Some amazing answers I came across on StackOverflow

Very descriptive and well-written. Not to mention long.

Decorators in Python

Metaclass in Python

Yield in Python


Welcome to The Matrix

We have entered the second generation of ‘machine generation’ with 3D printers.

Till now we used to have machines assembling machines from parts. For example, a robot in a car factory building a car. [UPDATE: link added] Now we can ‘print’ cars, or their parts thereof using a 3D printer.

As with every technology, as 3D printers get smaller, more efficient, faster and cheaper, I can almost visualize future machines having their own ‘healing units’ which can create and replace a part that has been worn out. Take it a step further and you can have fully self-spawning machines, not quite unlike living beings today.

And with huge acceleration provided to machine learning thanks to big data and miniaturized supercomputing, those machines could take decisions, and think for themselves. I give it 20 years to see ourselves living in a world filled with a completely different generation of machines, which are very close to humans in capabilities. I was reading the other day that in 20 years machines will know how to be funny, creative and, wait for it, sexy. The processing capabilities of your cell phone today, which is probably more powerful than yesteryears’ supercomputer, could be packed into something the size of a blood cell. On one hand we have the possibility of killing cancer cells by injecting intravenous supercomputers into the blood and keep a constant tab on our health. On the other, I wonder if it would be possible to monitor (and control?) people’s behavior using similar micro-gadgets. An extended version of The Manchurian Candidate could perhaps become reality?

I wonder if someday machines will be ’employing’ humans and patenting (imprisoning?) the intelligent ones. The possibilities, as they say, are endless.

Would you like to be harvested for energy?

PS: Did you ‘hear’? A 3D printed record has been created in the lab.

UPDATE: It has been 3 months since I wrote this post and we already have a 3D printed car and ear. Yes, the organ. I’m not saying I saw it coming, but I remember people saying that I was fantasizing and it was too far in the future to think about. Maybe not that far, after all.

I’m excited!

Walking the slow road

I took my ‘annual’ break at Deewali this year, and decided to stay completely out-of-touch from the internet. Here are my experiences. Some of them might be super-obvious:

  1. The information superhighway with all its hustle and bustle combined with the fast-paced lifestyles of our times can give rise to some problems unforeseen in the previous times. For instance, there have been reports of ‘withdrawal symptoms’ in Facebook addicts.
  2. Taking a detour from this overcrowded noisy road is not only useful, but most definitively necessary every once in a while.
  3. ‘Normal’ people don’t spend their days and nights checking Twitter and Hacker News streams.
  4. One sad realization: Facebook has become the ‘high point’ in some people’s otherwise mundane lives, and hence, is acting as a drug.
  5. There is humongous amounts of information being generated every second with the democratization of publishing media and the internet. As a result, the signal-to-noise ratio has gone down tremendously. And sites like Facebook with their revenue generation mechanisms aren’t helping.
  6. It is almost impossible to believe that it was no longer than 7-8 years ago when we didn’t have to ‘stay forever connected’ and yet had fulfilling lives and relationships. I have reasons to believe that was good for a lot of reasons, for example, debates on some topics could last for hours without having a clear sense of ‘right directions’. Now most of the topics that you can do such debates on are the eternal ones, like philosophy or religion.

Overall, it was fun taking a break. I intend to take more of these shut-offs going forward (lasting weekends, for instance).

The plight of shortlinks

This morning, it turns out,, twitter’s own URL shortner links were not working. The browser responded with ‘Lookup failed’, while wget said this:

Resolving ( failed: nodename nor servname provided, or not known.
wget: unable to resolve host address `'

So I tried to look into what was going on. This potentially meant that almost all of the millions of links being shared on twitter were rendered useless. Here’s what whois revealed:

Domain Name: T.CO
Domain ID: D740225-CO
Sponsoring Registrar: MELBOURNE IT LTD
Sponsoring Registrar IANA ID: 13
Registrar URL (registration services):
Domain Status: clientDeleteProhibited
Domain Status: clientHold
Domain Status: clientTransferProhibited
Domain Status: clientUpdateProhibited
Domain Status: serverDeleteProhibited
Domain Status: serverTransferProhibited
Registrant ID: TWITTERREG2012
Registrant Name: Twitter, Inc.
Registrant Organization: Twitter, Inc.
Registrant Address1: 1355 Market Street
Registrant Address2: Suite 900
Registrant City: San Francisco
Registrant State/Province: CA
Registrant Postal Code: 94103
Registrant Country: United States
Registrant Country Code: US
Registrant Phone Number: +1.4152229670
Registrant Facsimile Number: +1.4152220922
Registrant Email:
Administrative Contact ID: TWITTERADMIN2012
Administrative Contact Name: Domain Admin
Administrative Contact Organization: Twitter, Inc.
Administrative Contact Address1: 1355 Market Street
Administrative Contact Address2: Suite 900
Administrative Contact City: San Francisco
Administrative Contact State/Province: CA
Administrative Contact Postal Code: 94103
Administrative Contact Country: United States
Administrative Contact Country Code: US
Administrative Contact Phone Number: +1.4152229670
Administrative Contact Facsimile Number: +1.4152220922
Administrative Contact Email:
Billing Contact ID: MIT_BILLING
Billing Contact Name: DBS Billing
Billing Contact Address1: 636 Ellis Street
Billing Contact City: Mountain View
Billing Contact State/Province: CA
Billing Contact Postal Code: 94043
Billing Contact Country: United States
Billing Contact Country Code: US
Billing Contact Phone Number: +1.8669073267
Billing Contact Facsimile Number: +1.6506182574
Billing Contact Email:
Technical Contact ID: TWITTERTECH2012
Technical Contact Name: Tech Admin
Technical Contact Organization: Twitter, Inc.
Technical Contact Address1: 1355 Market Street
Technical Contact Address2: Suite 900
Technical Contact City: San Francisco
Technical Contact State/Province: CA
Technical Contact Postal Code: 94103
Technical Contact Country: United States
Technical Contact Country Code: US
Technical Contact Phone Number: +1.4152229670
Technical Contact Facsimile Number: +1.4152220922
Technical Contact Email:
Name Server: NS1.P34.DYNECT.NET
Name Server: NS2.P34.DYNECT.NET
Name Server: NS3.P34.DYNECT.NET
Name Server: NS4.P34.DYNECT.NET
Created by Registrar: INJECTCSR
Last Updated by Registrar: MELBOURNE IT LTD
Last Transferred Date: Mon Mar 14 22:21:58 GMT 2011
Domain Registration Date: Mon Apr 26 07:50:40 GMT 2010
Domain Expiration Date: Thu Apr 25 23:59:59 GMT 2013
Domain Last Updated Date: Mon Oct 08 05:13:38 GMT 2012

>>>> Whois database was last updated on: Mon Oct 08 05:35:46 GMT 2012 <<<<

See the last line? I’m guessing somebody messed around with DNS settings.

Hopefully the nameservers around the world will pick it up sooner, than later.

But the question is: is there a need for more ’embedded’ URL shorteners, maybe baked into the browsers, kinda along the lines of Mozilla Persona for authentication?

[Update: Just noticed that TNW has already reported this and is trending on HN]

This keeps getting hotter

I’m not pointing fingers, but iOS 6 is stripping off Google search referrer data. No, doesn’t seem to be an OS bug; Bing data is preserved (read more here). I might be wrong, but you can’t ignore the big picture.

Take this, and add to it the fact that Apple bid goodbye to Google Maps in its latest iOS update and you can start getting a clearer indication of things to come. Siegler puts it well. While you are at it, take notice. Listen to what Marissa Mayer is telling Yahoo! now. Or as we put it at MobStac,  Mobile is the new web.

Also, check out what iOS6 maps shows you.

And here’s the customary dose of fun:

Caput Draconis

[The title is the first password mentioned in Harry Potter books]

I have always been paranoid about security, but in the last few weeks the paranoia has increased, especially since I read how hackers almost entirely erased the digital life of Mat Honan. [Here’s the follow-up articles on how he got (a part of) his data back and then about catching the hacker]

Google has done a great job by providing two-step verification. Here’s how you can use it. I wish more services would provide such security-enhancing solutions.

So today I set sail searching for the best ways to create passwords which are hard to guess and yet easily memorable by humans. I didn’t want to use a software/service for it because it tends to limit the number of places you can use the service to enter the password (apps on phones/tablets, for instance). I understand that they are a much safer way to go, but the dependency was something I wanted to stay clear of. For those interested in such software solutions, please check out roboform, lastpass and gringotts 😀

Instead of trying to explain what has already been explained, and in ways much better than I possibly can, I’ll share the links with you.

  1. Jeff Atwood’s famous post about Passwords vs Pass Phrases
  2. Microsoft’s guidelines and password security checker
  3. Soundpuzzle has one
  4. And then there’s diceware

For those interested in numbers, here’ the analysis of how ATM PIN numbers are spread across the possible 10,000 values (0000 – 9999) Hopefully yours is not one of the top 20.

And here’s an awesome XKCD post about password security 🙂

Be safe. Peace.

VirtualBox Guest Additions on Ubuntu Server 12.04

While trying to set up the development environment for my site, I was having problems making VirtualBox Guest Additions let me share files with the host OS. The production env is Ubuntu Server 12.04 running on AWS EC2 so it was obvious I had to use a VM on the MacBook to ensure my dev env is in sync with the production.

When a couple of tries failed, I decided to start fresh. I deleted the existing VM, churned out a new machine and installed Ubuntu Server 12.04 (Precise Pangolin) on it. Then I proceeded with installing the VirtualBox Guest Additions. For this, I mounted the VBoxGuestAdditions_4.1.6.iso on the machine and ran the following command on it

sudo ./

and here’s the output

Verifying archive integrity... All good.
 Uncompressing VirtualBox 4.1.6 Guest Additions for Linux.........
 VirtualBox Guest Additions installer
 Removing existing VirtualBox DKMS kernel modules ...done.
 Removing existing VirtualBox non-DKMS kernel modules ...done.
 Building the VirtualBox Guest Additions kernel modules
 The headers for the current running kernel were not found. If the following
 module compilation fails then this could be the reason.

Building the main Guest Additions module ...done.
 Building the shared folder support module!
 (Look at /var/log/vboxadd-install.log to find out what went wrong)
 Doing non-kernel setup of the Guest Additions ...done.
 Installing the Window System drivers!
 (Could not find the X.Org or XFree86 Window System.)

The aforementioned log file printed thus

/tmp/vbox.0/utils.c:122:9: error: assignment of read-only member ‘i_nlink’
 /tmp/vbox.0/utils.c:132:9: error: assignment of read-only member ‘i_nlink’
 /tmp/vbox.0/utils.c: In function ‘sf_nlscpy’:
 /tmp/vbox.0/utils.c:563:13: warning: passing argument 3 of ‘utf8_to_utf32’ from incompatible pointer type [enabled by default]
 include/linux/nls.h:53:12: note: expected ‘unicode_t *’ but argument is of type ‘wchar_t *’
 make[2]: *** [/tmp/vbox.0/utils.o] Error 1
 make[1]: *** [_module_/tmp/vbox.0] Error 2
 make: *** [vboxsf] Error 2
 Creating user for the Guest Additions.
 Creating udev rule for the Guest Additions kernel module.

This had me confused so I Googled for solutions. Here’s one I stumbled upon and tried, but didn’t help fix the problem. Even though the problem was apparently occurring due to missing headers, adding them didn’t fix it.

I continued searching and landed on ubuntuforums. I followed these instructions and voila! it worked.

Also, looks like it is a fixed changeset on Vbox.

Finally, peace was restored 🙂

Hat tip: You would need to edit /etc/group file and add your username, www-data and root thus in order for permissions on the shared directory to work:

change vboxsf:x:1001: line to vboxsf:x:1001:<your-user-name>,www-data,root

CSS Margin In Percentage

Okay, this is funny; but only if it doesn’t come in the way of you getting things done on time. I was trying to assign percentage margin to a <div> and it kept throwing me off on the calculations. A bit of googling led me to this explanation.

If you are giving padding/margin in percentage, due to some out-of-the-world reason it would calculate on the basis of the width of the parent element; whether you are calculating left-right values for margin/padding, or the top-bottom ones.

It beats me as to why is it this way. Let me know if you know the answer.

Back to work!