About Bookmarks Contact Library Map Photos Search Talks
September
17
2005
11:30 pm
Tags:
Post Meta :

In a paragraph that spans two or more lines of text, a hanging indent causes all lines after the first to be indented. This is the opposite of a normal indent, where the first line of the paragraph is indented. A hanging indent is especially useful where the text is short, such as in a list of items.

Recently, I noticed that many of the items that appear on the side-bar of my website were hard to distinguish from one another. For example, in the menu of recent articles, long article titles gave a confusing appearance. It was hard to tell if a title was long, and thus wrapped to a second line, or if there were two separate titles one each per line. One solution to this problem of confusion is to add a hanging indent to all lists in the side-bar.

(CSS) provides an easy way to implement a hanging-indent. While there is no built-in hanging indent style, it is easily implement in lists with a combination of indent and padding specifications. The trick is to pad the list itself by a positive amount and then indent the list items by an equivalent but negative amount. For example, in my sidebar, I have padded all unordered lists by 1em (1 character width) and then indented all list items by -1em.

The CSS code looks something like this:


ul {
padding-left: 1em;
}
ul li {
text-indent: -1em;
}

September
14
2005
8:34 pm
Tags:
Post Meta :

There are lots of great ways to find out if your library has a book you want, but what do you do when your library doesn’t a have a book? In the case of popular books that have been recently released, you know your library will get them soon, but you also know there will be a long waiting list. You probably want to put a hold on the item as soon as possible. Your library might even provide a webpage listing the newest items. But by the time you get around to checking, the list of holds will likely be very long. Some libraries will email you when a book comes in, and a few even have feeds of new items. But even that isn’t perfect because for large libraries, the list of new items can be big.

What you want is an RSS feed that lists items that your library does not have yet. You want that RSS feed to be empty until the item is available. As soon as the item is in the catalogue it will show up in your feed and you can put a hold on it.

A year or two ago, I wrote a program that searches a catalogue, and returns the newest 20 items. I made the program so I could see the latest DVDs, Videos, and CDs. I recently modified that program so that it would search for books that my library does not have but I know they will get. In particular I was interested in the new, and positively scandalous, book by Peter C. Newman about Brian Mulroney. The book was kept secret until it was released and I knew the library would be ordering it any day, and I also knew there would be a long long line up for it.

Well, my program worked perfectly. I managed to get in the hold queue in position 50 (realize, that staff get to put in holds before patrons so you can never get in position #1. I’ve never managed to be any higher than position 8 at my public library for new items).

By this afternoon, mere hours after the item was ordered and added to the catalogue, the number of holds has grown greatly. While I am in position 50, there are 33 copies on order, so I should have the book about a month after the order arrives!

The nuts and bolts of the program works like this. I have a perl program that uses the Yaz Z39.50 library and an RSS library. I connect to my libraries Z39.50 server and perform a search for the item. I then generate an RSS feed as output. It contains some of the fields from the Z39.50 search results. In the case of searching for non-existent items, I generate an RSS file with no items. The program is run hourly from cron on my webserver.

I choose to configure firefox to pick up the RSS as a “live bookmark” and when the item was available, it was right there in firefox.

Now you might say, wouldn’t it be better to get these kinds of notices by email? I agree, email might be better. Instant Message or Text Message (SMS on a PCS phone) might also be better. Lots of people read RSS feeds all day so RSS is also a good candidate.

It would be interesting to have libraries start offering something like this to patrons as a service. The patron logs in and enters a list of items they want to search and when there are no hits, they can request to be informed when the library gets the item. The patron gets to choose how they want to be informed: email, RSS feed, text message or just by checking back on the web page. This would have a side-effect of letting the library see the most in-demand items.

My public library has a “request an item” form, but when you use it, you get a prompt response. Usually, the response is, “sorry, due to budget limits we will not be adding this item to our collection.” Of course that is just non-sense. Just because they are choosing not to add it at this very minute, does not mean they won’t add it. For example, I once requested that they add the video Colossus: The Forbin Project. It is an ideal compliment to many other films they have and is required viewing for some studies of philosophy, technology, embodiment, cyberphilosophy, etc. They will add this item some day, they just do not realize it yet. I’d like an automatic way to find out without having to manually search for it from time to time. I also know that someday they will offer the TV series Six Feet Under on DVD at my public library. Maybe not for a few years, but they will get it. When they do, there will be lots of holds. I’d like to be first in line.

Someday soon, before the Access 2005 conference I will clean up my perl code and release it as open-source. Subscribe to my RSS feed to find it when it is available!

June
9
2005
9:50 am
Tags:
Post Meta :

Today I learned a new command: stat. I never fail to enjoy learning a new unix command. Even after 10 years of being a I still find useful commands that I have never used.

The stat command is similar to the ls command in that they both give you information about files and filesystems. However, stat is more useful in automated scripts. For example if you wanted to get just the filesize of a file with ls you would have to do this:


ls -la myfile | tr -s '[:space:]‘ | cut -s -d ‘ ‘ -f 5

But “tr” and “cut” behave differently on different systems so this will not always work. On the other hand GNU stat is simpler and works well across systems:


stat -c '%s' "users1.txt"

« newer