Tuesday, December 23, 2014

#EvilCode 0001 : Lambda and Ref/Out.

What would be output of following ?

        static void Main(string [] args)
        {
            List< int> numlist = new List< int>() {1,2, 3, 4, 5, 6, 7 };
            CalculateAndPrint( ref numlist);
        }

        public static void CalculateAndPrint( ref List< int> Num)
        {
            var n = Num.Where(d => d > Num[2]);

            foreach ( var item in n)
            {
                Console.WriteLine(item);
            }
        }

The most obvious answer is 4,5,6,7. However that's not. This code refuses to compile because Lamba expressions  cannot accept variables that are declared in an outer scope.

Thursday, November 27, 2014

Back to blogging

It has been a long time since I blogged. In fact, it has been a long time since I put my thoughts on paper. But certain recent events has given me a lot of time for myself and this probably would be a good opportunity for to start blogging once again.

Having said that, writing has never been my forte. It is just a canvas for me to put down the thoughts which otherwise would have just wandered in the vacuum between my ears. May be, years later, these thoughts would be something i would laugh at.

Anyways, here I am, making a promise to myself to start blogging. Hope to add my next post soon.

Sunday, December 23, 2012

End of an Era


The phrase "End of an era" has never been so meaningful. This December, the curtains come down on career of a man, because of whom, millions like me watch cricket. The Mayans was right, Dec 2012 has a dooms day.Post Dec 23, Cricket will no longer be a religion, a single anthem will no longer unite a billion heart, the blue jersey will no long bleed blue, and there won’t be the fanatic scream of joy echoing the stadium when the helmet is kissed and bat salutes the sky. Dec 23, 2012 will be the day Sachin Ramesh Tendulkar will retire from ODI cricket.


I will not speak about Sachin’s records or accomplishments here; I am too small a person to comment on that. In fact we all are. I will only be speaking about a person who has inspired me innumerous times for past 2 decades.

For a person who seldom follows politicians or have have brains to follow some of great thinkers of my time, Sachin is my only hero. Everytime I am feeling down and is looking for motivation, i check out some of his greatest innings. From operation Desert Storm to Thunderbolt that struck Pakistan in Centurian 2003, from fighting physical pain at Eden to fighting mental agony during 26/11 Homage, every innings tells us a story, story off how a small boy became a man and a man became revered hero. His longivity is a tribute to his passion for the game. It also makes us believe that if your profession is your passion (whether its cricket or software) and you sincerely work for it, then nothing is impossible. All it needs is single minded determination and eagerness to learn every day, just like how the master showed us in past 23 years.


People call him God and God he is. If being god is to inspire and bring joy to people irrespective of their social or economic status, then yes he is god. If being god is to unite people irrespective of their faith or political boundaries, then he is god. He who brings sunshine even in darkest hour, bring along positive energy and encourage common man to dream, is definitely God to me.

But inspite of all this, when people called him god, he said he just wanted to be known as a proud Indian. That’s Sachin for you.

As every good thing has to come to an end, so has this saga of 23 years.As a die hard Sachin fan, it is a sad day for me but it is also a day we should celebrate a genius who cannot be replaced. If there is any regret it is that he did not receive the standing ovation he deserves. Game of cricket will move on and will see many great batsmen, but there won't be a better cricketer than Sachin Tendulkar. Period.

RIP ODI Cricket.

Monday, November 19, 2012

DAL ROTI - Avoid the place like plague



I haven’t written a blog for ages, but a certain incident that happened on a bright Sunday has made me to take up scribing again.

On Sunday, 18th Nov, 2012, me along with two my friends, set out to capture the beautiful Fort Kochi through our viewfinders.  4 hours of roaming under the hot sun left us dead tired and starved. What better than having a biriyani from Dal Roti (situated in Fort Kochi), I thought. A thought, which I would be regretting within minutes.

We entered the place and kept our bags aside. The owner himself came to take order and we order 3 biriyanis. To kill the time till our lunch comes in, we got chatting within ourselves.  While chatting, one of my friends took a sip from a bottle of Limca he was carrying. What happened next was unimaginable.

The owner came rushing towards us shouting abuses. Initially we were stunned, unable to understand what just happened. Then we realized that he was saying outside drinks are not allowed within the campus and that’s why he was shouting. My friend, with all politeness told him that we didn’t know it and we will keep it away. He then starting shouting that it is written in the menu and how can you say that you didn’t see it.

With all politeness we explained to the guy that, no one would be reading everything in a menu item, and would be just reading what he/she is looking for. This guy just continued shouting at top of his voice as if we have had alcohol. We clearly told him that it was just a bottle of Limca and we had opened it without knowing the rules.

But this guy was clearly out of his mind and was insulting us in front of rest of the customers.  Despite all that, we maintained our own dignity and never said anything with a raised voice.

Isn’t India a place where Guests are supposed to be treated as gods?? Forget gods, I felt this guy should have atleast have decency to inform us in a polite way about the rule. How on the earth would a customer look for rules in a menu card ?? And any sane man would first have the courtesy to politely inform a rule being broken before shouting at right?

And you wanna hear what happened next ? Back at home, I made sure I put it up in their face book page. You would be shocked to hear that the man said he is going to sue me for it. If this is the way he is going to take customer criticism, then he clearly showed that he lacks something in life.

Now, this is not an isolated incident. I checked out the Trip Advisor and found plenty of complaints about this guy. He has multiple faces when it comes to talking to an Indian Customer and a Foreigner.  Check for yourself some of the reviews which I took from Trip Advisor. There are plenty more like this.





Here is the post from DAL ROTI Owner in the FB Page, which he later removed.

Now you guys decide, whether you would like to visit this place again ? I would say, THINK AGAIN

Wednesday, June 27, 2012

Do's and Don'ts at Wild


I recently visited the Periyar Tiger Reserve and even though I wasn't exactly trekking, the boat service which I took was enough to mesmerize me. The dense forest, engulfed with mist the beautiful man-made lake at its heart. If you are seek peace, this is the place to be.

I will go on and on if I were talk about this place, but my intension of this blog is something else.  Hundreds visit the sanctuary every day, but how many of them truly are here to see the fauna found here ? Out of the people who seek the wild sighting, how many understand the do's and don’t of the place ? I would say, only very people who come to the place actually maintain the rules that is required within a forest.

There was this 5 member gang in the boat I took who were constantly chatting and laughing loud for the entire duration of the trip. The primary rules while visiting any wild or bird sanctuary is to maintain salience.  The forest is home to these animals who seek safety within its dense vegetation. Human voices alerts them and they will move away from the source of noise.

But not everyone understands it or bother to understand it. The above mentioned guys in boat were laughing so loudly that even humans would be scared off, let alone poor animals.  How I wish I had power to throw them off the boat. It wasn't just this group, there were others as well. Two women sharing their stories of latest episode of TV Serial, kids who were left to make noise by unconcerned parents and the list goes on.

Here is a small list of do's n don'ts I really wish people maintain during such trips.

Don’t expect to see animals  - Ironically that's the first rule.  Expectations can frustrate you and can lead to do things which you aren't supposed to do. You need to be extremely patient.

Maintain silence  - Avoid unnecessary chats . Its going to scare away the animals. Keep your mobiles in silient mode. Remember, Unnatural sound and natural wonders don't mix.

Leave kids at home - This might be cruel, but kids too young are better to be left at home.  They get too excited or scared at wild sightings which will again scare away the animals.

Don't wear flashy dresses & Don't wear anything that smells unnatural - Animals have a better  sense of smell than us. Anything unnatural and they would prefer to seek safety of wild.

Don't use Flash when taking photos - Avoid usage of flashes when shooting animals.

Don't feed animals - Animals know to look after themselves. Please don’t trouble  yourself to feed them, it might hurt them.

There are many websites in the internet which provides you detailed description of does and don'ts in wild. If you really enjoy the forest and want to see animals in their natural habitats, make sure you read them before go in.