BibleGateway.com Verse Of The Day

Showing posts with label rants. Show all posts
Showing posts with label rants. Show all posts

Thursday, February 22, 2007

2007 DST Issues And Java

This daylight savings time (DST) issue is a pain in my buttI didn't need right now. We still have legacy applications running on JRE 1.2.2, and since it is Silverstream 3.5, changing anything out from under will destroy the world and it will not run right, if at all.

Links to Sun's FAQ is at http://java.sun.com/developer/technicalArticles/Intl/USDST_Faq.html
Of notable interest here is this little tidbit of crap:
  1. Do my operating system's timezone patches fix the Java platform's timezone data?
    • No. The Java SE platform's timezone data is not read from the local or host operating system.
    • The Java SE platform maintains a private repository of timezone data in locally installed files (.../jre/lib/zi) as part of the Java Runtime Environement (JRE) software.
      • Applying whatever operating system timezone patches (for example Solaris OS, Linux, Windows) will have no effect on the accuracy of the Java SE platform's timezone data.

Well isn't that lovely? Java doesn't rely on the underlying OS to get timezone info. I'm sure there's a "good" reason, but it seems like pointless redundancy to me. Why set it up on the OS if the JVM doesn't use it? Sure there is probably some backward OS that has no concept of timezones, so Java abstracts everything to a point of uselessness just like Swing UI's.

If installing or updating new JRE is not an option (say, in production where the app server and all the apps haven't been tested on newer JRE's) The JRE updater tool is found at http://java.sun.com/developer/technicalArticles/Intl/USDST_Faq.html -- not sure how reliable ot stable that thing is, but we'll find out in our dev and test environments soon enough.

There is a brief discussion on the Jboss forums at http://jboss.org/index.html?module=bb&op=viewtopic&t=98682 as well. Or for Websphere http://www-1.ibm.com/support/docview.wss?rs=180&context=SSEQTP&dc=D600&uid=swg21219396#actions.

Tuesday, December 05, 2006

A Few Unix Shell Tricks

If you want to set a value in a shell script, but only if it isn't already set (e.g. set a default value but let it be overridden), try this. The following command will set PROJECT to be mqbridge, unless PROJECT is already set. In that case, the current value overrides. I have used this trick in ksh and bash. Not sure what other shells it works in.

export PROJECT=${PROJECT:-"mqbridge"}

Redirecting stderr to stdout: If you are trying to capture output of a command into a file, you will notice the regular output goes into the file, but errors go directly to the screen instead. If you want to capture both, use shell redirection like this (2>&1) after your command.

For example, to have all output go to the screen and to a file, you can do something like this:

    run.sh 2>&1 | tee output.log