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.


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….


Not an artist

What have I talked myself into? I casually suggested to my daughter that on a Zoom call I could do some painting with the little ones. So I invested in some gear, and here is my studio setup. My daughter suggested acrylic paints but I did find it all a bit fiddly squeezing bits out of tubes – oh for a paintbox! I think I’ve verified my opinion that I have no artistic skills as well as no shame, but early days, eh! If nothing comes of it I can pass on my materials to Chloe and Iris.

First review from the little ones:

“Iris said “wow!”…Chloe observed that you’d paid attention to that video you’d watched! And she wants to know where’s your next one!”

See my progress here….


Losing one’s way

With lots of Photoshopping I can knock off maybe 20 years, though my son’s first reaction was “That looks very odd!”. Well, son, that’s what I intended, so there!

Walking south and uphill there was still a fair amount of snow to be found on today’s shortish walk.

A couple of days ago I did a longer walk in the same area. Then, in much worse conditions, I managed to become quite disorientated. Today’s walk was to figure out how I’d managed to end up where I had – which I managed to do. When the conditions are poor and everything’s covered in snow, and when you’re not paying sufficient attention to your surroundings, it’s quite easy to lose track of one’s location - despite having, as I did, the Ordnance Survey map app and GPS on the phone! Just as well I was in North Surrey and not North Wales…


How to Remotely Troubleshoot Your Relative’s Computer

I have a friend who occasionally rings me up with his computer problems. Yesterday he called to say his annual anti-virus licence was going to expire that day. He confessed to having ignored the renewal reminders!

My experience with renewing McAfee anti-virus licences is that a) renewing from McAfee is ridiculously expensive, and b) not renewing from McAfee is never straightforward. My friend took my advice and went for the second option and purchased a McAfee licence from another company (InterSecure.co.uk). Inevitably the update wasn’t straightforward and wasn’t successful, hence his call for my assistance. In normal times I would probably have gone to my friend’s home, but these are not normal times.

I searched the web for how to remotely take control of someone’s computer and came across a very helpful page on the PCMag site “How to Remotely Troubleshoot Your Relative’s Computer“. Although I’ve had a career in IT support I’d never needed to do this before and this web page proved a godsend. The section on using a Windows 10 PC to take control of another Windows 10 PC was very straightforward and uses the Quick Assist tool (found under Windows Accessories). Having taken remote control of my friend’s PC I was able to install the new licence for his anti-virus software, though it wasn’t straightforward!!😎


Claude Shannon

I’m currently reading “The Idea Factory – Bell Labs and the Great Age of American Innovation” by Jon Gertner. It’s a Christmas present from my Berlin son and what a great choice it was! Bell Labs became an enormous laboratory for developing ideas and inventions at the start of the communication, information and technology industries we now take for granted. This book tells the history of Bell Labs and the leading engineers, scientists and managers.

Claude Shannon was one of those scientists and who has become known as ‘ the father of information technology’. I have a vague recollection of hearing about his work whilst I was studying for a computer science course. Now, some 50 years later, he appears in this very readable history of Bell Labs. Brilliant man that he was, it’s prompted me to look for a biography, and “A Mind at Play: How Claude Shannon Invented the Information Age” by Jimmy Soni and Rob Goodman has been well reviewed.

The biography is now on order from Postscript Books, a new mail-order company to me and which had the best price. I’ve added them to my menu of Links / Amazon alternatives. Their About page says “Most of our books are publishers’ overstocks and backlist titles…..Postscript has developed over the last 30 years, starting in south-west London in 1987 and then moving to south Devon in 2011“. An interesting business to find.