Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Sunday, January 28, 2007

Google Mapit bookmarklet

Here's a simple bookmarklet that I cobbled together because I got tired of copying and pasting addresses from the browser into Google maps, and then having to do it twice because the multi-line copy/paste didn't work. You should be able to drag this right onto your toolbar:

Mapit

Then you just highlight an address and click it, or setup a hotkey for it. I haven't tested it across all browsers yet, but it's working fine in Camino, Firefox, and Safari on my mac.

Here's a prettier version so you can see what it does:

javascript:var url = 'http://maps.google.com/maps?q=';
if (window.getSelection) {
var sel = window.getSelection() + '';
url += sel.replace(/\n/g,%22, %22);
} else if(document.getSelection) {
url += document.getSelection();
} else if (document.selection) {
url += document.selection.createRange().text;
}
void(window.open(url));

Sunday, January 14, 2007

RARFF - A simple ARFF library in Ruby

RARFF is a very simple ARFF handling library for Ruby that I wrote for kicks. ARFF is a file format popularized by Weka, the machine learning toolkit.

I've had a couple of cases where I collected some data using Ruby and I wanted to analyze it with Weka. This makes it a bit easier.