Generating a good portion—or more—of our electricity load here on Prince Edward Island from the wind happens frequently enough these days that it’s unremarkable. But it’s seldom that load and wind generation are so perfectly in balance as they are tonight.

A friend of mine made reference, in an email a few weeks ago, to her vain attempts to “release attachment to the outcome.”

That struck a chord with me: doing exactly that has removed one of the great sources of stress in our family’s daily life: getting to school on time.

According to the letter of the law, the school day at Colonel Gray Senior High School starts at 9:00 a.m.

And so our goal, starting out the year in September, was to try to arrive at school at 8:45 a.m. to give Oliver a chance to get settled before things ramped up.

This turned out to be untenable, for a variety of reasons.

First, if you work backward from 8:45 a.m., and factor in that we were walking to school in the fall, we had to leave the house by about 8:15 a.m. Which meant breakfast had to be underway by 7:30 a.m. Which meant getting Oliver out of bed by 7:00 a.m. Which meant getting myself out of bed by 6:30 a.m.

It wasn’t so much that this order of operations was untenable–6:30 a.m. is a perfectly reasonable time to wake up–it’s just that the military precision required to getting all operations completed on time to allow for an on-time arrival at school was eating away at our souls, especially Oliver’s, as there’s nothing he likes less than being rushed.

So, with the generous cooperation of school officials, we decided to release our attachment to the outcome: we’d try to get to school by 9:30 a.m., but if we didn’t, well, that would be okay too.

The positive effect on our family life was immediate and dramatic: with no time-pressure, our mornings could be leisurely and free of “Oliver, you have to hurry up and eat so that we can leave on time” stress coursing through the house.

Slow morning getting started? Who cares!

Oliver needs a little more time to finish watching a Robert Reich video or to memorialize somebody’s birthday by posting 89 YouTube videos to their wall? Take your time!

The great irony of this is most days we arrive at school, without consciously trying, at about 9:22 a.m.

I know this because the first thing Oliver does every morning on arrival is to go for a walk with Dave, his educational assistant. And so my first action on arrival is to send a text message to Dave, and to Shelly, the leader of the Learning Centre at the school, letting them know we’ve arrived.

And scrolling back through my text messages last week I found that there’s freaky regularity in our arrival time:

Screen shot from my SMS app on my phone, showing arrival times at school

This is supported by my Google Location History, which tracks my location and automatically records my arrival time at the school each morning:

Screen shot of Google Location History, showing a 9:23 arrival time at Colonel Gray High School.

Discovery of our regularity came as a big surprise to me, for I’d been under the impression, what given our release from attachment to the outcome, that we’d been arriving on a random schedule, untethered to real-world concerns like clocks and schedules.

But, no, it’s almost always 9:22 a.m.

9:22 a.m., it seems, is the time that Oliver is meant to be at school when we follow the natural rhythm of our family.

9:22 a.m. works for us.

9:22 a.m. doesn’t make us rush. It doesn’t make Oliver time-claustrophobic.

9:22 a.m. has made the difference between a hectic, stressful morning and a calm, enjoyable one.

I’m so happy we released our attachment, and that we were supported in doing so.

The Google app on my phone invited me to “Explore Interests” this morning. Under the “politicians” category it listed Donald Trump, Hillary Clinton, Barack Obama, Justin Trudeau, Melania Trump, Vladimir Putin, Bernie Sanders, Queen Elizabeth and Fidel Castro.

Quick on the heels of the City Cinema Twitter Bot, here’s the City Cinema Telegram Bot.

If you use Telegram as a messaging app, you can query this bot just like you can the Twitter one: “what’s playing on Sunday?” and so on. It’s powered by the same API.ai back-end as the Twitter bot is, and there were no coding changes required to support this integration.

Here’s what it looks like:

Screen shot of a Telegram conversation with the CityCinemaBot.

You gotta hand it to Telegram for eating its own dog food: the entire process of setting up a new “bot” is handled conversationally with the BotFather.

Remember that Amazon Alexa Skill that I built for City Cinema? Well it’s now generally available: if you have an Echo device anywhere in the world, you can enable the “City Cinema” skill.

My usual coding practice when hacking away at things like this is to write horribly-organized spaghetti code to see whether things are going to work at all, and to understand the underlying patterns, and then to loop back and create more elegant, reusable code once I’ve got some more insight. I’ve now done the loop-back for the code that powers the City Cinema schedule, building a PHP class that allows me to do things like this:

<?php
$c = new CityCinema('whatsPlaying', '2017-03-15);
$message = $c->speakable;
?>

(which will set $message equal to a speakable version of the City Cinema schedule for March 15, 2017).

The great thing about reusable code is that it’s, well, reusable. Meaning that when I went to explore the now-Google-owned API.ai platform for developing conversational interfaces, I could use the same PHP class to act as the back-end webhook for that too, with almost no modifications.

API.ai is a considerably more sophisticated platform than Amazon’s Alexa Skills Kit: coding for API.ai seems a lot less like coding for ELIZA and more like using a tool that’s custom-tailored for this task.

So, for example, the UI for creating a new “intent” looks like this in API.ai:

Screen shot of the API.ai intent creation screen.

Rather than needing to spell out, in JSON, all of the various utterances that I want to glue to my business logic, I simply specify some sample phrases, highlight where the entities that are required appear in them (connecting “Tuesday” to the @sys.date entity, for example), and API.ai takes it from there; even though I didn’t specify it in my examples, there’s enough to be derived from these that I can say “Ask City Cinema what’s on tap for Wednesday” and it will figure out what I mean.

One of the nicest features of API.ai is that it supports multiple conversational integrations from the same setup, and these are very easy to deploy.

For example, once I had the Google Actions integration working (to allow me to support Google Home and Google Assistant), I was able to roll out a Twitter bot in about 5 minutes; the only change required was to my back-end webhook, where I changed “do you want to hear a description” to “do you want a description” when the source was Twitter.

As a result, if you send a Twitter Direct Message to @city_cinema, you can now ask it the same questions you can ask Alexa and Google, like “what’s playing tonight?” or “what’s running on Sunday?” And I’ve added a couple of conveniences too, like “what’s your location?” and “how much are tickets?” Here’s what it looks like in action:

 

Screen shot of the City Cinema Twitter "bot" in action showing a dialog where I ask it questions and it responds.

Give it a try!

If you were an admirer of the seminal Penguin Café Orchestra, then you might like Penguin Cafe, a sort of spiritual reconstitution thereof by founder Simon Jeffes’s son Arthur:

Penguin Cafe was founded by Arthur Jeffes in 2009, bringing together a diverse and disparate group of musicians from the likes of Suede, Gorillaz and Razorlight, initially to perform his father Simon Jeffes’ legacy of world renowned Penguin Cafe Orchestra music, ten years after his untimely death in 1997.

Arthur, a composer in his own right, quickly began to create new and unique genre-defying music, with the spellbinding philosophy of the Penguin Cafe always in his mind.

The recently-released The Imperfect Sea is both of and a departure from the fathership. It’s available from the excellent Erased Tapes, which has itself just turned 10 and released a fresh new website.

You can’t do much better than putting the Erased Tapes back catalogue into a Spotify playlist and letting it run all day.

Penguin Cafe album cover for The Imperfect Sea

Lost in the shuffle of the Amazon Echo Dot that we’ve been using for the past month is its capacity to receive as well as send via Bluetooth.

I knew you could pipe the audio from the Echo into a Bluetooth speaker; what I only realized today is that you can pipe the audio of other services—like a phone or tablet—to the Echo.

For me this solves the problem of there being no SoundCloud skill for the Echo: I can simply use the Android SoundCloud app and send the audio to the Echo. Because the Echo is hardwired to our hifi, this gives me a handy bridge to blasting SoundCloud audio into the living room.

I was either mistakenly issued two double machiattos, or an anonymous suitor was trying to pick me up. Regardless, I’m now exceedingly well-caffeinated.

I use Apache Solr, and the related Drupal module, to power the search on this site.

Something that’s always bothered me about the out-of-the-box way this displays search results is that the date display with each search result is the “date the content was last changed.”

So, for example, for this post I wrote in 2015, the date that appears under the search result (when I search the site for pickles) isn’t November 1, 2015, when I wrote the post, but rather July 7, 2016, when it was last updated:

Things I’ve Liked Recently

favourite meal there: toast (from Breadworks bread), smoked salmon, vegetables, pickled onions and cheese. …

Peter Rukavina - 2016-07-03 11:22 - 1 comment

Because Drupal’s very vigilant about keeping the “changed” date current, this date can get updated for a lot of different reasons.

For example, on July 3, 2016 I used the Search and Replace Scanner module do to some automated processing of almost every post here, and Drupal dutifully updated the “changed” date for all of the affected posts to July 3, 2016. That’s fine for auditing purposes, but it just creates confusion for displaying search results, when what I want to know is when was this written.

There are various ways to fix this: altering Solr so that it indexes the created rather than changed date, altering the search results template so that it looks up the created date and displays it, etc.

But the simplest approach, assuming you’ve no need to track revisions, is to simply update the changed dates to match the created dates, via a MySQL query, like this:

UPDATE node SET changed = created;

Once I did that, and then deleted the Solr index and re-indexed everything, the dates in search results became much more helpful:

Things I’ve Liked Recently

favourite meal there: toast (from Breadworks bread), smoked salmon, vegetables, pickled onions and cheese. …

Peter Rukavina - 2015-11-01 14:35 - 1 comment

This is a “nuclear option,” inasmuch as you lose the audit trail for each node. But it was quick and painless for me.

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, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). You can subscribe to an RSS feed of posts, an RSS feed of comments, or receive a daily digests of posts by email.

Search