Author: scruss

  • manifold: ur doin it wrong

    This is supposed to be a nice site map, but Manifold GIS has this impenetrable and counter-intuitive user interface. No wonder it has such an active user community; they’ve all paid for it and are desperately trying to get some value out of it.

  • but no autotuning

    I gave my Wind Energy for the Perplexed (2009 remix) talk for the Kingsway PEO on Friday. Lots of industry folks were there.

  • iRed Lite – Takes Apple Remote Further

    iRed Lite
    iRed Lite is just the thing if you’re rushing to put a presentation together, and you want to use your Apple Remote to flip the slides

  • poppin’ panda heads

    There’s something quite disturbing about Meiji “Hello Panda” biscuits. They’re happy little panda heads that you bite into and goo comes out.

    Disturbing, true; tasty, definitely.

  • Stuck at the Border / Unexpected Spector

    So I was at The Dakota Tavern last night, expecting to see nana grizol with Colleen and Paul. I got there far too early, and notice that there was no sign of Theo Hilton or the rest of the band. I learned from Colleen (whom I’d met before) that they’d been stopped at the border, so Colleen and Paul were playing a longer set, and Colleen’s partner Ron Sexsmith would play later.

    Immigration for musicians annoys me. The costs of visas, and the processing time required, basically means that most bands I’d want to see risk getting turned away at the border. Since touring is how these bands make their living, everybody loses.

    Still, Colleen and Paul – assisted by a couple of Colleen’s friends – ended their set with a lovely version of Jeff Mangum’s arrangement of I Love How You Love Me [mp3, lo-fi phone recording].

  • wrong in every possible (good) way

    deathchase on rockbox on sansaI found my bricked Sandisk Sansa E250 in a pile in the basement. I thought I’d give it one last try to get it going. After much faffing about, I found that applying this fix – Corrupted version.txt/Fw update not working in recovery mode? The solution !!! – Sansa e200 FAQ – abi>>forums (which resulted in a failed boot saying something about an mi4 not being found) followed by Recovering a bricked Sansa had it working with the fairly awful Sandisk firmware. So it was off to Rockbox for the latest version.

    I have to say, Rockbox 3.4 is pretty neat. They’ve now got proper USB reading/writing/charging, so that you never have to see the clunky Sandisk UI again. When plugged in, the player acts as a USB keyboard for controlling your music. Apparently the E250 can now support MicroSDHC cards, which it couldn’t before. But best (and least useful) of all, is that you can play 3D Deathchase and other ZX Spectrum games on it …

  • Calculating the second last Friday of the month

    My boss, bless ‘im (no really, do; he’s a sound bloke, great guy to work for, and is just getting through some serious health problems), needs a monthly status report on the second last Friday of every month. I live by my calendar applications reminding me to do things, so I thought it’d be no problem getting Outlook to set up a reminder.

    No dice; it will only set up appointments on the 1st, 2nd, 3rd etc., starting from the beginning of the month. I did a web search, and really thought I’d found a solution for iCal. It was not to be; this was for a Unix program called ICal; dratted case-insensitive search. Curiously, it appears that the ics spec might support a second-from-last syntax, but Outlook and iCal (and Google Calendar) can’t create them. Phooey.

    So I tried excel; and really thought I’d found the basis of an answer: Last Friday of the month. And indeed, most of their assumptions are right; the code

    DATE(year,month+1,1)-WEEKDAY(DATE(year,month+1,1),1)

    really does give you the date of the last Saturday in the month. But you can’t assume that the day before the last Saturday is the last Friday – it is the second last, if the month ends on a Friday (April 2010 is a test case).

    So I tried the Swiss Army chainsaw of brute-force date calculation: Perl with Date::Calc. What I do here is create an array of every Friday in the month, then print the second last member; never known to fail:

    #!/usr/bin/perl -w
    # second_last_friday.pl - show date of 2nd last friday
    use strict;
    use Date::Calc qw(Today
      Nth_Weekday_of_Month_Year
      Add_Delta_YMD);
    my ( $new_year, $new_month ) = 0;
    
    my ( $year, $month, $day ) = Today;
    foreach ( 1 .. 24 ) {
        my @fridays = ();   # for every friday in this month
        foreach my $week ( 1 .. 5 ) {
            if (
                ( $new_year, $new_month, $day ) =
                Nth_Weekday_of_Month_Year(
                    $year, $month, 5, $week
                )
              )
            {               # day of week 5 is Friday
                push @fridays, $day;
            }
            else {
                last;       # not a valid Friday
            }
        }
        printf( "%4d/%02d/%02d\n",
            $year, $month, $fridays[-2] );
        ( $year, $month, $day ) =
          Add_Delta_YMD( $year, $month, 1, 0, 1, 0 )
          ;                 # month++
    }
    exit;
    

    and this gives

    
    2009/11/20
    2009/12/18
    2010/01/22
    2010/02/19
    2010/03/19
    2010/04/23
    2010/05/21
    
    ...
    
    

    See, notice the tricksy 23 April 2010, which – considering thirty days hath April et al – ends on a Friday and threw that simple Excel calculation off.

    I’m disappointed that all these new applications like Outlook and iCal don’t seem to handle dates as elegantly as the old unix programs I used to use. pcal, in particular, could generate incredibly complex date formulae. I must dig around to solve this problem – and for now, actually have to remember to write that report on the second last Friday of this month …

  • cheap databases for Mac

    Apparently they all use the wonderful SQLite, too.

  • wordpress visual editor not working?

    If it always doesn’t work, go to Users -> Edit Profile, then check ‘Disable the visual editor when writing’, then update profile. Now go back and uncheck ‘Disable the visual editor when writing’, and resave your settings.

    This worked for Catherine under 2.8.5. I’ve never had this problem myself.

  • big-ass spider

    This is one of the last surviving garden spiders. It’s huge – perspective makes it look smaller than my thumb, but it’s about the same size.

    It looks weary and arthritic. May not see november.

  • brontosaurus in my window

    I have a crane looming very close to my office.

  • The Drones of Scarborough Superstore

    I’ve mentioned the beautiful drone in the Loblaw Superstore before, but only last night did I actually get around to recording it:

    1. meats, fish – 2009/10/24 19:24:36
    2. chill – 2009/10/24 19:34:38
    3. ice cream – 2009/10/24 19:36:56
    4. organic dairy – 2009/10/24 19:40:52
    5. frozen veg – 2009/10/24 19:45:38
    6. ice cream 2 – 2009/10/24 19:52:04

    You should probably listen through headphones or decent speakers – there’s some bass in there. If you can, try to experience it for yourself. The store is at 1775 Brimley Road, just south of the 401.

  • renaming files to include datestamp

    My Marantz PMD-620 has a reliable internal clock, and stamps the files with the time that recording stopped. File times are remarkably fragile, so I wanted to make sure that the times were preserved in the file name. Perl’s rename utility does this rather well, as it allows you to use arbitrary code in a rename operation. So:

    rename -n 'use POSIX qw(strftime); my $mtime=(stat($_))[9]; s/.WAV$//; $_ .= strftime("-%Y%m%d%H%M%S",localtime($mtime)); s/$/.WAV/;' *.WAV

    which, for files 1007.WAV and 1008.WAV recorded last night, results in:

    1007.WAV renamed as 1007-20091024192436.WAV
    1008.WAV renamed as 1008-20091024193438.WAV

    To actually rename the files, remove the -n from the command line. I left it in so you couldn’t blame me for b0rking up your files if you typed first, thought later.

    There are probably smarter ways to handle the file extension. This works for me. Perfection comes later.

  • foo

    I am in oakwood village library, trying WordPress for BlackBerry.

  • Save Chambers Harrap in Edinburgh

    Harry writes:

    As you may have heard, the historic dictionary firm of Chambers in
    Edinburgh is threatened with closure by the parent company Hachette
    Livre
    .

    They intend moving the English dictionaries to London and the
    bilingual Harrap titles to Paris, involving not just the loss of 27
    jobs in Edinburgh but the end of a publishing tradition going back
    nearly two centuries.  Chambers is a Scottish and British institution
    dear to the hearts of word-lovers.

    Yes, the advent of free resources on the internet has changed the
    world of reference publishing, but it is far from clear whether all
    options for the future of Chambers Harrap have been properly
    considered in what appears to be a very drastic and possibly even
    underhand move by Hachette.  I feel strongly we shouldn’t just accept
    this as inevitable.  Hachette should be forced at the very least to
    undertake a properly full and open review of the situation first, in
    due consultation with the NUJ.  If you wish to join with others in
    urging them to think again, you may like to sign the online petition
    at http://www.ipetitions.com/petition/chambers-in-edinburgh/.  It only
    takes a few seconds.

    More at http://sn.im/chambersharrap and http://harrycampbell.blogspot.com.