Wednesday 19 December 2018

Maintaining my fitness

In my last epistle I wrote about how my DelvFire was inspiring me to greater fitness. Averaging 10,000 daily steps over a week was always likely to be a challenge, and even more so in the dark, cold and wet winter months.

One friend suggested that I get myself a dog, but that's a non-starter. Happy I am to pet other folks' pooches but the thought of having to walk one of my own on cold, wet mornings is too ghastly to contemplate. Perhaps I've lived too long with cats. Another 'helpful' (?) suggestion was a daily walk to the newsagent but that didn't impress either. I just know that the Daily Whatsit would lie unread several times every week. A subscription to The Guardian Online suits me fine.

And therein lies the problem. There's very little that I have to do that involves much walking. Shopping might have been a contender if I didn't live at the top of a fairly steep hill. Walking down to the town is a delight, as is walking back up again, so long as I don't have much to carry. For my twice or thrice-weekly top-ups at Co-op I gladly resort to the car.

Oh, and before you're tempted to suggest it, I abhor gymns, even though (for my age) I think I look quite good in leggings and a lycra top. Spending hours walking, running, cycling or rowing and getting nowhere would soon blow my tedium valve.

What I needed was a moderate walk in lovely countryside and not too far from my home... and now I have one. I don't walk exactly the same paths every time but the basic route changes little. Most importantly, having done it several times in the past few weeks I can testify that it's not become the least bit boring. As well as the constantly changing forest scenery, there are people to meet, their dogs to pet, squirrels and deer to spot and even the occasional boar to snarl at.

Here are a few photos, taken recently as I walked.


Coal mining has left its mark throughout most of the Forest of Dean. This old shaft at Moseley Green is simply marked "Independent Coal Pit No.6 (disused)" on the 1904 OS 6 inch map. I bet it didn't look this pretty when it was operational.

This uninteresting spot always raises a smile as I walk past. On holiday here, several years ago, S- and I were caught in an enormous thunder storm. With the flashes and bangs growing ever closer together, we thought it unwise to stay among the trees, so crouched down here on the left with only an umbrella for shelter.  Then I remembered that the umbrella had a metal top!


At this point Blackpool Brook has flowed 2 miles from its source near Speech House. The next time I see it, it will have grown considerably.


 

Central Bridge is so called because it was supposed to carry the Severn & Wye Railway over the Forest of Dean Central Railway, but the latter was never built. On a grey December day it wasn't looking very colourful, so below is a picture of it in July 2014.  As I wrote earlier, the scenery of the forest is constantly changing.



I did say that Blackpool Brook would grow a bit! Malards Pike lake succeeds in looking beautiful at all times of the year. 



11,844 steps.  Mission accomplished.

Thursday 13 December 2018

Tracking my fitness

Back in September, a couple of days before my holiday in Wales, a new watch appeared on my wrist. But this was no ordinary watch –  it was a Delvfire Fitness Tracker.

This was yet another purchase inspired by my good friend Lucy, who had recently bought a FitBit and was singing its praises on her blog.  To start with I was highly sceptical about its usefulness and said as much, but gradually warmed to the idea. The Delvfire is a down-market version (£33, compared with £120) but I guessed that if I bought one, S-- would soon want one too. I was right! Six weeks later we were back on the Amazon website, buying a second.

The incentive has been to 'up' my fitness level. That, coming from a woman who enjoys rambling and hill walking may seem strange but the truth is that, apart from one or two longish walks every week (weather permitting) I've been living a fairly sedentary lifestyle.  That's not good.

My ambition is to average 10,000 steps a day over a one week period – something I've only achieved once, on September's holiday in Wales.


Here's a more typical week's result. Just look at Wednesday - a measly 1791 steps! My excuse is that I spent most of that day programming my Raspberry Pi computer and never set foot outside the door. Before donning my Delvfire, though, there would have been many days like that. It's a privilege of being retired, I suppose, but not always a good one.



The Delvfire lacks the data analysis and smart graphics of the FitBit but it does tell me a few more interesting things, such as (if I wear it through the night) my sleep pattern. Here my target is 7½ hours sleep every night and it's unusual not to achieve this.


One piece of data, however, I choose to ignore – the result for Resting Heart Rate. Take a look at this (click to zoom in for a clearer look)...


The trace shows my heart rate today. Apart from obvious periods of activity, my resting rate hovers around 55-60 and the average over the whole day is 59. But look at the 'resting HR' result – 73!  The Delvfire calculates that figure at midnight but it makes no sense to me. How can my resting heart rate be 14 beats/min higher than my average? Every day is similarly baffling.

At £33 I'm still getting good value for money, though. Perhaps one day I'll upgrade to a FitBit, but not just yet.

Saturday 1 December 2018

Raspberry Pi

For 12 years before retiring to the Forest of Dean I was a secondary school governor. Probably because my full-time work was technical, they made me the governor responsible for ICT - Information and Communications Technology. It was the nearest that the school got to teaching computing.

Many times I regaled the head teacher and anyone else who would listen, pointing out that all they were teaching children was how to use Microsoft Office, and doubtless enhancing that corporation's profits too. "We have to teach the syllabus," I was told. "Then the syllabus is wrong!" I would reply.

Within a couple of years of my leaving, everything changed with the introduction of the palm-sized Raspberry Pi. Here, at last, was a computer on which children, and grown-ups too, could learn real programming; a computer that could be connected to switches, relays, lights, buzzers and more. O how I wish that I could be back at that school to say "I told you so!"

The British-made Rasberry Pi was a runaway success. According to Wikipedia:
    More than 5 million Raspberry Pis were sold by February 2015, making it the best-selling British Computer. By November 2016 they had sold 11 million units and 12.5 million by March 2017, making it the third best-selling "general purpose computer". In March 2018, sales reached 19 million.

19 million Raspberry Pi computers... and I didn't have one. The shame of it! So earlier this year I bought a RasPi B+ and set about resurrecting my old programming skills. In truth, this was my second attempt at resurrection, for two years ago I confidently wrote this post, in which I declared my intention to learn a programming language called Visual Basic. I failed. Somewhere around lesson 6 I lost interest because I didn't have any hardware that I could program to actually DO something – turn lights on and off, ring bells, or even control the model railway.

Control the model railway? Now there was an interesting challenge, and one well within the capabilities of the Raspberry Pi. But could I learn to program it?

The favoured language for the Pi is Python so, as in 2016, I bought a book and avidly started reading and programming.  The language lacked the simplicity of the BASIC that I'd used at work, but learning it was a dream and before long I had the confidence to start writing a program for that model railway.

It was just like being back at work in the R&D unit – work that I loved.

Precisely what this program will do, I'll hopefully describe in a future post after it's all working, but here's a little bit of the code that I'm pleased to say is all my own work. It would probably make professional Python programmers weep, but I'm rather proud of it.

def timetable_main_display():
    tt=open('whereto.txt','r') # whereto stores pointer to last train working
    tp=int(tt.readline()) +1   # moves pointer to next train working
    tt.close()
    
    wkg = 0
    trow = 0
    noterow = 0

    import csv    
    with open('StPetrock timetable.csv') as csvfile:
        readCSV = csv.reader(csvfile, delimiter=',')
        for row in readCSV:
            wkg = int(row[0])
                                   
            if wkg > (tp-1) and wkg < (tp+5):
                # calculate timetable time in minutes
                if wkg == tp: 
                    ttime = row[1]  
                    if len(ttime) == 4:
                        tclockhr = ttime[0]
                        tclockmin = ttime[2:4]
                        tclock_in_mins = (int(tclockhr)*60)+ int(tclockmin)
                    if len(ttime) == 5:
                        tclockhr = ttime[0:2]
                        tclockmin = ttime[3:5]
                        tclock_in_mins = (int(tclockhr)*60)+ int(tclockmin)
                        
                trow += 1
                twkg = row[0]
                ttime = row[1]
                tfrom = row[2]
                tto = row[3]
                tclass = row[4]
                tupdown = row[7]
                tstore = row[8]
                if trow == 1:
                    tclass_next_train = tclass
                    tupdown_next_train = tupdown
                    
                display_timetable_line(trow,twkg,ttime,tfrom,tto,tclass,tstore)