Archive for January 2009

 
 

Proto.in prototype.out

You would have easily guessed what this post is going to be about. Yes, I had the opportunity to attend the recent edition of proto.in and awesome would be an understatement! It started off with Mr. Atul Chitnis talk on how to run successful business. There two important points he stated

Assume connectivity

Always think ahead when building your product. Today is history

Following this was Start-up showcase where each team were allowed to present their ideas for 6 minutes. I was very impressed by a couple of start-ups – Lifemojo, indiakhelo. The ideas were really innovative and well implemented.We had a twitter contest going on and I tweeted like crazy from hari’s account :-) . Sadly though, there were many more crazier people like me :-) .

Post-lunch, there was an interesting talk by Paul Allwin founder and CEO of paagalguy. A Wharton grad, had interesting insights on the concept of a co-founder.

Don’t go in search of a co-founder for the heck of it. You can manage business on your own!

He gave some interesting facts about the crores of revenue this site generates through advertisements and how the attrition rate is less than 1%. A great talk! He had an interesting comment on his marital status :-)

I don’t think, I will get married. Every time, my mom tells the bride’s family “My son runs a site named paagalguy!! and you know what the result is :-)

That was pretty much the interesting part of Day – I.

The 2nd day had better events than the 1st. It started off with Mr. Bob Young’s speech – co-founder of Red Hat Linux, founder of Lulu.com. The talk had a great mix of humor,satire,advices, etc.. Everyone in the auditorium really enjoyed the 1 hour that passed by.

The Start-up showcase wasn’t that great compared to Day I. I can’t even think of any innovative start-up. Start-ups like remindo, fachak looked like an ‘old wine in a new pot‘. The other talk which was particularly interesting and very much applicable to me was ‘Fresh Out of College or Experienced – before making that leap‘. It was given by two young very inspiring entrepreneurs – Rajiv Dinghra ( WATBlog) and Dravid (theviewspaper.in). These two really instilled the belief and faith that if you really want to do something, you can do it! I had the opportunity to talk to them personally after the session, and they were truly inspiring!

However, the most important thing that came out of this event was the fact that I got to know truckloads of people from different backgrounds who shared their experience about how they started off their startup and the challenges they faced. I met the co-founder of letzknow and guess what – he is a 3rd year student in Amrita! I love these people who do what their heart says! I had an opportunity to meet Freeman and talk about tech entrepreneurship, incubation centres, etc. Hoping to meet him soon!

Everyone were given a badge which had their name and the company they belonged to. For some reason, I did not want to disclose my company’s name and hence filled the field as ‘Undisclosed‘. My badge looked like ‘Vivek Ravisankar,Undisclosed:-) . Many people thought, I was running a start-up and I did not want to disclose about it!

On the whole, the 2 days were real fun and I enjoyed the show to the max! It was a stud event, well organized with a good set of speakers. Proto.in rocks!

PS: A bigg thanks to Susa, hari and wally for helping me find my way in Blore. You guys also rock! :)

What is a heap ?

Well, I have been attending Database classes at Amazon for quite some time and its been fun! So, having attended ‘n‘ programming contests, talking about algorithms, etc.. i was posed a simple question “What is heap ?“. You immediately get the fancy tree-like structure where val(child_nodes) < val (parent_node). You know how to do a heap sort, you know how to merge 2 heaps. Agreed, stud! but what is it ? I really couldn’t come up with a rigorous definition that would satisfy him. But the actual CS definition goes like this.

An area of memory reserved for data that is created at run-time which is randomly accessed

So unlike a stack whose size can be determined at compile stage, heap is used at run-time (during execution). Haven’t you ever got a “Heap out of size” exception in Java ? ;) Anyways, so what is random access mean ? It looks too lame a definition for CS people. By random access, it just means that the moment it finds a block of memory that can fit the data, it fills it up.

There are ofcourse different ways of implementing the heap structure – best-fit, first-fit,worst-fit. You can read a nice text here. I am going to write an interesting post about how random access puzzled me :)

Java versus C++

Life at Amazon.com has been pretty good except for a few intricately hidden bugs which at times are difficult to swat! Here’s one nice bug, oops! (no pun intended) I wouldn’t call it a bug. Fully geared up for the task given to me this morning, the keyboard had a bad day until I had to do a swap…

Well, what’s there in a swap after all ? Just out of college, you do tend to show a lot of gimmicks, don’t you ? I too, am a faithful follower of the policy and wrote x^=(y^=(x^=y)); where x,y are integers. Now, compile successful, build successful, Yaaaaaaaaay!!! – it’s a 1000 line code, so the celebration kind of justified :-) . But wrong answer :-( So, I get down to the debugging stage, I do a

while( 1 ) { debug; }

After spending a lot of time (no way, am going to tell you how much I spent :P ), I realised, there was a bug in my swap code!!. Can you imagine ? It was such a common question, almost appeared in every single CS written paper. But, this is Java dear :-) Googling Java specifications lead me to a new finding:

“A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once”

Hence, whatever assignment happens in (x^=y) has almost nil effect w.r.t this statement!!!! This one-liner won’t work To be more precise, C++ rule states

“A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1″

Step 1: x = x^y;

Step 2: y = y ^ ( x^y ) = x;

Step 3: x = (‘x’ computed from Step1) ^ (y computed from Step2 ) = = (x ^y)^x =y

PS: I could have definitely explained it better using opcodes, but I want to keep it as simple as possible. As long as the meaning is conveyed, I am happy :-)

Let’s see what Java does

Step 1: x = x^y;

Step 2: y = y ^ ( x^y ) = x;

Step 3: x = (x) ^ (y computed from Step2 ) = = x^x = 0

This result is attributing purely towards the wicked statement at the end :-) At the EOD, I said “Thank God, there are no #defines in Java, God knows how many gimmicks I would have shown with that and how many screeching bugs would have been inside!!” I want to look at the bytecodes generated, googling how to look at it now:-). My 1st lesson, well learnt :D

How a Software Developer life changes – v 1.0 ?

Well, the title looks as though an experienced Principal Engineer, who has worked in the industry for 20 years is writing the post. But I am just a young kid, 6 months old :) . Even then, I could notice a clear change in the way I perceive/interpret things these days. The other day, when my brother asked me, where I had kept his book, I casually replied “Its on the 1st shelf! Check it.” He rummaged the entire shelf and couldn’t find it. I then realized, I had actually started counting the shelves from zero! and referred to the 2nd one (sigh). This is not the only instance this has happened to me. The reference to the word ‘server‘ at a restaurant, ‘thread‘ at a provision store, triggers a totally different meaning immediately.

I thought there were only a few people suffering from this ailment. But, I was proven wrong. My friend Rahul received a mail(am referring to the postal mail here :) ) from HSBC which had his address and name misspelt. He quickly exclaimed “Their internal DB(Database) seems to be inconsistent !”. I am pretty sure there will be many more people who would empathize with me :) .

On the other hand, I have become more organized in the way I do things. Software developing is not only about coding, its much more beyond that. It makes you think! You keep asking yourself, “Why are you doing this ?“, “Am I actually wasting time doing this ? Is there a better path that I can take ?“. Though this seems to be software design oriented questions, these can be extended to day-to-day life as well. Trust me, you get a lot of clarity in what you do. The design decisions that you make in developing softwares can be extended to any damn thing in the world!

For instance, I am always apprehensive about using my credit card in restaurants- how are you so sure that the waiter to whom you had given your card, has actually not swiped it twice! ? He could have well swiped it for a massive amount the first time and swiped it again for the corresponding bill amount. Would you ever know that ? I would have ideally expected the card statement to contain ‘previously swiped date and time‘. The moment you find that the value of this field matches the current clock, the waiter is in trouble! Well am sure you can think of lot many better designs .

I have often got questions like the one above in many occasions. Its legally possible to have more than 1 passport. Shouldn’t it be an unique identifier ? Things like these seem to come up. Anyways, I seem to be enjoying this life and hope to be like this forever :D

Hello World

A geeky way of greeting people. I have had many unsuccessful attempts writing blogs totally, attributing to my busy schedule (at least that’s what I would like to claim :-) ). There are numerous things that I want to share and a blog seems to be the best way to do it. Hoping to update my blog regularly. I really love the interface of wordpress :-) , much better than the sucky blogspot!