Laika Eclipse plugin

I sneaked out of bed early this morning to invest some time in setting up Eclipse, hoping it can speed up my current tedious build/check/fix/build routine while working in Scratchbox.

  • You’ll want to install the recommended eclipse-gcj package as well as the eclipse package, because it seems to make it faster.
  • The Laika plugin requires a newer CDT (C/C++ development plugin for Eclipse), because Ubuntu Edgy has an old (and apparently incompatible) one. You can install that via Help/Software Updates/Find and Install/Search for new features to install/Callisto Discovery Site/yadda yadda yadda.
    I guess this will clash one day with the Ubuntu-packaged CDT, when they update it, but that’s some fun for later.
  • You’ll get “permission denied” and “file does not exist” errors during the install unless you fix the permissions (maybe this is OK in a fresh Ubuntu Edgy install?), like so:
    /usr/lib/eclipse$ sudo chown youruser:youruser plugins
    /usr/lib/eclipse$ sudo chown youruser:youruser features
    Update: In later versions, you will also need to do the same thing in /usr/local/lib/eclipse/
  • Install the Laika plugin by the same method, after adding the http://www.cs.tut.fi/~laika/update remote location. Don’t use the URL as the human-readable name for that location, or it will fail.
  • In Window/Preferences, there are now Scratchbox preferences. The defaults are mostly good, but you’ll want to change the X Environment preferences to run your start_xephyr script instead of vnc. There are details about this in the Laika manual (in the left-hand menu on their web site).

When using File/New/Project, you’ll now have extra wizards under C and C++, such as “Standard Make C Project inside Scratchbox”. When you create one of these projects you’ll see convenient toolbar buttons to start the X Server, and to start the Maemo desktop (af-sb-init.sh start) inside scratchbox, on that display. You can even start your project with a GTK+ helloworld.

Note that clicking the Run button will show an “Internal Error” until you open that Run combobox, select “Run …” and select a path to a generated executable in the “Application” entry (the second one).

Eclipse has awfully obscure UI, and I can’t be the only one who thinks this. I wonder why it isn’t getting better as a result of being open, or maybe it used to be worse. Unfortunately, people have become used to IDEs that hate them (MS Visual Studio).

Workspace schworkschpace

Now there’s just the usual IDE problem of it forcing you to import (copy) your projects from other directories instead of just letting you open your existing project. (This is not Laika’s fault.)

As I’ve mentioned before, I don’t understand why Eclipse defaults to forcing me to put my source code in $HOME/workspaces, and copying existing projects into there. Just let me edit my files and build my executables without pretending you’re special. It’s good to make it easy to make your first helloworld project, but don’t make it hard for me to actually work with this thing afterwards.

The fix for this is to:

  • Open Window/Preferences, choose General/Startup and Shutdown, and select “prompt for workspace on startup”. Notice how it’s cryptically named – it affects project creation, not program startup, and it doesn’t prompt, it just lets you choose a non-standard workspace, without telling you why you’d want to do that (see the next point). And it’s hidden away among hundreds of other options, without even a tooltip to guide the user.
  • When creating a project (The import feature is now unnecessary), the Project Contents frame now lets you select an existing project’s path instead of $HOME/workspace. If there’s a project there already then it will just add the Eclipse files without moving or copying your existing files. If there had been no files there, it would have offered to create some. That’s implicit, hidden, and unexpected. This “feature” should be made explicitly available.
  • Update: Aargh, no, it silently overwrites your build files, such as autogen.sh, configure.ac, all your Makefile.am files, and even the license (!) in COPYING. Bastard.

Further ranting: Why oh why can’t an Eclipse project contain characters such as “-“? Why go to the trouble of implementing UI to prevent users from entering this, instead of just fixing whatever text escaping bug it’s hiding.

Update: I was looking forward to code-completion, but I had to turn it off in Window/Preferences/C/C++/Editor/Content Assist and unclicking all 3 triggers. One minute of hang (100% CPU) whenever I type -> is not working out for me. (Or only 20 seconds when I tell it to search only the current project and not the include files.) When the user clicks or types away from the line, the code-completion search really should silently cancel.

GNOME Foundation Board candidates, 2006

It always happens at the last minute, but we again have a great list of candidates for the GNOME Foundation board, possibly the best ever, and quite diverse. Dave Neary’s candidacy statement is promising yet pragmatic, and shows what the foundation is achieving, really fulfilling its purpose now that it’s cleared up the dull stuff. He’ll be chairperson again, I hope. And it looks like he’ll have a motivated and decisive set of colleagues. It’s getting better all the time.

GNOME Germany also has elections in December. We’ve become slightly better organised, but opportunities have been wasted over the last two years, mostly through lack of clear leadership and openness. We’ve failed to expand the membership past a small bickering core, and we’ve failed to navigate German beaurocracy. Reliance on donated server space even means that the web site is now offline, and even before it went offline there was a useless plan to move it to yet another wiki engine and CMS system, wasting more time and effort and reversing what’s been achieved. So it’s time for a completely new start and it’s time to get results. I think Jörg “Josh” Kress is providing the best leadership right now, so I hope he is enthusiastically elected as president. I’ve already posted him my “Vollmacht” so he can vote on my behalf at the meeting. I’ll get more involved again if he is elected.

Embedding Python and importing from memory

Time to ask the web again:

In Glom, I use PyRun_String() to execute python scripts from memory (the scripts are never on disk), and get the result. But I’d like those scripts to be able to import Python modules that are also in memory (in a virtual library of reusable code). Python’s import statement usually just looks for files in the Python import path. I’ve looked through the Python/C API reference, but I can’t see anything suitable. Unlike C, you can’t just paste the code into the start of the script, because being in a module affects the syntax.

I have a vague idea that PyImport_ExecCodeModule might make the Python code importable under the provided name, but it seems to require a compiled object, for which I need to supply a filename to PyNode_Compile().

I’d rather not write all the files to a temporary directory just so they can be imported. That seems like a fragile hack.

Update:

object = Py_CompileString(script_text, module_name, Py_File_Input) followed by PyImport_ExecCodeModule(module_name, object) seems to work. Thanks commenters. But now I wonder how to remove modules when they have been removed from the virtual library. Maybe I could do PyImport_Cleanup() each time, but that is documented as for internal use only.

Probably not running for the GNOME Foundation Board again

Since taking a high-level view of things again at the UDS, I am very tempted to run for the GNOME Board this year. Today is the last day for candidates to declare themselves. Apart from the general wish to help out, I’m mostly tempted because it’s a lot of fun and you get to chat with people you respect and hear about stuff you otherwise wouldn’t. They don’t seem like virtuous reasons though. And I’m concerned that I’d hit conflicts of interest because I view several of the Advisory Board companies as potential Openismus clients. So I probably won’t.

Ubuntu Developer Summit, Mountain View

I’ve covered the food and the flight, so now for some actual details about the Ubuntu Developer Summit in Mountain View.

Canonical (or Ubuntu, or even Google, not sure) sponsored travel and accommodation for “upstream” participants, including several people from GNOME and associated projects. Now that’s really working with upstream. We were new to the Ubuntu Summit way of doing things but figured it out quickly. I think we all felt we should be doing more to justify our presence, but hopefully we provided at least some valuable input and advice, and some of us even started implementating specifications. But most of the specifications being considered were lower down in the system, dealing with things such as drivers, devices, X, etc.

The Ubuntu Summits work by discussing specifications and gradually fleshing them out and turning them into definite actions over the week, with Launchpad (trying to) generate a meeting schedule for each day that gets all the relevant people in the right place at the right time to get this done. This Linux.com report about the UDS has a good overview. Matt Zimmerman does a great good-natured job of keeping things on track without being unpleasantly authoritarian. He should have a blog.

These specifications were relevant to us GNOME people:

  • Easy Codec Installation: Tim Mueller and Wim Taymans are adding additional details to GStreamer’s error reporting, and Ryan Lortie is implementing an asynchronous (returns immediately, calls a supplied callback later) C API (libgimme-codec) that can take this information and request that an appropriate GStreamer plugin be installed if one exists to support that codec/muxer. I think Canonical’s Ian Jackson is working on the command-line tool that Ryan’s library will use. The idea is that each distro can provide their own implementation of this command-line tool, so that no distro-specific stuff is needed in the applications. We agreed on this really quickly, and most of it was done by the time UDS was finished.
  • Composite By Default: Discussion about installing Compiz (or the Beryl fork of Compiz) by default as an option, though it obviously isn’t ready to be used by default. Beryl was favoured in general, I guess because the maintainers were there, and because it was the only one that was currently packaged for Ubuntu. But the maintainers, though nice people, don’t understand the pain that’s involved in being a window manager maintainer, and I think they are more concerned with gimmicks and their settings than with subtle usability or with juggling the often-conflicting needs of various fanatical WM users. People seemed to believe that composite support in Metacity has been abandoned by the Metacity developers, but I haven’t found any evidence of any such decision, and I still hope that can be done, to avoid years of regressions and hate email from bearded types. Packaging it as an option should deal with the feature parity issue for now.
  • Face Browser: Mirco Mueller might implement a snazzy 3D face browser for GDM’s login screen, for small business and home users (who don’t have too many users to choose from).
    This started out as general discussion about how to make sensible use of 3D effects during login. I don’t think anything more is still specified, but we realized that we could do quite a bit just by handing control of the background to a separate process, much as you can tell xscreensaver to render on the desktop background (X’s root window), with some extra information about the location of the foreground widgets. Of course, this could be abused for irrelevant gimmickery, but I think something subtle and slow could have a nice effect both on the login screen and the desktop background. How can we get Olafur Eliason (not my photos) to design a background theme?
  • They had some questions about a couple of items in the Common Customizations spec, about:
    • a numlock-on-startup setting. I discovered that the numlock setting is meant to be saved automatically, so no setting should be needed, but that probably only works when session saving is enabled, and it usually isn’t.
    • dial-up configuration with the Networking control panel, though I’m not sure whether they have problems with the current “Modem Connection” feature or they were missing support for DSL. The spec has been approved, though it’s still vague about these things.
  • Various X specifications: Keith Packard had lots of good news about X.org 7.3, though that won’t be ready for Ubuntu’s next release. All kinds of things should just work, even without a configuration file, and without restarting X, and be configurable generically (without driver-specific APIs) where necessary, such as projectors and multiple screens. He also has high hopes for the new open source (mostly reverse-engineered) Nouveau driver for nVidia cards. I like how Keith can shift from technical-level to user-visible-level easily where appropriate. He’s not your average geek.
  • Tab Consistency: Over the last couple of years, several GNOME applications (gedit, gnome-terminal, epiphany, gaim, firefox) have implemented their own closable/reorderable tabs. mostly for document-based applications, but they are inconsistent in how they place the tab close button, how they do drag-and-drop reordering, scrolling of excess tabs, which tab is selected when one is closed, where new tabs are added, etc. Gaim actually has options for most of this, really. Luckily, Firefox 2.0 solves the major problem – it previously had one tab close button while every other application had one on each tab, and GTK+ 2.10 has API that applications could now use to do consistent reordering. GTK+ still needs API for the tab close button. However, the spec was being pushed in the direction of changing all applications (and/or GTK+) to be consistent with the old Firefox way (one close button on the right), which would be a silly amount of work just to be inconsistent with every other distro.

The meetings about the Ubuntu release process were interesting, after my experience on the GNOME release team. It’s mostly similar, though they have a much wider set of things to worry about. I do think they suffer from the tendency that prevailed sometimes in the GNOME release team of looking on the bright side and persuading ourselves that everything would be OK. In particular, I think a mere one week gap between a release candidate (when far more people actually start testing) and a final release is wildly optimistic and probably unnecessarily painful. Anecdotally, Ubuntu Edgy shows the result for me, with at least 5 very user-visible bugs, while Ubuntu Dapper (with a longer stabilisation phase) was remarkably polished.

But I’m just a first-time spectator to that process, and it’s genuinely difficult to schedule enough time for boring bug-fixing and testing while still keeping developers enthused enough to actually do that work. Occasional long-time-support releases are probably a good way to balance that, though I wish there was a way to get more upstream bugfixes into the LTS releases without forcing use of backports of completely new major (with new features) versions.

Otherwise, I spent the time on the GNOME couch (Mirco’s photo) goofing around with the GNOME people more than I have a chance to at GUADEC, such as Ryan Lortie, Christian Kellner, Raphael “unpronounceable” Slinckx, Lennart “Milkybar Kid / Doctor Zee” Poettering, Danilo Segan, and loveable Ubuntu/Canonical people such as Daniel Holbach, Michael Vogt, and Sebastian Bacher (the Frenchest accent since Daniel Veillard). I agree with Ryan – these are people I’d just hang out with for the fun of it if we lived in the same place. It’s also intellectually simulating to meet the other people who deal with such different parts of the system.

I also found time to do some mindless hacking that I don’t have time for normally, such as continuing the port of libgdamm, pygda, and Glom to libgda 3.0, and writing some documentation.

I’m still feeling the Jet lag. Yesterday I woke up after a full night’s sleep, drank 2 cups of coffee, and fell asleep for 5 more hours.

Munich -> San Francisco airport security

More blather about the San Franciso trip:

The security procedure at Munich was more thorough than expected, with three security checks to pass through, with everyone having their shoes, bags, and jackets scanned slowly. The staff were aggressive, rude, and dismissive. Transatlantic flights still have the no liquids rule (very small amounts allowed in transparent bags), but other carry-on such as laptops is allowed.

Surprisingly, the officials on the U.S. side were much more pleasant, though arrivals must have their fingerprints scanned and a picture taken with a webcam. There were posters promising to treat people with respect. It might be a californian thing, because it wasn’t this good when I travelled to New York in 2000.

At San Francisco airport on the way back, most people just had the regular amount of scanning, but I was one of every N people who had special attention, going through the “puffer” machine, which blows airs at you so it can detect explosives residue. I’m sceptical that this can ever be anything other than undersensitive or oversensitive (various Irish people have been wrongly convicted for IRA attacks over the years based on false positives caused by playing cards, soap, etc), and doubt that it’s ever tested in action, but was pleased when the light went green.

They were nice about it though. I even had a friendly conversation with the guy who searched my bag and found a Toni Morrison book. He was telling me about some marriage problems she’d had recently, but after some confused googling I’ve concluded he was mixing her up with Terry McMillan (both American black female authors with male first names, and surnames beginning with M, I suppose). Until I figured that out, I liked the idea of the security guard appreciating literature.

Visiting the Googleplex: Worth it for the produce alone

The Ubuntu Developer Summit was hosted at Google, which was special.

The buildings are fairly ordinary, but there’s a bright lively atmosphere and a sense of abundance. I didn’t see many people over 30, and they all seem to enjoy life on the Google campus, protected from the grey world of highways outside. These people seem happy in their work.

We were in building 44, across the street from the main Google building, in a conference or presentation room, with side-rooms for meetings. Google allowed us (mostly me) to gorge on a steady supply of coffee, bagels, cakes, scones, fruit, crisps, and tubs of ice filled with soft drink cans.

Lunch time was a high point of the day. The rumours about Google’s canteens are true. The cooks really know what they are doing and have the means to do it. Eating there makes people smile. And there’s several (!) vegetarian choices, with skilful use of tofu. This would be the top restaurant (for me) in Munich, and it’s free at Google. The two canteens I saw were both called “No Name Cafe” – I think each building has one. Pictures at the Google Food Blog. After suffering months of Siemens food during on-site projects, this feels like a recruiting tool.

Outside the cafe there’s a chill-out area, with several retro video arcade machines, such as Defender and Pac-Man.

Things I noticed at the reception area of the main entrance (random pictures found on flickr, not mine):

  • Replica (apparently) of Space Ship One hanging from the ceiling. It’s smaller than I expected.
  • Screen with rotating earth, with columns of light indicated search activity at that location, color-coded for language.
  • Searches text scrolling up a white-text-on-black screen. Apparently it’s not real-time.
  • Large horizontal whiteboard for the made-up Google Master Plan. Each visitor can add to their own decision boxes and associations. The last entry at the right when we arrived was “Ubuntu Linux on all production desktops for teh win”. I shit you not.
  • An old copy of a classic Artificial Intelligence book (Patrick Henry Winston‘s one, I think), and old AI conference proceedings, as light reading while you’re waiting.
  • Free candy.

Other stuff on campus:

  • A resistance pool, for swimming in place.
  • A Hairdresser.
  • A Gym
  • Massages
  • Electric scooters

What I’m doing now

OK, so I can’t tell you much about what I’m doing, but I can tell you that I’m busy.

Tomorrow I fly to San Francisco to attend the Ubuntu Developer Summit, at the Googleplex for the week. This is unrelated to everything else that I’m doing, but should be fun.

Since the start of September I’ve been working on a small experimental project for an Openismus GmbH client. It’s secret but not currently part of any actual product or strategy for the client. It’s using the C-based GObject API, so I’m playing lots with GObjects properties, interfaces, vfuncs, inits and constructors, etc. This is full time for me until approximately early January 2007.

I’m also steering some work that Daniel and Johannes are doing for a client, which is mostly about creating documentation at the moment. That’s secret for now, though not for any particularly good reason, and will definitely be public and generally useful eventually, at a secret time in the future. They can’t say, so don’t ask.

I’m also doing bits and pieces and general support here and there for another Openismus GmbH client, and working on the repository analyzer for them.

I’ll likely have some work to do soon for yet another locally-based (more or less) client who have some long-term plans to use gktmm on embedded devices for a specialized market. They’ve already started and are doing well, but would like some advice and manpower.

In general, I’m busier than I’d like to be. I’d like to always have some excess capacity so that it’s easier to accept work for new customers, with the added avantage of being less stressed and thefore more productive. An extra full time employee would make that happen, but I’m not quite ready to do that yet, given the lack of guarantees of enough work in the longer term. Possibly I’m being too cautious.

/tmp does not belong in file save dialogs.

Here’s something that shouldn’t happen.

  • User reads her email with a web-based email service, using Firefox.
  • User opens an MS Word document (something.doc) that someone sent her via email. OpenOffice opens it.
  • User changes document and saves it with a new filename (something_changed.doc). OpenOffice offers to save it next to the existing document, which Firefox put in /tmp, because Firefox thinks it’s just saving a temporary copy so it can tell OpenOffice to view it. User says OK, because what does the User know about “tmp”?
  • User shuts the computer down.
  • User starts the computer.
  • User tries to find the document. After much difficulty, she finds /tmp, but the document has been deleted (because it’s deleted at startup, though the user doesn’t know this).

This happens in Ubuntu Dapper and Edgy at least. I think that Firefox in Ubuntu Breezy used to save the temporary documents to the Desktop, instead of /tmp, which was also annoying.

I’m not sure what the best general solution is, but I can imagine that some of these might help:

  • Temporary documents could be read-only.
  • GtkFileChooser could warn about saving documents in /tmp, and/or not allow /tmp to be shown when saving documents.

Repository Analyzer improvements

I’ve done some more work on the debian Repository Analyzer that I mentioned before, which can help companies with license compliance by helping them to discover the licenses of their debian-based product’s software, and to navigate around the dependencies with that information.

Now it identifies some standard free-software and open-source licenses (such as GPL, LGPL, MIT, X11, Boost, etc), though you’ll have to sanity-check the results, because there are several ways that it can automatically guess wrong when looking at the tarballs and diffs. There are Open Tarball and Open Diff buttons so you can take a quick look at the files for yourself.

It still ends up with lots of apparently-unique licences – for instance, there seem to be quite a few minor variations of the BSD, MIT, and X11 licenses. It needs a human to decide whether they are really equivalent, but I added a Remove As Duplicate button to let a human do that. That was a nice exercise of Glom’s pygda and pygtk support in Glom (This requires Glom 1.2).

There’s a lot of bugfixes too. In particular, it now does a better job of handling license files in various text encodings. This is still non-expert Python code, so I’d welcome any cleanup patches.