Navigation

home code debian images resume weblog wiki

Older news:

Feb 18, 2005:
Mixing whitespace
Jan 10, 2005:
The difference between dogs and cats
Dec 22, 2004:
Sunrise in winter
Dec 12, 2004:
New site layout
Winter in Rotterdam
Cyprus (November 2004)
Nov 26, 2004:
Python decorators

Browse:


Dutch programming contest/programming

Posted on 2003-10-27 by ivo :: /programming :: link

Last weekend, I participated in the Dutch rounds of the InterCollegiate Programming Contest (ICPC). Since we ended on the highest place of all teams from Delft, we can continue to the Northwest European finals (NWERC), in Lund, Sweden. The final score list lists our team (ECFh) on the sixth place, but Quintiq and ASML are companies, so they don't count on the score list for students.

While this is good news in general, it is weird. Instead of sending the top-10 teams to the NWERC, the top-x teams from each university are admitted. I'm not fully familiar with the rules and regulations of the admission policy, but this strategy seems flawed.

The problem set was horrible. The problems were written very badly, with clear errors and very vague wording. The examples weren't really supporting the text, and sometimes a restriction was only given in the explanation for the example input/output.

I realize it's not easy to write a clear, challenging problem set, that still leaves enough pitfalls to make it interesting. But please, don't clutter the goal of these contests with weird requirements. For example, there was a problem in which the input was given in Roman numerals. The problem was hard enough to do in decimal numbers, the Roman numerals just make it harder to verify input and output. I don't think that this added value to that particular problem.

Dogville/movies

Posted on 2003-10-24 by ivo :: /movies :: link

Dogville, by Lars von Trier is an interesting movie. It is divided in nine acts and one prologue, each introduced with a title screen that shows what will happen in that act.

The main thing about this movie that critics seem to be pointing out continuously is that the entire movie is shot on a set with virtually no attributes, except a few desks, beds and cars. I didn't think it was irritating at all. In fact, it seemed to put emphasis on the fact that Grace is a newcomer, she can't see through these walls. The people from Dogville appear to be able to do so, even though this is not stressed very much.

The entire movie has the feel of a classic movie from the 1920s, but it is much more vivid, events happen much faster. Despite this, the movie is still almost three hours long. It was able to keep my attention throughout all of it.

The scenes are sometimes accompanied by a male voice over, outlining some of the things that can't be seen. The events displayed in the second half of the movie are pretty gruesome, but the narrator keeps the same, slightly cynic tone throughout it all.

The role of Tom Edison isn't entirely clear. I don't know if his actions were inspired by a cunning plan meant to abuse Grace in all her vulnerability, or if he acted out of an ignorant naivety, with nothing but the best intentions that just didn't work out as well as he had hoped. I'm not sure if Grace saw Tom's real intentions either. The ending seemed to suggest she did, which would also mean that Tom was acting out of cruelty more than ignorance.

The end is surprising, to say the least. Von Trier appears to want to say that anything that happens in or comes out of America is bad. But if you assume that people really are the same everywhere, he appears to be disapproving of human nature. During the movie, I was constantly thinking about which way it would end. I thought of a lot of possible endings, including the one Von Trier chose. But when it was over, I was left insatisfied, feeling that the end wasn't appropriate somehow. On the other hand, I don't think that any of the other endings I thought of would have been better.

I still feel dissatisfied with it, partially because Von Trier leaves some things implicit, and I am sure that everybody who goes to see this movie has his or her own interpretation of what is happening, what Von Trier tried to tell and whether it applied to all of us, or just America and its inhabitants.

Machinae Supremacy: Attack music/quotes

Posted on 2003-10-23 by ivo :: /quotes :: link

What we learn is never free / we walk with evil
But in bliss we tend to be / so forgetful

You won't see it crawling back / just out of nowhere
And finally when they attack / they've always been here

Commonly confused characters/programming

Posted on 2003-10-22 by ivo :: /programming :: link

When looking for the html entity for an ellipsis (), I came across this page. It shows the difference between the different apostrophes, double quotes, dashes and spaces. For each different character, the author lists how to create the character in UTF-8, HTML, LaTeX.

The page is a good read, even if you already know the difference.

Why sed rules/programming

Posted on 2003-10-22 by ivo :: /programming :: link

Or: why you should use perl when you notice that your sed expression is becoming far too complicated.

sed -e 's/^\([0-9]\+\);--;\([0-9]\+\);\([0-9]\+\);;\([0-9]\+\);--;\([0-9
]\+\);\([0-9]\+\);;\([0-9]\+\);--;\([0-9]\+\);\([0-9]\+\);;/pa=\1-\2\&za
=\3\&pb=\4-\5\&zb=\6\&pc=\7-\8\&zc=\9;/g' -e 's/zc=\([0-9]\+\);\([0-9]*\
);-\?-\?;\([0-9]*\);\([0-9]*\)/zc=\1\&pd=\2-\3\&zd=\4/g' | sed -e '=' |
sed -e 's/^/+/;N;s/^+\([0-9]\+\)\n/\1 /' | sed -e 's/^\([0-9]\+\) pa=\([
0-9]\+-[0-9]\+\)&za=\([0-9]\+\)&pb=\([0-9]\+-[0-9]\+\)&zb=\([0-9]\+\)&pc
=\([0-9]\+-[0-9]\+\)&zc=\([0-9]\+\)&pd=\([0-9]*-[0-9]*\)&zd=\([0-9]*\)$/
pa\1=\2\&za\1=\3\&pb\1=\4\&zb\1=\5\&pc\1=\6\&zc\1=\7\&pd\1=\8\&zd\1=\9/g
' | tr '&' '\n'

The first thing I ran into is that sed only handles nine backreferences. I should have switched then, but I was stubborn and managed to do it anyway using the trick of running sed twice on the same line.

I should have switched to perl or python or whatever else, but I almost had it working... until line numbers had to be added. I found an example in the info page, using the = and N commands. It worked, but since they had to be inserted in each line in the output, another nasty regular expression emerged.

It worked, and luckily the input wasn't too big, but I really should have done this in perl right from the start, like I usually do…

Japanese Calligraphy/japanese/calligraphy

Posted on 2003-10-22 by ivo :: /japanese/calligraphy :: link

I have recently become interested in Japanese calligraphy. I have even bought my own brush, 筆 (fude). http://www.takase.com/ has a few good examples of what I hope to achieve eventually :)

http://www.japan-guide.com/e/e2095.html seems to be aimed mostly at selling books, but it has a few words on the basic terminology.

A site which has some good examples of Chinese calligraphy from the past: http://www.chinapage.com/callig1.html.