author: Jo Walton
name: David
average rating: 3.95
book published: 2007
rating: 0
read at:
date added: 2017/09/18
shelves: currently-reading

Dave Cross posted a photo:

Rottingdean Beach Huts

via Instagram ift.tt/2yeyrsZ

Dave Cross posted a photo:

I'm in Brighton

via Instagram ift.tt/2y34YkU

Dave Cross posted a photo:

Pigeons at the Pavilion

via Instagram ift.tt/2xp33KF

Sep 12, 2017

If you read yesterday’s post about my Mail Rail trip, you’ll remember that my slight quibble with the experience was that there weren’t any maps showing the route that the tour takes.

Well, I’ve found one. And I think it explains why they don’t shout about the route.

I was Googling for any maps of the whole Mail Rail system when I came across this blog post from 2013 where John Bull examined the documents that made up the planning request that the British Postal Museum and Archive had submitted to Islington Council. For real document buffs, the blog post included a link to the original planning request.

But, for me, the interesting part is the diagram I’ve included at the top of this post. It’s a map of the intended route. And it ties in well with the tour I took on Saturday, so I’m going to assume there were no changes in the four years between the planning request and the exhibit opening.

The Mail Rail exhibit is the coloured sections. The Postal Museum is on the other side of the road in the Calthorpe House. The bit in green is the entrance hall and gift shop and the blue bit is where you queue and board the train.

And the pink shows the route that the train takes. You can see it doesn’t go very far. In fact, it doesn’t make it out of the Mount Pleasant complex. It goes from the depot, takes a sharp turn to the right and pulls into the south-east Mount Pleasant platform. That’s where you see the first multi-media presentation. Once it pulls out of that station, the train comes off of the main tracks and takes a maintenance loop which brings it back into the same station but on the north-west platform where it stops for the second multi-media presentation. After that, it returns to the depot where the passengers alight.

So, all-in-all, you don’t get to see much of the system at all. I knew that you wouldn’t go far, but I’m a little surprised that you don’t get any further than Mount Pleasant station. And that, I expect, is why they don’t publicise the route.

To be clear, I still think it’s well worth a visit. And it’s great to see such an interesting part of London’s communication infrastructure open to the public.

But I really hope that in the future, more of the system can be opened up – even if it’s just for occasional trips for enthusiasts. I know I’d be first in line for a ticket.

The post Mail Rail Map appeared first on Davblog.

Dave Cross posted a photo:

Posters at the Postal Museum

via Instagram ift.tt/2wVjrQO

Sep 10, 2017
davorg merged pull request davorg/app-aphra#1
Fix typo
1 commit with 1 addition and 1 deletion
Sep 10, 2017

I rode the Mail Rail yesterday. It was very exciting. More about that in a minute. Before that, I went to the Postal Museum.

I’ve often thought that the UK needed a museum about the Post Office. And the new (well, newish – it’s been open a couple of months) Postal Museum is a really good start.

Most of the museum is a pretty standard chronological look at the postal service in the UK. There are exhibits telling the story of the service from its earliest incarnation five hundred years ago. It’s interesting and the displays are well-designed but I couldn’t help thinking it was all a bit simplified. There were many places where I would have welcomed a deeper investigation. Mind you, I find myself thinking that in many modern museums, so perhaps the problem is with me.

Towards the end of the museum is a small cinema area where they show various short films associated with the Post Office (yes, this includes Night Mail). I could have sat there watching all of them – but I didn’ t have the time. And I think they missed a trick by not selling a DVD of the films in the gift shop.

The Postal Museum is well worth a visit. It’s not as big as I thought it would be. We went round it all in about 45 minutes.

But the reason I left it a couple a months to visit the Postal Museum was because it was only this weekend that the other nearby attraction, the Mail Rail, finally opened to the public.

The Mail Rail is an underground railway system which, between 1927 and 2003 was used to transport post around London. I remember hearing about it soon after I first moved to London and I’ve been fascinated by it ever since.

And last week it opened as a visitor attraction. New carriages have been installed which are (only just) more comfortable for people to sit in and you can take a 20 minute guided tour of the line. Well, it’s 20 minutes if you include the time the train is sitting in the platform as you all board.

I enjoyed the ride. To be honest, I would have been happy just riding around the tunnels for 20 minutes, but there are a couple of points where you stop and are shown a multi-media presentation about the system and the postal service. A lot of time and money has been spent on them and they were really enjoyable (if not particularly informative).

As you leave the platform at the end of your ride, you pass though an interesting exhibition on the history of the system.

If I had one suggestion for improvement, I would like to have seen a map of the system with the bits that the tour covers marked. I suspect that you don’t actually get out of the bits of the system under Mount Pleasant sorting office. [Update: I found a map. See here for details.]

I recommend a visit. I’ll be returning at some point in the future to see it again.

Here’s a video I took of my tour.

The post Riding the Mail Rail appeared first on Davblog.

Dave Cross posted a photo:

This Afternoon's Project (After)

via Instagram ift.tt/2wh1fis

Sep 6, 2017
Sep 6, 2017

I have a few ideas for static web sites that I want to build. And, currently, the best place to host static web sites is, in my opinion, Github Pages.

And if you’re hosting a site on Github Pages, everyone knows that the best tool to use is Jekyll. Or is it?

I’ve tried to use Jekyll a couple of times and it just confused me. Something about the way it works just doesn’t fit into my head in some way. I’m not sure what it is, but every time I change something, it all breaks completely. I’m sure the problem is with me rather than the software. Everyone else seems to get on with it just fine.

So, anyway, when faced with a problem like that I did what any self-respecting geek would do. I wrote my own tool to solve the problem.

And, of course, I wrote it in Perl (because that’s what I know best) and I used the Template Toolkit (because, well, why wouldn’t I). And because I wrote it to reflect the way that I think about building static web sites, I understand how it works.

To be honest, how it works is pretty simple so far. It takes a bunch of files in an input directory, processes them using the Template Toolkit and writes them into a mirror directory structure under an output directory. So far, not so different to tttree (the tool that comes with the Template Toolkit), but there’s one little improvement that I’m finding very useful.

I like writing text using Markdown. And I thought that it would be great to write text in Markdown, but have it pre-processed to HTML before passing it through the Template Toolkit. A couple of months ago I released Template::Provider::Pandoc which does just that (actually, it does a lot more than that – it will convert between any two text formats that are supported by Pandoc.

And my new site builder software used Template::Provider::Pandoc to process all of the templates in the site. You don’t really want to be using Markdown for the main layout of your site – Markdown is rubbish for building navbars, footers or image carousels – but when I have a large amount of text, I can [% INCLUDE %] a template which includes that text in Markdown, knowing that it will be converted to HTML before being included in the page.

I’ve called the software aphra (for reasons that I’ll get to in a minute). There’s an early version on CPAN and the code is, of course, on Github too.

If you want to try it out, the best documentation, currently, is in the command line tool, aphra, that comes with the distribution.

What about that name?

Yes, it’s a strange name.

When I first realised I’d be writing something like Jekyll, I wanted to call it Hyde. I wanted to be able to say that it was uglier and more powerful than Jekyll. But there’s already a Python sitebuilder called that. Then I considered Utterson (he’s Henry Jekyll’s friend in the novel) but that had been taken too.

So I abandoned the idea of using the name of a character from The Strange Case of Dr Jekyll and Mr Hyde and started looking elsewhere.

I first came across Aphra Behn when I read Philip José Farmer‘s Riverworld books about thirty years ago and she has stuck with me ever since. [I should point out for people who haven’t read Farmer’s books that he takes real historical characters, like Behn, and drops them into a science fiction environment.]

Behn was a British writer who wrote novels, plays and poetry in the second half of the seventeenth century. At a time when women simply didn’t do those things, it just didn’t seem to occur to her that she shouldn’t. She was a great role model to many of the great women writers of the following centuries.

Oh, and she was a spy too, during the Second Anglo-Dutch War.

All in all, she was an inspirational woman who deserves wider recognition. And I hope that, in some small way, that my software will raise her profile.

What’s next?

So now I have my tool, it’s time to start creating the web sites that I wanted. I hope to have some news on those for you in a few weeks.

Or, perhaps, I’ll get bogged down creating a web site for Aphra. I’ve just registered a domain name…

The post Yak Shaving with Aphra Behn appeared first on Perl Hacks.

If you ever read my (mostly dead) more general blog, you might know that I’m a bit of an amateur genealogist. I’ve been tracing my family for over twenty-five years and I’ve got some branches of it back to the 1700s (actually, I have one branch back to the late 1600s).

One problem in genealogy is how to present data in a readable and easily-understandable way. Family trees are messy things. Both the roots and the branches can get very tangled. A good way to cut through all of that is to ignore unnecessary branches and just show the ancestors of a given person on the tree.

And that’s what the image at the top of this post shows. In the right-hand side of the image, halfway down, you will see Prince George of Cambridge (ok actually, you’ll see “Princ”, that’s a bug that I need to fix – it works when someone’s lifespan is long enough to fit their name in!) Above and below him (at a quarter and three-quarters of the way down the page) you’ll see his parents. And so on back through time until on the left of the page you’ll see his great, great, grandparents – most of whom were born back in the nineteenth century.

It’s all created with a Perl program, of course. I’ve just uploaded SVG::Timeline::Genealogy to CPAN (it should be there at some point later today) and that can be used to draw these diagrams.

The module is very similar to SVG::Timeline which I wrote about a couple of weeks ago. And that’s completely unsurprising as it’s a sub-class of that module. Interestingly, early drafts of this module pre-date SVG::Timeline, but I recently realised that it should be a sub-class so I spent yesterday re-implementing it (and making more than a few changes to SVG::Timeline as some idiot had made it hard to sub-class!)

There are two ways to use the module. The hard way involves writing your own code:

use SVG::Timeline::Genealogy;

my $tree = SVG::Timeline::Genealogy->new;

  ahnen => 1,
  text => 'Joe Bloggs',
  start => 2000,

  ahnen => 2,
  text => 'Mr Bloggs',
  start => 1975,
  end => 2005,

  ahnen => 3,
  text => 'Joe Bloggs',
  start => 1975,

print $tree->draw;

The easy way involves putting the information in a data file and using the treeline program that is included in the distribution.

$ cat bloggs.dat
1   Joe Bloggs  2000
2   Mr Bloggs    1975    2005
3   Mrs Bloggs  1975
$ treeline bloggs.dat > bloggs.svg

The fields in the data are separated by tabs.

The important bit to get right is the “ahnen” attribute. “Ahnen” is short for “Ahnentafel Number” and it’s a concept that is common in genealogy. You take a person in your family tree (say you for example) and give that person a number of 1. Your father then has a number of 2 and your mother is 3. Carry on with that scheme through the generations. You paternal grandparents are 4 and 5, your maternal grandparents are 6 and 7… and so on.

These numbers have a couple of interesting properties. Firstly, if a person has an Ahnentafel Number of $x, then their parents are 2 * $x and 2 * $x + 1. Secondly, with the exception of person 1 (who can obviously be of either sex) all the men have even numbered Ahnentafel Numbers and the women all have odd numbers.

It is therefore these numbers that allow us to convert a flat data file into a tree structure. They tie the records together in the correct order. If you want to know more, I have a module called Genealogy::Ahnentafel which allows you to manipulate these numbers in various ways.

So that’s, SVG::Timeline::Genealogy. Hope you find it useful. Please share any interesting genealogies that you find.

The post Genealogical Timelines in Perl and SVG appeared first on Perl Hacks.

Two weeks ago, I introduced you to my new module SVG::TrafficLight and hinted that there were more SVG-based modules to follow. Today, I’d like to talk about the next one – SVG::Timeline.

It all started over a year ago when I was looking through some of the more ridiculous religious questions on Quora when I came across one asking why Adam wasn’t mentioned in the Bible after the first couple of books in Genesis. As part of my answer I wanted to illustrate just how long a time Genesis 5 covers.

I knew that SVG would be the best approach and it only took half an hour or so to whip up the image you can see in my answer (and there’s a newer version, generated with the current version of the code, at the top of this page). It’s important to note that  I didn’t hand-craft SVG that drew the diagram – I wrote code that generated the diagram from an input file.

I then realised that this could be a more generally useful tool, so I set about making the code more generic. It languished on Github for a year or so before I decided it was useful enough to clean it up and release it to CPAN. Let’s take a quick look at how it works.

As you can see from the example above, a timeline is made up of a number of events. An event has a start date, an end date and some text. So you can start a timeline diagram with code like this:

use SVG::Timeline;

my $doctors = SVG::Timeline->new;

  text  => 'William Hartnell',
  start => 1963,
  end   => 1966,

$doctors-> add_event({
  text  => 'Patrick Troughton',
  start => '1966,
  end   => '1969,


And once you have added all of your events, you can produce the timeline using:

print $doctors->draw;

That code writes the SVG document is written to STDOUT, so you’ll probably want to redirect that to a file.

That will draw a timeline of your events using all of the default settings (which, in most cases produce a useful diagram). There are plenty of options that you can pass to the object constructor to tweak things. The most useful are probably the aspect ratio (if your diagram is going to be particularly long or thing – the default is 16/9) and the number of years between gridlines in  the output (the default is ten and you might want to change that if your timeline covers a particularly large or small number of years – like the Genesis example above).

The default behaviour is to colour all of the events the same colour (which can be changed from the default in the constructor for the SVG::Timeline object). But you can also change it for each individual event by adding an optional “colour” parameter to the add_event() call.

But that’s all a lot of work for the simple case. So the distribution also includes a command line program called timeline which does all of that for you. It reads a datafile and produces a timeline diagram based on  the contents.

Each record in the input file has three or four fields separated by tabs. The fields are the parameters for the add_event() call in the order: text, start, end and (optionally) colour.

There are example data files in the distribution for producing some of the timelines I’ve talked about in this article – along with shell scripts showing how to produce timeline diagrams using the command line program.

There are a few things I’d like to add. Support for events with unknown dates (perhaps fading the colour towards the unknown end). Diagrams that go vertically instead of horizontally and support for events that begin and end in the same year (currently, they are zero size and just vanish – I discovered that when I added Paul McGann and Christopher Eccleston to the Doctor Who example).

I find the program… well, if not exactly useful, it’s still fun to play with.

Please let me know if you produce any interesting timelines with it.

The post Timeline Diagrams with Perl appeared first on Perl Hacks.

Dave Cross / Tuesday 19 September 2017 22:03