Not very long ago -- well, actually it was, but it seems like only yesterday -- when I regularly read stories to the kids at bedtime, they would sometimes ask for particular favorites. I think there is something universal about stories, how there are some stories we just like hearing over and over again.
What is it that appeals about these stories? I think the particulars vary from one person to another (otherwise we'd all have the same ones) but I also think there's something about an obstacle overcome, or an exciting surprise, that appeals.
One of my favorites is a passage from Clancy's Red Storm Rising, around page 448. The Soviets have taken over a NATO air base in Iceland, and now it's payback time. NATO B-52s approached Iceland from the west in a cloud of jamming, and Soviet MiGs charged out into empty sky. Suddenly there was jamming from the south, and then from the east... and then the soviet fighters found themselves facing a line of twelve Tomcats strung out on a line at 30,000 feet -- directly up-sun. A dozen Sparrow radar-guided missiles flew at them out of the sun and ruined their morning, then the remainder chased the Americans eastward. Twenty thousand feet below them, another dozen Tomcats rocketed toward them on afterburner, hidden from ground-based radar by a pair of mountains. Their radars were shut down, and they fired Sidewinder heat-seeking missiles, hitting another eight Soviet aircraft. The north Atlantic was never the same after that battle.
Another one is the passage from Matthew 14, where Jesus feeds the five thousand. They were going on a retreat, or so they thought, except the multitudes followed them out to this remote place. After a while, the disciples wanted Jesus to send the crowds away, but he tells them to feed the crowd. You know the rest -- five rolls, two small fish (trout? smelt?), maybe 7000-12000 people fed? Then Jesus sends the disciples ahead of him to the other side, while dismisses the crowd and goes off to pray. He then walks upon the sea, terrifying the disciples. Peter says, "If it's you, Lord, command me to come to you on the water."
Jesus commands him to come, and Peter starts walking on the water. But then he starts to sink and Jesus pulls him out of the water. "O you of little faith, why did you doubt?" he asks. I love it that the other eleven are just sitting there, like "maybe Peter had little faith, but I had zero, zip, nothing." I love how Jesus didn't rebuke the others -- how gracious he is!
Another favorite is MacDonald's The Golden Key -- though I must confess I don't understand all of it, I love the passage where Tangle and Mossy meet each other and Mossy is immediately infatuated with Tangle. After (it seems) a few moments, Tangle is OK going off into the wide world with him, too. It is so charming and sweet. And when they find each other at the end (this is no spoiler -- you knew they would, didn't you?) and go on to the place from which the shadows fall... well, that's a happy ending too.
There are great moments in Perry's crime fiction, Card's Enchantment as well as his Ender and Hegemon series, Gaiman's Stardust...
What is it about all these things that fascinate me? I think it's the overcoming of obstacles, an element of surprise, the good guys getting their turn.
Then there is Haruf's Plainsong, where two bachelor farmers take in a pregnant teenager, who doesn't always make wise decisions. There's beauty and tragedy, and I also love the part where they take her in again. There's mercy and grace and gruff generosity, and a sense that what's truly most important is being recognized as such.
And I guess of the favorite stories, I hope the story of my life is one where I pursue what's really important.
Sunday, April 13, 2008
Monday, April 07, 2008
HTML formatting of indented lines
To format a poem on blogger, one need not put tons of " " entities at the head of each indented line; rather, "pre" can be your friend. That is, type
the result will look like this:
<pre>, and everything thereafter is treated as preformatted text, until the corresponding </pre>. For example, if you type :<pre>
I nunc,
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!
</pre>
the result will look like this:
I nunc,Now if you hate that typeface, you can provide an alternative -- for example
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!
<pre style="font-family:sans-serif"> followed by the same text yields this:I nunc,
O Baili, Parnassum et desere rupem,
Dic sacra
Peridium deteriora quadris!
Friday, April 04, 2008
audiocassette → mp3
So we have an audiocassette of a 2000? (Nope; it was November 1999) Veritas Forum presentation on "The Bitterness of Truth" by Dallas Willard. As the subject suggests, I wanted to make MP3 files of this.
So I fortunately have an ancient "digital entertainment center", which is great for doing "wavrec" to create ".wav" files. So I said
Why "-S" (stereo) and 48KHz ("-s 48000")? Probably due to some bug in the chip or in my driver (ouch!) it's not possible to set it for mono, or for any rate other than 48KHz. Therefore I have to give it these options to tell wavrec how many samples to look for.
I use a time of 3000 seconds, assuming that the tape might be a little longer than 45 minutes on a side.
So for both sides of a tape, I have two files of about 576Mbytes (oooh). Of course there was quite a lot of empty space in the beginning and end (the tape really was under 45 minutes per side). I used "snd" to trim off the beginning and end.
That gives us two files about 512Mbytes. But I don't want 48KHz stereo; I want maybe 24K mono. Therefore:
The first command turns 48K stereo into 24K mono. The second creates an MP3 file, 32Kbits/second, which has adequate quality for speech.
The other question is... Is 10 Mbytes too large a file?
But at least we have two files of 10Mbytes each rather than 576Mbytes each. I can at least imagine trying to email the 10Mbyte file.
This was probably explained in The Fine Manual, which I did not read (When all else fails...). Anyway, I linked these to a set of friendlier filenames:
which left me with this nice set of mp3 files:
So I fortunately have an ancient "digital entertainment center", which is great for doing "wavrec" to create ".wav" files. So I said
$ wavrec -S -s 48000 -t 3000 willard1.wavWhy "-S" (stereo) and 48KHz ("-s 48000")? Probably due to some bug in the chip or in my driver (ouch!) it's not possible to set it for mono, or for any rate other than 48KHz. Therefore I have to give it these options to tell wavrec how many samples to look for.
I use a time of 3000 seconds, assuming that the tape might be a little longer than 45 minutes on a side.
So for both sides of a tape, I have two files of about 576Mbytes (oooh). Of course there was quite a lot of empty space in the beginning and end (the tape really was under 45 minutes per side). I used "snd" to trim off the beginning and end.
That gives us two files about 512Mbytes. But I don't want 48KHz stereo; I want maybe 24K mono. Therefore:
$ sox w1.wav -r 24000 -c 1 w1x.wav polyphase
$ lame w2x.wav w2x.mp3The first command turns 48K stereo into 24K mono. The second creates an MP3 file, 32Kbits/second, which has adequate quality for speech.
The other question is... Is 10 Mbytes too large a file?
But at least we have two files of 10Mbytes each rather than 576Mbytes each. I can at least imagine trying to email the 10Mbyte file.
Splitting into smaller files
OK, I decided to try to make these into smaller files (the better for listening to on primitive mp3 players like your ipod shuffle, where you can't move within a track). Using the excellent snd program, I split the two long WAV files into 10 files of about 9 minutes each, with a few seconds' overlap. I was surprised that although I named the files w1a.wav, w1b.wav (etc.) the generated files were not wav files; they were$ file ../w1a.wav
../w1a.wav: Sun/NeXT audio data: 16-bit linear PCM, mono, 24000 HzThis was probably explained in The Fine Manual, which I did not read (When all else fails...). Anyway, I linked these to a set of friendlier filenames:
will-truth01.wavand then had to feed some parameters to lame, like this:
will-truth02.wav
will-truth03.wav
will-truth04.wav
will-truth05.wav
will-truth06.wav
will-truth07.wav
will-truth08.wav
will-truth09.wav
will-truth10.wav
for f in *.wav; do m=${f%wav}mp3; lame -r -m m -s24 $f $m; done;which left me with this nice set of mp3 files:
$ ls -lG *mp3Finally, for devices with display capability (hint: the ipod shuffle does NOT have this), I thought I'd add some info to the files via "id3v2", like this:
-rw-r--r-- 1 collin 2174784 2008-04-06 10:42 will-truth01.mp3
-rw-r--r-- 1 collin 2197248 2008-04-06 10:52 will-truth02.mp3
-rw-r--r-- 1 collin 2148576 2008-04-06 10:52 will-truth03.mp3
-rw-r--r-- 1 collin 2164992 2008-04-06 10:52 will-truth04.mp3
-rw-r--r-- 1 collin 2017824 2008-04-06 10:52 will-truth05.mp3
-rw-r--r-- 1 collin 2161632 2008-04-06 10:53 will-truth06.mp3
-rw-r--r-- 1 collin 2221344 2008-04-06 10:53 will-truth07.mp3
-rw-r--r-- 1 collin 2160480 2008-04-06 10:53 will-truth08.mp3
-rw-r--r-- 1 collin 2164320 2008-04-06 10:53 will-truth09.mp3
-rw-r--r-- 1 collin 1734624 2008-04-06 10:53 will-truth10.mp3
$ for f in will*mp3; do
P=${f%.mp3}; P=${P#*truth}; P=${P#0};
id3v2 -a "Dallas Willard" -A "Veritas Forum November'99" \
-t "Bitterness of Truth ($P/10)" -y 1999 $f;
done
Thursday, April 03, 2008
What are pointers and why should I learn about them? -- Part 2
OK, I was wrong about java -- probably because I'm rather a C/assembly dinosaur3 and I think in terms of nouns (e.g., pointers) rather than verbs (e.g., a method that sets the appropriate member of the structure).
So someone at work showed me the light -- you can do it with interfaces. Something like this:
The key insight I was missing -- probably because of my programming-weltanshauung -- was that I was thinking too low-level. I can probably make the Python implementation more Pythonic, too, by using something like the above rather than a reference to an array written up at http://cpark.users.sonic.net/tree_stuff/
So someone at work showed me the light -- you can do it with interfaces. Something like this:
public interface Selector {
Node getFromSide(Node t);
Node getToSide(Node t);
void setFromSide(Node parent, Node newFromSide);
void setToSide(Node parent, Node newToSide);
}
static class L2R implements Selector {
public Node getFromSide(Node t) {
return t.left;
}
public Node getToSide(Node t) {
return t.right;
}
public void setFromSide(Node parent, Node newFromSide) {
parent.left = newFromSide;
}
public void setToSide(Node parent, Node newToSide) {
parent.right = newToSide;
}
}
static class R2L implements Selector {
public Node getFromSide(Node t) {
return t.right;
}
public Node getToSide(Node t) {
return t.left;
}
public void setFromSide(Node parent, Node newFromSide) {
parent.right = newFromSide;
}
public void setToSide(Node parent, Node newToSide) {
parent.left = newToSide;
}
}
private final static L2R Left2Right = new L2R();
private final static R2L Right2Left = new R2L();
Node move1(Selector dir) {
Node newRoot;
Node oldParent;
oldParent = this;
newRoot = dir.getFromSide(this);
while(dir.getToSide(newRoot) != null) {
oldParent = newRoot;
newRoot = dir.getToSide(newRoot);
}
dir.setToSide(newRoot, this);
if(oldParent != this) {
dir.setToSide(oldParent, dir.getFromSide(newRoot));
dir.setFromSide(newRoot, dir.getFromSide(this));
}
dir.setFromSide(this, null);
return newRoot;
} The key insight I was missing -- probably because of my programming-weltanshauung -- was that I was thinking too low-level. I can probably make the Python implementation more Pythonic, too, by using something like the above rather than a reference to an array written up at http://cpark.users.sonic.net/tree_stuff/
"print myself"
Some years ago, a friend told me about a C program he wrote that printed itself. That is, when you run the program, it prints its source. Pretty cool, huh?
For the über-geeks out there, what I mean is this:
I was waiting (for/on?) a train or something a few months ago and decided to try to reconstruct the program. I won't put it here; you can try it for a while and then take a look at print_me.c
Well, that's not the prettiest thing I've ever seen; there is probably a much more elegant solution too, but I don't recall what it was.
For the über-geeks out there, what I mean is this:
$ cc print_me.c -o print_me
$ ./print_me > print_me2.c
$ diff print_me.c print_me2.c
$ echo $?
0
$ I was waiting (for/on?) a train or something a few months ago and decided to try to reconstruct the program. I won't put it here; you can try it for a while and then take a look at print_me.c
Well, that's not the prettiest thing I've ever seen; there is probably a much more elegant solution too, but I don't recall what it was.
Wednesday, April 02, 2008
sick!
this morning I was mostly OK, just dragging slightly, a little cough.
This afternoon... chills, headache, the whole thing. I told my boss, "I feel like cr*p," and she urged me to go home immediately. Not that I needed the encouragement.
So I'm home now. Shaking from the chills. This is not a fun way to be. Hot water helps. Maybe drugs will too.
This afternoon... chills, headache, the whole thing. I told my boss, "I feel like cr*p," and she urged me to go home immediately. Not that I needed the encouragement.
So I'm home now. Shaking from the chills. This is not a fun way to be. Hot water helps. Maybe drugs will too.
Who is master(ed)?
In the April'08 issue of First Things (#182) is an essay by R.R. Reno titled The Bible Inside and Out (pp. 13-15), which describes a great chasm in Biblical interpretation.
Humpty Dumpty says (according to Carroll), "The question is who's to be master" -- as indeed it is. As the old Campus Crusade pictures asked, who is going to be on the throne in your life or mine?
May we choose wisely today.
Modern scholars want to master the Bible.... In contrast, religious readers want to be mastered.(also quoted here).
Humpty Dumpty says (according to Carroll), "The question is who's to be master" -- as indeed it is. As the old Campus Crusade pictures asked, who is going to be on the throne in your life or mine?
May we choose wisely today.
Subscribe to:
Posts (Atom)