SOS

Shane O'Sullivan's technical blog… really ties the room together

Archive for April, 2007

Ubuntu on Thinkpad X41 – Upgrading to Feisty Fawn (7.04)

Posted by Shane O'Sullivan on April 30, 2007

Table of Contents | Prev Post | Next Post

This is one of a number of posts detailing how to install Ubuntu 6.10 (codename Edgy) on a Thinkpad X41. This post focuses on upgrading from Ubuntu Edgy Eft (version 6.10) to Ubuntu Feisty Fawn (version 7.04).

Upgrading from 6.10 to 7.04 is a relatively straightforward operation, however there are a few issues I’ve found so I’ll start with those before you decide whether or not to upgrade.

  1. Ubuntu seems to be running more slowly than before. Applications take longer to start up, with the desktop freezing while they’re loading in some instances. I can’t remember seeing this happen before. Other people have reported the same issue.
  2. The Beryl desktop manager seems to have some issues with the new release. Sometimes when a new application is loaded it doesn’t initialise properly when Beryl is enabled. E.g. an xterm window will load but you can’t type in it, or when I load QuickSynergy I can see the contents of the application window but can’t click on them. In each case, logging out then in again solves the problem, but I’d rather find a proper fix for it, obviously enough.
  3. The update failed the first time I attempted it. I got the following error:
    Could not install ‘/var/cache/cpt/archives/fuse-utils_2.6.3-lubuntu2_i386.deb’
    This package is used to map to the Windows NTFS partition on my hard drive, and this failure caused the upgrade process to fail. However, trying the same upgrade a few days later, the problem seems to have been resolved.
  4. Another problem with accessing NTFS partition is that it seems to have problems allowing me to rename files using the File Browser. It’s not a permission issue, I can rename them just fine using the Terminal (I have the ntfs-3g package installed which gives me read/write access to NTFS partitions).
  5. The Desktop Effects option (aka the Compiz window manager, admittedly it’s labelled as a beta product) seems pretty flaky, displaying many of the same issues that Beryl seems to have with this Ubuntu release. This suggests to me that the 3D graphics drivers for my Thinkpad may be faulty, and it is something I’ll look in to.
  6. Java seems to have gone back from version 1.5 to version 1.4.2. Some applications require Java 1.5 or later, and refuse to execute without it.

Long story short, I’m less happy with Ubuntu now than when I was back on Edgy, and there’s nothing in the new release that makes me glad I upgraded. By far the worst issue is the length of time it takes to start a new application. Pain in the ass. So, if you still want to upgrade, read on!

Update May 3rd 2007: Problems 1, 2 and 4 seem to have gone away after installing the latest updates with Update Manager, so I am now very happy with my new install of Ubuntu

Performing the Upgrade

  1. Click System->Administration->Update Manager
  2. There should be a notice on the top of the window telling you that a new release is available. Click on this button.
  3. Follow the simple steps, essentially just clicking OK at each prompt.
  4. The upgrade seems to uninstall the ntfs-3g package, which allows you to mount a Windows NTFS hard drive partition in read/write mode. Apparently it’s a known problem. To reinstall this:
    1. Click System->Administration->Synaptic Package Manager
    2. Scroll down to ntfs-3g, right click on the check box and choose Mark for Installation
    3. Click the Apply button then close the window.
    4. To mount your NTFS partition (if you’ve already set it up to be mounted at boot time, if not see here), open a terminal window by clicking Applications->Accessories->Terminal
    5. Type sudo mount -a and hit Enter. This remounts all mount points listed in your /etc/fstab file.
  5. To upgrade to Java 1.6.0 from the system default of 1.4.2, do the following (source link):
    1. Open a terminal and type:
      sudo apt-get install sun-java6-jdk sun-java6-plugin
      sudo update-java-alternatives -s java-6-sun
    2. Type: java -version and you should be told that you are using version 1.6.0.

As I mentioned, there are still some issues that I have with the upgraded version, and as (… if…) I solve them, I’ll update this post with extra information.

Posted in Feisty Fawn, Linux, open source, Technical, Thinkpad, Ubuntu | 4 Comments »

Adding a ToolTip to a Dojo Tab Container

Posted by Shane O'Sullivan on April 10, 2007

Using the Dojo Tooltip widget with the TabContainer is not as simple as one would like. It would be nice if it were possible to simply identify the Tab button by ID and add a Tooltip to it’s domNode element, which is the base DOM node that this widget is associated with. However, this does not work as the positioning of the Tab button plays havoc with the tooltip.

E.g.

<span dojoType=”dojo:tooltip” caption=”My Tooltip” id=”myTooltip”/>
<div widgetId=”myTab” dojoType=”dojo:ContentPane” label=”Info”> ….

var myTabDiv = dojo.byId(“myTooltip”);

var node =dojo.widget.byId(“myTab”).domNode;
dojo.widget.createWidget(“dojo:tooltip”,{connectId: node},myTabDiv);

The code above does not work, unfortunately. The fix is to create the Tooltip on a Span element inside the Tab button control. This will result in the Tooltip appearing correctly when you mouse over the text on the button.

E.g.

var myTabDiv = dojo.byId(“myTooltip”);
var widget = dojo.widget.byId(“myTab”);
var node = dojo.dom.firstElement(widget.controlButton.innerDiv,”span”);
dojo.widget.createWidget(
“dojo:tooltip”,
{connectId: node},myTabDiv);

Posted in Ajax, Dojo, Javascript, open source, tab, Technical, tooltip | 4 Comments »

Fortune’s Sweep-Line Voronoi algorithm implemented in Java!

Posted by Shane O'Sullivan on April 5, 2007

Zhenyu Pan, a Masters student from York University, has reimplemented my C++ Voronoi generation algorithm (itself an adaptation of Steven Fortune’s sweep-line algorithm written in C) in Java.  A Voronoi diagram is a graph where each edge is equidistant from the two points in the graph closest to it. Voronoi Diagram

Background:

Quite a few years ago (2003) I completed a research masters in mobile robotics, concentrating on robotic navigation and map building.  As part of that research, and for about a year after it, I wrote many (many, many,many :-) ) thousands of lines of code to perform map building using sonars in numerous different ways, as well as performing a lot of different analysis techniques on them, one of which used Voronoi diagrams for spatial analysis.  If you’re interested, you can download my Masters Thesis here.

So as to not see my work fade away and die, I first of all wrote an application called Map Viewer that provides lots of the useful features for researchers in mobile robotics and map building.  Secondly, I started an open source project on Sourceforge called Map Manager, which is a standalone library that people can integrate into their own research.  This included the Voronoi code I wrote, all in C++.

Back to the present:

Well, while I’ve been getting a steady number of emails over the years of people using my code (not exactly a flood, 3 or 4 per month), this is the first time that anyone has contributed back.  Zhenyu Pan completely reimplemented my Voronoi C++ class in Java, and incorporated it into a Java Applet.  Needless to say, I am very impressed.

The algorithm was originally written by a researcher called Steven Fortune in C, and while very performant and intelligent, it followed in the grand tradition of all C programs in being completely incomprehensible.  I spent many a painful night converting into a marginally more understandable C++ class (also cleaning up the code, fixing memory leaks etc).  That Zhenyu has been able to convert it from C++ to Java is very impressive (C to C++ is not so tricky, since C++ is a superset of C), as the code made very liberal use of non-Java constructs such as double pointers.  His code, like mine and Stevens, runs extremely quickly, and seems to be very accurate and reliable.

I’ll be adding his code to the Map Manager open source project soon.  For now, I’ve put his applet on the web at http://mapviewer.skynet.ie/java , and he will soon be putting it up on his university’s website at http://www.cse.yorku.ca/~aaw .

A big thanks to Zhenyu for attempting such a challenging project, and for contributing back to the project.

Posted in java, map building, open source, robotics, voronoi | 33 Comments »

 
Follow

Get every new post delivered to your Inbox.

Join 535 other followers

%d bloggers like this: