Friday, September 28, 2007

Be careful of wet newspaper!

Riding into work today, I got about half way in before noticing that my rear shifting wasn't working very well. Looking down, it looked like a rag had got caught in the jockey wheels/cassette.

So I stopped on the Moonee Ponds Creek bridge and had a look. It turned out to be a single sheet of damp newspaper, all caught up and mashed around the jockey wheels & cassette & under the chain.

Cleaning it out was difficult because it was caught up under the chain, and that it disintegrated when picking it out. Took about 5 minutes to get it out but then I noticed that the cassette, the paper had somehow loosened the locknut on the cassette and the cassette & the separate sprockets were very loose. Tried finger tightening the locknut, but that only worked a little bit, it was still loose.

Seems that the paper must of compressed on each rotation, in the gap between the locknut & chainstays. And since the chainstays are "going backwards" in relation to the clockwise drive of the cassette when pedalling, it unscrewed the locknut!! Who would of guessed, I'm going to make it nice & tight when I get back home to my cassette locknut spanner.

PS. I've heard some horror stories of plastic shopping bags wrecking the rear derailleur, so I got away pretty cheaply, especially since I just replaced my Shimano Deore 2001 rear derailleur with a SRAM X.9 2007 one.

Firefox Mouse Gestures (Optimoz extension): Snapback gesture

It seems the Optimoz gesture exchange page is down. But the project page on Mozdev seems to be up!!

matt added a comment (well 3) to the Firefox Extensions I use (2007-08-09) post, asking for it since the page is down and googling didn't find anything, so here it is:

  1. In Firefox, goto Add-ons -> Mouse Gestures -> Options -> "Edit Gestures" button (at the bottom of the General tab, and click New.
  2. In the Gesture code textfield, enter: LR
  3. For Function Type, select: Custom
  4. In Gesture Name textfield, enter: Go to first page
  5. In Custom JavaScript code textarea, enter: if (gBrowser.sessionHistory.index > 0) gBrowser.gotoIndex(0);

Now, you only have to hold down the Right mouse key, and flick the mouse to the Left and then back to the Right!!

Thursday, September 13, 2007

Bikely.com - Cleaner (Stylish site style)

Bikely.com - Cleaner site-style at userstyles.org

I been using the www.bikely.com site for a while now to plot my bike routes or to plan them. I've created some Stylish (a Firefox extension) site-styles to modify the page to remove some of it's clutter. I finally got around to publishing it, mainly because of the functionality lose (favourites adder missing in the header) that users in the forum's have been complaining about. Seems Bikely hasn't been actively developed for a while now, hopefully Jules or someone from BikeRadar continues to develop Bikely soon. Here is my created "site specific stylesheets" site-style:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document url-prefix("http://www.bikely.com/maps/") {

/* Get rid of Flash object and make the title info wrap */
#headerline > OBJECT { display: none !important; }
#lblRoutetitle > BR { display: none !important; }
#lblRoutetitle { clear: none !important; }

/* Hide Google Ads & Map copyright details */
#mapadcontainer { display: none !important; }
#map > div:first-child + div { display: none !important; }
}

So install the Bikely.com - Cleaner site-style & enjoy!! The userstyles site let's you install it directly into Firefox via Stylish or optionally, as a user-script into Greasemonkey. The user-script also works with Opera.

Thursday, August 09, 2007

Firefox Extensions I use (2007-08-09)

Update from my previous post Firefox Extensions I use (2006-06-21) and Firefox Extensions I use.

Anyway, here is a list of the current Extensions I am using in Firefox 2.0.0.6:

  • Browser tweaks
    • Enhanced History Manager v0.5.8.05.1 (amo homepage)
      Ok, so I'm an old Mozilla App Suite user, and like my advanced History manager to prune my huge history list.
      Update: I'm running a custom EHM version from AnonEmoose that let's you filter by referrer.
    • Favicon Picker 2 v0.3.4.1 (amo)
      This is great for fixing favicon issues in bookmarks, especially for adding custom one's for Bookmarklets on the Personal Toolbar (and can therefore get rid of the text, making more visible).
    • Menu Editor v1.2.3.3 (amo homepage)
      Don't use this that much anymore, but used to aggressively prune the context menu to make it faster to use (by getting rid of stuff I don't use).
      Maybe should again, extensions add a lot of crap to the context menu :-(.
    • Google Toolbar for Firefox v3.0.20070525W (homepage)
      I don't use the toolbar (I have it hidden), other than use the pagerank feature. This means almost all pages I visit get checked for Pagerank at Google, and it saves all of that history to my Google History page. This means I have a full text search of (almost) all my browsing history.
    • Kelvin's Australian English Dictionary v2.2.0 (homepage)
      A strict Australian Dictionary.
  • Downloading
    • Download Statusbar v0.9.5 (amo homepage)
      Very nice, download's popup just above the statusbar (like the find bar), and I changed it so they disappear after 10 seconds. Great for directly opening ZIP, exe and PDF files after downloading them (which download by default now).
    • DownThemAll! v0.9.9.10 (amo homepage)
      Great when downloading lots of the same type of file linked from a page (ZIP downloads, images etc.).
    • Fission v0.8.8 (amo homepage)
      Adds a loading progress bar to the address bar (ala Safari).
    • Linky v2.7.1 (amo homepage)
      Lets you open multiple links in a variety of ways. I use it by selecting links I'm interested and opening them all in tabs.
    • Magpie v3.2.8 (amo old homepage new homepage)
      Great for downloading content/pictures from a series of open tabs. Hopefully DownThemAll! will be able to do this one day.
  • Navigation
    • ChromaTabs v2.0 (amo homepage)
      Changes the colour of a tab based on the pages site icon (can be configured based on other algorithms).
    • Grab and Drag v2.1 (amo homepage)
      Instead of the cursor being used for selecting text (except for links), it makes the mouse pointer act like Acrobat Readers', where you click and drag the page around to scroll. Feels weird using a browser without it.
    • Mouse Gestures v1.5.2 (amo homepage)
      Lets me use gestures, which for me involves shortcuts for going Back and Closing a tab/window (customised to use a down stroke).
      Also added a custom gesture to Go to first page in the tab's history (Snapback??) as L,R
    • SmoothWheel v0.44.9.20061102 (amo homepage)
      Makes scrolling so nice and smooth (includes de-acceleration when getting to the top or bottom, sweet).
    • Tab Preview v0.3 (homepage)
      Great use of the new Canvas feature in Firefox 1.5, it shows a thumbnail of each page when you mouse over non-current tabs. There are a lot of tab preview extensions out there, no idea how this compares.
  • Page Tweaks
    • Aardvark v2.0 (amo homepage)
      Lets you point to sections of a web page and delete, isolate, de-widify etc. Great for pruning a page before printing.
    • Adblock Plus v0.7.5.1 (amo homepage)
      Couldn't live without. While I have maintained my block list of many years, when setting up for other people, I subscribe to the EasyElement+EasyList & ABP Tracking Filter through Adblock Plus's Subscription feature (it's very easy to update them).
      I used to use FiltersetG list (usually via the updater extension), but apparently it isn't tuned for performance.
    • AJAX Yahoo! Mail v0.6 (amo homepage)
      Modifies Y! Mail so that I can open messages inline (meaning I can open many at once and see them all on the one page). It also lets you download attachments with one click and "instant reply" without having to load a new page.
    • Greasemonkey v0.7.20070607.0 (amo homepage)
      Uses JavaScript to modify a pages content. Many JS scripts are available from userscripts.org. Never got into it until I found a few useful scripts at Userscripts that make Y! default to secure login, remebers Y! account names, hides the search section on the Google Personalized page (redudant with FF searchbox) and makes some improvements to All music guide.
      I've also created a few of my own (published scripts).
    • Resizable Form Fields v0.2.4 (amo homepage)
      Means you can (sometimes) resize textareas & form fields.
    • Stylish v0.5.2 (amo homepage)
      Uses CSS to change the style of a page, similair to Greasemonkey. Many styles are available from userstyles.org.
      I used to put customisations in my usercontent.css and userchrome.css files, but with Stylish, I can see the changes instantly and toggle on and off.
      I use it to increase the size of the Firefox search box (used to use the Resize Searchbox extension, should be in FF v2), show a crosshair when over a link that opens a new window. I created a few styles, for removing clutter from Yahoo! mail and yourTV.com.au TV guides (I should submit those to userstyles.org one day.
  • Web Devel
    • Console2 v0.3.7 (amo homepage)
      Replaces the inbuilt JavaScript Console with the "Error Console", makes the console very useful and adds advanced features.
    • Firebug v1.05 (amo homepage)
      All web development tools in one, it's truly amazing. HTML & CSS inspection/editing, Network traffic analysis, JS profiling & debugging, logging & error console!!!
    • JavaScript Debugger v0.9.87 (amo homepage)
      Great for serious JavaScript development. Need to try Firebug as well.
    • Live HTTP Headers v0.13.1 (amo homepage)
      Works well when debugging what the browser is sending and what the server returns (especially for redirects).
    • View Source Chart v2.5.03 (amo homepage)
      Useful when trying to analyse how a website is structured, when checking out how it works or for customising.
    • Web Developer v1.1.4 (amo homepage)
      Analysis and debugging pages. I use mainly for outlining block elements in HTML, validation and resizing the window for common sizes.

Retired Extensions:

  • Download Manager Tweak v0.7.1 (amo homepage)
    Seems to add nice little tweaks to the Download Manager. Not as useful as Download Statusbar for me.

Old retired list:

  • Adblock - Switched to Adblock Plus mainly coz of the small icon on status bar.
  • Forecastfox - Used to like a lot, but the weather date provider (Accuweather) is usually way off for Melbourne weather, so I use the Bureau of Meteorology's plain text based forecast.
  • Performancing - Post to Blog's: Blogger, TypePad, LiveJournal, WordPress & MoveableType.
  • Google Suggest - adds "Suggest" to the Firefox Google searchbox
  • Hash Coloured Tabs - creates new tabs with colour coding
  • Link Visitor - lets you selectively mark links as visited or unvisited
  • Resize Searchbox - creates a grippy for the Firefox searchbox so it can be resized

Saturday, January 06, 2007

Excel formula to calculate distance between 2 latitude, longitude (lat/lon) points (GPS positions)

I've been looking for this one for ages, and the one I created based on an equation I found a little while ago didn't work too well :(

Investigation

Calculate distance, bearing and more between two Latitude/Longitude points shows lots of equations in math, and implemented in JavaScript. Chris Veness's page also contains an Excel formula of the ‘Haversine’ equation (actually, using the "spherical law of cosines") for distances between points in kilometres:

=ACOS(SIN(Lat1)*SIN(Lat2) +COS(Lat1)*COS(Lat2)*COS(Lon2-Lon1)) *6371

But it wasn't working, because my GPS points (Lat/Lon) were in decimal degrees, not radians. So I used the formula I found at Latitude And Longitude In Excel (under the "Great Circle Distances" section) by Chip Pearson:

=RadiusEarth*ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2)))

where Chip gives RadiusEarth as 6378.135 kilometres. This didn't match up with distances I had when calculated from other systems. But Chris's page has:

R = earth’s radius (mean radius = 6,371km)

Digging deeper, I found Chris's Vincenty formula for distance between two Latitude/Longitude points page which includes a table on different datum models (treating Earth as an ellipsoid), it shows WGS-84 & GRS-80 having the greatest radius on an ellipsoid as 6378.135km & the smallest as 6356.752km.

So Chip was using the maximum radius of the Earth, not the mean radius like Chris (I'm not sure where Chris gets the mean radius from). Substituting Chris's R for RadiusEarth in Chip's formula gives:

Solution

=ACOS(COS(RADIANS(90-Lat1)) *COS(RADIANS(90-Lat2)) +SIN(RADIANS(90-Lat1)) *SIN(RADIANS(90-Lat2)) *COS(RADIANS(Long1-Long2))) *6371

and my final version that uses Excel cell references is:

=ACOS(COS(RADIANS(90-A2)) *COS(RADIANS(90-A3)) +SIN(RADIANS(90-A2)) *SIN(RADIANS(90-A3)) *COS(RADIANS(B2-B3))) *6371

PS. To calculate distances in miles, substitute R (6371) with 3958.756 (and for nautical miles, use 3440.065).