Cartagen 0.6.1 – Speed

We know we just released Cartagen 0.5 a couple weeks ago, but after testing it extensively in the wild, we really wanted a fast, low-resource release so that users of netbooks, older computers, and older browsers could use Cartagen too.

So, as well as including some general cleanup, this version hums along on a variety of machines. Please send feedback on speed/load times/CPU usage, etc; we tested it on an 800mhz G4 iMac and while it wasn’t super responsive, it did load and was somewhat usable in Firefox 3.5. For reference, Hulu.com’s Flash player does not run on that machine. On more powerful machines (4x3ghz Intel Xeon, 2500×1600 monitor), it can load over 10,000 objects in the viewport without hiccuping. For most users, a typical browser window size yields a responsive and reasonably low-resource experience.

Download Cartagen 0.6.1 (We did 0.6 and just rushed directly into 0.6.1 before announcing.)

There’s definitely a lot more we can do to improve speed, but for now we feel good about our optimizations. We identified the high CPU usage as generally poor management of timers in JavaScript, and wrote a TimerManager class which adjusts its timer intervals automatically, easing the CPU load. We elected to maintain a relatively high CPU usage to keep things rendering smoothly, but users of TimerManager can ‘turn up the heat’ or turn down CPU usage by tweaking a ‘spacing’ parameter. We also broke more intense tasks up by creating a TaskManager class, which preserves UI responsiveness and framerate while staying in a single JavaScript thread. We plan to use the multithreaded, asynchronous Web Workers spec in HTML5 when available, but for now we wanted to work on older hardware/software.

We hope that TimerManager and TaskManager will be of use to others working with JavaScript animation and we’ll be packaging them up separately for download.

For now, look at http://code.google.org/p/cartagen for source and http://wiki.cartagen.org for update docs.

Announcing Cartagen 0.5

Today we’d like to announce the 0.5 release of the dynamic mapping framework Cartagen. In this release, we’ve taken a shot at rendering any location on the planet (drawing, of course, on data from OpenStreetMap), and at rendering a much greater density of map features with richer styles. The has come a long way, and we hope it makes designing your own map easier while allowing even greater possibilities for unique and compelling designs.

Download Cartagen 0.5

This is the first release we consider to be useable by the general public; as such we are releasing a video to demonstrate how to download Cartagen, get a data set, and write your own GSS stylesheet in just a few minutes:

More information and setup instructions are on Cartagen’s wiki, and our live demonstration site at cartagen.org has been updated.

Cartagen is still incomplete: it needs more optimization for slower browsers and devices like the iPhone and Android phones, it can make better use of HTML5 features such as Web Workers for multi-threaded JavaScript for a more responsive UI, and we hope to continue our early efforts to combine it usefully with OpenLayers and other mapping platforms.

Special thanks to Ben Weissmann who’s joined the Cartagen team and has been instrumental in bringing it this far.

Parsing out key:value pairs from text messages and geocoding them

In this third tutorial, we scrape the incoming text messages for pairings of strings in the format “key:value value …”, which we parse out with a regular expression and store in a separate Keyvalue table. This allows us to intelligently search and manipulate the data, as well as to geocode addresses submitted along with data. This yields latitude & longitude data for a given text message.


WHOOZ Tutorial: Parsing out key:value pairs from text messages and geocoding them.

Download the code for this tutorial here: whooz-keyvalue-tutorial.zip (LGPL 3.0)

This builds on the code written in the last tutorial, Batch importing text messages from Twitter in Rails

Batch importing text messages from Twitter in Rails

Here we actually batch import the messages, saving them in a local model. I also demonstrate a script to perform the imports, and set up a table to store key:value pairs for more advanced usage – I’ll finish that feature up in a subsequent tutorial.

Saving the messages locally is important for not exceeding the Twitter rate limit, as well as for performing more complex searches and manipulations with the data. It also provides a common message storage if you’re importing from multiple sources, say, FrontlineSMS, Clickatell, and Twitter.


WHOOZ Tutorial: Importing text messages from Twitter to Ruby on Rails.

Download the code for this tutorial here: whooz-messages-table-batch-importing.zip (LGPL 3.0) or on Google Code

This builds on the code written in the last tutorial, Sending and receiving text messages in Rails with Twitter

I know this is pretty low resolution, but I’ll upload an HD version next week; Vimeo allows only one HD clip per week.

Sending and receiving text messages in Rails with Twitter

In this tutorial I cover how to set up a basic Ruby on Rails 2.2.2 application and how to connect it to the Twitter API. Then I demonstrate receiving and sending Tweets, i.e. text messages through Twitter. I’ve also shared the code in Google Code.


WHOOZ Tutorial: Sending and receiving text messages in Rails with Twitter

Download the code for this tutorial here: whooz-twittter-integration.zip (LGPL 3.0)

This code requires Rails 2 – if you have OS X 10.5, it ships with 1.2; you can upgrade with the commands sudo gem update --system and sudo gem install rails