Thursday, March 31, 2011

Tithing? and how to be less of a rich fool

Links: my other postings on Lent ; our church's reading plan
In a recent sermon, our pastor pointed out the internal inconsistency when someone says, "Jesus died on the cross to give me eternal life; I'll take that and all the other gifts God gives, but I won't give to His work -- to feeding the hungry, clothing the naked, freeing the captives, proclaiming the good news to the lost."

"I don't get that," he said. Well, here is an area where through personal experience I can say that I do get it. I mean, it's easy to see how it happens. Does it make sense? No. Is it consistent at all? No. But can it happen? Sure it can happen, and you don't have to be an exceptionally wicked person for it to be true in your life. Just ordinary wicked (and selfish) will do.

Because it's easy to deceive ourselves; heck, we want to deceive ourselves because we simply don't want to think of ourselves as selfish, greedy people, as Colbert pointed out last year.

But enough about me. The parable of the rich fool (Luke 12:13-21) came in today's selection from our church's reading plan. This fellow, the rich fool, is -- well, there's no other way to say it -- he is us. He's got some real cognitive issues, uh, sin going on here, which is how I see myself in him:

  1. The ground of a ... rich man produced a good crop. He thought to himself, “What shall I do?”... (Luke 12:16-17)
    This first line would have been shocking to its first-century audience. If the ground produces a good crop, any normal person would celebrate with his friends and share the bounty with his less fortunate neighbors.

    So how do I resemble this fool? I sometimes forget how important a community is to me. Folly! Solitude is good, but "It is not good" to be alone too much.

  2. “I will tear down my barns and build bigger ones, and there I will store all my grain and my boods.” (Luke 12:18)
    Okay, so I don't have all my money in retirement accounts -- but neither have I given away more than what, 10-20% of my income. I hate to think of myself as stingy, but how many hundreds of millions live (or die) today on less than a dollar a day? An entry-level professional in the United States makes more money than something like 99% of the households on the planet. True, our expenses are higher, so after adjusting... OK, maybe 98% of the households on the planet. I just made that up, but you know it's not far wrong. How much should we give away?
Well, that's not a lot of similarities, but we in the United States are the most individualistic society I've ever heard of -- so much so that we need someone to explain point #1 above to us (at least I did). How did we get that way? One day at a time, over a couple hundred years.

And about not giving -- how do we end up choosing that? Well, we all know that we're "rich" by some definition, but we don't think about that. Instead we think about things we want but don't have, we think about those with more money that we have (there'll always be someone)... and we can turn into this silly caricature of a selfish, spoiled child.

What can we do about it? For money, the answer's easy: give some away. it doesn't have to be a lot, but how much do you think the top 1% income earners (besides you, I mean) should give? If you're giving less than that, give a little more.

For community, here's my plan: when I'm going to some gathering I'm not particularly interested in, I want to ask the Lord to show me what he has for me. Will I learn something from someone? Will someone's character bless and impress me? Can I be a blessing to someone?

And then watch for what he does. Because he's always at work, and if I'm watching he'll show me.

Saturday, March 26, 2011

Freedom to act (at work) -- whether you want to be a VP or not

About 30 years ago, I saw some fabulous presentations by William Oncken on the subject of "Managing Management Time." This was before I knew I didn't want to be a manager. But the videotapes had valuable information for anyone in organizational life. One such concept was that of the "Freedom scale."

You can find this scale online, for example on page 2 of this PDF or page 7 of this one. The scale looks something like this:

  1. Wait until told.
    This means don't ask, don't even think.
  2. Ask what to do.
    Don't suggest, don't recommend. Just ask.
  3. Recommend, and act with permission
    That is, don't act without permission
  4. Act and advise immediately.
    The boss hates surprises
  5. Routine reporting only
Conflict arises when the boss and a subordinate have different ideas of what freedom the subordinate should be working at. This can happen because the boss doesn't communicate well; or maybe the boss is internally conflicted. The issue could be with the subordinate, too: if I'm a subordinate who's lazy or afraid to act, I'll tend to operate at level 1 or 2 whereas the boss may want me to operate at level 3 or 4 (or maybe I'm just accustomed to being told what to do all the time). If I tend to be rash and not to have good judgment, I may want to operate at level 4 or 5, but the boss may want me to act at level 2 or 3 instead.

Some of these things can be made better by communicating directly what level of freedom someone should be working at with regard to certain issues. Maybe it needs to be put in writing. On a sign in the employee's office/cubicle.

But when someone has to operate at a different level than they're accustomed to, that takes some adjustment. Someone accustomed to waiting (level 1) or asking (level 2) may have to make a recommendation (level 3). Or in case of an error in judgment, they may have to switch from "act and advise" (4) to "recommend then act with permission" (3).

And the boss may have some adjustments to deal with too, if for example a subordinate asks what to do and the boss wants recommendations rather than just problem statements. Of course, adjustments take work from everyone. I'm not sure who it's harder on.

But whether you're only a subordinate or you're both a subordinate and a boss, the freedom scale can provide a way to clarify expectations.

Creating a mirror-image truetype font: the wrong way and...

There are two ways to do anything:
  • the wrong way, and
  • your mother’s way.
(redacted)
There are actually a lot more than two ways to code anything. But first here's the story: my elder daughter was talking about writing poetry "as the ox turns" (more here) and wondered how hard it would be to visually flip every other line left-to-right. Just reversing the letters is easy; something like this would do it:
#!/usr/bin/python -utt
# vim:et:sw=4
'''Reverse every other line.  Like a filter.'''
import sys
flipIt = False
for aline in sys.stdin:
    aline = aline.strip()
    if flipIt:
        alist = list(aline)
        alist.reverse()
        print ''.join(alist)
    else:
        print aline
    flipIt = not flipIt
It works like this:
INPUT:
The skies they were ashen and sober;
the leaves they were crisped and sere -
The leaves they were withering and sere;
It was night in the lonesome October
Of my most immemorial year:

OUTPUT:
The skies they were ashen and sober;
- eres dna depsirc erew yeht sevael eht
The leaves they were withering and sere;
rebotcO emosenol eht ni thgin saw tI
Of my most immemorial year:
But what if you wanted to flip the pixels as well? Something like this?
Then you'd need a mirror image font. Right. A web search yielded BackBod, and I think I found a reversed Dabbington font, too. But she wanted something that looked more like Times New Roman.

The Wrong Way to Code This

Naturally I went looking on the web for "truetype file format" and proceeded to pick a font file apart, using information from Apple and Microsoft. I began like this:
def main(filename):
    global font_data, flip_data
    font_data = [ord(X) for X in list(file(filename, 'rb').read())]
    # offset subtable
    scaler_type = u32(0)
    assert(scaler_type == 0x74727565 or scaler_type == 0x10000)
    numTables = u16(4)
    print 'numTables', numTables
    startTabDir = 12
    print 'table list'
    glyfStart = None
    tables = dict()
    toffset2name = dict()
    for tabEntryOffset in range(0,numTables*16,16):
        mystart = startTabDir+tabEntryOffset
        tname = l2s(font_data[mystart:mystart+4])
        tstart, tlen = u32(mystart+8), u32(mystart+0xc)
        print '\t%s offset=%#08x len=%#x' % (tname, tstart, tlen)
        assert(tname not in tables)                     # duplicate => evil
        toffset2name[tstart] = tname                    # to sort by offset
        if tname == 'glyf':                     # flip glyphs left-to-right
Basically, I read the entire file in as a bytestream, then created an array (a "list" in Python-ese) of the bytes. That u32(0) call means "give me the 32-bit integer formed by reading 4 bytes starting at offset 0" (that's way later in the file). This program knows where tables start, and looks for certain tables by name (e.g, "glyf"), and...

So what's wrong with coding like this? The problem is that it's re-inventing the wheel. What I should have done, had I known of it at the time, was consult stackoverflow.com; I would have found questions and answers like this one, which gave me the clue that maybe there was a module out there that already handles truetype (though that question was about PERL) or (aha!) this one which led me to TTX, a fabulous package that turns ".ttf" files into XML and back.

So I was doing a bunch of work (and a lot of it was empirical, based just on what I found in this one file) rather than following the possible versions (etc) that the specs allow. Before I stopped working on the wrong way to code this, I had 476 lines in "flip.py" -- of which 398 were nonblank, noncomment lines. Besides, the fonts it produced weren't quite right.

Not so Wrong

So here's the new plan. Rather than writing all that code to parse the (mostly binary) TTF file, ttx would turn (e.g.) times.ttf⇒times.ttx; I'd modify the XML inside times.ttx, creating, say, semit.ttx ("times" backwards) and ttx would turn that into "semit.ttf".

Besides flipping each glyph left-to-right, I'd also flip the kerning table. Why? Consider the character pair ‘P.’ -- we want the ‘.’ closer to the ‘P’ than it would be without kerning, right? Now imagine if the ‘P’ is flipped left-to-right so it "sticks out to the left" like ‘¶’ -- in this case we want the characters moved closer when the ‘.’ comes before the (flipped) ‘P’. Thus the pair we want to look for is not {‘P’,‘.’} but rather {‘.’,‘P’}.

It's now about 121 lines (nonblank noncomment lines), after trying it out on a few more fonts (one of which didn't have a kerning table). The fonts look good, too. Here's the result of "pydoc -w flipttx":

 
 
flipttx
index
/mnt/home/collin/fonts/flipttx.py

Flip a true type font (ttx) horizontally.
 
Usage: flipttx.py [-d] {-o oldname} {-n newname} [infile [outfile]]
        -d (OPTIONAL): add debugging output
        oldname (REQUIRED) is original font name, e.g., "Times New Roman"
        newname (REQUIRED) is new (flipped) font name
        infile (OPTIONAL) is name of old font's ttx file 
        newfile (OPTIONAL) is name of new font's ttx file
 
OPERATION
Given a truetype font, named "Foo", in a file "fontFile.ttf",
create a flipped font (call it "Oof") in "oof-flip.ttf" as follows:
1. ttx fontFile.ttf
   => will create fontFile.ttx
2. flipttx.py -o Foo -n Oof fontFile.ttx oof-flip.ttx
   => will create oof-flip.ttx
   * and "Foo" in fontFile.ttx's NAME table becomes "Oof" in oof-flip.ttx
3. ttx oof-flip.ttx
   => will create oof-flip.ttf
 
Use spadmin (for OpenOffice.org) or FontBook (on Mac OS X), etc.
to get oof-flip into your system.  In your application (OpenOffice.org,
NeoOffice, Micro$oft Office, etc.) specify font name "Oof"
 
Why are oldname/newname required?  Because you need a way to specify
the flipped font name (e.g., "Oof").
 
GUIDES FOR THE PERPLEXED
    * "ttx" -- see http://www.letterror.com/code/ttx/
    * what's in a truetype font file?
      http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html (2002)
      http://www.microsoft.com/typography/otspec/otff.htm (2008)
 
HOW TO AVOID UGLY ON-SCREEN DISPLAY
    1. On a system like Mac OS X 10.6 you can just do what comes 
       naturally: add fonts using the "Font Book" application. 
       Then NeoOffice, Aqua (maybe even X11) will be able to 
       display the new font just fine.
 
    2. On a system like OpenSUSE 11.3 where OpenOffice.org gets 
       fonts from "spadmin" but you need to "xset fp+" or similar
       for display fonts, be sure to run mkfontdir(1) then add
       the directory to your X server's font path, lest your
       screen look truly ugly.  But at least on my system, "print"
       and "export to PDF" from OpenOffice.org both produced nice
       enough output.
 
BUGS
    1. Doesn't handle a too-short hmtx table, such as might be
       the case with some monospaced font.  (But Courier New
       was OK -- maybe ttx creates a full hmtx table?)
 
    2. Doesn't do anything with composite glyphs.  Maybe they'll 
       "Just Work" -- but probably not.
 
    3. Doesn't do anything with GSUB so ligatures, if your font has
       any, will probably look goofy.
 
VERSION
    $Id: flipttx.py,v 0.5 2011/03/26 20:05:07 collin Exp $

 
Modules
       
getopt
sys
_xmlplus

 
Functions
       
DPRINT(what)
Print onto sys.stderr if DEBUG is on.
flipGlyphs(glyfNode, hmtxDict)
Use hmtxDict to flip glyphs left-to-right (modify in place).
flipKern(kernNode)
reverse the order of the pair, i.e., L<-->R, in each entry.
main()
Parse the input XML, flip glyphs, flip kern table, give a new name
to the new font, write the XML tree to output file.  How did I know
what to do here?  Lots of it came from web info on truetype fonts,
especially http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
makeHmtxDict(hmtxNode)
Return a mapping of name to node in horiz. metrics table
tweakNames(nameNode)
Change all instances of OLDNAME to NEWNAME, in nameNode.
If font's original name="Times New Roman", OLDNAME="Roman", 
NEWNAME="Namor" then new name would be "Times New Namor" -- i.e., 
OLDNAME/NEWNAME can be substrings of the font's name.
usage()
Print help message to stderr and exit.

 
Data
        DEBUG = False
INFILE = <open file '<stdin>', mode 'r'>
NEWNAME = None
OLDNAME = None
OUTFILE = <open file '<stdout>', mode 'w'>
progname = 'flipttx.py'
Leave a comment if you want the source, which is currently 264 lines (wc -l) and about 121 noncomment nonblank lines.

And maybe an even less wrong way...

A search on "poetry oxturn" (no quotes) led me here which in turn led to this program which does the whole thing for you -- flips every other line and creates a postscript or PDF of the result. Apparently you can just try it online without having to download it and run under Tcl/Tk.

But... currently it gives you a typewriter-like font, not so pretty. This may change soon, as I'll send my program to the site's webmaster.

Wednesday, March 23, 2011

So you want to be a VP, part III

link to part II
Just read this terrific post summarizing a talk by Patty Azzarello on How to be Really Successful at Work AND Like Your Life. Two sentences from amazon.com's "About the author":
Patty Azzarello became the youngest general manager at Hewlett-Packard at age 33, ran a $1B software business at 35 and became a CEO at 38 (without turning into a self-centered, miserable, jerk). Whether leading massive business transformations or advising CEO’s 1-to-1, her insights, integrity, and generosity have fused with her work to create life-changing impact on the careers of thousands of people in large and small companies across the world.
All that's impressive, but I really liked her advice to DO BETTER, LOOK BETTER, CONNECT BETTER (details on the above post on compscigail's blog).

Patty has a short video on her home page introducing her (November 2010) book; amazon.com hosts an author page with links to her book, blog posts, etc.

This looks like great advice, particularly if you want to become a VP without ruining your life.

Limits of Divine Power

Links: my other postings on Lent ; our church's reading plan
Today's reading includes Mark 5:21-6:6, which put me in mind of a message I heard over 30 years ago, at my first Christian conference, where LeRoy Eims talked us through this area of Scripture; it shows the power of Jesus over the wind and the waves (Mark 4:35-41), his power over demons from hell (Mark 5:1-20), over sickness (Mark 5:25-34), over death itself (Mark 5:35-43).

What an exciting passage! Now the people in the land of the Gadarenes demonstrate one limitation on the Lord -- well, it was self-imposed, actually; they asked him to leave (they wouldn't listen to him!) and he did.

Here's another limitation on the power of Jesus. Wait, don't pick up stones to throw at me quite yet -- tell me if this doesn't mean Jesus couldn't...:

He could not do any miracles there, except lay his hands on a few sick people and heal them.
Mark 6:5
Right? Verse 6 says he was amazed at their lack of faith.

I think this an astounding truth. If I have no faith, I can actually limit the power of God to do things in my life. I can grieve his Holy Spirit (as Ephesians 4:30 says).

And on the positive side, I can bring him joy and delight when I take him at his word. Imagine that -- you and I can bring joy to the creator of the universe. We can please him by the way we live (Hebrews 11:6; Colossians 1:9-12).

A pastoral word

Does that mean if I pray and nothing seems to happen, it's because I don't have enough faith? No! And I can prove it.
  1. Look at 2 Corinthians 12:7-9; why didn't God grant Paul's request to be freed from his "thorn in the flesh"?
  2. Consider the girl who was raised from the dead in Mark 5:35-43: how much faith did she have? Zero!
  3. Finally, let me get mathematical. We observe that if I drop a rock on my foot, it hurts. Therefore if my foot hurts, I must have dropped a rock? Uh... no. Maybe I stepped on something sharp. Maybe an insect or some other animal bit it. Maybe something hot was spilled onto my foot, or maybe a golf ball just flew into my yard and hit my foot. That is, [P⇒Q] does not imply [Q⇒P]. Lack of faith may inhibit God's activity, but if God doesn't do something, it might not have anything to do with how much faith I have or haven't got.

Monday, March 21, 2011

Resisters Are Futile. I think.

No, this isn't about electronics, and that isn't a typo. "Resister" comes from Flory and Miller's Finding Faith, chapter 4. I'll simplify their characterization of this group, of which I'm sometimes a member (when I forget...) by calling them moderns fighting the transition to the post-modern era. We moderns have the fantasy that someday facts and logic will once again win the day. (In other words, “Never mind this ‘experience’ stuff; let's discuss the facts.”) Here's a sentence from Flory and Miller's Summary and Conclusions of their Resisters chapter in Finding Faith:
...Resisters are intent on resisting a changing social and cultural order where their conception of reason and rationality is under attack, or more accurately (at least according to their analysis) completely disregarded, and are trying mightily to regain a voice for a commitment to reason and rationalism that legitimates everything they believe in and, they argue, legitimates everything anybody should believe in. (117)
Yes, I sometimes resemble this remark. But when I do, I think I (and they) miss the point (to borrow a phrase from Campolo and McLaren) in a few ways.
  1. First, facts and logic have never really carried the day. As I've often said when reading, say, John 11:45-46 -- “When the chief priests and Pharisees heard that Jesus had raised Lazarus from the dead, they said, ‘Whoa, boys! We've been all wrong about this guy! He really is from God!’”

    No they didn't; facts and logic meant nothing to them in this area. Or when the Roman guards told the priests about the empty tomb in Matthew 28:4,11 -- same deal; God was really working but the priests refused to understand.

  2. Second, society really isn't heading in that direction; it really is heading toward story as the way of understanding truth, as Fallows points out in this great article on the new media (more in this previous posting). This quote from that article bears repeating:
    Jon Stewart and Stephen Colbert ... don't fact-check Fox News, or try to rebut it directly, or fight on its own terms. They change the story ... by presenting the facts in a way that makes them register in a way they hadn't before.
  3. Third, much as people don't apprehend truth presented in the style and structure I'm familiar with (and like), logic isn't 100% ineffective among young people today.

    A few summers back, we had a terrific time discussing parts of Keller's The Reason for God with some college students. Granted that these folks weren't exactly a random sampling, yet in areas where they weren't overly invested in their position, Keller's trenchant critique did gain traction. Some people really do want to know if their thinking is a little too fuzzy.

    But these folks would never pick the book up on their own; they came partly because of the material but also partly because it was at our house, they're friends of our daughters, etc.

Flory and Miller say "the relative success or failure Resisters remains to be seen" (122) and I suppose they are right. Though I don't ever see our society returning to a condition where people at least pretended to be logical more of the time, some people really are interested in truth, and facts and logic, if presented in a palatable way, can change people's minds, and sometimes, eventually, their hearts.

Yet as someone said, nobody ever decided to follow Christ or feed the hungry because they lost an argument.

Sort of Python - part deux

Continuing from part 1...
Now suppose you wanted to do something a little more useful, like a case-ignore search. Well, you'll need, of course, a case-ignore comparator function. Fortunately Python strings have a method called "lower()", which returns a string that's been shifted to lower-case. So rather than comparing the original strings using cmp(), we could pass in stringX.tolower() and stringY.tolower() to cmp() and use that return value, as shown below in compIgnoreCase:
#!/usr/bin/python -utt
# vim:et
'''Program to sort a list of words using various criteria.'''

def show(listA):
    print "\tlistA:", listA
    print

def compLen(x,y): '''Compare words for length''' return cmp(len(x), len(y))
def compIgnoreCase(x,y): '''ignore case in sort''' return cmp(x.lower(), y.lower())
def main(): '''Create a list of words, then sort using various criteria. Display the contents of the list after each sort.''' # Easier to type than ['In','the','beginning' (etc) listA = 'In the beginning God created'.split() print "Before sorting:" show(listA) listA.sort() print "after default sort:" show(listA)
# Sort for length listA.sort(compLen) print "after sort by length:" show(listA)
# Sort ignoring case listA.sort(compIgnoreCase) print "after case-ignore sort" show(listA)
return 0 if __name__ == '__main__': main()
Note the code added in this color; we compare the lower()'d version of the strings; the new results are shown in this color below:
% ./sort1c.py 
Before sorting:
        listA: ['In', 'the', 'beginning', 'God', 'created']

after default sort:
        listA: ['God', 'In', 'beginning', 'created', 'the']

after sort by length: listA: ['In', 'God', 'the', 'created', 'beginning']
after case-ignore sort listA: ['beginning', 'created', 'God', 'In', 'the']
Now what if we wanted to put the words with the highest proportion of consonants at the end, and the more vowel-heavy words at the beginning? I'd write a routine to calculate consonant density, and, like the other comparators, include it in a call to sort(). Added code and results are in this color:
#!/usr/bin/python -utt
# vim:et
'''Program to sort a list of words using various criteria.'''

def show(listA):
    print "\tlistA:", listA
    print

def compLen(x,y): '''Compare words for length''' return cmp(len(x), len(y))
def compIgnoreCase(x,y): '''ignore case in sort''' return cmp(x.lower(), y.lower())
def compConsonants(x,y): '''compare words for consonant density''' return cmp(consonantDensity(x), consonantDensity(y)) def consonantDensity(astring): '''how many consonants in astring?''' ret = 0.0 for abyte in astring.lower(): if abyte in ('a','e','i','o','u'): continue ret += 1.0 return (ret / len(astring))
def main(): '''Create a list of words, then sort using various criteria. Display the contents of the list after each sort.''' # Easier to type than ['In','the','beginning' (etc) listA = 'In the beginning God created'.split() print "Before sorting:" show(listA) listA.sort() print "after default sort:" show(listA)
# Sort for length listA.sort(compLen) print "after sort by length:" show(listA)
# Sort ignoring case listA.sort(compIgnoreCase) print "after case-ignore sort" show(listA)
# Sort by increasing consonant density listA.sort(compConsonants) print "in order of increasing consonant density" show(listA)
return 0 if __name__ == '__main__': main()
So consonantDensity calculates what proportion of each word's letters are consonants, and compConsonants(x,y) compares the consonant proportions of the two strings passed. The results look like this:
% ./sort1d.py 
Before sorting:
        listA: ['In', 'the', 'beginning', 'God', 'created']

after default sort:
        listA: ['God', 'In', 'beginning', 'created', 'the']

after sort by length: listA: ['In', 'God', 'the', 'created', 'beginning']
after case-ignore sort listA: ['beginning', 'created', 'God', 'In', 'the']
in order of increasing consonant density listA: ['In', 'created', 'beginning', 'God', 'the']
That looks about right: "in" is 50% consonants; "created" is 4/7 or about 57% consonants; "beginning", "God", and "the" are 2/3 (about 67%) consonants.

Finally, I wanted to mention "pydoc", a terrific documentation aid. When run on the above code, it produces this:

% pydoc sort1d
Help on module sort1d:

NAME
    sort1d - Program to sort a list of words using various criteria.

FILE
    /Users/collin/tmp/sorting/sort1d.py

FUNCTIONS
    compConsonants(x, y)
        compare words for consonant density
    
    compIgnoreCase(x, y)
        ignore case in sort
    
    compLen(x, y)
        Compare words for length
    
    consonantDensity(astring)
        how many consonants in astring?
    
    main()
        Create a list of words, then sort using various criteria.
        Display the contents of the list after each sort.
    
    show(listA)
Pretty cool, huh? Just put the "documentation strings" in the function declarations, and voila -- instant manpage!

Saturday, March 19, 2011

Sort of Python

Sorry for the title; I couldn't resist. My nephew and I were talking about sorting in Java, a language which I can't even spell. But I remembered, when talking about the idea of passing a function to another function, that this concept takes some getting used to. I decided to write a little example this morning, using a language I actually write code in, viz., Python. Here's the first part:
#!/usr/bin/python -utt
# vim:et
'''Program to sort a list of words using various criteria.'''

def show(listA):
    print "\tlistA:", listA
    print

def main():
    '''Create a list of words, then sort using various criteria.
    Display the contents of the list after each sort.'''

    # Easier to type than ['In','the','beginning' (etc)
    listA = 'In the beginning God created'.split()

    print "Before sorting:"
    show(listA)

    listA.sort()
    print "after default sort:"
    show(listA)

    return 0

if __name__ == '__main__':
    main()
Let me explain briefly. "show" is just a helper that displays the list in a certain way -- i.e., with a tab in front and an extra newline after the word list. I wrote "show" so that, in case I wanted to do something different (e.g., put the extra newline before, rather than after, the list; or use some spaces rather than a tab character) I would just change the layout once, in show(), rather than changing a bunch of print statements throughout.

"main" creates the list, which I creatively call listA, by taking a string (a sentence or phrase will be fine) and splitting it based on whitespace (this is like PERL's "qw"). Then it calls "show" to display the list's original contents.

Finally, it calls the list's sort function, passing no parameters. This sorts according to the default ordering, which may depend on your $LANG or $LC_ALL environment variable. Here's what happens when you run it:

% ./sort1a.py 
Before sorting:
        listA: ['In', 'the', 'beginning', 'God', 'created']

after default sort:
        listA: ['God', 'In', 'beginning', 'created', 'the']

% 
Now what if you want to do something different with the sort -- rather than sorting based on the natural ordering of these words, what if you wanted to put longest words last?

Well, sort() can still help you, but you need a comparator function -- one that, given two words, tells whether the first is shorter (or "less than", or "comes before") the second word in the desired outcome. Let's add that in like this:

#!/usr/bin/python -utt
# vim:et
'''Program to sort a list of words using various criteria.'''

def show(listA):
    print "\tlistA:", listA
    print

def compLen(x,y): '''Compare words for length''' return cmp(len(x), len(y))
def main(): '''Create a list of words, then sort using various criteria. Display the contents of the list after each sort.''' # Easier to type than ['In','the','beginning' (etc) listA = 'In the beginning God created'.split() print "Before sorting:" show(listA) listA.sort() print "after default sort:" show(listA)
# Sort for length listA.sort(compLen) print "after sort by length:" show(listA)
return 0 if __name__ == '__main__': main()
See how that works? I created a routine compLen, which returns -1, not when the first word would precede the second in natural ordering, but when the first word is shorter than the second word. By the way, Python's cmp does this comparison/return thing on whatever we pass it -- hence by just typing cmp(len(x), len(y)) I've created a routine that does what we need to sort by length.

The second change, within main(), calls sort(), passing in this comparator routine. When sort() does its thing, it will put them in ascending order, as defined by compLen().

Does that make sense? When sort() wants to decide if, what's currently say, element#2 should go after what's currently element#3 (i.e., if 2 and 3 are in the correct order), it calls a function. If you just say someList.sort(), then sort() will call a function that returns -1 if element#2 is "less than" element#3, whatever that means. But if you pass in a function like compLen, then sort() will call compLen, which will say whether element#2 is (in this case) shorter than element#3, and so you'll end up with a list sorted in order of increasing length. Here's how it looks when run:

% ./sort1b.py 
Before sorting:
        listA: ['In', 'the', 'beginning', 'God', 'created']

after default sort:
        listA: ['God', 'In', 'beginning', 'created', 'the']

after sort by length: listA: ['In', 'God', 'the', 'created', 'beginning']
%
Did that all make sense? More examples in part 2

Wednesday, March 16, 2011

Cinema: the new church?

Two statements:
  1. Jon Stewart and Stephen Colbert ... don't fact-check Fox News, or try to rebut it directly, or fight on its own terms. They change the story ... by presenting the facts in a way that makes them register in a way they hadn't before.
    Learning to Love the (Shallow, Divisive, Unreliable) New Media
    by James Fallows, The Atlantic April 2011

  2. More theology is discussed at Starbucks on a Saturday night than at most churches on Sunday morning.
    Ralph Winter (or maybe Chap Clark)
    pre-Windrider Festival film event 2011-03-14
It's not quite fair to say that people don't care about truth any more, but the way we take truth in, the way we decide what's true -- those have changed. Here's another snippet from the same article:
“There is actually a lot of energy released by opposing ‘settled facts,’” I was told by Jay Rosen, of the journalism school at NYU. “The more ‘settled’ it is, the more furious the energy. When someone points out an error in what Sarah Palin has said, that becomes another example of the liberal media, and it becomes another tool for organizing.”
Fallows, op. cit.
In other words, people don't decide what to accept or not based upon facts and logic. Instead, it's about something else entirely, which is where we have a lot to learn from the world of film.

We evangelicals have a hard time with this concept. (Which one? Yes.) First, we are (at least where I'm coming from) all about facts and logic to understand issues of importance. What happened about 33 AD after they crucified this man called "Jesus of Nazareth, King of the Jews"? The body was never found by highly motivated, powerful people. They were well-connected and focused enough to get him killed, and producing his corpse would have wiped out that troublesome sect—which instead has lasted nearly 2000 years.

Jesus's empty tomb stands as a serious challenge to to the likes of Dawkins and Pinker, men who say in their hearts, "There is no God." But facts and logic on their own are impotent to change the heart of man.

Yes, it has ever been thus. Those highly motivated powerful people from the 1st century were also unswayed by facts; Semmelweis had facts to prove hand-washing saves lives, but died unemployed and destitute. And so on.

But it does seem worse in our current century than it was, say, in the middle of the previous one.

We evangelicals (some more than others) think of weekly gatherings as being about The Content in The Sermon—surrounded by some music and stuff on either side. We don't give enough thought to the entire experience, which echoes something I heard before about sensory experience. People like me need to think of the entire experience of coming to a meeting -- the sights, the sounds, the smells, and the story all these tell -- rather than focusing only on the propositions contained in the sermon.

Second, the idea of listening to those outside the church, to learn how to communicate truth... well, I can't say we're always as open-minded as we should be. I think we humans -- not just the church by the way -- tend to think too much in terms of "us vs them" in echoes of what Judy Harris calls "group socialization theory." We are very concerned about getting facts straight about our faith, but we're not always so sure about their theology for example. Or on the other side, we put a lot of energy into welcoming the alien and stranger as Jesus and Peter and other Biblical writers, but we're not so sure how a newcomer would feel at their church.

Either of those preceding statements may be at least partly true, but what's worse (besides the smug attitude) is that we add, in our hearts, ...therefore, they can't teach us anything about ________.

Which comes under the heading of "biting off your nose to spite your face" or something like this. We all need to be about following Jesus, and that means taking off our blinders and prejudices, setting aside our pride, and looking for anything we can learn about how to communicate, serve, love, worship.

... that we may live a life worthy of the Lord and please him in every way, bearing fruit in every good work, growing in our knowledge of God, being strengthened with all power according to his glorious might in order that we may have great endurance and patience, and joyfully giving thanks to the Father, who has qualified us to share in the inheritance of the saints in the kingdom of light -- that in all things he may have the glory.

Right. So what do we learn from film? The film world, as Ralph Winter told us the other night, are very interested in the structure, the style. Whatever the substance is or isn't, if the style and structure are good, you've got a hit.

So what do you think of Avatar? Is it too much about tree-worshiping, or is it about hope and redemption, resolving one's inner conflicts, rebirth? How about the first Star Wars film from the 1970s? Was that one about a false impersonal deity (The Force) and occult religions? Or was it about self-discovery, self-sacrifice (e.g., Obi-Wan sacrificing himself so Luke could get away)? These are great stories, brilliantly told.

So are The Little Gorilla and Kavi by the way. If you can see these -- or better yet, see them with friends -- they can provoke more discussion of theology than one typically gets on Sunday morning.

Tuesday, March 15, 2011

Reading Luke 5

Links: my other postings on Lent ; our church's reading plan
The other day, I was parked behind a car whose license plate read "LK 5 31" or something like this. I wondered, was that the one about "I have not come to call the righteous?"

Well, today's reading included Luke 5:31 -- I just read Luke 5, due to sloth; it involved a lot less page flipping than this list from our reading plan (read down, then across):

  • Mark 2:1-12;
  • Matthew 9:1-8;
  • Luke 5:17-26;
  • Mark 2:13-17;
  • Matthew 9:9-13;
  • Luke 5:27-32;
  • Mark 2:18-22;
  • Matthew 9:14-17;
  • Luke 5:33-39;
  • Mark 2:23-28;
  • Matthew 12:1-8;
  • Luke 6:1-5
I don't want to discourage anybody who wants to read that, but I'm afraid I'd still be looking for the next selection when the train arrived at my stop.

Anyway, Luke 5 is a terrific chapter. We've got Jesus teaching Simon how to fish, Simon saying "Depart from me, for I am a sinful man, O Lord!" (Luke 5:8) -- I can certainly identify with that! Suddenly coming to see that someone you thought you knew is actually totally other and totally holy -- it was a terrifying experience, and he wanted to run and hide. Yet when Jesus told him to follow, Simon and his crew left everything to follow him (Luke 5:11).

Then there's the man with leprosy ("If you are willing, you can..." he said). What a great example for us today! Some fault the leper for doubting God's goodness, but I say the man had faith (the "you can make me clean" part) and guts, and like today's 27 million slaves, had reason to wonder whether God is actually good, whether Somebody out there cares about him. And Jesus healed him, right there.

As he did the guy lowered through the roof. And it's not just the physically sick Jesus cares for, but those who, like Levi (aka Matthew) the tax collector, have other kinds of problems (Luke 5:27-32). In case you didn't know this about tax collectors in those times, they collected tax for the hated Roman oppressors. They collected money from each person or household, and sent part of that money to Rome. The rest was their profit, or service fee, or whatever you want to call it. They were well-hated by their countrymen.

Yet Jesus called him to follow -- think of it, the Son of God, taking on a sinner like Levi (or like me) as a disciple. Wow! By the way, that's where Luke 5:31-32 fall: "It is not the healthy who need a physician, but the sick. I have not come to call the righteous, but sinners [to repentance]."

Sunday, March 13, 2011

A few words on marriage. And sex.

We drove a couple of hours into the valley yesterday for a wedding -- the last remaining single nephew of the lovely Carol is now officially unavailable. Besides the important point that marriage is for "as long as we both shall live," the pastor gave the rest of us a short reminder regarding our duties to support the marriage: the point I remembered was not to ah, "talk steenk" (as we used to say as kids) about one partner to the other.

This could be a very poisonous thing to do -- particularly if we suspect there's some strain in the marriage. I mean, if "Don" and "Mary" might be having some issues, and we send Mary the subliminal (or not-so-) message that if she decided to dump Don, we could certainly understand, what with all the stunts he's pulled recently, etc. -- that could be a terribly destructive thing to do. (On the other hand, it could also be a brilliant support of the marriage, if we know for sure that she'll rise up to defend her husband from these unfair accusations, etc., but that's a risky proposition.).

Instead, we should remind each other that the vow is "for better for worse, for richer for poorer, in sickness and in health" and that it really is a permanent deal, a promise.

This morning I heard a brilliant sermon on "I believe in God but I'm in charge of my sex life," where our pastor reminded us of the concept of "chastity" and how it applies to all of us, whether single or married. He explained that the exhortation to us in 1 Corinthians 6:18 ("Flee immorality... ") was not because sexual sins are more heinous in God's view; it's because the consequences are greater upon me, the sinner. It's a helpful reminder to me about the importance of chastity -- I don't want to be hobbled in my pursuit of God any more than I already am.

Something else I liked from this morning's sermon was a bit of dialog between a young, "modern" person who expressed incredulity at the idea of saving sex for marriage. "Nobody's a virgin when they get married these days. I mean, were you and your wife virgins when you got married?" Upon hearing that in fact John and Nancy were, he replied: "No way! There is no way I could live like that!"

So John asked, "How's your way working out for you?" It wasn't working very well at all, as it turned out. Another pastor, Andy Stanley, was quoted as asking a congregant, "Has having sex outside of marriage made your life better, or just more complicated?" Just more complicated. A lot more complicated.

Not everyone can see the damage that's being done; some just enjoy the pleasure of the experience. But as Cameron Diaz's character says in Vanilla Sky, "[W]hen you sleep with someone, your body makes a promise, whether you do or not." Something profound happens there. "Casual sex" is an oxymoron.

Or, as Lauren Winner writes in Real Sex, "in Christianity's vocabulary the only real sex is the sex that happens in marriage; the faux sex that goes on outside marriage is not really sex at all..." (38). Don't take that too literally! Of course it's real in the sense that it can produce a child, that your body makes a promise, that it can destroy relationships and families, that it can produce intense pleasure. But it's out of place; it's wrong in a fundamental way because it's out of context.

Friday, March 11, 2011

Christmas stories

Links: my other postings on Lent ; our church's reading plan
Yesterday's Scripture reading according to our church's reading plan included verses from Matthew and Luke: Matthew 1:18-25; Luke 2:1-20; Matthew 1:1-17; Luke 3:23-38; Luke 2:21-40. Why just Matthew and Luke, and why ordered like this?

Well, Christmas -- the birth of Christ -- is only mentioned in these two gospels. That's right -- Mark and John do not talk about the Lord's birth at all. All four gospels talk about Christ's death and resurrection, but only two talk about his birth. Yet, as Buechner says, Christmas is as much of a miracle -- it's the invasion of the Creator into his created order.

Why start with Matthew 1:18-25 and then do 1:1-17 afterward? I guess it's so that the day's reading starts with some action. Here's how Jesus was born, Matthew tells us, recounting the unexpected pregnancy, Joseph's thought of possibly divorcing Mary quietly (rather than having her shot), the various revelations Joseph got through dreams, the Magi's visit, the flight to Egypt, and so on.

Next we get Luke's account, the passage millions of Americans heard and perhaps memorized from A Charlie Brown Christmas: Luke 2:1-20, including the shepherds' visit. An interesting thing I heard recently, from a Christmas eve sermon actually, is that "no room at the inn" (Luke 2:7) might be better be translated "guest room was already occupied." Apparently, in towns like Bethlehem, people might have an upper room or guest room. The entire family (including domestic animals) might live on the lower level. And a manger (Luke 7) is where a newborn child might normally be placed.

So the message of Luke 2 isn't so much about rejecting Jesus (as John 1:11) -- that came later -- as it is about how when Jesus came, he came in the way any peasant child might come, wrapped in cloths ("strips of cloth" or "swaddling clothes" in other translations) and placed in a manger, as any peasant child would be.

The genealogies come next; tradition has it that Matthew's list describes Joseph's lineage whereas Luke's list describes Mary's. This is consistent with a totally uninformed theory of mine, viz., that Luke got a lot of his information through interviews with Mary, and that she lived long after Joseph had passed away. (Here's a short piece summarizing my understanding of what Matthew's genealogy tells us about Jesus's identity.) In any case, I think the editors of the reading list did well to give us the genealogies after the birth story.

What I got out of these readings is Jesus's radical identification with us: he is at once the Savior and Sacrifice, King of Kings and Lord of Lords, and yet also came through a line of ancestors that included Rahab and Ruth and Tamar, arrived as any peasant child, fled like a criminal in the earliest part of his life.

What an amazing love our God has for us, to enter into this sorry world during a dark time, to have to flee for his life, and eventually to die for our sins. How fortunate and blessed we are to be loved like that!

Thursday, March 10, 2011

Not giving anything up for Lent

Links: my other postings on Lent ; our church's reading plan
Our pastor is encouraging us to focus on some Scriptures during Lent, and I think this is a terrific idea. A few years ago I heard an essay on NPR (yes, on National Public Radio) about Lent: the speaker was talking about giving up this or that when he was in college (I think beer was one of the things he gave up). But decades later, he wondered if the focus of Lent ought to be "more _________" rather than "giving up __________". For example, rather than drinking less, or going to the movies less, he thought he would pray or meditate or serve the poor more.

So I like this "more Scripture" idea. Yesterday's reading was Luke 1 and naturally I'm already behind. I read Luke 1 this morning, and Mary's song impressed me, again -- particularly Luke 1:52-53:

He has brought down rulers from their thrones
    but has lifted up the humble.
He has filled the hungry with good things
    but has sent the rich away empty.
I can't imagine how this must have sounded to its first-century hearers, She switches the order in the two couplets:
  • brought down rulers... lifted up the humble
  • filled the hungry... sent the rich away empty
and I think the folks in the middle -- the humble and the hungry, rather than the rich and powerful -- are the focus of this song.

And I suppose it felt like bad news to the rich and powerful; in a way it's unsurprising that the Guatemalan government banned its recitation in public for a while in the 1980s. Considering recent events in northern Africa and western Asia, the Magnificat is as timely today as it was in the first century. "He has brought down rulers from their thrones" -- I'm sure many people are longing for that today. "Thy kingdom come, thy will be done on earth as it is in heaven."

Today's reading is is Matthew 1:18-25; Luke 2:1-20; Matthew 1:1-17; Luke 3:23-38; Luke 2:21-40. I'm not sure about the order, but more on this later.

Sunday, March 06, 2011

Gratitude

The transition to being "empty nesters" is not instant, but it is inexorable: within a month, our sole remaining teen-ager will start her third decade.

It is bittersweet, this transition. We raised our girls to go off to college and become independent, and they've done the first. The ex-teenager will be married within the year, and that's good, too; I just hadn't thought all this would happen so soon. It was nearly three years ago that I wrote this sentimental piece about the then younger teen, and I certainly miss the days when I'd come home to the lovely Carol, and also to little (and later not-so-little) girls, who would sit on my lap, or want to be carried around ("運んでもらう!"), or tell me about their day.

Which reminds me of a story. One day, a man came down the street and gave me a hundred-dollar bill. The next day, he did it again. For something like twenty years he did this. I got accustomed to it.

Then he stopped coming so regularly. He'd come during the summer, then stop. He'd come again toward the end of November, and then in January he'd stop. Sometimes he'd show up for a week in March or April.

These hundred-dollar bills (an inadequate metaphor but please bear with me) were not earned or deserved, so the appropriate attitude is gratitude. We are so fortunate to be able to enjoy these exceptional girls (I imagine every parent thinks his or her kid a genius, a spiritual giant filled with zeal and compassion; I am no exception) -- and to know that they're gone doing what we raised them to do.

Though I sometimes mourn the passing of those truly wonderful days, I know that I've received more and better than I deserve, and when I remember this, I can be thankful.

"Praise God, from whom all blessings flow!" Amen.

Is your firefox3 slowing your computer down?

Apparently firefox can slow down not just firefox, but your whole Linux computer, according to the results posted in this thread. I read the "vacuum" tip here and tried it on my computer at home. Here's the "before" picture:
-rw-r--r-- 1 collin users     7168 2011-02-16 19:50 content-prefs.sqlite
-rw-r--r-- 1 collin users   576512 2011-03-05 21:56 cookies.sqlite
-rw-r--r-- 1 collin users     5120 2011-03-05 20:30 downloads.sqlite
-rw-r--r-- 1 collin users     4096 2011-03-05 21:56 formhistory.sqlite
-rw-r--r-- 1 collin users     2048 2010-12-28 10:54 permissions.sqlite
-rw-r--r-- 1 collin users   446464 2011-03-05 21:56 places.sqlite
-rw-r--r-- 1 collin users     2048 2011-03-05 21:41 search.sqlite
-rw-r--r-- 1 collin users    18432 2011-01-18 18:39 signons.sqlite
-rw-r--r-- 1 collin users 15332352 2010-11-02 16:04 urlclassifier2.sqlite
-rw-r--r-- 1 collin users 46837760 2011-03-05 21:44 urlclassifier3.sqlite
-rw-r--r-- 1 collin users   412672 2011-03-05 20:29 webappsstore.sqlite
And here's the "after" one:
-rw-r--r-- 1 collin users     7168 Mar  6 08:02 content-prefs.sqlite
-rw-r--r-- 1 collin users   445440 Mar  6 08:02 cookies.sqlite
-rw-r--r-- 1 collin users     2048 Mar  6 08:02 downloads.sqlite
-rw-r--r-- 1 collin users     4096 Mar  6 08:02 formhistory.sqlite
-rw-r--r-- 1 collin users     2048 Mar  6 08:02 permissions.sqlite
-rw-r--r-- 1 collin users   151552 Mar  6 08:02 places.sqlite
-rw-r--r-- 1 collin users     2048 Mar  6 08:02 search.sqlite
-rw-r--r-- 1 collin users    18432 Mar  6 08:02 signons.sqlite
-rw-r--r-- 1 collin users  3257344 Mar  6 08:02 urlclassifier2.sqlite
-rw-r--r-- 1 collin users 35360768 Mar  6 08:03 urlclassifier3.sqlite
-rw-r--r-- 1 collin users   412672 Mar  6 08:03 webappsstore.sqlite
Just a few files had a significant reduction, but I thought I'd tell you about this anyway.

So, if your computer is slow and you use firefox3, this might help. btw there are instructions at the link above for how to "vacuum" firefox on Windows, too.

Tuesday, March 01, 2011

How to Overcome Envy -- expanded

I'm giving this talk Friday 04 March 2011 to a group that's just finished hearing a series on mission.

How to Overcome Envy

I understand from Jeff that you've been hearing lately about mission: the reason you're sent, the message you bring, and the mission you're to accomplish. Sounds like a great series.

My topic for this evening is about envy. Envy will slow you down: it will dilute the reason, compromise the message, and impede your mission.

What Is Envy?

Envy is pain at the good fortune of others. (Aristotle, Rhetoric)

Envy is like this: My friend wins a brand new Mercedes-Benz in a raffle — a raffle that I also entered. If that makes me unhappy, if that makes me less contented, that's envy.

What if my friend's kid gets into an elite university, or gets a 100% scholarship to an elite university, and I'm unhappy about that? Or if a colleague gets a promotion or an award? If I was happier before I heard about their good fortune, that's what makes it envy.

Why Do We Envy?

Let's look at an old example from Psalm 73, a psalm of Asaph:

Psalm 73:1-5

    Surely God is good to Israel,
        to those who are pure in heart.
    But as for me, my feet had almost slipped;
        I had nearly lost my foothold.
    For I envied the arrogant
        when I saw the prosperity of the wicked.
    They have no struggles;
        their bodies are healthy and strong.
    They are free from the burdens common to man;
        they are not plagued by human ills. 

Psalm 73:12-14

    This is what the wicked are like—
        always carefree, they increase in wealth.
    Surely in vain have I kept my heart pure;
        in vain have I washed my hands in innocence.
    All day long I have been plagued;
        I have been punished every morning.
(Psalm 73:1-5,12-14)

The psalmist sees others with good things he doesn't have. He sees his own problems and thinks others don't have them.

It's like that with us, too, and by the way the person you envy doesn't have to be arrogant or wicked. Here's an example, a guy I'll call "Nick." Nick wrote a novel. His agent called one day, "The publisher wants to offer you a million dollar advance." Nick quit his day job and wrote one best-seller after another. Nick is a real person, by the way; I think he's a Christian. I'll tell you more about him later.

So I compare myself with somebody who has more than I do, and I feel envious. What would happen if I compare myself with somebody who has less? I might thank God for blessing me with abundance. I might be more contented. I might become more generous. I might wait a little longer before buying my next expensive toy.

What's Wrong With Envy?

I'm an engineer, so here's an engineering answer: envy doesn't take all the facts into account. Asaph knew this too:

Psalm 73:16-18

    When I tried to understand all this,
        it was oppressive to me
    till I entered the sanctuary of God;
        then I understood their final destiny.
    Surely you place them on slippery ground;
        you cast them down to ruin.
(Psalm 73:16-18)
In other words, in the case of the arrogant and wicked who seem to have no troubles—at least for now—their end won't be all that good. I'm not saying to rejoice when calamity hits them; I'm just saying that their situation isn't as good as it looks.

Even if someone isn't blatantly evil, arrogant or wicked, we don't usually know much about their problems. I mentioned "Nick" — that's Nicholas Sparks, who wrote The Notebook. Have you read it, or seen the movie? He's written a bunch of best-sellers, and they're pretty good reads. He also wrote Three Weeks with my Brother, where I learned about...

his marriage in 1989; the loss of Nick and Micah's mother two months later after a horseback riding accident; the death of Nick's first baby and the physical problems of his second son; the death of their father in a car accident; and the passing of their younger sister from a brain tumor.
(from Publishers Weekly Copyright © Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.)

Whoa, Nick was about 25 when his mother died; the rest of that stuff happened before he was 40. I'm a lot older than that, but I still have both my parents; my sisters are still alive, my children are both healthy and following the Lord. I would not trade places with him.

Psalm 73:21-22

    When my heart was grieved
        and my spirit embittered,
    I was senseless and ignorant;
        I was a brute beast before you.
(Psalm 73:21-22)
Senseless and ignorant that's not a good way to be. Or like a beast.

Here's the thing: it's hard to follow God when I'm coveting or envious and embittered. In other words, like other sins, envy makes us stupid.

Envy is the enemy of just about any good thing I can think of. It even goes against the Ten Commandments.

What To Do About Envy?

I'm indebted to Kathy Collard Miller for most of these steps.

Remember that God is in control.

Charles Swindoll wrote,
Sovereignty means our all-wise, all-knowing God reigns in realms beyond our comprehension to bring about a plan beyond our ability to alter, hinder, or stop.
(also quoted on p.103 of Becoming Myself; Becoming His: Living the Life God Designed for You, by Kay Watson — per Google Books)
When I recognize that God is at work, that he's in full control, and that he will accomplish his plan concerning me (Psalm 138:8 NASB), envy will lose some of its steam. He's got good plans for me.

Here are some more verses; you probably know them. Daniel 4: "All the peoples of the earth are regarded as nothing. He does as he pleases with the powers of heaven and the peoples of the earth." There are a lot more — Isaiah 14:24 says "As I have planned, so it will be, and as I have purposed, so it will stand." Isaiah 40 talks about how all the nations are regarded as nothing. Psalm 75 says that he brings one down and lifts up another. He is the one who accomplishes all things according to the counsel of his will — from Ephesians 1. And so on.

Decide to Bless

Kathy suggested a prayer along these lines: “Lord, bless them. Give them many more opportunities. Expand their ministry.” This is a way of applying 2 Corinthians 10:5 — one method we can use to "take every thought captive to the obedience of Christ" (NASB).

Since Jesus told us to love our enemies and bless those who persecute us (Matthew 5:44), how much more should we bless those who didn't hurt us in the first place?

I would like to suggest that we ask God even before we face the situation, to make us the kind of people who can bless rather than get mad.

Remember that we each have a role

The Apostle Paul talked quite about this in 1 Corinthians 12; here's verse 17 from the NIV: "If the whole body were an eye, where would the sense of hearing be? If the whole body were an ear, where would the sense of smell be?" There is no "appendix" in the body of Christ!

In particular, you have a role, and your role is essential.

Grow in Grace

On my blog I write, "do the above for 20-30 years and repeat as needed", which also applies here. I've put in the handout some helpful commands from the Scriptures...
If I'm practicing these, it's hard to be envious:
  • Be joyful always; pray continually; give thanks in all circumstances (1 Thessalonians 5)
  • Rejoice in the Lord always (Philippians 4)
  • Let your mind dwell on: whatever is true, whatever is honorable, whatever is right, whatever is pure, whatever is lovely... (Philippians 4)
  • Remain in Christ, and let his word remain in you (John 15)
  • Love one another as he has loved us (John 13)
  • Bless your enemies, and your peers and friends (Matthew 5)
  • Humble yourself under God's mighty hand, and he will exalt you at the proper time (1 Peter 5)

Really important: There is no condemnation

Romans 8:1-4

Summary

  • Remember God's in control
  • Be determined to bless your rivals
  • Remember that your role is essential
  • Grow in grace and in the knowledge of our Lord and Savior Jesus Christ
        When you fall, remember there is no condemnation!
My prayer for you is: that you may grow in the knowledge of God's will through all spiritual wisdom and insight... (Col. 1:9-12)

Addendum: How it Went

I had 40 minutes to deliver plus Q&A. Last year I talked way too long, but this time I was done in about 25 minutes. Afterward someone stood up at the mike and said, "We're definitely gonna invite you more often."

During the question/answer section, someone observed that "victory" in this area comes and goes. I replied that there is no magic formula, but we practice the disciplines, we grow in grace, we do it for 20-30 years and repeat as needed.

Another question was: How do you respond if somebody is envious of you? Maybe you don't think you're in such an enviable position, but suddenly a harsh remark comes out from someone who thinks they know you well? What came to mind was the idea that we often feel that we have to act like we've "got it all together" and don't have any problems. If someone shares with me that they're feeling envious, it may be time for me to be a little more transparent, tell them about my struggles, ask them to pray for me.

Now that I think of it, someone remarked how our kids got along so well together. "It wasn't always this way," I replied. "There was a while when we couldn't turn our backs or one of them would be biting the other. We prayed a lot in those days." Which reminds me of this verse from 1 John 1:

If we walk in the light, as he is in the light, we have fellowship with one another, and the blood of Jesus his son cleanses us from all sin.