+++*

Symbolic Forest

A homage to loading screens.

Blog : Post Category : Geekery : Page 4

The old gods (redux)

Or, looking at the sky again

Back in August I talked about how Jupiter and Saturn were nicely visible in the sky, but not until well after The Children were in bed. Last night, though, we had a rare family conjunction of myself and The Children being in the same place, on a night when it was dark well before their bedtime, with a largely clear sky. So, the telescope came out.

This was the first time The Children had been able to use the telescope this autumn, the first time since a few abortive attempts just after moving house in February. I was impressed, to be honest, how over nine months they have grown that bit more mature to be able to use the telescope a bit better. Last winter, it was difficult to get them to stand still long enough to look through a telescope properly, difficult to get them to look through the eyepiece without grabbing onto it and swinging it out of position, and difficult to get them to wait patiently whilst I aimed and focused it. Now, though, they managed to do that with a few different things. FIrst we looked at Saturn, its rings angled and nicely visible; then at Jupiter and the four Galilean Moons. I couldn’t really see any cloud bands on Jupiter this time, unlike in August, but nevertheless the children were pretty excited.

There was a fair amount of patchy cloud; some constellations were visible but nothing exciting enough to hold The Children’s interest. In any case, it was almost bedtime. I left the telescope set up, though, and after a few hours the clouds had largely cleared and we went outside again. Orion was just rising; we looked at the nebula, and at Betelguese, and the Pleiades. The night sky, still just as it was last winter.

Code archaeology

When things become relevant again

One thing I have been doing over the past few weeks is: finally, finally, taking the hard drive out of my last desktop computer—last used about 8 years ago at a guess—and actually copying all the documents off it. It also had stuff preserved from pretty much every desktop machine I’d had before that, so there was a whole treasure-chest of photographs I hadn’t seen in years, things I’d written, and various incomplete coding projects.

Some of the photos will no doubt get posted on here over the coming weeks, but this post isn’t about those. Because, by pure coincidence, I was browsing my Twitter feed this morning and saw this tweet from @ireneista:

we were trying to help a friend get up to speed on how to make a Unix process into a daemon, which is something we found plenty of guides on in the 90s but it’s largely forgotten knowledge

Hang on a minute, I think. Haven’t I just been pulling old incomplete coding projects off my old hard disk and saving them into Github repositories instead? And don’t some of those have exactly that code in? A daemon, on Unix, is roughly the equivalent of a “Service” on Windows. It’s a program that runs all the time in the background on a computer, doing important work.* Many servers don’t even run anything else to speak of. On both Unix and Windows systems, there are special steps you have to take to properly “detach” your code and let it run in the background as part of the system, and if you don’t do all those steps properly you will either produce something that is liable to break and stop running that it’s not supposed to, or write something that fills up your system’s process table with so-called “zombie” entries for processes that have stopped running but still need some bookkeeping information kept about them.

Is this forgotten knowledge? Well, it’s certainly not something I would be able to do, off the top of my head, without a lot of recourse to documentation. For a start all the past projects I’m talking about were written in C, for Linux systems, and I haven’t touched the language nor the operating system much for a number of years now.

None of the projects I’m talking about ever approached completion or were properly tested, so there’s not that much point releasing their full source code to the world. However, clearly, the information about how to set up a daemon has disappeared out of circulation a bit. Moreover, that code was generally stuff that I pulled wholesale from Usenet FAQs myself, tidying it up and adding extra logging as I needed, so compared to the rest of the projects, it’s probably much more reliable. The tweet thread above links to some CIA documentation released by Wikileaks which is nice and explanatory, but doesn’t actually include some of the things I always did when starting up a daemon. You could, of course, argue they’re not always needed. So, here is some daemonisation code I have cobbled together by taking an average across the code I was writing about twenty-ish years ago and adding a bit of explanation. Hopefully this will be useful to somebody.

Bear in mind this isn’t real code: it depends on functions and variables that you can assume we’ve declared in headers, or in the parts of the code that have been omitted. As the old saying goes, I accept no responsibility if this code causes loss, damage, or demons flying out of your nose.**

/* You can look up yourself which headers you'll need to include */

int main(int argc, char **argv)
{
    /* 
     * First you'll want to read config and process command line args,
     * because it might be nice to include an argument to say "dont'
     * run as a daemon!" if you fancy that.
     *
     * This code is also written to use GNU intltools, and the setup for that
     * goes here too.
     */
    
    /* Assume the daemonise variable was set by processing the config */
    if (daemonise)
    {
        /* First we fork to a new process and exit the original process */
        switch (fork ())
        {
        case -1:
            syslog (LOG_ERR, _("Forking hell, aborting."));
            exit (EXIT_FAILURE);
        default:
            exit (0);
        case 0:
            break;
        }

        /* Then we call setsid() to become a process group leader, making sure we are detached
         * from any terminals */
        if (setsid () == -1)
        {
            syslog (LOG_ERR, _("setsid() failed, aborting."));
            exit (EXIT_FAILURE);
        }

        /* Then we fork again */
        switch (fork ())
        {
        case -1:
            syslog (LOG_ERR, _("Forking hell x2, aborting."));
            exit (EXIT_FAILURE);
        default:
            exit (0);
        case 0:
            break;
        }

        /* Next, a bit of cleanup.  Change our CWD to / so we don't block any umounts, and 
         * redirect our standard streams to taste */
        umask (0022);
        if (chdir ("/"))
            syslog (LOG_WARNING, _("Cannot chdir to root directory"));
        freopen ("/dev/null", "w", stdout);
        freopen ("/dev/null", "r", stdin);
        freopen ("/dev/console", "w", stderr); /* This one in particular might not be what you want */

        /*
         * Listen to some signals.  The second parameters are function pointers which 
         * you'll have to imagine are defined elsewhere.  Reloading config on SIGHUP
         * is a common daemon behaviour you might want.  I can't remember why I thought
         * it important to ignore SIGPIPE
         */
        signal (SIGPIPE, SIG_IGN);
        signal (SIGHUP, warm_restart);
        signal (SIGQUIT, graceful_shutdown);
        signal (SIGTERM, graceful_shutdown);

        /* And now we're done!  Let's go and run the rest of our code */
        run_the_daemon ();
    }
}

The above probably includes some horrible mistake somewhere along the way, but hopefully it’s not too inaccurate, and hopefully would work in the real world. If you try it—or have opinions about it—please do get in touch and let me know.

* NB: this is a simplification for the benefit of the non-technical. Yes, I know I’m generalising and lots of daemons and services don’t run all the time. Please don’t write in with examples.

** “demons flying out of your nose” was a running joke in the comp.lang.c Usenet group, for something it would be considered entirely legitimate for a C compiler to do if you wrote code that was described in the C language standard as having “undefined behaviour”.

Look to the skies

But, specifically, at the moon

An upcoming astronomy event: in a couple of weeks time, on October 16th, it’s International Observe The Moon Night. The idea being, everyone gets together around the world and, well, looks at the moon.

You might expect an event like this to happen on the full moon. It’s not, however: the moon will be waxing gibbous, a couple of days after passing First Quarter. In many ways this makes it a more interesting sight, as there will be a day/night terminator visible. That is: the line between the bright sunlit part and the dark night-time part. If you get a telescope or binoculars and look at the terminator, you can see the low-angled sunlight picking up ridges and hills, and casting deep shadows into the craters. Because the moon has essentially no atmosphere, the picture you see will be wonderfully crisp and sharp, the ridge of every crater picked out perfectly.

The Moon might be the nearest heavenly body, most of the time, but there’s still an awful lot we don’t know about it. Moreover, it’s fascinating just to go outside and look at. On International Observe The Moon Night you can go and join an established event, or you can put your hand up to host one yourself. Or, if you don’t like either of those options, just go outside and look at it yourself. It will—clouds permitting—be beautiful.

The old gods

The astronomy season is starting again

We’re getting to the time of year now when it’s properly dark before a reasonable bedtime; as opposed to a couple of months ago, when it is still twilight in the deepest part of the night, which around here happens at about quarter past one in summer. August, by comparison, is the time of year when I can go outside at 10pm and see if the sky is clear enough to do a small bit of stargazing before bed. It’s too late to wake up The Child Who Likes Space, who nominally owns the telescope, but nevertheless, I rationalise, I can always tell him about it in the morning.

A while ago, I noticed that according to timeanddate.com’s planet apparent size calculator, Jupiter would have a relatively large disc right now. Right now, in fact, it’s receding from us, but it’s still a relatively chunky 49 arcseconds wide. Still a dot to the naked eye—the Moon is about 36 times bigger in apparent diameter if my rough mental calculations are correct—but big for a sky object, and with the best chance we would have of seeing features on it. Over the past few weeks I’ve noticed that Jupiter and Saturn together, although relatively low in the sky, are very definitely the brightest things in the south-eastern sky when I go to bed. So last night, as the sky was almost clear, I decided to get the telescope out.

Last spring I found it rather hard to get the telescope set up in the new garden, due to the street light that shines directly into it over the garden wall. Back then, though, the garden was a rocky, rubble-strewn wasteland, which didn’t help. Now it’s grassed, and at the moment I can tuck the camping table and the telescope into a relatively shady distant corner; from which both planets were shining bright in the sky. It was as easy as any astronomy I could think of: set up the telescope, point the finder on Jupiter, and as soon as I had focused, I had the planet and the four Galilean moons right in the centre of the eyepiece. All four of the moons were on the same side of the planet last night, Io just visible almost touching the planetary disc, the other three clear and sharp and separate spread out to the east of the planet. Jupiter itself was a fairly uniform cream colour, with a thin, darker, more reddish band visible near its equator. It seemed so sharp and clear, much more clear and bright than a photograph.

After Jupiter, I trained the spotter on Saturn, much smaller in the sky. At first it just seemed to be an oval blob, but I’d knocked the focus off slightly. Tweaking it showed the planet, orange in colour, and its rings. We don’t have anywhere near enough magnification to show the ring divisions, and the rings and the planet seemed to have a fully uniform colour. It’s strange to think that when Stegosaurs were alive and tramping the planet, Saturn probably didn’t have any rings at all. I couldn’t make out any of the planet’s moons, but I know they are much fainter than those of Jupiter, my eyes probably hadn’t had time to fully adapt to the dark, and I didn’t know where to be looking in any case. I wonder how different the history of science would have been, if Jupiter didn’t have four clear bright moons for Galileo to spot easily with his early telescopes.

Incidentally, due to geometry, it’s impossible for the planets orbiting outside Earth to have phases like the Moon does: their discs will always appear from our standpoint to be fully illuminated. This coming winter Venus will be the largest planet in the sky—it peaks at just under 63 arcseconds on January 8th—and it will be interesting to see if around then more than a thin crescent is visible. Assuming the skies are clear, of course.

Summer astronomy news

Time for some more meteors

You might remember, if you’ve read back as far as last March or April, that I’d been trying some astrophotography but hadn’t got very far. I still haven’t got very far, largely because it’s summer, and we are only just out of the part of the year where it never gets properly dark at all here.

The other day, though, regular reader MdeC was grumbling on their social media that their attempt to take a gorgeous photo of the Milky Way—far better than anything I’ve produced—had been ruined by a meteor. And it reminded me: we’re just coming into one of the key meteor-spotting seasons of the year. August is the month of the Perseid meteor shower, one of the busiest and brightest showers in the calendar. The fact there are lots of meteors in the sky in August has been known since ancient times; in the 19th century the astronomer Schiaparelli calculated they were created by the trail of dust left behind by Comet Swift-Tuttle in its orbit. Their peak will be next week, on Thursday night and Friday morning, but they are spread quite broadly, and any clear night over the next couple of weeks gives you a good chance of seeing some.

So, if there’s a clear night, I’ll be taking a deckchair outside, lying back and looking up at the sky. There’s no point really setting up the telescope or getting binoculars out: they move too fast and can be anywhere in the sky. Just relax, find a dark place if you can, let your eyes adapt, and watch them flash across the sky.

Milestones

Or, how and how not to learn languages

I passed a very minor milestone yesterday. Duolingo, the language-learning app, informed me that I had a “streak” of 1,000 days. In other words, for the past not-quite-three-years, most days, I have fired up the Duolingo app or website and done some sort of language lesson. I say “most days”: in theory the “streak” is supposed to mean I did it every single day, but in practice you can skip days here and there if you know what you’re doing. I’ve mostly been learning Welsh, with a smattering of Dutch, and occasionally revising my tourist-level German.

My Welsh isn’t, I have to admit, at any sort of level where I can actually hold a conversation. I barely dare say “Ga i psygod a sglodion bach, plîs,” in the chip shop when visiting I’m Welsh-speaking Wales, because although I can say that I am wary I wouldn’t be any use at comprehending the response, if they need to ask, for example, exactly what type of fish I want. To be honest, I see this as a big drawback to the whole Duolingo-style learning experience, which seems essentially focused around rote learning of a small number of set phrases in the hope that a broader understanding of grammar and vocabulary will follow. I’ve been using Duolingo much longer than three years—I first used it to start revising my knowledge of German back in 2015. When I last visited Germany, though, I was slightly confused to find that after over a year of Duolingo, if anything, I felt less secure in my command of German, less confident in my ability to use it day-to-day. Exactly why I don’t now, but it helped me realise that I can’t just delegate that sort of learning to a question-and-answer app. If I want to progress with my Welsh, I know I’m going to have to find some sort of conversational class.

Passing the 1,000 days milestone made me start wondering if anyone has produced something along the same lines as Duolingo but for computer languages. In some ways it should be a less difficult problem than for natural language learning, because, after all, any nuances of meaning are less ambiguous. I lose track of the number of times Duolingo marks me down because I enter an English answer which means the same as the accepted answer but uses some other synonym or has a slightly different word order. With a coding language, if you have your requirements and the output meets them, your answer is definitely right. In theory it shouldn’t be too hard to create a Duolingo-alike thing but with this sort of question:

Given a List<Uri> called uris, return a list of the Uris whose hostnames end in .com in alphabetical order.

  1. uris.Select(u => u.Host).Where(h => h.EndsWith(".com")).OrderBy();
  2. uris.Where(u => u != null && u.Host.EndsWith(".com")).OrderBy(u => u.AbsoluteUri).ToList();
  3. uris.SelectMany(u => u.Where(Host.EndsWith(".com"))).ToList().Sort();

The answer, by the way, is 2. Please do write in if I’ve made any mistakes by being brave enough to write this off the top of my head; writing wrong-but-plausible-looking code is harder than you think. Moreover, I know the other two answers contain a host of errors and wouldn’t even compile, just as the wrong answers in Duolingo often contain major errors in grammar and vocabulary.

Clearly, you could do something like this, and you could memorise a whole set of “cheat sheets” of different coding fragments that fit various different circumstances. Would you, though, be able to write decent, efficient, and most importantly well-understood code this way? Would you understand exactly the difference between the OrderBy() call in the correct answer, and the Sort() call in answer three?* I suspect the answer to these questions is probably no.

Is that necessarily a bad thing, though? It’s possibly the level that junior developers often work at, and we accept that that’s just a necessary phrase of their career. Most developers start their careers knowing a small range of things, and they start out by plugging those things together and then sorting the bugs out. As they learn and grow they learn more, they fit things together better, they start writing more original code and slowly they become fluent in writing efficient, clean and idiomatic code from scratch. It’s a good parallel to the learner of a natural language, learning how to put phrases together, learning the grammar for doing so and the idioms of casual conversation, until finally they are fluent.

I realise Duolingo is only an early low-level step in my language-learning. It’s never going to be the whole thing; I doubt it would even get you to GCSE level on its own. As a foundational step, though, it might be a very helpful one. One day maybe I’ll be fluent in Welsh or German just as it’s taken me a few years to become fully fluent in C#. I know, though, it’s going to take much more than Duolingo to get me there.

* The call in answer 2 is a LINQ method which does not modify its source but instead returns a new enumeration containing the sorted data. The call in answer 3 modifies the list in-place.

On emotional lines

Or, a special locomotive

In the last post I mentioned I’d been up to North West Wales recently, for the first time since January 2020. The first place we headed to, naturally, was the Ffestiniog Railway, and it was bustling with activity: five engines in steam, I think (plus one diesel), several trains shuttling up and down the line. I couldn’t stop taking photos, either on the phone or on the Proper Camera, of every train I saw. And one in particular was special.

Welsh Pony

This is Welsh Pony, or Merlen Cymraeg, the one engine I was really hoping to see. “It’s Welsh Pony!” I said excitedly, snapping away, sending out photos and so on.

“What’s … so exciting about another train?” came back the replies.

“It’s Welsh Pony!”

Which obviously didn’t exactly cut it as an explanation. “I’ll try to explain more,” I said, “when I’m back at my computer and have time to put it into words. This is a very special engine for my generation of nerds.”

Welsh Pony was built back in the mid-1860s, one of a pair of very similar locomotives built for the Ffestiniog Railway by George England & Co of New Cross, following on from four slightly smaller side tank engines. Three of the earlier engines—Princess, Prince and Palmerston—were rebuilt to be rather more like Welsh Pony and its sister Little Giant, and those five together shared many decades of service.

Welsh Pony

The Ffestiniog’s fortunes started to decline from the First World War onwards. Little Giant was dismantled for spares in 1929, but as the 1930s progressed the railway struggled to fund necessary repairs on the ancient locos. Prince was out of use from 1936, and Palmerston from 1937. Welsh Pony was probably last used in 1940. When the railway closed to traffic in 1946, Princess was the only George England loco still running on the railway.

Welsh Pony

When the railway closed to traffic, the company didn’t shut down. It became the empire of one depressed, gloomy old man, who had worked for the line since he was a boy and had slowly seen it decay and rot away. He didn’t make any effort to save the locos, or the rolling stock, to cover them over or wrap them up or shut them away securely. They stayed where they had been left, many of them outdoors, some like Welsh Pony indoors, all close by the salt-spray of Harlech Bay. They rusted quickly, as the grass grew up around them. When a group of enthusiasts gained control of the railway after about eight years of closure, nothing was close to serviceable, and the enthusiasts had to carefully piece things back together on the tiny amount of cash they had to spare, repairing the most repairable locos and carriages one-by-one until they had the minimum they needed to offer a service. Welsh Pony, abandoned for about fifteen years when the railway reopened, was not one of them.

Welsh Pony

Welsh Pony hung around the railway, parked on various sidings, stored in various sheds. In the mid-1980s it was painted up and put up on a plinth, as Porthmadog Harbour Station’s “gate guardian” loco. It stayed on the plinth, rusting away in the sea air, until the early 21st century when it went back into storage once more. In 2014, restoration work on Welsh Pony finally started. A careful survey discovered that a huge proportion of the surviving fabric was just too rusted, and would have to be replaced. A new boiler was needed, new frames, new cylinders, new rods, but the wheels and valve gear are still original.

Welsh Pony in December 2019, with Prince and Palmerston on the left

The new Welsh Pony’s fire was lit for the first time in June 2020, with the ceremonial event livestreamed to an audience of thousands. Before restoration the boiler had been lagged with wood, and some of the rotting lagging had survived all those years the engine was out of use. When the loco was dismantled some of it was set aside, and was used to light the first fire, another little piece of continuity.

But why is Welsh Pony so special? Why, when I saw it in steam for the first time was I quite so overwhelmed? Well, I guess, for those of us who grew up in the 80s and 90s, Welsh Pony was a fixture, the engine standing mute and silent at the entrance to the car park, a symbol of the railway and yet at the same time something cold, dead and filled with the past. There are many people of my generation who can remember climbing up the plinth and onto the engine, even though you probably weren’t supposed to. It seemed impossible to imagine the rusting machine would ever run again. Even when it was taken down from the plinth and cosmetically restored, tucked back away in a storage shed, it seemed impossible to imagine it would ever run again. To watch it being warmed up, from afar, on a cold morning about a year ago, was a sight we thought might never happen. To see it running, hauling a train again, to be able to see it warm, moving and alive, for personally the first time, felt like an impossible moment.

Welsh Pony

I’m not sure setting out the bald facts like this will help you understand what made me so emotional about it, to be honest. Maybe, along with everything else, it’s a bit of an insight into how my mind works. Hopefully, though, it makes some sort of sense even if you’re never going to have that feeling about the engine—about any railway engine—yourself. All I can try to do, after all, is explain.

Pye in the sky (part two)

Some more local railway history

Last week, I posted a little bit about the history of the railway junction at Pye Corner, just outside Casnewydd/Newport. There, the original route of the horse-drawn tramway opened around 1805 is now a quiet, grassy back alleyway, with the railway that replaced it a few yards away. That railway line, now just a single-track branch, strides over the road into Bassaleg with a complex series of three parallel railway bridges, imposing and monolithic.

Pye Corner bridges

Looking through the tunnel of bridges, you can just about in this picture make out three different ones. In the middle, a stone arch. Beyond it a steel girder bridge and this side of it an arch in blue engineering brick. Three separate phases.

The stone arch is, I presume, the mid-19th-century bridge built by the Monmouthshire Canal Company when the railway line was rerouted from the back alleyway route it formerly took. On the far side: where the bridge was widened by the Great Western Railway, circa 1910 or so, to broaden the line up to Rhisga from two to four tracks. The blue engineering bricks on the nearside? Ostensibly that’s straightforward too—but not as straightforward as I first thought.

I mentioned in the previous post that Pye Corner was a railway junction as early as 1825, when the Rumney Railway was built from Pye Corner up to Rhymney. Now, I’ve said before that the railways of South Wales are complex and confusing, and the Rumney Railway is a case in point. Back in, say, 1860, there were two railways with very similar names, both linking Rhymney to the coast.

The Rumney Railway was the first, built around 1825, and like the Monmouthshire Canal Company’s railway it was horse-drawn, for its first few years. As you might expect from the name, it served Cwm Rhymni, running down from New Tredegar* along the east bank of Afon Rhymni. Unlike most of the valleys of South Wales, Cwm Rhymni doesn’t take a particularly straight line from mountains to sea, and the Rumney Railway followed the river where it takes a sharp eastwards turn at Bedwas and flows through Machen. From there, the river takes a rambling, meandering route through rolling countryside, past Ruperra Castle and down to the sea just east of Caerdydd/Cardiff. The railway, on the other hand, cut across the narrow neck of land separating Afon Rhymni from Afon Ebwy, to reach the latter at Rhiwderin, and ending by joining the Monmouthshire Canal Company’s railway about a mile further on. How it crossed the Afon Ebwy to get there will be the subject of a later installment.

The confusion arises from the Rhymney Railway, which came along in the 1850s partly because the Rumney Railway (also sometimes known as the “Old Rumney”) was by the time it turned 30 already something of a wheezing, antiquated and outdated little line, upgraded to steam but still using horse-era track. The Rhymney Railway was built to give Cwm Rhymni a proper, modern railway, and it doesn’t really concern us here save to say that it didn’t stick with the river as the Rumney Railway did: it headed into Caerffili town centre, then burrowed southwards through the hills into Caerdydd with a tunnel over a mile long. The Rumney Railway’s owners were worried they were getting left behind but didn’t have the money to upgrade their line; within five years of the Rhymney Railway opening, they had sold the older line to the Brecon & Merthyr Railway, so that the latter railway could use it as a stepping-stone to reach the sea. They did have the money in the bank to rebuild the Rumney Railway in a modern fashion, and did so, building further connections from Machen to Caerffili.

This doesn’t explain where that brick-built bridge comes from, though. Here’s a map of the railway connections around Pye Corner circa 1914. This is from the Railway Clearing House junction diagrams, which were made to give definitive plans of where railways interconnected and what the distances between junctions were, in order to be able to work out per-mile traffic rates.

Junction diagram

Yellow is the Great Western Railway (the former canal company line), blue is the Brecon & Merthyr, and you can see both companies have their Bassaleg stations. What’s the purple line though? That belonged to the company which owned the local docks, the grandly-named Alexandra (Newport & South Wales) Docks & Railway, or AND&R to its friends. They had wanted the collieries of Cwm Rhymni to be able to get their coal to the docks of Casnewydd, without having to pay any additional charges to the Great Western Railway; so they built a line parallel to the Great Western’s tracks between Pye Corner and Mendalgief, enabling coal trains to come straight off the Brecon & Merthyr and onto the dock company’s own line of route without touching the Great Western.

So that’s who built that imposing blue-brick bridge? Well, maybe. There’s certainly a boundary post still in the ground nearby, marking this off as AND&R land.

Boundary post

That answers the question, surely? Well, maybe not. We haven’t really looked at all of the evidence yet. However, as this post is already getting rather long, the conclusion (insofar as there is one) is sadly going to have to wait for another day.

* I’m not entirely sure where its original top terminus is. The Rumney Railway is particularly poorly-documented, so I’m not sure anyone is entirely sure quite where its original top terminus was.

Yet another crafting project (part eight)

Or, series two, episode five

The latest crafting project was finished last week, after just over seven weeks of work. I was surprised how quickly I finished it, to be honest, considering how much more difficult it was compared to the previous cross-stitch project. I say “finished”: it still needs blocking and framing, which is always going to be the least interesting job in a project like this. Because I’m fairly pleased with how it looks, there’s a larger picture if you click through.

![Bumblebee](bee.jpg “Bumblebee”)

I’ve already started the next cross-stitch project, which is going to be a much, much easier one; I will actually start a different series of posts for it this time. After only a week or so, it’s already well under way. At some point, too, I’ll pick up all those other projects that have been ongoing since some time last year.

The other posts in this series are *part four*, *part five*, *part six* and *part seven*.

Pye in the sky (part one)

Or, some pieces of railway history

For a few months now, I’ve been threatening to start writing a long series of blog posts about the railway history of South Wales, starting in Newport and slowly radiating outwards. The question, of course, is how to actually do that in a format that will be interesting and engaging to read in small chunks; and, indeed, for me to write. The “standard” type of railway history comes in a number of forms, but none of them are particularly attractive to the casual reader. Few go to the point of setting out, to a random passing non-specialist reader, just why a specific place or line is fascinating; just what about its history makes it worth knowing about. Moreover, not only do they tend on the heavy side, they are normally based either on large amounts of archival research, large amounts of vintage photographs, or both. Putting that sort of thing together isn’t really an option for me at present, especially not for a blog post.

So why would I want to write about the railways of the South Wales valleys in any case? In general, if you’re a British railway enthusiast, you probably think of the South Wales valleys as a place where GWR tank engines shuffled back and forth with short trains of passengers or long trains of coal. If you’re a specialist, and like industrial railways, you might remember it as one of the last areas where the National Coal Board still operated steam trains, at places such as Aberpennar/Mountain Ash. There are two things, though, that you probably only realise if you’re a specialist. Firstly, if you include horse-drawn railways and tramways, the South Wales railway system was the earliest and densest complex railway network in the world. Horse-drawn railways are often completely overlooked by enthusiasts, for whom railways started with the opening of the Liverpool and Manchester line in 1830. Partly, I suspect, because unlike later periods there aren’t many good maps or any photographs of most of the horse-drawn railways of this country. Although horse-drawn railways do appear on tithe maps, in most cases they are not very clearly marked and resemble a road more than anything else.

Secondly, the 19th century history of the growth of the South Wales railway network was intensely complex and entangled, and the later domination of the area by the GWR was by no means a foregone conclusion. Through the 1850s and 1860s there were a number of factions at work: on the local level, horse-drawn lines trying to modernise and make their railways part of the national network; newer steam-operated lines each serving a single valley and without any scope for a broader outlook; and nationally, the large London-based companies trying to gain “territory” and a share of the South Wales industrial traffic. In 1852 two directors of the London & North Western Railway, Richard Moon and Edward Tootal, said:

[A]ll the Narrow Gauge Lines [standard gauge] of South Wales are at present detached: & divided into separate & small Interests:- Again they are at present at War with the Broad Gauge.

(memo to LNWR board quoted in The Origins of the LMS in South Wales by Jones & Dunstone)

I’ll come to the reason why Moon and Tootal were investigating the railways of South Wales in a later post; but that, hopefully, sets the scene a little. South Wales didn’t become a GWR monoculture until, paradoxically, after the GWR itself ceased to exist. Through all of the 19th century, South Wales was a maze of twisty little railways, all different, many of them with very long histories.

All of which, if you’ve read this far, brings us on to a fairly ordinary-looking back lane behind some houses, in a fairly ordinary suburb of Casnewydd/Newport.

An ordinary back lane

You’ve probably guessed this is actually some sort of disused railway. It is; but it’s a disused railway that, paradoxically, is actually still in use. This is the trackbed of the Monmouthshire Canal Company’s tramway; its exact date of building is a little unclear but it was started around 1801 and open for traffic in 1805.

I’ve written about the Monmouthshire Canal Company before, as a good chunk of the Crumlin Arm of its canal has been semi-restored, albeit not in a navigable state. The canal was built in the 1790s, following the valley of the Afon Ebwy/River Ebbw down as far as Tŷ Du/Rogerstone where it cut across north of Newport to reach the Wsyg/Usk.

The canal’s enabling Act of Parliament permitted anyone who wanted to use the canal (within a few miles radius) to build their own horse-drawn feeder railway linking them to the canal. This included the Tredegar Ironworks, in the Sirhowy Valley; the only sensible way they could reach the canal, however, was to build their railway all the way down along the Sirhywi until reaching the confluence of the Ebwy and Sirhiwy in Risca. The canal company built a matching line, roughly parallel to their canal for much of its length but running around the south side of Newport. The picture above is part of this line, near the modern day Pye Corner station.

Above I said that paradoxically, this is a disused railway that is still in use. The reason for that is: a line built for horses to draw trains at walking pace is not exactly suitable for use by powered trains at much higher speeds. A secondary reason is that in many cases the new “rail roads” were the best road in the area, became heavily used by pedestrians, and started to have ribbons of houses built along them in the same way that public roads do.

Tithe map

This is the tithe map for the photo shown above, from around 1840. As you can see it’s hard to see the difference, in this map, between the railways and the roads; but a “public road” has already been built around the other side of the buildings that have grown up along the railway, so that people don’t have to walk on the railway to get to them.

When this map was made, the railway had already been using steam engines for around fifteen years or so. Not long after, the company decided its trains needed a better line of route here, so a new line was built, parallel, only a few tens of metres to the west. That line is still in use today as Trafnidiaeth Cymru’s Ebbw Vale Line, although it’s seen many changes over the years.

I was going to segue into the later railway history of the Pye Corner area at this point, because there’s plenty to discuss. Indeed, as far back as the mid-1820s there was already a railway junction there, and on the tithe map above you can see the second line striding off to the left of the map. It’s technically no longer a railway junction. There are still two routes here, but they come together and run parallel rather than actually joining. As this is already turning into something of an essay, though, that will wait for a later day.