July 2008
15 posts
python-pipeline - Google Code →
Clever hack using the __or__ (and __ror__) special methods in order to emulate a UNIX pipe in Python. For example:
>>> xrange(-10, 10) | grep(lambda x: x % 3 == 2) \
... | (x * (x + 1) for x in STDIN) | list
>>> [90, 42, 12, 0, 6, 30, 72]
AMQP (Advanced Message Queuing Protocol) was born out of my own experience and...
– ACM Queue - Toward a Commodity Enterprise Middleware: Can AMQP enable a new era in messaging middleware? A look inside standards-based messaging with AMQP
Testmaker .002 (Even easier automated testing in... →
This is a nifty hack for generating automated tests. It’s a Django middleware which sits and records all the actions that you do from within your browser and then logs all these actions and the expected output in the Python doctest format to a file. You can basically grab this file and use it in your test suite! The idea is very similar to Selenium-RC.
Once we’ve got a candidate list of dates, we take a look at your traveller...
– Dopplr Blog » Blog Archive » How Dopplr learns
iPhone Development Central →
This site has some great video tutorials on how to build apps for iPhone with the official iPhone 2.0 SDK. And the best part is they’re free! Highly recommended.
iPhone Web Dev Reference Library →
I didn’t know about this earlier but there’s lot of documentation on WebKit-specific stuff which you can use while writing a web app for the iPhone. And the best part is there’s a document titled “Safari DOM Touch Reference for iPhone OS”. Multi-touch events are exposed in the browser!
OS X Tip: Open a Finder window corresponding to...
In the terminal, just type open .
OS X Tip: Opening a new terminal tab in the...
This is extremely useful while programming. Your pwd is /really/long/path/to/some/folder and you want to open a new tab in the OS X Terminal and navigate to the same folder. You can automate this thanks to AppleScript.
Save the following script in a file named ~/scripts/newtab.scpt:
on run argv
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
tell...
Quick tip: Embedding scripts in your page that have a unknown content-type (such...
– John Resig - JavaScript Micro-Templating
Facebook's talk on how they serve images →
If you do not have time to watch the whole presentation, here’s what you need to know:
Currently most of the time images are served off the CDN (99% for profile images, 92% for photo albums).
POSIX filesystems store a lot of meta-data associated with each file which they don’t care about (eg: last-modified-time). Reading an image file would involve doing roughly 3 separate disk...
Nielsen’s layoffs also drew attention from CNN’s Lou Dobbs, who has...
– Tax break fuels anger over outsourcing-related layoffs in Fla.
When you made your process for selecting applicants a lottery, what else did you expect? They should seriously stop giving so many visas to these few big Indian outsourcing giants when they know clearly that these companies have been...
simplejson tip: dumping unicode
simplejson is a popular JSON library for Python. It ships by default with Django too.
Yesterday I was publishing some documents to Solr/Lucene for indexing and one of the fields in the document was supposed to store a JSON string.
So first I tried this:
fieldValue = simplejson.dumps(xyz) # xyz is any JSON-able type
type(fieldValue) # => type 'str'
fieldValueASCII =...
0xDECAFBAD » Queue everything and delight everyone →
To make the person who’s submitting something happy, offer feedback visible in their own personal context in under 50-200 milliseconds. (That is, less than half-a-second at worst, in people terms.)
The next person to delight is someone following the first person’s published content—and humanly speaking, delays of tens of thousands of milliseconds can be acceptable here. (That is,...
jsonpickle - Google Code →
jsonpickle allows for any Python object to be serialized into JSON. This library acts as an extension to simplejson. Whereas simplejson only serializes primitive objects (str, int, float, list, dict, etc), jsonpickle can handle most non-builtin Python objects. jsonpickle recursively examines Python objects and collections (dictionaries, lists, tuples, and sets), and converts non primitive objects...
Buzzword-laden Harvard analysis of MSFT-Powerset... →
“Microsoft’s acquisition of Powerset makes perfect sense and is probably the best shot at a disruptive technology that might allow it to leapfrog Google,” says Andrei Hagiu, assistant professor of strategy, focusing on technology, at Harvard Business School.