Humility
VI can’t even approach the terrible syntax of TECO.
VI can’t even approach the terrible syntax of TECO.
There has been recent grumbling by a certain notorius gangster in the comment pools of a few articles about some “bug” in the new design of this blog.
To that grumbler I issue the following: “Come forth, report thy bug, or I will forever consider it WORKS_FOR_ME.”
Gates and Ballmer are so funny and cute. They have a special little section in Excel 2000’s code designed to inform me that I am doing something really cool with my formulas. I mean, I’m not doing anything that should produce errors, so I guess they’re congratulating me on how well I’ve done accumulating knowledge about their product.
But, instead of putting a little message in there like “Good job, Brando!” it says something like “EXCEL.EXE has generated an error and must close. A log has been created.” Isn’t that funny and nice? I just wish those pranksters had let me save first!
[If you want to avoid such accolades, save before (or avoid altogether) using the TRANSPOSE()
function on a modestly-large array generated by the OFFSET()
function.]
Just walked by a television where, not particularly out of context, President Bush said our troops were currently “spreading peace.” Since musing seems the way to be these days, I mused: “Spreading peace through war…”
Sure, this has been done. World War II comes to mind, since when I think BMW and Hitachi I don’t really think of weaponry suppliers.
But, this domestic stuff isn’t exactly fighting Rommel in North Africa. It’s dirty, and the terms “losing side” and “surrender” truly only have precision when viewing military action as a sort of anti-idealized ethnic cleansing, which nobody but the bad guys really wants to do.
What I think we’re doing, strategically (but to be really nice, maybe not morally), is more concerned with stabilization than peacemaking. We all know now that the whole “Boo hoo, Bush is going to war to lower our oil prices” stuff is either horse-hockey (my guess) or was just such a colossal bungle that it backfired or something on that order. I’ll leave Michael Moore to fill in the gaps there.
My theory is that we really don’t care what the country looks like when (if?) we get through with it. Odds are it’ll be bombed to Hell and awash wtih American contractors trying to patch the holes.
What we’re really looking for, purely from our viewpoint, is somebody not completely insane that we can push around a little. Take Pakistan: the current regime is not particularly democratic and not particularly nice, but they have tanks and tend to point them in the correct direction, when they’re not threatening India.
Look at Bosnia and Herzegovina: although a democracy, the CIA World Factbook currently lists the country as having 45.5% official unemployment. Make that 25-30% if you include the gray market!
I guess this isn’t really all too earth-shattering, but it amounts to a request on my part: don’t say “democracy” when you mean “stabilization.” Would we care about North Korea if Mr. Il was a friendly trade partner, adoringly nicknamed “Little Kim” by the Bush staff?
I think there’s something innately depressing about setting up a recurring task in Outlook. I mean, you get that psychological positive rush of saying “Check, punk. You be done.” Then, next week’s version of the task appears immediately below the one you just checked off. The ever looming spectre of “Update and e-mail out your schedule.” Sigh.
I would really like to see this new webmail project running on a test server sometime.
Utilizing no supporting data, I estimate that a common spreadsheet data storage and extraction format would permit all United States public institutions of higher learning to cease granting bachelor degrees in Finance.
The Bigelow “English Teatime” variety doesn’t screw around. Good stuff.
Oh, and E-Dawg, it tastes better seasoned and sweetened with the blood of my mortal enemies. Yarg!
Well, I promptly dispatched my major internship project this morning, so there’s a bit of downtime available as things regroup from that major shock of progress.
Although I am unable to scan or otherwise capture the document from here, I have prepared a very cool little dependency tree for the project-management side of this Great Python Re-Write experiment. I got the append()
(enqueue) and about 10% of the pop(0)
(dequeue) side of the command queue written, if you consider the parser and handler calling systems as the unfinished 90% of the “queue” as a whole.
The parser, as can be said for well over half of my top-level unfinished items, is basically assembling a new set of Legos, as Python was nice enough to do most of the work essentially in advance.
The “handler calling system” is my term for the thing that takes the command:
lo ca
from the parser in parsed form ([0] -> “lo”, [1] -> “ca”) and does a letter-to-letter sloppy match against a table of command-to-function mappings. I am cursed with the curse of knowing how CircleMUD worked (good memories, on the whole!), so my handler works like its handler.
Its handler used a priority matching system, such that some commands (the command is the zeroeth parsed token, “lo” in the example) take precedence over others, even when the lower-precedence token would normally be alphabetically “superior” to the high-power one.
This allows the input socket (okay, the “player”) to type “l” (as in leopard, if the font is funky) to mean “look,” even when the first command starting with the letter L is “leer.” This non-alphabetic matching is a bit of a pain, but Python should make it easy with the startswith()
string method.
Writing the whole dang thing in the language I was originally planning to embed as a scripting language means that all handlers are bound and required by programmer’s fiat to be modular, extensible, and arbitrary. Even “go” and “look,” the big daddies of them all.
Needless to say, it’s fun watching Python’s prototyping efficiency whip butt against C++. I had the entire skeleton player/denizen/character/entity (née “object” in Sigma C++, where “object” is not a keyword) at least gasping for air in about five minutes, as opposed to days with C++’s constant file.cpp/file.h dance.
Pretty good stuff. I’m getting over the hump of doing things “over again” and starting to see things look new and interesting…
I want to take you on a journey with the Python language and libraries. I want you to see what they can do (the three >’s is a prompt).>>> s = " 'get a' cookie now "
>>> s
" 'get a' cookie now "
>>> import shlex
>>> shlex.split(s)
['get a', 'cookie', 'now']
Bam. Now, let’s introduce a little more complexity. Let’s say there are two cookies: one is normal, and the other is enchanted (in that search order). The enchantment does not modify anything in the way of a name or description. You need to get the second one. The “get a” token is not realistic; simply to brag on the quoting capabilities of both the language and the shlex
parser.
Let’s allow the player to say, “with respect to the search order [the natural, incidental order of the relevant linked list of items], select the nth cookie.” He can say this by appending ”#n” to the end of the proper token. All other #’s in the token, besides the last one, are to be ignored.>>> s = “ ‘get a’ cookie#2 now “
>>> s
“ ‘get a’ cookie#2 now “
>>> shlex.split(s)
[‘get a’, ‘cookie#2’, ‘now’]
>>> a = shlex.split(s)[1]
>>> a
‘cookie#2’
>>> a.rsplit(‘#’, 1)
[‘cookie’, ‘2’]
And, for the picky…>>> s = “ ‘get a’ cookie#3#2 now “
>>> s
“ ‘get a’ cookie#3#2 now “
>>> shlex.split(s)
[‘get a’, ‘cookie#3#2’, ‘now’]
>>> a = shlex.split(s)[1]
>>> a
‘cookie#3#2’
>>> a.rsplit(‘#’, 1)
[‘cookie#3’, ‘2’]
That’s what I mean by “Legos.”