Monday, October 11, 2004

It Couldn't Be Done

A quick excerpt from the poem "It Couldn't Be Done":
Somebody said that it couldn't be done
But he with a chuckle replied
That "maybe it couldn't," but he would be one
Who wouldn't say so till he tried.
So he buckled right in with the trace of a grin
On his face. If he worried he hid it.
He started to sing as he tackled the thing
That couldn't be done, and he did it!
Edgar Albert Guest (1881-1959) is the poet. You can find more on him here.

Python: Custom Grep Template

Sometimes a normal grep doesn't cut it. A template for a fancier grep written in Python would look like this:

#!/usr/bin/env python
import fileinput, sys
searchterm = sys.argv[1]
sys.argv[1:] = sys.argv[2:]
response = "%s: '%s' found %d times on line %d."
for line in fileinput.input():
    num_matches = line.count(searchterm)
    if num_matches:
        print response % (fileinput.filename(),
            searchterm, num_matches,
            fileinput.filelineno())
        print line
This would be a baseline for something more useful.

Christianity: Interdenominational Arguing

And John answered and said, Master, we saw one casting out demons in thy name; and we forbade him, because he followeth not with us. But Jesus said unto him, Forbid him not: for he that is not against you is for you. Luke 9:49-50 (NIV)
I think this could be considered good advice concerning interdenominational arguing...

Christianity: Arrogance of Disciples

  • Luke 9:49 John said, "Master, we saw someone driving out demons in your name. We tried to stop him, because he wasn't a follower like us."
    • Some translations say "he wasn't in our group".
    • They didn't like someone else using "their" power.
  • Luke 9:54 When his disciples James and John saw this, they asked, "Lord, do you want us to call fire down from heaven to destroy them, as Elijah did?
    • Like it was their place to do so!
  • Luke 9:46 Now an argument started among them as to which of them might be the greatest.

Three Great Web Applications

I never used to use web-based applications for anything, but I have recently discovered three that have changed the way I access information and use the computer. Gmail, Bloglines, and Blogger are the culprits.

Gmail is still in beta, but it is already my email client of choice. Standard email clients are great (my personal favorite being Thunderbird), but they typically tie you to a single computer. IMAP is a choice, but for personal email that seems like overkill. Most webmail interfaces to existing POP3 accounts are just bad imitations of a real client. Gmail is different, and it rocks. It really must be experienced. I now have total access to my email from any net-connected machine sporting a web browser.

Bloglines has really changed the way I read news, blogs, and anything else with a RSS/ATOM/etc site feed. I want to read news at home in the evenings and from work at lunch. Dedicated RSS readers don't really solve this problem unless they run off of a USB drive. Additionally, I often just read sites like Slashdot and OSNews from the actual site anyway, so I could never keep track of what I had read or not read. Bloglines provides a way to read all of my favorites sites wherever I am, and keep track of whether I've read them yet or not.

Blogger is really amazing. I used to keep my online notebook at my website where I had a series of Python scripts that kept track of dates, content, markup, and then published the site every time I added an entry. Blogger is much easier, looks better, and is accessible from anywhere. (My system required ssh shell access to my site host.) I am rather snobbish when it comes to "user-friendly" tools (I like using tools other people can't figure out), but Blogger is too good to pass up. It really makes life easier.

Monday, October 04, 2004

Unix: Colorized Prompt for the Bash Shell

Try this prompt:

PS1="\e[0;32m\]\u\e[0;31m\]@\e[0;33m\]\h \e[0;36m\]\w\n\e[0;33m\]> \[\e[m\]"

Then check out the definitive document on the subject.

Christianity: Jesus Tests Disciples' Faith

In Luke 9:1 Jesus gives the disciples power, they use it, and come back to report all their deeds (Luke 9:10). Yet they immediately forget God's power. They tell Jesus that there is no food for the people.

Jesus says "you feed them" (Luke 9:13). He wasn't intending on performing the miracle! He wasn't feeding the people for their sake (no one was going to starve from missing a meal), he was showing the disciples how they should be thinking about situations. Think about what God is capable of, not the impossibilities of the situation.

Christianity: Losing Salvation

A list of verses possibly pertaining to losing one's salvation:

  • 2 Peter 2:20-21
  • Hebrews 6:4-6
to be continued...

Friday, October 01, 2004

Guitar: Great Chord Progressions

This will be my running list of favorite chord progressions.

D Dmaj7 D7 G
This is a really great sounding progressing to get a song started. The Dmaj7 can be played xx0222.

Am G F E
This sounds a bit like Spanish guitar if played quickly.

Christianity: Memorizing Scripture

This will be an on-going list of verses related to memorizing scripture.

  • Luke 4: When Jesus is tempted in the wilderness, he responds three times with "the Scriptures say". (Luke 4:4, Luke 4:8, Luke 4:12) Scripture helped him fight temptation because he knew what was right.
  • Psalms 37:31 says the law is in a godly man's heart, so he won't slip from the path.

Python: Directory/File Walking

This template walks through all directories and files under the current directory.

#!/usr/bin/env python
import os

for root, dirs, files in os.walk('.'):
    print "root", root
    print "dirs", dirs
    print "files", files

Guitar: Finger-picking Patterns

My favorite pattern right now is:

|---------0-------|
|-0---------0---0-|
|---0---0-----0---|
|-----0-----------|
|---------0-------|
|-0---------------|
  m i T i m i T i
  T       T
It has an alternating bass as well as a treble part that alternates, so it sounds like a lot of stuff is going on. This is especially cool on a 12-string.

Guitar: Fill-ins

If you have a measure (or part of one) between lyrics, a quick chord change for a beat or two can spice things up.

If you are playing a D, switch to a Dsus4 (xx0233) for a beat. For longer fills, try a D-Dsus4-Dsus2-D progression. (Dsus2 is played xx0230.)