Archive

Archive for March, 2012

Tracking down potential bug in PyISAPIe

March 27, 2012 Leave a comment

Brushing up on my C skills…

http://stackoverflow.com/questions/9891467/large-post-data-is-corrupted-when-using-django-pyisapie-iis

Advertisements
Categories: C, Programming, Python Tags:

Resentment

March 22, 2012 Leave a comment

Resentment is what happens when you fail to honor a request that I never made.

Categories: Quotes

Take an encyclopedia with you wherever you go

March 22, 2012 Leave a comment

I’m working on a new project:  Putting 45,000 Wikipedia articles on a USB stick for offline use, e.g. for doing research while traveling on a plane, train, bus or in the car (preferably not while driving).

It’s for sale now at http://www.wikiusb.com/ – check it out!

Categories: Links Tags: ,

Shenandoah National Park Oral History Collection

March 13, 2012 Leave a comment

A project I’ve worked on over the last few years is now online at http://mdid.cit.jmu.edu/snp/.  It is a collection of oral history recordings and transcripts, delivered through a custom interface built on MDID3.

See the official announcement at http://www.jmu.edu/jmuweb/general/news/general11933.shtml.

Categories: Programming Tags:

Breaking Twitter Mobile

March 5, 2012 Leave a comment

Categories: Fun Stuff

Udacity CS373 Localization Problem

March 1, 2012 Leave a comment

I’m taking the Udacity CS373 Programming a Robotic Car class.  Below is my solution to the localization homework problem in unit 1 that was due yesterday.  Note that this is not the complete program, just the homework portion.

world_width = len(colors[0])
world_height = len(colors)

p = [[1. / (world_width * world_height)] * world_width
     for i in range(world_height)]

def sense(p, Z):
    q = [
            [
                pcol * (sensor_right if scol == Z else (1 - sensor_right))
                for pcol, scol in zip(prow, crow)
            ]
            for prow, crow in zip(p, colors)
        ]
    norm = sum(sum(row) for row in q)
    return [[col / norm for col in row] for row in q]

def move(p, motion):
    ym, xm = motion
    return [
            [
                p_move * p[(y - ym) % world_height][(x - xm) % world_width]
                + (1 - p_move) * p[y][x]
                for x in range(world_width)
            ]
            for y in range(world_height)
          ]

for me, mo in zip(measurements, motions):
    p = move(p, mo)
    p = sense(p, me)

Instead of looping, I make use of list comprehensions, which I think is a cleaner solution.

Categories: Programming, Python Tags: , ,