Windbreaks

Windbreaks
Windbreak slideshow – click on arrows either side of image to view the set.

The British seem to love windbreaks.

I got a bit obsessed about them yesterday, on that rare thing: a windless, hot summer day on the beach in Cornwall, and yet we were surrounded by windbreaks.

Some people were sitting on the sea-side, some on the land-side, suggesting that windbreaks are as much about territory and privacy as keeping warm. Why would you block yourself off from a stunning view of St Ives Bay with Godrevy Lighthouse perched on its rocky island a short distance away? You could look at stripy nylon fabric in your own back yard.

windbreak 13

One family had joined 4 or 5 long windbreaks together to create a windbreak city. Inside, all mod cons. Books, beer, barbecue.

windbreak 16

Some favour the single short line, others pen themselves into a U shape. I’ve not seen anyone boxing themselves into a square, surrounded on all sides by windbreak, but it’s only a matter of time.

windbreak 12

Occasionally you will see novelty fabric: boulders, a floral pattern, Cath Kidston fabric. These are mere interlopers. Everyone knows a true windbreak must have brightly-coloured horizontal stripes.

windbreak 14

Me? I never take a windbreak, except occasionally on a sunset beach barbecue. But I do take a pop-up tent. Which I suppose is the same as fencing yourself in.

windbreak 15

An Englishman’s home is his patch of sand demarcated with a windbreak, with tents, with towels – or as I saw yesterday – a large circle carved in the sand. I presume it was enchanted. If a non-family member stepped inside, they would turn to sand.

windbreak 10

Update: happy to spot this colourful alternative to a windbreak – at least as far as providing shade is concerned – on Porthminster Beach:

colourful windbreak alternative

You can view my complete set of windbreak photos here.

Posted in Uncategorized | Tagged , | Leave a comment

Hop Stuff Brewery – podcast

After a bit of a hiatus, the new Last Orders podcast is here:

Today I visited the brewery that links South and North London, Hop Stuff, where I was showed round by the lovely founder James Yeomans. Listen to the podcast to find out more, and while you’re listening, scroll down to see what it looks like. Radio with pictures. It’ll never catch on.

Hop Stuff brewery

Their award-winning porter, which I can’t wait to try.

Hop Stuff brewery

A small part of James’s ‘research wall’. Happy to see a bottle of Wu Gang Chops the Tree up there, among a myriad of other yeasty treats.

Hop Stuff brewery

The hole in the upstairs floor, showing the fermentation vessels below. It really, really reminds me of Mr Blint’s Attic! (See my other web site for details).

Hop Stuff brewery

Hop Stuff brewery

The fermentation vessel that wouldn’t fit.

Hop Stuff brewery

Bottled beer is a relatively new venture for them.

Hop Stuff brewery

Where the magic happens.

Hop Stuff brewery

The brewery is at the heart of the Royal Arsenal development. Berkeley Homes have bought a huge swathe of the old munitions factory land stretching to the River Thames. Some of the old buildings are being renovated, and new some 5000 new flats are sprinkled in between.

The Luxury of Choice

Berkley Homes

The brewery and its forthcoming bar & restaurant The Taproom are right in the heart of this development, with a new Crossrail station being built offering fast transport links to central and west London.

Hop Stuff brewery

I’m not sure what I think about this development. I used to travel through Woolwich on the bus every day on my way to work in Thamesmead, and I could sense the odd juxtaposition of the old and the new buildings, as well as the well-healed professionals hurrying from their newly-developed flats into jobs in the city, alongside the folk who have lived in the area much longer.

Hopping in Blackheath

How many locals can afford flats starting at £367,500? Not many, I suspect. The new Woolwich Arsenal development on the left comes hard up against ‘old’ Woolwich on the right of Plumstead Road, marking a bit of a dividing line (though there are other new flats further afield):

New Woolwich left, old right

Is there a Plan B for the less well-off residents of Woolwich, or will they be priced out of the area?

Plan B

The old covered market directly faces a parade of brand new, and as yet unoccupied, units that are covered with hoardings selling an upmarket urban lifestyle dream of Sunday brunch in a café bar with artfully distressed brickwork.

Plumstead Road Covered Market

But I digress.

Hop Stuff is a very interesting brewery, run by a thoughtful and very friendly team. I look forward to drinking some more locally-produced beer (especially that porter when they release another keg), and the Taproom sounds like it will be worth a visit. They may be about to out-Zero Degrees Zero Degrees.

Posted in beer, drink | Tagged , , , , | Leave a comment

Tomorrow Never Knows, chapter 1

Instead of finishing the various stories I have have hanging around (including the one that’s The History Boys meets An Education meets Doctor Who, that one is a doozie) I started a new one. I’m stumbling after 4 chapters so I offer up the first draft of the opening to shame me into either finishing it or shutting up.


Monday evening
Up here in the attic I can only hear my alarm clock ticking softly and the distant sound of a train chugging along the main line. I expect it’ll pass the house soon and I’ll see its smoke rising from behind the trees. It’s been raining all day and I’m bored. There was nothing on the wireless. Nothing I wanted to listen to, anyway. Just the usual boring old music dad likes and tedious talks about rationing and keeping the enemy at bay. It’s always the same.

It’s lucky my room has a good view or I’d just go totally insane. On a clear day I can see the sea, and the castle on the island. Today wasn’t a clear day.

Even though it’s almost August, I’m frozen. This morning I tiptoed downstairs and asked dad for some coal for my room and he almost bit my head off. He threw the newspaper at me. The headline was about coal shortages.

“You should read the news sometimes, Kim, instead of just reading old novels.”

This is a bit rich coming from him. He’s the town bookseller, you see. My reading of the old books tells me that once upon a time that would have been a lowly job. Not any more. He’s one of the most important people in the parish.

He was sitting in the old waiting room eating toast and writing a letter. He had a small fire going. He saw me enviously eyeing the warm coals.

“It’s for the customers. And we’ve got to keep the damp away from the stock. And Mrs Hopper. She’ll be in soon; she feels the cold at her age.”

I snorted and took the paper back upstairs with me. I’m supposed to help out in the shop in the summer holidays, but I’ve had a bad cold and I’m using it as an excuse. Got to admit I’m bored though, even after a week. I’ve already read both the Dodie Smith books we have in the shop, carefully so they can still be sold, and Emma for probably the ninth time. We’ve got loads of Jane Austen so I could read that anywhere and not worry about damaging the stock. I might read To the Lighthouse next. Dad says I’m not old enough, but Miss Danks put it on her reading list. Both of these facts make me want to read it very much.

The newspaper was pathetic. Eight badly-printed pages, tissue paper with type all smudged and misaligned, not like some of the beautiful books we’ve got downstairs in the shop which have lovely creamy, thick paper and beautiful letters. It was mostly news from London, boring stuff about the governments and telling us how everything is better than it really is. Hardly any pictures, except some adverts. Someone’s making a new wireless with shortwave and a record player built in. I’d love one of those. Might ask dad about my birthday present I never got. This year. Or last.

I was right. There goes the steam from the express train, heading North up the coast. A strip of sky has appeared just above the horizon in time for me to see the setting sun. The bright orange light is dazzling me. It’s painful, but it’s been so damp and dark today, I want to drink it in forever. Dad says sunsets make him feel sad. He’s crazy. The castle looks beautiful in silhouette. I think this a sign.

I wish we had a camera. Dad says we might get one next year. Like everything else I’m promised next year. If all our ships come in, what an amazing year 2035 will be.

Posted in fiction, literature | Tagged , , , | Leave a comment

Code making and breaking activities in Scratch – part 1

When I was a kid I loved making codes and still vividly remember my brother teaching me about simple substitution cyphers; I’d write messages and he’d then try to break them by looking for patterns and common letters like E to guess what offset I’d used. These were Ceasar Cyphers, or what in later life I would know as ROT13, where you shift each letter of the alphabet along by a certain number of letters. Both the sender and the recipient need to be using the same offset number, so some sort of prior communication is needed.

An offset of 3 would look like this:

ABCDEFGHIJ
DEFGHIJKLM

So A becomes encoded as D, B becomes E, C becomes F and so on.

I learned a hard lesson when my brother decoded one of my messages almost instantly. It turned out I’d left the plaintext message on the bottom of my code paper and hadn’t crossed it out well enough. He could still read it. ‘That’s not fair!’ I cried. ‘All’s fair in love and war’ came the reply. And indeed it was human errors like that that helped codebreakers in Bletchley Park break German World War 2 codes like Enigma. Many, many years later I taught a Year 5 lesson on the anniversary of D-Day in 2014 about codes and other things, and the same thing happened. One child caught another reading her plaintext. ‘That’s not fair!’ – which led to a discussion about the ethics of espionage in wartime.

So, everyone loves codes and cyphers, right? They make great coding activities as pairs of children can encode and decode secret messages whilst at the same time learning a bit of computer code, including how arrays, or ‘lists’, work in Scratch

My first project is a really simple substitution cypher, a bit like ROT13, only you can choose any offset, not just 13. You click on a sprite and it asks you for the secret number – this is the offset, or how many letters along the alphabet each letter is going to be shifted.

Here’s how to use it: you click on Scratch cat to make a simple cypher that reverses your plaintext. You can use this a back slang generator (or decoder) – discover where the word ‘yob’ comes from!

Click on Nano on the top right to encode your plaintext message. You’ll be asked for the offset value (the ‘secret number’) and Nano will give you an encoded version of your message. You decode a message by giving it to Pico, in the middle. Note that if the offset is 13 you can use either Pico or Nano for encoding or decoding, but if you use any other number you’ll need to pick the right sprite for the job. (It doesn’t handle spaces or numbers – you might want to do that as an extension activity. If you do, you may think about whether spaces make your cypher easier to crack).

This is the code for the encoder:

Blocks for encoding

This is how it works.

First it asks you what numerical offset you’d like to use, and puts this in a variable called offset. (There’s no error handling here if you type in 0 or letters – you might want to add that as an extension).

It then asks you for your plaintext message – the text you want to encode to keep it safe from prying eyes before sending it on. It puts your unencoded in a variable called plaintext.

You’ll then see a nested loop (a repeat loop within a repeat loop). The outer one repeats for the length of the message and keeps track of how far through the message it’s got using a variable called offsetcounter (which is a confusing name, I really need to change it). It does this to step through each character of the plaintext to analyse and encode it.

The inner loop runs 26 times (the length of the alphabet) for every character of the message. Each letter of the alphabet is held in a list (or array) called alphabet. It has to do this because, unlike some programming languages, I don’t think Scratch has an inbuilt way of turning text into numerical values. Nor do I think Scratch has a block that will find the numerical position of a given string in a list (though I may be wrong), which is why it has to test every character in the plaintext against the alphabet list to find that character’s numerical position in the alphabet, which is put in the alphacounter variable.

Each letter of the message is, in turn, put in a variable called temp. The code then runs through all 26 letters of the alphabet until it finds a match for the letter:

if (temp) = letter (offsetcounter) of (plaintext) then...

If this is true, we can get encoding!

The next line of code is quite complex, so let’s break it down.

Scratch blocks that do the encoding

We use the join block here. This is a string-handling block that allows you to glue text variables together. Our coded message is stored in a string (text variable) called code. Each time we encode a new letter we set the code string to be the message we’ve encoded so far, plus the new encoded character. That’s what the outer green join block does – look carefully how the colours overlap!

Let’s zoom in on the bit we’re adding each time:

Adding encoded text

item () of alphabet

is picking the coded letter from the alphabet, moving it on by the offset by picking item number alphacounter + offset. It’s a bit hard to see but there are two overlapping green blocks, one to do that adding, and another mod block.

Mod is short for modulo, or modular arithmetic. There’s an article on Nrich (that goes into way too much detail later on), and this really good article by Kalid Azad shows some great examples of why modular arithmetic is a useful trick to have up your sleeve: http://betterexplained.com/articles/fun-with-modular-arithmetic/

We need to use modular arithmetic for a couple of reasons. It’s best to think of our encoding not as sliding two lines of the alphabet along side each other (like I did at the top of the page), but as a circle (thank you tef):

Explaining modulo arithemtic to KS2 kids

This better shows what happens when you get to Z. What happens if I want to shift Z on by 3 letters? We cycle back round to the start again, so

TUVWXYZ
WXYZABC

So, with an offset of 3, Z in the plaintext becomes C in the encoded message.

Modular arithmetic also useful because I think it allows you to use offset numbers bigger than 26 – though they will be just the same as smaller numbers, but it helps avoid errors. Note that a secret number of 52 gives you the plaintext back again – why is this? Because 52 is twice 26. 52 mod 26 is zero, so you’re not doing any encoding at all!

The Scratch code is further complicated by the fact that there’s a special case when the encoded letter is Z. I’ll be honest, this was a bug I only spotted just as I was about to publish this and I ran the whole alphabet through it and noticed Z was missing from the coded message. If you encode WILL with an offset of 3, you should get ZLOO, but I was only getting LOO.

Useful debugging tips: display all your variables, add sounds like a drum and pauses inside loops to track what is going wrong. I found that the problem was caused when I was at the 26th letter of the alphabet (Z). 26 in modulo 26 is ZERO! And there’s no zeroth letter of the alphabet, so I catch this with

if alphacounter + offset = 26 then...

and manually set the encoded letter to z.

This is annoying because I had some reasonably elegant code, and now I have to test for a clunky exception right in the middle of it. Welcome to coding!

The decoder does the same process but in reverse.

Now this is fun, but it’s not a great cypher. It’s very easy to crack, partly because each letter is always encoded as the same letter making it possible to do frequency analysis if you have enough text to work on. The letter E is the most common letter in the English language, so if the most common letter in the coded text is J, you can be fairly sure that J is really E. That may suggest an offset of 5, you shunt all the other letters of the message back 5 places in the alphabet and see if the message makes sense.

Another flaw with substitution cyphers is that they allow you to spot patterns like double letters. If I encode the word HELLO using different offsets I get YVCCF or EBIIL or OLSSV. If you have an idea what the word may be, say a greeting at the start of a message, then that gives you a way in to breaking the code.

Which is why in the next session, we will make our code more cunning and harder to break by building a very simple Enigma machine in Scratch.

Posted in computers | Tagged , , | Leave a comment

Another music in a different kitchen

Dansette record playerI’ve long wanted some sort of solution for centrally storing and serving music for listening around the house. There are all sorts of commercial products (like Sonos) out there, some eye-wateringly expensive even without any storage, plus numerous open-source projects, better suited to my low-budget, Raspberry Pi-filled household. But, unless I’m missing something obvious, nothing seems to do exactly what I want. Not the commercial products, not XMBC / KODI, not Volumio, not Rune Audio (more on them later), not DLNA/uPnP servers, not headless MPD servers, not VLC… not anything. I’ve tried several of these, they all have their uses. But they don’t quite fit. Or quite work (as I type this, Volumio’s web interface has hung for the millionth time).

Here’s what I’d like to do: I want to hold all our music in some central point in the house, on a solid-state low-power device that’s always on (so this rules out a normal hard disk-drive NAS, using an old laptop or desktop computer, but suggests a RaspberryPi may be employed.) I may want to play the audio back on the device hosting the audio, but that’s not essential. What is essential, is to be able to play the audio on a laptop or desktop, and probably on an iPad or iPhone (via Airplay?) or Android phone or tablet. And possibly on a standalone RaspberryPi in the kitchen. I’d also like to listen to internet radio stations on the kitchen device.

Most solutions seem centred around having a device in the living room, plugged into the network via ethernet and plugged into the ‘hi-fi’. Do you remember hi-fi? It was big in the 70s and 80s. But it’s the space age now, and I don’t have a hi-fi in the living room, nor indeed do I spend any time in there, aside from finally sitting down at 9.50pm and falling asleep in front of the Ten O’Clock News.

My life just isn’t like that any more. I don’t sit in my arm chair, equally placed between two speakers, stroking my finely-chiselled cheekbones like Pete Murphy (out of off of Bauhaus) in a 1980s Maxell cassette tape TV ad. I never had cheekbones, even then. And Bela Lugosi’s dead.*

Volumio media playerVolumio and Rune Audio are forks of Raspify – or Rune is a fork of Volumio, I forget which. It looks like it was an acrimonious split, like The Human League splitting and becoming Heaven 17 and, er, The Human League. Or like Arduino splitting and becoming Arduino and, er, Arduino. Anyway, they are complete operating systems you install on your RaspberryPi (or similar) to play audio through an analogue output or USB DAC. These solutions tend to assume your device stores audio (or accesses a NAS) and plays it locally on a directly-connected hi-fi, but the device does not serve the audio files to other devices, which is something I need. They look cool though – both have lovely, responsive web interfaces to act as remote controls. Volumio is based on Raspbian, Rune on Arch Linux. Of the two I found Rune slightly snappier (more responsive), plus it showed album art and had a few more menu options. Even so, I wasted most of a day yesterday (but hey it was raining and I had to wait in for a John Lewis delivery that never appeared) trying out both – with limited success.

Rune Audio's web interface on a desktop computer

First problem: my audio was all on a 64GB exFAT-formatted Sandisk USB stick. It took 3 hours to copy it all there off an old iMac, so I was reluctant to change the format of this. Volumio and Rune Audio are both supposed to support exFAT drives. Except the drive never mounted in either. The OS could see it at command-line level, but the USB stick never showed up in the web interface. I tried a FAT32 stick – it showed up immediately. So I reformatted my 64GB stick as FAT32 and copied all the audio again – this took another 3 hours. (Having my audio on a drive formatted as something like FAT32 or exFAT is important because I want to be able to add audio to it on a Mac, ruling out NTFS or Linux disk formats).

I think I may have been using Rune Audio by this point – I’ve lost count of the number of times I’ve re-imaged SD cards for RaspberryPis – though I did discover a great OS X utility for doing this, Apple Pi Baker. Anyway, Rune Audio mounted the 64GB FAT32 USB stick and indexed it pretty quickly. It played audio off it! I had fun building playlists on the fly and listening to tracks I’d not heard for ages. The circular volume and progress controls in the web interface work really well.

But I could not get Rune Audio to work wirelessly. It wouldn’t even boot with one wifi dongle attached, and with my regular Edimax wifi dongle it could browse local wifi networks, but refused to join ours. I tried command line tools. No luck. So I reflashed the SD card as Volumio again, mounted the USB stick ok, indexed it (a bit slower), played audio, had to use the IP address for the web interface as the volumio.local address wasn’t working…

So it looked like I had some of a solution. The Volumio RaspberryPi wouldn’t serve audio to other clients, as far as I could tell, but it was playing audio off my 64GB FAT32 USB stick. I even got internet radio to work, which I’d struggled with previously. Then I moved it into the kitchen. At first all seemed good. It played, I controlled it from my phone. Then it hung. It hung a lot. I tried pinging it. 25% packet loss. The darn thing kept falling off the wireless network, sometimes never rejoining it. I moved it to a better location, though it had been in the same spot I’d used the same Pi & wifi dongle previously with no problems to listen to Fip. Still it kept dropping off the network.

I was about to give up entirely, when I noticed something on the back of my broadband router – a USB socket. My old O2 box had acted as a server, but they got bought out by Sky and the replacement Sky box didn’t have a USB socket. I never even checked our new BT one, but there it was – a USB socket, which accepts FAT32-formatted USB drives and will serve them (slowly) as Windows-style SMB shares. Not exactly a DLNA/uPnP media server, but there are some advantages to using this. First, cost: the broadband router is already here, and it’s always turned on anyway, so there’s a zero cost overhead. Secondly, SMB may not be the most media-friendly (or Mac-friendly) way of dishing up files, but at least it makes the files equally available to any device on the home network that will mount or play off an SMB share. I found I could play files in the Finder on my MacBook Air (though directory listings were painfully slow). KODI (XBMC as was) on my MacBook seamlessly indexed and played audio files off the stick in the router (it will also turn your Mac into an AirPlay receiver). I even found an iOS app called BUZZ Player which is a bit clunky, but it too would play audio files off the router.

So that left me with my RaspberryPi with Volumio installed (now connected by ethernet in the living room, where I don’t listen to music). I tried to mount the SMB share a few times and it didn’t work; I was probably doing something wrong, but it then transpired that Volumio gets very upset when you try to delete or ‘unmount’ unsuccessful shares. It goes into a sulk. It hangs. It’s all but useless.

So I may give Rune Audio one more try to see if I can mount the router’s SMB share in it, hoping that I one day solve the wifi problems. I may even see if I can get a DLNA/uPnP server running somewhere – perhaps even on the same Pi?!

But I am starting to think that the best way of getting music around the house would be to put a Dansette in every room. Even in the kitchen. The platters that matter.

Are 'Friends' Electric?

*I have now discovered that I still know all the words to ‘Bela Lugosi’s Dead’. He didn’t die in vain.

Update

I’ve been playing with Rune Audio a bit more. I definitely prefer it to Volumio – it’s quicker and less crashy in my experience. I managed to mount the SMB share containing all my music on my USB stick on my BT broadband router and play audio off it, with occasional glitches (suggesting the BT Homehub is indeed slow serving files). After doing some command line magic to update it to the latest build, I even got it to join my wireless network in the living room, but still couldn’t get it to work in the kitchen. I swapped out the USB wifi dongle and it works better – it will join the wifi network in the kitchen, but the audio playback is so choppy as to be useless.

So it looks like Rune Audio (and Volumio) are great solutions for playing audio back when you can wire in your RaspberryPi (or similar) to the network by ethernet. But here’s the thing: as I type this (in the kitchen) on my MacBook Air, I am listening to audio off the same source (USB stick in the BT Homehub mounted as a SMB share), pretty flawlessly in the OS X version of Kodi. I’ve had occasional glitches, compared with constant glitches and pauses listening to the same source via Rune Audio on a RaspberryPi in the same room.

KODI media player on MacBook

So here’s what I think I will do: put my old netbook in the kitchen to play audio off the router’s SMB share and also use the Spotify client. I can still listen to centrally-held music anywhere in the house on my laptop, or even on my phone using an app like Buzz Player. Total cost: £0.00

Or perhaps I should rebuild that Pi as a uPnP/DLNA server…

Update to the update

I did rebuild that Pi as a uPnP/DLNA server, wired in by ethernet to my broadband hub. I used these instructions. It works pretty well and seems much faster than the BT Homehub serving up a USB stick as a SMB share. The only downside so far is that it doesn’t handle accented characters in file names, but I’m sure that can be fixed somehow.

Posted in computers, Linux, music, Raspberry Pi | Tagged , , , | 2 Comments