Framework Debate

Why Django Sucks is a really good thread.

I generally don't *like* big frameworks, but that's more my aesthetic and cranky side's opinion. My practical side often prevails. I've never really regretted using big frameworks (or big libraries) for real projects. Getting a bunch of features, fully integrated, saves a lot of time.

Recreate a Dropped Table in Django Migrations

This is a somewhat embarrassing story, but one that's common enough that you can find it online: I dropped a table, and needed to recreate it, and I'm using those (grr) Django migrations.

The right way out of this mistake is to recover from a backup. But let's suppose I didn't have a recent backup of my development database... because I didn't.

Logging Shell Commands to Syslog

This is an article on security, but I started to record all my commands to syslog so I can track what I'm doing, when, and for how long, more or less. Then I record this on my calendar to see if I'm staying focused on work, or getting distracted. It's a nice blog post.

Bash History to Syslog

Edit: so I implemented it on my computer, but changed it slightly:

# log all my commands
function log2syslog
     declare command
     command=$(fc -ln -0)

Audio Augmented Reality

Everyone already augments their reality with their phones, headphones and internet applications. Everywhere you walk, you see people peering into their phones. It's the new television. (Television was this thing people were addicted to from around 1945 to 2005.) Just as television augmented the reality of the home and living room, mobile internet is augmenting the reality of outdoor urban space.*

Suddenly, a LINK's REL is important.

I'm one of those HTML losers who doesn't use the REL attribute unless is is LINK REL="stylesheet" HREF="...", or if it's provided in some template and I just paste it. (You can also use it for linking RSS and Atom feeds, but I rely on the software to do that for me.)

Not Hating on HATEOAS

There's been some loving and some hating on HATEOAS (which I don't know how to pronounce), but I'm starting to get it. See: REST Cookbook, Timeless, and PayPal's API.

The core idea is, in addition to the data, you send over some information about the possible URLs you can use as a next step.

Promises, promises (in Javascript)

This is a short explanation of what promises are, and how they work.

You're probably familiar with callbacks, where you pass a function as an argument to another function, like this:

   f( function b() {...});

When f does something, usually taking some time, it runs b.

Promises are just callbacks with a little more structure.

There's a library called Q that's influencing frameworks like Angular. Q's most visible quality is that it uses a differen syntax:


Argh, distracted again

I don't know why this happens, but I started off Monday morning pretty good and strong, and then by noon was getting distracted.

The main change in my routine was that I didn't get up early enough to play some Ingress or take a walk. The short walk seems to help me concentrate for longer periods of time.

Finding anagrams in a list

I was reading quora and came across a post about someone who was rejected from facebook for a sloppy answer. The question was to make a list of words where the anagrams were grouped at the top.

People consoled the guy.

The answer seemed like a unixy thing. It's not that hard, the trick is to create an index for each word, where the index is the word, sorted by letter. So "cat" gets an index of "act".

Then you do some unix magic and get a list of anagrams.

The code to add that index is this:


Demo of rotating an element to make a "dial" or "knob" ui element

Here's a little bit of code that shows how to create a "dial" knob that you can control with the mouse. It's entirely in HTML, CSS and Javascript.

It's not hard, but there are a lot of little details to make it look reasonable and not completely goofy. I think it moves a little weird - and it should respond to both x and y axes, but doesn't.

The sum of two sines, with an offset.

In defense of crappy programming languages

I've been doing a lot of Javascript and Python lately, and they're both kind of crappy, quirky languages, but are fun. There aren't many languages that aren't quirky. C and Scheme and Lisp come to mind. Maybe Java and C#, too.

ImportError: No module named site (Python, Apache2, Django, virtualenv, Dropbox)

I was getting a lot of this error:

ImportError: No module named site
ImportError: No module named site
ImportError: No module named site

Javascript Double Exclamation

It's a way to cast any variable to a boolean.

var x = true;

!!x === true; // this is a fact

Sometimes, we do a check on an object:

if ( {

However, if we assign a variable like this:

var isFoo =;

isFoo will now contain a reference to 
If you want isFoo to contain the truthyness of, you do this:

var isFoo = !!;

A Few Ideas for Mobile Augmented Reality Apps

I've been playing a game called Ingress and it's got a lot of interesting ideas in it, because it's like a tour guide to public artwork. Here are some ideas for more apps, specifically around LA.

LA tour of the Mexcian-American war.

LA tour of the old Chinatown and the New Chinatown.

Something that lets you record audio at a location, and when someone else goes to that location, they can hear the audio.

The same thing for historic photos and photos.

The same thing for poetry and spoken word texts and written texts.

The same thing for music.

Syndicate content