Friday, August 29, 2008

Java Timer and TimerTask

From java2s.com

"import java.util.Timer;
import java.util.TimerTask;

class MyTimerTask extends TimerTask {
public void run() {
System.out.println("Timer task executed.");
}
}

public class MainClass {
public static void main(String args[]) {
MyTimerTask myTask = new MyTimerTask();
Timer myTimer = new Timer();

/*
* Set an initial delay of 1 second, then repeat every half second.
*/
myTimer.schedule(myTask, 1000, 500);

try {
Thread.sleep(5000);
} catch (InterruptedException exc) {
}

myTimer.cancel();
}
}"

Saturday, August 23, 2008

Olympics Mania!

Recently stumbled upon this article on USATF site

Performance and Responsibility

Key points which i really liked about this article

"The Olympics are about good timing, good luck, good preparation and good execution. All those things have to come together"

"Dropping a baton isn't bad luck, it's bad execution."

"When the men's marathon concludes on Sunday, we'll still be the World's #1 Team in terms of medal count. We can be a much better team. And we will be."

It's goals like these which can make things happen. I think perhaps the most disheartening part of olympics for me was looking at lolo jones crying after she lost, considering that she was winning all the way to hit the penultimate hurdle not sure whether to call that bad luck or bad preparation and I am almost sure it is bad luck.