Sunday, May 26, 2013

cython wraparound problems

For performance reasons I was including the line

#cython: wraparound=False

in most of my Cython files. After an update to a newer versions of Cython (0.19) my Cython scripts started to crash. It took me some time to find out that combined with the wraparound=False line you cannot use [-1] as the index for the last element anymore (this is also written somewhere in the Cython documentation).

Saturday, May 18, 2013

Allowing only a single instance of a program to open using Qt

Many text editors open a new tab and not a new editor window when a second (etc. etc.) document is opened. For my program that displays curves of simulation results I wanted to have similar behaviour. This program is written in Qt using Qwt (also see this earlier post). This program already supports drag and drop and file association (i.e. double clicking on a file to open it with this program). To prevent a second program from opening when a second file associated with this program is double clicked I only had to follow this example.