Hitchhiker or Sin City?

Come early May, we’ll all be in England for the Wedding of Andre and Julie. It gives me a chance to catch one movie that isn’t released in Norway yet. I thought it was a no-brainer: The Hitchhiker’s Guide release date for Norway is in Mid-August! But then I read MJ Simpson’s review of the movie, and if only half of what he says is true, then this is just what everybody feared: Disney has completely missed the point, and they are pissing on Douglas’ grave.

So the alternative is Sin City, which is already released, is getting pretty good reviews, and not going to be shown in Norway before July. I am just not anticipating it as much as I was HHG2G.

I think what I really want to say is: I am very, very sad to hear that the movie is (very probably) so terribly, terribly bad.

My teeth are killing me

I was at the dentist on Wednesday. One of my lower wisdom teeth had a hole, and it seemed like a good time to pull the bastard, so that’s what she did. Only during the procedure, the crown broke off, and a piece of the root was left in my jaw, where it wasn’t possible to get it out without major surgery.

So tomorrow (one week later) I’m going to see a surgeon. In the meantime, the tooth (or what’s left of it) hurts. Or more precisely:

It HURTS!

I’ve eaten nearly 30 ibuprofen tablets since wednesday, and they give me about 4-6 hours of peace before I’m screaming again. Luckily, I can sleep even with the pain, the whole thing seems to calm down. And I’m drinking camomille tea, in the hope that it helps against something. I seem to remember that’s what my mother gave me as a child.

Get off my network if you can’t update your computer!

By now, we all know that the main reason there are so many viruses and spam going around these days are Zombie PCs. These are Windows machines which heir owners did not upgrade, and which got attacked by one of the many exploits for Outlook Express, Outlook or Internet Explorer.

Why do these people not update Windows? Because to them, there doesn’t seem to be a problem, not until it’s too late. So let’s tell them – reject email from Outlook/Express if it’s not one of the latest versions. Some people might want to reject all Outlook email, but I wouldn’t go that far, yet.

There are two good ways to go about this: at SMTP time, or in your mail filter. I’m using Exim 4 and procmail for my two examples here, YMMV but you’ll get the point.

To make exim reject old Outlook versions, we can write a system filter. In general, this is sotred in /etc/exim/system-filter.exim. Your rule could look something like this:

if $h_x-mailer: contains "Outlook"
   and ( $h_x-mailer: matches "5\.[50]0\." or $h_x-mailer: matches "6\.00\.2[678]" )
then
    fail "<> \
         This message has been rejected because it was sent from an \n\
         unsafe computer.\n\
         If you intended to send us email in the future, please go to \n\
         http://windowsupdate.microsoft.com/ and install any available \n\
         security updates."
    seen finish
endif

This rule will reject mail from versions 5.0, 5.5 and from older 6.0 versions at SMTP time (so the mail never really makes it into your system) and send a failure message back to the server. You can easily extend it to cover more versions. If you want to know which version of Outlook / Outlook Express is currently considered “safe” by Microsoft, you can find them on this page.

You may not have access to your system mail filter, or may not want to go so far as to reject the mail – maybe a warning is all it takes? And maybe you don’t have exim on your system. Then you can try combining a procmail recipe with a script. In your .procmailrc file, simply add these lines:

:0 ihc:oe.lock
* ^X-Mailer: Microsoft Outlook Express \/.*
| $HOME/bin/oewarn.sh $MATCH

The oewarn.sh bash script is a wrapper around a python script doing the detection, that will send a reply in case we don’t like the version. It looks like this:

#!/bin/sh
SENDMAIL="/usr/sbin/sendmail"
$HOME/bin/oewarn.py "$1" || ( formail -r -I"Precedence: junk" -A"X-Loop: eressea@eressea.upb.de" ; \
  cat $HOME/bin/oewarn.txt ) | $SENDMAIL -t

The text file oewarn.txt contains your nastygram message – what you want the sender to receive. The python script oewarn.py contains the magic to decide what version we have and whether we like it:

#!/usr/bin/env python
from sys import argv, exit
from string import split

def verify(versionstr):
    version = split(versionstr, '.')
    if len(version)==4:
        try:
            major, minor, release, build = map(lambda x: int(x), version)
            if major < 6 or release < 2800 or build < 1123:
                return 1
        except:
            pass
    return 0

exit(verify(argv[1]))

In my case, the message you receive would read like this:

Your computer is a danger to the Internet!

You are running a severely outdated version of Outlook Express (and possible
Internet Explorer). These two programs are the main reason the Internet is
clogged with spam and viruses today. Using Outlook Express is bad enough;
but failing to install critical updates is criminal negligence.

You will be given up to 3 warnings before we refuse to accept further emails
from your account. If you want to continue sending email to this address,
please update your software. Or even better, use a modern, safe Mail
program: http://www.mozilla.org/projects/thunderbird/

If you have a question regarding this policy, please contact
postmaster@eressea.de

Fun Code

I’ve been going through a lot of the 3 million lines of Anarchy Online code the past months, and seen several bits that make me, as a programmer, laugh. These are completely unfunny for non-programmers, of course. And they aren’t representative for most of the AO code, because that runs pretty well these days.

Here’s a good one, from the just-in-case department:

return this?m_nValue:0;

Found the same one in the Miranda MSN plugin. Note the informative comment.

  if ( this == NULL )  // :)
    return 0;

Then there’s the gratuituos memory leak (props to André who showed me this one today):

void foo(const char * s, int v, std::map& amap) {
  char * p = strcpy(malloc(sizeof(s)+1), s);
  amap[p] = x;
}

Here’s a redundancy that I wasn’t certain about, but I checked the standard, delete NULL is allowed:

if (p) delete p;

My favourite though:

void foo(int i) {
  char b[11];
  sprintf(b, "%d", i);
 ...
}

This bombed. Signed integers require 12 chars to represent, including the trailing space. But that’s not the funny part. The funny part is that I checked who did it, and it turns out the previous person that touched the code must have found a similar error. The diff he comitted was this:

- char b[10];
+ char b[11];

How long should we wait?

WaitForSingleObject( MyThread_c::GetInstance()->m_hThread, INFINITE ); // wait max 2 seconds

Like I said, none of this is funny if you’re not a programmer. And I probably forgot some of the better ones. So, have you got any code stories of your own?

New Hitchhiker’s Guide Trailer – another one!

It’s here at UGO, and while it uses a lot of the same images from the movie that the previous one used, I like it much better. That is mostly because it has the voice of The Book in there. The Book in the new movie is spoken by Stephen Fry, but the voice in the trailer doesn’t seem to be him. Maybe that’s because I’ve heard his dubbing voice so many times?

Anyway, I need an excuse (well, another excuse) to be in London in early april. Release Date in England is April 29th, and in Norway it is… August 12th. After almost everybody else, but five days earlier than the release for the french-speaking regions of Switzerland. This is one of the very few occasions where it really sucks to live here.

[Listening to: Life On Mars? – Seu Jorge – The Life Aquatic OST]

Add 4 inches!

I finally got a new screen. Until friday, I was working on a Sony 17″ monitor, and it couldn’t do more than 85Hz in 1024×768. That is the resolution I’ve been running for almost 10 years now. I bought that screen in late ’95, when 17 inches were a lot of screen space (athough you only got 16.2 visible).

These days you can probably buy a 17″ notebook, and I’ve had 21″ CRTs at work for years. And when I got a 19″ LCD some months ago, it was just a question of time when I would have something like it at home. And here it is. Through work, I got a 20% discount on a DELL 2005FPW LCD screen, 20.1″ with a 1680×1050 widescreen resolution. I wasn’t sure if I’d like widescreen, but so far, it’s been real nice.

I turn the screen at work 90°, which lets me have two source files underneath each other, or one with very long functions. With this screen, rotating it looks a bit awkward, but I can easily have two pages of code next to each other, which is just as good. Here’s how my desktop looks. Next thing I’m going to do is hook it up to the gamecube and finish Eternal Darkness in widescreen, the way it was meant to be played.

World Jump Day Idiocy


I can’t believe how many places I have seen the link to World Jump Day this weekend, and how many of those take it serious. Has everybody been sleeping in their elementary physics class? This isn’t rocket science.

My own proposal would be to build a big rocket and launch all these people into the sun. I’m almost certain that this would cause a positive change in course of the world.

Only in Norway

Well, I guess they have these in other places, too. I’ve just never seen one before. It’s a separate trash container for syringes, which makes sure that once the syringe is in, no playing children or really desparate people can get it out again.

Like I said, it’s the first time I see one of them. I was doing a cache near the Oslo public library a few weeks ago when I found it. Took the picture mostly for April’s benefit.

Competition Pro USB and the Future of Retro

Retro Gaming will one day be an industry, I am sure. Everyone in my generation has wonderful memories of their favourite C64 or Amiga games. Or Apple ][ and PC/CGA if you are a lamer like me who had one of those.

But face it, we can’t play these games any longer. Years of brainwashing by the games industry has conditioned us to get dizzy looking at anything less than 24 bit color or listening to less-than-surround sound. We may get out the old emulator to play a game or two for old times sake, only to note that our memories are so much better than the actual games, but surely we would not buy those games today? You can’t play anything from the 80s for more than a day. But how can we love something so much and still hate it?

But then there are games like Space Tripper or Mutant Storm. Follow those links and buy them now. You can read the rest of this when you’re done. These games capture the essence of what was good in the old games, but they do not force 8 bit sound and 4-color graphics down our throat. This is what I’m talking about. Good game concepts in a nice audio-visual package, at a price anyone can afford (in this case, $14.95) I want more of these games. Please, go and make them! And I don’t mean none of that shareware shit you slap together in a week.

I believe that there will one day be a larger market than today for these kinds of games. Game concepts from 20 years ago, with today’s production quality. Someone has to make them and, more importantly, sell them.

And to play these games (and the C64 games on VICE), I will need a Competition Pro for USB. It has been made, it is being sold. All I have to do now is to find me a norwegian importer.

PS: Wizball still rocks!