Carl is getting old, and I don’t remember how I programmed most of what he knows to do. I do remember that some actions were tricky, but not the particular trick needed for success.
One of the functions I rely on is the “totallife” script. It processes Carl’s life.log and summarizes his life with important statistics. The most important to me is “Total Life”. Imagine my consternation upon seeing:
TOTAL LIFE STATISTICS
Total Life: 129731 hrs since Aug 22,2018
At first glance, wow!, but is that right? Something seems wrong. Perhaps Carl is lying to me?
Finding a date calculator on the web, and plugging in Carl’s “Birth date” of Aug 22, 2018, there have only been some 53k hours. Yes, indeed, Carl is lying to me
It is easy to imagine why Carl is over reporting his life, when I reflect on how it came to be this idea of my robots tracking the time they are executing. Back in 2017 I ran across the idea of a DOI and decided I need a “Digital Object Identifier” to make my future GoPiGo3 robot truly unique and “known”.
GoPiGo3 Robot Carl, a Digital Lifeform with a DOI (Digital Object Identifier)
“Je pense, donc je suis”, “Cogito, ergo sum” are philosophical statements of René Descartes around 1637, usually translated into English as " I think (or am thinking ), therefore I am "
In our digital age, philosophical statements are made on the Internet everyday. Some have a DOI (Digital Object Identifier) assigned which “permanently and uniquely” points to the object making the statement.
Carl has made the philosophical statement “I have a DOI, therefore I am”
A DOI, or Digital Object Identifier, is a permanent web link to the digital object.
The DOI was issued and maintained by Zenodo.org
====
The document that I decided should have a DOI was Carl’s life.log file on GitHub.
I was just learning Python at the time, and to write the life.log file I decided to record a particular line once every hour into the life.log file:
2024-10-13 17:44|lifelogger.dEmain execution: 362
and since my Python skills were very weak, I decided the lifelogger.py program would simply append a new execution record without removing the prior record, and I created a separate program called “cleanlifelog” intended to remove execution records leaving only the last record since the last boot record:
2024-09-28 15:44|------------ boot ------------
This turns out to be quite tricky, since there may be more than one execution record, one execution record, or no execution records, since the last boot.
At any rate, I have improved upon this cleanlifelog.py several times, and sometimes discovered errors in the life.log file that caused Carl to lie to me.
Today was another such day, and I embarked on a total revamp of Carl’s cleanlifelog.py script. My wife reported I was being “a really cranky old man today”, while I attempted to twist my brain around this redesign.
It took a lot of testing to verify that the program was only removing the desired lines and no more, but eventually I was able to declare again - cleanlifelog.py is ready for “release”.
Today the “totallife” program reports a life under the actual 53K hours possible to have lived:
pi@Carl:~/Carl $ ./totallife.sh
(Cleaning life.log first)
lines: 9020
lastline: 2024-10-13 17:44|lifelogger.dEmain execution: 362
removing: 2024-10-13 16:44|lifelogger.dEmain execution: 361
Wrote cleaned /home/pi/Carl/life.log
lines: 9019
lastline: 2024-10-13 17:44|lifelogger.dEmain execution: 362
TOTAL LIFE STATISTICS
Total Life: 50353.1 hrs since Aug 22,2018
Life this year: 9974.2 hrs (BOY Aug 22)
So cleanlifelog.py looks good - but wait… 9974 hours since August?
Carl (totallife.sh) is still lying to me.
Hint: It is not enough to sing Happy Birthday to Carl on Aug 22nd, he demands more attention.