XOR Media

Coding, Operations, Etc.

Useful Latency Numbers

I ran across this gist on Hacker News which has a quick rundown of the latencies of various operations. It's nothing earth shattering, but if you compare the intra-data center round-trip (0.5ms) to reading 1MB of data from disk (20ms) you can pretty quickly see why systems like ...


Recursively Merge Dictionaries in Python

What we're after

jQuery's extend function is really useful and if you've ever written a plug-in for the library chances are you've made use of it. I've run across a use for this functionality in python and it also makes an interesting interview question (regardless ...


Simple Python Iterator to Walk a List in Pairs

I've run in to a couple situations where I've wanted to iterate over a list in pairs lately and decided to create a simple iterator to clean up the code a bit.

In the following code I have a list of dictionaries that I'm going to convert ...

In code, tagged: python, coding, and examples.