Saturday, December 31, 2011

Line segment intersection

It looks like an easy problem, it has a trove of information on it and Bryce Boe even has a two line solution for it. However, his program does not handle improper intersections, i.e. when one end of one of the segments lies on the other line. Since a point lying on the line does not make triangles with different orientations (since it has zero area), his program does not count it as an intersection.

The highest voted answer on the stack overflow question needs special care while handling vertical lines (And it is general outline for a solution, not actual code).

Now there are multiple methods of correcting these problems, and this is one of them:

Use this function to test the implementation:

Tuesday, December 20, 2011

Numerically stable standard deviation calculation and code perforation

How would you implement a class which has an append(double x) function to collect values, and a get_std_dev() function which returns the standard deviation of the values collected?

Sounds like an easy problem, here is my guess at what your code would look like:

This looks like an standard implementation, but it contains some subtle bugs. These bugs do not show up in regular usage, but they lie patiently in wait. Remember the tricky binary search implementation bug which escaped detection in the JDK for about a decade and is now staple fodder of all technical interviews?

Saturday, November 26, 2011

Handling NULLs and NAs

Real world data always has missing and blatantly incorrect values.

This becomes a painful issue when it comes to coming up with predictive models. While there are multiple ways of imputing data, it is difficult to figure out whether one is doing a good enough job. To make matters worse, the rows missing data might not be random. For example, all incomes above a certain threshold might be deliberately made NA to preserve anonymity. However, the model developer might not be aware of this censoring. Imputing data using any central measure will not only fail to capture this bit of information, but will actually make predictions worse.

Similar encoding might be present when one sees columns with values outside the natural limits. For example, say a column that contains number of questions answered from 5 questions in a test having the value -1 to indicate absentees.

In the worst case, a model developed by completely dropping the offending parameter might perform better than an imputed data-set.

In most cases, we can do better.

Sunday, October 30, 2011

Starting out with Ocaml

There are many thing which they do not tell you about Ocaml right when you start out. This is a stumbling block for many, and in this post, I will cover a few facts which just might help out the beginner a tad bit.


The first look at the toplevel is disheartening.

# let f = fun x : x + 1^[[D^[[D^[[D

The toplevel does not support readline functionality out of the box. This leads to considerable frustration (note that I accidentally wrote a ':' instead of '->' and I tried pressing the left-arrow to try to fix it.

However, there exists ledit which can be used to give the REPL some sensible behavior, albeit nothing like iPython's auto-completion.

$ aptitude install ledit
$ ledit ocaml

There are other readline wrappers around too which can provide similar functionality (rlwrap, etc.)

Working with external libraries

Ocaml handles libraries in a very very low-level fashion, and getting things to work correctly from the top-level can be particularly painful. Here are a few tips which may help if you are working with external libraries. Your mileage might vary.

Godi Ocaml

Use Godi's distribution of Ocaml instead of the Debian/Ubuntu packages:

$ aptitude install ocaml      # Not a very good idea

After Godi's installation, it'll take a little effort to set up the path/soft-links to execute the scripts initially, but after that hurdle, the rest is a very smooth ride.

Godi's installation provides some excellent ocaml packages out-of-the-box and does not require root privileges. Also, one of the clinchers is:

$ godi_console

for easy installation of many commonly used packages.

However, getting these packages loaded into the top-level just to play with could be a pain, but there is a remedy.


Use topfind to load modules in the top-level and handle dependencies.

# #use "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

- : unit = ()
# #require "ZMQ";;
/home/utkarsh/godi/lib/ocaml/site-lib/uint: added to search path
/home/utkarsh/godi/lib/ocaml/site-lib/uint/uint64.cma: loaded
/home/utkarsh/godi/lib/ocaml/site-lib/ZMQ: added to search path
/home/utkarsh/godi/lib/ocaml/site-lib/ZMQ/ZMQB.cma: loaded

Finally, there is a way of making your own top-level which loads certain default modules when it starts:

$ ocamlmktop -o my_top_level my_module.cmo your_module.cmo our_module.cmo

This is available with the godi-ocaml-labltk package which can be installed using godi_console.
This is an near absolute necessity while working with most Ocaml modules, even if they are very well documented. It certainly beats going through the .mli files of the packages.

I still have to try out the Eclipse's Ocaml IDE to see whether it can replace ocamlbrowser with intellisense.

Notes on tuning JVM

Notes from a talk about tuning the JVM by Attila Szegedi, Twitter.

Know the problem and options

Use these option to get to know whether GC happens often:


More eden size is always better. Old generation collectors:

  1. Throughput collectors:
  2. Low-pause collectors:
  3. Adaptive threshold collectors:
        -XX:+UseAdaptiveSizePolicy (with throughput collectors only)
        -XX:MaxGCPauseMillis=100 (ms)
        -XX:GCTimeRatio=19 (GC time : running time ratio)
  4. If all fails, us concurrent mark-and-sweep, collects all the time. Hence, having extra CPU can help avoid stop-the-world latency!
        -XX:InitiatingOccupyFraction (set to 75-80, triggers GC)

Fat data

Data might be taking too much memory.

Object headers

Object header = 2 machine words = 128 bits on 64 bit machine = 16 bytes

Similarly, Array headers take 24 bytes.

  • new java.lang.Object() takes 16 bytes
  • new byte[0] takes 24 bytes


In 8 bytes blocks. Happens for each subtyping.

class A { byte x; };
class B extends A { byte y; }
  • new A() takes 24 bytes (add 1 byte -> get 7 more bytes for padding)
  • new B() takes 32 bytes (same here)

No inline structures

class C { Object obj = new Object(); }
  • new C() takes 40 bytes.
  • 2 objects handlers and 1 pointer (w/ padding) = 16 + 16 + 8 = 40

Compressed pointers


Pointers become 4 bytes long and can be used below 32 Gb heap size. On by default from JDK 6, update 21.

Vally in performance in going from 30 Gb heap to 40 Gb, as points grow from 4 to 8 bytes.

Primitive wrappers

Happens without knowing (say, in Scala 2.7.7, Scala 2.7.8 fixed it):

  • Seq[Int] stores java.lang.Integer => needs 24 + 32 * length bytes
  • Array[Int] stores int => needs 24 + 4 * length bytes

Moral: Surprises exist. Profile everything.

Thread locals hurt

Threads don't die (pools). Just create new objects.


Pointer 8 4 4
Object header 16 12* 8
Array Header 24 16 12
Superclass pad 8 4 4
  • Compressed memory: Object can have 4 bytes of fields and still take only 16 bytes.
There are a lot of other interesting things he talked about as well, like Apache Thrift, Guava MapMaker libraries, etc.

~ musically_ut

Thursday, October 27, 2011

Verbosity of programming languages

It is not often that one sees the same functionality being implemented in more than one language outside toy examples and for mere bragging rights. However, the AI challenge's starter packages:

  1. Each implement the same algorithm in different languages
  2. With the same I/O infrastructure
  3. Were not written intentionally to be better than the other (no bias)
So I thought it would be a good data-set to look at how verbose the languages were while controlling for the task at hand:

Lines of code it takes to implement the same functionality
in different programming languages.
(Red bars likely to be higher than shown)

Thursday, October 20, 2011

Software Reliability: 3 general problems


While creating a critical piece of software (e.g. creating a Smart Home Controller for my Master's Thesis), one of the emphasis is on reliability.

Broadly speaking, reliability means not crashing or, failing that, exiting gracefully and then restarting without requiring any supervision.

Hence, I set about to write a tiny wrapper to execute applications in, which will wait for heartbeats from the application, restart them if they miss too many heartbeats or if they crash (exit with a non-zero return value), and will listen to the outside world and restart the application when asked to.

Wrapper ensuring some level of reliability

Wednesday, October 19, 2011

Humble "FrozenSynapse" Bundle

Humble Bundle came back again, this time with just one new game FrozenSynapse and the previous FrozenByte bundle with it, if you paid more than the average.

This run of the Bundle was not as peppered with events as the previous bundles were: there were only two mid-air additions to the bundle, instead of half a score of interesting events happening the last time and nothing (to the best of my knowledge) was made open source:

Humble "FrozenSynapse" Bundle's economic performance

Monday, September 26, 2011

Book Reviews: The Sweet Shop owner, The Help, and Brief Interview with Hideous men

The sweet-shop owner
(Graham Swift)
The Sweet Shop owner

This is a good book. Though the author has not gone out of his way to make it easy to read. It is the story of a special kind of love, a love which is arranged, but still as rock solid as any other kind of love one is likely to find. Where the implicit rules forbid one from making explicit mention of "love". Where effort is made to keep everything static, unchanging and if love was to be brought into the picture, it would result in too much change. My favorite line from the novel is:
 He wrote "5050 helmets" which, of course, meant "I love you."
While reading the book, I often felt as if I was reading another novel by Virginia Woolf. The style of narration is multiple streams of consciousness. However, in case of Virginia Woolf, one still gets long stretches of thoughts of one person before switching to another. However, Swift jumps gleefully from one person's thoughts to another and even through time at occasional places. It is disorienting, but since there is little to surprise in the book, it does not hamper the reading much.

Overall, a decent read.

The Help
(Kathryn Stockett)

Brief Interviews with hideous men
(David Foster Wallace)

The Help

This book has been made into a movie, which I have not seen. After reading the book, I can see why.

The narration of the story is good. In my personal opinion, as good as Gone with the wind. However, I am not very much into storytelling anyway. There were some pages which just had to be turned in the same session, and there were some places of dullness which were apt places to stop reading and take a break. A comfortable read.

The most entertaining part of the book for me were the various references to the events of that time and of future events sprinkled throughout the book, like assassination of JFK and a joking reference to when they land a man on the moon.

Overall, an enjoyable read.

Brief Interviews with Hideous Men

I could not finish reading this book. This book too has had a movie made on it, but I found the writing of the book to be too repetitive to be engaging. Perhaps actual conversations go that way, but I could not take the deluge of drab repetitions which the men made. More over, one does not know what is the question they are answering and though at times I could infer the questions and at some times, it adds to the reading, but I found it too tiring.

I usually do not leave books unread, taking it one page at a time, hoping that the next one would be better, but I did not find it to be worth it for this particular book.


Sunday, September 11, 2011

What Perl got right and R got wrong

R tries to do the right thing by having very short names for functions one uses often:

Creating vectors.
Transpose a matrix.
Quitting R
Generic isInstanceOf
apply after grouping
Generic type cast
Common primitive functions in R

As much as I like not having to type extra characters to get to these functions, I have always had to be extra cautious when it comes to naming my variables out of fear of accidentally overwriting any of these. Interestingly, R selectively ignores such overrides letting the primitives prevail if possible:

> R.version.string
[1] "R version 2.12.1 (2010-12-16)"

> c <- function(...) { 42 }   # Accidentally overriding c()
> c(45, 67, 78)               # Expected behavior
[1] 42

> c <- "42"                   # Now it should be a scalar, right?
> c
[1] "42"

> c(45, 67, 78)               # Magical return from the dead!
[1] 45 67 78

This overriding of an identifier as both variable and primitive function is grossly inconsistent, specially since functions are first class objects, same as any vector or string. If I override an identifier, even a primitive, I expect it to be really overridden.

Though the intention of cutting keystrokes is clearly good here, this inconsistency feels avoidable.

On the other hand
In contrast, this highlights how well Perl does the same thing. Larry Wall, the creator of Perl, was a linguist by education and one of his tenets while creating Perl was making it as succinct as possible. To this end, it ventured to those corners of the keyboard which only APL had gone beyond. Also, on an unrelated note, he was the winner of the International Obfuscated C contest twice and some say that after Perl became mainstream, there wasn't much point left in obfuscation contests.

Perl also short-cuts most commonly used functions and type qualifiers:

Variable definitions
Array variable prefix
Hash variable prefix
Scalar variable prefix
Substitute function
Match function
Common primitive functions in Perl

However, in Perl, the domain of the abbreviations looks completely different from identifiers; it is impossible to even imagine confusing them. In R, the use of identifiers and built-in primitives seems uniform, and is actually inconsistent.

And we have a winner ...

I think between R and Perl, Perl is the one which got it completely right.

The design principle to be learned here perhaps is that of having different keystrokes for different folks. The onus of preserving the (abbreviated) primitive functions should lie with the language, and it can be done:

  • the right way by syntactical obviousness as Perl does it,
  • the good ol' way by reserving keywords as Python does it or,
  • the wrong way by allowing overrides and resuscitating primitives as R does it.

Wednesday, August 31, 2011

R: Going faster than vectorization


Update: The by function of R can be used for the same task since data for me is stored in the same data.frame. I have tested that out later on in the post.

Recently I had to run though a large data.frame in R, selecting values from a given column based on an equality constraint on another column, in this format:

for(i in 1:length(values)) { 
  t <- my.var$row2[ my.var$row1 == value[i] ]; 

This is a fairly common operation and I had thought that beyond the vectorization I had done (borrowed term from MATLAB), R would take care of optimizations under-the-hood.

At this point, I thought how I would do it on a larger database and it struck me that perhaps I can do better than R if I manually index the data and find relevant intervals myself. How much faster can that be?

Thursday, August 25, 2011

Getting powerdot to work

Powerdot is a presentation package for LaTeX, much like beamer.

I recently got it up and running on my system and I thought I'll setup a quick guide for it:

Tuesday, August 23, 2011

Book Review: Half Asleep in Frog Pajamas

Half Asleep in Frog Pajamas
This is a book about a stock broker. Rather about two stock brokers, one current and one has-been; a she and a he broker. However, this is not a book about the Stock Market per se, neither is this a book about love, nor sleaze.

The book is written in a diary format, with time progressing linearly, with each entry marked with a day and time. The entire book, as advertised, is over in about the time-span of a long weekend.

Each entry in the diary begins off-topic and slowly careens into the old story line: sometimes in enlightening and sometimes in ridiculous ways. It probably reflects how a stock broker thinks when she is not thinking about the stock market. The book is sort of a drag in the beginning, until one gets to the evening of Friday and something of interest happens.

Monday, August 15, 2011

Gabriel's gift : A review

This has to be one of the most inspiring books I have read in a long, long time.

It starts with a magical touch, and a despairing look at the life of a broken family. And it goes uphill from there. There are moments where the book seems about to be taking a sinister turn, but instead it surprises the reader. A quite adorable tale indeed.

It is a very easy read, has a simple story told from the point of view of a precocious school-going teenager Gabriel. Kureishi managers to keep the narrative as well as the ideas extremely simple without losing any credibility at all. What we see in-front of us in the book is London with its motley populace, with stories of inhabitants intertwined and where opportunities seem to be hovering around every corner:
What a bright place London was, he (Gabriel) thought. Here anything could be achieved! You only had to wish high enough!
Opportunities waiting to be grasped by all but the hopelessly self-destructive. And Kureshi's London seems to have many of those, which somehow rings true with London we see today

It is amusing to see him trying to avoid vulgarity just like Dickens tried to keep the young readers in the dark about Phillip's exploits in London, but only in Garbiel's thoughts and words. He carefully avoids any detailed descriptions of Speedy's pose or what secret things happened in the bathroom while he drew his mother and her company or the indelicacy of bed's creaking while he was hidden under it. However, whatever we manage to see of London beyond Gabriel, it looks as colored as ever.

Wednesday, August 10, 2011

Humble Indie Bundle 3: A review

It was jolly good ride for the Humble Bundle 3, and it was far better and more exciting in the second half than the first one:
15 days of Hunble India Bundle 3

Sunday, August 7, 2011

The Rebel Angels: A review

It is not a very easy book to read. However, it is totally worth it. It reminded me of Salman Rushdie's Midnight's children, though magic realism in this book is much more subtle and integrated. The sequel of this book What's bred in the bone contains many more explicit supernatural elements than does this book. However, I like it all the more for it.

The pace of events never dies after the explosive and completely unwarranted introduction. The university atmosphere being built up feels construed in the beginning, but as one gets used to the eccentric characters and Gothic milieu of Spook university, a rich pasture from an imaginative mind emerges. The story is slow paced and borders on being a philosophical text. However, because of the setting of the story, it does not seem out of place. And the instances of philosophy are broken with patches of humor. Yes, the humor in most cases requires knowing some bits of Greek and Roman mythology and history, but the book does not go out of its way to make it hard. Actually, I would like to read the book once again just as I did Great Expectations in my school days, with annotations and helpful hints thrown along the way. The skill of Robertson Davies as a writer clearly shows through here.

This book is narrated via two different point of views, one of pastor Simon Darcourt and the other of Maria Magdalene Theotoky, a student pursuing a PhD in a field which can be vaguely related to medieval literature. They both have almost equal portions of the book dedicated to them with chapter names alternating between The new Aubrey and Second Paradise. The transitions are smooth and only at one point temporal interleaving comes into play, and that is during the climax.

Allusions to various other sources abound and the development of plot is intricate and subtle. The winning point of the book for me was the dry humor of Simon. The dry and cool manners of Arthur Cornish, the narcissist boasts of McVarish, the gypsy ways of Maria's mother and Maria's confounding attempts to distance herself, the crooked ways of Parlabane and the classical University settings and everything else too make it a memorable book.

This is a book about struggle to rid one of one's past and future, or one's fate. Also, entwined in it are love stories, from love of common gadje people to love of gypsies to love referred to as carnal knowledge to love which fringes on platonic and finally a kind which is nothing more than eternal friendship.

Overall, a very very enjoyable book. Highly recommended.


Tuesday, August 2, 2011

HumbleBundle 3: The first million

The road to the first million attained almost half-way though the bundle was wrought with events:
Humble Bundle 3: The first million

Wednesday, July 27, 2011

HumbleBundle is back again!

And this time, I am not late!

Err ... not very late anyhow. I did miss the action for the first $40,000 but got around to collecting data much faster than the last time around. If you do not know what a HumbleBundle is, read the wikipedia entry, or just visit their website here.

The start of the action is explosive!
The amount raised by the Humble Indie Bundle 3 so far, in minutes since my 1st data reading
(14 more days to go)

Saturday, July 16, 2011

Cleaning up my mouse

I accidentally spilled cranberry juice all over my table, including my mouse.

I managed to clean most of it away from my table:
My workstation
which was not easy in itself.

UI design for TOEFL username retrieval

HCI Design principle 0: Make it easy to use.

How not to do it:

  1. By asking for the user's street address. 
  2. In multiple lines of unformatted text.
  3. Making it a compulsory criterion.
Verdict: Fail.

Thursday, July 14, 2011

Tough times for Geneva

Lurking though the data for number of companies which declared bankruptcy in Geneva (data available from here), I noticed something:

So, as soon as I left for my internship in Japan in July '10, things headed down. They hit rock bottom in October 2010 and improved spectacularly in March '11, the month I landed back in Switzerland.

Something was up in Geneva while I was not here (July '10 - Feb 11).

Just sayin ...


PS: I was a little sad to see 27 business close doors on 24th December, 2010 and 15 businesses on 23th December, 2009.

Wednesday, July 13, 2011

Review: Dew Breaker

First, my biggest disappointment with the book: it could have started better.
Much, much better. Apart from that, the book is very well written, even bordering on downright outstanding.

When I read the description on the back, that The Dew Breaker is a man who is repenting his sins of past, and with some background on Haiti's history with dictatorship and atrocities, I pretty much had an idea of what I was buying into.

And I was correct, no great surprises there. However, I cannot say that I knew it all along. The book made sure that I did not suspect a thing till it actually happened.

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))

>> any(is.nan(exp(a)))

>> any(is.nan(exp(1.0 * a)))

>> 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?

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


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.

Friday, April 29, 2011

Why /home should be on a different partition than /

Nirbheek had advised me to always keep /home on a separate partition, and it came in handy today.


Natty Narwhal is the new Ubuntu release made on 28th of April, 2011. When I tried to upgrade to it yesterday, bad things happened.

While the installation went smoothly up to the step Installing the upgrades, it simply hung after trying to Load lirc module on my HP dv2000 laptop. More so, my laptop became unresponsive. The next step I took (I do not know why I did it), was to open a terminal and type:

sudo reboot

The Problem

This was a really bad idea, as it turned out.

The next time I tried to log on, I was greeted with the unfriendly error:
Kernel crash while updating to Natty Narwhal

Wednesday, April 6, 2011

5 cm per second

Sometime ago, Nirbheek recommended me a anime movie which I watched and liked a lot.
It was named 5 centimeters per second and it is currently my favorite anime movie of all times. Quoting from Wikipedia:
The title 5 Centimeters Per Second comes from the speed at which cherry blossoms (also called Sakura blossoms) petals fall, petals being a metaphorical representation of humans, reminiscent of the slowness of life and how people often start together but slowly drift into their separate ways

And I remember this fact from the movie well. Also, I was until very recently, in Japan and I missed the Sakura blossoms (and the calamity) by a whisker (about 3 weeks).

Sunday, February 13, 2011

Making a zooming out mosaic video

I have collected many photographs while I have been in Japan and I thought that I'll make a befitting compliment to the CCIL lab which was kind enough to allow to work with them.

Hence, I put together my photographs, used Ideamonk's PyMos to make a huge mosaic of the interior of CCIL photograph to show the interior of the CCIL lab. (the original photograph is from here, not taken by me).

Saturday, January 22, 2011

... and now something completely different

I think it is about time I posted something which dose at least some justice to the name I gave this blog. Here is a short list of Indie artists who you'll see climbing up my charts on and I got to know them via the recommendations made to me by community radio and have downloaded their music either through their websites, or via Jamendo.

As I have been listening to plenty of main stream music, I'll try to put their characteristics in perspective by pointing to the mainstream artists who are like and not-so-like them. Unfortunately, as I have not been listening to the latest music a lot (I am out of touch with 80% top-10 artists on for 2010), pardon me for slightly arcane comparisons.

Monday, January 10, 2011

Merging images in Gimp

The problem
You have two (or more) photographs of the same objects (with different lighting/focus/time lapses, etc.) and you would like to merge them but the photographs are a little off. The end result of such an operation would be akin to this (click to see the larger version):
Merged images (dA link)

Saturday, January 8, 2011

Books are becoming middle class economically aware

As some of you pointed out: excessive usage of budget might indicate Nation's budgets instead of personal budgets.

At least that is what the usage of terms cheap, expensive and budget in books over time tells us (via Google Ngram):

Usage of the words in books (click here to see the webpage)
This graph shows out of all (uni-grammatic) words used in books published each year, how many of them were cheap, expensive and budget. More details on interpreting the graph are here.

Monday, January 3, 2011

Unexpected Return of Investment from HDD

I recently upgraded to a 500 Gb HDD from my puny 80 Gb one, done primarily because I wanted to download the HumbleBundle without having to uninstall Eclipse and Firefox from my system. And I am quite happy with the results.

However, doing the upgrade also had some other interesting returns of interest:

  1. I am definitely happy about finally having all my music collection on my laptop instead of having to revert to the Backup Hard drive every time I had a craving for that one special song.
  2. I can finally run the 1080p HD movies on my laptop! So the bottleneck was the Hard-drive and not the CPU. (Anyway I could have figured it out sooner?)
  3. I copied my large Photograph collection to my laptop and I set my screen saver to "Picture Folder". Now every time my laptop goes to the screensaver, it is like taking a walk down the memory lane.