## 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.

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);
#else
#define LOG_DEBUG(param) do { } while(0);
#endif

int main()
{
int v1 = 10;
double v2 = 100223.1212313;
LOG_DEBUG(1<< " " << 3.5 << " " << "hello" << " " << v1 << " " << v2);
LOG_DEBUG("Hello");
}

Output is as follows
#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 arao@snowmane:~/tunnel-test$

:)

## 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 [http://news.bbc.co.uk/2/hi/uk/7123753.stm]. 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 of=file.data 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

Do you see a problem in this email header:
from:  Google Wage wave-noreply@google.com
to:  ********** @gmail.com
date:  Mon, Mar 19, 2012 at 8:06 PM
subject:  Reminder, Google Wave Sunsetting in 2012


## 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>

/*
* THIS WORKS FOR SCP WHERE ONLY ONE CONNECTION IS USED
*/

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 wrap_socket.so
Run scp as follows