M G Harish

Thursday, November 22, 2007

A formidable process: Indian Postal Service

Last week, as a part of our general training, we were being introduced to Software Engineering, wherein we came across the three most important things which render a project successful. They are: people, process and technology. The instructor gave an example of how a formidable process can make the entire organization superior. He took an example of the Indian Postal Service (officially known as India Post), which, in spite of a lot of difficulties, has been giving a promising service for over 150 years. I think that example is extremely thought provoking, and that is the reason I'm jotting down this article.

Let us quickly review the conditions under which the Indian Postal Service is working:
  • Letters can be sent to any place in India, from Ladakh to Kanyakumari, from East to West, from metros to remote villages and delivery is ensured.
  • With 20+ official languages and 24 languages being spoken by more than a million people, the diversity itself is a serious problem for India Post. But there is no rule that instructs people to write address in a particular language; you can write a letter to Uttar Pradesh writing address in Kannada, and still it reaches.
  • Address in any part of India (excepting a few regions) is messed up, with "near" and "Opp." taking most of the address lines and sometimes only name and city is mentioned (Yes, it's hard to believe, but I am not exaggerating. It happened with my father, in which only the surname and city was mentioned in the address). As against this, for the postal services of other countries, door number/street is compulsory.
  • Most people sending letters will not know the PIN (Postal Index Number) of the destination or they won't write it. Even worse, they sometimes write wrong PINs, but the people in the Post Offices are generous enough to correct the PINs and send it to the correct recipient. Contracting this, postal services in many other countries require PIN or ZIP codes specified, or the post will not be delivered.
Had we ever thought about all these? This is not a era when someone discusses why a postal card or an inland letter is not reaching properly. With telephones and mobile phones becoming a necessity and the Internet being the medium of fast communication, no one bothers about the snail mail. Also, when it comes to the public services, India is considered to be a close competitor for the last position. But, as I said, the example of the Indian Postal Service instantly changed my mindset and made me think and rethink.

Apart from all those constraints mentioned before, the number of posts undelivered is just about 5 per million. Very close to Six Sigma quality. And all this happens with no written rule. Such a quality service is possible only due to a formidable process and equally eminent people working in India Post who adhere to this process. There are a very few other such systems in the world, which always provide their 100%, yet remain unnoticed... Shouldn't we be proud of such systems?

Tuesday, October 30, 2007

Shortcut to Success?!

Well, it has been quite a while since I posted an article in this blog. That's due to the change in my dwelling place as well as my entry into the corporate world. Now I'm residing in the beautiful garden city, Bengaluru (Bangalore). I'm not going to write more about that now, but let me discuss an issue in which the current generation is getting attracted towards: finding shortcuts to success.

What is the most sought thing today? Probably, for most of us, it's money and nothing else. A more important issue regarding this matter is that everyone wants money, but without or minimal effort. But is it achievable?

There have been a lot of organizations which offer a huge money for a small investment, and there are a lot more people who go for them. With the advancement of the Internet and the means of online payments, it is growing even more rapidly nowadays. From offline firms like Amway to the online communities like agloco, from the antiquated firms like AllAdvantage to the emerging ones like eBiz and GISH, each of these firms has its own claims as to how the customer is able to earn a lumpsome amount. They promise to make you a millionaire in a year or two, but none of them has succeeded in this regard till now. Has anyone seen a person who is competing for a place in top 100 in the Forbes magazine just by participating in such organizations and making people members?

I'm not here to accuse these firms as frauds or to compell people not to join them. Each one has the right to do what he/she wants to do. Then why am I writing this article? I just want to share my yesterday's experience here.

My friend called me up requesting me to come to ITPL yesterday evening. He didn't tell any reason, but still I made sure that I went there. It was only after I met him that I came to know that he had called me to give a presentation about GISH, and now, I know that it has turned out to be a very good reason for me to write this article.

It was all about joining this organization by investing some amount initially and then urging others to be a part of it too. For every pair of members that you make, they give you 1000 bucks. And if you are able to have a certain fixed number of customers downline in a prescribed time period, you are eligible for some extra privileges by GISH. But that's not what matters here. An interesting figure he told was that even if you do only one pair of members in a month and consider the same rate of logins by those members and their downlines also, you'll end up with 212=4096 members at the last level in one year. So it's not a big deal to have a large number of people down the line. Seems interesting right? Just think, can you continue with the same growth rate for the next couple of years?? You'll have to have 230 pairs, which means 68,719,476,736 people. Current population of the world is just 10% of that. Where on the Earth do we find those many homosapiens then? Do we have count and include ancestors too and make them members?? There is no shortcut to success. Hard work can only fetch you what you want.

I forgot to mention, the presentation started with the expansion of GISH: Goals, Income, Savings and Happiness. According to the presentor, achieving Goals brings you Income, which when Saved, will give you Happiness. But does money alone ever bring happiness? Every insightful word or adage or Shloka tells that money is the cause of all the sorrows of man. As Adi Shankaracharya has described in Bhajagovindam:

अर्थमनर्थं भावय नित्यं
नास्ति ततः सुखलेशः सत्यम् |
पुत्रादपि धनभाजां भीतिः
सर्वत्रैषा विहिता रीतिः ||


arthamanartham bhaavaya nityam
naasti tataH sukhaleshaH satyam ||
putraadapi dhanabhaajaam bheetiH
sarvatraiShaa vihitaa reetiH ||

Meaning:

Wealth is problem - think deeply on this
There is no true happiness from that
A rich man is afraid even of his own sons
This is true everywhere and forever


Now tell me, do you still think that you can become rich overnight? And even if you do, does that bring you happiness? It is up to you to think and decide what you want to go. Whichever path you take, I wish you all the best!

Wednesday, October 03, 2007

What do you think of yourselves, MindTree Minds?

They were humble, elegant and more social than they are now. They had never shown this frog-in-the-well attitude until that fateful (?) day they got recruited to an Indian multinational company called MindTree. I'm talking about my own classmates and friends who got entitled MindTree Minds when they got selected.

I have been observing this attitude not only in my classmates, but also in friends in other colleges and juniors too. There are a few exceptions, nevertheless. But I stress, only a few are still the same as they were before. What makes me post it here? Because the so called MindTree Minds:
  • act as if MindTree is the only IT company in the world.
  • don't generally combine with people other than MindTree recruitees as they used to be.
  • show off that they are recruited to MindTree.
  • talk about the company all the time.
  • think that they are superior to others, while the truth is that some of them got selected by sheer luck.
I don't know what they think of themselves. Are their minds rotten to the core to be unable to understand the simple fact that they may not be in Mindtree forever? The sooner these vain mindtree minds understand the reality and come out of this dangerous egocentric syndrome, the better. As MindTree tag-line itself says, a tree is known by the fruit it bears. Mind it and get a life, folks!

Your honest opinions are welcome.

Thursday, September 27, 2007

Free SMS for Karnataka Spice Customers!!

With all the Cell phone operators increasing the charges for SMS, it has been a difficult time for the students and those who rely upon SMS for the communication most of the times. Spice, Airtel, Hutch all have increased their tariffs to 5 paise or above. But a week ago, my friend RJP sent me a message telling a trick to get free SMS. This works only for Spice customers in the Karnataka circle.

Change your message centre number in the message settings from default number to +919810051913 +919840011055 +919810051873.

A few notes about this trick.
  • It works only for Karnataka Customers.
  • All messages are completely free.
  • This works only for Spice numbers which start from 9964.
  • You can't recharge your mobile by sending SMS with this message centre. You have to revert to your old message centre, recharge and then put this number back on.
  • The specified message centre is Broadway II Gateway number.
  • Even interstate messages are also free.
Just enjoy the free messages as long as Spice finds this out and corrects this bug. I owe you a lot RJP :)

Tuesday, September 25, 2007

Wonder at the Wanderers!!!

First things first. Congratulations India for winning the first ever Twenty-20 Cricket World Cup. Congratulation Pakistan, for posing a spectacular final at the Wanderers stadium, Johannesburg.

Champions: Indian Team celebrating after winning final of Twenty-20 Cricket against Pakistan

It had all the ingredients to be a tooth-and-nail fight, a treat to watch out for anyone, even remotely connected with cricket, in and around the Subcontinent - a dream contest between the traditional rivals.

Let's set aside the result for a while and look how it fired up every one in the contending countries, especially in India. Even the fussiest roads were cool and calm as country-yards, even the money minded IT companies, which want its workers to work on Saturdays too, had allowed its officials to call it a day a bit early. And, everyone, no matter interested in cricket or not, watched at least a part of the match. After all, that's how it works in a country where cricket is a religion!

Now to the result of the match. Who in this world has imagined that the team India would win? A team which had no veterans playing, which had no regular coach, which had just got a new captain to lead the team and which had a bunch of novel players half of which hadn't played even a single international T20 game. What a wonder! But that's cricket for you! Anything can happen until the last ball is bowled. India somehow clinched the cup, but the real winner was the game, as Sunil Gavaskar told after the match.

The aftermath? Celebrations in India at least for a week, a warm and grand welcome and pouring cash prizes from each corner of the country for the players forgetting the past performances, and what not? The players can sigh a breathe of relief after what happened in the World Cup earlier this year.

Foot ball to start with, then hockey and now Cricket!! Can this be a CHAK DE INDIA magic?!

A final punch: Forget cricket, former President APJ Abdul Kalam's dream has come true. India has become a strong power in 2020!

Monday, September 24, 2007

One-liner ABS Function using Binary Operators

A few days ago, my friend TJ, who always keeps finding innovative programming challenges, asked a question: "Can you implement abs() function without using any relational operators in C?". But he also insisted to do it without using if, for, while etc., any control and loop structures for that matter.

I immediately came up with this:
abs_x = sqrt(x*x);

But he is not a guy to get contented with such an answer. He told that sqrt() internally uses relational operators in its implementation. Well, true. The sqrt() function that is included in math.h uses series expansion methods, which use if() statement in one or the other way. So I had no choice but to find some other way. After struggling a lot, I came up with this which uses only binary operators and arithmetic operators:
abs_x = (x^((((x&(1 << (sizeof(int)*8-1))) >> (sizeof(int)*8-1)&1)*-1)) + (((x&(1 << (sizeof(int)*8-1))) >> (sizeof(int)*8-1))&1);

The sizeof() opeator is necessary only to generalize the expression for any size (16 bit or 32 bit) of the integers. Otherwise a smaller version of the same would suffice.

For 32 bit integers:
abs_x = (x^((((x&(1<<31))>>31)&1)*-1))+(((x&(1<<31))>>31)&1);

or
abs_x = (x^((((x&0x10000000)>>31)&1)*-1))+(((x&0x10000000)>>31)&1);

For 16 bit integers:
abs_x = (x^((((x&(1<<15))>>15)&1)*-1))+(((x&(1<<15))>>15)&1);

or
abs_x = (x^((((x&0x1000)>>15)&1)*-1))+(((x&0x1000)>>15)&1);

Does it seem complicated? As we know, in C, numbers are represented in Two's Complement method. In 2's complement method of representation, the most significant bit represents the sign of the number. This bit will be 0 if the number is positive and 1 if it is negative.

The idea is to first check the most significant bit of the number. If it is 1 we need to negate the number. To negate a number, we should find the one's complement the number and add 1. That is what is done in the above expression!!

Do you think it's a great piece of one-liner code? It would have been, if it was impossible to simplify it further like swapping code posted before. Yes! It can further be reduced! Look at this code:
abs_x = x*(-2*(((x&(1<<(sizeof(int)*8-1)))>>(sizeof(int)*8-1))&1)+1);

For specific length, it looks like (for 32 bit integer):
abs_x = x*(-2*(((x&(1<<31))>>31)&1)+1);

All this code does is to multiply the original number with -1 if it is negative and with 1 if it is positive! Short and sweet one-liner, isn't it? But I can't say it's the shortest like I did in my earlier post. Feel free to express your opinions!

UPDATE
I guess thinking a lot certainly helps! I was able to find a still shorter one-liner!!
abs_x = x+2*x*(x>>(sizeof(int)*8-1));

Can I say this is the shortest? I still doubt!!

Monday, September 03, 2007

Beauty is in the eyes of the beholder

This is an era where everything is concluded with the result of a contest or a poll. Beauty isn't an exception. Beauty pageant, however, is not only based on the external appearance, but also the wit of the person. Nevertheless, errors happen and wrong persons get through various phases in the contest and, sometimes, even emerge as the winners despite having no brainpower. One such example happened in Miss Teen 2007 contest in USA:

Miss Teen South Carolina 2007, Lauren Caitlin Upton, screwed up her response to the question:
Recent polls have shown a fifth of Americans can’t locate the U.S. on a world map. Why do you think this is?


In case you are unable to follow what Miss Lauren Caitlin Upton said, here it is (What she might have intended to say, is emphasized using bold letters)
I personally believe that U.S. Americans are unable to do so because, um, some people out there in our nation don’t have maps and uh, I believe that our, I, education like such as uh, South Africa, and uh, the Iraq, everywhere like such as, and I believe that they should, uh, our education over here in the U.S. should help the U.S., uh, should help South Africa, it should help the Iraq and the Asian countries so we will be able to build up our future, for us.

In spite of going through this quotation many times, it makes no sense to me! But to err is human, and she has admitted her mistake and also has tried to correct her answer in a recent interview:
Well personally, my friends and I, we know exactly where the United States is on our map. I don't know anyone else who doesn't. And if the statistics are correct, I believe there should be more emphasis on geography.

Looks a bit cleaner, isn't it? Well, the real irony is that she went on to become the third runner-up in the Miss Teen USA 2007 contest!! As they say, beauty is in the eyes of the beholder, and the judge must have seen something special in Miss Lauren Caitlin Upton, may be humor, to pick her as Miss Teen South Carolina 2007!

PS: This blog crossed the landmark of 10000 visitors today.