AltGr and Parallels Desktop

Im neusten Build 1970 von Parallels Desktop funktioniert AltGr nicht mehr. Ziemlich umständlich kann man die Taste wieder aktivieren.

I’m quite happy with my alien operating system running along my other applications on my Mac. The biggest gripe is the keyboard.

  • Parallels maps the Windows Alt key to the Mac alt/option key. Ok, Alt to alt seems quite logical, but my fingers don’t care what is written on the key – they remember by position. And the Windows Alt key sits right to the left of the space key!
  • Though it’s handy to be able to tab out of Windows with Cmd-Tab, I can’t really tab back in. When I change the focus to Windows using Cmd-Tab, I have to press Cmd-I before my key presses are sent to Windows again (I know that I can use the mouse, but the keyboard is so much faster). I like when things are logical and symmetrical because that is what makes life easier.
  • The support for AltGr (I have a Swiss German keyboard and need AltGr for all the programmers best friends: []{}|\@#) is weak, almost nonexistent. A couple of weeks back Parallels mapped the Enter key of Apple Laptops (the one to the right of the right Cmd key) as AltGr – without telling anyone. I don’t remember where I first found about this life saver, probably macosxhints, but surely not the Parallels help.
  • As of the newest build (1970), Enter as AltGr has silently vanished again. And only hidden in the forum pages are instructions how to get back the AltGr behaviour involving the Terminal. This is not the Mac way to configure things! (Basically you have to create the file /Library/Parallels/.keyboard_config containing one word: numenterisaltgr and no LF following it).
  • I dream of having the same keyboard layout inside and outside Parallels Desktop (e.g. using the option key to compose all these special characters in Windows), and perhaps even having a combined list of OS X and Windows applications when switching with Cmd-Tab.
Posted in OS X/Windows/Linux, Tips | 1 Comment

Erleichtertes Hörbuch-Rippen

Importing an audio book from CD to the iPod has become a lot easier, thanks to Audiobook Builder.

Ist es nicht angenehm, sich ein Buch vorlesen zu lassen? Am liebsten natürlich ortsungebunden, vom iPod – bloss wie gelangt das Hörbuch in den iPod?
Bisher geschah das wie folgt:

  1. Die Import-Einstellungen von iTunes auf AAC/gesprochene Podcasts setzen
  2. CD einschieben, alle Tracks markieren und die CD-Titel gruppieren (unter Erweitert)
  3. Jetzt die CD importieren.
  4. Die Schritte 2 und 3 für alle CDs wiederholen. Am Schluss hat man einen Titel pro CD.
  5. Den Namen der Titel editieren und nummerieren (sofern das nicht schon automatisch geschah, weil der Titel abgefragt und gefunden wurde). So ist es später auf dem iPod einfach, die CDs in der richtigen Reihenfolge zu hören.
  6. Alle Titel markieren und das AppleScript Make Bookmarkable anwenden. Damit wird u.a. die Option Wiedergabeposition merken gesetzt und die Datei-Endung des Titels auf m4b gesetzt. Dies muss so sein, damit das Buch bei iTunes 7 in der Bibliothek unter Hörbücher eingereiht wird. (Dieser Schritt ist Apple-spezifisch. Bei Windows gibt es keine AppleScripts und für dasselbe sind wesentlich kompliziertere Aktionen nötig. Die Suchbegriffe m4b windows sind dein Freund…)
  7. Synchronisieren. Für mich hat es sich bewährt, eine intelligente Wiedergabeliste extra zum Synchronisieren zu verwenden, mit den Kriterien Zähler ist 0 und Genre ist Hörbücher (vorausgesetzt, dass man nach dem Importieren das Genre richtig setzt). Damit erreicht man, dass Hörbücher automatisch vom iPod gelöscht werden, wenn man sie einmal gehört hat.

Neu geht es (nur mit Apple) auch etwas einfacher: mit dem Audiobook Builder. Die Schritte hier:

  1. Ein Projekt anlegen, Titel und AutorIn festlegen (Cover-Fenster)
  2. Im Chapter-Fenster (Kapitel) jede CD importieren.
  3. Ins Finish-Fenster wechseln und den Build Audiobook Knopf drücken. Das ganze Hörbuch wird automatisch erstellt, das Genre auf “Audiobooks” gesetzt und direkt in die iTunes-Bibliothek eingefügt.
  4. Synchronisieren, genau wie oben.
  5. Das Audiobook Builder Projekt kann jetzt gelöscht werden (sonst belegt das Hörbuch zweimal Festplatten-Platz, da es in die iTunes Bibliothek kopiert wurde).

Als zusätzliches Zückerchen legt der Audiobook Builder auch gleich noch Kapitelsprungmarken an. Ohne Manipulation an der Kapitel-Struktur im Chapter-Fenster entsprechen die Sprungmarken aber bloss den ganzen CDs; ich würde Sprungmarken an den Track-Grenzen vorziehen.

Posted in Tips | Comments Off

Bad experiences with Milan Malpensa

We got an Alitalia flight with a stopover in Milan Malpensa for our holidays. I must say that we regret having chosen Alitalia.

The negative experiences started already when checking in in Zurich. Our connection flight from Milan was not open yet for a through checkin. No problem, we thought, we’ve got enough time to do that in Milan.

But there was no transfer desk when we arrived in Milan. When you first arrive, transfer desks are sign-posted, but when you get to the desks, there are no more signs. And even before the boarding desk was open, a huge queue started to build up. So I went to a nearby desk and asked, where we could get our boarding passes. Just at the boarding desk, was the answer. When we finally wanted to board, we were told that we had to queue at another desk to get a boarding pass.

Another thing what Malpensa failed to manage: there were no vegetarian meals. The Alitalia cabin crew made it not better by being a bit arrogant: they didn’t really apologise, because it’s not their fault, or is it?

This was not the last of our troubles. Our luggage stayed behind in Milan and we got the phone number of the Alitalia office where we should be able to inquire the status of our luggage. Of course we were nervous to start our trip without our things and tried to call this number early the next day. But only at noon we got through the first time and were told that the luggage would be delivered before eleven in the evening at a friends address. It was only in the evening that this friend was contacted and a few minutes before eleven when we finally got our belongings and the holidays really started.

After all this annoyances I think that “Malpensa” is an appropriate name for this airport: a combination of the Italian words for “bad” and for “thinking”.

How different was our experience in Toronto Pearson when we travelled back home. The airport employee at the boarding desk told the passengers that there is no point to queue yet and how exactly the boarding would happen as soon as a queue started to build. And the security changes (only a couple of hours after the incidents in London last week) were well and transparently organized.

The whole episode reminded us of the joke how to get the worst possible international party: let the English cook, the Italian organise and the Swiss entertain.

Posted in Life/the Universe... | Comments Off

Gimmelwald Gondola

Kellyerin ist von Gimmelwald nach Stechelberg geschwebt und Marcel hat das Video davon gefunden. In der Realität ist die Fahrt über den Rand der Fluh — direkt nach dem ersten und einzigen Mast — noch viel eindrücklicher!

Posted in Life/the Universe..., The Web | Comments Off

Solving the Santa Claus Problem with Barriers

There are already many solutions to the “Santa Claus Problem” by John Trono[1]. It’s a “problem simple to understand and yet far from easy to solve”; the author’s original solution (based on semaphores) was only partly correct. The probably most known analysis of the problem was written by Mordechai Ben-Ari[2], who also provided solutions in Ada95 and Java.

This is the original problem description:

Santa Claus sleeps in his shop up at the North Pole, and can only be wakened by either all nine reindeer being back from their year long vacation on the beaches of some tropical island in the South Pacific, or by some elves who are having some difficulties making the toys. One elf’s problem is never serious enough to wake up Santa (otherwise, he may never get any sleep), so, the elves visit Santa in a group of three. When three elves are having their problems solved, any other elves wishing to visit Santa must wait for those elves to return. If Santa wakes up to find three elves waiting at his shop’s door, along with the last reindeer having come back from the tropics, Santa has decided that the elves can wait until after Christmas, because it is more important to get his sleigh ready as soon as possible. (It is assumed that the reindeer don’t want to leave the tropics, and therefore they stay there until the last possible moment. They might not even come back, but since Santa is footing the bill for their year in paradise… This could also explain the quickness in their delivering of presents, since the reindeer can’t wait to get back to where it is warm.) The penalty for the last reindeer to arrive is that it must get Santa while the others wait in a warming hut before being harnessed to the sleigh.

As an exercise to learn the java.util.concurrent package of Java J2SE 5.0 I implemented another solution using barriers (CyclicBarrier objects). As either three elves or all nine reindeer must assemble before they are allowed to wake Santa, this seems to me an obvious choice.

The solution consists mainly of an outer class SantaClaus, that sets up all needed synchronisation variables and controls the program termination, and two inner classes Elf and Reindeer, that are instantiated on a separate thread for each individual elf and reindeer behaviour. The source code is also available as syntax coloured HTML; an earlier version without the harnessing part can be found here.

The barrier that manages the grouping of the elves is protected by a Semaphore queueElves with three permits. This implements the requirement “any other elves wishing to visit Santa must wait for those elves to return” in a rather defensive manner: there is some virtual waiting room for the elves to wait before waking Santa that has room for only three elves.

This defensive approach makes the priority requirement (if nine reindeer and three elves are waiting, Santa must deliver toys first) simple to fulfill; a fair semaphore (semaphore with a FIFO queue) is enough:

As no more than one group of elves can sit in the virtual waiting room and access to the waiting room is blocked until the first group of elves have got back to the toy manufacture, the ninth reindeer will never encounter more than two elves in the waiting room[3]. It is therefore enough to guarantee that the reindeer are serviced first if they are the first to try the semaphore that protects Santa’s office.

Using a fair semaphore also for queueElves guarantees that no elf is starved when he would like to consult with Santa.

If we would want the get rid of the queueElves semaphore or expand the problem (eg. Santa could start answering the letters from kids), we had to replace the semaphore santasAttention with a advanced mechanism like a PriorityBlockingQueue to guarantee priority for the reindeer.

[1] J. A. Trono. A new exercise in concurrency. SIGCSE Bulletin, 26(3):8–10, 1994. Corrigendum: 26(4):63.

[2] M. Ben-Ari. How to solve the santa claus problem. Concurrency: Practice & Experience, 10(6):485–496, 1998.

[3] This assumes that the short time between having realised that there are enough (elves/reindeer) to wake Santa and Santa coming out of his office is indivisible.

Posted in Programming | Comments Off

dmake Stories

At work, we started using dmake in 1991 (or even earlier) for building the firmware for the Vending Machine Controller Euro’90. The firmware consisted mostly of PL/M and C code and the compilers suffered from the DOS limitation of 127 characters per command line. Dennis Vadura’s dmake 3.70 (hosted by the University of Waterloo and available as DOS version) featured the $(mktmp ) macro that let me create any needed temporary config and response files.

Later we kept using dmake for the software for our DIVA and CCI/CSI interface families. The build system had grown quite complex and the makefiles made heavy use of the percent pattern rules and delegation to makefiles in other directories.

A couple of years ago, when I first tried to define a target that builds everything (several firmware variants, debug and release builds), I encountered a strange error from dmake:

dmake.exe:  Error: -- Unable to change to directory `xy?', target is [sub-b]

The latest release then (dmake 4.1) was labeled as “final free release”; the last dmake homepage from Dennis Vadura (dmake.wticorp.com, online ca. 2001), once tried to sell “dmake Gold”, but was already unreachable at this time. As the days of open source dmake seemed over, I was hesitating to invest time finding bugs and thought that we would move soon to another build system anyway.

Recently (we’re still using dmake…) I have learned that OpenOffice.org has “adopted” dmake and resumed its development. This gave me the energy to finally hunt down this bug: a dangling pointer.

Until my fix is integrated into a future dmake release, you can get the patch from the OpenOffice Issue Tracker.

Posted in Hug-Witschi, Programming | Comments Off

Gimmelwald-Lied

Über dem Esstisch in Zumbühls Städeli hängt inmitten der “Ahnengalerie” auch das Gimmelwald-Lied, schön gerahmt und wohl schon einige Jahrzehnte alt. Von der Version auf der Gimmelwald-Homepage unterscheidet es sich vor allem durch den Refrain, das Fehlen einer Zeile in der dritten Strophe und einige orthografische Feinheiten, etwa der Schreibweise “Gimelwald”:

Gimmelwald-Lied

Fritz Lüthi

Uf Gimelwald da heimers so
sin epa trurig oder froh.
wes z’Läben is chan bringen.
U’ z’wärchen hei’mer wäger all
i Fäld u Wald, in Hus u Stall
o z’Muetti mid de Chinden
Gimelwald, Gimelwald, griess Gott
mis schenna Gimelwald.

Uf Schiltalp wohl, da hei’mer z’danken,
si gid es Nidla, Chäs und Anken,
das tued es doch so gued.
Stä’ fescht in isem Burestand
u triw zum schena Vaterland
hein genge’ froha Muet.
Gimelwald, Gimelwald, griess Gott
mis schenna Gimelwald.

In isem Husli ob der Flue
da hei’mier doch o zässen gnueg
mier sin ja gar bescheiden.
Wil epa eina von es gan,
mier andren bliben wacker stahn,
Gimelwald, Gimelwald, griess Gott
mis schenna Gimelwald.

Hei mier eis ises Teili gschafft
u ganz verbrucht all isi Chraft,
de wei’mer riewig warten,
mu treid es den dir z’Bärgli ab
dert zuenem frischen chuelen Grab
bim Staubbach in dän Garten.
Gimelwald, Gimelwald, griess Gott
mis schenna Gimelwald.

Posted in Life/the Universe... | Comments Off

Swisscom and Orangeclick GPRS

Mobiles Internet mit dem Mac ist einfach, wenn man das nötige Modem-Skript (von http://www.taniwha.org.uk/) hat und die Telefonnummer (für GPRS die “APN”) kennt. Benutzername und Passwort bleiben leer, und die “Telefonnummer” bei Swisscom ist gprs.swisscom.ch; bei Orangeclick mit Express-Option ist es click.

One week per year I want to connect my Powerbook to the internet using GPRS. In principle this is easy: choose the right modem script in the Network Preferences and fill in the provider details.

Modem Script

Unfortunately, the Modem Scripts that come with OS X are rather old. I tried the newest one (for a T39), but failed. I asked the Swisscom hotline for help, but they told me that they don’t support Apple Computers and directed me to the commercial solution from Novamedia.de (“Mobile High Speed” for €87).

Next time my Powerbook was connected I found the Modem Script site of Ross Barkman with all the Scripts I wanted and the important piece of information, that you need to enter the APN in the phone number field.

Provider Details

I had two options: a Swisscom Mobile SIM card and an Orangeclick SIM card. Once I knew where to enter the APN, the configuration was easy, but navigating the provider sites to find the Details is not. This is what I found (and what worked):

  • Swisscom Mobile GPRS Configuration (PDF): APN is gprs.swisscom.ch, leave user name and password empty.
  • Orangeclick GPRS Configuration (the link works only when logged in): APN is click, leave user name and password empty. You need to buy the Express option for GPRS with Orangeclick!
Posted in Mobile Life, OS X/Windows/Linux, The Web, Tips | Comments Off

Cablecom will von 16:00 bis 24:00 bremsen

Auszug aus den geänderten besonderen Bestimmungen (PDF) vom Februar 2006 (Kapitel 6, Fair Use):

Der Kunde darf durch die Nutzung seiner Internetanknüpfung andere Nutzer nicht beeinträchtigen, hindern oder einschränken. Insbesondere während den Spitzenzeiten zwischen 16 und 24 Uhr darf der Kunde das IP-Netz durch das andauernde Ausschöpfen seiner maximalen Übertragungskapazität (excessive usage) für die Peer-to-Peer Nutzung, das Betreiben von Gameservern, den Download von Foren usw. nicht in einer Weise belasten, welche die Performance anderer Kunden beeinträchtigen würde.

Heisst das nun, dass die Cablecom-Infrastruktur in Zukunft den Anforderungen nicht mehr gewachsen sein wird und man juristisch vorsorgen möchte? Auf der Breitband-Produktseite jedenfalls wird suggeriert, dass das Cablecom-Netzwerk der ADSL-Technologie überlegen sei, weil die Kabel “dicker” seien:

Kurz gesagt, läuft unser Internet-Traffic über ein spezielles Netzwerk. Im Gegensatz zu den von ADSL-Anbietern genutzten dünnen Telefonleitungen setzt cablecom dieselben dicken Kabel wie für die Übertragung der TV-Signale ein, um enorme Datenmengen aus dem Internet bereitzustellen.

Update 2006-01-21

Matthias Mahr von macprime.ch hat bei Cablecom nachgefragt und folgende Antwort erhalten:

Er versicherte uns als erstes, dass diese Regelung nur bei Kunden in Kraft tritt, die ständig die Maximalen-Limiten voll ausnutzen. Das heisst z.B. bei Kunden die nonstop per Peer-to-Peer Daten runter- und hochladen sowie bei Kunden die einen sehr gut besuchten Home- oder Gameserver betreiben. Aber auch wenn dies zutrifft, heisst es immer noch nicht, dass wirklich eine künstliche Drosselung seitens Cablecom während den genannten Spitzenzeiten durchgeführt wird. Wie der Hotline-Mitarbeiter weiter erklärte, kommt es auch auf die Anzahl Hispeed Abonnenten pro «Knoten» an. Dies ist folgendermassen zu verstehen: Jedes grösseres Mehrfamilienhaus ist an einem «Knoten» angeschlossen, der dann verbunden ist mit Quartier- oder Dorfzentralen. Wenn dieser Knoten nun überlastet ist und darunter Nutzer sind, die das Netz ständig exzessiv nutzen, wird denen, um die anderen Kunden nicht zu beeinträchtigen, die Geschwindigkeit gedrosselt. Weiter betonte der Mitarbeiter, dass ein solcher Knoten mindestens 3 Kunden mit einer 6000/600 Leitung (dem aktuellen Top-Angebot von Cablecom) ohne Probleme verträgt sowie noch weitere Benutzer mit kleineren Bandbreiten.

Posted in Life/the Universe..., The Web | 2 Comments

iSync Phone Plugin for Motorola C350

Nicht jedes Motorola C350 ist gleich. Einige werden von iSync erkannt, meines nicht; mit einem selbstgeschriebenen Plugin klappt es aber doch noch.

According to the iSync Device List, the Motorola C350 is supported by iSync. But my phone was not found.

There are small differences between the supported model and mine. Using USB Prober[1] my device announces itself as:

    Device VendorID/ProductID:   0x22B8/0x5802   (Motorola PCS)

whereas iSync expects[2] a ProductID of 0x3802 for the C350.

Instead of editing the iSync plist file I created an iSync Plugin as Rui Carmo described in his detailed iSync Plugins Howto.

Download

From http://pesche.schlau.ch/isync/motorola-c350a.html or through this direct link.

Installation

Copy the MotorolaC350a.phoneplugin folder into one of these folders:

  • /Library/PhonePlugins (makes the plugin available for all users)
  • ~/Library/PhonePlugins

Then plug the phone with the data cable, restart iSync and Add Device… and the phone should be found immediately.

Update 2006-02-04

There are now at least two sites providing iSync Phone Plugins (which I haven’t tested):


[1] Installed as part of the Apple Developer Tools in /Developer/Applications/Utilities/USB Prober

[2] This file has a rather long path:

/Applications/iSync.app/Contents/PlugIns/ApplePhoneConduit.syncdevice/Contents/PlugIns/PhoneModelsSync.phoneplugin/Contents/Resources/MetaClasses.plist

Posted in Mobile Life, OS X/Windows/Linux, Tips | 6 Comments