Friday, April 4, 2014

I have moved

I started posting on blog.musicallyut.in as an experiment and I like blogging there.

I will not migrate the posts from this blog over, but all new entries will be posted there. :)

Friday, November 22, 2013

Political orientation (summary)

I have difficulty in immediately grasping what views a person holds when they tell me their political orientation, e.g. that they are Convervative or Socialist. I found the following short list on a LW survey and I liked the concise descriptions associated with them:
  • Libertarian, for example like the US Libertarian Party: socially permissive, minimal/no taxes, minimal/no distribution of wealth
  • Conservative, for example the US Republican Party and UK Tories: traditional values, low taxes, low redistribution of wealth
  • Liberal, for example the US Democratic Party or the UK Labour Party: socially permissive, more taxes, more redistribution of wealth
  • Socialist, for example Scandinavian countries: socially permissive, high taxes, major redistribution of wealth
  • Communist, for example the old Soviet Union: complete state control of many facets of life

Friday, November 8, 2013

Hide overflowing labels on pie charts

I have seen many questions related to occlusion of labels on pie charts and have always suggested that the problem should be solved by moving the labels outside the pie chart, or by rotating them to align with the axis.

The solutions I have suggested often is to rotate the label but it has never quite satisfied me. Part of it was the horrible font rendering done by some browsers and loss in legibility that brings and the weird flip when one label crosses over the 180° line. In some cases, the results were acceptable and unavoidable, e.g. when the labels were too long but in most cases, they looked just clumsy.

I would consider using a different form of visualization for the data usually, but out of curiosity, I thought that I should try to see how difficult is it to actually do it.

The results are on this Plunker.

Sunday, November 3, 2013

Book Review: 2013

Book reviews

I read (and listened to) a lot of books in the part few months and I just couldn't get time to write about them. Finally, I do have some time to pen down my thoughts.


The pleasure of Finding things out


This one is a classic,  Feynman's assorted lectures in a collection. This would probably qualify as a pop science book and I listened to this on my daily transits to and from work and it has to be one of the best books I have listened to. In the book, we catch a glimpse of Feynman at the most human level. 

I specially loved the anecdotes which showed him to be a human before a Nobel prize winning scientist, for e.g. the valve anecdote where he candidly admits that he had no idea what the little boxes with X symbols in them meant on blueprints of the new Nuclear factory. He risked his credibility by pointing to one of them and saying "What if this valve doesn't work?" fully expecting one of the engineers to say "Sir, the is not a valve, but a window."

Then there were stories which touched deep, like the moment when he realized that his father, his very own role model, could neither explain nor understand everything about the world. A similar story was how he was able to get his son to develop a inquisitive mind by inventing stories about little people encountering everyday objects at extra-ordinary sizes, but how the very same stories never worked on his daughter who always wanted the same stories from the same book read back to her.

His unabashed sincere approach to the supernatural stood out: does faith healing dilute if administered to more than one person at a time? Does it deplete over time?
So did his love of the correct experimental procedure: can mice use the vibrations on the floor to guide themselves? How about the lights of the room?



Overall, a very satisfying, relaxing and inspiring read.

Accelerando

This book by Charles Stross was a whopper. I read the freely available eBook version, after coming to know of it from somewhere on LessWrong, or maybe it was somewhere else, but I am very glad that I did. The book is fast paced, something or the other keeps happening and the story keeps moving forward. However, the story is not what kept me captivated. Actually, the story is largely accidental. What kept my rapt attention was the science-fiction and then, second, the characters.


The science fiction part is very lucid and I often surprised myself by actually thinking why we do not already have somethings mentioned in the book. It did glaze over a lot of the details, but it made sense. Spawning copies of yourself to research a question and then assimilating the experiences from it feels so natural! And useful! Mining the angular momentum of planets! Yes, do want! Dyson spheres! Yes, please! Economics 2.0! Uh, what? Aliens! Umm ... okay. Civilizations trying to hack the universe they are living in! Whoa. I need to sit down.

All characters in the story are unashamedly flawed. And irreparably so. Some of them right from the outset, some show them as the story progresses. Reality is broken.

This book took effort to write and it shows:
how often do you hear of authors taking time off from a short story to write a novel, because writing the novel is easier?
Overall, I loved it and strongly recommend it to any sci-fiction fan.

Another fine Myth

This was another book recommended by LessWrong in a very tangential way:

Quiggley: "Beware demon, I am not without defenses."
Auz: "Oh yeah? Name three."

It was a very light-hearted and easy to read fantasy book. It progresses at an easy place and would qualify as a children's book, save a few moments. The characters were too gullible and the magic was not as awe-inspiring as it is in HPMoR and there were quite a few kinks in the story. In ridiculousness and aphorisms, Robert Aspirin did not come close to competing with Terry Pratchett's disc-world novels, but it was a good relaxing book to listen anyhow. I liked Gleep. I think I'll test the Myth Adventures series (this is the first book form the series) with a few more books before delivering my final verdict on them. The Color of Magic was not very different from this book, though I remember much less of Rinceweed from that book than Skeeve from this one.

This book alone would stand at 3.5 / 5.

Other stuff

I have read a lot of other stuff as well in this period. I am about 40% into Charles Dicken's Bleak House and have finally managed to catch up with Harry Potter and the Methods of Rationality (strongly recommended, along with the audio podcast). I am also listening to A short history of Nearly everything  by Bill Bryson, another pop-science book, but which concentrates more on the lives of the scientists and is steeped in British humour. I have to often cover my grin while standing in a bus or train listening to this book. For some reason, it feels obscene to be that happy. Or maybe:

“And those who were seen dancing were thought to be insane by those who could not hear the music.” ~ Friedrich Nietzsche

Other than that, I have been preoccupied with trying to learn German and have started using DuoLingo on some of my transits!

Wednesday, September 11, 2013

Interactive Storytelling in The Last of Us.

I watched the walk-through of The Last of Us. If you haven't seen to the end/played to the end any game by NaughtyDog, then I bet the ending will catch you by surprise.

I loved it.

I like to categorise and keep a record of things which I am doing. I religiously scrobble my songs to Last.fm. I record every book I read with the finish date on Shelfari. I will need to create a new category here: interactive story watched as a movie. Or maybe as a TV series.

I will add Bio Shock Infinite to it. Perhaps Psychonauts too, I saw David play it (almost) to its end while sitting next to him.

I would add Dear Esther to it as well, but I actually played that game. It was a good storytelling experience, but it gave me motion sickness.

I prefer the non-interactive storytelling experience (like a movie), but with the kind of stories which are being told via an interactive medium today (in video-games).

It reminds me of the time I used a Kindle as bookmarker in a physical book I was reading. I know that there is irony in there somewhere; I just cannot put my finger on it.

Tuesday, March 19, 2013

mitmproxy as a reverse proxy

It turns out that thanks to the powerful scripting interface, mitmproxy can be used as a reverse proxy to redirect calls to different servers easily:

revProxy.py

import os

proxyHost = os.environ['PROXYHOST']

def request(ctx, r):
   if r.request.path.startswith('/api'):
       # Proxy calls with /api prefix to proxyHost
       r.request.headers['Host'] = [proxyHost]
       r.request.scheme = 'https'
       r.request.host = proxyHost
       r.request.port = 443
   else:
       # Proxy other calls to localhost:8000 with some rewriting

       if r.request.path.endswith('/'):
           r.request.path += 'index.html'

       r.request.scheme = 'http'
       r.request.host = 'localhost'
       r.request.port = 8000
   # end if
# end def request
Then use mitmproxy as:
PROXYHOST="my.apps.domain" mitmproxy -s revProxy.py

Friday, January 18, 2013

Two room problem

I had a problem.

I fractured my foot last month, on 6th December, and now am walking with crutches. I have largely recovered now, but one excruciating problem I face is having no free arms while going from room to room. That means I cannot bring food to the table from the kitchen, nor carry used plates, glasses, etc. to the kitchen. However, those problems were easy to solve: just eat in the kitchen and drink from reusable bottles.

The real problem was carrying my work around. I sit in the living room (which is large, airy and has a nice window) and lie down in my bedroom (which is a little cloistered but comfortable and snug). I had to constantly pack my work laptop in my backpack and carry it from one place to another since I like to work at both places. This annoyed me to no end, until I found a solution.

The solution was simple: use two laptops. I keep my personal laptop in the bedroom, work laptop in the living room and travelled light between the two places. Work related things are synced using Google Apps and git while my personal things were synced using Dropbox.

On top of that, I use my phone to make calls, and my Kindle (which also fits in my pockets) to read. So I don't have to carry anything in my hands.

I had got my PC as a present from one of my uncles in 1998. Then I stuck with it (replacing it part by part) for the next decade (!) before I got my first laptop in 2008. And that was a luxury. It has only been  5 years since and the computing power I have in my life has increased about 5 folds. I am suddenly living the first-world technophilic life.

When did that happen?