Tuesday, November 29, 2016

Colombia Adventure - Day 1

November 20th, 2016

We landed in Bogota, Colombia! We successfully made our way to our friends Matt & Abbie's house, where we celebrated our arrival with a most delicious meal of mac and cheese. The kids have grown so much since we last saw them and it was fun to catch up.

As first impressions go Bogota didn't make an especially strong one. It struck me as a large city, and our cab driver was nice enough. Oh, and we passed a number of casinos. The guidebook didn't say anything about gambling?! This warrants more research.

The altitude is kicking my butt. Standing in the customs line, I had a heart rate of 84 bpm, up from my usual resting rate of 64.

Looking forward to the adventure to come!

Thursday, November 24, 2016

Colombia Adventure - A Very Small Preview

Greetings from Bogota, Colombia! For the past 5 days we've been living it up and about the only thing I haven't been able to do is find time to blog. So for now, I've been taking lots of photos and scribbling down notes in my notepad. Expect lots more info on our trip soon. In the mean time, here's a few snapshots to hold you over.

Friday, November 18, 2016

Gotcha of the Day: Elegantly Casting YouTube to Chromecast Audio

I'm really enjoying our kitchen audio setup. We've now got 4 of these speakers, each hooked up to its own Chromecast Audio, spread throughout the first floor of our house. Using both iHeartRadio and TuneIn, I can effortlessly blast the tunes and here them wherever I happen to be.

One of the only disappointments in the setup is that by default, you can't cast YouTube to an Chromecast Audio device. If you've got the upgraded version of YouTube, it's possible, but I'm not ready to commit to $9.99 per month just so I can stream audio from YouTube. Thing is, when I want to hear a specific song, YouTube is usually the place to find it.

The standard work-around for this is to cast your device's audio and then hit play on YouTube. This isn't ideal, as it means that you're streaming audio from your device, rather than having Chromecasts pull down the data directly from YouTube.

Fortunately, I've found a far more elegant way to handle this. The solution: Tasker, of course. Specifically AutoCast, which is a Tasker plugin that allows you to take programmatic control of your Chromecast devices.

Turns out, as I had hoped, the limitation on streaming YouTube from a Chromecast Audio devices lies in the YouTube app, not the Chromecast device itself. I essentially followed the tutorials here and worked up an AutoShare + AutoCast rule that sends the YouTube video URL to my Chromecast Audio. Yes, you read that right: I'm sending a video URL to a device that only streams audio. Still, it *Just Works*.

Here's some screenshots of the recipe:

So I now have the ability to hit the Share button on YouTube, select AutoShare Command and the song will start playing on the speaker of my choice.

However, there are some limitations with this setup:

  1. You need the beta version of AutoCast to access Chromecast Audio devices. Luckily, signing up for beta access is easy.
  2. Occasionally playback doesn't start when I try casting a song. The fix I've used so far is to prime the Chromecast device by casting to it from a standard app (say, TuneIn), and then casting to it from my AutoCast hack.
  3. I can only broadcast to a single speaker, not a group.

This last point is a real pain, as the magic of Chromecast audio is when you hear your tunes emanating from multiple locations at the same time. However, the AutoCast community is active, so perhaps this issue will be addressed.

Still, next time I'm itching to rock out to a specific song, I now have a quick and easily way to do so.

Thursday, November 17, 2016

Less Talk, More Doing - Videos where skills tell the story

A guy playing in dirt, that's basically what his videos are. And yet, they're wildly popular. I'm speaking of PrimitiveTechnology, a sort of anti-youtube star who publishes functional videos showing, well, primitive technology. Like how to build a hut using nothing but natural supplies. So far, that video has racked up nearly 16 *million* views.

Watch his videos, and you'll see remarkable feats: like how to catch and cook food, make a bow and arrow and make crude textiles all using little more than rocks, plants and brainpower. As for what you'll hear, not much. The videos contain little more than the ambient noise of the forest, with the star of the show not narrating, nor even providing his name. This article nicknames the author of the videos as Prim, which I think is a perfect selection.

The videos do have companion blog entries which give a little more technical information about what Prim managed to accomplish (and fail at) in videos.

I find the videos fascinating on a number of levels.

First of all, they're awfully clever and show what one can accomplish given creativity and the natural resources at hand. But there's more to it than that. Prim, to me, is a fine example of skill trumping everything else. OK, you've got a great website. And man, that promo video you created is sexy as can be. But does your product actually work?

Recently, I stumbled on Mr Gear's YouTube Channel, and he has a similar, albeit splashier vibe than Prim. His videos lack narration, or even a description of what objects he'll be building. Like this one, where he creates a kitchen mixer, slingshot, circular saw(!) and micro-torch all from random bits and bobs. Again, it's all about skills and it sure is remarkable watching him put his to work. I love that he calls the videos "Simple Life Hacks," when I consider any project that requires a glue gun and soldering anything but simple.

So polish up those skills and let them speak volumes for you.

Wednesday, November 16, 2016

A Better Eyes Free Time Telling App

One of my first experiments in building Pebble watch apps was to create a program to "announce" the time using vibrations. The idea was simple: I wanted to be able to tell the current time without looking at my wrist. Truth be told, I haven't gotten a lot of use out of the app I built, though it was certainly fun to build and I think there's still value in the concept.

Apparently, I'm not the only one who thinks that eyes-free time telling would be handy. Enter: Ben Galbraith:

Having observed first-hand that stealing glances at my watch or other clocks during a meeting does indeed create a negative impression on others, I experimented with several alternative ways to seamlessly manage time. While I did find some schemes that worked, especially when meeting with people in my own office, the thing I really wanted was what I saw all those years ago: a watch I could touch to tell the time. But despite my best efforts, I could never find one.

Ben, like myself, realized that the vibration facility on the Pebble watch could help crack this problem. Luckily for me, he developed a far more polished app than myself and it's one that I find myself truly benefiting from. The app can be downloaded here: Time Helper.

Here's how the app works:

... I created a Pebble app that vibrates with a distinctive pattern every quarter hour and, whenever I push a certain button, vibrates the number of minutes in the current hour. I spent a bit of time experimenting with different vibration timings and finally settled on something that worked well for me. Then I integrated the app (and the watch) in my work life to find out if it would actually help me.

So rather than my attempt at relaying the exact time to the watch-wearer, Ben just vibrates out the minutes. And he does so using a wonderfully simple method: for every minute, he blurts out one tiny vibration. This is brilliant, as it simplifies the problem (relaying only two numbers, 0 - 9) without really losing any functionality.

There are some other nice touches included: when the app runs, it looks like a standard watch face. This helps mask any indication that you're closely monitoring the time. The app also includes a 'focus' mode that causes the app to vibrate once a minute. At times when you're just about out of time, turning on focus mode helps, well, focus you on wrapping things up.

The source code for the app is found here. While Ben designed the app to work on his Pebble Steel, it works quite well on my Pebble Classic.

Monday, November 14, 2016

Gotcha of the Day: More WordPress 4.6 Segfault Challenges

A few months back I had a client's WordPress site that started segfaulting when I upgraded to WordPress 4.6. I wrote it off as a quirk in the server. Perhaps there was some old low level library that was causing things to crash.

We finally got around to upgrading the serving, including: Apache 2.4 to 2.6, PHP 5.3 to 5.6, 32 bit OS to 64 bit OS and CentOS to Debian. The server was in test mode and I eagerly clicked the upgrade button to bring WordPress up to the latest version (now 4.6.1).

The home page rendered fine, but an internal page crashed. More segfaults!

[Mon Nov 14 14:33:05.945020 2016] [core:notice] [pid 21979] AH00052: child pid 11408 exit signal Segmentation fault (11)
[Mon Nov 14 14:33:05.945114 2016] [core:notice] [pid 21979] AH00052: child pid 11421 exit signal Segmentation fault (11)
[Mon Nov 14 14:34:06.022689 2016] [core:notice] [pid 21979] AH00052: child pid 11427 exit signal Segmentation fault (11)
[Mon Nov 14 14:34:07.023865 2016] [core:notice] [pid 21979] AH00052: child pid 11433 exit signal Segmentation fault (11)
[Mon Nov 14 14:34:08.024998 2016] [core:notice] [pid 21979] AH00052: child pid 11425 exit signal Segmentation fault (11)
[Mon Nov 14 14:34:08.025065 2016] [core:notice] [pid 21979] AH00052: child pid 11434 exit signal Segmentation fault (11)
[Mon Nov 14 14:34:09.032498 2016] [core:notice] [pid 21979] AH00052: child pid 11435 exit signal Segmentation fault (11)

How could this be? PHP isn't supposed to segfault, and certainly changing high level code in WordPress shouldn't trigger a segfault. And I was no running and an up to date system, so my theory of an ancient library causing problems didn't make sense.

A few months back when I had this issue I went the route of trying to analyze the core dump. Given that I had one page that was working and one that wasn't, I decided instead to focus on figuring out which chunk of high level PHP was breaking.

I did the usual debugging dance: I confirmed that /foo crashed with a segfault. I then removed all the custom plugin code I'd written and confirmed that /foo came up. Of course without the plugin code /foo no longer did anything, but at least it didn't segfault.

I then took my time moving these two goal-posts closer, and closer together. After about 20 minutes I had the one line of code that was crashing WordPress:

 add_filter('the_title', function($title, $id) {
 if($id == get_the_ID() && strpos(get_the_content(), '{sometext}') !== false) {
   ...

Calling get_the_content from within the_title filter was causing a segfault. I suppose I could have dug deeper to figure out why, but instead, I changed my code around to read:

 add_filter('the_title', function($title, $id) {
  $the_post = get_post();
  if($id == $the_post->ID && strpos($the_post->post_content, '{sometext}') !== false) {
   ...

For my purposes, this code works.

Is this related to the original segfault issue I ran into? It seems unlikely, but then again, who ever heard of WordPress causing a segfault? So crazy. I'm just glad I was able to fix it with relative ease.

Pop Quiz

Question: The above photograph was taken the morning Shira...

  • A. Entered high school
  • B. Graduated from high school
  • C. Entered college
  • D. Graduated from college
  • E. Got married

Show Anwswer

Friday, November 11, 2016

How, What and Why

I had to smile when I started typing a coding related question into Google yesterday. Apparently trying to make sense of this election is on more than few people's minds.

Thursday, November 10, 2016

The Etrog 2016 Seeds Get Planted

I wish I could say that I planted my Etrog seeds a sort of gesture of hope given the outcome of our latest election. But alas, the image meta-data would give me away. I planted these on Tuesday morning when the world of politics made sense. Donald Trump's unlikely campaign would come to an end and the country could pat itself on the back knowing, whether you supported her or not, that we had elected the first woman president.

Yeah, it didn't happen.

This year I upped my game and purchased actual seed starting mix and proper contains to plant the seeds in. I laid out all the pots and started filling them. As I reached the last set of pots I realized I had more spaces than seeds. On a whim, I grabbed a regular old lemon, sliced it open and extracted a few seeds.

The symbolism of that choice is not lost on me. If you were a Hillary supporter, here's to taking a lemon and turning into something so much more. And if you were a Trump supporter, here's to hoping your choice will help us all grow and flourish.

Wednesday, November 09, 2016

Taking our Kitchen Radio to the Next Level - On the Cheap

As we were wrapping up our Kitchen Renovation it hit me: why didn't we have our contractor install some sort of built in sound system when we had the chance? Mind you, I don't actually know what I mean by "built in sound system," just that I knew my chance to run cable and install speakers in the ceiling/walls had passed. This would have been a sweet upgrade from the under-counter AM/FM radio that's got quite a bit of use over the last 10 years.

I started doing some research and quickly learned that the days of needing to run hard wired sounds systems are long gone. Even still, purchasing the hardware to power a home sound system was an expense I'd have a hard time justifying. Not to mention, I didn't really know what I wanted or needed in such a system.

As a compromise, I took a card out of my friend Nick's playbook: I purchased two simple bluetooth speakers with AUX in ports and two Google Chromeocast Audio devices. At each end of the kitchen I plugged in a Bluetooth speaker and Chromecast:

I then fired up the Google Chromecast setup (which is amazingly done, by the way) and within a couple of minutes had two different devices I could cast to. I kicked off the iHeartRadio app, selected a local station, and cast to one of the speakers. I had music. Very cool. I then created a new Chromecast Audio Group and put both kitchen speakers in it. I then cast to this virtual device and lo-and-behold, I had audio seamlessly coming out of both speakers. This was downright magical!

I'm so hooked. I can't believe how elegant the Chromecast audio is, especially when you consider the ridiculously cheap price of $30.

I'm sure the audiophile out there is cringing right now. It doesn't matter. The speakers sound just fine to me, and while something built in would be sexier, I can live with the extra devices on the counter. Between the iHeartRadio app and tunein radio, I've got endless amounts of audio to listen to. Even Shira, who's a fan of FM radio, is enjoying the setup. Now instead of just being able to scan among the local stations, she can reach stations across the country.

I love that I can cast audio from either my cell phone or any Chrome browser. The only disappointment I've had with the whole system is that my Chromebit, despite running Chrome OS, doesn't seem to support any type of casting. I just get a blank screen when I list out the devices available to cast to.

I'm sure there are fancier solutions out there. But if you want to take your music to the next level, and do so on the cheap, Google Chromecast Audio is the way to go. Thanks for the lead Nick!.

Tuesday, November 08, 2016

Kitchen Renovation 2016 | And We're Done

47 days ago we embarked on a journey: to turn our perfectly usable kitchen and dining room into our dream space. After 13 years in the house, I was convinced we finally knew what we wanted. Well, allow me to take you through that journey in 27 photographs. If I were really together, I'd have setup a time lapse camera to scientifically document the whole experiment. Instead, I simply stood around the same place in the kitchen every day and grabbed a panoramic photo.

I definitely enjoyed working from home during the construction. I'd wander down in my PJ work clothes and chat with the individuals doing the work. I'd marvel at how every aspect of the renovation came together, from ripping up the floor to watching them lay counters. I'm telling you, I saw our kitchen in absolute ruins, with only a plywood sub-floor and various holes punched in the ceiling, and now as I type this, the place looks perfect.