Welcome to my Failing Memory. This is really just a place for me to keep my memory; a collection of quotes, verses, snippets of code, and all the building blocks that I have used here and there and figure I'll want to use again. Unfortunately I rarely remember that quote or story or where I first used something it in order to find it again or I can't find the base version that hasn't been customized to some specific scenario. That means more often than not, I am reinventing the wheel over and over again.
How heavy is this glass of water. 8 oz? 12 oz? 16 oz? The absolute weight of the glass doesn't matter. It depends on how long I hold on to it. If I hold it for a minute, nothing happens. If I hold it for an hour, my arm will begin to ache. If I hold it all day long, my arm will feel numb and paralyzed. The weight of the glass hasn't changed. But the longer I hold on to it, the heavier it becomes.
The stresses and the worries of life are like this glass of water. If you think about them for a little while, there's no problem. Think about them for a little bit longer, it begins to hurt. You think about them all day long, you'll feel paralized, incapable of doing anything.
Always remember, put the glass down.
When you meet someone new, don't ask: What do you do? It limits what people share about themselves to a job description.
Instead, try: What do you love to do? It ignites curiosity and invites people to express their distinctive interests.
If you choose not to find joy in the snow, you will have less joy in your life but still the same amount of snow.
Perhaps the central dysfunction of modern education is learning about someone instead of from someone. When you read a summary of Plato by a textbook author or a YouTube video, you are not receiving Plato. You are receiving a digestion of someone else's interpretation of Plato. (And digestion is a process that extracts what the body finds useful and discards the rest. You are, in effect, eating someone else's leftovers and calling it a meal.) Everything that doesn't fit the lesson plan or world view is lost. A textbook gives you the answer. Plato gives you the question and the argument. And it is only in the argument that your own mind is engaged so it grows and develops. Otherwise you are simply receiving and storing, like a warehouse.
What the nineteenth century understood, and what we have largely abandoned, is that the purpose of education is not employment. It is not the acquisition of a credential. It is the formation of a person — the construction of an interior life sufficiently rich and well-ordered that the person can think, judge, feel accurately, and act wisely.
A man who has only his professional training is, in the deepest sense, unprepared for life. He can do his work. But when his work is done, when he is faced with grief or injustice or a decision of real moral weight, he has no resources. He has no conversation with the past. He has no framework. He is, in the old phrase, a half-educated barbarian.
— Paraphrased from Quinn's Story by writer 406
Reading Atomic Habits by James Clear, this hit strong:
Motion makes you feel like you are getting things done. But really, you are just preparing to get something done. Motion allows us to feel like we are making progress without running the risk of failure. When preparation becomes a form of procrastination, you need to change something. You don't want to merely be planning, you want to be practicing.
It explains perfectly my recent Words of the Year: Go, Now, and Bite; each of which represents a shift from motion to action.
"The best is the enemy of the good" — Voltaire
"If successful AND unsuccessful people share the same goals, then the goal cannot be what differentiates the winners from the losers. Goals are good for setting a direction, but systems are best for making progress. You should be more concerned with your current trajectory than with your current results." — Atomic Habits by James Clear
In trying to identify a word to focus my trajectory for the year I seemed to be scattered all over the place. After a year of searching but not finding a "Mountain Cabin," I was starting to get frustrated and was concerned that I would compromise or make a snap reaction. Since I cannot control which properties are on the market, the word Patience started my short list. I also though of DoIt since after you get a Round ToIt, then you need to DoIt. Another idea was Bite, meaning one step at a time, a play on how you eat an elephant (one bite at a time.) And I also considered the word Action, which extends upon the two previous words; Go and Now.
Patience is a passive word, implying reaction to outside influences but no focus. Action and DoIt show movement and progress, but also lack direction. Bite extends upon the action of Go and Now by continuing to take one step at a time, regardless of the size of the step. This also breaks the stranglehold of Procrastination and Perfectionism.
I am not a Very Important Man, as importance is commonly rated. I do not have great wealth, control a big business, or occupy a position of great honor or authority.
Yet I may someday mould destiny. For it is within my power to become the most important man in the world in the life of a boy. And every boy is a potential atom bomb in human history.
A humble citizen like myself might have been the Scoutmaster of a Troop in which an undersized unhappy Austrian lad by the name of Adolph might have found a joyous boyhood, full of the ideals of brotherhood, goodwill, and kindness. And the world would have been different.
A humble citizen like myself might have been the organizer of a Scout Troop in which a Russian boy called Joe might have learned the lessons of democratic cooperation.
These men would never have known that they had averted world tragedy, yet actually they would have been among the most important men who ever lived.
All about me are boys. They are the makers of history, the builders of tomorrow. If I can have some part in guiding them up the trails of Scouting, on to the high road of noble character and constructive citizenship, I may prove to be the most important man in their lives, the most important man in my community.
A hundred years from now it will not matter what my bank account was, the sort of house I lived in, or the kind of car I drove. But the world may be different, because I was important in the life of a boy.
— by Forest E. Witcraft
While hiking the Colorado Trail in 2024, I came to the realization that the dream of someday having a "Mountain Cabin" was no longer acceptable. The peace and joy I experienced on the trail should be a daily occurrence. Someday needed to be Now.
In conjunction with starting an active search for a Mountain Cabin I felt I needed to address a long-term struggle with needing to "see" all the steps to complete a project which tended to appear to others as Perfectionism or Procrastination. So focusing on Now could help in several ways.
When dealing with strings, rather than using substr / substring, these special comparison operators can be used instead.
javascript ...
$( "div[id^='view']" ).hide(); // div ids that start with 'view'
$( "div[id$='dark']" ).hide(); // div ids that end with 'dark'
$( "div[id*='scheme']" ).hide(); // div ids that contain with 'scheme'
...
css ...
[id^="view"] { display: none; }
[id$="dark"] { display: none; }
[id*="scheme"] { display: none; }
...
I wrote a static page with multiple elements that I kept adding the new items at the bottom. After the page accumulated a large number of elements, scrolling to the bottom to find the latest entry became cumbersome. So using the following code, all the element objects are returned as an array, that is then reversed, and appended back to the container.
jQuery ...
var elements = $('figure').get()
elements.reverse()
$.each(elements, function(index, element) {
$(element).appendTo("#contentContainer");
});
... A coworker's daughter was thru-hiking the Continental Divide Trail (CDT) and shared her GPS tracker. Virtually watching her hike brought to my attention the Colorado Trail (CT) which shares 234 miles of trail with the CDT. I had no desire to hike the long trails, but at 486 miles, I thought the CT might be something I could do.
After a year of planning, indecision, and questioning if a thru-hike was realistic at my physical fitness and age, it seemed rather obvious that if I didn't start, then I would just continue to wonder. What I needed to do was don't question, don't worry, and don't hesitate; instead I needed to be prepared, be in the moment, and Go.

After my wife leaving and going though a divorce, I needed to stop looking back at was and what could have been and focus on the future. What I needed to do was Focus but also continue to Recover. So I chose Renew as my word for the year.
My cancer diagnosis and surgery in 2019 focused my search for a Word for the Year. The initial thought was Survivor but that seemed to have a negative or backwards looking focus. Searching for a word with a more positive connotation resulted in ideas like Vanquisher, Conqueror, and Overcomer. While positive, these were backward looking terms. Options like Endurer, Persister, Live, and Outlasted were indictive of the present time but also of a more passive nature. More synonyms resulted in words like Oblique, Emerge, Perspective, and Direction which directly lead to the word Forward as a focus for the year.
Flatirons Kids Ministry introduced the idea of Word of the Year. Rather than a resolution that was a narrow target of success or failure, they suggested a word that could focus thoughts and decisions over the course of the whole year. I had just become an empty-nester and had a lot of open, unscheduled time and had also just resumed mountain climbing. The word I choose was a multifacitted idea to keep looking up, moving up, and coincidently also the name of the Kids minisitry: Summit.
For documentation on this site, I'm using the highlight.js library to automatically do the syntax highlighting of the code.
<head> ...
<link rel="stylesheet" href="/path/to/styles/default.css">
<script src="/path/to/highlight.min.js"></script>
...
<script>hljs.highlightAll();</script>
...
This will find and highlight code inside <pre><code> tags; it tries to detect the language automatically. If automatic detection does not work for you, you can specify the language in the class attribute:
<body> ...
<pre><code class="language-html">...</code></pre>
...
The facts of life are facts and, as such, they can’t be violated. Any and all attempts to violate these facts are doomed to failure. It doesn’t matter how clever one is, there is no way to violate these facts. Plans that require a fact of life to be suspended, even for a moment, are doomed to fail.
Life is not fair.
No one is exempt from death.
Physics rules the universe and biology rules life.
The universe does not care.
The only constant in life is change.
There is always a choice.
Wishing never makes it so.
A person can't exceed their limits.
A person is responsible for their own happiness.
It is impossible to change the character of another.
From "The Millionaire Next Door" by Lazlo Zalezac.
Build a query string to search all columns in a table for a term.
mySQL ...
$result = getDataSet("SHOW COLUMNS FROM $table");
if (mysqli_num_rows($result) > 0) {
$i = 0;
while ($row = mysqli_fetch_array($result)) {
if ($i == 0) {
$sql = "SELECT * FROM $table WHERE " . $row['Field'] . "=" . $condition;
} else {
$sql .= " OR ".$row['Field'] . "=" . $condition;
}
$i++;
}
}
echo $sql;
...
For the websites that I administer, I was looking for an easy way to access the admin portal without having to enter the full URL every time. Remembering the 1995 movie "The Net" I figured a small hidden link would be the ideal solution.
<body> ...
<div style="position:fixed; bottom:2px; right:2px">
<a id="pi"
style="cursor:default; color:#dddddd; font-family:times;"
href="index.php">π</a>
</div>
...
jQuery ...
$("a#pi").click(function(event) {
event.preventDefault(); // better than return false;
if( event.shiftKey ) {
console.log("pi shift click");
$('.admin').css('visibility', 'visible');
$("#tabs").append('<li><a href="admin.php">Admin</a></li>');
}
});
...
Sometimes it is desirable to have content in separate tabs instead linking to separate pages. This is the method I use.
...<body> ...
<div id="tabcontainer">
<ol id="tabs">
<li id="One" onclick="setTab('One');">One</li>
<li id="Two" onclick="setTab('Two');" class="current">Two</li>
<li id="Three" onclick="setTab('Three');">Three</li>
</ol>
</div>
<div id="TabContentOne">Lorem ipsum dolor sit amet</div>
<div id="TabContentTwo">consectetur adipiscing elit,</div>
<div id="TabContentThree">sed do eiusmod tempor incididunt</div>
...
css ...
#tabcontainer {
position: relative;
left: -1em;
width: calc(100% + 2em);
height: 24px;
margin: 0 auto;
border-bottom: 1px solid #000000;
clear: left;
background-color: #ffffff;
}
ol#tabs {
padding-left: calc(1em + 10px);
}
ol#tabs li {
float: left;
width: 102px;
height: 23px;
margin: 0 4px 0 0;
border: 1px solid #000000;
border-radius: 8px 8px 0 0;
list-style-type: none;
cursor: pointer;
text-align: center;
background-color: #c0c0c0;
}
ol#tabs li.current {
border-bottom: 1px solid #ffffff;
background-color: #ffffff;
}
...
jQuery ...
function setTab(v) {
$("#tabs li.current").removeClass("current");
$("#tabs li#" + v).addClass("current");
$('div[id^=TabContent]').hide(); // string starts with
$('div#TabContent' + v).show();
});
$(document).ready(function() {
setTab('Two');
});
...