Third 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.

(Français) Anniversaires, éléments et signes du zodiaque

Les nombres ont une grande importance pour les japonais. Certains sont mauvais, comme le nombre quatre, d’autres bénéfiques. Ainsi un anniversaire important est le soixantième anniversaire. Cet évènement est appellé 巌歴 (kanreki), ce qui signifie retourner le calendrier. En effet après soixante ans, la même année zodiacale apparaît à nouveau.

Le est basé sur un système de douze années avec chacune un animal associé  : rat, bœuf, tigre, lapin, dragon, serpent, cheval, mouton, singe, coq, chien, et sanglier. Par dessus se greffe un système basé sur les cinq éléments  : métal, eau, bois, feu, terre. Une personne est donc définie par un animal et un élément, par exemple, je suis rat et eau. Les animaux changent toutes les années, les éléments tous les deux ans, le résultat est un système avec soixante combinaisons, qui se répètent après soixante ans. Nous sommes dans l’année du chien de feu, comme en 1946.

Comme rien n’est jamais simple, le kanji associé à chaque animal n’est pas le kanji normal. En lieu et place il y a douze kanjis différents. Ce qui est intéressant, c’est que ces signes furent un temps aussi utilisé pour désigner des périodes de deux heures de la journée et les directions cardinales correspondantes (si on place le nord à minuit). Par exemple, l’ancien kanji pour l’ouest (西) est coq (酉). Le kanji pour cheval (午) est utilisé pour exprimer l’idée de midi, comme dans 午前 (gozen), avant-midi (matin). 卯辰山 (utatsuyama) est ainsi nommée car elle se trouve dans la direction lièvre-dragon par rapport au château de Kanazawa. C’est à dire 105° en partant du nord (environ est-sud-est).

Les signes du Zodiaque Chinois
Kanji Kun ON Animal Période Kanji usuel
Rat 23:00 → 01:00
Bœuf 01:00 → 03:00
Tigre 03:00 → 05:00
Lièvre 05:00 → 07:00
Dragon 07:00 → 09:00
Serpent 09:00 → 11:00
Cheval 11:00 → 13:00
Mouton 13:00 → 15:00
Singe 15:00 → 17:00
Coq 17:00 → 19:00
Chien 19:00 → 21:00
Sanglier 21:00 → 23:00

Certains rôlistes auront remarqué que cela ressemble fort au système des heures draconiques de Rêve de Dragon, ce n’est pas très étonnant, vu que Denis Gerfaud s’est largement inspiré du système chinois.

Une note finale, la lecture KUN du sanglier contient un vieux caractères, ゐ, qui représente le son wi, mais qui n’est plus utilisé, de fait la lecture est généralement considérée comme étant い (i).

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…