Which brings me to The Miracle on 34th Street, a movie in which all the little acts of self-interest accumulate into a redemptive act of faith. It is the most cynical and idealistic movie on Christmas I can think of.
It reminds me of the concept of “the city of perfect justice,” a recurring theme in Winter’s Tale by Mark Helprin, a book Aaron probably wouldn’t like because of all the fantastical elements therein, but whose Helprinesque philosophy would draw him in. The idea is that all the little acts of enlightened self-interest add up, piece by piece, to a perfectly just system. Not perfectly good, nor evil beyond compare, but just.
10:57:59 PM # comment []
[updates: Bill, a wandering passer-by, has clued me in on the Billy Collins storm. It seems I have Garrison Keillor to thank for the referer storm. Welcome, Prairie Home Companion listeners! I am sorry I cannot help if you are looking for the text of the poem. Some quick links to an Ed Hirsch anecdote concerning the composition of “The Lanyard” and to the description of the Sunday night he read “The Lanyard” at the 2002 Dodge Poetry Festival.]
10:05:24 PM # comment []
A younker is a.... To wuzzle is to.... A baloo is a....
Those are the ones I remember. Anyone else? Google Sets doesn’t know them.
9:50:31 PM # comment []
Sasha and Ian, sitting in Kloe, K-I-S-S-I-N-G
[adapted from NewsRadio]
Jimmy James: I’m getting married.
Dave: Congratulations. Who’s the lucky woman?
JJ: I don’t know yet. Check this. I have a list of 36 marriageable women who meet my criteria of womanly virtues.
Catherine: You have a list? That’s the most degrading thing I’ve ever heard. [stomps off]
JJ: Check this. I have a list of 35 women.
Lisa Miller: By the way, Sasha Castel, la Blogatrice and danger girl extraordinaire, is getting married to Andrew Ian Dodge, a prominent London blogger.
Dave: Let’s lead off with that on the afternoon segment
JJ: [beat] A list of 34 women who meet my criteria.
8:51:23 PM # comment []
2:35:52 AM # comment []
Very approximately, coming second-hand:
Leno: I have a couple coming up from
Florida that have been married 75 years. Would you like to stay and meet them?
Gore: Of course!
Leno: Let's bring up [forgotten names]. Do you know Al Gore?
Man: Of course. He wasw always on television when he was a candidate. He was always in Florida.
[Shakes hands with Gore, they sit down].
Leno: Did you vote for him?
Man: No! [as if Leno had asked him if he liked kissing snakes. Leno and Gore smile frozen smiles]
11:31:19 PM # comment []
This could be you
Allan: Remember, whenever you start feeling polemical, how Alec Baldwin looks to you—quite insane. Think twice before posting that political piece.11:23:52 PM # comment []
[“The Art of Never Paying for a Meal” by Gersh Kuntzman New York Post by way of Elizabeth]
Holy cow! mouseover popup ads! The new wave of newfangled tear-out-your-eyes annoying.
11:42:51 PM # comment []
8:59:50 AM # comment []
On the Turnpike, with its undifferentiated traffic for the first several miles, I was stymied in my attempts at problem solving. That’s what keeps me awake when I am driving on little sleep, the constant interest of problem solving: how do I find a way to make the idiots in front of me join the idiots behind me? Stuck in traffic moving at exactly the same speeds all around me, I was weaving in my lane and just barely avoiding the nod-off of doom. Eventually the Turnpike bifurcated, traffic lessened, and I was fully awake. Or was it the Coca-Cola?
11:38:15 PM # comment []
11:17:03 PM # comment []
Kay declined to offer too many specifics about what exactly he'll do at HP labs. "They know what my agenda is going to be, I just haven't figured out which of the 50 ways make the most sense for HP," he said.Sounds like the contrary of what happened with Xerox. And Apple. And Disney. Sigh. Good luck, Alan! If you can cadge it out of them, a new generation of
12:00:58 PM # comment []
11:19:50 PM # comment []
[update: Paul helped me out with the accents, because I got every single one of them wrong! He also points out a scrumptious site.]
11:16:12 PM # comment []
10:35:25 PM # comment []
10:23:20 PM # comment []
Fancies on a Referer I
Someone must be desperate to find Weldon Kees material: though I am 158th in the Yahoo! Search Results for the man, someone thought it worth coming by.As it so happens, I happen to have brought my Donald Justice-edited (1975) compilation of Kees’s poetry with me to this dreary Philadelphia Adam’s Mark. Hm. If you’ve heard of Kees at all, you probably know “Round” and perhaps the Robinson poems, “For My Daughter” is also oft-anthologized. Um. How about this short piece:
Colloquy In the broken light, in owl weather,Webs on the lawn where the leaves end, I took the thin moon and the sky for cover To pick the cat’s brains and descend A weedy hill. I found him groveling Inside the summerhouse, a shadowed bulge, Furred and somnolent.—“I bring,” I said, “besides this dish of liver, and an edge Of cheese, the customary torments, And the usual wonder why we live At all, and why the world thins out and perishes As it has done for me, sieved As I am toward silences. Where Are we now? Do we know anything?” —Now, on another night, his look endures. “Give me the dish,” he said. I had his answer, wise as yours. |
Not quite representative of his work, but wholly within his “apocalyptic” attitude, I believe it has been called. Where Dobyns looks at the world in the same weary way, he always has a smile for it; where Kees looks, there is only wide-eyed witness.
Then again, it may be Kees himself, tired of life in Mexico (to which he of course retired after faking his suicide), wondering if life in America has changed since he left, or if he is remembered. If it is you, come back, come back! America hasn’t changed, but you knew that, even as you know that the language calls back to you, even if the music and the art do not.
10:06:51 PM # comment []
6:24:50 PM # comment []
Re-reading Kent Beck, actually two Kent Becks, the Guide to Better... and the ...Best Practice Patterns books, as well as an old favorite, McConnell’s Code Complete. Well, not reading, obviously, so much as skimming back and forth and trying to build connections. Book surfing.
9:45:35 PM # comment []
Enter your blog's URL and this search engine recommends others you might like.Something’s wrong with Liz’s permalinks.
6:36:06 PM # comment []
What was the paper about?...except one...
It was about Chinatown, and the formation of Chinatowns in America. I lost like three pages of it; it was terrible. It was a really, really good paper.
zach frechette ’04 forgot to ask if ellen knows janie porche’s phone number.[Zach Frechette and Ellen Feiss by way of the post-]
1:03:41 PM # comment []
8:38:11 AM # comment []
Quick, Allan Baruz, “...or perhaps double dactyls. |
Quite a feat, Paul!
1:08:46 AM # comment []
On the Importance of Maintaining a Stable Population of Nerds
| It’s like the Germans after World War II kept saying, “Oh, ve vere dat close to the atom bomb and vinning the var.” Yes, you were... and then you killed all your nerds. |
Late Show with David Letterman
12:41:20 AM # comment []
To satisfy you good searchers who don’t care about the readings set list (linked on the Incomplete Index to the right), I have an anecdote. Setup: apparently Collins had read it in a panel or during his reading or both the Friday before, and people were all abuzz about it on Saturday morning when Edward Hirsch was speaking on craft. Edward Hirsch is a large man with white hair and an imposing Jewish nose and laughing eyes: very personable, with a keen sense of the audience, and ready to switch gears and talk seriously about craft, going in a swift transition from avuncular to philosophical...
In the panel yesterday, you were sitting with Billy Collins. Could you speak to revision, vis a vis Collins’s “Lanyard?”...and back again....Billy Collins’s approach is opposed to Valéry’s, who thought of the poem as a created artifiact, and follows Frank O’Hara. If it doesn’t come out right the first time, it’s not worth revising. Of course, reading a lot of O’Hara, you realize that there is a lot of crap. [Leaning conspiratorially to the audience:] Maybe Billy Collins can always do it right the first time. Maybe he’s lying.
11:24:37 PM # comment []
Guard: Lunchtime!
Me: Lunch always brightens up a day.
Guard: [digging into a hoagie] Even if it’s bad for you.
Me: [skulking away clutching my chocolate-covered almonds] Especially if it’s bad for you!
10:38:13 PM # comment []
I informed him that I was allowed to hit him and he couldn't strike back because it was his fault I hit him in the first place. [The Ville]
11:48:04 PM # comment []
Also, Charles Miller shows us how it’s done.
11:28:30 PM # comment []
[ps: Thinking of the more positive side to this, perhaps the combined might of the Genius Bar will be able to keep your setup going, eh? (I am so going to blog hell.)]
11:55:55 PM # comment []
11:29:51 PM # comment []
12:13:49 AM # comment []
11:34:48 PM # comment []
| "God will not suffer man to have the knowledge of things to come; for if he had prescience
of his prosperity he would be careless; and understanding of his adversity he would be senseless."
|
| You are Augustine! You love to study tough issues and don't mind it if you lose sleep over them. Everyone loves you and wants to talk to you and hear your views, you even get things like "nice debating with you." Yep, you are super smart, even if you are still trying to figure it all out. You're also very honest, something people admire, even when you do stupid things. |
What theologian are you?
A creation of Henderson
[by way of Sasha Castel]
11:01:06 PM # comment []
10:59:44 PM # comment []
11:59:05 PM # comment []
My usual experience of fear is in response to more internal events, like crises of conscience, or of having done badly. I tend to have dreams of fear of having missed all my college classes for a course for which I have an imminent test, usually a class I would not even have dreamed of taking lo these many years ago.
Between loooong naps trying to read Harry E. Chambers’s Effective Communication Skills: For scientific and technical professionals, a book that has been on my shelf for five months but has steadfastly refused to become appetizing to me. Still I’m sure it’s worth a read.
12:26:00 AM # comment []
Good news though is that my work is finally letting unused vacation days carry over the calendar year, instead of paying them off. I would have liked to have done this last year and seen my grandfather before he died, though no one would have liked it if I had done this for three weeks (what I consider the minimum for visiting the Philippines, one week to adjust to the time change, one week to adjust back, leaves you one week where you actually start enjoying being there). They wanted to put me on call for the third week on vacation, which is a bad condition to place on a vacation. Now that I have a great deal of vacation time, I have no reason to use it that I can think of save to go on sabbatical. No place on earth seems interesting to me at this time.
Perhaps subconsciously I unjustly blame my company for my not having seen my grandfather, though when I usually think about it, it all seems a confluence of bad events with 11 September and all having put the fright of flight into everyone. I don’t think I cared about the danger, but then again I am in general unaware of my visceral feelings, which is why I am so often surprised to find myself sweating and shaking with hunger for having forgotten to eat and why it took so long for me to realize that eating a lot of cheese pizza or ice cream gives me dandruff. So maybe I am blaming them without realizing it. During the Los Angeles riots, when the resident house faculty advisor and her boyfriend were driving us out of the city, she asked me how I felt, and I had to make up an answer. I still can’t connect or attach a feeling of visceral fear to external events.
My grandfather died around this time last year. He was much on my mind 2 November, the first All Soul’s Day since.
Fended off a visit from Yen, pleading a disgusting cough.
11:58:26 PM # comment []
3:04:46 AM # comment []
6:52:43 AM # comment []
But I did figure out why my updates are taking so long; Radio Userland is re-publishing my site yet again. I was toying around with Paolo’s how-to on putting RUL on a dotMac disk (yes I’m a sucker), but switched back. So now RUL is upstreaming each and every file over a 24000 bps connection. Ble-ach. I want a modern hotel. Need the broadband, gotta have it.
12:25:47 AM # comment []
How about this:
Dealer: Okay, this game is Hoboken Hold ’em. Ante up!
What’s the ante again?
Dealer: One post pointing to my blog.
Um, okay. (Chips clatter)
Deal.
Dealer: Marybu gets a six (6d), File not found gets a three (3h), Paul’s got four clubs (4c), Mr Fat Guy has a six (6c), Allan’s got a deuce (2c)...
Who shuffled this trash?
Down in front! ...and Raven’s got a three of diamonds. Bets?
Pass.
Nuh-uh.
Um, one day dedicated to the wonders of my dog.
I’ll raise: one pointer to Jacko’s photo.
Eeew.
Too rich for my blood.
Dealer: Remember, you lose your antes...point to my blog!
Oh, all right. [by way of Illuminated Donkey]
11:53:53 PM # comment []
You Will Be Watched Scary stuff's a-comin' if some people get their way. The Homeland Security Act contains a section that will allow the government to track you- from your grades, to your credit card purchases, to your email. Scary! [Zeebahtronic]
You mean they can’t do that already? Whew. Time to rent some pr0n.
11:34:51 PM # comment []
11:36:29 PM # comment []
Or it could be that he’s paranoid, which is feeding into my (well-known) paranoia. I never quite sussed that out.
11:22:39 PM # comment []
10:48:54 PM # comment []
8:19:25 PM # comment []
Ugh.
10:42:33 PM # comment []
11:59:34 PM # comment []
While on the subject of Tori Amos, one thing about my (second) cousin Nina whose wedding I attended a few weeks ago. Her first dance with her husband was to a Tori Amos piano piece, a cover of Led Zeppelin. How cool is that?
10:31:09 PM # comment []
Of course within five minutes of walking in I spot three things I. Want. Now. Yet resisted the temptation, but how long can I hold out?
4:45:06 PM # comment []
Sidebar notes on losing my site history
Whoa! Sometime in the last several days, Radio Userland re-published the whole site! Each and every post, which means the nice template I was using in the springtime and early summer are gone (radio.weblogs.com is a static site, so previously those posts had been rendered permanently in the template that I had at the time, I nice blue one, even as I changed my links and RUL dropped my template), and I lost some sense of the history of how my sidebar links have grown. So I will have to do it by memory. Happy Tutor of Wealth Bon-da-ge first pointed me out when I commented on anonymity, and gave me a full sidebar link; I linked back to him once I figured out how to do the sidebar thing, but as WB, which got me some strange hits. Happy T has a great deal of hits on his site, but those who arrive usually don’t care to follow the sidebar links, sigh. Graham Leuschke pointed to me as well on seeing WB’s post, but only in a daily post, no sidebar. Jim of Objectionable Content pointed out my blog after Blogapalooza, and often comments. Paul Frankenstein and Ravenwolf may have done the same, or right after Paul’s own turn to host the NY Blogger party, BABB3. Aaron Haspel, Sasha La Blogatrice Castel, Zeebahtronic’s Liz, Ken Goldstein, and Hands Free pointed to me after BABB3, definitely. Liz permalinked me, and Ken had a semi-permanent special sidebar edition in which I was one of the BABB3rs featured. Goliard Dream’s pinax started commenting in my blog, then permalinked me.Those who cared to comment started with Charles Hornbell, who sympathized with my tire troubles going to Philadelphia. Mobius One of the44 commented after I linked to his coverage of the Dodge Poetry Festival. Pinax also commented, but was later promoted, as I said earlier. Bill Hayduk commented recently but I missed it until recently, whereupon I had an editorial crisis as to linking all commenters and yet not linking to where I work while explicitly disclaiming any relation of this blog to work or clients. But he commented, and I resolved it as you see to the side.
Doc Weevil linked to me in a set of photographs not well publicized from Blogapalooza, but doesn’t read me very often, as far as I can tell, though I try to keep up. Megan McArdle doesn’t link me, but as her travails not four blocks from where I beach when not on site was an inspiration, Live from WTC stays there. Always been a fan of Neil Gaiman since my RA introduced me to Sandman when I was at University of Southern California. RXC is a column I regularly read. I would put Instapundit there, but then I’d never get anything done. As you can see, Smart people is where I eventually put people who would never link to me normally.
Roland Tanglao and Jenny the Shifted Librarian have their news aggregators attuned to many hundreds of RSS sources, so they have their fingers to the pulses of geeky technology and information storage/copyright issues, respectively—that is, when Jenny’s Radio installation is working. She actually posted me, once, concerning my contention that loose copyright enforcement led to the freedom of the slaves in America. Everyone knows BoingBoing, and many of y’all know A & L Daily.
Too tired. Links later.
4:39:13 PM # comment []
4:07:04 PM # comment []
2:59:57 AM # comment []
12:32:30 AM # comment []
Your blogger, ripping off content for fun and, um, profit?
Dan Rydell: The story is, we had a conversation, seriously. Someone had clearly briefed her on my stuff with the public schools, and I told her about my opposition to secular programs that are publicly financed, I really spoke up and she seemed to listen.Casey McCall: You mean nonsecular.
[beat] What do you mean?
You don’t oppose secular programs that are publicly financed, you oppose nonsecular programs that are publicly financed.
[beat] Yes.
Go on.
Wait.
I’m right.
You’re sure?
Nonsecular means, “bound to religious guidelines.” Secular means, “free of religion.”
[Thinking] Okay. I’m sure I got it right at breakfast.
Uh huh, 50/50 chance. [Sits down, sighs] So go on.
[Abstracted] I’m gonna go... I’m going to change my clothes. [drops clothes] I didn’t get it right.
I know.
I blew it.
Yes.
I mixed up. I inverted the definitions of secular and nonsecular.
Looks like that might be the case.
Hillary Clinton thinks I’m an idiot.
Either that or a religious bigot.
I went to an Ivy League school, Casey.
Proud day for Dartmouth, Dan.
I made an idiot of myself in front of Hillary Clinton.
Yeah, but at least you had to spend a thousand bucks to do it.
[Sighs] Well, clearly I have to get in touch with her.
Clearly.
I need her to know that I know the difference between secular and nonsecular.
You don’t know the difference between secular and nonsecular.
Yeah, but I do now and I should’ve then. I have to call her.
At this point I’d say it’s a moral imperative.
I’ll call her hotel.
They’ll put you right through.
I’m not saying it’s not going to take perseverance, but I’m going to make contact with this woman.
Good luck.
Thank you.
“When something wicked this way comes,” Sports Night
*Technically secular means “worldly.” You can have a secular priest*: one who goes out and preaches among the people, instead of living the monastic life. This has been extended to any priest not a member of a religious order. One of the sources of discontent with the Spanish regime in the Philippines was the limited opportunities for the native* priests, who were typically trained in the secular tradition, while the priests that administered Masses and received parishes were typically Spanish priests from the religious orders.
*At the time, the term “Filipinos” referred to the descendants of the Spanish colonizers; the indigenous Malay peoples were referred to as indios and their regional affiliation*, such as: indios tagalog, indios visayan, etc. Another source of discontent.
*I actually got into an argument on Moxie’s site because of this. I pointed out that Bible classes are by definition nonsecular. Someone jumped all over me writing that secular also applies to priests, pointing out a dictionary definition. I kindly refained from unleashing my thoughts on his or her ignorance, then pointed out to Moxie that she probably meant non-sectarian Bible study class. People who make silly judgments in writing about other people on the basis of dictionary definitions without the benefits of real knowledge of how the word actually is used deserve all that you can give them, but I just don’t have the energy sometimes.
*I myself am the son of a Cebuano and a Tarlaqueño Kapampangan, born in Roosevelt Hospital, so I suppose I do fit in Ravenwolf’s New York Bloggers blogroll*.
[update: whoops, messed up Doc Weevil’s link. There it is. Also some spelling corrections.]
11:55:39 PM # comment []
Now how I wish I had some chick to talk to—I’m in an awful way.
11:48:51 PM # comment []
“One must write as if one were already dead.” —Nadine Gordimer
in an interview on NPR,
as quoted by Stephen Dobyns, “Voices One Listens To,”
Best Words, Best Order
11:02:52 PM # comment []
10:41:48 PM # comment []
Hella Annoying!
My California cousins keep saying “hella” for “extremely” or “very,” a practice I found disconcerting when I last visited them—in between nineteen-hour days at HP—two years ago and found mildly amusing last month at Monica’s wedding. No one they know outside of California uses it; I don’t hear it in California outside of their circle; the only public braodcast I’ve heard it in is one episode of South Park, where the other kids were on the verge of beating up Eric Cartman for using it. I don’t know of any Britney, Aguilera, N’Sync, rap, hiphop, or R&B song that uses it. And they use it anyway.10:38:54 PM # comment []
8:52:33 PM # comment []
11:19AM up 26 days, 18:02, 6 users, load averages: 3.73, 4.90, 5.26
11:20:05 AM # comment []
12:18:01 AM # comment []
11:48:18 PM # comment []
Either that or she’s too busy stuffing the ballot box for the blue-collar snob over at Daily Pundit’s blood-hungry warmonger poll. She is after all, not immune to this. I’ve done my part for Nick, Raven! Don’t hurt me!
Not that I have been any great shakes lately in the consistency department, having missed two days in the last two months.
12:07:13 AM # comment []
“Big win for the Republicans. They say that the Democrats lost because they could not articulate a message. ‘Could not articulate a message.’ You know you’re in trouble if you’ve been out-articulated by George W. Bush.”—David Letterman
11:42:37 PM # comment []
11:31:20 PM # comment []
A Googling for “i cannot find crap about spain”. Um. You’re supposed to put search terms you’re interested in into the little Google box. You’re not supposed to talk to it, darling. It will disgorge a number of results, but it can’t answer you.
11:26:50 PM # comment []
11:02:40 PM # comment []
11:53:53 PM # comment []
11:11:22 PM # comment []
"...Is it lawful for us to give tribute to Caesar, or not?"But he perceived their craftiness, and said to them,
"Show me a coin. Whose likeness and inscription has it?" They said, "Caesar's."
He said to them, "Then render to Caesar the things that are Caesar's, and to God the things that are God's." [Jesus, by way of Luke]
In whose likeness am I stamped? Who has inscribed His Word on my heart?
For a Catholic, it is not a privilege to vote, but a duty, just as it is a duty to obey the law and pay taxes (ugh!). It is a moral obligation that one must perform, even if it is only to vote for the lesser of two evils, to try to bring about the least objectionable outcome.
Having done my bounden duty, knowing it is futile in the state where I live, still I had to add my voice, especially for those without a voice.
11:04:48 PM # comment []
I think the time is correct now. I leave network time off when on site because I believe they block outside NTP ports for some reason. Must have been fiddling with the time in the meanwhile, but twelve hours off? I hope I don’t have to exercise that APP this soon. Then again, it would be nice to exercise it, considering that that’s the only thing I got for the $350 I spent, as I already have the complimentary TechTool.
So even though it looks like no bloggage for yesterday, really there was.
10:59:13 PM # comment []
Next time, young feller, do your homework earlier at night! And check the Google caches if it’s not on the front page.
12:02:42 PM # comment []
Big smile. Silence. Er? Turn to other conversers to try to see if they said anything important while your own attempt to break away went nowhere; they’re still inanely chatting about how they want to annex Israel as the fifty-first state. Pfft. Look up wondering, is she still giving me a blank stare? Yep. Still giving him a blank stare.
Well, she was certainly not admiring my meager readership (quantity, I mean, not quality; I would take you guys over any four-fifths of the [um, name really big blog here] readership, I swear I would). So I imagine she must have been admiring the free beer I won.
11:50:49 AM # comment []
10:45:06 PM # comment []

[Portland, by way of Steven Frank]
11:19:42 PM # comment []
I know because I am struggling to register its APP before the end of the one-year cutoff. No go.
:.(
On a brighter note, OmniWeb seems to be picking up the Userland control for text editing, which Navigator does not. On a not-so-bright note, OW is still much slower than Chimera.
8:57:28 PM # comment []
Mike is having problems with his G3 PowerBook (WallStreet). He thinks it’s his CPU card. I had trouble with OS X running on my Lombard because of a trickily jiggered RAM slot, myself, but it also froze up my OS 9 as well at times.
Paul has changed his domain and is writing a novel. I feel like giving him some constructive criticism, but perhaps it’s too early. I am still working on the sidebar link, but clicking this one above should be no problem.
Ken’s gone fishin’, which may or may not be secret code for moving house.
Happy Tutor seems to be on a Catholic jag, no doubt brought on by All Hallow’s Vespers, Matins, Lauds, Prime, Terce, et cetera.
Pinax (pinax?) has enough time on her hands to make me throw my hands up in despair. As Joshua Halberstam points out, and Aaron Haspel has been noting, my word-envy is reserved for attainable goals, like the 25k Bookworm word Mr. Frankenstein got. I can only shake my head in wonderment and resignation. Well, that, and throw my hands up in despair, as I was saying earlier.
8:29:37 PM # comment []
a _ [ :x | x isValidLuhn] . b _ [ :x | x isValidLuhn2]. interval _ (50000000000 to: 50000010000).
Time millisecondsToRun: [interval select: a] 18071
Time millisecondsToRun: [interval select: b] 28953
After tinkering around with both algorithms, I realized that keeping a running total is much faster. An even greater speed improvement is achieved by converting the ASCII character to its corresponding integer then subtracting 48, rather than converting to a string then converting the string to a number. So instead of aDigit asString asNumber, doing aDigit asInteger - 48 does better:
Time millisecondsToRun: [interval select: f] 4768
The naive implementation is easier to read, but three to four times less efficient, as it conses up a string from a character. Using (aDigit asInteger - $0 asInteger) might be a slightly more readable compromise. It seems like using a dynamically allocated Collection of any sort seems to be very bad for performance.
Combining the mapped doubled add-the-digits approach with the accumulator approach:
Integer>>isValidLuhn8
| stream accOdd accEven anEven doubleMap | accOdd _ accEven _ 0. stream _ ReadStream on: self asString reverse. doubleMap _ #(0 2 4 6 8 1 3 5 7 9 ). [stream atEnd] whileFalse: [accOdd _ accOdd + stream next asInteger - $0 asInteger. anEven _ stream next. anEven ifNotNil: [accEven _ accEven + (doubleMap at: anEven asInteger - $0 asInteger + 1)]]. ^ accOdd + accEven \ 10 = 0
...seems to yield really good performance (3.5 to 5.5 seconds for 10001 operations) on average, while being only slightly incomprehensible.
11:01:47 AM # comment []
I tested the implementation against those, then another:
Integer>>isValidLuhn2
| str accOdd accEven anEven | str := ReadStream on: self asString reverse. accOdd := Bag new. accEven := Bag new. [str atEnd] whileFalse: [accOdd add: str next asString asNumber. anEven := str next. anEven ifNotNil: [accEven add: anEven asString asNumber]]. ^ accOdd sum + (accEven inject: 0 into: [:x :y | (#(0 2 4 6 8 1 3 5 7 9 ) at: y + 1) + x]) \ 10 = 0
12:41:32 AM # comment []
Integer>>isValidLuhn
| str accOdd accEven anEven | accOdd _ accEven _ 0. str _ ReadStream on: self asString reverse. [str atEnd] whileFalse: [accOdd _ accOdd + str next asString asNumber. anEven _ str next. anEven ifNotNil: [anEven _ anEven asString asNumber * 2. anEven > 9 ifTrue: [anEven _ anEven - 9]. accEven _ accEven + anEven]]. ^ accOdd + accEven \ 10 = 0
[update: Whoops. I was using a stripped image (the image I use for my Comanche Swiki), so all the variable names were lost, so I replaced them. The underscore is the keyboard key used for the assignment operator, which in Squeak images renders as a left-pointing arrow. The caret sign is an up arrow and returns from the function.
update: There must be a better implementation, probably using #inject:into:. The implementation above streams through the digits of the integer, accumulating the odd and even digits alternately.
update: I don’t know why the algorithm description insists on adding the digits of the doubled even-positioned digits; it seems to me that the digit-added property holds true even if you add the doubled digits together after, instead of at each step. That is, 35 + 11 and 8 + 2 both ultimately equal one. I don’t remember what this property is called. If that is the case, the implementation above could be simplified to something like, um, oh, wait, never mind. Sequence of actions is important. Never mind.
update: I originally pasted in the file-in version, but I thought if I presented as it is presented in Kent Beck, it would be less scary. Smalltalk really is a pretty language.
update: Whoops, more Smalltalk implementations just popped into my head: here and here.]
10:06:50 PM # comment []
Good design...
- ...is simple
- ...is timeless
- ...solves the right problem
- ...is suggestive
- ...is often slightly funny
- ...is hard
- ...looks easy
- ...uses symmetry
- ...resembles nature
- ...is redesign
- ...can copy
- ...is often strange
- ...happens in chunks
- ...is often daring
9:21:47 PM # comment []
Coercion and manipulation—force and fraud—are the basis of comedy or so I read somewhere, perhaps Maurice Charney? Or not. Anyway, if that is the case, then perhaps the exploration of authority and how characters relate to it is the basis of tragedy?
Quick examples: Hamlet—yes; the Œdipus plays, yes; Romeo and Juliet—yes. Any counterexamples?
Hm. Something to think on.
Although, come to think of it, there is proper, condign, acknowledged power—authority—in comedy, as well. Midsummer Night’s Dream. But in such plays as those proper authority is subverted by force or fraud: say, by pixie dust in the eyes and a merry Robin Goodfellow. Twelfth Night has an authoritative power who is brought low by the power of love; its exercise never comes up. The hijinx occur due to fraud (cross-dressing, ghostwritten letters) and force (bullying and mockery).
Tragedy seems to depend on some defiance or loss of authority. One thinks of one of the progenitors of the form, Prometheus Bound. In Romeo and Juliet the two warring families defy the Prince. Or perhaps tragedy originates in the violation of authority, where something is wrong with the natural order, and people try to put it right: Hamlet. Or there is a conflict between the exercise of authoritative power and the natural order: Elektra.
9:20:49 PM # comment []
12:54:56 AM # comment []
Copyright 2003 R Allan Baruz
Theme Design by Bryan Bell