[ About
| Features
| Music
| Pictures
| Software
| Writing
]
(
adam
| aaron
| alyson
| brendan
| claudia
| jakey b
| joe
| john
| jill
| kevan
| kristen
| kris
| mom
| rachel
| rachel 2
| r
| sam
| seth
| sumana
| susanna
| tpm
| ...
)
Fri Mar 19 2010 14:30:
More REST stuff, this time outsourced to Martin Fowler. In the embarassingly-titled "Richardson Maturity Model:
steps toward the glory of REST", Fowler talks about the maturity model I set out at QCon in 2008, and shows examples of services at the different maturity levels.
(3) Wed Mar 17 2010 21:24 Alternate ETag Validation Functions:
Yes, months after driving away everyone who read this weblog hoping I would talk about RESTful topics, here's some REST stuff. This is an idea I got from my co-worker Björn Tillenius. I hope someone else has come up with the same idea and given it a better name.
Here's the problem, on a high level of abstraction. Consider a representation (#1):
<p id="1">Forklift</p>
<p class="read-only" id="2">Green</p>
And let's say the ETag of this representation is the string "x".
According to the protocol governing this media type, you can modify the text in any paragraph unless its class is "read-only". So maybe you can PUT a document like this (#2):
<p id="1">Hovercraft</p>
<p class="read-only" id="2">Green</p>
Or PATCH a document like this (#3):
<p id="1">Hovercraft</p>
OK, that's easy. Now suppose that the read-only text changes randomly according to conditions on the server. Let's say the read-only text suddenly changes from "Green" to "Red". If I were to GET the document again, I'd get this document (#4):
<p id="1">Forklift</p>
<p class="read-only" id="2">Red</p>
And let's say the ETag of this document is "y". If I sent a conditional GET with an If-None-Match of "x", I'd get 200 and a new representation instead of 304 ("Not Modified").
OK, but I don't send a conditional GET. I don't get the document again at all. Instead, I PUT document #2, with an If-Match of "x", and the request fails with 412 ("Precondition Failed"). Maybe it should fail anyway; maybe the server is very strict and thinks I'm trying to change a read-only paragraph from "Red" to "Green", which would probably be 400 ("Bad Request"). But we don't even get to that point because the ETags don't match.
The request also fails with 412 if I PATCH document #3 with an If-Match of "x". But there's nothing really wrong with that request. The point of If-Match in conditional writes is to avoid conflicts with other clients, and there are no other clients here.
The ETag is different because a read-only paragraph changed on the server side.
One obvious solution is to calculate the ETag only from the read-write portion of the document. This fixes conditional writes, but it breaks conditional reads. A client that requests document 1 and then makes conditional requests will never get document 4. The ETag is no longer a strong validator (update: actually, it's not any kind of validator); the document might change significantly without the ETag changing. So that's no good.
The solution Björn came up with is to split the ETag into two parts. The first part is derived from the read-only portions of the document, and the second part is derived from the read-write portions. The ETag is a totally opaque string to the client, but the server knows what it means. On a conditional read, the server checks the entire ETag. On a conditional write, the server only checks the second half.
In this example, the ETag for document #1 might be "1.a" and the ETag for document #4 might be "2.a". A conditional GET of document #4 with If-None-Match="1.a" would fail, but a conditional write with If-Match="1.a" would succeed. When the write went through, the document's ETag would change to "2.b", and "1.a" would not be good for either conditional reads or writes.
From the client's perspective everything just works: your conditional read returns 200 iff the representation has changed, and your conditional write returns 412 iff someone else is messing with the resource. But is this okay from a standards perspective? Section 13.3.3 of RFC 2616 says "The only function that the HTTP/1.1 protocol defines on [ETags] is comparison." That doesn't seem to prohibit me from defining another one.
If "x" is a strong validator then so is "1.a", but the new comparison function ignores some of its information about the resource state, effectively treating it as a weak validator (update: or as something that's not a validator at all). Is that okay? Would you believe the following definition of a strong validation function? "In order to be considered equal, the second halves of both validators MUST be identical in every way, and both MUST NOT be weak." (cf 13.3.3 again)
I'm interested in your thoughts on this. Smartass comments like "you should have two resources" will not be dismissed out-of-hand but also will probably not convince me. If you're curious, here's the real-life bug that spawned this thinking.
Sun Mar 14 2010 22:34:
Speaking of Evan, he's started a new weblog, walltype, where he curates photos from Flickr that fit his own baroque categorizations. I think it has explodingdog-esque potential.
Speaking of new weblogs by my friends: Pat Rafferty's Raffertyesque. Now you have something to read while you look at Evan's curated pictures.
Sat Mar 13 2010 13:29:
Evan: "You really need to watch Summer School on the original rental VHS. It's like listening to the Beatles on LP."
(2) Fri Mar 12 2010 08:47 The Long Joke:
In 2001 my sister Susanna sent me the birthday card you see before you. It said "Whee! You're 3 22!" I thought this was hilarious, and I kept the card.
Then Susanna had a daughter, and I had an idea. Recently Maggie turned three, and I gave my niece the birthday card Susanna had sent me eight years earlier. "Whee! You're 3 22 3!" The payoff was worth it. "I laughed for like 5 minutes," said Susanna.
Recently I was doing a video chat with Susanna and I mentioned:
L: So I'm jogging for an hour every day, and I realized I wasn't doing enough reading, so I decided I also needed to read for half an hour every day. And I also want to devote half an hour to games, though that's not as much of a problem. And I think I should also allocate at least half an hour for writing. But if I keep dividing up my free time like this then my whole life will be...
S: Organized?
Hmm.
Fri Mar 12 2010 07:39 "Frankly, I do not feel this hatred.":
The Israeli fanzine Bli Panika (Don't Panic) has published an awesome Hebrew translation of
Let Us Now Praise Awesome Dinosaurs by Ehud Maimon. Google Translate translates the title back into English as "Mention dinosaurs and glory", and Tark and Entippa's names are transliterated Tariq and Antipathy. Pretty fun!
Back when I first heard about this project, I mentioned to editor Rami Shal'heveth that the story's title is a riff on a phrase originally in Hebrew, but he probably already knew that. Actually, no: "Ben-Sira's book is one of those canonical texts that everybody knows of, but nobody reads."
(2) Wed Mar 10 2010 21:29 It's All Fun And Games:
Check out REDDER, the psychotropic game with the palindromic name. I'm a big fan of the strange effect that happens as you play, but I won't mention too much to avoid whatever passes for spoilers when it comes to strange gameplay effects.
(1) Mon Mar 08 2010 14:44:
Tired of finding kitten? In Robot Wants Kitty, kitten is dangled just out of your reach for the whole game. And since there's a power-up early on that makes precision movement pretty much impossible, I never found kitten. On the plus side, hey, it's another robotfindskittenlike game.
Fri Mar 05 2010 20:58 Work humor:
"I will lock you and [x] in a room for a week to sort this out."
"We would spend that week planning vengeance on you for locking us in a room!"
"The scenario you put forward seems all too plausible."
Thu Mar 04 2010 17:21 Incomprehensible Joke:
S: "I always wondered what would happen if you put a disc in the Wii the wrong way."
L: "It shows a Koopa Troopa on its back."
Thu Mar 04 2010 16:47:
Last week Sumana and I went to the launch party for N.K. Jemisin's epic "The Hundred Thousand Kingdoms". Nora founded the writing group I'm in, and I read and critiqued a draft of the novel just before she sold it. Then she left the writing group and went off to be a famous novelist.
I always have a difficult time at events held in bars, but Sumana is very good at introducing me to people. For instance, I met Saladin Ahmed, who along with Nora was nominated for a Nebula this year. And then comes this SF Signal interview with Saladin, Nora, and many other Nebula nominees. "If your work couldn't have been on the ballot this year, what work would you have liked in its place?" Saladin:
I'd also have been happy to see more two-fisted fun on the ballot. Two of the absolute best stories I read this year were "Zeppelin City" by Michael Swanwick and Eileen Gunn, and "Let Us Now Praise Awesome Dinosaurs" by Leonard Richardson. Both were ridiculously enjoyable and Nebula-worthy to my mind.
I'm encouraged!
(1) Tue Mar 02 2010 18:27 Star Trek vs. Batman:
No need to dream, it's a filmed mashup of the 1960s Star Trek and the 1960s Batman. The Batman writing is pretty decent, but the Star Trek writing is bland and doesn't capture the feel of the series.
Sun Feb 28 2010 21:12 Original Research:
Sumana is planning a trip to the extensive archive of the Museum of Television and Radio, with the goal of resolving a couple nagging pop-culture conundra that can't be resolved by Internet-based means.
Since it costs $25 to get in to the archive, we thought it would be nice to pool conundra. Bothered by something about television or radio history that, if you had access to a huge archive, could be resolved within fifteen minutes? Search the archive index to see if they have what you need to check, and post your comments here or on Sumana's weblog.
(3) Fri Feb 26 2010 10:17 Satan vs. Leonard:
In the late 90s I did some work on a rock opera called "Porcelain Puppy vs. Demon Dog". On the whole, it was terrible, and I never completed or recorded it, though some of the better songs have shown up in my subsequent albums ("Royal Jelly" is one). But I did record one tiny test skit to satisfy my love of overdubbing my voice with itself, and for some reason put it online.
A few years ago, Katie Bolte, student at the Minneapolis College of Art and Design, found this test skit and liked it enough to animate it. She emailed me about it yesterday. So check it out and relish my humiliation as teenage-me tries to do the voice of Satan in a Saturday morning cartoon. The narrator's overblown description of Cerberus is funny, though.
Wed Feb 24 2010 19:33 Prime Suspect:
More from Walter Jon Williams's The Praxis:
The 313-degree Shaa compass had no zero coordinate, but began instead with one, the odd number left over after factoring the prime number.
I guess that's true. Maybe the Shaa could help Bill Gates factor those large prime numbers.
Apart from prime number weirdness (and species essentialism), this is a really fun book. There was a lot of boring clan politics at the beginning, but it turns out that was setup for an examination of how totally dysfunctional is a society based on clan politics. I often suspect these authors of being secretly enamored of the petty intrigues of clan politics, but it's clearly not the case here.
Insta-update: Before posting this entry I asked Adi about the compass thing. His response:
I don't understand that statement at all. Do the Shaa simply relabel their compass? Instead of using labels of 0,1,...,360, their compass uses the labels 1,2,..,313? (i.e., their compass has a full range of motion, but simply a different scale)
If this is in fact true, then I wonder what additive identity the Shaa have chosen. From the statement you wrote, it seems as though the additive identity is 1... which can't of course be consistent with 1 working as a remainder after division by prime numbers. And the "odd number left over after factoring the prime number" does not make sense to me... Why one would use the multiplicative identity [ie. 1] as an additive identity is beyond me.
Unfortunately, by this point in the book the Shaa are all dead, so we can't ask them, and it's clear that a bad compass is the least element of their legacy of incompetence.
Tue Feb 23 2010 08:57 The Palace At 40 Million Dollars:
Went to the MoMA yesterday with Peter Hodgson (high-quality photos coming soon). I was raving over The Palace at 4 A.M., official Crummy.com Sculpture Of The Millenium (1001-2000).
"I can't believe Alberto Giacometti did all those horrible elongated pinched statues of people, and then he also did my favorite sculpture of all time."
"You know, one of those statues just sold for a hundred million dollars. It's the most expensive sculpture of all time."
"That's awful," I said.
"Well, it means your favorite sculpture of all time probably just tripled in value."
"Great, now I'll never be able to buy it from the MoMA."
I guess I could make my own copy out of kebab skewers.
PS: I structured this entry like the weblog entries in my novel, because I was worried that the style would seem really unnatural in a real weblog. But I think it works okay.
(3) Sun Feb 21 2010 22:51 Guess The Verb! (It's "Said"):
This has bothered me for a little while. In general, it's considered undesirable to use too many adverbs in writing.
He messily ate the sandwich.
But you can replace a generic verb with a fancy evocative verb that does the work of an adverb.
He assaulted the sandwich.
In fact, you can replace a whole clause (often including adverbs) with an evocative verb that conveys the same information.
He walked aimlessly around wandered the room.
Except when the generic verb is "said". Using fancy versions of "said" is "said-bookism", also considered undesirable.
"Just as you wish," he preened said.
And you can't use adverbs here either.
"Just as you wish," he said obsequiously
Hypothesis: by preventing you from describing the way someone says something, these rules force you to write dialogue that explains how it should be read.
"Just as you wish, O most esteemèd lord."
vs.
"Well," he said, "if such is my lord's wish..."
(1) Fri Feb 19 2010 06:00 More TV Oddities:
Both from 1981, both thanks to bobtwcatlanta.
- "Fitz and Bones": The Smothers Brothers and Diana Muldaur star in this "hour-long comedy/drama show about a mis-matched TV news team". IMDB reports one episode. A show generated from one of the more obscure tables in the Dungeon Master's Guide.
- "Falcon Crest": I made a joke about star Jane Wyman looking like Nancy Reagan; IMDB reveals Wyman was Ronald Reagan's first wife. Maybe I already knew this subconsciously, but clearly Reagan had a type. Robert Foxworth gets second billing as a winery owner who undoubtedly plans to betray the Federation/Vulcan High Command/Earth Alliance as soon it comes into existence. Also stars Lorenzo Lamas, who went right from this show to "Renegade".
(3) Wed Feb 17 2010 09:18 Crummy.com Podcasts: Leonard and Lucian's Remedial Pop Culture:
Hey, it's part 2 of my conversation with Lucian. This time, we talk about boys' and girls' fashions from the late 80s and early 90s, the styles that caused a nationwide push for school uniforms. Lucian then explains the Teenage Mutant Ninja Turtles to me (apparently Raphael is cool but rude), and explores his lifelong obsession with being a cool dude.
I was going through a box of old stuff from my childhood and I have this thing I wrote then I was six, a list of things I like. And it's like "cats", blah blah blah, "COOL DOODS!"
Here's the direct download; here, the RSS feed.
(2) Tue Feb 16 2010 20:35 Hey, Who Doesn't?:
And forty-one, a prime number, was a significant number for the Shaa, who loved primes and multiples of primes.
--Walter Jon Williams, The Praxis
(1) Tue Feb 16 2010 07:57 Deadlines:
In a remix of college insanity, I have to finish a project before the Ubuntu feature freeze on Thursday; plus yesterday I had to submit my WS-REST paper and complete a novel chapter for writing group. All that's missing is the crushing angst! Oh, there it is.
Sat Feb 13 2010 22:20 Videos I Haven't Watched:
No guarantees.
Audio I'm listening to while running: The Tolkien Professor. And as long as I'm straying further and further from the title of this post, an excellent poem: "Answer to an Invitation to Dine at Fishmongers Hall", with its incredibly quotable first stanza.
Wed Feb 10 2010 20:44 Crummy.com Podcasts: Leonard and Lucian's Inaccurately Sepia-Toned Retrofest #1:
On Sunday, Lucian Kahn and I had a long conversation about our respective childhoods, growing up in southern California in the 1980s and 90s. I've cut the conversation into two parts and part 1 is now available.
In this 41-minute episode, Lucian and I discuss our early encounters with the mysterious personal computer. Most retrocomputing podcasts focus on video games, but we talk about everything: school computer labs, operating systems, paint programs and creativity suites, online services, weird DOS front-ends, wooden mice, and the "turbo" button. All with no nearby Internet access, so we can spout off half-baked theories informed only by the vague ideas we had as children.
In next week's episode, Lucian will explain things I never understood when I was a kid, like fashion and the Teenage Mutant Ninja Turtles.
Bonus: I have bowed to popular demand and created an RSS feed for the podcast. Let me know if it doesn't work. You can also see a HTML page with the same information as the RSS feed.
(6) Tue Feb 09 2010 09:28 Commissar Joe:
Shopping at Trader Joe's is like living under a really good planned economy. You can get all sorts of exotic food at pretty decent prices, but there's only one brand of everything: the store brand. The few exceptions (soy milk, energy bars) feel like imports from another country. Some of the packaging hasn't been changed in thirty years. The products come and go at the whim of unseen "experts", seemingly unconnected to consumer demand. There's an in-house propaganda publication full of over-the-top writing about how good you have it.
I made this connection on Sunday when I spent twenty minutes standing in the twelve-item checkout line.