Archive for April, 2007

Housing Prices

Thursday, April 19th, 2007

Over the past few years, I’ve found that a suprising number of people are interested in investing in real estate. Everybody sees housing prices go up, up and up. But I just found a graph of housing prices in the US from 1890 to today, adjusted for inflation (hat tip to the Freakonomics Blog). In summary, housing prices have stayed mostly constant over the long term, once you adjust for inflation. I think people forget to adjust for inflation, and then they think that they made a lot of money by investing in real estate.

The most interesting thing to me is that over the last 10 years housing prices have doubled. That’s no surprise. What is a surprise, however, is how many people think housing prices will stay at their current levels. I think this situation is similar to the Internet stock bubble. I remember just before the bubble burst, all sorts of people who knew nothing about the stock market were putting their savings in the stock market, because they didn’t want to miss out on a sure thing. Well, that bubble burst, and I think this housing one will too, though at a slower pace since housing is less liquid than stocks.

ProjectPipe now has web services

Thursday, April 5th, 2007

We have just created a web service api for our ProjectPipe product. Our web services api follows the REST style, which means that you do queries and make changes by sending http GETs and POSTs, respectively. You verify that api calls succeeded by checking the http status code — 200 is good and 404 is an error. All output is in the JSON format, which is a simple, cross-platform data representation format with library support available for all major languages.

Below are sample URLs for project test.test:

  • /test.test/svc/task - query the task table
  • /test.test/svc/task/1 - read task with id of 1
  • /test.test/svc/task/add - add a new task
  • /test.test/svc/task/1/edit - edit task with id of 1
  • /test.test/svc/task/1/delete - delete task with id of 1

One of the great things about REST apis is that you can use any http client to use the api. For example, you can use the curl command to query for tasks:

curl -u userid:password http://localhost:8001/test.test/svc/task

Below is a python snipped to do the same thing:

import base64, pprint, simplejson, urllib2
theurl = ‘http://hosted.projectpipe.com/test.test/svc/task/1′
username = ‘userid’
password = ‘password’
encoding = base64.encodestring(’%s:%s’ % (username, password))[:-1]
req = urllib2.Request(theurl, headers={’Authorization’: ‘Basic %s’ % encoding})
out = urllib2.urlopen(req).read()
pprint.pprint(simplejson.loads(out))

If there is an error then the urlopen().read() will throw an exception, that’s the great thing about using http status codes.