Touching the camel

Paul asked about getting back
to maintaining some Perl code after an absence of a few years. Since I
do a lot of Perl, here are some of the time-savers that I can’t live
without:

  • search.cpan.org allows you
    to search all the publicly-available modules on CPAN. There are few problems in Perl that
    haven’t been at least partially solved by a CPAN module. At the very
    least, make sure any web scripts use CGI.pm appropriately. I still see
    hand-rolled code that parses CGI arguments, never as well as CGI.pm would
    do.
  • PerlMonks is where you go
    to ask about your Perl problems, and find solutions. It’s worth
    learning a bit about the search options so you don’t ask a very old
    question again. This is me on
    PerlMonks, incidentally.
  • The Perl FAQ,
    included in the documentation as /perlfaq[1-9]?/. The Perl Cookbook is
    basically just the Perl FAQ on paper. Nice to hold, but you can’t
    search it the same way you can with perldoc -q <keyword>.

I would always advise Perl programmers to be
lazy
. Not slothful, but spend a little time seeing if someone
has solved your problem before. Thus you can turn many routine
programming jobs into a small matter of configuration.

I would also advise learning some of the idiomatic Perl tricks,
like ‘... or die ...‘, inline
if/unless, careful use of
undef, and list operators like map and
grep. It’s not just because you’re likely to meet them in
everyday code, but they’re very convenient. Once you start to miss
them in other languages, you’ll know that you are One Of
Us
.

sometimes you just have to …

… calculate the number of seconds in the current year using JavaScript:

function seconds_in_this_year() {
      // get length of this year by subtracting "Jan 1st, /This Year/"
      // from  "Jan 1st, /Next Year/"
      var now = new Date();
      var current_year = now.getFullYear();
      var jan_first = new Date(current_year, 0, 1, 0, 0, 0, 0);
      var jan_next = new Date(current_year + 1, 0, 1, 0, 0, 0, 0);
      return (jan_next.getTime() - jan_first.getTime()) / 1000;
}

late cat

I think I’m about the last person on the planet to get a Digital Convergence CueCat — remember those freebie barcode scanners that were going to change the world, until the parent company crashed and burned?

Active Surplus has a whole case of late-model USB ones (model #68-1966 for those who care). Maybe $14.95 is a little steep, but it does cover all your barcode scanning needs.

Grubbing about in the logs

Am I glad I’ve installed MT-Blacklist. I’m getting several denied comments a day. Most of these are from IP addresses 213.91.217.*, which if traceroute is to believed, are in Bulgaria.

Another weird thing is that someone’s been searching for bigha on my site. Now, I occasionally have bike things on it, but I’ve never written about Bigha, the recumbent that emerged from the wreckage of BikeE. Is this some form of super-stealth advertising?

Formerly Known As Renaissance Nerd …

I guess I can pull this résumé from toronto.craigslist.org, then:

  • Can (& currently does) build high performance web applications with Unix, Apache, Perl and various RDBMS systems.
  • Linux user for nearly 10 years.
  • Knows his way around pre-press systems, and especially skilled in PostScript hacking.
  • Comfortable with SGML, HTML and XML. Not afraid to use CSS2, JavaScript or XSLT, either.
  • Knows lots of obscure markup languages, like TeX, troff and proprietary publishing languages.
  • Skilled book typesetter, having typeset dictionaries and thesauruses.
  • Obscenely large English vocabulary.
  • Experienced wind farm builder.
  • Skilled numeric data analyst.
  • Can build data logging and instrumentation systems, especially remote, solar-powered systems.
  • Director of a wind energy co-op.
  • Experienced free-lance journalist.
  • Confident public speaker.
  • Mechanical engineering degree, with a master’s in innovation theory.
  • More letters after my name than in it.
  • Cycling and transportation activist.
  • Sometime union shop steward.
  • Well-read and witty.

wind at my back

From early April, I will be a contracting engineer for Zephyr North, a wind consultancy in Burlington. It’s taken me 7 years to get back into wind energy, but it’ll be good to be back.

Oh yeah, I’ll be working in Fortran again. Strange to think that my dad was also a Fortran programmer…

big dog

I met a big dog today. Thor is a 2½ year old english mastiff, and weighs nearly 110kg. I’ve seen smaller Shetland ponies.

I like mastiffs, despite my paperboy experience. One of the houses of Blackfarm Gardens had a huge mastiff, who would lurk under the window until she heard me coming. Then she’s leap up against the window, scaring the living crap out of me every day.

Glass has a limited fatigue life, though. One day, she tried her stunt, and the window gave way, showering me with glass and cutting her quite badly. We both recovered better than the window did.

don’t be a prat, carry one

prat brand notebook logo
Prat might be a respected brand of paper journals and art products, but don’t get too involved in the statonery lifestyle, else people might think you’re a prat.

mozilla tab coolness

If you have multiple documents open as tabs in the one Mozilla window, you can bookmark the group of tabs if you right-click over the tab bar, and select Bookmark This Group of Tabs.

Next time you open that bookmark, you’ll get all the pages opening in the one window, exactly as they were. Neato mosquito!

Toronto, the MFP enquiry, and Linux

At a Green Economics meeting last night, we heard from councillors Paula Fletcher and Glenn De Baeremaeker about the Toronto Computer Leasing Inquiry. It seems that the city is stuck with approximately 14000 Windows-NT class machines that it can no longer use, as Microsoft will not support its operating system.

I need to find out more on the specs of these machines, but I think it would be fair to say that they would be functional for most office applications with Linux. This has only been hinted at by other writers, but at least it could provide working, virus-proof computers to city staff at very little extra expense.

This could be something that the Toronto Linux User Group could look at.

bad news

Despite what I hoped when I said Don’t be dead, Mr. Spalding, it has been confirmed tha Spalding Gray’s Body Found Washed Ashore on Brooklyn Waterfront.

Toronto International Bicycle Show

Was at the Toronto International Bicycle Show yesterday at the Ricoh Coliseum. There was the usual tedious display of thousands of yet-more-suspended mountain bikes (zz!), but a few (mostly Canadian) things caught my eye:

  • Giatex “stretching” bike, which looks pretty much like a folder until you realise the frame extends rather than folds. Surprisingly light, and remarkably cheap. I’d like to review this for a magazine at some point.
  • Aerolite titanium bike frames. Very reasonably priced, and well finished. What caught my eye was a splittable tandem frame with S and S-like couplings.
  • Go Bike folder. This bike is both lighter and more solid than any picture can do justice to. Richard Diver of City Bikes was on the stand, with the most recent Brompton.
  • CCM Evox upgrades, at least since I reviewed it for Velo Vision:
    • chain guide
    • braze-ons for what looks like a 20″ rack
    • Shimano Altus gearing, with less of a gap between the smallest sprocket and the frame.

    I’d say these are very useful upgrades, and it looks like the price is the same, or possibly even less. No sign of a lighter frame, though.

  • Rotor System crank set. Not Canadian, but another attempt to get past the perceived top-dead-centre problems of rotary cranks.

I was pleasantly surprised by the skill and grace of the flatland freestyle BMX riders. I spent most of the time being amazed at quite how they managed to keep balance on bits of bikes that aren’t usually balanced upon.

Rendez-vous with the Triplets

triplets of belleville
Ah, how I love The Triplets of Belleville. I was brought up on a steady stream of Jacques Tati and Django Reinhardt, so it’s natural that I get along with this film very well. Especially since I scored a region-free copy in the UK. I can live with it being called Belleville Rendez-vous on the box.

It was robbed of an oscar. Finding Nemo was an amusing little merchandising platform, but ToB is genius. But what chance did a joint French-Canadian production have in a US-based competition?