Links

pmuellr is Patrick Mueller

other pmuellr thangs: home page, twitter, flickr, github

Friday, March 23, 2007

Wake County Library Lookup

In my previous post regarding using libraries, I mentioned using Josh Staiger's Wake County Library Lookup Greasemonkey script, which annotates Amazon.com pages with links to the library, if the library has the book in it's collection.

What I neglected to mention is that I have been having problems with the script for the past few weeks. One problem was that a number of Amazon pages no longer contained the library links at all; I think this is due to Amazon's new URL scheme. The ISBN was being pulled from the URL, and it's not always there anymore, or in a different place. The search for the ISBN has been expanded so that now more books will be candidates for library lookup.

The other problem was that the page layout of the Amazon pages changed, such that the links Josh was adding were no longer appearing. Dark XPath and DOM hackery. ~shiver~ I fixed that by not placing the library information in-line with the page the way Josh was doing, but placing it at the top of the page. A bit icky, but it's pretty much guaranteed that the links will show up now; the script is not currently dependent on the shape of the HTML on the page.

I talked to Josh about the issues earlier this week, and he mentioned he hasn't been keeping a close eye on the script, because he doesn't actually live in Wake County anymore. Although he has been making some updates, as recent as this January. What a trooper!

So it only makes sense at this point to fork and maintain a new version of the code, since Josh really doesn't have a reason to do this anymore. My version of the script is here. It's highly likely that I won't be updating it, till Amazon or Wake County make enough changes to their pages to break the script again. Which is pretty much guaranteed. The perils of screen scraping. But I'm certainly open for any thoughts on the functionality.

Thanks for putting the time into this Josh!

twit-growl

twit-growl-snapshot.png

So, I'm not totally convinced on the Twitter thing yet, but I'm an information junkie, so how can I resist?

Twitter will feed you messages via SMS, IM, or you can go to the website. However, I don't do SMS, the IM has been broken since I started playing with Twitter, and the web site is a web site. I don't really 'check' web sites anymore.

So, I was thinking on the drive home from work that I should hook Twitter up with Growl. In fact, I figured someone must have already done this. And they have. The first couple I looked at on google were Ruby, and didn't seem fully operational, so I thought I'd write one. And here it is. It's rough; you'll have to install a Python library, and install wget. You can do it.

Took a total of 1.5 hours; my Python is a bit rusty; had to consult the manual constantly. But there's something just fun about writing Python; I should do more.

Tivo'd baseball?

Monday, March 19, 2007

Free Books!

Like Bill, I've had a problem accumulating books, but I've been much better about this for the last few years. I was using Safari Books Online for a while, but didn't really use it enough to justify the $120/year or whatever it was. It appears the price has gone up to $20/month, which is double what I think I used to pay; definitely can't justify that.

A handy little Greasemonkey script from my new next-door cube-mate, Josh Staiger, Wake County Library Lookup, opened my eyes up to a free resource: my local public library. (Thank you Ben Franklin!) If you don't happen to live in Wake County, North Carolina, perhaps you can find a Greasemonkey for your library, here.

I've been a life-long library user, so it's not like my eyes were just opened up to the possiblity of free books, but most libraries don't have a great selection of tech books, or at least recently available tech books. There are options; you're a tax-payer (probably), so why not ask your library to buy a book you want. For Wake County Public Libraries, head over to the Adult Services section at the library, and ask the librarian about this. They'll give you a card to fill out; ours wants to know, along with the usual stuff, the publisher, publication date, and ISBN. Stuff you can get from Amazon.

In lieu of ordering the book, at Wake County you can make a request for an InterLibrary Loan, where the library will attempt to get the book from a different library system. You can do this from your comfy chair at home, via the web. Our library is great; I request books from their (fairly yucky) web interface, they email me when the book is ready to be picked up. Head over to the library, walk over to 'my' shelf and find the labelled book, and checkout.

I just checked out Pragmatic Project Automation: How to Build, Deploy, and Monitor Java Apps, from my library this afternoon. It happened to be the only book, besides the GTD book, on Bill de hÓra's Ten books for the working programmer, which my library had available. I put in an InterLibrary Loan request for another one.

BTW, I just created an Amazon list for Bill's top ten list, plus some of the other books mentioned in the comments.

Of course, sometimes you need to own the book. But many times, you don't. You just need to read it. Or you might want to preview it, before actually purchasing it. A more extended preview than you can get from a visit to your local bookseller.

Saturday, March 17, 2007

Get Polar

Catching up on my podcasts, I listened to Jon Udell's interview with Steve Vinoski on the way to work yesterday. At at 20:09, Jon asks Steve something to the effect, wouldn't it have been better if sides in the REST vs. WS-* debate weren't so polarized? Steve replies back "the polarization has opened a lot of eyes that may not have happened otherwise". He's so right.

I frequently play's devil's advocate, simply to get new thoughts injected into a conversation. It's way too easy to just nod your head and say 'uh huh'. Remember, innovation happens elsewhere.

There's an interesting twist here, also, regarding persuasion. Robert Cialdini, in Influence: The Psychology of Persuasion, talks about reciprocation. In trying to persuade someone, start with an offer you know they will refuse. Follow-on offers that are more attractive, won't seem nearly as outrageous; you've changed the expection level. Additionally, in your follow-on offers, you've actually 'given' something to the offeree; you've lowered the cost of the offer. People don't like to be in debt to other people, and will frequently expend more than the debt is worth to remove the debt.

Thursday, March 15, 2007

SQL grumbles

So on Elliotte Rusty Harold's recent post PUT is not UPDATE, I made a comment about 'avoiding databases at all costs'. And I'm sticking to it. Kind of.

A later comment, obviously directed at mine, claims: 'avoiding databases is like avoiding surgery for voodoo'. And such. Well, that's true. I could hardly have made it through 20+ years at IBM by completely avoiding databases. I actually cut my teeth as a youngun doing PL/1 programming for CICS using DL/1 databases (SQL was just becoming popular then). And wrote some specialized database code for natural language grammar parsing. And of course, it's been impossible to do demo-ware for products I've worked on in the various 'development tools' organizations I've worked with, without having a DB/2 database in the story, especially since "there's no such thing as an application that doesn't have a database behind it."

That doesn't mean I have to like it.

Here are my problems with databases/RDBs/SQL:

  • Is every data persistance problem best solved with a relational database? I don't think so. But you don't see too many people using hierarchical databases anymore. GetNextInParent anyone? Or VSAM. B+ trees. Sure, Berkeley DB carved out a niche, but then of course, Oracle bought them. Relational. Brainwashing, plain and simple.
  • I don't actively follow the SQL standards, besides knowing there are many of them. And yet, the actual 'standardization' is not terribly great. When I talk to folks who have products that support some set of databases, and ask them about supporting others, it's a "Simple Matter Of Programming" to add that support. Meaning, porting work. It's perfectly fine to differentiate on quality of service, but why can't that BE the differentiator? Why do I have to port to other databases?
  • SQL. The Language. OMG. It's COBOL. English. But I'm a programmer; please give me a functional interface! I'm hopeful that the LINQ project will help bring some sanity to the space. And I hear that the Jazz plumbing is using a functional-ish database access layer. Thank You!
  • Sometimes files are good enough. And they work great on the web, behind a web server, because you get all the creamy RESTy cacheability (ETags, Last-Modified, etc) from the web server. And now it's even easier to lie. Squirrel your persistance story behind a FUSE file system, so you can provide a simple file-based front-end.

So I would be remiss to note that I've decided to NOT use a file-based persistance story for my gRESTbook project, like I had been thinking, and am using ... gulp ... sqlite3. In the end, even with the general ugliness I find in databases, they do provide enough value for me to put up with them. Or, you could say that this is the simplest possible thing I could get working at the moment. There's room for exploration of other alternatives later.

I just updated the project with the data model and tests for it.

Wednesday, March 14, 2007

PHP JIT

Last week, on the PHP-DEV/php-internals mailing list, Jakob Santos proposed a JIT compiler for PHP. Rasmus responded with (paraphrasing) 1) a JIT won't help PHP and 2) PHP doesn't need a JIT, it's just glue code around functions written in C anyway.

Some people countered these arguments. :-)

And then yesterday, Jakob posted the beginning of the journey to his blog.

Interesting; I look forward to following this work.

Tuesday, March 13, 2007

Bubbly Job Market?

I guess the job market for programmers must be hot right now. Just today, I had two friends that both asked me to be references for jobs they're applying to. (I'm truly honored, thanks). And I've been getting resume-search-hit-yielding cold calls from recruiters now for the last month or two. Email, work phone and home phone. My home phone! Wow, someone so desperate they did a second search to get that number. What's next? IM? Twitter? Second Life? Probably as easy to track me down in places like that, as it is my home phone number. Except for the fact that I don't use Twitter or Second Life. heh

BTW, not that it matters, because cold callers of course aren't going to be reading my blog, but ... I'm not actually looking for a job. I enjoy causing trouble where I am.

Remembering Web Connect

In Minding Your Business With Smalltalk (part 2 of 4), Steve Hunter mentions using the VisualAge for Smalltalk Web Connect feature. Wow. A blast from the past. I worked on this in a very small team back in 1995 or so. Before servlets. Before Apache httpd.

We had a lot of fun inventing stuff. HTML editors inside the VisualAge Composition Editor. A way to forward requests from a web server into a live Smalltalk image; we called ours CGI-Link; ParcPlace had something similiar; both of these are of course extremely similar to FastCGI, which was also created at about the same time.

The closest I could actually get to a date when I worked on this was based on the presentation I did at OOPSLA. Late 1995, we apparently had stuff working. That presentation is funny; screen shots of the VA composition editor, the OS/2 Web Explorer browser (remember how it used to let you store up to 10 bookmarks! ~shiver~). The slides were actually constructed with a small REXX program; I remember later whacking the Smalltalk compiler so I could do slide presentations as Smalltalk classes.

Friday, March 09, 2007

Flex Tooling

Adobe Flex Builder 2 - $500. Youch. That's way over the sweet spot at which I'll willing to plunk down some cash for a software tool.

What is Adobe Flex Builder 2 anyway, assuming you don't want to follow the link above? A set of Eclipse plugins that provide a development environment for folks developing with Adobe Flex. I can only imagine this includes things like syntax-coloring editors for ActionScript / MXML, code completion for the same, debugging, etc. For $500, that's what I'd expect. But I don't really know what it includes, because for $500, I have no intention of ever buying it, myself. Why even find out what's in it?

I can't really complain about this; just over 10 years ago we were selling VisualAge Smalltalk for $3000 a seat. The price has gone up since then. And since Adobe is giving away the Flex runtime, they have to sell something to keep the stockholders happy. I'm not stockholder, so it's ok if I'm not happy about it.

It would interesting to see Adobe break this out a bit more, to make the tools a bit more approachable to various cheap-skates like myself. They of course have student pricing, but that doesn't help me. What about some kind of subscription model, like MyEclipse?

I'm not going to wait for that to happen. A lot of the literature I've seen around Flex puts the Builder 2 eclipse plugins right in your face, as if that's the only option you have to develop with Flex. It's not. I'd love to bookmark a link to the 'free' (as in beer) SDK, but the obvious download path goes through un-bookmarkable links (in Flash? heh), as well as a required sign-in to your 'Adobe account'. So here is the 'english bookmark'.

  • Start here: http://www.adobe.com/devnet/flex/
  • Click the tab "Downloads" under the title "Flex Developer Center"
  • Click the link "Download and try" link under "Free Flex 2.0.1 SDK (included with Flex Builder 2)"
  • Sign into your Adobe download account.
  • Half-way down the page is the "Free Flex 2 SDK and Japanese Language Pack"

And I should note that the tools are implemented in Java. The list of platforms supported, assuming you have Java installed, include: Windows 2000, XP, Server 2003, Mac OS X 10.4.x, Redhat Enterprise Linux 3 or 4, Suse 10, Solaris 9, 10.

Whew.

After 'installing', you are left with a set of command line tools. Time to get busy!

So what I need to find out is how painful life will be without the amenties the Eclipse plugins presumably provide. I can deal without code completion and syntax highlighting. I might be able to fudge a bit on the syntax highlighting by using a plain old XML editor for the MXML bits, and maybe a JavaScript highlighter for the ActionScript bits. But I assume there is no story for debugging. That may be painful.

On the other hand, this is an opportunity to build some new tools. My favorite 'subject area' in programming. Programming itself.

new gRESTbook()

As atonement for my sins, I've started a new mini-project called gRESTbook. The idea is to actually stop spouting off about REST, and just waving the "it's easy and it's cacheable!" flag, and writes some code. An example. Of a really simple service, but complex enough to show all the interesting generic challenges. Remember web Guestbooks? That's even easier than the old todo list that we usually used to use as an example app.

I've been meaning to do this for a while. Actually, what I really want to play with is stuff like this (lifted from the project page):

  • machine- and human-readable descriptions of services
  • machine- and human-readable descriptions of data flowing through these services
  • library-ized engines to handle common RESTy patterns
  • programming language 'interfaces' that I can use to plug existing data into the library-ized engines
  • finding out what nice looking client interfaces to RESTy services look like

But you have to crawl before you can walk.

And I also want to play with the client end as well, since there are plenty of unknowns in that space as well. Currently planning on using Flex for the client.

I'll sporadically post back here as significant function becomes available ...