Guillaume “Zifro” Desrat’s former blog

HTTPS blocked ? Use secure HTTP authentication then !

Filed under: code — Zifro November 30, 2006 @ 12:55 am

Alexis, an active member of Ruby France (you know, the French guys fond of Ruby), has set up a blog on blogspot.com : Alexis’ notes @ http://alexis-notes.blogspot.com/.

We only discussed Ruby code and software design twice (as far as I remember), but I was impressed by his knowledge and the way he quickly solved a problem by offering to use a Mediator design pattern.
I’m looking forward reading some Ruby code he gonna write !

In his first post, he writes a proposal to put an end to unsecure HTTP authentication, without HTTPS. I haven’t tested it yet, but it makes sense to me when I read it.
I strongly encourage you to go and read his proposal, comment his ideas, and go back later to read more on his blog.

Speedy Gonzales

Filed under: geek — Zifro @ 12:22 am

Last night I pulled a bit too much on the mouse wire, and disconnected it. I plugged it back on the PS/2 connector, but, as expected, I couldn’t move the cursor. So I tried removing the USB -> PS/2 adaptor and plugged it…. WOW it works. Who said OpenBSD wasn’t ready for the desktop ?

Funny, the mouse is way faster now. I can move from one screen to the opposite just in one wrist movement. My mouse is Speedy Gonzales !

P.S. : this post was to be longer, with a big part of ranting about standard and wireless keyboards and mice, but Firefox crashed. So I gave up re-writing all the text. The rant will be the topic of another post.

DSL with Ruby : how to get a step ahead ? (make it written in French, for my colleagues’ sake)

Filed under: work, WinDEV, code, Ruby — Zifro November 29, 2006 @ 12:50 am

DSL is the acronym for Domain Specific Language. A DSL is a language designed for a particular purpose, for an intended audience who may not feel fine with a complex programming language. For example, Microsoft Excel macros are part of a DSL.

I’m currently working on an application which exports data into a text file, formatted with given tags and given parameters, then send it to another remote software, which will handle it (I skip here the whole process, which isn’t interesting at all for those who don’t work on it) to finally have the data printed and sent by mail.

WinDEV doesn’t offer built-in testing, so I made the application write a checksum like log, to verify the number of each type of data exported. Well.
But as we’ve got several undocumented (yeah, I know, real developers don’t write neither documentation nor comments, I should just read the code…) data handling rules, some of the corrections I add last month made errors appear in other parts of the file generated.
At this point, it gets enough freaky for me. I NEED REAL TESTS !

So, I decided to write, on my spare time, a tool to validate the file (if fields are all filled, if the values make sense, if the email field really contains an email address, and so on). Playing with metaprogramming and code injection, I got this skeleton of testing code (hiding all the automagical thingies in FileAnalysis.rb) :

#!/usr/local/bin/ruby -w

require "FileAnalysis"
include FileAnalysis

trap('SIGINT') { puts "\n\nAborting tests...\nBe sure to run *ALL* the tests at once from time to time ;-) \n\n"
exit
}

FileForPrinting.is "MMMMMMMM_data_2006_11.txt"
FileForPrinting.analyze do |line|

line.store? do |mag|

store.should_have_all_fields_filled
store.should_have_a_valid_email_address

end

line.cust? do |cust|
# here goes the tests for customers lines
end

line.art? do |art|
# here go the tests for article lines
end

end

This looks like a DSL to me (and it’s pretty like “Creating DSLs with Ruby” on Artima.com). Tests are quick to write, and fully understandable (okay, for those who know which tags are in the file, and which tests could apply to those lines).

Unfortunatly, my colleagues, who’ll have to deal with this piece of code, sooner or later, aren’t… English-friendly :)
For one thing, we don’t write code in English at work (WinDEV is set to “I code in French, pal” mode), and they’re not used to read and write this language. On the other hand, I don’t feel comfortable with writing tests in English for something I work on daily, in French. I mean : why the hell would I write line.store? instead of ligne.magasin ?

So I’ve the idea of pusching the DSL work one step further, turning it into a French written test tool, which would look like :

FichierAImprimer.est "MMMMMMMM_data_2006_11.txt"
FichierAImprimer.analyse ligne par ligne

ligne de type magasin ?

la ligne devrait avoir tous les champs remplis
le magasin devrait avoir une adresse electronique valide

ligne de type virement ?

...

fin des tests

Okay, that would be very cool. Of course, I might end up writing slightly different code lines, to save some time working on that, but I think you get the idea. I suppose I’ll call a method, just after starting the program, as the first line of the code, to parse the file (or, maybe another one which will contain the tests) to replace some strings by another, according to rules I’ll set up (delete a blank space if it is immediately followed by a “?”, “le” and “la” at beginning of the line should be deleted as well, and so on…).

This would mix the two categories of DSL : the ones which are new dedicated languages to serve one goal, and the ones which are evolution of existing programming languages.

At this point, I have only two questions to you, readers : have you ever written a DSL to be used by non-English people, and what’s your opinion about all this ?

Because it’s a very good idea

Filed under: healthy life — Zifro November 28, 2006 @ 9:17 pm

The world-known FreeBSDGirl has an idea which I love : the “FreeBSDGirl Christmas Card”.

So, I’d like to propose you the same thing : send me an email (zifro@) by December 10th with the subject “A Christmas card, please”. Add your address info, and I promise you to send a Christmas card quickly.

Really, I think it’s a good idea. I’m waiting for your mail !

How to save (a lot of) money.

Filed under: geek — Zifro November 27, 2006 @ 1:58 am

For the last two months, I’ve been more and more thinking about buying an Apple computer.

I first fell in love with the Mac Book Pro, the 17 inches one, of course. It featiures nearly everything someone would love to have. But at EUR 3.100 (USD 4,080) with an external TV card, I quicky admitted I couldn’t afford it. Sigh.
Then I considered getting either a Mac Book or a Mac mini. Both are way cheaper than the premium Mac Book Pro : about EUR 1.498 (USD 1,970) for the first and EUR 1.059 (USD 1,400) for the latter. They aren’t fully loaded like the Pro, but they’re still quite interesting.

If I choose a Mac Book, it’s also to have a small and light laptop when travelling, and to really feel at home, I would gladly add a 23 inches Apple Cinema Display (maybe inspired by the commercial featuring 37signalsJason Fried and David Heinemeier Hansson) And then it costs a lil’ more : EUR 2.650 (USD 3,490).

As I realized I’m not that often travelling, buying a laptop may not be the best idea. Moreover, it would cost me a big Apple screen, as it wouldn’t handle my current three screens display.
So I thought of affording a Mac mini, plugged to one of my screens, and using Synergy to switch from OpenBSD to Mac OS X just with one single keyboard/mouse set.

Anyway, I like my OpenBSD workstation, with fluxbox, and I’ll keep it for a long time before chaging for an Apple computer (even if they’re very attractive).
Okay, to fulfill my dreams, here is what I would order :

For… about EUR 5.300 (USD 7,000). Insane hu ? :)

Yet Another WinDEV/HyperFile Bug : Network disconnections

Filed under: WinDEV — Zifro November 24, 2006 @ 3:45 am

I promised to write a long post about what I feel about WinDEV in details, but I don’t manage enough time to write something clean and clear, summing up why you shouldn’t and why you might want to use it.

By the time I prepare it, let’s take a look at this : when using HyperFile in classic mode, if the box hosting your WinDEV program get disconnected from the network for one reason or another, you must expect the HyperFile mechanism to yell at you because it can’t find your remote databse any more. And that even if the disconnection is so short MS Exchange doesn’t notice it and/or you don’t loose the network drives attachment.

See by yourself.

Really. Cutting-edge technology.

Back from Paris

Filed under: friends, Ruby, geek, girls — Zifro November 19, 2006 @ 11:44 pm

Ouch. A three days week-end. Eventful and restless.

I caught a train on Thursday evening, an hour and half after leaving the office, to arrived at 11pm in Paris. pouype was kind enough to host me for the week-end. He was waiting for me at the railroad station and drove me to his house, in a nice and quiet suburb.

On Friday morning, pouype and I got into the train, he to go to work, I to go to La Defense, to attend Paris on Rails conferences, in IBM’s Descartes Tower.
The conferences were very interesting, and it was the opportunity to meet many of those from Ruby France and Rails France I chat with on the Internet. I also met the team from the company I have job interviews with the week before, and the recruiter from Teamlog was here as well. I’ll write a complete page about these conferences in some days.

After the conferences, pouype (who joined after his day job) and I stayed next to the tower, so I could catch anyone I knew coming out, to introduce him to pouype. After discussing the interest of each conference with kristalino and bartocc , pouype, underflow, zencocoon and I walk around to finally have a drink and, after being cordially invited to leave, had pizza for dinner (where we were asked to leave too, a little after at 10pm O_o).

On Sunday, pouype, his wife and I went to a Greek restaurant, after what she stayed at home while we drove to La Cité des Sciences de La Villette, for APRIL’s 10th anniversary. We attended a conference and then leave to meet leeloo, the Mandriva Girl, and one of her friend, who lives in Montpellier, so we’ll plan to see each others sooner or later.
I didn’t watch my clock and I was four minutes late to get the train back to the South :-\

After considering waiting for 11 hours at the railroad station, as the following train to Avignon was at 7:54am on Sunday (!), I choosed to wander around and try to find a cheap room.

I did. But you can imagine the comfort of a EUR 50 (USD 64) room, less than a quarter of a mile far from the railroad station… I even blocked the door with chairs, in case someone tried to rob me during the night… (I took some pictures, I’ll upload them later)

Finally, I caught the earliest train this morning, and got back home at 11am.

Eventful, restless.

Friday was a good day

Filed under: work, friends, Ruby — Zifro November 14, 2006 @ 9:35 pm

Last Friday was a very good day.

I had a job interview with Teamlog’s human & social resource manager, had lunch with the local agency director, who interviewed me a month or so before, and then meet their client, who might hire a Ruby on Rails (and some other skills) developer.
Their company, which I won’t name here, is really amazing : they deal with cool technologies, in a nice environment, use eXtreme Programming, and, best of all : they develop software with Ruby, my favourite programming language.
I think the (four !) interviews with them went fine… I’m looking forward hearing some good news… I hope :)

Afterwhat, I headed to Lyon and parked at fredix‘ home. We waited for alex and jsh to arrive, and then got to the Pizza Hut. We spent a very nice evening, ate more or less gigantic pizzas, and discussed some points of our beloved association, Ruby France.

Finally, I drove alex back home and got on my own way, to arrive at 2 am… quite a looooong day.

Eclipse, the lightweight IDE

Filed under: code — Zifro November 8, 2006 @ 11:25 pm

Eclipse is light. Here is the top command output on my machine, after running for one day :

load averages: 1.31, 1.36, 1.38 20:17:15
48 processes: 2 running, 44 idle, 1 zombie, 1 on processor
CPU states: 88.8% user, 0.0% nice, 11.1% system, 0.2% interrupt, 0.0% idle
Memory: Real: 310M/491M act/tot Free: 8176K Swap: 38M/256M used/tot
PID USERNAME PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND
5362 zifro 64 0 244M 205M run - 341:47 54.15% Xorg
27702 zifro 2 0 96M 94M sleep poll 588:48 37.06% firefox-bin
32490 zifro 2 0 2604K 4832K run - 28:44 4.05% xmms
21058 zifro 2 0 429M 22M sleep poll 9:16 0.00% java
5990 zifro 10 0 288K 4K idle wait 0:00 0.00% eclipse
2974 zifro 2 0 5340K 9620K sleep poll 4:49 0.00% xchat
18904 zifro 2 0 13M 17M sleep poll 0:29 0.00% thunderbird-bin
18220 zifro 2 0 2484K 3048K sleep select 0:18 0.00% fluxbox
650 zifro 2 0 20M 21M sleep select 0:07 0.00% ruby

See ?
JAVA is bloated, not Eclipse :-D
But I started using it with RADRails under Windows, and I like it. When I stopped travelling in Europe and got another job, I had to give back the laptop I used to work on, so I migrate my development tools under my good ol’ OpenBSD workstation at home.
I spent hours compiling Java, installed the Eclipse package, added the Ruby Development Tools plugin and finally the RADRails plugin, in order to enjoy the same environment again.

Before Eclipse, I was a long time SciTE fan, opening many windows and terminals, to edit my source files and run the scripts needed.
And in older times (back when I was a Linux newbie, which I’m not any longer, since I’ve been an OpenBSD newbie for four years now), I used gvim.

Based on my following requirements :

  • syntax coloration for many languages/frameworks (C, Perl, Ruby, Rails, …)
  • panel for directory listing
  • panel for class/code analysis (like Eclipse’s Outline)

what would you advise me to use now ?

Two days (and few hours) to go

Filed under: work — Zifro November 7, 2006 @ 9:16 pm

The countdown has started for weeks.

On Friday, I’ll have the second round of the job interviews session with Teamlog. I gonna meet their social/human resources manager, and (that’s new) I’ll also be introduced to their clients, for who I might work, if I’m the right man.

I must confess I think a lot about it, as “most of the interviews will be done in English”. It’s not my native language ; it might be hard to have a two hours discussion with them.

- Next Page >>>