Extending Jon Udall’s LibraryLookup bookmarklet

I routinely use three different public library systems (Los Gatos, San Jose, and Santa Clara County). Needless to say, searching all of them for a book is a real pain.

But today at lunch, a friend reminded me of Jon Udall’s “LibraryLookup” bookmarklet, which worked wonderfully, but still required three searches to check all three libraries. So I decided to extend the bookmarklet to do the work for me, and here’s the result:


javascript:var%20re=/([\/-]|is[bs]n=)(\d{7,9}[\dX])/i;if(re.test(location.href)==true){var%20isbn=RegExp.$2;void(win=window.open('http://146.74.92.11'+'/ipac20/ipac.jsp?index=ISBNEX&term='+isbn,'Santa Clara','scrollbars=1,resizable=1,location=1,width=575,height=500'));void(win=window.open('http://64.204.128.44'+'/ipac20/ipac.jsp?index=ISBNEX&term='+isbn,'Los Gatos','scrollbars=1,resizable=1,location=1,width=575,height=500'));void(win=window.open('http://mill1.sjlibrary.org/search/?searchtype=i&searchscope=1&searcharg='+isbn,'San Jose','scrollbars=1,resizable=1,location=1,width=575,height=500'));}

I’m sure there’s some easy optimization to get rid of all of the repetition in the JavaScript, but I’m lazy.

What I do wish I could do is have the bookmarklet open the results in tabs instead of popup windows, but I don’t think that’s possible without turning this into a Greasemonkey script or a real XUL plugin, and I’m lazy.

But if someone else has done it….

WorldCat would, of course, be a better solution, but it doesn’t seem to include the Los Gatos library (yet, anyway).

Gutsy Ghastliness

I brought home my old Thinkpad T41p from work for a few days; I had wiped out its disk in preparation for giving it to someone else, and so I had to install a new OS. My first plan was just to install Windows XP, but I didn’t have an OEM disk nearby, so I couldn’t use the license key which came with the machine.

So I decided to go the Ubuntu route. I had a 7.04 CD on hand, which installed with no problems, and then I upgraded to 7.10. That was all in the office, connected to a wired Ethernet.

But I wanted to be able to use the machine on my wireless LAN at home (and elsewhere). Using Network Manager and typing in my preshared WPA key didn’t work. And I tried it many, many times.

Eventually, I found wieman01’s OWTO: Wireless Security – WPA1, WPA2, LEAP, etc., which worked wonderfully well — I am up and running on my wireless right now.

I don’t know how easy it’ll be to set things up to connect to an old WEP network, which was my real goal in bringing this beast home for a few days, but I’m sure it can be done.

I do wish I knew why Network Manager didn’t do the job, though. Suggestions welcome.

Leopard for me

I visited the Apple Store on Saturday, thinking I might come away with a new iMac. But I couldn’t quite convince myself that I needed it.

So yesterday, I went back and bought Leopard, thereby using up almost all of my iPhone rebate (for some reason, the sales guy only applied $99.99 of the $100 to the transaction, and my receipt says clearly that I have one cent left). I took it home and installed it on the two-year-old mini.

There were no fireworks.

I did run into a couple of small glitches, though:

  • Quicksilver now shows up in the dock; there is rumored to be an update which solves that, but the official site is down, and I’m not willing to load an unofficial copy yet.
  • My userid fell out of sudoers, so I had to log in to my admin account and put it back.
  • I had to change my path to pick up the new system versions of Ruby and Python instead of the ones I’d installed into /usr/local/bin in the pre-Leopard days. I should uninstall those versions, too, but I haven’t had a chance to see exactly what’s been superceded.

I also found it necessary to put the Dock back to 2D view; the reflective shelf effect is cute for a few minutes. And I really don’t like Stacks.

But otherwise, it was pretty painless. And I haven’t noticed any loss of performance.

I still might want that new iMac, but the Leopard upgrade isn’t the excuse that I need to justify it.

No Leopard for me!

I had it all figured out. We were going to meet some friends for dinner in downtown Los Gatos this evening at 7pm — that would give me enough time to pick up Leopard beforehand.

So we left home just before 6, expecting to be parked by 6:05. But the traffic on North Santa Cruz was horrible, and going over to University didn’t improve matters. Finally, I detoured to the secret parking lot between Santa Cruz and University on the north side of Hwy 9, several blocks from the restaurant, let alone the Apple Store.

But that was OK; I could easily carry the Leopard box around. For that matter, it’d be easy enough to carry a new Mac mini.

But first we had to get to the store. And even the sidewalks were rather crowded. With dogs. In costumes. And their owners. And people giving the dogs treats.

Yes, it was Howlin’ Halloween in Los Gatos.

We pressed on. And as we crossed Bachman, I noticed something else odd — the stores and restaurants were dark, including the place we had reservations. And they stayed dark all the way up Santa Cruz, past the Apple Store. Most of the stores were closed, but not the Apple Store — they had a long line of people waiting, and every few seconds, someone would leave the store with a bag and a smile.

Since part of my hidden agenda for the evening involved having Diane try out an iMac, I decided to skip the store (somehow, much of the system’s charm would be lost if it was powered down) and accompanied Diane and Jeff to Borders in Old Town, which was brightly lit.

I tried calling the restaurant, but they didn’t answer their phone. So I called our friends, and we decided to try somewhere else, Di Ciccio’s in San Jose. As we left the bookstore, I saw that the lights were on again on Santa Cruz — I called the restaurant we’d planned to eat at and cancelled our reservation. They said, “but the power is back on”, but it was too late.

I hadn’t been to Di Ciccio’s in more than 15 years — not for any particular reason, but then again, there was no good reason to go there, either. The ownership had changed in the last couple of years, and I’d definitely be more eager to go back now. The food was quite tasty, even if the portions were too large; I’d rather have had a bit less food and saved a couple of bucks. We had a Clos la Chance 2005 Pinot Noir, which was very enjoyable, and which was priced quite fairly ($32, versus $30 at the winery or $25 from K&L).

And then we came home. I thought about going back downtown and getting my copy of Leopard, but on further reflection, a walk with Diane seemed like a better idea. And that’s what we did.

(Of course, I haven’t given up completely on Leopard — I’m making a backup of my existing disk so I’ll be ready for the upgrade. Tomorrow. Or Sunday. As John Gruber points out, “no one ever got hurt by waiting a week or two to install a new OS.” But where’s the fun in that?)

Open Letter to Steve Jobs

As Todd noticed, I (and many other iPhone early adopters) was a bit miffed last night at the speed at which the iPhone’s price dropped. I’ve been around technology long enough to expect price drops and capability increases…just not that soon.

Today’s note offering a $100 credit is a step in the right direction (and I’ve already got a list of things I want to buy from you, Steve, probably sometime in October).

But you know what would be a real way of demonstrating loyalty and gratitude to your early adopters?

An extra discount on the next generation iPhone. I want GPS and 3G, and giving me a break on an iPhone which includes them would be a great way to keep me on the upgrade treadmill…happily.

Looking forward to hearing from you real soon!

Do they know something I don’t know?

I’m staying out of the hot sun and playing two month’s worth of catchup with Quicken. As part of that joy, I downloaded my last couple of months of credit card transactions — sometimes Quicken automatically assigns a transaction to a category. It’s usually correct, but not always. And sometimes I wonder…such as today, when it assigned meals at Waffle House to “Home Repair”.

Not nearly as easy as it looks on YouTube

Like many others, I don’t like the earbuds that came with my iPhone. It’s easy enough to find an adapter to plug in any headphones for listening, but that doesn’t help when I want to use the phone. So I was delighted to find the DIY Earbud Replacement instructions and video from Engadget. I even thought about doing it myself, but since I knew I was going to be visiting my brother-in-law, an electrical engineer, I decided to wait and enlist his help.

Good decision. It turns out that the video doesn’t actually show the process of opening the earbuds (either the Apple or the JVC) — for the Apple earbuds, the careful application of a pair of visegrips was required to break the seal. The JVCs were harder — they took visegrips and tweezers and some muttering.

After getting the earbuds open, the rest of the process was straightforward — I watched Pete unsolder the existing connections; I undid the knots on the Apple buds and he cut off the (glued) ones on the JVCs; he soldered everything back together and hotglued the JVC bud covers back on. And presto! I have much better earbuds, complete with mic and switch, just like on the video.

Of course, the new earbuds don’t fit the shallow holes in the case I bought for the phone, so I’m going to have to do something about that — and I know it’s not enlarging those holes, because there’s no room available. It’s always something…..

Thanks, Pete!

Warwalking in my neighborhood

Most evenings, Diane and I take a walk through the neighborhood, but she couldn’t go tonight, so I went out on my own. I got bored pretty quickly and took out my iPhone, and just for curiosity, put it on the page where it’s looking for WiFi networks.

There were, as you might expect, dozens; I was pleased to find that most weren’t wide open, and only a few were named “linksys”. But there were other amusing SSIDs to be found: “StayOffMyNet” (locked), and “god” (wide-open), to name but two.

As I said, I got bored pretty easily….

First programming language?

A reader (and friend) writes:

My nearly 17-year-old daughter is starting to be more and more curious about what it is that I
*DO*, and computers and stuff. Which leads us to the perennial question:

What programming language should beginners be exposed to first – this
year? Just to give them a basic notion about programming concepts – not
to get them a job.

I’m completely stumped. I live in a world of C and C++ and Java and
Perl and more recently Ada – yes, Ada – from which I am unlikely to
escape.

Is Python the answer? Or ??? I can’t imagine that any of the languages
I listed above is a candidate. Pascal is irrelevant these days. Logo
(“turtle graphics”) were cute 20 years ago. What is it now? Something
simple to grasp but that isn’t too limiting.

Curious what your ideas are.

…S

My first programming language was Fortran on an IBM 1620; I decided that wasn’t a reasonable recommendation, despite the availablility of an 1620 emulator (I had to drive 5 miles each way uphill in the snow to get to the computer).

Instead, I answered thusly:

I, of course, am still partial to Rexx, but I don’t think it’s a good beginner’s language any more, because you can’t do “interesting” things in it (like make GUIs happen, or manipulate other programs, or do things on the web). And, to be honest, I haven’t written anything in Rexx in a few years and don’t even bother to install it any more.

So my suggestions would be Python or Ruby.

Python, because it’s got a very clean syntax (as long as you don’t mind that indentation is syntactically significant), because it is just object-oriented enough (and these days, I think starting with an OO language is the right answer), and because there are packages available that let you do damn near anything (though I still haven’t gotten around to writing anything GUI….). The documentation is pretty good, and there are at least two decent books to start with (Learning Python and Dive Into Python, which is also available free online).

Ruby, because all the Cool Kids are using it (especially with Rails). It has much too much syntax for my taste, and there’s often More Than One Way To Do It, which you may consider to be good or bad. I haven’t really gotten into Ruby or Rails yet, because I haven’t had a real good use case, though that may change.

Other languages to think about:

PHP, the language of WordPress and MediaWiki. There’s even a book, PHP For Teens, which might be interesting from a target audience perspective. OTOH, PHP’s natural habitat is in creating server-based apps, and that might not be ideal.

Java, just because. I’ve been able to avoid it so far, but the time has come for me to get my feet wet there, so I can vouch for Head First Java as a good introductory book.

And one of my colleagues here suggests JavaScript — you can write it and play with it right in your browser and get instant gratification.

Both S. and I are interested in your thoughts on this…comment away!