Essential math

<Goat25> what is the volume of a pizza of radius z and thickness a ?
<Goat25> answer: pi z z a

http://bash.org/?696997

Celebrating the IT2006 release

Had the IT2006 release party last night. Slightly belated, presumably to not allow us get distracted from bugfixing, or something.

We went to Grand Casino where we had a slots tournament. One winning line, no freezing the wheels, no changes to bets. For five minutes all you could do is hit the ‘Spin the wheels’ button. Pretty lame. Should’ve played poker.

Dinner was okayish, much less complicated than the last time we were at Mecca. Had some discussions which made me reconsider that maybe, just maybe, there are situations where one should let the engineers design the UI. What a scary thought.

Boston Summit 2006

Wandering about in Boston

Fire & Ice

We arrived in Boston Tuesday evening. That gave us plenty of time to recover before the Summit and the Mobile, Handheld and Embedded Hackfest held two days earlier.

Carlos spotted Tomb from somewhere. The tagline “Like stepping into an Indiana Jones movie” should give some idea what it was like. Pretty nice.

Dinner we had in FiRE & iCE improvisational grill. It’s do-it-yourself, you pick and choose the ingredients and they cook it for you. And it was good.

After dinner we went for a übertower of pumpkin beer at CBC. ick. Suffice to say it didn’t make any friends.

Embedded hackfest

The embedded hackfest was great. Though no hacking on the code was done we made good progress on other fronts. It’s almost frightening how similar people are thinking. What the embedded platform is is considered roughly the same. Everyone is having issues with gtk+ performance thanks to Carlcairo. (Sorry Carl, we missed you 🙂 While there’s steady progress on the performance, today gtk+ 2.6 seems most viable option for FPU-less ARM devices.

Summit

While great in its own way I felt the summit was a bit scattered and the more focused embedded days ended up being more productive. I had a wild goose chase trying to optimize pango extents handling with cairo backend. Others were trying to replace pango/cairo with pango/Xft in gtk+ 2.8. Hope to hear from them soon!

tigert was pimping GeoClue every chance he got 🙂 Which was good, it seemed well received and accomplish fair amount of hacking.

And I can’t wait to hear more on Echelon for GNOME.

Joke of the week

Umm, Google Reader doesn’t seem to do content search. This must be some sort of a joke, right?

On related note, does anyone happen to know how to get live.gnome.org RecentChanges (or moinmoin in general) show up in Google Reader?

Going to Boston

tigert, maybe we should consider taking a gun to the Summit? As strange as it may sound it might actually keep your luggage safe. So ridiculous…

Way to start a conversation

-!- lefti [~lefti@67-41-207-85.morava.adsl-llu.static.bluetone.cz] has joined #gtk+
<lefti> Hello, can you stop this project (gtk+) ?
<lefti> there is no reason to do gtk+ anymore ...

And then the discussion goes on about QT being free, so the reason for having gtk+ doesn’t exist anymore, and how much better the world X desktop would be if everyone used QT. Or something like that.

Anyone feel like asking to stop QT as there’s no reason to do it anymore?

Liferea likes its Sardine fresh

If you’re using liferea and are subscribed to the Sardine releases RSS feed you may have noticed some items are repeatedly reappearing as unread. A fix that worked for me is to increase the cache size. By default liferea caches 100 items per feed, the Sardine feed has 125 or so — the overflowing 25 items keep coming back. (There are some bugs in liferea tracker about this. I stopped reading at the fourth duplicate…)

Greetings from Lapland

Reindeer

Ivalojoki scenery

Rainbow

Salmon

The holidays were great. Though at times in Seinäjoki it was simply too hot in the sun and had to look for shades for some cover 🙂 Lapland wasn’t much cooler either; during the three weeks it rained maybe ten minutes (if you can call it rain.) We didn’t see many mosquitos or “mäkärä” there, which was nice.

Connection reset by peer

I’m starting my disconnected holidays real soon now, so I won’t be around e-mail or IM or anything for a while. Instead I’ll be around here the next week and here the week after that. I’ve packed my 770 with me but I doubt I’ll bother using it much with GPRS and all.

C# and DBus making development easier… or not

last-exit installs itself as a handler for lastfm: URIs, but every click on a link launcher a new instance of the application. Such waste obviously can not be tolerated, so I figured last-exit should be single-instance. And use DBus for that, naturally.

Note: The following is not a sane way to do it. One really should be using the mono bindings. Or simple callbacks rather than GObjects.

C# and DBus the hard way

As I was told DBus C# bindings are unusable I went on about writing DBus# objects the hard way. (Last time I tried with using the DBus mono bindings it kind of worked. I had to make the method call return a value or the messages would appear to be lost most of the time, and even then every other message caused mono to segfault.)

It turns out there’s quite a few levels of code generation and necessary autotools magic involved in the whole process:

  • dbus-binding-tool: takes a (hand written) XML file describing a DBus object interface and generates client and server side glue code, very similar to orbit-idl-2. Combined with the C implementation this gives you a shared library you can start wrapping for C#.
  • gapi2-parser: takes a (hand written) XML file referencing source files to parse as well as some namespace annotations and generates an XML description of the GObject(s). Semantically very close to the XML file for dbus, syntactically not.
  • gapi2-codegen: takes the output of gapi2-parser and generates C# source files. Logically almost identical to dbus-binding-tool. Building the sources gives you C# dll wrapping the shared library.
  • gapi2-fixup: takes a bunch of extra (hand written) files and then customizes the generated code in wonderful ways I’m sure, but I didn’t want to go there.

None of which naturally had useful manpages, –help or other easily/obviously accessible documentation. Eventually Google found GAPI Overview in Mono wiki and dbus-binding-tool --mode=glib-server was mentioned somewhere else.

Well, in the end it worked nicely and I was able to use dbus-send as the URI handler:

#!/bin/sh
exec dbus-send --session --type=method_call \
     --dest=org.gnome.LastExit /org/gnome/LastExit \
     org.gnome.LastExit.Open string:"$1"

Using dbus-send, or preferrably having gnome-vfs send the DBus message directly from the application itself, should be more efficient than loading the mono runtime just to send a few bytes down the socket.

I couldn’t be bothered to figure out the automagic needed to make the whole thing bootstrap cleanly. It was an awful hack and no one in their right mind would accept such a patch. I was happy to just get it built.

C# the high level language

I abandonded that line of development and thought about trying the very latest mono bindings from freedesktop git repository. Needed to add a little hack to make it run with the dbus version that comes with Ubuntu Dapper. The echo server example appeared to be working, but mono was segfaulting when the client was trying to handle the method call response.

After a little digging I found mono was segfaulting during finalizing an object, and the following code seemed to be responsible one way or another. At least just skipping the whole function makes the crash go away…

mono/ProxyBuilder.cs (BuildFinalizer):

[…]

//generator.EmitWriteLine("this.service.SignalCalled -= this.delegate_created");
generator.Emit (OpCodes.Ldarg_0);
generator.Emit (OpCodes.Ldfld, serviceF);
generator.Emit (OpCodes.Ldarg_0);
generator.Emit (OpCodes.Ldfld, deleF);
generator.EmitCall (OpCodes.Callvirt, Service_RemoveSignalCalledMI, null);

generator.Emit (OpCodes.Ret);

There’s a lot more where that came from. I lost interest as I didn’t feel like learning assembler again. At least not this twistedly verbose dialect of it.

Last Exit “Minor Numbers are For Wusses” 2.0

Of course the whole exercise was for nothing, other than being a learning experience, as a different implementation was committed to CVSreleased shortly after. They cheated, there’s no GObject exposed to C# side but just a simple function for setting a callback function. On the plus side it causes much less headaches. I was also told there are better mono bindings around, waiting for commit approval somewhere.

At least last-exit is looking better than ever 🙂