Powered by Perlanet
The Perl Conference (formerly known as YAPC) in Amsterdam is getting closer. Oh, sure, it’s not imminent, but in five months time it will all be over. And there’s a lot to get done in those five months. I’m glad I’m not one of the organisers.
But there is something that I need to get organised over the next couple of months. It looks likely that there will be training courses running before or after the main conference and, assuming that happens, I’d like to be running one of those courses.
Last year, the “Modern Web Development with Perl” course that I ran in Cluj-Napoca seemed to be very successful (it certainly had the most attendees of any course I’ve run alongside a YAPC) and I think that was down to two factors:
I’m not doing to mess with a successful formula, so I’m going to take the same approach this year. Consider this my “what course should I run?” post.
This is how it will work. In this post I’ll make a few suggestions of courses. We can discuss them in the comments and you can add your own suggestions. In a few weeks time, I’ll pull out the most popular suggestions and put it to a public vote. I’ll run the course that gets the most votes.
So what courses could I run?
There are courses that I’ve run many times and that would only need light updating. I have a course on DBIx::Class (I ran that in Granada in 2015), one on Moose and one on testing. I’d be happy to do any of those.
At the LPW last year, I ran a “Modern Perl Update” session which seemed to go down pretty well. I went through the last few Perl releases and explained the new and changed features. It was only a couple of hours long, but I could expand it. Perhaps I could add some stuff about CPAN modules that people don’t seem to know about.
I could re-run the Dancer course from last year. In a day, the class went from nothing to writing a functional and useful Dancer application. Perhaps there’s a big enough audience to do that again.
Or, perhaps, some kind of extension to last year’s course. I don’t mean that you would need to have done the previous course in order to find it useful, but maybe something about integrating Perl web tools with a modern web development toolkit. Using Angular or React as the front end to a Perl backend. Or how about writing APIs in Perl?
I’ll should point out that there are some things that I’m not the right person to teach. Perl 6 is top of that list. Not only have I not had the time to really explore Perl 6 yet, but given that Damian Conway is going to be at the conference and I fully expect him to clean up on the Perl 6 training front.
So there are half a dozen suggestions. What do you think? Are you coming to Amsterdam? Would you (or your company) pay extra for a training course? What course would you like to see?
Let me know your thoughts.
Long-time readers might remember that I once had a bit of an obsession with aggregating web feeds on sites that I called “planets”. I wrote Perlanet to make this job easier and I registered the domain theplanetarium.org to host these planets.
The planets I built were of varying levels of usefulness – but of all of them, planet davorg was the vanity project. It was simply a way to aggregate all the web feeds that I produced. There were feeds from various blogs along with things like Flickr, Twitter and CPAN.
One of the things I liked about planets was that they were self-maintaining. Once you’ve configured a planet, it will just keep on running (well, as long as the cron job is running). If the web feeds they are aggregating have new content, the planet will have new content. And many of the feeds that powered planet davorg were still running.
But last weekend I found a couple of problems with it. Firstly, it looked like it was designed by an idiot. Which, to be fair, it was. Web design was never my strong point. But we have Bootstrap now, so there’s no excuse for web sites to look that bad. So that’s how I spent the first hour or so – slapping a bit of Bootstrap paint onto the site. I think it now looks acceptable.
The second problem was that not all of the feeds were still running some of them (Delicious, for example) were just dead. I can’t remember the last time I posted anything to Delicious – can you? So I spent some time tweaking and fixing the feeds (replacing CPAN with MetaCPAN, for example). Most of this was easy.
However, one feed was a problem. My Last.fm feed was dead. For over ten years I’ve been “scrobbling” ever song I’ve listened to and one of the feeds I was aggregating was that list. According to this page on their web site, my feed is supposed to be at http://ws.audioscrobbler.com/1.0/user/davorg/recenttracks.rss – and that was the URL in my Perlanet configuration. But it doesn’t work. It returns a 404 error.
I tried to contact someone at Last.fm to find out what was going on, but I haven’t got any kind of response. It looks like they’ve been running on a skeleton staff since CBS took them over and they don’t seem to have the time to support their users (not, I suspect, a recipe for long-term success!)
But there was one possibility. You can get the same data through their API. And some quick experimentation, revealed that their API hasn’t been turned off.
And CPAN has Net::LastFM which will make the API calls for me. Ok, so it hasn’t been updated since 2009, but it still works (I’ve just noticed that there’s also Net::LastFMAPI which is a little more recent).
So it just took a small amount of work to write a little program which grabs uses the Last.fm API to get some JSON that contains the information that I want and convert it to an Atom feed. In case this is useful to anyone else, I’ve put the code on Github. Please let me know if you do anything interesting with it.
And if anyone from Last.fm reads this. Please either turn the web feeds back on or remove the documentation that still claims they exist.
In 2011, the BBC started repeating old episodes of Top of the Pops. Initially, they were showing one episode a week, as close as possible to thirty-five years after the original broadcast (starting with shows from 1976). More recently, they’ve been showing two episodes a week, so we’re currently in early 1983.
I’ve been watching them avidly since they started, but I’ve been even more interested in watching them over the last year or so – since the repeats hit October 1981. That’s because that’s when I moved to London to go to university and I started to watch fewer and fewer episodes as I, increasingly, had better ways to spend my Thursday evenings. So I’m seeing many of these broadcasts for the first time.
Over the summer of 1982 I pretty much stopped watching completely. I managed to get myself elected as Social Secretary at City University and many of my evenings were spent running gigs, discos and various other entertainments for the students.
I’ve written before about a couple of things that happened while I was Social Secretary (here’s me being threatened by the lead singer of Bad Manners and here I am booking Marillion at the start of their first major tour) but recent episodes of Top of the Pops have reminded me of a few other incidents.
There was the time that I was mildly censured by the London Student newspaper because I had booked Toto Coelo for a Christmas Party. Or the time I booked the Hee Bee Gee Bees (featuring Angus Deayton and Philip Pope) and ended up inviting Philip Pope back to a hall of residence party.
A few recent episodes of Top of the Pops have featured Blue Zoo singing “Cry Boy Cry”. I’m not sure I realised what a big hit that was. They played a few gigs at the university – including a “Blue Party Night” at a hall of residence where I painted my face blue, using dye that took days to get out. And I’m pretty sure that they were the band I cancelled when I was offered the Marillion date I mentioned above.
But a recent Top of the Pops reminded me of the biggest mistake I made while I was Social Secretary. I turned down the chance to book Culture Club.
To be fair to myself, no-one had heard of them when I was offered them. Well, no-one who wasn’t really in tune with the London music scene. Of course, you could say that someone who was running entertainment for a London university should really be in touch with the music scene. And I’d have no answer to that.
But when their agent called to offer me the gig, I hadn’t heard of them.
They were just about to start a tour and wanted somewhere to play a warm-up gig. Back then (and, I suppose, it’s still true now) bands used to like using student unions for warm-up gigs. Student unions were like private clubs – you couldn’t get in without a union card. Acts could get their performances right without making fools of themselves in front of the general public. That was how most student unions got most of their decent acts.
So Culture Club’s agent called me and offered me a warm-up gig for their first national tour. And I turned them down because I had never heard of them.
I thought that was the last I would hear of it. But I was wrong. A few months later, at the end of October 1982, they made their first appearance on Top of the Pops. I think this is it (warning, a few seconds of Jimmy Savile at the start of this clip).
Of course, these days we’re all used to seeing Boy George on the telly. But in 1982, this wasn’t the case. It was a sensation. He was all over the tabloid front pages the following day. People talked about it for weeks. Instantly, everyone knew who Culture Club were.
Oh, and the date that I had been offered for the warm-up gig – it was, of course, the day after this Top of the Pops. If I had taken the booking, it would have been a great night. I would have looked like someone who really had his finger on the pulse of the music scene.
Instead, I’m the man who turned down Culture Club.
 Although looking at the dates, it seems more likely that this was during the previous year – when I was just a member of the entertainments committee.
It’s far too long since I’ve posted anything here. I’ve no excuse really. Following the end of my contract in Canary Wharf, I was off work for seven weeks. OK, I was on holiday for two of those weeks, but that still leaves five weeks when I could have been doing something constructive, but actually just spent a lot of time watching Netflix.
But there were a couple of things I did. Neither of them took more than a few hours, but I thought it was worth writing them up – if only to give an example of a couple of really useful (to me, at least) things that I was able to build really quickly with Perl.
If you were a music fan in the 1990s, then there’s a good chance that you own at least one album released on Cooking Vinyl Records. At times, it seemed like pretty much every album I bought was released by them. Back in 2005, I wrote a blog post where I tried to explain how much they meant to me.
In particular, they produced a series of compilation albums that introduced me to so many of my favourite acts. Ten years ago, I tried to find a definitive list of all of the songs and artists which appeared on those compilation albums. As I failed to find one, I created it myself. At the time, it was a static list of albums which listed the tracks and artists on each of the albums. For ten years I’ve had it in the back of my head to do something more interesting with the data. A few weeks ago, I finally got round to it.
As I said, the original page just had a list of albums with artists and song titles. That’s useful, but it would be more interesting to be able to cross-reference the data in various ways – list all of the albums that an artist appeared on, for example. And for that, we need a database.
If you’ve come on any of my database training course over the last ten years, you’ll know that I use a CD database example. The model that I use is pretty simple and, in particular, it assumes that all tracks on a given CD are by the same artist. As I say in the class “various artists compilations don’t exist in this simplified universe”. Obviously, that’s not going to work in this example. So I needed to come up with another database model.
Here’s the data model I designed. You’ll see that it all hinges on the track table. A track is an instance of a particular song, recorded by a particular album appearing on a particular album. The only extra data on the track table is the “number” column which allows us to declare the order in which tracks appear on an album.
Advanced students will have spotted an omission from the data model. An artist might well have different versions of a song. There could be the original version, an edited single version and many live or remixed versions. So actually, we could add a “recording” table and it’s the recording that appears on an album. That’s, perhaps, an enhancement for the future.
Having designed the database the rest of the code just falls out really. I already had a data file so it was just a case of parsing that and inserting the data into an SQLite database. DBIx:Class (and, particularly the find_or_create method) makes this trivial. I then wrote another program that generated the web site using the Template Toolkit. Nothing complex there at all.
Why not have a look. And check out some Cooking Vinyl recordings.
I’ve lived in London for thirty-five years. And in all that time I have never seen Tower Bridge opening. Oh, I’ve seen it when it’s open, but I’ve never been in the right place at the right time to see it actually opening. As a Londoner, that’s a matter of supreme embarrassment to me.
But the office I’m working in currently is three minutes walk from Tower Bridge. All I need is a way to get a notification a few minutes before the bridge lifts. Surely, there must be a way to get that?
Sadly, no. The Tower Bridge web site has a page listing the upcoming lifts, but no service that would send any kind of notification. So, once again, it was up to me to provide one. I asked the London Perl Mongers on IRC what would be a good way to get notifications of upcoming events on an Android phone and Ilmari pointed out that the obvious method was to create a calendar that could be read by the calendar app on my phone.
So that’s what I’ve done. I use Web::Query to scrape the data from the Tower Bridge web site (doing some over-complicated madness to account for the fact that they are missing the year from their dates) and then create a .ics file using Date::ICal and Data::ICal. I also create a JSON version of the data in case it’s useful to anyone (if it is, please let me know).
So, there you are. Two (hopefully) little projects that I threw togther in a very small amount of time using the power of Perl. Please let me know if you find either of them useful.
Time for my traditional round-up of the gigs I saw in the previous year.
According to Songkick, I saw 39 gigs in 2016. That’s the lowest number since 2012 (when I saw 36 – but had the excuse that my leg was in plaster for six weeks and I didn’t get out much).
Let’s start with the disappointments. I left two gigs at the interval. I had wanted to see Marc Almond for a long time, but when it finally happened it was all just too torch song for my tastes. I’m told the second half was much better.
Then there was Barclay James Harvest (or rather, John Lees’ Barclay James Harvest – the two surviving members of BJH both have their own touring version of the band). Sometimes going to see an act for the first time for thirty-five years isn’t a good idea. They just didn’t hold my interest the way they did back in the early 80s. When they took an early interval (after only half an hour on stage) I ducked out. I hope the second half was longer.
I didn’t leave, but I thought the Björk show at the Hammersmith Odeon was pretty disappointing too. I think I’m in a minority there though.
I only saw two bands twice – Sunflower Bean and the Magnetic North. And this might be the first year in living memory that I didn’t see any members of the Carthy clan playing.
I ticked off four more acts in my “acts from my youth that I never got round to seeing” list – Toyah, ELO, ABC and the Human League. I already have a ticket to see ABC again.
Usually, Amanda Palmer gets a free pass onto the top ten list, but in 2016 I only saw her as a special guest at a Jherek Bischoff show that didn’t quite make the cut.
Here, in chronological order, are the ten best gigs I saw in 2016.
I’ve just deleted Marianne Faithful and The Staves from this list as it was too long. Other shows bubbling outside the top ten include Barenaked Ladies, St. Etienne and Hannah Peel. It’s mark of the quality of the shows I’ve seen this year that I haven’t found space for Savages, Pixies or Billy Bragg.
And let’s spare a thought for acts we’ll never see performing again. I will alway regret never seeing Prince live and it’s over twenty years since I saw David Bowie play. But of all the talented musicians who died in 2016 I think it’s the two Leonard Cohen shows I saw (in 1993 and 2013) that I will treasure the most.
There are “year in gigs” posts for every year since 2011.
Last week I mentioned how I had uploaded a new version of Symbol::Approx::Sub. Because there were pretty major changes to the inner workings of the module (although the interface still looked the same) I decided that I would move it from version 2.07 to version 3. At the same time, I decided that I would switch to a semantic versioning scheme.
Later in the week, I released minor updates to a few more of my modules. And I decided to apply semantic versioning to those as well. But as I was only making minor packaging fixes to these modules, I didn’t increment the major version number. For example, Array::Compare went from 12.2 to 12.2.1.
It turns out that was a mistake.
Well, I don’t really think it was a mistake. I think it was the right thing to do. But it appears that my opinion is at odds with what some parts of the Perl toolchain think.
Last night I got this bug report. It seems that by switching to three-part semantic versions, the version number can (in some quite common circumstances) appear to decrease.
To my mind, a version number is a dot-separated sequence of numbers. So 12.2 is smaller than 12.2.1. Any sane version number comparison will separate the two strings on dots and compare the individual components. Any missing components (12.2 is, for example, one component shorter than 12.2.1) should be assumed to be zero.
But that’s not what the Perl toolchain does. Observe:
$ perl -Mversion -E"say version->parse('2.12')->normal" v2.120.0 $ perl -Mversion -E"say version->parse('2.12.1')->normal" v2.12.1 $ perl -Mversion -E"say version->parse('2.12') <=> version->parse('2.12.1')" 1
When the version number with two components (2.12) is split into components, the second component is bizarrely treated as a three-digit number so it becomes 12o instead of 12 and when it is compared with the second component of the three-component version, 120 is obviously larger than 12 and any tool which relies on this behaviour to work out which version of a module is the most recent will get the wrong answer.
This leads to other “interesting” effects. In my head, versions 1.1, 1.01 and 1.001 are all the same version. The leading zeroes mean nothing. But under this scheme, they are very different version numbers.
I know that versioning isn’t as easy as it should be and I know that some people use bizarre versioning systems. And I’m pretty sure that no matter how bizarre a versioning system is, you’ll almost certainly find an example of it on CPAN. So I suppose that this behaviour was a “least worse” scenario that was chosen to make the most sense given CPAN’s wide range of versioning schemes.
Personally, I see it as a bug in version.pm. But I’m not going to report it as such as I’m sure the Perl toolchain gang know what they’re doing and have very good reasons for adopting this seemingly broken behaviour.
I just need to remember to be more careful when switching my modules to semantic versioning. Using a minor or patch level version change when switching to semantic versioning is likely to lead to confusion and bug reports. Only a major level change (as I did with Symbol::Approx::Sub) is guaranteed to work.
And, I suppose, I’ll need to release Array::Compare 3.0.0 to CPAN pretty soon.