Contact Info

(for those who care)

Instant Gratification   



Fri, 28 Jan 2005

Miscellany

A variety of things. Today I had the opportunity to read two poems to Bety. One is by Sara Teasdale, probably my favorite poet.

The Look

Strephon Kissed me in the Spring,
Robin in the fall
But Colin only looked at me
And never kissed at all.

Strephon’s kiss was lost in jest,
Robin’s lost in play,
But the kiss in Colin’s eyes
Haunts me night and day.

— Sara Teasdale

[source…]

…and a fun one:

Celia Celia

When I am sad and weary,
When I think all hope has gone,
When I walk along High Holborn
I think of you with nothing on.

— Adrian Mitchell

The story of Sara Teasdale is pretty sad. I actually own a very old copy of Strange Victory … it’s emotionally very tough to read sometimes, although I haven’t actually more than cracked the covers of my copy. Haven’t had a lot of time to read poetry lately.

At work, I’ve been scheming on how to get an automation tool that’s simple enough for non-programmers, maintainable, and at the same time, useful. Recommendations welcome. So far experiments with a JS-based recorder of browser-actions went well. It lets me record actions at a browser level, rather than protocol level. All hail Greasemonkey, which is going to encourage me to learn mozilla extensions. So far my recorder is dumping to a wiki for centralized data store, and I put together some auto-script-writing-wizard stuff that uses the uber-l33t XmlHttp stuff to fetch data.

Currently I use XmlHttp to fetch a list of pages at startup, and then per each action, fetch the corresponding page (action) in question and grep it for parameter tags. Those parameter tags (actually python def funcName( p1="val1" ):) are then presented to the user via popups, etc. as an assistant (like VisualStudio auto-complete?) in generating more complex scripts. Probably will have to move away from JS prompt() calls and towards a floating <div> that toggles and is dynamically populated with elements, values, etc. (this is especially for the case of multiple parameters on a single action).

Pretty cool being able to conditionally fetch information, parse it either server-side or client-side and do fancy JS / DOM manipulations to make it do what you want to do. I forsee a bright future in this type of work, just so long as it’s testable (should be, since you can treat your XmlHttp requests as requests/responses to be handled appropriately. MockXmlHttp.send(), anyone?).

This might convince me to work with the JSON people for PHP, since that’s how I’m using 90% of my latest dynamic javascript.

Which brings me to my third point of miscellany: XML.

The reason stuff like JSON (a light-weight JavaScript Object Notation) even exists is becuase… well, a variety of things. First, why does XML exist? It’s for the structured representation of tree-like data in a language-neutral, human-readable format. Well and good, but you read all the time about the lisp people and S-expressions. The other thing that XML brings to the table is XPath/XQuery. XPath is like SQL for tree-like data. This will eventually be amazingly useful, but only when it gets to be as popular as SQL (note to kiddos: learn XPath).

For now though, XML is a common standard, but it’s really more of an impedence mismatch. XML isn’t native to PHP, and it isn’t native to JavaScript, and it isn’t native to Python, and it isn’t native to Java and it isn’t native to anything. Yay. Also, nobody knows XPath well enough to give a damn about some work that they’ll save (writing a couple of foreach loops is easy enough in any language except Java). The closest thing I’ve seen to native support is the perl lib EasyXML (I guess it got converted to XML::Simple nowadays), where once you’ve loaded the XML object, it gets treated as a first-class perl citizen. Yay. But for now, the whole point is that most developers want access to the first-class citizen, not XPath, and that means that JSON is the path of least-resistance for getting information out to a browser (no dependent libraries). Hopefully it will die a quiet death as more languages get native XML support, but for now it seems pretty useful.

And a final closing funny: “Better to have a nickname than an adjective.” (said by “Big” Dave to “Magpie” ;^)

23:56 CST | category / entries
permanent link | comments?

Like what you just read? Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.



Thanks for Visiting!