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 […]
programming
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 […]
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 […]
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 […]
Adding the values from two lists in a pairwise fashion is a rather common programming issue in the daily data processing routine. As python is not known to be the very best basis for high throughput calculations, one should know python’s limits. Starting from the following script, #!/usr/bin/env python l1 […]
By default, the TabbedPanel uses a GridLayout with the restriction of one row and 99 columns for the headers. This should be sufficient for most applications. However, it is more common to add a second row for the tabbed headers instead of trying to fit them all into one single […]
Have you ever wondered when the fireworks actually start and how long people remain busy? Yes, everybody is making fun of those who cannot wait until midnight. But most of the people are getting it right: Or the more interesting part: My notebook has pulled an all-nighter to record the […]
Once again, portage is unhappy and complains about this command tunix calibre # g++ -O2 -march=native -pipe -fPIC -O2 -march=native -pipe -pthread -I/usr/include/python2.7 -I/usr/include -I/usr/include/podofo -c /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/output.cpp -o /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/build/objects/podofo/output.o In file included from /usr/include/podofo/podofo-base.h:27:0, from /usr/include/podofo/podofo.h:34, from /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/global.h:14, from /var/tmp/portage/app-text/calibre-0.9.6/work/calibre/src/calibre/utils/podofo/output.cpp:8: /usr/include/podofo/base/PdfDefines.h:66:28: fatal error: boost/config.hpp: No such file or directory compilation […]