26 April 2009

Saga of Entrepreneurship

Some fifty years back, the organization wanted their people to obey their orders, they want their employees to think but not to outthink their bosses. They typically did not like if the questions were asked and they liked to get only answers and most importantly the answers that are liked by them. When the world economy is in recession and more Gen Y get into the organizations, these leaders are overwhelmed by the number of questions asked at them and the people seem to be "egoistic". Few years from now, there will a substantial change in the way we work. Even today, the way we work is changing - the concept of "managers" is slowly replaced by the concept of "entrepreneurship". The organization no longer like to have managers who can only do "managing stuff". They like to have people who can take risk, who go an extra mile simply to explore and interested in the learning.

When you are a manager, you will think within a boundary but when you are entrepreneur you think without a boundary and your boundary is the horizon. The organizations have become risk appetite in terms of investment and returns. Now, they are trying to change their employees' thought process and attitude. The word "work" is often replaced by the word "business". I believe, the word "entrepreneur" nowadays not only applies to people who start their own venture but also to people who work for organization and take risks. The word is not used in its real meaning but as quality or way of doing something.

So, moving forward, we will be seeing more of entrepreneurial spirits in the organization and I believe that will innovation in management or next level in management evolution.

Human Brain - Reversed

I worked in Network security and the interest towards security led me to read about application security and reverse engineering. Reading reverse engineering is exciting and reversing a software is a great experience. Reversing a software is no means a small thing but even multiple times harder is to reverse a complex system - the brain simply because "software" is created by man but "brain" is not created by man (though human is responsible for creating a race, no one yet has created a fully functional brain and it is nearly impossible). The brain, weighing roughly three pounds has a lot of mystery. The scientists are trying to figure out the potential of brain and most important try to reverse the brain.

At one side, the biologists are trying to study brain as neural circuitry and another front scientists are also studying brain to improve relationship, leadership and emotional intelligence. The study of brain will help us to understand how the brain works and most importantly how the brain learns. This will help us to properly educate the kids and grown ups. I believe the study of human brain and understanding it will be more challenging and rewarding as well. John Medina, in his book, Brain Rules, says that the human beings are smarter rather than being stronger and the history of human evolution also proves that we are smarter and hence study of human brain is very important and it can lead us to next level in human evolution.

23 April 2009

Survive in Hard Time - Connect with your people

Assume the following scenario in 22-Apr-2009. "We are now in tough times and this is the right time for us to optimize and so we are going with cost cutting. We cannot afford to be complacent and we will emerge strong post recession. The time we invest, the strategy we chalk out and its execution will decide whether we will emerge stronger". Just fast forward your time machine. Can you guess what they will say once they economy recovers (and if they exist).

You are in 22-Apr-2012 and again you hear the same voice. "We emerged strong, we did something which is innovative and it made us to be here. We are ahead of the competition". I believe, most of the corporates, if not all of them, will be on top of the world and beat drums that their strategy worked. In a real sense? No, says many professors at famous business schools. They say that most organizations ride the waves because of either of two things - Co-incidence or luck. They just happened to be there with probably a strong balance sheets, they were able to withstand the recession and as expected post recession, the economy booms and they start to build their balance sheet again. Their profits erode in recession and booms when the economy comes to normalcy. This is how most corporates work.

Then what the heck that this strategy does. Why often leaders confuse their people about strategy. Why dont they be meaningful? How to thrive well in recession. It is fairly simple, "deliver more for less". How can you make it? Just connect with you people and make them understand your perspective. The employees may think that why the hell he/she needs to deliver "more for less" unless one gives the perspective. It is imperative that leaders, irrespective your designation, interact with people (not just CEO, VPs). Connecting is quite different from forwarding emails, connecting is quite different from a monologue. When you try to connect with people, the first thing you got to do is understand their problems, respect their opinions, reject their opinions with due dignity and above all have guts to take blame and do not shy away.

One thing that managers keep telling their people is communication and bringing up the issue at right time and with due sensitivity. Isn't it not important to connect with people when their morale is down or when their life is at stake? It makes sense even in good times but it makes more sense in difficult times.

When you do that, your people will automatically deliver more and you will also leave a legacy.

22 April 2009

Intellectual Curiosity - Questions Matter !

Intellectual curiosity is the one of the factors that tells whether we are moving in right track. If you look at great people, they always asked good questions and the guys who answer the questions were average guys. It takes a great deal to ask sensible questions than answering some ordinary questions :-). For example, many scientists were ousted from schools because their teachers thought that they were asking non sense questions. But those teachers failed to understand that the very same curiosity later drove them to learn more things and to see things differently. I feel that answering a question is pretty easier when compared with asking relevant, meaningful, thought provoking questions. Though a child is immature, everyone wants to be like a child and everyone prescribe others to be like a child. Curiosity makes the different, isn't it?

Sometime back, I hovered over Internet and landed on the website of Jim Collins and read his biography. After a while, I was reading "The Greatness Guide" by Robin Sharma in which he emphasized the importance of being "under construction". When I reflected the words of these great people, I felt that there was a great advantage in being a life long student constantly looking out of opportunities to learn the knowledge and unlearn the ignorance. This is an wonderful state of being and signifies the growth of any person. Awareness follows thinking, awareness gives us intelligence and intelligence helps us to find answers for those complex questions. Only when you ask questions, you understanding expands and that shows that you are moving in right track.

So ask questions, don't bother if you don't answers, but eventually you will find it. Any thoughts?

21 April 2009

Decision Making, System Thinking, Scenario Planning

I have been reading the book on system thinking by Gerald Weinberg rather slowly. I have not read more than first few pages and even the first few pages opens up a lot of opportunities for thinking. It makes me to think a lot. I try to apply system thinking theoritically to many aspect of my life. I feel system thinking is a natural thinking. I understand, we, the human being have the capability to be a system thinker. It is purely our fault of not realizing our ability and we prove that "The fish is the last one to see the water". As well pointed out by Gerald Weinberg, the rapid industrialization brought in wealth but hazardous second order effects of pollution and global warming. The rapid development of crops have produced good amount of harvest but gave us inorganic food leading to genetic effects. While the fast paced world is focussing on the first order results, it fails to observe and act on the second and third order effects. This gives us enough evidences that we are not learning from our mistakes and failing to correct ourselves. I strongly believe that when the decision making is good, all the other things will be good. Recently, I have read a short write up about scenario planning or scenario based decision making and how it helps in making wise decisions. I feel that scenario planning is subset of system thinking. Here is my view on both system thinking and scenario planning. Read on.

Amidst the unprecedented recession of our generation, no one will deny that we are witnessing the second order effects high leverage and heavy risk appetite and the first order effects of a systemic failure. No one would have thought that they are merely betting on something which is overvalued multiple times or on things that does not exist at all. I am not sure whether we will learn anything from this recession. I don't deny the fact that some organizations will be creating a document or at best will be writing a software to protect themselves from a failure. However, I seriously doubt whether we, as a human being, will come up with a learning which we can apply the lessons learnt to some other problems and use them for better decision making. I doubt because we fail to appreciate the importance of system thinking and only the system thinkers can stop such failures.

The effects that we consider second order are the effects that are not thought about. The world does not even care about the second order effects and goes to an extent of not giving importance to be aware of those second order effects. But these second order effects reaches a tipping point and becomes much severe. Only then the world realizes its significance like the recent recession. If you want to explain with a real world example, who thought that poverty will to lead emergence of terrorism (I am taking about Naxal in India) . The terrorists are the second order effects of poverty. If you want to fix terrorism, fix the first order effects that is exploiting people and poverty. So, the system thinking should play a pivotal role in any decision making process may it be at policy level or at strategy level. First criteria for a decision maker is to be a system thinker.

The next thing that will be cropping up in upcoming months is the concept of Scenario Planning. I believe the system thinkers and scenario planning experts are likely to play a very crucial role in building a modern society. Scenario planning is a kind of analysis where the future is built and the study will be made on the impact of the decisions in that future. For example, if you are taking a home loan from a bank, the banks will consider what will happen if the person loses the job, what will happen when the land values drops. I believe, when the entire world is newly build and modern economy emerges, the scenario analysis together will system thinking will play a crucial role in making wise decisions. I would like to see a world that thinks. It is the thinking that will bring prosperity not just investments. :-)

20 April 2009

Unix Programming - Understanding a simple "C" Program

Post 3
We saw that a program is a passive entity which is sequence of instructions. The sequence of instructions implements a specific algorithm or logic for doing specific operations. Another important aspect of writing a program is segregating the program logic into logical chucks as functions. These functions make program modular so that the program can be easily understood. The program also consists of data and the primary aim of any program is to process the data and produce useful information. There may be different types of data required throughout the process execution. Some data might be required for the entire life of the process and some data may needed only for certain period of time. Each of the process has an address space and the data is stored in process address space. The data is referred by the code (instructions) using variables. Based on the nature of the data whether it required throughout the program or only shorter span of time in a function the variables can be classified into two main types - local and global. Let us discuss about various types of variables with the help of simple example. This understanding is very much essential before discussing process address space.

#include

int COUNT = 0;

void simplefunction(int c, int d)
{
printf("%d, %d", c, d);
}

int main()
{
int a = 1;
int b = 2;
simplefunction(a, b);
return 0;
}

In the above example, we have a variable with name "COUNT". There are two functions "main" and "simplefunction" each two variables. The variables "a", "b", "c" and "d" are called as local variable as their access is restricted the respective functions and the variable "COUNT" is called global variable as the access to global variable is available to all function. The local variables are also called as stack variables. The local variables have shorter life span and global variables exists throughout the life of the entire process. When a process is loaded in to the memory, these variables are stored in a specific region in the process address space, some of them are created when the process starts and some of them are created as and when they are executed and freed as soon as they go out of scope (that is whenever they are not needed).

In the next post, we will discuss about how a process is loaded into the memory, various regions in process address space and how a process is executed.

19 April 2009

Unix Programming - Getting the executable

Post 2

So, you now know what is a process from a layman's view. Process is a live entity which has some mission to be completed and it has some input and output resources and does some computing. These processes are run in computers. If you see the computers right from 1980s, there are many types of computers like super computers, desktop personal computers, laptops and even you have decent amout of computing being done in mobile devices. In all these devices, there are at least handful of processes to tens of thousands of processes running at the same time. If you look at these devices, they are quite different in application and quite different in assembling. For example, your desktop computer may have many hardware components including processor which does the computing. The way the computation is done may vary from processor to processor. So, each processor comes up with a way of getting things done. Each processor will have specific set of instructions, often referred as instruction set, using which the computation can be done.

Assume a scenario like this, you are writing a software that takes a year's time to write but you want that software to be run in most devices. For example, let us assume that you are much concerned about time management and you are writing a simple daily planner. Isn't it reasonable if you want it to be run in your desktop, mobile and even super computer? But if you write a software using instruction set of a specific processor, your software will not work in other devices which has different processor. In order to overcome this, computer scientist came with the concept of high languages like C and C++. These high level languages have specific syntax often expressed using English, special characters and scientific notations. A special software, compiler or interpreter, is used to convert the code written in high level language to machine language. So, now you have moved from writing software for specific device to writing software for whole bunch of devices and using compilers/interpreters to actually generate machine instructions from your high level language.

When you write a program in high level language, it cannot be directly run on your computer. As a first step, you have to compile it, link it and load it. We have seen what is compilation. But what really is linking? In your software, you will do some commonly used operations such as getting input from the user, reading a file, writing to a file and displaying output to the user. What you do with the input and how you process the input to produce output may vary from program to program but all the programs tend to have certain common denominator. Rather than writing code for this common denominator for each software you write, does it sound good to write the common code once and keep it for lifetime. Yes, it is in fact a brillant idea and the common code is called library. When you are writing software you will be quite often referring this common library. For example, in our "Hello, World", printf is a library function that outputs to standard output. Don't bother if you do not get what is standard output. We will uncover that in future. Time being, assume that it is your display. The concept of attaching your code with the common library is called linking. Only after compiling and linking, your code becomes fully functional and ready to be run. We call it as "binary" or "executable" or "exe".

So far, we have prepared a program and not yet executed it which is equall exciting if not more exciting. In the next post, we will again discuss about a simple program little bit deeper. I assure you, before end of next week, I will tell you about process address space :-). I feel that it is very important to know these details so as to get deeper understanding. I just don't want to 100th text book and 100001th webpage. I believe in quality rather than quantity and quantity makes sense when there is quality. Hope you agree with me.

Catch you later

18 April 2009

Why should I understand Unix?

Clear: Hey dude, how are you doing?

Confused: I am doing fine, just thinking about some stuff.

Clear: What's that?

Confused: Unix...

Clear: Preety cool, I m learning it. It is interesting piece of marvelous

Confused: But my friend once said, it is difficult to understand

Clear: Any new thing is difficult to understand.. remember you had difficult times in understanding me, weren't you :-)

Confused: Yep :-). So what do you say abt Unix?

Clear: Unix is simple and an example on how to write a software. By reading Unix, you not only understand Unix but also how to write better software.

Confused: Thats interesting. I never thought something like this..

Clear: There many operating systems that follow Unix. You have so many Unix OSes and Linux too.

Confused: I thought Unix and Linux are different

Clear: They are different. But the design concepts are almost same.

Confused: Ok, I think, now, I m getting clear. how to read it.. any idea?

Clear: Yep, start reading Unix about half-page daily, digest it, 

Confused: Half a page, interesting. I used to read entire book over a weekend....

Clear: Novel? It isn't a novel. So you have to digest the concepts to deepen your understanding. do as little as half a page. It ll take years to be overnight success in Unix :-)

Confused: Yep, I understand the need for consistency and daily improvements. Sounds good. let me do it

Clear:  Great...all the best...

Confused (now clear): Thanks buddy for great piece of suggestion. talk to you later. HAND

Clear: you too.

How to Build Emotional Intelligence?

You might have seen how a short tempered and ill tempered behave with lot of emotions. Irrespective of whether your emotional intelligence is high or low, everyone's reaction to a situation will be spontaneous and natural. If you happen to possess low emotional intelligence you will certainly overdo things at an emotional level and hence you may be perceived as "immature" guy. If you look the scenario and how your brain processes these behaviors, you will agree that you cannot be look emotionally good if you aren't really emotionally good. If you do, then your action will not be natural and people will see that you are acting. This perception is quite dangerous than perceived as ill-tempered guy. For others, it is absolutely essential that you appear as authentic guy (again, it is not hard and fast rule that you should appear authentic. Anyway, the world is willing to deal only with authentic. You decide). So acting like a good tempered guy is not the way how you should improve your emotional intelligence. How can you improve? Here is my personal experience on how I am improving my emotional intelligence.

Our brain, which weight roughly three pounds has thousands of miles of cells and still the scientists are figuring out from where the decision is coming from exactly. For each thing that comes out of you, need to be approved by the gatekeeper – the brain. The scientists are moderately successful in studying brain cells and also as components. But the research is still on to study brain as neural circuitry. The study will reveal how, we, the human beings process the information. I am looking for some research results about emotional intelligence. However, I do not want to wait until the results are published and want to do the experiment on my own which is generally the hard way. For the first time, I want to be a monkey or rat in my own lab to improve my emotional intelligence.

One of the things that I found recently is that one cannot improve emotional intelligence by going opposite to your emotions. For example, when you are hungry you just need the food. When you are angry, you need to vent it out, when you are happy, you got to hug your friend. So, I do not believe in the concept of counting numbers or biting nails or whatever. When you do that, your emotions simply takes another form. But my point about emotional intelligence is ability to stand on your opinion and yet considering the perspective of others without taking any sidelines.

The emotions are building blocks of human relationship and certainly when you overdo certain emotions, it becomes an issue. As long as you are not stepping out and overdoing things, it is not a problem. But, in case, you are overdoing it, you need to be little careful in getting your thoughts across and check with others how you interacted with them. This can simply be done by making a third person (your friend or well wisher) to watch you when you react and give you feedback. In worst case, you can record your reaction in a video/audio and analyze yourself. This is the first step – capturing the data. This data should show you some evidence whether you need reconstruction.

The next step is to accept your current state and work on improving yourself. The first step, identifying your emotional intelligence, will be easier. But accepting it is very difficult as you have to convince your ego that you are not good and needs improvement. There is a difference between someone telling you that you are bad and you thinking that you are bad. If someone tells you that "you are bad", it is not end of world. But when you start to think that you are bad, you may end in getting inferiority complex and eaten up by low confidence. So, it is highly important that you do not lose "SELF" but yet work on it. So, always think about so many good things you have and work on those traits that need improvement. This is where your friend or well wisher can help you to sail through by giving those crucial feedbacks and also appreciate and cheer you up. If you can work on improving your emotions to other's emotions, it will be great not only in professional career but also at personal life.

If you are thinking that you can improve your emotional intelligence by not reacting to others, it is wrong. You cannot improve emotional intelligence by looking at others or by just reading books. It has to be an experience because you need train your brain and the neurons in the brain when you want the change to be ever lasting. It is like archery, swimming and life. You got to live and learn with it. But if you are satisfied with temporary solution, you can tell your brain to do “the acting” (which again is not good for you). It is the time and efforts that will help you to improve your emotional intelligence, not books, not case studies, not training. I have tried this approach and it works very slowly. I believe that this is the only way how one can build emotional intelligence and any other short cuts do not work at all. It might be slow, but it is effective and ever lasting.

So, sounds good? Have any thoughts?

Other posts on Emotional Intelligence can be accessed via this link

PS: If you want to here from a subject matter expert about Emotional Intelligence, refer the works of Daniel Goleman. He is authority in EI.

17 April 2009

Unix Programming - What is Process?

Post 1

Today, we have so many programming languages and many software that have been created with those programming languages. It is surprising to see that an operating system design is still scaling from mini devices such as watches, washing machines to super computers and clusters. KISS, stands for Keep It Simple and Stupid, an acronymn given any piece of software that does one thing and does it well. It is not overstatement if I say Unix is a cornerstone in computing. There has been so many software that were produced but yet it is difficult to find one something like Unix. Unix is such a marvelous creation like the ones of Bethoven, Michaelanglo. The concept of Unix is simple - Process have life and files have space. Many operating systems have cloned the concept and design philosophies of Unix. If your Unix/Linux system is doing something, it should be combination of Processes and Files. In this post and few (not sure how many) subsequent posts, we will discussing more on Unix/Linux programming concepts  predominantly from user space and from kernel space as and when it is required. My intention is not cover the entire stuff in a single post, but rather I want to be consistent in posting short post. I feel, it is gives a sense of accomplishment to interested readers after reading few posts. It also gives better retaintivity as you can come back to short posts and quickly go through it which improves your short term memory. Without wasting much time, let us get into action.

What is a process? A process is a live entity, it is a program under execution. But when you generalize with such as definition, we tend to forget what really is a process. This may be an answer that you can give in an interview but not when you are trying to understand the system. It is the processes that move the system. Apart from being a program under execution, what is the process? A process is a black box that takes input, processes it and produces the output. It is an algorithm or group of algorithms that is running on the computer. When you say "taking input", what sort of inputs does it take? The input can be a data from a memory location, a stream of bytes from hard disk or network hosts, a signal from its fellow process or its parent and the input resources can be of any form. So, now you know that you need input. The next thing is how do you intend to operate on the input data. Apart from input resources, you also need a logic (code or machine instruction) that processes the data. Until now we have seen data received from input resources and code that processes the data both requiring some space. After you manipulate the data, you need store the data to a output resource or device. But generally, computing is not that simple. Before storing it to output device, you may need to have so many intermediate stages as a part of your algorithm. When you connect these things, you will get the process. A process is not just a program under execution but much more than that. A process is live entity that has address space, context, input resources (open files, database connection, sockets) and output resources (open files, database connection and sockets), state and so many other things in user space and as well as in kernel space. Not only user space, the process has also something in kernel space like per process area and data structures to access the input/output resources. Everything put togother is a process. It is not just code, it is much more than that.

Assume that you have given a billion dollar to answer this question. If you know "C" programming language or if you do not know "C" you can take any programming language. Can you give me a write up (you can to the comments section) on how the following program is executed in a Unix/Linux system. If you answer this question, I believe the size does not matter. You can work on super computers or high performance clusters. Here you go.
int main()
{
    char *str = "Hello, World";
    printf("%s", str);
    return 0;
}
In the next post, we will be discussing how this program is loaded into the memory and how the address space of this process is going to look like and then slowly move on to how this process is executed, how "Hello, World" is printed.

Catch you later.

16 April 2009

Emma - Java Code Coverage Made Easy (Part 3)

Before reading this post, I would suggest the readers to go through the previous posts (Part 1and Part 2) for better understanding even though this post alone can be of use but when combined with other previous will help you to understand the whole context of code coverage. In the first post, we understood the importance of code coverage and the second post talked about Emma's on-the-fly instrumentation. Before dealing with other possible ways of using Emma, in this post, I would like to give an overview about Emma. The intention of having previous posts is to help someone to get off the ground and this post will help to understand Emma. This post will be predominantly theoretical (which is very much needed to understand how tools are written for Java in general and how Emma is implemented in particular). With the information given in this post, you will be able to come to decision on how to use Emma effectively.

In the world of Java, you can write tools in whichever way you want. However, Java gives you at least two standard way of writing tools. These are defined as specification. The first method is something to do with "monitoring and managing" runtime behavior. Java Platform Debug Architecture, Java Debug Wire Protocol, Java Virtual Machine Tool Interface and Java Debug Interface primarily do "runtime monitoring and managing". The concept can be put simply put as "watching what JVM does and taking actions based on JVM behavior". The tool should listen what JVM is doing through events and write logic - what the tool intended to do. The main disadvantage of this is approach is the overhead in receiving the events and processing the events.

Another standard way is to add the logic to the class files. Let us consider code coverage. The objective of any code coverage tool is to measure the coverage line by line. In order to do this, the coverage tool injects the code coverage logic in all class files. Whenever the class is loaded and executed, along with the application logic, the code coverage logic also runs and records the coverage metrics. This is called as bytecode instrumentation. Again, there are two ways of doing this. First is to modify the application class in the hard disk (or any secondary storage) and the second method is add the bytecode on-the-fly when the classes are loaded.

Emma exploits both the methods and hence it lets users to measure the code coverage both offline instrumentation and on-the-fly instrumentation. The caveat is that during the on-the-fly and offline, the way the application is measured for coverage is not going to vary. Only the method used to inject or instrument bytecodes is going to vary (which we described already).

Emma employs on-the-fly instrumentation if you have integrated Emma with IDEs. The command line version of Emma has the capability to run both in offline and on-the-fly instrumentation mode. Most of the times, the developers/testers use on-the-fly instrumentation since the risk of changing the application classes is not there as bytecode instrumentation happens on-the-fly. But the life is not easy as it seems. When you are using certain application servers or servlet container, you cannot use on-the-fly because the application servers/servlet containers have custom classloaders. Here offline instrumentation is the only option. So, before using Emma, you may need to study little bit about your application and use the suitable methods.

I have also come up with a little interactive presentation with flash using Wink on Emma. It can be accessed through this link

15 April 2009

Hotswap Agent for Java Virtual Machine (Part 2)

This is the second post in the series of posts on writing Hotswap agent for Java Virtual Machine. In the previous post, we saw an higher level overview about the requirements and specification on how it can be done. In this post, we will drill down to the details. I am also planning to write few more posts on implementing this agent using Java Debug Interface. Also, once you understand this Hotswap agent, you can write a lot of tools using Java Debug Interface. The rest of the post gives the details of how to write an agent using JDI.

Java Debug Interface is a programming interface which lets us to write agents that interact with a live JVM. The interaction is of two types. First, JDI gives infrastructure to receive events from the JVM. For example, whenever an exception is thrown, JVM publishes an event. With the help of JDI an in-process agent or an agent running as different process in the same or different system can consume the event. Secondly, with the help of infrastruture given by JDI, the agent can also control JVM. The events together with controlling of JVM helps developers to write tools such as debuggers and profilers.

When you are going to write an agent (a program that monitors and managers remote JVM) using JDI, the first thing that you have to do is to know how are you going to connect to JVM. There are mutiple connectors available. Each connector differ in the way on how they interact with the JVM. For example, LaunchingConnector helps you to launch a JVM before connecting to it but ListeningConnector simply listens to a running JVM. Next thing is the transport mechanism, the method of communication between JVM and the agent.

After deciding both of these, you need connect to JVM. If the connection is successful, you will get an instance of JVM. With the remote JVM object, you can subscribe for specific event by through JDI request. Apart from this, using classes and methods in JDI, the agent can also control JVM such as stopping a thread, running garbage collection, redefine and reload classes etc. The following is the list of events that an agent can subscribe for.


If you want to write a simple tool to reload classes on the fly, you have to identify Connector, Transport, subscribe for events like JVM Start, JVM End. You have to use redefineClasses method and then reload the classes into the JVM. I believe, this post would have given you some idea on how to write a Hotswap agent. In the next post, we will see the implementation of Hotswap agent with the help of code.

14 April 2009

Emma - Java Code Coverage Made Easy (Part 2)

This is the second post on Java code coverage with Emma. In previous post, we discussed about Code Coverage and introduction to Emma. In this post, we will discuss about how to install Emma and do the basic code coverage with an example and screenshots. After you complete the reading of this post and previous post, you should be able to download Emma, install it and run Emma from command line. Towards the end, we will also discuss about how to get HTML report and interpret simple Emma report. It will be good if you can download Emma from here and use it side by side as you read this post. Please make sure that you download the binary of Emma and not the source version. The binary version of Emma should be sufficient to do this. Along with this, you need to have Java compiler and Java Runtime Environment to compile your Java classes. In order to give a picture of how Emma works and process involved, let us take the toughest approach of running Emma from command line rather than integrating with IDE. In later posts, we will discuss about IDE integration (Eclipse/Netbeans) to make developers life easier.

Downloading and Installing Emma
Emma comes in three different versions - binaries with examples, source and libraries. In order to do this example, we need to download "binaries with examples and documentation". You can directly download it form Sourceforge.net or you can access Sourceforge project via Emma home page. Irrespective of the way you choose, please make sure that you download Emma binaries with example version. After downloading emma..zip, unzip in a directory. You find three directories "docs", "examples" and "libs". Inside the directory "lib", you will find two JAR files emma.jar and emma_ant.jar. For time being, we will not be requiring emma_ant.jar as it is used to integrate with "ant" which we will cover in subsequent posts. The JAR "emma.jar" is the tool that we will be using throughout this example. Apart from the examples given in this post, you can also try to play with the examples that comes with Emma. Take "emma.jar" from the extracted directory and copy it to the directory where we have our examples. The following picture shows my setup.



Emma.jar and Examples

Java Program Example
Consider the following Java classes. Greater.java is the main class that we are going to test and measure coverage with the help of GreaterTestDriver.java. The class "GreaterTestDriver.java" mimics the testing of the class "Greater.java".



GreaterTestDriver.java


Greater.java

Greater.java has compare method and it prints out the largest of two numbers. GreaterTestDriver.java creates an object of "Greater.java" and invokes compare method passing values 10 and 5 respectively. For values 10 and 5, if block in the method compare is executed and else part will not be executed which our coverage has to pin point.

Running Emma
Running Emma is simple and you only need to specify emma.jar in the classpath and run your application using "emmarun" command. In our case, it is running the test driver "GreaterTestDriver" class. Once you run Emma and after you application exits, Emma prints the coverage results in a text file "converage.txt".


Running Emma and Getting output in text file


If you look at the report "coverage.txt", it gives the coverage data at package, block, method, class and line level.

You can also run Emma and get report in HTML format. Again it is very simple and you need to specify that in command line options (refer the last boxitem to know more about command line options used in this post).




Emma with HTML Reporting

So far you have run Emma and got the HTML report. But the data given by Emma shows the coverage results but the information is not sufficient. It will be helpful to merge the results with source code. Emma can also pin point which lines are executed and which lines are not executed. Yet again, the step is simple and following example is self explanatory.


Emma Reporting with Source Code

In the above report, the lines that are highlighted in green color are the ones that are tested at least once and the lines that are in pink color are not tested. In ideal case, you need to improve your test suite to cover the lines that are highlighted in pink color. As an exercise, can you achieve 100% coverage in Greater.java?

Command options used in this example

# In order to run Emma from command line and to get report in test file
java -cp emma.jar emmarun -cp . example.GreaterTestDriver
# In order to run Emma from command line and get report in HTML but without Source Code
java -cp emma.jar emmarun -r html -cp . example.GreaterTestDriver
# In order to run Emma from command line, get report in HTML and merge the result with Source Code
java -cp emma.jar emmarun -sp . -r html -cp . example.GreaterTestDrive

In this post we saw only on-the-fly instrumentation and in upcoming posts we will discuss other features of Emma such as Eclipse (and Netbeans) integration, off-line instrumentation, integrating with ant and merging data of multiple sessions, integrating with Tomcat.

I have also come up with a little interactive presentation with flash using Wink on Emma. It can be accessed through this link

13 April 2009

Hotswap Agent for Java Virtual Machine (Part 1)

Before joining my company and in fact until two years after I joined my company, C, 8085/8086 ALP and Perl are the programming languages I knew. I learned C and ALP at college and Perl at my office to write a simple CGI utility. Two years later, I started to learn Java as I was moved to development team and I started to learn Java with certain amount of dislike. After a short period of time, I started to read about Java Virtual Machine specification and writing tools with the help of JPDA. Writing tools using JDI/JPDA is relatively simple as JPDA gives you enough infrastructure. This post contains specification/requirements for writing a small and powerful agent to reload classes of live JVM. As you may know, Java source code is compiled and bytecodes are produced. These bytecodes (generally .class files) are loaded into JVM and are much like machine instruction but the fact is that only JVM can understand it. These bytecodes are your program and decides how your application is executed.

If you are a developer, your daily job might be writing code or fixing bugs or both. During development, you may need to change the logic of your program, recompile the source and restart the application. Restarting the application is stopping the running JVM and starting a new JVM process. This is a very lengthly process if your work involves changes to source code multiple times. Sun HotSpot VM comes with a feature called HotSwap. Using this feature one can replace the classes that are loaded in the JVM. Once reloaded, the objects that are already created also takes effect with new changes. This tool will improve the productivity of developers when frequent restart of the applications is required. Here is the specification.

Specification
Write a simple tool which let you to reload classes in a running JVM without restarting your application. Also provide a simple user interface (probably using SWING).

Steps
1. Use Java Debug Interface API to connect to remote JVM. In order to connect to remote JVM, you the hostname/ip address of the remote box and port number on which your JVM runs. In order to hotswap the classes, you need start JVM in debug mode and if you start JVM using "socket" debugger.

2. Also subscribe for few important events such as JVM Exit, Disconnect Event. (for more info refer Java Debug Interface API Spec).

3. If the connection is successful, you get an instance of the remote JVM and you can once again use JDI to replace classes.

4. You have to write the logic of reading the class file (flat file) from the file system and give to JDI. JDI pumps the class file to remote JVM which reloads the class after making lot of checks.

In next couple of days, I m planning to write a post on how to do this with a small example (thanks to Veeru for pointing this out).

12 April 2009

Emma - Java Code Coverage Made Easy (Part 1)

Irrespective of the number of lines of code you write and if you are a good (and honest) tester or developer, you accept the fact that it is impossible to test the entire software. I am not talking about those simple programs like printing "Hello, World". I am talking about software that is decent in size. Testing software is brain intensive. I would like to give you a simple scenario how I used to think when I was in testing team (of course, that was 6 years back when I was fresher). When I was executing a test case or writing a test case, I generally used to get few parallel thoughts about what are the other related test cases. It never ceases there. It went on and on until I felt comfortable. If I did not cover some corner cases, something would pinch me from inside to do more, to spawn many parallel thoughts and eventually I would end up writing more test cases. While this approach is good, but this is very subjective and depends on the person who is testing. It depends on the knowledge level and expertise of the person who is doing the testing. The testing should be much more and also driven by data. Even if we take that most of the testers of are effective, how are we going to convince and be sure that the test cases are effective?

As a tester, we generally used to get requirements, design documents (?) and finally code in binary format. If you apply general system thinking, tester is above developer simply because he supervises developers' work and validates it. The confidence level of the tester has to impeccable so that the project managers, product managers can have sound sleep and sound sleep every night. This confidence comes with thoroughness of testing and this ability is only possible if you eat, sleep, think with testing in your head and practice testing as art. You might be watching YouTube, but yet you will think like a tester. You might be doing test strategy, test planning, test plan, sophisticated test case design. All these comes in the following ways - requirements, design document, your understanding about how the code will look like and ad hoc testing. But is that sufficient. We are living in the world of doing more and wanting more, testing effectiveness is no exception. Is there a mechanism by which I can measure my test suite effectiveness. Yes, it is there. The rest of the post deals with doing code coverage for Java applications using Emma, an open source code coverage tool.

First, what is code coverage? The process of measuring or seeing which part of code that are tested and the areas that are not at all tested is called code coverage. Second, why is it important? The answer is read the definition again. Period. If you are unit testing you code, it helps you to see the coverage immediately and hence you can fix it "then and there" and butterflies will not fly in your stomach when the product goes to testing team. If you are a tester, it helps you to measure - first your test plan and then the code. Naturally, you will write more test cases or change the existing test cases to cover more. The point is "more coverage". So, no more butterflies in your stomach too when your product goes out to production.

Emma is an open source software which is simple, powerful and flexible. Emma uses bytecode instrumentation technique and measures the code coverage. It has the ability to instrument the classes on-the-fly and also supports offline instrumentation. In on-the-fly instrumentation, you just give the location of your Jar file or class files, Java Virtual Machine when it loads the classes it instruments the logic for code coverage. In offline mode, you need to do an additional step of adding the logic to Jar/class files and copy it in your hard disk and load the instrumented classes to Java Virtual Machine. But irrespective the method you choose, the code coverage will be same. The offline mode is particularly helpful when you have custom classloaders like application servers or servlet container.

You can run Emma directly from command line and you can also integrate with nightly build as a part of continous improvement strategy. Ideally, in nightly build, code coverage works hand in hand with Unit Testing Framework like JUnit. After instrumentation, you have carry out your testing. When you are testing, Emma does the code coverage. Once you are done with the testing, you can safely stop the application. Emma also comes with reporting and it can produce reports in HTML and XML. The report can also be merged along with source code and by just looking at this report, you can identify the lines that not covered.

Apart from running Emma from command line and including with ant, it can also be used at developer's desktop. Emma has plugins for famous IDEs - Eclipse and Netbeans. With this, the developer's can run their unit test cases with Emma immediately after implementing a unit of code. Based on the coverage, they can work on their unit test cases to achieve better coverage. Better coverage, better quality and improved confidence. With this, we come to an end on introducing Emma - Open Source Java Code Coverage Solution.

In the next post, we will be discussing how to install Emma and use it.

Have a Great Day

I have also come up with a little interactive presentation with flash using Wink on Emma. It can be accessed through this link

11 April 2009

Speaking Experience @ ILUG Chennai Monthly Meet

This is the first time that I am speaking in Indian Linux User Group, Chennai. ILUG is most active LUGs in India. The meeting generally happens in IIT Madras (the place I wanted to study). Again, I want to reiterate the fact that speaking about Open Source in Open Source meeting gives me enough motivation and abundance of energy. I registered the topics with Mr. Bharathi Subramainan and he gave be slot immediately. Today, I also noticed what happens when people with passion sign up to do something. Unlike other meetings, the members were very punctual and I could see considerable number of people waiting in the hall and some people working in computers in another room. Today's incident enlightened me about valuing others time and I will never forget this in my life. Apart from that we also had good knowledge sharing session.

The talks started at 3.15pm and the first talk was hosted by Selvakumar K from NRC-FOSS on KTechLab, an Open Source IDE for Electronics and PIC Micro Controller Circuit Design and Simulation. He talked about analog and digital simulation tools in Linux. I feel that the tool will help any electronics student to do experiment in his/her laptop/computer. The colleges should seriously consider to have this tool in their department and encourage students to use when they are doing practicals or learning theory.

Next, I started my talk on Java Code coverage and explained about need for code coverage and features of Emma. I talked about various ways of using Emma such as with IDE, nightly build, from command line, online instrumentation and off-line instrumentation. Towards the end, I gave a quick demo on using Emma with Eclipse, on-the-fly instrumentation from command and HTML reporting.

Towards the end, Prof Dr C N Krishnan talked about NRC-FOSS and its Phase 2 initiatives. He requested the help from ILUG-Chennai. He also expressed his concerns on giving feedback to NRC-FOSS.

We have also been given some stickers, pens and Fedora CDs sponsored by Ubuntu and the speakers have been given caps (so, I got one) from Ubuntu. This Saturday was fulfilling and exciting as well. Looking forward for more such knowledge sharing session.

10 April 2009

Creating Virtual Machine in VirtualBox - Screenshots

For more than four years, I have been using VMWare workstation and from last year I started to use Virtual Box. Virtual Box is a virtualization product by Sun which virtualize X86 platform and supports Windows, Linux, Solaris and Open Solaris as guest operation system. It is good that Virtual Box is released under open source license and it is available for free of cost. You can download Virtual Box from here. Installing Virtual Box should not take more time and it is very simple like installing any software. Just double click the binary executable and answer few usual questions. You are done. I captured the screenshots of creation of Ubuntu Virtual Machine. One feature, I like about Virtual Box is you can reuse Virtual Disk. We will see this in another post. I am presenting the screenshots that I captured. By following this post, you should be able to create a virtual machine and start installing operating system of your choice.


1. Create New Virtual Machine


2. Click Next in "New VM Wizard"


3. Specify Operating system, distribution and give a name to this VM


4. Specify the virtual RAM size (leave at default)


5. Create a new VM and new virtual disk


6. Click next in "Virtual Disk" Wizard. This is the sub-wizard in the main wizard. If you already created virtual disk, you can skip this setup by choosing virtual disk from available list.


7. Choose virtual disk storage type (leave at default)


8. Specify a name for Virtual Disk and size


9. Click "Finish" to create virtual disk


10. Click "Finish" to create VM. After this step, a new VM should have been created.


11. Open settings and choose either CDROM or ISO file location. So that VM will use CD/ISO for OS installation

In this post, we saw how to create virtual machine. The steps are same irrespective the guest operating system. Virtual Machine behaves much like a physical X86 based system and as of now many flavors are Linux, Windows, BSDs can be installed as guest operating system. Guest operating is the operating system that gets installed in the virtual machine. For example, in a Windows XP system, we can virtualize many virtual machines. The operating that gets installed in the virtual machine is generally called as guest operating system.

09 April 2009

Creating a WoW

We, as a human being are like goats. By and large, we go with majority. When so many people in a room say that "world revolves around me", we will also agree with it. If they say, they want to create a wow, all of a sudden and without understanding the science and art of innovation, we will jump in and say "yes, we will". Up to this, it is quite good. At least you have the curiosity. But the worst things is many of us tend to stay in the same place without taking any initiative. We just want to build a marvelous building at this moment without any foundations/hard work. Creating a wow or innovation is easy. But it is not so easy and does not come just like that. I am not a innovator and I have distantly worked with some innovators. Here is my point of view.

Many of us are working on creating wow for others. I don't question the willingness and focus to create wow for the others (mainly customers). But I do like to ask you a question. Have anyone did something for you that impressed you. Otherwise, did anyone in your life created a wow for you. How does a wow smells, what do you feel about it, does it speak to you? When someone did it, did you feel that you were in heaven. Without understanding what a wow is and without even experiencing something, how can you create a wow. Even if you create a wow, how can you say that it is "wow". Creating a wow once or twice is easy and may be gotten due to luck. Do you know how to do it consistently? Do you have the magic of converting the air as wonderful music like a flute.

First of all, may it be innovation or quality or productivity, it sucks without daily improvements. The daily improvements are the foundation. Here my point is not the final product (the big idea) but it is what we do to bring that big idea. The knowledge we gather, the type of people we interact, the number of minutes, hours we think and so on. Without focusing these foundations, creating a wow is just a lip service and I am sure that it is never going to happen. Innovation is a chemical reaction, the reaction that takes place in your brain and you really need to work hard and be consistent in fusing your neural circuit.

Creating wow is not an one time event. We need to come up with techniques where we can create wows like an engine. The customer may not like to stop with just one idea. She wants two, three, and infinite. The ideas are going to give an impression , and it is also true, that you care for her (though it is not the only way to impress). So, if you are consistent, you will be in the game. Else the customer is going to say that you are outdated.

Another thing that we are doing is "ritualize" wow creation rather than internalizing it. When you practice as a ritual, you do it but without involvement, passion and halfheartedly. After internalizing and comprehending it, you do it more with involvement and wholeheartedly. This is another key thing that we need to watch out for.

The final thing is give people the resources and freedom. The resources can be in terms of time and environment that is suitable for creating wow. You cannot expect an idea when people are squeeched and used to maximum possible extent. If you ask a stressed guy, he can only give mediocre ideas. Give them time to think and then expect sparkling ideas.

The above discussed things are my viewpoint. I look forward for your response/comments to learn more on this.

Economic Slowdown - When are going to hit the ground?

It is a trillion dollar question that when are we going to hit the bottom before making a recovery. This is a very hot news and it is minutes after US Fed released minutes. In summary, Fed sees that the economy is deteriorating and downside risk is high. And another point here is the economy is deteriorating more than expected and it is likely that the customers will hold back the spending which again lead to production cuts which leads to lay-offs. This is going to be cyclic and will take sometime to break the cycle and to go in counter direction. In summary, there is lot of downside risk in short term before something happens in a long term

Hold your breath and read through these pages.

Google News
Yahoo News
CNN
Bloomberg

Again, in another two months, the markets are going to see another bottom, may it be capital markets or job market. Now, we should believe someone who says the recovery is going to take three years :-(. Hard truth, but it is truth, we have to digest and move forward.

08 April 2009

How to Mount Windows Partition from Linux

I have dual boot in my laptop with Windows XP and my favorite Ubuntu. Windows XP is factory default. Two years back, I installed Fedora and after trying the recent version of Ubuntu, I wanted to install Ubuntu and it has become my favorite in no time. I simply like it. Since I backed up some important Ebooks and documents into Windows partition, I wanted to access those both from Windows XP and Ubuntu. After doing some searching in Internet, I found a mechanism to mount windows partition to Linux.

First, you need to identify the number of Windows partition and locate the partition that you want to mount. "df -k" will help you to identify all the partition/disk in your system. Then, use the "mount" command to mount. For example, here is the sequence of steps to be followed. Run "sudo fdisk -l" and identify windows partition and then mount it using script given after fdisk output.

lnarasim@lnarasim-laptop:~/scripts$ sudo fdisk -l

Disk /dev/sda: 78.5 GB, 78518522880 bytes
255 heads, 63 sectors/track, 9546 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xd0f4738c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1958 15727603+ 7 HPFS/NTFS
/dev/sda2 1959 9546 60950610 f W95 Ext'd (LBA)
/dev/sda5 1959 4569 20972826 7 HPFS/NTFS
/dev/sda6 4570 4736 1341396 7 HPFS/NTFS
/dev/sda7 4737 4985 2000061 82 Linux swap / Solaris
/dev/sda8 4986 9546 36636201 83 Linux
lnarasim@lnarasim-laptop:~/scripts$

lnarasim@lnarasim-laptop:~/scripts$ cat win_mount.bash
#! /bin/bash

sudo mkdir -p /media/c
sudo mkdir -p /media/d

sudo mount -t ntfs -o nls=utf8,umask=0222 /dev/sda5 /media/c
sudo mount -t ntfs -o nls=utf8,umask=0222 /dev/sda6 /media/d

I have also come up with a simple shell script to do that. If you want, you can also add this in startup scripts so that Windows partition is mounted automatically after startup. With simple use of Linux commands, we are able to access Windows partition.

07 April 2009

Absorption and Agility - Learn from Animals

The recent days is testimony for many companies for their absorption capability. There are times when the companies should be agile in looking out opportunities and some times it so happens that they need to tuck their tail and sit idle waiting for opportunities. Sitting idle, as the words suggest, will not yield any benefits other than optimizing the operational costs. I remember that I read that in some business journals that the best companies in the world invest in innovation and making new products which supposed to take chuck of money. Being an uncertain time, many of us fear about the future's prospectus. It greatly applies to individuals also.

There are times when one needs to retreat and practice "wait and watch" game. And sometimes and the situation is in favor, we need to be agile to make use of the opportunity. Few months back, Microsoft's intention to buy Yahoo is an excellent example how things should not be done. Microsoft gave enough time to Yahoo and Yahoo thought that Microsoft undervalued Yahoo. The deal did not go through affecting the stakeholders of Yahoo.

If you ever wonder how to learn "Absorption and Agility", watch this video. We have to learn a lot from animals. Because, they do not have greed like human beings and their agenda is just to survive. I am sure, you will love it.

06 April 2009

Lip Service, Laziness and Five Years in Hell

My father was a teacher in state government and he has retired now. When he was in service, he used to go to election booths as presiding officer. When we were kids, he used to tell us about his election experience. There would be so many people inquire him about his election experience on how people stone the election booths. Generally he used to go to other constituency and during all his election duties he never stopped exercising his duty - casting his vote (through post) .My grandmother is now 80s and she never missed one. Check with your family, you will have many great grandparents who are still casting their votes and show us that casting votes is such an important one. But these days, the people are merely enjoying a holiday either watching movies or mini-serial or mega-serial. You have whole bunch of entertainment channels. Also, this time, we also have IPL. Whether it is Congress or BJP or XYZ, why should I bother? Whatever is going to happen is going to happen? I can always yell at politicians or my servant just in case the economy fails.

Sometime back, the senior advocate and journalist Mr Cho. Ramaswamy, in his speech said that people of this generation do not exercise their electoral rights properly. It was proven right during that time that a by-election in TN registered a record polling of 90%. God and politicians only knows how they made the record. Sometimes, even God does not know. When we are not going to exercise our votes, there are two things that can possibly happen. Either someone cast your vote or wrong candidate has been selected to represent you because you did not vote. When you sum up, both the cases is sufficient enough to take our country backwards. If you are going to assume that no one will cast your vote other than you, you are dead wrong. This is secret for record polling. With this economic recession, the prosperity will be evaporated if a wrong party or party with protectionism comes to power. So, use your voting rights to pick the right candidate and right party.

Let us make this place a better one for the future generations. Let the future generations know that their great grandparents are visionaries and thought leaders. If you choose the other way, the next five will be "hell".

04 April 2009

Speaking experience @ VIT, Vellore

This is the first time that I am visiting to Vellore and Vellore Institute of Technology. Today, I happen to be there for a talk on Linux Process, POSIX Threads and Linux Scheduler as a part of a workshop on "Open Source Initiatives and Linux Kernel Internals" organized by School of Computing Sciences VIT. I was very fortunate to share the speaking podium along with eminent and highly accomplished Prof. Dr. C N Krishnan and ILUG-C co-coordinator Mr. Bharathi Subramanian. We started in Chennai around 6 am and reached Vellore at 8.30am. The faculty members and Director gave us a warm welcome.

Around 9am, we headed to the auditorium for the workshop. The first part of the workshop is on NRC-FOSS. Dr Krishnan covered the agenda of NRC-FOSS (Phase 1 and Phase 2) and why FOSS makes sense to India. It was insightful and towards the end, I could find many students charged up to take open source in their mainstream learning.

Next, I spoke on Linux Process Management, POSIX Threads and Linux Scheduler. The students were very much interactive and had a lot of enthusiasm to ask questions. I too felt that some questions really made me think. After my talk, Mr. Bharathi took the session on Linux Device Driver and showed how to write simple kernel module and simple dummy character device driver. Again, this talk helped me to refresh whatever I learnt some 3 yrs back.

During the workshop and throughout the day, we received an excellent hospitality from the faculties and students. Overall, it was another productive Saturday and I can sleep with a lot of satisfaction. You can view some of the pictures that are taken during workshop @ here.

02 April 2009

Be an agent of Change

Have you ever thought that this generation is going to do a turnaround. This is going to be a history in evolution of mankind. We saw a dreadful effects of hyper leverage, the retirement funds of many senior people eroded, lifetime wealth were gone without traces and the economy has come closed to a depression, if not grinding halt. We thought that "entry today" and "exit tomorrow" is a great game. Having said that, today, many organizations, business leaders and most importantly policymakers, economic experts are trying to make this as turnaround. We are in the verge of witnessing one more revolution which, I believe will take the economy and mankind to next level. I am sure, we will and it is just a matter of time. If each one of us take part in this change, I feel, the recovery will be fast and post recovery will be great. How can you take part in this change? Read on.

The concept is going to be simple but difficult. As Scott Berkun used tell, if something is simple, it doesn't mean that it is easy. Many simple things in the world are difficult. For example, consider a mother giving birth to a baby. The doctors and even some elderly folks many know that the process is simple. But they will also agree that it is difficult. The work of the security guard is simple - to continuously watch the trespassers. But it is difficult to watch consistently. So, many things in this world is simple but yet they are difficult.

Similarly, it is very much easier to say "be an agent of change" and it takes a great deal to be the agent and consistently trace the agenda - wellness to mankind. When I write this, I hear a good news from US of some data better than expected number. Can we try to shorten our turnaround time? Yes, it lot depends on how we work and face the challeges in front of us. This is the time that we should demostrate a state of high productivity and fully focussed on the work. It is the time that we show some mercy to people who lost jobs and try to help them to find their way. You can try to impart your knowledge to next generation and take sometime to make "education poverty (illiteracy)" a history. When economy recovers, the entire mankind should have a reason to cheer and not just few "so called" gifted souls.

Make use of this time to build your home, town, state and country. After a year, the economy will take of itself and show a great recovery. Think about this. What will you do if economy recovers? How do you want to see your people in a recovered economy? Don't we like to see a green ecosystem, dont we like to see computers in village schools or showing computers to these kids at least once. Devote 5% of your time to others. Believe me, it is not spending your time, it is investing. If you invest now, you will eat fruits, and then your generations. If you don't do, then, you will be a history and so is your generations.

This is the time to be a agent and hero or to die.

Happy Recovery :-)