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.
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
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"
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"
Labels:
Java,
Programing
Subscribe to:
Posts (Atom)
Popular Posts
-
I recently had to come with this data-structure, later I found that google collections has a MapMaker which essentially does the same. Post...
-
This is the way I like to handle events. Note the ease with which the MessageSenders and MessageListeners can be "weaved" using ao...
-
There are times when we face the need to marshall and unmarshall java objects. What better than XML for this! Most programmers can write the...
-
Bananas for the code monkey It is always a good idea to prevent users from doing unwarranted things. Thats the whole idea of client side val...
-
Event bus is a rather simple notion, that is of great aid. Think of a telephone network; to communicate between two ends, one would require ...
Labels
- Programing (13)
- monologues (8)
- Java (7)
- experiences (7)
- ideas (2)
- java script (2)
- CSS (1)
- GXT (1)
- My First Post (1)
- Politics (1)
- movies (1)
About Me
- Swaroop
- 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.