Friday, May 09, 2008

Get Environment Variables in Java

In Java 1.5, to get the value of a single environment variable, you simply need to call the getEnv("environment variable") method providing the environment variable name that you want to evaluate. The following is a simple example:

String variable = System.getenv("PATH");
System.out.println(variable);

In Java 1.5, a new method was introduced to allow you to discover all of the environment variables defined in the system. The following example uses the new method to print all of the environment variables and their values:

Map variables = System.getenv();for (Map.Entry entry : variables.entrySet()){ String name = entry.getKey(); String value = entry.getValue(); System.out.println(name + "=" + value);}

That's it.

Tuesday, May 06, 2008

B'day with noble ideas

Few days back, I have attended a Birthday Party of some relative's kid. It was good being there. While coming back, they gave all the invitees a plant of "Bela". It was really nice manner to have greenery.

My daughter even do not want to spent lavishly on her B'day. She wants to distribute some fruits and chocolates to the kids/elders who do not get opportunity to celebrate their B'day. A noble idea at a very small age.

Election time

In Karnataka, election is going on. Daily some or other party's people will come for canvasing. Parties are publishing their manifesto, a set of pages with lot of promises which will never happen, or if they do happen, it will be full of business opportunities for party leader's family members.

When candidates disclose wealth of their immediate family members, why election commission do not ask for source of income. Those who have been in power for 2 years or so even (in hung assembly), becomes millionaire. How come ???
What is jini, they have ??

Amitabh Bachchan

Now a days Amitabh Bachchan's blog is a news in indian media as well as among his huge fans across the world.
Though his writings are mostly his views about certain subjects, which he could not talk publicly, But still on the other side he as a idol in many's life gives chance to his viewer's to interact with him more frequently.
His life's disciplined should be followed by his followers.