23 Jul 2008

A sense of "déjà vu"

While looking at some movies informations on imdb, I stumbled on this:


Lack of imagination or coincidence ?




22 Jul 2008

Eclipse, classpath and subversion

I always have the same problem over and over to make eclipse, the project classpath and subversion work perfectly together :(
And I'm pretty sure thousand of other guys have the same problem.

The problem is that you need to do 2 things to avoid the output dir to appears as a folder under source control:
  • add the output dir to the ignore list
  • AND
  • add an exclusion filter in the src dir to avoid eclipse to copy the .svn folder in the output dir
Example:
1- When you start a new eclipse project, you have that folder structure:





2- You add it to subversion but you don't want the output dir to be added so you just add the src folder:


3- You add the bin dir to the ignore list:


But you are not over yet! At this stage subversion doesn't complain anymore about uncommited changes in bin BUT you still have the .svn folder in bin.

This is specially anoying with tortoise svn since it displays svn icons on the bin folder.

4- Now you need to exclude the .svn from the src folder to prevent eclipse to copy them:




Does anybody knows how this can be achieve under Maven when using "mvn eclipse:eclipse" ?
I suppose one need to use the filters as describe in the pom reference...




Playing with wordle

Just a quick post to a tag soup generator: wordle
It seems I have a lot of ruby and rails tag in my del.icio.us account :D



This blog tag soup (I don't know where it picked those tags btw)



My del.icio.us account: no comment ;)

6 Jun 2008

Vimeo: Nice HD player

May be you already heard about vimeo a youtube like website, famous because of the Office Lip Dub.

I just discovered they have a HD version of there player and I have to say it's quite impressive: quality is excellent, simple to use, no extra fancy widget everywhere.

You can see it in action with this Christina Aguilera Video Live at David Letterman.

Technorati tags:

4 Jun 2008

New Job at Sqli

3 years and a half later, I'm leaving Anyware Technologies to go to SQLI still in Toulouse.

This time it's: "Thank you julien" :)

New projects, more responsabilities as a project manager, new people, cmmi level 5 quality requirements... lots of changes. But I like changes ;)

So! Let's get started!

ps: Reminds me of that road in Terminator 2 ending (at 4:40) when a new futur lies ahead ...

ps 2: For the film enthusiast(s), David Lynch made a more freaky version (at 1:25) of it in Lost Highway few years later... but I'm get out of topic here :)

29 Apr 2008

Feeling Good :)

Kt Tunstall - Hold On lyrics

I was tired of January
I was tired of June
I felt a change a-comin'
Oh, I was tired of January
Tired of June
I felt a change a-comin'
Oh, I felt a change a-comin
I felt a change a-comin
Felt a change a-comin, soon



Muse - Feeling Good Lyrics


It's a new dawn
It's a new day
It's a new life
For me
And I'm feeling good

11 Apr 2008

Blog Posts you don't want to read

Most of the time, I read my blog posts in the morning.

Every once in a while I have posts that give me a headacke just by reading the title :D


I only took the latest posts ;)
The reasons I find them funny is because:
  • They use and combine "enterprisey" buzzword
  • The title alone is so complex you need to read it twice
  • There is few chances that you'll ever have to use what they talk about because it narrows to such a limited field
  • Even if you have the courage to click on the link, you will read less than 10 words out of it
  • As soon as you'll leave the page you will forgot about it
  • When you encounter one, you know it's time for another coffee :)

ps1: It's not about a technology (microsft, java, ruby...) every community does this kind of posts ;)

ps2: InfoQ is a good source of information, I remove theserverside feed because it was getting so much worst than InfoQ in the buzzword competition ;)

18 Mar 2008

Adobe Air/Flash/Flex Redux

Looking and playing a bit with Adobe AIR is on my Todo list for a few months now but I wasn't getting the "big picture".
Just found this "technomap" in an Adobe devnet article: "Adobe technology platform ActionScript reference for RIA development", it helps a little :)

There is also a pdf with what seems to be methods references...





Technorati tags:

3 Mar 2008

Cedric Beust on TDD

Disclaimer: If you've never done TDD you shouldn't watch this ;)
Why ? Because I think you can't understand those arguments until you have already experienced it.
Don't say "I won't do TDD because Cedric said so!" Try it for 2-3 months and then watch the talk...

For those who have already done TDD (Test Driven Development), Cedric Beust (From TestNG) gives an interesting, balanced talk about TDD (starts at 33 min).

Some of TDD drawbacks according to Cedric (extracted from one of the slides):
  • Promotes micro-design over macro-design
  • Hard to apply in pratice
  • No clear evidence that it produces better designs than "tests last"

The talk is actually much more balanced (and in favor of TDD) than this except my suggest... You should really take a look at it.



Technorati tags:

12 Feb 2008

A better way to use Java Enum than switch

I think java enum are a nice addition to the language. I used to combine them with switch/case statements. But lately François, a colleague, shown we a better way :)

You can embedded behavior in each enumeration case, reducing client code and making it more elegant :)

Let's take a simple example: Every day of the week you need to do something: take out the garbage, go to the laundry etc. ...

Using switch here's how I would have done it:
    private enum Week {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}

public static void main(String[] args) {
final Week today = getToday();
Action action;
switch (today) {
case Sunday:
action = new FamillyDiner();
break;
case Monday:
case Friday:
action = new Garbage();
break;
case Tuesday:
action = new Laundry();
break;
case Wednesday:
action = new ChillOut();
break;
case Thursday:
action = new Grocery();
break;
case Saturday:
action = new SoccerGame();
break;
default:
throw new RuntimeException("Impossible day!");
}
action.execute();
}

Conclusion:
  • You can see the number of lines in main() is quite important
  • The client code (the switch/case code) is likely to be duplicate
  • There is an unnecessary case "default" that can never happen (even null case would result in a NullPointerException in the switch)
  • But it still much better than a if/elseif/else using int

Adding behavior to the enum:
    private enum Week {
Sunday {
@Override
public void execute() {
System.out.println("Mom and Dad diner.");
}
}, Monday {
@Override
public void execute() {
System.out.println("Take the garbage out.");
}
}, Tuesday {
@Override
public void execute() {
System.out.println("Do the laundry.");
}
}, Wednesday {
@Override
public void execute() {
System.out.println("Have a beer. Just Chill out!");
}
}, Thursday {
@Override
public void execute() {
System.out.println("Go out to the local store for Grocery with shoping list.");
}
}, Friday {
@Override
public void execute() {
System.out.println("Take the garbage out.");
}
}, Saturday {
@Override
public void execute() {
System.out.println("Manchester vs Arsenal! Can't miss that!");
}
};

public abstract void execute();
}

public static void main(String[] args) {
final Week today = getToday();
today.execute();
}

Conclusion:
  • Less lines of code and still readable
  • main() code is soooo easy
  • No unnecessary case "default"
  • If you don't want this behavior and still use the enum you are free to use the switch/case way


Clearly I think this approach is far better and much more elegant unless someone show me otherwise...



Download the complete code sample.