Archive for December, 2005

Real World Prince of Persia

0

This guy is freaking amazing. Check out this Russian free climber. It’s like watching the kung fu movies except all the moves are real. Via Will Price.

Difficulty PUTting up with REST

3

I want to be a good REST citizen. I really do. But it’s not easy.

GET is supposed to be idempotent and side-effect free. Excellent. I’m all for it.

So here I am putting together a little app and I need to design my Web API. The right thing to do is:

PUT http://parand.com/sessionid/currentState (change state)
GET http://parand.com/sessionid/currentState (get state)

Neat. One URL for both. (Btw, is the session ID in right place? Should it be http://parand.com/currentState/sessionid instead?)

Now to actually make it happen. The API will mostly be called from Web browers (AJAX!), and thankfully XMLHTTPRequest supports PUT. Good.

But how does the backend handle PUT?

Hmm. I’ve handled GET and POST plenty, but how does one do PUT? Apparently with something like this on CherryPy.

So I need to plug in this new piece of code as my main controller, which makes me nervous. But more than anything, I just don’t want to think about this. This is just plumbing for my silly little app, and I want to think about the app instead of how to handle PUT. I’m sure handling PUT is built into CherryPy, but I can’t seem to find it.

Btw, notice how CherryPy’s philosophy is that GET and POST should be transparent to the developer:

It doesn’t matter whether the parameters are sent with a POST or a GET, or if they’re a small string or a large file that’s being uploaded. They always end up being converted to a regular python string and they’re passed as an argument to the function. It’s all transparent to the developer!

Did I get that right? Isn’t that very not REST?

Now that I think about it, I’ll probably have visual basic clients also, and possibly plugins to various Office products. Do those do PUT? I know they do GET.

Anyway, I’m trying to persevere and keep on my little quest to do PUT. But the trouble is, these little guy keeps calling me:

http://services.parand.com/setCurrent/sessionID
http://services.parand.com/getCurrent/sessionID

Bad, bad. I try to ignore them, but there’s this little voice that keeps telling me I could’ve implemented my API already if I had just gone with GET from the beginning instead of all this digging around.

So I’m sure there’s an easy way to do PUT, but it’s eluding me, and I’m very tempted to just GET on with it. To all the RESTians out there, how about putting together guides that spell out exactly how to implement PUT (and all the rest of the REST recommendations) on all the different back-end (and front-end while we’re at it) technologies out there? Philosophy is good, but particality is driving.

I don’t get it: XSLT, RDF, XQuery, XLinq

2

It seems to me that I should like XSLT, be waxing philosophic about RDF and how it will be the future of everything, and be into XQuery (or at least XLINQ).

But in truth I don’t get any of them.

XSLT: It seems to me transformation is complex. It appears it requires a programming language. It strikes me I know a couple of those already. It strikes me that XSLT is yet another, and that I would rather use one I already use for everything else to do my transformation too.

It’s just odd to suddenly jump into a weird XML dialect to do transformation when I do everything else in some other programming language. Domain specific languages and such, I know I should be into it, but I’m just not.

RDF: Ok, so I know next to nothing about RDF. At least I know nothing besides the basic syntax. I feel like there’s a big aha moment waiting for me in RDF, but it just doesn’t seem interesting enough to invest in getting there.

I really feel bad about not getting RDF, because all the cool kids seem to be into it.

XQuery: The idea here is to have yet another XML based programming language? And this language is better than Python, Perl, or Ruby because?

I don’t feel bad about about not knowing much about XQuery. Seems like a sideways idea.

XLinq: This made a big splash but seems to have quieted down. I tried to get excited about it, but again I just didn’t get it. Take a look at Uche’s XLINQ examples in Amara. Amara looks a lot more interesting to me than XLinq.

Try Ruby: Online Interactive Tutorial

0

Try Ruby is very cool. It’s a Ruby prompt in your browser, with step-by-step instructions for which Ruby commands to try and what they do. Very effective way of learning.

The Ruby people really have an amazing knack for marketing their language effectively. I’ve never seen any other group pay so much attention to and provide so many tools for people to adopt a product. These guys are out-doing highly paid professional marketers in a big way. I’m very impressed. I wonder if there’s a correlation between people who gravitate to Ruby and people who care about how ideas are presented. The man behind the big resurgence of Ruby, David Heinemeier Hansson, recently made a presentation entitled “Pursuing beauty with Ruby on Rails“. These guys seem passionate about presenting ideas with beauty and understandability.

Script-Only HTTP Servers?

5

I’ve been thinking about and looking for a script-only http server. That is, a server that’s optimized for producing dynamic content, invoking a script on every invocation.

I tend to think of the serving of static and dynamic content as different things. One is basically a file system while the other is a service provider.

In a past life I spent some time as a Web app performance optimization “expert”. One of the basic techniques was to separate the serving of static from dynamic content. You could do this by setting up a bank of servers to serve your images, style sheets, and html pages, and another to serve scripts. Many good reasons, including:

  • Different caching characteristics, allowing the use of caches and distributed caches for the static content
  • Different memory usage characteristics. Static content can typically be served with lean and mean servers taking up little memory (and memory is an important gating factor in how many simultaneous clients you can serve), while dynamic content requires fatter servers

There are other practical matters. For example, I have access to several servers with high bandwidth that I can serve static content from, but only one server with limited bandwidth that I can serve dynamic content from. This is an easy situation to get into: you can get very cheap hosting of static content, but dynamic content costs you more, and your choice of how you serve dynamic content (ie. root access) costs you even more.

Which brings me to the point: I was expecting that by now the major scripting languages would offer their own built-in http servers, if for no reason other than convenience. I see that that’s not the case – the assumption is still that the scripting engine will be plugged into Apache, ala mod_perl, mod_python, etc. This means the servers are all fat and there is no separation of dynamic and static.

Meanwhile, you have fastcgi, which basically is a way of setting up a separate bank of servers for dynamic content. The request goes from Apache, thru fastcgi, to the dynamic execution engines. Ruby on Rails, for example, makes use of this. It’s nice because it gives you the separation, allows you to scale your script engines separately from your static engines, and makes your module pluggable into any http server that supports fastcgi.

But fastcgi is an extra layer I’d like to get rid of. Why not have a native server built into the scripting language, obviating the need for fastcgi? What value is gained by having dynamic requests go thru Apache on their way to my serving engines?

Well, there’s the resolution of the URL to the script to be executed. Apache figures out what needs to be invoked and invokes it.

But is that a good thing? Check out mod_rewrite. Check out the forums on cherrypy. People want more control over how the URL is translated to what’s invoked. We are living in a REST world after all, and parsing the URL is very meaningful.

To be fair, Apache offers a lot. It takes care of everything for you so you only have to write your scripts. It’s standard, it’s everywhere, and people know how to operate and tune it.

Still, I’m convinced it’s cleaner to have a separation. Have the request hit my scripting engine from the start, skip Apache all together. Give me full control over URL parsing.

Ruby On Rails, as usual, appears to have the lead in this. They ship with a built-in http server, which means you can get up and running in no time. They’re also offering lighttpd as a choice, meaning you can skip Apache. They continue to use fastcgi, which is probably a fine thing to do.

IBM UDDI Shut down

1

IBM shuts down their public UDDI registry. Via Bill de hOra.

It’s about time. I can tell you the exact point I lost interest in UDDI: it was the second advisory board meeting and I was struggling with the enthusiasm expressed by the board for adding features and categorizations while the basic directory was failing to get traction. A gentleman who shall remain nameless was waxing philosophic about how UDDI would be used to track shipments and trucks as they made their way across the country. It was such a huge moment of disconnect – I just wanted a directory of services – that I realized UDDI is not for me. The U foiled us; we tried to be Universal not in acceptance and reach, but in scope and features.

Born Sinners Born of Sin

0

Went to Christmas at the Prado in Balboa Park. Very nice.

Listening to the monologue between Christmas carols, I really understood this idea for the first time:

Christians (at least some subset) really believe that Adam committed the original sin, that every child is born of sin, born a sinner. It’s a stain that can’t be cleaned, it’s there from day one, and it’s the reason that Christ died.

That, to someone who didn’t grow up with it, is a completely bizarre world outlook. I don’t mean that in any offensive way – I’m just saying it’s very strange to an outsider.

I don’t know if this is Islamic, Bahaii, cultural, or simply the influence of my parents, but I always believed that a child is born with a clean slate, free of sin. As she grows she builds a coating of sin, but that can be washed off. The child is born in the image of God; she is perfect, and life is a pursuit of perfection, of being God-like.

I’m not saying one is better than the other, but they certainly are different. Being born perfect or being born quite imperfect in a way that you can never fix, that must have a big effect on your life outlook.

I’m no expert on this, so please feel free to correct where I have gone wrong.

AdSense Login NonSense

4

For quite a while now I’ve been unable to log into my Adsense account. As a result I’ve stopped using Adsense ads.

Here’s the problem: some time back I attempted to log in as I had always done before, using the email address I had used to signup to Adsense with, which is not my gmail address. I got this:

Welcome! You’re signed in to Google Accounts under the email xxxxxxx@excite.com and your Google Account password, but this is not a valid AdSense login. If you’re an AdSense advertiser, try signing in using your AdSense email and password. Or, sign up for AdSense.

Strange. I hadn’t changed my password and I was typing it in correctly. I noticed it was recognizing me via my gmail ID, so I tried that, putting in my gmail ID and password.

Welcome! You’re signed in to Google Accounts under the email xxxxxxx@gmail.com and your Google Account password, but this is not a valid AdSense login.

That’s true, but I’m not able to get in with my regular AdSense login, so what do I do?

I navigated the feedback pages and sent in a request to get access to my account. Two weeks, no response. So I sent in another message. This time I got a message telling me I should make sure I’m not using my gmail address for my non-gmail login. I wish I had thought of that.

I pretty much let it go and forgot about it, figuring Google doesn’t want my business (which is perfectly reasonable; I’m generating almost no revenue).

Then last week I get an email from Google titled “Tips and Information on how to get the most out of AdSense”:

We’ve noticed that you’re not showing contextually targeted Google ads on your pages through the AdSense program at this time. We’re following up to see if we can help you to get started again or to maximize your site’s potential with AdSense.

Yup. Excellent. How about letting me log in?

If I try to log in now I get:

Welcome! You’re signed in to Google Accounts under the email xxxxxxx@excite.com and your Google Account password, but this is different from your AdSense account email and/or password. If you’re an AdSense publisher, try signing in using your AdSense email and password. Or, sign up for AdSense.

Same if I try my gmail account.

I think this is the same problem being discussed over on search engine watch.

Battelle’s Glasses and Mine

1

I just noticed John Battelle’s favicon.ico (the little website icon you see in the browser address bar) is very similar to mine – a close crop of his eye with glasses. Was it always like that? It’s not the world’s most original idea, but I’m surprised the two are so similar. Perhaps I unconsciously copied him.

Tivo is a Comatose Product

3

Tivo has some great things going for it. The basic functionality is very useful, and it’s simple enough that even my wife will use it. Most of my TV viewing is through Tivo.

However, it feels like a completely dead product. It really hasn’t changed or added any new functionality in 5 years. It’s absolutely ridiculous that I have to buy one of the few approved USB devices to get ethernet connectivity. It’s almost 2006 for god’s sakes. My cell phone has better net access than my Tivo.

What I’d like is the ability to have all my media (photos, music, movies, and TV) play on my TV regardless of what computer they’re stored on. I’d like access to email. I want a Web browser. I want a Web cam. I want Skype Instant Messenger. I want to be able to check out IMDB on the upcoming movies.

I want do download movies, store them on my drive, and view them when I want. I want to get rid of all the physical media, all the CDs and DVDs littering my house.

I want to be able to messenger my family such that if they’re watching TV they can get a little icon of me beeping at them, and push a little picture-in-picture window open on the TV where I can talk to them, they can see me, I can see them.

I want a voice interface so I can say the music I want to listen to instead of pecking away at the miserable on-screen keyboard.

It should all be there on my TV. The point is that the TV is there in the family room, easily accessible, and used by all the family members.

This stuff is all doable. In fact, I don’t think any of it is really all that complicated. All it takes is a small, attractive, quiet computer by the TV, and some good old geek time.

Problem is I don’t really have the geek time to hobby this. A professional geek should be doing this for me. Tivo should be doing it for me. But somehow they’re happy with the feature set they had 5 years ago.

And yes, I realize music and photos can be accessed via Tivo today, but not through my Tivo, because I haven’t bought the silly approved USB dongle, because I never have the list of compatible devices with me when I’m thinking of buying it, and because I refuse on moral grounds to deal with such ridiculous nonesense as requiring a handful of approved devices for net access in 2006.

So anyway, somebody build my geek box for me.