I have spent a far bit of time in the education system and I feel there is a great difference between knowledge and information. The internet is full of information, tons of small independent pieces of data. When you are at school you spend most of your time learning rules that you can reuse. Learning becomes the process of gluing your information together using the knowledge you have.
As a graduate student I feel that I create so much information and I never have enough time to study it.
Friday, 1 May 2015
Wednesday, 18 March 2015
Install eclipse plugins via the command line
I am always a fan of making features usable on the command line. I use Ubuntu a bunch and one task I started was to write a script to install all of may favourite packages I like. One of the packages I love it Eclipse. It gives me the same experience across operating systems. Has many features for many different programming languages.
I asked myself today "I wonder if I can install eclipse plugins on the command line?" The amount of plugins I like to have installed in eclipse is numerous. From PyDev to SubClipse to CDT. Having to go in and select all of these each time is time consuming. As well having to add in the new repos for plugins outside of the standard version repo was also annoying. It turns out you can very easily install eclipse plugins with the command line
The Basic syntax is
To find the plugin names in eclipse to go Help -> Install New Software -> Select a repo -> select a plugin -> go to More -> General Information -> Identifier;
Here is an example list of command in a script that installed many of the features I use.
Best of luck.
References:
I asked myself today "I wonder if I can install eclipse plugins on the command line?" The amount of plugins I like to have installed in eclipse is numerous. From PyDev to SubClipse to CDT. Having to go in and select all of these each time is time consuming. As well having to add in the new repos for plugins outside of the standard version repo was also annoying. It turns out you can very easily install eclipse plugins with the command line
The Basic syntax is
eclipse -application org.eclipse.equinox.p2.director -repository < repo_link > -installIU < plugin >
To find the plugin names in eclipse to go Help -> Install New Software -> Select a repo -> select a plugin -> go to More -> General Information -> Identifier;
Here is an example list of command in a script that installed many of the features I use.
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.cdt.feature.group/
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.egit.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.cdt.sdk.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.linuxtools.cdt.libhover.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.wst.xml_ui.feature.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.wst.web_ui.feature.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.wst.jsdt.feature.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.php.sdk.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.rap.tooling.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.linuxtools.cdt.libhover.devhelp.feature.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.linuxtools.valgrind.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/releases/juno/ -installIU org.eclipse.egit.feature.group
#Subclipse
eclipse -application org.eclipse.equinox.p2.director -repository http://subclipse.tigris.org/update_1.10.x -installIU org.tigris.subversion.subclipse.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://subclipse.tigris.org/update_1.10.x -installIU SVNKit
#PyDev
eclipse -application org.eclipse.equinox.p2.director -repository http://pydev.org/updates -installIU org.python.pydev.feature.feature.group
eclipse -application org.eclipse.equinox.p2.director -repository http://pydev.org/updates -installIU org.python.pydev.mylyn.feature.feature.group
Best of luck.
References:
- http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fupdate_standalone.html
Monday, 9 March 2015
Crowd Simulation Lecture
I recently gave a lecture on Crowd simulation. This lecture outlines some of the popular steering algorithms and then some of my work on making them even better via parameter optimization. You can find the presentation here.
Take care.
Take care.
Sunday, 21 December 2014
High Resolution performance timer
I recently stumbled across this issue because I was trying to compile some code on an ARM based computer. There was code in the program I wanted to compile that uses assembly! I am not going to get into the details over which method might be faster or has higher resolution. From what I have learned this is the most compact and portable code to use if you want a high resolution counter that can be used for something like performance profiling.
This was the original code that was causing the issue. This code depends on the x86 instruction set.
Thanks to improvements on the POSIX based
Best of luck.
References:
This was the original code that was causing the issue. This code depends on the x86 instruction set.
#ifdef _WIN32
unsigned long long tick;
QueryPerformanceCounter((LARGE_INTEGER *)&tick); // works great on Windows ONLY
return tick;
#else
uint32_t hi, lo;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi)); // Works well on x86 only
return ( (uint64_t)lo)|( (uint64_t)hi)<< 32 );
#endif
Thanks to improvements on the POSIX based
int clock_gettime(clockid_t clk_id, struct timespec *tp);
We can replace our not portable assembly code for our easy to use clock_gettime code like so
#ifdef _WIN32
unsigned long long tick;
QueryPerformanceCounter((LARGE_INTEGER *)&tick); // works great on Windows ONLY
return tick;
#else
timespec timeInfo;
clock_gettime(CLOCK_MONOTONIC_RAW, &timeInfo); // nanosecond resolution
unsigned long long int nanosecs = ((unsigned long long)timeInfo.tv_sec)*1000000000 +
((unsigned long long)timeInfo.tv_nsec);
return nanosecs;
#endif
Best of luck.
References:
- http://man7.org/linux/man-pages/man2/clock_gettime.2.html
- http://tdistler.com/2010/06/27/high-performance-timing-on-linux-windows
- http://en.wikipedia.org/wiki/High_Precision_Event_Timer
Sunday, 12 October 2014
Mesh Subdivision with the Loop Algorithm
Recently I have been learning more about Polygonal meshes and operations you can perform on them. One of the first operations that can be done on a mesh, that is a kind of cool, is subdivision. The basic idea is that you have a mesh that is very course (few polygons, rough) and we want a method that can construct a smoother mesh from this course mesh. This has been a popular method for constructing extremely smooth meshes for movies for many years.
This is an example very course mesh of a Camel. This mesh was not constructed this way by chance. An artist spent many hours adjusting verticies (points) and faces (polygons or triangles) on this mesh in order for subdivision to work well.
The Loop algorithm is a popular algorithm to perform mesh subdivision. One reason for its popularity is that it ensures that after subdivision the mesh is C2 continuous (smooth second derivative on surface) everywhere on the mesh except for at extreme points.
After lots of careful thought I decided to implement the algorithm in 3 steps.
original mesh
After one subdivision
After two
After three
final mesh
Camel mesh after simplifaction
References:
This is an example very course mesh of a Camel. This mesh was not constructed this way by chance. An artist spent many hours adjusting verticies (points) and faces (polygons or triangles) on this mesh in order for subdivision to work well.
The Loop algorithm is a popular algorithm to perform mesh subdivision. One reason for its popularity is that it ensures that after subdivision the mesh is C2 continuous (smooth second derivative on surface) everywhere on the mesh except for at extreme points.
After lots of careful thought I decided to implement the algorithm in 3 steps.
- Add all of the new verticies for the mesh (easy)
- Take every edge and add a new point between the two points that define the edge
- Construct/fix all of the polygons in the mesh (not so easy)
- Add edges between all of the new points and update the face/polygon labels for these edges
- Most bugs came from this step
- Compute the new positions of the verticies on a copy of the mesh from 2 (almost easy)
- Simply use the old mesh to compute all of the neighbours for old points.
- Computed the weighted sum of positions from neighbours and selected point (See loop Algorithm) and assign this position on the mesh copy
- For new points I used the new mesh to get the neighbours of each new point that was in the old mesh
- Last I had to run a query to get the edge between the points from (3). This got me the edge I should use to find the last two neighbour points for the Loop Algorithm
original mesh
After one subdivision
After two
After three
final mesh
Camel mesh after simplifaction
References:
- http://www.cs.ubc.ca/labs/imager/tr/2014/CartelModeling/Cartel_website/
- https://www.graphics.rwth-aachen.de/media/papers/sqrt31.pdf
- http://research.microsoft.com/en-us/um/people/cloop/thesis.pdf
Saturday, 6 September 2014
Install SciPy on Mac OS
Way to many versions of python on Mac OS, but this seems to work.
Intstall homebrew
install gfortran
brew install gfortran
or
brew install gcc
sudo easy_install scipy
References
- http://urinieto.com/2012/02/install-python-2-7-x-under-snow-leopard-lion-64-bits/
- http://stackoverflow.com/questions/11517164/scipy-numpy-matplotlib-troubles-on-osx
- http://brew.sh/
- http://docs.scipy.org/doc/numpy/user/install.html
Thursday, 14 August 2014
Spelling and Grammar Checking for Latex
One of the hurdles of starting to use Latex for document creation after getting used to Word is "is there spelling AND grammar checking?" I am happy to say there is a solution to this problem.
There are a few Latex editors already that have support for spell checking but grammar checking is another issue all together. In this post I am going to give a quick guide on a great Latex editor and how you can add grammar checking as well.
TexStudio is becoming a very popular latex editor. It works across many platforms including Windows, Linux and Mac. TexStudio also has built in support for being able to compile and display the document being worked on.
LangaugeTool is a very interesting tool that can be used as stand alone grammar checker. It works as a server on your computer and any system can send HTTP requests to it to ask if there are any grammar issues.
Here are the steps to get everything setup:
As a side note you can easily grab more spelling dictionaries for TexStudio.
Best of Luck.
References
There are a few Latex editors already that have support for spell checking but grammar checking is another issue all together. In this post I am going to give a quick guide on a great Latex editor and how you can add grammar checking as well.
TexStudio is becoming a very popular latex editor. It works across many platforms including Windows, Linux and Mac. TexStudio also has built in support for being able to compile and display the document being worked on.
LangaugeTool is a very interesting tool that can be used as stand alone grammar checker. It works as a server on your computer and any system can send HTTP requests to it to ask if there are any grammar issues.
Here are the steps to get everything setup:
- Download the version of TexStudio that will work for your operating system.
- Install TexStudio
- Download LangaugeTool. It uses java so you will need Java available on you computer already.
- Unpack Language tool into some directory
- In TexStudio Configure TXS first, by using Options > Configure TexStudio… > Grammar like this:
- If TexStudio is configured to use inline grammar checking (which is the default, see Options > Configure TexStudio… > Editor > Inline Checking > Grammar), you should see grammar checks immediately:
- After setting this up you should automatically start seeing grammer highlighting in your documents.
As a side note you can easily grab more spelling dictionaries for TexStudio.
Best of Luck.
References
- http://wiki.languagetool.org/checking-la-tex-with-languagetool#toc4
Subscribe to:
Posts (Atom)