Bin@home — LiveJournal

Un café ?

About  

Google Reader Feb. 20th, 2007 @ 09:46 am
Is the perfect tool to be kept inform of my last writing on my new 2 blogs ! You also had this one.

It will inform you every time there is a new post, if you subscribe to the feed.
Firefox got a reader too, but the advantage of google one is that you maintain only one list of subscription !

Republique des blogs, Londres Feb. 19th, 2007 @ 10:36 am
Plus de details sur mon nouveau blog

viendez !

Moving to bloggers Feb. 15th, 2007 @ 10:09 am
General stuff
More it stuff

One of the reason is that blogger is more flexible in what you can and can't do so ...

Avenue Q Feb. 13th, 2007 @ 05:03 pm


Got some tickets for the 8th of March. it's supposed to be brillant !

France - Irlande 20-17 Feb. 12th, 2007 @ 11:04 am
Un peu sado, j'ai regarde le match dans un pub irlandais. Autant dire que je me sentais particulierement seule en deuxieme periode ...

Enfin quelle liberation a la fin du match, j'en connais qui on du essayer d'oublier a coup de Guinness :)

Prochain match :
Saturday 24th February 2007
15:00 GMT 	Scotland 	vs 	Italy 	Murrayfield
17:30 GMT 	Ireland 	vs 	England 	Croke Park
20:00 GMT 	France 	vs 	Wales 	Stade de France

Info.
Other entries
» The wee wii is coming !
I ordered a wii this week end !
a quite expensive bundle, but the only one available, and it's actually the price of a wii with 4 games which is fair.

This bundle consists of:

    * Rayman Raving Rabbids
    * Super Monkey Ball: Banana Blitz
    * The Legend of Zelda: Twilight Princess
    * WarioWare: Smooth Moves
    * Nintendo Wii Console


No idea about the games :) anyway I just bought that to play bowling :)
» Spam Spam Spamalot
Some things in life are bad
They can really make you mad
Other things just make you swear and curse.
When you're chewing on life's gristle
Don't grumble, give a whistle
And this'll help things turn out for the best...

    And...always look on the bright side of life...
    Always look on the light side of life... 

...
» My future bed


Who cares ? I do !
» London in the snow and signal failures


» I doubted my Java
I was reading The Java Specialists' Newsletter [Issue 137] about instantiating the logger.

They point at a problem that is real and I wondered how to solve that too, also I end up just accept the way we do it and forget about that.

Anyway that was not the point, when I read that I blinked :

package com.cretesoft.tjsn;

import java.util.logging.Logger;

public class CleverApplication {
  private static Logger logger = null;
  { logger = Logger.getLogger(this.getClass().getName()); }

  public static void main(String[] args) {
    try {
      logger.info("static Hello");
    } catch (NullPointerException e) {
      System.out.println(
          "failed to call Logger from static context");
    }
    CleverApplication m = new CleverApplication();
    m.run();
  }

  public void run() {
    logger.info("Hello");
  }
}
  



There are several reasons why this is a not a good idea. First off, the logger is not available from a static context. Secondly, every time a new instance is created, we make a new logger. This could be avoided if we used the lazy initialization idiom, but that would then introduce contention. Thirdly, the class name of the instance might be a subclass of CleverApplication.


Crap I thought it was a static initializer... so I did a test, and yes it is not. So was I wrong all my life ? No, I was missing some cafeine ... there is a static initializer, and that's the one I used, I never used the non static weird things (explaining the confusion, that should be in the constructor no ?) :

class Foo {
  static int i;
static {
i++;
}
}


So nothing to be afraid, just don't think to much before the cafeine kicks off.
Top of Page Powered by LiveJournal.com