June 2008 Archives

There was supposed to be a light inside the refrigerator that came with our house, just like every other refrigerator in the world. But instead there were just a bunch of dangling wires. Fast-forward several years to last week, when I finally got around to putting in a switch and a light. Lemme tell you, having a light in the refrigerator really freaks me out. I can't get over thinking that there's a hole in the back with sunlight shining through every time I open it. And yes, I do peek through the crack as I'm closing it to make sure the light really does turn off.

CouchDB Cheat Sheet

| | Comments (0)

I've added/removed linefeeds for readability.

$ curl http://www.example.com:7777/
{"couchdb":"Welcome","version":"0.8.0-incubating"}
$ curl -X DELETE http://www.example.com:7777/test_db/
{"ok":true}
$ curl http://www.example.com:7777/test_db/
{"error":"not_found","reason":"missing"}
$ curl -X PUT http://www.example.com:7777/test_db/
{"ok":true}
$ curl http://www.example.com:7777/test_db/
{"db_name":"test_db","doc_count":0,"doc_del_count":0,"update_seq":0,"compact_running":false,"disk_size":4096}
$ curl -X PUT -d "{\"a\":\"b\"}" http://www.example.com:7777/test_db/foo
{"ok":true,"id":"foo","rev":"666990838"}
$ curl http://www.example.com:7777/test_db/foo
{"_id":"foo","_rev":"666990838","a":"b"}
$ curl -X PUT -d "{\"a\":\"b2\", \"_rev\":\"666990838\"}" http://www.example.com:7777/test_db/foo
{"ok":true,"id":"foo","rev":"2431793718"}
$ curl http://www.example.com:7777/test_db/foo
{"_id":"foo","_rev":"2431793718","a":"b2"}
$ curl http://www.example.com:7777/test_db/_all_docs
{"total_rows":1,"offset":0,"rows":[{"id":"foo","key":"foo","value":{"rev":"2431793718"}}]}
$ curl -d "{\"a\":\"b3\"}" http://www.example.com:7777/test_db/
{"ok":true,"id":"4aa63f6ae005d2033da6c80c65252609","rev":"2168454103"}

At this point I struggled for about 30 minutes to get an ad-hoc view to work. This error message wasn't too helpful:

{"error":"error","reason":"{{nocatch,{map_process_error,{exit_status,136}}},\n [{couch_query_servers,readline,2},\n {couch_query_servers,read_json,1},\n {couch_query_servers,prompt,2},\n {couch_query_servers,'-start_doc_map\/2-fun-0-',2},\n {lists,foreach,2},\n {couch_query_servers,start_doc_map,2},\n {couch_view,view_compute,2},\n {couch_view,update_group,1}]}"

Update 6/17/2008: I tried again today and it worked. No idea what I did differently.

$ curl -H "Content-Type: application/json" -d "{\"map\": \"function(doc) { emit(null, doc); }\"}" http://www.example.com:7777/test_db/_temp_view
{"total_rows":3,"offset":0,"rows":[ etc. ]}

Tonight's Hell's Kitchen

| | Comments (0)

Not that I ever watch reality TV shows, but I can't help wondering: if Christina wanted Jen off the show so badly, why didn't she nominate Jen and herself? Or Jen and Corey? She could have forced Gordon's hand.

My team is moving to new offices in Redwood City, and we've resolved to lay out our workspace in an XP-friendly bullpen style that favors pair programming and impromptu meetings.

While visualizing our new digs, I had an idea. What if, instead of making it easy to gather around a single computer, the computer itself were mobile? Laptops aren't the answer; I can't write code of any depth without an ergonomic keyboard and a mouse, and I am addicted to giant LCDs. So I'm looking for a tiny rolling workstation stand with a VESA monitor arm, an adjustable keyboard/mouse tray, and a UPS so I can move around without shutting down the PC. A quick search on the web produced many contenders that I had to rule out for various reasons: too ugly (wood laminate), too fragile-looking, keyboard tray not sufficiently adjustable to the 26-inch height I prefer, not really compatible with a VESA mount, or priced for verticals rather than the consumer market.

This is the closest to what I have in mind.

Rolling PC Workstation

But I wanted more of a flexible monitor arm so that we could easily move the monitor around according to whoever's coding at the moment, and I'd imagined the keyboard tray jutting forward a little more, both to counterbalance the monitor arm (visually if not physically) and to enable me to stretch my legs out a bit underneath without straddling the PC. And if I ditch the included tray and monitor mount and replace them with my own, then I'm paying $250 for a rolling pole, which doesn't feel like such a great deal.

Any ideas? By the way, I decided to disable blog comments after a barrage of unsuccessful spam attacks, so if you have an idea, post it somewhere on the web, and my Google Web Alerts will eventually pick it up.

About this Archive

This page is an archive of entries from June 2008 listed from newest to oldest.

May 2008 is the previous archive.

July 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.2-en