Older blog entries for Spooky (starting at number 14)

I've just finished making sure that gnome-games in CVS compiles under GTK+ in CVS with deprecated functions disabled. There are still a few functions that just kick up a warning but link OK left, but all the option menus and old gnome color pickers have been replaced. The problem with a package like gnome-games is that, because it consists of sixteen individual programs, trivial updates get magnified by a factor of about ten. For example there where 69 instances of gtk_timeout_add, of which all but 13 have now been converted to g_timeout_add.

The good news is that the new GTK+ code is, in general, shorter and easier to read than the old. So the GTK+ team is definitely doing the Right Thing (TM).

Of course it hasn't just been code renovation, I spent the afternoon outside playing soccer, cricket, and touch rugby with everyone from the lab.

I was formatting a new ext3 filesystem today and wondered what block size actually suited my needs. A quick survey of the files on my laptop revealed that space consumption is about 95% efficient. Reducing the block size would only grab back about 1% more. This is despite 60% of the files being smaller than a single block: most of the blocks are still dedicated to big files. So the lesson to be learnt is that you will gain more by reducing the reserved space (which defaults to 5%) than reducing the block size to relieve file slack.

Naturally I did both.

Hardware

I bought myself a nice, shiny, 19" LCD monitor to replace the dodgy nine year old 14" CRT I had been using for the past year. Having an image that doesn't change width depending on how bright it is and not having a red gun that occasionally stops working is nice. Although a sharper image means I notice all the jagged edges now (the old monitor was somewhat "mushy" since I ran it at 1024x768 and it was only rated for 800x600, but this isn't necessarily a bad thing). Also my G5 has apparently shipped, but since it is going to have to traverse the US twice and then cross an ocean before getting to me I'm not too excited yet.

Software

I must get around to doing the gnome-games 2.4.1 release. There's only been about three bugs fixed since 2.4.0, but if people only report three bugs what else can they expect ?

Television

My life is going to revolve around television for the rest of the weekend. The rugby world cup has started and I watched the All Blacks' first match today. They flattened Italy as expected. Since I am a motor-racing fan tomorrow is a big day: The Bathurst 1000 race is most of the afternoon followed by the final Formula 1 race of the season in the evening. I enjoy watching Bathurst, a lot can go wrong in 1000 km.

I have started to look at why all my GNOME apps take a few seconds to start up when they should just fly. Basically the moment the code hits gtk_widget_show_all things come to a grinding halt. I know that this function does a lot of work, but 2-4 seconds on a dual 1.3 GHz machine to set up a simple window ? Non-GNOME gtk programs are fine so there is something about the GNOME-specific widgets that is causing trouble. This is work for another night, I need to sleep now.

gnome-games

I've fixed almost all the user visible bugs in mahjongg. Of course there are still some nasty things behind the scenes and resizing is still a little slow and the SVG theme stilll sucks. But it is playable.

This of course frees up time to go and deal with other parts of gnome-games. Which I won't do because I am about to go outside and enjoy myself.

gnome-games

I've just uploaded my scalability changes for mahjongg to CVS. The most immediately noticeable effect will be that some things just don't work quite right (like the background colour). It is in a state where it is playable (if you use default.png as the tileset). Known bugs include:

  • Auto-apply of preferences is at least partially broken, but not for the reasons you would think.
  • The background colour doesn't work at all.
  • The SVG tileset (which is the default of course) is incomplete and sucks big time. Use default.png instead.
  • The old seta.png could in principle be put back in, but I haven't got time this evening. I will do it sometime.
  • The window size isn't remembered yet and the minimum size is arbitrary.

These things will get fixed, but I'd prefer to get something out there now rather than wait any longer. People with SVG skills are encouraged to make new tilesets. Each tile has proportions 64x88 with a "thickness" of 8. There are two rows of 42 tiles plus a blank at the end. The top row is the normal form and the bottom the hilighted form. Alpha is supported, but gets converted to straight bi-level transparency in the end.

Laptop

The keyboard has been replaced, along with some tape over the rough edges that caused the original problem. Now that I have some spare keycaps I might just replace the windows keys. (If I can be bothered, one of the reasons for purchasing this particular model was that the windows keys were small and stuck up in the corner and didn't chew valuable space)

mahjongg

I have to redo all the graphics for the tiles. That's 42 unique tiles in each tileset (not counting the "highlighted" versions). Very, very, repetitive: it sounds like a job for a computer. So I'm writing a perl script to draw tilesets for me (in svg). I supply the creative bits, the script does the hard work. Looks good so far.

Laptop

It turns out that a keyboard for the laptop actually exists in this country (the computer wasn't purchased here). It may even make it here by tomorrow. Given where I live this is truly amazing.

Friends

There have been several old friends I've been meaning to catch up with since I got back nearly a year ago. I ran into one of them this evening and it turns out she now lives just up the road from me. This just leaves MAXINT to go.

gnome-games

Mahjongg is two bugs away from being uploaded to CVS. Thats not to say that it only has two bugs, just two that make it unusable after the rewrite. One is a matter of searching for the new style of graphics files I use. This isn't a big issue, I just haven't got around to it yet. The other is that I only have one example of the new graphics format, and it isn't complete. In principle I can play a complete game, but since two-thirds of the tiles are blank it doesn't really work out :).

Laptop

I managed to destroy my laptop's keyboard today. Some of the keys were sticking, so I took the keyboard off to clean it. Unfortunately the design of the keyboard is such that the ribbon cable connecting it to the computer folds back over a metal edge. Thin plastic film, meet sharp metal edge, sharp metal edge, meet thin film. Oh dear. These plastic film ribbon cables are virtually impossible to solder anything to and even when you succeed the join is very, very, fragile. Tomorrow I get to find out whether the local Toshiba people are worth anything. (I can't buy a new laptop, I've only just ordered a G5 which kind of wipes out the toys budget.)

22 Sep 2003 (updated 24 Sep 2003 at 11:55 UTC) »
Gnome

The whole mahjongg business was getting me down, I had some working code and had removed a lot of the old "bad" code. So I left it for a few days. Got back to it last night and rewrote 80% of what I had previously written. The separate foregrounds and backgrounds are gone and the whole thing more-or-less works again. Well, the redrawing of individual tiles is broken, but thats because of a bug, not because of unwritten code. Some bits of code are inefficient place-holders, but all-in-all it looks a lot nicer and cleaner. It should be faster too (about five times faster redrawing the entire board, and it uses less memory). However it is still going to be some days before it is ready for CVS.

Bit-rot

gnome-games is a particulalry bad place for code. It gets left for a long time and slowly rots away. Looking at the mahjongg code you see functions that were obviously written one line at a time, each time by a different person fixing a different bug. Lines like:

#undef GNOME_DISABLE_DEPRECATED

do not inspire confidence either. The disturbing bit is that according to the ChangeLogs it was a good idea at the time. Of course mahjongg was at least initially written as a GNOME program. Gtali was originally a curses program that was ported to GNOME. The old code uses one CapitalisationConvention and the GNOME code uses another capitalisation_convention. There was also a very awkward separation of the code so that both curses and GNOME front-ends could be compiled from the same source. Fortunately the original source had been relatively clean when everything started.

The code really needs regular rewrites to clean up the mess that successive bug-fixes create. I try and be careful about the code I add: I try and fix the cause of a bug, not its symptom, but still everything decays. This is why I'm doing the big rewrite on mahjongg. I know that in six months time someone will look at my code and curse me, but it will be a lot better than if I hadn't touched it.

Life

Yes, I have one. It's kept in a locked box under my bed.

17 Sep 2003 (updated 22 Sep 2003 at 12:30 UTC) »
gnome-games

Finally ! Someone found a clear and hideously ugly bug in 2.4.0 ! I knew there had to be at least one stupid mistake. Remember kiddies, using global search and replace to edit your code will get you in trouble.

I'm continuing to refactor mahjongg with an axe. I think I've got rid of all the old code, it's just that the new code isn't quite working yet.

Microcontrollers

My homemade programmer works, I can now download arbitrary code to the ATTiny15L and get it to execute. All I have to do now is figure out something I want to do with the microcontroller (aside from lighting a single green LED) and perhaps compile binutils with AVR support so I'm not doing the assembly by hand.

5 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!