Action executed in 0.000 all posts   articles   bookmarks   polls   tag cloud

ACPS Redistricting

Alexandria district blocks

Given the ugly nature of congressional districts, and even one elementary school district in Northern Alexandria, when I heard ACPS was redistricting their elementary schools, I became concerned. I started a project on GitHub to do my own analysis. It's been a fair amount of work, but GIS is fun.

My goal is to model the placement of K-5 students in Alexandria and build districts that minimized distance travelled. Also the assignments must be "stable", where "stable" means there's no 2 kids that would want to swap schools based on distance.

I'm using data from Census, Alexandria GIS, and OpenStreetMap. And I'm using the PostGIS extension to PostgreSQL for spatial analysis.

In an earlier districting project I measured distance as the crow flies, in order to build congressional districts. The issue with that is it completely ignored natural barriers like the Chesapeake Bay. So for this project, I'll use pgRouting to measure distance one would drive to school.

I hope to build a solution a problem that lies between the "single source shortest path" and "all-pairs shortest path" problems. For now I'm leaning towards something like a memoized A* algorithm.

As for the assignments, I'm not sure what to use yet. This problem is unlike k-means because both the location and the capacity of schools is fixed. I'm considering the Stable Marriable Problem (or NRMP), the Assignment Problem, and Hopcroft-Karp Algorithm.

If you're interested, please feel free to fork the project and contribute to it.

How You Can Help with Hurricane Patricia

HOT OSM Hurricane Patricia

Hurricane Patricia made landfall in Mexico 7pm today. Do you wonder how you could possibly help out? One way is through building a better map for relief workers.

OpenStreetMap is a global map built by citizen mappers similar to the way Wikipedia is built. With about 1 hour of training, you can also edit the map in a way that would help the people of Mexico in this disaster.

Prepare by learning about OpenStreetMap.

Then join the Humanitarian OpenStreetMap Team on the front line with a Hurricane Patricia task.

If you have any questions, please email me.

Double-Struck Header Title

double struck b

I was amazed to see that the default font in Chrome doesn't have glyphs for the double struck characters in Unicode used for special sets of numbers in math. The header title on this blog was using them, so it was important to me that it was right. My solution is odd, but works very well.

Instead of searching for some widely available font that did have these glyphs rendered, i created my own font. I knew that the DejaVu Sans font on my laptop had them.

I could have just shared this font as a web font and be done with it. But there was still one issue bothering me. I highly doubt that machines recognize the double struck B as a B. So i created a new font with just the letters and digits and used the double struck glyphs from DejeVu Sans. Now you can copy my header title into some a document and get Brian DeRocher.

Switching from inline-block to flex

Holy Grail Layout by Mozilla

While disliking CSS floats, i though i achieved the nirvana of page layout by using display: inline-block. Then i found display: flex.

Both the left side navigation and the right side main content were inline-blocks with the left side width: 20% and the right side width: 80%. I just had to make sure there was no margin on these elements and there was no white space between the elements. So often i had code like this <div><div class='left'>menu</div><div class='main'>content</div></div>; or for forms like this: <div class='form_style'><label>name</label><div><input/></div></div>.

Now i'm using display: flex. It's pretty well supported among all browsers. It easy to support responsive layouts. I'm looking forward to finding and switching to a flex based grid.

Reference: Using CSS flexible boxes

Counting Bubbles and the Poisson Distribution

brewing bubble count poisson graph

I've been counting the number of bubbles seen per minute in the 2 beers i'm currently brewing. After putting them on a chart, it seemed to me they look like a poisson distribution. I'll let you decide for yourself.

Good scientist debunk, great scientists debunk themselves

Francis Bacon

Last week i reshared by Carl Sagan, telling us how, unlike politics and religion, scientists can change their mind. Like the universe took a cue...

... this morning i hear on Morning Edition and interview with Shankar Vedantam about how little journals support verifying science. But i was really impressed when i read A Researchers Who Provided Key Evidence For Gluten Sensitivity Have Now Thoroughly Shown That It Doesn't Exist.

The person in this image is Francis Bacon, often cited for inventing the scientific method.