Archive for January, 2010

January 26, 2010: 5:20 pm: kpdPython

I’ve been trying somewhat in vain to debug a REST interface that’s failing when running under GAE. After some searching, I found a way to force the local development server to use an http proxy (such as Charles or Membrane).

Make the following changes in the file:

C:\Program Files\Google\google_appengine\google\appengine\api\urlfetch_stub.py

around line 193:

      
<pre>
try:
    if protocol == 'http':         
        logging.debug("using proxy instead of %s path=%s", host, path)  
        connection = httplib.HTTPConnection("127.0.0.1", 8888)   # host and port of proxy server
        path = "http://%s%s"%(host,path)
        logging.debug("new path is: '%s'", path)
    elif protocol == 'https':
          connection = httplib.HTTPSConnection(host)
    else:
        error_msg = 'Redirect specified invalid protocol: "%s"' % protocol
        logging.error(error_msg)
        raise apiproxy_errors.ApplicationError( urlfetch_service_pb.URLFetchServiceError.FETCH_ERROR, error_msg) 
</pre>

You may wish to make the same change for Https as well. It would not be too hard to fix it the right way by having it check for the http_proxy environment variable, but I haven’t done that.

January 18, 2010: 8:57 pm: kpdPython, programming

Here are the slides and examples from my Code Mash 2.0.1.0 talk:

Restful Interfaces to 3rd-Party Websites with Python (PDF)

examples.tar.gz

January 6, 2010: 9:37 pm: kpdindoor-rowing

Just found Concept 2 Crossfit, a blog with some great articles on preparing for and rowing a 2K erg piece. It’s well worth checking out.

January 5, 2010: 5:49 am: kpdindoor-rowing, rowing

This is a graph of last night’s baseline 2000 meter erg piece on the Concept 2 ergometer. Meters are along the X axis and the units of the Y axis depend on the data series. It just took a quick change to a new erg program I’m working that wrote information out to a comma-delimited file every second.
Open Office’s spreadsheet did the rest.

The race plan was to do even splits and sprint at the end. Splits are represented by the red line (seconds/500 meters) look fine at the overall scale, but the watts line jumping so much means there’s room to make a more even power application throughout the row.

I was hoping to see more information about the relationship between cadence, slide ratio, and meters-per-stroke, but the numbers were rounded for the latter two instead of showing 1 or 2 decimal places as needed. That’ll be fixed up for next time.

Graph of baseline 2K erg test 1/4/2010

Graph of baseline 2K erg test 1/4/2010