Blog Thought #1

Tuesday, January 10th, 2006

Feed readers work better for full text feeds like enplaned or The Cafes that contain the real content.

Essentially headline feeds like the Cafe au Lait Recommended Reading or Memorandom work better in a browser. In fact, a feed like Memeorandum’s that forces you to visit their site first just to get the real link is almost completely pointless. The Cafe au Lait/Cafe con Leche recommended reading feeds are much nicer (though of course the real difference is in the content).

The Cafe au Lait/Cafe con Leche story feeds are sort of in the middle, but they probably run more to the headline end of the spectrum because the individual stories, even when syndicated as full text, are usually pretty small.

Ted’s Wrong, Dion’s Right

Tuesday, January 3rd, 2006

Ted,

You’re technically right that HTML is not part of the Web architecture; but you’re living in dreamland if you think the Web could have succeeded with PDF, Flash, Word, or any of hundreds of other possible stricter formats.

The Web’s success depended critically on the looseness (I hesitate to call a non-programming language weakly typed) of HTML. People could open it, edit it, make mistakes, and still get good results. Plus they didn’t need any fancy payware tools to make things work. Plain text was good enough. A stricter format would not have brought the Web where it is today.

P.S. Your spam prevention code locks out blind users, much as PDF, Flash, and so forth are much less accessible to the visually impaired than plain vanilla HTML.

P.P.S. Your comment system is locking me out too, for no obvious reason so I’ll post this response on my own blog instead.

Two tips for fixing Apache problems

Monday, January 2nd, 2006

1. If something is going wrong (e.g. in my case getting a 403 Forbidden error for pages that should be accessible) the first thing to do is check the error logs. Don’t even try to fix the problem until you’ve looked in the error log. “tail” is a very useful command to find out just what last went wrong:

elharo@cafe:/usr/httpd/logs$ tail -4 cafe.elharo.com-error_log
[Mon Jan 02 18:29:45 2006] [error] [client 216.254.67.87] Options FollowSymLinks or 
SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: 
/var/www/cafe/wordpress/
[Mon Jan 02 18:30:07 2006] [error] [client 216.254.67.87] Options FollowSymLinks or 
SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: 
/var/www/cafe/wordpress/
[Mon Jan 02 18:32:06 2006] [error] [client 216.254.67.87] Options FollowSymLinks or 
SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: 
/var/www/cafe/wordpress/
[Mon Jan 02 18:32:10 2006] [error] [client 216.254.67.87] Options FollowSymLinks or 
SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: 
/var/www/cafe/wordpress/index.php

2. If the error in the log happens to be, “Options FollowSymLinks or
SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden” add Options +FollowSymLinks to your .htaccess file in the affected directory, right before you turn on the rewrite engine. i.e.

Options +FollowSymLinks 
<IfModule mod_rewrite.c>
RewriteEngine On

Spam Quotes

Tuesday, December 27th, 2005

Like most blogs that enable comments, this one has attracted its share of spam. Interestingly I’ve noticed that most of these comment spams start off with something really complimentary. Some examples:

I’m asking myself: How can it be that I’ve never ran through your site before? It’s a great one!

Very nice. You’re site is very helpful.

I guess they hope I’ll be so excited by the ego-boo I’ll promptly approve it before reading on, where I find such Dadaist gems as “Table becomes Small Slot in final when Plane is Game it will Fetch Boy” and “when Stake is Chair it will Hope Cosmos”.

POST vs. PUT

Thursday, December 8th, 2005

Musicians will understand this analogy. Have you ever tried to learn a piece that goes the wrong way? That is, you’re playing along and it’s so obvious where the next notes are going to go and instead the piece goes off in a completely different direction. Half the time you find yourself playing the notes you think the piece should use rather than the notes it does use.

For me, understanding the difference between HTTP POST and PUT is very much like that. I’ve had a great deal of trouble understanding explicitly RESTful protocols like APP because they follow the actual definition of POST and PUT instead of what is to me clearly the right definition. However, I think I’m finally starting to get it.

My mistake is in thinking that anything that creates a new page is a PUT and anything that changes an existing page is a POST. In SQL terms, POST is an UPDATE and PUT is an INSERT. However, that’s not the case. In fact, the mistake is in trying to model PUT and POST in terms of INSERT and UPDATE. They really aren’t even close.

What actually happens is this. PUT puts a page at a specific URL. If there’s already a page there, it’s replaced in toto. If there’s no page there, a new one is created. This means it’s like a DELETE followed by an insert of a new record with the same primary key.

POST, however, really has no equivalent in SQL. POST sends some data to a specified URL. The server on the other end of this URL can do whatever it wants with this data. It can store it somewhere private. (HTTP 204 NO CONTENT). It can store it in the page at the URL that was POSTed to (HTTP 205 RESET CONTENT). It can store it in a new page, in which case it returns the URL of that page in the Location field of the HTTP response header (HTTP 201 CREATED). It can use it as input for several different existing and new pages. It can throw the information away. It can insert, update, or delete records in a database (or all of the above). It can start brewing coffee (HTTP 202 ACCEPTED). It can start global thermonuclear war. POST is decidely non-side-effect free and non-idempotent.

PUT is a much more limited operation that never does anything more than PUT one page at a specified URL. It is idempotent, which is a fancy way of saying that doing it twice is the same as doing it once. Both PUT and POST can be used to create new pages. However PUT should be used when the client specifies the location for the page. PUT is normally the right protocol for a web editor like DreamWeaver or BBEdit. POST is used when the client gives sends the page to the the server, and the server then tells the client where it put it. POST is normally the right protocol for a blog editor like TypePad or anything that inputs into a content management system. In SQL analogy, POST is an INSERT with an automatically generated primary key, and PUT is an INSERT that specifies the primary key in the INSERT statement.

Spirit of 1999

Tuesday, December 6th, 2005

Wow. I haven’t seen an online store this bad in years. I know there are still a lot of crappy marketing sites out there, but most sites trying to immediately close sales long ago figured out that fancy tricks stop customers from buying. Not these folks.

It took me four or five tries to figure out where to click to see the page for the product I was interested in. On the third try I actually ended up on a page for a similar but slightly different and more expensive DVD burner than the one I was looking for. Initially I thought this was bait and switch, but one should never attribute to malice what can be explained by simple stupidity. I did eventually find the page for the product I wanted. Of course, this page promptly refused to sell me the drive because I didn’t have cookies turned on.