Parsing names
In the last weeks I have been asked several times to modify some components I’m working on to add the ability to split a full name in its components (first name, family name, etc.).
It looks like most people have great expectations about this working correctly but they get annoyed when it fails, and you can be sure it will fail. It will fail because it’s impossible to parse a name correctly, for instance:
| Full name | First | Middle | Last |
|---|---|---|---|
| Barack Hussein Obama | Barack | Hussein | Obama |
| Pier Silvio Berlusconi | Pier Silvio | Berlusconi | |
| José Rodríguez Zapatero | José | Rodríguez Zapatero |
How can you do this automatically?
This becomes particularly silly if you cannot be sure that the string you are going to parse is actually a full name, for instance don’t try to parse a chat nickname. It’s true that gmail/gtalk uses your full name by default, but this is only a default and it’s true only for gmail.
To cut a long story short, please please please don’t try to parse names. You can see by yourself how hard it is, even if I’m just considering western-style names.
If you still don’t trust me here’s a quote from e-name-western.c, i.e. the file that does name parsing in libebook
:
* <Nat> Jamie, do you know anything about name parsing? * <jwz> Are you going down that rat hole? Bring a flashlight.
On a side note when you are trying to understand why some code is broken you can find some funny commits, like the great EDS purge
Update: I found this “serious” bug in e_name_western_parse
.
Vala, Clutter and limoncello
During this week-end I finally found some time to start playing with Vala and Clutter. I would like to write a small game using them, but I’m not sure I will finish it because the more the time passes the less I seem able to write code in my free time. Now that I’m spending all the day programming I find it very hard to write code when I come back from the office and I end up spending my time doing other things, like cooking.
Speaking of cooking, in Italy it’s quite common to make your own limoncello or other similar liqueurs so I finally decided to try making a basil-based limoncello-like liqueur. This kind of liqueurs is made using some 95% (190 proof) alcohol to extract the flavour form the lemon/basil/whatever and then the result is diluted with water and sugar. In Italy bottles of grain alcohol are available in most grocery stores[1], but here it seems impossible to find. I suspect that the only way to have access to it in the UK is to work in a lab where alcohol is used[2].
[1] And nobody that I know of tried to just drink it or used it to make other drinks stronger, so I was quite surprised when I discovered that pure alcohol is used in the US (in the states where it’s legal) almost only to make drinks stronger.
[2] Somebody in Cambridge reading this that works in a place where 95% alcohol is used?
Time goes by
It has been a year since I moved to Cambridge from Italy. It feels weird, but things go well here so for now I’m not planning any other change.
Clearly I need to cook a cake for this event
.
WebKit GTK on iRex Digital Readers
When I joined Collabora last year I started to work on porting WebKit GTK to a device produced by iRex technologies based on the GNOME mobile stack and with an electonic paper display. My task was to make WebKit usable for the browser that they want to ship with the next version (with Wi-Fi connectivity) of their device, this meant adding missing features, fixing various bugs and adapting WebKit to work well with this kind of devices.
At FOSDEM I willl give a talk on what I did and I will have with me a DR 1000S, so you can play with it (I suspect that most people will follow the talk only because of the nice toy
)
Another waste of time
Clearly IRC, Jabber, MSN, facebook, feeds, several news web sites, emails, etc. were not enough to waste all my time so today I started using twitter. Let’s see if I will get bored in some days or if I will become addicted.

I'm a 26 years old Italian software engineer that lives in the rainy Cambridge (UK). Here I work for 

Recent Comments