Here's some footage from inside a tornado.
http://www.youtube.com/watch?v=3Qu9wR03GVA&fmt=22
That's an amazing clip.
Tuesday, July 21, 2009
I'm a sucker for a good tornado video
Del.icio.us Add to del.icio.us
Digg DiggIt!
Reddit Reddit
Stumbleupon Stumble This
Google Bookmarks Add to Google Bookmarks
Yahoo My Web Add to Yahoo MyWeb
Technorati Add to Technorati Faves
Slashdot Slashdot it
Thursday, July 16, 2009
Java Double Brace Initialization
refactory.com lists UI class instantiation as an application for double bracing. It's been ages since I've used Swing for anything, but I remember anonymous inner classes were very helpful for making tweaks to the Swing classes.
For a brief example consider the following Foo.java.
Foo foo = new Foo() {
{
// static initialization block
this.setBar(100);
}
// overridden and new methods
public void setBar(int bar) {
if (bar < 0 || bar >100) {
// ignore input that is out of range
return;
}
this.bar = bar;
}
};
Double bracing can be very helpful for writing test code. The static initialization block can set up an object in a state that is relevant to the test and the relevant methods of the class can be overridden to support the test.
Del.icio.us Add to del.icio.us
Digg DiggIt!
Reddit Reddit
Stumbleupon Stumble This
Google Bookmarks Add to Google Bookmarks
Yahoo My Web Add to Yahoo MyWeb
Technorati Add to Technorati Faves
Slashdot Slashdot it
Labels:
java,
java tip,
refactory.com,
testing
Subscribe to:
Posts (Atom)