During the installation of calibre, I got this error: * Building of dev-python/cssselect-0.7.1 with CPython 3.2... python3.2 setup.py build -b build-3.2 running build running build_py creating build-3.2 creating build-3.2/lib creating build-3.2/lib/cssselect copying cssselect/parser.py -> build-3.2/lib/cssselect copying cssselect/xpath.py -> build-3.2/lib/cssselect copying cssselect/tests.py -> build-3.2/lib/cssselect copying cssselect/__init__.py -> build-3.2/lib/cssselect warning: build_py: byte-compiling […]
programming
Retrieving information on the possible frame rates for a given pixel format (RGB, YUYV, …) and a given frame size (640*480, …) using v4l2 should be simple. However, it took me some time to find the appropriate section in the documentation. In case you already have a file descriptor fd […]
A few days ago, I asked myself whether pop music is getting faster over time. In order to check this, I looked for the music tempo in beats per minute (BPM) for most of the billboard top ten since 1970 and calculated the average BPM over time. As you can […]
C++ has great features. And dangerous ones. Consider this piece of code: #include <iostream> using namespace std; #define sizeof(x) __LINE__*4 int main(void) { cout << sizeof(int) << endl; cout << sizeof(int) << endl; } This code is perfectly valid and prints 32 and 36. This error should be extremely hard […]
Today I was asked to calculate the Franck-Condon factors (FC) for nitrogen using the harmonic approximation. As I won’t go into physical details, here’s a two-sentence description: FC factors give a hint on relative intensities of radiation from a molecule and vary from 0 (no radiation) to 1 (quite high […]
Just another issue with svn-merge-repos.pl: # ~/dump/svn-merge-repos.pl -t total ghp:ghp latex:latex foobar:foobar tt:tt snafu:snafu code:code svn: Unable to open an ra_local session to URL svn: Local URL 'file://code' contains only a hostname, no path Died at /root/dump/svn-merge-repos.pl line 274. Although the documentation of the script itself uses relative paths, svn […]
While merging multiple subversion repositories with svn-merge-repos.pl, I got a rather strange error: svnadmin: File not found: transaction 'yyy', path 'xxx' The last command issued by the perl script was svnadmin dump --revision 86 --incremental '/srv/svn/foobar' | svndumpfilter include '/projects/foobar' | svnadmin load --parent-dir 'foobar' '/srv/svn/total' Apparently, the error is […]
There’s one caveat for iterating over xml.etree elements in python. Although the following code works on iterators – just like in C++ – the code sliently fails in checking consecutive children of the element being iterated over import xml.etree.ElementTree as ET xml = ET.parse('filename.xml') root = xml.getroot() for elem in […]
boost::program_options ist recht hilfreich, hat aber eine merkwürdige Standardformatierung bei der Ausgabe – hier ein Beispiel aus einer aktuellen Beta-Anwendung: Die Beschränkung von 80 Zeichen pro Zeile ist konservativ gewählt und nachvollziehbar, wenngleich nicht immer nötig. Darüberhinaus sind unterschiedliche Gruppen (options_description) unterschiedlich formatiert, was die ohnehin eingeschränkte Übersichtlichkeit nicht gerade […]
Wenn ich das Haus verlasse, schalte ich meistens die Rufumleitung auf mein Handy ein. Leider ist das über das Benutzerinterface der FRITZ!Box 7270 etwas zeitraubend. Lieber ist mir da ein shell-Kommando, das zusammen mit dem shutdown-Skript oder dem init-Skript ausgeführt werden kann. Die Quintessenz: man kann den ersten Eintrag der […]
Beim Erstellen einer Grafik mit matplotlib bin ich über die Problematik gestolpert, dass EPS nicht nur wegen der einschränkten Unterstützung unter Windows ein suboptimales Ausgabeformat zu sein scheint – es unterstützt keine Transparenzen: entweder man gibt den Vektorgrafik-Vorteil auf und begibt sich in die Niederungen des Rasterns von Bildern (gerade […]
Profiling ist trotz Anwendungen wie Valgrind auch in Verbindung mit kcachegrind nicht gerade einfach – insbesondere dann nicht, wenn Nebenläufigkeit eine Rolle spielt. In diesem Fall lohnt sich ein Blick auf Intel® VTune™ Amplifier XE 2013. Im Zusammenspiel mit C++-Anwendungen unter Linux kommt dann bei der Performance-Analyse stellenweise tatsächlich etwas […]