Emacs Python folding fixed

By making use of the outline minor mode of Emacs, one can do Python code folding. However, it seems MOST of the available .emacs examples illustrating this are broken, as you’ll find if you try to use them on any Python code longer than three lines. Here is a correct example, thanks to me and goof.

Read More

I’m afraid of Americans

Paul links to this CNN article from his weblog. I thought it was so ridiculous that I would link to it too. In short: a man dares to wear “Give Peace a Chance” T-shirt in an American mall, is told by two security guards to remove the shirt or leave the mall, refuses to do so and is consequently arrested. Don’t forgot to read some of the comments on my previous posting.

Read More

From the horse’s mouth

Here is a very interesting excerpt from a speech by Major General Smedley Butler (USMC). You can read the whole thing (the excerpt is quite short), but this paragraph just about sums it up for me: I helped make Mexico, especially Tampico, safe for American oil interests in 1914. I helped make Haiti and Cuba a decent place for the National City Bank boys to collect revenues in. I helped in the raping of half a dozen Central American republics for the benefits of Wall Street.

Read More

Odd bits

This link has some very interesting tidbits that could help you to speed up your Python code. In other news, I’ve updated the binary Radeon DRI suspend/resume-capable drivers on my dri_resume page.

Read More

F*ck off Murphy

As I was slaving away at my trusty Linux workstation today, the 30G IBM DTLA 307030 IDE hard drive started making extremely upsetting noises. These are not the kind of noises one expects from a smoothly operating hard-drive, but rather from some mechanical device in the throes of a messy death. Yes, this is one of those IBM hard drives and Paul confirmed that it was exactly this noise that his IBM hard drive made shortly before it went to heaven…

Read More

Euphemisms ‘R Us

This is probably the most elegant euphemism I’ve heard in a very long time: “Wat de geachte afgevaardigde daar zegt staat op gespannen voet met de werkelijkheid.” which is short for “Hij LIEGT!”. Vive l’Hollandais!

Read More

Interesting Python factoid of the week

>>> def someFunc(someParam, someDict={}): ... someDict[someParam] = someParam ... print someDict ... >>> someFunc('hello1') {'hello1': 'hello1'} >>> someFunc('hello2') {'hello2': 'hello2', 'hello1': 'hello1'} >>> someFunc('hello3') {'hello2': 'hello2', 'hello3': 'hello3', 'hello1': 'hello1'} >>> The moral of this story is: be careful when using default parameters for dictionaries, lists and such like. One could be forgiven for thinking that the default parameter gets initialised with every invocation, but that is clearly not the case.

Read More

I rule

I spend quite a chunk of my time hacking on VTK (the Visualization ToolKit), one of the better examples of open source. I’m particularly proud of the fix I made today though, as it’s quite deep in the VTK object hierarchy. Shows you how much it can help to construct an isolated test case that breaks something before you start debugging. First I present the problem along with my test case (I ran into the problem whilst hacking on large GUI+VTK project) and then, after considerable amounts of Rooibos tea, the solution.

Read More

I R ekstreem chess playir.

In order to try and improve my pitiful Chess abilities, I’ve started playing online chess-by-email games via RedHotPawn. If you would like an ego boost, get yourself an account and challenge me. It shouldn’t take you more than a few moves to take my king out. My login is, you guessed it, “cpbotha”.

Read More

The Linux-running Entertainment PC that I can’t afford right now

EUR166 for a Via EPIA C3 800, EUR110 for a Starex Mini-ITX case, EUR55 for 256MB of PC133 SDRAM, EUR57 for a LiteOn 16x48x DVD/CD-ROM, EUR115 for a Western Digital 80GB HDD and EUR50 for miscellaneous expenses brings me to the grand (and currently unaffordable) total of EUR553. Maybe I should rather upgrade my home network infrastructure with a new 100Mbit/s switch and wait a few years until the components above are available for a song.

Read More