“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…
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…
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:
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
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