Wednesday, April 28, 2010

"Do you work out?"

I don't think a young lady had ever asked me that before, but it happened last week. And no, it wasn't like, "I thought you said you were in shape, Gramps; do you even work out?" How did that happen? How is it that after more than a half-century, I got that question last week?

I'll tell you: John's cycling class at the Sequoia YMCA, 6-7AM Mondays. As I wrote last week, you get a good workout, nobody will hassle you if you're not up to standing up on the pedals when everybody else is, and at least for my fifty-plus knees, ibuprofen wasn't even needed after the 3rd week. Just going once a week was enough to get me into good enough shape to be asked that.

And who was this young lady who asked me that? A cardio tech -- I was undergoing a treadmill test involving an EKG and some ultrasound movies. One young woman was monitoring my EKG, and the other took my blood pressure from time to time as I exercised on the treadmill. They were talking about interval training and remarking on how quickly one can get the heart rate up using this treadmill on an incline.

Of course, if too many of you come to class, we'll run out of stationary bikes and some of us will have to switch to another day or something. By the way, John is reputed to offer brownies to the winner of his Tuesday night quiz on facebook (which I haven't tried). After eating these, you'll feel like you need to come to class on Monday. A beautiful scheme, is it not?

Sunday, April 25, 2010

Kissing the face of Jesus; serving at CityTeam

This weekend is Compassion Weekend at our church, where rather than meet on Sunday morning, we go into the community and serve, mostly on one of these projects. At our San Mateo campus, we kicked the weekend off with a terrific meeting.

First up was Brent leading the worship band -- a "youth" band featuring one dad who claimed to be 29, his teenaged(?) son Matt on keyboard, Ivana on violin, a teen flutist, and a trumpet player. Oh, Henry was on drums and I think there was one other person on rhythm guitar.

Next, Eric shared some stories and gave us some motivation for the weekend ahead: Even if we were "just" painting or landscaping or moving furniture, we were on the mission field.

Then Kevin delivered a message -- a summary of something he heard from John Ortberg at a conference. You can read parts of that in pages 2 and 7 of this transcript, but basically the idea is that if you look at what Jesus preached, it's all about something he called "the kingdom of God." Passages like Mark 1:15 and Luke 8:1 and Luke 9:2 and Acts 1:3 suggest that this concept of the kingdom of God is pretty important to Jesus. What's my "kingdom"? Basically that's the "range of my effective will," a place where things go the way I want them to. You have a kingdom; so do I. Wherever a two-year-old can say "No!" and make it stick, that's also a kingdom. The two-year-old's kingdom is limited and temporary, but it's a kingdom nonetheless.

When we say "Thy kingdom come, thy will be done on earth as it is in heaven," we're asking God to make the earth his kingdom; we're asking him to do his will on earth the way it's done in heaven. And the good news is that the kingdom of heaven, the kingdom of God, the range where everything goes the way God would like it to go -- is coming near to this sorry, dark world. When we do God's will, we're part of that; we're bringing God's kingdom to earth.

Something else I remember from that message was an astonishing insight from Matthew 25. You may recall the passage -- Jesus is describing the day of judgment, where his sheep will be separated from the goats:

Then the King will say to those on his right, "Come, you who are blessed by my Father; take your inheritance, the kingdom prepared for you since the creation of the world. For I was hungry and you gave me something to eat, I was thirsty and you gave me something to drink, I was a stranger and you invited me in, I needed clothes and you clothed me, I was sick and you looked after me, I was in prison and you came to visit me."

Then the righteous will answer him, "Lord, when did we see you hungry and feed you, or thirsty and give you something to drink? When did we see you a stranger and invite you in, or needing clothes and clothe you? When did we see you sick or in prison and go to visit you?"

The King will reply, "I tell you the truth, whatever you did for one of the least of these brothers of mine, you did for me."

So Mother Theresa was caring for a dying leper. This fellow had been out on the street for months (maybe years). She was holding his hand and kissing his face. Probably his last day of life, and how long had it been since he had last been kissed?

Someone asked her if she didn't feel any revulsion at all because of the leper's open sores, etc., and she said that she was, according to the above passage, actually kissing the face of her king, the Lord Jesus Christ.


CityTeam Painting Project

Last month, the lovely Carol talked with Charles, who directs the men's shelter at CityTeam in San Jose. Was there something that we could do for the men? He described a renovation project that some groups have done -- paint and replace carpeting in one of the dorm rooms. These are 20'x20' rooms housing six men. We settled on painting, and decided we could probably do two rooms. Steven drove to San Jose to go over some details with Charles and to eyeball the rooms, and Carol bought paint and tarps and brushes and roller covers.

On Saturday morning, we drove down to CityTeam -- Carol, Christina in one car and Steven and Suzie in another. We had ladders and brushes and rollers and a brush-cleaner in our car too. The lovely Carol wrote more about this on her blog. It was a great time, and we were quite tired at the end.

We went downstairs with the stuff we were going to take home. I told the receptionist that there was some work still to do in the lounge: switch and outlet plates to be replaced, thermostat cover and cue rack and other stuff to go back onto the walls, the TV cabinet to be moved back against the wall and so on. No problem, he said. Then there was the matter of the screwdriver I'd borrowed. "I wouldn't want José to get in trouble," I said, as I handed it to the receptionist. (José had taken me to see the tool-man, who was understandably possessive of his equipment.)

The receptionist was effusive in his appreciation. "You guys worked hard all day and did a great job," he said. The residents and the maintenance man would be happy to reassemble the room.

What a blessing, to be able to support these guys who are working hard to make their lives better. I pray that they may experience the reality of God's promise: To those who by persistence in doing good seek glory, honor and immortality, he will give eternal life. (Romans 2:7, NIV)

Saturday, April 24, 2010

Darwin's Dilemma

My buddy John sent me the DVD by that title, though the title apparently also belongs to a DOS video game from the 1990s. The film summarizes a startling event -- the Cambrian explosion. In Darwin's own words:

There is another and allied difficulty, which is much more serious. I allude to the manner in which species belonging to several of the main divisions of the animal kingdom suddenly appear in the lowest known fossiliferous rocks.
The case at present must remain inexplicable; and may be truly urged as a valid argument against the views here entertained.
Charles Darwin, On the Origin of Species, 6th Edition
(Project Gutenberg EBook #2009), chapter 10
As the film explains, Darwin's theory predicted gradual change over long periods of time, but what the fossil record shows is the sudden appearance of several phyla over a very short period of time.

Now I'm not a biologist and I'm not going to argue for or against intelligent design. What I would like to do is make a few observations that struck me.

First, and this is something I heard some time ago (not in this film) about Chinese biologists conversing with their American counterparts. "We can criticize Darwin but we cannot criticize our government. You can criticize your government but you cannot criticize Darwin." I don't have names, dates, or even the exact wording, but anyone who thinks scientists aren't dogmatic needs to look at the evidence. Some are, some aren't -- just as some Christians are dogmatic and some aren't, and the same for other religious groups and political parties. In connection with this, you might enjoy reading Lewontin's comment on dogmatism in science.

By the way, is censorship is alive and well in the politically-correct scientific establishment even today? I suppose yes; you might want to check out the claims made in this article from an admittedly conservative source.

Second, a few years ago we heard a fascinating recap of the debate over evolution, presented by a venture capitalist who attends our church. He has no axe to grind over evolution, though he's a product of our educational system he believed as most right-thinking Americans do -- that natural selection is how we got to have all these species, Darwinian evolution is established fact, those who disagree are willfully ignorant, etc.

Some years before that, he was at some retreat or something when he discovered that people at our church don't all believe the evolution story. Apparently someone heard him mutter, "What kind of whackos am I getting myself involved with?" He does not remember saying this out loud, but apparently...
His comment was this: Darwin's "tree of life" has remarkable similarity to what geneticists have discovered by analyzing so-called "junk DNA" in various species. These markers seem to be consistent with Darwin's ideas; that is, with no knowledge of DNA, Darwin came to many of the same conclusions that modern biologists have by looking at analyses of the genetic material of many different species. In other words Darwin was spectacularly right about the relationships between species as confirmed by inspecting DNA. But Darwin's theory was also spectacularly wrong in its prediction that various species would appear gradually in the fossil record, whereas the fossil record shows just the opposite: a veritable explosion of life in the Cambrian era. I am not sure what the producers of this particular film would say about the discoveries related to "junk" DNA. To be fair, though, the subject of the film was Darwin's dilemma -- which has nothing to do with DNA, junk or otherwise.

Third, is Darwin's Dilemma actually still a problem for the theory of evolution (or "conjecture" -- but I'll give it the benefit of the doubt)? A search on the topic yields a reference to PNAS June 20, 2000 vol. 97 no. 13 6947-6953, titled "Solution to Darwin's dilemma: Discovery of the missing Precambrian record of life" by J. William Schopf, who writes “those of us who wonder about life's early history can be thankful that what was once “inexplicable” to Darwin is no longer so to us.”

But 8½ years later, Science Daily announced that Darwin's dilemma had been finally solved:

Solution To Darwin's Dilemma Of 1859

ScienceDaily (Jan. 9, 2009) — A solution to the puzzle which has come to be known as ‘Darwin’s Dilemma’ has been uncovered by scientists at the University of Oxford, in a paper to be published in the Journal of the Geological Society.
This article by Jonathan Wells disputes that those scientists solved the dilemma; indeed, Wells concludes:
But this was not Darwin’s dilemma. Darwin’s dilemma was the absence of intermediate fossils showing that the Cambrian phyla diverged from a common ancestor. Callow and Brasier didn’t solve Darwin’s dilemma. Instead, they put one more nail in the coffin of Darwin’s attempt to salvage his theory from it. The truth is that “exceptionally preserved microbes” from the late Precambrian actually deepen Darwin’s dilemma, because they suggest that if there had been ancestors to the Cambrian phyla they would have been preserved.
So just googling around doesn't give me a really good feeling for The Answer. I used to think this was a Really Important Issue; now, though I don't think it's exactly trivial, I'm not nearly as concerned about it. Part of the reason is that I no longer believe Genesis 1 was intended to be a chronological account of creation; rather, I think it was a polemic (more on this here). And if you're interested in some comments from a website that's not quite so conservative or religious, you might enjoy reading the DVD's customer reviews on amazon.

赤じそ it ain't

The lovely Carol signed us up for a weekly bag from Two Small Farms. Basically, they drop a bag of stuff for us at an undisclosed location once a week. Since we don't always recognize what's in the bag, we sometimes face a challenge in figuring out how to make the best use of this fresh organic produce.

Such a challenge came to us in the previous week's grab-bag (more properly a drop-bag) in the vegetables you see at right. My first thought when I saw them was "青じそ" which is obviously wrong, since the plant is red (赤) not "blue" (青). Too bad, because I really miss that taste sometimes.

But this plant doesn't have much of a smell. I sauteed a few leaves this morning and scrambled them with some eggs and sliced sausage; they turned everything pinkish. Disappointingly, not much of a taste or aroma. I cut off the thick part of the stems, but these aren't like woody like the bottom parts of some Chinese broccoli stalks; they probably would have been OK to add.

Fortunately, the folks at two small farms have a "What's in the box?" page, where we found that this particular vegetable is called "Mystery" -- well, we clicked to discover that our mystery vegetable is called "orach" -- also known as goosefoot -- pictured at left. According to the Wikipedia article, it was used a lot more before spinach became more favored (I wonder if Popeye the Sailor Man had anything to do with that). There's a lot more information about this plant in this essay from Mariquita Farm.

I can't say I'll look for it in my grocery store. Apparently nobody carries it, but even if they did, the chief reason I'd buy it would be to mystify guests. It doesn't have an exciting taste (like fennel bulbs) or a nolstagia-inducing flavor (as 青じそ would, at least to me); you don't get a lot of volume out of it (like you do with leeks)... but there's nothing to really hate about it, either. It's just not very exciting.

What kind of vegetable are you?
Purple orach.

Proposition 16 -- ebola in sheep's clothing

This time it's PG&E, saying you should vote yes on 16. They call it the "Taxpayers Right to Vote Act" but the attorney general says "Imposes new two-thirds voter approval requirement for local public electricity providers." Why should you vote yes on this? Here are some reasons I can think of:
  • You're hate cheap public power and would rather pay more to PG&E;
  • You own bazillions of shares of PG&E;
  • You think responsible corporations like Duke Energy and environmentally sensitive PG&E, not irresponsible, polluting municipal governments, should provide utilities.
  • You hate government so much that you'd rather pay more to those corporations.
I guess it's time again to post a pointer to

What is it with these guys? Why can't they be content to make an honest buck? Why do they have to come up with these deceitful tactics? I mean really?

Sunday, April 18, 2010

This loop is a piece of cake if you take John's class...

It was a beautiful day today, sunny and warm (77°F/25°C), and I felt the need to get out there and not waste it, even though we did this 7-mile hike yesterday (with 1400' elevation change, too).

So I got out my trusty old Centurion LeMans, and set out on a 15-mile loop I've done a few times with the ex-teenager. It took me a full 80 minutes, but nothing hurt afterwards.

Now I have to say that this is unusual for me at this time of year. For nothing to hurt I mean (and I didn't even take any ibuprofen before starting out). What's happening, you ask? It's not glucosamine/chondroitin or any other fancy drugs; it's John's cycling (or "spinning") class at the Y-M-C-A, the Sequoia YMCA to be specific. Schedules can be found here. You want the Group Exercise Schedule for the current version, but we meet Mondays at 6:00am. Yes, there are two 6:00s in a day; this is the one before most people go to work.

John will give you quite a workout. He leads us through warm-ups, then we get going. When you come for the first time, please come early so he can adjust the bike for you. Speaking of the first time, if you haven't done this before, you might want to take some ibuprofen before coming to class. I took two tablets before the first class, and my right knee started hurting about half-way through. I took two more after I got to the office, and apparently there was no permanent damage.

For the second class, same drill with the medications but that time there was no pain until we were almost at the end. Ever since then, my knee hasn't bothered me at all in class -- which is probably why it didn't complain to me today. And if you're out of shape and feel you can't keep up with the rest of the class, don't worry; I didn't stand up for the first few months (yes, he does tell us to "come out of the saddle" during class) because I wasn't ready for it, and nobody scolded me or looked at me sideways. It's a great group.

Back to today's bike ride -- I took the route shown at the above link, and shot the photo at right with my phone just after the 280/Sand Hill interchange.

It was a beautiful day and I'm so thankful to be able to get out on the old bicycle and enjoy it like that. Praise God from whom all blessings flow!

Saturday, April 17, 2010

The Answer Man, only he wasn't

We heard by email about the Windrider Film Forum Bay Area, and went with another couple to see The Answer Man (2009, formerly "Arlen Faber"), a delightful film, though its score on rotten tomatoes wouldn't lead you to think so.

Jeff Daniels, who doesn't look at all like Anna Paquin's dad from Fly Away Home (1996), turns in a convincing performance as the complex and confused title character. But the story is really about fathers and sons -- something that the reviews don't exactly put front and center.

What made the film for me, I think, was the Q&A we had afterward with the director/screenwriter. Mr. Hindman gave us a lot of interesting detail about the film, his creative process, the casting, etc., and caused me to think of the film as the result of a socio-political-economic effort with a lot of logistical issues. I hope the DVD has some "making of" features on it.

The theme of "heroes" not being all they're cracked up to be was echoed in Educating Rita (1983), which we saw this past week. It's a good reminder that everyone we look up to, however genuinely respectable, also has nontrivial weaknesses and issues. Whether someone is a professor at a big university, an author of some brilliant book, big-time executive, pastor or whatever, all have feet of clay and need our compassion, not just our respect.

And in the case of pastors especially, our prayers for protection as well.

Geek meets girl, and maybe God too, later

A couple of years ago, I saw two twentysomethings talking on the train platform, and started writing the story below. Some notes from that time:
He: Asian, black slacks, shoes, socks, coat; brick-red (a little duller actually) scarf, glasses (20/200?), hair thinning but not that old. Highlights ?? in the hair. Gel/mousse?? Black leather shoulder bag. Heels on the semi-dress shoes somewhat worn but not excessively so.

She: med-blonde collar-length, glasses (20/40? not as thick as his), blue eyes, black coat, brown top, grey/khaki velour or cordless corduroy slacks, tennis shoes
I picked it up and moved the plot ahead a little, which raised some questions for me; I've added those at the bottom.

"Hi. Ray, is it? I haven't seen you waiting for this train before."

I looked up from my paperback copy of The Magic Mountain to see... What was her name? I tried to return her smile; not sure whether I succeeded. "Hey," I offered. "Usually I come in later, but I have an 8:00 con-call."

I glanced down the track; no sign of a train. Not that I really wanted one. I looked back at her.

"What are you reading?" she asked after a short pause.

Doreen! -- that was her name, from the 2nd floor. Met her at last Friday's beer bash. From some big-name school; Caltech or MIT? Works on... filesystem maybe? Networking? But she just asked me something....

"Mann," I said. "Trying to become literate, you know." I did not say, "Chicks dig that." They were supposed to dig this all-black outfit, too. Maybe it was finally paying off?

Her laugh was musical. "You should meet my sister -- she says the same thing, even though she was an English major." Doreen was wearing black. Mostly. Well, dark anyway, except for her white socks and once-almost-white tennis shoes.

What should I say next?? "Does she live around here?" Idiot! Why did I ask that??

"Yes, we share an apartment a couple of blocks away," she said. Doreen pointed off-axis from the train track, and I saw the headlight approaching. The singing of the steel wheels was just becoming audible.

The doors slid open, and she boarded first, sliding to the window in a backward-facing row and patting the seat beside her. Obediently, I sat. "So you share an apartment with your sister?"

"Actually I guess it's a condo. She bought a place and had room...."

The doors slid shut, and the train pulled out.

I turned to face Doreen. I'd never been this close to her before, never noticed her chestnut-colored eyes. I commanded myself to breathe. "How's it working out?"

She gave me a big smile. "Really well, actually. We were best friends growing up -- we're from around here. Both of us went to school on the east coast. Our parents hoped we'd move back, and sure enough we did, though she got here first."

MIT then, not Caltech. "So she's older?"

"No, a few years younger. But I did the PhD thing and she got a job teaching right out of college."

"A new teacher bought a condo right out of college? Here?" Several heads turned. Oops!

Doreen suppressed a little grin, and replied almost in a whisper -- "Our parents helped with the down payment. But what's your story?"

"The usual," I replied. "San Jose State, then Berkeley for grad school. Didn't make it past the quals, got my MS and started working. I rent a house with some guys a few blocks over toward 101."

Doreen was looking out at something. When she looked back, I asked her, "So what do you guys do on weekends?"

She giggled. I loved that laugh! "It's not the usual around here, but we volunteer at our church -- we do a skit for the elementary school kids every week."

"You're right," I said. "That's not the usual around here."

"Kinda weird, huh?" she said.

"No no no no no. It's really cool, actually. Umm, what kinds of skits do you guys do?"

"Well, stuff from, you know, the Bible," she started, rather tentatively I thought.

"You mean, like Jael driving a tent peg into Sisera's temple?" Well, that was a bold gambit, but maybe really stupid too. Could she tell I was kidding?

"Uh, I don't think the parents would go for that one," she replied. She cocked her head to one side. "That's a pretty obscure passage. One of your favorites maybe?"

Was she smirking? "Nah," I said. "I used to think the Bible was down on women, and this girl in my dorm told me about that one. Apparently this Debbie person was ruling Israel, which really surprised me."

"Yeah, there are a lot of misconceptions about the Bible -- that women don't count for anything in it, or that the stories are for kids. Even the stories we do tell kids aren't really children's stories: Noah's ark is about the destruction of pretty much the entire human race. Jonah went to tell the city of Nineveh that a nuclear bomb was going to land on them, then he got mad because it didn't happen. Not your best role model."

She was pretty animated. I wanted to say something intelligent, but I'd just given her everything I knew about the Bible; I knew even less about kids. C'mon, Ray, use those neurons! She mentioned... parents! "So what do the parents say?" I asked.

"That's another thing. Most of them are busy with their careers, or taking the kids to sports or pushing them to get straight-As. Not to say they're indifferent about their kids' spiritual education, but it's not as high a priority as it might be." She paused. "Easy for me to say, though; I've don't have kids."

"That's good to know. Uh, I mean..." My face felt hot but she giggled again, and I caught a whiff of her shampoo or whatever. I tried to get a grip on myself. "I bet you get that kind of thing all the time."

Another giggle. Was the train still on the tracks? "Not so much," she said. Is she surrounded by grandfathers or idiots? Or nerds?? I must have looked incredulous, because she added, "No, really. I guess guys see me hanging out with the kids, and...." She looked out the window.

Great -- now I had the initiative. I gave her about five seconds and tried: "Consider me your resource." She turned back to me, and I gave her my "Hollywood smile." "Listen, Doreen, I know how guys think." She raised an eyebrow, and I thought maybe I'd get another laugh. But she seemed intrigued. So I plowed ahead. "How about dinner tonight?"

That got a laugh. "That was fast!" she said.

"Always happy to provide a little comic relief," I said. She continued laughing. Sheesh, it wasn't that funny. "Can't blame me for trying, can you?"

She was leaning forward, managing with some effort not to laugh out loud. She braced herself against the seat in front of us with one hand; the fingertips of the other were just touching the buttons on her jacket. She recovered and turned to me. "Tonight I'm doing Alpha," she said. Her eyes were still smiling.

"Alpha? What's that, like a double-date -- protons and neutrons?" That got her laughing again, and it was contagious. When I looked up I saw that our stop was next. I reached across her to signal the driver, and she evidently had the same idea at the same time. I drew my hand back, just as she did. Then we both pushed the signal strip. More laughter. To heck with work -- I could ride the train all day with this woman!

"Alpha," she was saying. "It's a group dinner..." We stood up as the train came to a halt. It's always a challenge to keep my feet under me when the train decelerates, but I postponed getting up as long as I could. We lurched toward the doorway, and I was both relieved and disappointed that she didn't stumble into me. The doors opened and we stepped onto the platform.

"A group dinner?" I prompted. We walked toward the office.

"Someone makes dinner, or orders pizza or something, but we all chip in. Then we watch a video -- it's a lecture where this English guy goes over some spiritual issues. Last week it was about the possibility of miracles, and this week... I'm not sure. Maybe something like the reliability of the Scriptures...?"

The reliability of the Scriptures. I'd thought about that before, maybe back in college or something, but never put much effort into considering it. It seemed like an impossibility: the manuscripts were thousands of years old, translated however many times, and didn't that DaVinci Code movie say something about...

"Earth to Ray," I heard.

Oops! "Oh, yeah, I was just thinking that I'd heard of that in college but never spent much time thinking about it."

"Heard of Alpha?" She looked puzzled.

"No. Um, the girl I mentioned? She always referred to the Bible whenever she talked about her purpose, how she made big decisions, that sort of thing. She based her life on that book, which always seemed to me to be like a leap of faith, you know?"

Doreen nodded. "It's huge. If you're going to base your life on a book, you want to know it's reliable." She paused. "Want to come tonight? A friend is giving me a lift after work."

It was still a few minutes before 8:00. She would call me about 5:00 when she got an ETA from her ride, and also tell the host to expect another person. I thought of something else. "Am I dressed OK?" I asked.

She indicated her cords and tennis shoes and laughed again, then turned to climb the stairs to her office. "I'll be counting the minutes," I didn't say.

Okay, so I wasn't being 100% silly; here are some of my questions:
  1. Let's suppose Doreen isn't aware of what's happening to Ray's pulse. If she found out what was going on, would she feel awkward about it? Should she?
  2. If Doreen is aware of what Ray's going through, is she being manipulative?
  3. How sincere would you say Ray is -- in his curiosity about the reliability of the Scriptures? -- in his offer to help Doreen understand guys?
  4. If Ray seems sincerely engaged after Alpha, should Doreen accept a future dinner invitation from him?

Thursday, April 15, 2010

Is this a software bug defect?

Suppose you find a piece of C code like this in something you're supposed to maintain:
11    char dst[MAXDLEN];
..    ...etc...
42    /* String in "buf" mustn't exceed size of "dst"; if it does, ignore it. */
43    if (strlen(buf) < MAXDLEN) { 
44        char *p = strchr(buf, '_');        /* strip any suffix matching '_.*' */
45        if (p != NULL) {
46            strncpy(dst, buf, p-buf);      /* copy up to suffix */
47            dst[p-buf] = '\0';             /* because strncpy may not NUL-terminate */
48        } else {
49            strcpy(dst, buf);              /* copy the whole of "buf" */
50        }
51    } else {
52        dst[0] = '\0';                     /* "buf" has nothing legal. */
53    } 
..    ...etc...
Here's my question: Is the call to strncpy in line 46 a bug or defect? Or is it OK? A few possibilities:
  1. What do you mean, bug? There's no incorrect behavior here! We copy however many bytes come before the underscore character, then line 47 adds the terminating NUL. The code is just fine.
  2. Well, it's not a software defect in terms of behavior, but the code is pretty ugly. The point of line 46 is to copy a known number of bytes, so it should be coded memcpy(dst, buf, p-buf); but I wouldn't go so far as to say it's a bug, really.
  3. There may not be a defect in the computer's behavior, but there's certainly a defect in the programmer's writing. This code is a violation of Strunk & White's rule #13: Omit needless words. What the programmer wants to say is:
    Copy p-buf bytes from buf to dst.
    which may be coded as memcpy(dst, buf, p-buf); but instead they have coded strncpy(dst, buf, p-buf); which being interpreted means:
    Copy up to p-buf bytes from buf to dst, but if a NUL byte is found, stop copying from buf and instead write additional NUL bytes to dst until a total of p-buf bytes are written to dst.
    I've color-coded the needless words with this pretty background color to show that over thirty (30) needless words have been dumped onto the otherwise concise sentence "Copy p-buf bytes from buf to dst." -- more than 4 needless words for every 1 in the original sentence! This indicates that something's surely wrong in how the programmer writes code..
It's probably not too hard to tell where my sympathies lie, but if you take position #1 above, let me ask you whether this is likewise perfectly fine:
    for (i=0; i<5; ) {
             ... code that doesn't read or write i ...
            if (some_condition) {
             ... more code that doesn't read or write i ...
The "for (i=0; i<5; ) {" should rather be coded as "for (;;) {" or maybe "while (1) {", but coding it as it is -- well, that's just wrong. What was the programmer thinking?

If you think that this "for (i=0; i<5; ) {" is a perfectly OK piece of code, I would love to hear why you think so, because a loop like this baffles me, as does strncpy where memcpy would do.

Tuesday, April 13, 2010

So you want to be a VP... Part I

A young friend mentioned the other day that there's a pretty clear path to getting an engineering job: you get an engineering degree, you go to the career center and job fairs, you send out your resume, you go for interviews, and in a normal economy you can probably find work. But suppose you're working as an engineer and you want to become vice-president or head honcho of a company: what do you do?

By the way, I'm probably not the best person to ask about this, because I couldn't stand being even a first-level manager when I tried it in the early 1980s; if can't design, build, or debug something, then I won't last very long in a job. One of the few times I took an active role in my career was asking to be anti-promoted from management to individual contributor; being a vice-president or CxO sounds like about as much fun as a root canal without anaesthetic.

That said, I do have some thoughts on the subject, mostly about being a valued employee whatever your role is. And as much as I bad-mouth my management experience, I have to admit that it made me a better engineer, because it provided insights into what managers do and the kinds of challenges they face.

So let's start there: your manager. Unless you have an exceptionally bad one, then your success will be tied to hers (assuming for this post that your boss is female). It's hard to look good if she doesn't, and if your mission at work is to help her succeed, she'll do what she can to help you accomplish that mission. So try to understand your boss's world: what does she worry about? What is her vision for your department? What kind of skills do you need to develop in order to help make that vision into reality? And so on.

Along these lines, I happened onto this article on, which described "Next-Generation Leaders"; it's definitely worth a read, and includes this summary table:

Next-Generation Leaders Trophy Kids
Create meaningful work for themselves Expect meaningful work to be given to them
Ask, "Is there anything else I can do?" Say, "That's not really my job."
Constantly strive to do their best work Constantly claim "I'm trying my best"
Try to solve problems on their own before asking for help Ask for help at the first sign of an obstacle
Use self-deprecating humor to give everyone a laugh Make sarcastic comments in attempts to be funny
Think about what other people want Frame things in terms of "what I want..."
Have enough self-confidence to learn from other people Talk down to other people
Eye long-term rewards for themselves Expect a constant flow of immediate rewards
Pride themselves on results Pride themselves on trying hard
Earn their success Blame others for failures
Try to create real value Try to earn praise
Adapt their language and appearance to fit the situation Believe that their appearance defines them
Seek out feedback on their performance Get defensive when critiqued
The left-hand column isn't just for future VPs, by the way, and the right-hand column is a good list of warning signs. You might want to look at that from time to time, and see which column honestly is a better description of what you're doing.

I mentioned good managers. If you find a good one, do what you can to stick with her. If you have a bad one, you may take measured steps toward a better one, but burn no bridges! You want to be VP, you'll have to work in an organization, which means you don't control who you work for. It's hard to succeed if your boss goes down in flames. And who knows -- your boss may learn something from you and become a better one! So don't undermine your boss; if you disagree, tell her so, respectfully, but when marching orders are given, you have to obey them until you find another boss. There are plenty of reasonable ones.

I really believe that last sentence, by the way. This may be old-fashioned, but I like to practice the principle of "abundance thinking." Abundance thinkers believe that there's no shortage of blessings, no shortage of success, no shortage of credit to go around. There's no shortage of reasonable managers or reasonable colleagues; there are lots of people around who are or could be excellent. The folks who run Disneyland are abundance thinkers; if you want to start up a theme park somewhere, they will show you how they did things, tell you what worked and didn't, and so on. Why would they do that, if you might be a competitor? Because they believe there are plenty of guests interested in theme parks, and if you try to duplicate what they have today, no worries; by the time you do that, they'll have innovated in other ways.

In contrast, "scarcity thinkers" behave as though life were a zero-sum game: the more credit you get, the less there is for me. Thi is not 100% false, but it's mostly false. The part that's true is that there's only one #1 slot in any rank-ordering of employees, but the part that's false is this: when you help other people, when you catch them doing great work and tell their boss about it, well, I'm saying this is a great habit to get into and absolutely will not hurt your career.

So I routinely tell our young employees to do that: if someone helps you out, send their manager a short email, especially near the time for annual reviews. This is good for everybody: you'll develop a reputation for generosity, your colleague's boss will have a nice piece of written evidence for ranking/evaluating your colleague, and of course your colleague will reap a bump in their manager's esteem.

Another thing I advise our young employees to do is to take notes at meetings. This will help forestall the otherwise-common confusion that follows when nobody records decisions. "What did we decide last time?" and "I thought you were going to do that?" and "When was that supposed to be done anyway?" -- all these can be answered by referring to the notes you took and circulated; if you email them out the same day, with a request for corrections/clarifications, you can help prevent wasting time at the next meeting, and everybody will love you. In Up the Organization, Townsend suggests keeping notes to one page and touts that as a means to becoming a Vice-President.

Which brings me to books: Townsend's book, though not technologically up to date, is still a great read, and an easy one. You should also read Drucker's The Effective Executive. It's worth having your own copy and re-reading it from time to time. And you don't have to be a Director or VP or even a manager to profit from reading it. Know thy time, focus on contribution, etc. -- those are important principles for any "knowledge worker" to follow.

Dave Packard's 11 simple rules is another great list;you can find them here and lots of other places. Here's the summary:

  1. Think first of the other fellow.
  2. Build up the other person's sense of importance.
  3. Respect the other man's personality rights.
  4. Give sincere appreciation.
  5. Eliminate the negative.
  6. Avoid openly trying to reform people.
  7. Try to understand the other person.
  8. Check first impressions.
  9. Take care with the little details.
  10. Develop genuine interest in people.
  11. Keep it up. That's all — just keep it up!
Again, you don't have to be a VP or even a first-level manager to gain something by following these.

Finally, make sure that being a VP is something you really want to do -- that is, you want to do the work, not just to have the title. What do these guys do every day? What do they like about their jobs? What are the challenges and stresses they face? And what is their home life like? Try to get some time with a current VP and ask them.

And why isn't a VP's life for me? Because VPs don't get to do what I do. They don't write code, they don't talk much to new employees, they don't solve interesting technical problems. It just doesn't seem very interesting to me.

Sunday, April 11, 2010

The Paradox of Community

The other day, one of our pastors spoke with nostalgia of his time as a seminary student, when he and his family lived in a Pasadena apartment ¼ the size of their former home in the Colorado suburbs. Apartment living had its stresses, but his accounts of the intense bonding experiences gave me pause.

I've never chosen to live in high-density housing when I could have my own place. True, I had roommates in college and in my single days, but what I've always wanted was a few people nearby, not the 100+ that our pastor described. Yet without "enough" of a community, there's little chance of running into someone who can speak into your life, who can help you grow in ways you need. The Proverbs teach us that "a wise man's rebuke to a listening ear" is precious, but finding the right wise person to rebuke me when I need it, and in a way I can accept it -- now there's the challenge.

So why do we Americans tend to want mansions, with big yards separating us from our nearest neighbor? It wasn't uncommon just a few decades ago to pop by a neighbor's house to borrow a cup of sugar or something, but if we can afford it (I suspect most of you reading this can) we tend to prefer to keep our pantries stocked well enough not to have to "bother" the neighbor -- even though some great conversations may have happened when popping over for that cup of sugar.

With increasing wealth -- not just individually, but as a society -- comes a decrease in the sense of community. We can afford our own cars, lawnmowers, sugar, sander, etc., so we don't talk to neighbors to borrow them or arrange carpools or whatever. For those who can afford their own houses (and many of us would if we could), we move into them, rather than living in high-density housing -- though that removes us from an important sense of community and belonging.

This led me to the observation that when people get purchasing power, they want to, as Krugman famously observed in 1996, "live in nice houses, drive cars, and eat meat" -- even though the houses will isolate them and the meat will clog their arteries. For some reason, we, as much as third-world families, tend to want what isn't good for us.

Is it just that we're victims of the fall? Also in that brilliant talk last Friday, our pastor observed that Genesis 3 describes shame's entrance into our world -- the desire to hide. In other words, do we isolate ourselves, hide ourselves from each other, because we're depraved, as John 3:20 says, "Everyone who does evil hates the light, and will not come into the light for fear that his deeds will be exposed"?

I don't think that's all there is to it, though sin is certainly part of it. There's also a reasonable desire for some privacy, some autonomy. In this weekend's Prairie Home Companion, Garrison Keillor described Judy Inqvist's sense of freedom after moving to Minneapolis. This fictional pastor's wife had spent decades in a small town, but now in the big city she could walk down the street without having everyone looking at her to see whether she was wearing what a pastor's wife should wear, without people looking at her and her husband to see if they were holding hands, if everything was all right between them, and so on.

One gets the sense that in a small town, there just might be too much of that community experience -- too much of a good thing, in other words.

I seem to remember reading some years ago of the tension between the opposing needs for connectedness and autonomy that we all have. At the time, I don't think I really understood the tension between those two desires, but I think I do now. So what's the answer? How do we get enough, but not too much, community?

If you find out, I hope you'll let me know.

Monday, April 05, 2010

I did this in "Compose" and the tab key

i normally dislike wysiwyg editors but this one seems to be okay for nested bulleted lists.
  • item one
    • one-A
    • one-B
  • two
    • two-A
    • two-B
  • three
    • three-A
      • three-A(1)
      • three-A(2)
        • 3A(2)(a)
        • 3A(2)(b)
    • three-B
  • four
that's all folks

A patent apology (sic)

There are plenty of reasons to dislike software patents: they stifle creativity rather than enhance it, they're used by rich companies to reduce competition (think Mi¢ro$oft and FAT, Apple and the WIMP GUIs), and so on.

Given this situation, can an employee in today's tech industry ethically participate in his company's patent incentive program? On one hand, it feels like a bribe: "Are you sure you don't believe in software patents? Here's $500 just to tell us about an idea that might be patentable, with thou$and$ more if we file a patent and a few more thou$and$ if the patent office issues one."

That is one point of view, and it's certainly respectable and consistent. I don't happen to hold it, and I'll admit right here that I'm biased, having received incentive payments (or "bribes" for you purists). But here's how I see it.

As I understand it, the main reason my current employer applies for software patents is a defensive one. In this regard, it resembles the attitude of US and Soviet defense strategists during the Cold War days: neither side wanted to be the first to use nuclear weapons, but neither did either want to be the victim of a "first strike." Though a patent "war" obviously wouldn't have the devastating human consequences of a nuclear exchange, unpleasant (potentially disastrous) financial consequences would certainly hit one if not both sides.

How does this work? Suppose someone at a fictional company Moon MegaSystems (hereafter "Moon") casts about for a way to make some money and considers suing another company Relational Equipment ("RelEq") for patent infringement. Moon owns hundreds, maybe thousands of software patents, which under challenge may prove to be invalid. But it takes time and money to challenge Moon's patents, so a potential victim of a Moon patent lawsuit may decide to settle -- to just pay Moon off -- rather than spend millions in court costs. But if RelEq itself has hundreds or thousands of software patents, Moon will think three times before suing RelEq becuase of the real possibility of a counter-suit.

Suppose a RelEq employee is concerned (as he should be) about his employer's financial well-being, but doesn't believe in software patents. What good does he do by declining to participate in his employer's software patent incentive program? What if every RelEq employee behaved this way, and RelEq's (defensive) patent portfolio became smaller, relative to Moon's? This does nothing to overturn the software patent system, and only makes RelEq a more attractive lawsuit target for Moon.

If we could vote on the policies of the US Patent Office (I guess it's the "PTO" actually) then I'd vote to overturn all software patents and refuse to grant any new ones. But given the current reality, I'll continue participating in my employer's patent incentive program. It's actually part of my job.

Saturday, April 03, 2010

Thoughts on escapism

Sitting at Disney's California Adventure resort, I was struck with a sense of the absurd; I mean it was surreal: here was a place dedicated to illusion and escape.

I had driven to the southland with the younger teen so she could visit a friend from Hong Kong, satisfy her practice driving requirements for her driver license, and have some bonding time with Papa. We stayed with my cousin and her lovely family -- her engineer→manager→entrepeneur husband, her teenage daughter destined to break many hearts (dozens are likely suffering in silence already), and her boys full of energy and curiosity. Like our uncles, she brings a lot of laughter to the home herself, but she makes it clear that children must obey.

My cousin suggested spending a few hours at California Adventure, which we enjoyed immensely, but it was after "Soarin’ over California" that the sense of the absurd hit me. "Soarin’" is a fabulous illusion; you don't have to try much at all to believe you're flying over golf courses and orange groves and mountains.

And I really admire the design and execution of these theme parks. Just the parking structure is a thing of beauty! You drive in and attendants direct you to the right floor, then to the right row. You park and there is no traffic! Why? Because everybody else is parking behind you! You unload your car and take the escalator down. From level 5 for example, you take one (not four) escalators to ground level. This is brilliant! Since people only ever go between their cars (at level "N") and the tram (at ground level), why make someone at level 5 take escalators to levels 4, 3, 2?

Later, I mentioned my sense of the absurd "What felt wrong about it?" she asked me. At first, I wondered if it was just that so much energy went into escaping reality. She said, "But if I'm reading a book at home, couldn't I be escaping just as much?

Well, that was a good point. Is it just that I'm a fan of reading, or is there something more to it?

last edited 27 July 2008