The qhull library has a central point with a few samples to start from when you want to use it in your code. Most interestingly, the developers invite you to call the qconvex program as an external application in case you want to calculate the convex hull of a point […]
Blog
In some cases, you may want to make your documentation available online. Personally, I don’t like building the documentation at three places: in the office, on my notebook and on my machine at home. Hence, I played around with subversion. Here is the post-commit hook: #!/bin/sh DIR=$(mktemp --directory) REPOS="$1" TXN="$2" […]
When using doxygen together with sphinx via breathe, you may encounter this error Exception occurred: File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 207, in parseFile parser.Parse(buffer, 0) ExpatError: not well-formed (invalid token): line 963, column 201 It took me some time to figure out what the error behind this message is supposed to be. […]
Usually, python tracebacks look like this To me, this output is hard to follow. Here is what I like more… … and how to get this for your code import sys, traceback, math def fsexcept(exc_type, exc_value, exc_traceback): frames = traceback.extract_tb(exc_traceback) framewidth = int(math.ceil(math.log(len(frames))/math.log(10))) filewidth = 0 linewidth = 0 functionwidth […]
As I use the same console for editing source code and commiting to svn, I accidently may issue a commit when using the bash history feature. In order to avoid this issue, I wanted to keep all svn commands from being recorded in the bash history. Add the following lines […]
Today, a colleague of mine came up with this problem Between the two groupplots, there is a additional label [K] which he liked to get rid of. The relevant source part was \begin{groupplot}[ y unit=K ] \nextgroupplot \addplot coordinates { % snip }; \nextgroupplot \addplot coordinates { % snip }; […]
Although scanned images tend to be quite large, books mostly consist of text. Hence, monochrome representations are still legible. Unfortunately, it can be tricky to get a small PDF from your input file. Here is (one) easy way to do it: gs -sDEVICE=pnggray -dNOPAUSE -dQUIET -r120 -sOutputFile=data/m%d.png inputfile.ps Yes, there […]
Well, the task is neither new nor unsolved. I was particularly interested in the fancy possibility to use a map container for binary search. Of course, boost offers better (read: faster and shorter) ways. Both of them can be implemented in a few lines. #include <map> #include <boost/random.hpp> #define CHOICES […]
After a recent update to mendeleydesktop 1.8, I got some annoying error messages: $ mendeleydesktop Using bundled Qt version 4.6 because no system Qt version was found Running /opt/mendeleydesktop/bin/..//lib/mendeleydesktop/libexec/mendeleydesktop.i486 /opt/mendeleydesktop/bin/..//lib/mendeleydesktop/libexec/mendeleydesktop.i486: error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory If you see this […]
For the lecture on Advanced Atomic and Molecular Physics by Prof. Dr. Ionela Radu, I created a reference sheet as exam preparation. You may download the high-res PDF version here.
In general, okular stores the annotations in a XML file somewhere in your .kde-folder. Although you may export the annotations together with the relevant file using the so called document archive, this does not help in case you want to print the decorations or in case you want to pass […]
There is a quite simple file format in order to store atom positions. The text based format can hold single conformations or multiple frames in order to keep track of conformational changes. Although parsing of text based files is considered an easy task, speed might get important if you scan […]