Thursday, December 29, 2011

Calling Member function using NULL pointer

To my surprise, my program did not crash when I called display() by NULL pointer, but it crashed when I tried to access member variable.

#include


#include

using namespace std;

class Test

{

public:

    int p;

   void display() {

       cout << "Test::display()" << endl;

   };

};



int main()

{

    try {

       Test *t = NULL;

       t->display();

       t->p = 5;

    } catch (exception &e) {

      cout << "Dereferencing pointer: " << e.what();

   } catch (...) {

      cout << "Unknown Exception";

   }

   return 0;

}

 

Friday, October 28, 2011

Story behind Sonia's Sacrifice to be a PM

Information on eligibilty to be a PM of India.

Eligibility:
Article 84 of the Constitution sets the principal qualifications one must meet to be eligible to the office of the Prime Minister. A Prime Minister must be:

- a citizen of India.

should be a member of the Lok Sabha or Rajya Sabha. If a person elected prime minister is neither a member of the Lok Sabha nor Rajya Sabha, then he must become a member of the Lok Sabha or Rajya Sabha within six months.

- of above 25 years of age (in the case of a seat in the Lok Sabha) or above 30 years of age (in the case of a seat in the Rajya Sabha).

- for an Indian citizen of foreign nationality, the principle of reciprocity is applicable i.e. the same rules as there are in that particular nation for foreign nationality.

Sonia is not indian citizen by birth, so if Italy allows a person to be a Prime Minister who is not born in Italy, then only she can be PM of India.

Many Congress party members (including MPs) say that she sacrificed, better they know our constitution and then talk.


--kova

Thursday, June 2, 2011

DRS woes

India has been opposing DRS for a while now and only way to make it happen is making it compulsory for a tournament as it happened with World Cup. I agree with India (for that matter Sachin/Dhone) that DRS is not a foolproof. I watched first test between England vs Srilanka. In Second innings of Srilanka, Dilshan was given out cought behind. He went for Referral. There is nick (visible that ball kissed gloves), but hotspot failed to notice it. There is deflection, there is noise, ye hotspot did not pick it up. It brings again same debate whether we should use technology which does not give correct results all the time. Its better to use DRS on experimental base and its upto teams which want to take part in these experiments.

Sunday, April 3, 2011

Jaya Ho - Team India

Team India achieved Amazing, Spectacular, Fabulous and Famous World Cup Victory. Its quite emotional when we see final scenes and it seems it has the ability to erupt memories of 2003 World Cup Final and 2007 World Cup early exit.

Its quite unusual behavior from Sanga at the toss, he could have clearly conveyed what he called at the toss but could not do and again Martic Crowe messed up things in World Cup final, he could have asked Dhoni to flip coin again immediately if he has not heard what Sanga said. Sanga messed up with toss and messed up with team selection. There are four changes in a team that won in Semis and it says how much he worried about indian batting line-up. Experts and Many people are thinking that Srilanka is better side, but the man who should believe it has doubts.

Sanga was very defending in his team selection, bowling options. He used every bowler before Murali hoping that whatever he can get from others, is a bonus. Though the batsmen in the middle are good players of spin, Murali would have an effect. 

On other hand, Dhoni has shown clarity in thinking and fearless attitude once again. He was not hesitant to flip coin once again, though it looked like he won on first attempt. Dhoni has taken a brave decision by promoting himself ahead of Yuvraj, who is in form through out the tournament and it paid off. No wonder, Fortune favors the brave.

On field, Dhoni was Superior captain than Sanga and he deserves to lift the cup.Before the final, many people has put both the captains at same level, but it seems Dhoni is far better than many including Sanga when it comes to handling pressure and when it comes to play Boldly.

Team India is CWC 2011 Champions.


@kova

Monday, March 28, 2011

All the Best Team India

Too many stories, reports and analysis on India vs Pak semi-final match on Mar 30, 2011 in Mohali are on air, I say only one thing - All the Best Team India.



Kova







Saturday, January 1, 2011

Happy New Year 2011

Every New Year brings new hope, new energy and sense of optimism. I wish we will have less scams, people are more responsible and accountable. They will not be greedy for 1 or 2 Rs in Public Transport [In Karnataka, we have a tradition that instead of taking a ticket of 7 Rs, People would love to give 5 Rs to Ticket Collector and travel and Ticket Collector accepts it Happily]. I pray GOD to give more patience to people to fight for legality of things, to be honest as much as possible and do not pay bribe for Driving License, Household Cards, Birth Certificates, Caste Certificates, any kind of NOC [No Objection Certificates] etc.


Wish You All Happy and Energetic New Year 2011.


@kova