Thursday, August 27, 2009

Builds and Clearcase...

Builds so far have been the biggest pain point --

Restore resouce...

The component that i am part of has multiple modules and i am responsible for coding for only one of the modules. When i do a build of the whole system, it builds all the modules and if one of the modules has problem the build fails. When one of the other modules was creating problem i deleted from my local system and commented those modules in pom.xml..... I forgot about it completely.

About 15 days later when i wanted to build the whole component i took an update of the code using clearcase remote client and then i tried building the code. But build was failing.... !!!

I was not able to figure out the issue for a long time.. but the solution was very simple -- My deleting the other modules code from local machine created discordance between the clearcase view and the clearcase webserver - I had to do a restore resource option in clearcase to clear the discordance. I was aware of such an option, but it either did not occur to me immediately or this is the first instance when i actually used it.

when I built now the build was successful....

more about restore @ https://publib.boulder.ibm.com/infocenter/cchelp/v7r1m0/index.jsp?topic=/com.ibm.rational.clearcase.ccrc.help.doc/topics/u_restore.htm

Thursday, August 20, 2009

Some interesting Stuff ( Ideas !!! )

1. Below listed is a product for indian agricultural market - a product that allows farmers to remotely switch off or on the power supply of motors and also helps them in monitoring motors - this has great application in rural india and the farmers need not walk long distances every day --

http://www.nanoganesh.com/html/Index.html

2. g-speak and g-stalk - check them out @ http ://oblong.com/article/08mMyyzpYMm7kFtv.html

3. Interesting east (vs) west comparison - http://www.slideshare.net/Robertc1970/east-vs-west-162816 - Also check out the poster section under http://www.yangliudesign.com/ and look at discover asia poster :-) Interesting !!

4. Common Sense Rules !!! - Fundooooooooooo idea - an idea that has a lot of application in all the rural places - http://www.qdrum.co.za/

5. Green Innovation - http://news.bbc.co.uk/2/hi/technology/7795492.stm

6. Quickies - http://www.pranavmistry.com/projects/quickies/

7. Gestural interface - look @ http://www.pranavmistry.com/projects/ and look for the six sense project.

More to be added to this list.....

Linux Commands & Related

How to find the command that started a process......

It's easy stuff (again). This was the first thing i tried in the morning - I got up, logged in to my comp, started putty and tried quite a few options to figure out how to do it -- googled it out too --

Example : lets say if i ran a command like "service testservice start" in linux and it started a java process. If i do a ps -ef in the command line it gives me all the java processes running in the system. Now given the pids of these processes is there a way for me to figure out what was which of the pids correspond to "service testservice start" --

well, i tried the following first :

ps -ww -fp
ps -o "%u : %U : %p : %a"
cat /proc/pid/cmdline
ps -aux

but none of them provided the actual solution -- looks like pargs in solaris gives the command directly - but how does it happen in linux ? I got this solution from a friend.

run ps -ef command - it gives the process id and also gives the parent id of the process - now run a "ps ppid" where ppid corresponds to the parent pid - that gives the solution to the problem.

This was to figure out a command that was starting a tomcat process - there are quite a few eurekas about tomcat itself .. will consolidate and put them up, hopefully :)
How to know who all are connected to linux machine and what they are doing :

Is there a way to find out who all are logged into the machine and what they are doing ?? If you are working on a machine that is shared by multiple people and want to know who all are using right now and what they are doing - is there a way ?

w command in linux provides the information. ( http://linux.about.com/library/cmd/blcmdl1_w.htm) Also wall command can be used to send a broadcast message.

List of installed rpm's :a couple of days back i was trying to find the command that provides the list of rpm's installed on a linux box - if you have yum repository in the machine, then the way to do it is : yum list installed would do the job for you.

rpm -qa provides all the information about the rpm's but does not provide the versioning information explicitly - i was looking for version information explicitly - with some help figured out that this is the way it works :

rpm -qa --queryformat "%-30{NAME} %10{DISTRIBUTION} %10{VERSION}\n"

Using netcat and tar for network file transfer

some easy file transfer

http://www.screenage.de/blog/2007/12/30/using-netcat-and-tar-for-network-file-transfer/


HashMap & Arbitary number of arguments in java...

It's simple stuff - HashMap

let's say there is a hashmap of strings in java and given a key you want to retrieve the corresponding value - i thought one could do it just by passing the string -- No it does not work that way -

since the get method takes only an object as a parameter - so typically the way to do would be to get all the keys from the hashmap and the iterate over the keys to get the corresponding values --

Arbitary Number of Arguments in Java

I saw a method with the following signature today - public List getXYZ(String... categories) - was wondering what String... means - it can be used to pass arbitary number of arguments in java - here is the explanation....

http://java.sun.com/docs/books/tutorial/java/javaOO/arguments.html