Sunday, March 28, 2010

Kakuro solver considered too slow -- but now fixed. "They see me mowin'..."

Couldn't leave well enough alone, so I googled "hard kakuro" and clicked to an astonishingly difficult kakuro puzzle at; it took my old solver something like 15 minutes on my desktop box. This seemed entirely too long, so I played with it, resulting in a speedup of better than 94:1 on said desktop box. Running the old vs. new Python programs on a G4 Powerbook gave a better than 100:1 speedup.

The secret? The old program would find all possible permutations of all possible combinations for each sum, then painstakingly remove all the impossible ones. It turns out that using a list comprehension, and removing in advance the permutations that are disallowed by just the first and last cells of the sum -- this one step -- gives almost an order of magnitude speedup. I suspect some of the savings is due to reduced demands on memory management.

Almost another order of magnitude can be gained by using the entire list of cells in the aforementioned pre-screening. It turns out that since the list of "possibles" is constant while we're screening out permutations, we can build a string like

"lambda vec: vec[0] in (1,2,3) and vec[1] in (1,2) and..."
then say mm=eval(that string), and then code the list comprehension as [x for x in permutes(...) if mm(x)]

I have to say Guido and the Python team were genius to give us list comprehensions and the "eval" function. That was a lot of fun, too! Oh -- I updated the website with the latest sources, as well as the steps from the old to new, for your code-reading pleasure. Enjoy!

3/29: took another 13-17% off the execution time!

What took 54:22 (yes, nearly an hour) on a powerbook G4 now takes under 23 seconds on the same box, roughly a 140:1 speedup. On a 2.6GHz Xeon 5150, the speedup was 5:54 down to under 5 seconds, better than 70:1. I really like Python.

Friday, March 26, 2010

Both daughters home!

Just around lunch time today, we were lounging around (I took the day off) and mentioned the seahorse exhibit at the Monterey Bay Aquarium.

That was not what I'd call a hard sale. "I haven't been there in a long time," the ex-teenager said wistfully. "I love spontaneous trips!" said the other. I grabbed dog food and we all headed off together, stopping at our neighborhood market to get some apples. And cash.

What a beautiful day! The teen-ager napped in the back seat for part of the drive. We parked in the garage at Foam and Prescott, and walked down to the beach. The sun was shining and the water was astonishingly blue. We took our shoes off and enjoyed the feel of the coarse sand. After looking at shells for a while we dried our feet, got our shoes back on, and went to the aquarium.

The aquarium is gorgeous, maybe even more so than I remember it. Seahorses are amazing creatures. I don't think I knew they were fishes. It's amazing how they move, using very thin fins. (These guys are not tunas.)

After 2–3 hours we're ready to look for dinner. We chose Sly McFly's, on Cannery Row at Prescott. Fish and chips, and clam chowder in a bread bowl -- not exactly health food but delicious and satisfying.

The drive home was uneventful. We talked some about college life, about some surprises and general thoughts as the ex-teenager is approaching graduation.

I'm a thankful man, to have both daughters home and to be able to enjoy this day with them and to hear their thoughts on life....

You socialist you

The oldest reference I can find (easily) to this essay is:; I'm going to tweak the first sentence before posting here:

"The Government can't do anything right"

This morning I was awakened by my alarm clock powered by electricity generated by the public power monopoly regulated by the U.S. Department of Energy.

I then took a shower in the clean water provided by a municipal water utility.

After that, I turned on the TV to one of the FCC-regulated channels to see what the National Weather Service of the National Oceanographic and Atmospheric Administration determined the weather was going to be like, using satellites designed, built, and launched by the National Aeronautics and Space Administration.

I watched this while eating my breakfast of U.S. Department of Agriculture-inspected food and taking the drugs which have been determined as safe by the U.S. Food and Drug Administration.

At the appropriate time, as regulated by the U.S. Congress and kept accurate by the National Institute of Standards and Technology and the U.S. Naval Observatory, I get into my National Highway Traffic Safety Administration-approved automobile and set out to work on the roads build by the local, state, and federal Departments of Transportation, possibly stopping to purchase additional fuel of a quality level determined by the Environmental Protection Agency, using legal tender issued by the Federal Reserve Bank.

On the way out the door I deposit any mail I have to be sent out via the U.S. Postal Service and drop the kids off at the public school.

After spending another day not being maimed or killed at work thanks to the workplace regulations imposed by the Department of Labor and the Occupational Safety and Health administration, enjoying another two meals which again do not kill me because of the USDA, I drive my NHTSA car back home on the DOT roads, to my house which has not burned down in my absence because of the state and local building codes and Fire Marshal's inspection, and which has not been plundered of all its valuables thanks to the local police department.

And then I log on to the internet -- which was developed by the Defense Advanced Research Projects Administration -- and post on and Fox News forums about how SOCIALISM in medicine is BAD because the government can't do anything right.

New Appeal to Reason
Politics from a democratic left perspective from the middle of the United States
Monday, August 10, 2009
The details aren't all quite correct (oh, and I think that's "Fire Marshall") but I certainly agree with the sentiment.

Tuesday, March 23, 2010

Discussing Jesus with Al Franken

In a sketch from "Lord Save Us From Your Followers", Al Franken describes his encounter with a zealous Jesus-follower. Mr. Franken didn't (and I suppose still doesn't) think Jesus is God, and his interlocutor said he was calling Jesus a liar.

Not knowing exactly what was said, I nevertheless can imagine someone being quite obnoxious about this issue. I don't even have to stretch very much because I've been that obnoxious myself in the past. But though I don't think my brother in Christ provided Mr. Franken with a winsome appeal to the facts, I nonetheless agree that Jesus really doesn't give us the option of thinking he's "just" a great teacher. He made it quite clear that he was claiming to be equal to God in a way that merely human beings like you and I are not.

Back to Mr. Franken's story: my brother in Christ apparently told him, "Jesus said, ‘When you look upon me you look upon the face of God.’ What do you make of that?"

Mr. Franken replied, "Well, maybe he was misquoted. Maybe he was saying that when you look upon any man you look upon the face of God." (These quotes are approximate, as I'm working from memory.) Nobody had a successful rejoinder to Mr. Franken, and I think this a shame.

It's a shame not because it would have been possible to "win" the argument -- nobody has ever come to hope in Christ because she or he "lost" an argument -- but because I think it important that we present our faith winningly and also intelligently. It doesn't really dishonor God if the world thinks Christians are silly ("We are fools for Christ" - 1 Corinthians 4:10, etc), but it doesn't honor him to present our faith as something we just made up.

As a matter of record, Jesus was not ambiguous at all in his claim to be special. Here's John's record of just one occasion:

"My sheep listen to my voice; I know them, and they follow me. I give them eternal life, and they shall never perish; no one can snatch them out of my hand. My Father, who has given them to me, is greater than all; no one can snatch them out of my Father's hand. I and the Father are one."

Again the Jews[1] picked up stones to stone him, but Jesus said to them, "I have shown you many great miracles from the Father. For which of these do you stone me?"

"We are not stoning you for any of these," replied the Jews, "but for blasphemy, because you, a mere man, claim to be God."

John 10:27-33
  1. ^ I should mention something here about John's use of the phrase "the Jews." It is a shock to some people, but Jesus grew up as a Jew; so were all the disciples. John himself was a Jew. What he means by "the Jews" is "the religious leaders." Really, John is really not anti-Semitic.)

Jesus is talking with religious leaders here, and they are quite clear about what he meant. Even if we don't have the exact words (this conversation most likely was in Aramaic, whereas the text is written in Greek), its import was unambiguous.

So Jesus really did claim to be equal to God, which leaves us, as Lewis said, with three possibilities:

  1. He was some sort of nut-case, rather like someone who claims to be a poached egg;
  2. He was a liar (or worse) -- claiming to be God when he wasn't;
  3. He really was who he claimed to be.
Jesus doesn't leave us the option of thinking of him as a merely human philosopher or teacher; if he was merely human then #1 and #2 above are our only options. This line of thought won't, of course, convince anyone to follow Jesus, but I hope it can help people to be willing to take another look.

Sunday, March 21, 2010

Maybe not the last kakuro post...

I discovered last night that my solver didn't work for puzzles like this one by Vegard Hanssen. So it took rather more thinking, and a little more coding (which Python makes easy) to get that one solved.

I've put the new one in place of the old one -- all visible at Besides the prettier HTML, which I got from Vegard Hanssen's site (see the above puzzle too), the new "" program has the following changes vs "".

  1. Trivially, the old code had "HTML=True" near the top and the printout routine would output HTML if the variable was true. Yup...
  2. Almost as trivially (I don't think it made any difference), handle the process of setting a cell's determined value vs adjusting the content of its "possibles" list uniformly. There was one place we weren't doing that.
  3. Once we start dealing with permutations (the 2nd bullet in this earlier posting), find undecided cells that have only two possible values. For each such cell, try out first one value, then the other, to see if it leads to a contradiction. If it does lead to an impossibility, remove that value from the list of "possibles" and thereby decide the value of that cell. For example, in the aforementioned very hard puzzle #345943, doing the elementary steps brought us to this point:
      A B C D E F G H
    3 1
    4 2
    As you can see, the solver didn't get too far with this one; filled in 5 but left 27 cells blank. The new logic does this for example with cell 7D:
    • 7D can be either 1 or 3 (see for a complete list). But if 7D=1 then
      • 8D=3 because of 6Ddown, and
      • 8C=5 due to 8Bacross.
      • Of the combinations allowed by 2Cdown, there's only one allowing 8C=5: (6,9,8,3,7,5), which dictates for example that 7C=7.
      • This is a problem because 7Bacross doesn't have any permutations starting (7,1,...).
    • Hence 7D cannot be 1.
    • Therefore 7D=3, 8D=1, 8C=7, etc.
    This same logic, combined with the permutation-checking code described earlier, handles this puzzle as well as puzzle #18999, which takes about 7 CPU-seconds (feels like forever) on this 1GHz Athlon3000+ box (bogomips 2009) running 32-bit 2.6.28-18-generic (Ubuntu 9.04) and Python 2.6.2
So unless I find any more kakuros that this solver can't handle, this will really be the last kakuro post.

Hugh Gallagher's college essay... and a novel

Going in backwards order, the debut novel of this American humorist was "Teeth"; you can see more about this 1999 book on's description. I read an excerpt, which makes me want to read the rest.

But I heard of him because of an essay he wrote, which appeared in Rob Bell's Drops Like Stars (apparently now available in paperback). According to Wikipedia, it was written for a 1989 writing contest and later submitted to colleges. The full version is at but here are a few lines from it:

I am a dynamic figure, often seen scaling walls and crushing ice. I have been known to remodel train stations on my lunch breaks, making them more efficient in the area of heat retention.

I woo women with my sensuous and godlike trombone playing, I can pilot bicycles up severe inclines with unflagging speed, and I cook Thirty-Minute Brownies in twenty minutes. I am an expert in stucco, a veteran in love, and an outlaw in Peru.

There's lots more. The essay also appears on along with 19 (currently) responses.

shrimp + garlic + asparagus = yum! in half an hour

No kidding, you can do this in less than 30 minutes. Here's the plan:
  1. Oh, I forgot to tell you, you have to have on hand
    • maybe ½–¾ pound of shrimp, and
    • some fresh asparagus. A dozen spears wouldn't be too many.
  2. Start the rice. Or a pot of water for pasta.
  3. Put
    • 2 T olive oil
    into a skillet on medium-low heat while you shell and de-vein
    • ½–¾ pound of shrimp
    Add shrimp to the pan. After a minute or so, add:
    • 2 T vermouth or white wine
      I'm no gourmet, but here's what I think: white wine seems to me to bring out the flavor of seafood, whereas red seems to moderate it. I like this dish to be shrimpy, which is why I like the white.
    • a smashed clove of garlic
    • 2t or 1T of lemon juice
    • salt and pepper if you like
    • parsley if you have some
    Cover it and...
  4. Take out and wash
    • fresh asparagus.
    I grabbed ten; a dozen would not be too many. (Could there be too many?) Now check on the shrimp. Flip them over maybe, cover, and let them sit for another minute.

    Pull the shrimp out and put them on a warm plate. Toss the asparagus spears into your skillet with

    • ¼ cup or so of water,
    and cover again. Flip them after a minute or so and remove them when tender enough (check with a fork).
  5. Somewhere in there the rice was probably done, or the water boiled for your pasta.
That's it! Tasty, healthy (if you don't like "healthy," use 2-3T butter instead of olive oil) and easy. You can use brown rice or whole-grain pasta if you want to be healthier.

Saturday, March 20, 2010

Must we strive always to be perfect?

This question came up the other day, and the first thing that came to mind was: Jesus seemed to think so, according to Matthew 5:48. I promised to think about it.

So here are a few more thoughts. First is something I was taught as a young believer: Jesus gave us those commands so that we would see they were impossible to do on our own. We would then see that we need his help. It's like the Israelites in the desert in Exodus 13:21 -- with a pillar of cloud by day and a pillar of fire by night. The point, in other words, is not to choose the most direct path through the desert; rather, it's to trust in the One who makes himself known in the cloud and the fire, and to follow Him.

Now did the Israelites trust God through the desert? Not so much. Some did an absolutely terrible job -- representatives of the ten tribes, who gave a bad report in Numbers 13. The people weren't much better. Rather than believing and obeying the Lord, they wanted to give up.

Will we fail, as they did? Sometimes we will. Does that mean we should stop trying? Of course not! We have these commands from God for at least two reasons:

  • They show us what our God is like -- he is good to all, he has compassion on everyone, he is just and righteous and generous, he forgives sin.
  • By sincerely trying to follow them, we'll better appreciate our inadequacy and inability to be like God. This is like what Dr. Pausch called a head fake, or what The Karate Kid actually learned when painting fence-boards or waxing cars. So although the command is, "Love your enemies," the lesson is "You need Jesus."

I think there are at least two ways to approach this. One is to focus on trying to be perfect. Whenever we fail, we'll come face to face with our inadequacy. This is good because we then are drawn closer to the Lord. As the author of Hebrews tells us, "He is able to deal gently with the ignorant and the wayward, since he himself is beset with weakness" (Hebrews 5:2).

The danger with this first approach, of course, is that we'll fall into the trap of the scribes and law experts of Jesus' day: rather than following God's commands, which are at turns impossible or difficult to quantify, we create quantifiable goals which are also easier to meet. So we have to steer clear of that trap.

Another approach is to seek the Lord, as the Psalmist writes:

One thing I ask of the Lord, 
     this is what I seek: 
that I may dwell in the house of the Lord 
     all the days of my life, 
to gaze upon the beauty of the Lord 
     and to seek him in his temple.
The hope would be that by meditating on the Lord's wonderful attributes -- his eternal power and divine nature, his generosity and mercy and goodness and compassion and holiness -- we would become like him. This is I think the idea behind what John tells us in 1 John 3:2-3 -- that we become pure by hoping in him, and we become like him when we see him as he is. We resemble what we worship, according to this theory.

A pitfall with this approach is that we might focus only on the attributes of God that we feel comfortable with, the attributes that we already have. So people who have angry personalities, who like to tell others what to do -- these people may find it all too easy to focus on the wrath of God and forget about compassion and mercy. Those who have the gift of mercy may be inclined to see God as a warm friendly kind of character and forget about moral purity.

Well, it's not surprising that there are pitfalls no matter what we do; we are indeed beset with weakness. How do we move forward and avoid the pitfalls? As with other issues, the process is simple but not easy. Here's how I'd summarize it:

  1. Read the Bible frequently with a desire both to obey God and to know his character.
  2. Obey what you know God wants you to do, and avoid what you know God wants you to avoid.
  3. Participate in corporate worship; listen to sermons; pray individually and together.
  4. Have spiritual friendships where you discuss your concerns, your understanding of God's character and will, struggles, etc. These friendships should provide mutual encouragement, with enlightenment, exhortation and accountability as needed.
  5. Repeat steps #1-#4 for a lifetime.

A final comment: A young friend told me recently that "when I try to seek God, even though I don't always succeed, everything goes better." Now there's a good word. It reminds me of the verse that says "those who honor me I will honor" (taken rather out of context but still true -- 1 Samuel 2:30) and this from Proverbs 16:7: "When a man's ways are pleasing to the Lord, he makes even his enemies live at peace with him." Also related: Romans 2:7: "To those who by persistence in doing good seek glory, honor and immortality, he will give eternal life" -- or more succinctly, "Seek me and live" (Amos 5:4).

Note it doesn't say "if you do it right"! Look at Abraham (the friend of God) and some significant mis-steps he took, or Jacob/Israel, or David. Abraham misunderstood God when he was right there; we're obviously going to misunderstand the Bible since we live thousands of miles away and thousands of years in the future. And he lied about Sarah. Jacob was a great deceiver, hardly a paragon of moral rectitude, and yet the Lord identifies himself as "the God of Abraham, Isaac and Jacob." And King David with the adultery and murder and coverup, and yet he was the man after God's own heart.

So we strive, we'll blow it, God will bless us anyway. Sounds like a plan!

Meyer ≠ UGLY

I met our friend Peggy, and her three Chinese friends, at Stanford for a walking tour. Our guide said that Green (which was either being built or soon-to-be-started when I sent to school there) was the library for most nonspecialized materials, so I had to ask: What about Meyer?

Meyer, which used to be called UGLY (UnderGraduate LibrarY), is now like a 24-hour study area with rooms open basically 24x7 and no books. I think she said there was a computer consulting service on the 2nd floor (when I was going to school, you went to where the computers, or the terminals, were -- 029 card punches [photo] way out in Pine Hall, or terminals at CERAS -- you didn't carry them with you).

Well, a lot of things have changed at Stanford, but this one was rather a shock.

Finding true success

My friend Kiki invited me to address the young professionals group at their church. These are Asian immigrants; actually more of them are young college students than practicing professionals, but that's OK.

I prepared a one-page handout, which I'll cut up and include here for your reading pleasure, and intersperse my comments. So here goes nothing:

I'm very happy to see you all here. I know there are a lot of things that you could be doing on a Friday night, but you're here for fellowship and worship. That is a wonderful thing.

My wife and I moved to Japan in 1993, when our children were 2 and 4 years old. We stayed there about six years; we learned the language (though we forgot a lot since we came back); our kids were in the Japanese school system; we shopped in the neighborhood stores and had to make all kinds of adjustment. So I have a lot of respect for you, studying and working in a foreign country.

I am sure you miss a lot of things about your home country; we sure did when we lived overseas. But as Paul reminds us, our real home isn't the United States or your home country; our citizenship is in heaven, and we wait for a savior, the Lord Jesus Christ, who will make our lowly body like his glorious body, and that's good news (Philippians 3:20-21).

1. What is true success?
    * Big house?
    * Good grades?
    * Lots of money?  
      (Luke 12:13-21; Ortberg "When the Game Is Over...", pp. 21-25) 

So what is success? A big house? (everyone nodded) Good grades? (ditto) Lots of money? Those things are all good, but our daughter used to tutor a junior-high girl. I took her there, driving down this nice street, beautiful lawns, big new houses. But the girl who lived in this big new house came home every day and her parents weren't home! They were out making money! My daughter said, "I would hate to be in her situation." There's nothing wrong with having a big house, but if your kids don't see you, I'm not sure that makes you a successful parent.

And there was a man who wanted to get the best grades he could at seminary. He was studying to become a professional Christian minister. He graduated at the top of his class, but he spent so much time studying that he neglected his wife and children! After graduation, they all left him.

This story comes from John Ortberg's book "When the Game Is Over...": There was a man whose chief operating officer came to him one day and said, "we're standing on the brink of unprecedented economic opportunity." The boss decides he's going to put his empire through a technological revolution: 24/7 access to every employee, completely new software to run the business, etc. He tells his wife, "we'll be set for life" and this sort of thing. She heads to bed at 11, but wakes at 3:00am because her husband isn't with her. She goes downstairs to find him in front of his computer, slumped over the keyboard. Feeling a little exasperated, she shakes him, telling him to come to bed already. But he doesn't wake up. His skin is cold. The paramedics come and pronounce him dead on the spot -- probably a heart attack.

The story of course is the parable of the rich fool (Luke 12:13-21) brought into the modern age. The lesson is as relevant today as it was 2,000 years ago.

    * Possible without college?
      + Soles4souls
      + my cousin

Is true success possible without college? Soles4Souls was started by a man who never went to college. He wasn't a very good student. When he was about 15 years old, he worked for his uncle, who fired him. By the time he was 17, he was contemplating suicide. But one of his teachers took him aside and told him that he could make a difference in the world.

So he didn't kill himself then, but managed to get through high school. What he was good at was shoes; he got executive positions at several footwear companies, never having let on that he hadn't been to college. In 2004 he saw a single shoe floating onto the beach in the wake of the Indian Ocean tsunami. He called others he knew in the shoe industry and got about a quarter-million pairs of shoes to send to the affected area. He's now the boss at Soles4Souls, which gives away a pair of shoes every 9 seconds! And again, no college!

I have a cousin who's about 50 years old, and he never learned to read or write. My aunt, who also never went to college, found the kind of help her son needed, cared for and encouraged him. He has a job as a janitor at an elementary school, and everybody loves him. He wanted to order flowers for Mothers' Day or something, so he went to the yellow pages and found pictures of flowers. Then he saw a phone number that began with the same 3 digits as his home phone number. He called them and said what he wanted. Of course he didn't have a credit card, but the florist found out what they could, and called the school where he worked.

Yes, they did have a janitor there named ___________; yes, he was a reliable man, good character, etc... I guess they figured out a way to get their money, and his mom was surprised and pleased to get her flowers. She asked him how he arranged that, which is how I eventually got the story. My aunt is also one of my heroes, by the way.

My cousin isn't famous, he hasn't saved the world, but he found his niche, he's loved by people he's with, and he's succeeded with the abilities he has. He's found success.

2. God knows we're interested
    * Matthew 6:33 Seek first...
    * Luke 14:7-11 Places of honor at the table
    * Proverbs 3:1-16 wealth, honor
    * Comes from God: Matthew 5:45; James 1:17
    * It's not just for ourselves
      + Ephesians 4:28 to share
      + 2 Corinthians 9:6-8 to share
      + Proverbs 11:23-25 generosity

God knows that we're interested in those things, and he doesn't even mind! If you look at the Bible, both Old and New Testaments, we find God saying things like, "Seek first his kingdom and his righteousness and all these things will be yours as well"; he doesn't say "Don't desire all these things." Or Jesus said to take a lower place at the table, so that the host will honor you in front of others; he doesn't say "You're silly to want to be honored." And Proverbs 3 says you should do this and that in order to get prosperity, favor and a good name in front of others, riches and honor, and so on.

All those things come from God, by the way; he sends sunshine and rain on everyone, and every good and perfect gift comes from him. And the other thing is that when we get good things, it's to share with others. Ephesians 4:28 says that we should work so that we'll have enough to share with the needy. 2 Corinthians 9 has a promise of abundant grace, that always having all sufficiency in everything, you will have a lot for... not for ourselves, but, it says, "for every good work." That promise, by the way, is for those who give joyfully and generously (verses 6-7). And we see in Proverbs 11:23 that the desire of the righteous ends only in good -- but verses 24 and 25 talk about generosity bringing blessing. I think there's a reason those verses are together.

3. True success
    * Matthew 25:21 is spelled F-A-I-T-H-F-U-L
    * Matthew 5:3-10 Blessed are...
    * Micah 6:8 What the Lord requires
    * Psalm 147:10-11 Who the Lord delights in
    * Proverbs 16:32 Better than military might
    * Galatians 5:22-23 Love, joy, peace, patience
    * 2 Timothy 2:24-25 Not quarrelsome but kind, patient, gentle

So what is true success? In the parable of the talents, in Matthew 25, Jesus doesn't say "Well done, good and successful servant" but "good and faithful servant." All the above passages give us a picture of what God considers success: meek, desiring righteousness, merciful, pure in heart, to do justice and love kindness and walk humbly with God, the Lord delights in those who fear him; he who rules his spirit is better than someone who's a military success, and so on.

4. How to become that kind of person?
    * We become what we worship: Psalm 115:1-8, 1 John 3:2-3
    * Admire a gangster?  Or Mr. Rogers?
    * more: -- search "power to change"

So how do we become that kind of person, kind to all, able to teach, patient, gentle, filled with kindness, goodness, faithfulness and all the rest? One principle we see in the Scriptures and also in real life is that we become like what we worship. So we must choose our heroes carefully. In Psalm 115 (and also Psalm 135) it talks about idols. They have eyes but can't see, they have hands but can't move them, and so on. Then it says: "Those who make them will be like them, and so will all who trust in them." If we worship an idol, we'll become blind, deaf, unable to talk or think. By way of contrast, 1 John 3:2 says that we're God's children, and that we'll be like him when we see him as he is. That doesn't mean we'll become gods, but it means we'll be completely clean from sin; 1 John 3:3 says we'll be purified as we place our trust in God.

And so in real life. When I was in high school, being a small kid, I kind of thought I'd like to be the kind of person that nobody would mess with -- one of my heroes was a gangster from the movie "The Godfather." Some years later, I realized that I often had a sort of "edge" -- people were afraid of me. This was not good!

I met Jesus and I remember hearing a speaker at a retreat challenge us: "How would people at work describe you? Brilliant? Competitive? Insightful? Why not warm, caring, compassionate?" I was shocked, because I knew people wouldn't describe me as warm or caring; I was aggressive and competitive. I became more a fan of Fred Rogers (of Mister Rogers' Neighborhood), and maybe 20 years later, somebody at work remarked on how patient and accepting and encouraging I was. That was progress! It took 20 years, and I hope 20 years later I'll be even more like that.

The process of change isn't complicated, but it's not easy either. You do it for 20-30 years and keep doing it. I have some essays on that in my blog,; type "power to change" in the search window (or just click here).

5. How do you obey a command: "Love the Lord" (Mark 12:30)
    * 1 John 5:3, John 14:21: Obedience itself is love
    * We also need to "fall in love" with Jesus, with God
    * Ever hear this: "Bible is God's love letter"?
      + Genesis 1 vs. Enuma Elish (mentioned on my blog)
      + Romans 5:6-8, John 3:16 -- God sent his Son
    * Bible study?  Look for the ways God is described as unique.
      Isaiah 55:8-9 -- /How/ are God's ways higher than ours?  See 55:7

Now Jesus talked about being faithful. Faithful to what? Well, someone asked him what the greatest command was. It's this, Jesus said (Mark 12:30): Love the Lord your God with all your heart, soul, mind, and strength, and your neighbor as yourself. Have you ever thought about what it means to have a command to love? You can't practice it like some physical exercise: "OK, everybody, line up and at the count of three, love the Lord! 1,2,3, you there in the back row, you're not loving!" That really isn't now it works.

So there are two things I'd like to say on this: first, that obedience itself is love, as 1 John 5:3 says. John 14:21, actually throughout John 14 and 15 I think Jesus says it more than just a few times that obedience of Christ and love for Christ are inextricably bound together. The second thing is that beyond obedience, we need to "fall in love" with God, with Christ. And to do that, we need a picture of how much God loves us.

Maybe you've heard people say that the Bible is God's love letter to us? I used to hear that all the time and it was one of those things I didn't actually "get," until I learned about Genesis 1 and how drastically it differed from the predominant creation myth of its day, the "Enuma Elish." That's when it hit me what wonderful news it was to its hearers, and how they must have felt to realize how much God loved them, to tell them this truth about themselves (vs the lies woven through the Enuma Elish). I've written about it here, but I have to say that whenever I think of it, I am so impressed with God's great love, that three thousand years ago (and more) he told someone this astonishing truth about who we humans are. Wow!

And the New Testament -- reading in Romans 5 how God demonstrates his love toward us, and of course John 3:16 -- how much did God love the world? Enough to send his only son! I hope that never gets old to you.

By the way, you might consider doing a Bible study on some theme like God's uniqueness. Look in your Bible for phrases like "Who is like you?" or "What other nation has gods like" or "Who is like me?" or "There is none like you" or "My ways are not your ways" and see what they're talking about. On that last one (from Isaiah 55:8-9), here are a few surrounding verses:

 7Let the wicked forsake his way
       and the evil man his thoughts.
       Let him turn to the LORD, and he will have mercy on him,
       and to our God, for he will freely pardon.
 8"For my thoughts are not your thoughts,
       neither are your ways my ways,"
       declares the LORD.
 9 "As the heavens are higher than the earth,
       so are my ways higher than your ways
       and my thoughts than your thoughts.
 10As the rain and the snow
       come down from heaven,
       and do not return to it
       without watering the earth
       and making it bud and flourish,
       so that it yields seed for the sower and bread for the eater,
 11so is my word that goes out from my mouth:
       It will not return to me empty,
       but will accomplish what I desire
       and achieve the purpose for which I sent it. 
So what's he talking about when he says his ways aren't like ours? A few things stand out to me:
  • God's way isn't like that of the unrighteous.
  • God will forgive! He is full of mercy to those who return to him.
  • His words always have a purpose.
  • That purpose will always succeed.
Now whenever we hear those words, when they're in a song or just in some reading, I hope we think about the Lord's great mercy and goodness, and about his purposeful and powerful word, and we don't just think, "yeah, he's different."

There are other studies you can do, of course, and we have our whole lives to build up memories and experiences to help us remember God's goodness and love and wisdom and mercy and justice -- and his love for us. All these things help us to fall and to stay "in love" with him.

6. Love takes time!
    * Must give up something!  
      + Life takes 36 hours a day -- Ortberg, op. cit., p.127
    * Corollary: You can't get "A"s in everything
      + Choose your C-minus, or there will be Fs
    * Don't get an "F" in Loving God or Loving your neighbor

To love God, and to love our neighbor, takes time; we can't do everything else we want to do, and then add the greatest commandments on top of that. John Ortberg writes that just getting by in a variety of fields (family, career development, sleep, exercise, etc.) takes more hours per day than we have. This means we pretty much have to choose some areas to get a "C-minus" in, because otherwise we'll end up with an "F" in something or another.

This is hard to do, because our tendency is to want to be a star, to get an A-plus in this or that, because that makes us feel like a superstar in that thing. But we don't have any commands like that in Scripture: we have "Don't exasperate your children" and "Honor your father and mother" and "Be kind to one another" -- what we do, in other words, is aim to get a C-minus or better in all subjects; don't go for the A-plus in one area at the cost of getting an "F" in another.

7. Some practical hints
    * Bible: One Year Bible
      + Some notes on One Year Bible at
    * Scripture memory 
      + Search my blog for "memorize scripture"
    * Coming here is a wonderful thing!
    * GIVE: Giving 10% of your income if you can
      + Right off the top -- Proverbs 3:9-10, Malachi 3:10
      + Church isn't the Temple, but this is important
      + Money an IDOL: break its power

Here are a few things that have helped me. For reading the Bible, something like the One Year Bible is a great tool. There are fancy charts you can get to help you keep track of what you've read so far, and so on, but the thing I really like about the One Year Bible is that if you know what day it is, you can just turn to that day and read what's there. If you missed yesterday then sure, you can go back if you want to, but really it's OK to just read today's selection. The thing we're aiming at here is making it easy, so that you can keep doing it. And if you'd like a little essay on the day's reading, I've written essays for every day of the year at

Then, as I mentioned earlier, it's wonderful that you're spending your Friday evening here for worship and fellowship and teaching. Being with each other, singing and hearing these wonderful songs that remind us of who God is -- that's wonderful.

The other thing I'd like to say as a practical hint is to be sure to give. You've heard the passages, Proverbs 3:9-10 which says to honor the Lord with your wealth -- it says you'll get more by giving more but the main point is that it's a good idea to give. Malachi 3:10 is another verse often quoted on giving. Yes, it's true that the church isn't the temple from Old Testament times, but giving is still a very good thing to do. For one thing, there's a lot about giving in both the Old and New Testaments. It's important to give -- to your church, to feed the hungry and help the poor. It's an expression of why God gives us resources.

And giving money away is good because money is an idol, or a potential idol. From the time I was very young, my parents talked a lot about saving money. Yours too? (much nodding.) So when I started working, I put a lot of money into the bank. But then I met Jesus and he said things like "Do not store up for yourselves treasures on earth" and "Don't be afraid, little flock, for it is your father's good pleasure to give you the kingdom. Sell your possessions and give to the poor," and things like that. Also, it wasn't a good thing that when I thought about my savings account I felt safe.

In Old Testament times, idols were made of metal or wood or stone, and the way to break an idol was to knock it over and literally break it in pieces. With today's idols (like money was for me), we can't actually do that. Instead, the way to break money's power is to give some away, and it's good to start early. Maybe you can't afford to give away 10%; give what you can. Here's the thing. I go to a "rich" church. We took a survey and in 2004 the median household income was something like $190,000, which made me below average! Now 10% of $190,000 is $19,000 a year. Is it hard to give away that much? Well, if you can't give away $3,000 when you're making $30,000 a year, it'll be hard to give away $19,000 when you're making $190,000 a year. I don't know why, but it just is. So I hope you start early on giving.

By the way, what works for us is that we have automatic deductions; money just goes out from our checking account to our church, to missionaries, to development and relief organizations. We don't get the experience of giving regularly, but we do give. It's a tradeoff that works for us.

8. Generosity to all and success at work
    * GIVE: Galatians 6:9-10 "to all men"
      + Proverbs 3:27 Don't withhold good
      + Give blood!
    * Take notes at meetings and send them out
    * Someone does something nice for you?  Thank their manager!

Galatians 6:9-10 says "let us do good to all", and the Proverbs tell us not to withhold good to our neighbor when we can give it to them today. By the way, if you can give blood, I hope you do so. Jonathan Haidt, one of the few honest atheists, mentions in this article that religious people give more of themselves to others and give more blood. I think this is a great way to bless others, and it doesn't cost money!

Here are a few applications of this principle at work. Maybe you've been to meetings at work where people talk about what happened last time, and there's a lot of confusion. "Didn't we decide that...?" and "No, Bob objected to that..." and so on, and everybody's time gets wasted.

You can take notes at a meeting and then send them out to everyone afterward. It's not hard, but people generally don't like to do it. If you do it you'll be part of the solution, and maybe the next meeting can be shorter, too. During the meeting itself, pay attention and when it sounds like people have decided things, you can say, "I'd like to capture what we're saying here. We're deciding to switch from vendor A to vendor B, and Joe will contact the logistics people by tomorrow afternoon to get that going. Is that right?" Then write it down. Also, if somebody's supposed to do something, who is that person, what will they do, when will they do it by? Write that down too, after getting agreement. You'll help everybody's time not to get wasted, and it'll be good for your career, too.

My final suggestion is that when someone helps you out with something, email their boss. "I really appreciated Jane's efforts to help me on the issue of __________; her unique insights and cooperative attitude really helped us solve this problem quickly for the customer" or whatever. Thinking this way will help you stay on the lookout for good things people do, which will make you easier to work with. And managers like getting this kind of thing about their people. This idea is also good for your career, for all kinds of reasons.

I talked rather longer than I had planned to, but most seemed to stay engaged until the end. It was a good time, and at the end someone handed me a check! Well, my friend Chris told me they could afford it, so please accept it. That's fine, but I wasn't expecting to be paid; that talk was a highlight of my week! Perhaps they'll ask me back, and at that time I'll try to narrow the topic down and not talk so long.

Where the Wild Things Are

We read the book to the kids years ago, and last night rented the DVD from Blockbuster®. The two stories are quite different, and each very good. The book is a children's book, but I wouldn't call the film a children's film. I mean, it's not The Book of the Dun Cow, which I consider rather creepy for the pre-teen set, but as Wikipedia® reports, the film has a PG rating in the US. It is a little intense.

But I think the film a great conversation-starter. Why are the creatures so unhappy? What could KW or Claire or Carol or Max do to make the situation better? What are the limits of parental or civic/governmental power, and what must each person do for him/herself? And what do you suppose God would say about the problems shown here?

Friday, March 19, 2010

Last kakuro posting for a while, I promise

    A     B     C     D     E     F     G  
1 2 9  
2 1
1 8  
2 1 3
2 4 9  
2 3
8 1
1 4 2    
Couldn't resist the temptation so the solver now outputs HTML like what you see on the left. It's still not pythonic and not even really OO, but it works so far. I am probably never going to perfect it.

A few more pictures, and sources are here:

Lord, Save Us From Your Followers

The teen-ager and I saw the film today. We were a little worried that maybe it was going to be a guilt-fest. It wasn't really, though it was easy to feel overwhelmed.

It reminded me a little of "They Like Jesus But Not the Church." The part of the film I'll probably remember the most was the "Culture Wars" game show, wherein some representative evangelicals competed with some representatives of the "liberal media elite"; the emcee asked questions like "what are some important things Christians say Jesus did" or "what are some common reasons a woman would want to have an abortion." Turns out that the liberal media folks beat the pants off the conservative evangelicals. I actually find this easy to believe.

The exciting thing about all this, though, was what happened after the game-show part was taped. The "contestants" sat around in a back room talking to each other for an hour or two, just talking. After that time, they had a sense that those people are actually pretty nice and enjoyable to talk with -- even though we think completely differently about some pretty fundamental things. I find this really easy to believe, too. Some of my best friends are liberal atheists. We disagree on some pretty fundamental things, but we also agree on a lot of things.

The other thing from the film I'll probably remember for a long time is the importance of service. The outpouring of aid from churches after Katrina/Rita, and helping the homeless in Portland, Oregon, were demonstrations to those outside that the church can actually be some earthly good.

We walked out of the theater and down the street, past a homeless woman. We got about about 3 yards past her and we both stopped and looked at each other. "Want something to eat?" we asked. "Are you allergic to anything?" Only onions, she said. We asked for two bagels, toasted, with cream cheese (Sheri noticed another homeless person -- lucky for him, since I didn't see him at all). Bottled water. A little cracker with chocolate over it.

We handed "Steve" (not the name he told us) one kit, introduced ourselves, and learned his name. He didn't seem to want to talk much. We then found "Sally" and did the same. She told us her name and a little about herself. Laid off after some seasonal work expired. Her children are with their father currently. We listened and wished her well.

The film changed me for a little while, anyway. I hope it sticks.

Thursday, March 18, 2010

It's not Pythonic, but it works (so far)

The code described below doesn't handle very hard puzzle #345943 by Vegard Hanssen; see this later post for an update.
– 2010-03-21
Following up on my earlier post on Python and kakuro, I did a few more things and it now solves every puzzle I've tried on it. I'll explain using this fragment of the earlier puzzle:
      A     B     C     D     E     F    
  0|XXXXX|XXXXX|XXXXX|17\  |15\  |XXXXX| 
  1|XXXXX|XXXXX|  \10| ___ | ___ |XXXXX| 
  2|XXXXX|XXXXX|  \15| ___ | ___ |18\... 
   +-----+-----+-----+-----+-----+-----+-----+ ... 
  3|XXXXX| 9\  |16\  |  \11| ___ | ___ | ___ | ... 
                           | ... | ... | ... |
The earlier version did this:
  1. For each blank cell, create a list of possible values. This is initially [1,2,3,4,5,6,7,8,9].
  2. Given the number of cells that must add up to a given total (e.g., 1D+1E=10 because of 1C across), figure out all possible combinations of values (e.g., 1+9, 2+8, 3+7, 4+6; can't do 5+5 because that would repeat). Remove from the cells any possible value that isn't in this list of combinations (so that 1D and 1E would have at most [1,2,3,4,6,7,8,9]).

    Do this for all totals. (In the above example, 1D+2D=17 because of 0D, hence 1D and 2D can be at most [8,9]. Similarly, 1E can be at most [1,2,8,9]. More on this below.)

  3. If the number of possible values becomes 1 for any cell, then that cell's value is decided. No other cell that's part of the same total (whether an across total or a down total) can have that value, so eliminate that value from the list-of-possibles for those cells. This may cause another cell's list-of-possibles to have only one value, so this other cell is now decided, and so on. Repeat until no more cells are getting decided.
  4. Another way a call's value can be decided is this: Suppose that all combinations require a certain value (if you have to produce 22 in 3 cells, for example, this can be 9+8+5 or 9+7+6; in any case you need a 9), and suppose only one of your cells could possibly have that value (because of other decided cells/combinations), then that cell must have that value, so it's also decided. Repeat the loop of step#3 until cells stop getting decided.
  5. For all totals, eliminate any combination that's impossible by virtue of step #2 (for example, the combinations possible for 1C are now reduced to 1+9 and 2+8, since 3+7 and 4+6 require values that 1D cannot have)
  6. Repeat #2-#5 until they don't modify anything in the puzzle
That got me to the result shown earlier, with 41 cells left undecided. Here's what I added since that earlier posting:
  • Handle 2x2 boxes with a tail on them. (The "box technique" is described concisely in the Wikipedia article.) In the above example, 1C says 1D+1E=10, and 2C says 2D+2E=15. Hence 1D+2D+1E+2E=25. Similarly 0D and 0E dictate that 1D+2D+1E+2E+3E=17+15=32; combining we see that 3E=7. This is another way a cell's value can be decided. Repeat the loop of step#3 above until no more cells are decided. This filled in a dozen cells, leaving 29 undecided.
  • Make steps #2,#5 more effective by using ordered lists of numbers rather than unordered lists. In the example of step#2, we determined that 1E has possible values [1,2,8,9]; this is because 1C's list of possible combinations was reduced to 1+9 or 2+8; that code didn't take cell ordering into account. Yes, I know it was dumb, but I code the easy cases first! If we keep track of permutations (ordered lists) of possible cell values rather than merely combinations, the program will know that 1E can't be 8 or 9; it can only be 1 or 2, since 1D can be 9 or 8. With this logic added, the program solves all kakuro puzzles I tried, including today's from the Examiner.

    It seems like we have a sort of belt-and-suspenders thing going here; the "box" logic described in the previous bullet might overlap with what step#4 does, and the step of using permutations rather than combinations might have been adequate by itself. But I'm not sure and I'm not motivitated to work more on it now.

    Why not just start with the permutations in the first place? Well, if you have 9 cells (45 in nine), then how many permutations is that? Right, 9!=362880. Well, that's possible on most well-equipped modern computers, but it seemed rather much to me.

That sure was fun! I've put my code, and a few examples, on for your viewing pleasure.

Sunday, March 14, 2010

Python and kakuro

I don't know when these started appearing in the Examinator, but the lovely Carol has started doing kakuro puzzles. In case you haven't been bitten by the bug yet, the idea is... ah, best you read it yourself on the link above.

Now I thought it would be more interesting to write a solver than to actually do the puzzles, so I gave it a shot, thinking it would be no harder than writing a sudoku solver. You probably guessed it -- I was wrong. Well, at least it's harder for me. If I had started with an easier example I might be feeling cocky right now, but instead I started with this one... which my solver (so far) has left a bunch of blanks in:

      A     B     C     D     E     F     G     H     I     J     K     L     M     N  
  0|XXXXX|XXXXX|XXXXX|17\  |15\  |XXXXX|XXXXX| 5\  |17\  |XXXXX| 9\  | 8\  |XXXXX|XXXXX|
  1|XXXXX|XXXXX|  \10| ___ | ___ |XXXXX|15\11| ___ | ___ |  \14|  8  |  6  |12\  |XXXXX|
  2|XXXXX|XXXXX|  \15| ___ | ___ |18\14| ___ | ___ | ___ |  \ 6|  1  |  2  |  3  |10\  |
  3|XXXXX| 9\  |16\  |  \11| ___ | ___ | ___ |XXXXX|XXXXX|XXXXX| 6\  |14\ 4|  1  |  3  |
  4|  \10| ___ | ___ |15\  |  \ 9| ___ | ___ |27\  |XXXXX|16\29|  5  |  9  |  8  |  7  |
  5|  \11| ___ | ___ | ___ | 9\18| ___ | ___ | ___ |10\ 8|  2  |  1  |  5  |15\  | 4\  |
  6|XXXXX|10\17| ___ | ___ | ___ | 6\  | 8\11| ___ | ___ | ___ | 9\  |  \ 5|  4  |  1  |
  7|  \12| ___ | ___ |  \36| ___ | ___ | ___ | ___ | ___ | ___ |  2  |11\ 4|  1  |  3  |
  8|  \ 8| ___ | ___ |16\  |15\10| ___ | ___ | ___ |13\  | 6\21|  7  |  9  |  5  |17\  |
  9|XXXXX|16\  |17\18|  9  |  7  |  2  |  \18|  8  |  7  |  3  |  \13|  2  |  3  |  8  |
 10|  \30|  9  |  6  |  7  |  8  |XXXXX|XXXXX|  \ 4|  3  |  1  |22\  |  \11|  2  |  9  |
 11|  \ 9|  7  |  2  |15\  | 8\  |XXXXX|17\  | 4\ 9|  1  |  2  |  6  | 9\  |XXXXX|XXXXX|
 12|XXXXX|  \24|  9  |  8  |  7  |  \12|  9  |  1  |  2  |  \ 8|  7  |  1  |XXXXX|XXXXX|
 13|XXXXX|XXXXX|  \ 8|  7  |  1  |  \11|  8  |  3  |XXXXX|  \17|  9  |  8  |XXXXX|XXXXX|

Basically what my solver does is calculate all possible combinations of cells that can add up to the prescribed totals. This gives an easy start -- if you look in the lower right-hand corner you see that cells 13K and 13L must add up to 17. The only legal way for this to happen is for 13K to be 9 and 13L to be 8. The reverse might be possible except that because of cell 11L, we see that 12L+13L must add up to 9. If 13L were 9, then 12L would have to be zero, which isn't allowed.

That simple strategy didn't get me all that far; I then went to the rather sophisticated (I thought) step of saying, "If all combinations adding up to the prescribed total require that at least one '5' be present, and only one cell could possibly be '5', then that cell must be '5'." This allowed me to decide that 8M=5.

But beyond that, you see there are still a bunch of blanks in the puzzle above. I have an idea for a next step, but I'm not sure that'll be enough. Well, that's enough fun for today; time for sleep.

Ahhh, too wide

I'll have to hack the output to be html rather than fixed-width font. Later.

Jesus is God, and you are not. Neither am I for that matter.

In yet another great sermon, our pastor asked us a lot of rhetorical questions. If the world is the Lord’s, then whose is it not? Well, it's not ours, that's not whose it's not.

So when the Bible says we were created to rule over creation, this doesn't mean it's ours; it means we're to be regents, or stewards. We're supposed to take care of it, because it's his, not ours. (This is where I'm tempted to pick a fight with atheistic relativistic environmentalists: if the world doesn't belong to God, if man is "just" another part of nature, then what objection is there to the idea of just having most powerful exploit our planet for whatever reason they want? In the wild it's survival of the fittest, right? But that's a fight for another day.)

Today's objection is to the Mormons and the “Jehovah’s Witnesses” -- both of whom have a view of Jesus Christ contradictory to what the Scriptures teach us. I'll sum up the orthodox (note the lowercase "o") view:

Jesus is God, and we are not.
If I think Jesus isn't God, I make one kind of error; if I think that I am God (or could become God), I make another.

Rather a simplistic way to summarize the Christian faith I know, but really what I'm trying to do here is simply show how it differs from two major cults. So rather than talking about what the cults say, let's focus on what the Bible does say about Jesus. Here are a few points for consideration.

  1. Jesus is the creator: Colossians 1:16 says that "all things were created by him and for him." John 1:3 says so too: "Through him all things were made; without him nothing was made that has been made."
  2. John 1 has a lot to say about this: In the beginning was the word, and the word was with God and the word was God. We know this is talking about Jesus because in John 1:14 it says that the word became flesh, and his name, the name of Jesus Christ, appears in John 1:17.
  3. Jesus never ever sinned, as Hebrews 4:15 (and many other passages) say. This is why he was able to pay for the sin of the whole world (1 John 2:1-2).
  4. As Jesus himself said, "Worship the Lord your God and serve him only" (Matthew 4:10) Yet the Magi worshiped him (Matthew 2:10); the disciples worshiped him (Matthew 14:33); the women who saw him after the resurrection worshiped him (Matthew 28:9) -- and that's just in Matthew's gospel! There are lots more cases where Jesus doesn't reject worship. (Note that Paul and Barnabas rejected worship in Acts 14:10-18.)
  5. Thomas correctly recognized Jesus as God (John 20:28) and Jesus didn't contradict him.
So the Holy Bible teaches us that Jesus is extraordinary and in fact that he is God, and that we are not! Christ does call us brothers (Hebrews 2:11-12) as he called his disciples brothers (John 20:17). Yet although the Bible says "we will be like him" (1 John 3:2) this doesn't mean we're going to be God; it means that we will be purified (1 John 3:3).

If therefore someone tells you that Jesus used to be sinful like we are, or that we can someday become God like he is, you can be sure that they don't have a firm grasp on the truth as taught in the Bible. Likewise if someone tells you that Jesus isn't eternal -- e.g., that he's just very old.

Sunday, March 07, 2010

Firefox won't start!

So I'm running Ubuntu 9.04 32-bit on this AMD Athlon(tm) 64 Processor 3000+ box my buddy Kipp gave me. Yesterday I booted it to get the flight status of the lovely Carol's return home. Clicked on the little firefox icon and saw the "Starting Firefox..." label pop up on the "dock" at the bottom of the screen. Then it went away. Huh??

Opened a terminal window and said "ps x|grep fire" -- nothing. I looked in $HOME/.mozilla/firefox/*default for a lock file -- I think it was .parentlock but removing that didn't do me any good.

That's weird, I thought. Tried "mv .mozilla .mozilla-old" to see if something else in there might have been causing a problem. Nope -- the firefox rectangle appeared and disappeared, and there was a brand new "$HOME/.mozilla" directory there, but still no browser!

Next: did the System→Administration→Synaptic Package Manager thing, marking firefox for reinstallation. No effect. Deleted it, then installed again. Ditto.

Well, that was rather annoying! Typically I'd use a web browser to download a tarball and then unpack it, but since my browser (i.e., firefox) was itself toast... clearly I had a chicken-and-egg (or a bootstrap problem if you like): I didn't have a functioning browser, so I needed a browser to download a browser. The package manager didn't know about opera (and maybe it's not free anymore anyway?).

Fortunately, there is a non-graphical browser that worked fine; lynx. I typed "lynx" and my shell told me I needed to install it. No problem; once it was there I just did what came naturally: accepted all cookies, and it directed me to or something. I selected the 9.8MB Linux download at the bottom of the web page (not just the bottom of my screen; had to use the arrow keys to get there). After a short while I had the file; where should it be saved? $HOME/firefox-3.6.tar.bz2 was fine.

Probably wget would have worked too, but since I'm a dinosaur I thought first of lynx.

Now to install; I became root and said "mkdir /opt/firefox-3.6; chown collin /opt/firefox-3.6" then became myself again. "cd /opt/firefox-3.6; tar -xjf $HOME/firefox-3.6.tar.bz2" did the job.

Whew! Firefox is back. Why did the old one (a 3.0 version) go bad in the first place? No idea. But I'm up and not sufficiently curious....