SQLite Is Dynamically Typed

A small, cool fact about SQLite is that its columns are flexibly typed. You can store any value in any column! Try it out: sqlite> create table t1 (v1 int, v2 varchar(10)); sqlite> insert into t1 values ("abc", "this string is longer than 10 characters!"); sqlite> select * from t1; abc|this string is longer than 10 characters! sqlite> select typeof(v1), typeof(v2) from t1; text|text The null type is still special: [Read More]
code 

A Fast and Simple Geohash Decoder

I knocked out a tiny website that I’ve craved while working on geospatial projects. It’s an interactive tool that transforms between geohash and latitude/longitude pairs. It supports direct geohash links and direct lat/lng links. It displays the bounding box of the geohash, unlike geohash.org, which only marks the hash center (and seems to have fallen victim to Google’s gross watermarking of their free Maps tiles.) The entire project is maybe 50 lines of code including markup, but UI actually feels pretty slick thanks to the awesomeness of Mapbox. [Read More]
code 

Code Readings: Douglas Crockford's secret to software teams that punch above their weight

I recently came across a gem of an idea in a Douglas Crockford interview with Peter Seibel, from Seibel’s Coders at Work. The idea is that of a code reading: a public presentation of code that’s a sort of cross between a code review and a tech talk and a whiteboard session. As Crockford tells it, code readings sound pretty awesome: the mentorship effect of a great code review, multiplied across all involved team members, at cost of maybe a half-hour or an hour per week. [Read More]
code 

Two Simple Pandas Recipes

What follows are two common data analysis tasks using the popular pandas Python library, recorded for personal posterity. Enjoy! Situation number one: you’ve just loaded a DataFrame and are poking about. You have some categorical columns and you want to graphically understand the distribution. You can plot it easily with the following: df.groupby("col_name").count().<another_col>.plot(kind="barh") which yields, for example: Alternatively, if the categorical column you’re trying to understand has high cardinality, you might want a histogram rather than a value for each category: [Read More]
code 

A Humble Alternative to Technical Interviews

I’ve got a proposal for an alternative to the dreaded technical interview loop that could make life easier, better and cheaper for people and their companies. The idea came from a conversation with coworkers I overheard a few years back: INT. OPEN OFFICE - DAY Two software engineers, GEORGE, a senior engineer and highly-skilled technical leader who people love to work with, and JOHN, a mid-level engineer, banter in their San Francisco office, surrounded by drink fridges and ping-pong tables. [Read More]
code 

No-sweat Jupyter notebook setup on Google Compute Engine

So you want to putter around with some data using Jupyter Notebook, and you don’t want to be limited by your local machine’s specs or have your laptop fan sounding like a jet engine. Here’s a solution using Google Compute Engine that takes about 10 minutes to set up. Create the virtual machine. You can do this via the Google Cloud UI by following the tutorial here. There are a number of reasonable presets for machines you can use depending on your needs. [Read More]
code