Wednesday, September 09, 2009

Paul Graham:
The main point of essay writing, when done right, is the new ideas you have while doing it. A real essay, as the name implies, is dynamic: you don't know what you're going to write when you start. It will be about whatever you discover in the course of writing it.
So true.

Wednesday, September 02, 2009

German Tank Problem

A very interesting estimation problem I stumbled upon:
Suppose one is an Allied intelligence analyst during World War II, and one has some serial numbers of captured German tanks. Further, assume that the tanks are numbered sequentially from 1 to N. How does one estimate the total number of tanks?
Read this guardian article for the interesting story about how this was a real problem in World War II and how the solution helped Allies win the war. Read the solution on wikipedia or this blog. The intuition is that the maximum of the 'captured' serial numbers as well as the number of captured serial numbers can be used.

Tuesday, May 12, 2009

Fullscreen Flash problems in Ubuntu 9.04

Recently I upgraded from Ubuntu Intrepid to Jaunty (9.04). Things are great, especially the boot time (my computer boots consistently in 15-20 secs since the upgrade). But somehow since the upgrade flash videos on websites like youtube, hulu etc have had problems with fullscreen view. The video becomes seriously choppy when seen in full screen mode and the usual reinstall of flash plugins didn't seem to make it any better. This was quite annoying especially since this issue didn't exist in Intrepid (8.10) or previous versions of Ubuntu.

After a bit of web search, I finally stumbled on the right solution. The solution, as usual, was on Ubuntu forms in this post and in bugs.launchpad.net here. In short, do "lspci -vv" and find the VGA output. Then find the right address to be added in the file /proc/mtrr. Apparently, the write-combining method of accessing the MTRRs has been affected due to a missing line in /proc/mtrr file. Adding the right range for write-combining lets the graphics card work much better.

I followed this method. Find the 'prefetchable' memory range and substitute in the 'echo' statement to the file /proc/mtrr.

And enjoy watching the daily show in full screen again!

Thursday, April 30, 2009

Important day today

wish me luck!

Wednesday, February 25, 2009

And I used an english word in my code

Sometimes even a commonly used word seems so strange when we look at it in an unfamiliar setting. Today, I happened to use the word 'reason' in my python code [1] as a name of a class. And so, out of habit, I named it with the first letter in capitals - Reason(). And it looked strange. It felt like either the spelling was wrong or I don't know that word very well [1]. It looked so distant.

I guess the usage of a normal English word as a variable name in the code was unexpected. Having been looking at variables named 'curr_chan', 'curr_state', 'rcv_pkt' etc, a fully formed word like 'Reason' just seemed out of place. Such is the human mind...

[1] - No pun intended :)

Thursday, January 22, 2009

The charm of Opera

An aria named "Ah mes amis - Pour mon âme", sung by Juan Diego Florez.



Also watch this piece with Pavarotti and others enjoying themselves. His facial expressions are priceless, apart from the voice of course :)
You don't know jack, unless you know Brainfuck!

Saturday, January 17, 2009

Lala - the right way to do online music distribution

My biggest gripe with online music stores have always been this -- its damn hard to discover new music if you are not willing to spend a lot. They usually put a listening limit of 30 seconds when you want to sample a song. This makes it hard to figure out if you really like the song enough to spend that precious $0.99 on it. A new music store is trying to solve this issue by doing the following two things:
  1. You can sample a song for its full length one time. Yes, listen to the whole song once and then you can decide whether you like it enough to listen to it again... and if so, ready to pay for it.
  2. You can also buy web-only playing rights to a song for only 10 cents. These web-only songs are available to you through lala.com from anywhere and from almost any browser, since it uses flash. If later you decide to buy a mp3 (yes, mp3, no drm stuff), the 10 cents is taken off the mp3 price (usually 89 or 99 cents).
And to top it off, they are giving 50 web-only songs for free if you register. Registration requires only email address and no credit card. More FAQs here. Their collection is also quite impressive. Classical, pop, Indian, bollywood, latin....

I am amazed at the simplicity of it all. Lala has become my stop for online music purchase from now on. Join in, if you want to try it too. And if you join because of me, I will get 5 web-songs for free also. So just register... for my sake ;)