When designing computer systems, keeping various orthogonal aspects separate is a very good idea: it keeps the design clean and the various parts of the code easier to understand and to test. When designing an UI, this orthogonality adds states that might not make sense and add clutter and noise.

One example of this I found in the UI displaying flight information on airplanes. They all follow the same pattern: various bits of data are rotated in various languages and units. As my flight was from Roma to Zürich, the languages where: Italian, German, French, and English, and the units where metric and imperial. I’m not really sure which type of miles where displayed (US or nautical), nautical would make more sense, but then should the speed not be expressed in knots and not MpH? Things would be simpler if we only used metrical units, but that is not the point here.

In any case, the system displayed temperatures in Fahrenheit degrees in French, Italian, and German, which makes absolutely no sense. Fahrenheit degrees are only used in the US (and two minor Islands that speak neither French or German, or Italian). While the unit system is orthogonal of the display language, there is in practice a strong coupling between the two. For me this is the typical case where orthogonality in the underlying system (which is good), transpired in the UI, producing noise (which is bad).

Flattr this!

A pink church in a yellow field with a blue sky in the background.

Street Parade and Bodensee

A pink church in a yellow field with a blue sky in the background.

This year, I did not go to the Street-parade. Péter had suggested we do a bike tour of the north part of the Bodensee, which, given the weather, I gladly accepted. The weather was gorgeous and it is a very beautiful region. While we though we would escape the bustle from the Street-Parade, we did not know there would also be the Seenachtfest in Konstanz. Compared to the 950’000 visitors of the street-parade, 60’000 does not seem like a lot, still Konstanz was pretty busy when we returned there to take the train.

One interesting thing about the street-parade is the amount of traffic it generates on my blog. I wrote a blog entry about it in 2007, and year after year it still gets a lot of traffic around the time of the party. See the graph below for this year’s spike:

Flattr this!

clear screen

Programming English

One of the annoying fictions of my work is that programming code is written in English. This is affirmation is technically correct (the best kind of correct), but in reality the language used in the code is a very restricted subset of english. When writing, and to a certain extent when reviewing code, I generally use the following principles, some of which are inherited from technical writing, others specific to coding:

  • Semi-colons are only used in code, nobody knows how to use them in English.
  • Eschew the usage of complex vocables, the demeanour of using convoluted words is jejune.
  • Avoid shortened expression with apostrophes, i.e write “This will not…” instead of “This won’t…”. The reason is that depending on the context, i.e. the type of file, of programming language, and within a single language the type of string or comments, the apostrophe needs to be escaped or not, so searching for a message in the code is needlessly complicated. At any rate, English works fine without apostrophes.
  • Avoid the use of the saxon genitive, first because its use involves apostrophes, secondly because its usage is less general than using of. One advantage of applying the two rules above is that it avoids the issue of mixing up its and it’s.
  • Avoid pronouns. Either repeat the word, or use variable names. Strangely enough, I find single letter variables in text much clear that longer ones; this is probably a leftover from mathematical writing, but I also think this because the context change highlights the variable.
  • Avoid synonyms, they add ambiguity, break the search tools, and increase the chances the reader does not know a given word. A cat is always a cat, never a feline. I don’t care what your english teacher said.
  • Avoid the Picard Technique. There are a lot of words of latin origin that are technically valid in English, but not widely used except by marketing people and spaceship captains. For instance to say “This commences the thread that utilises the laser interface” as opposed to “This starts the thread that uses the laser interface”. It is a trap! Easy to fall into when one is a native speaker of a latin language like french.
  • Function or method names are always followed by opening / closing parentheses, i.e. FireOrbitalCanon().
  • Avoid being smart. Names that are puns, allusions, are very dangerous because they are usually built one some cultural knowledge. While English is the shared language for the code, the various cultures used in English speaking countries are not. In other terms, you can assume the reader of your comments will understand English, but not the vocabulary for gold mining or references to the Simpsons.

Flattr this!

Old Java Stuff

Oracle has finally released the version 7 of the Java Runtime Environment for OS X in the same way than the other platforms. This marks the end of a long story: Sun never properly supported Java on the Macintosh – I remember using the version bundled by Metrowerks to work on my Diploma. With OS X, Apple took over the maintenance and integration, and it has recently decided to step down and pass over that responsibility to Oracle.

I don’t think this change will have any serious impact, Java on client machines was dying, and Oracle’s antics have certainly not improved the situation. As far as I know, I only have only run two Java application in the last six months, a configuration utility for my printer, and the software for my tax declaration. I have run more tcl-tk applications in the same period.

I really like the Applet idea, and Java is certainly a way better language than Javascript, alas Sun never really understood client software or UIs, and this showed in the GUI apis, none of them were really nice or efficient. Even on my current laptop, Java feels sluggish.

During my PhD I wrote some applets (besides the Java Quickdraw library), like the one in the side of this text. I’ll add them to this blog when I have time.

Flattr this!

Technology Cycle

Technology Cycle for Devices

When people talk about technological progress, they often seem to have the vision of a unstoppable army going forward, knowing where it goes. For me it looks a lot like a large river, unstoppable, but meandering around in unpredictable ways. One by one, objects around me are crossing the barrier that separates analog from digital. This evolution seems to follow some recurring path, where usability first degrades to improve afterwards. Here are the steps I observed.

  1. Analog device. The object has one purpose and just works for that purpose.
  2. Digital device with a clock. The first thing that you notice when a device becomes digital is that it gets a clock. The objet has a limited amount of buttons, and the clock is difficult to program, so often the device stays at the blinking 12:00 state.
    My kitchen and bathroom scales are at this level.
  3. Digital device with battery. A battery has been added to the device, so it can keep it state in case of power-cut, lots of feature have been added, but the device is way to complicated to configure properly, so the majority of its feature are unused. It displays winter or summer daylight saving time all year around.
    My old stereo is at this level.
  4. Digital device with serial port. A serial port (or a hacked usb-port) has been added to the device. Hackers can now use the device for many purposes, for the available population there is no noticeable changes. The device has now more unused features.
    My Casio electronic dictionary is at this level (no serial port, but proprietary USB).
  5. Digital device with USB port. The device has an USB port with some working protocol. It can now be used with computers relatively easily. The digital device is now much more useful than the analog equivalent. Digital cameras and MP3 players are typically at this level.
  6. Digital device with network connection. The device now has a network connection (Wifi or wired ethernet). The device can now be used in conjunction with other devices. Hardware is not the limiting factor, but software.
    My phone, my TV, my amplifier and my gaming console have reached that level.

Note that I’m not convinced there is a strict causation between certain feature and usability, more of a correlation.

Flattr this!

Python Logo

A script to change network location automatically

Python Logo

As I mentioned earlier in this blog, I run a squid proxy in my home network. I’m using Mac OS X’s location feature to have two settings, a default on without proxy, and my home network with some customisations, including the proxy setting. Of course, when I move around I always forget to switch. As I always have a shell terminal open, I wanted a command that just fixes the issue by looking at the current wifi setting. There are numerous apps trying to solve the same problem on the web, they are usually way to complicated for my taste: adding icons to the menu bar, running on a permanent basis and generally making a nuisance of themselves. I was kind of surprised this feature was not added to Mac OS, as iOS solves the problem more elegantly: proxy settings are associated with the SSID.

The good news is that there are two command-line tools that provide the needed information. The first is
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport which can be used to return information about the current 802.11 network. The second is
/usr/sbin/scselect which can be used to select the current location. So I wrote a small Python script that uses the information from the first to configure the latter. The configuration is simply the map in the beginning of the file, which contains the relationship between Network name and location name. You can download it here

Flattr this!

A Fish drawn in Ascii Art

The Fish Shell

A Fish drawn in Ascii Art

There are things you drag around with you for ages, because they just work. In the last ten years, I have moved between three countries, but I have kept using the same shell, with the same configuration that kept getting more and more elaborate. Sun microcomputers has died years ago, but my bashrc is still theoretically capable of configuring itself on SunOS.

A few days ago, Angel showed my a new shell: fish, aptly titled Finally, a command line shell for the 90s, the was rebooted Ridiculous Fish who already wrote a very good hex-editor for Mac OS X, HexFiend. Basically, fish is a shell that does the right thing out of the box and uses features that appeared in computer since the eighties: colour, unicode, thread. Fish is also very good a completion, it parses man pages to build its completion lists and seems to have custom files for many other Unix tools. This convinced me to try it as a replacement to bash. I’m pretty happy with fish and I really recommend you try it out.

wiesmann@wagamama~/Downloads> google_chrome_app  google_chrome_app  (Google Chrome)  google_earth_app  (Google Earth) google_drive_app    (Google Drive)

One nice feature I had on bash was a script that build a list of aliases out of all the Mac OS X applications, launching them with the open command. The script was something I had gotten off Mac OS X hints and transformed a bit. The script was not very smart, as it looked for Applications in a static set of directories. I wanted to see if I could rewrite the same feature for fish using mdfind to find all the Applications. The result is a small Python script which generates a list of fish functions, including a short description built using mdls.

To use the script, just download it from here, then run

./applications_to_fish_functions.py > ~/.config/fish/app_functions

And finally add the following lines to your config.fish file:

if test -f ~/.config/fish/app_functions
  . ~/.config/fish/app_functions

All your Mac OS X applications will be available as commands, if arguments are passed to them, they will be opened by said application (assuming the application can handle said file), in tab-completion, the name of the application (with spaces and casing) is displayed. I will try to add further information.

Flattr this!

Cover of the Terry Pratchett Book 'Snuff' – Commander Vimes at the wheel of a paddle boat in a storm with a bunch of chicken fleeing.


Cover of the Terry Pratchett Book 'Snuff' – Commander Vimes at the wheel of a paddle-boat in a storm with a bunch of chicken fleeing.

Yesterday, I took the day off an spent the day at the Badi in Wollishofen. Badis are bathhouses on the lake of Zürich, with showers, lockers, a cafeteria, a nice taal tree and a box full of books. Although the box contains some Terry Pratchett books (Diggers, if I recall correctly), I had brought my own: a copy of “Snuff” that was lent to me by a friend. So I bathed and finished reading the book in the sun, and managed to get some sunburn, which is very astonishing because the weather was quite cloudy.

Snuff is a new adventure of Commander Vimes, of Ankh-Morpork fame, this time he goes on holiday in his wife’s country-side house, of course, there is a crime, and then something bigger, so the holidays are far from dull. While most of the action happens in the country-side, part of the action happens in Ankh-Morpork, so all the characters of the guard make at least a token appearance.


Double Day
ISBN : 978-0-385-61926-4

The book basically follows the classical recipe of recent Disk-world books, it is well written, and gripping and I enjoyed reading it. I found the shift of Vimes becoming old and respectable interesting, but the story basically fell appart once I put down the book.

First one can feel that Terry Pratchett is getting really old, I felt more dramatic tension in one posh dinners than in the fights, this reminded me of “A Civil Campaign” by , where the most dramatic moment was a family dinner going quite wrong.

Second, the character of Vimes is starting to collapse on his own weight, he now has a bazillion titles, he is the protégé of the Patrician, and since the book Thud! he has magical powers. All this power undermines the dramatic tension, as no-one really believes that anything really bad can happen to him or his family. A small part of the book is devoted to Vime’s internal struggles, but it is minor and felt like an afterthought. I think Sir Commander Vimes is starting to be way to much of a Mary Sue for Sir Terry Pratchett. I also found that the way Vime’s child is described feels a bit to much like an introduction, that we are soon going to get the adventures of Vime’s son.

Third, the parts of the story besides of the country-side where Vimes resides feel hollow and artificial. The whole Sergeant Colon sub-plot should either have been the center of the story or been removed, it just feels like some filler to justify having the other characters coming around. This also seems to be a trend with older authors, everything needs to become some kind of family reunion. Even Nobby Nobbs finds a girlfriend in the last chapter.

In summary Snuff is a pleasant read, showing that Terry Pratchet can do his usual tricks quite well, but it probably won’t leave any lasting impression once you finished reading the book. This is certainly not him at his best, the writing is good: but the story below it feel increasingly hollow.

Flattr this!

About this mac dialog box showing the information for my laptop using Mac OS X 10.8

Mountain Lion

About this mac dialog box showing the information for my laptop using Mac OS X 10.8

I installed Mac OS X 10.8 on my laptop this week-end, and as far as operating system upgrades go, that one was pretty uneventful. The only problem I encountered was Calendar, iCal’s replacement, getting very confused with my preferences, so I needed to erase them and recreate them. This was trivial, and given the amount of hacking, dog-fooding of internal APIs and general abuse that configurations had received over the years, this was a much needed reset.

Ars Technica, has, as usual, a very long and thorough review. From my perspective, the changes were minor and mostly welcome. Safari is more stable, Address Book has again a usable structure, and there is Reminder application that is equivalent and synced with iOS. RSS feeds are officially dead, which as far as OS X support goes, is no drama, the built-in applications never supported RSS properly. I’m much more annoyed about the death of RSS as open-format as opposed to the social networks.

Under the hood, the main change is certainly gatekeeper the code signing and sandbox system. Generally speaking, desktop applications have way to many permissions, and so being able to control what they do is a good thing, as far as I’m concerned this is just the continuation of having memory protection and pre-emptive multi-tasking. Also being able to set up a Mac in a way where it only runs code from trusted sources is a very much desired feature, in particular for machines used by non savvy persons. I also think it might be a good idea to adapt command-line tools to use the sandbox API and limit their access, awk should never open a network socket, so why not declare this at startup time?

Flattr this!