Open source reader

Friday, June 09, 2006

IP <--> Latitude/Longitude

I was wondering how you could get the IP - latitude/longitude couple for geolocalisation.
I was not aware of the maxmind database, you can check out the demo here ...
Unfortunately is not free (retrieving the country is free), do you know any free IP location database ?

A *great* Ruby on Rails flash presentation ! (pdf available too)

An amazing presentation of Ruby on Rails from Olivier Gutknecht !
You'll find the flash presentation here and the pdf version here.
Let's all ask for an english version ! His contact is "ol+ror @" ...
(Yes I read french... and ready to help him translate his document)

Features, Tasks and Defeats

John Kern has a post called Just what is a feature? that summarizes what are features, tasks and defeats.
Here is an excerpt about what tasks are:
  • Things we get don't paid for, but have to do.
  • Do it once and forget about it.
  • Takes someone time to do.
  • You don't want to forget about it.
  • Generally not a "reopened" issue.

Happy reading !

Car mechanics *are treated better* than java developpers !

John kern has great funny post about our job... I recommend it !
Here is an excerpt
Here's an idea for you to try next time you are at the car mechanic.

Hello. Yes, I would like the following done for my car:
  • I would like the brake rotors and pads replaced
  • My new low-profile tires mounted on the rims i brought
  • And I want you to troubleshoot the electronic map used by the twin turbos for boost pressure versus exhaust gas temperature at altitude
  • All-wheel drive balance
  • An inspection
I let you read the funny remaining on his post called Next time you are at the car mechanic.
Happy reading !

*simple* date API

Here's what I found for handling dates: joda time. It is worth the time to digg into...
Here is what you could do with :
public boolean isRentalOverdue(DateTime datetimeRented) {
Period rentalPeriod = Period.days(2);
public boolean isJoinedInLastThreeMonths(DateTime datetimeJoined) {
Interval last3Months = new Interval(Period.months(3), new DateTime());
return last3Months.contains(datetimeJoined);
public String getBirthMonthText(YearMonthDay dateOfBirth) {
return dateOfBirth.monthOfYear().getAsText(Locale.ENGLISH);
You'll find a quick user guide and a full user guide ...
Happy reading !

Thursday, June 08, 2006

a *mini* working scheduler in 4 lines !

I learn every day something new ... Here is a mini quartz in a few lines of code using TimerTask

int delay = 5000; // delay for 5 sec.
int interval = 1000; // iterate every sec.
Timer timer = new Timer();

timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
// Task here ...
}, delay, interval);

Thanks javatips !

*easy* integration of a javascript online spell checker

Just found this link using GNU Aspell hey, that's pretty neat, you'll find an online demo here ...
It may be usefull for lots of projects ... the integration is pretty easy, look at this javascript:
var text1 = document.form1.text1;
var textarea1 = document.form1.textarea1;

var speller = new spellChecker( text1, textarea1 );

Yes, it is that easy, and you're done.

Tuesday, June 06, 2006

*Yes* PHP developers can laugh at Java developers (+ stupid rant)...

Last week I was fooling around with php projects like sugarcrm, gallery, wordpress, pligg etc
The installation of these projects went smoothely, the applications delivered the promised functionnalities: all in all they do work well !
I went into their respective source codes, and I have to admit that I am quite impressed by the guys responsible these applications !
God, it is such a mess !

Well you know what it is ... with PHP ... It is so easy to fall in the spaghetti trap.

Now back to the java world, read this post Java call stack - from HTTP upto JDBC as a picture and god what a huge overhead ! There's so much abstractions !
While PHP guys are going straight to the points, we go by abstractions...
While we are still configuring our XML, they have working prototypes and laugh at us ... good for them ! :)

But you know what ? I am happy to support the overhead/patterns java imposes/recommends to developpers !

And most important : I am sure most java developers would be able to take over my java code easily, I would be in deap trouble to support on of these PHP projects !

I really believe that you should be confident/happy to add functionnalities in existing code base.
If you're in an ugly mess, you won't be confident, you'll make bugs, you won't be happy, you will not want to go to work, you'll be depressed, you'll be fired, you'll loose your girlfriend, you'll be homeless :) ...
At this point, you'll have time to read java books, and get back to real business ! :):):):):):)

Enough nonsense, Ok back to work for me :)

Want to *secure* your web applications ? mod_security may be a good option !

I just heard about this project, you may find it very usefull, some more infos at "modsecurity".
Here is an excerpt:
ModSecurityTM is an open source intrusion detection and prevention engine for web applications (or a web application firewall). Operating as an Apache Web server module or standalone, the purpose of ModSecurity is to increase web application security, protecting web applications from known and unknown attacks.
Happy reading !

A *simple* POJO aspect example in Spring 2.0:

You'll read it at "POJO Aspects in Spring 2.0: A Simple Example" lots of code, but please use AOP wisely, cf "When to use AOP ? For things your system can live without !"
Happy reading !

Getting Started With JPA in Spring 2.0.

Read an entry about JPA at "Getting Started With JPA in Spring 2.0" here is what you'll read with plenty of code
  • Initial Setup
  • Code - Domain Model
  • Code - Data Access Layer
  • The Service Layer
  • Configuration
  • Integration Testing
  • Further Reading

  • Happy reading !

    What an impressive speedup !

    I read this post about the merge of Abdera and Rome called Apache Abdera and ROME: alea jacta est!
    Here is what you'll read:
    Early on in our development, we ran some comparisons between the Abdera and ROME parsers and noted a significant difference. When parsing Tim Bray's Atom feed, for instance, Rome's JDOM implementation consumed over 6.5 MB of RAM and used over 600+ million CPU cycles. Abdera's Axiom/StAX based implementation used around 750k of RAM and around 90 million cycles.
    That make two nice numbers:
    • 8 times less memory consumption
    • for 6 time the speed !
    How long did it take to accept the Abdera merge proposal ? :)