Today, I needed a JavaScript equivalent of Ruby’s Array#compact (which returns the array stripped of any nil values). A standard JavaScript implementation looks like this: Array.prototype.compa...
Preamble In the last few years, Objective-C has become enormously DRYer. For example: in the past, adding a property to a class meant adding several of: an ivar, a @property, a @synthesize, a get...
http://blog.mackerron.com/2014/07/02/dry-nsstring-constants/
For Cocoa developers: I’ve just put a small category on NSMutableAttributedString on Github. It applies *bold*, /italic/, _underline_, -strikethrough-, ^superscript^ and ~subscript~ styles, and...
http://blog.mackerron.com/2014/03/11/inline-formatting-nsattributedstring/
For reasons that may become clearer in future, I needed to use a bandpass filter in an iOS app. The DSP part of Apple’s Accelerate framework makes this lightning fast both for the programmer to...
http://blog.mackerron.com/2014/02/04/vdsp_deq22-bandpass-filter/
I recently posted a HOWTO based on my experience moving a Xen domU from Linode to my own Xen Dom0 setup at Hetzner. Since this machine is only a development server, I more recently decided to tur...
http://blog.mackerron.com/2013/07/29/moving-xen-domu-to-vmware/
I’ve been playing with the much-enhanced raster support in PostGIS 2.1 in the last few days. Amongst other things I’ve been producing maps with ST_MapAlgebra, which has changed a little since...
http://blog.mackerron.com/2013/07/21/map-algebra-callbacks-postgis-2-1/
Since light can affect happiness, two important pieces of environmental data I add to the Mappiness data set during analysis are: (1) whether a response was made in daylight; and (2) day length w...
http://blog.mackerron.com/2012/10/15/sunrise-sunset-postgis-plr/
We have an old MacBook (the original white Intel model from 2006) running EyeTV as our telly. Apple’s Magic Trackpad makes a handy remote control for this setup. Unfortunately, Bluetooth on the...
http://blog.mackerron.com/2012/10/11/bluetooth-sleep-macbook-trackpad/
When converting coordinates between WGS84 (GPS) and OSGB36 (UK National Grid), using OSTN02 can gain us a few metres in accuracy over the basic parametric transformation provided by PostGIS’s s...
I recently needed to calculate a SHA1 hash in an iOS app. In iOS4+ it’s possible to use CommonCrypto, but Mappiness has always supported iOS3. I therefore added NSData and NSString categories t...
http://blog.mackerron.com/2012/06/19/sha1-category-nsdata-nsstring/