Back in Action: 1954 Peterborough Royale Deluxe

About twenty years ago my father and I restored a derelict cedar strip boat that was slowly rotting away at a cottage nearby ours.

That’s me on the left. Teenagers are awful.

It took us several years, and I think we did a ripping good job. We don’t have a “before” picture, but here’s how it turned out:

Unfortunately as is often the case with these things, we got it to about 98% restored then ran out of steam. There were a few things that we simply never got right. We lived with it for a few years, then we put in storage for 15 years or so.

We were storing it in a building belonging to our cottage association. But then the building was sold. This means we were faced with an important decision. Get rid of it, or sort it out.

We decided to sort it out and put it back in the water. Since neither of us has the time to work on it anymore it went to Woodwind Yachts and we (by we I mean my Dad) paid them to sort it out for us. There wasn’t much that needed doing, but that final 2% is often the most difficult part, as anyone who has tried to restore a vintage vehicle of any kind will tell you.

We got it back this week and took it for it’s first ride. We then had to immediately pull it out of the water and store it for the winter.

It doesn’t look particularly different, but there are some important structural changes that make it much more usable. Since we’ve got it back I’ve been working on replacing the hilariously dim incandescent bulbs in the running lights with LEDs. More on that to come…

Back in Action: 1954 Peterborough Royale Deluxe

More LEGO Sets

Back at the cottage means more of my old LEGO sets! These were the smaller sets that you could sometimes convince your parents to buy you on a whim if you happened to be at the mall and begged loud enough, whereas the bigger ones like the seaport were reserved for Christmas.

6524: Blizzard Blazer

6644: Road Rebel

6646: Screaming Patriot

6351: Surf N’ Sail Camper

The names of the sets are absolutely hilarious. “Screaming Patriot”? They sound like the names of unlicensed Halloween costumes. You know the type, where it’s clearly “The Incredible Hulk” but it’s called something like “Angry Green Man”. I’m guessing they were named by some Swedish guy who worked at LEGO in the 1980’s and 1990’s and was given the job because he had a relative in America.

More LEGO Sets

Hidden Metro

I am rapidly approaching my fortieth birthday. That means I’m old enough to remember when Toronto was “Metro Toronto”. Long story short: Toronto used to be governed by many small regional entities who all cooperated under a framework called Metropolitan Toronto. Just before the end of the previous century this was replaced with one monolithic government in the name of “cost savings”. Whether that was actually successful or not I can’t say for certain (though my completely non-scientific intuition says it’s not terribly likely) but the neat thing is that you can still find the logo for Metro Toronto hiding all over the place. I try to take pictures of it when I see it.

On overpasses
On crosswalk buttons
On bollards
Hidden Metro

Unzip a File to Memory in Scala

Recently I had some trouble unzipping a file in Scala.  After combing through many different StackOverflow threads I eventually worked out this solution:

def unzip(path: String): Map[String, Array[Byte]] = {
val zipFile = new ZipFile(path)
.map { entry =>
val in = zipFile.getInputStream(entry)
val out = new ByteArrayOutputStream
IOUtils.copy(in, out)
entry.getName -> out.toByteArray
} toMap

Unzip a File to Memory in Scala

Merged Cells and Formatted Text in SpreadsheetApp

Google Apps Script is a really nice way to interact with Google Docs programatically.  You can write add-ons or stand-alone scripts to read or modify documents and have access to a DOM, which is a much nicer way to do things than attempting to use a REST endpoint or similar. The only problem is that while the DOM/object model is reasonably complete, it isn’t totally so.  As of this writing there is no way, when dealing with spreadsheets, to determine if a cell is merged, or, more frustratingly, obtain the formatted contents of the cell.  We really needed this information recently, so we decided to parse it out of the HTML that you get when exporting the document.  This can be done in Apps Script itself.

You can see the gist here.

Basically we build up an associative array, where for a given cell index you can get back the row span, column span and formatted value.

parsedHtml['Sheet1:A1'] = {index: 'Sheet1:A1', text: '123,456', rowspan: 2, colspan: 2}

If there is no entry for a given cell index then that cell is part of a merged range or outside the data range.  The latter should be known beforehand.

NOTE: that this code requires underscore.js to work, you can read an article from Google about how to use it in apps script projects here.

Merged Cells and Formatted Text in SpreadsheetApp

View Adobe Swatch Exchange Files Online

The other day I was trying to do some web design according to IBM’s design guidelines.  They provide color swatches as .ase files, which are read by Adobe products like Illustrator, PhotoShop, etc.  I have none of these applications but I figured “hey how hard can it be to parse the file myself?”

Two days and a fair bit of hair tearing later witness!

I later found out that IBM Design does provide a site that shows the same information, but by that time I was way to consumed with the problem.  That happens sometimes.  But hey, now I can look at any .ase file!  And so can you!

View Adobe Swatch Exchange Files Online