On projects & the new year

I enjoy having one or more personal projects to work on at any given time. I tend to feel a bit aimless without at least one. Not every project gets completed; sometimes I sideline ideas for a time when something else comes along. Other times projects wither and die as the time that could have been allotted to them gets sucked up by the demands of my day job.

Since today is the (artificial—but perhaps more on that in a subsequent post) beginning of a new year, it is customary to reflect on the past and plan anew for the future.

I don't recall ever having made New Year's resolutions per say; why wait until a new year if something is worth doing? In this I'm in complete agreement with J. Timothy King, an entrepeneurial author and software developer:

I usually don't care about New Year's resolutions, because there's nothing special about January 1. That is, you can make resolutions any time during the year, and you should. Because if you better your life only once each year, your life is bound to be boring and unproductive. So make resolutions all year round. Not just in January, but every month, every week, every day of the year. And keep them.

On the other hand, the new year is one of those months, one of those weeks, one of those days of the year. So New Year's is as good a time as any to make a resolution... and keep it.

2007 was a very busy one both at work (staff turnover, training, many new projects, compliance deadlines, etc.) and at home (with new twins—though in some ways I do miss the every two-to-three hour joint feedings—shared lack of sleep brought Shauna and I closer together in many ways).

Most of my past projects have been primarily computer-related (websites, utilities, programs, libraries, or typesetting). Having had some "down time" between Christmas and New Year's, I've decided it would be healthy if I expanded my notion of worthwhile "projects" to include things that are not primarily computer-related.

Inspired by talks at Church this Christmas season, I'm inclined to take Luke 2:52 as a guide:

And Jesus increased in wisdom and stature, and in favour with God and man.

This is the last verse in the four gospels that tells us anything about Christ's life beyond age twelve until the beginning of his public ministry. Let's look at the four dimensions of growth:

And Jesus increased in wisdom1 and stature2, and in favour with God3 and man4.

  1. education, learning
  2. physically
  3. spiritually
  4. socially

What are potential projects I could work on in these areas? After several days of mulling things over, here is what I've come up with:

1. Education, learning

I tend to read in spurts—I'll knock out three or four books in a row and then nothing else for three to four weeks. I should regularize my reading schedule so that I'm always reading something, have another book lined up for after, and I should write and summarize what I've learned (or enjoyed—or not—in the case of fiction) in writing.

Writing and summarizing moves this idea beyond being a "goal" of reading more to being a potential project in my mind. There is some precedent for my posting very brief summaries of what I've been reading, but what I have in mind here would be an entire blog post on a single book. I take Will Duquette's book posts as the model I want to aspire to.

Additionally, since I'm just about the last person to have finally acquired an iPod, I should find interesting and informative podcasts to download and listen to during my commute. Of course it'd be good to write about what I learned from those too.

2. Physically

This is where this post comes dangerously close to treading into traditional New Year's resolutions. I'm generally healthy. I don't smoke and I don't drink (for religious reasons). As an adult I've come to enjoy most every fruit and vegetable (though a few, like brocolli, I don't care for raw).

But... aside from the exercise my fingers get typing, my daily life at work is pretty much 100% sedentary. Though my weight hasn't varied beyond +/- five pounds in the last five years, I do have some weight I could stand to lose.

For 2008, instead of participating in the Salt Lake City Marathon's 5K (like last year), I could participate in the bike tour instead.

Or, I could try and get ready to take part in the non-competitive Ghost Town Century in May.

Of course to do do either of these I'd need to get a working bicycle... And to make it a better "project" I ought to marry it with photography (or something).

3. Spiritually

I'm ashamed to admit I haven't re-read the Bible in Portuguese for at least ten years, preferring my native English instead. To rectify that I intend to read the New Testament again in both Portuguese and English.

But why stop there (and besides, that'd just be a goal, not a project)? I enjoy typesetting (c.f., Mormon's Book), but before Guttenberg and movable type essentially rendered the profession obsolte, scribes would spend a lifetime making copies of the Bible (and other books) by hand. Why not try my hand at copying the Bible (well, at least the New Testament for starters) by hand in both languages? I wouldn't be able to create some sort of caligraphic masterpiece by a long shot—my handwriting is only average (in an age where people type instead of write), but at the least I suspect I would gain many insights I wouldn't have otherwise and I'd have an heirloom of sorts to pass on to my children.

I'm going to order a pair of moleskine notebooks and get started once they come.

4. Socially

In the Myers-Briggs classification scheme I'm an INTP. I'm naturally somewhat shy and reserved, but once I've gotten to know someone tend to be a loyal friend for life.

I enjoy playing games. While Shauna more than makes up (for our family) of any social awkwardness that I may have (she can remember personal details about the cashier working the graveyard shift at Walmart months later) she doesn't particularly care to play games unless we have company over.

We had two other families from Church over last night to celebrate New Year's, one of whom I knew quite well, the other who recently moved from Texas I didn't. Both families had children roughly the same ages as ours and it was enjoyable to get to know them both better.

Shauna and I have talked briefly about having people over on at least a weekly basis (instead of just on occasional holidays). If we did do that we'd be able to get to know quite a few families from Church—and in our neighborhood (for those of other faiths)—in 2008. And I'd have an excuse to cook more often from the Soup Mix Gourmet.

And, by not bowling alone we'd be exposed to people, board games, recipes, books, and movies that we wouldn't have otherwise. Last night, for example, the Hixson family brought over Ticket to Ride (which was won the 2004 Game of the Year in Germany). I'd never even heard of this game, but it was an instant hit.

Weather permiting, I need to take my kids camping and teach them that roughing it doesn't mean a Motel 6.

* * *

Naturally I'm open to feedback and suggestions on things to tweak, other things to consider, mere words of encouragement, or some deserved accountability if it looks like I must have let my job encroach too much on my life...

— Michael A. Cleverly

13188 comments | Printer friendly version

Why didn't Talmage get this for Louise?

Why didn't Talmage get Louise something like this for Christmas?

Hello Kitty AR-15

H/T: Will Duquette

— Michael A. Cleverly

70 comments | Printer friendly version

Tcl 8.5

After more than four years in the making, Tcl 8.5 was released a few days before Christmas. And wow, what a treat it is!

This release is, in my opinion, the best ever.

I first became acquainted with Tcl 10-years ago via Philip Greenspun's original Database Backed Websites book. At the time AOLserver 2.x was closed source but available at no cost. I never had much hands on experience with the Tcl 7.6, 8.0, 8.1 and 8.2 releases; I made the jump straight to Tcl 8.3 (IIRC) once America Online open sourced the code base for AOLserver 3.x.

Since Tcl has been around for twenty years now, there is a fair amount of outdated information on the web regarding Tcl's features, performance and capabilities that doesn't apply at all to modern Tcl versions.

There are a number of features that excite me in this release. I intend to blog a bit about each of the following (I'll update this post with links to subsequent posts as they get written):

Stay tuned.

Addendum: Dossy points out that I overlooked the biggest news: the {*} expand operator, which means an expansion from the 11-rule endekalogue to a 12-rule dodekalogue. (Tcl 8.5, now with 9% more syntax!)

— Michael A. Cleverly

390 comments | Printer friendly version

Tcl 8.5: custom math functions & arbitrary precision integers

In Tcl 8.5 you can now define, at the script level (instead of needing to write in C) custom math functions. For example here is a factorial function:

proc tcl::mathfunc::fact {n} {
    if {![string is integer -strict $n] || $n < 0} then {
        return -code error "fact is only defined for non-negative integers"
    set result 1
    # remember, n! (n factorial) is the product of all integers between 1 and n
    # except 0! which is defined to be 1
    for {set i 2} {$i <= $n} {incr i} {
        incr result [expr {$result * $i}]
    return $result

Then we can use fact($n) in expr, if, while, for, etc. just like any of the "built-in" math functions.

Since we now have arbitrary precision integers (thanks Kevin!) we can compute factorials that exceed the native size of a long integer, i.e., 42!

% expr fact(42)

Defining your own math functions makes solutions to Project Euler problems easier to write. YMMV. The other features of Tcl 8.5 will probably be exciting to an even wider audience.

As of January 2008 the Google calculator can only calculate up to 170!. We can do twice as better quite quickly (timings from my 2.4 GHz MacBook Pro laptop):

% time {expr {fact(171)}} 1000
295.348728 microseconds per iteration
% time {expr {fact(340)}} 1000
791.435306 microseconds per iteration

— Michael A. Cleverly

106 comments | Printer friendly version

TSA laundry mixup

Shauna picked up our dry cleaning today. After she got home she discovered the dry cleaners had given her an extra startched shirt—part of the uniform for a Transportation Security Administration agent.

It looks like it'd be roughly the right size (for me). But I'll forgo trying it on—it seems rude to try on someone elses laundry. Besides that, who knows... there might be some secret law against wearing a TSA agent's shirt...

We'll be taking it back in the morning, naturally, as I'd hope someone else would if they'd been given my dress shirts by mistake.

— Michael A. Cleverly

50 comments | Printer friendly version

Tcl 8.5: in & ni

Once upon a time (Tcl 7.x; probably earlier too?) the best way to test for string equality in Tcl was:

if {[string compare $x $y] == 0} ...

Beginning with Tcl 8.1.1 the preferred way became:

if {[string equal $x $y]} ...

Beginning with Tcl 8.4 and the introduction of the eq and ne operators testing for string equality became much more concise:

if {$x eq $y} ...

Much more readable, concise, and less to type. In Tcl 8.5 we get a simillar improvement for testing whether a particular item is a member (or not) of a list:

if {$x in $y} ...

Which IMHO is a huge improvement over the former idiom:

if {[lsearch -exact $y $x] != -1} ...

Naturally ni is to ne as in is to eq. And to top it all off, ni is fun to say too.

— Michael A. Cleverly

461 comments | Printer friendly version

Why are pharmacies so slow?

I stayed home from Church with Jacob today. He was running a fever and complaining of a sore throat. When he still wasn't feeling any better this evening I took him to KidsCare in Bountiful. The quick test for strep came back (in the words of the doctor) "very positive." She wrote a prescription for Amoxicillin, which we took to Walgreens (one of the only pharmacies open around here on a Sunday evening).

I've never encountered any pharmacy [in America] that I'd consider really fast (< 5 minutes) or efficient. Today when we went through the Walgreens drive thru, the pharmacist told us they'd have it ready in 25-30 minutes and to come back then.

There were no other cars in line & no patients visible inside. Why does it take them so long to fill one small bottle? It's a liquid, so it ought to be easier to measure than counting out individual pills. Given that it is the season for strep (and the standardized dosage doctors prescribe for kids) you'd think they could even have bottles pre-filled.

Is there some law or industry norm that says all pharmacies must be slow and make sick patients wait? It's not like Amoxicillin is a hard narcotic where they might want to double check the validity of the prescription. So what do they spend all that time doing?

Maybe Paul will find out when he starts his pharmacy program in Georgia later this year...

— Michael A. Cleverly

442 comments | Printer friendly version

Bowling scores

Bowler bowling

Some years back Anna got a new family tradition started: bowling on Thanksgiving morning. We all gather at Bountiful Bowl just prior to their 10 AM so we're among the first in the door when they open.

A perfect (or near perfect) game would only have 12 balls thrown (one each in the first nine frames and three in the tenth). It would be possible to bowl an 11-ball game by scoring nine consecutive strikes and then missing a strike or a spare in the tenth frame. A strike-free game would generally have 20 balls thrown though a strike or spare in the final frame would boost the number up to 21.

This past Thanksgiving I bowled a (for me) respectable 136. I didn't get a strike in any of the first nine frames and then got a turkey (three consecutive strikes) in the tenth frame. A 21-ball game! Go me!

I recall discussing (in passing) whether there was any bowling score that was "impossible" to bowl. Clearly there is only one way to score 0 (all gutters) and 300 (all strikes). There would be one way to score 291 thru 299 (11 strikes and 1-9 pins on the final ball).

What about 289? Without scratch paper & a pencil we didn't bother to figure it out. I assumed there would probably be ways of scoring that high. (And it turns out there are eleven different ways, but more on that in a moment.) If there was some score that was impossible to get it seems like it would make a good plot device in a detective story—some intrigue at the local bowling alley (league rivalry turns violent?) and the villan's alibi falls apart when our able gumshoe realizes the mathematical impossibility...

Yeah, well... guess it'd be a real turkey of a plot device after all. (There is probably a reason I've never written more than five pages during NaNoWriMo :-)

While catching up on Project Euler (I've slipped to 72% with the rate they've been adding new problems lately) I looked a sequence my programs was generating (1, 20, 210, 1540, 8855, ...) up in the On-Line Encyclopedia of Integer Sequences and found out that the sequence I was calculated (at least in the first five terms) matched the "number of possible games of 10-pin bowling with a score of n."

The OEIS entry had links to Balmoral Software's All About Bowling Scores page, which is full of great mathematical insight into the game of bowling, as well as easy to understand charts and graphs. (Definitely worth checking out.)

For instance, did you know that the number of possible different games is roughly six quintillion? Or that an "average" 280-point game has more strikes than a 281-point game? Other fun facts:

Now if I could just swap my bowling & golf scores I'd be good at both!

— Michael A. Cleverly

302 comments | Printer friendly version

Results of lavishing subsidies on politically important special interests—entirely predictable

A recent Smithsonian Tropical Research Institute report links US farm subsidies to increased deforestation in the Amazon rainforest:

The US is the world's leading producer of soy, but many American soy farmers are shifting to corn to qualify for the [$11,000,000,000/year] government subsidies. Since 2006, US corn production rose 19% while soy farming fell by 15%.

The drop-off in US soy has helped to drive a major increase in global soy prices, which have nearly doubled in the last 14 months. In Brazil, the world's second-largest soy producer, high soy prices are having a serious impact on the Amazon rainforest and tropical savannas.


High soy prices affect the Amazon in several ways. Some forests are cleared for soy farms. Farmers also buy and convert many cattle ranches into soy farms, effectively pushing the ranchers further into the Amazonian frontier. Finally, wealthy soy farmers are lobbying for major new Amazon highways to transport their soybeans to market, and this is increasing access to forests for loggers and land speculators.

Laurance emphasized that he was not the first person to suggest that US corn subsidies could indirectly harm the Amazon. "But now we're seeing that these predictions-first made last summer-are being borne out. The evidence of a corn connection to the Amazon is circumstantial, but it's about as close as you ever get to a smoking gun."

I agree that this is entirely predictable.

I spent the better part of two years (1992-94) living in the Amazon (~3 months in Rondonia, ~13 months in Amazonas, and ~6 months in Acre). I've witnessed people struggling to eke out an existance. If families and communities in the region can earn more (and become more prosperous) by stepping in to help fill the soy-gap created by our Congress's ill-conceived policies, what right do we have to be shocked or dismayed at the results?

Congress's misguided farm subsidies are also contributing to rising meat prices domestically and food prices globally, pricing tortillas out of the reach of the poor in Mexico, and leading to more (illegal) immigration.

I can't help but wonder—paraphrasing Rep. Jeff Flake—what business is it of the Federal Government to pick winners and losers in the economy, to decide we ought to be promoting white & yellow corn production (with earmarks and subsidies) instead of blue corn or above any other vegetable out there?

— Michael A. Cleverly

93 comments | Printer friendly version

A great new Tk resource

Mark Roseman has created a new Tk website (tkdocs.com) which aims to provide "a language neutral, up-to-date (8.5+) best practice tutorial and associated documentation".

The tutorial is coming along quite nicely, with code examples for both Tcl and Ruby. Presumably examples for other languages (Python, Perl, etc.) may yet be forthcoming—or would be included if someone steps up and contributes them.

The site, as new is it is, is already off to an excellent start. Kudos to Mark!

— Michael A. Cleverly

98 comments | Printer friendly version

"Happy Birthday to Them"

A year ago at this time (i.e., 31,536,000 seconds in the past) Ethan had been born but Marta was being stubborn and taking her own sweet time.

The past year? At least twice as much work, but definitely more than twice as much fun...

Eliza has a short video clip of them both (with a bonus special bonus presentation by Andrew).

— Michael A. Cleverly

88 comments | Printer friendly version

Markets in Everything

A week and a half ago I began work on a website indexing the Markets in Everything posts from my favorite econ blog, Marginal Revolution.

Markets in Everything demonstrate that there are markets for, well, just about everything. :-) Some are pure genius (the "why didn't I think of that" kind), others mistifyingly odd, some sad and others downright sick / disgusting / disturbing.

An unexpected bonus I received from having created the site: Tyler Cowen is sending me a copy of his book Creative Destruction: How Globalization is Changing the World's Cultures.

Since I went public with the site a week ago I've had nearly 5,000 unique visitors. Approximately 30% came from Marginal Revolution, 44% from the New York Times Freakonomics blog, and the remaining 26% from various other sources (or users whose browsers aren't configured to send referrers).

A professor from the University of Washington was kind enough to write:

Just wanted to say a BIG THANKS for compiling all of the Marginal Revolution "Markets in Everything" posts! I am using them in an econ class I'm teaching soon, and had made little progress in looking for all of them... now you have done that for me!

A fun little project, and very much worth the $6.99 I spent registering the marketsineverything.com domain name.

— Michael A. Cleverly

39 comments | Printer friendly version

Sobering examples of what one person can do

Two quotes I shared (via email) with some friends today:

The first, dealing with L'Affaire Kerviel:

The [30-year old] SocGen rogue trader managed to annihilate an amount of money that surpasses the yearly output of the economy of 112 countries, among them Madagascar, Mozambique, and war-torn Afghanistan, all of which have population sizes larger than 15 million.

And the second dealing with last years cyberattacks on Estonia that, at the time, were thought to be coming from Russia:

The fact that a single angry student was able to impact international relations between two countries is an startling development.


The fact that a single student was able to trigger such events is particularly ominous when you consider just how many potential flashpoints exist between various countries all over the world.


The DoS attack against Estonia is an excellent example of how a cyberattack carried out by a 20-year-old student in response to real-life events further exacerbated an existing problem between two nations.

One person replied, "the [Mathematica] code is cool, but it's freaky that one person can affect the economy like that."

— Michael A. Cleverly

86 comments | Printer friendly version

An experiment for Valentine's Day

Among all the Marginal Revolution Markets in Everything posts, one that personally intrigued me was #4, personalized romance novels.

For $55.95 a company in Florida will produce a unique book based on various details you provide (name, hair color, favorite car, favorite radio station etc.) and then plug those details into a pre-fabricated story running between 180 and 210 pages.

As Tyler Cowen noted:

Some people actually like this idea:

"It was an addictive read because it makes you the star," said Pete Hart, 34, who received a pre-fan novel called "Vampire Kisses" from his girlfriend. "I was referred to as Pedro in the book, which is my nickname. I found that quite charming."

Another fellow noted:

"It read more like a novel or novelette and less like a typical romance novel," he said. "I enjoyed reading it. Besides, I was in it."

I'm intrigued, since I've made typesetting a hobby, and in part because of the huge profit margins. In my experience producing a single 180-210 page book shouldn't cost more than ~$7, so $55.95 would represent an eight times markup. Not bad...

Of course not being a reader of romance novels (or chick-lit generally) I'm somewhat skeptical of the appeal. But I recognize I'm probably not representative of the demographic and so I shouldn't necessarily consider my own opinion too highly. Better to try an experiment and attempt to quantify the appeal generally.

I am going to prepare a personalized book for my wife for Valentine's. This will provide me with one data point. However a sample size of one (especially when she might be biased to say nice things regardless of what she really thinks) isn't large enough to draw any conclusions from.

As long as I'm going to be creating a personalized book for my wife the marginal effort to create an additional personalized book for someone else is very low. (I'm already going to write a Tcl script to take a list of changes and apply it to the original text; re-running the script with someone elses list of changes would be trivial.)

An invitation to participate in an experiment for Valentine's Day 2008

My inivitation to you, dear reader:

I'm willing to produce a personalized trade-paperback (6"x9") version of Jane Austen's Pride and Prejudice for you.

I only ask two things:

  1. That you reimburse me after the fact for the actual cost of having the book produced and shipped. (Payment via PayPal or check; I'm estimating the book itself will probably cost in the $9 - $12 range depending on what size font I end up using.)
  2. That after you've given the book to your significant other and (s)he has had an opportunity to read it you complete a short follow-up survey that I'll send so I can quantify peoples reactions generally.

The characters whose names could be changed to customize the story (links are to character summaries at Wikipedia) include:

This chart from Wikipedia shows the relationships between the aforementioned characters.

Location names that could be changed include: Rosings (Lady Catherine de Bourgh's estate); Netherfield (the estate leased by Mr. Bingley); Meryton (the village near where the Bennet's live); Brighton (where Lydia is invited to go with the militia); and Pemberley (Mr. Darcy's estate).

How to participate

Given that Valnetine's Day is two and a half weeks away, and to allow time for production and shipping, please email me (michael at cleverly dot com) with the following no later than Saturday, February 2nd, 2008:

Please put Pride & Prejudice in the subject line of your email to decrease the chances of your email being inadvertantly miscategorized as spam. If you haven't received an acknowledgement from me within 48-hours please send another message.

I'm willing to ship internationally; however, I doubt time would permit your books arrival prior to February 14th, and the shipping expense would undoubtedly be greater.

Incidentally, if the idea of this experiment offends any die-hard fans of Jane Austen you have my apologies in advance.

— Michael A. Cleverly

816 comments | Printer friendly version

Recessionary fortune cookies

My fortune cookie at Cafe Trang tonight read:

You shouldn't overspend at the moment. Frugality is important.

— Michael A. Cleverly

94 comments | Printer friendly version

-> Next month (with posts)
-> Last month (with posts)