Archive for October, 2009

31
Oct
09

halp retarded kitty


Hilarious:
lolcats funny cat pictures

Advertisements
31
Oct
09

endurance boost


Last training, I was able to last about 10 minutes. Now I managed 13:10. Big improvement.

27
Oct
09

another song from the 90’s


Remember this one?

21
Oct
09

tabata clock


If you know your workouts, you definitely heard of Tabata intervals. Here’s a website that can help you time it.
When you reach the 5th or 6th round you’ll see what you’re made of!

Good luck!

20
Oct
09

adding methods to singular objects in groovy


In both Python and Ruby you can add methods just to an object ( instead of all instances of a class ). The great thing is, you can do the same in Groovy. Here’s how :


def a = new File(".")
a.metaClass.bla = {
    println File.separator;
}
a.bla() // this will print \ or / , depending on your operating system

bla isn’t a suggestive name, I’m sure you agree. But, this illustrates the point. If for example, you instantiate a second object, and try to call the same method on it, like in the following example:


def b = new File("..")
b.bla() // this will throw a MissingMethodException

You can notice that the second object does not share the bla method.

I’m sure you guys can put this to good use !

19
Oct
09

hundred pushups challenge


I started the 100 pushups challenge 2 weeks ago. I haven’t really been following the schedule. I’ve done pushups maybe twice a week ( once according to the training plan, and once to test the maximum number of pushups I can do ). That being said, I’m pretty proud of being able to do 50 pushups in a row. 50 more left to go!

19
Oct
09

a way to reimplement the with statement in groovy


class G
{
   def nwith(closure) {
       closure.delegate = this
       closure()   
   }
   
   def test_print()
   {
       println "whatever"
   }
}

a = new G()
a.nwith {
    test_print()
}

I named my “with” statement “nwith”. The thing is, you need to set who the closure delegates to, and then call it. From there on, all the statements written execute in the context of that object.




Blog Stats

  • 226,733 hits