Das eez kaput! Sometime around 2002 I spaced the entire database table that mapped individual entries to categories. Such is life. What follows is a random sampling of entries that were associated with the category. Over time, the entries will be updated and then it will be even more confusing. Wander around, though, it's still a fun way to find stuff.
Date: Sun, 8 Sep 2002 15:35:43 -0400 (EDT) From: Aaron Straup Cope To: Karl Dubost Cc: Steph Subject: Glossaries: XPath, SAX and benchmarks So, I sat down and did some tests this morning per our conversation about glossaries and XBEL and XPath. It's a bit depressing given the nature of the XPath query you need to pull stuff out of an XBEL document : "/xbel//bookmark[title=\"$keyword\"]/\@href" Since the <bookmark> element can be either next to the root <xbel> element or contained in an arbitrary number of nested <folder> elements, there isn't much too do except sniff around every node until you find what you're looking for. Which takes a long time. Longer than you'd normally want anyway... On the other hand, if you just use a plain old SAX widget to find the keyword, it takes roughly 1/4 to 1/5 of the time to do a lookup. Below are benchmarks for 100 iterations of a subroutine that does 5 keyword lookups against an XBEL file. Note that the XPath query doesn't even instantiate a new object; the same object is shared across all 500 calls to 'find'. The SAX query on the other hand, instantiates a new filter and a new parser for each lookup. Obviously, some clever caching of lookups would speed things up as well. **** 101 ->./debug.xbel Benchmark: timing 100 iterations of xpathquery... bquery: 765 wallclock secs (645.73 usr + 13.66 sys = 659.38 CPU) @ 0.15/s (n=100) 101 ->./debug.xbel Benchmark: timing 100 iterations of saxquery_pureperl... saxquery_pureperl: 171 wallclock secs (148.23 usr + 0.62 sys = 148.86 CPU) @ 0.67/s (n=100) 102 ->./debug.xbel Benchmark: timing 100 iterations of saxquery_expat... saxquery_expat: 171 wallclock secs (148.17 usr + 0.20 sys = 148.38 CPU) @ 0.67/s (n=100) **** package Foo; use base qw (XML::SAX::Base); sub keyword { my $self = shift; $self->{'__keyword'} = $_[0]; } sub link { my $self = shift; return $self->{'__link'}; } sub start_element { my $self = shift; my $data = shift; return if ($self->{'__match'}); if ((! $self->{'__bookmark'}) && ($data->{Name} eq "bookmark")) { $self->{'__bookmark'} = 1; } return if (! $self->{'__bookmark'}); if ($data->{Name} eq "bookmark") { $self->{'__link'} = $data->{Attributes}->{'{}href'}->{Value}; } $self->{'__title'} = 1 if ($data->{Name} eq "title"); } sub end_element { my $self = shift; my $data = shift; return if ($self->{'__match'}); if ($data->{Name} eq "title") { $self->{'__title'} = 0; } if ($data->{Name} eq "bookmark") { $self->{'__bookmark'} = 0; } } sub characters { my $self = shift; my $data = shift; return if ($self->{'__match'}); return if (! $self->{'__bookmark'}); return if (! $self->{'__title'}); if ($data->{Data} eq $self->{'__keyword'}) { $self->{'__match'} = 1; } } package main; my $file = "/usr/home/asc/aaronland.net/asc/webdev.xbel"; use XML::SAX::ParserFactory; $XML::SAX::ParserPackage = "XML::SAX::Expat"; use Benchmark; my $count = 100; my @keywords = ( 'FilterProxy Home Page', "REX XML Shallow Parsing with Regular Expressions", "aaronland", "Schematron - XML Validation Language", ">RE ActivePerl mod_perl ppd available", ); timethese($count, { saxquery_expat => sub { foreach my $kw (@keywords) { my $filter = Foo->new(); $filter->keyword($kw); my $parser = XML::SAX::ParserFactory->parser(Handler=>$filter); $parser->parse_uri($file); } }, }); **** use XML::XPath; use Benchmark; my $file = "/usr/home/asc/aaronland.net/asc/webdev.xbel"; my $count = 100; my $xbel = XML::XPath->new(filename=>$file); my @keywords = ( 'FilterProxy Home Page', "REX XML Shallow Parsing with Regular Expressions", "aaronland", "Schematron - XML Validation Language", ">RE ActivePerl mod_perl ppd available", ); timethese($count, { xpathquery => sub { foreach my $title (@keywords) { my $query = "/xbel//bookmark[title=\"$title\"]/\@href"; my $r = $xbel->find($query); } }, });
Most common computer error.
ex. Oh, you have a "ID10T" error. (IDIOT)
(verb) The process of shortening phrases, via an acronym, for the purpose of simplifing statements. Typically used in technical data reporting or inter-office e-mails. (IE "FUBAR" or "KISS")
ex. I didn't realize that phrase had been acronyzed.
Lissom \Lis"som\, Lissome \Lis"some\ (l[i^]s"s[u^]m), a. [For lithesome.] 1. Limber; supple; flexible; lithe; lithesome. Straight, but as lissome as a hazel wand. --Tennyson. 2. Light; nimble; active. --Halliwell. -- {Lis"some*ness}, n. web1913
lissom adj : gracefully slender; moving and bending with ease [syn: {lissome}, {lithe}, {lithesome}, {slender}, {supple}, {svelte}, {sylphlike}] wn
Polyglot \Pol"y*glot\, n. 1. One who speaks several languages. [R.] ``A polyglot, or good linguist.'' --Howell. 2. A book containing several versions of the same text, or containing the same subject matter in several languages; esp., the Scriptures in several languages. Enriched by the publication of polyglots. --Abp. Newcome. web1913
polyglot adj : having a command of or composed in many languages; "a polyglot traveler"; "a polyglot Bible contains versions in different languages" n : a person who speaks more than one language [syn: {linguist}] wn
Quotidian \Quo*tid"i*an\, a. [OE. cotidian, L. quotidianus, fr. quotidie daily; quotus how many + dies day: cf. OF. cotidien, F. quotidien. See {Quota}, {Deity}.] Occurring or returning daily; as, a quotidian fever. web1913
quotidian adj : found in the ordinary course of events; "a placid everyday scene"; "it was a routine day"; "there's nothing quite like a real...train conductor to add color to a quotidian commute"- Anita Diamant [syn: {everyday}, {mundane}, {routine}, {unremarkable}, {workaday}] wn
(n) Foreplay. Not my original word, but a wonderful word to say. Try it. Firkytoodle. Probably got it from Mrs. Byrne's Dictionary.
ex. As in a song lyric: Momma don't 'low no firkytoodlin' 'round here.
Slang Doritos. Sounds like "pete's."
ex. Pass my the retes.
my @date = (@_)[0..2]
doesn't work?! It does, but whatever... The kind words were nice and
appreciated, too. But if any of you think I'm touching the awards
controversy with a ten foot pole, you must be drooling uncontrollably.
Move along, now.
$MTCommentAuthorLink$
with automagically tags a name with some kind of URI, if present. You
can configure MT to force people to include an email address when they
submit a comment which, notwithstanding the ubiquitous
bob@bob.com
, is understandable. You can also include an optional URI. The problem
is that if you disallow anonymous comments and a user doesn't have, or
doesn't include, a URL their email address gets stuck into the anchor
tag. This is just bad form given the volume of spam-bots scraping the
web. There are two hacks around this problem. The first is to update
all your templates and change
$MTAuthorCommentLink$
to
$MTCommentAuthor$
, but this has the side-effect of never including an author's URL which
may be cause for further annoyance. The second is to alter the
conditional by hand, at lines 412-414, in MT::Template::Context.pm.
Neither of these options are really very satisfying, though. Rather,
this should be a configurable option in the mt.cfg file; something like
MTCommentsAtNoSpam
. Unfortunately, none of the objects contained in the
MT::Template::Context object contain instances of the MT::ConfigMgr
object. In the days to come, I will submit a bugfix to pass
$app->{ "cfg" }
as an argument to the Context.pm constructor...