It’s always been a painful task, trying to fill in all the bibtex-fields when adding a new source to your LaTeX-document. www.CiteULike.org simplifies this by allowing you to search the scientific publications in its database and exporting as bibtex.
That search engine can be a real time saver when trying to find your sources in BibTex-format. They also offer registred members a library of their own which they can export very easily. This has changed the way I work when writing reports. As soon as I want to cite some paper, a quick search for it on CiteULike adds it to my library. The entire library can then be exported as a bibtex-document which is perfect. What is not so good is that they add a lot of extra information.
But, that’s why I have a python-script which downloads my current library, filters out unwanted fields in the bibtex-file and saves as a file. For each LaTeX-document I write, I always point the bibliography to the same file and voilá.
updateReferences.py (Adjust the three variables in the beginning to your environment and needs).
The next step would be to automatically call this updateReferences-script when bibtex is run…

Posted in Programming, Tips | No Comments »
When I started Matlab 2009b on my new install of Ubuntu Lucid Lynx (10.04) I had the problem that some keys weren’t working. Most notably, the [] didn’t work which is quite bad when writing Matlab-code. Also, the terminal outputs this message:
Warning: X does not support locale en_HK.utf8
The problem is that the locale is set to utf8 (small caps) while Matlab requires UTF-8. By specifying the locale before we start Matlab we solve the problem.
Remove the symbolic link to matlab in /usr/local/bin/matlab with
sudo rm /usr/local/bin/matlab
and create a script in its place:
sudo gedit /usr/local/bin/matlab:
and paste this as it’s content:
#!/bin/bash
# Start Matlab with the right encoding
echo “Starting Matlab with en_HK.UTF-8 coding”
LC_CTYPE=”en_HK.UTF-8″ /usr/local/Matlab2009b/bin/matlab
where you change en_HK to something that seems appropriate and is part of the list produced by locale -a. My Matlab is installed in /usr/local/Matlab2009b/.
Posted in Programming, Tips | 2 Comments »
I found this widget for Wordpress which displays Twitter updates at http://seanys.com/2007/10/12/twitter-wordpress-widget/ . Simple and easy to understand it really applies the “Keep It Simple, Stupid”-rule.
I like it but according to Twitter there is an optimization you preferably should do. If the twitter servers are overloaded, this widget might halt the loading of ones blog since it tries to fetch the twitter status in the middle of the page building.
So, in a few minutes I read and understood the basics of wordpress plugins (that’s an achievement of Wordpress, making it that simple) and modified the widget. All in all I think I added 5 lines of code.
Twitter widget modified for speed
This plugin is installed by putting it in the usual plugins directory and adding it as a widget.
Addendum: I haven’t tried this widget for Wordpress 3.x. Has anyone else tried?
Posted in Programming | 3 Comments »

Three dimensional forest
As my bachelor thesis, I finally chose the task of measuring individual trees from three dimensional images of a forest, generated by a helicopter equipped with a laser. The raw data was already generated for us so the work consisted mainly of image processing of this data.
The first and crucial part was, of course, to actually find the trees in the forest. The four of us split and implemented two such algorithms in parallell. I was part of implementing an advanced pattern recognition algorithm called Multiscale Isotropic Matched Filtering invented a few years earlier.
Both methods performed well but unfortunately the other algorithm, which was very simple and intuitive in contrast to ours, found more trees.
With the detected trees it was possible to compare our findings to data from ground measurements. With this knowledge it was possible to estimate the relationship between tree height and diameter for example and the tree biomass. The final goal was to get a good estimate of the total biomass in an area. The simple method overestimated the biomass with only 8% and was very accurate.
Anyway, it’s been a rather fun project and I find the area of image processing and pattern analysis very interesting.
Downlod Bachelor thesis report
Posted in Chalmers, Programming | 4 Comments »
Tank vs Aliens, or Tava, is a project I tend to take up when feeling overwhelmed by the studies. 2004 I released a similar game made with Game Maker. The game is a bit special because you are faced with alot of enemies at the same time. The basic goal is to kill all the aliens with your tank and bomb-dropping airplanes.
We’ll see if I ever finish it
Tags: c++, opengl, Tava
Posted in Programming | 1 Comment »