- Get yourself a copy of Qt Creator and SDK from Nokia.
- Download the SPIM source code. Probably the easiest thing is to install subversion and check the code out:
svn co https://spimsimulator.svn.sourceforge.net/svnroot/spimsimulator spimsimulator
This creates a directory namedspimsimulator. You can also download the tarball at that site and unpack it. - In QtCreator open the project by opening the file
spimsimulator/QtSpim/QtSpim.pro - Build a release version of the project in Qt Creator (self explanatory)
- The executable is sitting in
QtSpim-build-desktop/QtSpim. QtSpimuses two shared libraries from the Qt SDK. These arelibQtGui.so.4andlibQtCore.so.4. Be careful, both of these are probably just links to the real shared objects sitting in the same directory.-
In my case I needed to distribute the executable and the two shared libraries to a lab so I copied them to
a global place (in my case
/usr/localon each machine). I also wrote a simple script to setLD_LIBRARY_PATHto pick up the correct Qt libraries and execute the QtSpim executable. The other option is have users manually setLD_LIBRARY_PATHin their.bashrc.
Thursday, December 29, 2011
Building QtSpim
Tuesday, December 27, 2011
Installing eclipse plugins for multiple users
These notes are primarily for myself because I can never freaking remember how to do this and I always lose my handwritten chicken scratch. If you happen to run across them and find them useful, then cool.
When an eclipse user installs plugins through Help → Install New Software
it puts the plugins in the user's local hierarchy. I had recently
installed PDT, the PHP Development Toolkit for a single user and wanted to distribute it to a lab environment for multiple users.
-
Fire up eclipse and make sure a valid repository is set at
Window → Preferences → Install/Update → Available Software Sites
Since I am running 3.7 (Indigo) I set it tohttp://download.eclipse.org/releases/indigo
- In the eclipse GUI install the plugin you want as a single user. For me this was
Help → Install New Software → Programming Languages → PHP Development Tools
- Eclipse installs plugins in two directories
featuresandpluginsat~/.eclipse/org.eclipse.yaddayadda/whereyaddayaddais some version specific string. For me this wasplatform_3.7.0_185596441. -
Go to that directory (the parent of
featuresandplugins) and tar/gzip them uptar cf plugins.tar features plugins; gzip plugins.tar
- Distribute the file
plugins.tar.gzto each machine or put it in a shared location. I put it in my web hierarchy and did awgetfrom each machine using clusterssh. -
Unzip it
tar xzvf plugins.tar.gz
- Copy the contents of each folder to the location where eclipse is installed. For me this is
in
/usr/local/eclipse/and thenfeaturesandplugins. For me this wassudo cp -r features/* /usr/local/eclipse/features/ sudo cp -r plugins/* /usr/local/eclipse/plugins/
-
Make sure permissions are read for everyone. So I had to
sudo chmod -R o+r *
inside of the sharedfeaturesandpluginsdirectories.
Friday, December 2, 2011
MathJax in Blogger
Playing around getting MathJax to work in blogger. Below is the spherical law of cosines. It was getting cut off at the right so I had to break it up into two pieces. A bit ugly.
\[ d = \cos^{-1}(\sin(lat_1)\sin(lat_2) + \] \[ \cos(lat_1)\cos(lat_2)\cos(lon_2-lon_1))R \]And some other mess that I got from here. \[ z \left( 1 \ +\ \sqrt{\omega_{i+1} + \zeta -\frac{x+1}{\Theta +1} y + 1} \ \right) \ \ \ =\ \ \ 1 \]
And this is from the MathJax main page.
\[ J_\alpha(x) = \sum_{m=0}^\infty \frac{(-1)^m}{m! \, \Gamma(m + \alpha + 1)}{\left({\frac{x}{2}}\right)}^{2 m + \alpha} \]So I think we can say it works. Right click on any equation and Show Source to see the LaTex.
So to use MathJax in a blog post you need to edit a post as HTML and insert the Javascript below.
<script src="http://cdn.mathjax.org/mathjax/1.1-latest/MathJax.js">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
});
</script>
Now add LaTex equations in your HTML using \[ latex-equation \].