A script that might improve your writing

Just like me, you may not be a native English speaker. However, publishing scientific documents often requires to write somewhat comprehensible English texts. Just like me, you might have some mistakes you make over and over again. When writiting my dissertation, I compiled a list of my “favourite” mistakes. Luckily most of them are so stupid that simple pattern matching suffices to find them. I wrote a small script and a “database” of my frequent errors to check my texts. Maybe this is useful for someone. I tried to include explanations and suggestions to make it easier to figure out why the script complains about something…

Continue reading

A quickie: watching 3D movies on a Philips TV (7000 line)

Recently, I was struggling a bit with our new Philips TV. It can do 3D and it can play *.avi and *.mkv movies but it seemed not to be able to play these in 3D even though they had the 3D information encoded (side by side).

After some fiddling, I found out: it works perfectly. The only thing that’s blocking the 3D feature is that the samples I tried were not in HD. Apparently the TV requires the source file to have a 1920×1080 resolution. Once you got the file in the right format, it works like a charm and you can enable the 3D feature via the on-screen menu.

Here is a quick command to re-encode a clip in the right resolution and in a format that the TV can definitely read:

$> mencoder 3d-sample-in.avi -vf scale=1920:1080 -o 3d-sampe-out.avi \\
   -oac mp3lame -ovc lavc -lavcopts vbitrate=2200

Mencoder is part of the mplayer software package. I have not optimized the above line for performance or size… using different encoder options may result in a much better result.

Color your shell – 1: colorful ls

colors for lsPreface:

This is a series of posts that explain how to get to a nicely colored shell by tweaking your .bahsrc.

I am aware that each of these hints has been discussed on the Internet forever. However, it took me a little while to get all into my .bashrc, so I hope this will be useful for someone.

Colorful directory listings (ls)

Getting color to ls is fairly easy. You basically just turn it on. However, depending on your OS, you may have to push different buttons to get it working.

Continue reading

Some words on malloc and memset

Some people seem to have a particular strategy when it comes to using malloc and memset. The strategy is simple:

Use malloc often, then memset everything. [don’t do this at home]

The bad thing about that strategy is that it leads to complex code and non-obvious bugs. The following mini-tutorial is based on some slides I prepared for a small tutorial for our students at RWTH Aachen University.

Continue reading

Filemerge / opendiff confuses me

This post is an attempt to remove my confusion when using opendiff AKA filemerge. Opendiff is a very handy and quick tool for visually comparing files. However, the way it visualizes the portions of two files that are to be merged into one keeps confusing me. The symbol is an arrow, However, I always wonder whether the direction of the arrow symbolizes the direction of the changes (text at the blunt edge of the arrow will survive) or if the pointed part of the arrow points at the text that will survive.

The message to me is:


Keep this in mind, Tobias!