Archive for the 'blather' Category


When a textbook is not a textbook (redux)

Wednesday, May 7th, 2014

In a move reminiscent of OCAD’s textbook debacle of a couple of years ago, law schools are now jumping into the fray with ridiculous controls and DRM designed to use a textbook as a vehichle to perpetuate revenue streams rather than to teach students.


Are you preparing for the IP-ocalypse?

Wednesday, April 23rd, 2014

ARIN (American Registry for Internet Numbers) just announced they have now entered Phase 4 of their IPv4 Countdown, whereby only one /8 address block (in aggregate) remains to be allocated.

Between Phase 2 and Phase 3, the 3rd-last /8 was depleted in 11 months. It took only 8 months for the penultimate /8 to go, so it would be optimistic to think that there will be any IPv4 addresses available by the end of 2014.

You may want to look at ARIN’s IPv4 Depletion FAQ to see how this will affect you.

If you have not done so, it’s time to get familiar with IPv6. I recommend you start at, where you can find a ton of resources.


The Ex-XP Experience

Tuesday, April 8th, 2014

Being that it’s XP End of Support Day, I made sure this past weekend that there is no more XP in my home environment.

I still have Windows 7 Ultimate on my trusty yet crusty Dell 9400 and Win7 Pro on Clare’s Lenovo SFF desktop, however the one remaining XP instance was the kitchen machine, a venerable IBM T60 Thinkpad with 2G RAM.

The kitchen machine is used for general web browsing, Yahoo Instant Messenger, Skype, RDP/VNC client and sometimes playing music. I needed all these things to work just as easily as before, including the cheap USB webcam and mic, and the wireless network.

I installed 32-bit Ubuntu 12.04 LTS Desktop by downloading the ISO image to my Macbook Air and burning it to a DVD with my USB DVD drive, then booting up on the DVD. I used all defaults except for system name. When the system came up for the first time I used Firefox to download the Chrome package, installed it with the package manager, and then did the same with Skype. I used Pidgin to connect to Yahoo Messenger. In about 45 minutes and with a minimum of fuss, I had everything working. I set up accounts for my family, connected to wireless, and left it on the kitchen counter.

So far the only problem I have is that the video driver will only do 1024×768 and not the full native 1400×1050 that the T60 allows. This is not a big issue since Clare and I both need reading glasses now. Skype video is even clearer than it was on XP. My daughter started playing music with Grooveshark and it just worked. There are Office-compatible programs installed by default. Remote desktop access works great for both RDP and VNC hosts.

I heartily recommend Ubuntu 12.04 LTS Desktop as a great XP replacement with a fantastic out-of-the-box experience. You may also want to try Linux Mint.


Goals are for Losers (and other wisdom)

Thursday, March 20th, 2014

Scott Adams of Dilbert fame has another book out – “How to Fail at Almost Everything and Still Win Big”. As the owner of four of his previous books (that is to say four of his more-than-cartoons books), this one did not disappoint. Thanks to Alex Sirota and NewPath Consulting for sending the book my way.

You could be forgiven for thinking that The Dilbert Principle was more lampoon than sociology, however much like its progenitor The Peter Principle by Laurence J. Peter, the book actually makes a lot of sense about hierarchical organizations and their behaviour.

Similarly, this book provides compelling arguments to help you guide yourself through life and the workplace while giving you a chuckle.

In the introduction, we are teased with a list of topics, the first of which is “1. Goals are for losers”. Other topics include maximizing your personal energy, conquering shyness, and managing your luck.

The book is written in Adams’ usual fun and persuasive style, so it is a great read.

Of course, don’t take your advice from this middle-aged nerd, go figure it out for yourself.


Reliability: The Rarest Quality

Tuesday, February 18th, 2014

Of all the qualities that make someone a good employee, friend, partner, or teammate, the most elusive is reliability.

A reliable person:

  • arrives on time.
  • calls if they are going to be late, BEFORE the appointed time if possible.
  • does what they said they would do.
  • pays what they owe, on time, in full, nothing less
  • holds their end of a bargain or agreement.
  • keeps promises.
  • makes good on broken promises, WITHOUT being asked.

It all comes down to respect. A reliable person shows respect to others and earns it in return. All relationships, personal and business, stand or fall on reliability. Lapses in reliability can be tolerated if respect is shown and understanding sought, but unreliability without apology or explanation is unacceptable.

This post is the result of months of personal and business interactions, precious few of which were marked by any acceptable level of reliability.


Using Regular Expressions with SQLite

Wednesday, November 27th, 2013

SQLite is a great database tool that is available almost anywhere and is quick and easy to use.

I am currently using it for work I am doing for a client. I am writing a rules-based data validator in for a tab-delimited file using Perl on Windows. With SQLite, it’s simple to slurp the whole file into a database table and then query it multiple times to see whether columns conform to rules.

SQLite doesn’t quite come with a built-in REGEXP operator. I say not quite because it does alias REGEXP to a call to a function called regexp(re,str), however the function does not exist unless you provide it.

You can provide it by compiling a dynamic library extension (.so in Linux, .dll in Windows, .dylib on Mac), but my experience with that route was frustrating and bothersome. It’s only really necessary if you need to use SQLite with regular expressions from the commandline tool or a program outside your control.

Today I found out that if you are using SQLite in a program, you can provide the function in your own language!

Here is a simple example in PHP (it’s just as easy in Ruby or Perl or Python or whatever). Save this to dbtest.php and run it from the command prompt with ‘php dbtest.php’:


if(! file_exists('test.db')){
        $db = new SQLite3('test.db');
        $db->exec("create table users (name varchar(10))");
        $db->exec("insert into users values ('Robert')");
        $db->exec("insert into users values ('Egbert')");
        $db->exec("insert into users values ('Dilbert')");
        $db->exec("insert into users values ('Ratbert')");
        $db->exec("insert into users values ('Dogbert')");
        $db->exec("insert into users values ('Umberto')");

$db = new SQLite3('test.db');

// add the REGEXP magic to the db
function regexp($r,$s){return (preg_match("/$r/",$s)===1);}
$db->createFunction('regexp', 'regexp', 2);

// find names that start with a capital, two lowercase, then bert
$sql = "SELECT * FROM users WHERE name REGEXP '^[A-Z][a-z]{2}bert'";
$result = $db->query($sql);
while ($row = $result->fetchArray()) {
  echo $row['name'] . "\n";

/p?easy/ !

I would have thought it would be really slow, but I can run a REGEXP comparison against thousands of records and it’s plenty quick enough for my needs.


I just added a CAPTURE function to SQLite that returns the first captured section of a string when you supply a regular expression with parentheses.

Here it is in Perl:

$dbh->func('capture',2,sub { my($regex,$string) = @_; my($capture) = $string =~ /$regex/; return $capture; }, 'create_function'); # get month from YYYY/MM/DD format where month or day could be one or two digits my $row = $dbh->selectrow_arrayref( "SELECT CAPTURE('\\d{4}/(\\d{1,2})/\\d{1,2}', date_created) FROM invoices" );


Looking for a house in Brampton?

Tuesday, October 22nd, 2013

I recommend my house at 60 Foxtail Road. We’ve been in it almost 15 years and it’s nicely finished and well appointed. I’d keep it if I could take it with us.

60 Foxtail Road


Complete coverage, good service, peace of mind.

Thursday, October 10th, 2013

In the same week that the US Government has shut down ostensibly in a squabble about improving the lot of health care to Americans, I’ve had a couple of painful shutdowns of part of my renal system with a large kidney stone intermittently blocking my left ureter.

I thought I would tell you about my experience this week as a patient in the Canadian health care system, in this case at one of Ontario’s busiest emergency rooms, Brampton Civic Hospital. A lot of effort has been spent in the US vilifying the Canadian healthcare system, so I thought a real-world story might be beneficial to counter some of the misinformation.

I am a 52-year old white male, 6 feet tall, 225 pounds, type II diabetic. I am covered by the Province of Ontario’s health plan. My key to all services is my health card, a photo card I show at every visit to any doctor, lab or hospital. You show the card and they serve you, no questions, no stopping to determine whether or how much you’re covered, no payment ever exchanging hands, no bills forthcoming (there are exceptions but this is true for close to everything).

The total amount I had to pay out of my pocket for this care was zero. It was completely covered by the taxes I pay and the contributions I make. There was no expense for co-pay. There was no expense for needles, tongue depressors, lab work, nothing. The sum total of expenses for the entire week for me was a $15 parking charge.

I chose this hospital because it is close to my home. I would have received the same care at any hospital. I did not have to choose one that belonged to some particular plan. At all stages I was treated professionally and promptly (with consideration to other patients whose urgency exceeded mine).

Here is a breakdown of the care I received. It was all provided via the government plan, with no need for extra insurance coverage.

If there were to be a bill, these might be some of the line items:

    Emergency room visits: 2
    Specialist visit: 1
    Family Doctor visit: 1

    Bloodwork: 2
    Urine: 2
    Ultrasound: 1
    XRay: 2
    CT: 1

    Morphine injection: 1
    Morphine IV: 1
    Saline Solution IV: 1
    Gravol: 1
    IV for nausea: 1

The drugs administered at the hospital were all covered. The prescriptions I got were paid for separately and partially covered (80%) by my private drug and dental plan.

Initial Emergency room visit. At 1am, I had some discomfort in the left of my abdomen and blood in my urine. I was triaged through to Ambulatory Care in about 15 minutes, and was in the waiting room there for about 45 minutes until I was moved to an examination room. Was seen about 25 minutes after that, blood and urine were taken, then 1 hour to wait for results. During the hour my pain increased, becoming unbearable and as soon as they were aware, I was given two Percocets, a Gravol and a shot of Morphine in the arm. Once the results came back I was scheduled for a CT scan at 1pm and sent home with prescriptions for Flomax, Naproxen and Percocet, which I filled at the local 24-hour pharmacy, and a referral to my Urologist. Total time from start to finish, 5 hours.

By noon I had talked to my Urologist and had an appointment for 7 days later.

At 1pm I had my CT scan. For the Doctor to see it, I had to be triaged through a now very busy emergency room, and wait for a while at Ambulatory Care. Diagnosis, two 2-3mm stones on the right, one 2mm on the left and one 9mm on the left, 1/3 of the way down the ureter towards the bladder. Total time, 4 hours, mostly waiting comfortably while others were seen who were in distress.

The next Monday I got an appointment with my family doctor to get an extension on the pain medication prescription. He gave me a once-over and grilled me on some details.

The day before I was to go to my specialist, the pain was excessive despite the Percocet, so concerned that some damage might be happening, I went back to emergency. Within an hour I was taken in, blood was taken and I was and seen by the Doctor. I was given an IV of saline and a morphine pack, and later a pack of something for nausea. They took me for an ultrasound and the doctor saw me about 20 minutes later saying it was not clear enough so they were sending me for Xray, which I went to immediately and was seen in short order. The Xray showed it still in the ureter, if a little bit further along. As the symptoms had by that time subsided, the doctor and I decided together that we wouldn’t involve the on-call Urologist but that I would go to my own as scheduled the next day. Total time, less than 4 hours

When I arrived at the Urologist, they tried to get the XRay from the online hospital system, but there were connection problems, so they sent me upstairs to their local lab for another XRay. I was back in 35 minutes with the CD containing the XRay and the Dr gave me my consultation. We decided that due to the invasiveness of the surgical procedure (full anaesthetic, scope up the urethra and ureter, blasting, extraction) I would continue with painkillers and Flomax and if not passed in three weeks reconsider. Total time: 2 hours

Summary to date:

I was seen quickly and efficiently at one of Canada’s busiest emergency rooms three times in one week.

Imaging – I received a CT scan appointment within 10 hours, ultrasound immediately, XRay immediately (twice).

My specialist saw me within a week.

I could have chosen intervention if I cared to at this time. It will be available to me any time should my condition escalate.

At no time did I have to consider the financial implications of this care as there are none.

I understand that the taxes Americans pay for health care (which goes to medicare, government plans including Congress, generally not back to all who pay it) equal or exceed those that we Canadians pay for the care that we all actually receive.

It’s really a mystery why America remains as the only nation who doesn’t get it.