Python Recipe: Read CSV/TSV Textfiles and Ignore Comment-lines

Scientific data commonly comes in tab-separated textfile format containing comment lines. What is the best way to read this data? Analogous to the recipe given by skip.montanaro, use a commented file decorator as follows:
import sys, re
import csv
class CommentedFile:
def __init__(self, f, commentstring=”#”):
self.f = f
[...]

A Reload-Button in Adobe Acrobat

Read this post about how to reload your pdf document. This is particularly useful when you are creating a new document with LaTeX. Sweet, I was waiting for that functionality.

Use the new Emacs Daemon!

Emacs usually takes quite some time to fully start up. However, as described in the great blog Emacs-Fu, Emacs 23 can now be started in the background as a daemon. This allows to fire up a new Emacs instance really fast. Thanks djcb!

Print Particular Lines of a File Using SED

Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you
sed -n -e ‘3p’ -e ‘5p’ -e ‘11,15p’ textfile.txt

Anycom Bluetooth USB Adapter on Windows 7

For the first time I could personally sense the effects of the economic crisis. The manufacturer of my Bluetooth device ANYCOM USB-200, the Germany-based ITM Technology AG is insolvent. Immediate effect for customers like me: No more driver updates and their general unavailability on the homepage.
Here is the good news for everybody who wants to [...]

Working with a List of Tuples in Shell Scripting

Several people have recently asked me whether or not it is possible to use tuples in their shell script. One example is running a program with a varying set of parameters. Since they often did not find a good solution, they began to formulate their problem in a higher-level scripting language like Ruby. Surprisingly, you [...]

Inline Figures in Org-Mode Paper Drafts

Writing a paper often comes along with a problem known as information fragmentation: figures, tables and the respective data sources related to the paper certainly are somewhere on your hard disk – but where? How did I name the file with the data-points again? And, the heck, which commands did I use to create that [...]

List Only Subdirectories for Shell Scripting

I like to have the following snippet in my .zshrc (or .bashrc) for convenience
alias lsd=”ls -l|awk ‘/^d/ {print \$9}’”
It displays all subdirectories underneath the current directory. The goodness in this variant is that it gives you the pure names and that you can use it in loops without hassle :
for d in `lsd`; do
mv $d/resultfile.dat [...]

Finding out where your Program Crashes with the Emacs GUD

This post describes a very, very elementary debugging skill. Yet, I could not find any concise tutorial about it on the web. So, here we go!
Assume you’re developing a small software under Linux, maybe using C or C++ and the GCC compiler. Testing your program, you find that it crashes with an error (segfault, assertion, [...]

Economic Crisis coming faster than Great Depression

Since weeks  the media is reporting about the severity of the current economic crisis, comparing it with the Great Depression (GD) that began 1929. However, to me this seemed like a historic exaggeration since I couldn’t really rediscover the severe effects of the GD in the current crisis. However, I now found some figures that [...]