about processes and engines

Archive for the ‘coding’ Category

WordPress Syntax Highlighting

It simply works.

def hello
  puts "hello"

The explanation, from the FAQ.

No more pastie for this blog (but I keep using it in other contexts). is a great platform.

Via Emmanuel Oga.

Update : Barry Hess had an issue with Markdown and Syntax Highlighting. I guess it doesn’t concern people like me who simply have a account.

Update : Firefox is no friend with this trick. Whenever I have a post that uses it, I edit it with Safari, works like a charm.

Written by John Mettraux

October 17, 2007 at 9:09 am

Posted in coding, source, wordpress

code rythm

I won’t give any example, I don’t have the time.

I hate when people don’t put a whitespace after a comma in their code (or in whichever of their prose), it breaks a typographic rule, it makes their work difficult to read.

Similarly I don’t like when people don’t add extra blank lines to their code. Prose that isn’t split in paragraphs is hard to read, it’s the same for code.
Bits of silence are important in music pieces, there are bits of silence around notes, around musical phrases. Rythm.

A majority of the smart guys I came across until now were equally good/excellent at maths and music. I’m not among them.

It’s a pain to read code slapped together without a single breath / blank line. It’s usually perpetrated with an IDE, encouraged by auto-completion and an opening on some hyphothetical refactoring. Auto-deception.

I prefer to work with my plain text editor, line by line, like a poet, verse by verse. But I’m no poet nor am I a musician.
Beautiful muses are demanding.

Written by John Mettraux

October 1, 2007 at 1:16 pm

Posted in blahblah, coding

and other small coders

IBM announces an interesting initiative today that will make it easier for open source programmers and other small coders to put together a range of software, including Web Services.

From Andy Oram at OnJava. No link to the actual IBM announce.

“other small coders” is quite insulting, I guess it comes from IBM. “patent protection” as always, sounds very ‘cosa nostra’.

Written by John Mettraux

July 11, 2007 at 11:33 pm

Posted in blahblah, coding, opensource

fat stack (fixed)

I checked in yesterday an important modification in the heart of OpenWFEru. It makes this open source ruby workflow / bpm engine way less ‘beta’.

The initial, naive, implementation of the process execution of OpenWFEru could generate deep stacks. For small processes, it was OK, but it broke at a certain point (like, for instance, a sequence of 450 participants), and it got slower as the stack of a process grew.

Processes with asynchronous participants (outside of the Ruby interpreter running the engine) were less susceptible to that problem.

This has been fixed. One of the consequences of the fix is that the launch() method lost its optional ‘async’ parameter. Now (OpenWFEru 0.9.10), all launches are asynchronous. Don’t argue, it’s a business process execution engine, it deals with time and concurrence. (You can still wait_for() a given process instance).

Written by John Mettraux

April 21, 2007 at 2:06 pm

Posted in coding, openwferu, ruby

Scrum according to Emerson

ninjava_aprilYesterday evening, Emerson Mills talked about “Scrum according to me (how scrum saved my personal life)” at the last Ninjava meeting.

Here’s a Wikipedia link to Scrum (Pick your favourite, maybe limit your choice to the first three items in the list there, oh, Snap does limit itself to Rugby).

I was busy polishing a test suite while he was talking, so my attention wasn’t 100% (gomen), but here are a few fragments I gleaned :

– interruptions are bad, they ruin focus and delay projects
– put the team in the same, open, space. No [head]phones allowed
– split sprint goal into tasks, task go on a post
– a sprint is some kind of iteration (2-3 week)
– someone picks the post-it, write his name on it with a time estimate
– “post-it are cheap, their learning curve is nil, there is no license for using them”
– managers shouldn’t bother developers, if they want to know the status of the project, they look at the post-it board
– once per month a day is dedicated to demos (status demos ?), managers do attend. Bring beer and junk food
– getting better at time estimation, task after task
– be flexible

about stand-up meetings :

– stand-up meetings seem to originate from Japan
– first thing in the morning
– managers attend, but only devs speak
– make them short
– if you have a free-spirited dev willing to develop from home, it’s OK as long as he shows up to the meeting (same, open, space ?)

The discussion that followed was rather intense and included things like :

– new projects or maintenances ?
– XP and Scrum
– pair programming means real-time code review
– sales and management people ‘observe’ the process, they give goals, but not time goals
– is pair programming protecting the pair from interruptions or actually just diluting them ?
– what about open source programming and scrum ?
– what about teams having to multitask on legacy maintenances ?

Zev had to interrupt the discussion at 10pm (damn managers, interrupting again) to let the crowd have an opportunity for beer and food in a restaurant.

There were many things said and ideas exchange, can’t relate everything here… An excellent Scrum evangelism session by Emerson, and not a slight scent of dogma, ideal.

Thanks a ton to Cerego for hosting the meeting. The next one will be in June probably.

Update : the PDF of Emerson’s talk is now available.

Written by John Mettraux

April 20, 2007 at 3:59 am

Posted in coding, dev

your product

They are everywhere, their way was paved, they’re spoilt, they’ve all the documentation, videos and slideshows, it’s an invasion… They were given a box, a very convenient box…

The Rails developers…

Rails is grand, but don’t forget to think out of the box… How can you call yourself a developer when you’re just a baby bird stuck in its railway nest screaming : “hey, feed me with the documentation on how to integrate your project into Rails !”… If only you had the decency to initiate a reflection on how to achieve it instead of playing the “consubie”, taking open source and free software for granted.


Don’t call my project a “product”, did I ask for any of your money ? The price is playing the open source way : reporting bugs, providing patches, communicating in an open way via the mailing lists and not via private emails.

Written by John Mettraux

April 8, 2007 at 8:26 am

Posted in blahblah, coding, ruby


I’m implementing a journaling functionality for OpenWFEru, our open source Ruby workflow and bpm engine. OpenWFEru currently uses unique ids for business process instances that are mostly plain integers.

Journaling goal is to help rebuild broken processes and when this is done manually, it involves matching various files whose names sport those “workflow instance ids”. Matching 1174038400840 among 1174137717900 might be really tiresome for the eyes especially on some platforms without a decent ‘find’ or ‘grep’ implementation.

kotoba.pngI’ve just implemented a base 10 to base 70 converter… Sounds boring ? Indeed but maybe with a look at these examples, it might get more interesting:

Kotoba uses 70 of the syllables of the Japanese language to produce strings that are [usually] easier to remember than their integer counterparts.

Of course, Kotoba is usable as a library (require ‘kotoba’) from your Ruby code (but the command line version is great for integrating into your nifty shell scripts).

Kotoba’s source is available under a BSD license as a single file download. Else, it’s currently part of OpenWFEru. I don’t plan to ‘gemify’ it for now.

update : it’s been ‘gemified’ as openwferu-kotoba. It’s available via a classic download as well.

Written by John Mettraux

March 18, 2007 at 6:02 am

Posted in coding, openwferu, ruby, shell, utils

Cyclo Saikuro

Yesterday evening was the revival of Ninjava, a gathering of programming enthusiasts (not only Java) in the Tokyo area.

Zev Blut presented one of his open source projects : Saikuro.

“Saikuro” is a japanese transliteration of “Cyclo”. This tool analyses a set of ruby code and outputs a report about its “cyclomatic complexity”.

saikuro.pngIn short, this metric looks at how many branches there are in a piece of code and returns a complexity score.

In this example, the complexity is “3” : the easy way to compute the metric is by counting how many areas are “encircled” by the graph representing the code (plus the area surrounding the graph).

Pointers to articles about that metric are available from Saikuro’s home page.

I ran Saikuro over my OpenWFEru project. Saikuro generated two reports, one about Cyclomatic Complexity and one about the count of tokens per line.
For OpenWFEru the very first written methods (the one dealing with interfacing with the Java engine over REST) were flagged in red. As Zev pointed out, such ‘parsing’ code sports loads of ‘ifs’ and thus yields a high CC score.
To the reports.

At the end of the talk, the discussions centered on the usefulness of the metric for a developer and especially a project manager, and on how to integrate it in a development process. (check in, code review, …)

It’s a simple and effective metric, nice addition to a Ruby toolboox. This utility deserves to be gemified.
It would be nice if the reports actually displayed the methods (at least the ones in the red), maybe with a bit of Erb and a ruby.css…

Emerson Mills will talk about “agile software development process” (“scrum à la Mills” as he said) in the next (April) meeting of Ninjava.

Thanks to the Cerego guys for hosting this meeting !

Written by John Mettraux

March 16, 2007 at 12:11 am


Omega SeamasterA workflow engine relies on a scheduler for certain time related activities.

While porting OpenWFE to Ruby, we ported the scheduler as well.

As our small Ruby scheduler can be used independently from OpenWFEru, it deserves its own documentation page.

This page is especially linking to one of the OpenWFEru examples.

Made in Japan vs Made in Switzerland.

Oh, and the openwferu-users mailing list just got created.

Written by John Mettraux

January 30, 2007 at 3:00 pm

Posted in coding, openwferu, ruby, workflow

less light, blindness

I’ve lost two hours of my life fixing some code someone else wrote. It was done in Eclipse.

Of course, it was just a problem of duplicated code showing up in both the extensions of a class. I use only Vim, no fancy Eclipse. What good using an IDE when you lack the discipline to produce elegant code ? Less code is less danger.

That faulty code is closed source [of course].

And to conclude : my apologies for any code I wrote or will write, closed or open, yielding such problems; I’m just a human being…

Written by John Mettraux

July 16, 2006 at 3:36 pm

Posted in blahblah, coding, eclipse, java