Monday, March 12, 2007

Dumping environment variables

If you ever wanted to know what your "accessible" environment variables are at run time, put the code snippet below anywhere within your code execution path and print either to your log or System.out.

StringBuffer sb = new StringBuffer();
sb.append("Environment vars: ---------------------------------------\n");
Properties props = System.getProperties();
if(props != null && props.size() > 0) {
Enumeration enum = props.keys();
String key = null;
while(enum.hasMoreElements()) {
key = (String)enum.nextElement();
sb.append(key + ": " + props.getProperty(key) + "\n");
}
}
sb.append("\nEnvironment vars: ---------------------------------------\n");
//System.out.println(sb.toString());
logger.info(sb.toString());

Friday, March 09, 2007

DST Changes - Wake up an hour early this Sunday, March 11.

In case anyone is still not aware.

There is a DST (Daylight Saving Time) change implemented starting 2007. Normally we "Spring forward" on the first Sunday of April, and "Fall back" last Sunday of October. Well, thanks to Congress we now get to wake up one hour earlier starting *this* coming Sunday March 11 instead of in three weeks and get an hour extra sleep first Sunday of November instead of last Sunday of October.

Yep, your computer scheduling is going to get messed up unless you update your Windows. Same thing with your phone if it has scheduling capabilities.

Bottom line, add one hour on your watches and clocks this coming Sunday. Officially 2am will be 3am, but do it whenever you want before you go to bed Saturday night. Or else your Sunday appointment (if you have any) will get messed up.

For more info: http://www.timeanddate.com/time/aboutdst.html