Interesting Python factoid of the week

<br /> >>> def someFunc(someParam, someDict={}):<br /> ... someDict[someParam] = someParam<br /> ... print someDict<br /> ...<br /> >>> someFunc('hello1')<br /> {'hello1': 'hello1'}<br /> >>> someFunc('hello2')<br /> {'hello2': 'hello2', 'hello1': 'hello1'}<br /> >>> someFunc('hello3')<br /> {'hello2': 'hello2', 'hello3': 'hello3', 'hello1': 'hello1'}<br /> >>><br /> 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

Joe “Zonker” Brockmeier is an uncivilized barbarian

A while ago, I read this fluff piece about Python. As with most fluff pieces, it was quite inane, but our anthropologist wunderkind Joe “Zonker” Brockmeier succeeded in citing Guido van Rossum incorrectly as “Rossum” instead of “Van Rossum” no less than six different times. I went through the very tedious process of registering for a login at the offending site in order to post my thoughts in the talkback forum on this embarrassing faux pas.

Read More

Bruce Perens came down from the mountain

I have often heard the open source phenomenon (if you want to get pedantic with me about open source vs free software, start by blowing it out yer ass: I’m going to be pragmatic about it and use the two interchangably) compared to religion, but last night was the first time that I had this almost religious open source experience. In spite of all the grudges I have against organised religion, this experience was altogether quite a pleasant one.

The reason for this was the impressive oratorial performance of one Bruce Perens. Bruce is in town (namely The Netherlands) to speak to some important people so he generously took the time to speak to some of us humble hackers here as well. Click below to continue reading…

Read More

mv blog evolution

Paul just pointed this out: In Ximian Evolution, open your “Summary” window, Select “Tools|Settings” from the menubar, select the “News Feeds” tab under “Summary Preferences”, click on the “Add news feed” button and add this URL: http://cpbotha.net/weblogs/cpbotha/index.rdf Now select this feed from the left hand list and click on the “Add” button in the middle. Your Evolution summary window will now contain a live listing of my weblog. JOY! Get this URL from any Movable Type weblog by copying the “Syndicate this site (XML)” link.

Read More

My laptop

This is an AnandTech review of the Hypersonic Sonic Aviator 3.06GHz Pentium 4 laptop which is just another rebadge of the Clevo 5600. I bought mine (rebadged as a Promedion) a while back, but with a 2GHz P4 (Northwood) and a Radeon 7500 Mobility instead of a Radeon 9000 Mobility. In case you didn’t know, this laptop does Linux.

Read More

I rule

After a few minutes of Perl *ptooooey* hacking, I’ve re-elevated myself back to the super-user that I am. I now have authoring permissions over all blogs on this system and won’t be able to lose them again. If you’ve somehow lost authoring permissions on blogs in a Movable Type installation that you maintain, download and run this script. It will only work if you had permissions before and subsequently lost them.

Read More

Aaaarrgghhhh

I quote from the Movable Type Movable Type User Manual: AUTHORS AND PERMISSIONS: “You can edit your own authoring permissions by selecting your own name from the pulldown menu. Be careful when doing this, however, particularly with respect to turning off author-editing permissions for yourself. If you turn off your author-editing permissions, you will be unable to turn them back on.” I’ve gone and done this on all the blogs of the other users on my installation, so that I don’t get listed as author on the blogs that I don’t have anything to do with.

Read More