Tag Archives: Ubuntu


LDTP in jhbuild: A Cry For Help

Glom has lots of code, lots of functionality and lots of UI. It’s easy to break things when making changes to the code. So Armin set up some initial Glom LDTP python scripts to check for regressions. These scripts try to actually use the UI and then check that the application worked as expected.

I’m sure I had that working once, but it doesn’t work for me now. I wish it did because it would be incredibly useful to me. Note that I build Glom in jhbuild, so I need LDTP to work there. To simplify things, I build LDTP in jhbuild too. I’m trying this on Ubuntu Jaunty and Ubuntu Karmic. Armin has a similar environment and it does work for him.

The problem is that the waittillguiexist() [1] function calls just timeout instead of recognizing that the first window has appeared. I definitely have accessibility support enabled, and Accerciser does show the window properly. I’ve asked the LDTP developers but they haven’t been able to help me.

[1] Yes, I hate that function name. I wish that the API and documentation had received proper feedback from native English speakers. It’s rather embarrassing to look at so far.

Xephyr on Ubuntu Jaunty

Many Maemo developers have noticed that the version of Xephyr (xserver-xephyr) on Ubuntu Jaunty crashes very easily, making the SDK nearly useless. I uploaded a Xepyhr version to the Openismus PPA with the patch applied to fix the crash. Maybe one of the open launchpad bugs is relevant.

I wouldn’t generally advise you to upgrade to Ubuntu Jaunty anyway, certainly not if you have Intel graphics (for instance on my Lenovo X61) – ironically the very graphics hardware that you’d expect to work with Linux.

Learning Java Web Stuff

Relearning Java and JSP

Over the last couple of weeks I’ve been relearning Java and JSP and learning about Google’s GWT . I learnt Java when it was first released but I last used it around six years ago and I never used it seriously in a  large project.

I’m now up to speed on new stuff in the Java language, such as annotation, generics, and enumerated types, some of which I really missed not having before. A newer edition of Bruce Eckel’s Thinking In Java was great for that. I’ve always  liked how he includes comparisons to other programming languages (C++, Python, C#) and is unafraid to criticize the API that he’s demonstrating, though I wonder how interesting that is to other people.

For JSP I tried a different style of book: Head First Servlets and JSP. It’s full of clip art and silly captioned kung-fu photos and cartoons but that really did help me to keep reading. I’m only slightly ashamed.

No, I’m not going to do less C and C++. I love C++. It’s just not what’s used for web development.

Learning GWT

Of course any web site these days must use AJAX to provide a more interactive page, exchanging data with the server and updating the page without doing a whole page refresh. I’d like to avoid writing or maintaining Javascript if at all possible, so Google Web Toolkit seems like a good choice. Bizarrely, it generates javascript from Java, and it even has (imperfect) Javascript implementations of some of the standard Java library. It’s weird but it seems to work. I believe it’s used for gmail and Google Maps.

I’m using the GWT in Action book, though the online GWT documentation seems fine, and the self-hosting runnable examples are really helpful.


This also included learning about the maven and ant build/configuration tools. maven feels roughly equivalent to autotools plus pkg-config, with ant being roughly equivalent to make. As far as I can tell maven is the in thing.

So far maven is working out well for me, though all the XML to use the necessary plugins feels like voodoo and it has taken me days to get some plugins working, for instance to build WAR files to deploy to tomcat, and to use JNI. The incredibly obscure error messages don’t help and when it does what I want I am thankful but never quite sure how it knew what I wanted.

I also feel weird about using plugins from sites that I’ve never heard of. Without being familiar with the history and community, I have no way to know what is the official best plugin to solve particular problems.

Eclipse Pain Again

This is an opportunity to give Eclipse another chance. After all, it’s meant to be wonderful for Java development, right?

But I seem to need various extras to work with common things like JSP and maven, which forces me to use the hateful “Software Updated and Add-ons” feature. The problems with this are numerous:

  • It shows me many similarly but incomprehensibly named add-ons so I don’t know which one I want. It should explicitly tell me exactly what I would expect to see in my Eclipse UI after installing each thing.
  • It sometimes shows me duplicates of add-ons, just in slightly differently-named directories. What do I choose?
  • It sometimes shows me countless minor versions of the same add-on, instead of just showing me the latest one. There’s a checkbox for that in some versions – it should be on by default.
  • It almost always tells me that some dependency (or some version of some dependency, I guess) is missing. If it doesn’t know how to find it then I certainly don’t. Fail.

I managed to install the WebTools add-on in one of my Eclipse installations. But it has a rather hacky MSWindows-centric wizard, which assumes that all of Tomcat is installed in one directory and won’t let me get further until that is true. Of course on Linux distros things are split up between /usr/lib, /usr/etc, etc.  Some helpful Fedora people seem enthuasiastic about fixing it.

Anyway I generally dislike the idea that I must use a particular project wizard for things that are orthogonal. I shouldn’t be forced to choose between my programming language, my build system, or some of my dependencies. They should be independently interchangable. I suspect that I’d be happy with Eclipse just as an editor, using the command-line with my hand-edited build files, but I never seem to get that far. Eclipse should make it more obvious how to do that because it’s currently a rather hidden feature in some of the new-project wizards.

Note that I’ve tried standard Eclipse in Ubuntu Intrepid (Even Jaunty only has Eclipse 3.2), Eclipse 3.4 in Jaunty (by downloading it and running it from a directory, which works surprisingly well), and “Fedora Eclipse” 3.4  in Fedora 10 in a vmware image.

I’m not ready to give up just yet. I’ll take another run at using Eclipse just as a simple editor, trying not to use any special add-ons. But my patience surprised me.

Online Glom

This isn’t just to refresh these skills and prove to myself that I can still learn. I plan to use this to create a web UI for Glom. My plan is roughly:

  • Use JSP for the standard static parts of the page. This gives me easy authentication and session management.
  • Use GWT from within JSP to construct large parts of the page (identified by div tags). This gives me fancy AJAX UI widgets and a way for client-side code to communicate with code on the server without a page refresh.
  • On the server side, use my C++ libglom library via a Java wrapper generated with SWIG. This will at least give me database structure and UI layout details from .glom documents.

Although AJAX allows us to do more than the old submit-form/get-new-page UI of CGI, I am still not looking forward to dealing with the increased use of async coding compared to desktop coding, batching information up to reduce client/server communication, and being restricted to aggregations of serializable/copy-by-value primitive types when doing that.

My initial inept attempts at all this are in my online_glom repository on github. There’s hardly anything to see but there’s probably already plenty to correct.

Books in the Openismus Office

This is our small collection of books.


The gtkmm web site also has a list of C++ books we recommend. David and Michael really liked Accelerated C++, confirming the good things I’ve heard about it.

I’d like to buy some Beagle boards for the trainees to play with. Does anyone know of some good general books about deploying Linux to arbitrary embedded hardware? I’d also like them to have some book about setting up custom Debian and/or Fedora repositories, as most embedded projects seem to do, ideally with a proper autobuilder. They should learn about OpenEmbedded and Poky too.

Glom 1.10


Today I released Glom 1.10. There are no big new features compared to Glom 1.8. It’s mostly just a port to libgda-4.0 and the addition of an experimental sqlite backend, with limited functionality compared to the default PostgresSQL backend, for embedded use. Johannes did most of the libgda-4.0 port and Armin did the sqlite backend.

libgda-4.0 is a significant improvement over libgda-3.0, giving us better performance with huge numbers of rows . It also allows us to remove some code from Glom, such as code to escape binary data for SQL queries. Vivien Malerba was very responsive to our feedback and took our patches quickly.  I look forward to using future API to construct SQL queries from conceptual parts so we can remove that code too.

We will try to get Ubuntu packages into the Openismus PPA soon, at least for Ubuntu Jaunty, which otherwise has a (recent, bugfixed, woohoo!) Glom 1.8 in the official repository.

boost::python in Glom

I recently took another look at boost::python. It was a much better experience than when I first tried boost::python for Glom in 2005, probably because my use of the Python C API in the meantime has helped me understand what boost::python is doing. I have a mostly-done patch to use it in Glom 1.12 (Glom 1.10 will be released soon). This should make the code simpler and much more robust, allowing me to add more Python API to Glom, allowing people to drive more of the Glom UI via scripts.

As a side-effect this will force us to enable C++ exceptions in the Maemo build for Glom 1.12, increasing code size, but that might be less of an issue by then.

I do find the boost::python documentation fragmented and unfocused, spending too much time congratulating itself about its use of various design patterns and generic programming techniques in the implementation, instead of just telling me how to achieve common tasks. It often assumes knowledge of the Python C API, as if it is based on original proposals or internal documentation. Many companies are using boost::python so I’m surprised that none have arranged for more useful documentation to be written. I’d be happy to do it if someone wants to pay for my time.

In fact, boost::python’s API maps closely to the C API, so you probably need to know both, though I hoped that boost::python would make it clearer and more explicit.

However, the people on the boost::python mailing list have been very helpful when the documentation has not been clear or where I have made silly mistakes.

Boost should install pkg-config .pc files

Getting the CFLAGS and LIBS for boost python in your configure.ac is insanely difficult and fragile. There are some .m4 scripts out there, but I can’t get any of them to work. Why on earth don’t they install a .pc file? They can’t all be Windows programmers.

And despite using unstable APIs, they don’t seem to allow parallel installs. For instance, on my Ubuntu Linux system, the headers are directly under /usr/include/ rather than /usr/include/boost-python-1.0/. GNOME gets this stuff right.

The need for parallel installs is even greater for boost::python because there are various possible incompatible configurations, any of which you are likely to find on your system. At the moment you will just get compiler or linker errors (which distro packagers don’t understand) instead of being able to explicitly depend on a specific version with a specific build (which distro packagers could understand).

This will make life difficult for Glom distro packagers, but I think it’s still worth it.

Scanner for Linux?

Can anyone recommend a fairly recent model of scanner that is absolutely sure to work with Ubuntu Linux. I guess that means that it will work with the “XSane Image Scanner”, from inside Gimp, and with the gnomescan project’s “flegita” GUI. By recent I mean widely available to buy now.

I have too many paper-only documents so I want to back them up electronically.

As usual, the information about supported hardware out there is rather vague, with wildly differing interpretations of “works ouf of the box”. If you need to compile a driver or edit a text configuration file then it didn’t work out of the box.

Update: I don’t really want to buy an all-in-one device just to get a scanner. I already have a printer.

Gramps for Geneology

My father has become slightly obsessed with tracking his family tree. He’s done lots of research going back around six generations. He uses a Windows application (called “Generations”, I think, but I’m not sure now), which is very awkward, though he manages.

When his grandson Liam arrived, he wanted to put Liam’s family tree in his system too. Germans tend to have quite good family records, backed up by Church archives, so we had some data.

I exported the result as a GEDCOM file and was really pleased at how well the open source GRAMPS application imported this file on Ubuntu Linux. For some reason I didn’t have high expectations, but this application is obviously well maintained.

And Gramps seems to be a better application anyway. It has a more sensible UI even though it is as feature-packed as these applications needs to be. Gramps also creates more compact ancestor graphs, so you don’t need to tape so many pages together. But it could still theoretically squeeze more on to the page at a readable size. This might already be possible but it’s hard to achieve with the awkward printing options.

Thinkpad X61: Everything just works in Ubuntu

Yesterday I received my new Lenovo Thinkpad X61. It’s the UX29DGE model, with Intel GMA X3100 graphics (gnome-device-manager says GM965/GL960), and 2.20 GHz Core Duo T7500. It shows up as Model 76739DG in gnome-device-manager.

After fighting with Windows Vista to reduce its partition size enough, I installed Ubuntu Hardy easily. I wanted to keep Vista around so I can look at it sometimes, but that short experience of it is enough to help me understand why people hate it so much. It’s as if they went out of their way to break all the basic principles of UI design, as if the managers had a running feud with the human interface department and wanted to outrage them. People who hate computers (most people), and who think that computers hate them, will not be surprised.

But it’s great to have a new laptop on which everything works. Even hibernation. I’ve never seen that work before and it’s truly useful. I wish my desktop could do it, in the absence of working session management.

I am a little disappointed that it’s almost as hot as my Acer. I guess this is just how all laptops are. How do people manage to use these things on their laps? Do we need a control panel to limit the CPU speeds, together with the internal temperature sensor, with options for “cosy”, “slow grilling” and “burning trousers”?