Mise à jour de mes paquets Anki de japonais: +60 mots et +6 kanjis, et toujours des corrections et des exemples d’utilisation de mots.
Archives de l’auteur : Fab
Cassé et réparé mon clavier Typematrix
En attrapant mal mon clavier, deux touches de celui-ci ont jouées les filles de l’air, et l’articulation (entre la touche et le boîtier) d’une d’entre elle s’est malencontreusement cassée… Heureusement, j’avais conservé mon ancien clavier (tombé en panne et gracieusement remplacé par Typematrix). La procédure pour démonter et remonter les touches s’est avérée assez simple. Il a juste fallu être délicat pour que les pièces se déclipsent (et qu’elles ne se brisent pas en deux). Une pince à épiler m’a été utile.
Microbenchmark: Expat outperforms Java and libxml2 in SAX parsing
I needed an XML parser for my tests with Rust (parsing a gigantic 2Go Wikivoyage XML dump) and there is no native one. So I would need a wrapper around a C implementation. At first, I used libxml2, because it has a very appealing name it has a very convenient XmlTextReader API where you are controlling the parsing loop (no callback like in SAX).
I wondered how it compared to the StAX API of Java, and made a simplistic test printing (to /dev/null) the names of all the nodes. And surprise, StAX was way faster:
- the StAX (openjdk-7, Ubuntu 14.04, amd64)
- 35 seconds
- Memory usage: 30 Mo
- XmlTextReader API of libxml2 (2.9.1), g++ 4.8.2
- 50 seconds
- 3.5 Mo
Then I made tests with SAX, comparing the default Java implementation with libxml2 and finally also libexpat 2.1:
- Java: 30s (39Mo)
- libxml2: 34s (2Mo)
- libexpat: 21s (180ko)
Conclusions:
- the Java implementation seems quite good (at least in this particular scenario)
- libexpat is quite fast, but it’s SAX and not pull-parsing (which is very convenient)
- if you are processing huge XML files, forget about libxml2
Ordre d’écriture des kanji
Un article utile en anglais expliquant l’ordre d’écriture des traits des kanji (pour 99% des cas).
cgroups script for the current session
In Linux, cgroups (a kernel feature) allows to limit the resources (cpu, memory…) accessible to a group of processes. I have written a little bash script that will either:
- create some groups for the current user session and assign some restrictions. No need to be root or to modify a global configuration file. Call it when your desktop session starts (for example by putting an entry in «~/.kde/Autostart»). Edit the script to create your own groups.
- start a process in one of theses groups
The main reason was that I encountered a bug with Firefox and Google+, with triggered infinite memory allocation, which freezes my machine for a few minutes (because of the trashing). I hope that it will allow me to kill the process/close the tabs if it happens again.
Continuer la lecture
Taille comparée des villes de différents pays
Voici comment les villes et états se comparent en terme de population et de superficie. On notera par exemple que Marseille a une population équivalente à environ la 156ème ville chinoise, ouch!
Continuer la lecture
Mise à jour de mes paquets Anki de japonais (mai 2014)
Mise à jour de mes paquets Anki de japonais: +130 mots et +32 kanjis, et toujours des corrections et des exemples d’utilisation de mots.
Java: PipedInputStream contention
I met a performance issue with PipedInputStream/PipedOutputStream, and here is how I finally solved it.
Continuer la lectureUbuntu 14.04 : autojump is broken
In Ubuntu 14.04, the provided autojump does not allow to choose between several matches because of a bug. How to fix that (as suggested in the bug report):
- download a recent version, unzip, do «bash install.sh» and update your .bashrc to point on this install
- in ~/.autojump/etc/profile.d/autojump.bash, remove the argument «–bash» (twice)
comps=$(autojump--bash--complete $cur)
Point médian avec Anthy
Pour taper le caractère «point médian» (・) avec Anthy, cela se fait avec la touche (« / »). On peut aussi taper «なかぐろ».