A blog about skating and cycling, or vice versa

Just standing there like a Le Mans#

Wed, 02 Jul 2008 12:53:57 +0000

Back from the Le Mans 24Rollers event on Monday night, where I spent 18 hours standing at the pit wall with a stopwatch noting the times of all the LSST veteran team skaters. I decided earlier this year I wasn't going to actually race but that it would be fun to go along there anyway (since I subsequently nadgered my shoulder, this was probably fortuitous), and pit crew seemed like a reasonable thing to be doing. Capsule summary as follows - advantage: less effort; disadvantage: less down time; after-effects: sunburn, slight hangover, really sore calves from all the time spent standing on (my) toes, two new t-shirts.

Shoulder update: everything I said last time, plus now getting to slightly above horizontal in the forward direction and can kind of do a skating armswing provided it is not too vigorous. T-shirt donning ability has improved to the point that I can now put both arms in first and then get it over my head. Bruising nearly all gone. Can now tie my shoelaces with no more than moderate care.

It still hurts carrying any significant weight, or even holding the arm straight out for more than a few seconds, and if I stretch my arm out sideways I can't bring it around in front of me without pain - which is noteworthy because (as above) I can get to the same out-in-front end position if I start with my arm down.

String them up#

Wed, 09 Jul 2008 19:30:28 +0000

Postgresql has no builtin support for converting a multi-row result set (e.g. select code from country) into a single string (e.g. AF,AL,DZ,AD,AI,AQ,AG,AR,AM... ). Standard advice is to use CREATE AGGREGATE to make one, and (my) standard response to that advice is to grumble about its absence from the standard functions.

However, the little-used Postgres "array" type offers an alternative approach, as witness:

sql> select arraytostring(array(select code from country limit 5),',');
arraytostring
-----------------
UK,US,FR,DE,AF

Sha and jolly well zaam. I've worked this out once before, I know, but forgotten it entirely. Here's hoping that writing it down will fix it in my mind.

I have very nearly full range of motion (not all of it absolutely pain free) in my left arm, but I can't quite get it to touch the left side of my head. Went skating last night (route check) for the first time in five weeks, and got home feeling utterly knackered.

1 Minute Greasemonkey Guide#

Thu, 17 Jul 2008 15:13:31 +0000

I am a late but fervent convert to Greasemonkey, based on an hour playing with it last night.

  1. install firebug and learn how to use it. This takes longer than a minute, but we assume you've done it already
  2. write a javascript file with some funny comments at the top, and call it something.user.js
  3. In Firefox 3, browse to the file and a popup will, er, pop up allowing you to install the script. In FF2, according to instructions I read there is an extra step here (you need to go to Tools -> Greasemonkey and do something that will probably be fairly obvious)
  4. Installation will copy the script into your firefox profile directory somewhere (look in the gm_scripts subdir). You can edit the file in place thereafter instead of continually reinstalling
  5. to print stuff to the firebug console, use unsafeWindow.console.log(stuff) - but be careful, the "unsafe" in the name is not just for show

A few words about the content of the script seem appropriate: it is executed when web pages are loaded (the special comments contain include and exclude directives for you to specify exactly which pages) and references to document do roughly what you'd expect - so, you can rewrite bits of the DOM tree of other people's websites in nasty brutal "if it breaks you can keep both pieces" hacky ways

Habitable Firefox. Yay

// This is a Greasemonkey user script.
//
// To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
//
// ==UserScript==
// name          phpbb killfile
// namespace     http://www.telent.net/
// description   brutal script to hide phpbb posts
// include       http://www.example.com/forum/*
// ==/UserScript==

var posts=document.evaluate("//span[@class='name']",document,null, XPathResult.UNORDEREDNODESNAPSHOT_TYPE,null); for(var i=0;i<posts.snapshotLength;i++) { var p=posts.snapshotItem(i); var name=p.firstChild.nextSibling.firstChild.nodeValue; var tr=p.parentNode.parentNode;

if(name=='Moron') { while(tr.firstChild) tr.removeChild(tr.firstChild); var span=document.createElement("span"); span.className="postbody"; var replace=document.createElement("td"); replace.setAttribute("COLSPAN","2"); replace.setAttribute("ALIGN","CENTER"); span.appendChild(document.createTextNode("post hidden")); replace.appendChild(span); tr.appendChild(replace); } }

Probably I should confine the Include directive to viewtopic.php. Yes, I know a robust solution would include some kind of configuration options to change the list of ignored users, cope with multiple forums etc etc, but that's not the point. Quick and dirty.