Archive for June, 2005

Google Maps + Geocaching Improvements

Thursday, June 30th, 2005

So, it looks like Google Maps recently changed a bit of their interface that breaks my previous GMapsShowCenter bookmarklet. Luckily, we don’t even need that bookmarklet anymore.

A friendly fellow geocacher made a slight tweak to my GoogleMapIt bookmarklet that takes care of adding the point to the map (basically you just need to pass in the point coordinates in the query string with the ‘q’ variable).

Here’s the updated version, which works great. Thanks to geocacher Sugarcrum for the tweak!

GoogleMapIt <- drag this to your bookmark bar.

GoogleMaps Geocaching Bookmarklets

Monday, June 6th, 2005

This weekend, I spent a few hours learning a little bit about hacking Google Maps and making my own bookmarklets to help with Geocaching. Here’s what I came up with…

GoogleMapIt – a bookmarklet that finds the first instance of Latitude/Longitude coordinates (written in degrees and minutes) on a web page, converts them to decimal degrees, and opens a new window showing that location using Google Maps (Google Maps wants decimal degrees for loading lat/lon maps).

GMapsShowCenter – a bookmarklet that creates a location marker in the center of the Google Map you’re currently viewing. Helpful for when you’ve just loaded some latitude/longitude coordinates into Google Maps and need to see the marker for where they point to (by default, Google Maps doesn’t show a location marker when you load lat/lon maps).

Example usage:

  1. Add GoogleMapIt and GMapsShowCenter to your browser’s bookmarks bar by dragging these links there (or add to Favorites in IE).
  2. Load the page for any geocache, like The White Duck (my cache).
  3. Click on the GoogleMapIt bookmarkelt in your browser’s bookmark bar.
  4. Click on the ShowCenterMarker bookmarklet.
  5. Admire the location of the cache.

Safari Backslash Replacement Bug

Sunday, June 5th, 2005

Been working on some javascript bookmarklet code and found this bug in Safari (I’m using version 2.0 (214)).

In the href value of any anchor tag (link), all backslash characters appearing BEFORE a question mark character get replaced with forwardslash characters

this behavior manifests when: - you drag the link to the bookmark bar to make a bookmarklet - you copy the link to clipboard - you look at the link href in the in status bar

this behavior does not seem to manifest when: - you click on the link

Example: The href of <a href=”http://foo\bar\?baz\quux”>TestLink</a> goes from “foo\bar\?baz\quux” to “foo/bar/?baz\quux” – Try It: TestLink

Why does this suck? If you’re writing some javascript code that you’d like users to use as a bookmarklet, and that javascript code includes some regular expression with some backslash characters in it, your regex will get messed up when the user drags your bookmarklet link to their bookmark bar.

Bookworm

Thursday, June 2nd, 2005

You can all blame Brad for passing the book buck on to me. Here’s my responses…

Estimate the total number of books you’ve owned in your life. My best estimate is probably around 1,000 +/- a few hundred. I used to own a lot more than I own now, but that’s because NYC apartments don’t afford gigantic libraries. This is probably a good thing for me.

What’s the last book you bought? The Great Book of Amber (The Complete Amber Chronicles, Books 1 to 10), by Roger Zelazny – this is one of my favorite books to give out as gifts.

What’s the last book you read? Small Gods, by Terry Pratchett. – A Christmas gift from a close friend.

List 5 books that mean a lot to you. - The Great Book of Amber (The Complete Amber Chronicles, Books 1 to 10), by Roger Zelazny. – Granted, it gets pretty out-there toward the end, but it’s still an amazing world with a ton of great characters (the names of which are my current method for determining new hostnames for computers). Also, it was good enough to spawn the venerable rogue-like game Zangband.

  • The Dark Tower Series (Books 1 to 7), by Stephen King. – Hands down, this is my current pick for the best fiction I’ve ever read. Mysterious, immersive, and so damn fluid.

  • Snow Crash, by Neil Stephenson. – In my opinion, this is Stephenson at his best. In my obsession with virtual worlds, I’ve always had a soft spot for the Metaverse.

  • The Moon is a Harsh Mistress, by Robert Heinlein. – I’ve read almost everything Heinlein wrote, and this is definitely his best. Heinlein shaped a lot of my early teens.

  • The Stars My Destination, by Alfred Bester. – Probably the most deserving title for “Best Science Fiction Book That Most Sci-Fi Fans Haven’t Read.”

Tag five people: I’ll post links to pals if/when they post their own write-ups.