Sunday, October 24, 2004

What Yesterday Taught Me

In last night's game the action was too fast and furious to keep up with.

Text Editing

Somehow, isn't that the way these things always happen -- somehow, I made a mistake on the Cards-Sox page in the HTML, the mark-up language of the web. This experience brings me to my next idea: how to make text editing work better, if not less error-prone. And while we're at it, my hidden agenda is always to discover ever more generalizations: in text, programming, editing, human expression. This is a step in that general direction.

I'm a fan of the macro programming language m4, which allows a writer to re-use frequently repeated runs of text. Here's a Google search of m4. Often, in situtations like this, editing on-line content, there is quite a bit of "dark matter" to provide the gravity to hold the product together and provide it's structure. You know, the paragraphs, lists, headings, even the images.

M4 is a handy tool to capture and re-use the repeated text, seen or un-seen in the case of HTML. The world is moving on from "batch" and "compile" environments, where some jobs are done ahead of time, and now moving to "just-in-time" delivery of the goods and services. I'm thinking that's appropriate here too. The web already has a good deal of timely information, much of it in on-line shopping, using databases with concurrent processes, locks, semaphores. All the recent software innovation is well used. My target is a little narrower. It's us.

As we sit here in our web logs, typing away. Somewhere below the words is the structure. I for one, would like to capture that in a useful way. To get an idea of the problem, select yesterday's Cards-Sox entry and try to make some sense out of the HTML. It's not worth my time in it's current shape. But, I've previously used m4 to format web pages on my own, and would like to bring it into this process, the on-line publishing. As I edit this very page, in addition to the "preview" option, I've an "Edit HTML" and "Compose" tab. Most of the time, I'm composing. Occasionally, I like to see the real stuff, and switch to the HTML view. To make this work, I'm proposing to get the macro-processing out of the batch, pre-compile mode, and work it in to the editor. My waking thought this morning was maybe there's an emacs mode in this, though I think that will be stretching.

A Macro Tool

Here's what I'm talking about, requirements-wise (sort of):
  • capturing repeated text, both identical, and patterns with arguments,
  • install in a client-server model, which means remove it from a pre-compile or batch process
  • support functional, procedural languages, to the possible omission of Object-Oriented languages
  • moving personal communications into the web (relying on someone else's server for backup data security.. This may need to be examined in detail)
This was where my thinking was yesterday morning. Yesterday was a day of great awakening for me, returning to this Web log, blogger.com. I opened up this web log, Three Martinis for reasons you can see below. In the process, I've had some of my preconceived ideas challenged as to the value of this medium. Recently a critic, I'm now a convert. Probably for the opportunity to ramble on, if not make an occasional point. The experience of Cards-Sox leads me to these conclusions (sort of an implementation):
  • The macro-processor belongs in the "keystroke interpreter" portion of the process
  • It communicates with the file store using stored templates and a view of the edited product.
  • It is stateful, either in a discovery mode or user dialogue. Think of the simple text-completion tools on browsers as already-existing example of this process
  • Users may, like the editor for this web log, see a Compose mode, or an HTML (e.g.) mode, or an editor mode. The latter shows the structure in a raw sense, regardless of the target language.
My view of how this works is also informed by the workings of emacs. Each keystroke is interpreted as you type. Emacs is stateless in that sense, or it may be thought of as one big state machine, where each keystroke takes you to a possibly different state. In emacs case, the default state (or action) is to insert the just-typed character at the point in the buffer, and move the point. But note the action when you are searching for text. My copy of emacs highlights the visible text fragments that match the search criteria. The cursor moves to the first matching string beyond the current point.

Applications

The constraints on generalization are easy to imagine. If one has a large amount of text to re-use, such as legal boiler plate, frequently you see phrases such as "John Doe, hereafter referred to as the Party of the First Part (PFP)". This is an example of a request by the writer to make you, the reader perform the necessary substitution as a mental exercise. Where the text is considerable, and there are but a few values to substitute, but possibly many places to perform the substitution, it is quite cost-effective to capture the boiler plate and insert the few instances of the repeated text. Form-letter, or mail-merge software is an example of this use. If you think how these are used, they are still batch processes. In truth, for such large amounts of text, the process is likely to remain a batch. Think of the job: "Fred, call up the contract and insert Grace Jones as the 2nd supplier". As the amount of text to re-use decreases, unless it's a tightly controlled legal requirement, it is frequently easier to simply re-type it, as the overhead of accessing it, and bringing it into contact with the specific information is greater than the re-typing. It's for each application, based on re-use patterns, to determine what is the lower threshold on size of re-use pattern.

So, I'm imagining a world where re-used patterns are marketed, again imposing a threshold, but since it's economic, the costs and benefits may be weighed. Imagine this: you're typing, and you're informed by your editor there is an applicable text pattern for your use. You see a copy of your work, a copy of the text pattern, and an insertable template, which you may select. The first application is for those of us who teach, and defend against plagiarism. I needn't describe the scenario.

Three Martinis

In the mid-'70s, while a paid programmer for NORAD, I observed events which inform the ideas behind Three Martinis. With a personal suffix of "third", namely MMIII, the number three has especial significance to me. Working on my software, I had to program an interface to some system software, the Man-Machine Interface, or MMI, as it was known. After a few months, there was a sufficiently useful MMI document, and lo and behold, it worked as advertised. The interaction was pretty lo-level for the Fortran IV most of us orbital mechanics used, but no problem. I was working my way through one, then two separate interfaces to this software. All was going well. Then, when I started an interface to a third module, I got the rather bright idea of generalizing this for all three modules, as the code was looking quite similar. It's worth noting the programming means was a batch card deck. (Or coding sheets for those who couldn't type). Of course this interface worked. It was all my software. As an aside, when I proposed this for the general library, I had to put it before the committee, and was rejected with the notion that "you're an applications programmer, not a systems programmer". That non-technical rejection proved the necessity of my interfacing module. I was able to shop it around to the group of ten I worked with. It didn't make the public library.

So, why three. For any number of years, I've had the occasion to repeat:

My threshold of pain is three.

Three of what? Three of anything. The number of applications for the principal that the third one is redundant (oops) is considerable. In software, there are readers and writers, clients and servers, processes and data, ... the list goes on. We are conditioned to think of binary as something fundamental. It seems if one is doing something for the third time, you haven't discovered the appropriate generality. Such was the case with the NORAD MMI. If you have written two instances of a piece of code, and only two, the odds are good you'll need no more. But if you cross the two-three threshold, the need is likely to continue indefinitely. That's the time to generalize.

Leaving for another day, is generality always better?





Saturday, October 23, 2004

Sox - Cards

It's Satuhday night, Octobah 23, 2004. In a re-run of history, the sahwcks ah hosting the cahds at Fenway pahk. Tim Wakefield has just retyahd three of the fuhst foah cahds, Larry Wakuh dublin' intah the right field cahnah.

While you are all watching the game, I think I'll browse the web for baseball score keeping software. I'd seen some things for the Palm, after having taken in Tony Gwynn's last trip to the Vet in Philly a couple of summers ago. For you drive-by readers, it's sort of mandated that the McGowan boys are baseball fans. To wit. Most of you think Cal Ripken broke Lou Gehrig's consecutive game record. What record? Here's a question: prior to Cal Ripken, who appeared on-field in the most consecutive major league games. Here the "on-field" is both a clue, and a defense against those of you who might guess "the organist", the "grounds-keeper", ... any number of other ruses. Well good fans, the answer is "Cal Ripken broke Bill
McGowan's record
"

While the URL was linking, David Ortiz just put the Sox up 3-0 with a blast to right field.

The inning ended 4-0 after a double and RBI single.

While they do a beer commercial, here's the Google for

Bill McGowan Umpire.


And while we're off the subject, did you notice the verb "Google". It's been happening for as long as English has been spoken, turning nouns into verbs. Before Kinkos got merged into Fedex, or whomever, they invented the verb "to office". This so thoroughly disturbed the Martini maker, he was incensed enough to do the nasty:
he verbed the last noun. "To verb" (v), as in "we've verbed the last noun!"

Wakefield is throwing 57' strikes! The Cards are up to their small ball. They've got runners on 2nd and 3rd, one out after a bunt! Good stuff, Vince (my brother Vinny, a Cards fan!)

Metheny sac fly: 4-1. (Tim McCarver, former Cards catcher with the call). Thats it for the Top of Two.

Belhorn led off the bottom of two with a single to left. Next batter out somewhere. Cabrera lines out to Taguchi in left. Manny Ramirez singled and was stranded. Still 4-1 Boston. Here's the scorebook software, Baseball Scorebook. Two complete at 9:02.

Larry Walker just homered into the right field corner: 4-2! That's six total bases for Walker. Pujols just got HBP and is on first. After checking on the eggplant parm (my soul), the score is still 4-2.

bottom of 3:

  • Bill Mueller(sp?) , full-count walk.
  • Mirabelli, Doug, C. singles off the wall. It's 1st,3rd -- out out.
  • Mark Belhorn, 2b lashed a 3-1 foul by inches, walks to load 'em up.
  • Johnny Damon, (bases loaded!) singles, one RBI, 5-2 Sox. (here comes Toni LaRusso, and a beer commercial, lets check the eggplant) Reliever: Dan Herron

  • Cabrera singles, RBI 6-2
  • Manny Ramirez, FC: Rentoria (6) to Womack (4), 7-2. RBI
  • David Ortiz, BB, on 4 pitches
  • Kevin Millar, 6-3
  • Score 7-2, 9:33PM
4th Inning, Cards:

  • Jim Edmonds (3-1) BB, PB to second
  • Sanders (3-0) BB (runners on 1st and 2nd)
  • Womack (3-1) BB (bases loaded)
  • Metheny (3-2,1) F9 (sac) , E3, Sanders, Womack 3rd 7-4
  • Taguchi () 5-3, Womack scores 7-5
  • Edgar Rentaria (3-1), BB. RELIEVER for Wakfield:
  • Larry Walker () 1B, first and third, TWO out.
  • Albert Pujols (2-1) FC, 6-4
  • 7-5; 9:52
Sox:
(pardon the rather formulaic bullet lists, as we watch the game)

  • Trott Nixon (3-2,4) BB

  • Mueller (3-2,1) BB, first and 2nd, none out.
  • Mirabelli () F7, one out
  • Bellhorn (1-0) F9, two out
  • Damon (2-2) F7
  • 7-5: 10:06
5th Inning:

  • Rollen, F [1]
  • Edmonds (x-2) K
  • Sanders (2-2) K
  • 7-5, 10:14
Sox:

  • Cabrera (1-2) 6-3 [1]

  • Ramirez (2-0) 1B, off the Ump in left field
  • Ortiz (2-2) F7 [2]
  • Millar (1-2,1) 5-3 [3]
7-5, 10:25

6th Inning --
brought to you by KWAX-FM, 91.1, University of Oregon
Cards:

  • Womack(2-0) F9 [1]
  • Metheny (0-2,1) K [2]
  • Taguchi (0-2,1) 1B, E1T, to 2nd,
  • Rentaria (2-2) "four breaking balls in a row" -- McCarver; 2B, RBI, 7-6
  • Walker () 2B, RBI 7-7, tim buck, "1017 post-season games, no one has hit for the cycle"

  • Pujols (2-2) K [3]
7-7; 10:38

Sox:

  • Nixon (3-1) 1-3 [1]; "it's getting colder" -- Chris ...

  • Mueller (3-2,1) F8 [2];

  • Veratek {ph} (1-2,1) K [3]. with the announcers questioning inserting Veratak at this point, I'd have to say it's the Cards' game now.
7-7; 10:46


7th Inning


Mike Timlin for the Sox


Cards:


  • Rolen (1-2) F8 [1]
  • Edmonds () F7 [2]
  • Sanders (1-0) 1-3 [3]

7-7; 10:52


As we listen to a winner of a Fox talent contest demonstrate why TV is the vast wastland. Kelly Clarkson by name is attempting "God Bless America". Bless you, Kate. Kelly probably looks _great_ on the tube on a managed stage. From my seat across the room, it sounds like she missed 40% of her notes, but got the vibratto and Nashville sounds down. Oh woe!


Sox: facing Kiiko Calero


  • Belhorn (3-1) BB; to second on Damon, scores on Ramirez,
  • Damon (1-2) 4-3 [1]
  • Cabrera (3-1) BB, to third on Ramirez, scores on Ortiz
  • Ramirez (1-0) 1B, RBI 8-7, might have been picked off first, but a poor throw by Edmonds, with no one covering first, allows Ramirez to slide back.
  • Ortiz () 1B, RBI 9-7
    • Relief pitcher: King

  • Millar (1-2,2) FL2 [2]
  • Relief: Cal Eldred

    Gabe Kapler {ph} (2-2) K [3]

  • Cedeno (2-1) 1B,
  • scores on Walker
    • Relief pitcher:Keith Folke

  • Rentaria (2-2,1) 1B, E7
  • 9-8

  • Walker (2-2) E7
  • 9-9
  • Pujols (3-0) BB intentional loads the bases
  • ?() F5 [2] infield Fly
    9-9; 11:47

  • Bellhorn (1-2) HR into RF corner, 2 RBI,
  • 11-9
  • Damon (0-1) F6 [2]
  • Cabrera (1-2) 5-3 [3]


  • 11-9; 11:58



    9th inning:

    Cards: Reese at 2nd

  • Anderson (3-2,1) 2B to left field corner;

    • Molina (0-2) F3 [2]
    • Cedeno (0-2) K [3]


    FINAL: Sox, 11-9, 12:09 a.m
    .

    The play of the game is Bellhorn's 2 run home run and Keith Folke's inning(s) of relief.
    The game one winner wins 60% of the series, and 13 of the last 16 -- Joe Buck.


    Good night, Ms Callabash, whereever you are.

Three Martinis

Three Martinis is dedicated to the proposition that life, not unlike Gaul, is divided into three parts.


How is that, you may ask. For starters, I'm Marty III, Marty McGowan III, to be specific. It's gone now, my year (MMIII), but still sufficiently fresh in our conscience to celebrate. My Grandfather, Martin Sr, wrote a column for years, Martinis, in the Appleton (MN) Press. So, in part, this is dedicated to his memory. That memory includes whimsy, serious, and the spiritual. Just like the milking stool out at the Oyen farm, which had three legs, so does life: fun, travel, adventure; sober, spirit, sensation; and Saturday, Sunday, and the workweek.

On the Web, your author is into at least two of these venues: sober and sensation, with some attempts at the spirt. In the sober category, there is The News' Dark Time, in the spirit, we have Call To Action -- NJ, and in the sensation group there is Statboni, the unofficial NHL statistics site.

The News' Dark Time.

It's recently gone over One Hundred issues, motivated by the unashamedly liberal view we are not being served by major media. In particular television, with the popular print struggling to differentiate itself from commercial television. (As an aside, gentle reader, please hasten to chasten your editor, if the tone of one of the three forums leaks to heavily into another). The NDT must be a "Saturday's" child.

Call to Action -- New Jersey.

Your third Martini is also a lifelong Roman Catholic, though less proud of the association every day. To that end, he's hosting a Web site, in need of much update: the Call to Action -- NJ, where we promote the New Jersey action. You recall, this all grew out of Renew, a Bishop's (yes bishops') call to renew the church in 1976. Mrs Martini and I were in CO at the time, and did some grass-roots issue culling as part of a truly alive church in that time and place, as the historically inclined are glad to recall. -- Sunday's child.

On to the Work Week.

Here the web work is a little more diffused. At this writing, your Martini mixer prefers "Up with a twist", while Mrs Martini is clearly favors "Tanquery OTR, olives". But the website of this season is your editor's gainful employ at The Benedictine Academy in Elizabeth NJ. Our young ladies are just starting to make their impact on the school web site, and your editor, as Technology Director, is running the classroom from a chamber off McGowans.Org. Now there's a Saturday site. (Aside to self: make a taxonomy on your work, viewed from at least 3 directions)

At some point, we'll put this up on a web site, maybe. One of the things Martini is struggling with these days is the value of self-publishing and locking up domain names. Somewhere into a third martini this summer, I locked up "three martini" in (most all) its internet manifestations. Next year we'll review that decision as an expensive ($90) boost to simply start writing.

For those of you with access to other parts of my electronic musings, this will be a place to comment on the general topic, with one caveat: "Saturday" talk -- the serious stuff, will be confined to that neighborhood, not here.