Archive for August 2004

Get 'em off the road... - 2004-08-07 01:30:51

Drivers under 21 are likely to be forced off the road between 10pm and 6am, restricted to carrying one teenage passenger and not allowed to drive cars deemed too powerful.

...

Drivers up to the age of 20 represent 7 per cent of all drivers but are involved in 18 per cent of fatalities, according to Mr Scully. And there is a "huge spike" in young drivers in fatal crashes between 10pm and 2am. They are involved in 25 per cent of all fatal crashes between those hours.

Young driver curfew: off the road by 10pm - SMH

This is better (in my selfish world view) than the previous suggestions of placing such a ban on P-platers. Since I'm a P-plater. After all the spike is in young drivers who of course are mostly P-platers, rather than in P-platers who happen to be young.

However, I still have issues with this.

Not allowing multiple teenage passengers has the problem of then increasing the number of cars needed by teens to get places - and in many areas a car is the only working means of transport. In my (now ancient) experiences with teenage drivers, safety was reduced when multiple cars were involved in getting somewhere. After all you can't race when there's only one car...

Not driving too powerful cars has the problem (which is mentioned in the article) of causing some people to not drive daddy's air bag equiped, crumple zoned, and so on new car (if it happens to be too powerful and instead drive an old tank line Torana - which tends to transfer all the energy to be dissipated in a collision to the passengers.

Not allowing people under 21 to drive after 10pm will result in a lots of 21 year olds who have years of driving experience, but almost no driving experience in late night conditions driving late at night. We require Learner drivers to drive at night (and in the rain - if that's possible in these dry conditions) before letting them get their Ps. I thought that was precisely because P platers had lots of accidents in such conditions - so wouldn't this result in 21 year olds having lots of accidents at night - another huge spike to appear in a few years time?

Zaurus hell... - 2004-08-11 03:33:39

My work, for the moment, involves writing software that will run on a Zaurus (SL-6000) and an iPAQ (don't know the model).

I've been using python since it's quick and easy and happened to already be installed on the iPAQ. Everything was going fine until the Zaurus arrived and I needed to port the code...

I wrote my code to be portable - it's the obvious thing to do when writing code. The iPAQ uses GTK+ for the GUI stuff, while the Zaurus uses Qt. So I've added a client/gui/qt package alongside the already existing client/gui/gtk package (clearly, I saw this coming).

However, the python on the Zaurus wraps an old version of Qt and hence doesn't have all the widgets I'd like to use. It also doesn't have ossaudiodev, but instead the ancient linuxaudiodev - and that won't open in 'rw' mode for reasons I don't understand.

So I decided I'd try compiling my own python (mainly for the audio stuff the older Qt is usable enough). Being an idiot I decided that cross compilers are for girly-men and that I'd run a compiler on the Zaurus itself. So for the last couple of hours things have been compiling on the Zaurus while I read my mail on the 2.4Ghz P4...

As you might expect python failed to compile, complaining about not being able to link in stat64. I couldn't see why it was having trouble so I wrote a tiny test program:

#include <sys/stat.h>

int main() {
        struct stat s;
        stat("/", &s);
        return 0;
}

Which manages to not compile complaining about not being able to find stat at link time.

After a little searching, I discovered that there is no trace of stat or stat64 in the libc.so on the Zaurus. There was however, __xstat and __xstat64 - which are gcc's internal do the syscall functions. So I wrote my own stat and stat64 in terms of them and that problem went away.

I can't help but wondering which clown thought they'd leave out stat. It's a reasonably essential part of a libc and since it's a trivial wrapper around the __x* functions which do exist it doesn't take up much space. The thing comes with bash so clearly stat() is around somewhere, I can only guess it's implemented in their sys/stat.h and not included in the libc.so. Seems a mighty strange thing to do all the same. Of course the fact that the headers I'm using are obviously different than those the system used is a bad sign...

Should live another year... - 2004-08-18 02:46:19

I got my medical results back, and apparently I don't have syphilis, HIV, or tuberculosis. I even qualify as "fit and healthy" it would seem, all appearances to the contrary.

I also have a letter from the Police saying that I don't have a criminal record, making for a very short police history report.

Which is all good, on bad side the man at the US Consulate didn't ask me so why do you want to go America?, which means I didn't get to answer: because, Australian McDonalds don't do supersize. Anna was most disappointed that I didn't get to use that answer of hers. Maybe next time, after all many months after beginning we still need to supply three more documents before they'll grant (or deny) a visa.

The immigration section of consulates are interesting places. Where else can you see multiple people who are engaged to someone they first met on the internet? And they have to explain within earshot of room filled with bored people who have been waiting for four or five hours in an area with no magazines, no food, no toilets, and in which you are not allowed to turn on electronic devices (to access any of these things to the bottom of the elevator you must go and then back through the two sets of security checks, and then be told you can't take your coffee inside - I guess they don't want hot coffee being thrown at people?).

You also get to hear people explain how they could forget about that conviction for shoplifting when they ticked the No box to the Have you ever been convicted of a crime? question. And see the amazed looks on the faces of Americans when they find out that even though they left the USA when they were six months old and have never returned, the IRS still requires them to have filed tax returns for all those years they were working in whatever country they did live in.

Testing, Testing, Testing - 2004-08-31 06:10:52

Why do so many programmers not bother with useful testing?

;wc text.[ch] text_check.c
  175   489  3807 text.c
   34    77   586 text.h
  330  1147  9992 text_check.c
  539  1713 14385 total

Writing 330 lines of code in order to test the 209 lines of actual useful code is just not fun.

Are other professions like this? Is over 60% of the work done by an architect completely unrelated to the actual real building design they are creating? Do doctors spend 60% of their time doing things that do nothing to make sick people better?

My test code will not be used in the final product, it does absolutely nothing except exercise the incredibly simplistic buffer gap code. It does some replaces() and some undos() and some redos() and makes sure the text is what it should be at every step in the process. It does trivial things like making sure freshly created data structure actually results in len()==0. It can't do much else, since the buffer gap doesn't support much else.

It's amazingly useful code to me, in that without it I wouldn't know if the real code actually worked. But it means that 60% of my work isn't real. 60% of the work is not part of the work, so to speak.

Anyway, I guess when you choose to use C you get what you deserve.

List All | Archives: 2002 2003 2004 2005 2006 2007 2008