Categories

pytst 1.16

I’ve just released pytst 1.16, you can download it there.

This release fixes an annoying bug that occurs if you used CallableAction or CallableFilter. If your Python callback functions raised a Python exception, the whole process crashed. This meant that you had to catch all Python exceptions in the callback, which was not always handy. The exceptions now behave as expected, that is to say they are passed from the callback to the Python calling code through the C++ layer.

Thanks to Keith Davidson who reported this bug. Keith also reported a problem with NULL characters inside the keys : keys seem to be handled as NULL-terminated strings. It looks like there is a problem in the SWIG layer, since the C++ code doesn’t assume strings are NULL-terminated. I’ll have a look at this problem ASAP.

pytst 1.15

I’ve just released pytst 1.15, you can download it there.

This release fixes a quite important problem introduced on 2006/05/05… For a reason I don’t quite remember now, I decided to make the TST C++ template specialization dedicated to the Python bindings privately inherit from the more generic tst<...> template. I guess this was related to some problems I had with SWIG.

The problem is that this broke something in the way SWIG handled inheritance between the two types, the net result being that the Python TST class lost its prefix_match methods and other methods that were declared in the parent class but not in the specialization.

I’ve reverted the inheritance between the two C++ classes back to public inheritance, and everything is back to normal now.

I really wished I could spend more time working on ctst, since it features theoretically better structures and algorithms, plus to be frank I’m quite fed up with C++, and I’d be more than happy to go back to C.

Also, I must say that the native API for Ruby is very impressive. I’ve been developing the Ruby bindings for ctst by hand, not using SWIG, and I’ve spent substantially less time than it took to have SWIG properly handle my C++ code from pytst

A tribute to Groovy

My life as a developer :

Update : it’s my life as a professional developer, since my life as a programmer began in 1983 on a Sinclair ZX81

  • 1995 : Java 1.0 beta is released. I begin playing with it. Hotjava browser, applets are all the rage. Soon after, the infamous « Loading Java » status bar message in Netscape is the signal that you’ll loose control of your browser for at least 15 seconds while the JVM loads an applet.
  • 1996 : Academic and toy projects in Java. Since JDBC is not out yet, I decide to write my own DBMS in Java. It works but of course it’s crappy. Cloudspace, Hypersonic and over 100% pure Java DBMS are safe.
  • 1997 : Wrote an HTTP 1.0 server in Java, with pluggable controller modules named « lumps » (Java <-> coffee <-> sugar lumps, nudge nudge wink wink). Damn, I should have thought about « Servlets ». Wrote a lump which interprets a server page language not unlike ColdFusion (that is, as crappy, but at least at that time it already ran on the JVM). Wrote my first server pages which could access an Access database through the freshly released JDBC-ODBC bridge and display data on my browser. As a trainee, I have to work on a project built with Borland Intrabuilder. That was both interesting and very scary, since the thing was drowning in bugs.
  • 1998-1999 : Had to work, first part time, then full time. Of course, it’s all about EJB 1.0 beta and my lead developer Laurent Quérel and I try to build something around EJBs and Persistence Powertier which would not look totally unlike Hibernate today. I begin to get the abstraction addiction. It’ll take me a few years to get rid of this addiction.
  • 2000-2001 : the future is on the mobile phone, and WAP is going to be the next web. In full abstraction addiction mode, my team and I develop our own specialized application server, so that you can write a web application once and browse it from any web-enabled device, the presentation being abstracted and adapted to the zillion different devices that would soon access our apps. We develop half a dozen application with this application server before the net bubble explodes and we realise that it would need a few more years before the Internet on a mobile phone would become a Big Thing. One good thing, though : when we began this application server business, we drop all the EJB nonsense. We built our own IoC container, much like Spring. And we didn’t need an ORM, because all we needed to map to was XML, dude. This was the time when I read & wrote a lot on the xml-dev mailing list.
  • 2002-2003 : I’m done with the abstraction addiction. I’ve got a challenging job, lots of work to do, and no much time to think and ponder about abstracting anything. The code I write must be straightforward and must get things done. I’m feeling more and more irritated by the verbosity of Java and the zillion XML configuration files I’m forced to write. An IoC container is a nice thing, but honestly, I sometimes feel that a simple scripting language would be much more suited to configure my apps. I begin experimenting with Jython. I also try for the first time Groovy, which is under development, but the language seems a bit goofy at the time, a patchwork of good ideas but nothing really as coherent as Python.
  • 2004 : OK, I finally get it. I need a dynamic language. I hesitate between Python and Ruby ; Ruby is more interesting but less polished, and at the time, a lot of documentation is badly translated from Japanese. I choose to invest in Python. I fall in love with Python. I use it first for any kind of data massaging tasks, then progressively for web development. I begin tinkering with mod_python, which will eventually lead to my active participation in the project. In the same time, I experiment with Zope, find it fascinating and decide to use it for a classic web application project. Big mistake, that I’m still paying for four years after.
  • 2005 : Ruby on Rails appears. People marvel at the thing. I don’t get that the scaffolding demos that begin to invade the blogosphere have nothing to do with the real power of RoR. When watching those demos, I told myself « OK, that’s really cool, but real apps are much more complicated than just CRUD screens ». Of course, Sherlock, but do you really expect that things will be brighter in any other framework you can choose if even the basic stuff like CRUD is complicated ? Oh, and on August, the 23rd, my daughter Violette was born.
  • 2006 : it’s time for a comeback to Java (nothing to add to what I’ve wrote at this time). I also work 50% on my time for Yoono, once again with Laurent Quérel. One day, walking back from lunch in a Parisian street, I recognize Guillaume Laforge, which I knew took over the leadership of the Groovy project. I tell him « Excuse me, but aren’t you Guillaume Laforge » ? Yes indeed – I think he found it a little creepy to have reached celebrity to the point of being recognized in the street by total strangers :) . Anyway, at the time, in the street in front of our offices, I naively propose him to work for Yoono, as we were looking for top notch Java developers. Of course he declined politely, but now that I know what Guillaume was working on, I’m glad he did !
  • 2007 : for a new big project, I hesitate quite a long time between Java + Spring + Hibernate + Struts, Python + Django and Ruby on Rails. I finally decide to give RoR a go. It’s awesome. Nothing to regret as of today, except maybe my choice of MySQL + InnoDB tables which gives strange problems with table locks. Apart from that, I get the same rush than anyone else trying RoR : freedom and power ! However, the deployment model sucks. What, a single-threaded application server ? You have to launch multiple servers and load-balance between them using Apache 2.2 mod_proxy_balancer, lighttpd or Pound ? OK, I’ve done it with mod_proxy_balancer and it was no rocket science, but seriously, It’s a bit of an hassle to manage. And the performance is not so great, I squeeze 60 reqs/sec per instance, with is totally sufficient for the app we built, but come on ? I get easily 4 or 5 times more reqs/sec with any badly configured Python or Java stack (please don’t flame me for this obviously inane benchmark).
  • 2008 : Grails 1.0 is out. I have a new look at Groovy. It has been totally morphed into one of the coolest dynamic language out there under the lead of Guillaume Laforge. Groovy is now a true dynamic language, with a seriously good feature set. All my favorites from Python and Ruby are there. And it runs, fast, on the JVM. What can I say ? It looks almost perfect. Of course, writing such a language is a difficult task, and things could get ruined by weird lexical scoping interaction with closures or things like that (no, I don’t think about any particular language, Ruby). But at first sight, it looks very, very good. Could I ask more ? A nice web framework running on top of the JVM ? Well, Grails sure looks promising, I can’t wait to try it on a real application ! Performance-wise, my first benchmark tell me we’re far above Ruby on Rails. Oh, and IntelliJ supports Groovy and Grails with a pretty cool plugin, too. So I guess life as a web developer is now perfect, end of story :) .

And now for the punch line : I have now reached a position at work where I’m supposed not to code any more, at all.

WHAT ? All those years of sweating, fighting and yearning, and now that a good web development stack is out in the wild, I’m supposed to retire as a developer and become a friggin’ MANAGER ? I tell ya, there’s no justice anymore in this world.

Oh, and 13 years after, my browser still hangs for more than 15 seconds as soon as I try to load a page with an applet. Meanwhile, Flash objects load almost instantly, without any problem…

Une idée lumineuse !

Ce matin dans le métro, une magnifique opération marketing du Groupe France Mutuelle pour promouvoir leur produit FC Santé.

Distribution générale d’une boite en carton 100% non recyclé, contenant une bonne dose de mousse 100% vrai pétrole équitable au sein duquel était lové une merveille de petit GiFiMi (la mascotte du groupe) en pur plastique du même métal.

Quelle merveilleuse attention en ces périodes de fêtes ! On imagine des milliers de petits neveux mal-aimés ou de belles-filles ingrates qui se verront refiler cet ersatz de Bibendum à Noël. Le dispositif doit être redoutablement efficace : le petit bonhomme pas en mousse planté au sommet du sapin de Noël, qui pourra hésiter à souscrire à une mutuelle avec franchise cautionnée (lire : si tu es malade, c’est de ta faute, tu paies, sinon on te redonne un petit bout de tes versements) ?

Bien sûr cela a donné lieu à un face-lift des plus tendances de la station (en l’occurrence, Mairie de Montreuil, mais apparemment d’autres stations ont subit le même sort) :

Ces photos ne sont que la partie visible d’un iceberg de boites éventrées qui débordaient de toutes les poubelles de la station, dans les couloirs, etc.

A en juger par la signature sur le flyer se trouvant dans la boite, c’est The Marketingroup et son sens de la relation qui ont oeuvré à cette réussite.

Le plus beau était sans conteste le volet événementiel de l’opération : le moment où en pleine heure de pointe, sur un quai bondé, le conducteur du train resté quelques minutes de trop à l’arrêt demande à tout le monde de sortir « pour cause de colis suspect dans le train ». Au final, c’était une fausse alerte (et je ne sais pas si c’était lié) mais c’est sûr, on les regarde tout de suite avec plus de respect, ces centaines de boites en carton donc chacune pourrait contenir un pain de plastic de taille respectable.

Ecologique, ciblé, efficace et citoyen, que demander de plus ?

PullXML renamed to PushXML, hosted on Google Code

As the API for PushXML is definitely not a pull API (it is based on a callback instead), I’ve renamed PullXML to PushXML.

I have also decided to host this small project on Google Code, so that I can have a public Subversion repository, issue tracking and so on.

Here is the link to the project and here is a direct link to the latest version of PushXML.

PullXML : an XML Pull Parser for PHP 5

You’ve got a big, big XML file to parse. You need to do it in PHP. Well, you’re in deep trouble. Unless I’ve missed anything, here are the different alternatives I’ve seen, none of which satisfied me :

  • Use SimpleXML. Not possible here because your big, big XML file won’t fit into memory.
  • Use DOM or DOM XML. Same problem, the file won’t fit into memory, PLUS this time you get a notoriously crappy API.
  • Use XMLReader. No memory problem, this time. However the API is awkward, maybe it gets better using a combination of calls to XMLReader::expand() and XMLReader::next(), but then again it’s back to the crappy DOM API.
  • Use The SAX-like streaming XML parser. This works, no memory problem, but then again it’s pretty awkward, you have to implements a stack-based machine to do anything remotely useful if the XML document is a little bit complicated.

Well, after messing around with PHP for a few hours (man, this language is soooo weird ! I miss Python…), I came up with PullXML, an XML Pull Parser. It works in PHP 5, it could be ported to PHP 4 but frankly this is not something I look forward to doing :) .

PullXML is implemented with the SAX-like streaming parser. It builds objects that look like SimpleXML objects, but instead of loading the whole document in memory, it builds them chunk by chunk and calls a callback you provide when a chunk is ready.

The chunks are delimited by the pivot, which is a simplified XPath expression that gives the path that each chunk must match. For example, if the pivot is /foo/bar, then PullXML will call your callback for each bar element that is in a foo element, including the content of the bar element, of course (otherwise this would be quite useless). But the best way to see how it works is to have a look at the source code and experiment with the example at the end.

I’m no expert in PHP and I haven’t much used SimpleXML, so this must be quite buggy for the moment. Yet, it already does the job as expected on one of my projects. If you have any remark about the source code or any suggestion for a better compatibility with SimpleXML, feel free to leave me a comment.

Ideas Worth Sharing and the Gapminder

This presentation from Hans Rosling is a definite must-see. The message about world health is enlightening, and the visualisation tools are impressive. This is one of the coolest thing I’ve seen for a long time, I mean in a « we should have thought about it before » way.

The great news is that you can do your best Hans Rosling impersonation by using the tools his Gapminder venture developed. They are available here, here and here.

Switched to DotClear 2 beta 6

Hi ! This is my first post under DotClear 2 beta 6. I’ve apparently succeeded in migrating from DotClear 1.2.5.

I only had a small problem with permalink begin moved to /index.php/2006/... to /index.php/post/2006/..., but I solved it by making a full export, tinkering the exported file with regexps, then performing a full import. Problem solved !

Now I need to customize the templates and re-add all the annoying widgets that my former blog had (or not). But that will be for another day, because I’ve got some work to to right now.

In any case, kudos to the DotClear 2 development team for this great release !

It’s about time !

It is now 2007 and for the first time in the history of mankind cometh a project management software that can handle multiple levels of undo. That was one of my main pain point with all the existing PMS.

It’s even mentioned as a feature ! It’s like they just discovered that multiple level undo was actually useful, and was worth being advertised. Like this was not a standard feature in every other kind of professional software (ahem… except those with web-based UI, of course).

Anyway, this might be the first actually usable PMS, so let’s stop bitching and start evaluating the beast !

Update : well, I’ve tried it and it works. As expected. Now that I’ve got it, there’s not much to be excited about multi-level undo :) . I think it’s been something like ten years now since I first played with MS Project, and apart from this « cool » new feature the product doesn’t really seem to evolve. See the other pain points I’ve got with it there.

Ma très chère Free.

Moi qui pensais avoir tourné la page l’an dernier sur deux ans d’incompréhension mutuelle, de silences gênés, de mesquines attaques financières, me voilà fort surpris et déçu.

Surpris, je le fus en te retrouvant au détour d’un relevé de banque, un an après notre séparation glaciale.

Je rappelle les faits : atteinte d’amnésie, tu m’obliges après un déménagement à faire plusieurs demandes d’ouverture de dossier. Tu m’ignores ensuite lorsque je demande le dégroupage total.

Enfin, un jour, tu m’entends mais m’envoie la Freebox je ne sais où (apparemment à mon ancienne adresse) et sans me tenir au courant. Parallèlement, les dossiers s’ouvrent en cascade, mais toujours sans dégroupage. Malheureusement, je ne pensais plus jamais avoir à ressasser tout cela, et les pièces justificatives me manquent aujourd’hui, disparues dans un grand autodafe libérateur, mais ce fut en tout cas une histoire très confuse et surtout très coûteuse.

En effet, quelques mois plus tard, tu me factures 400 euros pour non restitution d’une Freebox que je n’ai jamais reçue (voir le paragraphe suivant, il faut suivre). S’ensuit une longue lutte, des échanges maladroits, des appels infructueux à la coûteuse hotline, des recommandés avec accusé de réception, pour au final que j’obtienne gain de cause et que tu me rembourses (hormis les frais de procédure, comme on dit).

Note que j’étais toujours chez toi mais toutes ces maladresses avaient quelque peu entamé ma confiance en notre relation. Néanmoins, pour prouver ma bonne volonté et m’investir un peu plus dans notre couple, j’ai redemandé le dégroupage de ma ligne pour profiter de ton alléchante offre triple play.

Combien de couples malheureux pensent que faire un enfant leur permettrait de sortir de l’ornière ? Je ne sais, en tout cas plus de six mois après avoir fait ma demande sans être entendu de toi, je n’en pouvais plus. Lassé de payer les sempiternels 29 euros et des poussières par mois pour un ridicule 2 Mb sans téléphonie gratuite ni télévision, je décidais finalement de résilier mon abonnement pour refaire ma vie avec un autre fournisseur. Et de ce côté là, ça va très bien, merci.

J’étais donc surpris de recevoir des nouvelles de toi dans mon relevé bancaire, mais déçu de leur teneur. Apparemment, tu vis dans un monde fantasmagorique où mon numéro de téléphone fixe est toujours 01 43 78 WX YZ, et où je suis toujours abonné à tes services. En conséquence de quoi, tu as continué à me prélever consciencieusement 29,99 euros par mois depuis plus d’un an.

Oh, je sais, c’est un peu de ma faute, j’aurais dû vérifier de plus près mes relevés de banque, et ce depuis longtemps. Mais que veux-tu, je suis comme ça, confiant dans mon prochain, et malgré toutes nos difficultés, je ne pensais pas que tu pourrais vivre dans un tel déni de la réalité.

Tu vois, je te parlais d’une histoire coûteuse, et je sens confusément que ce n’est pas fini, car nous allons encore devoir nous échanger moults recommandés avec A/R, moultes additions salées à ta hotline payante (il y en a encore pour longtemps), et moults énervements de ma part, qui ne se facturent pas à court terme mais qui finiront bien un jour par grever le budget de la Sécurité Sociale. Mais si mes comptes sont justes, après les 400 euros de la Freebox, c’est maintenant près de de 360 euros que tu m’as injustement prélevés, et pour lequel tu me forces à me battre.

Mon premier réflexe lorsque je me suis rendu compte de on problème, je l’avoue, était de me mettre en colère. J’ai derechef appelé ma banquière préférée pour faire opposition à tes prélèvements. Cela manquait de cordialité, j’en conviens, mais songe au temps qu’il te faut pour répondre à chacune de mes solicitations (deux mois minimum), tes prélèvement concomittants auraient compliqué les choses.

Tu me permettras néanmoins de trouver une certaine ironie au mail que j’ai reçu de ta part ce matin à 6h30 (je me suis permis de l’annoter) :

Bonjour,

Hey, baby, ça farte ? Ca fait un bail !

Vous êtes abonné au forfait Free Haut Débit sur la ligne 014378WXYZ.

Plus vraiment, non, tout est fini entre nous depuis un an. D’ailleurs je ne suis plus non plus abonné à France Télécom donc à ce numéro, je n’habite même plus au même domicile.

Conformément à la facture N° 12-53437260 établie le 02 Décembre 2006 nous avons émis une demande de prélèvement d'un montant de 29.99 euros auprès de votre établissement bancaire.

A quelle adresse m’as-tu envoyé cette facture et toutes celles qui ont précédé ? J’ai souscrit à un transfert de courrier suite à mon déménagement, je n’ai malgré tout rien reçu…

Il semble que ce prélèvement ait été refusé par votre Banque pour le motif suivant : Tirage contesté par le client (70)

Je veux, oui… Plus de tirage entre nous, ma poupée.

Pour régulariser votre situation auprès de nos services, il serait souhaitable de nous envoyer au plus vite :
- Soit par chèque pour un montant de 29.99 euros à l'ordre de Free Haut Débit (Ne pas oublier de mentionner le numéro de téléphone de la ligne concernée au dos du chèque) à envoyer à l'adresse suivante : Free haut Débit 75371 Paris cedex 08
- Soit par carte bancaire en téléphonant au 3244 (0,34 TTC par mn à partir dun poste fixe) du lundi au vendredi de 8h30 à 19h00.

Ouh la, je vais me dépêcher alors. Et puis, c’est vraiment la grande classe de faire payer 0,34 euros TTC par minute, car j’imagine que ce sont des euros, pour payer une mensualité qui n’est pas dûe. Franchement, baby, tu me déçois.

Si vous avez changé de banque, merci de nous retournez les documents ci-dessous :
- le RIB d'un compte bancaire valide pour effectuer les prochains prélèvements
- une autorisation de prélèvement correspondant au nouveau RIB fourni (disponible sur http://adsl.free.fr/comptes/modification.html )
En parallèle de votre modification à Free Haut Débit, vous devez prévenir votre établissement bancaire et/ou postal de la mise en place du prélèvement automatique qui sera intitulé "Free Haut Débit" code NNE 459654.

C’est amusant, j’ai exactement fait le contraire : interdiction de prélèvement pour le même code. Ah, et il y a une faute de grammaire, c’est « merci de nous retourner« .

Si vous ne régularisez pas rapidement votre situation, nous serons contraints de bloquer votre accès à Internet et d'engager les poursuites nécessaires pour recouvrer les sommes dues.

Alors bon, je sais, cela va être dur, mais on va faire comme avec un sparadrap, d’un coup sec : mon accès à Internet n’existe plus depuis longtemps ! Je suis curieux de voir comment tu peux le bloquer. En ce qui concerne les sommes dues, j’en ai autant à ton service. Tu me dois du temps, aussi.

Nous vous rappelons que votre Facture est consultable en ligne à tout moment à l'adresse : http://adsl.free.fr/conso/

Aaaah, c’est pour ça que je n’ai rien reçu ! Bon je vais voir. Euuuh :

La page demandée n'est pas disponible sur ce serveur

Bon ça a changé… Il faudra changer ce mail type quand tu écris à tes exs, ça ne fait pas sérieux. Je clique. Aaah, mais on me demande un identifiant et un mot de passe ! Mais ma pauvre petite, si tu crois que je m’en souviens… Bon, je clique sur « Vous avez oublié votre mot de passe ». Tu me demandes mon identifiant… Je l’ai oublié aussi. Je mets un identifiant qui pourrait être vaguement le mien… Ah super, ça marche, tu vas m’envoyer mon mot de passe ! Pris d’un doute tout de même, je reviens en arrière et saisis connard. Ah super, tu vas lui envoyer son mot de passe, à lui aussi ! Youpi ! Allez, maintenant je tape lapin… Ouiiiiiiiii ! Et pere.noel ? Ohhh, lui aussi va le recevoir ! Franchement, tu es la pingre la plus généreuse que je connaisse.

L'équipe Free Haut Débit. FAQ: http://faq.free.fr/?q=1075

Eh bien salut, Free, franchement tu ne me manques pas. Comme je te sens un peu dure de la feuille, je me suis permis de mettre tout ça sur mon blog (http://nicolas.lehuen.com/index.php/post/2006/12/22/120-ma-tres-chere-free), histoire que tous mes amis soient au courant, eux qui m’ont aidé lorsque tu me rendais si malheureux, lorsque je me sentais si seul, trahi par toi.

J’espère juste qu’un jour tu ouvriras les yeux et que tu réaliseras : non, Nicolas Lehuen n’est plus un de tes clients, et tu lui dois 360 euros. Franchement, si tu avais des problèmes d’argents, je ne dirais trop rien, mais ce n’est pas le cas…

Par ailleurs, si tu as besoin d’un peu de liquide, tu peux demander à ton patron, Xavier Niel, il a la méthode !

Update : bien sûr, lorsque j’essaie de répondre à ton mail à l’adresse de l’expéditeur, hautdebit@freetelecom.fr, j’ai une erreur car l’adresse n’existe pas. Décidemment, quelle classe !

Update 2 : je viens d’avoir une de tes collaboratrices au téléphone, m’indiquant que selon toi, je suis toujours abonné (sans blague) et que devais fournir la preuve de ma demande de résiliation. Figure-toi qu’après un an, je n’ai plus trace de mes justificatifs d’accusé réception. Comment va-t-on procéder ? Faute de mieux, je te réenvoie un formulaire de résiliation, prêtant ainsi le flanc à une vile attaque de ta part du style « puisque vous résiliez maintenant c’est que vous n’aviez pas résilié auparavant ». Hélas…