Recent Articles

A mental model for variables and closures in Javascript

Apr 13, 2012   #Closure 

Closures and variables have a strained relationship in Javascript that causes much confusion among newcomers and results in hard to spot bugs even for experienced JS coders. It is good to have a clear and accurate “mental model” of this relationship using which you can correctly predict what would happen with any given piece of code.

I came up with such a mental model a while back and posted it on Hacker News … which I reproduce here.

Read More ...

Classes and Javascript

Apr 12, 2012   #Class  #OOP  #Inheritance  #Encapsulation 

If you have been programming in Java and C++ for a while and are used to thinking about problems in terms of classes and inheritance, you may find yourself struggling with Javascript since it has only objects. This post is to – a) provide you with a perspective on why programming with only objects is powerful and b) show you how to translate the class-based concepts you’re used to thinking in into the Javascript world.

Read More ...

Social hash as identity

Jan 3, 2012   #Social  #Hash  #Digital identity 

(This is a “brain-dump” post).

Many write-ups and studies on social networks and privacy issues talk about the risk of using one’s personal information disclosed within social networks for identity theft. That made me think about whether it is really possible for an identity thief to steal my entire social environment and history or whether such theft is simply an indication of how broken the current paper-world identity systems are in the digital age?

Enter the “social hash” – a short identification string that can be generated from the data in your social network’s history that is very highly likely to be unique to you and very difficult to duplicate in a “prove your identity” challenge.

Read More ...

Newcomb's problem and quantum physics

How would Newcomb’s problem look like in the physical world, taking quantum physics into account? Specifically, would Omega need to know quantum physics in order to predict my decision on “to one box or not to one box”?

Read More ...

iPad2 wish ..

Jan 26, 2011   #iPad 
Now that macworld is near, it is time for an iPad wish list. I have only one item on it - and it is the addition of a wacom tablet-like stylus interface on top of the capacitive touch screen. Camera? Nope don’t need. I want a pad where I can draw and scribble with precision, flipping the stylus on its head to turn it into an eraser. Ah! That’ll be a heaven of a tablet with both touch and stylus support. Read More ...

Photon polarization

Jan 5, 2011   #Decoherence  #Polarization  #Quantum physics 

Decoherence as projection discusses photon polarization as a phenomenon that can only be explained quantum mechanically even at the macroscopic level –

Read More ...

The Alternate Reality Kit

Sep 19, 2010   #Smalltalk 
The term “object oriented programming” has degraded to the point where I no longer take self proclaimed OOP enthusiasts seriously. I don’t believe they know what they’re talking about … unless they bring up something … anything … about Smalltalk. If you don’t have a clue about what makes me go soft upon the mere mention of Smalltalk, check out this 1987 video demo of the Alternate Reality Kit. Makes you wish you had that on an iPad today doesn’t it? Read More ...

Primes - Go vs. Haskell

Sep 18, 2010   #Prime  #Haskell  #Golang 

Recently, a friend of mine pointed out a concurrent implementation of Eratosthenes’ prime sieve expressed in google’s Go programming language. I couldn’t resist trying a Haskell version of that same approach.

Read More ...

Randall Munroe (xkcd) likes these

Mar 12, 2010   #XKCD  #Randall Munroe 
Recently, Randall Munroe held a guest week where some of his favourite cartoonists drew for him on xkcd. (RM was going through a family illness.) I love xkcd, so I got curious about what RM likes and decided to jot down links to all of them I could find. Here they are – xkcd – A tribute link to the ever brilliant RM. Zach Weiner – Saturday Morning Breakfast Cereal Jeffrey Rowland – Overcompensating Bill Amend – Foxtrot David Troupes – Buttercup Festival Jeph Jacques – Questionable Content Ryan North – Dinosaur Comics E Horne and J Comeau – A Softer World Nicholas Gurewich – The Perry Bible Fellowship Kazu Kibuishi – Cooper Chris Onstad – Achewood David Malki – Wondermark Jessica Hagy – Indexed