22 Sep 2002 redi   » (Master)

Since Advogato's HTML subset is on topic at the moment, would anyone be interested if I knocked up a patch for mod_virgule to make <person diary="23">redi</> link to a particular diary entry, rather than just to the person's personal page? When referring to something in someone else's diary I prefer to link to the relevant entry, as otherwise cross-referenced diaries become harder to folow once the entry has moved off their personal page and/or recentlog. This would make it easier to link to a particular entry without using an <a> tag and entering the whole URL for the diary entry. Update: not so easy, doesn't look like mod_virgule can handle attributes on it's special_allowed_tags, something like <diary>redi:23</> would be needed.
Update 2: if it's wanted I've got a patch to do exactly that. Contents must be zero or more alpha-numeric characters (account name) followed by a ':' followed by zero or more of numeric characters (diary entry to link to).

I think I'm too ill too do any complicated coding today. I'm looking at more examples in Langer & Kreft's IOStreams book, and despite having made every single correction listed on the book's errata pages, I'm convinced their example code for a streambuf that does buffered input is broken. There are several places where a value is multiplied by sizeof(char_type) so byte-wise functions such as read(2) and memmove(3) will work correctly, but I'm sure they've applied it to the wrong values. Rather than multiplying the number of items by the number of bytes per item (to give the number of bytes) they've multiplied a pointer offset by the bytes per item. This is wrong, as the rules of pointer arithmetic in C++ take care of this anyway. Despite something like 200 errors being listed on the book's website, this hasn't been reported yet, presumably because the code's only been tested where sizeof(char_type) == 1 and so it makes no difference what you multiply by that size. I think I'd better go back to bed until my head's clear enough to decide if I'm right. I assume I'm not and when I read this diary entry with a clear head I'll be terribly embarrassed.

(John, if you read this, output is now fully buffered - just need to finish the input case and correctly switch buffers and states when changing between stdout and stderr - and figure out whether these examples are wrong)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!