Friday, November 4, 2011

My favorite C# micro-optimizations #2: 1D Arrays

This is my second post on my favorite C# micr0-optimizations. Everything I said in the first post applies to this one as well, namely, don’t optimize until you know that you need to; and spend most of your optimization budget optimizing the algorithms, rather than figuring out which way to access an array is faster.

That said, this was a surprise to me: jagged arrays (e.g., arrays of arrays) are much faster than rectangular arrays: but indexed access into a 1D array is faster yet.

In other words, this is relatively slow:

   1:  for (int x = 0; x < size1; x++)
   2:  {
   3:      for (int y = 0; y < size2; y++)
   4:      {
   5:          result = twoDArray[x, y];
   6:      }
   7:  }

This is significantly faster:

   1:  for (int x = 0; x < size1; x++)
   2:  {
   3:      for (int y = 0; y < size2; y++)
   4:      {
   5:          result = jaggedArray[x][y];
   6:      }
   7:  }

But this is the fastest:

   1:  for (int x = 0; x < size1; x++)
   2:  {
   3:      for (int y = 0; y < size2; y++)
   4:      {
   5:          result = oneDArray[x * size2 + y];
   6:      }
   7:  }

Benchmark results on my machine (1000 iterations through a 1000x1000 array):

2DArrayTest action completed: iteration = 5, completionTime = 3111, averageCompletionTime = 3101.400
JaggedArrayTest action completed: iteration = 5, completionTime = 2283, averageCompletionTime = 2256.000
1DArrayTest action completed: iteration = 5, completionTime = 1698, averageCompletionTime = 1638.800

It’s also very much worth noting that the order in which the iteration happens is important. Sequential memory access is faster than purely random memory access, most likely because data is fetched from main memory to the CPU’s cache in chunks, so that subsequent sequential reads are from cache.

In other words, if instead of this at the center of each loop:

result = jaggedArray[x][y];
result = twoDArray[x, y];
result = oneDArray[x * size2 + y];

We switch the order of the indexes, so that memory is accessed out-of-order (this is called “diagonal access”):

result = jaggedArray[y][x];
result = twoDArray[y, x];
result = oneDArray[y * size1 + x];
Then the tests take more than twice as long:

JaggedArrayTest action completed: iteration = 5, completionTime = 7499, averageCompletionTime = 7676.400
2DArrayTest action completed: iteration = 5, completionTime = 6790, averageCompletionTime = 6818.600
1DArrayTest action completed: iteration = 5, completionTime = 5862, averageCompletionTime = 5883.200

It’s interesting that in a diagonal access pattern, rectangular arrays are indeed faster than jagged arrays: but one-dimensional arrays are still the fastest.

Thursday, November 3, 2011

My favorite C# micro-optimization #1: Buffer.BlockCopy()

So a caveat first-off. Micro-optimizations are evil. You almost never need them. You can live the vast majority of your life as a programmer and never use them; and most of the time you use them, you’re going to use them incorrectly. If your program is running slow, you’ll almost never find some tiny little micro-optimization that will fix it.

But there are times when they’re handy, and with all the work I’ve been doing the last couple years on a custom Silverlight media stack, I’ve had a number of opportunities to learn about how to speed up code that gets called thousands of times each second. This series of articles is the result of that experience.

And my first suggestion is to use Buffer.BlockCopy() when you need to move data in and out of arrays. You don’t normally need to do this very heavily, but when you’re dealing with real-time multimedia, you’ll find yourself doing it all the time, so the faster you can do it, the better.

I mention this because a common way to move data from one array to another is through a for loop, like so:

   1:  for (int i = 0; i < sourceArray.Length; i++)
   2:  {
   3:      destinationArray[i] = sourceArray[i];
   4:  }

Unfortunately, that’s very nearly the slowest way to do it. (Array.Clone() is actually slower, but that’s another story.) A much better way to do it is to use Array.Copy(). Indeed, this is normally the preferred method, since you don’t have to worry about the size of the individual elements, which is an easy place to mess up. Moreover, Array.Copy() works for arrays of any type, instead of just intrinsic value types.

   1:  Array.Copy(sourceArray, 0, destinationArray, 0, sourceArray.Length);

But as it turns out, Buffer.BlockCopy() is slightly faster for many operations, since it doesn’t have to perform certain checks at the beginning of the copy:

   1:  Buffer.BlockCopy(sourceArray, 0, destinationArray, 0, sourceArray.Length * sizeof(short));

Benchmark results on my machine (10 million copies of a 64-element short[] array):

Buffer.BlockCopy action completed: iteration = 5, completionTime = 420, averageCompletionTime = 422.000
Array.Copy action completed: iteration = 5, completionTime = 478, averageCompletionTime = 482.600
forLoop action completed: iteration = 5, completionTime = 1092, averageCompletionTime = 1093.000

That said, the difference between Array.Copy() and Buffer.BlockCopy() tends to disappear the larger the amount of data to copy (while a for loop falls further and further behind). If you’re copying 64,000 elements instead of 64 elements, these are the results:

Buffer.BlockCopy action completed: iteration = 5, completionTime = 1251, averageCompletionTime = 1229.000
Array.Copy action completed: iteration = 5, completionTime = 1254, averageCompletionTime = 1218.200
forLoop action completed: iteration = 5, completionTime = 11063, averageCompletionTime = 11082.200

But there’s one significant caveat: if you only need to move a few elements, even the minimal overhead of Buffer.BlockCopy() can be too much. If you need to move less than 32 elements, you’ll probably find that a straightforward for loop (or perhaps an unrolled version of it) is the fastest. Of course, you’ll want to do your own testing to find out where the break-even point is. But here are my results with 1,000,000 copies of a 16-element array:

Buffer.BlockCopy action completed: iteration = 5, completionTime = 367, averageCompletionTime = 363.800
Array.Copy action completed: iteration = 5, completionTime = 418, averageCompletionTime = 420.000
forLoop action completed: iteration = 5, completionTime = 291, averageCompletionTime = 290.000

Tuesday, November 1, 2011

Fast (approximate) Sqrt method in C#

As part of the video codec that Alanta uses, we need to calculate the variation between blocks in one frame and the equivalent blocks in the next frame. I’ve been using an algorithm proposed by Thiadmer Riemersma that looks something like this:

public static double GetColorDistance(byte r1, byte g1, byte b1, byte r2, byte g2, byte b2)
{
    int rmean = (r1 + r2) / 2;
    int r = r1 - r2;
    int g = g1 - g2;
    int b = b1 - b2;
    int weightR = 2 + rmean / 256;
    const int weightG = 4;
    int weightB = 2 + (255 - rmean) / 256;
    return Math.Sqrt(weightR * r * r + weightG * g * g + weightB * b * b);
}

It works pretty well, but that last step depends on a square root calculation, which is relatively slow; and when this is something you need to run on every pixel in a frame, you want it to be as fast as possible. Consequently, I’ve been looking at ways to optimize it.

The important thing to note is that for my purposes, close is good enough: I don’t need IEEE precision. It turns out that there’s a pretty good approximation that’s available in languages like C or C++ which let you do unsafe casts back and forth between ints and floats:

float sqrt_approx(float z)
{
    union
    {
        int tmp;
        float f;
    } u;
    u.f = z;
    u.tmp -= 1 << 23; /* Subtract 2^m. */
    u.tmp >>= 1; /* Divide by 2. */
    u.tmp += 1 << 29; /* Add ((b + 1) / 2) * 2^m. */
    return u.f;
}
The problem with this approach is that C# doesn’t normally let you play this kind of magic.
The key word being “normally”, of course.
Turns out there’s one trick you can use to make C# treat the same memory address as either an int or a float, and that’s to create a struct with a [StructLayout(LayoutKind.Explicit)] attribute. (And surprisingly enough, the trick works in Silverlight as well.) The resulting class looks like this:
public class Approximate
{
    public static float Sqrt(float z)
    {
        if (z == 0) return 0;
        FloatIntUnion u;
        u.tmp = 0;
        u.f = z;
        u.tmp -= 1 << 23; /* Subtract 2^m. */
        u.tmp >>= 1; /* Divide by 2. */
        u.tmp += 1 << 29; /* Add ((b + 1) / 2) * 2^m. */
        return u.f;
    }

    [StructLayout(LayoutKind.Explicit)]
    private struct FloatIntUnion
    {
        [FieldOffset(0)]
        public float f;

        [FieldOffset(0)]
        public int tmp;
    }
}
The results are pretty good: it’s more than twice as fast, and the results tend to be within 2% of the “real” answer:

MathSqrtTest: averageCompletionTime = 2424.000
ApproxSqrtTest: averageCompletionTime = 1058.000
Average variation: 0.0253587081881525

If you want a bit more accuracy at the cost of an additional CPU cycle or two, you can use this one, based on the famous inverse square root method in Quake 3:

public static float Sqrt2(float z)
{
    if (z == 0) return 0;
    FloatIntUnion u;
    u.tmp = 0;
    float xhalf = 0.5f * z;
    u.f = z;
    u.tmp = 0x5f375a86 - (u.tmp >> 1);
    u.f = u.f * (1.5f - xhalf * u.f * u.f);
    return u.f * z;
}
It’s a tad slower than the first (though still nearly 2x as fast as Math.Sqrt()), but much more accurate:

MathSqrtTest: averageCompletionTime = 2428.400
ApproxSqrt2Test: averageCompletionTime = 1361.000
Average variation for method2: 0.000928551700594071

Sunday, September 25, 2011

Dead to Sin, Alive to Christ

Today was our last Sunday at Overlake Park Presbyterian Church. Three weeks ago, we made it public that we’d decided to begin attending a church closer to our house. This was a hard decision to make, and even harder to tell everyone about. Folks at OPPC have welcomed us warmly for the last seven years, and they love our kids. But it was nearly a half hour drive to church, and we decided that for our kids’ sake, we needed to belong to a church that was closer to home. So today we said goodbye. In a rather astonishing show of good will, they asked me to preach; and this is what I came up with.

Introduction

Many stories in the Bible evoke a sense of crisis, of paths diverging forever, of profound, world-changing events turning on the smallest details. God’s selection of Abraham. Moses hidden in the reeds. The sound of a horn at Jericho. The voice of an angel in Mary’s room. One of the most important examples of small details that change the course of history is found in the words that the risen Jesus spoke to Saul of Tarsus, when He met him on the road to Damascus. “Saul, Saul,” Jesus said, “why are you persecuting me?”

We’ve heard those words so many times that we often miss their significance. To put them into perspective, ask yourself the question, “Who was it that Saul had thought he was persecuting?” Because of course, Saul hadn’t been intending to persecute Jesus at all. As far as Saul knew, Jesus was dead and buried, and good riddance. Saul had been harassing Jesus’ followers precisely because Jesus wasn’t around to bother with. But that day, when Saul fell blinded onto the ground, Jesus didn’t say, “Saul, why are you persecuting my followers?” He said instead, “Saul, why are you persecuting me?”

We all know the rest of the story. As a result of his archetypal “Damascus road experience,” Saul became a Christian. He disappeared from sight for some years. And when we hear from him next, he is already an apostle and a missionary, proclaiming loudly and eloquently the story of Jesus’ life and death. But Paul is also doing something else that is quite interesting. He’s not just telling the story of Jesus: he’s telling us what the story means. Because, after all, that story is a little ambiguous, isn’t it? I mean, so there was this Jewish rabbi from Galilee who caused a bit of a stir, and stirred up a bit of trouble, and ran afoul of the establishment, and ended up tortured to death at the hands of a police state. His followers claimed that this rabbi had come back from the dead, but even if that was true, well, so what?

It’s precisely that “so what” which interested Paul. And for Paul, the key to understanding the significance of Jesus’ life, death and resurrection lay in those first words from Jesus’ mouth: “Saul, Saul, why are you persecuting me?” Because those words tell us, as they told Paul, that those who follow Jesus are not just well-meaning disciples of some Jewish rabbi. On the contrary, those followers are Jesus, and when Paul was persecuting them, he was actually persecuting Jesus Himself. And if that is true, something big and entirely unexpected is afoot.

The Cross

In his letters, Paul develops this initial insight in a variety of different ways. One of them is through his familiar image of the Church as the Body of Christ. To the Corinthians Paul wrote, “Now you are the body of Christ, and each one of you is a part of it” (1 Cor. 12:27). And to the Romans, similarly, “For just as each of us has one body with many members, and these members do not all have the same function, so in Christ we, though many, form one body, and each member belongs to all the others” (Rom. 12:4-5).

As the poet Gerard Manley Hopkins put it,

the just man...
Acts in God’s eye what in God’s eye he is—
Chríst—for Christ plays in ten thousand places,
Lovely in limbs, and lovely in eyes not his
To the Father through the features of men’s faces

The other way Paul develops this insight may be a little less familiar to us, though it is perhaps even more important. Paul says that when Jesus suffered and died on the cross, we ourselves, the Church, were right there with him. “Do you not know,” he asks in today’s passage, “that whoever has been baptized into Christ Jesus has been baptized into his death?” (Rom. 6:3). “I am crucified with Christ,” he writes to the Galatians, “and I no longer live, but Christ lives in me” (Gal. 2:20). And in the same way, we were somehow present in Christ at the moment of His resurrection. “We were therefore buried with him through baptism into death in order that, just as Christ was raised from the dead through the glory of the Father, we too may live a new life” (Rom. 6:4).

But what exactly does this mean, to be “crucified with Christ”? And why have Christians always believed that the cross was at the heart of Christianity?

To put this into perspective, if you were a Muslim, the symbol of your religion would be a crescent moon.  If you were a Buddhist, the symbol of your religion would be a lotus flower.  If you were a Jew, the symbol of your religion would be a six pointed star.  These all symbolize things like beauty, grace and life. But as Christians, our emblem suggests nothing like that.  Our emblem is the cross, a crude but effective method of execution invented by the Romans for the gruesome purpose of convincing would-be criminals that whatever they were contemplating, it just wasn't worth it.  The symbol of Christianity is a symbol of ugliness, suffering and death.  Why?  Why do all other religions have as their symbols something reminiscent of light and beauty, yet Christians insist on exactly the opposite?

I certainly don’t have a complete answer. But it’s worth noting that this theme of death and resurrection was not merely a Christian invention. On the contrary, it has been the refrain of the great myths and stories throughout history. The Babylonians told the story of how Gilgamesh sought and failed to find the secret of immortality after the death of his best friend. The Egyptians told the story of how Osiris was brought back to life after his body was cut into 14 pieces and scattered across the earth. The Greeks told of Persephone, and how she was abducted by the king of the underworld, and then returned to the earth again after her mother cut a deal with the gods. Perhaps most remarkably, Nordic legends tell of how Odin, the chief of the gods, sacrificed himself to himself, by piercing his side with a spear and then hanging himself on the holy tree at the center of the world.

Beyond those legends, science tells us much the same story. According to the theory of evolution, life arose through pain and suffering and sacrifice. Think of how many different systems in your body need to work perfectly, just to keep you alive. Then think about how many random genetic mutations were required to arrive at those perfectly functioning systems: and how many thousand times more mutations failed, and left the organisms who inherited them vulnerable to accidents, predators and sickness. You and I have life only because untold billions before us suffered and died. Our bodies work because their bodies didn’t. You might very well say, “By their stripes we are healed.”

In other words, a life that comes through death is at the beating heart of our world. So when we see the same pattern in Christianity, we shouldn’t be surprised. Life followed by death followed by new life is not just an abstract doctrine: it’s as close as we can come to reality itself. As George MacDonald put it, “When Jesus died on the cross, He did that, in the wild weather of his outlying provinces, which he had done at home in glory and gladness.”

Crucified with Christ

So then: Christians have chosen the cross as their emblem, because we believe that it gives expression to the fundamental reality underlying the universe. As Paul said, “We preach Christ crucified: a stumbling block to Jews and foolishness to Gentiles, but to those whom God has called, both Jews and Greeks, Christ the power of God and the wisdom of God” (1 Cor. 1:23-24). But again I ask: what does this mean? So we are somehow united with Christ in his death and resurrection; and Christ’s death and resurrection somehow shows who God is in a way that nothing else could. But what does that mean? What is its significance? Does believing this actually change anything?

This is a profound question, and I don’t think we can do anything more than touch on it today. But it’s worth noting three things.

#1 – This is God’s Life

The first is that Jesus tells us that it’s only by conforming to this pattern that we can partake of the life that He came to bring. In Luke 9:23, Jesus says, “Whoever wants to be my disciple must deny himself and take up his cross daily and follow me. For whoever wants to save his life will lose it, but whoever loses his life for my sake will save it.” I don’t think that Jesus is saying, “Unless you’re willing to sacrifice yourself, you’re not good enough to be a Christian.” Rather, I think he means that sacrificing ourselves is what the Christian walk looks like. We partake of the life that God offers us precisely to the extent that our lives resemble God’s Life; and that Life is a life of love, and therefore of sacrifice. The same is also true of another difficult saying of Jesus: “Whoever wants to become great among you must be your servant, and whoever wants to be first must be the slave of all. For even the Son of Man did not come to be served, but to serve, and to give his life as a random for many” (Mark 10:43-45). The requirement that we serve others is not an arbitrary standard, a line which God drew in the sand but which could have been drawn elsewhere; rather, the requirement of service expresses certain unalterable facts about God’s own nature.

#2 – This is forgiveness

The second thing to note has to do with forgiveness. For both to ask and to receive forgiveness is a kind of death. In the Lord’s Prayer, we pray, “Forgive us our debts, as we forgive our debtors.” Again, it’s not that God won’t forgive us unless we forgive others; it’s that we can’t truly repent, and ask for that forgiveness, until we ourselves have learned to extend it.

I’ve had a pretty good life, and I can only think of one instance where someone has done me a significant and genuine injustice. I was angry about that injustice for years; and if you get me talking too much about it, you’ll find that I still am. It’s very true, of course, that my anger, and my lack of forgiveness, isn’t hurting anyone except me. But it is hurting me, and it’s hurting me precisely because that part of me doesn’t want to die. I want to hold on to my rights, I want to insist on what’s coming to me. And to the extent that I’m not dying to myself, to the extent that I’m continuing to hold on to my natural life, I simply can’t participate in the new life that Jesus offers.

Because I need to be clear: extending forgiveness to someone who has genuinely done you wrong, means death. Imagine trying to forgive a serial killer who had kidnapped, tortured and murdered one of your children. Even the thought of forgiving someone who had done that would gnaw away at your insides. It would feel like you were betraying your murdered child; it would feel like you were condoning the murderer’s actions. In short, it would kill you to forgive him. But it would kill you in the right way. It would put to death just that much more of that part of yourself which refuses to participate in God’s life.

But there is maybe even a better way to look at it. For if it hurts us to forgive someone who has done us an injustice – just imagine how it must feel to God. Can it be any less of a death for God to forgive? God loves the child who has been murdered, the wife whose husband was unfaithful, the partner who was cheated out of his business, far more than we could ever hope to. If it kills us to forgive someone, how much more must it kill God? And if Christianity is right, that is precisely what it did: it killed God. People talk nonchalantly about God forgiving sins as if it was the easiest thing in the world. But our own experience gives the lie to that facile assumption. Forgiving sins isn’t easy: there is no more difficult thing in all of creation. It’s so hard that the undying God Himself had to die in order to do it. And we must die as well, if we want to participate in that forgiveness.

#3 – This is Resurrection

Third, we must remember that Jesus’ death on the cross was not the end of the story. Yes, Jesus died; and it was a true death. His heart ceased to beat. The neurons in his brain ceased to register the agony of his body. His muscles, on fire for the last six hours, finally slumped, and his corpse began its slow, inevitable decomposition in that merciless April sun. But God had something else in store, for He would not abandon Jesus to the realm of the dead, nor allow His Holy One to see corruption. On the morning of the third day, God raised Jesus from the dead; and the life he now lives, he lives to God. One small part of the meaning of the Resurrection is the lesson that God is faithful to those who engage in self-sacrificial love. Indeed, how could He not be? For He cannot deny Himself; and those who sacrifice their own desires for the good of others, are already living in God’s love, whether they know it or not. If we die to our sinful nature, we will be alive to God. As Paul says elsewhere in Romans, “And if the Spirit of him who raised Jesus from the dead is living in you, he who raised Christ from the dead will also give life to your mortal bodies because of his Spirit who lives in you.”

Two Stories

I should point out as well that self-sacrificing love is not merely rewarded in heaven. To the extent that we live in that love in this life, to the extent that we die to ourselves, we experience God’s new life right now.

I have two examples of how this can work: one from my own very recent experience, another from the experience of one of the great saints of the Church.

Olivet University

To give you some background, twenty years ago, I graduated from a small Christian school in the Santa Cruz Redwoods named Bethany University. Bethany was a lovely school in many ways, but it’s been teetering on the edge of financial ruin for years, and finally, this summer, it ran out of money and was forced to close its doors. Many people had loved that school, and were genuinely grieved at its closure. But within a month after Bethany announced that it was closing, another tiny Christian school by the name of Olivet University announced that it was going to purchase the Bethany campus, and continue Bethany’s mission of ministerial training. On the face of it, this was welcome news.

But after that, things kind of got weird. This isn’t the place to go into all the details, but suffice to say that this new school, Olivet, was surprisingly sloppy with the truth as they began the process of moving onto the Bethany campus. To a wide range of alumni who were still grieving their school’s demise, it felt like our school’s heritage was being used fraudulently – and for purposes that we could only guess at.

My involvement in all this started when I wrote a blog entry in which I complained about some of Olivet’s behavior, and pointed out some of the misinformation that they had been spreading. I uploaded the post to my blog, turned off my monitor, and headed downstairs with a book. I presumed that was going to be the end of it: among other things, really, nobody reads my blog. So I was pretty well surprised when I got a phone call that very evening from an Olivet administrator, in which he threatened legal action if I didn’t take my blog post down.

I didn’t take it down, of course, but as you can imagine, that was the wrong approach for him to take, and it got me even more suspicious about what Olivet was up to. So I started doing quite a bit of research on Olivet University, its history, its background, its faculty, everything I could find. And I followed up that initial blog post with several more, detailing some of the relevant information that I’d found. And some of the information I found was indeed quite interesting.

But here’s the point that I’m finally getting to. As I was researching Olivet, and writing up my findings, I found myself, almost without thinking about it, wanting to stretch the truth. Olivet had made me angry; and I absolutely wanted the bad things I found to be worse than they were; and I absolutely wanted the good things I found to not be as good as they were. I wanted to include any incriminating information I turned up, even if I thought it wasn’t likely to be true; and I wanted to leave out anything that tended to exonerate them. I found myself having to go back and rewrite whole paragraphs of my blog posts, because I had been doing exactly what I was accusing Olivet of doing, of being insufficiently careful with the truth. In brief, I wanted to be right, and I was willing to go to rather inappropriate lengths to convince others that Olivet was in the wrong. Worse than anything else, though, was the realization that I tended to do this with more frequency than I was happy to admit. My conflict with Olivet was not the first time that I had been ready to present “facts” with an unwarranted confidence.

I’ll confess, I wasn’t entirely comfortable when God pointed this out to me. But after some squirming, I did what I should really do more frequently: I repented. I didn’t get down on my knees or anything, but as I sat there, my hands on my keyboard, I prayed, “God, help me to love the truth more than being right.”

As I stand here now, I’ll confess, that sounds kind of lame. But I can’t express how freeing that simple prayer was. I have no illusions about being cured of my tendencies to exaggerate, or my desire to prove the other side wrong. But at least in that one particular debate, that one particular prayer entirely changed my perspective. The debate was no longer about me, but about the truth, and that made all the difference. I ended up having to admit that I was wrong about a couple things, but it felt OK to say so. And when my worst suspicions about Olivet eventually proved to be unfounded, I was very grateful that those suspicions hadn’t made it onto my blog. Giving up my insistence on being right was only the tiniest sip from the cup of death: but the freedom which followed in its wake was no minor taste of life.

St. Francis of Assisi

The second story I have to tell comes from the life of St. Francis of Assisi. Apart from Jesus himself, more than any other human being, St. Francis’ life is an example of the extent to which dying to yourself is merely the start of an entirely new life. You may know the story. St. Francis was born to a wealthy family, but in his early twenties he renounced all of his worldly possessions, and began to serve and care for the lepers around his village. St. Francis has a well-deserved reputation for loving nature, and for caring for all of God’s creatures; but it’s worth noting that this love of nature was combined with a very strong asceticism. He renounced any possessions, he walked barefoot through the snow, and regularly engaged in extended fasts. During one such forty-day fast in preparation for Easter, St. Francis prayed that he would know the full pain that Christ suffered, and in answer to this prayer received the stigmata, the five wounds of Christ in his own body. When he died two years later, he requested that they lay him naked on the ground, so that he could return to God the same way he came. Several years ago, a modern medical analysis of St. Francis’ skeleton showed that he was suffering not only from starvation, but also quite likely from leprosy.

And yet, despite these sufferings, those who knew him universally said that the overriding characteristic of St. Francis was not pain, not sadness, not depression; but rather joy.

In his biography of St. Francis, G. K. Chesterton sums up this paradox well:

[St. Francis’ self-denial] was as positive as a passion; it had all the air of being as positive as a pleasure. He devoured fasting as a man devours food. He plunged after poverty as men have dug madly for gold. … He held on this heroic course from the moment when he went forth in his hair-shirt into the winter woods to the moment when he desired even in his death agony to lie bare upon the bare ground, to prove that he had and that he was nothing. And we can say, with almost as deep a certainty, that the stars which passed above that gaunt and wasted corpse stark upon the rocky floor had for once, in all their shining cycles round the world of labouring humanity, looked down upon a happy man.

Conclusion

OPPC has been through a great deal over the last year. We said good-bye to Charlie last August, and then unexpectedly had to say goodbye to him again just last month. We said goodbye to Pastor Vonna just last week. And as you presumably know, Galena and I are saying our own goodbyes: this is our last Sunday here. With all of these changes, I wouldn’t be surprised if some of us sometimes felt a little like St. Francis, lying shivering on the rocky floor.

But if you feel that way, think back again on Jesus’ words to Paul. Any pain that Jesus’ church feels, is experienced by Jesus Himself. All authority in heaven and on earth has been given to our Lord; and we go forth today, not merely in His name, but with His power and authority coursing through our own bodies. We die daily, but our life, our true Life, is hidden with Christ in eternity. OPPC may yet have further deaths to die, whether literal or sacramental, and that is as it should be. In a far less dramatic manner than St. Francis, we are called to partake of our Lord’s sufferings; but we are equally called to partake of our Lord’s glory. For we are His Church, His Body, and we live in the power of His resurrection.

Sunday, September 18, 2011

Excess Excitement at the Smith Household

You know your morning just got interesting when you're downstairs and hear a huge thud from upstairs, followed by your wife screaming. When you get upstairs and she's laying on her back, still screaming, you know it just got very interesting.

The long and the short of it is that when Galena was getting dressed this morning, she went to step up onto our bathtub, so that she could get a full-length look at herself in the counter mirror. As she was stepping up, however, her kneecap dislocated again (#3!), and she crashed backwards down onto the floor (which was the thud that I'd heard). By the time I got up there, she was lying on her back, holding her knee in her hands, alternately screaming, then whimpering and then screaming again. The kids piled into the bathroom behind me, with rather wide eyes. I very briefly tried to relocate her patella, but not having the foggiest idea what I was doing, quickly gave that up, and ran to get  some ice, which was maybe a nice gesture, but almost equally pointless. After contemplating what would be required to get her to the hospital on my own, with three kids in tow, I gave up on that idea too, and just called 911.

In the meantime, Caedmon had run to get a couple pillows for Galena, so that she could rest (slightly) more comfortably. Brendan had progressed from wide-eyed to his signature line, "It's too scary! It's too scary!" Calista, thankfully, was almost entirely oblivious, and occupied herself with rolling toys down the stairs, to make sure the paramedics were appropriately welcomed.

The ambulance arrived a couple minutes later, and they made their way upstairs. The lead paramedic examined her and said, "I've never relocated a patella before, but a doctor showed me how once. You want me to give it a shot?" These weren’t perhaps the most reassuring words, but Galena nodded grimly, and after one false start (which resulted in a great deal more screaming), it slid back into place. And with that, the pain went away almost entirely. The paramedics decided to take her to the hospital anyway, just in case something worse had happened, and bundled her out the door.

That was my signal to call Karn Hanhart, who very graciously dropped everything she was doing, and rushed over. Caedmon was initially very keen on coming to the hospital with me, but then he heard me instructing Karn to let them watch as much TV as they wanted. He figured another opportunity like this wasn't going to come his way anytime soon, and decided to stay home.

At the hospital, they x-rayed her leg, concluded that nothing else was wrong, and sent her home. The whole thing finished up by 11:45 am or thereabouts. At this point, Galena's hurting a little bit, but not badly. She's lying on the couch, resting and basically letting Caedmon wait on her, which he seems pretty happy to do.

She's supposed to go visit an orthopedist later this week. Since this is the third time this has happened, they may recommend surgery, or physical therapy, or maybe nothing: but we'll wait until she's had the consult before making any decisions.

Tuesday, September 13, 2011

A Welcome Update from Olivet

On the Bethany Alumni forums today, someone challenged my constant harping on how Olivet had been framing their connection with Bethany University by saying, in effect, “Well, what do you want them to say?”

That was a very fine question, and after some thought, this is what I came up with:

In 2011, Bethany University had to announce its closure and submitted its teach-out plan. However, Bethany made an appeal for Olivet University to continue the mission of training ministry-bound men and women in Santa Cruz. Olivet University fully affirms the mission and the heritage of Bethany, and feels privileged to continue in the tradition of ministerial-based education that Bethany pioneered. The Bethany that was founded in 1919 has closed its doors, but with the full blessing of the Assemblies of God, the mantle has been passed to a new generation and to a new university. We chose retain the name "Bethany University" precisely to honor that heritage.

After I posted it, and various folks had the opportunity to read and comment on it, I forwarded it to Nate Tran, Olivet’s Dean of Administration, and asked if he’d be willing to post something like that up on the website. I was quite pleased when he responded quickly, and said that they’d be willing to make the appropriate changes. A few minutes later, the website had been updated. This is very good news from my perspective, and I’d like to thank Olivet for working with the alumni on this.  We all wish Olivet the very best as they endeavor to serve our common Lord; and it’s my hope and prayer that their students experience the same divine blessings at 800 Bethany Drive that so many thousands of Bethany students before them did.

Monday, September 12, 2011

Follow-up on Olivet University

Tonight, Bethany University breathed its last. Bethany had already closed its doors earlier this summer, but just a few hours ago, they held the final memorial service in Craig Chapel. Folks from all over the country came to attend, and hundreds more watched via a live stream. There was much laughter, there were many tears, and I don’t think anybody who saw it was unmoved.

Towards the end of the service, the president of Olivet University, William Wagner, spoke memorably for a few minutes. I enjoyed his stories, and I appreciated and strongly affirm the vision he expressed, of reaching the world for Christ through the wide range of new technologies and media that have revolutionized society over the last two decades. Bethany was a lovely school in many ways, but nobody could have claimed (with a straight face) that it was on the cutting edge of technology or media. There’s no doubt that Olivet is much further down this road than Bethany was or could ever have gone. (And of course, it was very generous of Olivet to donate what is now their chapel for this final memorial service. Folks from Bethany who worked with the staff and students from Olivet in the run-up to the service said that they were invariably helpful, gracious and hard-working.)

Dr. Wagner’s was actually the second Olivet voice I’ve heard recently. A few hours after my last post, the Dean of Administration from Olivet, Nate Tran, gave me a call, to discuss my concerns. I appreciated his attempt to reach out to me, and we talked for nearly an hour. On the whole, the call was productive, though somewhere in the middle it reached a remarkable low point, when Mr. Tran said that his “superiors” had instructed him to warn me that if I didn’t remove or rewrite my post, they would be forced to consider legal action. As you can imagine, that didn’t do much to help the tone of the call, and my response was Christ-like only in the sense that it perhaps faintly resembled the Christ who cleansed the temple. I may have done some shouting. (Take note: if you’re ever responsible for reaching out to thoughtful critics of your organization, it’s very bad form to start by threatening to sue them. All it’s gonna do is make folks even more suspicious.)

That interlude aside, however, our conversation was cordial and helpful, and I found Mr. Tran to be a reasonable interlocutor. I didn’t take notes during the call, but in general, I think it would be fair to say that he expressed three primary concerns about my post.

(1) His first concern was that my post described Olivet as “unaccredited”. He contended that this wasn’t accurate, and indeed, depending on what you mean, he’s right. Accreditation is a reasonably complex topic, but I’ll summarize (inadequately) by saying that there are roughly four different levels of “academic accreditation” in the United States: (1) entirely unaccredited; (2) accredited by an organization that isn’t recognized by CHEA or the USDE; (3) accredited by any of a fairly large number of bodies that are recognized by the CHEA and USDE; and (4) accredited by one of a very small number of “regional accreditation organizations”. In my experience, when folks in academia talk about a school being “accredited”, they usually mean #4, i.e., regionally accredited. They often lump schools from categories 1-3 into roughly the same boat, and use the term “unaccredited” to describe them all (which is why I originally used that term). The reason for this blunt approach is fairly simple: regionally accredited schools will generally only recognize coursework or degrees from other regionally accredited schools. If you go to a school in category #3, you can get financial aid from the US government; but your degree or coursework will typically only transfer to other schools if they come from a school in category #4. There may be exceptions; but they will tend to be exceptions.

With that in mind: Bethany was accredited by WASC, a regional accreditation body, and hence fell into category #4; Olivet is accredited by the “Association for Biblical Higher Education”, and falls into category #3. In other words, technically, yes, Olivet is accredited. However, from a practical perspective, what this means is that Olivet provides some, but by no means all the benefits of what is usually meant by an “accredited” school. Hence, before you decide to go there, you need to think carefully about what you plan to do afterwards.

Because Mr. Tran had a good point on this one, I’ve updated my previous post.

(2) Mr. Tran’s second concern was that my post didn’t accurately characterize the nature of the changes to the Bethany website. His understanding, he said, was that these changes had been purely cosmetic (new colors and pictures, that sort of thing), and that the content hadn’t been touched: and that’s why it still presented the “1919” Bethany history. I expressed some doubts about this while we were still on the phone, and a bit of investigation afterwards showed that he was demonstrably wrong on this point. You can verify this yourself if you visit the last version of the Bethany website on the Wayback Machine, and compare it to the current version. Among numerous other differences, the new website lists a whole bunch of degrees  that Bethany never offered, but which are effectively the same degrees that Olivet offers. It describes a Center for Information Technology that never existed at Bethany, but is featured prominently on Olivet’s website. The "e-Library" it describes is quite clearly the Ralph D. Winter Library at Olivet, not the Wilson Library at Bethany. And so forth.  In other words, the institution it was describing was clearly Olivet – except when it came to Bethany’s history and heritage, which it attempted to appropriate as its own.

Since this was an easily verifiable inaccuracy, my assumption is that Mr. Tran was simply misinformed.

(3) Mr. Tran’s third concern was that my post didn’t do justice to the very fluid situation in which Bethany and Olivet now find themselves. As I’ve said previously, I’m effectively an outsider, and have no first-hand knowledge of the state of the purchase; moreover, I don’t want to reveal anything that Mr. Tran may have wished to remain confidential. Suffice to say, that although Olivet is in fact leasing the campus from the Bethany Corporation, and has made a fairly significant down payment, the transaction is by no means complete. Furthermore, because the Bethany campus is facing imminent foreclosure by the banks who hold its debt, Olivet has been forced to move very quickly. Anybody who is familiar with the traditional pace of academic institutions will know that in a traditional university, it would be impossible to perform the requisite due diligence, raise the necessary funds, close the transaction, move the entire school, and then start classes, in anything less than two or three years. Olivet has had something like three months. Given both the speed and the complexity of the situation, Mr. Tran said, Olivet’s communications have been intentionally sparse: they haven’t wanted to provide premature, incorrect or confusing information. And although he didn’t actually say this, I’ll add on his behalf that, given this situation, it would be quite surprising if some significant mistakes didn’t occur in the communication that was provided.

All this is true. One indication of just how true is that since my conversation with Mr. Tran, Olivet has updated the “About” page on the Bethany website. The previous version of the page that Olivet had created (you’ll have to take my word for this) made no reference to the acquisition by Olivet, or to the fact that Bethany had actually closed its doors in the summer of 2011. Without any caveats, it presented the Bethany advertised by the website as being the Bethany which had opened its doors in 1919.  And that was, to put it graciously, entirely inaccurate.

Currently, however, that page reads:

Bethany University was founded in 1919, originally called Glad Tiding Bible Institute, as a training center for an urban San Francisco ministry. The nearly 100-year-old school is deeply rooted in rich Christian tradition and its long history has set Bethany as a highly respected institution in carrying out Christian mission.

Throughout the years, Bethany has gone through several transitions. The school relocated to its new home in Scotts Valley in 1950 and changed its name to Bethany Bible College 5 years later. In 2005, the Bible College expanded into a university and was named Bethany University.

In 2011, Bethany University had to announce its closure and submitted its teach-out plan.

However, Bethany made an appeal for Olivet University to continue the mission of training ministry-bound men and women in Santa Cruz. Olivet University has since transformed Bethany into an online university to provide greater accessibility to educational resources for churches in the global mission field.

Bethany has re-emerged under the management of Olivet University. Both institutions continue to provide world-class theological education together.

There’s no doubt that this is more accurate. But it’s still not very accurate.

To start with a minor point, it’s laughable that either of two tiny denominational schools (of which one has never achieved regional accreditation, and the other was perpetually on the verge of losing it) could provide a “world-class theological education”. I loved Bethany, I loved my professors, and they gave me a fine theological education, but none of them would have claimed that it was world-class. Still, I’ll forgive that as standard marketing-speak (we all expect marketers to lie, don’t we?), though I do wish Christian institutions had more respect for reality.

But it’s worth highlighting the rest of the paragraph in which that claim is found:

Bethany has re-emerged under the management of Olivet University. Both institutions continue to provide world-class theological education together.

These sentences strongly imply that Bethany is still around, that it has merged in some sense with Olivet, and that under new management, basically the same institution is carrying on. But that is highly misleading, to say the least. I honestly don't know what legal ground Olivet is on: from everything I’ve heard, Olivet is merely purchasing some of Bethany’s assets, not the actual entity itself. Still, it’s possible that I’ve been misinformed, and that Olivet is actually buying the actual Bethany corporation. So legally, technically, it’s possible that they may have the right to say that the Bethany which started in 1919 is still around and under new management. But even so: I’ve been asking around, and I’m only aware of one former staff member from Bethany (the groundskeeper) who will be making the transition to Olivet. Bethany’s WASC accreditation no longer exists, and wouldn’t transfer in any event. None of Bethany’s degree programs are being offered. I’m not aware of any former students who are attending. To the best of my knowledge, none of the former faculty will be teaching at Olivet. To take just one example of just how closed Bethany is: if you’re a Bethany alumni and need a transcript, you’ll need to order it from a different AG school, Vanguard University, which is taking over Bethany’s records: because there isn’t anybody left from Bethany who can fulfill those requests. You won’t be ordering that transcript from Olivet, or from whatever this new institution that might be named Bethany is. As I said before, this new school will share with my alma mater nothing more than a name and a campus.

Given that the Bethany I graduated from has shut its doors, fired all its employees, sent its students to other schools, is no longer in operation, and has for all intents and purposes come to a grinding and painful halt, I don’t see how it's possible to say, "Bethany has re-emerged under the management of Olivet University. Both institutions continue to provide world-class theological education together."

In other words, I appreciate the fact that Olivet, after getting caught in a blatant misrepresentation, has attempted to correct that misrepresentation. I remain concerned, however, that even this correction is still badly misleading.

So what does all this mean?

Well, I’m honestly not sure. As I said previously, the hypothesis implied by the Davidian Watcher blog, that Olivet and its associated institutions are just a front for a dangerous cult, simply doesn’t hold water. You don’t get a life-long Southern Baptist missionary to be president of your school unless you’re reasonably orthodox. But that doesn’t mean Olivet might not have other significant cultural and institutional problems. Having precious little first-hand information about Olivet, I need to reiterate that I’m not qualified to offer anything more than questions. But what I’ve learned since my first post has left me with more of those, including:

  1. Why was Olivet so fast to threaten legal action over such an innocuous post? Does it say something significant about their culture, or even about whether they have something to hide? (For what it’s worth, a lawsuit is one of the tactics that the Davidian Watcher blog says they used on him.)
  2. Why was Mr. Tran misinformed about the nature of the changes to the Bethany website? Was it just normal and innocent communication SNAFU’s? Or was someone intentionally trying to mischaracterize those changes (and hadn’t realized it was possible to check them via the Wayback Machine)? Or somewhere in-between?
  3. Why does the “corrected” version of the website still present a highly misleading picture of the relationship of Bethany to Olivet? It was already clear that people were paying attention, and cared about what was being communicated. If I’d been in their shoes, I would have gone out of my way to make sure that this page left no inaccurate impressions. They clearly don’t want folks throwing stones: why give critics another opportunity?
  4. Most speculatively, does all of this imply that Olivet has a culture of disregarding the truth, of treating perception as more important than reality? I’ve worked with folks in the past who possessed a remarkable “reality distortion field” that was very effective in-person, and within the organizations they led – but who were, for precisely that reason, entirely unprepared and unable to deal constructively with critical perspectives from outside the organization. That’s what this reminds me of.

Like I said, no answers, just questions.

I should add one last note.  Last Friday, after my conversation with Mr. Tran, I sent him an email asking for his answers to a variety of questions. I haven’t yet heard back from him, but if I do, and if this is still interesting to anybody besides myself, I’ll try to post and respond to his reply.

[Note from 2011-09-13: Olivet has since updated the language on the Bethany “About” page to a version that I feel is much more accurate. See this post for more details.]