Monday, July 21, 2008

Remove duplicates from a List


Set set = new HashSet();
set.addAll(list);

// avoid overhead :D
if(set.size() < list.size()) {
list.clear();
list.addAll(set);
}

Friday, July 11, 2008

Create New Eclipse Workspace - With All Your Old Settings

If you want to create a new eclipse workspace and preserve all your settings,
simply copy the .metadata/.plugins/org.eclipse.core.runtime/.settings directory into your new workspace directory.
Here is a detaliled article Create New Eclipse Workspace - With All Your Old Settings

Tuesday, July 8, 2008

Celebrity

A celebrity is someone who works hard all his/her life to become known and then wears dark glasses to avoid being recognised

Ideal Marriage

Adam and Eve had an ideal marriage. He didn't have to hear about all the men she could have married, and she didn't have to hear about the way his mother cooked.

Courtesy : Teja

Thursday, July 3, 2008

Yesterday, Today and Tomorrow

Yesterday today was tomorrow yet tomorrow today will be yesterday

Courtesy : Teja

Wednesday, July 2, 2008

Find the path of class being loaded


java.net.URL codeBase = (Class).getClass().getProtectionDomain().getCodeSource().getLocation();
System.out.println(codeBase.getPath());

Change Environment Variable from command line

This says how to change environment variable from command line.
Permanent changes to Environment variables

Gist of the article :

1. Install Windows XP Service Pack 2 Support Tools
2. Use setx.exe