[[Oliver]] and I drove up to Rollo Bay this morning to take in the last day of this year’s Rollo Bay Fiddle Festival. We arrived just in time for the “Tune Writers Circle” in hall at Noon, and were entertained by the fiddle, banjo, piano and mandolin stylings of players like J.J. Chaisson, Brent Chaisson, Elmer Deagle, Anastasia DesRoches, and Mike Hall.

At 2:00 p.m. the afternoon concert started, and we stayed around for Courtney Hogan, the Queens County Fiddlers, Tim Chaisson, and another round of Mike Hall, who was the real highlight of the event for me.  Born in Saint John and honed in Cape Breton, Hall is a sharp player who’s obviously going places. We picked up his CD, A Legacy Not to Be Forgotten, and will look for him again.

By 3:00 p.m. Oliver was flagging — an 8 year old can only take some much fiddle — and so we took the long way home, up to Naufrage and along the north shore and over to Mount Stewart where we stopped in at The Trailside for a piece of cake and a chocolate sundae and a chat with the Doug Deacon.

All of this was part of the 2009 edition of “trying not to completely miss summer on Prince Edward Island,” an effort that, so far, we’re doing pretty good at.

After I succeeded at getting my taxonomy into Drupal, my next task was to get 10 years worth of blog posts from my old homebrew blogging system into Drupal too.  In this regard the Drupal module Node Import was of great help, but a little massaging on the old posts was required before I actually did the import, for which I wrote a PHP script.

My script was quite simple: it took the existing blog posts from a MySQL table, did the massaging, and output them as a vertical bar-delimited ASCII text file ready for Node Import.  The “massaging” amounted to the following:

  • I stripped the HTML tags from the post titles – just used strip_tags on this field.
  • I escaped the vertical bars inside posts themselves – just changed all instances of | to \|.
  • I created a “Taxonomy” field with a double-vertical bar-delimited list of taxonomy terms – for example Internet||Weblogs||Firefox.

Once my script ran on my archive of posts, I had an ASCII file that looked something like this:

"5487"|"2009-05-01 11:11:34"|"Post Title"|
<p>This is the post text in HTML.</p>"|"Internet||Blogs||Firefox"

The first field is the unique record ID on my old system, which I wanted to preserve in Drupal to make referencing old posts easier. The final step, once I had the ASCII file exported, was to run it through iconv to convert the character encoding from ISO-8859-1, used in my homebrew system’s tables, to the UTF-8 used by Drupal:

iconv -f ISO-8859-1 -t UTF-8 drupal-export.txt > drupal-export.utf8.txt

Now I was ready for Node Import.  In Drupal I went to Administer > Content Management > Import Content, clicked “New Import,” and then walked through the wizardy steps to define the import.  Some note on each of the steps:

  • Step One
    • I selected “Story content type”, as this was the content type I decided to use for blog posts.
  • Step Two
    • Remember that you have to “Browse” for the file, then click “Upload” to actually upload it before you go on to the next step.
  • Step Three
    • Delimiter Separated Values
      • Record Separator Newline
      • Field Seperator Pipe (|)
      • Text Delimiter Double Quote (“)
      • Escape Character Backslash (\)
    • If you make the above selections and then click on the “Reload Page” button, you can see a preview of your import in the “Sample data” section of the page, and can get a quick visual indication of whether you selected properly.
  • Step Four
    • I mapped each of my export file’s fields to the appropriate Drupal field.
    • I’d previously added a CCK field called “Previous Number” to hold the original blog post’s record number.
  • Step Six
    • This is the step where you define the field settings you wanted applied to every post where no value appears for a given field in your export file.
  • Step Seven
    • This is the most useful step of all: it gives you a preview of 5 imported items as they will appear once imported (and you can change “5” to a greater number using the “Number of records to preview” drop-down list at the top).  If posts don’t look right here, then they’re not going to look right when they import, so check the preview carefully for possible glitches.
    • If you find problems that require creating a new version of the ASCII file export, you can just click on the module’s “Back” button (not the browser’s) to go back to Step Two and upload another file; all the other choices you’ve made on on steps are remembered.

It took me about an hour of back-and-forth, looking at the preview of the import in Drupal, making tweaks to my export, uploading another version of the file, previewing again, and so on, to get things working properly; this was mostly working around peculiarities in posts on my old system, and didn’t have much to do with Drupal itself.

Once I was ready to launch the import itself it went quite quickly, and was done in under 30 minutes.  The result: more than 5,000 old blogs posts, mapped to a hierarchical taxonomy, in a new home in Drupal.

Our Canoe

About a decade ago, back when [[Catherine]] and I had no [[Oliver]], and thus had surplus time on our hands, we bought a canoe.  It is a nice canoe – nothing extravagant, but enough to knock around in the waterways of Prince Edward Island in.  We did not canoe extensively during our footloose time – a few trips in the West River, a rather bizarre attempt, with my brother [[Steve]], to navigate the Morell River, and an unfortunate outing into the North River in the area surrounding a sewage outflow.  But we always had high hopes.

Those high hopes were diminished somewhat when Oliver arrived and our surplus time disappeared.  When Oliver was 3 years old we made some attempts at resurrecting our canoe lifestyle, but our initial personal flotation device trials resulted in a face-down-in-the-water Oliver, and so we were scared off.

This week, though, with summer speeding by and Oliver’s childhood advancing, I resolved to reapportion some of my summer time to getting the canoe up and running again.  

We started last night with a trip to Canadian Tire and the purchase of a wee paddle and a new PFD, followed by an hour-long session in the CARI Pool to insure that the PFD actually worked (it did!).

Tonight I dragged the canoe out of the carriage house, hosed it off, and assessed the wear and tear of 8 years among the skunks, cats and raccoons (in general, not to bad: some animal attempted to eat the styrofoam seats, but not too much damage was done, and the craft remains seaworthy).

Next on my list tonight: find a way of affixing the canoe to the roof of our 2000 VW Jetta.  When we first bought the canoe, Sporting Intentions sold us a $20 kit of nylon cord and styrofoam blocks that snapped on the canoe’s gunnels; they served us well, but were eaten by the aforementioned animals in the interim so needed to be replaced.

Alas I’ve had no luck replacing them: there are plenty of kayak carriers in the stores of Charlottetown, but nobody but Sporting Intentions sells canoe carriers, and they’ve “gotten away from the styrofoam system” and all they have to offer is a $400 Thule system that, while it’s beautifully designed and snaps right into the Jetta, is overkill for what will likely be a weekend outing or two this summer (I should add that the Sporting Intentions salesperson was super-helpful, both in selling me on the virtues of the Thule, but also in pointing us to good spots to put in).

So as of this writing I’m still searching.  Canadian Tire is selling styrofoam “pool noodles” for $1.99 each and I’m pretty sure I could adapt them for the job, add $20 worth of tie-down straps and have something that would safely get the canoe into fresh water.

Times a wasting and the snow will be here soon, so I’d better be quick about it.

Suggestions welcome.

Finally, after being euphemistically known as an “entertainment centre,” and unofficially referred to as a “racino,” the casino in Charlottetown is being renamed to what it is: a casino.

HOMBURG

There have been rumblings of discontent within the cultural intelligentsia of Charlottetown for the past few months about the donation, that last night became public, by developer Richard Homburg of $2 million to the Confederation Centre of the Arts, and the resulting renaming of the Centre’s Main Stage to Homburg Theatre.

While their are myriad reasons to call this donation into question, the foremost, to my mind, is the simple vanity of it all.

Selling off naming rights is a well-established institutional practise, and one the Centre has used before in smaller ways without outcry.  But Prince Edward Island is a special place, a place that treats vanity as a serious sin, punishable by suspicion and long term just-out-of-earshot scorn. 

On the Island, it’s fine to be successful, you’re just not supposed to show it off.

That Homburg appears to have ridden into Charlottetown, decided to remake the city in his image (complete with large HOMBURG signs slapped on everything that doesn’t move), and then, in a vainglorious coup de grace, paid to have the cultural heart of the city renamed after him, is vanity the likes of which we’ve never seen before.

While it’s hard to argue with Homburg’s generousity, to my eyes the impulse is tarnished by this self-idolatry.

My old homebrew blogging system used a hierarchical set of categories to tag posts.  It looked something like this:

  • Technology
    • Apple
      • Steve Wozniak
    • Backup
    • Barcodes
      • UPC

And so on.  When I migrated the blog to Drupal, I needed a way of getting this set of categories out of the old system and into Drupal. Here’s how I did it.

First I created a new Drupal Vocabulary (Drupal-speak for “set of categories”) called “Topics” and then I looked in the drupal.vocabulary table to find that the vocabulary had a record number – or vid – of 5.  I noted this for later.

The old system’s categories were stored in a MySQL table that looked like this:

CREATE TABLE `categories` (
  `number` int(11) default NULL,
  `name` char(75) default NULL,
  `parent` int(11) default NULL,
)

For each category there was a number, a name (like “Apple”) and the number of the parent category, if any.  While there are various ways of importing categories into a Drupal “taxonomy”, none of them exactly fit the bill for me, so I decided to go the “write a PHP script to do it” route.

First I selected all of the categories, in numerical order (because I wanted to make sure that parents appeared before their children):

SELECT number,name,parent from categories order by number

For each of the categories I inserted a record into the Drupal term_data table:

INSERT into drupal.term_data (vid,name) values (5,'" . addslashes($name) . "')"

In then retrieved the tid (or “term ID”) value:

select LAST_INSERT_ID() as tid

and noted this for later use should I need to identify the ID of this category should it be a parent to a child encountered later.  I then also inserted a record into the term_hierarchy table, using a value of either 0 (zero) for categories with no parent, or the tid value for the parent, noted earlier, for this with a parent:

INSERT into drupal.term_hierarchy (tid,parent) values ($tid,$parent)

Put it all together and the code looks something like this:

$query = "SELECT number,name,parent from categories order by number";
$result = MYSQL_QUERY($query);
$howmanyrecords = MYSQL_NUMROWS($result);

$currentrecord = 0 ;

while ($currentrecord < $howmanyrecords) {
    $number = mysql_result($result,$currentrecord,"number");
    $name = mysql_result($result,$currentrecord,"name");
    $parent = mysql_result($result,$currentrecord,"parent");

    $query2 = "INSERT into drupal.term_data (vid,name) values (5,'" . addslashes($name) . "')";
    $result2 = MYSQL_QUERY($query2);

    $query2 = "select LAST_INSERT_ID() as tid";
    $result2 = MYSQL_QUERY($query2);
    $tid = trim(MYSQL_RESULT($result2,$currentrecord2,"tid"));

    $tids[$number] = $tid;

    if ($parent <> '') {
        $parent = $tids[$parent];
    }
    else {
        $parent = 0;
    }

    $query2 = "INSERT into drupal.term_hierarchy (tid,parent) values ($tid,$parent)";
    $result2 = MYSQL_QUERY($query2);
   
    $currentrecord++;
}

The end result was a 788-term vocabulary, with hierarchy preserved, in Drupal, ready to attach to the posts I would import next.

I’ve mentioned this before, but if you’re looking for an easy way to buy locally-produced organic vegetables on Prince Edward Island, you should give Aaron Koleszar’s Organic Veggie Delivery service a try.

The produce is local, the schedule and mechanism for delivery and payment is easy to manage, the delivery car is powered by biodiesel, and you’ll not meet a nicer veggie delivery person than Aaron.

Here’s a snippet from Aaron’s email today, announcing his return to the fold:

I’m pleased to announce that after 6 weeks recovering from hernia surgery, I plan to resume deliveries on Thursday/Friday of next week (July 23-24). Orders will be due by the night of Monday, July 20. Later today (or on Friday) I will send out an update detailing what’s available and what’s in the veggie boxes.

I’d like to thank everyone for your patience and for all of your kind words, thoughts, and wishes of a full and speedy recovery. The surgery and recovery went well and I’m mostly healed. I’m feeling quite well, but I still need to be careful with lifting for a while.

For the time being, I will only be delivering every 2 weeks, so the next delivery will be scheduled for August 6-7. I expect weekly deliveries to begin late August or early September.

Also, you should know that my partner Jodie and I are joyfully anticipating the arrival of our first baby. The forecasted due date is August 13. However, if the actual baby delivery date happens to coincide with vegetable delivery dates, then I might have to delay the veggie delivery a bit. In such an event, I would of course be in touch to inform you.

Okay, I’ve figured out the key combination in FCKeditor that’s causing me grief: I’m used to typing Command + Left Arrow to go to the start of the current line in an editor.  While this works as expected in a normal input field, if I do this in FCKEditor it’s interpreted as “back” by the Firefox and takes me back to the previous page, therein losing everything I’ve typed into the editor.

Apparently this is a Mac Firefox-only issue, and is discussed in this blog post and this Firefox bug report.

While some recommend Keyfixer as a Firefox add-on that fixes this issue, I couldn’t get it to work, and opted, instead, for keyconfig.

Keyconfig Setting in FirefoxTo install keyconfig, just visit this page, click on the link to the latest keyconfig.xpi file, and install the add-on.  Once it’s installed and Firefox has restarted, select Tools > Keyconfig in Firefox, select the row named goBackKb that’s set to ⌘Left Arrow and click Disable.

Once I did this, using FCKeditor in Firefox on my Mac became a much more pleasurable experience, what with the whole “you could lost everything with one careless keystroke” somewhat removed.

The barricades went up on Monday morning around the parking spots in front of our house, and there were tree surgeon types scouting around, so we knew something was up.  We feared the worst, but it turns out that the giant tree (and it is giant) in front of our house was simply due for a trim.

Tree at 100 Prince Street

There’s nothing like a meeting of the Charlottetown Downtown Residents Association to make you feel like gathering a bunch of your drunken  motorcycle-racing friends, finding the highest, ugliest, most architecturally unsympathetic building in the city, climbing to the top and making mad passionate love to Tim Banks while the hooligans pee in the bushes and pull wheelies on their muffler-less dirt-bikes.

Being trapped in a room with that bunch of frightened curmudgeons makes me want to renounce every curmudgeonly thing I’ve ever written in this space in favour of an endless, lawless bacchanal: bring on the crows, the miscreants, the graffiti-writers and heck, even the developers of obscene buildings. It’s better that we have a downtown that’s chaotic and vital than the sedate 1950s utopia envisioned by the downtown livers.

That is all.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

I have been writing here since May 1999: you can explore the 25+ years of blog posts in the archive.

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search