Couverture du livre «Kleiner Sprachatlas der deutschen Schweiz» avec en fond la carte pour le mot «Gouille»

Le petit atlas des langues de suisse-alémanique

Lorsqu’on vit dans un contexte donné, il est toujours difficile d’apprécier ce qui est normal de ce qui est une bizarrerie locale. Même si le est un sujet de discussion et de rancœur récurrent en Suisse-romande, on insiste peu sur le fait que c’est quelque chose d’assez spécial : il ne s’agit pas d’un dialecte, mais d’un groupe de dialectes assez fortement différenciés, l’usage du dialecte est présent à travers toutes les couches sociales, et les gens qui parlent ses dialectes sont habituées à se comprendre entre-eux.

Le général de Gaulle aurait dit Comment voulez-vous gouverner un pays où il existe plus de 300 sortes de fromage ? En suisse la question à poser serait plutôt : comment voulez-vous diriger un pays où il existe plus de 25 mots pour parler d’un bonbon ? Par bien des aspect la situation est plus exotique que ce décrivent bien des auteurs de Fantasy qu’ils soient anglo-saxons ou français.

Kleiner Sprachatlas der deutschen Schweiz
, ,
Infographie : Manfred Renn
Huber Verlag
ISBN : 978-3-7193-1524-5

Le petit atlas linguistique de la suisse-alémanique (Kleiner Sprachatlas der deutschen Schweiz) est un livre très intéressant qui établit une carte linguistique de la Suisse, pour 120 mots on y trouve la carte de la suisse et les différents mots et prononciations à travers le territoire. En face de la carte se trouve une page d’explications.

J’ai trouvé très intéressant de voir à quelle zone géographique se rattachent les mots que j’utilise. En général il s’agit des mots de la région Zürich-Thurgovie, mais parfois il semblerait que j’utilise des mots de la région bernoise, typiquement quand c’est un mot qui a été importé du français (ce qui est assez commun).

Plus généralement, les cartes révèlent une complexité fascinante, qui ne correspond pas tellement à ce que l’on pourrait attendre si on lit la wikipedia : un certain nombre de dialectes clairement distincts et séparés à cause du cloisonnement social et géographique. Au lieu de cela, chaque mot révèle une carte différente, un peu à l’image de l’histoire suisse : alliés pour un mot, deux régions peuvent se retrouver opposées pour un autre. Au delà des mots, les pages contiennent des explications intéressantes sur les phonèmes, la grammaire.

En bref, un livre intéressant si vous êtes curieux à propos du suisse-allemand et la structure des langues de manière plus générale.

Squid cache logo

Enabling the Squid Cache Manager

Squid cache logo

I have had a squid proxy running on my NAS for ages, but I was never really able to quantify the effectiveness of the cache. There are a lot of small scripts that parse the squid logs and output some statics, but that is not very satisfactory. Today I realised that Squid offers some kind of web UI to visualise the state of the cache manager.

The squid cache manager is basically two parts, one part that runs on the squid proxy itself, and cgi-bin program that can be run on any web-server. As I did not see the point in starting a web server on my NAS just for that, I decided to run the cgi program on my laptop. Here are the steps to get this running. This assumes you know how to use vi and have ports installed on your Mac.

  1. Connect to your NAS as root
  2. vi /opt/etc/squid/squid.conf
  3. Find the line with this text http_access allow manager localhost and add http_access allow manager localnet just below. This will grant access to the cache-manager to your whole LAN.
  4. Restart Squid: /opt/etc/init.d/S80squid restart.
  5. Logout of your NAS.
  6. On your mac, install Squid sudo port install squid @2.7
  7. Go to your CGI bin directory pushd /Library/WebServer/CGI-Executables
  8. Install the cgi clientsudo ln /opt/local/libexec/squid/cachemgr.cgi ./
  9. Edit the configuration file of said tool sudo vi /opt/local/etc/squid/cachemgr.conf
  10. Replace localhost with the hostname/address of your NAS.
  11. Point a web browser to the address http://127.0.0.1/cgi-bin/cachemgr.cgi.
  12. The web-UI will ask for some name/password pair, give any random thing
  13. You should see a web UI to Squid.

Light dithering

As I’m mostly working on back-end and pipelines those days, I don’t do much user facing code. To compensate a bit I have been playing around with Javascript and Html5. While I can’t say that Javascript is elegant, it is very easy to play around with, the modern equivalent of Basic, I suppose.

So I wrote a small dithering function, it uses a simpler error distribution matrix than Floyd–Steinberg as it only distributes the error on the pixels to the right and below the one considered. The algorithm also uses some randomisation to avoid patterns.

In order to respect traditions, this one dithers the classical Lenna image. Just click on the button to load the image and the button to dither the image.


Image: Lenna

Karate

Red circle with 致道館 containing a red disk containing 七い

Besides 合気道 (aikidō), I now have been following some 空手 (karate) classes at work for a few months. The classes are given for free by a colleague and we use either the fitness room or one of large meeting rooms for this. My main motivation for doing karate was to strengthen my posture and get some muscles. While my posture problem is also corrected in aikidō, this is less of an emphasis. As for getting some muscles, given aikidō’s emphasis on not using strength, this is just not happening.

I had done some 少林寺拳法 (shōrinji-kenpō) while I lived in Japan, and the current karate course at work was not the first of its kind. There were previously two courses of 功夫 (kung-fu), which faltered for various administrative reasons. The main advantage of doing sports at work is that it is very close and convenient, I basically just need to go down to floors. The main disadvantage is that it is in the work context, where I already spend plenty of time.

The particular school of karate we are learning in is International 空手連合 (karate rengo), a variant 致道会 (chidōkai), which descends from 松濤館流 (shōtōkan-ryū). As far as I can tell, the logo is “七い” (seven + “i”), with the word 致道館 (chidōkan) written below, but my reading of the symbols in the center don’t make much sense, so I’m probably missing something.

Training is quite different from aikidō: there are no rolls and falls, which is probably a good thing because the rooms we use for training have no mats. There is a heavy emphasis on basic moves and katas, which take up most of the time of lessons. According to the school’s web-site the goal is to not stress beginners:

Les exercices de coups de poings sur place comme les Kara tsuki 1, 2,3 ou sonamba tsuki sont suivies par des déplacements de faible amplitude dans les quatre directions, comme le kihon yondosa, toujours dans le soucis de ne pas brusquer le débutant.

While this fulfils my initial objective, I must say it feels pretty abstract at this stage: I spend most of the time doing empty movements in front of the mirror. One of the first exercices, 空付き (kara-tsuki) means empty punches. The end result feels more like I’m doing ballet than anything else. Kata are a bit troublesome, as I have a horrible memory for sequences and I easily confuse left and right, so I have to spend concentration on the sequence instead of the actual moves. Also the general combat philosophy seems to be to stand ground and do strikes, when you are the shortest guy in the class, this does not sound like such a good strategy.

So my feelings are pretty mixed, I think this practice is very positive for me, but at the same time, training is a bit frustrating, as philosophies are not aligned:

Une fois que la base est solide, les techniques de combat et les katas sont abordés avec beaucoup plus de facilité. Tout cela a pour but d’aider l’entraîneur et l’élève à optimiser le temps consacré à l’entraînement. La structure en est précise et suivie. Il n’y a pas de place à l’improvisation.

Basically, the school’s philosophy is to optimise training time by having very solid basics with a very precise structure. I don’t really care for optimising my training time, I don’t have any particular illusions in reaching a significant level in any martial arts, they are just a mean for me to have better life. On the other hand, I’m a pretty chaotic person, so following a very precise plan is not exactly my forte, it comes as no surprise that my favourite part of aikidō is 乱取り (randori), literally grasping the chaos, which means a lot of improvising…

So I think I’ll keep aikidō as my main martial art, but keep doing the karate training to try to fix my stance and strengthen myself a bit…

Fake bike with square wheels, broken.

Indvertisement

Fake bike with square wheels, broken.

A few days ago, there was a bike with square wheels parked close to this office. This was obviously a part of an advertisement campaign for a cigarette brand. Officially they are advertising for the new shape of their cigarette packs. Of course, a few days later, the bike had been befallen by the same fate as any bike left to long in a city: it was broken.

Cover of a singing book: a tree with below it a lady with a yellow blouse and a brown skirt, reading from a book. She is surrendered by five kids.

There is something fascinating in seeing more and more indirect advertisement (let’s call this Indvertisement), in particular by companies whose core product is problematic. The goal seems to be to do something sufficiently weird to go viral, while at the same time keeping enough distance from the actual product. As people become immune to advertisement, they need to be more subtle, more embedded in everyday lives. Of course, this makes it also easier to create fakes, like Greenpeace’s Let’s go arctic fake Shell campaign.

When I was a child, my mother had a song book entitle Chömed Chinde, mir wänd singe, sponsored by Maggi. The book contained full page colour illustrations, in each of those, the name of the sponsor appeared, in a small and subtle way: a box of condiments on a shelf, a branded toy truck pulled by a small boy. Unlike today, where the name of the sponsor is typically pre-prended to the real name of the thing, the book’s name bore no relationship with Maggi. This was considered advertisement. Maybe we will get back there eventually.

Floating point considered harmful

bool foo() {
  float a = 0.6;
  float b = 6.0;
  return (a == (b * 0.1));
}

bool bar(float c) {
  return (c != c);
}

When I learned coding on the C64, the two main tools where Basic, and direct memory access. Any advanced stuff was done in assembly. So basically, coding involved pretty much only pointer arithmetics and goto statements. Of course this was a long time ago and such constructs are now shunned, and many newer languages even prevent the code from doing such thing, which is probably a change for the better.

Strangely, there is one type of operations that is very dangerous, but which most languages do not restrict: floating point operations. Consider the snippet on the side, will foo return true? Maybe, but there is no guarantee that the bit representations of a and b will be equal. Will bar ever return true? Yes if c is NaN. Generally speaking, comparing bit for bit two floating points is a bad idea, and providing that operation to the programmer is a disservice. Floating point semantics are complicated, and only partially visible in the programming language: rounding, extended precision are typically not accessible.

A lot of the code I have seen just happily assumes that floats basically behave like integers, why would it not? Floating point numbers are the only types which in each and every language are allowed to have the same operators as integer. In most of the cases, using a fixed point (currencies) or fractional representation (computing averages and such) would be more appropriate, but such constructs are typically missing in the language, or are second class citizens – Python for instance only had fractions since version 2.6 and there is no shorthand notation to create them.

The only languages I used which had put some serious thoughts in their numerical representations where Ada and Smalltalk. The others seem to be happy to just clone C operations.

Affiche pour l'Observatoire Urania à Zürich

Observatoire Urania

Affiche pour l'Observatoire Urania à Zürich

À Zürich, il y a une brasserie Lipp, cela n’a rien de très spécial. Au dessus de la dite brasserie, il y a un bar panoramique, nommé le Jules Vernes. Le bar tient son nom du fait qu’il se trouve dans l’ancien observatoire de l’École Polytechnique Fédérale de Zürich (ETHZ), construit de 1861 jusqu’à 1864 par Gottfried Semper. Ce qui est encore plus intéressant, c’est que le dit observatoire appartient aujourd’hui à l’université populaire de Zürich, qui le maintient en service. L’observatoire Urania peut ainsi être visité, soit à titre individuel le jeudi, le vendredi ou le samedi, soit en groupe organisé.

Avec mon équipe de Google, nous avons donc visité l’endroit lundi dernier. Si un télescope construit en 1906 avec une distance focale de 5 mètre situé au centre d’une ville n’est de loin pas l’idéal pour voire les planètes ou les étoiles, j’ai quand même pu voir les anneaux de saturne. Cela dit, même s’il date de plus d’un siècle, le télescope est impressionnant : 12 tonnes de métal dans une coupole en bois, le contrôle se fait à la manivelle, même si un système de tracking automatique a été ajouté. J’ignore si l’endroit pourrait être loué, mais cela ferait un décor merveilleux pour une soirée Steampunk.

J’ai aussi pris quelques photos de l’endroit.

Compatibility

Thias の blog displayed in NSCA Mosaic 2.0.1

Compatibility is a recurring theme in computer science, a myth that would exist if programmers followed the rules. I was playing around with an emulated Mac running system 7.5, and as soon as I had a running TCP/IP stack, I ran an old web browser and pointed it to my blog. The web browser was Mosaic 2.0.1, created in 1995. So there are 17 years separating the client and the server.

The good news is, the page loads. The bad news is, the page content is pretty broken. The HTML language was designed so that the display would gracefully degrade in browsers that do not support all features, but this page involves three incompatible changes:

  • PNG images
  • UTF-8 encoding
  • Javascript

The switch from the GIF to PNG image format was caused by patent issues, not much to say here, excepted that patents are a nuisance. The change of character encoding was necessary because the initial design of HTML was broken, it was largely inspired by the LaΤeχ typesetting and so would represent non ASCII characters as escape sequences (at least in HTML the name-spaces are clearly separated), still this required each and every non-ascii character to be named and escaped, this made a system that was supposed to be human readable unreadable for most languages on the planet.

As people soon figured out that this system would not work, support for the various platform and country specific encodings was added. We have not finished fixing this mess, and I regularly encounter bugs caused by people who still use one of those encodings (usually iso-latin-1). That is really a shame, because the first draft of Unicode was published in 1988.

The last technology is probably the most hated on the web (except for Flash maybe), something that grew out of the need to do form validation and became the universal solution used to fix all problems with web protocols. The irony is that Javascript is not very useful to do form validation, mostly because validating dates, colours and such is much easier to do on the client, which knows the user’s locale, so HTML5 introduces new tags and attributes to do proper form validation (without javascript).

The interesting thing is that while things broke at the display level, at the connection level everything ran fine, Mosaic could even connect to the proxy that runs on my NAS. Does this mean that the low level stuff was better designed that the presentation layer? I’m not really sure. The HTTP 1.1 is a very simple protocol. While simplicity is a nice property in a protocol, if the protocol is simple because all the complexity was pushed to the upper layers, then the protocol is not elegantly simple, it is just not doing its job. Some people call this New Jersey design style.

The HTTP is simple because it is a thin stateless wrapper around TCP/IP. So all the issues that are not handled in the lower layer (where they should be) have to be handled in the application layer: state (cookies), multiplexing (data: protocol), cryptographic exchange (keygen tag, complicated javascript libraries), deferred loading ( XMLHttpRequest), application level routing, etc. The protocol makes it very easy to write a web server is three lines of shell script, and awfully hard to make a scalable web-server.

Recently they have been talks about a new version of the HTTP protocol, and I agree with Poul-Henning Kamp that the current proposal are not very interesting. They fix a few hedge cases and improve performance by just hacking the protocol further. But at least an old web browser will still be able to connect…

Screen capture of the 'Space Map' application

68K nostalgia

Information Box about my Conversion Program for the old Macintoshes

Ars technica had a nice post about Cracking the Agrippa, an old cryptographic puzzle dating from the classic Mac. The second page includes instructions to set up an emulator running Mac OS 7, and I have recently recovered the binary file of some very old programs I wrote, so I set-up a virtual machine a tried running my old creations.

There were two programs: one that was doing simple date conversion from gregorian year to the system of the elves in the (paper) RPG I friend of mine wrote, Tigres Volants. The second, more ambitious, did a 3D projection of the solar systems in that RPG game setting, using an Elite style display. Unsurprisingly the second program crashes (in those days I was developing on a colour Mac, and never really tested the thing on a black and white Mac), but the first program still runs.

screen capture of 'Conversion de Date' running on a black/white Mac

The date conversion program would be trivial to rewrite in Javascript, and I remember rewriting the map program in Java using AWT. But in those days, writing a GUI was not so easy, as you had to write all the event handling code yourself. On the positive side, binary size was very small: the date conversion binary is 9514 bytes long and includes icons and information text.

I wrote those program while at the university, but probably recompiled them, or at least edited the resources during my PhD at EPFL (hence the e-mail address). I have since then lost of the source code, it might be rotting in the old Jazz cartridges that are rotting away in my cellar, for which I have no working drive anymore.

If you want to play around, I have created a small disk image (64K) that contains both binaries.

Edit:

The second program is not the 3D map of space, as I had though, instead it generates a color-map of a planet based on the hash of the name and some general data. I work nicely in emulation on a color-mac.


Second Edit:

Now that I have a working emulator, going through the archives is much easier. So I found the binary (and the source code) for the space map application. So I created a second disk image with the application and the data file. Because of the data, the file is much bigger: 680K.

Screen capture of the 'Space Map' application

La course au mouton sauvage

Un mouton devant un papier peint avec des fleurs rouges.

Il y a fort longtemps, j’ai vu au cinéma une adaptation de la pièce de théatre Rosencrantz & Gildenstern are Dead, l’idée est assez intéressante : présenter un histoire connue (Hamlet) depuis le point de vue de personnages mineurs. Le roman de Haruki Murakami La course au mouton sauvage semble avoir reproduit par accident cette structure, ou tout du moins le besoin pour celle-ci.

Durant la fin des années 70, un publicitaire tombe par hasard sur une étrange conspiration, et doit partir en quête d’un mouton mythologique. Le livre est structuré assez étrangement, mais peut, à mon avis, être divisé en deux grande parties : la première narre les errances du protagoniste, la seconde, la quête du mouton sauvage à proprement parler. Si j’ai beaucoup aimé la seconde partie, que j’ai lu d’un trait, j’ai eu beaucoup plus de peine avec la première. En fait, si j’ai trouvé l’histoire très intéressante, le personnage m’a semblé sans le moindre intérêt. Ici j’aurais largement préféré que la narration provienne d’un autre personnage de l’histoire : la girlfriend aux oreilles fascinantes, le chauffeur de la mafia et son téléphone vers dieu.

La course au mouton sauvage

Traduction depuis le japonais : Patrick de Vos
Éditions Points
ISBN : 978-2-02-056228-7

L’explication du deuxième de couverture est un peu trompeuse La vie du narrateur, jeune cadre publicitaire à Tōkyō, n’a rien d’exceptionnel.. Sans être exceptionnel, le narrateur semble avoir un passé intéressant, mais celui-ci n’est évoqué qu’en filigrane, car la narration tourne invariablement autours du vide existentiel qui semble le définir. Il est assez ironique de savoir que ce passé est décrit dans des romans qui n’ont jamais été traduits. Autours du narrateur, bizarreries et deus ex machina s’enchaînent sans qu’il réagisse réellement, tout au plus consomme-t-il des bières en quantités qui forceraient le respect d’un héros de Tim Powers. Le seul acte de courage dont il fait preuve a pour but d’avoir quelqu’un qui s’occupe de son vieux chat.

Le résultat est quelque chose de bizarre, un voyage initiatique petit bourgeois et mou, avec une narration largement détachée, qui devient assez rapidement ennuyeuse. Le décor de l’histoire est lui aussi très fade : le japon de la fin des années septante, décrites avec indifférence, jonchées de références qui m’échappent sur un fond sonore qui me semblait craquelé et acratopège (peut-être même du Jazz).

Peut-être que le style plat et abstrait qui ressort en français est voulu, mais je n’ai pas trouvé le résultat très impressionnant. Si je n’ai pas vu de problème de traduction patent, j’ai remarqué des coquilles, ce qui, ceux qui me relisent peuvent en témoigner, est plutôt mauvais signe.

J’ai trouvé ce livre assez médiocre. À l’instar de La fin des temps, il y a des idées très originales, mais elles sont écrasées par le vide existentiel du narrateur. Je ne pense pas que dans le cas de ce livre, je puisse blâmer la traduction, je pense plutôt qu’il y a quelque chose dans les goûts de Murakami qui me déplait. En conclusion, un bouquin qui n’est vraiment pas du niveau de Kafka sur la Berge, et qui m’a surtout donné envie de retrouver le DVD de Rosencrantz & Gildenstern are Dead.