Gallimaufry of Whits

for 2007-02

These are quick notes taken by Sean B. Palmer on the Semantic Web, Python and Javascript programming, history and antiquarianism, linguistics and conlanging, typography, and other related matters. To receive these bits of dreck regularly, subscribe to the feed. To browse other months, check the contents. This file was generated from plain text source, for convenience of posting, so apologies for all the in-your-face URIs.

2007-02-02 09:18 UTC:

Since OS X doesn't deign to have a decent Unicode font built in, I've installed two of my favourite fonts, Everson Mono and Code2000:

Everson Mono installed fine, but Code2000 comes up as having problems with the "Postscript Compatibility Table" and as "Missing OpenType Data". A while ago when I tried to install Code2000, I can't remember there being a way to force install it, but this time there was so perhaps that came in one of the OS updates.

So now I've installed the following user fonts in total:

As you can see, it's a short list; I'm not all that much of a font geek. But the OS X fonts are rather good, especially the marvellous Hoefler Text, so it's easier to get by without user fonts than on Windows.

Anyway, the thing which tipped me over the edge was that Character Palette wouldn't show me runic Unicode characters. (Oh, and that's another thing: why does Quicksilver only bring up "Show Character Palette" when pressing "c" but not "scp" or "cp" or anything like that?) Both Code2000 and Everson Mono have it covered now.

2007-02-02 09:39 UTC:

On Unicode fonts, I've just installed Gentium and Junicode too:

I'd heard of Gentium before and, I think, downloaded it on my Windows box, but Junicode is new to me, and it absolutely rocks: it's a font for mediaevalists.

In installing it, I might've stumbled across the reason for my old font installation problem too. It comes in several variants--Bold, BoldItalic, Italic, and Regular--all of which installed okay except for BoldItalic, which was "Missing OpenType Data". But this time, the button that lets you proceed was greyed out and unpressable. It was only when I unchecked and then rechecked the font that it worked... For Code2000, the font was already unchecked, so when I checked it the button was activated. I'm not sure why it was unchecked for Code2000 and checked for Junicode, but if that was what was behind my not being able to install Code2000 when I tried it some months ago, it would appear to be an inconsistent bug.

Anyway, for the best example of how awesome Junicode is, I'd go for the Junicode.pdf file included with the distribution. It appears to have once been online at http://io.debian.net/~tar/debian/ttf-junicode/ but since that's now gone, I've uploaded it to inamidst:

http://inamidst.com/stuff/archive/Junicode.pdf

You can get the whole package from http://junicode.sourceforge.net/ The license appears to be GPL with some extra commentary... you'll just have to read License.pdf to see what you make of it, but it seems quite sane.

2007-02-03 10:44 UTC:

The Whits/Flog duad has become a triad! He didn't email me or notify me about this (I picked it up via a referer), so I might be doing the wrong thing by noting it here, but Simon Rozet has made a start on a French language weblog:

http://atonie.org/notes/
- Notes en Vrac

The title, "Notes in Bulk", seems to be a fairly standard phrase in French if the number of results on Google (14,800) is anything to go by, but there are only a handful of other sites in the top slew of results that are using it as a title so it's a good choice.

There are only a few posts so far--from the 21st, 22nd, and 31st January--but hopefully he'll stick with it. Yay. No published source yet, but he seems to be using Cody's Flog code: http://d8uv.org/flog/source

2007-02-03 12:58 UTC:

The verb "potter", meaning to aimlessly perform pointless tasks, is quite a new word, the oldest attestations in the OED being from the mid 19th century, but it's derived ultimately from "pote", which is an Anglo-Saxon word meaning to push or kick.

Whilst I was looking that up (I like the word potter), I came across this quote for it: "1435 R. MISYN tr. R. Rolle Fire of Love 93 Euerlastynge potand behynde, in temporall solas & bodily lufe {th}a seyke to florysch." The spelling of flourish as florysch is only used in five place on the web, including a British History Online site that is currently borken:

http://www.british-history.ac.uk/report.asp?compid=51760
- Book of Foundation in Middle English: Book 2

It's a good site normally, but it seems to be having a problem with its "Microsoft JET Database Engine". There's no date for this document, but it talks about Henry II and "lorde Richard Archbysshop of Cawntirbery", so it must be from 1174-1184 when Richard of Dover was the primate (he succeeded Thomas Becket). It's quite readable, especially for Middle English... for example, it talks of one canon as being "a man of jocunde companye, and felowly jocundite, of grete eloquence, and of grete cunnynge, instruct in philosophy". Apart from -ite for -ity, it's easily parsable.

Some of the terms for lights are particularly fun, e.g. "yllumynyd" and "schynynge lightys". I guess that substituting "y" for random vowels and throwing the odd one in for fun is a good method for getting awesome wyrdys.

2007-02-03 13:23 UTC:

Ooh, the -ric suffix of archbishopric, abbotric, etc., is from Andlo-Saxon riche or rike, which must be cognate with reich. The words "rich" and Latin "rex" for king are derived from the same IE root (*reg-) too.

2007-02-03 14:41 UTC:

I've had my current digital camera since 2003, but it might be on its last legs given that the following problems appear to be coming up with an increasing regularity:

It's a Fuji A202. Apart from the problems above, which are likely just due to its relative age, I've been very happy with it. If it were to break in the near future, what would I replace it with?

The two most popular cameras in the $300-$500 range right now look like the Canon PowerShot S3 and Fuji S6500FD, but they're both a bit more advanced than the A202, and moreover they require four batteries rather than two, so I'm probably looking at getting a compact point and shoot still. I guess I have to balance learning the craft of photography a bit more and getting better photos as a result, and the convenience of having a point and shoot camera that'll sit nicely in my pocket.

In fact, you can pick up the older Fuji S5600 model for just under $300, and that's got a huge optical zoom, 5.1MP, and looks like an SLR... it might be a thing to get both an SLR and a compact. Actually, I think what I'm really after is a hybrid: a compact (two batteries, small) that nontheless has a good optical zoom (around 10x), and lots of manual settings and trickery to play about with should I want to. There don't seem to be many of those around, but I've only just started looking, and not very hard.

2007-02-04 09:15 UTC:

Slashdot had a story today that scientists have created a new substance that's stiffer than diamond:

http://science.slashdot.org/science/07/02/04/0310234.shtml
- Material Tougher Than Diamond Developed

I'm not entirely sure what they mean about this: do they mean that it's stiffer (the word they use), or harder? The terms are often confused:

"Scientists and journalists often confuse stiffness for hardness, and spuriously report materials that are not actually harder than diamond because the greater anisotropy of their solid cells compromise hardness in other dimensions to end in a material prone to spalling and flaking in squamose or acicular habits."
- http://en.wikipedia.org/wiki/Hardness

If they really meant hardness, as is probable (the title of the linked article is "Diamond loses its stiffness crown to new material"), there are actually two materials and a conjectured one already that are harder than diamond, some of which are possibly harder than the new ceramic barium titanate:

Diamond is, at least, still the hardest known naturally occuring substance.

2007-02-04 15:04 UTC:

So whilst I'm on the whole fonts thing, Wikipedia mentions that OS X 10.5 (Leopard) might be using a different default font:

"It has been speculated that such an interface, rumored to be called 'Illuminous', will sport more glossy black elements in the user interface, as well as discontinuing the use of Lucida Grande as the default system font." - http://en.wikipedia.org/wiki/Mac_OS_X_v10.5

I searched around a bit to see what it's going to be replaced with, and a couple of sites mention Myriad. Myriad is a weird mouldable typeface that might be good for a drop in replacement for geometry sensitive applications using Lucida Grande (cf. http://swhack.com/logs/2007-02-04#T14-20-03 on). But it looks as though Myriad was once to be used in the iPod, and Apple dropped it for a very similar font called Podium Sans instead:

"Whether Podium Sans started life as Myriad or another font is up for debate, but strangely Apple no longer mentions the Myriad typeface in connection with the iPod user interface. Searching Apple.com for Myriad results in no results mentioning the font."
- http://en.wikipedia.org/wiki/Podium_Sans

Apple still seem to use Myriad in their presentations and so forth though, on the other hand, so they have some tie in. Perhaps Leopard will use Podium Sans or something along the customisation lines?

2007-02-04 16:41 UTC:

So I noticed that a commonly used worklow idiom with me is capturing a user selected region of the screen and uploading it to the web. You can do that in just a few lines of code on OS X; here's the important bit:

 screencapture -is $1.png
 convert $1.png -format jpg -quality 65 $1.jpg
 rm $1.png

Not sure why I didn't make a script for it before (I've called it "cap").

2007-02-04 17:02 UTC:

I've been trying to convince Christopher Schmidt to have a Whitsflog, and in doing so I wrote up instructions for installing a Whits-like Whitsflog:

http://inamidst.com/whits/source
- Whits Source

But it's must better to use Cody's Flog Source (http://d8uv.org/flog/source and associated files), since it requires less code editing, and lets you use Markdown which most people like. I'm actually wondering about using Markdown or something similar myself... the inYourFaceURIs are getting a bit tiresome.

See also http://d8uv.org/flog/flog.tar.gz which Cody just made.

2007-02-05 14:29 UTC:

Pillow mounds are awesome. They're post-mediaeval artificial rabbit warrens, possibly made to assist rabbit farming. Wikipedia has a lowdown:

"The most characteristic structure of the "cony-garth" ("rabbit-yard") is the pillow mound. These were "pillow-like", oblong mounds with flat tops, frequently described as being "cigar-shaped", and sometimes arranged like the letter <E> or into more extensive, interconnected rows. Often these were provided with pre-built, stone-lined tunnels. The preferred orientation was on a gentle slope, with the arms extending downhill, to facilitate drainage." - http://en.wikipedia.org/wiki/Warren_(domestic)#Pillow_mounds

Furthermore:

"To facilitate this artificial warrens were built consisting of low flat topped mounds, 10 to 20 metres long, 5 to 10 metres wide and up to a metre high sometimes surrounded by a shallow ditch. Such mounds are often called pillow mounds although on Dartmoor they are known as buries and historically were termed coney garths ( or sometimes conegar or coneygree)."
- http://www.hobbyhorsefestival.co.uk/Hunting/History.html

"A Medieval licence for the were required from the King, which gave the 'Right of Free Warren' on a piece of illuminated manuscript, which Robert de Ogle acquired for Thirston in 1341AD."
- http://tinyurl.com/2vnoyv

From this evidence and a note on another page, it seems that they date mainly to the 1300s. I came across them when doing one of my many random OS Get-a-map browses for interesting place names and so on. The pillow mounds that I found are at NY 780 043 GB. I was going to write a Wikipedia article about them until I eventually found the little section under Warren (domestic).

2007-02-05 15:19 UTC:

I've compiled most of the Swhack logs on swhack.com to static HTML files, and in doing so I wanted to a) make logs with non-static counterparts still be dynamic, b) serve the static files without extensions, and c) redirect .html URIs to their extensionless counterparts.

To achieve this is not straightforward, because you're essentially writing a loop which you need to stop, so I reused a trick that DrBacchus gave me:

"2006-03-30 19:09:55 <DrB> sbp: And, if not that, you
could PT and then E=redir:1 and then RewriteCond on the
env var redir. Or ... something."
- http://swhack.com/logs/2006-03-30#T19-09-55

And came up with this .htaccess snippet:

 # 1) If no static .html exists, serve dynamically via the CGI
 RewriteCond %{DOCUMENT_ROOT}/logs/$1.html !-f
 RewriteRule ^logs/(\d{4}-\d{2}-\d{2})(.*)$ logs/index.cgi

 # 2) If an HTML file exists, serve that
 RewriteCond %{DOCUMENT_ROOT}/logs/$1.html -f
 RewriteRule ^logs/(\d{4}-\d{2}-\d{2})$ logs/$1.html [PT,E=REDIR:1]

 # 3) If accessed with a .html extension, remove it
 RewriteCond %{ENV:REDIRECT_REDIR} !1
 RewriteRule ^logs/(\d{4}-\d{2}-\d{2})\.html$ /logs/$1 [R]

I'm not sure why the ${DOCUMENT_ROOT} bit is required, and also it's odd that even without [L] on RewriteRule-1 and without RewriteCond-2 altogether, it still works. But that's mod_rewrite for you.

2007-02-05 16:57 UTC:

News From The Flogosphere: I'm thinking about merging my code with Cody's Flog code, and creating a kind of canonical Whits/Flog software package. I'll probably migrate to using Markdown, since that's what all the cool kids are using.

The plan is to let all the differences between Whits and Flog be configured upon installation of the softeare. One difficult thing about this is that small differences in the interface can mean large differences in the backend: for example, my 2007/02 URIs vs. Cody's 2007-02 URIs.

The biggest difference is that I append to single text source files, converting them dynamically and building them later, whereas Cody always builds at edit time, which means more header files and stuff. I'm not sure how to resolve that really, because the problem is that I want to retain the source files and Cody doesn't... Also I have daily item bundles whereas Cody has items-per-post. It looks like merging whilst staying lightweight and elegant will be difficult.

2007-02-07 11:44 UTC:

I've set up OpenID on inamidst.com because I'm a dedicated follower of fashion. The main thing I'm whitsing (waxing whitsical?) about is that it was really hard to find out how to set up OpenID on your own site, even though it's a really simple procedure. Eventually I found this:

http://www.openidenabled.com/openid/use-your-own-url-as-an-openid
- User your own URL and an OpenID

But I have to say that sites like openid.net really don't seem to be set up for the proper propagation and proselytisation of OpenID. Probably a good job that Microsoft is getting on board, then.

2007-02-07 11:54 UTC:

More possible whit verbs: whitting, whittering, whitsing, whitsering, whiting... I think "whitsing" is the most technically correct, but I like whittering because of the existing verb "wittering"... oh, and it seems that that's actually derived from a verb "whitter":

"witter, v.
colloq. (orig. Sc. and dial.).
[Perhaps a variant of whitter v.: cf. whitter n.]
1808 A. SCOTT Poems 82 The winking swankies whitter, An'
fondly ee some female band."
- http://dictionary.oed.com/cgi/entry/50286430

And whitter was originally "quitter", probably from Scandinavian. So whilst it seems to be unreleated to "whit", it's cool that the verb form exists all the same.

2007-02-07 12:16 UTC:

On the merging of the Flog and Whits code, Cody and I have been trying to strike compomises between the two sets of code. So far, we've got:

I rather like this so far. So, the remaining choices that we have to make, that I can think of, are:

Another design choice is whether to use markdown.py or an installed command line version of markdown. Not having to bundle markdown.py with the Flog Software would debloat the distribution, but it would still require markdown so it'd only be a false thing anyway. Also, command line calls from Python in Cygwin often mess up, so I'd rather include markdown.py.

2007-02-08 09:58 UTC:

James Shapiro has a theory that in a couple of generations or so, there won't be any more conflated versions of Hamlet. He puts forward a convincing interpretation of the process of revision between Q2 and FF (and says, much less convincingly, that Q1 is probably derived from a cut down version of Q2 for touring), such that each of those two versions should be taken as distinct versions unto themselves.

Now this has spurred a lot of debate over the years, but conflationist editors do have the upper hand now. Normally I like to get back to the original sources as much as possible--I tend to quote from the quartos and folio, for example. But I really like my conflated edition of Hamlet because it preserves all the cool bits of the play, even if it makes less sense as a result. Shapiro points to the answer there though: he notes that the new Arden Hamlet is going to have the Q2 and FF versions of the play separate (this is probably ISBN 1904271553 / 978-1904271550), and points it out as a good indication of the future.

There's a book in my library that goes one further, even: it has all three of the texts side by side! It's a wonderful, if fairly old, book, and I remember I liked it so much that I looked it up on Amazon. I think it was going for 50-100 GBP or so, as many old academic tomes do. Someone ought to make a popular version of it.

2007-02-08 10:09 UTC:

Hmm, actually there seems to be a three-text edition of Hamlet by Arden somewhere, mentioned in the introduction to a Q2 based edition, ISBN 1904271332 / 9781904271338. Shapiro even reviews it:

"'The new Arden Hamlet is a pathbreaking edition, one that promises to change irrevocably our understanding of Shakespeare's greatest play.' - Professor James Shapiro, author of 1599: A Year in the Life of William Shakespeare" - http://www.ardenshakespeare.com/catalogue/product.aspx?isbn=1904271332

But it's not in the online Arden catalogue... it's probably the expensive 1603/1623 version (ISBN 1904271553 / 978-1904271550). Perhaps it's out of print already.

2007-02-08 11:36 UTC:

Yesterday I wrote a <100 line melding of the Whits and Flog source code, using the compromises that Cody and I had worked out. But in testing the code, I found that I was unable to paste in IRC logs, and it piqued my vexations with Markdown, so I've abandoned the code. Cody and I subsequently discussed what to do about it, and basically started to talk about a better wiki syntax, incorporating the best of Markdown, Avocet, Protoavocet, Pwyky, reST, and so on and so forth.

Cody came up with a nice spin on the Pwyky link syntax that I really like, and we decided that the Protoavocet way of doing preformatting is the win. Markdown still has a lot of sane stuff like *emphasis*, and reST has innovations such as auto-numbered footnotes, so we could draw a lot of that in. I'm wondering about writing an extremely self-documenting parser for what we're hashing out.

2007-02-08 13:43 UTC:

Awesome: in 1585 Robert Greene wrote a work called Planetomachia. He totally beat H.G. Wells to it.

2007-02-10 12:28 UTC:

The saga of the code merging continues: a mysterious commenter suggested not only that we call the resulting code "Flogits", but also noted that the text processing is just a component of what we're making, not the be all and end all of it. The code that I wrote on 2007-02-07 (hereafter known as The 727 Code) is pretty good apart from it using Markdown. Background:

So I'm ever more inclined to simply hold back the release of The 727 Code until I get something hashed out for a Text -> HTML handler, which will undoubtedly be along the lines of Cody's spec, and named "Avocet". Expect an increasing amount of text format posts on Whits if I actually manage to get interested in this.

2007-02-10 13:41 UTC:

One good use for Amazon's Mechanical Turk, or other similar "wave $20 at a hobo" systems, would be to get descriptions of Youtube Videos. When someone gives me a link to an article, I can skim it to see if it's interesting enough to be worth reading. When someone gives me a link to an image, the overhead of loading it and glancing at it is so small that it's worth doing it as long as the person who handed it over is known to emit awesome links.

But with Youtube, it's not like that. When someone hands me a Youtube video, all that I have to go on is the person's reputation for showing me stuff I'll enjoy (the primary factor), and the scant metadata on the video page itself (the secondary factor, but still often a deciding one). There have been many times where I've simply closed a Youtube tab because it's not really been worth spending five minutes finding out whether the video is any good or not.

So if I could cheaply pay someone to do that for me, that'd be cool. Of course the real solution is to somehow reward people to post better metadata on Youtube itself, perhaps by having a rating for the metadata itself as well as the actual video, and awarding some kind of... well I don't know. But there must be something that can be done about this, surely?

Cf. http://www.disobey.com/node/1632 ("Hobos are Cheap Robots").

2007-02-10 15:45 UTC:

The first ever Whits entry was about the Plexnet, a kind of Operating System for the Internet developed by Tav, a friend of mine. Today I've started to document the layers of the system, which is requiring squeezing the informational blood out of the Tav stone on the #esp IRC channel on Freenode. So far, so good: the Indexes layer, renamed to the Entities layer, is making sense.

When and if the document gets finished, I'll probably be plonking it on inamidst.com somewhere. Tav's a bit distressed because nobody's really got the idea of the system yet, so nothing's moving forward for him in this area.

Background information:

2007-02-10 16:07 UTC:

Morbus is making a card game very loosely derived from 1kbwc (gleep), and he just today came up with the rules and stuff for it, so I've been discussing some of those with him. It's all hush, hush at the moment, but there's a little bit about it in his request to the jQuery list for some help:

http://jquery.com/discuss/2006-August/009340/
- jQuery: RFP: 2 player card game?

I like the way that the email starts off, with its "every line ends with a sentence" thing that reminds me of David McCusker's blog from many years back, before he renamed himself Rys. There's also: '* I WILL, however, entertain cries of "impossible, Morbus."' Anyway, if you can help him out, give him a tinkle at morbus@disobey.com and say I helped you along your way.

2007-02-11 17:13 UTC:

Avocet, the structured text format that Cody and I have hashed out, is coming along much better than I expected. There's already a pretty much functional version that you can download and try out:

http://inamidst.com/proj/avocet/
- Avocet: Structured Text

The .py script is what you can use to parse the files, and the other files are examples so that you can see how the format works in lieu of documentation. The source is messy, but it seems like it works, so I even tried integrating it into The 727 Code that I mashed out of the Whits and Flog code. Again, much workage!

We're still not really sure what to call the new combined code. "Avocet" for the optional text processor is pretty good, and came from when we were hashing out names for the Pluvo programming language that I wrote. But "Flogits" or "Whitlog" or some other combination of the blog names doesn't really sound as good to me...

Suggestions welcome! Feel free to use this form:
http://inamidst.com/misc/feedback

2007-02-18 19:44 UTC:

Mimulus, the WYSIWYG XHTML editor extension for Firefox, got a bit of press recently when it appeared on reddit and a few other weblogs (some as a result of the reddit thing). I've been meaning to tinker with it further, because I figured out a way of fixing the most annoying problem with it, the fact that the caret keeps going missing--literally disappears from the screen so you don't know where the focus is. It's a really simple idea, and it works: encapsulate the region next to the caret in a span and then put in a left border.

The problem is, that means I'll have to do a huge code overhaul, and it'll make it quite messy. It'd be nice if Firefox just fixed the damn disappearing cursor, but I doubt that it's on their priorities list in a browser increasing beriddled with annoyances.

2007-02-18 19:53 UTC:

So I haven't been working on the new Whits/Flog code, but I have been busy taking notes on Shakespearean stuff. Today, for example, I plotted the excavations map of the Globe remnants in the car park of Anchor Terrace on top of a satellite view of the same, to pinpoint exactly where it all is; and I found out about Henry Jackson's letter mentioning Othello in 1610--very fun stuff.

Simon Rozet did just remind me about the Whits/Flog code though. The two main things holding it up are a) making a test suite and furthering the Avocet code, and b) coming up with a name for the new code and finalising other such features. Again, if anyone can help especially with the name, that'd be awesome.

2007-02-20 17:37 UTC:

To cut a long story short, MPlayer OS X rocks.

BBC News said that someone had unearthed a new JFK video, and eventually I managed to find a link to a WMV of it:

So I thought okay, download, play, easy. But VLC wouldn't play the file and nor would QuickTime, so I had to search about for something that would. The first thing that I found was a suggestion to install "Windows Media Components for QuickTime" on the Microsoft website, the Flip4Mac software, so I installed that but QuickTime still wouldn't play the WMV file.

I found another site (that I'm not even going to bother linking because it's clearly out of date) which suggested that the only way to do it is to download Windows Media Player for mac, so I got a .bin and a .hqx file of the source and found that I couldn't unpack them without StuffIt. I really don't like the kind of RealPlayer level of annoyance that the StuffIt sites doles out to its visitors, so I've been boycotting it for quite some time, and I couldn't find anything preinstalled on OS X to open those files, so there was another lead exhausted.

At this point I gave up and viewed it on a Windows box. But when I came back, I figured I might as well give MPlayer OS X a try, not because I really thought it'd play WMV files but because the interface is kinda cool. So I downloaded it and not only did I find that the interface is even better now, but I even tried the WMV file anyway and, you guessed it, it played it without a hitch.

http://www.mplayerhq.hu/design7/dload.html
- MPlayer 1.0, for Windows, Linux, and OS X

I got the 1.0rc1 binary for OS X. It makes you use one of those .pkg installer deals, but that's basically the only (very minor) frustration I faced with it.

Good work, MPlayer dudes.

2007-02-20 17:48 UTC:

Morbus is playing http://www.welovepuzzles.com/ quite a bit, and managed to get me into it too, so when he approached me with a puzzle to do with prime numbers I couldn't really do anything but obligingly help:

http://www.perplexcity.com/permalink/puzzle/587/
- Lexically Accumulative Prime Numbers Puzzle

Basically the puzzle was to find the biggest prime number that, when you successively take the first digit off, is still a prime number (you can't, apparently, use "0" anywhere).

Morbus went about it by getting a huge corpus of prime numbers and trying to find the biggest number that matches the spec. I went about it by doing a kind of naive path based search. The biggest problem was finding a decent prime number tester in Python. I tried a couple without much success, and one even let through a lot of numbers ending in "2" as being prime... Eventually though I found a package called mathfun and that pretty much worked, though it was rather slow.

The code I made as a result is here:

http://inamidst.com/proj/primes/
- Prime Number Code

But whilst that was running, I decided to take a look through the Wikipedia materials on primes and found that the problem was already known as the "longest left-truncatable prime" problem. The answer was on this page:

http://en.wikipedia.org/wiki/Truncatable_prime

So that's that. Chris(schmidt) was running the code too on his Dell Poweredge 2950 and basically blowing my process away, but presumably he quit the code at around 4000 iterations like me... it was just bogging down too much.

So there you go. Wikipedia > Python, I guess.

2007-02-20 18:02 UTC:

Simon Rozet was asking me about the ancient use of log:forAll in CWM, since he was looking into some of my old CWM work, so I wrote up the following thing (converted from IRC) to try to explain it:

When you have a rule like this:

   { ?p ?q ?r } => { ?r ?q ?p } .

The { ?p ?q ?r } bit is the query part, so you look for all triples matching those three variables. In this case, since each part of the triple is a variable, all triples will match it. If I had something like { :Sean foaf:knows ?person } instead, it'd only find all the triples where :Sean is the subject and foaf:knows is the predicate. Once it does the query, it makes a set of bindings.

So for example, let's say my instance data is:

   :Sean foaf:knows :MorbusIff .
   :Sean foaf:knows :ChristopherSchmidt .

And the rule is:

   { :Sean foaf:knows ?person } => { ?person rdf:type :Cool } .

Now, the query part of the rule is { :Sean foaf:knows ?person } so it'll query both of my instance triples; they both match. The first one will give {'person': MorbusIff} as the result bindings, and the second will give {'person': ChristopherSchmidt}.

Because it's a rule, basically what the second part means is "plug in the result bindings to this pattern and output it", so we'll end up with this:

   :MorbusIff rdf:type :Cool .
   :ChristopherSchmidt rdf:type :Cool .

So, the ?person thing is a variable in the query, and also a kind of template variable in the result side of the rule. But ages and ages ago CWM didn't have the ?variablename syntax, so you had to use regular qnames, and then put in the log:forAll statement at the beginning of the file to say that they're variables.

So instead of ?person, I could've done :person, or I could've named it :p. The name doesn't matter, as long as it's used consistently--it's a variable. Then at the top of the file I'd have to do:

   this log:forAll :person .

(Or "this log:forAll :p".) And CWM would therefore know that all subsequent mentions of :person (or :p) were actually intended to be variables, not URIs.

2007-02-20 18:07 UTC:

Also Being for the Benefit of Mr. Rozet, I tried installing bzr (Bazaar) using DarwinPorts, or MacPorts or whatever the heck it's called now, but for some reason it couldn't find any mirrors of the main packages:

$ sudo port install bazaar
Password:
--->  Fetching bazaar
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://bazaar.canonical.com/releases/src/
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-od.opendarwin.org/bazaar
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-msn.opendarwin.org/bazaar
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-bay13.opendarwin.org/bazaar
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-od.opendarwin.org/
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-msn.opendarwin.org/
--->  Attempting to fetch bazaar_1.4.2.tar.gz from
   http://distfiles-bay13.opendarwin.org/
Error: Target com.apple.fetch returned: fetch failed
Error: Status 1 encountered during processing.

The previous dependencies had installed fine. I'm not all that interested in using Bazaar anyway, so I'm not going to look into it further, but it's kinda strange that all of the mirrors should fail on that single package.

2007-02-20 18:13 UTC:

Chris(schmidt) was running some code that barfed on a malloc apparently because someone was using range instead of xrange. I commented that someone should just alias range to xrange in the Python source, but of course that'd cause problems for people who're expecting a list-like behaviour from the object returned.

And then I came up with The Idea. The Idea to have an object that is a generator in essence, but when you try to use it like a list, by calling a list-only method, it exhausts the generator and morphs into a list object.

Might be a cool thing for someone to hack on, but apart from this particular situation I'm not sure how useful it'd be. It is often annoying to get a generator back from something and then want to use it as a list, but changing the behaviour of all builtin functions that emit generators would be a pain, and wouldn't cover user code using yield anyway. Really it's the generator type itself that needs to be changed. If only Python used prototypes.

2007-02-22 20:16 UTC:

Ooh, I just found something of significance enough that I think it's worth submitting to a peer-reviewed Shakespearean journal. There's a single further step of difficult research to perform if I want to make it really, really good, but I've already made the basic discovery. It's nothing groundbreaking, but it does tidy a loose end up rather neatly. More details as I may divulge them, of course.

Sean B. Palmer, inamidst.com