≡ Menu


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

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

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. I immediately noticed something was wrong. Whenever I docked it the speed dropped noticeably. Something wrong with the graphics? Any kind of drawing to the screen was choppy. Maybe it’s network related? Any network requests took dramatically longer than normal. It actually seemed like it was slower on every kind of task.

When I undocked it would be back to normal. My docking station is 6 years old; maybe it wasn’t as compatible as advertised.

I found a few promising hits on google that suggested it might be underclocking the CPU when docked. They suggested it was some kind of ventilation and heat problem, and the machine’s way of handling that was dialing back the processor speed. That sounded iffy to me. Furthermore, Task Manager showed my CPU usage was very low.

Defeated, I filed a help desk ticket. In 15 minutes our world class IT department replaced my old 65 watt power supply (which worked fine on my older notebook machines) with a new higher power supply (I think it’s 100 watts). Problem solved.

In summary: if you’re experiencing lagging performance from your Dell notebook, check if your power supply is underpowered.

Latest Project – Credit Card Bonus Monitoring

I just launched a brand new project at CreditCardBonusCategories.com.

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 CreditCardBonusCategories.com. I’ll be sharing various hacks, reviews, and commentary on the offers available from the best cards. So if you’re interested in ringing a bit more cash from your cashback cards, check out my newest project: CreditCardBonusCategories.com.

Trying Google Page Speed Service

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

My site is dramatically faster, even though I’d already applied all the easiest optimizations.

Setup was pretty easy. Just a handful of dns tweaks. The only snag I hit was in the third step. They asked me to create a txt dns record. I was naming mine incorrectly. The name of this txt record must be your domain name. So in my case, it should be quotationcollection.com. I was trying to use google-site-verification.quotationcollection.com. So don’t make that mistake.

If you host a website, I encourage you to check out this service. At least run a test to see what you can gain.

So far I’m very pleased. Stay tuned to see how I feel when they stop offering it for free.

Full disclosure: I am a Google shareholder. I also use dozens of their products and services including adsense and referrals.

Transportation Danger Administration

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.

  1. How many people are now choosing automobiles over airplanes because they don’t want to be radiated or fondled?
  2. As you know, air travel is safer than road travel. So how many injuries/deaths should we expect as a result of this increased car travel?
  3. How much do the TSA’s new screening procedures reduce the chance of injury/death on an aircraft?

Soon, some economist will figure out the answers to numbers 1 and 2. I suspect number 3 is not quantifiable, but I wouldn’t be surprised if some bureaucrat has already made up an answer.

Regardless, I strongly suspect that the answer to number 2 is going to dwarf the most optimistic guess for number 3. Put another way, the Transportation Safety Administration is actually making transportation more dangerous.

I’m looking forward to putting some numbers to this.

Restart Now

VS 2010 Restart Now

Guess I’ll go for ‘Now’.

Who is Worthy of Your Attention

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 full-time staff devoted to grabbing and keeping your attention. And they may not have your best interest in mind.

In a world where information and entertainment choices are growing exponentially, how do you decide what’s worthy of your attention? How do you distinguish the valuable from the nonsense? You don’t have time to research everyone’s credibility. You need some heuristics to save you some time.

Below are some things you might consider when evaluating how to spend your attention:

  • What is this person’s incentive? Does persuading me (or keeping my attention while an advertiser can attempt to persuade me) affect their bank account either directly or indirectly?
  • Is this person asking me to apply reason? Or do they want me to react emotionally?
  • Is this person emphasizing our differences and asking me to think in terms of us vs. them? Or is this person emphasizing our similarities and asking me to cooperate? One favorite tactic of infotainers is to divide people into groups, label them, and then pit them against one another. It sounds like this: “Group x believes ABC” or “group y wants to xyz”.
  • Is this person screaming? Or are they speaking calmly and rationally?
  • Is this person encouraging me to be a better, stronger, higher character person? Or is this person appealing to my base animal instinct?
  • Does this person claim to speak for some other person or organization? If so, are they self-appointed?
  • Does this person have any expertise on the subject in question?
  • Does this person want me to feel empowered – able to help myself and others? Or do they want me to feel like a helpless victim whose problems are somebody else’s fault?

The next time you find your TV tuned to the news (although it applies to radio, magazines, newspapers, and the interwebs, too), ask yourself these questions.

What’s your excuse?

Just can’t seem to find time to exercise?