Searching for duplicate flex functions

After a day lost trying to find a bug caused while refactoring multiple versions of copy/paste code into a component I’ve decided to write a small application which searches for other code from my component still duplicated in other places. Naturally a basic python script has emerged. It takes as argument a file and a folder and searches for files ending with .as recursively. Both the reference file and the found files are parsed and a basic function reference is created which is compared to the other files....

October 13, 2010 · len

Ubuntu 10.10 netbook first impressions

As always I’ve been waiting with curiosity the new Ubuntu 10.10 release which this year was auspiciously launched on 10.10.10. I had also heard some rumors about the new netbook “Unity” interface so I’ve decided to give it a try. I own since a few years a Acer Aspire One which despite the very slow SSD drive I still use for bedtime book reading, watching some internet recorded tv shows (mainly envoyee special) and morning news reading....

October 12, 2010 · len

Why am I losing screen height on each new laptop?

My first hi-res laptop was a Dell I8000 which had a, huge at the time, resolution of 1600×1200. It was quite expensive because of this but also a wonderful and productive experience. My next laptop was also a Dell, a I8600, which had a “wide-screen”. This means it had a 1680×1050 resolution. The switch was not so heavy even if I lost 150px in one shot. I moved the panels (as in gnome panels) to the right and gained some extra space....

October 6, 2010 · len

GPS track analysis

GPS data has become extremely available in the last time and analyzing it always yields interesting results.The purpose of this article is to show a simple example where GPS track data is compared with a set of waypoints in order to determine whether a specific tracks was followed. This scenario is custom to various competitions ranging from randonee, cycling (cross country, orientation), 4×4 and the examples can go on and on....

October 3, 2010 · len

Status RSS plugin for pidgin

As a pidgin user I am used at not expecting many fancy things but one of the features I’ve wished for some time is a plugin which updates the status automatically to the last entry in a RSS feed. As an example I’d like to update the status to the last post on my blog. So, even if I don’t like perl too much here is a simple plugin which does just that....

July 15, 2010 · len

Delete self-pings

It seems that self-pings are bad for Google page ranking. Well, I have never spended too much time thinking about SEO but I find them a bit clutering and thus I’ve decided to remove them. There are some plugins which block new self-pings but none which deletes the existing ones. So here is a mysql command which does just that: Warning: don’t execute sql commands on your db if you don’t know anything about what sql is, it might ruin your base....

July 11, 2010 · len

Python xml namespace parsing with libxml2

The goal of this tinkering was simple: to parse a KML file for further interpretation and use using python and libxml2. First test <pre lang="python">#!/usr/bin/env python import libxml2, sys doc = libxml2.parseFile(sys.argv[1]) ctxt = doc.xpathNewContext() ctxt.xpathRegisterNs('kml', "http://www.opengis.net/kml/2.2") root = doc.getRootElement() res = ctxt.xpathEval("//kml:Placemark") for e in res: nodes = e.xpathEval('kml:name') if len(nodes) > 0: if nodes[0].content.strip().startswith('cp'): coord = e.xpathEval('kml:Point/kml:coordinates') if len(coord) > 0: print coord[0].content.split(',') doc.freeDoc() ctxt.xpathFreeContext() This sounded ok according to the scarce doc but resulted in the following error:...

July 9, 2010 · len

Tethered capture with ubuntu and D450

Shooting a photo and the imediately seeing it on a large monitor is a feature I’ve always wished. I don’t say live view on a display but instant copy and display would suffice. And actually, as I found out, it’s quite easy to achieve on Ubuntu Linux (10.04) with a Canon D450. Required software Make sure gphoto2 and geeqie (former gqview) is installed. An apt will do the trick: sudo apt-get install gphoto2 geeqie Scripts I’ve written 2 scripts....

July 8, 2010 · len

Holux M-241 GPS

Read track via USB gpsbabel -t -w -i m241 -f /dev/ttyUSB0 -o gpx -F test.gpx Read track via Bluetooth Find mac: hcitool scan Scanning ... 00:1B:C1:05:XX:XX HOLUX_M-241 Bind to a serial port in /etc/bluetooth/rfcomm.conf rfcomm4 { bind yes; device 00:1B:C1:05:XX:XX; channel 1; comment "Serial Port"; } Connect the serial port: rfcomm connect 4 read track: gpsbabel -t -w -i m241 -f /dev/rfcomm4 -o gpx -F test.gpx

May 31, 2010 · len

Ubuntu Lucid Lynx

There was not much I expected from the new ubuntu Lucid Lynx as I was happy enough with the existing version already. But I a good tradition and because I woke up at 8:30 this Saturday I decided to go ahead and install it on my Dell D820. The install The install went smoothly, everything was detected, installed the upgrades, the nvidia drivers and some day to day packages: mozilla-thunderbird, pidgin, emacs....

May 8, 2010 · len