xkcd is among my favorite web comics about romance, math, language, sarcasm, programming, and raptorphobia. As you can see, it's chock full of valuable advice.
So, as as sort of Friday Five, here are a few of my favorite xkcds.
See also Wikipedian Protester and Katamari. I wanted to stop at five, but I couldn't.
I removed my Netflix queue display sidebar item temporarily. Netflix has apparently altered the format of its feeds. Though the parser/translator continued to work, the footprint of the output is bigger than I would like. (Not to mention all the images, geez.)
It'll come back after I've revisited the formatting. This might be the time to look into an XSL tranformation for RSS feeds, to coerce them into the sidebar format, then style them with CSS. Right now, it's all done with hardcoded, feed-specific python code.
This follows the software design rule of threes. I wrote it once for Netflix, then again for last.fm. Now, I have to do it again for Netflix. It's probably time to produce a general feed-to-xhtml solution.
From the source code is free speech
department: python source
code expresses meaning by outwardly contradicting that meaning.
__import__('sys',map(lambda x: getattr(globals(),'setdefault')(*x),[('_',getattr),('__',__import__),('__l', list('sd'))])).stdout=open('/dev/null','w')
_(__('os', map(lambda x: _(globals(),'setdefault')(*x),zip(__l,map(lambda x:_(__('this'),x),__l)))),'write')(1,''.join([d.get(c,c) for c in s]).split('\n')[int(_(__('sys'), 'argv')[1])+2]+'\n')
Example usage:
$ python irony.py 0
Beautiful is better than ugly.
$
As Chris observed, and I pointed out in previous entries, I've been immersing myself in LISP lately. I speculated out loud that the structure of an XML document is equivalent to an s-expression. Chris responded by creating a LISP program that converts an s-expression into an HTML document.
I wondered if it would be possible to produce an XSL transformation that could convert XML into an s-expression; to use Chris's example, a transformation that converts this:
<html>
<head>
<title>Hello world</title>
</head>
<body>
<blink>
<span style="color:red">Testing.</span>
Still blinking.
</blink>
</body>
</html>
Into this:
'(html
(head
(title "Hello world"))
(body
(blink
(span (attributes (style "color:red")) "Testing.") "
Still blinking.
")))
What I came up with is an XSL transformation that can transform an arbitrary XML document into an s-expression. (It transformed the HTML above.) It still has a few problems: it can transform qualified names, but the colon-separated identifies cause problems for LISP, as it looks for a matching package. Also, deliberately empty text nodes are problematic. Otherwise, though, it works pretty well.
The transformation: sexp.xsl
The command line: $ xsltproc sexp.xsl sexp.xsl
The result: sexp.lsp
Perhaps "whence" would work just as well in the title of this entry, because I'm not only trying to figure out where to go with an integrated library system, but also how to come at it.
Some design directions I'm thinking about in order of importance:
Is there any reason the UI shouldn't be browser based?
A library system is essentially a database application. I have an okay understanding of database design, but there's room for improvement. So far, I've identified severala whole mess of different tables:
Koha is an already existing, working ILS project. It should be reviewed, but I don't know enough perl to review it myself. I've been told it's missing important features, like consortium support. It's a bias, I know, but I can't help but feel like if Koha were implemented in another language, like Python, I'd be able to make heads or tails of it.
Speaking of which, I'm unclear on the benefit of consortium support in a free (as in freedom) ILS. One need not amortize the cost of the system itself over the members of the consortium, and a shared sysadmin could administer several installations, that is, databases, almost as easily as one. One could implement reciprocal circulation policies in terms of, well, circulation policies and patron groups, it seems to me. I must look into this in more detail.