Today's Second Geohack
I managed to wangle a Fire Eagle invitation this morning, so over lunch I grabbed the Python API Kit and threw it at the sample Gypsy client.
$ ./gypsy-fireeagle.py 00:0B:0D:88:A4:A3 got 51.861145 0.156275 Updated FireEagle
The first line is me running my script (this one is 64 lines, but it is half whitespace), telling it where my GPS is. The second line is the current position that my rather cheap and nasty GPS determined. The third line tells me that Fire Eagle has been updated with those coordinates.
Suffice to say I'm very impressed with Yahoo's geocoding software. My GPS never settles to an accurate reading and will happily jitter around a 20 metre wide circle for hours, but the location Fire Eagle is reporting me at is two doors away. I'm not exaggerating: it says number 9 on my street when it should be number 5. That is some incredibly accurate mapping they have.
Today's Geohack
Following hot on the heels of Yahoo's announcement of their Internet Location Platform, I wrote a quick 20-line Python hack to convert from latitude and longitude to a place name. Because the ILP doesn't yet expose the ability to go from a position to a WOEID we have to ask the Flickr web services to do this first (as Flickr is owned by Yahoo this is using the same backend). Once we have the WOEID, it can be then be looked up on the ILP and useful information obtained. Example speak more than words:
$ python geohack.py Using position 51.872330 0.161950 Got WOEID 12775 Got town Bishop's Stortford
Now to write a GeoClue provider which will fill in the locality information from the position. Long-term grand plans involve integrating all of this geo magic into Postr, somehow.
NP: Third, Portishead
Fire Eagle Invitation?
Does anyone out there on the Intarwebs work for Yahoo, or have a friend who works at Yahoo? I'd really like to give this Fire Eagle thing a go, specifically integrating Gypsy and GeoClue with Fire Eagle, but it's invitation only at the moment...
Update: I now have an account!
GUPnP Basics, Part 1
For the last few days I've been learning more about UPnP and testing it with the few devices I have around the house. One of these is a cheap ADSL router, which apparently has the lamest UPnP stack on in existence. It does however support the WAN IP Connection interface, so you can use UPnP to get the external IP address and manipulate the port mapping. I'll skip over the horrific security violations this involves, because it's a useful demonstration that the majority of people will be able to test.
Today we'll start simple and get our external IP address using GUPnP. The first thing to be done is to create a Control Point, which in the UPnP model handles discovery of resources, be them devices or services (a device can have multiple services). When creating a control point you can specify the URN of the resource you want to target. In this case we want all services providing WANIPConnection so we'd use urn:schemas-upnp-org:service:WANIPConnection:1. If you want to browse for all services then use ssdp:all (SSDP being the Simple Service Discovery Protocol).
static GMainLoop *main_loop;
int
main (int argc, char **argv)
{
GError *error = NULL;
GUPnPContext *context;
GUPnPControlPoint *cp;
/* libsoup requires threading, so we have to initialise it */
g_thread_init (NULL);
g_type_init ();
/* Default GLib context, default host IP, default port */
context = gupnp_context_new (NULL, NULL, 0, &error);
if (error) g_error (error->message);
/* Create a control point targeting WAN IP Connection services */
cp = gupnp_control_point_new
(context, "urn:schemas-upnp-org:service:WANIPConnection:1");
/* The service-proxy-available signal is emitted when any services which match
our target are found */
g_signal_connect (cp,
"service-proxy-available",
G_CALLBACK (service_proxy_available_cb),
NULL);
/* Tell the control point to start searching */
gssdp_resource_browser_set_active (GSSDP_RESOURCE_BROWSER (cp), TRUE);
/* Enter the main loop */
main_loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (main_loop);
/* Clean up */
g_main_loop_unref (main_loop);
g_object_unref (cp);
g_object_unref (context);
return 0;
}
static void
service_proxy_available_cb (GUPnPControlPoint *cp,
GUPnPServiceProxy *proxy)
{
/* ... */
}
Now we have an application which searches for the service we specified and calls service_proxy_available_cb for each one it found. Now, to get the external IP address we need to invoke the GetExternalIPAddress action. This action takes no in arguments, and has a single out argument called "NewExternalIPAddress". Yes, the naming scheme is stupid. GUPnP has a set of methods to invoke actions -- which will be very familiar to anyone who has used dbus-glib -- where you pass a NULL-terminated varargs list of (name, type, value) tuples for the in arguments, then a NULL-terminated varargs list of (name, value, return location) tuples for the out arguments. A simple implementation would be as follows.
static void
service_proxy_available_cb (GUPnPControlPoint *cp,
GUPnPServiceProxy *proxy)
{
GError *error = NULL;
char *ip = NULL;
gupnp_service_proxy_send_action (proxy,
/* Action name and error location */
"GetExternalIPAddress", &error,
/* IN args */
NULL,
/* OUT args */
"NewExternalIPAddress",
G_TYPE_STRING, &ip,
NULL);
if (error == NULL) {
g_print ("External IP address is %s\n", ip);
g_free (ip);
} else {
g_printerr ("Error: %s\n", error->message);
g_error_free (error);
}
g_main_loop_quit (main_loop);
}
Note that _send_action blocks until the service has replied. If you need to make non-blocking calls then use gupnp_service_proxy_begin_action which takes a callback.
So, that is searching for services and invoking actions in GUPnP. Next time I'll cover subscribing to state variables, and routers which can't count.
NP: Folk But Not Folk, Various
EphyDeli 0.3
EphyDeli is a Python extension for Epiphany that adds Post To Delicious menu and toolbar items for posting the current page to Del.icio.us. I know of several people who use it frequently and the last release was in 2006, so I've obviously mastered the Unix philosophy well here! This release was caused by those mean old Epiphany developers changing the API, many thanks to Thibauld Nion for noticing this and sending a patch.
To download it you can either grab the tarball or fetch the bzr tree.
It's Bubbling Hot
$ cat /proc/acpi/thermal_zone/*/temperature temperature: 84 C temperature: 90 C
Maybe it's time to get a dedicated build machine, my poor laptop gets quite toasty when building Poky. Then again it seems happy enough, so maybe I should just use an external keyboard to avoid boiling my hands.
NP: Oneric, Boxcutter
Postr 0.12
A quick Postr 0.12 release, mainly to fix an annoying bug but there are some neat new features here too.
- Update the status bar after uploading
- Add a Switch User menu item
- Add Add/Remove buttons to the image pane
- Install the Nautilus extension to the new extension path
- Don't select groups when the name is clicked
- Don't display errors when posting to moderated groups
- Show a warning on exit if there are images to upload (thanks Germán Póo-Caamaño)
The tarball is here, and packages for Debian have been uploaded.
Postr 0.11
I finally got around to fixing the very annoying text wrapping problem in postr.dev, I thought I best release Postr 0.11:
- Add Send To Group options
- Add Privacy and Safety options
- Use a multi-line entry for the Description field
- Show the user's name in the status bar
- Fix the resizing of the preview
The tarball is here, and packages for Debian have been uploaded.
No Iain, I Am Luis Villa
Iain, you are clearly an imposter. And this perfect-sighted intruder, whoever he is, should be hunted down, because I am Luis Villa!
We're Hiring!
Here at OpenedHand Towers we've just announced some more job openings, so if you have skills in any of the kernel, X.org, GTK+, Clutter or OpenEmbedded then please have a look. We're also after user interface/interaction designers, junior designers (print/web/UI), and have an student internship for a programmer. Pretty much something for everyone!
GNOME Mobile Moduleset
I just committed to JHBuild three new modulesets, mobile-2.24, pimlico and matchbox, so that GNOME people wanting to develop against the GNOME Mobile platform can use tools they know to build everything they need.
- mobile-2.24
This changes GConf and EDS to use the DBus ports, and provides meta-mobile-platform which builds the complete platform.
- pimlico
This builds Contacts, Dates and Tasks, providing meta-pimlico.
- matchbox
This builds Matchbox Panel, Matchbox Desktop, Matchbox Keyboard and Matchbox Window Manager, providing meta-matchbox.
Also, Poky is building images nightly with the complete platform in, which will let you build and test software in a PDA-style environment with QEMU, running on x86 or a number of ARM-based devices (such as Nokia N800, Sharp Zaurus or OpenMoko).
Last week at the Collaboration Summit in Austin (which I couldn't attend for personal reasons) there was a day-long GNOME Mobile meeting, as a result of which there is now a long list of packages which need to be considered for addition to the Platform (such as HAL, Gypsy and Geoclue), and a few changes (such as replacing gnome-vfs with gvfs). I hope to review the proposals fairly shortly, so that we can hopefully make an initial GNOME Mobile 2.24 platform release alongside the Desktop release in September.
In other news, this is exactly what the Internet is for.
NP: Blue Moon Station, Solar Fields
Dear Interwebs: Secure SMTP Relay Wanted
I'm looking for a basic SMTP relay which supports SMTP AUTH, TLS, supports the sendmail interface, and has a local mail queue, so that I can send mail from my laptop in Evolution (to localhost, or calls sendmail) and the shell (calling sendmail) when online or offline.
I need SMTP AUTH and TLS, which means nbsmtp, masqmail, and nullmailer are out. I want a local queue for when I'm not online which means esmtp, ssmtp, msmtp, and nullmailer are out (I'm not convinced that msmtp's queue scripts are reliable enough). Surely there must be a simple SMTP relay which will reliably manage a queue if the mail cannot be sent! If not, does anyone know of a good guide to configuring Postfix or Exim to do this?
New Gypsy Release
Coding Legend Iain has just released Gypsy 0.6, the all-new GPS multiplexing daemon which focuses on being lean and easy to use, and not on, erm, putting your GPS on the Internet or something weird.
Because I'm fairly lame there are not matching Debian packages yet, but I'll get around to that tomorrow. In other news, a very nice man called Ian Lawrence wrote a buzzword-compliant tutorial where he uses Gypsy to talk to a Bluetooth GPS, tests it with my Gypsy Status 10-minute hack, and then uses Django to redirect the user to the relevant geohash.org page.
NP: Remembranza, Murcof
EDS and Memory
I was going to reply to Philip's post, but Federico did a wonderful job before I could start.
That said, I still haven't forgiven you for some of the finer details of libecal Federico. :)
Dear Intertron: Emacs Help Please?
I recently switched to Emacs from XEmacs, and have pretty much got it working how I like. There are just two problems remaining.
- I'm using emacsclient, and when I close the last frame Emacs quits. With XEmacs when in server mode the process continues when the last frame is closed, anyone know how I can get Emacs to do this too?
- Emacs appears to be moving the mouse pointer when I open a new frame. This is totally frustrating not only because I use sloppy focus, but also because its moving the point to the wrong frame. How can I turn this off?
Help greatly appreciated!
Traits of the Common and Generally Mythical Evolution Data Server Replacement
When not writing media centres or GL toolkits, it appears that the latest trend in open source is to write Evolution Data Server replacements. There is a fairly common pattern forming.
First, implementation details will be announced as a major, if not the main, feature. The shining example is "based on DBus". Yes, DBus is great. Yes, ORBit is a dying technology for something as simple as transfering a few strings between two processes. But this is an implementation detail. I'd prefer a project using DBus instead of another incredibly complicated IPC, but implementation details are typically not something to get excited about.
Often this first point gets out of control and suddenly the point of the project is to design a DBus interface, not to write real working code. Of course, an interface without any code behind it, without any reference implementation, without several applications and different users, is bound to be broken somewhere. But you'll never know until it is too late and you've labelled the interface as STABLE. Learn from DBus itself, anyone who followed the project before 1.0 knows that the core concepts were rewritten several times before it was finally marked as stable.
Spreading basic FUD is fairly common too. "EDS is not efficient concerning network bandwidth" doesn't make sense, because EDS is a local daemon. When it does talk over the network, it's fairly sensible. The LDAP (and Groupwise/Exchange I believe) backend maps EDS searches to native searches so that only the requested items are fetched. Backends such as WebCal have no option but to fetch the entire file, because that is how they work. "EDS is not efficient concerning memory usage" is rather vague, and if you interpret it as "private dirty memory usage is unreasonably high when in use" then in my opinion that is untrue and I have Massif logs to back me up.
If these points were true, they'll generally be fixable within EDS. The default local calendar backend is implemented as an iCalendar file on disk, which is parsed into memory in its entirety on startup. This certainly works well for a basic implementation but should be replaced with a database of some sort, a simple one which stores a hash of UID to event would reduce memory usage for large calendars. Add to that a cache of start and end times to optimise that common case and the end result is probably both faster and uses less memory, for a few days work.
Occasionally complaints are spot-on, but EDS isn't immutable and whilst starting a new project from scatch may be more fun, please think of everyone else. EVCard is over-complicated and yet tragically crippled, whilst EContact tries to be clever but generally gets in the way. Luckily we can write a new contact object which is easier to use. The query language is limited, but Milan Crha of Red Hat fame has been chipping away and now it's more flexible without breaking existing applications. Maybe someone can come up with a good replacement language, and the old language deprecated.
I'll summarise what I'm trying to say.
- EDS isn't perfect, we all know that.
- However, EDS also isn't immutable. It can be fixed.
- If you find bugs or bad design in EDS, please file a bug report.
- If you have spare time to start a replacement project, please briefly consider the possibility of working on EDS first. The code isn't that scary, honest (especially the DBus port when I get around to merging it).
- If you still want to start a replacement project, at least be polite and inform the evolution-hackers mailing list that you are starting a project to replace it. You never know, there might be common ground that we can both work on.
NP: Kharah System, Hereill
Testers Wanted
Over the weekend I hacked on a clone of Marco Polo for GNOME. The idea is that you define a set of contexts, such as "work", "in meeting" or "home". The current context is determined by a set of rules, for example being on the "Burton" wireless network means I'm in the "home" context, the time being between 09:00 and 18:00 means the "daytime" context, and so on. Finally, when entering or leaving a context actions can be executed, such as muting the sound card, mounting a remote drive, or changing the default printer. So far I have sources for the time of day and wireless network name, and actions to run a command and set a GConf key.
Now that the basics are in place, I'm looking for other alpha-testers. Experience with Python is a requirement at the moment as there is no UI or configuration file yet. That said, if this application sounds like it could be useful to you then please email me.
NP: !K7, Various
Devil's Pie Graphical Editor
Thanks to Chris for pointing out gdevilspie to me, a graphical interface to writing Devil's Pie rule files. I've never used it so I can't comment on how well it works, but I'm very glad that someone finally wrote it!
More Tasks Magic
I finally got around to working on magic date parsing in Tasks, thanks to Mallum porting a JavaScript library to C last year. I rewrote it again this week, and landed it in Subversion a few days ago. I'd love any brave Tasks users to give it a go, especially people who don't use English. They'd need to translate the new strings, but I want to check that the technique I'm using is portable between languages.
Feedback on what magic strings should be detected would be great too. Currently it detects "today", "tomorrow", "yesterday", "this [weekday]" and "next [weekday]". Next up is "by|due|on [local date representation]", but what else would be useful?
Sound Juicer "Died To Make This Sound" 2.22.0
Sound Juicer "Died To Make This Sound" 2.22.0 is available now. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Last minute fixes, cleanups, and translations abound!
- Fix various crashes in the preferences dialogs (thanks Matthew Martin)
- Translate the genres (thanks Brian Geppert)
- Add a paused track state (thanks Brian Geppert)
- Use the system icons for play/record (thanks Micharl Monreal)
- Many many translations!
Thanks to everyone who helped with Sound Juicer 2.22, there has been a huge influx of new contributors thanks to the GHOP and gnome-love projects.
For Sale: IBM ThinkPad X22
In an effort to clear up the utter mess which is my home office, I'm selling my old laptop. It's an IBM ThinkPad X22 (ultra-portable), with (and this is from memory) a Pentium 3 Mobility at 733MHz, 640MB RAM, and a 20GB HDD. I think. (update: 40GB HDD). It has built-in wired ethernet but no built-in wireless, though I can throw in the Orinoco-based wi-fi card I've been using. There is also the UltraSlice micro-docking station with a hotpluggable CD drive/HDD bay. It will come booting Debian, but it has a Windows 2000 license and I'm sure I have the CD somewhere in the attic. The main caveat is that the screen hinges have lost their grip so it is best used either closed as a router or network music box, or against something to keep the screen from falling open. :)
So, anyone want to make an offer? I'll put it on eBay if nobody wants it, but I thought I'd offer it out to the Planets first. If anyone is interested ping me and I'll go and turn it on to double-check the specifications.
Google Contacts Data API
Those nice people at Google have finally opened their Contacts API. Now, Evolution already has a Google Calendar backend, so does anyone fancy writing a Google Contacts addressbook backend? If someone with C/GObject knowledge is interested, I'll happily provide assistance on the Evolution side.
Poky "Pinky" 3.1 Released
From: Richard Purdie <richard@openedhand.com> Subject: [poky] Poky Version 3.1 (Pinky) Released It gives me great pleasure to announce a new release of Poky, version 3.1 (Pinky).
Poky 3.1 is released! We've been hard at work for this one, mainly deep in the guts to make it more portable and powerful. Of interest to GNOME developers is that Pinky is shipping a complete GMAE 2.20 platform, and a plugin for Anjuta to make building and deploying software for your target device trivial.
We've also got a sweet new web site and possibly the cutest mascot ever. I, for one, can't wait to stroke a plush Beaver.
Sound Juicer "Drop The Empty Pursuit Of Props" 2.21.92
Sound Juicer "Drop The Empty Pursuit Of Props" 2.21.92 is available now. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Just small fixes now:
- Don't loop if the selected music directory doesn't exist (Matthew Martin)
- When editing the album artist, unset the sortable artist name
- Remove deprecated calls in BaconVolume (Michael Terry)
Can I Get A Replicator?
There is a Sound Juicer bug which has been reported in 2.20 and 2.21, where changing the album artist name doesn't change the name that is used when creating directories (link to bug). Thinking about the code this is very strange, and I can't replicate it myself, so I have to ask the Planets. Has anyone else seen this, or can they replicate this?
NP: Workmen digging up my road the bastards, Thames Water (photo)
Dear InterWeb...
Mock The Week is about to start, so I'll be quick. Can I ellipsize a GtkMenuItem? It's easy to make Tasks have very long menu items, which end up being too big for the screen. I'd like to get the menu items truncated so that the menu will fit on the screen, or something. I guess I'll have to truncate the string manually if there is no magic way of doing it directly in the menu, but that really is a fallback plan.
Cheapo MP3 Player
Today I ordered what is almost the cheapest MP3 player I could find, and is certainly the cheapest I could find which wouldn't fall off when jogging (as much as I love my black iPod Classic, it's not really suitable for jogging). I really hope that it reads MP3 files from a FAT partition and uses USB Storage...
NP: Mishaps Happening, Quantic
DBus-using Library Design
As a rule of thumb, when writing a library which uses DBus please always make asynchronous DBus method calls. You never know when someone will write a system using your library which, via a series of plugins, ends up calling itself. A single main loop and blocking DBus calls are not a great combination, and leads to lots of frustration.
Yes, libnotify, I'm looking at you.
NP: Out of Season, Beth Gibbons
Sound Juicer "Spent All Night Just Watching You" 2.21.91
Sound Juicer "Spent All Night Just Watching You" 2.21.91 is available now. Tarballs are available on burtonini.com, or from the GNOME FTP servers. A few features, before we hit the deep freeze.
- Write extracted audio to a temporary file and then rename (Matthew Martin)
- Disable the Eject button if the drive cannot eject (David Meikle)
Pimlico for N810
I finally got around to hacking Evolution Data Server to build without the addressbook, and still work. This isn't hard work, its just very dull: I must have rebuild EDS from scratch at least twenty times this evening.
The good news is that there are now Contacts, Dates and Tasks packages for Chinook, also known as ITOS 2008, also known as the software on the N800 and N810. Sorry it took so long!
I generally thought that LinkedIn was pretty useless for people like me. I have a community of like-minded associates available via Planet Gnome and so on, so apart from collecting friends it is pretty useless.
But recently it's been becoming quite useful. For large companies it generally appears to be company policy that contact with open source projects is done via anonymous email domains, like GMail. This obviously makes it tricky to guess where someone is from when they appear on a mailing list... but LinkedIn to the rescue. Search for a name and hey presto, their CV!
NP: Artists Like: Amon Tobin, Last.fm
Sound Juicer "It's Deeper Than The Darkest Sea" 2.21.3
Sound Juicer "It's Deeper Than The Darkest Sea" 2.21.3 is available now. Tarballs are available on burtonini.com, or from the GNOME FTP servers. More hot features!
- Add a Disc Number field, and magically populate it (Matthew Martin)
- Add content/* media types for Nautilus (Matthias Clasen)
- Set a11y relationships on the cluebar (thanks Rich and Willie)
- Fix play/pause (Bill O'Shea)
- Handle the cdio element not being cdparanoia
Akonadi Questions
I've recently been looking at Akonadi again, and trying to understand its design goals, implementation, and so on. The documentation on the web site is pretty thin on the ground, so I have a few questions which I'd love any friendly Akonadi developers to reply to (note that I'm biased towards the address book side for now).
- IPC. Akonadi uses IMAP for most operations, with DBus used for notifications and other "control" messages apparently. As IMAP supports notifications fine, why not drop DBus entirely? To use Akonadi there has to be an IMAP connection, correct?
- Data format. How is something concrete, like a contact, represented? In what format would it be stored in the "local addressbook", and in what format is it transferred over IMAP?
- Dependencies. For a GNOME component C++ I can just about handle, Qt is pushing it, and libkde is out. What are the real dependencies of Akonadi, and can they be reduced?
- Examples. Can anyone provide example code of basic operations against the addressbook, such as searches, handling live views, adding and removing contacts?
Thanks!
NP: Artists Like: Skalpel, Last.fm
Kernel Patching
In my recent PowerTOP adventures I discovered a few timers which could be removed. One was a polling loop in the PCMCIA driver, which I disabled because the interrupts are unreliable, apparently. This turns out to be totally correct, with the polling disabled it doesn't notice me inserting a CF, so I can't do anything. I'll leave this on the "something to pester Richard about when he is less busy" list.
The next driver related poll on the list was from a IrDA module. Now, it shouldn't be doing anything because I have nothing apart from the drivers loaded. Even unloading the real drivers and just loading irda.ko caused wakeups, so I hunted around and with lots of Samuel's help (he took my concept patch, and made it actually compile!) we produced a patch which was merged into David Miller's 2.6.25 tree today. Excellent, I'm now a kernel hacker!
Linux Wakeups
To satisfy an idle curiosity, I installed PowerTOP on my Zaurus to see how many wakeups a second it was doing. It started out at 112w/s, which isn't that great, but Richard told me that I should give our 2.6.24-rc8 kernel a go, because it has NO_HZ defined. To our surprise it booted, and to cut a long story short my Zaurus is currently idling at 5.4 wakeups per second, and 11% of those are about to be patched out of the kernel.
Harsh Trolling
This has to be some of the harshest trolling I've seen for a long time. If it's not a troll, then someone needs anger management sessions.
NP: Central Reservation, Beth Orton
Sound Juicer "Now There's Emptiness In My Bed" 2.21.2
Sound Juicer "Now There's Emptiness In My Bed" 2.21.2 is available now. Tarballs are available on burtonini.com, or from the GNOME FTP servers. Again, the response from the gnome-love and GHOP tasks has been great, and there is a lot new in this release.
- Update documentation (Andreas Freund)
- Check extracted filenames are not too long (Ed Catmur)
- Add a Year entry to the main window (Andrzej Polatyński)
- Add a Duplicate Disc menu item (Dave Meikle)
- Show better error messages if the target directory can't be created (MatzeB)
- Remove branding from the desktop file
- Fix initial playback (Bill O'Shea)
- Hide the progress bar unless ripping (Ghee Teo)
- Move the cursor to always been on the currently playing/ripping track (Dave Meikle)
- When editing album artist, only change track artists if it was the same (Bill O'Shea)
Social Whoring
Linked In always had the atmosphere of a more serious and professional social networking site, unlike MySpace and Facebook where people seem to collect friends like stickers when they were younger. Then I discovered TopLinked, a site dedicated to letting people grow their network massively to people they've never met. The top member has 37 thousand connections. I just don't understand this, what is the point of having so many connections when there is no value in the connections themselves?
NP: Bricolage, Amon Tobin