When using the tclBCScript interface of namd for imposing additional forces on a classical molecular dynamics simulation, you may get the (undocumented) error message ------------- Processor 0 Exiting: Called CmiAbort ------------ Reason: FATAL ERROR: tclBCScript failed to call nextatom until failure Charm++ fatal error: FATAL ERROR: tclBCScript failed to call […]
programming
Sometimes, the list of entries on a single page gets very long. For quick navigation, you may either add a table of contents or collapse all content. In order to do so, add the following line to your layout.html template: {% set script_files = script_files + [pathto("_static/collapse.js", 1)] %} Now […]
Have you ever tried to spot a certain message in screens full of debugging output? Normally, you have a hard time scanning the text in order to find the output section you were looking for. Why not making the life easier for yourself (and your users) and start printing messages […]
If you’re not using autodoc, building a list of all your documented classes is not that straightforward. Unfortunately, sphinx does not offer any method to embed this list into your documentation. Below, you find a snippet that creates a sorted list of all classes. Here is what the result looks […]
Although usually it is helpful to define longer but explaining command line parameters, it will be tedious for users who work with this application very often to type out each and every parameter. Here is an example how to solve the problem for the python argparse module and choice options. […]
When using the todo extension of sphinx, I get lines like Todo: configureable random number generator (The original entry is located in /home/ferchault/svndir/colago/lib/colago.rst, line 322.) As the path itself may vary from machine to machine, the absolute path is rather pointless in this setup. Unfortunately, the extension itself has no […]
As I use the same jobfile for several jobs with only minor (sometimes automated) changes, I do not retain copies of the jobscripts submitted to slurm. For automated progress reports during runtime, I need to get at least some information of the jobfiles. As far as google told me, there […]
What about the following snippets? #include <iostream> using namespace std; // not necessarily true #define if(x) if(!x || x) int main(void) { int a = -2; if (false) cout << "should not enter this branch" << endl; if (++a) cout << "first: " << a << endl; if (--a) cout […]
Sometimes it is useful to calculate the area covered by ink for a given document e.g. when estimating the total printing costs. I played around with standard tools and to my knowledge the following way is the easiest yet simplest assuming that you are working on a linux machine. First […]
In case you have imagemagick installed, you may see a strange behavior: executing a python script overwrites your data without notice. This effect is due to the command line application import of imagemagick. When you pipe data to a python script the first command of which is import foobar you […]
As long as the recursion limit of your installation is not reached, you can flatten nested lists by using this function: def flatten(o): if isinstance(o, list): nonlist = [x for x in o if not isinstance(x, list)] listelems = [x for x in o if isinstance(x, list)] listelems = [flatten(x) […]
Usually, you can define an output file for stderr and stdout each in your jobfile. Even if you omit the command, the queueing system will do so. You can query the two filenames: $ qstat -f 124762.torque Job Id: 124762.torque [...] Error_Path = filehostname.example.com:/home/user/s-6.5-0.25_ 1.e124762 [...] Output_Path = filehostname.example.com:/home/user/s-6.5-0.25 _1.o124762 […]