Archives for the ‘Programming’ Category

Parallel Map

… in JavaScript. A number of events and coincidences have reminded me about functional programming and parallelism lately, especially an example I saw of Clojure’s pmap: pmap function Usage: (pmap f coll)        (pmap f coll & colls) Like map, except f is applied in parallel. Semi-lazy in that the parallel computation stays ahead of the […]

Ants on the brain

Google AI Challenge—Week 2: I think my ants are losing faith in me, as I haven’t uploaded a new version of my AI to the official server for a couple days now. New things are still in the pipeline, but I’ve lost my last 3 matches (though my opponents were ranked higher than me and […]

Some interesting sorting algorithms

Walking back from Falafels today with CS majors, we somehow began discussing strange sorting algorithms. A good sort to know (not really) is bead sort. Imagine you have a bunch of beads on rods, like an abacus, and cross-wise they represent numbers. If you simply tilt the whole thing over, then gravity will let them […]

git-dude, meet hg-dude

Git-dude is a cool little thing. Given a directory of git repos, it continually fetches updates and displays a popup if you get any new commits. When I first saw it on Google Plus, somebody inexplicably commented, “This is a neat thing and I dont [sic] think there is a mercurial equivalent.” Given that Git […]

iOS keycodes in Javascript

Here are the iOS keycodes for the keyDown and keyPress events in JavaScript as generated by an iPad running iOS 4.3.3:

WordPress permissions on

“To perform the requested action, connection information is required.” My earlier post on WordPress with was too hastily written. There are more issues than WP not wanting to use the direct upgrader, and editing WordPress code is not the right way to solve it either. Problem 1: WordPress doesn’t want to use the direct […]

Scheme in Javascript

Scheme’s power to simplicity ratio makes it a fun target for implementation. Today, I introduce a couple new ways of running Scheme powered by Javascript. The first is an online Scheme interface that I’ve been working on sporadically for the last few months. Inspired by TryHaskell, it began as a series of patches to jquery-console, […]

Convert PHP to static pages with GNU Make

I recently moved an old website to a new server. For performance reasons, the new server is running nginx instead of Apache, and didn’t have nginx set up to use PHP. (The optimal way, apparently, is to use PHP-FGM, which currently requires you to patch and build PHP yourself, at least until PHP 5.4). That […]

Android emulator temp directories

If you are using the Android SDK on a shared computer, you might run into the awesome “NAND: could not create temp file for system NAND” error. This is because “/tmp/android” is hardcoded into the emulator as the directory to start temporary files during emulation, and somebody else has likely claimed it first. The easiest […]

Our friend Scope

Scope is one of those things that is absolutely essential to understand as a programmer. If you don’t understand how a language handles scope, you are doomed to continue making difficult-to-understand mistakes and poor code design. Scheme is a good platform for exploring how scope works for beginners, and the language features that it has […]