Archive for September, 2006

15 Septembris 2006

One week left!

We’ve gotten some excellent proposals for “Five Weeks to a Social Library,” but there’s definitely room for more. The CFP closes a week from today.

It’s okay if your service isn’t completely shiny and if the path to it hasn’t been roses. I strongly believe people need to know these things!

So let’s see your proposal. Yes, you.

DSpace batch import hint

DSpace’s batch import is pretty reliable; whenever I’ve had a problem with it, the problem has ultimately been Between Chair And Keyboard.

The one annoyance I’ve found, though, is DSpace’s inability to reorder bitstreams for display. Once you’ve dumped a bunch of files in an item, you’re stuck with last-in-first-out.

There’s actually an easy fix. When you create the “contents” file, which you do programmatically if you have any sense, put the list in reverse-sort order. That way, DSpace will display the bitstreams in the order you want.

In Python, simple calls to list.sort() and list.reverse() do the trick. I expect it’d be some horrible convoluted gyration in Java. I’m just sayin’.

14 Septembris 2006

Travel plans

Well, agreements are agreed and contracts are signed, so I can stop being cloak-and-dagger about my upcoming travel plans.

Late next month I’m going to US Regional ETD 2006. Not speaking at this one, just absorbing useful knowledge.

I’ll be spending the last week of November in London and Oxford, as I have been invited to put my head in the lion’s mouth and speak to an international STM publishers’ association about how they might earn extra researcher interest (and revenues) with social software.

And next April, I will present “What’s Driving Open Access?” to the Texas Library Association’s annual conference in San Antonio. I am definitely looking forward to this; judging from past conference websites, TXLA really knows how to put on a conference.

If you’ll be at any of these and you’d like to meet up, by all means holler.

13 Septembris 2006

Java grunt du jour

So half my Java class failed last week’s little quizzie, which was doubling as an entrance exam (a humane practice; more classes should do it). Not me. I may be clueless, but I’m not that clueless.

My reward is the first programming assignment. I ripped through three-quarters of it pretty quickly (allowing for the usual number of “why the eff do I need parentheses here, dammit?” moments), but a find-listed-duplicates exercise got me really, really wishing I were writing Python. (Until a clarification from the professor came through, I thought we weren’t allowed to use java.util.*, which would have meant no ArrayList, just dumb arrays. Imagine my annoyance.)

I did the stupid little problem. But damn, it’d be easier in Python. Phooey on StringTokenizer.

12 Septembris 2006

DSpace hack: better browsing from items

Research hath shown that most people who land at an item in a DSpace repository have not followed the flower-strewn garden path to it; they’ve gotten there via a search engine. If the item is to their liking, they are quite likely to ask “What related items does this repository contain?”

An out-of-the-box DSpace item page offers one answer to that question: a link to the collections that contain the item. That’s not a bad answer, not at all; it’s good to offer some context. But it’s not the only possible answer, either. What about more items by this item’s author? What about more items with the same subject keyword?

(Yes, yes, I know all about how horrible repository keywording is. I’m still wading through the subject browse in the repository I run, cleaning things up. I’ve murdered 300-odd subject keywords entirely since I started, many of them by exerting a bit of authority control. I have some choice screenshots of pre-cleanup subject-browse pages for the edification of future generations, or something. Even so, “more items by keyword” is still an appropriate browse choice, especially since not all repositories are slapdash about keywording.)

This can be improved. It’s not the world’s prettiest hack, and it’s tucked away in a bizarre corner of the code, so bear with me here. As always, you hack DSpace at your own risk; I can’t promise that you won’t break it by following my instructions.

You’re looking for the file /src/org/dspace/app/webui/jsptag/ItemTag.java. In that, you want the render() method, which starts with the line private void render() throws IOException. It should be kicking around line 282 somewhere, but don’t quote me on that, as I’ve hacked this file a lot and I don’t know where anything started out any more.

What you’re going to do in broad terms is check each chunk of metadata to see if it’s an author or subject, and if it is, you’ll turn it into a link to the appropriate browse-by page. Fortunately, existing code does similar checks for dates and linkitude, so it’s not too hard to suss out how to do this.

Next, look for the lines that initialize “is this a…” variables:

            boolean isDate = false;
            boolean isLink = false;

Add a couple.

            boolean isAuthor = false;
            boolean isSubject = false;

Now skip down a bit, after the code that switches isLink to true if “link” figures in the name of the metadata field. Add similar code to check for authorness or subjectness:

if (field.indexOf("contributor") > 0 || field.indexOf("creator") > 0)
{
     isAuthor = true;
}

if (field.indexOf("subject") > 0)
{
    isSubject = true;
}

Skip a bit further down to the for loop that goes through each bit of metadata in the list. It starts with the line for (int j = 0; j < values.length; j++). There’s a set of if/else if/else statements starting with if (isLink). We’re going to add some else ifs in the middle of that:

else if (isAuthor)
{
    out.print("<a href=\"" + request.getContextPath()
     + "/items-by-author?author="
     + URLEncoder.encode(values[j].value, “UTF-8″)
     + “”>” + values[j].value
     + “</a>”);
}

else if (isSubject)
{
    out.print(”<a href=”" + request.getContextPath()
    + “/items-by-subject?subject=”
    + URLEncoder.encode(values[j].value, “UTF-8″)
    + “”>” + values[j].value
    + “</a>”);
}

And that should do it. Authors and subjects for an item now link to their appropriate browse-by pages.

I believe, but am not sure, that this increases the density of web-spider crawls of your repository. If this is a problem for you (and it has been for us lately), use robots.txt well or don’t do this hack at all.

WCAG rot

I popped a patch into DSpace to leave empty alt text for thumbnails on item pages. Every single person I know who relies on screen readers for the Web tells me that putting an image filename as alt text (which is what DSpace currently does) is intensely bothersome.

Patch got rejected. Why? Because WCAG says there has to be a text equivalent for everything. Naughty naughty, no alt text.

Grargh. I am annoyed. Why does WCAG rot have to get in the way of doing the right thing?

I resubmitted the patch with “thumbnail” as alt text, because that’s a marginal improvement over the filename. I think it deeply stupid that I have to do that, because it means dumping another line into the internationalization file, but so it goes.

9 Septembris 2006

I only thought I hated Java

After a snafu with the ISBN, the bookstore finally managed to lay its hands on copies of the textbook for my remedial Java class, so I have been catching up on reading.

Yeah, yeah, I said I hated Java. Well, I don’t any more.

I LOATHE THIS LANGUAGE WITH A PASSION THAT BLAZES UNCONTROLLABLY.

Oh my $DEITY, how many more things could they have designed into this language that make it easy for me to screw things up? Interfaces, decorator classes on every little freakin’ thing (the gyrations necessary to get a string out of a file have to be seen to be believed), wrappers all over hell’s half-acre ($DEITY forbid I just not give a damn what kind of number I’m seeing at any given time…), special rules for primitives (… or whether it’s an object or not…), Stupid Exception Tricks…

Look. I am not a very good programmer. Let’s just take that as read, okay? I screw things up enough all by myself. I want a language that lets me get stuff done in spite of my well-known tendency to screw things up, and gets out of my way otherwise.

Java is not that language. Java is absolutely wonderful at finding new and annoying ways to get in my way. So much for OOP being the silver bullet. If Java is the poster child for OOP, gimme a procedural language, thanks all the same, and preferably one whose VM doesn’t eat new-model computers as a light snack.

Java is Teh Evil. The more I understand about it, the more I wish I could kill it. Preferably with a Beeblebroxian very large axe.

Underfoot

Baby tigers quickly master the commonest skill of felines everywhere: getting underfoot. Mama tiger was very good about not stepping on them, though she didn’t bother worrying about them when they knocked each other around or landed smack on the ground after gunning for her.

I couldn’t manage to tell the three of them apart; they’re the same size from where I was standing, and I’ve not got the visual intelligence to make sense of stripe patterns. I’m pretty sure it was the same one every time who would start squawking when it lost track of where mama-tiger was, but I’ve no notion which one that was.

They’re imitative little cusses; they ignored a chunk of log on the second tier of their yard until mama-tiger sharpened her claws on it, whereupon they busily did likewise—which was silly cute, because they had to climb bodily up on the chunk to get their claws into it. Mama-tiger didn’t have to teach them to jump, though. They were almost entirely dependent on the stairs between tiers when David and I got there, but at the end of their outside-time they’d learned to scramble up some of the rocks and weren’t afraid of skipping a few steps with a jump down.

If you can get to the zoo between 8 and 10 in the morning, I do recommend it. How often does one see baby tigers in a lifetime?

In Amazonia, we got to watch the big fish getting fed, which jazzed David because he really likes the big fish. Up top, quite a few flowers were in bloom (mostly yellow ones, for some reason), and the sunbitterns! were! nesting! One of them gathered leaves and creepers and whatnot to take up to a wide branch by the window, while the other hung out nearby and displayed gorgeous dark-gold, rust-red, and black sunspots. I’ve never seen a sunbittern do that before—it’s spectacular, and David had a hard time dragging me out!

(In passing, I hope Amazonia won every zoo design award there is. It’s an amazing building design. I can’t imagine improving on it.)

We ate lunch on the tamarin trail, though those small souls did not make an appearance, before trudging up to the aviary. They’ve been moving birds around; the argus pheasants aren’t in the open enclosure with the ducks any more, perhaps because Mr. Pheasant had gotten too used to hopping out of it. A little burrowing owl watched me closely—my hat, maybe?—its head jerking from side to side to train its eyes on me no matter where I went. The learning center was open, so we poked through an awesome pile of cast-off feathers (including argus-pheasant feathers).

In the indoor open-fly zone, we were treated to the most astonishing duet I’ve ever heard: sunbittern and crowned pigeon. The latter has a deep, hollow, echoey sort of voice that’s reminiscent of a lion’s “oom” heard from a long way off. I honestly thought the noise was from outside the aviary somewhere until David got me watching the bird, which ducks its head and inflates its chest to speak.

In the outdoor open zone, we found the tragopans and the bamboo-partridges, the hammerkops (Dutch name, I presume?) and the laughingthrush. And the cormorant, whose throat rattled as it digested its fingerling fish. (The waterfowl are moulting, so they’re not as pretty or as active as in spring.) We saw the bustards getting fed, and defending their food from the ubiquitous Nycticorax, who isn’t quite as numerous in September as in spring, but scrounges from the zoo birds nonetheless. We also saw a young flamingo; you wouldn’t think grey-brown plumage would be conspicuous, but it is when all your neighbors are salmon-pink!

We popped up to see young Tai-shan in his building; he was contentedly napping guarded by his mom. Better so, probably, given the number of disgustingly rude yahoos who think nothing of popping a camera flash in a wild animal’s face. What is it with people? Do they not realize they are being pointlessly cruel? Poor Tian Tian was showing his teeth, for all the good it did him. They thought he was “posing.”

Some days I hope these yobbos try this with a bear in Yosemite or Yellowstone and get themselves savaged; it’s no more than they deserve. The only problem is that the poor bear would be killed. Buy a fricking postcard, people. Or at least learn to take non-flash pictures.

Meandering back down, we peeked in at the invertebrates (what’d they do with the nice cuttlefish? they aren’t there any more!) and the small mammals. There is, it turns out, something cuter than a baby tiger—and it’s a baby meerkat.

We headed over to Meskerem in Adams Morgan for the best in finger food. Hit the spot after a crowded day. I got home tired, but—the real reason for this post’s title—I was wearing one of my new pairs of Munro clodhoppers by way of trial by fire, and nary a blister to be found. That’s a good pair of shoes.

7 Septembris 2006

Mission haiku

Rochelle in LaCrosse haiku’d her library’s mission statement and invites us all to create haikus for personal mission statements.

Could. Not. Resist. So here’s mine:

Electronic text.
Durable and attractive,
free to all users.

6 Septembris 2006

Rehearsal tidbits

I walked up to get my name tag just as a new chorus member was arranging for receipt of his music and rehearsal CD.

“What part do you sing?” the chorus manager asked him.

“Soprano,” he said sepulchrally. Everybody nearby broke up laughing.

(Hey, it could have been true. Nobody would figure me for a weak little countertenorish warble…)

Seats get reassigned every year, so I had high hopes of getting off the front row. No such luck. I figure they figure if I’m singing the right stuff, everybody else must be too. Keep the pros close—and the pathetic amateurs closer…

But when Noah lined up the animals for a group photo before embarking, the elephants were in back. I’m just sayin’.