16 Sept 2012

White headphones

At work, we can pick up headphones for free.  You just walk into the place where they’re kept, take one, and walk away.  You don’t have to ask anyone, and you don’t have to tell anyone.  I took a really nice Sennheiser pair a couple weeks ago.  Though they are expensive (about $60), it was painful to use them.  10 minutes into wearing them, my ears would be paining real bad.

I decided I’d just buy a better pair myself.  Being a predictable BoseSheep, I went to Bose (like iSheep buying Apple without thinking).  They had two different models: OE2 and AE2.  OE is on-ear while AE is around-ear.  AE2, when worn, doesn’t even touch your ears so they are more comfortable than OE2.

But I am not a rational buyer... I’ve never been one.  Very often I’d buy things for totally random reasons.  This time I decided to buy the OE2 because that was the only model available in white.  AE2 came in one colour and that was black.  I just cannot buy a black toy when there’s  a white alternative.

Within two days of usage, I don’t like the OE2 because it’s pushing on my ears almost like the Sennheiser.  Unhappily but with no other choice, I go to Bose Store again to return the OE2 and pick up an AE2.  To my surprise, they had white AE2s now!  Bose must have launched these in the two days I had the OE2!  Funny how lucky I get :)

11 Sept 2012

Slow = bad

Having to wait for machines repeatedly is one of the most demoralising things you can experience when trying to get something done.

9 Sept 2012

Understanding code

You don’t understand a piece of code until you can confidently add features to it.

Is screen the only advantage tablets have?

Quite often, I find myself wanting to read on my Nexus 7 than on my laptops.  Checking my Google Reader, reading any article that’d take more than a couple of minutes, reading Kindle books... I prefer the tablet for all these.  This is not surprising because the Nexus 7 has a 216-dpi screen while my laptop has an incomparable 96-dpi screen.

When it comes to doing some real work... work that involves multitasking and/or precision, touch devices are very inadequate.  Think of writing code, for instance.  I’d have 6+ browser tabs open with various manuals, one terminal for building and running the code, one or two more terminals for other random stuff, one editor/IDE window (usually GVim; occasionally Eclipse), and a few more browser tabs that are pure distraction (Gmail, Google+, etc.)  A touchscreen device without overlapping windows just won’t work for this use case.

Android’s multitasking UI would improve over time, but I doubt if it can catch up with current desktop OSes in the next two years.  On the other hand, it’s likely that before the end of 2013 there will be enough high-res monitors and laptops in the market.  When that happens, I may use the laptop a lot more frequently than the tablets.

While tablets may replace laptops for quite a few people going forward, I don’t see myself giving up the functionality I get from desktop OSes.

2 Sept 2012

Inspecting 302 HTTP headers

Let’s say you want to inspect the response header for an HTTP request.  But the response is a 302, so your browser immediately navigates to the new location and you never get to see the 302 response (and the headers).

One way to solve this problem would be to install a browser extension that would keep the headers for you even after the redirect has happened.  But I’m not a big fan of installing browser extensions for functionality that I very rarely need.  So I use the wget command instead:
wget -S -O/dev/null --max-redirect=0 'http://www.google.com/'
-S flag tells wget to print the headers to stderr
-O/dev/null discards the response body (by writing it to the null device)
--max-redirect=0 tells wget to not follow any redirects.

This is the 302 redirect google.com sends for redirecting users to country-specific Google domain:
--2012-09-02 09:54:33--  http://www.google.com/
Resolving www.google.com (www.google.com)... 74.125.237.50, 74.125.237.48, 74.125.237.52, ...
Connecting to www.google.com (www.google.com)|74.125.237.50|:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 302 Found
  Location: http://www.google.com.au/
  Cache-Control: private
  Content-Type: text/html; charset=UTF-8
  [...snip...]
  Date: Sat, 01 Sep 2012 23:54:33 GMT
Location: http://www.google.com.au/ [following]
0 redirections exceeded.