Sleep cycle

My son put me on to an app for monitoring sleep patterns. You put your phone next to your bed at night and the app listens out for noises and decides what the noises mean. It can sense the sound of your breathing and movements and from this decide whether you are awake, asleep, in deep sleep, snoring, talking.

These are my 6 days of using the app. The sleep patterns are all over the place and I couldn’t see a relationship between the patterns and how well I felt I had slept. Also, I suspect that the awake peaks in the middle of of the night are my wife going to the loo! I’m not sure how the app can work when there are two people in close proximity to the phone. With the app draining the battery 50% or more, my curiosity is exhausted and I’ve deleted it – at no cost.

Just another walk

On another 13 mile walk I came across this chalk hole, confirming that the North Downs is very much a chalky landscape. That’s a great tumbledown shed in the background!

I like this signpost

White bushes were everywhere

A typical path through the trees

In an enormous field populated by many sheep, interesting shadows

Slopes make for an interesting image

And near the end, a lovely tree and hedge

Sleep cycle snow

It’s the day after my birthday and I woke up to check the results of an app I had loaded onto my phone to monitor my sleep cycle – just a bit of fun. I don’t know whether this chart is good or bad. I woke up feeling grotty, but that’s normal. There doesn’t seem to be much deep sleep happening, but is that good or bad? I’ll see how the following nights go.

We weren’t expecting snow! By the time I got out for a modest hike it was no longer snowing, and on the return leg the snow had disappeared.

13 miles!

I extended my occasional 10-mile walk with an additional loop at roughly half-way, and what a delightful stretch it was. There were plenty of walkers out on a lovely spring-like day and I got chatting to a delightful man as he enjoyed his picnic. A retired headmaster, his walks were more like 3 miles and he seemed quite impressed with the length of my walk. Nice to have met you, David!

My first Python code

For a challenge I’ve tried to teach myself the Python programming language. It’s a big language with many features which I, as an ex-programmer from many decades ago, am unfamiliar with. But I’ve managed to write and test the code below, though I’m not sure I want to take this much further. I’ll see…..

import csv
from datetime import datetime
from operator import attrgetter
# A re-creation of my Reminder program from several decades ago!! My first Python program!
# Version 0.1 04-Mar-2021 In the beginning
# Version 0.2 07-Mar-2021 In the beginning 
# Version 0.3 07-Mar-2021 I'm finally happy!
class Reminder:
    def __init__(self, myRec):
        self.Date = myRec[0]
        self.DateTimeConversion = datetime.strptime(myRec[0],"%d-%b-%Y")
        self.Message = myRec[1]
# Function GetReminderData to get the reminder data
# Read each record in the file
# Ignore any blank lines 
# Add each record to the list myReminders
def GetReminderData(myFile,myReminders) :
    with open(myFile) as csv_file:
        csv_reader = csv.reader(csv_file, delimiter=',')
        line_count = 0
        for rec in csv_reader:
            if rec == []:
                line_count += 1
                p = Reminder(rec)
# Function HowManyDaysDifference to get the number of days between today's date and a text date
# This is my weird code - what a palaver!
def HowManyDaysDifference(TextDate):
    today_object =
    mydate_in_datetime = datetime.strptime(TextDate,"%d-%b-%Y")
    tdiff = mydate_in_datetime - today_object
    diff_in_days = tdiff.days
    if diff_in_days >= 0:
        diff_in_days += 1
        tdiff = today_object - mydate_in_datetime
        diff_in_days = -tdiff.days
    return diff_in_days
# Function PrintList to nicely print the data
def PrintList ():
    mySectionSeparator = "-" * 75
    tChange = True
    print ("\n" * 10 )
    print ("         Welcome to my Python Reminder program!")
    print (mySectionSeparator)
    for i in sorted(myReminders, key = attrgetter('DateTimeConversion')):
        nDays = HowManyDaysDifference(i.Date)
        if tChange and nDays > 0:
            tChange = False
            print (mySectionSeparator)
        if nDays == 0:
            t1 = "     Today    "
        elif nDays == -1:
            t1 = "   Yesterday  "
        elif nDays == 1:
            t1 = "    Tomorrow  "
        elif nDays < 0:
            t1 = '{:4d}'.format(-nDays) + " days since"
            t1 = '{:4d}'.format(nDays) + " days until"
        t2 = i.Date +t1
        print (t2,i.Message) 
    print (mySectionSeparator)
# This is the MAIN  program
myFile = 'C:/Users/Mike/Documents/Documents/MyPythonCode/Reminder.dat'

myReminders = []

GetReminderData(myFile, myReminders)


And the output is….