22 October 2003

Laptop

I started running out of space on my laptop, so decided it would be easier to buy a new hard disk rather than clean things up (after all, I could get a 40GB drive for about AU$200, which would give me more than 3 times as much storage, and had almost identical power requirements). If only things were that easy …

After backing everything up, the first problem was taking the old hard disk out of the machine. The m300 is quite a nice machine, as you only need to undo one screw to remove the hard drive mounting. Getting the hard drive out of the mounting was a bit more of a problem as there were two torx screws holding the drive in. Moreover, I didn’t have access to a small enough torx driver :(. Luckily the screw heads were raised enough that it was possible to undo them using some pliers without damaging anything.

After getting the new drive into the mounting frame and into the machine, I needed to get Windows 98 onto the drive. This was required to get the hibernation working under Linux (the BIOS saves the contents of memory to a special file on the Windows partition). It turned out that the CD that came with the laptop was a quick restore disk, and wanted to create a full 40GB partition, rather than use the use the smaller partition I had already created. It them proceeded to screw up the restore, leaving me with a system that (a) wouldn’t boot fully, and (b) was convinced that there were errors on the hard disk, but just couldn’t find them. I guess that the restore CD managed to mis-format the drive somehow. In the end, I had to borrow a 98 CD and do a clean install, which worked perfectly (and let me install to a smaller partition). I can see how a quick restore CD could be useful in many common cases, but this one was nowhere near as robust as I would have liked.

Compared to this, getting Linux up and running was trivial. After completing the restore, I did a few tests with hdparm -Tt which showed that the new disk had a read performance of 25MB/s (in comparison, the old disk did 13MB/s), which has resulted in noticably shorter compile times on the laptop. It is also a lot quieter when busy.

This should put off the need to get a new laptop for quite a while.

Gnome 2.5

Updated my system to CVS head, and things are looking good. The new Nautilus feels even faster (especially in spatial mode). Apparently metadata plugins are planned for 2.6, which should be interesting. It should allow people to implement things like TortoiseCVS, augmenting the existing views rather than creating a completely new view like Apotheke does.

Python

Been reading over Ulrich Drepper’s paper on how to write shared libraries, and it struck me that use of the PyArg_ParseTupleAndKeywords() function will result in a lot of relocations that can’t be avoided.

I did a few tests using some dummy extension modules that contained a number of functions. I tried varying the number of functions, number of arguments for each function, and whether keyword arguments were supported.

I found that in the PyArg_ParseTuple() case, the number of relocations was proportional to the number of functions (as expected — a few relocations for each entry in the PyMethodDefarray. For the PyArg_ParseTupleAndKeywords() case, there was also one relocation for each argument listed in the keyword list array, which dominated as the number of arguments went up.

I haven’t checked how much influence this has on the startup speed, but it would make a difference to the amount of code shareable between processes for larger modules.

1 October 2003

linux.conf.au

They accepted my abstract submission for LCA in January! The lineup is of invited speakers looks really good, so everyone should register. Hopefully they can outdo the conference we put on in Perth :).

.au Politics

A number of changes to the federal government cabinet this week, because Richard Alston (aka World’s Biggest Luddite) is resigning as Minister for Communications, Information Technology and the Arts. He is getting replaced by the current Attorney-General Daryl Williams, so it will be interesting to see how that plays out.

As part of the reshuffle Phillip Ruddock, the immigration minister, is taking over as Attorney-General, which prompted this quote:

“To move Mr Ruddock, who’s an international law breaker, who’s incarcerated innocent people behind razor wire in conditions which would be unacceptable in most prisons in Australia to chief law officer of the land is appalling”

Bob Brown, Greens Senator

I guess this is partly related to the reports of Immigration officials encouraging asylum seekers to obtain illegal travel documents so that they can be deported to some other country.

The new immigration minister is Amanda Vanstone, who I remember most for screwing up education.

Cairo

Did some more hacking on my Python bindings for Cairo. They are now in the new freedesktop.org CVS server.

I added a cairo.gtk.set_target_drawable() function that sets a Cairo context to draw on an arbitrary GdkDrawable, taking into account the temporary pixmaps used by GTK for its double buffering and the expanded virtual 32-bit coordinate space (based on some of Carl’s code in grrobots).

I ported a few of the Cairo demos to Python/GTK for testing purposes, and they all seem to be working fairly well. The exception is the knockout demo, which doesn’t seem to be redrawing properly (a bad interaction between Cairo and GTK’s double buffering, I guess).

15 September 2003

PyCairo

Been discussing the bindings on the Cairo mailing list. I’ll probably be merging my bindings with Maarten’s ones.

I also brought up a few changes that would make it easier to write robust language bindings. Since the API is fairly new, the changes will probably go in.

PyGTK

LWN covered the pygtk 2.0.0 release. 2.0.0 is also in RawHide too, so it looks like it should be a usable baseline in the near future.

In CVS, the move on to GTK 2.2 APIs is under way. It is still necessary to test them, and add a few custom overrides, but things are looking fairly good. The wait for 2.2.0 shouldn’t be anywhere near as long as the 2.0.0 dev cycle :)

10 September 2003

Cairo

Started on some Cairo bindings for Python. At the moment, they are fairly immature, but shouldn’t require too much more work before I can test them.

Differing a bit from the C API, I’ve made the cairo_matrix_t type immutable from Python. That is, all the operations that modify a cairo_matrix_t have been wrapped in such a way that they return a new matrix rather than modifying the old one.

I also set things up so that cairo_status() calls are made automatically after operations, and an exception rasied if appropriate.

The next thing to do is to set up some shim code to make the binding usable in conjunction with PyGTK. This will probably just be a bit of code in an extension that lets you create a cairo.Surface from a GdkDrawable or GdkPixbuf (in 24-bit RGB format — since GdkPixbuf uses RGBA and Cairo uses ARGB, it doesn’t look trivial to render into an RGBA pixbuf).

Talked with keithp on IRC a bit about the extension, and some changes to the Cairo API that would make the extension’s life a bit easier. Will follow it up on the list.

Mail Viruses

As predicted by the anti-virus firms, it looks like Sobig.F has stopped propagating (based on the sudden drop in virus bounce messages I have been receiving). About time.

8 September 2003

There was a really weird interview on Lateline last friday. They now have the transcript. Christopher Pyne really reminded me of Dexter Pinion from Backberner.

Looks like the government put up a website for one of the weirdest community service announcement I’ve seen in a while. I wonder if they intended to make it as funny as it seemed?

5 September 2003

PyGTK

A story was posted on FootNotes about the 2.0 release. A number of nice comments. The 2.0.0 package has hit Mandrake cooker, and a Fink package is apparently in the works.

I’ve started work on adding support for the GTK 2.2 APIs, which shouldn’t take very long at all. I’ve updated the .defs files, which covers most of the APIs. There are some others that will require a little more work.

PyGTK 2.2 will be a drop in replacement for 2.0.0 when it is ready, just as GTK 2.2 is.

Mail Viruses

Only 5 days til I stop receiving bounces from the sobig worm! I had hoped that people would fix their mail servers, to not send out these erroneous bounces, but no such luck :(

I wonder when the next one will strike?

TV

The new series of CNNNN started a couple of weeks ago. Been pretty good so far. I don’t think it is the kind of show that they could syndicate overseas though :)

PyGTK

Finally got version 2.0 of PyGTK, PyORBit and Gnome-Python out. I sent the announcements a bit further than usual this time (gnome-announce-list, python-announce, etc). Already, it is in Debian, Mandrake Cooker and there is a Win32 installer. PyGTK is also buildable/runnable on MacOS X, provided that you have an X server installed (such as Apple’s one). If you have been holding off from looking at PyGTK 1.99.x, you should definitely take a look now.

This release has been a long time in the making:

  • 595 revisions to the ChangeLog (out of 670 revisions on the main branch in CVS) since branching the 1.2 bindings.
  • Over 5000 lines in the ChangeLog.
  • Over 3 years since branching.

The result is a binding that is a lot nicer to use, and will be much easier to maintain. It does demonstrate that you lose a lot of time when you decide to do a rewrite. At the same time, I don’t know if it would have been feasible to get from the old 1.2 bindings to where we are now in small incremental steps. I am very happy with what we have now though.

Updating the binding for GTK 2.2 (and GTK 2.4 after that) is going to be a lot easier and quicker. All the infrastructure is in place, so it is a simple matter of adding the new APIs. The 2.0 to 2.2 delta is much smaller than the 1.2 to 2.0 delta.

It is a similar story for the Gnome bindings, although we will probably skip to Gnome 2.4, since it is almost out and contains some new APIs that are interesting from a language bindings perspective. I won’t need to rewrite the CORBA bindings this time either :).