London Perl Workshop Report

Lightning Talks Preparation at the LPW 2017

(Photo above by Chris Jack)

Last Saturday was the annual London Perl Workshop. I should write up what happened before I forget it all.

I arrived at about 8:30 in the morning and was able to check in quickly – collecting a bit of swag which included a free t-shirt as I was a speaker. I then made my way up to the main lecture theatre in order to see Katherine Spice welcoming people to the day on behalf of the new team of organisers. After that headed off to the smaller lecture theatre to set up for my tutorial. There were a few differences from previous years. Firstly, I was giving a completely Perl-free tutorial (about on-page SEO techniques) and secondly, I had been moved out of the tutorial track and into one of the main talk tracks. As a side effect of that second change, I was also asked to trim my talk from my usual two hours to a more “talk-like” eighty minutes.

The talk seemed to go well. I got some interesting questions and a few people came up to me later in the day to tell me they had found it interesting useful (sometimes both!) The slides to the talk are available on SlideShare: Web Site Tune-Up – Improve Your Googlejuice.

Following that, I had time to see one talk before the coffee break and I chose Why learning a bit of Crypto is good for you‎ by Colin Newell. Colin gave a good (if, necessarily rather shallow) explanation of how learning a small amount of cryptography can help you improve the security of your systems.

Then it was was the morning coffee break. For the past few years, this break has traditionally included cakes which were supplied by a sponsor. When that didn’t look like happening this year, organiser Neil Bowers (with a gentle nudge from Leon Timmermans) came up with the idea of a community bake. And that’s what happened. A number of attendees baked cakes for us all. I had one of Neil’s blueberry muffins and it was lovely.

There was a slight change in the schedule after the coffee break. Matt Trout was unable to be at the workshop so, at the last minute, JJ Allen stepped in and gave his talk To delete or not to delete, that is the question‎, which was about some impending data protection laws which will affect all businesses. I stayed in the same room to see Neil Bowers explain The PAUSE Operating Model‎ and then JJ returned to talk about something completely different – Perl and Docker, sitting in a tree‎.  JJ’s company, Opus VL, have released some of their Docker infrastructure code to CPAN and I’m sure many people will find it useful.

Then it was lunchtime. I bought a sandwich from the university’s cafe and sat in the foyer talking to various friends who walked past.

I started the afternoon watching Paul Evans on ‎Devel::MAT updated‎. Devel::MAT is a development tool which aims to do for memory analysis what Devel::NYTProf does for profiling. It looks very useful. That was followed by Julien Fieggehenn’s talk Turning humans into developers with Perl‎. Julien doesn’t just train people in Perl, he acts as a mentor for them for a couple of months when they join his company, so he was able to talk in some detail about much wider issues than just choosing which topics to cover in a training course.

Talking about wider issues, I then saw Tom Hukins’ talk Development: More than Writing Code?‎ Tom is, of course, right that there’s more to being a good developer than just writing good code. This is a topic that I’m thinking of developing a training course on. Tom was followed by Paul Johnson giving good advice on Modernising A Legacy Perl Application.

The afternoon coffee break included some professionally baked pastries. They were also lovely, but don’t think they were appreciated quite as much as the morning’s community versions.

After the coffee break, we all gathered in the main lecture theatre for the plenary session. Ann Barcomb spoke about Fifteen Years of Contributing Casually‎. Ann was once a Perl developer. I first met her at the first YAPC::Europe in London in 2000 and she was then part of the organising team for the second YAPC::Europe in Amsterdam in 2001. But since then she has become a researcher into the sociology of the open source movement. You can read a lot of her research on her web site. Her talk illustrated her findings with some personal anecdotes about her own casual contributions to the Perl community. Everyone seemed to find it fascinating and the Q&A at the end of the talk showed every signs of turning into a full-scale discussion. On a personal level, it was great to catch up with Ann again about fifteen years after we had been in the same room together.

And then there were the lightning talks. They were their usual mixture of intriguing and entertaining. Mark Keating (enjoying his first LPW that he wasn’t organising) implored us to get involved in the Enlightened Perl Organisation. I announced a plan to publish more Perl books (of which, more later). I was particularly impressed by Kenichi Ishigaki who flew in from Japan just to give a lightning talk about his module Perl::PrereqScanner::NotQuiteLite.

After that, there were a few closing words from Neil Bowers and, in another innovation brought in by the new organisers, drinks were served on site rather than in a local pub. Of course, some people went off to a local pub after that as well.

As always, it was a great day. The new organising team seem to have hit the ground running and produced an impressive workshop. My thanks to the organisers, the volunteers, the speakers, the sponsors and all of the attendees.

I’m already looking forward to next year’s workshop.

London Perl Workshop Klaxon

The London Perl Workshop is looking frighteningly imminent. It’s on November 25th – that’s less than three weeks away. All across the capital (and even further afield) if you listen hard you will hear the sounds of speakers frantically trying to get their talks ready.

That, at least, is how I have spent my weekend. I’m presenting a new training course at the workshop and I’ve been working hard on the slides for the last couple of days.

This new course is a bit of an experiment for me. It’s a completely Perl-free session. For most of this year, I’ve been working for a well-known property portal and the work I’ve been doing for them has concentrated on search engine optimisation and I’m going to take this opportunity to share some of my new-found knowledge with a room full of people.

I know what you’re thinking. SEO is either a) really dull keyword research or b) snake-oil. To be fair, I’ve seen both of those things, but that’s not what I’m going to be covering. I’d hate to be seen as either boring or a snake-oil salesman!

No, I’m going to be covering something that I think is far more interesting. The course will be all about making your web site more attractive to Google. And if Google likes your web site, they will crawl your site more often, extract more useful information from it and (hopefully) show your site in response to more user search queries. Getting your site to appear in more search results means more visitors and more visitors means a more successful web site.

I won’t be covering anything complicated. There’s nothing that you won’t be able to implement in a couple of hours. Anyone could use these techniques – but the point is that most people don’t. That’s why they work.

The schedule hasn’t been published yet, so I don’t know when I’ll be giving the talk, but I expect to have that information in the next few days. I do know that my slot is 80 minutes – that’s because the organisers have received a large number of high-quality proposals, so we all have to squeeze up a bit to fit in as many of them as possible.

The London Perl Workshop is one of my favourite conferences. The range of talks is always great. And it seems that this year’s workshop (which has a new organising team) is going to be no exception.

Hope to see some of you on 25th November.

Drawing Traffic Lights With Perl

Traffic Lights

For a thing (that you may hear more about at some point in the future) I needed diagrams of traffic lights. But Google Image Search didn’t really have what I was looking for. Everything was either too realistic or not CC-licensed so I could use the images how I wanted.

So I decided to do it myself. But I’m not exactly artistic. I far prefer it when I can get computers to draw images for me. I’ve dabbled with SVG before and it seemed like the perfect tool for the job. And there’s a module from CPAN that makes it simple to create SVG images from Perl.

It only took an hour or so before I was drawing images like the one above – which was exactly what I was looking for.

Initially, I shared my code as a Gist, but since then I’ve extracted the useful bits into a module which I’ve uploaded to CPAN as SVG::TrafficLight. I’ve tried to make it as configurable as possible, so you should be able to use it for all your traffic light drawing needs as well.

Starting to use it is pretty simple.

The default sequence of lights shows the UK’s standard traffic light sequence (green,  amber, red, red and amber, green) but it’s simple enough to produce a different sequence (even one that you would never see on the roads).

If you read the documentation, you’ll see how you can customise pretty much anything in the diagram – the size of the lights, the padding between them, even the colours used.

Let me know if you find it all at useful. SVG is fun. I’ll think I’ll investigate it some more.

 

I Wrote Some Perl

Ok, yes, I’ve been writing Perl for over twenty years. But Perl 5.26 was released this week and for the first time, my name is mentioned in the release notes. Because I have not one, but two fixes in this release of Perl.

The first is this commit which fixes a piece of documentation to make it clear that grep() returns a list, not an array.

The second is this commit which fixes some sample code so that it runs without warnings under use strict.

It’s a small start, I admit, but I have a taste for it now. In a years time, I hope to report that I have more than two commits in Perl 5.28.

And you can help too. Instructions on how to contribute are in the perlhack manual page. There is more information in perlhacktips and perlhacktut.

The people working on Perl all do a great job. But it’s a hard job and it might just get a little easier if more of us helped out.

Two Weekend Projects

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.

Cooking Vinyl

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.

Compilation album data model
Compilation album data 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.

The site is at http://cookingvinyl.dave.org.uk/. And all of the code is on Github. It could do with being made a bit prettier – perhaps I can add some pictures.

Why not have a look. And check out some Cooking Vinyl recordings.

Tower Bridge

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).

The site is at http://towerbridge.dave.org.uk/ and (of course) the code is on Github.


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.