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:


Mixing whitespace/programming

Posted on 2005-02-18 by ivo :: /programming :: link

The following emacs lisp code visually marks all initial whitespace that mixes both tabs and spaces on the same line:

;; Highlight dangerous whitespace mixing
(defface invalid-whitespace-face
  '((t (:background "red")))
  "Used in programming modes for marking mixed tabs
and spaces.")

(mapcar (lambda (mode)
          (font-lock-add-keywords
           mode
           '(("^\\(\t+ \\| +\t\\)\\s-*" 0
              'invalid-whitespace-face))))
        '(c-mode python-mode ...))

Just add a list of modes for which you want to activate this warning.

The difference between dogs and cats/

Posted on 2005-01-10 by ivo :: / :: link

Excerpts from a dog's diary

Day number 180

8:00 amOH BOY! DOG FOOD! MY FAVORITE!
9:30 amOH BOY! A CAR RIDE! MY FAVORITE!
9:40 amOH BOY! A WALK! MY FAVORITE!
10:30 amOH BOY! A CAR RIDE! MY FAVORITE!
11:30 amOH BOY! DOG FOOD! MY FAVORITE!
12:00 noonOH BOY! THE KIDS! MY FAVORITE!
1:00 pmOH BOY! THE GARDEN! MY FAVORITE!
4:00 pmOH BOY! THE KIDS! MY FAVORITE!
5:00 PMOH BOY! DOG FOOD! MY FAVORITE!
5:30 PMOH BOY! MOM! MY FAVORITE!

Day number 181

8:00 amOH BOY! DOG FOOD! MY FAVORITE!
9:30 amOH BOY! A CAR RIDE! MY FAVORITE!
9:40 amOH BOY! A WALK! MY FAVORITE!
10:30 amOH BOY! A CAR RIDE! MY FAVORITE!
11:30 amOH BOY! DOG FOOD! MY FAVORITE!
12:00 noonOH BOY! THE KIDS! MY FAVORITE!
1:00 pmOH BOY! THE GARDEN! MY FAVORITE!
4:00 pmOH BOY! THE KIDS! MY FAVORITE!
5:00 PMOH BOY! DOG FOOD! MY FAVORITE!
5:30 PMOH BOY! MOM! MY FAVORITE!

Day number 182

8:00 amOH BOY! DOG FOOD! MY FAVORITE!
9:30 amOH BOY! A CAR RIDE! MY FAVORITE!
9:40 amOH BOY! A WALK! MY FAVORITE!
10:30 amOH BOY! A CAR RIDE! MY FAVORITE!
11:30 amOH BOY! DOG FOOD! MY FAVORITE!
12:00 noonOH BOY! THE KIDS! MY FAVORITE!
1:00 pmOH BOY! THE GARDEN! MY FAVORITE!
4:00 pmOH BOY! THE KIDS! MY FAVORITE!
5:00 PMOH BOY! DOG FOOD! MY FAVORITE!
5:30 PMOH BOY! MOM! MY FAVORITE!

Excerpts from a cat's diary

Day 752

My captors continue to taunt me with bizarre little dangling objects. They dine lavishly on fresh meat, while I am forced to eat dry cereal. The only thing that keeps me going is the hope of escape, and the mild satisfaction I get from ruining the occasional piece of furniture. Tomorrow I may eat another houseplant.

Day 761

Today my attempt to kill my captors by weaving around their feet while they were walking almost succeeded, must try this at the top of the stairs. In an attempt to disgust and repulse these vile oppressors, I once again induced myself to vomit on their favorite chair...must try this on their bed.

Day 765

Decapitated a mouse and brought them the headless body, in attempt to make them aware of what I am capable of, and to try to strike fear into their hearts. They only cooed and condescended about what a good little cat I was...Hmmm. Not working according to plan.

Day 768

I am finally aware of how sadistic they are. For no good reason I was chosen for the water torture. This time however it included a burning foamy chemical called "shampoo." What sick minds could invent such a liquid?! My only consolation is the piece of thumb still stuck between my teeth.

Day 771

There was some sort of gathering of their accomplices. I was placed in solitary throughout the event. However, I could hear the noise and smell the foul odor of the glass tubes they call "beer.." More importantly I overheard that my confinement was due to MY power of "allergies." Must learn what this is and how to use it to my advantage.

Day 774

I am convinced the other captives are flunkies and maybe snitches. The dog is routinely released and seems more than happy to return. He is obviously a half-wit. The bird on the other hand has got to be an informant, and speaks with them regularly. I am certain he reports my every move. Due to his current placement in the metal room his safety is assured.

But I can wait, it is only a matter of time...

Sunrise in winter/photos

Posted on 2004-12-22 by ivo :: /photos :: link

Last monday I had an extra hour before work, so I drove into the fields between Delft and Rotterdam and took some pictures of the sunrise. It had been freezing that night, with an almost clear sky and there was frost everywhere.

image 02

Read more…

New site layout/site

Posted on 2004-12-12 by ivo :: /site :: link

I have changed the site design again, the old one got boring. The new layout is vaguely based on an article from A List Apart, called Creating Liquid Layouts with Negative Margins.

The layout works like I intended in mozilla, opera and konqueror, and looks not-entirely-horrible in internet explorer. The latter looks fixable, and I'll try to do that some time soon. I will probably be tweaking the layout for some time to come.

Everything in the right-hand column is static, by the way. I had been struggling with some blosxom plugins to generate a photo album, but none of them did what I wanted them to do. So another item for the wishlist of wirescape plugins is a photo-album plugin.

Winter in Rotterdam/photos

Posted on 2004-12-12 by ivo :: /photos :: link

image 01

Cyprus (November 2004)/photos

Posted on 2004-12-12 by ivo :: /photos :: link

image 08 image 09

Read more…

Python decorators/programming

Posted on 2004-11-26 by ivo :: /programming :: link

As another example of what you could do with python 2.4 decorators, I tried to wrap class methods in a database transaction, and this is what it became:

def intransaction(method):
    def wraptransaction(self, *args, **kwargs):
        try:
            self.conn.beginTransaction()
            rv = method(self, *args, **kwargs)
        except:
            self.conn.rollbackTransaction()
            raise
        else:
            self.conn.commitTransaction()
        return rv
    return wraptransaction
class DatabaseInterface(object):
    def __init__(self, **kwargs):
        self.conn = DatabaseConnection(**kwargs)

    @intransaction
    def getSomething(self, id):
        return self.conn.select(id)[0]

All applications suck/programming

Posted on 2004-07-21 by ivo :: /programming :: link

Seriously, I don't know what is wrong with me. I just can't seem to find any usable software package lately. Either they all suck, or I'm being too demanding or impatient. Probably both, there's a lot of crappy software out there—which includes my own. Most software depends on either a specific database system, a specific programming language, or has far too many dependencies (have a look at slash or scoop for example, gah).

Last monday I ran into a fixed limit in the X protocol, I had opened rougly 220 X terminals, at which time I couldn't open any more because the X protocol somehow allows only 240 client connections. (Yeah I know, I have a habit of not closing them when I've done something—have a look at this screenshot to get an idea of what my desktop usually looks like.) Why is there even a limit like this? It probably has something to do with the X protocol being invented when computers were slow and networking bandwidth was limited, and terminals seemed like a good idea, so fixed field lengths were being used. There's Fresco, but I have never looked at it long enough to tell whether or not it fixes these things.

Isn't there some kind of way to make these things more generic? I don't want to install php if I have perl available, I don't want to install mysql if I already have postgresql installed. Hell, if I wanted to use XML files or Oracle, why not use those? And I certainly don't like to be forced to use a certain desktop environment—if you're bored and have some internet bandwidth to waste, try to install konqueror on an otherwise pure GNOME-system.

I often threaten to write my own programming language, my own operating system, and given the time and motivation I'd probably rewrite everything in existance to fix limitations like these.

The latest project I'm working on (kansloos.it) involves selecting a news or weblog package, something that allows me to post short stories, lets users submit stories, and some level of integration with several forums on the same site. I've been increasingly frustrated by blosxom, and from talking on IRC I've heard a lot of similar sentiments about other weblog packages. Now it tends to go in the direction of writing yet another weblog implementation, which probably also has its own constraints and weird limitations, and it won't be finished for a while either.

So what am I going to do? I just wrote “write weblog system” on my todo-list…

Protest-protesters/politics

Posted on 2004-07-19 by ivo :: /politics :: link

Conservatives to protest RNC protests ―what?

Their website has more information. These guys seem to be seriously derailed.

There is nothing wrong with protests to make yourself heard, but these guys just seem to be protesting just for the heck of it:

“We must admit we get a certain high from puncturing the moral self-righteousness of leftists.”

The FAQ is filled with specious claims, appealing to the fear of and uncertainty over other cultures. They seem to assert that western culture is the only acceptable culture, denying the fact that morals and standards vary wildly elsewhere:

“When mothers happily send their children off to bomb buses and schools, this is not based on any rational grievance. No, this is endemic of a sick, utterly immoral, anti-life culture that serves only one purpose: to keep tyrants in power. ”

Time for an anti-anti-protest-protest-protest movement?

Configuring exim4/programming

Posted on 2004-06-30 by ivo :: /programming :: link

 ┌──────────────────┤ Configuring Exim v4 (exim4-config) ├───────────────────┐
 │                                                                           │
 │ The headers of outgoing mail can be rewritten to make it appear to have   │
 │ been generated on a different system, replacing                           │
 │ "phoenix.office.next-element.nl" "localhost" and "" in From, Reply-To,    │
 │ Sender and Return-Path.                                                   │
 │                                                                           │
 │ Hide local mail name in outgoing mail?                                    │
 │                                                                           │
 │                    <Yes>                       <No>                       │
 │                                                                           │
 └───────────────────────────────────────────────────────────────────────────┘

So, what should I choose if I want to allow overriding the From-header?

Yay, internet!/home

Posted on 2004-03-21 by ivo :: /home :: link

Yay, my internet connection works. It has been working since thursday evening, but I've been to busy doing other stuff to whine about it here. It took me too long to figure out where to get an old version of the firmware for my modem so I could use sipspoof.ini.

Settling down/home

Posted on 2004-03-12 by ivo :: /home :: link

I have moved to the new address, where the dust has been settling down (literally) over the last week or so. The curtains are still missing, as well as some finishing touches. Other than that, all the big parts are done, except for the furniture and the stuff that's still in boxes.

My internet connection should be active right now, but I don't have an ADSL modem yet. Apparently they've already sent it to me, I wonder when I get it. Until the ADSL link works, I'm stuck with dialing in every so often, which is exactly the reason why I haven't written something here for so long.

I have internet at work, but you know, when you're at work, people seem to expect something from you, I don't know what or why.

I made some photos during the makeover and the move, but since I don't have internet yet, I can't upload them :\ When I'm back online I will post them.

New home/

Posted on 2004-02-06 by ivo :: / :: link

Finally, after being on some silly list for just under two years, I have been offered a new home. I gladly accepted, but it's going to be hell to make it inhabitable, it's all concrete floors and completely empty. I fear it's going to be a long and expensive month…

layout

Abstract methods in python (4)/programming

Posted on 2004-01-26 by ivo :: /programming :: link

Well, that was interesting. Rigel pushed me to submit the code to the ASPN cookbook, which I did. Then he told me that my entry was included in today's issue of daily python (apparently they do that to all entries from the ASPN cookbook). Incidentally I fixed a few minor bugs in the code. The complete code is downloadable here: abstractmethods.py.

Abstract methods in python (3)/programming

Posted on 2004-01-22 by ivo :: /programming :: link

Ok, here is the same code as in the last two articles, this time with more explanation. The point is that python doesn't have a notion of “abstract methods.” Abstract methods are part of an base class that defines an interface, without any code. Abstract methods can't be called directly, because they don't contain any code in their definition.

In the definition of the base class, you may want to include a specific method that is part of the interface, but the specific implementation is still unknown. A popular example seems to be the drawing of a point or a line in a graphical application.

The classes Point and Line share several implementation details, but differ on other. In particular, the way they are drawn is completely different (you will want to optimize the drawing of a line). Suppose these two classes are derived from the same class, Object. It is possible to separate the implementation of the method draw of these two classes, while draw can still be called from the base class Object.

The text below will introduce some utility classes that make this possible.

The goal of this article is defining a way to make it possible to define classes such as the following (not yet paying attention to the proper syntax):

class Object (object):
    abstract draw()

    def update(self):
        self.draw()

class Point (Object):
    def draw(self):
        ...
    ...

class Line (Object):
    def draw(self):
        ...
    ...

The method draw of the class Object cannot be implemented, because the concept of ‘drawing’ a generic object is undefined. Other methods, such as the update above may want to use draw anyway, because it is part of the specification for the Object class and its descendants.

The implementation in python exists of two parts:

  1. The definition of a way to declare abstract methods, and
  2. a way to restrict the creation/usage of these abstract classes.

First the declaration part. To declare an abstract method, we can use callable class variables:

class Object (object):
    draw = AbstractMethod()

When somebody tries to call Object.draw(), an exception will be raised. But as long as methods in Object use self.draw(), they will actually use Point.draw(), because self will be of type Point.

If AbstractMethod is a class, draw will be an instance of this class, so we can make draw callable, and raise a proper exception (TypeError or NotImplementedError for example) if it is called instead of an implementation in one of the descendant classes.

class AbstractMethod (object):
    def __init__(self, func):
        self._function = func

    def __get__(self, obj, type):
        return self.AbstractMethodHelper(self._function, type)

    class AbstractMethodHelper (object):
        def __init__(self, func, cls):
            self._function = func
            self._class = cls

        def __call__(self, *args, **kwargs):
            raise TypeError('Abstract method `' + self._class.__name__ \
                            + '.' + self._function + '\' called')

So now we can declare Object as follows:

class Object (object):
    draw = AbstractMethod('draw')
    def update(self):
        self.draw()

If we tried to call Object().draw() directly, we get an exception:

>>> Object().draw()
TypeError: Abstract method `Object.draw' called

The same happens with Object().update():

>>> Object().update()
TypeError: Abstract method `Object.draw' called

If we implement a descendant class which implements draw, there is no error.

class Point (Object):
    def draw(self):
        print 'Point.draw called'

(Note that there is no definition for update in Point, it uses the implementation inherited from Object.)

>>> Point().update()
Point.draw called

Of course, we shouldn't be getting an exception at all if we try to call an abstract function. It should be impossible to create an instance of a class that has one or more abstract methods in its definition (either declared directly in the class definition, or implicitly via inheritance without overriding it with a real method). We can solve this pretty easily by declaring a metaclass that checks if there are any abstract methods in a class definition, and raise an exception if there are.

class Metaclass (type):
    def __init__(cls, name, bases, *args, **kwargs):
        type.__init__(cls, name, bases, *args, **kwargs)
        cls.__new__ = staticmethod(cls.new)

        ancestors = list(cls.__mro__)
        ancestors.reverse()  # Start with __builtin__.object
        for ancestor in ancestors:
            for clsname, clst in ancestor.__dict__.items():
                if isinstance(clst, AbstractMethod):
                    abstractmethods.append(clsname)
                else:
                    if clsname in abstractmethods:
                        abstractmethods.remove(clsname)

        abstractmethods.sort()
        setattr(cls, '__abstractmethods__', abstractmethods)

    def new(self, cls):
        if len(cls.__abstractmethods__):
            raise NotImplementedError('Can\'t instantiate class `' + \
                                      cls.__name__ + '\';\n' + \
                                      'Abstract methods: ' + \
                                      ", ".join(cls.__abstractmethods__))

        return object.__new__(self)

The definition of Object becomes:

class Object (object):
    __metaclass__ = Metaclass
    draw = AbstractMethod('draw')

This has the final result:

>>> Point().update()
Point.draw called
>>> Object().update()
NotImplementedError: Can't instantiate class `Object';
Abstract methods: draw

The error can be caught much earlier on when the exception is raised when the class is instantiated.

There is one remaining issue, which is that descendant classes of Object which don't implement all the abstract methods defined in Object can also not be instantiated:

>>> class FooClass (Object):
...     pass
>>> FooClass()
NotImplementedError: Can't instantiate class `FooClass';
Abstract methods: draw

The code in the last article didn't do this, but the code in this article checks all ancestors for any abstract methods that haven't been implemented.

Abstract methods in python (2)/programming

Posted on 2004-01-22 by ivo :: /programming :: link

The fun never stops!

class Object (object):
    __metaclass__ = Metaclass
class Metaclass (type):
    def __init__(cls, name, bases, *args, **kwargs):
        type.__init__(cls, name, bases, *args, **kwargs)
        cls.__new__ = staticmethod(cls.new)

        abstractmethods = []
        for clsname, clst in cls.__dict__.items():
            if isinstance(clst, AbstractMethod):
                abstractmethods.append(clsname)

        abstractmethods.sort()
        setattr(cls, '__abstractmethods__', abstractmethods)

    def new(self, cls):
        if len(cls.__abstractmethods__):
            raise NotImplementedError('Can\'t instantiate class `' + \
                                      cls.__name__ + '\';\n' + \
                                      'Abstract methods: ' + \
                                      ", ".join(cls.__abstractmethods__))

        return object.__new__(self)
class MyAbstractObject (Object):
    foo = AbstractMethod('foo')

class MyObject (MyAbstractObject):
    def foo(self):
        print 'foo'

def main():
    a = MyObject()
    a.foo()
    b = MyAbstractObject()
    b.foo()
> python test.py
foo
Traceback (most recent call last):
  File "test.py", line 25, in ?
    main()
  File "test.py", line 21, in main
    b = MyAbstractObject()
  File "/home/ivo/p/python/abstract-classes/Metaclass.py", line 29, in new
    raise NotImplementedError('Can\'t instantiate class `' + \
NotImplementedError: Can't instantiate class `MyAbstractObject';
Abstract methods: foo

Abstract methods in python/programming

Posted on 2004-01-22 by ivo :: /programming :: link

Classes are fun!

class AbstractMethod (object):
    def __init__(self, func):
        self._function = func

    def __get__(self, obj, type):
        return self.AbstractMethodHelper(self._function, type)

    class AbstractMethodHelper (object):
        def __init__(self, func, cls):
            self._function = func
            self._class = cls

        def __call__(self, *args, **kwargs):
            raise TypeError('Abstract method `' + self._class.__name__ \
                            + '.' + self._function + '\' called')
class MyAbstractObject (object):
    foo = AbstractMethod('foo')

class MyObject (MyAbstractObject):
    def foo(self):
        print 'foo'

def main():
    a = MyObject()
    a.foo()
    b = MyAbstractObject()
    b.foo()
> python test.py
foo
Traceback (most recent call last):
  File "test.py", line 25, in ?
    main()
  File "test.py", line 22, in main
    b.foo()
  File "/home/ivo/p/python/abstract-classes/AbstractMethod.py", line 19, in __call__
    raise TypeError('Abstract method `' + self._class.__name__ \
TypeError: Abstract method `MyAbstractObject.foo' called

Debian desktop background/debian

Posted on 2004-01-19 by ivo :: /debian :: link

Most desktop backgrounds are way too bright for my taste, and the ones focused on Debian are no exception. I created a simple and dark image to put on my desktop. You can see it in action in this screenshot.

the background

Dependencies on libgnutls5/debian

Posted on 2004-01-16 by ivo :: /debian :: link

The number of packages that depend on libgnutls5 has dropped considerably since the introduction of libgnutls7. There are currently 22 binary packages that depend on libgnutls5 in any architecture, and only five source packages that have an explicit build dependency on libgnutls5-dev.

The ultimate goal is to get libgnutls5 and libopencdk4 out of sarge before it is released.

I am sending email to the maintainers of these packages, so please, if you maintain one of these, change your build dependency to libgnutls7-dev | libgnutls-dev.

anubis
Maintainer has promised an upload this weekend.
elinks
Build-Depends on libgnutls7-dev|libgnutls5-dev. Maintainer notified.
gtklp
Build-Depends on libgnutls-dev|libgnutls5-dev. Maintainer notified.
lynx
Maintainer notified.
thy
Maintainer notified.

Status updates can be found here.

A truly free mind/programming

Posted on 2004-01-15 by ivo :: /programming :: link

When complaining on IRC about the time I spent on writing articles for this weblog, someone jokingly said that I should put a PayPal banner on my website. But I tend to hate paypal.

But another thought struck me then, which is that I don't want to recieve any money for the work that I do for this site. All the texts on this site are licensed for redistribution, as long as you give me credit, and keep the copyright notices intact (details). I don't do this because I'm so philanthropic, I just want anyone to be able to take my texts or code or images or anything else, and modify it for their needs and redistribute the result.

Basically this has happened long before I came into contact with the free software movement. I had written some code that I wanted to give away to friends. I saw that they were using it, which felt good. But I was young and naive at that time.

Later I found out about the existence of Linux, and the idea of choice appealed to me. I installed it, and gradually became aware of all the projects that surrounded it: the GNU Project, the Free Software Foundation (FSF), the League for Programming Freedom. As time went on, I came into contact with GIMP. To install it, you needed lesstif. I had heard of Motif before, and I thought it was good that there was a project that wanted to provide a free version of it. That lesstif has been licensed under a non-free license for a long time didn't bother me then. It was better than nothing.

Gradually I became aware of the real reason for the existence of organizations such as the FSF. I started releasing my own code under licenses such as the GNU General Public License (GNU GPL).

As I started to become more involved in the free software movement, starting with the GNU Translation Project, I came into contact with the real values of licensing code under free licenses, and I learned to understand not only the virtues, but also the responsibilities that come with code released under the GPL. Being a user of (almost) only free software, I was already aware of the expectations of other programmers, and I learned to apply those feelings to my own software.

My code became free, and my mind followed. It was a gradual process, but I can't say I'm sorry it happened. I'm glad. But paypal still sucks.

Scientific methods/science

Posted on 2004-01-15 by ivo :: /science :: link

Introduction

Usually, when people ask me if I have a religion, or if I believe in something, I usually answer “no”. My parents are both atheists, I wasn't baptized. When I have to put a little more nuance in that, it becomes “I believe in Nature.” But I don't mean Nature to be some higher order being like some people see mother nature. So I change it to “I believe in science.”

“But there are some things that science can't explain.” (usually they refer to the metaphysical) — bzzt, wrong. There are things that science hasn't yet had a chance to explain. (And there are things that science explains, but nobody wanted to know about.)

There are people who don't know how to handle science, there are those who don't know how to handle scientific results, and there are those who just Do Not Get It. There are a lot of generally accepted principles that apply to any scientific research. These principles have influenced the way that scientists do research since the middle ages, when research in western Europe was generally intended to support the Catholic Church in their doctrine.

Read more…

gnutls10 1.0.4-1 finally uploaded/debian

Posted on 2004-01-14 by ivo :: /debian :: link

I have just uploaded gnutls10 1.0.4-1 in all its glory to unstable. It contains new binary packages, so it'll take a while before it shows up in incoming. Let's hope it's still in time to get released with sarge…

The only thing that was keeping it is a solution to bug #224846. I was unable to reproduce it for a while, until I found the culprit: it turned out that the chroot that I'm using to build packages was contaminated with latex2html and a few other tex-related packages. Removing them made me able to fix it quickly. Instead of rebuilding the documentation, I'm now just using the upstream version of the postscript file.

For those who want to test it before it hits incoming, and I know there are some of you who do, you can also get it from my package archive.

Blosxom plugin: cvs/programming/blosxom

Posted on 2004-01-12 by ivo :: /programming/blosxom :: link

I was looking for a way to have the $Revision: 1.1 $ that CVS inserts in the theme file recognized and/or ignored by blosxom, so I could show the latest version of the HTML template in the page. Because the only plugin on the blosxom website that appears to do something that I think I wanted—cvsinfo—is unavailable, I wrote my own plugin to do it. You can download it here.

Documentation

NAME

Blosxom Plug-in: cvs

SYNOPSIS

Replaces CVS keywords (such as $Id: cvs,v 1.2 2004/01/12 12:59:43 ivo Exp $) with the part after the :.

INSTALLATION

Drop the cvs plug-in into your Blosxom plugins folder.

CONFIGURATION

None necessary.

VERSION

1.2

AUTHOR

Ivo Timmermans <ivo@o2w.nl>, http://www.lychnis.net/

LICENSE

cvs Blosxom Plug-in
Copyright 2004, Ivo Timmermans <ivo@o2w.nl>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Blosxom theme: lychnis/programming/blosxom

Posted on 2004-01-12 by ivo :: /programming/blosxom :: link

I finally made the theme for this website (http://www.lychnis.net/) available for download: lychnis 1.5.

The theme needs at least these plugins: better_title, cvs, headlines, sitelinks, theme, writeback, xhtml. Some of these plugins required tweaking to make them work, sometimes I had to correct the HTML code in them to be XHTML. I'll get these changes published once I've cleaned them up, or maybe I will submit them to the original author(s) of the plugin.

The original idea for the layout is copied from a design on OSWD, called libra. Among other things I changed it to be XHTML 1.1 compliant and to make more use of CSS.

lychnis.net live/site

Posted on 2004-01-12 by ivo :: /site :: link

My new domain lychnis.net is alive, and I created a brand new website for it. Take a look at the information about the site to find out what it means, or just go there.

The new site is also based on blosxom, with a few minor modifications to some of the plugins (most notably the hide plugin). The articles are the same as in the weblog. Only the most recent article is shown on the frontpage, the rest can still be read by clicking on weblog in the navigation bar at the top.

Coding style guide for C code/programming

Posted on 2004-01-12 by ivo :: /programming :: link

After reading Fruit's Source Code Style, I have taken the document and modified it to match my own coding style. The result is this Coding style guide. Thanks to warp and Garion for their comments. More comments are always welcome.

It basically documents the style that I like to program in. This will differ from other people's. It is certainly not prescriptive, only indicative of what I think yields readable source code for any project.

Blosxom theme: scratchpad/programming/blosxom

Posted on 2004-01-09 by ivo :: /programming/blosxom :: link

I made the theme that I'm using for this page available here: version 0.1. It's pretty easily customizable with CSS. If your browser offers the possibility to select alternative stylesheets when viewing this page you can try it now to get an idea of what would be possible. The theme itself is loosely based on the iztsu theme.

The theme needs at least these plugins: archives, bloglinks, breadcrumbs, categories, find, htmllinks, readme, sitelinks, theme, writeback, xhtml. Some of these plugins required tweaking to make them work, sometimes I had to correct the HTML code in them to be XHTML. I'll get these changes published once I've cleaned them up, or maybe I will submit them to the original author(s) of the plugin.

Blosxom plugin: sitelinks/programming/blosxom

Posted on 2004-01-08 by ivo :: /programming/blosxom :: link

In the header of the page you'll see a new bar, with a list of shortcuts to more information on my website. To do this, I took the bloglinks plugin and changed it to a sitelinks plugin. The change to the code is minimal, the only thing that's really different is that it expects the contents to be aligned next to eachother instead of in a list structure. You can download the code here.

Lython/programming

Posted on 2004-01-07 by ivo :: /programming :: link

What's that, did Hell just freeze over? I didn't see this one coming, but now it's possible to compile lisp code to python bytecode with lython

On the website it claims that the lisp code “resembles common lisp.” I took a look at the example code fragments that are distributed with the code. It looks as if lython is just a wrapper for python, that takes lisp syntax and translates it to python syntax. And it's only the lisp syntax that has been implemented so far, no native lisp functions (all function calls are directly translated to python function calls). But Common Lisp is so much more than just syntax, it's a massive amount of function calls. These will have to be supported before lython becomes a useful program. Until that time, I fear that lython will be nothing more than a toy to scare your friends with on a cold winter night.

Creative commons license/

Posted on 2004-01-06 by ivo :: / :: link

I have included a copyright and license statement at the bottom of this page:

Copyright © 2003-2004 Ivo Timmermans. Unless otherwise specified, all material on this website (including any images, sound files, and other original works) may be distributed licensed under a Creative Commons License.

In short, this means that you can redistribute content from this page under an identical license, as long as you take some restrictions into account. There is more information in the Commons deed, which is a short summary of the full license.

Before I did this, you didn't have the right to reproduce anything, except in those cases described as “fair use”. I think that this newly chosen Creative Commons license corresponds better to the way I think about copyright and ownership, and the licenses I usually put on my code (GNU General Public License (GNU GPL) or BSD, in two occasions GNU Lesser General Public License (LGPL)). The texts I wrote for this website don't have a special status for me, so it's only logical that they should be free as well.

Blosxom and RSS/debian

Posted on 2004-01-05 by ivo :: /debian :: link

For planet Debian, this blog is being syndicated with others via RSS. It appears that Blosxom doesn't automatically add a release date+time (the pubDate tag) to the RSS document. Mark Howard mailed me how to fix this: in blosxom.cgi, find the line starting with rss story in the __DATA__ section, and change it to (all on one line):

rss story   <item>\n
    <title>$title</title>\n
    <pubDate>$dw, $da $mo $yr $ti:00 GMT</pubDate>\n
    <link>$url/$yr/$mo_num/$da#$fn</link>\n
    <description>$body</description>\n
  </item>\n

Font sizes/site

Posted on 2004-01-03 by ivo :: /site :: link

Someone has been complaining that the fonts on this website are too big. This comment touches a subject that I've often enraged myself about: default font sizes in browsers.

For some reason or other, Microsoft ships Internet Explorer with a rather large default font size setting. People aren't exactly inclined to change anything, so most of the IE users will be using this default. This has inspired web designers all over the world to specify smaller fonts on their websites, to make it look acceptable in IE.

Mozilla ships with a default font size of 16 points, I always change that to 12 points to be able to read pages that don't specify anything in a comfortable font size. This does mean that I see websites that were designed for IE (which is a bad thing to do at any time) with very small, nearly illegible text.

I designed the layout of this website for my own browser, and it looks good (well, acceptable) in Internet Explorer, when you change the font to “Smallest”. I will not change the size of the fonts here, people should configure their browsers to display fonts in the size they like. If you keep the default of IE or Mozilla, you get what you asked for: large letters.

Happy 2004/

Posted on 2004-01-01 by ivo :: / :: link

A very happy new year to everyone!

I'm sure you all have some new year's resolutions. This year, own resolutions are simple:

  • Get a job in Sweden and move there;
  • Learn to speak, write and read more Japanese;
  • Become stronger in Go, at least 5th kyuu at the end of 2004.

Japanese writing system/japanese

Posted on 2003-12-30 by ivo :: /japanese :: link

The following excerpt is from the article Outline of Japanese Writing System, an otherwise very worthy read:

In English, the relationship between the above words is somewhat obscured by the fact that the concept of water is expressed in three different written forms, i.e., hydr, aqua, and water. In Japanese, on the other hand, although 水 has different phonetic forms, i.e., an on reading of sui and a kun reading of mizu, it has only one form, i.e., 水. The kanji thus provides a visual link that transcends the different pronunciations. This ability of kanji to represent a given meaning with little or no dependence on their pronunciations is perhaps one the most distinctive features of the Japanese script.

While this may be true, I still find it hard to guess the exact meaning a certain japanese word has. This is confirmed by a following paragraph:

Generally, the more common a character is, the more numerous are its meanings and the more complex is the relationship between them. An extreme example is 上 'up; go up'. This dictionary lists a total of 114 meanings for 上, subdivided into 16 subentries. It has 27 meanings as an on word element, 3 meanings as an independent on word, 17 meanings for 5 kun word elements and 67 meanings for 9 independent kun words. Although 上 is a very long entry and is hardly typical, many characters do have more than ten on and kun meanings combined.

So how can you be sure which meaning you are supposed to give to a character in a random word? I'm sure it gets easier to guess right when the character you're looking at is less used, but for a beginner such as myself, it's not a great advantage of kanji. This so-called advantage of using kanji is greatly overrated.

Fortunately it's not exactly a burden either, like how you don't have to know all the Latin or Greek roots to understand English. You just look up these unknown words in a dictionary. But saying that it's easier to guess the meaning of a Japanese word if you know the meaning of several basic kanji is like saying that you can guess the meaning of an English word if you know French.

One thing that does make kanji useful is that the Japanese language has lots and lots of homophones. This is caused by the import of a huge amount of Chinese words, totally ignoring the tone accent and subtle distinctions in the pronunciation. Using kanji in written text makes it very easy to discern between homophones, because they are usually written with different kanji for different meanings.

Studying Fuseki/go

Posted on 2003-12-29 by ivo :: /go :: link

Now that I'm a little further in mastering the game, I can see where my weaknesses lie and what I should do or which books I should read to get more skilled. Right now I think that my greatest weakness lies in the opening, the 布石. So I went to the store and bought a few books about it. Reading these books makes me aware that yes – I needed it.

There are lots of areas that I need to master, but the fuseki was the most urgent. I think the next field of interest should be the endgame, but I'm not sure yet. Reading these books on the fuseki pushed me up quite a bit, and I haven't even finished yet…

But even when studying these exotic games the books give me, I still feel that I'm picking up on the principles that lie behind them, even though I'm not always sure about what it is.

It is the experience of suddenly seeing yourself play a new type of move, because you saw the principle behind it explained somewhere, that makes you feel good. It doesn't even matter if you lost or won the game as long as you can see you've learned something.

Waarom Amerika gehaat wordt/politics

Posted on 2003-12-27 by ivo :: /politics :: link

Iemand wees me op dit artikel in het tijdschrift Onze Wereld.

Design Patterns in Python/programming

Posted on 2003-12-18 by ivo :: /programming :: link

While searching for an algorithm to sort a graph topologically, I found an online version of the book Data Structures and Algorithms with Object-Oriented Design Patterns in Python. This should be mandatory reading for anyone wishing to do something a little bit more complicated in python. (By the way, the website has implementations in Java, C++ and C# as well.)

The author was nice enough to include a link to a fully working python package, in which the classes from the book have been completed and extended to a very nice and easy to use library. Unfortunately it's unusable in any project, because it has no license. There's a copyright notice in the package, and a little notice about the copyright on the texts on his website, but no license.

I have mailed the author, asking for an explanation. Let's see if he answers, and what he has to say…

Learning Japanese/japanese

Posted on 2003-12-15 by ivo :: /japanese :: link

Someone passed me this link about the Japanese language.

Japanese Teacher: Good morning, Harry.

Harry: Good Morning.

Japanese Classmates: (gasps of horror and shock)

「ほしのこえ」/movies

Posted on 2003-12-14 by ivo :: /movies :: link

「私は、ここにいるよ」

「ほしのこえ」, also known as Voices of a distant star, is the product of Makoto Shinkai. It is a short anime movie that tells the tale of a young couple that is torn apart when Mikako enrolls in a UN mission to Pluto and ends up on Agharta, a planet of Sirius.

Even in this short film, Makoto Shinkai manages to depict the characters as well formed, complete personalities. The way the Mikako stays connected with Noboru by sending messages to him is touching.

I highly recommend this anime to anyone. I watched the fansub by Shinsen Subs, and I'm currently waiting for Amazon to deliver the DVD to me.

Random thoughts:

  1. Why does the U.N. enroll 15 year old girls in the army?
  2. Why do they allow loose objects to lie around in a fighter unit during combat?
  3. Why does it take 8 years for an email to reach earth, but only a few moments for a spaceship to go to Sirius? Surely they must have found out a way of accelerating the email if they can transport four entire spaceships over that distance… They do give a hint on this one: We haven't yet found a way back to Earth yet. But why they chose to go to Sirius instead is beyond me.

Kifu recognition (part 2)/go

Posted on 2003-12-08 by ivo :: /go :: link

Well, the first steps have been made, I can now find lines in an image. Below you will find an example of what sort of result this yields. Unfortunately this is only the easiest part of step 1, recognizing the grid on the goban… :(

go-board

Here are some of the intermediate steps that were necessary to get this image. I put another example here.

Kifu recognition/go

Posted on 2003-12-06 by ivo :: /go :: link

For a while now I've been thinking about writing a program that can take an image of a go board and translates that to a kifu in SGF. I know this has been done before, but as far as I could see, there isn't really a readily-available program to do this, let alone any free software.

So I'm accepting the challenge. Here's a simple list of a few of the things this program has to be able to recognize, roughly in increasing difficulty:

  1. The grid on the board;
  2. The stones on the board and their exact positions on the grid;
  3. The color of the stones;
  4. The size of the board (19×19, 13×13, 9×9);
  5. Any markings on stones;
  6. Number/letter markings on stones;
  7. Number/letter markings anywhere on the board;
  8. The position in a photograph of an actual game, where stones may not be placed exactly on the points in the grid.

Starting with generated images and scans of images in books, I will be working my way down this list. I'm now trying to get a simple program that does nothing more than recognizing lines on the board, and define where the grid must be.

Colonialization by the U.S./politics

Posted on 2003-12-05 by ivo :: /politics :: link

“People of the world, unite and defeat the U.S. aggressors and all their running dogs! People of the world, be courageous, and dare to fight, defy difficulties and advance wave upon wave. Then the whole world will belong to the people. Monsters of all kinds shall be destroyed.”

Mao Ze Dung, "Statement Supporting the People of the Congo (L.) Against U.S. Aggression" (November 28, 1964)

Even back then it was the U.S. who was seen as the world's aggressor, and indeed I feel like I'm living in a country that has been colonialized by the U.S. mindset. All too often people, influential people, stare at the other side of the Atlantic Ocean, and try to copy american ideas, while they are completely out of context, irrelevant and sometimes plain wrong.

A good example of this, and a source of quite a bit of frustration, is the way the Delft University of Technology tries to be the MIT aan de Schie, and tried to copy a considerable amount of nonsensical concepts; they may make sense when applied to an american university, but here they don't, at least not in the way people seem to want to apply them.

The prime minister of the Netherlands, Jan Peter Balkenende, is sometimes seen as not having a clear vision, and as someone who blindly follows other political leaders. I would say that this t-shirt should be created for us living in the Nederlands. (And some italian I met was wearing a similar t-shirt about Berlusconi.)

Making fun of world leaders/politics

Posted on 2003-12-04 by ivo :: /politics :: link

(This is still just a lot of loose ends, I'm going to write followup articles to address some items in this article. Trying to write down all these thoughts is part of the process of understanding it, so the articles this section will probably remain chaotic for a while.)

Try doing a Google search on miserable failure. The first item you will see in the search results is the official biography of the American president George Bush. This is the result of a meme that's apparently been going on for a while; see this and this weblog entry. The key is to get as many sites as possible to include the following piece of text (note that I'm contributing to this meme by quoting it here):

“From this day forth, I will refer to George W. Bush as a Miserable Failure at least once a day. Why, you ask? Well, someone came up with this great idea to link George W. Bush and Miserable Failure in popular search engines. If you have a blog or web site, help raise the link between George W. Bush and the phrase ‘miserable failure’ by copying this link and placing somewhere on your site or blog.”

Thank you very much for your participation.

Satires and parodies on Bush, his behavior, his words, his administration, and more have been published ever since he got into the public eye, as documentaries, jokes in popular television shows, websites, cartoons, blog entries such as the one above. Even books are published which make fun of him. To me it seems like the amount of these satires have been increasing over the past two years, actually, ever since that tuesday in september 2001.

Lots of websites have arosen during the term of his presidency, trying to explain to the public how bad his administration is performing, how much the so called war on terrorism has cost the U.S. and other countries (a lot), and what is actually being accomplished in it (not much good).

I won't say that Bush is to blame for all bad things that are happening, but he's the most visible in the media. It's certainly not the first american president to be considered incapable; have a look at an old airings of shows like Saturday Night Live, you'll see jokes about how the president can't spell, that he's an idiot, and so on. Besides, the U.S. isn't the only country with an idiot for president. Idiots have been running this world for a very, very long time.

Plato's cave

There is a duality in the role of the news media. On one side they are capable of showing the masses what is going wrong in the world, on the other side they are obeying the official stream of information in everyday news broadcasts.

The first kind of news requires a lot of research, most information will be kept secret. This is usually done in background articles, documentaries, movies. It requires effort to get to this information, and only sometimes published as a truthful, well-formed, readily accessible piece.

The second kind of news is what big news corporations do all day round, they buy eachother's news items, mingle that into a low-level broadcast and fire it off into the masses, hoping that enough people will read/see/hear their version of the story.

This second kind of news is what causes people to be too much focused on what the media are telling them. It's like Plato's cave, we can't go out of the cave to see what the outside world really looks like, instead they are kept inside and have to rely on the information the media are giving them. The reality is too hard for us to grasp, too overwhelmingly wrong, too real. And only every once in a while some background or in-depth research is provided, but most people only seem to be interested in what's happening now, not what was happening twenty years ago.

With the uprising of the internet, where critical people from all over the world can comment on the world's major (and minor) events, this is slowly changing, with alternative news feeds such as Indymedia, Alternet gaining in popularity.

This numbness of the general public is also caused by (or maybe is causing) companies to put ever more effort in trying to sell products to the public, using increasing noisy, flash, brightly colored, annoying advertisements. The summit of all this must be the infomercial...

In the movie Blade Runner, Ridley Scott portraits a world full of commercials and advertisements. The big mass have grown so accustomed to this constant stream of big screaming bright colors they don't even notice.

Some people even seem to have forgotten there even is an outside world, and that it is indeed possible to go outside the cave they're in.

Revolution

All we can hope for now is some kind of revolution. The first step is to take anything you hear with a grain of salt. Distrust conventional mass media news broadcasts such as those on CNN. Go and look on the internet for alternate resources, IndyMedia may be a good place to start.

“There is no construction without destruction. Destruction means criticism and repudiation; it means revolution. It involves reasoning things out, which is construction. Put destruction first, and in the process you have construction.”

Mao Ze Dung, "Circular of the Central Committee of the Chinese Communist Party", May 16, 1966

Let the destruction begin.

Why you should be using zsh/

Posted on 2003-12-02 by ivo :: / :: link

Initially I wanted to write an entry about some of the basic features that makes zsh the most powerful shell for everyday use, that everybody should be using. However, there already is such a document: An Introduction to the Z shell. So I'll point to that instead :)

This document doesn't really point out the differences between zsh and bash, or why zsh is better than any of the other shells out there. The Zsh workshop by Larry Schrof contains some more information, but may be too much in-depth; or maybe just read the Why zsh? sheet. There's also a little bit of information in the zsh FAQ about similarities with tcsh and bash. Maybe I'll write a document about the differences in the future.

Released python-gnutls 0.2/programming/python-gnutls

Posted on 2003-12-01 by ivo :: /programming/python-gnutls :: link

I have just released version 0.2 of my python wrapper for gnutls. The project homepage for python-gnutls is http://home.o2w.net/~ivo/python-gnutls/. The released files are here.

The changes since version 0.1 include:

  • New classs 'server' and 'conn' have been added. The classes 'client' and 'server' are derived from 'conn', and most methods from 'client' have been moved to 'conn'.
  • A method handshake() has been added. The handshake is no longer done implicitly in the gnutls.client constructor.
  • New methods:
    • Class conn: cipher_get, cipher_set_priority, compression_get, compression_set_priority, kx_get, kx_set_priority, mac_get, mac_set_priority
    • Class server: generate_dh_params
  • New constants defining various gnutls functions. They are named exactly like their counterparts in gnutls/gnutls.h, but without the GNUTLS_ prefix.

Reporting bugs in software/programming

Posted on 2003-11-29 by ivo :: /programming :: link

For free software to work, it is essential that people report any bugs they may find to the authors. When the feedback is accurate and correct enough, they can then fix their software.

However, when you've finally tracked down a bug in a software package, it's sometimes a lot of very frustrating work to find out what exactly is causing the software to break. This is essential information to the programmers, without this they usually wouldn't know where to start looking for the cause of this problem (there are exceptions of course).

As a Debian developer, I know that having incomplete information in a report for a bug that doesn't manifest itself on my system can be extremely frustrating and annoying. Asking the user for more information can help, maybe he needs to be guided a little, for example by providing a way to get a gdb backtrace.

Here's the tale of my latest adventure in this area, as a user. About two weeks ago, a CGI script written in Perl was failing mysteriously on a production server. I had checked everything, even changed the locale the script was running in. The code was pretty simple:

if ($value =~ /^$allowed$/m) {

$allowed is .*, and $value contained some UTF-8 text, with an ä in it. Nothing out of the ordinary, but it wouldn't work. The match statement would always be false. After hours of debugging, it turned out that when $allowed was compared to .*, it wasn't equal. We could set it to .*, in which case the expression was true. (Using $allowed = join('', split('', $allowed)) didn't help either, but maybe perl optimized that a bit.)

So, we looked at the perl bugs. The system I was developing this on was running Debian stable (woody), which has perl 5.6. So you have to look at bugs in perl 5.6. Or Debian bugs for the stable release. The bug under examination may or may not have been fixed already, either in new releases, CVS code, Debian patches, mailing list posts, or somewhere else entirely.

On the other hand, the bug might not even be in perl. The value of $allowed is passed on via a complicated structure of hashrefs and arrays from a parsed XML file, using XML::Simple. So maybe that module is at fault. XML::Simple gets its data from expat, so it might even be expat.

All these little bits of information make it pretty hard to find out if a bug has been fixed or not. I have been trying to see if the bug exists in more recent versions of perl, but so far I haven't been able to reproduce the situation well enough. For one thing, I would have to setup a system that is exactly the same as the production platform, which may take up quite a bit of time. And of course, time is money.

So, what do you do, report the bug or not, knowing that the information you have is incomplete, probably inconsistent and maybe even incorrect; knowing that the developers may ignore or flame you for your report?

I didn't. Hacking around the problem by replacing ä with &auml; was much easier.

Musings on a cold saturday in autumn…/

Posted on 2003-11-22 by ivo :: / :: link


Python wrapper for gnutls/programming/python-gnutls

Posted on 2003-11-05 by ivo :: /programming/python-gnutls :: link

I've re-started on my little project to create a simple python wrapper for the GNU TLS library (gnutls). The code is available from CVS only for now. I'll create a more permanent website for it in the wiki, under PythonGnutls.

This time I'm not using SWIG, mostly because I couldn't find out how to create a custom class, without resorting to C++; and I wanted to understand better what SWIG is trying to do for me. Maybe I'll switch back at some time in the future, when the first issue is solved.

/site :: link

You may have noticed I added the "Hacker logo" to the bottom right of this page somewhere last week. Of course I first read about it when it appeared on slashdot. The reactions there were mostly negative, with arguments such as:

  • Hackers don't need a logo;
  • It will be abused by crackers and other dubious figures;
  • The media will use it for anything related with computers, and bedazzle its meaning;
  • Why does Eric Raymond want his statue carved in the face of the moon;
  • Why did he have to chose a glider that moves down?

Personally, I like the idea of having a logo. Like it says in the FAQ, having the logo on your website doesn't make you a hacker; that is a title you have to earn. Instead I want to show my sympathies to the hacker culture, show anyone that I share visions.

I agree somewhat with the sentiments that "a gun crazed wack job that would scare most moms out of the day care center". Like Richard Stallman once said at an edition of FOSDEM, It doesn't help your case for free software if you mingle your views with political statements. People will close their minds for your arguments for free software if you also make statements that they disagree with, even if they are in a different field.

But even so, Eric has done a lot of good work for the open source/free software world in general. I have never met him in person, I wouldn't know if he deserves any of the criticism he gets. In any case, it would be unfair to refuse to use the hacker logo solely because you disagree with Eric.

The idea to take a glider for the logo is brilliant, of course. It's simple, and could be represented in ASCII very well. I don't care much that Eric chose the one that goes down, any variant would do. Plus I think this one looks good :) I've just become interested in finite state machines and cellular automata.

I don't fear much for usage of the logo by people who aren't hackers in the original meaning; "we'll find some way to shame and reject you publicly if you mess with ours."

And the media, well… that's just a matter of consequently using the image as a link to Eric's explanation page. People will pick up its real meaning, and if they don't they should be politely corrected. I hope the real hackers among us are civilized enough to keep their anger down if anyone uses it in the wrong way.

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.