Sunday, August 10, 2008

Discovering RESTful APIs

Read up today on REST APIs. See this introduction for specific details. Here I'm just going to give my opinion.

The idea behind the REST style is appealing in its simplicitly. I can see Many ways in which rigorously following the style would produce an easy to understand API, provided the user (client) is also familiar with the style. We've all become so used to treating GET and POST in HTTP as equivalents that we don't even think about how we might be abusing the intent. I never did understand the intent behind the separation of GET, POST, PUT and DELETE until now, and even now that understanding is arguably superficial.

REST provides a set of constraints over an API. Does it make sense to have a framework for supporting REST style APIs? Would the framework do anything beyond providing constraints on the behavior of the various HTTP verbs? How would such constraints be encoded? A lot of food for thought here.

Tuesday, August 05, 2008

Lassen Volcanic National Park trip report

We returned from Lassen Volcanic National Park late Sunday. Well, technically early Monday. Spent the day yesterday recovering. I'm not in decent hiking shape, and even the little hiking we did took its toll. That aside... Lassen is amazing! I got us a reservation at Butte Lake (we showed up on the wrong date, but that's another story...) more or less by accident. It was the first camping reservation I'd made, and the reservation web site is, well, lacking in user friendliness. Butte Lake is in a relatively remote north east corner of Lassen, inaccessible from within the park, off a gravel road. But there we find one of the most spectacular sites Lassen has to offer: the Cinder Cone. Bumpass Hell is great, but the scale and quality of Cinder Cone made it superior in my mind. Plus, you can hike to the top. We got to our campsite too late to attempt the hike, but we got close enough to really appreciate the spare beauty of the site. The Cinder Cone rises up from some impressive lava beds. I did of course take lots of photos, I'll post them when they're processed. Largely speaking, I feel we barely scratched the surface of the sites accessible from that corner of Lassen, and we'll have to return for a longer stay there some time.

Morning at Butte Lake was really amazing. It was cold when we woke, but nowhere near freezing. A couple of layers had me comfortable enough to take a trip out to the lakeside for some early morning photography, some of the best of the trip. We packed up and headed out to the main park area. We entered through the Manzanita Lake entrance, another wonderful sight. There we spotted a bald eagle! But I was too slow with my camera to make good of the opportunity. We stopped at the visitors center. I've decided the NPS has the best officials I've met, meeting them always leaves me happy. Got a few pointers for trails to take.

We first went up to Paradise Meadow. The trail was uninteresting to start with, but then as we climbed we found more and more wildflowers. The trail ran along a stream, and the end of the trail was in a large meadow surrounded by mountains. Our next trail was the Kings Falls. It is another short trail, goes down running along a stream, which cascades down some rocks. We initially thought those were the falls, but as awesome as they were, the falls were further along the way. The distance markers were a little confusing, we theorize that they stamped duplicates of certain signs and just decided to use all of them, even though they were a bit inaccurate. The falls go down many feet, but we can only see them from the top. So it is a bit difficult to fully appreicate them. On the return we went up a horse trail rather than along the cascades. The upper portion of the horse trail was quite wide open, very scenic.

After the Kings Falls trail we proceeded along the highway, climbing, climbing, climbing up to about 8000 feet. Right next to Lassen Peak. The peak looks quite doable, maybe next time we'll give it a shot. There's a rest stop with some food and water. Just past Lassen Peak is Helen Lake, one of two alpine lakes that are right by the roadside in Lassen. From there we went on to Bumpass Hell, just a few hundred feet further along. The trail is quite easy, runs along the sides of hills which challenged my fear of heights. Especially since my feet were not holding up so well. Bumpass Hell was other worldly. Anyone going to Lassen has no excuse for skipping out on this site, it is just that accessible.

From that high up we could also see the forest fires burning, and the smoke streaming out. The sight made quite an impression. I've captured some of it in photos.

Lassen is the highest I've been so far. I know, not that high. But we'll soon be going to the Eastern Sierras, to White Mountain, to see the bristlecone pines. We'll easily cross 10000 feet on that trip! I'm really looking forward to that trip.

As for photography, my new 24-105mm lens held up really nicely. The only problem with the lens is that the zoom drifts. I tend to wear the camera strap with the camera hanging down, and invariably the lens drifts out to 105mm. This is a bit disappointing. The expensive B+W polarizer turned out to be fantastic. Seems to lose less light than other polarizers I've used, even from B+W. Highly recommended. Using a tripod really brings out the best of the lens, otherwise even as good as the IS is on the lens, it still doesn't compare with the stability of a tripod. My best photos, morning at Butte Lake, were taken with a tripod. That is the only time I used a tripod. The difficulty with a tripod of course is that you have to carry it and set it up. This is difficult when you're trying to get through three trails, even short ones, through the course of the day. A good tripod, in other words, is virtually a necessity. Also, the 24-105mm is a good enough general purpose lens that I will try a different tack the next time: instead of carrying so much camera gear, carry a tripod instead. I didn't touch any of the other lenses I was hauling through the whole trip!

Thursday, July 31, 2008

To the northwest corner!

We're going to Lassen on Saturday. But I made an error in reservation, and sent us off to a night at Butte Lake. Accessible only by driving eight hours down a gravel road. At least it will be (relatively) secluded.

I am forgotten

I feel as though I've been forgotten, working here in front of my computer. But is it really that I'm forgotten, or that I've forgotten how to be?

Tuesday, July 29, 2008

Space profiler needs profiling

I struggled and failed against the Allegro CL 8 space profiler yesterday. I tried capturing a space profile for some of our software running on Windows. With only five seconds worth of data Allegro CL would chew up 300MB of heap in producing the profile. Needless to say there was nothing meaningful to be had there.

What I really want is to get visibility into which heap data allocated makes it to oldspace. I want to see what's making the image size grow. I'm not getting useful data from the space profiler, and I don't think I possibly could. Time profilers are much more useful in optimization, space profilers can't separate temporary allocations from those that get tenured.

Monday, July 28, 2008

Photos from India and Taiwan posted!

It took me a while, but I'm finally through processing all the photos I had taken in India and Taiwan. I posted them on picasaweb and flickr. I clearly have a long way to go in developing my photography... I also upgraded my 28-135mm lens to a 24-105mm L lens. My first L lens. And it is fantastic! Even zoomed in at 100% the pictures are sharp as can be.

I took the lens out for a test run around Stinson Beach. There was fog covering the whole area, except a hole around the beach that let in some nice warm sunlight. The beach though is far from photogenic. Not really all that much worth photographing. So I got some spectacularly sharp photos of fairly generic stuff, like sand, and seagulls, and sunbathers. All the exciting stuff happening off shore, like pelicans diving for fish, was too far for me to capture with this lens.

The lens is considerably heavier than the 28-135mm, but definitely seems to be a great investment. We'll be going to Lassen soon, which will give me a chance to really give the lens a workout.

Monday, July 21, 2008

The Dark Knight

I had a peek at The Dark Knight on IMDB. The movie currently is the best ever on IMDB, with a score of 9.6/10. It will probably come down, but this is an incredible score. Going through the user comments, found this: "Oh my freaking baby Jesus." Which sums up nicely how I felt when I saw the two minute bank robbery clip six months ago in the previews of I Am Legend. I've been waiting for this movie ever since.

Sunday, July 20, 2008

Whatever Happened to AI

I just finished reading Lenat's "The Voice of the Turtle: Whatever Happened to AI". It's in the Summer 2008 issue of AI Magazine, more precisely Volume 28, No. 2. In it he asks what happened to the premise of producing human level AI. There are several knee jerk responses that immediately come to mind, given that I've spent a bit of time working on AI:
  1. The meaning of human level AI is fuzzy. In the absence of a clear definition, the question is not really meaningful.
  2. Human level AI is not a unitary construct. An individual's conception of the world is greatly affected by the types of tasks she knows to perform.
  3. Humans are not logical in the manner that logic can be programmed into software. Although the paper isn't about an AI that mimics humans, we're going against the grain of the one example of intelligence out there.
Lenat is extremely intelligent, but quite opinionated on the right way to achieve intelligence. I disagree with his approach, primarily because I don't think of intelligence that has arisen out of nothing. Intelligence is a facility that has developed in response to particular evolutionary pressures. In our case, I believe it is to deal with increasing complexity of social structures. The application of social intelligence to other more general problems is a happy accident.

I do believe that an intelligent agent has to have some embodiment external to its representation of its world. In other words, an agent should be able to take in uninterpreted sensory information (even if it is symbolic), translate it into a format that is more amenable to manipulation, and take actions on that format. Communication with other agents must be one of the many actions the agent is required to perform. Without this overall architecture I don't think there is any way we can build a truly intelligent communicative agent.

Lenat's overall flaw is in believing an intelligent entity can be created by manually representing facts. I believe intelligence is seen where an entity is able to operate and adapt to an environment, and communicate with other agents. These facts are an afterthought, a story we have put together to explain how we do things. It isn't how we actually do things.

So, what happened to AI? I think it is only necessary in entities that have to be truly autonomous or embodied. Otherwise we'd generally be better off with the story of facts weve so far been creating.