Javascript for Rubyists

July 25, 2011

“JavaScript is the only language out there that people think they can program without actually learning it.” – D.Crockford

We’ve all used JavaScript. At least, we’ve all used jQuery to manipulate some part of the DOM. Maybe we think we understand the syntax enough, so we ‘improvise’ when we’re forced to write some. Maybe we’ve tried it a few years ago and ran screaming from this seemingly broken language.

read more…

{ 0 comments }

Redis, meet node.js. You’ll get on well together.

This gist makes a pool of redis connections for your node.js application, allowing you to create 1 pool per redis database.

Depends on node_redis and node-pool. Code after the jump.

read more…

{ 0 comments }

I gave a lightning talk last week about making maps using Mapnik and node-mapnik, even managing to slip in a demo :)

Here are the slides:

{ 0 comments }

I needed a high speed autocomplete dropdown box in some recent work that couldn’t depend on an external service, and that had to be faster than regex parsing of the search corpus.   We needed an autocomplete that you could embed in a static webpage.

Following on my recent algorithmic explorations, I implemented a trigram inverted search index generator and client in Ruby and JS. You can test out the results in the demo below.

It was pretty good fun (and simple!) to learn about the wonderful world of n-grams, and how darn useful they are. Also, as I basically implemented the algorithm based on the information at wikipedia, it really solidified my stance on software patents.

Demo: http://tokumine.github.com/trigram_search/

Repository: https://github.com/tokumine/trigram_search

{ 0 comments }

I needed to be able to detect complex polygon intersections in the browser, so I spent some time exploring and implementing the Bentley–Ottmann sweep line algorithm for detecting crossings in a set of line segments in Javascript. It uses an AVL binary tree and event queue to run in O((n + k) log n) time.  The code on Github is developed to be run on node.js, but it can be easily adapted to run in a browser.

Sweepline Repository on github

{ 0 comments }

UK 3G data coverage in national parks and protected areas

January 16, 2011

Understanding 3G data coverage in remote areas is pretty important for environmentalist geeks, as typically our mobile apps will target use outside of urban, habited areas. To ensure our apps work, we have to know how much we can rely on the internet and cloud based data processing and storage services through mobile 3G [...]

Read the full article →

Postgres 9.0.1, hstore, PostGIS 1.5.2, GEOS 3.2.2 & GDAL 1.7 on Ubuntu 10.04 Lucid

October 12, 2010

Ubuntu 10.04 / Lucid is the latest long term release that most of us will be using for our server deployments for now. Unfortunately, it was released just before the latest big releases in the FOSS GIS world: Postgres 9 and PostGIS 1.5.
Thankfully, it’s pretty simple to install these latest versions. Here is quick rundown [...]

Read the full article →

Web GIS data payload benchmarks

September 20, 2010

Hardware Accelerated web GIS
Vector rendering speeds in browsers are set to go through the roof in 2010 thanks to 2D/3D Hardware Acceleration. Though the demos shown so far mainly target 3D games, this next step of browser evolution is a huge deal for the web based GIS/mapping community, which to date have been limited [...]

Read the full article →

Handy textmate snippet to convert hash syntax

September 20, 2010

This is one of those things that I’ve known existed for years, but I’ve always avoided because of a previous irrational fear of regexes.

Read the full article →

PostGIS manuals for when refractions forget to renew their domain names…

September 20, 2010

PDF
HTML

Read the full article →