Friday, December 4, 2009

Nostalgia

"The place that you don't want to leave is not the same as that you would want to stay"
- Rake Thinker
Three and half years at a place makes you take so many things for granted. This is the end of my time in college and it was a pretty awesome journey. College, like a friend saus, is your whole life compressed to four years (flavoured with a lot of alcohol, tobacco and mary jane). You are naive in the beginning, get carried away for sometime, start thinking about what you want to do towards the end and before you do something you are out in the real world. Cliched as it might sound, the journey surely was important than the destination in this case. This place has changed me completely; a lot for the better and some for the worse. But I guess everything has its price and I think I got a very good deal.

I have about a week left on campus. Nostalgia (aka psentiness) is slowly seeping into me and I will certainly miss all the wonderful people around me, the discussions in ANC, visits to Nutan, CEL and the freedom this place offered me. As Bill Watterson rightly puts it "So, what's it like in the real world? Well, the food is better, but beyond that, I don't recommend it.", I will never get as much freedom, both physical and intellectual, as I had here. I should be terribly sad to leave this place. Ironically I am not and the quote at the beginning sums it up perfectly. I realized that this is the place I don't want to leave but I don't want to stay either. No place is fun when there is nothing to learn anymore, when all the people who inspired you aren't there and most importantly when you cannot inspire people around you. This nostalgia is nothing but the sweet aftertaste of a really bitter semester. I think even a prisoner misses the penitentiary before leaving.

Whatever it might be, my college is over and it was an amazing experience. Thanks to all the people who made my stay here very special. Peace.

Thursday, November 26, 2009

Google Wave


Note: This is my first cartoon and I hope to draw more (once I get a hang of drawing better stick figures). This idea has been copied from some unknown source I found on twitter (the original author can comment :). This cartoon is dedicated to SupT for being a very close friend and turning 21.
PS: There are mouse-overs too!

Friday, November 20, 2009

Graphs -I



"Graphs are like pornos. They make complex things look very simple"
- Anonymous Mathematician
NOTE:
I am not a very social person and hence all my observations should be taken with a pinch of salt (and a shot of tequila if available). By "friends" I don't exclusively mean best friends or girls out of your league you want to hump (aka BITSian Sisters) or gay partners. "Friends" are people whom you don't mind sharing your cigarette with. If you are a non-smoker, some one whom you will talk to for a time equal to one's minimum orgasm time. Well, if you can't get an orgasm, may be reading this post should not be your top priority.

Tuesday, November 17, 2009

Star Dust

The astronomy club of BITS-Pilani arranged a star gazing session on the event of Leonid meteor shower. If you are a BITSian, you are probably familiar with the rusty telescope on the top of FD-2.But this time there was no telescope and it was an open session in Central Lawns. It was announced that the shower would begin from 11 PM and would reach its peak (maximum intensity?) by 2 AM. Punctual as they are, the students walked towards the lawns by 1:30 AM while the more enthusiastic ones reached an hour earlier. A majority of people including me, expected to see meteorites falling everywhere and couples (heard that girls got night permissions) making out in the dark corners of the lawns, while looking ocassionally at the action in the sky. But all we could see were a bunch of astro club people talking about the resemblance of some constellation to a dick, some dogs and random lokis with their cell phone torches pointing towards the sky. Added to this, one of my friends forgot to wear his underwear (sadly he is a guy) and constantly complained about his balls freezing.

Around 1:50 AM the Coordinator (or whatever) of astroclub talked about the perfect techinque to spot a meteor.

  1. You need to keep looking at the sky
  2. You need to have a lot of luck

Simple enough. So we all waited and after half an hour there were no girls let alone romantic couples but around 100 guys hooting and chanting "Gira re gira" randomly. Not to forget the dogs. Digressing from the topic slightly, I would like to introduce four most popular dogs on campus

  • Amitabh : The dog is named after Big B and constantly makes a sound similar to his characteristic grunt
  • Ashok: As an abandoned pup this dog is rumoured to be bred by the supre of Ashok Bhawan to steal food, footwear and almost anything from final year students. (Named after Ashok Bhawan)
  • Comodo: This black, small and ugly looking dog is very aggresive. Legend has it that a guy got stoned and mistook it for a comodo dragon
  • Horny: This dog has a tendency to go near girls and flaunt its aroused male genitilia, an act which most students are contemplating doing.

Ten minutes later, people started imagining seeing meteorites. Some of them in the hope of luring girls to believe that there were meteors in the sky, started shouting seeing an aeroplane in the sky. At this point my neck was aching, my friend was scared that he might lose his manhood to Pilani winters and my other friend was hungry. So, that brought an end to the astro session and we walked back wondering whether the myth that "if you can't see a meteorite your wife will be a lesbian" is actually true.

Posted via web from Random Neural Activity

Reality Distortion Field

http://www.joyoftech.com/joyoftech/joyimages/972.jpg

Posted via web from Random Neural Activity

Tuesday, September 22, 2009

If twitter existed

Twitter is an addiction for some and JASN (Just Another Social Networking site) for others. What if twitter existed in the past? This is a South Park-ish attempt to generate humour with that idea.

mlkingjr
I have a dream that one day this country stops FUCKING AROUND with niggers. "I have a dream" @ http://niggerforlife.blogspot.com

indian_nightingale
Count me in. RT @mkgandhi Sick of British colonialism. Going to Dandi to make salt. Anyone game?

adolf_hitler
Please support killing innocent jews by adding a swastika to your profile pic. Takes just a click http://tinyurl.com/nazi123. Kindly Retweet #hatejew #nazi

showmansteve
@johnscully Do you want to spend the rest of your life selling sugared water to children, or do you want a chance to change the world?

A few years later...

johnscully
@showmansteve You are fired.

einstein_emc^2
@maxborn @god doesn't play dice. He is more of a poker guy. How is @schrodinger's cat btw?

jimi_hendrix
Note to self: Don't get too stoned and burn your guitar. It fucking costs a lot of money.

neilarmstrong
is walking on the moon :) (via @tweetNASA)

The number of tweets are low due to lack of appropriate pop culture references and racist jokes. Ideas are welcome and will be appreciated.

Sunday, September 20, 2009

Tharoor and Twitter

It is strange to see a tweet making it to the front page in a country where 35% of population is illiterate and a significantly higher percent (including my parents) do not understand social media. Nevertheless, Tharoor succeeded in getting away with it and Congress got some publicity for the austerity campaign. It is a win-win situation. Shobaa De (who btw doesn't know it is tweeting and not twittering. What a n00b!) says it is cool as long as they pay for it. Chetan Bhagat talks about how our netas should improve their sense of humour.

But is it all that simple? If you are reading this post, you think it is. But imagine reading about it in the newspaper about some minister who refused to stay in his house because there was no gym there and called common people cows on the internet. What kind of an impression would it create?

I totally agree that the congress austerity campaign is merely an act of tokenism and all the hue and cry about Tharoor's comments doesn't make sense. But when you are representing people you should ensure that all of them understand the context of your statements especially when they are made about them. It doesn't create a good impression when you publicly refuse your accomodation and pay (may be out of your pocket) for a 5-star hotel when half of the people that you represent do not have food to eat. So should he be a saint and abandon his comfortable life? No. All I am saying is do not act in a way which thrusts into their face, the disparity in your lifestyle and theirs.

We (Web aware Indians) constitue a very small portion of the electorate and if we lose an able leader like Tharoor just because a lot of others cannot relate to him or his lifestyle, it would be sad. And the media should also be responsible enough to give a complete background of the situation before putting it on the front page.

Monday, September 14, 2009

Absolut Minima

Global Minimum. That is what I would call my life right now. I knew it was coming since a long time but I was too arrogant to accept it. Thought I was good enough to handle it but I cannot convince myself any more. There was a time when I actually did things rather than talk about them. When I was actually good at what I did than show off that I was. When I inspired people and cared about them than acting indifferent. Had the balls to take up a challenge and fail trying. I seem to have lost that ability somehow. I don't feel myself anymore. All that I am right now is a pretentious bastard living in an illusion. I am nothing but a disappointment to all the people who believed in me (including myself). I don't know if I will ever be myself again. But if I don't try, I know I never will.

Wednesday, August 12, 2009

Psenti-Sem

The following are the activities that will constitute most of my final semester on campus
  • Getting bit by LGMF's and other wildlife in my bhawan
  • Convincing people that Microsoft Windows actually sucks
  • Attending first year classes and hitting on first year girls
  • Conning my project professor
  • Being under the influence every alternate day (at the least)
  • Taking a "trip"
  • Campaigning in elections for the "gults"
  • Coding a virtual pet
  • Plan "the road trip" with Andy
People who know me might wanna add more :)

Friday, July 3, 2009

Prisoner's Paradox : Solution

Here is an interesting math puzzle that I found here:

Three condemned prisoners share a cell. A guard arrives and tells them that one has been pardoned.

"Which is it?" they ask.

"I can't tell you that," says the guard. "I can't tell a prisoner his own fate."

Prisoner A takes the guard aside. "Look," he says. "Of the three of us, only one has been pardoned. That means that one of my cellmates is still sure to die. Give me his name. That way you're not telling me my own fate, and you're not identifying the pardoned man."

The guard thinks about this and says, "Prisoner B is sure to die."

Prisoner A rejoices that his own chance of survival has improved from 1/3 to 1/2. But how is this possible? The guard has given him no new information. Has he?

This is a classic example of a paradox usually encountered in the theory of probability. Like most other paradoxes it might seem a bit confusing initially but there is a simple technique to come to the correct conclusion.We studied it in school and it is called Baye's theorem.Let us take a closer look at the problem:

The objective:

We need to find out what is the probability that prisoner A lives before and after getting the information from the guard.Let LA denote the event that prisoner A lives.Before getting the information from the guard it is fairly simple, since only one of them is going to live it is P(LA) = 1/3.

Now consider the event of guard telling prisoner A that prisoner B is going to die.Let us denote the event as GAB.Let us assume that A actually is freed (I shall tell you why a little later) then the probability of the guard giving the information is P(GAB/LA) which is 1/2.

For those of you who are wondering why it is not 1,this is the tricky part.If prisoner A lives then the guard can tell either the name of B or C because both of them are going to die.The probability that he told A that B is going to die is 1/2 (remember, given the condition!).Now for the fact why we computed P(GAB/LA)? You must have already solved loads of problems where to find a conditional probability you will find its posterior probability and apply Baye's theorem.The case is no different here.It is crucial to note that we are trying to find the probability that A lives after getting the info so the desired probability is P(LA/GAB) which can be computed using the standard formula.

Therefore
P(LA/GAB) = P(GAB/LA)*P(LA)/P(GAB)
To evaluate P(GAB) we need to evaluate all possible cases (if you don't know what I am referring to refer Wikipedia on Baye's theorem).Let us look at the following cases:

We know P(GAB/LA) and P(LA) which are 1/2 and 1/3 respectively.So the product is 1/6.
The second case is P(GAB/LB) and P(LB) which is zero because he cannot tell A that B will die when B will actually live (he cannot lie!)
The third case is P(GAB/LC) which is 1.Confused again? It goes like this... When C is actually living that means both A and B are going to die.Since the guard cannot tell A about his own fate he HAS to tell him about the death of B.So hence it is 1 and its product with P(LC) is 1/3.
Finally the sum is P(GAB) = 1/3+1/6 = 1/2.

Now substituting it in the Baye's formula we get P(LA/GAB) = 1/6/(1/2) = 1/3.You can observe that the probability is infact the same as that was before asking the question.So technically there is no new information that A received.Secondly, A incorrectly estimates that his chances after asking the guard have become 1/2.His chances actually remained 1/3 before and after asking the guard.So the paradox is just superficial and the law of probability still prevails.

Going further, isn't it paradoxical that the probability of C living increased without him actually doing anything?Well...if you followed the steps properly it should not be difficult figuring out the answer.And also note that none of the other prisoners have the same information as prisoner A.So they would still be clueless and assume that their probability of survival is 1/3.And if prisoner C also approaches and asks the guard and both A and B share the information with each other.Then what would the probability of their survival be?

This problem is also called the three prisoners problem and available in Wikipedia for more reading.One of the methods shown there is similar to this with slight change of details.I took me a couple of hours to come up with a sound explanation of what was going on in the problem and put it on paper.

Any flaws, corrections or comments are welcome.

Wednesday, July 1, 2009

Stuck without Javascript

A couple of days back I was working on a mobile optimized website.Since Javascript is not supported in mobile phone browsers (though Opera Mini and some others do but most of the default browsers don't!) I had to figure out a way to display tiny bits of a large result without querying the server every time.I was facing the following problem...A couple of days back I was working on a mobile optimized website.Since Javascript is not supported in mobile phone browsers (though Opera Mini and some others do but most of the default browsers don't!) I had to figure out a way to display tiny bits of a large result without querying the server every time.I was facing the following problem...

I had a huge array that contained search results from a database and I had to display one result at a time without querying the server every time.Well, if I had Javascript I would have put each result in a container and kept all of them invisible except the one that I wanted to display.Since I don't have that option I had to use the following PHP hack.

I queried the server for the results and got an array.After getting the array, I serialized it using serialize() function and passed it along with a display index using GET to a display URL.I unserialized() the string in the display page, thereby recovering the array.Using the display index I could display the desired element.So I could display each element without querying the server each time for results.

This is not an uncommon technique but it will help you if you are stuck without Javascript like me :)

Note:There are other ways of passing information using curl etc, but you will need support from the server for using them.

Saturday, June 27, 2009

Steps to Create a Successful Web App

This is the fourth blog I am starting and I am bored of my usual hello world posts.So let me just talk about what I want to write in this blog (if I actually write!). The answer is simple, the title says it all.Just random things that are in my mind.But I warn the readers that this blog may contain some posts which are inappropriate for non-geeks.

I read this article by Kevin Rose on how to promote a web app.After working on chirplines and trying to market a web app, here are my views on creating a successful web application.

Find your market
Internet has a diverse set of people and you cannot satisfy everyone with your application.So before you begin your first line of code have a clear idea as to whom are you targeting.For example Vimeo targets an artistic crowd compared to youtube which has a general crowd.Each feature that goes into your app should make it more usable for your target users.

Keep It Simple Stupid! (aka KISS)
Da Vinci said "Simplicity is the ultimate sophistication".Keep your application as simple as possible.Don't get carried away by the options available at every stage.You need not incorporate mail updates just because they can be done.Stick to the basics and in case you need to add something, take the easiest path even if the result is marginally less.This applies to the back end as well.Don't use a complex algorithm for something which a binary sort can solve.

Get Real
The first thing I was asked to do when we were designing chirplines was to design the CSS for the home page.I was really excited and wanted to get it pixel perfect.I spent 2 days on it without going anywhere.The most important thing while developing a web app is to get real and start making the first draft without giving too much importance to details.More importantly get the functionality right.CSS and color combinations can be changed in minutes but what your app does can't be done so quickly.So get it working first and worry about the details later.37 Signals has an excellent book about this which you can find here.

Usability Usability Usability
Yes you probably heard about it a zillion times but usability is crucial.Web has too many applications coming up too fast to make your users come back for a second time.So you just have a single chance to make an impression.Avoid unnecessary email conformations and login screens.tumblr for example doesn't even wait for an email conformation before you can start posting.Reduce the number of steps that it takes for the user to do what you want him to.

Selling your app
Even though you have a kick ass app, you can't get users without reaching out to a lot of people and the web is too big for your sales division.The only way you can get a number of people is through other people who already used it.Things like Twitter, Facebook, Digg offer limitless possibilities to market your app.

Social Media Bitches (SMBs)
Thats right!These are the people that you want to get hold of while selling your product.How to spot them?Simple.Anyone with more than 10,000 twitter followers come under this category.These people can get your site a number of users and it's how good your app is that decides how many of them stick to it.As Kevin Rose says in the article offer them something valuable to get them use your app.

Show the way
Show people what all can they do with your app.Make a cool podcast on how to use the app though it might be obvious for you (because YOU created it).Get the users excited about it the same way as you do.As my friend rishabh says "Show two solid applications of your app and people will come up with a thousand".

One can write a book about the "right" things about making web apps but at the end of the day there is no secret recipe to make a successful app.Whatever I talked about are things I noticed from my experience of developing chirplines.I would love to hear different views and comments on the ideas expressed above.