Recent Entries:

Favorite Links

Springframework 3.0.0 M3 build and maven 2 repo

May 26th, 2009

I built the latest version of spring 3.0 and deployed in my maven repo.

Feel free to use it but don’t make assumptions that it will be online in any future


Disable Skype’s mood message chat

April 26th, 2009

It was driving me nuts!! After installing the latest 2.8 beta for mac I was getting one of those red notifications every time any of my contacts was changing his mood message.

Luckily you can disable it in the Preferences->Advanced->Enable Mood Message Chat.

Tags: | Posted in General | Leave a Comment »

Why debuggers are bad

April 21st, 2009

Debuggers are useful

  • They make you run an application and inspect variables while you a running the real thing
  • They make you debug code and quickly find bugs

You set a breakpoint somewhere, you run your application, it stops where you want and let you inspect variables and more.

Debuggers are bad

  • They make you debug code instead of writing unit tests
  • They make you debug code instead of writing proper log statements

Conclusion: Debuggers are good when you search for bugs and not as a development practice

Log statements are there forever and let you for instance trace code in a production environment where a debugger is usually not available.

Unit tests are there forever and let you run the same tests that you run in your debugger on and on.

Again: Debuggers are useful but don’t abuse them.


Respect for JavaScript

April 7th, 2009

Surfing around I found this cool video of Doug Crockford, the man behind JSLint and JSON. He surely is a funny guy


Internet Explorer 6 is still there….

April 4th, 2009

Tonight I was looking at my blogs awstats and realized that IE6 is still the most used browser (at least in Windows).
Given the fact that my blog is quite technical and my readers have a tendency to use open source software as Firefox, this is pretty scary!!!

Internet Explorer 6 is bad and full of bugs! It makes us programmers to do a lot of unnecessary work to make pages look nice.

Please download firefox….

Msie 7.0 No 11703 12.7 %
Msie 6.0 No 13168 14.3 %
Firefox 3.0.8 No 3450 3.7 %
Firefox 3.0.7 No 7044 7.6 %
Firefox 3.0.6 No 9078 9.8 %
Firefox 3.0.5 No 10922 11.8 %
Tags: , | Posted in General | Leave a Comment »

REST and validation errors

April 2nd, 2009

REST advocates to use HTTP for CRUD fully exploiting the verbs defined in the protocol specification:

POST to Create
GET to Read
PUT to Update
DELETE to Delete

Nothing strange about that. But how do we handle server-side data validation ?

Server-side validation cannot be replaced by client-side but it complements it. Client-side we can f.i. verify if an E-mail address is compliant with the SMTP rules but we cannot verify if the address is already registered in our database.

HTTP provides the error codes 4xx to indicate that something has happened:

400 Bad Request
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

and specifically:

409 Conflict
The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough information for the user to recognize the source of the conflict.

But how do we include enough information?

Inspired by the error validation model used in Spring MVC (Errors) I suggest that together with the 409 the server includes a response that may look like the following (assuming we are using xml):

Since the client can hold a reference to the object used for the POST/PUT operation, we may not need to include the invalid model in the response. The client should be able to show to the user an appropriate form with the validation errors.

Of course the errors tag could be extended to include more information to handle all the different cases but I thing that the idea is right (again, take a look at the Errors class in Spring MVC for an example of how to handle all kind of validation errors)


OnTheFly

March 19th, 2009

I Just published on github a tool to concatenate JavaScript and CSS files on the fly to speed up the development process when using large code base. Check the project page


Maven: The Definitive Guide

January 28th, 2009

I have been looking for you for ages.
I wanted to know all of your secrets, not just guess them from the POM reference or from the maven official documentation, which is very poor in same cases.
Where have you been?
Finally I found you, Maven Definitive Guide!

Tags: , | Posted in General | Leave a Comment »

www.södraitalien.se

January 22nd, 2009

www.södraitalien.se and www.sodraitalien.se are now registered and redirected to www.basilicata.se


Corsair memory upgrade for ReadyNas NV+

January 21st, 2009

Memory moduleI just got my Corsair Value Select  1GB DDR1 400Mhz PC3200 (VS1GSDS400/EU) memory module and installed on my ReadyNas NV+. I’ve run the memory test twice and it works like a charm.

Unfortunately my SqueezeCenter is not much faster…, but this is an other story :-(


Next Page »