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 == []:
                pass
            else:
                line_count += 1
                p = Reminder(rec)
                myReminders.append(p)    
    csv_file.close()
#====================================================
# 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 = datetime.now()
    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
    else:
        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"
        else:
            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)

PrintList()

And the output is….


Berlin bookstores

I’ve just started reading this second-hand, 1973 paperback  - a Christmas present from my son’s German girlfriend. Admire the book’s yellow pages – it’s 48 years-old! The enclosed bookmark says the book came from one of the many Berlin bookshops selling English books.

Astonishingly, Berlin bookshops are considered ‘essential services’ during lockdown and allowed to stay open – we in the UK can only dream.

Here’s a rather nice article detailing ‘The best English bookstores in Berlin‘.