IFS 2008-08-24: Cobra
Tuesday, August 26th, 2008I’ve found and proposed a solution for a bug in the Cobra Toolkit, a HTML parser with a Javascript engine attached.
I’ve found and proposed a solution for a bug in the Cobra Toolkit, a HTML parser with a Javascript engine attached.
I divide free software people this way:
I stick on the first and second groups.
On time to time, I release a new free software, taking part in the last group, at least for a few lines of code.
More often I’m part of the third group, by submitting bugs and (sometimes) patches.
I’ve decided to list those patches here, since somehow they give a feeling on how, why and when I do what I say to do to friends and colleagues asking me about linux and the rest.
And by the way, that improves my curriculum.
I’ve just received the approval email for my latest java tool: JRecordBind.
If you are familiar with JAXB, JRecordBind is just the same (from a functional point of view) but it targets host files, a.k.a. “fixed length text files“.
If you are not familiar with (un)marshalling tools, let me present you JRecordBind.
When you need to import some fixed length file, you usually have an extensive documentation about which field is where. Something like
- from char 1 to 20 there are name and surname, filled with spaces
- from 21 to 28 the birthdate in the format YYYYMMDD
and so on.
Speaking XML, this is the XSD, the definition of the structure of the data file, with the types of each field.
JRecordBind needs you to write this definition into a “.properties” file.
The RecordBeanGenerator will then create a java bean suitable for storing each line of the data file.
The Marshaller object will transform this bean into a text line: that’s useful when you need to export data.
The Unmarshaller will do the contrary, that’s transforming every single line into a bean: useful when you need to import data.
JRecordBind allows the developer to focus of the varying part of such import procedures: how to spread imported data into a database. JRecordBind will care about reading/parsing/validating.
JRecordBind is still in the incubator since I plan to add multiline support (beans defined in multiple lines) and multibean support (different types of beans defined in different lines)
Nonetheless, it’s quite fast: on my pentium-m, unit tests have unmashalled 100.000 lines in 5 seconds.
If you want to blame me for this tiny little piece of code, drop me an email at federico _Oo_ fissore.org
A final note
I must admit that JRecordBind is currently compiled with Java 6. But it could be easily ported to Java 1.4. Do you think I should? My ego says “Noo! Java 1.4 is dead. Long live Java 1.4!” but since host files are old, maybe old 1.4 software could benefit of this tool.
Uhmm, I’m at a crossroad.
Gentoo is a source based distro: usually, every software you need will be downloaded in source code form and compiled right on your box.
This opens up a whole set of optimizations, making Gentoo usually a bit faster than other distros, as it is more specialized and can take advantage of your own CPU instruction sets (think about MMX, SSE and 3DNow!).
These optimizations make some guy see Gentoo as an environment friendly distro: software is optimized, therefore less energy is required to accomplish the same task.
But even the less intuitive can understand that having a computer stuck at 100%, compiling for hours, it’s not really good for the environment.
Nonetheless, I still use Gentoo and I suggest using it to my coworkers. To me Gentoo is the perfect distro for every developer as it helps you understanding your box (and even the differences with other’s boxes, if you start contributing your ebuilds)
Understanding the main tool you (as a developer) use, will make you more efficient: you’ll start having answers to others questions, because you have seen your installation growing up, step by step.
That’s my point in using Gentoo: my box is in the palm of my hand. I know almost anything of it. I usually know why things happen, on the contrary of my coworkers, that waste time and productivity finding workarounds to things they don’t know.
Something that reflects the quality of their job, as they produce software that sometimes misbehaves.
If you want to be a good developer, start understanding your box now. Whatever operating system you use, shit is unlikely to happen: everything happens for a reason. If you think your OS makes it hard to understand, try another.
This friday, May 23rd, I’ll be at the Underscore _TO* Hacklab, the local hackers club, learning Python.
I’ve always been too lazy to start learning it, while always being attracted by it.
If you are interested, follow the signs (courses are in Italian).
Some friends of mine have asked about the reasons for this blog name change.
It’s due to my recent frustrations about the company I work with, the quality of its developers and the vendor lock-in they suffer AND sell.
It’s a general opinion that the project I’m working on was born old. Old technologies, old tools, old libraries.
Nevertheless the architecture is quite new (the SOA thing). At the time the project was plotted, SOA was really new.
So why have they chosen to stick on old tools?
Would you use the Apollo 11 to go to Mars? Nice job with the Moon, but Mars…
Ok, this can’t be a rule of thumb, but sticking on the “Never change a winning team” mantra is just the opposite, so, to me, it’s safe to consider some middle point alternatives.
At the time I was conspiring with my coworkers, looking for ways of giving the thing some fresh air, our beloved (!?) tourism minister, Francesco Rutelli, was magnifying the italian monuments and I was thinking: “Are monuments (and pasta) the only thing we offer to the world market? Wait! I’m working with tools and libs so old that they look just like monuments!!”
So I’ve decided: no more monuments.
Technologically speaking, you can read that as “no big names” or “no corporations”.
Feasible? I’m doing it, so, yes it is. BTW, what do you expect from a penguin like me?
This Tuesday I began a new adventure: I’m technical director in the business company my sister has founded. The company relies on a software done years ago by another company, now partnering with us.
These very first days were not very happy.
First of all, I didn’t write a single line of code. Gosh, terrible!
Second, the whole app is a mix of VB6 and VB.NET, glued together in (yet another) data driven app where the (fluscking) db has MUCH more power that it deserves. It costs a lot to extend (because of the Microsoft licenses… naah really, don’t tell me!! I can’t believe that! … ) and is generally slow.
Third, the current team members are a bit aged and they probably fear a loss of control by using technologies they don’t know.
Quite hard to find a breach where I can place a Glassfish/JBoss/Tomcat instance. If you have advice about it, I’ll really appreciate.
In the meanwhile, my friends at Reply are struggling to get ready for the new demo. Even if I’m officially out until April, I’ll join them next week.
Last, this evening I’ve met Reply local boss, in order to find a way for the JUG Torino to use their meeting room. And they are happy to have the pleasure to host us: so they will, probably next month.
So, why fresh air? Well
So definitely some new things are going to happen in the next weeks/months and my “Italian Silicon Valley” dream, day by day, is getting more real.
Just a dream anyway. I’m not in a hurry: I’m having fun.
Today we host Vaclav Pech, JetBrains evangelist, that will show us the functionalities of IDEA, the famous IDE.
IDEA has always been one step ahead when talking about refactoring: it will be great to have Vaclav himself speaking to us about his product.
So: don’t miss it!
FYI: la commissione sta tirando le somme e ha messo online un form al quale gli operatori di settore possono inviare i loro commenti circa l’utilizzo di software opensource
After a long time, I finally managed to get Safari working again and steadily. Well, almost. Still something breaks here and there, but definitely usable.
So, to recap:
Enjoy!
I’ve found the Safari.exe process is not correctly terminated when you close all its windows, so you’ll have to kill it manually. Also, go immediately to youtube (you’ll find the link in the bookmarks bar) and head over to Adobe to install the flash player (or you’ll experience some ugly white boxes while surfing)
And thanks to these guys.