Sunday, December 17, 2017

Life imitates code

Sometimes life imitates art, as they say; this is a case where life imitates code.

It started a half-century ago at least (the story, not the code). Way back when I was in elementary school, Dad gave me the idea of making “Soma cube”s out of wood. I don’t know how many of these I made back in grade school, but a few years ago I started doing it again.

Then about this time last year, I wondered what it would be like to write a program to solve the puzzle. This page has links to the source code for a solver written in C++; I couldn’t run it because I don’t do Windows. I soon decided to keep the data representation but otherwise write a new solver in Python.

The solver places the “T” piece in the only way possible (as explained here in the wikipedia article), then places the “L” piece in one of 28 unique positions. Here “unique” means never having to say “that’s a reflection of a previously-described solution”; ask me for details or see the code if you’re hungry for details. Anyway, the other pieces—V, Z, A, B, P (wikipedia’s nomenclature)— get placed after T and L.

Consulting a recent output, I discovered that the “V” has 103 possible placements (by “possible” I mean given the position of “T”), whereas the “P” has only 42. For some reason I had the intuition that placing the “P” first would use less CPU time.

I ended up coding a sort step so that the solver would place the “hardest” piece (the “P”) first, and then the pieces with increasing numbers of possible placements, and finally the “V” last. How much of a difference does it make? I don’t recall, but I’ll just try it now on a 2.4GHz Intel Q6600:

$ time ./soma2-unsorted.py > s2-unsorted.out

real 3m46.587s
user 3m46.564s
sys 0m0.004s
$ time ./soma2.py > s2-sorted.out

real 0m38.732s
user 0m38.720s
sys 0m0.008s
$ 
That’s 226.6 seconds vs. 38.7 seconds, a nontrivial difference.

Fast-forward to earlier this month. I was thinking again about wooden puzzles and wikipedia told me about the “diabolical cube”, with only 13 solutions, and it’s here that life imitates code.

Because of my experience with the Soma cube solver, I immediately started by placing the “hard”est-to-place pieces first, and then try to place the easier ones. By proceeding that way, I figured out the first several solutions. But to get the rest of them, I modified the Soma cube solver… after a few tries it worked, completing in about a second. Here’s an actual run on the same box as above:

$ time ./diacube.py  > d.out

real 0m0.978s
user 0m0.976s
sys 0m0.000s
$
The 7-cube piece must be placed parallel to a face of the desired 3x3 cube; it can be
  • actually on a face—in this case, the rest of the pieces determine a unique solution; or
  • between two faces—in this case, it’s possible to create solutions that are reflections of each other. I could have avoided this by coding for placement of the second piece (I would have done this to the 6-cube piece) but instead opted to write a little code to keep only one solution out of a pair of reflections.
There wouldn’t be many of these, because my program produced 17 solutions, whereas Wikipedia told me there were only 13. So it computed only 4 redundant solutions, and it would take longer to think about unique placements than it would be to write the code to find reflections.

Or so I thought. I goofed up the code that looked for reflections, because I had forgotten that my solutions contained references to each polycube’s placement. In computing a reflection, I trashed the original polycube. A rookie error.

Anyway, if you ever get your hands on a “Diabolical cube,” it’ll be a lot easier to solve if you place the 7-cube piece and the 6-cube piece and the 5-cube piece first.

For reference, I’ll give you the 13 solutions, after some blank space if you want to avoid the spoiler :)

solution 1:
6 6 6
4 4 2
4 4 2
7 6 6
7 7 7
7 7 7
3 3 6
5 3 5
5 5 5
solution 2:
6 6 6
4 4 2
4 4 2
7 6 6
7 7 7
7 7 7
5 5 6
5 3 3
5 5 3
solution 3:
6 6 6
2 4 4
2 4 4
7 6 6
7 7 7
7 7 7
3 3 6
5 3 5
5 5 5
solution 4:
6 6 6
2 4 4
2 4 4
7 6 6
7 7 7
7 7 7
5 5 6
5 3 3
5 5 3
solution 5:
6 5 5
6 6 3
6 6 6
4 4 5
4 4 3
2 2 3
7 5 5
7 7 7
7 7 7
solution 6:
6 5 5
6 6 3
6 6 6
2 2 5
4 4 3
4 4 3
7 5 5
7 7 7
7 7 7
solution 7:
4 6 2
4 6 2
5 6 5
4 6 3
4 6 3
5 5 5
7 6 3
7 7 7
7 7 7
solution 8:
4 6 3
4 6 3
5 6 5
4 6 2
4 6 3
5 5 5
7 6 2
7 7 7
7 7 7
solution 9:
4 5 5
4 3 2
3 3 2
4 5 6
4 6 6
6 6 6
7 5 5
7 7 7
7 7 7
solution 10:
4 5 5
4 3 3
2 2 3
4 5 6
4 6 6
6 6 6
7 5 5
7 7 7
7 7 7
solution 11:
3 5 5
4 4 2
4 4 2
3 5 6
3 6 6
6 6 6
7 5 5
7 7 7
7 7 7
solution 12:
2 5 5
3 4 4
3 4 4
2 5 6
3 6 6
6 6 6
7 5 5
7 7 7
7 7 7
solution 13:
3 5 5
2 4 4
2 4 4
3 5 6
3 6 6
6 6 6
7 5 5
7 7 7
7 7 7

Sunday, December 10, 2017

A few thoughts from when my home was invaded by adolescents

That was a long time ago, but I'm thinking now about a couple of specific things we heard at the girls’ school in those days.

One was a seminar titled something like “When an Adolescent Invades Your Home”—I mentioned it in this post (written when both girls were in college). The presenter said that for quite a few years, children live largely unconsciously, with the lights off (he turned off the classroom lights to illustrate). Then, he said, a wonderful thing starts to happen: the lights come on (he flipped the switch to on) for a while (he turned the lights off). He didn't play with the switch much longer, but we got the idea.

This rang true, as I remembered doing really stupid things when I was younger, and yes I do feel very fortunate to be alive. Even today, the lights aren’t on for me all the time… but enough about me :). The point, though, is that for junior high kids (and even high school kids), the lights aren’t always on.

Another thing from that seminar iirc is that the onset of puberty has been happening earlier and earlier in the United States. One guess is that it's related to the hormones we feed to livestock to get them to mature faster. Anyway, the lights aren’t coming on necessarily sooner, but the hormones are raging earlier. So it’s more challenging now than it was a half-century ago.

The other thing that stuck in my mind was something their junior-high school Principal said in a graduation speech (probably in 2005). As parents, we have many roles with our kids. We supervise, guide, teach them, coach them, and so on. But what stuck in my mind was his comment that from here on out it’s mostly cheerleading; by now their habits are largely already set. From here on out (this was 8th grade graduation), we are not going to change their minds about many things, or get them to develop or drop many habits.

In other words, the time for most (key word, that: most) of that has already passed. Which is actually kind of scary, considering that the lights are still off a fair amount of the time and that their hormones are probably raging more than ours were at their age.

But then nobody said it would be easy.

Sunday, November 19, 2017

What should the church think about nontraditional sexuality?

(title updated 2017-12-10)
Some years ago, when I was recruiting the next cohort of elders to be on our church’s board, I spoke with a sister I’ll call “Dorcas,” whom I thought eminently qualified. She declined, citing Tim Keller’s teaching that women are forbidden from the office of elder. I was quite surprised at Dorcas’s demurral, but wondered whether my ideas were more enlightened than hers, or just less pure.

Though I hate to disagree with Dr. Keller, I nevertheless undertook my own study of the issue, consulting other writers as well as the Scriptures. You can see the results here on my blog.

Fast forward to about a year ago, when my younger daughter Sheri asked me to consider a study regarding the Bible’s teaching about homosexuality. Was the traditional interpretation in fact correct, and is the 21st-century Church drifting away from the truth? Alternately, have we been wrong all this time, as we were about slavery for example, and are we due for a change?

Before going into my study and its results, I’ll summarize my understanding of the issue when I started out. A few points, in no particular order:

  • In the beginning, God created humans male and female, as the Lord Jesus said in Matthew 19.
  • The Law (the first 5 books of what Christians today call the “Old Testament”) forbids various kinds of sexual activity; I blogged about one such prohibition back in 2007, when the One Year Bible’s daily reading included Leviticus 18.
  • Although Jesus affirmed some parts of the Law (Matthew 5:17ff), he revised other parts (Mark 7:5–7, 17–23). Hence it’s debatable whether the Old Testament’s gender-related prohibitions were confirmed vs. revised by Jesus. From my limited understanding it appeared to me that Jesus didn’t revise or amend any of those gender-related prohibitions.
  • The above notwithstanding, Jesus never directly addressed gender identity nor sexual activity (or attraction) between persons of the same gender.
  • It bears repeating here that Jesus did directly address sexual sins such as adultery, which he defined very broadly (Matthew 5:28); anger; covetousness; failure to care for the hungry, the alien, the prisoner, the sick. These sins are practiced very widely, even within the church—to our collective shame.
  • I remember a conversation I had at that time with a fellow elder on my church’s board. Based on my understanding of the Scriptures, I asserted that God would never punish sexual activity by eternity in hell. My fellow elder’s reply was something like: “I’m more concerned with how we treat them here on earth.”

    I’m glad that we were in agreement regarding ultimate destiny, but his comment influenced me in the intervening years in the way I think about the Christian life. Jesus did speak of the world to come, but he spoke a lot more about life here and now.

Also, around that time, I read
  • Jesus, the Bible, and Homosexuality by Jack Rogers;
  • Wesley Hill’s Washed and Waiting; and, some time later,
  • Justin Lee’s Torn.
The Rogers book I found wholly unconvincing at the time. I’m unsure what I’d think of it today.

Hill and Lee are gay men who have struggled with their orientation for many years. These brothers of mine desire to follow and obey and worship and serve God. They did not ask for their same-sex attraction; indeed, they sought to change their orientation. One passage in Washed and Waiting particularly touched me when I read it in 2011. Hill attended a wedding reception and got bulldozed into dancing with a young woman he knew slightly in college.

A couple of days later I explained to my friend Chris over breakfast what had happened. We danced, I said. I was with this beautiful girl. I was holding her hand and touching her back. Her dress was thin and showed every curve on her body, I said. I could feel her sweating through the dress, and, inches from her face, I could see every exquisite feature she had. “And, Chris,” I said, “I felt nothing. No attraction. No awakening or arousal of any kind. No sexual desire whatsoever.”

Chris nodded. He knows my situation backward and forward and wasn't fazed by what I was telling him.

“The worst of it,” I continued, “is that while I wasn’t attracted to this stunningly beautiful person who was my dance partner, I couldn’t stop looking at the guy dancing several feet away from me. I did notice him. I noticed his body, his moves. Chris,” I said, “I was attracted to this guy. All I could see and desire was another guy across the room while I’m dancing with this girl. This is so frustrating. This is what it means to be gay, and I would give anything to change it!” (133)

Poignant and painful, these paragraphs gave me a little bit of a picture of what it’s like to have only same-sex attraction. As I paged through the book, searching for this passage, I confirmed my impression that Hill’s view is the traditional one.

I read Lee’s book a year or two later, shortly after it came out late in 2012. As Hill gave me an idea what it’s like to have same-sex attraction, Torn gave me a picture of what it’s like to be in the Church as a gay man. As one might expect, it’s a mixed bag. Lee has some prescriptions for us all, whether or not we take the traditional view on same-sex attraction. I think these steps would be very helpful, and I hope this little essay is a baby step forward.

One thing from Lee’s book that shocked and saddened me was his discovery that so-called “reparative therapy” has never actually worked—as far as his investigation was able to find. He quizzed people about successful case studies, but none seemed to exist. In other words, the whole thing was wishful thinking at first and a fraud later on. Whether you believe Lee, or some of the claims in Exodus International’s wikipedia article, the organization no longer exists.

When Sheri prodded me to undertake my current study, she pointed me at video lectures by Gushee (I’ve lost/forgotten the links), which the lovely Carol watched with me. These presentations discussed the experience of LGBT folks in the church; I’m sorry to say that overall we have not welcomed them and we have not loved them the way Jesus would have us to do—independent of whether certain kinds of sexual attraction and activity are (or aren’t) considered OK by God. In hindsight, it was appropriate that my current study began with the more important question, viz., how are we doing on that new command Jesus gave his disciples? “A new command I give you,” Jesus said: “That you love one another even as I have loved you, that you also love one another. By this everyone will know you are my disciples, if you have love for one another” (John 13:34–35).

That said, the question “What does God think about certain behaviors?” is still important, and to that end I’ll mention a few resources that I encountered this past year:

Brownson argues persuasively that neither the traditional interpretation (basically what I thought in 2013) nor revisionist interpretations (I think of Rogers, but it’s been several years since I actually read him so I’m not sure) are correct. He ends up pretty much saying what Loader says, but his argument is more comprehensive (it’s a book to Loader’s short essay). I’ll jot down a few things that I remember from it.
  • When we protestants read the Bible, we make all kinds of judgments about what we must follow vs. what we need not follow today, following various kinds of logic. So for example, we discard the prohibitions against bacon and shrimp not only because they’re delicious, but also because Jesus declared all foods clean. The Apostle Paul also wrote a lot about this in Romans and Colossians.
  • These arguments are not just about Old vs. New Testament commands, either; Jesus commended foot-washing. The Apostle Paul forbade braided hair and golden jewelry. He also commanded that men lift their hands when praying.
  • To determine whether a particular biblical precept or prohibition is normative for today, then, we engage the text with some kind of logic or another. These we hope are coherent and consistent, and are not based solely on what feels good vs. icky to us.
  • When we examine the prohibitions against sexual activity between two people of the same gender, we must try to understand how to interpret them. Are those commands like the Old Testament prohibitions of bacon and shrimp? Or the commands prohibiting sexual intercourse during a woman’s menstrual period?

    Alternately, are they like the New Testament commands to greet one another with a holy kiss, or to abstain from braids and jewelry? Or are they in the same vein as “Do not lie to one another”?

  • Romans 1 seems to condemn same-sex sexual activity, but if that’s the common-sense interpretation of Romans 1:25–32, what’s the meaning of “you who pass judgment do the same things” (2:1)? The same things: what same things?

    Brownson explains it better than I ever could, but his point is that in order to explain the flow of the argument in 1:25 onward, the explanation must also say what 2:1–4 means. The rhetorical style seems to be that in 1:27–32, Paul takes the part of certain moralists of the day. Then in 2:1 he takes a sharp turn and shows why his readers must not just nod in smug agreement with the previous several sentences.

The short version is, Brownson convinced me, and Loader’s essay is a terrific shorter summary of part of Brownson’s argument.

But more important than a list of what specific sexual behaviors are permissible between which specific partners—about which reasonable, diligent, devoted disciples of the Lord Jesus Christ disagree—is the question of how we treat our neighbors (the subject of second greatest command, which is like the first, Jesus said in Matthew 22:38–39) and how we treat one another (John 13).

And that, as a former manager used to say, is all I know.

Saturday, October 14, 2017

An eventful week; a grateful me

The younger ex-teen got married last weekend; it was a celebration of great joy—and also relief.

You see, Grandma Bessie (my mom) was planning to visit us, arriving Tuesday night. But rather than going to the airport, she went to the emergency room due to abdominal pain, severe and unrelenting. My mobile phone exploded with text messages. The phrase “aortic <something>” was heard. X-rays and CAT scans were discussed.

They had me at “aortic”; I started checking flights, but didn’t book anything until the medical folks settled on the diagnosis: aortic aneurysm. I clicked “Book this flight” for Alaska 837, SJC→HNL Wednesday morning.

Wednesday

Am I getting old, or was it just the stress, or have the seats gotten harder? Whatever it was, I was hurting by the time we landed. Inga picked me up and we went straight to Queen’s. Dr. Sato came in and advised Mom to get the endovascular aneurysm repair, maybe like the one decribed here on webmd.

As I heard the story, Mom had said she’d consider it; today the surgeon was recommending it. He itemized a bunch of risks, things that might happen during surgery. They’re not frequent, he said, but they do happen. I asked him what he would recommend for his own mother, if she had a similar condition. Surgery.

He told Mom of a past, younger patient of his. He recommended the surgery, she declined, she went home, the aneurysm ruptured, and she died the same day. Mom was sold, and Dr. Sato indicated that he’d try to do the endovascular aneurysm repair Thursday afternoon.

Then an anaesthesiologist came in, describing how the anaesthesia itself had risks (beyond the surgery), including death! My comment was, we don’t have many alternatives here.

Thursday

In the morning we heard the surgery would be at noon! I ran down to the hospital, having spent the night at “home,” and hung around until they shooed me out. I sat in the waiting room for a while, and then sister Donna said I could join her in pre-op. After some confusion, the nurse and I found each other, and she ushered me in to Mom’s area, where it was freezing. I was impressed by the keep-warm technology.

Mom was mightily bored by all this and kept dozing off, or maybe she just closed her eyes. Eventually they said they were really going to do the surgery, and I snapped a pic just as she was about to go to the “OR.” The photo is dated 1:57pm.

I went home for a nap, and Mom was done about 5:20pm. The surgery had gone well, I heard. I eventually figured out how to get to the surgical waiting room in QE Tower. Quite a few folks were there, sister Inga and nieces and nephew; several of them were still heading to California for the wedding.

They let me into the recovery area after a while, and I joined Donna there. Mom would have to lie flat for four hours, the first two with sandbags on her thighs, to discourage reopening of the surgical incisions (pokes, actually). She wasn’t too happy about that.

I held Mom’s hand for the next 3 hours or so, giving her Bible passages or praying or chatting or just sitting. At some point Donna took my parking ticket to a nurses’ station, where they stamped it for me. I would later find out that the afternoon’s parking would be on the house :).

At the 7:00pm shift change, the new nurse asked Mom if she knew where she was.

“Hospital,” she murmured.

“Do you remember the name of the hospital?”

“Queen’s.”

“Do you know what month and year it is?”

“October,” she croaked.

“And do you know remember the year?”

“Seventeen.” It was barely a whisper.

“Who are these people?” the nurse asked, indicating Donna and me.

“I don’t know!” she said. Very funny, Mom! The nurse wasn’t fooled for a moment.

Some other post-op procedures were needed. An X-ray for example. So the X-ray guy showed up after a while and said something about sitting her up. The nurses updated him on the situation; I didn’t have to tackle him.

Around 10pm the nurse moved her to a private room in QE tower. We were about to exit the elevator on the 8th floor when an EMERGENCY indicator lit up, the doors closed, and the elevator expressed back whence we came.

The doors opened to reveal a nurse with a surprised expression; he released the elevator, mumbling something about grabbing another one, and the elevator returned to the 8th floor. Our nurse explained that some ICU patients must be transported without delay immediately after surgery; they cannot wait.

Mom got situated and after a while, Donna suggested I go home. No argument from me on that.

Friday

The next morning, Dr. Sato dropped by Mom’s room to ask how she was doing. Any pain? Mom shook her head no.

He smiled. “See? Told you!”   He also said, “You can go home today as far as I’m concerned.” No medication needed, but Mom should take it easy the next couple of weeks.

I ran “home” so Jana could take me to the airport. (I had already packed my things.)

My return flight was uneventful, but all too long. Again my seat hurt. The lovely Carol picked me up late Friday night.

Saturday

I’d missed Friday afternoon’s rehearsal, but I was assured all I had to do was follow directions—always a challenge for me, but perhaps it would be OK this time.

Several friends of Peter and Sheri spoke at the ceremony; each one added a unique perspective, so that all of us present got glimpses of both bride and groom. I have to tell you that as much as I respected and esteemed Peter before the ceremony, his friends’ comments made me feel even happier to have him in our family. The celebration was intimate and meaningful and and God-honoring.

By the way, my nephew Keith unobtrusively live-streamed the ceremony; Mom and Donna and Jana and Mom’s great-grandchildren all could see it.

As I said at the reception, “It’s hard to be humble when Peter is your son-in-law!” Oh, and we “facetime”d with Mom at the reception. She looked happy.


I am a very grateful man today. I wasn’t quite in a panic Tuesday, but as I said several times, it was a little too exciting. Aortic aneurysms are often fatal; it was fortunate indeed that Mom had a lot of pain so that she would know to go to the hospital. And it was fortunate that the symptoms appeared before she came to California.

And now both my daughters have husbands that make it impossible for me to be humble.

And it’s also really hard to be ungrateful. My cup is full, even as the nest is empty.

Monday, October 09, 2017

Well, that’s weird: Fibonacci edition

About six years ago, I read a puzzle about Fibonacci numbers in CACM and tried to understand the solution, so when I recently saw on quora the question “Is every Fibonacci number divisible by 31 also divisible by 61?” I was interested enough to figure out (to my surprise) that indeed every one is: every 15th Fibonacci number is divisible by 61, but only every 30th is divisible by 31.

This I found unusual and amazing, and I wondered, for what other primes is this true? Naturally I wrote some Python.

#!/usr/bin/python -utt
# vim:et:sw=4

'''
Let f(n) be the nth Fibonacci number (f(0)=0, f(1)=1, f(n)=f(n-1)+f(n-2))
For prime p, let ff(p) be the smallest n such that p|f(n),
e.g. ff(3)=4 because f(4)=3

Now, what primes (p, p2) satisfy p>p2 but ff(p)<ff(p2) and ff(p)|ff(p2)?
'''
import sys

def main(maxx):
    '''
    Get primes up to /maxx/, and the first /maxx/ Fibonacci numbers,
    then check for the criteria described above.
    '''
    plist = prime_list(maxx)
    flist = fib_list(maxx)
    ff = dict()
    for p in plist:
        for n, f in enumerate(flist):
            if f >= p and f % p == 0:
               ff[p] = n        # e.g. since f(4) == 3, ff[3] = 4
               break
        else:
            print "Couldn't find fib which %d divides" % (p)
    # Now ff[p] is idx of 1st fib that p divides
    for idx, p in enumerate(plist):
        f = ff[p]
        for j, p2 in enumerate(plist[:idx]):
            # for p2 < p
            f2 = ff[p2]
            if f2 > f and f2 % f == 0:
                print 'f(%d) = %d and f(%d) = %d' % (p, f, p2, f2)
            
    sys.exit(0)

def prime_list(pmax):
    '''
    Return a list of prime numbers up to pmax (sloppy criterion)
    '''
    # First two nontrivial primes
    plist = [2, 3]
    # Look for further primes by formula p = 6k +/- 1 for some k
    for cseed in range(6, pmax, 6):
        cand1, cand2 = cseed - 1, cseed + 1
        for p in plist[2:]:
            # Zero a cand if another prime p>3 divides it.
            # Need not check p≤3 because of construction.
            if cand1 == cand2:
                # must both be zero
                break
            if cand1 and cand1 % p == 0:
                cand1 = 0
            if cand2 and cand2 % p == 0:
                cand2 = 0
        else:
            append_t(plist, cand1)
            append_t(plist, cand2)
    return plist

def append_t(alist, athing):
    '''
    Helper: append /athing/ to /alist/ but only if /athing/ is "true"
    '''
    if athing:
        alist.append(athing)


def fib_list(fmax):
    '''
    Return a list of the first /fmax/ Fibonacci numbers
    '''
    bak1, cur = 0, 1            # f(0)=0, f(1)=1
    flist = [bak1, cur]
    for n in range(2, fmax):
        bak1, cur = cur, cur + bak1
        flist.append(cur)
    assert flist[5] == 5        #print 'DEBUG:', 5, flist[5]
    #print 'DEBUG:', flist
    return flist

if __name__ == '__main__':
    maxx = 99
    if len(sys.argv) > 1:
        maxx = int(sys.argv[1])
    main(maxx)
Running it produces:
Collins-MacBook-Pro:fib31 collin$ ./pfib.py 
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
Collins-MacBook-Pro:fib31 collin$ 
Whoa, really? Every 11th prime is divisible by 89, but only every 44th is divisible by 43? H'm.
f(11)=89, f(22)=17711, f(33)=3524578, f(44)=701408733
Every one of those guys is divisible by 89, but only the last is divisible by 43. How weird is that? And from looking at the pattern of what happens to f(n) mod 89 as n increases, it's clear that indeed every 11th Fibonacci number is divisible by 89, and every 44th is divisible by 43.

If instead of 99 we say 199 or 299, what do we get?

Collins-MacBook-Pro:fib31 collin$ ./pfib.py 199
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
f(199) = 22 and f(43) = 44
Collins-MacBook-Pro:fib31 collin$ 
OK, I examined that one, and everything is as it seems. What if we go another 100?
Collins-MacBook-Pro:fib31 collin$ ./pfib.py 299
f(61) = 15 and f(31) = 30
f(89) = 11 and f(43) = 44
f(199) = 22 and f(43) = 44
f(211) = 42 and f(83) = 84
f(211) = 42 and f(167) = 168
f(229) = 114 and f(227) = 228
f(233) = 13 and f(79) = 78
f(233) = 13 and f(103) = 104
f(233) = 13 and f(131) = 130
f(281) = 28 and f(83) = 84
f(281) = 28 and f(167) = 168
f(281) = 28 and f(223) = 224
Collins-MacBook-Pro:fib31 collin$ 
Well, that was fun if not exactly insightful. Why so many from 200–299, compared to the range 1–199? But the upshot is, we could ask a number of other questions, like
  • Is every Fibonacci number that's divisible by 89 or 199 also divisible by 43? (Yes.)
  • Is every Fibonacci number that's divisible by 79 or 103 or 131 also divisible by 233? (Yes.)
and so on. No idea why, but there it is.

Sunday, August 13, 2017

What is our hope?

I recently came upon Mary Jo Balistreri's lyrical, poignant essay, At the Window, in Issue 13 (spring 2017) of Minerva Rising. Balistreri was 71 when she wrote the essay, speaking of the present and the past, of her dead grandsons and her dying daughter, and her own failing body.

I re-read the essay during a week when I learned of two deaths. I met Bill, who was about my age, in the early 1980s; I last saw him a few years ago in Yosemite. He died in an automobile accident earlier this month. The next day, Marshall, 71, perished in an airplane crash. I served with Marshall several years ago in the coffee and hospitality crew at our church's San Mateo site.

My mind turned toward my own future as these events, and Balistreri's essay, seeped into my consciousness. I reminded myself that every day is a gift, that life is uncertain. And I thought about hope. Yesterday morning, the lovely Carol read to me from Frederick Buechner's Secrets in the Dark (HarperCollins, 2006) [author's site]:

To remember the past is to see that we are here today by grace, that we have survived as a gift.

And what does that mean about the future? What do we have to hope for, you and I? Humanly speaking, we have only the human best to hope for: that we will live out our days in something like peace and the ones we love with us; that if our best dreams are never to come true, neither at least will our worst fears; that something we find to do with our lives will make some little difference for good somewhere; and that when our lives end we will be remembered a little while for the little good we did. That is our human hope.

op. cit. pp. 63–64, in “A Room Called Remember”
Buechner goes on to describe a better, fuller hope.
Then death shall be no more, neither shall there be any mourning or crying. Then shall my eyes behold him and not as a stranger. Then his Kingdom shall come at last and his will shall be done in us and through us and for us.
loc. cit.
This is hope indeed. We pray to God, “Thy kingdom come, thy will be done on earth as it is in heaven.” but speaking for myself I often fail to do what I know to be his will. Love my enemies, pray for my persecutors? I have the hope that one day I'll be fully willing and able to do all that.

But for today, I put one foot in front of the other. I ask for help. I fall down. I get up. And I remember, or try to, what God has done in my life and in the world, and I hope.

Friday, July 28, 2017

Come to me, rev2

Is this a little easier to follow?
This is not exactly a continuation of an earlier post… well, maybe it is. Or it could be. I’m using it to explore the idea of Matthew 11:28-30 as a gospel invitation.

What was I doing in this Bible lecture? Well, actually I know how I got here—I tried to get a date with Doreen, but she got me to go to “Alpha” with her, then I found myself reading the… the New Testament for crying out loud!

Then I was hooked—not just on her, but on the subject; I mean I really wanted to understand all this. So when she invited me to a talk about the Good News of Jesus for Today (approximately), it sounded interesting enough that I didn’t even mind when she couldn’t make it at the last minute. Anyway, the lecture was starting.

“Jesus said, ‘Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy and my burden is light.’ This invitation is the centerpiece and summary of Matthew’s gospel.”

That confused me. I mean, was that it? I heard several times in college and grad school that “All have sinned…” which I never liked much, but this guy was talking about a yoke?

“What makes us weary and burdened?” he went on. “What makes me weary is trying to manage other people’s opinions of me.” I could relate to that one.

“And what burdens do we carry?” he continued. “Jesus isn’t talking about rent and groceries. But there are burdens we really shouldn’t bear, things we worry about—things I worry about—that we need to set down,” he said.

I started making a mental list, which to be honest didn’t include world peace or a cure for AIDS; the issues, I’m embarrassed to say, were mostly about me. Affording a house, the next round of layoffs in the rumor mill, this sort of thing.


“So what did you think, Ray?” Jeff asked over a beer. I’d met him at Alpha, and wasn’t sure if he was like me, or if he already believed most of this.

“It’s more appealing than ‘You’re all sinners,’” I said.

“Yeah,” he said. “I mean, I don’t disagree with all that, but ‘Come to me’ is more, you know, inviting.”

OK, he did believe most of that. So I wondered aloud why he was here.

“Well,” he began, “I’ve been asking myself on and off the past few years, ‘What is the gospel?’ I mean, when Jesus preached the good news about 2,000 years ago, people were mostly really happy to hear it. What message would appeal that way to my friends and neighbors? Some years ago, I actually spent time knocking on people’s doors and asking them what they thought about Jesus. And if they let me, I’d explain the good news that although they were sinners, Jesus died for them. Results were, as they say, mixed.”

“Wow! You never struck me as one of them,” I said. He chuckled a bit—he didn’t seem embarrassed at all. “So you still believe that, but you’re wondering how to market it better? I mean, ‘Come to me…’ and ‘All you guys are sinners’ sound like they came from different books.”

Jeff had an answer for that one. “Jesus did say ‘Come to me…’ but he also said that looking on a woman to lust after her was committing adultery in your heart. And that being angry at someone was like killing them. He also said to love your enemies. When I put all that together, I get the picture that we are all sinners. So he effectively said that ‘sinners’ thing too. Jesus healed a paralyzed man, but before he healed him, he said to him, ‘Your sins are forgiven.’ This got him into some trouble with the religious authorities of his day. He definitely did it on purpose.”

I remembered that story. “Didn’t he say something like ‘So that you guys know I have authority to forgive sins’?”

“Yes he did! He made a big deal about having that power.” He was on a roll now. “Here’s how the thing about sinners ties in. If I don’t know that my sins are forgiven, I’ll always be insecure, so I’ll feel compelled to try to manage people’s opinions. I don’t think it’s possible to escape the addiction to ‘impression management’ unless we know our sins are forgiven.”

“Whoa,” I said. “If I’m honest, I’d have to say I do a lot to give the impression that I’m cool or smart or whatever… though at the same time I try to tell myself that I shouldn’t care so much what everybody thinks. And it is tiring, like the guy said.”

“We like to think we’re too sophisticated for this, but we all have a kind of primitive fear of being found out. That’s why it’s good news that Jesus has the power to forgive sins.”

“So when Jesus says, ‘Take my yoke’ and ‘learn from me,’ he’s deliberately leaving some parts out—doing a kind of head fake?” I asked.

“Well, he doesn’t give the entire dissertation in every sound bite.”

Did Jeff sound a little defensive? But he had a point. “Fair enough,” I replied. “But if somebody hears the ‘summary and center-piece’ and tries to live like Jesus and learn from him, they’ll get frustrated that it’s not actually possible?” So much for all those guys who think religion is a crutch; this one at least was looking like a cast-iron bitch.

He paused a moment. “When Peter Drucker was a boy, his piano teacher told him, ‘You will never play Mozart the way Arthur Schnabel does. But there is no reason in the world why you should not play your scales the way he does.’ Drucker’s point was that a lot of practice is required. We can’t learn the Jesus way like we learn which sorting algorithm works best for which dataset. It’s a lifetime of walking with him. That’s why he said ‘yoke’; he didn’t say ‘teleprompter.’

“Jesus isn’t a textbook; he has a different way of teaching. Do you know the parable of the sower?” I didn’t. “Jesus says the kingdom of God is like this strange guy who throws seed everywhere.”

“Everywhere?” I asked. “Like not just in his field?”

“Right. On the road, on the rocks, in the weeds—very inefficient. The text says that some people came around him to ask what it meant, and Jesus said, ‘The secrets of the kingdom are given to you…’”

What? “Who’s the ‘you’ there?” I wanted to know.

“That’s exactly the point. Most of the audience said, ‘Great sermon, Rabbi,’ then went home and forgot all about it.”

“But the few who didn’t?” I asked…

“Right. The ones who said, ‘Uh, Rabbi, what did you mean?’ Those were the ones who heard the secrets of the kingdom.”

“So if you ask and keep asking, you’ll get it?” I think Jesus said something like that, too.

Jeff was nodding. “You know how every hotel room in America has a Bible in it?” I did, and not just in the USA either. “Probably 99% of the guests never even open it.”

I saw where he was going. “But anyone who reads it, and keeps reading to try and understand it and live it…”

“They get the secrets of the kingdom,” he said.

Fascinating. The words of the parable say one thing… “So the parable is an invitation to do something, not just an explanation of interesting facts?”

“Exactly,” he said. “He’s not giving us a dissertation or a topo map or a textbook. Instead he’s inviting us into a relationship. An apprenticeship.”

“So when he invites people to ‘learn from me,’ as he says,…”

“That’s apprenticeship,” Jeff completed the thought. The parable—well, its interpretation at least—also invites us to apprenticeship. But ‘learn from me…’ is more straightforward.

“So what do you think, Jeff?” I wanted to know. “You’ve been thinking about what the gospel is for today; do you think that’s it? That Jesus is taking apprentices, and if we sign up, we can get healing from our addictions and burdens?”

He was nodding. “Hey, that’s pretty good! Mind if I use that?”


Of course, the gospel is more than that (why is Romans 1:17 good news?). But as far as why it might be interesting to someone who doesn’t know Jesus, is it all that bad as a summary?

Monday, July 17, 2017

Come to me… Is this the gospel?

Please see rev2

Monday, June 26, 2017

Adventures in Automotive Technology, Prius Edition

FRESNO, Friday 6pm: 150 miles from home, on our way back from a week in the mountains, we're on our way to meet our friend Sylvia for dinner, when warning indicators suddenly appear on our 2006 Prius. We bought it 15 months ago with 57,000 miles on it; now the odometer reads 80,000.

The icons include a scary red triangle with a bright "!" in the middle, and something that looks like a skinny doughnut. On the "Multi-Information Display" we see the red outline of a car profile with another red "!" superimposed.

The car drives just fine, so we drive another few miles to dinner, where we enjoy catching up with Sylvia. I inspect the instrument panel further. I find nothing, but a web search tells me that it's not safe to drive unless we know what the codes are. The Diagnostic Trouble Codes (DTC) can't be read at any random auto repair shop; only the dealer knows how to get them and what to do with them.

Early Saturday morning, we get to a Toyota dealership, where a friendly service rep tells us that unfortunately, all the master technicians are at a Toyota sponsored event. Last year it was Disneyland; this year it's NASCAR. So probably nobody can actually read the codes, or knows what to do if they could. I thrust both arms in the air and cry: "Today must be my LUCKY DAY!" (I didn't say what kind of luck.) This got a smile out of "Ted" (name changed to protect the innocent).

I ask him, off the record, what he would do in my place: 150 miles from home, car full of camping stuff, gotta get to work Monday, all the master techs are out of town, etc. "I'm not gonna tell anyone, 'Ted at <dealership name> told me…'" I say.

He says he'd take a chance and head home. "I'm a risk taker," he says.

"So THAT'S why you work at a Toyota dealership!" I say. "Those guys that climb El Capitan without ropes—they're BORING. Life right here, now THAT'S livin' on the edge!"

That gets another chuckle out of Ted. And just in case I'm not a complete whack job, he adds: "But if you lose power" or any other hiccup, we should pull over and get towed, he says. Fine. I shake his hand and he gives me his card.

Well, we didn't quite make it to Los Banos. The car lost power and I pulled over near some almond trees by the side of the road. At least it wasn't too hot. The lovely Carol called AAA for a tow, and was on hold for a while; I took over with her phone and waited... well, a while longer. I don't actually know how long we were on hold. Eventually, though, a wonderful lady came on and took our information. She arranged a tow, and said the driver ought to be to us about 11:27am.

At 11:26 (I am not kidding) I saw a tow truck on the opposite side of the highway. It made a legal U-turn and the driver pulled in front of us. He took my AAA membership number and towed us to the Toyota dealer in Merced, about 2 hours from home. I guess that means we drove 50–60 miles before crapping out.

We paid the driver for the extra mileage (AAA covers a 5-mile tow, but we went 21 miles), then I chatted with Kevin the service manager. When I told him what lit up, he said, "that's the indicator you don't want to get." Exactly. "90% of the time when you get that," he said, "it's the hybrid battery. The other 10% it's something else."

Oh, and all the master techs watching NASCAR races? "I have a master tech in here every Saturday." Wow! It really is my lucky day! He was out at lunch but would be back soon.

How much does it cost to replace the battery? Something like $3,500. But the other issue would be time. "It takes six hours to replace the hybrid battery," he said. "and we close at five." He could get us into a rental car before that and we could head home with the laundry and the perishable stuff anyway.

The master tech returned from lunch, and after a while Kevin asked us if we ran out of gas. "No, we filled it up in Visalia" (or was it Three Rivers?) "and drove about 200 miles." I said we had about half a tank. A short while later, it looked like we had a bad fuel level sending unit.

More time passed. Kevin came over. "I have some more information. You weren't that lucky. He did a test drive and found something else was wrong." It turns out that the Prius has a lot of sophisticated electronics. Those electronics must be kept from overheating. There is a pump for the coolant, and it had failed. It would set us back several hundred dollars to replace that. The good news was: it would be done by five.

Kevin was good as his word. We had been there about five hours, and spent about $500. The tow truck was about $100 and about another hour. So we got off easy this time.

So the end of our vacation week could have been a little better; it also could have been a whole lot worse.

Sunday, May 21, 2017

Isaiah, Merton, Rob

When we lived in Kobe (Japan), our pastor frequently spoke on the theme of the way we live our lives. A big problem we have, he said, is something he called “My Way.” I was reminded of this recently when he posted a photo of a printed prayer, with the caption “If you pray this sincerely from your heart, you will be given eternal life!” (roughly translated).

I expect that Pastor Rob composed that prayer, which reads in part: “I've gotten so tired of doing things my own way” (roughly translated. Actually all my translations are rough, so this is the last time I'll say that). The prayer goes on to describe an earnest desire to live God's way from now on.

I'll include the entire prayer below, but this contrast between “My Way” vs. “God's way” reminds me of another prophet—the Old Testament prophet Isaiah actually. One of Isaiah's famous quotes is from chapter 53, which you may have heard in Handel's Messiah:

All we like sheep have gone astray.
We have turned every one to his own way.
And the Lord hath laid on Him
the iniquity of us all.
Isaiah 53:6 (AV)
Isaiah writes about our ways vs. his ways a fair amount in these chapters. In chapter 55, for example, we read
Let the wicked forsake his way
    and the evil man his thoughts.
Let him turn to the Lord, and he will have marcy on him,
    and to our God, for he will surely pardon.
“For my thoughts are not your thoughts,
    neither are your ways my ways“
                        declares the Lord.
Isaiah 55:6–8 (NIV 1984)
And what does that look like, to go my own way? Thomas Merton, a 20th century Trappist monk, writes very insightfully that
…I do not find in myself the power to be happy merely by doing what I like. On the contrary, if I do nothing except what pleases my own fancy I will be miserable almost all the time.
No Man Is an Island 3.1 (p. 25)

The prudence of the flesh is opposed to the will of God. The works of the flesh will bury us in hell. If we know and love and act only according to the flesh, that is to say, according to the impulses of our own nature, the things we do will rapidly corrupt and destroy our whole spiritual being.

op. cit., 8.3 (p. 134)
According to Merton, the antidote to “My Way” isn't necessarily to join the military or monastery, where we're no longer free to act as we like. On the contrary, he writes that
…we must remember the importance and the dignity of our own freedom. A man who fears to settle his future by a good act of his own free choice does not understand the love of God. For our freedom is a gift God has given us in order that He may be able to love us more perfectly, and be loved by us more perfectly in return.

Love is perfect in proportion to its freedom. It is free in proportion to its purity. We act most freely when we act purely in response to the love of God. But the purest love of God is not servile, not blind, not limited by fear.

op. cit., 8.1–2 (pp. 132f)
So that's the thing: we act most freely by acting most purely in response to the love of God. This is a supernatural thing; it does not come naturally. Consequently, we need help.

Which brings me back to the prayer, which as I mentioned I believe is due to Pastor Rob.

天の神様
私にはあなたが必要です。
God of heaven: I need you
今へりくだって、あなたを呼び求めます。
Humbly now I call on you.
もう、自分のやり方でやって行く事に
疲れてしまいました。
I've totally gotten so tired of going my own way.
あなたのやり方で生きて行けるように助けてください。
Please help me to live life your way going forward.
私は、今、自分の人生の扉をあなたに向けて開きます。
I now open the door of my life to you.
あなたが私の主となり、救い主となってください。
Please be my Lord and Savior.
私の心にぽっかり空いた穴を聖霊で満たし、
私を完全な者にしてください。
Please send the Holy Spirit to fill the hole that opened up in my heart, and make me a perfect person.
主よ、私があなたを信頼できますように、
私があなたを愛せますように、
私があなたのために生きていけますように、
どうか私を助けてください。
Lord, please help me somehow—to be able to trust you, to make me love you, to live my life for you.
あなたの恵みと憐れみ、平安を私が理解できますよう、
私を助けてください。
Please help me to understand your grace and compassion and peace.
主よ、感謝します。 アーメン
Thank you Lord. Amen.
Thanks to my friend Shuji for checking my transcription, and for his suggestions on my translation. All remaining errors are mine.
Update Monday morning, May 22: It struck me that this prayer can be a response to Matthew 11:28–30, where Jesus says
Come to me, all you who are weary and burdened, and I will give you rest. Take my yoke upon you and learn from me, for I am gentle and humble in heart, and you will find rest for your souls. For my yoke is easy, and my burden is light.

Saturday, April 15, 2017

LG 34UM58-P, Debian Jessie, nVidia NVC0

Short version: I run this script after logging in (runlevel 5):
#!/bin/sh
# Extract from Xorg.0.log when monitor was connected via DVI/HDMI cable
# (II) NOUVEAU(0): Manufacturer: GSM  Model: 59f1  Serial#: 105956
# (II) NOUVEAU(0): Modeline "2560x1080"x60.0  185.58  2560 2624 2688 2784  1080 1083 1093 1111 -hsync -vsync (66.7 kHz eP)

/usr/bin/xrandr --newmode  "2560x1080_60.0"  185.58  2560 2624 2688 2784  1080 1083 1093 1111 -hsync -vsync
/usr/bin/xrandr --addmode HDMI-1 2560x1080_60.0                            
/usr/bin/xrandr --output HDMI-1 --mode 2560x1080_60.0 
Details follow.
Remember the bad old days of monitors on Linux? A new monitor meant trying to figure out the modeline, tweaking various configuration files, all the while hoping you didn't smoke your monitor?

It's been a long time since I've had to do anything like this, and so I was out of practice when my brand new LG monitor (2560x1080, 34" diagonal) didn't work "out of the box" with my computer.

I brought the monitor home from our neighborhood Costco, where I had been eyeing it for some time. Because of my temporal separation from the bad old days, I didn't even think of checking for compatibility until it didn't work. But I'm getting ahead of myself.

First thing, I got home and noticed oops, it only has HDMI inputs, no DVI (even I didn't think it might have (S)VGA). No problem; I have a DVI/HDMI cable. Which the quick start guide warns against using. Well, what was I going to do about that? So I connected it up, and after the initial screen, nothing. Fortunately, my old monitor had started working again by then so I could look at /var/log/Xorg.0.log and such.

Eventually I noticed this in the logfile:

[    18.396] (II) NOUVEAU(0): Initializing outputs ...
[    18.424] (II) NOUVEAU(0): Output DVI-I-1 has no monitor section
[    18.480] (II) NOUVEAU(0): Output DVI-I-2 has no monitor section
[    18.482] (II) NOUVEAU(0): Output HDMI-1 has no monitor section
What do you mean, "HDMI-1"? Well, there was a mini-HDMI socket in the video card. I hadn't noticed it before. Keeping in mind that LG warned of (in)compatibility issues when using a DVI/HDMI cable, I sought a miniHDMI/HDMI cable.

With that cable, things started working better, but still I was getting 1920x1080 resolution, which looks ugly. Also not so useful. And the monitor whined about it. After some web searches, I came up with the script you see at the top of this post; I run it after login and it works fine.

There is a way to make Xorg just come up in this mode, but I don't have the motivation to figure out what it is... Just call me slacker.

Whirlpool cooktop repair GJC3634RP03

We've had this cooktop since we re-did the kitchen in 2008. A few months back it developed a crack. Recently, the front right burner stopped working.

I ordered a replacement burner, and thought to install it last Saturday. I'd done this before (with a different burner) and was overconfident; I removed the cooktop from its recess in the countertop and, long story short, it experienced sudden deceleration upon impact. Instead of one crack I now had, well…

7:15 AM
Right. I didn't replace the burner last weekend, because I discovered why it was dead: stuff had literally fallen through the crack, which now was a hole, and interacted unfavorably with the burner element. More on this below.

Anyway, the first thing to do is turn off the power:

7:43 AM
After flipping the breaker off, I ensured there was no juice by turning on a burner and verifying that the power indicator didn't illuminate.

Next, I pulled the cooktop from its recess in the countertop. I opened the drawer (knob(s) visible in the picture below) and pushed up on it, then manhandled it out of the hole, placing a piece of scrap wood under it. You can see in the photo that the crack is especially pronounced.

7:47 AM
The glass top is held on with eight (8) "Phillips" head screws, three on the long sides and two on the short sides. The picture below shows two of the screws (well, one hole and one screw) on the rear edge of the cooktop:
7:52 AM
Fortunately, the glass isn't all that heavy. I lifted it off and set it aside. Here's what the range looks like without the top. Note the small dish in the foreground, where I stashed the screws.
7:53 AM
Here are the two damaged burners. "Wait," you may be thinking, "you only mentioned one bad burner!"

You're right; we hadn't noticed the rear burner was bad. Well, it wasn't all bad; you see, the rear burner is a sort of dual burner; you can heat up only the center part, or you can turn on the whole thing. It was the outer, torus-shaped part that was damaged. Details of the damage are shown later on.

7:55 AM
Then I removed the front burner. Notice that no fewer than four wires are connected to this thing! That's because it has a temperature sensor in addition to the heater. When the surface is hot, an indicator lights up to warn you.

Anyway, I took a photo so I could be sure to put the wires on the right place when installing the new burner:

7:55 AM
Once the wires are disconnected, the burner basically lifts out; it's held in place by these, umm, brackets?

Anyway, here's the old one.

7:57 AM
And here's the new one, which doesn't come with its own brackets; I moved the old brackets onto the new one.

Since I moved them one at a time, a photo wasn't strictly necessary (as I thought it was for the wires), but still:

7:58 AM
The next two photos give some detail of the damage to the burners. The damage to the front burner is extensive.
8:00 AM
Damage to the outer part of the rear burner isn't quite so bad, but methinks it's enough to make the outer burner not work:
8:00 AM
The wiring for the rear burner is a little more complicated than for the front burner:
8:01 AM
Undersides of both rear burners. Same deal: the "brackets" need to be moved from the old burner to the new.
8:04 AM
Here's a pic of the two new burners, installed.
8:10 AM
The new glass top is black, for two reasons: first, I could find one in stock at appliance parts pros (I think repairclinic.com also had one), whereas a white one would be back-ordered.

Second, as you might guess, the white glass top is very hard to keep clean-looking. Some stuff just doesn't come off. This one might not be any easier to keep clean, but it won't look as bad when it's not.

Here it is, before I screwed it on. Dad always told me to start all screws before fastening any, but I made an exception for the toughest-to-reach screw on the rear edge. From this picture, you can imagine how annoying it is; I only wanted to put the screwdriver in that position once. (I suppose I could have started the other 7 screws, and done that screw last, but I didn't think of that 'til now.)

8:12 AM
The new glass didn't come with the rubber grommets/washers/bushings/whatever for the control shafts. I transfered them from the old glass:
8:13 AM
It also didn't come with knobs. I could have bought new black knobs, but maybe the white-on-black look won't be so bad.
8:20 AM
Here it is, with knobs on and eased back into its recess in the counter. It doesn't look half bad, if I do say so myself:
8:22 AM
And now, turn the power back on:
8:23 AM