Track redesign

In my previous post I shared how I had found a layout plan that looked interesting, and I’ve been developing that idea further. I’ve got nearly all the track pieces already to achieve it (minus the points), and when I laid it out on the floor it turned out to be slightly smaller, which would make it easier to fit into the garage, which is another plus. So I’m now going full speed ahead with that idea.

I’m using AnyRail to play around with track plans, though you’ll notice I haven’t bothered tweaking the layout to fill those gaps at the bottom – there should be just about enough flex in the track to allow me to connect all that up. We’ll end up with two stations, a main station and a countryside halt in amongst the trees. I’m still planning on the back section being raised slightly to add variation, I’ll just need to be careful about the gradient to ensure that my trains can climb the hill. The branch line at the top of the layout will be a timber yard of some description, prepping logs fresh from the wood to be transported to a sawmill bottom right.

There are some isolated sections too, which took some careful figuring out. On the diagram above the isolated track connectors are shown as little triangles. The sidings at the bottom each have a small section of isolated track at the end, allowing me to store more than one engine on each siding by switching those sections off. The points will isolate the other sections, so I’ll be able to leave trains in either station while a freight train makes the journey from the woods to the sawmill. I haven’t quite figured out where the road is going yet, but I’ve put in a level crossing ready for it.

I’ve also been thinking about the construction of the base board. I mulled over the idea of using old wooden pallets as a substructure, seeing as they’re really strong and some businesses give them away for free. But in the end I decided against them, on the basis that they’re really heavy and probably overkill for my little railway. So I’m now erring towards a custom-built table, using six legs I’ve just bought from Ikea, a timber frame, a 12mm chipboard base, and sheets of extruded polystyrene foam on top of that. At least that’s the plan today.

In preparation for the build, I’ve done a load of clearing out and organising in the garage, which had been fairly haphazardly strewn with stuff on the basis that it didn’t matter. Well of course now it does, so order has had to be imposed. A few items went to the local recycling centre, others have been reorganised into tidier piles. A load of old cardboard boxes nearly went into the recycling too, until I had a brainwave and decided to weave them into the inside of the garage door to provide some insulation. It’s all cut to size and wedged in, not a strip of duct tape to be seen! That should make life in the garage a bit more bearable come winter.

Tidying the garage, and indecision

Last night I spent a few hours out in the garage, planning out where my model railway is going to go. Based on my mock-up in the sitting room, it’s going to need a base board around 1m x 2.4m. I got my tape measure out, and that’s going to take up rather a lot of my garage! And it’s not exactly empty as it is.

So I set about reorganising the contents of the garage, putting things more neatly into corners, throwing out some rubbish, and generally trying to work out how I’m going to fit everything in. You probably wouldn’t notice the difference, but it is now a lot tidier – in places.

Meanwhile, I’ve been thinking a lot about wiring, referring to this excellent page – it’s not pretty, but it is incredibly useful. I need to buy some parts, probably from my nearby East Somerset Models, or possibly eBay, but it should be fairly straightforward. It’s just a lot to get to grips with, all of a sudden! What makes it even more complicated is that I’m suffering from indecision – I keep coming up with alternative track designs, or variations on what I had before, and I can’t decide which one to go with. I keep moving the sidings around, trying to make more space for stations. But I also want the layout to make sense, which means that something needs to happen in those sidings. I’d like to have a small industry or something, so that I can legitimately transport something from A to B, ideally without requiring the passenger train to be taken off the layout.

And then this morning I found this layout on the SCARM website. Yes, it’s for a different scale, but it shows a slightly different way of adding variation into an oval. It’s got room for a nice station (though only one), plus an industry (transporting lumber from the woods to a sawmill). I might have to get the track into the sitting room again so I can play with this idea. The SCARM software looks tempting too, I might have to download that as well!

Model railway build: it begins

Something unexpected happened last week – I took possession of a model railway. Well, to be exact, I took possession of some of the parts I’ll need to create my own model railway. Which essentially means I’ve been handed a mid-life crisis.

When I were a lad, my Dad and I built a 00 gauge railway. We mounted it on a big board hinged to the wall. It had two ovals (an outer express line and an inner goods line) that went through a tunnel, a branch line that went up a hill and finished on top of the tunnel, several sidings, a hole in the middle for small people to peep up through, and some weird electronics to optionally isolate certain bits of track so we could have lots of engines on the track at once. There were many happy hours spent playing with engines, painstakingly applying ballast to the tracks, and trying to make the grass look realistic.

But with my parents moving house, it became time for me to reclaim the railway, or lose it. Of course, I couldn’t take it as it was, on that great big board, so my first task was to rip up all the track and scenery. That was tough, not physically but emotionally. But the heartache was balanced out by the hope that it would live again, albeit in a different form.

And so begins my next project – making my own 00 gauge railway layout. I’ve already got a rough idea of a track layout, using the bits of track that were still usable. I’m trying to keep it simple, but I also want it to be interesting. My plan at the moment is to have a single oval, but with a wiggle in it for variation, and a few sidings. Below is a picture of what the track looks like on my sitting room floor.

I’m already considering changing that, though. I’m contemplating whether the sidings on the right could be inside that wiggle, on the edge of the board rather than inside the loop. I’ll need to get the track out again and see if I can make it work.

As for mounting it, I’m looking at using some sort of styrofoam base to build up some scenery, making some nice hills and a subtle elevation change such that the back straight is slightly higher than the track at the front. I’m still researching how best to do that. I’m imagining that will all be mounted on a bit of chipboard, possibly with some slats underneath for rigidity. I’m still working on how best to raise that off the ground; it’s going to be in my garage, and I’ll want to store stuff underneath, so I need to work out whether I can repurpose an existing table or whether I’ll need to create my own legs. I’m not exactly experienced with woodwork, so this is going to be a challenge! I’m also wanting a lid, probably also in chipboard for now, which will keep the dust out when I’m not using it, and possibly also allowing me to store some stuff on top if I need to. And there was me thinking this would be a simple project!

Height map showing where the hills might be

Ultimately, I’m aiming for a quaint little countryside line, ideal for a little tank engine and a few carriages or trucks. I’m not anticipating express trains on here. I’d quite like some sort of industry on the top branch line, but I’m not sure what yet. Might be a farm, or a mine, or a factory. Suggestions on a postcard.

The sovereignty of God

Or: God, our ultimate superhero

This is a sermon I preached at St Aldhelm’s Doulting, focusing on James 4:11-17.

Superheroes are everywhere in today’s culture. In some ways we’re a bit like them, in that we often judge each other, comparing our own skills and achievements against other people. James points out that this is contrary to God’s will. We judge God too, every time we go our own way instead of his.

James teaches us that the solution to our problem of pride is humility. We need to humbly submit to each other, and to God.

Sermon: Living faithfully

This is a sermon I preached at St Peter & St Paul Shepton Mallet, looking at James 2:14-26.

James writes to young Christians in churches across the Middle East, telling them that faith without works is dead. At first glance, that seems contrary to Paul’s teaching, so we need to take a closer look at what James is saying.

Listen to this recording to learn more! And do leave your comments below.

What is Church?

Following a discussion with a learned friend recently, it became painfully apparent that my personal definition of “Church” was quite different from his.  He challenged me to explore this further, particularly to look at the New Testament to see Biblical evidence of Church.  This document is an analysis of this research, which will hopefully point me towards a Biblical definition that is also culturally relevant and contextual for today.

Personal opinions matter

Since this exploration started with a difference of opinion, I thought it would be worth asking a few more people for their opinions too, to gather as broad a range as possible.  The answers were not intended to be scientific or cleverly thought out, and most people I asked were not given much chance to craft their responses, and that was quite deliberate; what I wanted was people’s gut feel, their immediate impression, a summary of what was most important to them.

Those with theological training (perhaps unsurprisingly) gave the most Biblically-centred answers.  A common point of reference was Acts 2:42, “They devoted themselves to the apostles’ teaching and to fellowship, to the breaking of bread and to prayer”.  To them, this is Church.

Interestingly, those with a less leadership-oriented perspective came up with very different definitions, centred more around community, family, people, personal experience, and spirituality.  Some highlighted the importance of the mix of believers and unbelievers, showing the importance of mission and being outward focused.  One person quoted Matthew 18:20, where Jesus says “where two or three gather in my name, there am I with them”.  Another had a more timeless understanding of Church, including all believers throughout time and throughout the world, highlighting the nature of the breadth of corporate worship.

As for me, I had my own opinion too.  I instinctively defined Church as the following:

The Church is the body of believers acting as a community within the community to worship and encounter Jesus.

However, as confident as I was of this definition when I first met with my learned friend, I recognised the importance of looking to the Bible first, and using God’s Word to inform my definition, rather than just finding Bible passages that backed up my opinion.

How to use a browser as a kiosk

When it comes to engaging with customers, interactive screens are an important tool to have in your arsenal. They need to be visually attractive, easy to use, and effective at conveying their message, whether that’s providing information or a particular service. For that reason, web applications are a good way of implementing such tools, because they are inherently visual and optimised for on-screen interaction. So how do you go about setting up and securing your kiosk application?

The context

You’ll find interactive screens in lots of places these days. When I visited the Warner Bros Studios last year I noticed they had several touch-screen computers dotted around, enabling visitors to explore some additional information about how they made the Harry Potter films. It was animated, styled like you’d expect a Harry Potter display to look, and was designed to be an engaging way for people to explore, and without needing an extra employee to operate it. It was a self-service kiosk.

I occasionally make kiosk applications for big shows. You know the kind of thing – events taking place at giant exhibition halls, where hundreds of companies rock up with their stands to try to sell you stuff. These days you’ll find many of them using interactive screens to grab the attention of the crowds as they pass, allowing them to engage with their brand in a more touchy-feely way. I tend to make these interfaces using web technologies, simply because they are primarily designed for on-screen interaction.

The problems

To come across as a professional kiosk, it should satisfy these criteria:

  • It should be full-screen, not showing any browser controls.
  • It should not reveal the underlying operating system.
  • It should not allow users to get out of the application.
  • It should not need staff to periodically reset it.
  • It should be completely self-explanatory, and not require a member of staff to explain how to use it.
  • It should respect people’s privacy.

Pressing F11 to enable full-screen mode in the browser is a good start, but it’s clearly not enough.

Opening your application in kiosk mode

All mainstream browsers come with a kiosk mode. The basic principle in all cases is to create a desktop shortcut with a special parameter in the target, and then make sure that shortcut is opened when the computer is started. Here is the process, assuming you’re using Chrome on Windows:

  • Right-click on an existing Chrome shortcut (e.g. in your start menu) and select Send To > Desktop (create shortcut).
  • Right-click on the new shortcut on your desktop and select Properties.
  • In the Target box, add --kiosk to the end, putting in the URL of your web application.
  • Drag the shortcut into the startup folder of your start menu.

You should now find that when you log into the computer it will automatically load up your web application in full-screen mode. Users will not be able to use the back button, see or change the URL, or open a new tab. However, other features will still work, so we’ll need to lock those down too.

Preventing people exiting kiosk mode

If your kiosk uses an external keyboard, you could easily just hit Alt-F4 to close the application, and – bingo – they’ll be looking at the desktop with free reign over pretty much anything. Not great. People could also try to print, save a bookmark, or pretty much anything else that could be done with a keyboard shortcut.

One solution here is to intercept those keypresses using something like AutoHotkey. I won’t go into too much detail here, there are plenty of resources on their website to point you in the right direction. But, essentially, you’ll want to create a little script to detect when certain combinations of keys are pressed, and do absolutely nothing with them. It will be as if those keys haven’t been pressed at all, which means that the browser/computer won’t do anything. Depending on what browser you’re using, you may have different shortcuts to intercept, so it might be worth looking up a list of keyboard shortcuts that browser uses, and intercept all of them. Don’t forget to also catch any operating system shortcuts, so anything including the Windows key or function keys. You basically only want people pressing the letter and number keys.

Another option is to use a touch-screen computer instead, and not give people access to a keyboard at all. You’ll want to deactivate any operating system gestures though. And if you want to accept user input, you may want to consider using an on-screen keyboard. I wouldn’t rely on the operating system’s built-in on-screen keyboard, because that typically gives people access to the whole keyboard, which means you’ll need to catch them with AutoHotkey. A good alternative option is jQBTK (jQuery Bootstrap Touch Keyboard), which is a little jQuery plugin that generates a keyboard using Bootstrap components, making it easy to integrate and easy to style too. It’s a shameless plug, admittedly, because I wrote that particular script! But I haven’t come across anything better yet.

Application design

There are some things to remember when actually building your web application, too. For starters, be aware of your screen resolution, because you may not want people to be scrolling like they might on a normal web page. Because you know the size of the viewport, you don’t necessarily need to worry about responsive design or even browser compatibility – as long as it works on your kiosk machine, that’s all that matters.

Here are some other brief pointers to keep in mind:

  • Don’t include links to other websites.
  • Make sure the controls are a suitable size.
  • Make sure it’s really REALLY obvious how to use it.
  • Test it beforehand, ideally with someone who has never seen it before.
  • Think about error messages – are you happy for them to appear in operating system default windows, or would it be better to have it consistently styled within your app?
  • Include time-outs, so that if someone leaves your kiosk half-way through it will automatically reset itself after a certain delay, ready for the next person. But make sure it doesn’t reset while people are still using it!

Security and privacy

Beyond stopping people from exiting your app or doing unexpected things with it, there are other security-related things to bear in mind. Since you’re not revealing the URL, you probably* don’t need to worry too much about the usual XSS or SQL-injection concerns you might have on a ‘proper’ website. But remember that people will be using your web app in a public space – do they want their actions to be visible by other people?

An example would be any sort of data collection. If you’re asking people to enter their name, email address, or indeed any personal information into your app, they will be hesitant if they think the person behind them in the queue can see what they’re putting in. So think about the size of your form elements – keep them big enough to be easily visible by the person using it, but not big enough that other people around would be able to read it.

Also remember to set autocomplete="false" on your HTML inputs, so that the browser doesn’t try to put in details that someone else has already submitted!

Finally, NEVER ask people to log in on a public screen. Imagine the havoc that could be caused if someone logged in and then forgot to log out again. Depending on the context, there may be ways of doing it, if you’re really careful. But unless it’s absolutely critical I would avoid it completely.

* Actually, you should ALWAYS think about XSS and SQL-injection. It’s good practice, even if you never expect it to be a problem in your context. You don’t want some clever-clogs coming along and manually entering something in your email form that wipes all your data.

Final remarks

Anything I’ve missed? I’m sure there must be. Do let me know in the comments whether there are any other best practices you would employ when building a kiosk app.

Sermon: Jesus, King of sinners

In my latest sermon, preached on 22 January 2017 at St Aldhelm’s Doulting, we look at Mark 1:40 – 2:17. We read about the leper Jesus healed, the paralysed man who was lowered through the roof, and the calling of Levi.


Donald Trump has been inaugurated as President of the US, and the UK is mid-Brexit, leaving many wondering whether this is a kingdom they want to be part of. Jesus’s kingdom is different, though – it’s full of sinners like you and me. No sin can exclude you. But Jesus also wants us to change, to become more like him. Ultimately, our eternal life must take priority over our earthly life – that’s not to say our earthly life is unimportant, but rather that it’s a matter of priorities. Lord, your kingdom come.

Also, apologies that the audio goes rather quiet for a bit towards the beginning, I had to step away from the mic to hand things to some kids!