Category Archives: Blog

General thoughts on life, the universe and everything. Stuff that doesn’t fit in the other categories!

New project: Otto

My wife got me a 3D printer for my birthday/Christmas. I’ve printed a few little things since then, but I’ve been itching for a bit of a project. I didn’t want anything too ambitious but, clearly, there’s no point in doing something that can’t fail.

After much searching, I decided upon Otto, a walking, dancing, obstacle avoiding robot.

In this post I’ll talk about how I prepared for the project and my thoughts on its likely success (or otherwise).

The 3D print is bigger than anything I’ve done before but not necessarily any more complex.

3D Printing Otto

The part of the project that I have the least experience with is the electronics. I’ve never really been a “hardware” person, though I built a 68000-based computer while at university. Fortunately Otto uses an off-the-shelf embedded computer called an Arduino so my terrible soldering skills won’t be tested.

What is complex for someone that doesn’t live and breath it, is the Arduino ecosystem. There are a number of different boards (varying both in size and features) and it’s open source so there are quite a few compatible variants available too. I picked a cheap compatible version. I do wonder if this will cause problems further down the line.

The “nano” has few built-in ports, so you need an I/O “shield” that plugs into the Arduino’s pins. That was nearly as expensive as the actual computer!

Finding small volumes of the other components proved a little tricky. Once you factor in delivery, it became almost as cheap to order ten servo motors rather than the four that I really needed. I’m sure I’ll find something to do with the others!

Anyway, I ordered all the bits and pieces that I think I need. It’s entirely possible that some of them are wrong. We’ll see.

Stay tuned for what happens when the components arrive.

Reading 2016

Coming into the beginning of last year I decided I would try to read more books. I do most of my reading on my commute and the previous couple of years I had not had to regularly go to an office, so I managed few books and no novels at all.

While my total of twelve books may not set the world on fire, I managed to read some interesting ones so I thought it might be worth writing a few words on each one.

“How to Fail at Almost Everything and Still Win Big: Kind of the Story of My Life,” Scott Adams

It’s a good thing that I have the ability to compartmentalise things. Some of his recent writing about Trump has not been to my taste but this book is interesting. I’m not big on “self help” books but this one espouses a philosophy I can vaguely get behind. And Adams’ writing is always engaging.

“The Simpsons and Their Mathematical Secrets,” Simon Singh

Not one of Singh’s best but still interesting. As a bunch of short mathematical stories tied together by episodes of the Simpsons (and a few from Futurama), it may be better as a hook to get people interested in science and maths than as a structure. I don’t regret reading it but I will concede that it took me a while to get through (with a few pauses while I read other books).

“I, Partridge: We Need to Talk About Alan,” Alan Partridge

Most books that are TV or movie tie-ins are terrible. I only got this one because it was on sale for £1 and, even then, it took me over a year to get around to reading. I’m happy to report that I was wrong. It’s surprisingly well written, you absolutely get the “voice” of The Alan, and there are some real laugh out loud moments. The sound-track is also spot-on.

“The Kingdom by the Sea,” Paul Theroux

Theroux toured the UK in 1982 when it was the “sick man of Europe,” Margaret Thatcher was just starting out and the Falklands conflict was on-going. It made an interesting contrast with 2016. As ever, it was surprising how much had changed and how much stays the same.

“I Think You’ll Find it’s a Bit More Complicated Than That,” Ben Goldacre

Like Singh’s, this is not Goldacre’s best book but, as a collection of essays, there’s still a lot of good stuff.

“The Language Instinct: The New Science of Language and Mind,” Steven Pinker

Where language comes from, whether it’s biology or nurture or both, is clearly far from a solved problem but this is a fascinating discussion. Accessible for a layman (like me) but quite detailed.

It’s especially interesting right now as my two year old gets increasingly expressive.

“And Another Thing…,” Eoin Colfer

I wrote a full blog about this. In short: it’s really hard to follow Douglas Adams. It’s not that Colfer did a bad job, more that Adams was an impossible act to follow.

“Ready Player One,” Ernest Cline

I heard lots of good things about this and then I learned they were making a movie. I knew a had to read it before I saw the film.

I didn’t get into gaming culture as much as some, so I may have missed some of the references, but what’s there brings back some nostalgia and it’s mixed with a decent story and mostly believable characters.

“How to win friends and influence people,” Dale Carnegie

I spent a lot of time ridiculing this book, mostly for the title if I’m honest – it sounds smarmy.

Then I read it. And, maybe I was wrong.

Like the Pinker book, it’s also fascinating to watch my kids and see the bits they understand purely instinctively. My son, at five, is already better at this stuff than I’ve ever been.

“The Girl with the Dragon Tattoo,” Stieg Larsson

I finished another book, got stranded on the Tube and, lacking anything else to read, started this. I’d seen the movie (both versions) and still couldn’t remember the end.

The writing is not great but it’s still a bit of a page-turner.

“The Bug,” Ellen Ullman

Not as good as I wanted it to be. I think, perhaps, I’d have enjoyed it more if I weren’t a programmer. (I can’t really say much more without giving away some of the plot. And I’m not saying you shouldn’t read it.)

Having said that, it did encourage me to write my first Apple TV app so it wasn’t for nothing.

“Inside the Machine,” Jon Stokes

I remember enjoying the articles about CPU design on Ars Technica that this book is based on. I added it to my Amazon wish list ages ago… and then it went out of print. Last year I found it on Safari Books Online.

The processors it talks about are pretty dated now – the newest are Intel’s Core and IBMs PPC 970 – but what’s important in many ways is the progression from early chips, so it stands up well. At times it feels that Stokes is trying a little too hard to write an academic text book, but I’ve not seen any books that are quite so accessible and detailed.

“Brexit: What the Hell Happens Now?” Ian Dunt

What a depressing year 2016 has been, and Brexit has been a big part of that. If it’s going to be a fixture in our lives for the next few years I figured it was probably a good thing to understand it.

What he writes is pretty convincing, well structured and approachable. Kind of like the exact opposite of the current governments approach to it.

Write to your MP about Brexit!

I’m sick of last years referendum on our membership of the EU being used to justify… pretty much anything. And any criticism is met with “you have to respect the will of the people.”

Well, I’m a person and I don’t think my will is being respected by many politicians and much of the media. The result of the referendum doesn’t say that people are happy with a so-called Hard Brexit, dismantling the NHS or using EU citizens as negotiation pawns.

I don’t write to my MP very often but, especially because of our current lack of an effective opposition, this is the ideal time. My MP said “Now we need to influence best Brexit we can.” I agree, but uncritically voting for Article 50 and the governments haphazard approach isn’t it.

My wife has put together the above graphic. Please feel free to share on Facebook, Twitter, MySpace, Friendster, whatever social media you use. And if you’re willing to mail an actual postcard, please let me know — we have some that we’re willing to share.

February 12: contact form removed due to spam. Feel free to contact me on Twitter

Apple AirPods first thoughts

I got some Bluetooth headphones about a year ago as an experiment. They were cheap but more than lived up to expectations. The lack of wires really is a game changer, albeit a totally #firstworldproblems one.

But they had flaws. When Apple announced their AirPods I was intrigued. Would they fix the problems while keeping the benefits? At ten times more than my old headphones I hoped so.

They arrived only a few hours ago so this isn’t a thorough review but here are my initial thoughts.

Out of the tiny box, first impression is that they case has a surprising heft. Maybe the size makes you expect it to weigh the same as some dental floss but the reality is batteries are heavier than that!

The lid smoothly flips up and the headphones themselves don’t just fall out. Instead they’re held in by magnets and require a gentle tug to extract. Overall the hardware design is understated and thoughtful.

Open the lid and hold next to an iPhone and it pretty much immediately pairs. No pin codes, no janky on-off buttons, no confusing flashing lights or mystery buttons. Even better, the details sync between your devices. It appeared on my iPad and even my pre-Bluetooth 4 MacBook Pro (which doesn’t automatically “see” the AirPods but does connect just by clicking “Connect” in the menu).

The sound from my iPhone is fine. I’m no audiophile — I don’t even play one on TV — but it’s loud and clear. They don’t fall out of your ears, even if you try.

The one area I was skeptical about — Siri rather than real buttons — is still an area for concern. It took me a few attempts to activate it. It seems to require quite a decent jab to activate, which does eliminate the possibility of accidental usage. “Volume up,” “Volume down,” “Pause” and “Resume” all do what you’d expect. Siri even activates correctly on the Mac.

How well it works in practice will have to wait for “real world” testing. What I will say is that the “pause when you take one out of your ear” functionality works as advertised. I love it.

I’ve not reached the end of day one yet but impressions are good. They feel good and Just Work, which sounds like damning with faint praise unless you’ve used other Bluetooth devices.

But it’s going to take a while longer to determine whether they’re worth ten times the price of my old headphones.

This post originally appeared on Medium.

And another another thing…

I can’t make up my mind about “And Another Thing…,” Eoin Colfer’s book, which is the sixth Hitchhikers novel, the first not written by Douglas Adams.

On the one hand I wanted to give it a fair chance, try to judge it on its merits rather than simply as a H2G2 book not by Adams. On the other, it’s clearly not by Douglas Adams. It has the same characters. It’s clearly by someone who is a Hitchhiker fan and some things — like the names of places and things — feel spot on.

But the story itself doesn’t quite work for me. It feels like… just a story. Which is a weird criticism, but bear with me.

Especially later in his career, Adams liked to combine his interest in technology, science and religion in his writing and that is what I think is lacking from “And Another Thing…” It’s not that it’s bad, just that it’s ordinary.

With the caveat that I’ve never written a novel and that there’s a long way from a simple idea to a complete manuscript, I hubristically like to think that I would have taken a different approach.

There could be some fun to be had around the “infinity” of Earths that the Vogons destroyed at the end of “Mostly Harmless.” Because, if an infinite number of Earths have been vaporised, there are still an infinite number left. The concept of “infinity” is bizarre enough to have both truth and humour. There’s definitely some potential playing with Hilbert’s hotel. Can you imagine an infinitely large hotel where all the guests have an ego the size of Zaphod Beeblebrox’s? Or Arthur trying to find a room in a full hotel? Marvin would probably be quite depressed about the whole thing.

Anyway, it’s not a fully baked idea, and it’s certainly not a complete story, but the concept feels more Adamsian than what actually happens in the book. The rest is left as an exercise for the reader…

This post originally appeared on Medium.

Double Trouble

One of the great things about WordPress is the community and the number of great plugins that can do amazing things with little effort.

But all that code, as any good developer will tell you, is a liability. How do you pick a plugin that not only meets your requirements now, but will both continue to do so? WordPress advances. APIs change. Plugins need love too.

Many moons ago I settled upon Flickr Gallery, a plugin that allows you to import Flickr images just by adding a short-code to posts. I thought there was value in keeping all my public photos in one place and, at that time, WordPress had poor media management facilities. The plugin seemed popular and well supported.

Flash forward to 2015 and, well, it doesn’t work. It hasn’t been updated for nearly five years and where I should see pictures I only see blanks.

But I’m a developer. How hard can it be to fix?

Groan! Have I ever said how much I hate web development?

Anyway… two hours later I find that there are not one but two problems. I find this after fixing the first problem in a server running on my local machine but find that it still doesn’t work here.

The first problem is that Flickr now requires SSL access to its API. In code terms, open phpFlickr.php and change the following lines:

 var $rest_endpoint = 'http://api.flickr.com/services/rest/';
 var $upload_endpoint = 'http://api.flickr.com/services/upload/';
 var $replace_endpoint = 'http://api.flickr.com/services/replace/';

To:

 var $rest_endpoint = 'https://api.flickr.com/services/rest/';
 var $upload_endpoint = 'https://api.flickr.com/services/upload/';
 var $replace_endpoint = 'https://api.flickr.com/services/replace/';

I found the cause of the second problem when I realised that none of the flickr code was getting called. It turns out that I have the Jetpack plugin and that also uses the “flickr” shortcode, though the syntax for using it is slightly different.

(I find it odd that there’s no error or warning flagging the conflict. This took far longer to track down than it needed to.)

I tried disabling that option in the Jetpack plugin but that didn’t work. In the end, I added the following code to flickr-gallery.php, just before the “add_shortcode(‘flickr’…” line:

if (shortcode_exists('flickr')) {
    remove_shortcode('flickr');
}

Very much cheating… but it does work.

I’m trying to figure out if there’s a way of distributing the change in a more user-friendly format.