Older blog entries for bolsh (starting at number 24)

14 Sep 2004 (updated 14 Sep 2004 at 09:39 UTC) »
jamesh: In the version of STV that I know, there are a couple of differences to that which you describe.

The main one is that surpluses are not distributed as you describe exactly. It would be more accurate to say that 80% of campd's votes would be distributed at 100% strength. You cannot have partial ballots.

Another minor difference is that if a candidate gets pushed over the quota by someone else's surplus or elimination, then only the votes which pushed them over the top get examined for surplus redistribution. This is a pretty controversial practice, which almost certainly changed the result of at least one constituency in Ireland last time around (Dublin North Central, IIRC).

Correction: It was Dublin Central. When Joe Costello was elected by transfers from Jim Mitchell, the surplus distribution favoured Dermot Fitzpatrick, even though the total vote for Costello would have favoured the more left-leaning Keho. The fact that the surplus came from Mitchell, a center-right candidate, skewed the next preference down.

There is also a GPL application to handle STV counts, which would make the task easier: pSTV. So perhaps the idea of having people do the 2004/5 election using the existing system, but specifying preferences as a test-run of STV, would be an interesting experiment.

13 Sep 2004 (updated 13 Sep 2004 at 07:37 UTC) »
Sed tip

A friend was recently looking for help with a problem, and that gave me the chance to freshen up my sed a bit.

His problem was the not uncommon one of wanting to replace a two-word string which might go over line-breaks. He wanted to keep the newlines in the replacement.

Most people are unaware that sed can do multiline edition with the commands N, D, P, G and H. Here's the script which did the job in the end (assuming I want to replace "I hope" with "we expect"):

sed -e '
N
s/\<I\([ \n]\{1,\}\)hope\>/we\1expect/g
P
D' input.txt > output.txt

N adds a new input line to the pattern buffer, the s replaces I hope in that pattern buffer, saving the thing which separates I and hope (spaces or a newline), and inserts it between the we and think in the output, P prints up to the first newline, and finally D deletes up to the first newline, and forks back to the N if there's anything left in the patter buffer. The last line, which is the active pattern buffer, gets dumped when the N command fails (that is, when there is no more input).

I'd forgotten how much sed rocks.

Just back from holidays, two computerless weeks (apart from 1 hour) of sun, sea and sand (and driving - all in all, I drove 3600 km). Still catching up with all that's happened while I was away.

It's a pity time doesn't stand still while you're on vacation, since a large part of the good feeling you build up while not working ends up getting sucked into the hole of built-up work the day you get back.

Anyway, the Irish almost had no influence on the olympics, until the last two days, when we won a gold, and a madman may have lost another one.

10 Aug 2004 (updated 10 Aug 2004 at 08:58 UTC) »
Just don't think about where it comes from...

For the coffee lovers among you, I present Kopi Luwak, $1000 per kilo. (French article).

What's new in the GIMP 2.1

I saw Edd's blog entry about the fashion show, and was wondering why he'd left off the GIMP. So I asked him. And he asked me what was new in the GIMP.

So here it is - a list of the 5 biggest changes in the GIMP since we branched the 2.0 maintenance branch back at the end of April.

  1. Shortcut editor

    You can now edit your shortcuts in a dedicated dialog, as well as continue to use the little-known dynamic shortcuts feature (which has been there since 1.2).

  2. Interoperability and standards support

    You can drag & drop and copy & paste image data from the GIMP to any application which support image/png drops (currently Abiword is the only one we know of) and image/xml+svg drops (Inkscape support this one). So you can copy & paste curves into the GIMP from Inkscape, and then drag a selection into Abiword to include it inline in your document.

    Patterns can now be any GtkPixbuf supported format, including png, jpeg, xbm and others.

    We can load gradients from SVG files.

    Drag & drop support has been extended. You can now drop file and URIs onto an image window, where they will be openes in the existing image as new layers.

  3. Plug-in previews

    We have provided a standard preview widget for plug-in authors which greatly reduces the amount of code required to support previews. David Odin is currently working on improving functionality of this widget (or rather, providing another widget which wraps the existing one) to allow arbitrary zooms and pans on a preview image. Very cool.

  4. HIG conformance

    A lot of work has been done on HIGifying the GIMP's interface. Most dialogs now follows the HIG to the best of our knowledge. We'd love to have a GUI review for HIG compilance done, actually...

  5. GTK+ 2.4 migration

    - Menus use the GtkUIManager to generate menu structure dynamically from XML data files - GtkFileChooser is used everywhere in the GIMP - Support ARGB cursors when they are available on the system

There are a few others which are either too small to list, or are not yet finished and might not get into 2.2.

It is now possible to run the GIMP in batch mode without an X server. We have a GIMP binary which is not linked to GTK+ at all. That's pretty cool.

The big possible feature is color management support (including soft proofing and display filters). There is quite a lot of infrastructure in place already, and since someone is now working on this, I am hopeful that this will be one of the headline features in 2.2.

Politics talk

I'm going to see Fahrenheit 9/11 tomorrow, and over the weekend I had a big chat with some people about politics (particularly French politics, which I know far too little about).

But as usual when talking about politics in France, we got around to talking about Bush, and November's elections. And I have started to form a pretty unpopular opinion...

I think Bush will win the election.

Note that I don't *want* Bush to win the election. But I fear that the Democrats are going about things the whole wrong way. This election campaign brings back memories of the 1972 presidential campaign (2 years before I was born - I have a good memory).

I read "Fear and Loathing on the Campaign Trail" a few years back, and re-read it again about 6 months ago, and the parallels between the Nixon cabal and Bush's cronies are pretty scary.

One of the similarities between 2004 and 1972 that comes across is that in 1972 the Democrats selected McGovern because he was the man who could beat Nixon (at least, after Muskie bombed out). And now, Kerry has been nominated and is being hailed for the same reason - he can beat Bush.

This is not the stuff of passion, and it is not the kind of campaign slogan that will win over the hearts of an electorate. "Kerry - he's better than Bush" just will not cut it.

OK - so Kerry's running partner has't (to our knowledge) had electro-shock treatment in a psychiatric hospital, but he really isn't presenting a new vision of things.

I want to see a political candidate not just say what's wrong with the other guy, I want to see him get passionate about his way of seeing things. The republicans kind of have a lower standard expected of them. We expect them to be duplicitous, but we know what we get with them. And the reassurance of the devil you know may be too much for Kerry to overcome, unless he starts pushing a comprehensive list of reasons why people should vote *for* him, and not *against* Bush.

Happy anniversary

"It was twenty years ago today
Sergeant Pepper taught the band to play"

And it was three years ago yesterday that Anne said yes to me. Happy anniversary, moutesse.

GIMP color management

Something we should look at: this is a color management plug-in for the GIMP. Might save us some time to build on what already exists.

David Schleef had things to say about memory usage myths. I wonder, though - if a stack is really only using 32k, why does mem_usage list nearly 11M of stack? What's in the 10960k worth of "clean" stack?

The solution to all the worlds problems: virtual bubble wrap

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