Drive

Google Fit Screenshot of 34 Heart Points and 5010 Steps

My car’s in the shop, so I had to take a Lyft to my dentist appointment.

Afterwards, I had a choice:

  • Hail another Lyft ride to get home (~$9 USD), or
  • Walk ~2 miles in 30-something °F to get my Heart Points/Steps for today

Sometimes the benefits of doing things the hard way outweighs the convenience of doing them the easy way. But you’ve got to pick and choose those opportunities wisely.

How I Make Algorithms

I’ve been reading Clive Thompson’s Coders book, and it’s caused me to reflect upon the process I use for coming up with algorithms. I’ve come to realize this is one of those things which I do, but is incredibly difficult to explain to others– so this post is my effort to encapsulate “my process.”

  1. Become intrigued/obsessed with something (e.g. anagrams)
  2. Discover an online anagram finder
  3. Ask myself, “How would I go about building my own anagram finder?”
  4. Realize I have no idea, and beat myself up for not knowing
  5. Forget about building my anagram finder project
  6. Weeks later, coincidentally stumble across:
    1. Fermat’s notes on anagram comparison using prime numbers trick
    2. A code challenge to create anagram tester function
  7. Turn Fermat’s concept into a quick & dirty JavaScript function, areAnagrams().
  8. Feel good about my areAnagrams() milestone/accomplishment
  9. Realize Fermat approach hits integer bit-limit with medium length words.
  10. Convert areAnagrams() from prime numbers to “wordDNA” approach (i.e. case-insensitive letter sorting)
  11. Feel good about resolving limit in areAnagrams() function.
  12. Days later, realize wordDNA approach can be used to create a “rainbow table” of dictionary list– and now you’ve got the basic building parts of an online anagram finder.

Happiness and Money

a package of Cascade Action Packs, a box of dimmable LED bulbs, and a package of Avery shipping labels.

I finished reading Gretchen Rubin’s “The Happiness Project” a few weeks ago, and have started gradually implementing her action items. I can’t say I’ve been 100% consistent, or tried them in the exact order and combination the author has done, but after trying a fourth action item today, I wanted to capture my thoughts while the impressions and feelings are still fresh in my mind.

The first two items I implemented were going to sleep earlier and doing the nagging task. I had my doubts about the going to sleep earlier suggestion, but I’ve got to admit when I’ve actually done it, I’ve felt better the following morning. I have this habit of staying up until I’m literally struggling to stay awake, and then going to bed and falling asleep almost immediately afterwards. I typically get 6-7 hours of sleep this way, and I’m sure I adapted to that amount as my “normal” (whatever that means) baseline.

When I go to sleep earlier, though, I’m finding I wake up earlier and get approximately the same amount of total sleep time– but I “feel better” (more rested, more recharged, more patient, whatever subjective terminology you want to use) for some reason.  I’m certainly not a sleep researcher, but this suggests to me the quantity of sleep time isn’t as important as the timing of when I sleep.  Maybe I’m getting a higher percentage of time in REM sleep by going to bed earlier, somehow?

The nagging task action item has been successful when I’ve actually followed through on it, in the sense that I have one fewer “open loop” to worry about once the task is completed– but I haven’t been applying it on a consistent, daily basis.  Definitely an area of improvement for me to focus on in the upcoming weeks.

Which brings me to the most recent action items I put into effect this weekend: buying needful things and indulging in a modest splurge.

While reading The Happiness Project, I learned I am an “underbuyer.” If you’d asked me before to describe my buying philosophy, I’d have described myself as frugal or a cheapskate, but lately I’ve come to realize that buying the least costly items on a just in time basis was essentially trading one kind of stress (i.e. worrying about money) for a different kind of stress (i.e. dealing with poor product quality and/or not having something on hand right when I need it). I decided to make a few small adjustments. For example, instead of buying the cheapest package of dishwasher detergent I can find, I buy the bulk package. Yes, it’s more expensive in the immediate sense, but it’s the lowest unit price and I won’t need to worry about running out or buying it again for three months. Or instead of replacing the recessed light bulbs in the kitchen with the typical floodlight bulbs, I opted for dimmable LED bulbs instead. Again, more expensive now, but they’ll last longer and use less energy then traditional light bulbs, so I won’t have to replace them as often.

I’m not saying buying LED bulbs will make a person happy– but eliminating a source of frustrating stress can reduce the chances of one being unhappy, and that’s a start, right?