I’m not a book reviewer

So I just finished reading a book “Davy The Punk”, and I quite enjoyed it. It was an interesting look at the parts of “Toronto The Good” of the early to mid 20th century that you don’t hear much about. And because I’ve liked the author, Bob Bossin, as a folk musician and storyteller for many years, I thought I should write something about how much I enjoyed it.

But as I was thinking about it, I couldn’t separate out in my mind whether I liked the book because I liked Bob Bossin, or whether I liked the book on its own. And really, that seems like an important distinction if I were going to recommend this book to people who didn’t grow up hearing Stringband or seeing Bob Bossin at folk festivals. And I guess that’s the part of literary reviewing or literary criticism that’s harder than it looks.

So what it comes down to is what I can tell you about this book: it was written by Bob Bossin, mostly about his father Davy, who was a pivotal figure in the hidden (and not so hidden) gambling “underworld” of Toronto, with diversions into its connection to gambling and crime figures of New York and Chicago, as well as anecdotes about famous and infamous figures you’ve probably heard of and some you’ve never heard of. There’s some things a Trudeau Liberal such as myself finds hard to reconcile with my own worldview and belief in what Canada is and stands for, like the blatant anti-semitism of Canadian culture and government back then.

And all I can really advise you is, in the words of Abraham Lincoln, “If you like this sort of thing, this is just the sort of thing you’d like”.

Second paddle of the season

It was forecast to be 46°F, so a group of us agreed to meet up at BayCreek today at 5pm. On the drive over, my car thermometer was saying it was actually 53°F! Not bad after the harsh cold we’ve had this winter. Present when I arrived were Paul D in his West Side Boat Shop (WSBS) EFT, Doug in his WSBS Marauder, and both Furtoss brothers in their Epic 18xs.

The water was quite a bit lower, and quite a bit slower, than it had been on Saturday. It was still challenging in places, and there were a few places where one or more of us was carried across the stream into somebody else’s boat. But really, it was all about enjoying the evening and the company of our fellow paddlers. We didn’t see any mink this time, but did see some mergansers and mallards. We also saw several people out walking their dogs, which might be one reason we didn’t see any mink.
20140319-122023.jpg

We went up 3.5 miles. Once again I still don’t have a GPS, so I don’t know how long it took. With the lesser current than Saturday, the pace was probably a bit better this time. On the way back down, a couple of the guys seemed to want to talk rather than paddle, so I forged on ahead, but I soon found myself surrounded by them again. Not sure if I was slowing down or they were speeding up. Probably both.

The way downstream was more fun with navigating tricky currents and eddies, although not as tricky as they’d been on Saturday. I love the feeling of speed when you’ve got the current pushing you along, but somebody remarked that you don’t see as much along the bank when it’s whipping by at 7 mph.

20140319-122214.jpg
The piece de resistance came right near the end, with less than a kilometer to go. A huge bald eagle was standing on the bank. One of the Furtoss brothers got to about a boat length from it when it took off. But it perched in a tree that was over the creek where we were heading. We all drifted to it trying not to startle it. We were all wishing we had a camera, when I realized I had my phone in my pfd pocket. I pulled it out, and couldn’t see a damn thing in the screen. At the time I thought it was just glare, but afterwards when it was too late I realized I had polarized glasses on and could probably have seen better if I’d taken them off. But as it was, I shot about 10 pictures blind, and one or two of them were ok.

First paddle of the season

Thunderbolt in snow
Yesterday Doug and I met at Baycreek for my first paddle of the season. Compared to previous years before my surgeries, this is relatively late for the first paddle, but it’s been a pretty harsh winter. The creek was open and running very strong, and it was 46°F, so it was a perfect first paddle.

Doug and I were both in our West Side Boat Shop boats, him in a Marauder and I in my Thunderbolt, and we still had our race numbers from the Long Lake race last year, which by coincidence were consecutive. Our boats looked like they belonged together. I was dressed in my farmer john wetsuit with long johns underneath, and a NRS Hydroskin light neoprene shirt, OR wind shell, and PFD up top, paddling gloves, and wool cap – all of that worked just fine. Unfortunately on my feet all I had were regular socks under neoprene socks, and that was *not* fine. My feet were cold before I even got in the boat, and when I got out afterwards they were numb and very painful as they thawed out. I’ve got to figure out something better. Somebody suggested plastic bags under the socks, maybe I’ll try that next time.

The strong current on the creek provided some challenge to my boat handling skills. Lots of swirling eddy currents, especially around corners – at one point the current caught my bow and whipped me across the creek right into Doug, which could have been bad for both of us. After that I was careful to go through the big corners single file, and start sweeping on the outside before the current caught me instead of after.

Later that day, I heard Doug telling somebody that I had tired him out and several times he saw me stop paddling to wait for him. In fact, what had happened was I’d powered ahead through a corner or other tricky bit to go through in single file, and I needed that recovery.

It was a pretty good day for spotting wildlife. At one point a mink was running along the bank going the same direction as us. It went into a pile of something and I thought he’d gone to ground, but Doug said “I can see him looking out at us”, and sure enough a few seconds later he pops out again and runs some more along side us, before finding another pile of stuff to hide in. Later on, we saw a diving duck that had a lot of white on the body and a roundish white cheek patch. I originally thought it was a Bufflehead, but I think it was probably a Common Goldeneye. We also saw several Common Mergansers. The Canada Geese were out starting to stake out nest areas.

I didn’t have my GPS, but Doug said we did 2.5 miles up in 45 minutes, and then returned the same 2.5 miles in 20 minutes. My shoulder started twinging a little bit with about a mile to go, so I guess we turned back at about the right time. But I did some stretches afterwards and the pain went down to background levels, so that’s comforting.

Later that evening, we were discussing plans for the season. It looks like Round the Mountain on May 17th is a definite, as is the Long Lake race in September at the end of the season. I doubt I’ll bother with Armond Basset, it’s always a drag. Blackburn is a stretch goal – it’s longer than any race I’ve done, and it’s on the ocean. I’ve also got the “TC Surfski Immersion Weekend” on June 5th-8th, and Oscar Chalupsky is giving a clinic here in town on July 13th. Mostly I think I’d like to spend more time out in the wave on the lake rather than pounding out miles on the canal like I did last year.

Defeating the popup blocker

I’m doing a WordPress site for a local business that involves a lot of custom PHP programming, which is interesting because I’ve never done PHP before. But heck, a language is a language and you can learn anything by googling these day.

So one of the things this site does is collect a bunch of information, and then submit it to a third party who then returns a URL for the specific payment page for that specific reservation, and you’re supposed to redirect the end user to that page to pay. I had that going where there was a WordPress shortcode that generated the form, and another WordPress shortcode on the destination page that did all that stuff, and then used a cheezy Javascript window.location=$url; thing to redirect it. That worked.

But the client had a look at it and didn’t like the fact that the end user ended up on a different site, and wanted it to pop up the payment page on a different tab or page. So I changed the Javascript to do window.open($url, "_blank");, but I found out that this causes every browser in the world to see that as a popup and block it. Asking end users to disable their popup blockers is probably a no-no.

Fortunately I discovered this post. He specifically talks about Chrome, but it also seems to work on Firefox, Mobile Safari, and even IE8. So I changed the form submit button into an ordinary button. Then I added a button click handler on it which quickly opens up a new window (if you delay it by single stepping with a Javascript debugger, it triggers the popup blocker) with some hopefully quick-loading bogus content, then making an AJAX call to get the URL, and in the “done” handler for the call, do a w.location = data.url; to redirect the new window to the correct url, and then does a “submit” on the form to take you to the correct new page on the original site. The Javascript code ended up looking like:

    
    /* When you submit the booking, make a popup window! */
    $('#info-form-fake-submit').on('click', function(eventObject) {
        var w = window.open(ajaxurl + "?action=pt_fake_page");
        $('body').addClass('loading');
        var $form = $('form.pt-form');
        $.ajax({
            url: ajaxurl,
            type: 'POST',
            datatype: 'json',
            data: $form.serialize() + '&action=pt_complete_reservation'
        }).done(function(data, textStatus, jqXHR) {
            if (data.status == 'good') {
                w.location = data.url;
                $form.submit();
            } else {
                alert(data.msg);
            }
        }).fail(function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ': ' + errorThrown);
        }).always(function() {
            $('body').removeClass('loading');
        });
    });

A progress meter/progress bar/progress breadcrumb

I was making a web site and there is a set of steps you have to go through. I thought it would be a good idea to have one of those bars across the top that shows you the steps you’ve done and what you have to do. You can see them when you’re checking out on Amazon, and when you’re ordering pizza on the Dominos site, among many others. The first problem I had was that nobody seems to know what to call these damn things, so it’s hard to google for them. If you google for “progress meter” or “progress bar”, you mostly find those ones like you see when you’re downloading files, where it says “20 minutes to go” and then 2 minutes later it says “10 minutes to go” and then 3 hours later it says “5 minutes to go”. If you google for “breadcrumb” you get the navigation type where you click on the items to navigate. So that was my first problem.

I eventually found one that I liked the look of, but it had one minor problem and one major problem. The minor problem was that you had to put in the number of elements at the top, which was a little tacky. The major problem was that when when I shrunk the screen down (ie. when I displayed it on an iPhone) things got all wonky and the lines and dots didn’t line up correctly. So I was thinking maybe I could do it using a table with a border along the bottom, but while I was playing around with that option, I discovered this answer in StackOverflow that would allow the divs to act like tables.

So I threw the two ideas into a blender and came up with the following CSS:
div.progtrckr-table {
width: 100%;
display: table;
table-layout: fixed;
margin-bottom: 20px;
}
div.progtrckr-table div {
display: table-cell;
width: 2%;
text-align: center;
padding-bottom: 0.5em;
vertical-align: bottom;
}
div.progtrckr-table div.progtrckr-done,
div.progtrckr-table div.progtrckr-doing {
color: black;
border-bottom: 4px solid yellowgreen;
}
div.progtrckr-table div.progtrckr-todo {
color: silver;
border-bottom: 4px solid silver;
}
div.progtrckr-table div:after {
content: "\00a0\00a0";
}
div.progtrckr-table div:after {
position: relative;
float: left;
left: 50%;
bottom: -1.3em;
line-height: 1.2em;
}
div.progtrckr-table div.progtrckr-done:after {
content: "\2713";
color: white;
background-color: yellowgreen;
height: 1.2em;
width: 1.2em;
border: none;
border-radius: 1.2em;
}
div.progtrckr-table div.progtrckr-doing:after {
content: "\039F";
color: yellowgreen;
background-color: white;
font-size: 1.5em;
bottom: -1.1em;
}
div.progtrckr-table div.progtrckr-todo:after {
content: "\039F";
color: silver;
background-color: white;
font-size: 1.5em;
bottom: -1.1em;
}

You can use it just by making a div of divs, like so:
<div class="progtrckr-table">
<div class="progtrckr-done">Pickup/Delivery Options</div>
<div class="progtrckr-done">Check Availability</div>
<div class="progtrckr-doing">Reserve Boards</div>
<div class="progtrckr-todo">Checkout</div>
</div>

When I first tried it, I still had a bit of a problem where the dots weren’t lining up correctly on a small screen. That’s when I discovered that there was something in the inherited CSS that was changing the line-height. I added a line-height: normal; to the div.progtrckr-table block, and all was well. I’m pretty happy with the results.

If you want to play with it, click the “Edit in JSFiddle” in the below:
[dciframe]http://jsfiddle.net/ptomblin/y26Xp/embedded/result/,100%,300,0,auto,border:1px solid blue;align:left;[/dciframe]