Revo Pico RadioStation

I am incredibly pleased with my Revi Pico RadioStation Internet radio. It’s easy to use and has a rechargeable battery so I can use it much like a regular portable radio. I wanted to have more English around the apartment so Liam hears more and to stop my vocabulary from degrading to the international English that I use in Munich if not speaking German.

Setting up the connection to my WPA2 wireless network was perfectly simple. I just chose the network then entered the pass phrase and it connected. Choosing radio stations is easy, by location, genre or search, with popular stations in “highlights” lists. When turned on it starts playing whatever station it was playing when turned off.

It gets the list of radio stations from wifiradio-frontier.com. I wish that we had access to a list like that on the Linux desktop, for instance in Rhythmbox. The website lets you set up groups of favorite stations, which then appear in the device’s UI. That’s rather clunky – for instance, I can’t correct the spelling of my “Scotlland” group without completely recreating the group. Likewise, I can’t move stations between groups. Obviously I’m concerned that the website might disappear one day, orphaning the device, but I expect the device to be technologically outdated before that happens.

The UI is very good, only limited by the two-line text display and the slow automatic horizontal scrolling. That’s particularly noticeable when choosing podcast episodes, which all tend to have the same long prefix in their titles. It would also be nice if it played podcast episodes sequentially instead of repeating the same episode. But that’s not the primary purpose of the device.

The company is based in Lanark, Scotland, though they manufacture in China. My RadioStation’s serial number of 1005 is surprisingly low.

Maemo 5 Desktop Widget Example

I’m working on some example code for Maemo 5 as standalone modules with full autotools files.

I now have Desktop Widget example code working in the Maemo 5 Beta SDK, showing a simple clock face, using the drawing code from Davyd Madeley’s cairo-based custom widget example, with his kind permission. Implementing a Desktop Widget is much like implementing a regular GTK+ Widget: You can draw in the expose-event handler, or add child GTK+ (or Hildon) widgets.

I’ve filed documentation bugs to make it easier for the next person to figure out how to implement and install Desktop Widgets, and a few bugs about the Hildon documentation in general.

I expect the final Maemo 5 version to have many standard Desktop Widgets, far more attractive than this:

maemo_beta_sdk_clock_in_edit_mode

In Desktop Edit mode, you can move the Desktop Widgets around by dragging them with your finger, remove them by touching the X icon, or configure them by touching the spanner icon. You can add extra widgets (if installed) by touching the “Desktop menu”. Note that you need to apt-get update and upgrade after installing the Beta SDK to see the X and spanner icons.

The rendering artifacts (such as the white line at the top) are just a known bug in Xephyr (on the PC). They won’t appear when running on an actual device.

Stiller

It’s taken me about two years on and off, but the long slog is finally over. I finished reading Max Frisch’s Stiller in German.

I’ve read maybe twenty English books while trying to get through it, never quite giving up, never caring if the character is actually Stiller, uninterested in the commentary on Swiss society. Now it’s done. His Homo Faber was more enjoyable.

libglom is now 100% non-UI

libglom has been mostly theoretical until now. But I just removed all the UI code and the GTK+ dependency so it can now be used realistically by applications other than Glom itself. This small libglom document-parsing C++ example shows how easily you can get the basic details of the Glom system. This is only in svn for now.

And here is a small libglom test case in Java. (Yes, that’s not a well structured junit test case – I’m just throwing code in there as I  create the API.)

I’m using SWIG to create a Java API for the libglom C++ API. SWIG seems very capable and handles real C++, but the syntax is alien to me so I’d be very glad if a SWIG expert chose to do that job for me.

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.

Maven

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.

Cooperating Application Instances in GNOME?

I believe that a document-based GNOME application should do these things, even I start two instances from the panel’s Applications menu rather than starting the second instance from the application’s File menu. (For now, let’s ignore single-instance tabbed applications such as gedit.)

  • File/Quit should close both instances.
  • It should list the open instances in a Documents menu.
  • It should warn me if I open a file that is already open in another instance, offering to just bring it to the front.

Single-process, single-instance

Firefox does this. Gnumeric and Abiword don’t, though it works for a second instance that I open via File/New. They probably start extra File/New instances in the same process and keep track of them via static data.

They could solve the problem by enforcing a single-instance via libunique, so the one process knows about all “instances”. Yesterday I easily added libunique support in my experimental gtkmm document/view framework, Bakery, because I want to fix this problem in Glom.

Many processes, single-instance?

However, having all application instances in one process gets annoying fast. Applications do hang or crash sometimes and it’s nice if that does not affect every open instance of the application. People probably don’t notice this because they rarely use File/New or File/Open. They probably do notice that File/Quit and the Documents menu don’t work as they’d expect.

So I guess we need some RPC to allow each application instance’s process to talk to all the others, maybe using a D-Bus interface. But that would quickly get complex and buggy and would provide multiple opportunities for code duplication and inconsistent behavior. I guess some shared API is needed. Has anyone else thought about this or even solved the problem already? Is there even one application that does it properly already?

Maybe it would be simplest for application instances to register themselves with a desktop-wide D-Bus service which could also be asked for a list of open documents.

What do other platforms do?

Back when I used Apple MacOS (versions 5 through 8) this was normal and worked, probably partly because the Finder maintained a list of open documents and didn’t even try to open second instances of already-open documents. The MacOS toolbox API was incredibly primitive back then so I guess that applications solved this individually. But it was a simpler time.

I wonder if MacOS X has actual API to help applications solve this problem.

Books in the Openismus Office

This is our small collection of books.

office_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

glom.png

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.