December 24, 2012

An unforgettable incident

This incident that happened to me some time in August 2009 just before I was leaving for France. The first part of what happened is fresh in my mind but what followed is really hazy.

I was with my mother and we were doing some shopping at M.G. Road, Pune. Because it was raining and I had parked my car about 500 m from where we were, I asked my mother to wait near a sandwich shop that had some shelter. On reaching my car I realized that some one had parked a car right behind my car. Normally, under such "normal" circumstances, there is someone sitting in such cars but sadly no one was there. Luckily there was a parking attendant who hands out parking tickets but he was of no help. I  got into my car and honked a couple of times to get some attention but then no response. I remember waiting for slightly more than two minutes but then my patience ran out thanks to the pouring rain. I asked the parking attendant if there was a police van nearby because I wanted to complain, but the poor guy gave me a helpless look. I asked him to help me flatten the tyres because I did not want the car to leave when the police arrive. On seeing us bending near the tyres, two guys and one girl who were in the shop right in front of my car came running towards this car. I remember seeing them in the shop when I honking and they could see me all this time. The two guys then rolled their sleeves and asked, "itni kya jaldi hai. kaunsa bada kaam karne jaa rahe ho" (why are you in a hurry? what important task are you going to do? .. and something of that crap).  I was pissed off and I said something like "chal chal chup chap gaadi nikaal .. behaas karne ke liye time nahi hai " (just move your car quietly.. i do not have time for you guys). One of them replied, "abe gaadi nahi nikala to kya karlega be tu " (what will you do if I do not remove the car). On which I replied, "police ko bula uske baad dekthe hai kya kar sakta hun" (call the police and we will see what I can do). Then they started showing their true colors and one of them said, "Police ki dhamki kise deta hai be.. Tu jaanta hai hum kaun hai .. law students.. aur hamare ghar main saare lawyers hai..  kya kar lega be tu .. ek case main ander daalenge jindagi bhar court main sadta rahega" (why are you threatening us with police, you do not know who we are, we are law students coming from a family of lawyers, we will put you in some case where you will rot running from one court to another). At this I got really pissed off and before I could react, I heard something really nasty. I seriously do not remember who said these sentences, and the exact sentence, but it included something like "abe is chikne ko mere rape case main jail bhejte hai .. dektha hai kya karlega saala" (we will file a case saying this guy raped me) .. To be honest, I only remember the words (chikne, mere,  rape case, jail, saale) and most of which coming from the girl followed by some sentences and a laughter that still haunts me at times. I remember  dashing off to my car, starting it,  and blowing the horn. I do not remember exactly what happened next. When I had regained my senses I was in my car with the engine running and the parking attendant knocking my car window and saying saying "te gele saheb" .. (they have left). The first part of this incident is fresh but sadly most of the end is hazy.

There are many conclusions that can be drawn, but for some weird reason I am really glad in a selfish way that I locked myself in the car rather than getting involved in a fight. At times I feel stupid because I did not note down the registration number of the car. If I had a smart phone may be a picture of their car and so on. There are many things I could have done and many things that I should not have done. I am glad, as I said before in a selfish way, that I did not do the things I should not have done.

October 18, 2012

Grow up from religious adolescence

When I was a kid I really revered the people considered as saints. This childish reverence was shattered by a verse of the Bhaja Govindam song 
जटिलो मुण्डी लुञ्छितकेशः, काषायाम्बरबहुकृतवेषः। पश्यन्नपि च न पश्यति मूढः, उदरनिमित्तं बहुकृतवेषः
Though I am not well versed with Sanskrit, the essence of this phrase sifts the saints from the frauds. The verse translates to "Matted hair, shaven heads, amber and orange colored cloths (clothes worn by saints in India) are all a way to earn livelihood." The beauty of this verse is that it came from one of the most revered saint who lived in India. Sadly, we have not evolved enough from the time of Shankara. At times I also try to imagine what Shankara would have done if he had access to all the technological and cultural revolutions that have taken place in the last 150 years. Would he have still written about women in the way he wrote in the Bhaja Govindam? Would he have still called this poem Bhaja Govindam or would he have taken the approach of Spinoza to define the Brahman!

Though Sankara is not alive, some saints in India are willing to redefine the notion of being spiritual leaders. For example, in 2010 I had come across this wonderful piece of article titled "Confessions of Saffron Robe." This article reports that swami called Chennamala swami wanted to do a Basaveshwara and raised various questions on how religious organizations operated in India. He rightly pointed out that children should not be ordained ascetics because this amounts to child abuse. He also raised questions on how religious institutions act as a front-end for various ponzi schemes. This was a really nice step however it is a very small step and I wonder how long it will take us to let moral values hatch out from the cocoon of religion.

Despite such drops of reform in the ocean of religious insanity, the power of these so called saints has increased astronomically in the last couple of decades. This occult power has intoxicated them to an extent that, rather than exhibiting humility and selflessness, these so called saints now claim their superiority by declaring themselves to be Gods or reincarnation of the Gods! Any sane person who can think rationally would use the Internet or other technological revolutions of the past decade to see the naked lies of such emperors. However, rather than using the knowledge gained in the last century, technology is being used to re-validate and re-affirm the blind faith in these god-men. For example, Indians have followed the blind followers of the American evangelists to create TV superstars like Asaram Bapu.

It surprises and worries me that a large number (majority) of Indians haven't grown out of their religious adolescence. What worries me more is that we have doctors and so called scientists who are used as pawns by these Gurus.

Does this so called Doctor who attends conferences in Cleveland actually believe that a photograph of Aniruddha Bappu saved his life? (PS: I always enjoy reading YouTube comments on religious videos).

Do you actually believe that this idol is drinking milk? Or would you like to reexamine this situation and consider effects like capillarity?

Do you actually believe that such a snake exists. Indeed if it exists and these images are not photoshopped, do you think that its existence can be explained by some genetic mutation or do you believe some supernatural power is responsible for its existence?

YouTube has innumerable videos that should have been used to remove the cloak of blind faith yet the comments on YouTube just portrays the extent to which blind faith makes people senseless.

One of the videos that I really like is the one by Christopher Hitchens titled "Hells Angel". In this video Hitchens uses Mother Teresa as a example for an objective analysis on the hidden agenda of all organized religions.

I just wish that people see videos like the following one rather than use the Internet to validate their blind faith and be pawns to ponzi schemes operating under the guise of organized religion!

October 16, 2012

Gender Equality to fight Rape

During the last few days the the number of rape cases being reported in news channels and newspapers across India have witnessed a significant increase. I do not know if this increase is because of increased news coverage, or the of the incidents of rape are indeed increasing, or a combination of the two.

Rape is by far one of the worst crimes in developing countries like India, primarily because the victim gets treated like a social outcast. And rather than addressing the root of this problem, gender inequality, our "honorable ministers" come up with weird solutions like decreasing the marriage age and minimizing the interaction of boys and girls. For the sake of debate let us assume that the marriage age is reduced to 16 and that schools, and other places of education segregate students based on their gender. Do they really think it will solve the problem? Will a girl/woman still report a case where she was raped by her neighbor, classmate, or colleague? Will marriage or caging women to rooms or making them cover their bodies and faces reduce this madness?

Based on my personal experiences, I believe that it will worsen the problem. I studied in a boys school and I was uncomfortable talking with girls (at times even my cousin sisters). The situation worsened when I went to college. Despite being a co-ed college (co-ed is what they call education institutes where girls and boys study together) the rows of benches were separate for boys and girls. It was the same during my engineering years. Things were not very different during my masters because the number of girls in IITD were really really low.  And even in IITD, and the other IITs, the hostels for girls are separate from the hostels for boys. This form of gender based segregation is not healthy. How many girls or boys in India are comfortable living in a hostel where there will share the facilities with people of the opposite sex? It was at the age of 28 and after sharing an apartment with girls that I started becoming truly comfortable with them. Until then I was a hypocrite -- a hypocrite who believed that he considered boys were equal to girls and whose penis started to do the thinking when a beautiful girl started talking with him after a bisou. It was my housemates in Nice, boys and girls, who truly taught me what it is to treat another person as your equal. Thanks to the internet and mobile revolution I am glad that my cousins who are about 10 years younger than me have had a much more healthier school and college life than I did. I therefore do not want the system to revert to dark ages when my nieces and nephews start going to college. I want them to have a nice time with their friends and classmates regardless of the gender of the child they want to spend time with. Reverting the laws shall undo the little progress that has happened in the last 20 odd years and shall only bring the dark ages back in India.

Marital rape is the other important issue that reducing the marriage age does not address. India is one of few countries where marital rape is considered a form of domestic violence, however, only a handful of the total incidents of marital rape are reported. Marital rape is even more heinous because the victim shares the roof and the bed with the offender. Like other cases of domestic violence in India, the victim bears this torture in silence. Silence for the sake of the family and kids -- all because of the social stigma and its impact on the children. The reason for bearing the torture by most rape victims is the social structure where the female is not considered an equal to their male counterparts.

The gender equality in developed countries ensures that the victim is treated like a victim and not the culprit. This is the least any society can do!

September 24, 2012

To Arxiv or not to Arxiv

To be honest, I had never cared about the copyright transfer forms and just blindly signed and submitted them while submitting the camera ready of my papers. I only hope that this does not change the next time I submit a paper. My concerns are based on the discussions in the networks lab (at the University of Washington) regarding the copyright held by ACM.

Based on the discussions I believe that I may have violated some of the ACM copyrights by maintaining author versions of my papers on HAL, an arxiv equivalent from INRIA. I personally prefer these author versions. The author versions give me the flexibility to update a future date if some additional text is required based on the discussions during conferences. Now based on the verdict, as reported by wired, against Aaron Schwartz I am worried.

Federal prosectors added nine new felony counts against well-known coder and activist Aaron Swartz, who was charged last year for allegedly breaching hacking laws by downloading millions of academic articles from a subscription database via an open connection at MIT.

“JSTOR authorizes users to download a limited number of journal articles at a time,” according to the latest indictment. “Before being given access to JSTOR’s digital archive, each user must agree and acknowledge that they cannot download or export content from JSTOR’s computer servers with automated programs such as web robots, spiders, and scrapers. JSTOR also uses computerized measures to prevent users from downloading an unauthorized number of articles using automated techniques.”
I do not know if ACM or IEEE will start suing authors who have only a few publications but authors like me are an easy target. In this regards, The Cost of Knowledge is a site that discourages the use of Elsevier as a publication platform. I believe that in the next few years a similar initiative might come up that discourages the submission to ACM. In the meantime I will still continue to use HAL and make my author versions available on arxiv as tech/research reports.

September 6, 2012

A variable length macro for logging in C++ without format specifiers

I wanted to write a simple logging module for c++. My requirements were simple
  • Nothing fancy but a simple macro to log variables. 
  • No format specifiers like "%s %d" and so on. 
  • Variable argument list
  • Use cout to dump the log messages. Later on this should support logging to syslog if required.
  • Easy to enable and disable with #if 0 and #if 1 declarations.
I did a couple of searches but then most of the implementations were heavy to use and I just wanted a macro that I could enable and disable before compilations.
The following is the simplest I could think of and come up with.
#include <iostream>

#if 1
#define LOG_DEBUG(param) do {     \
  std::cout << param << std::endl;\
} while(0); 
#define LOG_DEBUG(param) do { } while(0);

int main()
  int v1 = 10;
  double v2 = 100223.1212313;
  LOG_DEBUG(1<< " " << 3.5 << " " << "hello" << " " << v1 << " " << v2);
Output is as follows
$> ./a.out 
1 3.5 hello 10 100223

August 29, 2012

Getting Auctex working on Mac OS X

Here are the steps I followed:
*) ./configure --with-emacs=/Applications/ --disable-preview --with-lispdir=/Applications/
*) make
*) sudo make install

(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)

August 28, 2012

Template for SIG Alternate


% \usepackage[english,plain]{fancyref}
% \usepackage[colorlinks,citecolor=black,filecolor=black,linkcolor=black,urlcolor=black]{hyperref}
% \usepackage{amsmath}
% \usepackage{mathtools}
% \usepackage{amssymb}
% \usepackage{cite}
% \usepackage{verbatim}

% \renewcommand{\fref}{\Fref}
% \usepackage[labelformat=simple]{subfig}
% \renewcommand\thesubfigure{~(\alph{subfigure})}
% \newcommand{\tbd}[1]{[{\color{red}{\bf{TBD: #1}}}]}
% \newcommand{\etal}{\emph{et~al.}}


\title{Name here.}
\alignauthor Ranjha \titlenote{Real life dog detective.}\\
       \affaddr{Pratap Sharma.}\\
\alignauthor Zanjeer \titlenote{First famous dog.}\\
       \affaddr{Mumbai Police.}\\
\alignauthor Zanjeer II \titlenote{Inspired by Zanjeer.}\\
       \affaddr{Mumbai Police.}\\
\alignauthor Scooby Doo \titlenote{Time for scooby snack.}\\
       \affaddr{Mystery Inc}\\
\alignauthor Scrappy Doo \titlenote{Let me at him. I'll splat him.}\\
       \affaddr{Scooby's care}\\
\alignauthor Scooby Dum \titlenote{Dum Dum Dum Dum!}\\
       \affaddr{Mystery Inc.}\\





August 19, 2012

Theist or Atheist: My dilemma while using the Dawkins Scale

I wanted to find out where I stand on the scale of 1 to 7 in what I call the Dawkins scale of belief. While thinking about this scale I realized I have some serious issues with this scale. These issues arise because this scale does not account for pantheism (or the Advaita school of thought as it is known in India).

Spectrum of Theistic Probablity 

The details of this scale are as follows. The following is an excerpt from the wiki page titled "Spectrum of theistic probability" that details out the scale used by Richard Dawkins to quantify the degree of theism/atheism.
  1. Strong theist. 100 per cent probability of God. In the words of C.G. Jung: "I do not believe, I know."
  2. De facto theist. Very high probability but short of 100 per cent. "I don't know for certain, but I strongly believe in God and live my life on the assumption that he is there."
  3. Leaning towards theism. Higher than 50 per cent but not very high. "I am very uncertain, but I am inclined to believe in God."
  4. Completely impartial. Exactly 50 per cent. "God's existence and non-existence are exactly equiprobable."
  5. Leaning towards atheism. Lower than 50 per cent but not very low. "I do not know whether God exists but I'm inclined to be skeptical."
  6. De facto atheist. Very low probability, but short of zero. "I don't know for certain but I think God is very improbable, and I live my life on the assumption that he is not there."
  7. Strong atheist. "I know there is no God, with the same conviction as Jung knows there is one."
Pantheism vs Abrahamical Religions. 

I was curious as to where I stood on this scale; however, I faced a problem as I could not fit myself anywhere in this scale. This scale is perfectly suitable for the concept of God according to the Abrahamical religions.  People following such faiths can use this scale to quantify their beliefs.

Statue of Spinoza in Amsterdam. I had not heard about
Spinoza before my trip to Holland. For some creepy reason 
I was drawn to this statue and decided to take its picture.
I then read about this person after my trip. This had a domino
effect on my view of the world.
For me, the biggest hurdle in using this scale was the absence of Monism and Pantheism. Specifically, the forms of faith where there is no difference between the so called creator and the created. This problem is not new and is largely captured in various debates between the dvaita and advaita schools of thought in Hinduism. In the context of this scale, Dawkins tends to equate Monism (and also Pantheism) with not only Monotheism but also Atheism. This, in my opinion, is misleading and to a large extent wrong. Dawkins in his various books disagrees with such concepts and believes that pantheism is "sexed-up atheism." The essence of Dawkins beliefs is true. Indeed, the all forgiving Abrahamical God is completely different from the Brahman described by Adi Shankara and Nature described by Spinoza. Pantheism, however, is inherently different from atheism on many issues; the most important difference is creation, the bone of contention amongst all forms of beliefs. Despite these differences, I strongly believe that pantheism is more closer to atheism and has very little in common with monotheism.

From a Line to a Triangle (and Pyramid)

To address my dilemma I thought of drawing my thoughts on the various forms of belief and faiths I had come across. I am not confident of being able to capture all forms of faith in a planar graph, however the ones I have come across tend to fit in the following triangle. I must confess that at times I think of this as a top view of a pyramid with Agnostic at the top (and not bottom thanks to some atheistic arrogance).

I realize that I have navigated over the surface of this triangle (or moved within this pyramid) over the years. When I was young, I was on the line joining Monism to Monotheism, somewhere between Monism and Polytheism. With times, thanks to reading comics of Madhavacharya and Shankaracharya,  watching my great-grand mother worship Raghavendra Swami, and living with people from all over the world, my view of the world has changed. Currently I am slowly moving to the centre of the triangle having Agnostic, Pantheism, and Atheism as its vertices. At times, to save some time on useless discussions, I call my self atheist and an agnostic.

Position Fluidity 

I do not know where my beliefs shall converge before my last heart beat. I also do not know if this figure shall a) burst out to more dimensions with time, or b) converge to a simple straight line like Dawkins. I personally would have loved to have the clarity of people like Dawkins to simplify all the beliefs on a straight line.

I am certain that beliefs evolve with time for most of us. The sad things is that some people tend to retrace their steps and become born again believers of certain faiths. I wish and strongly believe that I shall not end up as one of them (whom at times, due my atheistic arrogance, I tend to call morons thanks to their weird questions).

Despite the differences in our beliefs I wish that each one comes out from the adolescence of blind faith and starts to think rationally and critically. Such rational and critical thinking is essential to shed light and be open minded on these issues. For starters I would recommend videos from QualiaSoup; I have embedded one such video that I found useful in becoming more open-minded.

August 17, 2012

Respect over Fear: A tribute to Harold Sir

During my school days at St. Vincents,  I had a physical training (PT) teacher whom we all knew as Harold Sir. I did not know his last name, Joseph, till I saw this obituary being shared on Facebook a couple of days back.

Harold Joseph, or Harold Sir to me and my classmates, stood apart from all the other PT teachers we had. Though he used to sit with the other PT teachers, in a room near the primary assembly area, he was visibly more disciplined than the rest. For example, one could easily spot him in a crowd -- you just had to find a person with the perfect posture. His spine would be as straight as any line can draw and his physique could put any olympic gymnast to shame. At St. Vincents the entire batch for a year used to be randomly shuffled into four divisions.  Each division that had him for PT was to a large extent, thanks to being naive, sympathized -- he never missed any class and was very particular in mixing exercises with sport. Some PT masters would just make us run one round of 400 m around the field and then hand over the footballs and basketballs. Harold Sir was different: he paid attention to the PT drills, push ups, sit downs, and other exercises, and would give the footballs only after the exercises

His face was always free from any emotion -- he was a no-nonsense kind of a person. I only remember him being visibly happy on very few occasions. For example, when someone ran by pacing a 400 m run well; I remember him saying "Very Good!" with smile to me once on one such occasion. Because I used to play tennis, I once overhead him express his  pleasure on watching the technique of one of my classmates (Ankush Chabra) during a tennis match.

His past was always mysterious to most of us. It was normal to hear stories floating around during lunch breaks that he was some senior member in the armed forces. The stories evolved with each passing year -- the smaller the kids floating the stories, the more hilarious they used to be. But the essence of these stories -- he had some military past -- was undeniable. This was also evident because during most march pasts that had members from the Indian Army marching with our NCC troops. During such march pasts the senior Army officers attending the event would look up to him with respect.  On one such occasion I remember that the chief guest, a senior military officer, got up from his seat and walked up the place Harold Sir was sitting and greeted him. For me it was his death that shed some light on this mysterious past; I just came across an article on him in sakal times titled,"Harold Joseph, St Vincent’s PT instructor no more." Indeed he was an officer in the Indian Navy. Now the only mystery is the number of enemy ships and submarines he sank with his bare hands.  

His biggest lesson and his biggest gift to me is defining respect and detailing the process to command respect. He is amongst the teachers that command respect. But this respect is the result  of distillation of innocent childhood fears, and Harold Sir refining it with time to produce respect in the purest form. He is the perfect example of how pure respect leaves a life long impression. Most primary school students began by fearing him. His presence and his name read out as the PT master for your division would be associated with trembling feet for a few. Trembling feet were completely natural thanks to his physical appearance -- standing with a posture supported by a gravity defying straight spine and muscular enough to sink ships with his bare hands. With each lesson his qualities distilled out every measure of fear to produce pure respect. It is difficult to express in English, but the best way as to how I saw him was "स्तिथप्रग्य" -- no-nonsense, disciplined, and the absence of any kind of favoritism. His dedication to his work is largely unparalleled. He truly loved to imbibe his qualities and his knowledge is each child and paid complete attention to each and every student in his own special way.

I wish that all kids can experience at least one lesson from a true teacher like Harold Sir!

August 10, 2012

Finding Apartments in Nice, Antibes, Juan les pins, or Sophia Antipolis: For PhDs, Erasmus, and Interns

When I began my Doctoral studies at INRIA Sophia Antipolis, the biggest worry I had was finding a place to live and getting adjusted to life in France. Luckily the French Riviera is an amazing place for International students. The people here are nice and finding an apartment is not very difficult.

Useful Websites 

Here is a list of websites that I found useful during my apartment search.
  • : This is good site if you would like to move in a colocation (flatshare). I found the places I lived in [ and] using this site. The site is very nice and it uses google maps really well to give an idea of the neighborhood. The site is also well managed and to be honest a bit addictive. Another reason why I like this site is because I got to interact with the owners directly and I did not have to pay any money to agents.
  • This site is good if you want to rent an apartment with with your friends. A couple of my friends used this site to get in touch with agents in Nice. Nice is full of rental agencies and most of the houses are managed by agencies. It is very rare that you can get in touch with the owner of the house sans agencies to rent a house. 
Apart from these two sites, the other sites me and some of my friends found useful were: 
  • : This site is for university residences and private residences suggested by the university. You can also see some listing of the private residences in internal list of Univ of Nice. The University office at Sophia has some boards where people can post their rental ads. I saw similar boards at the Fac de Lettres as well.  
  • A site for private residences where you can find studios to rent.
  • : This is specific for studios in Sophia Antipolis. I lived in their Oxford residence for close to a year. 
  • : This is like the craigslist site in the US. 
INRIA Newsgroup

If you are in intern, doctoral student, or a post doc at INRIA then you have access the inria logement news group. Ask you colleagues for the steps to subscribe to this internal news group. Similar news groups exist for CNRS, Eurecom, and other research institutes. 

Some other pointers and terms used

There were some terms that I found confusing and it took me some time to get used to their meaning. Also there were some things about renting places that are specific to France. Once you meet a couple of owners and agencies you get used to these terms and their usage. 
  • garant : It is the caution money that needs to be paid to the owner. In most cases this is refundable and, like all caution, some amount may be deducted based on the damages during your stay. I would recommend that you explicitly confirm to make sure that you will get this money back. Feedback from past tenants is useful on the promptness of the owner and agency on refunding the garant.
  • Insurance: Most likely you will have to buy insurance for the place to rent -- even if it is a single room in a colocation. Depending on the place you rent most banks support insurance from individual rooms to the entire apartment. The charges at most banks are similar. Contact the bank where you have an account for details. In some cases some agencies include the insurance price in the rent. So it is better if you get this clarified
  • Electricite,  Eau et Telephone: These were the three things I could not live. In some cases the price of water, electricity and telephone (internet) is included in the rent. These are typically mentioned as (tout compris). In any case explicitly ask your owner and agency for the amount you need to pay. At times you might also need to pay something more for building maintenance such as cleaning of floors, heating, and collection of garbage.
Attend Parties

However, despite all these pointers, the best way approach for a doctoral student is to find a temporary place, attend parties of lab-mates, and talk to people and get their feedback. This clarified most of my doubts.  Also this is the best way to get feedback about agencies and house owners. 

I must confess I have been lucky on the places I found, and the people with whom I lived in Nice. I therefore hope that you too have a good luck for your house hunting along with an amazing time during you stay in French Riviera.

July 30, 2012

Settle Down

Please settle down!
When I was a kid, most of the classes in my school began with the phrase "Settle down boys." At that time settle down meant different things for my classmates. For some it meant stopping the fights with dirty glances of resuming them during the break and sitting on a desk; for some it meant to show how prompt they were at their homework; for some the excuse to give as to why they did not do their homework and so on. But as time flew the definition of settle down tends to converge to attain meanings that were specific to age.

Where will you settle down?
During my years of engineering, the question of settling down meant what you planned to do next in life. Marriage with a person was in the back of the head for some of my classmates but for most it what which career path they are planning to take. Majority of my classmates decided to pursue a masters in the US, the rest wanted to work for a couple of years before choosing between an MBA, or an MS, or being satisfied with their current degree. Only a couple of my friends, who were among the best in my class, decided to go for a career in the military -- they could not imagine a life without a kukri in their hand.  

Have you settled down?
While working in companies and during internships Have you settled down! on migrating to different cities. At times I felt like blurting "I haven't found anyone interesting yet" to lighten the mood ;). During my masters the word settle down was associated with the place you wanted to live and at time with the person with whom you wanted to live. By this time marriage had started to take more than the desired fair share in the minds of most of my my friends. For me however it was the realization of being in a journey which led me away from the scale of 1 in the dawkins index.

With whom will you settle down?
 As my PhD studies began, the pressure to get married began from my parents, married friends, and most of all my relatives. Sadly no matter how pleasant arranged marriage has been for some of my friends, it gives me the creeps. I must confess that  I am very indecisive -- even while shopping in the supermarket,  I randomly select the brand of honey I buy; its fine if the bottle of honey is adulterated with granules of sugar -- you can dump it without the bottle complaining to its parents and its parents coming to skin you alive. Arranged marriage for me is like getting married during the first date or marrying someone by reading the content description on the box that contains a living human being! In terms of finding a person to live with, thanks to listening to tons of "Bhaja Govindam" as a kids, each time I get horny I tend to remember the verse "it is just a transformation of the food eaten." No matter how much I like to eat I will never marry my lunch. Well most of my friends have rightly told me that I tend to think a lot -- I can't help it. I agree I like the ones I meet at school, work, and parties,  but for some reason I prefer to have them as friends and move on with my life. To be honest the question of settle down gives me the creeps.


Will I ever settle down? (Is P=NP?)

I do not know. And with time passing I am getting more and more confident that I do not think so. I must confess that at times I have taken decisions that appear to be completely random -- so I seriously do not know if I will ever settle down.

July 28, 2012

Error on including #include linux/if.h

Another WTF moment!

arao@snowmane:~/tunnel-test$ cat test.c
#include <linux/if.h>
#include <linux/if_tun.h>

int main()
    return 0;
arao@snowmane:~/tunnel-test$ gcc test.c
In file included from test.c:1:0:
/usr/include/linux/if.h:179:19: error: field ‘ifru_addr’ has incomplete type
/usr/include/linux/if.h:180:19: error: field ‘ifru_dstaddr’ has incomplete type
/usr/include/linux/if.h:181:19: error: field ‘ifru_broadaddr’ has incomplete type
/usr/include/linux/if.h:182:19: error: field ‘ifru_netmask’ has incomplete type
/usr/include/linux/if.h:183:20: error: field ‘ifru_hwaddr’ has incomplete type

WTF !!!! Some google searches later...

arao@snowmane:~/tunnel-test$ cat test.c
#include <sys/types.h>
#include <sys/socket.h>>
#include <linux/if.h>
#include <linux/if_tun.h>

int main()
    return 0;
arao@snowmane:~/tunnel-test$ gcc test.c


July 5, 2012

How romantique: English with French words with an Indian accent

I) Je suis un douche-bag

I realized my english is screwed thanks to living in France for close to 3 years. It began when I asked one of my house-mates  "Do we have a douche on this floor?" I answered the pensive look of the girl by a gesture of bathing in a shower followed by my peanut brain lighting up and me blabbering "Sorry I mean a shower." Apparently, the girl showing the apartment was fluent with a couple of European languages and she tried her best to control her laughter; I was glad that she did not take it offensively. My friend who dropped me to my dorm/apartment told me that I should stop using douche. A quick urban dictionary look up confirmed that I should stop using a term for vaginal cleanser for a shower. It was the beginning of the embarrassment that followed in the next couple of days. Some of the weird moments are as follows.

II) Tu comprends?

"I did not comprehend?" was what I muttered and the one talking to me did not seem to comprehend as to why I muttered I did not comprehend. My peanut brain lit up in a few milliseconds of observing the thoughtful look and I answered "I mean I did not understand." Luckily this had happened during my last visit to San Franciso so thanks to the deja vu my peanut brain was bit faster this time and I guess the person was already trying to make his point clear to me. For me it was another C'est terrible! in every sense of the word terrible in French.

III) Votre Nom SVP

While creating my account at the bank I responded "Rao --- Err! AAh! Oh!" out of habit to the question "You Name?" Thanks to this weird response the one creating the account gave me the form to fill. I am glad she did not consider my response as a bank raid by a weird hippie who looked high and and made weird sounds. I guess that saved me a lot of the embarrassment. The first embarrassment was really giving my surname (Nom) instead of my name (Prenom).  Finally the one creating my account was glad when we talked about places to visit in India and Europe.  Once the account was created I responded to her शुक्रिया with an american accent with a "धन्यवाद" followed by a "Bonne vacance!" with an Indian accent.  

IV) Excuse moi ou Pardon!

During my first bus ride I randomly chose between "Excuse me" and "pardon" but I guess the people gave way to the weird haired brown skinned hippie who swapped French and English words and pronounced them with a thick Indian accent. I guess my accent and my hair saved my day because they guessed it was better to give way to this homeless looking wierdo!

V) Enchanté

At my first party the first girl to whom I said hi to thought I was  a bit desperate when I blabbered something like "Enchanted" instead of "Nice to meet you." I realized Nice to meet you was the phrase to say. For the girls later, it was "nice to meet you". Sadly no was glad to meet me at the university or I guess the convention is slightly different in an official environment. On the bright side it could have been much worse if I told "Enchanted" to a couple of blokes. However, I am really glad that I still think twice before bisous.

Grande finale) Recette des preservatifs
To conclude, I am glad that all these embarrassments are petite compared to when I told one of my colocataire during dinner, "Pourquoi vous aimez votre repas avec des préservatifs" which roughly translates to "Why do like food that has condoms." I can still remember the piercing look in her eyes.

I only hope that I do not look like this!

June 1, 2012

Avenue des Orangers

I was staying this apartment from August 2011 to May 2012. I have made this video as a memory of the good times I had while living here. I had a really nice time living in this apartment. If any one wants to move into this apartment this video can give a rough idea of its size and the things that were available when I was staying there. What I really liked about this video is the sound of the bird singing in the background. I did not notice it while filming this video.

May 26, 2012

Energy Energy Everywhere yet I cry for a car full of free fuel ready to wear

This week the fuel (petrol) prices in India were increased by about 15%. As expected there were a huge number of protests. The social networking sites were full of messages on how the government has failed it people and failed in its promises. I agree with them in protesting against failed promises but I differ on the their suggestions to the government. Fuel prices will increase and continue to increase so long as we increase our demand. Each car and each motorcycle added increases the amount of money the country will spending in importing fuel. Each cycle bought or each bus/train ticket bought shall reduce the amount of money leaving the country because of imports. Rather than diving into the spiral of perpetual debt and double digit inflation, the solution lies is efficient modes of transport that can potentially reduce the import bill.

What worries me the most is that since independence the policy has been to subsidize fuel rather than subsidizing alternative and potentially cheaper forms of energy. We have been subsidizing kerosene in the name of the poor but have not subsidized solar heaters and solar lighting (for example, solar laterns). Bio-gas subsidies and subsidies for solar cooking are non-existent in comparison to the amount of money spent on kerosene and LPG.

For energy required for cooking, we have potentially really large sources of energy in the form of sun-light, heat, along with an abundance of human waste for bio gas. Yet we are way behind the west in utilizing this energy. You will never find a protester from a political party protesting to increase the subsidies for renewable energy. However, you will find idiots crying for cheaper petrol so that they can use the vehicles for making mating calls.

With respect to transport, Pune, my city, was once the city of bicycles. Over time cycles were replaced by motorcycles and now motorcycles are being replaced by cars. The rate of increase of the population overshadows the rate of increase of public transport buses by astronomical (or economical considering the debt of each nation) scales. Yet you will not find people protesting for better buses in numbers that can be seen protesting for cheaper fuel.

I was interested in finding out if places in India have looked at alternative energy in a large scale. I found a couple of instances however they are small comparing to the large off-shore wind farms seen in the north european countries and the bicycle share systems and amazing public transport that can be seen in most cities of Europe. I just wish that some day rather than whining and trying to address the symptoms of the problems the people start looking at the root of the problems and work towards addressing them. 

May 18, 2012

Recommended Firefox plugins/add-ons for improved Privacy

Here is a list of Firefox plugins that I regularly use. I strongly recommend each of these add-ons. I use these to keep a check on the websites that can track me. Most of us might be of the impression is that "I do not have anything to hide, so I should not be worried about privacy." But the question here is not about hiding something, the question is "Why should anyone be interested in what you do?" Have a look at this cartoon strip from Abstruse Goose; it should give you an idea as to why privacy is important.
The list of add-ons I use to track (to some extent) my privacy are as follows.
  1. ShareMeNot: This is a very useful plugin that ensures that sites like Facebook and Google are not able to track the pages you visit even if you are currently logged into sites like Facebook and Google.
  2. Sqlite Manager: It is a nice firefox add-on that provides a GUI for SQLite databases like the ones used by Firefox. It shows all the data that is saved by Firefox. 
  3. Collusion: This add-on provides the list of sites sharing your information and the list of sites that are accessing your information from these sites. It can be a bit scarry if you do not close Firefox for a long time as this graph builds on with time. 
  4. Firebug: This is a really nice add-on that helps me inspect the page elements. I use it to see from which websites I am receiving data and pushing data. It is also really helpful when creating webpages and checking if the page you created is W3C compliance. I used this while creating my homepage at INRIA.
I do not use and I would not recommend add-ons like Adblock-plus because advertisements are the source of revenue for the sites providing their services for free.  For example, there are a couple of newspapers, bloggers, comic strips, and other artists that rely on revenue from ads.

Wish-list of potential candidates for the Presidential race

The irony and  misfortune of India is that the worst rubber stamp was put forward as a symbol of female empowerment. It was really shameful to see one of the best presidents, Abdul Kalam, being replaced by one of the worst presidents India ever had. I am so upset by her performance that I do not want to type he name. Now for the current elections my wish-list of potential presidents is as follows. 
  1. AK Antony: I have put him in the top of the list because he has been in politics for a long time. Despite his long tenure he has a saintly clean figure. His positive points are that he knows how to run governments and how governments run. He is also a master of how to keep people at bay. I really admire him because he has done a really nice job in cleaning some of the mess in the armed forces. Also he is one the few Indian MPs  who take oath by affirmation. His biggest strength is that he is largely powerless. However I believe in times of calamity it is time for Saint Antony to pick up the sword. I hope he awakens from his slumber because the country needs people like him to wake up!
  2. General VK Singh: After a very long time we have a commander who is clean and who has the conviction to keep the armed forces clean. Any soldier would be proud to be given a medal from him as the President.  He has done a magnificent job in cleaning the mess in the armed forces and he needs to be elevated to the to the task of cleaning all the other departments of the country. 
  3. P Sainath. He does not need any introduction has seen the villages. He knows the the true strengths and weaknesses of this country. He can see the impact of policies. He knows the impact and the power of the knowledge and what it takes to take knowledge to the grass roots of the country. He is well versed with the true picture of the problems faced by the majority of the population.
  4. CNR Rao: A man of science who has a clean image. He is the current scientific advisor and is worthy of being elevated to the post of the President.
  5. Sudha Murthy: If India needed a female president then it would have been really nice if she had become the first female president. She is the one who provide the seed funding for one of the largest corporations in the world. She has travelled the corners of the country and knows the the complete divide and the hardships faced by the people.  Sadly rather than a person like her we had the dishonour of having one of the most controversial persons as the president. 
Some might say Anna Hazare, however the problem with people like Anna Hazare is that they prefer to be outside the system and criticize it rather than cleaning it from the inside like Gen. V. K. Singh. This  is the reason why I have Gen. V.K. Singh and C.N.R Rao in this list and not Anna Hazare. I was a fan of Kiran Bedi however her theatrics have undone a lot of the respect she had gained. I hope that is she is able to regain the trust and respect she had before the Anti Corruption Movement began.

In any case I see that in the end some unworthy spineless human will be elected as the President of India. For the sake of my country I only hope that this is not true.

May 8, 2012

Hypocrisy and the State of Denial on Gender Inequality and Female Infanticide

In the last few days there was a lot of hype about a new TV show with Aamir Khan, one of my favourite artist, in the lead. I really liked the title song for this TV show called Satyamev Jayate. The main reason why I was looking forward to see this show was because Aamir is known not only to put his 100% in whatever he does but also creating an air of mystery before revealing his works.

The first episode of this show revolved around the concept of female infanticide and to what extent this practise is rampant all over India. What surprised me the most was not the gory depths  to which people fall for a male child, but the complete ignorance of the general public about this practise. What this show validated was the level of ignorance of the people of India. More than ignorance it quantified to a large extent the state of denial among the people. All the statistics are available in publicly available datasets such as the census of India. Newspapers such as the Hindu have over time published a large number of articles on this issue. One just needs to do a search on female infanticide on any search engine to see the gory details of this madness.

The most surprisingly section of this episode was when two journalists were invited to speak on their sting operation that was carried out in Rajasthan. The journalists whose works were presented in most news-channels say that "राजस्थान मैं ही नहीं पुरे देश मैं हल्ला मचा!".There are two points I want to make on this statement.
  1. अगर सच मैं हल्ला मचा होता तो अभी तक कुछ हुआ क्यूँ नहीं? Why has nothing yet been done? This operation took place years before this show has been telecast and yet nothing took place. There have been elections after this matter was exposed and yet nothing was done by the political class and the voters. Who is responsible for the lack of action then?
  2. Why are the people who saw this episode being surprised now? It only means that either this message despite being broadcast on most of the news channels did not reach them or they chose to ignore it then. The later is the most likely explanation of what actually happened.
Both these two points highlight the level of ignorance and the state of denial among a large section of the Indian population. The state of denial was the most important thing that this episode actually showed. The last census clearly showed that female infanticide is common among the literate people (I do not want to call them educated as there is a difference between literacy and education). There has been a lot of work done by the UK government that showed that the sex ratio was terribly skewed among the families that come from the Indian sub-continent. For example have a look at this article titled UK Indian women aborting girls []. Despite this information being publicly available the people watching this show were amazed when Aamir presented these facts. This just shows the ignorance of the people. This ignorance has its roots in the state of denial that everything is fine in my neighbourhood and the problem lies elsewhere. But rather than being in the state of acceptance (which is 3 stages away from denial according to Kubler-Ross) we continue to cling on to the state of denial by choosing to be ignorant. It is time we accept the facts and use them to see where we actually stand. It is time we realize that the problem of female infanticide has its roots on the issue of gender inequality which is a much more larger problem. 

The state of denial on the issue of gender inequality has its roots on the fact that girls are not considered equal to boys in India. No matter how much Indians say girls are equal to boys this is not true. I was a part of this hypocrisy up to a few years back but I am changing. Take a simple test to see where you stand. Consider that you live in a neighbourhood with three schools that have the same level of teaching; one only boys school, one only girls school, and one co-education school. If you have to select a school for your child which school will you select? Now let me make it scary. You did not ask why is there a separate boys school and a separate girls school in my neighbourhood. (This is the first question a European might ask). You are perfectly fine for having a separate school for girls and a separate school for boys and yet at the same time want to tell that girls are equal to boys. This is the hypocrisy I am talking about.  My question is why in a society which we call open minded do we still find a school only for boys and a school only for girls. If girls were equal to boys all schools shouldn't all schools be co-education schools? Now how many schools in India despite being co-education have separate class rooms for boys and girls? For the time being, forget schools, lets go to college. When I studied engineering there were six engineering colleges in Pune only for girls. Can any one tell me whose children went to these engineering colleges? Were the parents of these girls illiterate? How many sent their girls to these colleges because the education was good? How many preferred this college because it was a girls only engineering college?

In summary, the main objective of this post is not to highlight the issue of female infanticide, but to highlight two issues that are responsible for female infanticide. First is the the issue of the larger problem of gender inequality. Second is the state of denial which we use as an excuse to be ignorant and vice-versa. I want to end this by asking: Are we living in the times of Savitribai Phule who had to create a separate school for girls because girls were not considered equal to boys? If you want to send your child to a school please select a school based on the quality of education and not because it is a girls only school or a boys only school. I just wish for a time when all schools in India becomes co-education schools. My only hope is that this post creates some kind of awareness on where we actually stand on the issue of gender equality and female infanticide.

May 5, 2012

Memories of my internships at General Motors India Science Lab

I just came across this blog post by Prof. Giri that says that General Motors is shutting down its Research lab based in Bangalore. Reading it made me a bit sad. If I was not coming to France, I would have joined this lab. In fact I was very serious about joining GM-ISL before the crisis hit GM in 2007-2008. I had done two intern-ships in this lab because my advisor at IIT Delhi had joined as a researcher in this lab. The faculty at Delhi, especially Prof Saran and Prof. Maheshwari were very kind to let me continue working with my advisor and letting me spend close to 8 months of my two years here.Well my 8 months  in Bangalore (as two intern-ships from May-July 2007 and Jan-April 2008) taught me many things.

One important lesson I learned here was the lesson of life which I learned while staying in Kundanahalli as a paying guest. It was in a house with 12 people and I got a bed in a room; the room was shared with three other guys and  I paid around Rs 3000 (EUR. 50) per month for the place to sleep and the food. Wifi was not that common India in 2007-2008, and I did not have a laptop with me, so after coming back from work I used to have dinner and go to sleep. Some times I used to  watch a movie in the television  and talk with the other guys living in the apartment. It is hard to imagine that I never thought about hanging out with friends or going to the cinemas. It was here that I actually felt how completely unrealistic is India's growth story. Kundanahalli was full of engineers who lived in a house like I did, and who despite earning a modest salary (around Rs 15000) did not have room for themselves. Water was a big problem and we used to wait in the morning for the tanker to come to answer the call of nature and have a shower. If you wanted hot water, then you had to take water out in a bucket and use a coil to heat it. It might be hard to imagine 12 guys (at times 15) waiting in line to use one of the two toilets in the house. Luckily all of the guys I shared the apartment were good so time scheduling worked perfectly.  The biggest lesson learned here was humility and simplicity. Despite my parents urge I did not want an expensive room and I wanted manage in my stipend which was Rs 15000 (yes I was receiving a stipend more than some of my engineer colleagues). On weekends I used to move to my aunts house who lived in the other corner of Bangalore (Vijaynagar). The bus ride to my aunts house would at times take more than 2 hours. Well I saved a lot of money thanks to living this kind of a life and bought my first digital camera with the money I saved.

My other lesson was on approach to research. This was very important as my previous work experience was in the engineering division of a start-up. Working in a start up had its own challenges as a concept of a 5 or 10 year vision is at times wrong unrealistic. In research labs the lab head and the team head must have a vision of 5 to 10 years. The work done was expected to reach the assembly lines may be 5-6 years after the first prototype was built. People would debate and come up with new ideas and validate the feasibility of some these ideas.  It was here that I saw the actual use of mathematics as language and the pressures on the research teams from their engineering divisions who needed results and directions. At times in the coffee room I could see debates on which shade of gray is best suited to meet the required fire-resistance and so on. I got my first publications, one workshops, one conference, and a co-author for a journal, while working for this lab. What I disliked the most was the formal attire that was mandatory while working in this lab. I simply could not understand its need.

I am a bit sad on hearing this closure but honestly speaking I knew it was a matter of time for this lab to close. The financial mess of General Motors in 2007-09 was the reason as to why I decided not to join this lab. My focus was on continuing to do research and I wanted to find a PhD position soon but I was in a dilemma as my degree was delayed by the administrative procedures of IIT Delhi. In the end, after my internships at GM, I joined a start-up which later shut down and I came to France for a PhD.

April 13, 2012

Create a file with random bytes

I periodically need to create a file with random content. I use the following code.
dd if=/dev/urandom count=102400 bs=1024 iflag=fullblock
Here the final file size is bs*count bytes. Note that I am using urandom instead of random as I am not using the random numbers for some security operation and I am not bothered about the entropy.

April 5, 2012

Google Wave or Google Wage

Do you see a problem in this email header:
from:  Google Wage 
to:  **********
date:  Mon, Mar 19, 2012 at 8:06 PM
subject:  Reminder, Google Wave Sunsetting in 2012
Have another look at the from field? It tells how serious google was about this project at its end. I am a bit sad as this project had a lot of potential and was way ahead of current times. It just needed more attention and presentation from google. At times they should have stopped thinking like a geek and started thinking like a little child. I believe google has made a wrong decision in not giving google wave its due share. It reminds me of the wrong decision Google took in not giving importance to orkut and creating google plus a few years later. I remember describing facebook as a new orkut to a friend when I created by facebook account.

February 14, 2012

Logging TCP state variables such as Congestion Window from user space

If you are familiar with hijacking library calls using LD_PRELOAD then this should be very intuitive. The following code should help you monitor some of the tcp state variables. I am using the following code to log the evolution of the TCP congestion window during an scp session. Please have a look at tcp_info structure available at /usr/include/linux/tcp.h and the tcp_info structure in the kernel tree. I needed only the variable related to the congestion window and timers for my work. You can modify the periodic_alarm function to suit your need. This code works for scp, for other applications you might need to modify the socket descriptor used in the periodic alarm file. Happy Hacking!
#define _GNU_SOURCE  
#include <sys/syscall.h>  
#include <sys/types.h>  
#include <sys/socket.h>  
#include <stdio.h>  
#include <stdint.h>  
#include <dlfcn.h>  
#include <signal.h>  
#include <netinet/tcp.h>  
#include <sys/syscall.h>  


int (*real_socket)(int domain, int type, int protocol) = NULL; 
int sockfd = 0;
struct sigaction sact;
long long start_time;

 * Periodically dump the info from the socket.
 * Note this assumes that the tcp_info struct includes tcpi_total_retrans. 
 * Older versions do not support tcpi_total_retrans
void periodic_alarm( int sig )
  struct tcp_info info;
  int infoLen = sizeof(info);
  struct timeval now;
  long long curr_time;
  gettimeofday(&now, NULL);
  curr_time = (now.tv_sec*1000)+(now.tv_usec/1000);  

  getsockopt(sockfd, SOL_TCP, TCP_INFO, (void *)&info, (socklen_t *)&infoLen);
  fprintf(stderr,"%llu %llu %u %u %u %u %u %u %u %u %u %u\n", curr_time,
   curr_time - start_time, info.tcpi_snd_cwnd, info.tcpi_snd_ssthresh,
   info.tcpi_unacked, info.tcpi_lost, info.tcpi_retrans, info.tcpi_total_retrans,
   info.tcpi_rtt, info.tcpi_rttvar, info.tcpi_rcv_rtt, info.tcpi_rto);  

int socket(int domain, int type, int protocol)
  int fd;
  struct timeval now;
  if (NULL == real_socket)
      real_socket = dlsym(RTLD_NEXT, "socket");
  fd = real_socket(domain, type, protocol);  
   * For scp the first socket is enough
  if (SOCK_STREAM == type&SOCK_STREAM && 0 == sockfd)
      gettimeofday(&now, NULL);
      start_time = (now.tv_sec*1000)+(now.tv_usec/1000); 
      // if (sact.sa_handler != periodic_alarm)
      sact.sa_flags = 0;
      sact.sa_handler = periodic_alarm;
      sigaction(SIGALRM, &sact, NULL);
      ualarm(999000,10000);// Wait for 1 second then every 10 ms      
      sockfd = fd;
  return fd;

Compile with the following command
gcc -shared -ldl -fPIC wrap_socket.c -o
Run scp as follows 
LD_PRELOAD=./ scp fname username@machine:path 2>logs-1