For the attention of last week

archive of tokumine.com

Category: Uncategorized

iPhone4 HD video test, huge robots & APIs

I was passing Trafalgar Square last night, and happened across this robotics display as part of the “OUTRACE” art installation. The perfect excuse to give the HD video on the iPhone4 a try.

Aside from being pretty, on further investigation this is actually a huge, ultra expensive web mashup.

Mashup you say?

Mashup indeed. I shall illustrate the point with the use of the Google Charts Graphiz API I found yesterday

outrace.org flow

Advertisements

Boris Bikes on Fusion Tables

http://tables.googlelabs.com/embedviz?viz=MAP&q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7%2Ccol8%2Ccol9%2Ccol10%2Ccol11%2Ccol12%2Ccol13+from+245192+&h=false&lat=51.509383501611595&lng=-0.13586997985839844&z=13&t=4&l=col11

To road test the release of the new geometry styling controls in Google Fusion Tables, I threw together a live visualisation of London Cycle Hire Rank availability. Using the Ruby Fusion Tables gem it sips data from the Boris Bikes API, and is basically a total rip off of homage to Oliver O’Brien’s (excellent) original visualisation.

Aside from the speed of development, the best thing about this version is: you don’t need a server.

Resources
Fusion table
Source code

Fusion Tables gem & yes, a twitter example…

I just released a gem to help interactions with fusion tables.

It’s on github, or you can install with a straight:

gem install fusion_tables

The main rationale behind making this gem was to make it easy to upload geospatial data to make quick exploratory maps of large datasets. As an example, here are the results of sampling georeferenced tweets from the live twitter streaming API around several major cities (click the points!):

Tokyo

http://tables.googlelabs.com/embedviz?viz=MAP&q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7%2Ccol8+from+229966+&h=false&lat=35.68295607559028&lng=139.81063842773438&z=9&l=col5

London

http://tables.googlelabs.com/embedviz?viz=MAP&q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7%2Ccol8+from+229966+&h=false&lat=51.590722643120145&lng=-0.0933837890625&z=9&l=col5

New York

http://tables.googlelabs.com/embedviz?viz=MAP&q=select+col0%2Ccol1%2Ccol2%2Ccol3%2Ccol4%2Ccol5%2Ccol6%2Ccol7%2Ccol8+from+229966+&h=false&lat=40.79509814519892&lng=-73.81301879882812&z=10&l=col5

Fusion Tables also lets you generate live visualisation from the same data you’re displaying in the map. Here’s a comparison of the counts in all the cities I sampled:

The Fusion Table that drives these maps is available here, & the code I used to generate these examples is also on github.

UN flag suitable for famfamfam icon set

UN flag for the fam fam fam flag icon set

UN flag for fam fam fam

Totally geeky way to spend a lunchtime, but what the hey. Here’s some takes on a 16×11 pixel UN flag paying homage to the FamFamFam style.

They should fit in well with the FamFamFam flag icons set available here: http://www.famfamfam.com/lab/icons/flags/

PostgreSQL friendly IPinfodb SQL import

Title says it all really. I finally got tired of importing the ipinfodb into postgreSQL via CSV (the SQL they provide on their site targets MySQL), and have made a dump available on S3. Knock yourself out.

http://stokumine.s3.amazonaws.com/ipinfodb_one_table_small_pgsql.sql.gz

to use:

psql -U[your_user] [your_db] < ipinfodb_one_table_small_pgsql.sql

creates a table called geo_ips

Using Tolk with Google Translate

I love DHH’s Tolk. For those that don’t know, it’s a rails engine that makes translating your base locale in your Rails app really easy . While I was translating, I was getting bored with doing simple things like translating the days of the week and so on, and sometimes needed help with more complex┬ásentences. This is my fork of Tolk that autotranslates your translation string with google translate to give you a sensible starting point rather than a white box.

It’s on github: http://github.com/tokumine/tolk/

http://vimeo.com/moogaloop.swf?clip_id=13429054&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=00ADEF&fullscreen=1

Tolk and Google Translate from Simon Tokumine on Vimeo.

Using split locale files with Tolk

The vanilla method of storing view translations in an i18n’d Rails project is to maintain a huge locale yaml file. A step forwards is to maintain many yaml files split into folders mirroring your controller or view structure. Splitting is better for maintenance, however many tools and services, like DHH’s Tolk which can help with the actual translation of your site currently rely on your locale being in one place.

I wanted both. I’d like to maintain my base locale files in a nice split structure, whilst at the same time being able to use tools like Tolk to maintain my translations.

With your base locales arranged as described by the Rails Guides simply use the following rake task to generate an aggregated locale YAML file. To ensure no keys are overwritten, be sure to maintain your translations in their own namespaces.

Linode sweet spot

linode_sweet_spot-2

Protectedplanet.net now live!

Phew, this one took 5 years off my life, but finally the http://www.protectedplanet.net site is live!

Go check it out!

Amazon EBS RAID-0 & PostGIS build

Just posted my EBS RAID-0 + PostGIS build script to Biodivertido.

Check it out.