November 19, 2012

Hide Amazon's list price to prevent impulsive shopping

Would you prefer

to this?


Note the missing list price and savings. If you want the only factor in your buying decisions to be the actual price of the item, install this stylish extension.

Edit:

Use in conjunction with an extension like Priceblink to know the true value of an item, by comparing with multiple vendors.

November 18, 2012

Cheat at Letterpress

# sorry, letterpress
#
# if your puzzle has the letters "wrdgplcbnzfkmrtwwtoxusicx",
# and you want a word with the characters "rosting" in it,
# but not letters "cl", you do:
# python letterpress.py wrdgplcbnzfkmrtwwtoxusicx rosting cl
import os
import sys
words = open('/usr/share/dict/words').read().split()
words = [w.lower() for w in words if len(w) > 2]
puzzle = sys.argv[1]
if len(puzzle) != 25:
sys.exit('puzzle must contain 25 characters')
letters = ''.join(sorted(puzzle))
# all possible words
candidates = [word for word in words if all(word.count(c) <= letters.count(c) for c in word)]
# keep only those words that include mandatory characters
if len(sys.argv) > 2:
candidates = [word for word in candidates if all(sys.argv[2].count(c) <= word.count(c) for c in puzzle)]
# keep only those words that exclude blacklisted characters
if len(sys.argv) > 3:
candidates = [word for word in candidates if all(word.count(c) <= puzzle.count(c) - sys.argv[3].count(c) for c in sys.argv[3])]
# sort by length and print
print os.linesep.join(sorted(candidates, key = lambda x : len(x)))
view raw letterpress.py hosted with ❤ by GitHub

January 14, 2012

Adblock issues in Chrome

Apparently, the following 'Lazy Background Pages' flag in chrome://flags (or about:flags) is incompatible with Adblock Plus. Enabling it results in Chrome not being to fetch any web page whatsoever. This had me scratching my head for a while.


Well, now you know.

January 04, 2012

Using visualization to mislead

Here's a recent advertisement in the Times of India, touting the Times Now television channel's viewership:
The difference between Times Now and CNN IBN is barely four percentage points, and yet, the three dimensional pie exaggerates the difference.  In fact, at this angle, CNN IBN would have lesser projected surface area even if it's share of the viewership was larger than Times Now's.

Here's the full advertisement, which appeared on page 9 of the Mumbai edition of The Times of India on 27th of December. It should be accessible from here, with a few clicks.