Reality is a perception. Perceptions are not always based on facts, and are strongly influenced by illusions. Inquisitiveness is hence indispensable

Sunday, May 27, 2007

Indian politricks

INDIA: a land of many faces, facets, facts and fantasies. Indian ness is something very mythical. Is it lack of individualism or servitude to collectivism? The very nature of being related to India raises questions in my mind. India is not a perfect nation, No nation in the world is.

Indian politics are one (ugly) aspect that can give an understanding of how the nation thrives. Now whenever a government changes/ about to change. We see the following patterns. The time lines are drawn for upcoming elections. There is an incumbent govt. and some opposition parties. This is extreme simplification; we are ignoring internal boardroom disagreements & other issues. So the incumbent govt. starts its' campaign with bombastic antiques. They rope in movie stars, popular personas, and offer soaps. Why do they do that? Are they so scared? Scared of loosing power? Now this also involves buying advt. slots on prime time.

Here there is some sort of moderation provided by constitution in terms of Election Commission. These guys are the real heroes of democracy. They literally act like old school headmasters with a rod in their hand. They are the ones who resort sanity to the other wise completely one-sided bout.

What happens at the end of the day? Mostly the underrated opposition wins! Reason: The people know better. Now the party that wins resorts to some changes. They start appointing buerocrates who have their favor, in niche positions. The merit and past achievements are ignored. They also resort to reversing decisions made by last govt.

This may not sound ugly. But the next aspect is really ugly. The issues highlighted during campaign to power are brought into limelight. These include earlier govts. policies that were strongly criticized too. Now after a months time. These are put on backburner. One would find no difference in the attitude towards public after a year or so. The headlines also sound familiar only the names and pictures keep changing.

Wednesday, May 23, 2007

Paving Path to ClassPath and Packaging

Last fortnight vineela posed a question. Sounded silly in the first go but later found it to be not so silly. She was trying to compile java files from command prompt. Guess what happened. A disaster! Now she is not a run of the mill kind. Only issue was that she was born and brought up in the world of user-friendly IDEs. She never worked with the age old tools "javac" and java. Why should she? When was the last time I used javac? Let me guess, it is nearly four years.


There were three problems she was facing, packing the sources, compiling and running. The next step of packing the sources into directories sounds easy. What about classes? As per the practice, they also need to mimic the file structure. We need to duplicate the directory structure. What about running the app? Run it from the top-level package. Wait... Wait... why are we hurrying? Take a break and breath-in... & out... repeat it 3 times (use for loop!!)


Some references before we start.

http://java.sun.com/docs/books/tutorial/java/package/QandE/packages-answers.html http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html http://www.cs.wisc.edu/~hasti/cs368/JavaTutorial/NOTES/Packages.html



Simple Example:


Assuming we know how packages are formed we shall go ahead.

Have a directory called C:\Workarea. Now create three folders called "src", "classes". Under "src" create your package structure.

My source files are: myblog.master.Lord.java, myblog.servant.Gini.java.


There is a correlation between and packages and directory structure.

Under C:\Workarea\src create 3 directories

1.) myblog, 2.) mblog\master, 3.)myblog\servant.


Create the same structure under C:\Workarea\classes. We need to copy java sources to src directory location.

Now copy Lord.java to master and Gini.java to the servant directories. Now come to top directory i.e. C:\Workarea.


Under windows run these commands "dir /s /b *.java > a.txt" and then "javac -sourcepath src -classpath . -d classes @a.txt"

javac essentially takes parameters describing the source location, classpath info and destination where classes are to be saved. @a.txt is the file that contains the locations of .java source files


Bingo...


To run the app from C:\Workarea call "java mainclass"

Popular Posts

Labels

About Me

Well for a start, I dont' want to!. Yes I am reclusive, no I am not secretive; Candid? Yes; Aspergers? No :). My friends call me an enthusiast, my boss calls me purist, I call myself an explorer, to summarise; just an inquisitive child who didnt'learn to take things for granted. For the sake of living, I work as a S/W engineer. If you dont' know what it means, turn back right now.