Older blog entries for jamesh (starting at number 164)

Foundation Elections

There has been talk on the foundation list about changing the vote counting procedure to something more fair. The method being proposed is Single Transferable Vote, which is the same system used within a single electorate for the senate vote in the Australian Federal Election. As with the Australian elections, some people have some trouble understanding exactly how it works, so here is a description.

  1. Each voter orders every candidate on their ballot in order of preference. Each ballot is assigned a weight of 1.
  2. The ballots are grouped by the first preference.
  3. If any candidate's total reaches the quota, then they get in. The quota is chosen such that if there are s seats, then at most s candidates can reach the quota. So a candidate must get more than n/(s + 1) first preference votes in order to reach the quota.
  4. If any candidate gets over the quota, then the highest vote getter is elected, and their votes are redistributed at a reduced strength. If x people voted for the candidate, then the weighting of each of the votes is scaled by (x - q)/x where q is the quota (x - q is the number of votes over the quota). The winning candidate's name is removed from all ballots and we go back to step 2 and repeat to find the next winner.
  5. If no candidate reaches the quota, then the candidate with the least first preference votes is removed from the election. Their name is removed from all ballots, and we go back to step 2. The votes for the removed candidate are redistributed at the same strength, since they didn't help elect a candidate.

Note that this vote counting system is identical to Instant-runoff voting when there is only a single seat. The quota calculation shows that the winning candidate needs to get more than 50% of the votes to win, as expected.

Some of the nice properties of this system include:

  • If you vote for a losing candidate, your vote is transfered at the same strength, so is not wasted. This reduces the risk of voting for a candidate that is unlikely to win.
  • Voting for a popular candidate doesn't waste your vote. The portion of your vote that wasn't needed to elect the candidate is redistributed to the next preference. For example, if 50% of people vote for dcamp, but the quota is 10% of the votes, then all his votes will be redistributed to second preference at 80% strength.
  • If there are two similar candidates, they shouldn't split the vote in such a way that neither wins. If one candidate gets knocked out, their votes will transfer to the other.

There are some differences between what I described and what is used in the Australian elections. This seems to be to make the process more discrete and easier to count (mostly rounding the various quotas and transfer values). For the foundation election though, I can't see any reason not to use a more exact version.

Zenity Notification Icon

Yesterday Glynn posted about notification icon support in Zenity. His current implementation really only handles one-shot notifications, since the icon disappears and zenity exits when you click the icon.

I talked with him on IRC about adding support for a different mode where you send commands to zenity via stdin, similar to the jhbuild notification icon prototype Davyd did. This would allow you to write bash scripts like this:

exec 3> >(zenity --notification)
echo "icon: someicon" >&3
echo "tooltip: doing some important work" >&3
# do stuff
echo "icon: someothericon" >&3
# do some more stuff
exec 3>&-

This could be very useful for many scripts in addition to jhbuild, which is why I suggested adding it to zenity. Now it just needs implementing ...

7 Sep 2004 (updated 7 Sep 2004 at 06:09 UTC) »

linux.conf.au

The LCA2004 team have put together the conference CD and DVD. Apparently they will arrive in the mail in about a week.

They put the CD contents on the web first, and I was a bit disappointed that the recording of my talk was missing (it does include my slides though). However, when they put the DVD contents up I saw that it included a video recording of the talk, which is pretty cool.

There are links to the CD and DVD contents on the wiki. The video recording can be found by following one of the "Explore DVD" links, and looking at the entry second from the bottom. There is also a video of Havoc's keynote in there.

jhbuild

It sounds like Fluendo are looking at using the Subversion support I added to jhbuild. There were a few bugs in the code that jdahlin fixed, but it seems to be working pretty well. I still need to fix up the Arch support so that you don't need tla unless you actually build a module managed by Arch.

I've also dropped one of the old versions of Automake (1.6) from the bootstrap moduleset and sanity checks. Maybe after Gnome 2.8 is out we can clean up the last few modules still requiring Automake 1.4, which should drop the number of Automake versions I need to deal with even further.

Elections

Today is the last day people can enrol to vote in the federal election. Last week we had John Howard defending one of his part members, Trish Worth, for comparing refugees to animals at a forum organised by the group Justice for Refugees.

There is also a Liberal (Peter King) who lost preselection, but is still running as an independent. He has been accused of splitting the conservative vote, which is a bit strange. I'd assume that conservatives who vote for him would give their second preference to the Liberal candidate, and vice versa. What might happen is that Labor voters might pick the independent candidate over the Liberal candidate (this happened in my electorate when a similar thing happened a few years back).

Meanwhile, the National party leader is going round telling people that the Greens are really communists: "They are watermelons. many of them - green on the outside and very, very, very red on the inside."

One other weird thing was the postal vote applications sent out by the current MP. The weird thing was that they came with reply paid envelopes to send the application back to the MP instead of the AEC. She explained why in response to a letter in the local paper, but it still seems a bit weird for the applications to pass through the office of the currently elected member.

Federal Election

So the Federal election has been announced for 9th October. If you are an Australian living overseas, now would be a good time to apply for a postal vote. It'd be great if this gets rid of John Howard. Of course, even if he does win he will probably retire soon after the election ...

Last week, it also turned out that John Howard is a spammer. He paid his son's company to send out unsolicited email to members of his electorate. Apparently our anti-spam laws include exceptions for political parties, so it might not be illegal. However, the Labor party are chasing it up whether it was legal for a third party to send out the spam (since they don't have the protection of the exemption). On the brighter side, it might encourage the politicians to rethink whether the exemptions in the Spam Act are a good idea or not.

Python Unicode Weirdness

While discussing unicode on IRC with owen, we ran into a peculiarity in Python's unicode handling. It can be tested with the following code:

>>> s = u'\U00010001\U00010002'
>>> len(s)
>>> s[0]

Python can be compiled to use either 16-bit or 32-bit widths for characters in its unicode strings (16-bit being the default). When compiled in 32-bit mode, the results of the last two statements are 2 and u'\U00010001' respectively. When compiled in 16-bit mode, the results are 4 and u'\ud800'.

So rather than just being an implementation detail, the unicode string width chosen at compile time can alter the result of Python programs that manipulate characters outside of the basic multilingual plane. It would be nice if Python programs didn't have to care about this sort of detail ...

Oxford

I've been in Oxford for the past week at the Canonical conference. There are lots of great people here, working on a lot of cool projects. Jordi's blog has a lot more info about it.

Bushisms

I found this one quite good.

Compulsory Voting

tberman: I agree that voters should have the right not to vote for anyone, but don't feel that simply not turning up to vote is a good way to do so. In a non-compulsory election, the non-voter count is going to be comprised of those who are abstaining from voting, and those who are simply two lazy to turn up. With compulsory voting, those who don't wish to vote for any particular candidate can simply leave their ballot blank, which is known as an informal vote.

Given the difference in turnout between U.S. and Australian elections, I'd guess that a fair number of the people who don't vote in the U.S. would vote if they had to turn up to a polling place on the day.

I also think it is important for as many people as possible to vote. The people who get elected are supposed to represent the electorate. When there is a clear majority it doesn't matter much, but in a marginal seat, those missing votes could easily swing the result. In this case, people can claim that the winner does not have the support of the majority of the electorate.

As far as the U.S. gravitating towards a two party system, I'd suggest that this is caused more by the vote counting procedure than the culture. When you have a system where where voting for someone who won't get a high first preference count is equivalent to not voting, people are going to gravitate towards the parties where their votes actually make a difference (or not vote at all).

With a preferential system, you can vote for a minor party as your first preference, then number off the major parties with your other preferences. This also fixes the problem where two similar candidates might split the vote causing both to lose -- one will get knocked out, and their votes will be transfered to the next preference (which would likely be the other similar candidate). This generally leads to the least unpopular candidate winning, rather than the most popular one.

Fahrenheit 9/11

Went to see Fahrenheit 9/11 on Monday night. It was an interesting movie, but it was clearly aimed at a US audience. It did have a fair bit of information I hadn't heard before, but in some areas he was obviously choosing which bits of information to include to increase the effect (eg. when listing the countries in the "coallition of the willing" he didn't list Britain). Other bits seemed particularly relevant like the bit about the Bush administration playing with the terror alert apparently for political reasons, given what has happened so far this week.

Overall, I thought it was a good movie.

Firefox

Firefox is quite a nice browser, but the toolbars seem to have too much padding round the buttons in the toolbar. It looks like this is due to the double padding round the back and forward buttons.

It looks a bit better after creating a chrome/userChrome.css file in the profile directory containing the following:

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); .toolbarbutton-1, .toolbarbutton-menubutton-button { padding: 5px !important; } .toolbarbutton-menubutton-button { margin: -1px 0px -1px -1px !important; } .toolbarbutton-1[type="menu-button"] { padding: 0px !important; }

You might need to adjust the negative margins to match the xthickness/ythickness of your GTK theme in order to make it look okay.

The other cool thing is that some people are working on adding GTK stock icon support to the Mozilla code base. While the initial focus of this is to add stock icons to buttons in the dialogs, it sounds like it could be extended to toolbar buttons and other places in the future. This would make it fit in on the Gnome desktop a lot better.

Subversion

Have been looking at the Subversion 1.1 release candidate, and it looks pretty good. This could be the point where more people start to seriously look at using Subversion as a CVS replacement.

This would be largely due to the new fsfs repository backend. This new backend doesn't use berkeley db, and shouldn't ever wedge like the BDB backend does occasionally. Furthermore, you don't need write access to the repository to perform read only operations. This should make it a lot easier to set up systems where you have multiple ways of accessing the repository (eg. svnserve/ssh for write access, DAV and viewcvs for read access).

The fsfs backend stores each revision of the repository as two files in the repository (one for changes to the files/properties, and one to store revision properties), and doesn't modify the files associated with previous revisions when performing a commit. This means that the the existing backup and mirror infrastructure that projects have set up for CVS repositories should work equally well for Subversion.

The "new file for each revision" policy also has some nice features. In the case of svn+ssh access where each committer can directly access the repository files, it means that the existing revisions in the repository can be made readonly without preventing people from committing new revisions (something that can't really be done with CVS).

These administrative improvements should make it a lot easier to deploy Subversion, which in turn let more developers take advantage of its features.

Mail Viruses

The barrage of mail viruses and their side effects is getting quite annoying. In the past week, I've had a gnome.org mailing list subscriptions disabled twice. After looking at the mailing list archive, it was pretty obvious why.

The mail server that serves my account is set up to reject windows executables a few other viruses at SMTP delivery time (so it isn't responsible for generating bounces). Unfortunately, a number of viruses got through to the mailing lists and were subsequently rejected before reaching my account. After a certain number of bounces of this type, mailman helpfully disables delivery.

It'd be nice if mail.gnome.org was set up to reject these sort of messages too (in the case of gnome.org it'd probably be safe to block zip files as well, which would cut out virtually all the viruses).

It also seems that the email viruses don't pick the sender and recipient completely at random. Apparently a number of infected machines keep on mailing the XML mailing list with my address as the sender. It got so bad that the list admin put me in the "always moderate" list. Of course, this meant that I ended up receiving many messages telling me my message awaits moderation (which are pretty easy to filter). Luckily the new version of Mailman limits itself to 10 of these messages a day.

jhbuild

I've merged in some of Thomas Fitzsimmons' jhbuild patches. It isn't yet at a stage where you can build GCJ using an unmodified jhbuild, but we've got some of the basics in there. A big part of the changes involve adding support for srcdir != builddir builds, which is apparently the preferred way of compiling GCJ. This is accomplished by setting the buildroot config key to the directory where you want builds to be performed. Things aren't fully working yet, but at least some modules build in this mode. We'll probably need to add support for marking some modules as not supporting srcdir != builddir builds, since some modules will most likely never support it.

gnome-common

I've been doing some work to simplify the gnome-common autogen script. A lot of the infrastructure dates back to the early 2.0 days where it was important to make sure developers could hack on 1.x apps and 2.0 stuff at the same time, which involved complicated infrastructure to make sure 2.0 packages didn't see the Gnome 1.x autoconf macros and vice versa.

Since then things have changed. Developing Gnome 1.x apps isn't really a priority any more (and no one was using the stuff installed by gnome-common for 1.x work anyway). We also have far fewer autoconf macros in gnome-common, and they aren't particularly Gnome 2 specific. This is partly because I killed a lot of them last year, and deprecated most of the rest. While looking through the macros this time, it turned out I could remove another one, and get rid of the deprecated macros altogether. This just leaves some macros for setting compiler warning flags, one for adding a --enable-debug configure option.

The patch moves the remaining autoconf macros to the normal $(datadir)/aclocal directory so that aclocal can find it easily, and install the common autogen script as $(bindir)/bin/gnome-autogen.sh (which was previously a small script that would choose which set of macros and autogen script to call based on an environment variable).

Hopefully these simplifications will make it easier to debug autotool failures in the various Gnome packages. Many people seem to find autoconf hard enough to understand as is without us making things more complicated and adding extra ways that things could fail.

nxml-mode

Started playing with nxml-mode, which makes editing XML much nicer in emacs (psgml-1.3 does an okay job, but the indenter and tag closer sometimes get confused by empty elements). There is a nice article about nxml-mode on xmlhack which gives an introduction to the mode.

The first thing that struck me about nxml in comparison to psgml was the lack of syntax highlighting. It turned out that the reason for this was that colours were only specified for the light background case, and I was using a dark background. After setting the colours appropriately (customise faces matching the regexp ^nxml-), I could see that the highlighting was a lot better than what psgml did.

One of the big differences between nxml and psgml is that it uses RELAX-NG schemas rather than DTDs. It comes with schemas for most of the common formats I want to edit (xhtml, docbook, etc), but I also wanted to edit documents in a few custom formats (the module description files I use for jhbuild being a big one).

Writing RELAX-NG schemas in the compact syntax is very easy to do (the tutorial helps a lot). I especially like the interleave feature, since it makes certain constraints much easier to express (in a lot of cases, your code doesn't care what order the child elements occur in, as long as particular ones appear). While it is possible to express the same constraint without the interleave operator, you end up with a combinatorial explosion (I guess that's why XML Schema people don't like RELAX-NG people making use of it). For example, A & B & C would need to be expressed as:

(A, B, C) | (A, C, B) | (B, A, C) | (B, C, A) | (C, A, B) | (C, B, A)

(for n interleaved items, you'd end up with n! groups in the resulting pattern).

After writing a schema, it was a simple matter of dropping a schemas.xml file in the same directory as my XML documents to associate the schema with the documents. This is required because RELAX-NG doesn't specify a way to associate a schema with a document, so nxml has its own method. Matching rules can be based on file extensions, document element names, XML namespaces or public IDs, but I used the document element name for simplicity. You can specify other locations for schema locator rules, but putting it in the same directory is the easiest with multiple developers.

Once that is done, you get background revalidation of the document, and highlighting of invalid portions of the document (something that psgml doesn't seem to be able to do). It also says whether the document is valid or not in the modeline, which is helpful when editing documents.

Now all we need is for libxml2 to be able to parse RELAX-NG compact syntax schemas ...

155 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!