Thursday, June 25, 2009

Reason for (infamous) segmentation fault / Core dumping

It is seen that inspite of capturing lot of requirements and coding meticulously, the code which we wrote is bound to some kind of core dumping at certain point of time if it is part of large application / system.

Many of the analysis of the core dumps through debugger always point to something which was totally unexpected while coding, some kind of input which is not expected and not taken care.

In a large application, it will be very difficult to ensure that all the methods / functions behave properly and gives you the right return everytime for the next functions / methods which is a very much ideal / perfect situation.

One way of encountering it is to make your method takes care of such unexpected inputs which is like conquering the hell to make heaven safe because you never know what hell can be of. I feel this is very difficult or next to impossible in a large system.

So, the next easier way of dealing with the same problem is to check your input before you processed or passed to your methods / functions. This will ensure that atleast your code don't dump because somebody feeds you something wrong. It is simple logic GIGO (Garbage In and Garbage Out). Check the input reject it if it garbage / unwanted to your code. I think this will resolve as much as more than 90% of your core dumps provided you code it as expected with your sets of input.

Thursday, June 18, 2009

New found Passion : Stock Marketing

I was looking all the possible options so that my wife won't sit idle before she get a job. The kind of criteria which she is looking (and I prefer) - near and good in place like Mumbai will take time to realize. I hit upon the idea of making her spent time on stock marketing. Since past few weeks she started reading business pages (which was non-existent till yesterday), business sites and sites which gives readings of sensex. Even I suggested to keep an eye on some companies which is worth the investment according to me for a long term. While trying to help her, I slowly started having interest in stock. It's now a new found passion for me.

I took back the password of my demat account which was with my uncle since I opened the account. Today, the moment I reached office, I bought shares of NTPC and Satyam Computers.

NTPC because it is PSUs and the upcoming budget may have something for power sector as the need of power is going to manifold as India progresses.

Satyam because after the change of guard it is going to do better. Satyam has the manpower, infrastructure and process to do well in some point of time. The effect of scandal is slowly mitigating and things started improving. It will be back to its original position in some point of time.

These were my reasons for buying. I listened to my colleagues who were in stock market since long time but, I took little or no advice from them as it is going to my own hard-money to be invested. So, I want only myself to be blamed if things goes busted or worst.

Both the shares I bought showed some profit in the beginning. But, after lunch time both are in RED. Let's see what happens in long run.

Some more investment will happen soon but, not much.


Caution : Investing in share market is like tiger waiting for prey

Thursday, June 11, 2009

To make other happy !

Sometimes, we do certain things which only to make someone happy but, not ourselves even if we aren't enjoying / happy doing the same.

I'm doing introspect of such things in my life in past few years as far as I can remember very well and vividly.

Such things which I did for the sake of someone's happiness had a common link. They were all disastrous to me at the end. No wonder that they were disastrous because they were done half-heartedly with no much intention.

Sometimes, it became too stupid to continue and I found myself almost stuck in some senseless situation. Moving out of the situation was rather difficult by that time with so many things on stake and liability.

By the time I moved out of the situation, I lost many good friends and well-wisher by then and also earned bad reputation from other.

And, for myself I earned bad memories which is going to haunt me for a long time and which can't be undone easily.

Don't do things because you want to make someone happy. But, do it because it makes you happy.