Terence Eden. He has a beard and is smiling.

Terence Eden’s Blog

Theme Switcher:

Screenscraping Album Artwork From The Linux Command Line

· 9 comments · 950 words · Viewed ~4,918 times


Cover art for The Beatles' Sgt Pepper Album.

Like many people, I've collected a fair number of CDs over the years. As hard-drives and MicroSD cards have got larger and cheaper, I've gradually been ripping them to FLAC. Most CD rippers automatically tag the music files with the correct metadata and, nowadays, they will also download and embed album artwork as well. (As an aside, it always boggled my mind that CDs don't come with metadata…

Aggressively Defensive Programming

· 3 comments · 1,500 words · Viewed ~608 times


How much checking do we perform that our code is running as intended? I found a curious bug this weekend, which made me think about some of the assumptions that we use when programming. Imagine sorting an array using JavaScript. var arr = [10, 5, 66, 8, 1, 3]; arr.sort(); So far, so normal. Create an array of numbers, then sort that array. The result should always be [1, 3, 5, 8, 10, 66]. …

Use DRAKON to Generate Code from Flowcharts

· 850 words · Viewed ~17,633 times


It's 1986. You're working on the Russian's Buran space programme - trying to create a re-usable space vehicle which will exceed the capabilities of the American's "Space Shuttle". There's a problem. You have very complicated real-time algorithms which you need to review, improve, optimise, and then turn into code. How do you do it? Obviously, you invent DRAKON! ДРАКОН, "dragon" Backronym for…

The Python Pals Program A Problem

· 12 comments · 1,900 words · Viewed ~1,301 times


As mentioned earlier, I've been inspired by the Byte Brothers to create a mystery story which kids have to solve using their l33t h4x0r skillz in Python. This is loosely based on The Byte Brothers Go to a Getaway, by Lois and Floyd McCoy. My well-thumbed copy was printed in 1984. I'm not sure when I got it, but I remember being around 8 or 9 when I first started writing programs in BASIC. …

API Design is UI for Developers

· 20 comments · 1,250 words · Viewed ~23,451 times


Scrap of JSON which doesn't say much.

I've been thinking a lot about APIs and their design recently. I stumbled on this fantastic quote from Greg Parker: Greg Parker@gparkerA programming language is a user interface for developers. Language authors should learn from HCI principles.❤️ 41💬 6🔁 019:10 - Wed 22 February 2012 When I first started learning C++ (back in the bad old days) I was convinced that any 1st year student could desi…

Getting Images from a Foursquare Checkin

· 500 words · Viewed ~1,489 times


Photo of a MacBook. The decal sticker is of Iron Man. His hand blaster is replaced with the Apple logo.

"Oi!" shouted Whatleydude, "Get Dabr to show images from foursquare checkins!" "Righty-ho sir!" I said. I started coding furiously. Of course, things are never quite as simple as I first thought.... So, how do we go from http://4sq.com/fgIWov to 1 Expand the URL Get your Bit.ly API Key. http://api.bitly.com/v3/expand ?shortUrl=http://4sq.com/fgIWov &login=YOUR_BIT_LY_USERNAME …

Twitpic OAuth - I'm Stuck

· 13 comments · 300 words · Viewed ~3,313 times


Logo of TwitPic.

Twitpic has implemented an OAuth API. No more having to hand out passwords to all and sundy. Only I'm too much of a dunderhead to get it working. Perhaps it's a combination of heatstroke or this rotten head-cold, but I just can't see what I'm doing wrong. Any help much appreciated. The easy bit. It's easy to post the data to Twitpic $media_data = array( 'media' =>…