Saturday, July 9, 2011

Debugging puzzle in R

Here's a small debugging puzzle in R. I recently came ran into it and thought that the bug was rather elegant. I have simplified down the problem I faced, but not all the way to keep a little fun in.

Explain the output
>> # a is a (large) vector with numerical elements
>> any(is.nan(a))
[1] FALSE

>> any(is.nan(exp(a)))
[1] FALSE

>> any(is.nan(exp(1.0 * a)))
[1] FALSE

>> any(is.nan(exp(0.0 * a)))
[1] TRUE

See something surprizing? Suddenly a NaN where there was none before?

Can you think why this is happening?

Hint
If you give up, then click-and-drag to select and see the hint below:

>> # Multiplying an Infinity with zero gives a NaN
>> Inf * 0
[1] NaN


~
musically_ut

Sunday, July 3, 2011

Review: The year of silence

The year of silence
(Madison Smartt Bell)
When I started reading this book, I was hoping to find a sad story about a young girl who died of an overdose and not much else. However, the book took me by surprise. It is about Marian, but it only revolves on the periphery. It starts furthest away from the focal point, converges to Marian and then recedes again.

And for a short book, it is fairly patient about the business. It reminded me about the movie Crash with a slightly fractured timeline. Towards the end, all the ruffled edges start coming together again. The book feels like a house of cards, very delicately put together, adding weights and then counter weights to keep the narrative balanced. The narrative itself is beautifully constructed with vivid imagery. The underlying theme of the book, Marian's life, is woven intricately like a thread through all the pages, keeping the book intact. The genius of the book lies in the narrative, in the small nothings that keep the other characters alive in our mind as we get to know Marian better.

All in all, a book I liked and enjoyed reading, albeit with a hint of sorrow. 

Sunday, June 19, 2011

Topics of TED Talks

I today noticed on Twitter this link to the description of all TED Talks which have happened so far (16th June, 2011). Immediately, it looked like something worth looking (read: visualizing) into. So I did.

I created a wordle of the topics (after removing names of authors from some topics):
Topics of TED talks, created using wordle
The topics world, new, life and future clearly stand out, showing what TED is really about.

Saturday, June 18, 2011

Piled Higher and Deeper

In case you do not know, Piled Higher and Deeper (PhD, for short) is a web-comic which has become notoriously famous over the last 5 years and has recently been converted to a movie! It is one of my favorite comics and it should come as no surprise that when the creator of the comics Jorge Cham came to give a presentation at EPFL (on 17th June, 2011), I walked though rain and thunder to see him.

Well, actually it was more like a 5 minute walk though a drizzle, but heroic nevertheless.

The event was announced on the PhD mailing list, but not to the general public. I got to know of it via Twitter, when Nirbheek pointed it out the same morning!

Thursday, June 2, 2011

Think (and do) before pasting a link

TL;DR Try to open the link in Private Mode in your browser before to make sure that others will see it when they click it.


Sunday, May 29, 2011

USB drive as a music carrier using Banshee/Rhythmbox

The old ways of sharing music may soon become passé with Amazon and Google both stepping into the cloud music ring, but till that becomes mainstream, here is a nifty trick to easily share music using your USB stick and a music player such as Rhythmbox or Banshee.

My USB Drive/Audio book reader

Saturday, May 7, 2011

Declaring software open-source considered helpful

There have been two Humble Bundles released in the last six months:

  1. Humble Indie Bundle in December, 2010
  2. Humble Frozenbyte Bundle in April, 2011
The summary statistics themselves are enough to challenge some established stereotypes, e.g. the average amount contributed by Linux users has consistently been significantly larger than the Mac OS or Windows counterparts, showing that Linux users are willing to pay more than non-linux users for quality software.

On a larger scale, considering these to be real-world economic experiments, there is still much information buried deeper in the data than can be gleaned by looking at the summary. Here, I look at five-minute sampled data to see what effect making the software open-source had on the sales:

Contribution and purchases data for the Humble Frozenbyte bundle.
The projections show what the contributions and purchases might have been if Frozenbyte had not declared their games open source.