Friday, January 27, 2006 8:40 AM | rahel luethy | 0 comment(s)

professionalism

when we arrived at the frauenspital around 6 pm on filipa's birthday-to-be, a midwife performed some kind of entrance check-up. among other things, she put both her hands on my belly and said: "3 kilo 200 gramm". we were extremely impressed and somehow angry with my gynecologist, who had never dared to say anything about baby weight over the whole 39 weeks of pregnancy.

filipa weighed 2650g.

3200g is the median weight for baby girls and the midwife's chances for being so wrong were only 10%. a fairly acceptable risk, considering how stunned we were by her (temporary) professionalism.

Thursday, January 19, 2006 2:11 PM | rahel luethy | 0 comment(s)

1$ per pixel

some people just have better ideas than others:

this guy is selling 1'000'000 pixels on his website for 1$ each to pay for his degree studies. sold out!

Tuesday, January 10, 2006 9:51 AM | rahel luethy | 11 comment(s)

the most wonderful thing ever

about 33h ago, our daughter filipa lil was born

filipa

january 8th, 11.43 pm, 2650g, 48cm wir sind uebergluecklich!

Wednesday, January 04, 2006 3:46 PM | rahel luethy | 4 comment(s)

inline refactoring trick

consider the following scenario: you have a class Foo which offers a non-static method getFoo():

public class Foo {
 
 public String getFoo() {
  return "foo";
 }

}

you're wearing the refactoring hat and have decided to change the method to be static. of course you could just add a static modifier and fix all compile errors, but let's assume that your method is used a gazillion times in your project, so this is not really an option...

tada! here comes the inline refactoring trick (I haven't invented it, but somehow I can't find the original article anymore):

  1. perform a rename method refactoring and change getFoo() to getBar():
    public class Foo {
     
     public String getBar() {
      return "foo";
     }
    
    }
    
  2. duplicate the method, rename one of the duplicates back to getFoo(), and add the static modifier to the one still called getBar():
    public class Foo {
     
     public String getFoo() {
      return "foo";
     }
    
     public static String getBar() {
      return "foo";
     }
    
    }
    
  3. replace the complete contents of getFoo() with a static call to getBar():
    public class Foo {
     
     public String getFoo() {
      return Foo.getBar();
     }
     
     public static String getBar() {
      return "foo";
     }
    
    }
    
  4. here comes the magic: perform an inline refactoring on the getFoo() method, which will change all former callers of getFoo() to now invoke Foo.getBar()
  5. rename getBar() back to getFoo()
  6. take off that STUPID HAT
note that the same magic works for more complicated scenarios, like refactoring a class with static methods into a singleton.

Monday, January 02, 2006 7:02 PM | rahel luethy | 3 comment(s)

new year, new look

I've been fiddling around with new fonts, flickrj, and photoshop over christmas. moreover, the contents are now available as rss, which will render a lot nicer in thunderbird — enjoy!