Thursday, December 27, 2007

Problem 1: IP

I have started a small series about the problems I think about regularly and have found no answers yet. Here's the first installment:

For all the non-ComSci folks out there, IP= intellectual property. Its the buzzword used by everyone these days to protect their innovation.

Intellectual Property is the basis of patents, licenses, copyrights and everything guarding unauthorized use of knowledge. If I be audacious enough to proclaim that knowledge should not be hoarded and should be made freely available to all, the age old argument of "reward for innovation" crops up.. nobody can innovate with an empty stomach and it would definitely be bAAAAd to have some smart ass marketing guy steal your years of research and create a million dollar startup out of thin air.

The situation is worse than it seems to be. This became visible to me when I left the academia. Without the academia's massive library at my disposal I need to have ACM and IEEE subscription to get a decent article on any advanced topic. If all the work done by the academia is such a closely guarded secret, how can they even complain about the growing divide between the industry and itself? I refuse to pay $20 for a single paper!! I have been meaning to check the latest in digital search trees and all google, and yahoo search engines leads me to is some totally shallow ppt or to citeseer, which inturn redirects me again to ACM/IEEE.... Arrrghh

Let me stop picking on academia for a second and focus on the rest of the world. Piracy (of ideas, content) exists when supply does not match the demand. Apple is cribbing about fake iPhones in China, had they launched it there(one of the fastest growing economies), they wouldn't have lost the market . Software piracy falls in the same category.. its very rampant in India, being an Indian I can tell that no one would pay $300 for a genuine copy of Windows on $400 machine that they assembled at home. Most of the sales guy tend to concentrate on only the local markets.. bad strategy in my opinion.

We live in a predominantly closed society. If everything was open, we would have a better chance of surviving the future... Just like Maemo and Ubuntu were spawned off from Debian, some new and better OSes would have spawned from Windows(XP?) and OSx. We would have better algorithms and the knowledge distribution would have been uniform rather than spiked throughout the world. This is not to say that you wont have cheap knockoffs of a Macbook pro.. but atleast it will give Apple/MS an incentive to innovate.. it will be a tougher competition, not lack of it.

Thursday, December 06, 2007

Gadget bonanza...

A week ago on Black Friday, I purchased a Canon Rebel XT DSLR camera. It's not the coolest camera on earth, but it is the perfect entry level camera for a hobbyist and amateur photographer like me and fits smugly into my budget too. I had been busy for the past few days getting acquainted with all its features, terminology and the sheer number of settings to be made to take a sellable pic. Since I hardly get any time these days, I was taking a long time to get "OMG" pictures..

Just when I thought I had my share of toys.. I got another shiny one.. Nokia N800. At Mailshell, we have an annual game event when we play some RPG and the whole company plays against the bots or someone online as a team..but the trouble was that the developers almost never had the "right" operating system and it took ages to get the games working on all the machines.. The CEO, Tonny, decided to give everyone a common platform, a Nokia N800.

Its a neat little piece of hardware running a modified version of Debian. Unfortunately Tonny underestimated the geekdom in the development team :P. The CTO flashed the device and upgraded the OS to a newer kernel. I installed ssh, opened an xterm on it and was apt-getting away to glory, started pairing it with all the bluetooth devices I had access to (keyboard, cell phone)... i.e we did everything, but played games on it. The damn thing wouldn't connect (mostly because we had just hacked the stuff to run on the beta OS)... nevertheless it met its purpose.. we hacked away as a team :D.

I can hardly wait for the weekend to really get dirty with it.. for starters I will install a sniffer on it with crackers and keyloggers to see how much data I can gather during one casual stroll to the neighboring Starbucks :P .. just kidding.

Saturday, December 01, 2007

What's going on?

I was just reading my past few entries and realized a dip in content quality and quantity. Most of you would have assumed that after joining the workforce my life has become monotonous with me working from 9 to 5 and having an early dinner and sleeping early at 10 (ew ew.. bored guy cooties) . I assure you that is not the case... After a bit of soul searching I have come up with a list.
  1. I am in CA dude!! I have been exploring this place for the past 6 months. There were hardly any weekends when I was home. San Deigo, LA, SF etc etc.. so less time with my computer during weekends.
  2. Joined the workforce so no time during the weekdays.. of course you would argue that I am not working for the whole day, but there is something about f*ing with your brain for eight hours that renders it useless for the rest 12 hours... I dont even bother to log in to my IM.
  3. I have CABLE now.. after 6 years without the tube, its back to ruin my schedule. It has taken the time away from reading, music listening, podcasts and other activities that caused info overload and instead made me addicted to useless comedies, thrillers and reality shows.. the writer's strike has come as a blessing.. no matter how hard I try I cant resist it.
  4. Travel does not excite me much.. I have seen the tallest trees in Yosemite, ice capped dormant volcano from a height of 15000 feet during free fall, world famous waterfall(Niagara).. so any new landmark has a pretty high bar to cross to make it to my blog.
  5. Linux.. is ready for prime time. There is hardly any tinkering I need to do with it.. makes me almost miss the RH7 days. So there is no interesting hack to boast about.
  6. I hardly check out any new softwares these days.. few years ago I used to test almost all the linux versions that used to hit the magazines, try all the new audio players etc.. am pretty content with my ubuntu and Debian boxes... plus am working with my own software so any free non-braindead moment is meant just for my stuff.
  7. My adult life has adulterated my innocent little geeky life. You know you are in a mess when you keep track of bills, taxes, policies and loans :(
  8. I can hardly use my blog with an open mind... there is alway an HR, relative , friend watching.. waiting to get offended.
  9. Lastly.. I finally got a DSLR and am trying my best to tame the beast.. but the instructional books and videos say that it will take weeks for me to master the basic modes :( .. assuming I am clicking everyday!!
  10. I didn't like the idea of a 9 item list.. so this is the 10th one, just for the heck of it.

Wednesday, October 31, 2007

Call of the wild

So after a month of nightmares and living in constant fear of escaping the orbit of earth(yeah.. I feared that the most.. weird).. I finally sky dived at Monterey. It was an experience I'll cherish for life. Big cheers to Bay Jump. The tandem masters and the photographers had made me super comfortable and were totally professional with 1000+ jumps under their belt.
Now that I did it, I find myself wondering why did I do it... I am definitely not an adrenaline junkie , nor was I "not scared" of jumping.. probably I was just arrogant about doing it.. more arrogant than I was scared.

The jump was from a height of 15000 ft and the chutes came up at 5000ft. Thats a free fall of 10000 ft. It took about 1.5 minutes to cover that distance, 15-20 secs of which were wasted in shouting, screaming and getting used to the fall. In the remaining few seconds I just felt numb, not scared.. just plain numb, and appreciated the beauty that engulfed my pshyche. The scenery was breathtaking.. mountain peaks rising from the clouds, birds flying below me, the bay with its extraordinarily sparkly water and just the visible curvature of the earth... neither words nor any photograph can do justice to that.
Check out this video.. I look scared to death(which is about 10% how I actually felt.. kudos to the videographer) and my vest got fluffed up giving my tummy an extraordinarily rotund appearance.

Friday, October 26, 2007

Email scam!

Many of you guys would have recieved spam mails by some rich guy in Nigeria (or some such place) wanting to offload money and asking your help in doing so. I was not sure of the consequences if I had gone with the scheme. What could the money transfer do to me anyway? I learnt it the hard way.. well I did not goof up.. instead it was my roommate who did it few months ago.

Few months ago, before moving out(after graduation), we decided to sublease our house. My room mate, lets call him XYZ, took the initiative of finding someone. He posted ads on craigslist, various user groups, mailing lists and what not. Finally one day he victoriously declared that he had found a hot blonde from London who wanted to move in a month early and was ready to pay $4000 (our rent was $810.. I smelled rat but who was I to dampen his spirit). Quite surprisingly, within a week or so he got a check for $4000. Since that was gonna be shared amongst us, I kept my suspicion under covers and joined the celebration.

(This part of the story was revealed to me after it happened).
A week later XYZ was contacted by the girl saying that the rent was not fair and that she had checked out various websites and wanted a fair deal. Being the "decent guy" XYZ is.. he agreed to pay $3000 back and since, supposedly the English blonde was low on cash, XYZ money ordered it to her. And then the inevitable happened.. the cheque bounced. XYZ got conned of $3000 which ended up eating up all his savings and cancellation of his credit cards connected with that account. The bank did not want to help in the case of an international fraud.. neither did the police. The school lawyer could only help so far as filing a report with the police and putting up a public notice letting students know that email scam threat is very real.

As sorry I was for XYZ, I was amused and curious as hell. I asked him to forward me few of the emails. Email scammers are not as high tech as spammers so analyzing the emails was quite easy. All I had to do was to do a geo lookup of the MTA ip address. The IP addresses pointed to some location in Mexico.. not London.

Generally these cases go unnoticed because people dont want others to know. I called XYZ yesterday and he told me that he saved 5 other friends from similar scams. These scams are not as uncommon as you think... so beware of trolls on various public lists.

Wednesday, October 10, 2007

Sunday, September 30, 2007

Occupational hazards

If someone walks into your house with a gun how would you possibly react?
First reaction would be ,of course, panic (well.. in most of the cases). Hardly any of us would try to analyze the intention of the guy before panicking.. thats human nature. Why am I talking about this?

A week ago I asked my landlord to forward a port to my machine. He seemed hesitant. I thought he was tired and would sooner or later do it.. I asked him again this week and he seemed hesitant again. I looked at him inquiringly and he asked: "How would you react if a guy fresh out of college with a Masters degree in computer science, specializing in security, working as an anti-spam engineer, with a lock picking tutorial on his blog asks you to open a port on your network?". I had nothing to say to him.

Sunday, September 23, 2007


Note :Do not try this at home without adult supervision

I have been using linux for the past 5 years and use it as my primary OS.. but once a while I have the "OOPS" moment. (No.. this does not mean that there is a problem with linux, just means that if it was any other OS I would have just done a boring clean install because there was nothing else I would be able to do).

I have got so used to larger disk space that when I installed Debian Etch on my "new" 900Mhz machine with 10 GB hard disk, I never put any forethought while partitioning the harddisk. I just went for the default 2G root partition and ~8 G /home partition. As expected, with my rampant abuse of the apt-get command, I pretty much filled the root partition. Now my 500G external disk was mounted on home folder and I did not need any space in there, so it made real sense to redistribute the space. Complication 1: The /root was on a primary hard disk partition and /home was an extended one so I could not use gparted and do any easy cut paste operation.

The right thing a sane person would have done was to cpio the whole disks, repartition and then cpio the stuff back and fix the tiny inconsistencies along the way..but no. I was crazed beyond imagination. I created two disk images with dd and tried to restore them after repartitioning. This wouldn't be a problem for the root partition as the size of the formatted drive was bigger than the disk image..not so with the /home partition. /home didn't have anything anyway, so I thought that even if the image got partially copied, I would be able to fix the number of blocks in the superblock. (Now you know the meaning of the phrase: Little knowledge is a dangerous thing). I had never used dd earlier and had no idea whether this would work.. but what the heck, its all about keeping the spirit of adventure alive.

So after copying the larger disk image onto the smaller /home partition. I ran mkefs2 -S to fix the superblocks and ran e2fsck -y to check the filesystem and fix the errors automatically. It cleaned out my /home directory.. by that I mean it deleted everything.(btw I also tried dls and foremost before performing the step.. these are industrial strength forensic tools.. courtesy of Debian repositories).

Finally I did a clean install but fell asleep half way while configuring it. After waking up I discovered that I had deleted the font files, X, gdm, and few other gnome packages while asleep. I couldn't figure out the packages I had deleted while asleep (may be I wanted to get rid of them at a sub-conscious level :) and no amount of apt-get seemed to startup gdm.. I gave up and did another clean install. Hopefully this should be the last install.. today. All the software mishaps predicted by Murphy's law have already happened.

This exercise made me realize how rusty my sysadmin skills have become since linux became all "user-friendly".. ah the good old rh6 days.

Tuesday, September 18, 2007

Developed country..

I ran out of disk space, so I purchased a 500G external harddisk. This disk was big enough for a file server, so I purchased a second hand PC from my room mate (Laptop cant be kept permanently on). I needed a monitor for my PC(and of course I hate CRTs).. so I purchased a 22'' HD LCD monitor.. but all my room had was a futon so I got a table to keep the LCD on. This is where my story begins:

My roomate took me to a thrift store to get me a cheap second hand table(of course I was gonna pay.. he had the truck to lug the table).. the cheapest one was for $100. Across the street was an Office Max. I got a decent table for around $50, which along with a stupid 3 year warranty(on a stupid friggin table) and service tax cost me around $75.. thats not it. Apparently you have to assemble the table yourself in USA!! I got a bunch of weird looking plywoods, different types of screws and a manual to put it all together. The salesman (with shining teeth and a thumbs up) retorted that it should be a child play for a computer whiz like me(yes.. if you are an Indian with specs in Silicon Valley.. people assume that you have something to do with computers).

5 hours, one broken screw driver, a swollen arm and a million curse words later, the table was finally assembled.

Fours years ago when I needed a table in Bangalore, I just went to the market and picked up a Rs 75 table(completely assembled) and paid the auto rickhaw Rs 30 to deliver it to my place. Is it just me or have people really misunderstood the meaning of a developed and developing nation.

Saturday, September 15, 2007

The Bitter truth

Anyone who knows me, knows that I used to loathe MBAs/Marketing guys (well Marketing ppl I didn't know). Yes.. I was prejudiced, sort of envious of their life and had a feeling of being hoodwinked everytime I dealt with them. I think it's time for me adapt to nature of the world rather than question it. So here's my open apology to all you MBAs out there..

I never was and probably never will be a glib, suave, sophisticated salesman. What one wants to be in life depends on his priorities..its a binary choice; either one aims to be highly creative or one aims to be extremely rich. There is no middle ground. Although your priorities can change over time. You cant be rich and creative.. and mind you the rich will mostly take the credit for the work done by the creatives.

I'll restrict my domain to engineering as a creative work as I can relate well to it. An engineer creates great product, a salesman sells "not so good" products but it sells better than the "great" product. You could call the salesman evil for selling a "not so good" product or you could call an engineer incompetent for not being able to sell his product. The truth is that it does not matter and is not going to change anytime in the future. The salesman will always be on the deck of the cruise sipping a martini while the engineer would be in the engine room doing a performance study of the isothermal combustion inside the turbine... you get my drift. And at the end of the day, when the engineer comes up with a new design for an efficient engine, the salesman takes most of the credit just by doing a presentation (and mind you.. does better than the engineer).

Lemme support my verbiage above with some examples:
  • We all know Shah Jahan built Taj Mahal... who was the architect?
  • Windows was built by Microsoft(most people assume its Bill Gates :P )... who designed it?
  • Did you know who Ted Hoff is? (inventor of Microprocessors)
  • Did you know who Per Brinch Hansen was? (Inventor of OS)
Unless you are a "fact geek".. you might not know the answer to any one of them... and you know what, these guys didn't care. They are necessary for the well being of human race. We should be thankful to each one of them.. from the one who made fire to the ones who are making laser propelled space crafts. We should also be thankful to the salesmen.. they are the ones who are bringing these products to the masses. How would the world now be if we didn't have a Bill Gates mass producing and selling PC softwares? Each product defines a milestone in technological evolution and there is no looking back (Think iPhone, iPODs etc).

In conclusion when a large corporation speaks to you (urges you to buy its product), the voice behind the loudspeaker is that of an engineer.. the loudspeaker itself is the salesperson. You need both of them to convey a message to 10+ billion people in the world.

So all the MBAs out there.. if I have ever judged you by your good looks, smooth talk, a balanced life and money, I realize that it was not your fault.. it was and is my choice. Accept my humble apologies...

Saturday, August 18, 2007

Why do you need PGP?

Lets answer a more basic question first: Why do you need any security constructs like AntiVirus, firewall, IDS etc? Maybe because:

  • You have secret/vital information to protect.
  • The exploit/attack is so easy that any casual user can do it.. for fun.

On my laptop running Linux I don't have an antivirus, firewall or IDS.. I don't have any critical information on my laptop (the critical information is encrypted using my DNA sequence, scrambled using my iris pattern as seed, divided into blocks and stored on NSA servers :P), nor does it run continuously to give the attacker any time to conduct the attack... It's a different story altogether for workstations running 24x7. That said, why do I need PGP to encrypt/authenticate my mails then? It's not that I need to protect my mails from the public eye or even a passive listener.. come on, what can a person get by reading the emails I write to my friends and family!!.. The problem arises when he can write emails to my friends and family using my email ID.. and be undetected. The point of concern is how much easier it is to do so.. let me show you how:

PLEASE NOTE: Doing this is illegal in US and EU unless you own the email addresses you are using. Posing as a third party is considered Identity theft and is a criminal offense. I am using the email address that belongs to me and this demonstration is only for the educational purposes. I am not responsible for anything you might do with the information provided here.

  • Cover your tracks: What better way to do that than tor+privoxy!! Since I will be using telnet for this exploit, I need a way to torrify telnet. torrify command does that but I was too lazy to figure out the syntax. I grabbed tor_aliases to do that. Its a small script that you add to your .bashrc , which automatically torrifies various net tools like telnet, scp etc.(Thanks t3rmin4t0r for pointing it out to me on #linux-india).
  • Find the smtp server of the victim: I am going to send a mail to the ID belongs to me and I use it for testing purposes). Lets figure out which smtp server gmail uses..

  • sridhar@pico:~$ dig mx
    ; <<>> DiG 9.3.4 <<>> mx
    ;; global options: printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 8033
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 7

    ; IN MX

    ;; ANSWER SECTION: 3534 IN MX 50 3534 IN MX 5 3534 IN MX 10 3534 IN MX 10 3534 IN MX 50

    ;; ADDITIONAL SECTION: 214 IN A 214 IN A 237 IN A 237 IN A 285 IN A 5883 IN A 4017 IN A

    ;; Query time: 64 msec
    ;; SERVER:
    ;; WHEN: Sun Jul 29 14:05:57 2007
    ;; MSG SIZE rcvd: 270

    MX points to the servers that receives email. The numbers 50,5,10,10,50 you see are preference numbers. Lower the number, the higher the preference.. for us it means that we have higher probability of a successful attack. which implies that we will be using

  • Speaking SMTP: The last step is to speak in SMTP to make the server to accept the mail. I am not going to teach you SMTP here. Check out RFC 821 for the details.
  • sridhar@pico:~/blog$ telnet 25
    Resolving through tor...
    Connected to
    Escape character is '^]'.
    220 ESMTP o11si2850482fkf
    502 5.5.1 Unrecognized command o11si2850482fkf
    250 at your service
    mail from: <>
    250 2.1.0 OK
    rcpt to: <>
    250 2.1.5 OK
    354 Go ahead
    From: Someone <>
    Subject: Testing

    I see the light!!

    250 2.0.0 OK 1187318464 o11si2850482fkf

Please do note that is my own ID, so no harm done. What have I just done? Sent an email to as I could have used any email address there and nothing will be traceable back to me. The following screenshot shows you the result:

As you can see that the message was marked as spam, that is because I did not create the mail properly and may be in its blacklist. It's fairly easy to fool those spam filters.

Infact the method just demonstrated is used alot by spammers.. just a bit more refined and automated. Nothing is stopping your mortal enemy from impersonating you and wreak a havoc in your life. Yes there are ways to detect a fake mail.. IP analysis, route it takes etc etc, but it all requires the receiver to be a paranoid geek. How many mails do you receive daily and how many times have you stopped to check the authenticity of the mail?

So what is the solution?.. PGP or it's free, open source implementation GPG(GNU Privacy Guard). There are millions of tutorials on the web so am not going to write another one here.

In a nutshell, it attaches a keyed hash to your mail. Since it uses DSA, only you posses the key to create the hash. All others users can only verify your hash using your public key (which has to be published on keyring servers e.g. ). The email client takes care of the whole process so you don't have to do anything except the initial setup.

Is it fool proof? NO.. This will only stop casual attacks. The attacker may spoof your identity, create a public key with your credentials and ask the receiver to download his public key, so the receiver might consider your emails fake and the attacker's emails real, but of course this is not something your friend might do for fun.

Bottom line; if you are breaking up with someone on email, proposing someone or making a million dollar deal, use GPG to tell the receiver that it's really you :)
BTW my pgp key is this. That said I can always deny sending a mail which doesn't have my signature... which I might use to satisfy my evil ends ..Mwahahahaha.

PS: There are chances that the attack shown above might not work. This would happen if your IP is blacklisted.

Sunday, August 12, 2007

Software piracy.. we need to re-evaluate our definition.

Let me throw away my "Ms Universe" stance and admit that I am a hypocrite. I want to get stuff for free but I want others to pay for the things/softwares I create/produce. Apparently there are a lot of people who think like me, a lot of them do not produce/create anything.. they basically want stuffs for free.. which leads to piracy.

First of all, we need to assert the true meaning of the word Pirate; basically a thief/burglar working mostly off-shore. What do you need to do to be a pirate? umm... kill few people, take their belongings and perhaps wear an eye patch (Arrrrr..). Now how did the word piracy come to mean a guy sharing his music/software while still retaining the original copy of the music/software, I'll never know. The word coined by the likes of MPAA and RIAA (perhaps one of them but am not sure) totally defaces the normal norms required for the existence of a society.

By this time most of you anti-piracy advocates would be yelling : THERE SHOULD BE A REWARD FOR INNOVATION. Sure.. there should be one, but creating something does not justify being greedy. Apple developed iPOD in 6 months and as of April 2007 has sold 100 million copies.. isn't that a big enough reward. Harry Potter and the deathly hallows was the most preordered book in history and J.K.Rowling is a millionaire.. isn't that a big enough reward. Yes they are loosing couple of million dollars.. am sorry that they wont be able to buy the unicorn and a gold coated private jet.

Software Pirates are not kleptomaniacs who just download anything off the internet... just the stuff they dont want to pay for. E.g I will never download 300 or watch it on the television.. but I wont pay $10 to watch You, Me and Dupree in a theater. Being a movie junkie, I cant resist seeing the movie either.

Digital piracy is here to stay. Why? Because reverse engineering is always easier than engineering and the people who crack the DRMs and torrent the files are much more smarter than the people who put the DRM in the first place. Its a cold war thats going on between the sofware geeks and the stuffy corporate marketing managers on a turf where the geeks have spent their whole life... it's not too difficult to predict the outcome with most of the major players shunning DRM and MPAA/RIAA. Also the American law forbids the export/import of any strongly encrypted software (i.e. can't be cracked by NSA).. which means that the technology is always going to be crackable.

Lets do the math now.
US population: 301,139,947
Broadband Access: 40,876,000
Lets restrict our calculation to movies. Percentage of illegal movie downloads= 20%
Note that I am just considering broadband users so have accordingly bumped up the percentage by a conservative estimate of 2% (the source mentions 18% total).
=>Total number of Americans downloading movies= 8,175,200 (the real number is actually 25 million).
Number of cases filed= 87
Probability of getting caught = 87/8,175,200=.000001

Need I say more!!

Tuesday, August 07, 2007

He became a legend..

Dr Per Brinch Hansen, my compiler design professor, Chief architect of RC4000 minicomputer(That had the first real OS), inventor of monitors, author of first concurrent programming language:Concurrent Pascal, author of the first book on OS, a voracious reader and a drop dead geek(in a good way.. although he always said that the word was coined by Stupid Americans to pick on smart people, including Americans.. so don't take it personally guys :), because it's difficult for a dumb guy to rise up to the level of a smart person) died on July 31, 2007. He was 68 and was diagnosed with cancer in June.

This was his last email to me that I'll cherish forever:

Dear Sridhar,
Thanks for your kind email of June 1. I am still recuperating after my hip surgery.
I am happy to hear that you found an interesting job in Santa Clara. Everybody should live in California while they are young.
Keep in touch!

Per Brinch Hansen

It's hard to imagine him gone, partly because I never considered him a mortal being. Although he was suffering from senile decay, he had a really overpowering personality and you could really see the halo of knowledge. Frankly, he was seen as a really eccentric person by many of my friends, but since I tend to be eccentric at times, I was totally comfortable with him (Probably for the same reason I chose supposedly the most difficult professors as my advisors in undergrads).

May his soul rest in peace. I wouldn't say that he died.. but became a legend. His legend will inspire many future generations of Computer Scientists/Engineers.

Thursday, July 19, 2007

Harry is comming..

July 21, The day I was waiting for the past two years. For all the sane people out there who have no clue what I am talking about, Harry Potter and the Deathly Hallows, the supposedly last Harry Potter book is hitting the book stores on July 21.

The world looks very different now if you see it from the eyes of a Harry Potter fan. All I can see everywhere is the mention of this book and discussion of possible endings. Just yesterday while having lunch at a deli(not a regular one, this one is in the middle of IT campus and the customers are generally just IT guys), a group of 50+ year old people were discussing Horcruxes and Harry's quest in the last book... shattered my colleague's belief that Harry Potter books are for kids :P. Today Cecelia(of PhD comics fame) wrote about it too.

I will be quarantining myself for the weekend. That means no blogs, no mails, no IMs and no calls. Basically am just trying to avoid all the channels that can ruin the ending for me, especially I'll block out all the people who are Harry Potter fans.. I know they'll do the same.

I have never gone ballistic over a book before.. not for a movie, not even for the iPhone :P. J.K.Rowling.. you rock.

Saturday, July 14, 2007

Vim-blogger and Markdown

This guy blogged about posting blogs from emacs, and for reason unknown to me it stirred my old itch to post blogs within the VI editor... with complete support for different teeny nifty features that I have built into my template over the years, without using html(that just breaks the thought process and I can never get it just right). I also needed the dynamic spell check support in firefox2 that I've gotten so used to.
A bit of googling revealed that there was already a vim-blogger plugin!! Some guy known as The Geek Wannabe already had everything in place. The only thing I had to do was follow the steps. The guy did it using GData API. Markdown was included in it, which mean that I can do all the occasional formatting like this code:

int main()
std::cout<<"Hello World\n";

without sweating about replacing the < like signs with & lt; or adding quoted text like this:

Yeehaw.. I am in quotes.

Adding spell check support was a simple matter of invoking :setlocal spell spelllang=en_us.
This post is written and posted completely within *vim* all the emac guys out there.. up yours :P. Geek Wannabe, you should run for President's position.

PS: Ah.. bit of rough around the edges indeed.. but all for vim-love.

Sunday, July 01, 2007

Whistling at your computer

Those of you following Slashdot would have noticed the IBM's article to provide commands to your computer by whistling at it. I decided to give it a shot on Ubuntu7.04. Follow these steps to get it working flawlessly on Ubuntu:
  • $sudo apt-get install libsndfile1 libsndfile1-dev libglut libglut-dev
  • Follow the instructions in the linked article and download the file
  • Replace the functions getEpochSeconds and getEpochMicroseconds in with this code:

    use Time::HiRes qw(gettimeofday); #Add at the beginning of the file

    sub getEpochMicroSeconds {
    my $seconds=0;
    my $microseconds=0;
    my $timeVal;
    ($seconds, $microseconds) = gettimeofday;
    $timeVal = $seconds.$microseconds;
    $timeVal = substr( $timeVal, 6);

    my $padLen = 10 - length($timeVal);
    $timeVal = $timeVal . "0" x $padLen;


    sub getEpochSeconds {
    my $seconds=0;
    my $microseconds=0;
    ($seconds, $microseconds) = gettimeofday;
    return $seconds

  • After this you can pretty much follow the same instructions that the article explains.
I tried running the few commands(did not try the windowing commands using xwit though) after which my mouth started to hurt and I could not whistle a consistent tune afterwards :( It's a good piece of software, and the sndpeek program that it uses is really awesome and feature rich but I think using whistle as an input is totally infeasible for me.
On the other hand, if you know how to play any kind of wind instrument(like flute, clarinet etc) you can easily write a superkewl password login utility that takes a particular tune as an input... sounds right out of a hollywood movie, doesn't it :)

Sunday, June 24, 2007

Apple: fishy fishy...

Earlier this month Apple released Safari for Windows. Why this sudden generosity from Apple? Why did Apple suddenly jump into the browser market.. I mean sure Apple had its browser on the market for a long time but it was more of a passive player. Even the most ardent apple fanboys used firefox on Macs. The great Stevo himself confessed that he used firefox, so why put all the time and effort porting the browser to a different platform??

At the WWDC Steve Jobs mentioned that they would like to have a sizable market share in the browser market. In fact he predicts that IE7 and Safari would be the only two browsers left in the market. Call me a conspiracy theorist.. but I think thats a load of crap. Knowing Mr Jobs, I don't think he had the browser market on his mind. If you have a Windows installation, give safari a shot and you'll know what am talking about.

Safari on Windows is definitely faster than Firefox and IE. I am a huge Firefox fan but the superkewl interface of Safari makes me wanna boot into Windows. Although the font rendering is not crisp, just the speed and Apple's zen like interface designing approach makes browsing a totally different experience. To top it all, apple went through all the trouble of retaining the tiny special effects like rollover in their browser. I have a big appetite for effects and beryl on Ubuntu takes care of that pretty well but you gotta give Apple the credit for putting those effects where its least intrusive and least expected.

90%(maybe more) of the Windows crowd do not have access to a Mac and have never heard of Linux. By providing a windows app, Apple is using Microsoft to advertise its technology. These simple effects are enough to blow the socks off any casual Windows user. Most computer users just want an eye candy pc for browsing or word processing... Apple computers do that and look good too. An app as simple as a browser showcases Apple's technology and their capability. Its a perfect setup to woo Windows users. In my opinion Apple's not eying the browser market.. but the OS market. The timing couldn't be better.. MS is trying to change its product line and challenge Google. We are witnessing a clash of titans, Google, MS and Apple. The evil geniuses of Bill Gates and Jobs, and the combined minds of thousands of geniuses employed by Google makes the outcome totally unpredictable.

I guess we can grab our bag of popcorns and watch the show.

Wednesday, June 20, 2007

American Television...

After 6 years of spartan college life, I finally have a television set in my room. Now torrents and few online video websites are all that I need to cure my video itch, but I decided to give this hassle free medium a shot. I have been watching television for about 20 days now and I get about 75 channel. Here's my analysis:
  • 25% of the channels are in languages that I don't understand.
  • There is a 99.9% probability that Discovery channel will show either the Mythbusters  or Man Vs Wild
  • FOX and TBS will only show reruns of popular old sitcoms.
  • Rest of the channels will air some sort reality shows.
What irritates me the most is the sheer volume of Apprentice type shows. In the past 3 weeks I have seen numerous shows; 3 of them with cooking theme (Hell's kitchen, Top Chef and some stuff on the Food channel), one to select a hair dresser (Sheer genius), one with movie direction as a theme (the contestants make their own short movies), yet another one shows a contest between two set of ladies in their 20s and 40s to win a guy in his 30s.. the list is endless. Another show (America's got talent) takes stupidity to a whole new level by allowing the contestants to do anything they like.. how one can compare a song, a dance and a standup is beyond me.. they lie on a argand plane, they are too complex disciplines to be compared. Just today on the same show, an old lady in her 80s sang a classical song and a guy from Pakistan danced to bollywood tunes.. how do you compare them??

And what's with the advertisements!! they are almost as long as the show itself and the amount of bullshit in the ads needs another blog entry altogether. Hybrids are shown as if they are going to solve all the world's pollution problem in a jiffy.. no mention of the pollution caused by the manufacture and disposal of the Li-ion batteries, has its own stupid "The Algorithm" advertisement... let the app speak for itself, Home Depot encouraging minors to gift their dads on father's day!! take a look at their inventory. How is a 10 year old supposed to get money to buy his dad a GPS device or a gift card to buy it??

For the past six years, I have been watching pure, unadulterated, pirated video.. I guess this is the reason why most people pirate media even after being able to afford it. I hope the Cable TV folks learn their lessons fast, the end user now is not as stupid as he used to be...

Friday, June 08, 2007

My way of saying "I Hate You"

I never intended this blog to be too public. Just known amongst the inner circle.. seemed like a good way for people to know me. The problem arose when I didn't want people I know to know me.
I hate when people read this blog and evaluate me after reading just a single entry. I never had to slander anyone till now but the realization that I can't do it on my blog robs away my sense of independence and freedom.

For the past few days, I have been mulling over this problem. I was consciously trying to avoid posts that will hurt certain segments of the society or adversely effect me. It's certainly may be categorized as "unethical". But I guess it's wise to not say anything rather than let the world know what/who you hate. So folks if you think that I should be writing about something and am not.. then in all probability I am not fond of it.(to put it mildly)... and yeah.. I have another blog which I use to vent out my frustration.. something like going into the woods and shouting out loud.

Can you hear the screaming silence??

Friday, June 01, 2007

The end of the beginning..

My academic life has now supposedly ended.. you know with me graduating and all... I have moved to Santa Clara and would be working for Mailshell. Hopefully I will not succumb to the complacency or frustration that I have seen so many people succumb to after stepping into the real world. Anyway.. This entry is dedicated to people who influenced my life in Syracuse and have a big hand in what I am and who I am:

Dr Marc Howard: There are really few people on earth who don't judge a person by their past(I mean work experience.. not parole history :P) but what they are. He is one such guy. People want experience, they want something on paper.. something that speaks of your achievement. When I met him I had none.. During the initial interview.. my answers to almost all his questions were: "I dont know".. I was hired.. probably because our shared hatred for microsoft, because I loved Linux, because I was a vegetarian, because I was a coder stuck in a food court job.. I dont know the reason. Frankly I thought that I did not fit in well.. I had no knack for cognitive mathematical research(although was interested in it), but somehow he always found me something that I was interested in doing and something I was good at doing. I worked with him for an year and met some most amazing people; Vinayak, Vijay, Jennifer, Donna.. they were all gurus in their field and kept Memlab machinery running smoothly.. Dr Howard if you are reading this: Thank you for being there...

Dr Wenliang(Kevin) Du: I worked as a research assistant under him for an year and it was a rocking year. One after another, the super kewl projects kept my adrenaline levels insane. Remember when you were a kid and you so badly wanted that bike or that GI Joe set or that comics.. remember how you felt when you got them; I felt the same about the projects I did(that I wanted to do). Dr Du gave me direction.. I always wanted to do the projects I did for him, but when he sponsored my 2 semesters in Syracuse University, paid me stipend, I didn't have to worry about anything else.. I just did what I loved to do. My lab became my haven, a utopian land where nothing went wrong.. life was too good. Thanks alot Dr Du for letting me play with what I loved to do and building my resume on the way.

Dr Per Brinch Hansen: Now I have already written loads on him so wont overdo it. He reminded me of two professors, Mr ATC and Mr Sridhar M, of my undergraduate college. You know what the common thing amongst all three is: Every one suggests not to take their courses, most of the people who take their courses have their ego hurt and hate them(some open hate groups), all three are considered difficult... but I liked all three of them, they were excellent teachers, and somehow I didn't find them that strict and found their courses extremely easy contrary to the popular belief, all three of them helped me alot in my career. It was an honor being his student and that too in the last compiler design class he taught.

Dr Jim Fawcett: Most people in Syracuse University would brand me as a hypocrite if I say that I am a "Fawcett Fan".. The word "Fawcett" has become an adjective in Syracuse University. There are Fawcett courses, Fawcett Fan club, Fawcett quotes.. etc etc. I know people who take all the courses he offers (8 I think).. I took two of them and really loved the Object oriented Design course. IMHO It should be made a core course. The mere fact that I just took only two of his courses and I work on Linux, causes many guys to think that I am not a "Fawcett fan".. but I am. I have never in my life seen such an energetic person with so much industrial and academic experience. What is more interesting is that he is really affable and can teach the a dimwit to write the most elegant C++ code. Dr Fawcett.. I salute you .. and I am a "Fawcett Fan" for life :)

Syracuse University: Lastly I would like to thank my alma mater. After all I met the afore mentioned people here. The infrastructure here is aeons of geological time ahead of any place I have been. It gives your own niche. You can find people to "Party" and you can find people to "geek out" with you. Almost any legal activity you can think of, you can do it in SU.. for free. Man.. I love that place.

PS: Click on the first and the last photos to view pictures in the related sets.

Tuesday, May 22, 2007


Remember the good old days of RH7 et al when almost all the software had to be recompiled and adding a new hardware meant atleast a day's work to get everything working properly.. and when just an installation would make you entitled to use the word "Geek". Yes...those were the days.. It really was a great feeling back then.. you felt completely in control of your PC.

Now evolution is indispensable .. so Linux evolved.. from an experimental system to a commercially sellable system.. We had a barrage of distros.. touting compatibility, snazzy graphics and point and click solution to most problems. The public applauded and accepted Linux but deep down inside I hated them for liking linux just because of its looks..

Anyway.. my taste in distros underwent a drastic change from RH to Fedora to Debian and finally to Ubuntu. I was not a fan of the pointing device but the apt-get and the highly up to date repos have kept me hooked up. There were hardly any instances when I had to mess with something. Scripts like Automatix took care of most of the painful jobs.. Even if I had to recompile the sources, ./configure make "make install", hardly counts as hacking.

Anyhoo.. coming to the meat of the subject a friend of mine got some HP laptop with AMD 64 Turion, 2 GB RAM and a Broadcom 4310UART wireless card and was bugging me that he could not get wireless to work under Ubuntu. Normally I dont like support calls but this changed it all. There was a bug in Broadcom drivers(Specifically the way NDISwrapper used them) for AMD64 having more than 1GB data.. An opportunity too good to miss.. I went to my friends place to fix his card(yeah am mad and was totally bored).

After two hours of hair pulling, RTFMing and shouting out F&^* loud.. I got the damn thing to work. It was the most refreshing thing I had done in a while :).

PS: If you are having a similar this, this and this.

Thursday, May 17, 2007

Cute Customizations..

I hope you guys would have noticed the usability enhancements in Google search in the past few days. Earlier it just used to throw all the search options above the search textbox. Now based on your query it suggests search options. E.g if you search for Harry Potter, google will suggest you searches in books, news and video sections, but if you search for iPhone, google would suggest news, patents, blogs and products. A small yet nifty customization to save the end user from information overload. I also love the way they handle the presentation of results.. a gazillion line program running(or operating on a dataset of that size) on a 100 node beowulf cluster(just a speculation) justs gives you a single line of relevant data, sometimes just a hyperlink... friggin amazing.

Google's Experimental search gives an insight into the changes we might see in the future. I am already a fan of search keyboard shortcuts. I thought that it would be a great idea to integrate it with the google suggest plugin built into firefox. The following keybindings are available in google search:

Key Action
J Selects the next result.
K Selects the previous result.
O Opens the selected result.
Opens the selected result.
/ Puts the cursor in the search box.
Removes the cursor from the search box.

Adding these options to the search plugin is quite straight forward. The file /usr/share/firefox/searchplugins/google.xml(on *nix of course, Windows users can make the same changes in the respective files too) stores the configuration for google search. Just add the following line in the static parameters section:
<param name="esrch" value="BetaShortcuts">

Restart your firefox and try googling using the search plugin. You should see the navigator arrow similar to that in gmail(with keyboards shortcut available ofcourse).

On a somewhat related note; I upgraded to Pidgin. I've been using Gaim's beta6 for sometime now. Pidgin sports better graphics but there are no functional improvement over Gaim2 as such. One thing that is lacking in Pidgin is the lack of emoticon sets available to Yahoo messenger users(apart from no video or voice messaging system).. there is a workaround though. This guy has posted a link to the ymsgr emoticon set. This is how you could get it to work:
  • Download and extract the zip file from the website.. it is extracted as a directory named default.
  • Rename it to Yahoo
  • Find a file called theme in it, open it in an editor and change the name and Author values to differentiate it from the default pidgin emoticon set(anything is fine).
  • Archive it as yahoo.tar.gz
  • Open Pidgin->Tools->Preferences->Smiley Themes and drag and drop this tar ball in the window.
  • Select the entry that appears.
  • Alternatively you could also move the directory Yahoo to ~/.purple/smileys and then select the new entry later.
The animated smileys move a bit faster but they are tolerable. Man.. i surely love linux and these applications for their flexibility.

Sunday, May 13, 2007

Sridhar Iyer, MS

I am now officially a Master's graduate and all set to conquer the world. I can't help but think about my adventurous journey from the suburbs of Kanpur to Bangalore to NY(Syracuse) and hopefully to California(might end up there).

There was a time when just the thought of coming to USA was laughable. Forget USA, the only place I could see an airplane was in the sky. I used to cycle my way to the "tempo" stand to attend coaching classes..
There was a time when I thought that life had nothing left in store for me when I didn't make it through IIT and ended up in a nondescript college (it was not that bad though..).
There was a time when I worked in food courts (just for a month though).

I am sure that there would be thousands of international students in USA with similar stories. SU has had students from more than 157 countries!! During the commencement, I saw the glazed look in the eyes of parents.. some from poorer third world countries... I felt small.. Even though I was surrounded by a lot of graduates who earned the same degrees, they accomplished much more than I did. It takes courage and dedication to break your safety cocoon and search for a better world, and strive to be there rather than be intimidated by it... only to be labeled as "lucky" if you do so.

Syracuse University was the perfect university for me and I think that it is the right place to do MS in Computer Science. I have met tons of interesting people, scholars, academicians, optimists(yeah.. they are a rare breed) and drop dead geeks. It has strengthened me physically (coming from a place where the temperature is around 45C.. the -40C winters were quite a change, surviving on cheese pizzas and ramen noodles is a feat in itself.. {Jorge: am still a vegetarian :P} ) and mentally(come on .. it's grad school). I can see things clearly now..

I can't predict my future but I do know that as long as I have a dream and a path of virtues.. life will always be great. The following excerpt from the commencent speaker, the renowned author Frank McCourt, summarizes it well:
So I've reached this point in my life where I'm doing what I want to do and that's the most beautiful thing of all... . If you don't love what you're doing, you're dead. Take out insurance. You're dead. And I leave you with a quotation from an old English poem: "Read your scriptures, follow in the path of virtue, and keep your bowels open."
PS: Click on the pic above to see my graduation photoset.

Tuesday, May 01, 2007

The sound of music..

Am not a music enthusiast, but when I got to listen to it, I need the song. Although I do have an MP3 player, I am fond of internet radio.. live365, pandora,, et al. Most of them work flawlessly on Linux.. but some Indian Bollywood radios seem to fail pathetically. I always thought that it would be some compatibility issue since they seem to work fine on Windows. Incidentally, few days back I started firefox from the terminal(well.. i generally click on the icon) and wistfully tried playing a song from (Firefox on wine is really frustrating). Of course.. nothing happened, but I found a SEGFAULT reported to the terminal... this was the beginning of a big adventure :)

I googled out the issue and found that someone had found the issue and interestingly enough posted the solution on bugzilla long ago. I downloaded the latest tar ball and saw that the errors were not yet fixed! Big deal I thought.. lemme compile the code myself. There were no INSTALL or READMEs in the directory.. but there was a Makefile... I didn't care to look into the makefile and just called make. That didn't work.. I found that Makefile called individual makefiles in hundreds of subdirectories and those makefiles were not there in the subdirectories!! This is where the "real" fun began.

I have to give you a brief idea of the helix project on Linux(Real's backend) before I can proceed further.
  • Its a mixture if highly convoluted C and C++ code. The building process is handled by a python script called Umake (which is used for cross platform compilation).
  • The same blob can be compiled into helix server, helix client, real player.. etc etc. There are 32 different project into which you can compile the source code into.
  • There are 634 build targets!!
  • This whole setup reads another configuration parameter to know the destination build system.. including most almost all versions of Windows, Unix and linux.
  • I'd leave the maths up to you.
It makes sense now that a static Makefile was not supplied with the release tarball. But I was pretty adamant on getting RealPlayer to work with my firefox installation. This manual will tell you that how freaking hard it is to get the damned thing compile.

I had to become a Helix community member, set up CVS access to the repository, accept all the BEULA craphola(I am not allowed to fix bugs and let people have it even though its free), spend countless hours debugging the substandard code and build it. The whole code base has tell tale signs of cut paste code, unnecessary optimization and non standard C++. I was messing up with the latest stable release when one of the Real developers informed me that the branch was dead!! I got one of those nightly builds that had fixed few, but not all, of the issues. I then quickly made the changes and got the thing to build. The most stupid errors were the ones where the variables were used without definition inside a #ifdef clause, casting a boolean into integer etc.

To cut the long story short, now works with firefox on Linux!!! and no unfortunately I cant give you the binary, you have to build it yourself.. RealPlayer's license needs another entry. It is clearly an example of __evil__ open source (The good one being GPL of course). I cant check in the code cuz I was not authorized to modify them at the first place.

Anyhoo.. the songs sound so much more melodious now :)...

PS: A developer asked me to submit a patch. If all goes well, then the whole Linux desi community would soon be thanking me :P

PPS: My patch is accepted. You can download the nightly build by tomorrow.. or wait for the next release. It will be a part of the next release... Yay!!

PPPS: Download the latest binaries here.

Saturday, April 28, 2007

Tech update..

So it's time to bore you with stuff that keeps my boredom at bay. Few of the technologies that I have embraced and felt great about. Here are few of them:
  • Google web history: Few days back, google's personalized search history metamorphosed into Google web history. There were a lot of murmurs that google now has all the knowledge about you.. Guys give it a break!!. Even if google has it.. so what?? Believe me, there are a million ways to track you down, sniff on your IMs, see your browsing history and even get your password. Google's worth is around 100 billion and would certainly not be interested in identity theft scams, so give it a rest. It's really helpful if you have forgotten to bookmark something (delicious ofcourse) at work and want to look at it later.
  • Google recommendation(GR): This was bound to happen. Clearly, Google let its snazzy neural networked monster lose on my web history to recommend me web pages. It looks a lot like StumbleUpon, but it's not. StumbleUpon is to GR what yahoo directory search was to google search. StumbleUpon gives you some random sites, some funny ones, you hardly spent 30 seconds on them. GR on the other hand gives you well defined searches, some you can spend the whole day on without regret. It helped me find the right drivers for my card, a tutorial on a topic I had totally given up on.. its simply great. It still needs a little bit polishing though. It quite clearly also takes the site that it recommends as an input for the next iteration. This might be desirable at times but sometimes the results just get too convoluted. E.g I was searching for some actress' web page. GR recommended me another one the next day.. fine, I thought.. but now since GR thought that I have visited two sites (one on my own and one by recommendation), I would really be interested in them and started bombarding me with web pages of different actresses. I had to go and delete the web history to take care of that. I guess the next step for them is to monitor the time you spend on a website to compute its weightage... they surely would have some brains working on the issue.
  • Ubuntu Feisty Fawn: Finally upgraded to feisty fawn. It's without doubt the best desktop distro I have ever used. It has rock solid stability and flexibility. Now Fedora is definitely more secure than Ubuntu but I find Ubuntu much more usable.. and I dont care much about security on my laptop.
  • AIGLX + Beryl: I had posted earlier about XGL+compiz on my Dapper. It made the system so unstable that I never even thought of installing it on Edgy. People all over user groups were crying over lack of Linux driver support for ATI cards, so I had given up all hopes. GR popped me a link about installing AIGLX+Beryl on ATI drivers (somehow I never though about aiglx, was too fixated on getting fglrx to work on my system with mediocre results). Did the installation and am totally in love with my desktop. I have totally shifted from metacity to beryl. I removed all the obtrusive features like wobbly windows and magic lamp effect to get me simple snazzy desktop. For once my terminal windows are truly transparent/translucent. The beam out effect on closing windows is fast, fashionable and unobtrusive. Of course I retained the rotate cube functionality when I switch desktops by mouse(which i hardly do) to show off when needed :P.
  • Evolution+Gaim(Now Pidgin): Well.. I was using them for ages but never customized them. Gaim kicks any other IM clients a** (civility enforced :P). It gels amazingly with the desktop environment. Help me remove redundant entries for user.. i.e. it shows only one entry per user irrespective of the number of accounts or aliases he/she has logged in as. The psychic mode is another awesome feature that notifies me when someone has just started typing me a message before they complete it.. works really well to spook people out. Evolution did a great job importing contacts from gaim and I find its junk filtering mechanism more usable than thunderbird.
I was planning on a new laptop (this one is almost 2 years old), possibly a MAC.. but I think I've changed my mind. Ubuntu can be, whatever I want it to be.. it supports non-free restricted drivers.. and has my 2nd favorite OS underneath (minix is my 1st fav but has still a long way to go).

Tuesday, April 24, 2007

India Shines

I am not a conventionally patriotic person, but boy.. this makes me so proud. India plans an unmanned mission to moon next year. There are still debates if there'll me a manned mission by 2015 or not. Well, India is still a third world country and putting a man on then moon makes little sense when people are living in abject poverty and corruption is rampant.

But the commercial aspect of it is interesting. India launched the Italian satellite for just $11M, whereas the cost of doing so elsewhere is between $50M to $200M. Not only is India helping other countries set up their own infrastructure in a cost effective way, its furthering its own knowledge and, am sure getting rich in the process. The market of space tourism is just heating up. It costs about $20M to spend some weeks in space.. just imagine the rush if India started offering it for $1M.. maybe less. I am sure there'll be year long waiting list to get on that ride. I am pretty sure that our scientist President and PhD Prime Minister had something to do with it... not that they are going to admit it(they are really modest).

Lets see how India is able to use this market to its advantage..

Update: Broadband to me made free in India!! Holy s**t.

Thursday, April 19, 2007

I am High!!

const n=10;
integer array A[n];
integer x,i;

proc Sort
integer k,x;
do ~(k<1)>
do i
if A[i]>A[i+1] ->
1=1 -> x:=1;

$Input Table:
do ~(i>n)->read A[i];i:=i+1; od;

$ Test Sort:
call Sort;
do ~(i>n)->write A[i];i:=i+1; od;


Hmm.. before you bombard me with any questions, let me answer them all..
1) What Language is that?
Ans: PL

2)What does it do?
Ans: Its a really bad inefficient implementation of bubble sort.

3)Does it actually compiles and runs?
Ans: Yes, Of Course.

4)How do I know it?
Ans: Cause I WROTE THE COMPILER!!! I can not express in words, how elated I am. Well, of course, its just another project. But.. its a friggin compiler!! I wanted to make one, when I first came to know about them(about 10 years ago).. It's totally surreal. It gives me error messages when I make an error(Type error, Syntax error, out of Scope etc etc) and it took almost 3 months to finish it (well.. only 2 weeks for coding though). It totally amazes me that how a figment of my imagination can suddenly become so tangible, so real.. so alive.

Sincere thanks to Dr Per Brinch Hansen, for helping me realize a dream. Its been a pleasure being his student.

There is also sadness deep inside.. I realize that I may not get to work on a compiler ever again in my life..but there is hope..
If I have a geeky kid or a grandkid, you know what stories I will be telling them :P

Sunday, April 15, 2007

Its alive!!

Remember the good old school/undergrad days.. when you thought you knew everything. No? Well then I guess it was just me. I was as enthused by open source and Linux then, as I am now, but was apparently not a very good programmer(good by the standards of ppl of my age though)... but of course I didn't think so then. I made a Linux Task Manager on the lines of Windows task manager which had a similar interface and used to parse the data from the /proc directory. It was one of the best term projects and I so was excited by it that I went and uploaded it on Sourceforge. Of course I did not maintain it... I was young and brash then :P.

Fast forward four years.. I g0t a mail regarding missing files in that project!! I went and checked the sourceforge page and was shocked to find a 93.1% activity and about 96 downloads!! I downloaded the old tarball and it was missing a few source files... who would want to download such a project?? I found an old CD containing the source codes of my projects.. used qt3to4 to convert the project format and re-uploaded it. Ofcourse, I marked it "ceased development".

I just looked into the source files to see if I could quickly fix some of the stuffs there... There was a bigger surprise waiting for me. I had done implementation in the .h files... used namespace-less header.h files, used fscanfs in C++ code... programmers doing any of the above stuffs should be immediately stopped from using the computer and should be sent to concentration camps and tortured until they start following the guidelines.

There was a time when I would bring the project into any discussion I was involved in... Fortunately there is still time and there is still no such product. I swear to totally change and refactor the code as soon as I get time...

PS: If you are a Qt expert and are free, you can contribute to the project.. wont take long to get it up and running.

Tuesday, April 10, 2007

Phi Beta Delta

I got nominated for membership in Phi Beta Delta. You ask why? Not to sound boastful(or to reaffirm the fact that modesty died the day I was born), I'll attach the verbatim copy of the nomination letter:

March 8, 2007

It is our pleasure to inform you that you have been nominated for membership in Phi Beta Delta by Dr. Patricia Burak, with the concurrence of the Membership Committee of the Syracuse University Alpha Sigma chapter. Phi Beta Delta is the nation's first honor society dedicated to recognizing individuals who have demonstrated scholarly achievement and performed outstanding service in the areas of international education and exchange.

There are three basic categories of members: first, distinguished international and domestic faculty and staff; second, international students and scholars who have demonstrated high scholastic achievement at Syracuse University and have demonstrated interests and/or involvement in international activities; and third, domestic students who have demonstrated high scholastic achievement and/or comparable experience.

The ceremony was on April 9'07. Here are the pictures and a brief video of the speaker explaining the meaning of Phi Beta Delta.

Now... I just NEED a job :(

Wednesday, April 04, 2007

The final Cap

If you guys are following the news, you would know that the H1B cap reached on the first day itself. The immigration services received a whooping 150,000 applications to fill 65,000 H1B quota( 6800 of which is reserved for people from Singapore). It is yet to be decided that how many of those applicants held an advanced degree from US. The US government has decided that it will randomly select 65000 applicants from the applications received and reject the rest. That effectively means that around 70,000 people will not get the visa(even the ones who have already got a job). Add to that, the number of people who might get a job(people like me).

Now let me do some simple maths here.
  • 90% who apply for H1B visas have technical jobs with salaries > $50000.
  • A new grad can earn anywhere from 65K to 90k.. and pay 15k to 30K in taxes.
  • Let me take a conservative estimate and say that all 70,000 people would have paid $10,000 in taxes.
  • This means that they would have contributed to $700 million to the US economy.
Now what happens to that $700 million?? Those generated jobs don't vanish into thin air... they are outsourced. What happens next?... the government cries about outsourced jobs.. while other economies flourish. If US was a privately held firm, the CEO would have been sacked by now.

PS: Who would have thought that I would write about international politics and economy.

Thursday, March 29, 2007

Was it worth?

My life at Syracuse University is close to an end. I have a GPA of 3.75 and might end up with a GPA of 3.9 if all goes well. I have been a research assistant for two years, worked extensively on computer/network security and OS internals. I have done independent study on genetic algorithms and have taken advanced courses like Compiler Design, Computer Security etc and to top it all I have been nominated for the Phi Beta Delta honor society. In short, I have achieved whatever one can possibly ask from a graduate school.... but was it all worth?

Well it may seem strange that I am questioning the worth of something I enjoyed doing. Life has been exceedingly fair to me till now but it seems that it has something else in store for me now. I haven't got a job yet, mostly because I have been picky about the jobs and that I have been rejected by all the jobs that I pick. Another sword of Damocles is the constant threat of H1B visas getting over. My future is totally unpredictable... I might break down, submit to consultants and work on some SAP/Peoplesoft job(god nooooo................). My daily schedule now includes talking to consultants, relatives and friends about jobs, checking the H1B quota.. praying for it to increase(first time in my life I am following politics :( ). All I need is a decent ground to launch a career.. Is that asking too much? I dont care about the money.. I have worked for free in the past.. all I want is exciting cutting edge work... Am i just a wide eyed academician and there is no such thing as "exciting work"? Would I grow old like everyone else and then oneday tell my kids and grandkids that I was once a good grad student... ?

I am in paranoid city.. so maybe I am thinking too much. May be something interesting will come along.. maybe I will get a good job...until then I gotta keep going.

Friday, March 16, 2007

What next??

I've seen my share of movies and read enough literature but every piece of work seems to end abruptly and makes me crave for more. There have been instances when I saw five movies back to back or read two novels without any break. Tragedy, comedy, fantasy or fiction; nothing ever seems complete. They only focus on the beginning of the "real" story.

One genre of movies shows the hero in abject conditions, he rises on occasion, and at the end achieves his goal. My question: what next?

I saw Iqbal today. Its about a poor village boy, deaf and dumb, who makes it to Indian cricket team, with the help of a mentor, who in a way redefined himself and found his own courage with the help of the boy. Finally he does makes it to the team, but what happens next?

Initially you have nothing to lose, the support of your family and everything to gain. So either you succeed or stay the same. Nothing much can happen to you. The case is reversed when you succeed: You have much to lose, you are away from your family, the gains are not all that great and you cant stay at same position. So what would have happened to Iqbal(whom I described in the para above)? What happens after he makes it to the Indian Cricket team, his mentor dies and he is away from his family on an international match?

Having goals is nice. Redefining your goals after you reach your goal is better. I have had loads of acquaintances who had set a very specific goal for their life... getting into IIT, being an engineer, studying in America etc etc... they did not fare too well after they achieved their goals. So basically an average person spends around 25 years of his life achieving his goals, next 40 years riding on his achievements... and after that..probably hoping to get recognized without doing any work. Of course there are exceptions, like the "KFC" colonel who started business at the age of 65. There should be more movies and novels about the story after "the success"...don't you think?

My career goal is to be a CTO in a big MNC.. my own MNC. The odds against me achieving that goal are great.. but hey! I have a lifetime to achieve it :)

Tuesday, March 06, 2007

Weather in Syracuse..

Weather in Syracuse requires a special mention. Yesterday night the temperature was 28F(-2C) and today morning its 0F(-18C) and it feels like -21F(-30C) due to wind chill and blowing snow. Pretty drastic change in temperature in one night...don't you think?

Its said that once a professor at SU missed summer in Syracuse. It fell on Tuesday and he was out of town.(from PBH memoirs)

Saturday, March 03, 2007

Compiler Design....

Before I dive into the meat of the topic, I would like to mention that I am a HUGE fan of Per Brinch Hansen... so whatever viewpoints I express in this post, will totally be partial to him.Per Brinch Hansen is teaching me Compiler Design this year and I need to implement 6 phases of a compiler, for a minimalistic language(PL), incrementally for the course completion. I am already done with the scanner and parser.Programming should be a thoughtless process. It should be as obvious as Maths.

Most of you guys(that is, if you are in Computer Science) would have taken design courses(OO etc ). How many times did you have trouble implementing a properly designed code? If your design is good, you should have none, but the idiosyncrasies of the programming language sometime do corner you at some nasty implementation issue. Everyone has seen a nasty memory leak or a typo ruining the whole logic of your implementation. According to Prof Hansen:
Programming should be a thoughtless process. It should be as obvious as Maths. If you are asked the value of 5+2, you would say 7. Have you ever stopped and tried to derive that. Programming should be like that.
Yesterday I was writing the parser, which mainly involved sifting through the PL code and producing a JAVA implementation for the PL's BNF. PL's grammar had some 50 rules which needed to be implemented in the form of around 50 functions. Following the design rules and restrictions imposed by him, I was able to code the parser in just four straight hours!! The code compiled with no syntax errors!! I spent around a day testing it rigorously..and nothing failed!! In fact at one point of time, programming seemed more like documentation. I even wrote vi macros to construct the function skeleton from the grammar rule in the comment (I hate typing:P ). Cant wait to finish rest of phases...

PS: BTW the EFS project ,I was talking about in the earlier post, is implemented and all the issues are resolved. Too bad its proprietary :(

PPS: A colleague forwarded me this link. Turn out that Per Brinch Hansen was the one who came up with the idea of an OS kernel!!

Saturday, February 10, 2007

Am I an engineer?

The most appropriate heading would be "Are software engineers really engineers??". I'll get to that in a minute. According to Wikipedia:
Engineers apply established principles drawn from mathematics and science in order to develop economical solutions to technical problems. The work of engineers is the link between perceived social needs and commercial applications. Engineers consider many factors when developing a new product.
There in another word, CRAFT... according to the Wikipedia again:
A craft is a skill, especially involving practical arts. It may refer to a trade or particular art.Crafts practiced by independent artists working alone or in small groups are often referred to as studio craft.
The only thing that distinguishes craft from engineering is objective logic and intuition. There is no place in engineering for the "feel good" factor. It just a simple cold manifestation of science in a practical form, which in turn is just simplified mathematics represented in language understandable by humans.

So why is software development a feat of engineering? and not a craft?
Now there is nothing wrong with it being a craft. New craftsmen are trained by a master craftsman (something like internship/co-op).. they mimic everything the master does to achieve the end result. This works for general arts and used to work for medical science too few decades ago. So if you were to learn software development as a craft from the "experienced" developers, you would mimic everything they do... even if it involved throwing a dead frog after declaring each variable in a file, and it will not lead to a catastrophe until you are copying everything that the master developer does.

Advancement in technology has given so much slack to us "Computer scientists/engineers" that we do not evaluate the consequences of our action. We do not look at a problem as an engineer in other field would. Take an electronic or mechanical engineer for an instance. How many time have you known that they designed a system that failed or had a bug? Bugs are a commonplace in software engineering. Infact it is widely acknowledged that a shipped software will have bugs.. then there will be an upgrade or a patch released to fix that bug.. and then another..and another ...and so on. This is mostly due to the fact that most software rarely effect human life... but when a "crafty" software developer does write a such a software, we are in for some serious trouble.

Not all the software development fraternity works this way. There are certain organization that are required to develop 99.9% bug free software or risk loosing a million dollars or a million lives. NASA is one such company, a bug in code would mean loss of over a billion dollars.. and guess what! they don't do version upgrades on space vehicles. It does what it is supposed to do. No one is perfect though, the MARS land rover running Linux had a small race condition and that had jeopardized the whole multi billion dollar project... and imagine the mental state of the computer programmers who had the whole world looking over their shoulders, ready to point fingers should anything go wrong. Fortunately they recovered with minor losses. Boeing is another one, from auto pilot to auto land, everything depends on the software... a small bug would not only cause the death of many lives aboard the plane, but would also lead to the destruction of the multi million dollar equipment. Forget the biggies, the real time and embedded software developers are also better engineers because their software control the expensive machineries. Then we have the financial developers like Bloomberg... the whole money making fraternity depends on them, from Goldman Sachs to JP Morgan. A simple miscalculation can lead to a loss of billions of dollars.

I am an engineer/scientist by education, but its my profession that will decide what I really am;an engineer, a scientist, a blue collared programmer or a craftsman. After all as Batman said..
It's not who I am underneath, but what I do that defines me.