三急Third KyūTroisième KyūDritte Kyū


Today, I passed the exam for the third kyū of Shōlinji-Kempō.

Aujourd’hui, j’ai passé l’examen de troisième kyū de Shōlinji-Kempō.

Heute habe ich die Prüfung für den dritte Kyū von Shōlinji-Kempō bestanden.

L’examen a eu lieu dans la salle de sport de 辰口Tatsunokuchi, et a duré un peu plus de deux heures. Je me suis surtout fait corriger mes 蹴りkeri (coups de pieds) et ma garde. Nous n’avons pas fait de 乱取りrandori (combat simulé), ce que j’ai trouvé dommage vu que je suis à mon avis meilleur en randori qu’en technique pure. Malgré tout cela, j’ai réussi l’examen et je devrais recevoir le mois prochain ma ceinture brune.

Les kanjis d’aujourd’hui:
Kanji Kun ON Signification Note
Urgence, Niveau, Se dépêcher

Essayer, Expérimenter
Vérification, Test
Coup de pied
Désordre, Trouble, Guerre La langue () et un crochet.

Custom Pagers

Teaching operating system internal courses has own downside, you get to learn about cool mechanisms that are not often used in practice. One of them is custom pagers. The idea is to supply to the operating system a special function to handle virtual memory page-ins and page-outs. These functions could be used to load and store the pages into a different backing store,compress the data, of even generate it as needed.

One use of custom pagers is for encrypting data, and it seems that Mac OS X uses this to protect some executable (notably the finder). This interesting article explains how a custom pager is used to handle protected Mach-O binaries. Actually, this mechanism seems to have been hacked to a certain degree, which is not that surprising, the OSX86 blog claims to provide the patches for running the kernel of 10.4.8 in command line mode, some other files admittedly enable full GUI loading.


Terry Pratchet's Wintersmith

I was lucky, during my travel to England, to be able to grab a copy of Terry Pratchet’s last Discworld novel, Wintersmith. I have been reading Discworld books for a long time now, from the original stories of Rincewinds woes to the more structured stories of the Ank Morpork’s watch or the Witch stories. Wintersmith is the next installement of the adventures of young witch Tiffany Aching. I really enjoyed reading this book, but I can’t help feeling some kind of empty feeling afterwards. The book is well written and the characters are endearing, but in the end it is just a Discworld story like the others before, i.e. there is not much of a story, basically is something terrible is again triggered and there is a lot of running around and interacting, and then the problem is solved in a more or less satisfactory way. In my opinion, Terry Pratchet was never good with endings, and he seems to solve this problem by basically packing the full resolution of the story in one chapter.

In the Discworld, stories are a form of magic of its own right, and once started they have to go to the classical end. Discworld novels seem to also follow this pattern, they seem to be designed to be children’s stories for adults, the story is known, the book is just retelling it in a slightly different way and we get to see likable characters again. One theme of the book is how things in stories are not like they are in reality, from the Wintersmith trying to play a human role to Tiffany’s reaction to shepherdesses in romance books not looking after the sheep. Yet the Wintersmith book suffers from the same problem: the kids in it don’t behave like kids or teenagers. In the end an old man’s vision of a twelve year country girl is as close as the romance books vision. It still makes an very enjoyable reading, but with little more virtue than novels with saucy shepherdesses…

Edit: corrected many mistakes, thanks to Anne for pointing it out.

BSD file flags

Mac OS X being a BSD derived Unix, it inherits some of its security features, many of those are not advertised and a such not widely known. One such feature are file flags. Those flags can be used to specify additional properties for certains files, for instance that the file is immutable, or that a directory can only be appended to (i.e you can add files, but not remove them). The immutable flag is actually used by the Finder to mark a file as locked.

You can see the flags of a file by adding the option -o to the ls command. The actual flags can be manipulated using the chflags command.

Hard links

The web server of our lab is generated using a template engine called velocity, basically the web site is described by a set of files that are compiled into the final web site. This is convenient because the web site can be tested on another machine, for instance my laptop. While many pages are generated from templates, like for instance the bibtex files, many other, including a large volume of pdf, jpeg, and Quicktime files.

During the build process, those files are simply copied from the source directory into the destination directory. This is ok, but basically means that I’m wasting around 160 megabytes of disk space on my laptop simply to have two copies of some files (sometimes three, when I wrote the paper or created the slides and there is also a copy in my home hierarchy).

The solution to this problem is as simple as old: use hard links. I created a hard-link of each static file in the source directory into the destination directory. As the copy task of ant sees no difference between source and destination, it leaves the destination alone. Basically the files are present twice, once in the source and once in the destination, but they use the disk space only once.

This approach works because the files are basically never touched, so I don’t have to worry about updates. Updates are the main problem of hard-links: if the file is edited inplace, the updates will show-up everywhere but if the editor is smart and first saves the changes into a new file and then does the swap, the file is not really updated but replaced by another with the same name. This is a sane way of doing updates, because it ensures atomicty, but it breaks hard-links. Replacing a file with another one with the same name yields the same result. So in my case, if I replace one the static files, the destination link will not be affected, become outdated and be replaced by the ant copy task. This is OK for me, because the behaviour is safe, both the source and the destination hierarchy will be consistent, simply some disk space will be wasted.

There are other limitations to hard-links, they don’t work between file-systems and you cannot hard-link directories. The first restriction is easy to understand: it is difficult to share storage between different file-systems. The second is more delicate. Technically nothing in the internals of Unix prevents the hard-linking of a directory. The problem is more about avoid cycles in the file-system hiearchy, basically allowing a directory to contain itself. Permitting cycles has the potentiel to create a lot of chaos, as many tools (like the tree command) rely on the fact that the file-system does not contain cycles. Even if a hard-linked directory does not create a cycle at creation time, it might do so later, so permitting hard-links of directories imply adding the possibility that a move of a directory later on might fail (because it would create a cycle).

So how do you create hard-links? Basically you can use the ln command. The GNU version of copy (cp) also supports option --link, which links files instead of copying them. This version of copy is by default on Linux, and can be installed on Mac OS X, where it is usually called gcp.

Uniformes scolaires

Une des choses qui frappe dans la vie de tous les jours au Japon est la présence d’uniformes scolaires. Les écoliers de tous âges portent une forme d’uniforme ou une autre, que ce soit les plus petits qui portent la même casquette jaune, jusqu’au uniformes de high school, qui comporte même un casque standard pour se déplacer à vélo. Ces uniformes sont portés non seulement pour aller et revenir de l’école, mais aussi durant les activités para-scolaires du week-end. Chaque école dispose d’un uniforme différent, et il y a aussi deux uniformes de saison, un pour l’été et un pour l’hiver.

Si c’est une idée acquise et fortement enracinée dans la société japonaise, ce n’est de loin pas le cas en Europe continentale et en Suisse. Pourtant une expérience dans ce sens est menée en Suisse, à Bâle. Naturellement, on ne parle pas d’uniforme, mais de «tenue d’école».

Plus ça change…

Sel et coquillages

ロマの軍人は給与で塩を貰いました。 それからラチン語の塩はサラリーに成りました。 古い時貝をお金で使っていましたから, 買うの漢字で貝の漢字があります。

Rome’s soldiers were receiving salt as a form of payement. Because of this, the latin word for salt became the word salary. Because shells were used as monney a long time ago, the kanji for buy contains the kanji for shell.

Les soldats romains recevaient du sel comme forme de payement. À cause de ça, le mot latin pour sel est devenu le mot salaire. Dans les temps anciens, les coquillages étaient utilisé comme unité monétaire, de ce fait le kanji pour acheter contient le kanji de coquillage.

C’est amusant de voir que le vocabulaire et l’écriture sont encore conditionné par des moyens de payements qui datent de plusieurs millénaires, et qu’un mot latin apparaît deux milles ans plus tard en japonais après de nouvelles transformations pour donner サラリーマンsalary-man, un salarié (généralement d’une grande compagnie).

De fait, on retrouve le kanji coquillage dans d’autres mots liés au commerce, à commencer par 貰うmorau recevoir, mais aussi 貿易bōeki (négoce extérieur, commerce).

Les kanjis d’aujourd’hui:
Kanji Kun ON Signification Note
Armée, Guerre Un chariot avec un couvercle.
Salaire, Autorisation, Cadeau

Participer, Donner
Simple, divination


Sur le chemin de retour depuis l’aéroport depuis l’aéroport du 関西kansai, il y a deux trains possibles depuis 新大阪shin-Ōsaka, le サンダーバードthunderbird et le 雷鳥raichō. Le thunderbird est un train très moderne, alors que le raichō utilise des rames plus anciennes.

De nombreuses lignes de train portent des noms au Japon. C’est assez pratique pour se répérer, surtout que les trains on japon ont des look très différents. Ce que je n’avais pas réalisé, c’est que raichō et thunderbird sont en fait le même nom, la première fois il s’agit du mot écrit en japonais avec des kanjis en lecture ON, la seconde il s’agit de la version anglaise écrite en katakana.

Le mot pour train en japonais est 電車densha, qui peut se traduire par chariot électrique. L’ancien mot 汽車kisha (chariot-vapeur) n’est plus employé, mais apparaît encore dans le mot 汽車賃kishachin, le prix du trajet en train.

Les kanjis d’aujourd’hui:
Kanji Kun ON Signification Note
Tonnerre La pluie sur un champ
Électricité Le tonnerre avec une prise.

Vapeur Énergie et eau
Prix, Payement

The shoe event horizon

I’m on my trip back from Leeds to Japan, and stopping for one day in Manchester. The place I stay, the Britania, is fascinating, this is an old establishement, and it is clearly past its prime, and even its second. While the entrance hall has a large chandelier and a nice decoration, when you look close, everything is old and damaged. The room is quite small and reminds me of the old flat I had when I was a student or the flat where my grand-mother lived. Not exactly the feeling of a luxury establishement.

I took a walk in the streets of Manchester, but of course it rains and jet lags seems to have caught up with me. As I change time zones tomorrow, I don’t really feel like fighting it. Beside the fact that the Manchester center is one big construction site, the streets and the boutiques reminded me of one Douglas Adams joke, the Show Event Horizony, a phenomenon where all the shops are replaced by shoe shops and society collapsed. There are a lot of shoe shops in Manchester, and the whole place and my hostel in particular have a definitive feeling of decadance…