by Eric on February 6, 2019

A toy program for demonstrating Python functions:

#==============  readChoice ==============  
def readChoice():

    choice = "bogus"
    while choice not in("S", "D", "R", "N", "E"):
        #**** Functions can invoke other functions. Here we're invoking the print() function.
        choice = input('Choose from the functions above: ').upper()


#==============   readX ==============
def readX():

    hasGoodX = False
    while not(hasGoodX):
            x = int(input('Enter your x: '))
            hasGoodX = True
        except ValueError:
            print("Try again. x must be an integer.")


#==============  printResult ==============
#****** Functions can accept many arguments. Here we're accepting a string and 2 integers.
def printResult(funcName, originalX, result):
    print("The " + funcName + " of " + str(originalX) + " is " + str(result) + ".")

#==============   square ==============
def square(x):
    return x * x

#==============   double ==============
def double(x):
    return x + x

#==============   reciprocal ==============
def reciprocal(x):
    return 1/x

#==============   begin main program ==============
choice = "not E"
while(choice != "E"):
    choice = readChoice()
    if (choice != "E"):
        x = readX()

    if (choice == "S"):
        printResult("square", x, square(x))
    elif (choice == "D"):
        printResult("double", x, double(x))
    elif (choice == "R"):
        printResult("reciprocal", x, reciprocal(x))
    elif (choice == "N"):
        print("Rats! I forgot to implement Negate. Why don't you try it?")


Life as an Engineering Exercise

by Eric on January 10, 2019

Reading time: 4 minutes

Consider your smartphone. Specifically, consider the various engineering decisions baked into its design.

The engineers can make the screen bigger. More screen real estate means better video viewing.
But then it won’t fit in your pocket as well. It will also be tougher to operate with one hand. Battery life will decline, too.

They can increase battery life by increasing battery size.
But that bigger battery will make it heavier.

They can use more plastic and less glass. That will make it lighter and possibly cheaper.
But that probably means reduced durability.

They can make it faster by including a stronger processor.
But that will reduce the battery life. It will also increase operating temperature.

Your phone’s design balances many trade-offs: weight, safety, size, usability, power consumption, privacy, cost, etc. Tuning any of these knobs affects the others. The important question facing phone (or automobile, or home, or aircraft, or any other) engineers is: “Which knobs should we optimize and which knobs should we satisfy?” That is, which dimensions should we tune as well as we can, knowing that we’ll have to settle for acceptable on all the others?

You and I can think about our lives in the same terms. Which dimensions should I satisfy? Which dimensions should I optimize?

Have you ever known somebody who spends every spare moment exercising? Or eating? Or chasing women?
Have you ever known somebody who thinks about nothing but acquiring money? Or spending money?
Have you ever known somebody who spends every moment working? Or resting?
They have optimized their life for one of these dimensions. And maybe they’ve acquired a great big pile of money; or enjoyed a lot of food, leisure, or romantic partners. Maybe they’ve amassed status at work or around town. But how did it affect the other knobs? What tradeoffs were required?

Many human life dimensions-food, health, romance, rest, work, money-share these characteristics:
They can satiate temporarily, but not permanently.
In moderation they are healthy. But too little or too much is harmful.
Finally, in the extreme (when maximized) they can be a form of idolatry.

All these dimensions, these knobs, are to be satisfied-not optimized.
Save enough money to feed and shelter yourself and those for whom you’re responsible. Build in a lot of slack, taking care of today and tomorrow.
Work hard at something important and valuable. Then rest and play hard with the people you love and enjoy most.
Eat enough tasty, nutritious food to maintain your strength. Then stop. Any more than that is making you weak and ill.
Exercise enough to keep your body strong enough for all this.

If these dimensions are to be satisfied, that still leaves the question of what to optimize?

Warren Buffett spent most of his life optimizing for net worth. He was very effective in that pursuit-more than once recognized as the wealthiest man on the planet. In the Buffett biography The Snowball by Alice Schroeder, Buffett has some comments on the life engineering question. Consider his advice:

“When you get to my age, you’ll really measure your success in life by how many of the people you want to have love you actually do love you.

I know people who have a lot of money, and they get testimonial dinners and they get hospital wings named after them. But the truth is that nobody in the world loves them. If you get to my age in life and nobody thinks well of you, I don’t care how big your bank account is, your life is a disaster.

That’s the ultimate test of how you have lived your life. The trouble with love is that you can’t buy it. You can buy sex. You can buy testimonial dinners. You can buy pamphlets that say how wonderful you are. But the only way to get love is to be lovable. It’s very irritating if you have a lot of money. You’d like to think you could write a check: I’ll buy a million dollars’ worth of love. But it doesn’t work that way. The more you give love away, the more you get.”

My experience, along with my study and observation of others’, convinces me that Mr. Buffett is correct.

A well-lived life is optimized for relationships. Your children, your spouse, your parents and sisters and brothers; your church, your business, your friends, and of course your Maker: the best thing on tap here on planet Earth is relationships.

Satisfy health. Satisfy money. Satisfy appetites. Optimize relationships.


Dell Latitude Slowed by Low Power

April 24, 2014

I recently experienced poor (slow) performance from a brand new Dell Latitude laptop. I googled and googled and couldn’t find the answer, but our IT department knew the problem. I’m writing it up here so maybe some other lonely soul experiencing it can arrive here via google. I recently got a new Dell Latitude at work. […]

Read the full article →

Latest Project – Credit Card Bonus Monitoring

February 26, 2014

I just launched a brand new project at I’m always optimizing my credit card cashback rewards. I figured, “As long as I’m putting in the effort to stay on top of these credit card bonuses, why don’t I publish my findings for others to benefit?” So that’s what I’ll do at I’ll be […]

Read the full article →

Trying Google Page Speed Service

August 4, 2011

I just began running my quotation site on Google’s Page Speed Service. This is a new service Google offers to website owners. It makes their sites load faster. Two primary techniques they employ to accomplish this are: rewriting your served content to employ some best practice speed-ups caching some of your content on Google’s super fast […]

Read the full article →

Here we go again

March 21, 2011

Libya’s on fire; we attacked it. With no declaration the Prez acted. Constitutional concern? Who cares? Let it burn. Cause the bracket has us all so distracted.

Read the full article →

Transportation Danger Administration

November 19, 2010

Everyone’s angry at the TSA about the new airport search procedures. I don’t like it either. I normally prefer to argue from principle, but every freedom loving writer in America has that covered this time. So instead I’ll take a pragmatic angle that I haven’t heard yet. How many people are now choosing automobiles over […]

Read the full article →

Restart Now

November 1, 2010

Guess I’ll go for ‘Now’.

Read the full article →

Who is Worthy of Your Attention

October 6, 2010

Your attention is a precious resource. Many people want some of it. They want to persuade you to adopt an opinion; they want to sell you something; they want to entertain you (long enough to sell you something). Many of the people vying for your attention are professional, highly trained, highly skilled persuaders. Some have […]

Read the full article →

What’s your excuse?

August 5, 2010

Just can’t seem to find time to exercise?

Read the full article →