Archive for September, 2009

First steps with Ruby

by on Saturday, September 26th, 2009

I’m taking my firsts steps in learning ruby. I have been hearing good things about it for so long that I finally decided to give it a shot. 

It actually looks nice. I like Object Orientation and ruby seems to be better at it that most interpreted languages I’ve come around. Unfortunately it still lacks things like method overloading (the downsides of having dynamic data types I suppose). I do like the ‘everything is an object’ paradigm.

Anyway, I haven’t learn enough to give a real opinion about it, so please don’t take me very serious.

I’ll try to keep you informed about my progress, but I make no promises.

JSon saves the day

by on Saturday, September 26th, 2009

Don’t you love when you find a simple solution for a problem that has bothering you for quite a while? I don’t know why I didn’t come up with the solution before but at least I did.

I love JSon’s simplicity.

Parsing and writing flat files with Flatworm

by on Thursday, September 3rd, 2009

I will not even try to apologize for forgetting about this place. It’s useless….

Recently I´ve working a lot with flat files. You know, parsing and writing them from/to objects. My first try was very ad hoc since I was using a very simple format. Unfortunately things changed and the need for several types of formats form multiple clients appeared.

Luckily I found a nice java library (named Flatworm) for parsing and writing files using a format defined in a XML file.

The project seems to be abandoned but it’s quite usable. You can read a fast guide to it in its home page.

Flatworm basically let you define a format with many fields (with a fixed length or using a separator ) which will be mapped to a bean fields. This way, if you write a bean to a file each field will be filled using the appropiate get method. It works the same way parsing, calling a set method for every field in the format.

I will not write a tutorial about it since the guide is quite easy to follow.

Greetings.