08.15.09

Progress! Including census tracts!

Posted in Hacking, Maps at 9:54 pm by ducky

It might not look like I have done much with my maps in a while, but I have been doing quite a lot behind the scenes.

Census Tracts

I am thrilled to say that I now have demographic data at the census tract level now on my electoral map!  Unlike my old demographic maps (e.g. my old racial demographics map), the code is fast enough that I don’t have to cache the overlay images.  This means that I can allow people to zoom all the way out if they choose, while before I only let people zoom back to zoom level 5 (so you could only see about 1/4 of the continental US at once).

These speed improvements were not easy, and it’s still not super-fast, but it is acceptable.  It takes between 5-30 seconds to show a thematic map for 65,323 census tracts. (If you think that is slow, go to Geocommons, the only other site I’ve found to serve similarly complex maps on-the-fly.  They take about 40 seconds to show a thematic map for the 3,143 counties.)

A number of people have suggested that I could make things faster by aggregating the data — show things per-state when way zoomed out, then switch to per-county when closer in, then per-census tract when zoomed in even more.  I think that sacrifices too much.  Take, for example, these two slices of a demographic map of the percent of the population that is black.  The %black by county is on the left, the %black by census tract is on the right.  The redder an area is, the higher the percentage of black people is.

Percent of population that is black; by counties on left, by census tracts on the right

Percent of population that is black; by counties on left, by census tracts on the right

You’ll notice that the map on the right makes it much clearer just how segregated black communities are outside of the “black belt” in the South.  It’s not just that black folks are a significant percentage of the population in a few Northern counties, they are only significantly present in tiny little parts of Northern counties.  That’s visible even at zoom level 4 (which is the zoom level that my electoral map opens on).  Aggregating the data to the state level would be even more misleading.

Flexibility

Something else that you wouldn’t notice is that my site is now more buzzword-compliant!  When I started, I hard-coded the information layers that I wanted: what the name of the attribute was in the database (e.g. whitePop), what the English-language description was (e.g. “% White”), what colour mapping to use, and what min/max numeric values to use.  I now have all that information in an XML file on the server, and my client code calls to the server to get the information for the various layers with AJAX techniques.  It is thus really easy for me to insert a new layer into a map or even to create a new map with different layers on it.  (For example, I have dithered about making a map that shows only the unemployment rate by county, for each of the past twelve months.)

Some time ago, I also added the ability for me to specify how to calcualte a new number with two different attributes.  Before, if I wanted to plot something like %white, I had to add a column to the database of (white population / total population) and map that.  Instead, I added the ability to do divisions on-the-fly.   Subtracting two attributes was also obviously useful for things like the difference in unemployment from year to year. While I don’t ever add two attributes together yet, I can see that I might want to, like to show the percentage of people who are either Evangelical or Morman.  (If you come up with an idea for how multiplying two attributes might be useful, please let me know.)

Loading Data

Something else that isn’t obvious is that I have developed some tools to make it much easier for me to load attribute data.  I now use a data definition file to spell out the mapping between fields in an input data file and where the data should go in the database.  This makes it much faster for me to add data.

The process still isn’t completely turnkey, alas, because there are a million-six different oddnesses in the data.  Here are some of the issues that I’ve faced with data that makes it non-straightforward:

  • Sometimes the data is ambiguous.  For example, there are a number of states that have two jurisdictions with the same name.  For example, the census records separately a region that has Bedford City, VA and Bedford County, VA.  Both are frequently just named “Bedford” in databases, so I have to go through by hand and figure out which Bedford it is and assign the right code to it.  (And sometimes when the code is assigned, it is wrong.)
  • Electoral results are reported by county everywhere except Alaska, where they are reported by state House district.  That meant that I had to copy the county shapes to a US federal electoral districts database, then delete all the Alaskan polygons, load up the state House district polygons, and copy those to the US federal electoral districts database.
  • I spent some time trying to reverse-engineer the (undocumented) Census Bureau site so that I could automate downloading Census Bureau data.  No luck so far.  (If you can help, please let me know!)  This means that I have to go through an annoyingly manual process to download census tract attributes.
  • Federal congressional districts have names like “CA-32” and “IL-7”, and the databases reflect that.  I thought I’d just use the state jurisdiction ID (the FIPS code, for mapping geeks) for two digits and two digits for the district ID, so CA-32 would turn into 0632 and IL-7 would turn into 1707.  Unfortunately, if a state has a small enough population, they only get one congressional rep; the data file had entries like “AK-At large” which not only messed up my parsing, but raised the question of whether at-large congresspeople should be district 0 or district 1.  I scratched my head and decided assign 0 to at-large districts.  (So AK-At large became 0200.)  Well, I found out later that data files seem to assign at-large districts the number 1, so I had to redo it.

None of these data issues are hard problems, they are just annoying and mean that I have to do some hand-tweaking of the process for almost every new jurisdiction type or attribute.  It also takes time just to load the data up to my database server.

I am really excited to get the on-the-fly census tract maps working.  I’ve been wanting it for about three years, and working on it off and on (mostly off) for about six months.  It really closes a chapter for me.

Now there is one more quickie mapping application that I want to do, and then I plan to dive into adding Canadian information.  If you know of good Canadian data that I can use freely, please let me know.  (And yes, I already know about GeoGratis.)

08.05.09

Africa journal part 2: elephants

Posted in Family, Travel at 6:05 pm by ducky

Of all the charismatic megafauna in Botswana, elephants are perhaps the most charismatic and definitely the most mega. We are also friends with Jake Wall, an elephant researcher working with Save the Elephants (see the National Geographic article that he’s featured in!), so we probably knew more about elephants than any other of the Botswana animals. Good thing, as we saw lots of elephants. LOTS of elephants. I am certain that I saw at least one hundred, and maybe two or three hundred.


elephantsDrinking2.sm

We saw the biggest herds from the Chobe river next to the Chobe National Park, near Kasane.

elephantsChobe2.sm

There are 50,000 elephants in the 11,700km² park, and in the dry season, many of the ones in the north go to the river in the late afternoon to drink. There are so many elephants there that there are practically traffic jams!

elephantsLeavingWater.sm

Not only that, but the herds do not run away from tourists in boats. I don’t know if they are just habituated to tourists and how much of it is that groups of primate predators in boats aren’t as threatening as groups of primate predators on land. (How do they know we are predators? Predators have eyes that face forwards.) The elephants kept wary eyes on the boats, but they weren’t spooked enough to move away. Later on the safari, we mostly got to watch animals’ backsides as they moved away from the scary tourists; the river cruise was one place where we saw their frontsides.

elephantsDrinking4.sm

In the same way, because we were in boats, the elephants weren’t a threat to us. That meant that the boat captains could bring us quite close. I estimate that we got to within four or five meters of elephants (and crocodiles and hippos!) sometimes.

elephantsDrinking3.sm

On our second river cruise, a bachelor herd (males only) swam across the river RIGHT IN FRONT OF US. I knew that elephants could swim, but was quite surprised at how they swam. Unlike dogs or horses, their heads are almost completely submerged and their bodies are completely invisible. All you can see is a little bit of trunk, acting as a snorkel, and the tops of their heads. Their heads rock forwards and back as they swim.

elephantSwimming2.sm

Elephant swimming across Chobe river

All fourteen of the bachelor herd got into the water, but one young male turned abruptly back after walking in up to about his shoulders. Our guide surmised that he was new to the area and afraid of the water. As we left, he was wandering back and forth on the shore, looking across the river at his buddies. I imagined him feeling bereft and forelorn, hating being separated from his herd but also afraid of the dark waters in front of him.

His buddies, once they got across, pulled up hunks of the tall grass in the marshy land on the other side and for all the world appeared to spank the ground with it, then eat it. Our captain explained that they were knocking the dirt off of the roots. (They maybe were standing in a little bit of water — hard to tell from a distance when marsh grasses were everywhere.) When an elephant dies of “old age”, it is usually from starvation. Either the teeth wear down to unusable or they fall out, and then the elephant can’t chew its food adequately. If they knock the dirt off, then that saves wear and tear on the teeth.

On the other hand, sometimes elephants would eat dirt. Yes, really. There are some minerals (like salt) that aren’t plentiful enough in their food, so they will dig holes and eat the dirt. (They might not chew the dirt, I suppose, so perhaps that dirt doesn’t wear down their teeth.)

Elephants feeding each other dirt

Elephants feeding each other dirt from a hole they dug

The first pictures, of the elephants at the riverbank, are mostly “breeding herds” — composed of females and juvenile males. As soon as a male starts getting overly friendly with the females in the herd, the mother forces him out! I sure hope that elephants have complex language, as otherwise it seems like it would be a horrible, horrible shock. Imagine being a boy who spends every minute of every day with the same twenty family members, and as soon as your mom sees you checking a girl out, she forcibly runs you out without telling you why! Imagine then having to find a group of other lonely males — with presumably a different social structure — and try to fit in.

The bachelor herds we saw had a range of ages hanging out together. We heard that the younger bulls learned how to do things from the older bulls. (Presumably like how to cross rivers, and also where the good water holes are.)

Bulls do not always hang out together; sometimes they go off on their own. Not being an elephant psychologist, I don’t know if they are socially maladept, bored, tired of being around younger bulls, tired of being around older bulls, or what. Maybe those anthropomorphic emotions don’t even make sense for elephants.

We did observe two elephants being affectionate (or at least intimate) with each other, feeding each other dirt from a hole they had dug — see photo above.

It was not uncommon to see lone bulls — occasionally at very close range!

JimElephantTent.sm

Jim responding to cries that there was an elephant in our camp

We were taking a siesta in our tent when we heard people shouting that there was an elephant in our camp. We weren’t sure if we were safer inside the tent our outside, and eventually chose to get out of the tent, only to discover that the elephant was only five meters away!

This bull was after seed pods from the camelthorn acacia tree in our camp. He put his tusks around the tree, carefully laid his trunk up the tree trunk, and shook the tree, making pods rain down. He hoovered the area of pods and then sauntered off, totally nonchalant and disinterested in us.

elephantShakingTree.sm

Bull elephant harvesting camelthorn acacia seed pods

I was surprised at just how quiet elephants are when they walk. As I mentioned above, the elephant in our camp was 5m away and we never heard him. Not a thing. They are so big that you’d expect the ground to shake as well, sort of like a truck going by, but no, not a thing. When walking, they have three feet on the ground at any one time, and have big poufy feet, so they are incredibly stealthy. Here’s how big their feet are compared to mine:

elephantTracks.sm

Tracks of the elephant that went through our camp

Later on the trip, Jim and I heard a great deal of splashing around while we were visiting the camp latrine, which that night only had distance as its privacy guard. The splashing noise went away before we finished up, and on our way back we encountered a (very uncomfortable/embarrassed) guide who wanted to warn us that an elephant had swum across the river and landed right near us, but didn’t really want to intrude upon us in the latrine! Once the elephant got out of the river, we heard nothing, even though the splashing sounded quite near.

Did that frighten us? No. Maybe it should have, but it didn’t. The elephant that passed the latrine could probably smell us (and the latrine), we were not advancing upon it, it would have to go through some bushes to get to us, and elephants are usually not aggressive unless they are in musth (a condition similar to erustrus in females, characterized by extreme randiness, aggression, and a strong and distinctive odor) and we didn’t smell anything funny. We also only heard one animal splashing, which meant that it was unlikely to think we were threatening its child.

We did see adult females protecting a baby elephant quite fiercely a few days before: note that there are four adult females forming a defensive ring around the baby, barely visible (cyan arrow points to its tail). They were also trumpeting and flapping their ears.

Four female adults protecting one baby elephant

Four female adults protecting one baby elephant

While elephants’ walking is nearly silent, the same cannot be said for their crapping. Their dung comes out in volleyball-sized balls, and like horses but unlike dogs (or lions, as we observed later), elephants don’t stop and squat to defecate, but just lift their tails and keep on walking. That means their dung falls from a great height — two or three meters up. Boom! Boom! Boom!

Elephant dung

Elephant dung

The shape is such that, well, I will never look at Rolo chocolates the same way again.

On our river cruise, we were quite surprised to see baboons apparently eating elephant dung. Our guide explained that elephants have poor digestive systems. (Elephants pass so much fiber in their dung that people make paper out of it!). Their digestive system is so poor that frequently it lets fruit and nuts escape undigested. Baboons would thus root through the elephant dung in order to find those fruits and/or nuts.

Baboon eating elephant dung

Baboon eating elephant dung

As you can see, I was fascinated by the elephants.

Africa journal part 1: logistics

Posted in Family, Travel at 5:42 pm by ducky

Jim and I, having no kids of our own, borrow nieces and nephews when they turn (about) fourteen.  We had a friend from Botswana who encouraged us to visit, and The Niece was up for it, so we went to Africa!  This post talks a little about where we went, how we got there, where we stayed, what the accommodations were like, etc.   This post will have almost no observation/analysis/personal notes: it probably isn’t that interesting unless you really like Jim and/or I, or you are planning/thinking about a trip to Botswana yourself.  (See the next postings for analysis and personal notes.)

We spent twenty-four days total away from our home, although we spent about seven days getting there and back: one day from Vancouver to Seattle (via Bellingham to pick up The Niece), one night to Frankfurt, one day in Frankfurt, one night to Johannesburg, one day drive to Botswana, and then the reverse (except we flew to Jo’burg instead of driving).

The Safari

The centerpiece of the trip was a seven-night/eight day overland (i.e. driving) safari with Chobezi, camping for one or two nights in one place, then driving to the next interesting place. We travelled in a group of eight: us three, two Belgian men in their early twenties, one guide/driver, and one cook.

We found and booked the trip online (and when I say “we”, I mean “Jim”), with what turned out to be a South African booking agency.  This meant that we knew very little about what the safari would be like.  We knew where we would be stopping, and we knew that we were going overland and camping in tents with foam matresses, but that was all we knew.  We knew so little that we even had trouble rendezvousing with Chobezi at the pickup point!

We camped at four places: at Serondela and Savute Marshe in the Chobe National ParkMoremi Game Reserve, and an island in the Okavongo Delta.

A typical “moving” day would have us get up around 0630h, eat breakfast, pack our gear, tents, and sleeping rolls, wait for the guide and cook to pack everything else (they turned down help), and drive to the next site, looking for game along the way.  We’d set up our tents and bedrolls, then take a siesta, sunbathe, hang out, whatever, until about 1630h, when we’d do an evening game drive before dinner.  A non-“moving” day would be the same except that we’d go for a game drive early in the morning and not tear down/set up camp or drive to the next site.

We rode around in a “safari car” or “safari truck” — a converted Land Cruiser with elevated bench seats.  The truck we used on our safari has five seats plus some storage in the back, plus it hauled a trailer full of stuff when we moved camp.  I believe most safaris rely more heavily on airplanes to get people from one place to another; I don’t recall seeing another safari car with storage.

Safari Car

Our safari car

Here are some other safari cars:

Some other companies' safari trucks

Some other companies' safari trucks

The tents were quite big.  The Niece and I could stand up in them.

Ducky Standing up in tent

Ducky Standing up in tent

I had never seen bedrolls these before: they were relatively thick foam matresses, with sheets, pillow, and a comforter placed on them, that we could zip up and roll up.

BedrollsUnrolled

Bedrolls unfurlled (L) and in bondage (R)

Bedrolls rolled up

Bedrolls rolled up

The tents and bedrolls were heavy, but because we were car camping, it didn’t matter.

Camp hygiene

The camp had a it latrine with a toilet seat frame over it, and canvas walls set up around it. Jim once commented that in terms of value per ounce, the toilet seat was way, way up there!

Next to our tents they put little canvas bags that served as wash basins.  Every morning, they would put hot water in the basins for us to wash with.  That was really nice!

We also didn’t realize it until near the end, but we had a shower available as well.  Apparently the first day, our guide asked me if I wanted a shower.  “Maybe later”, I said, and he waited for me but I never got around to asking.  I don’t remember this: probably I thought he was kidding.  (A shower?  While camping?)

At our second stop (at Savute Marsh), we stayed in a campground, with hot showers and sinks and flush toilets and everything.  They also had neat washbasins with built-in washboards, so clearly you were allowed (encouraged?) to wash your laundry in the sink.

There were probably twenty campsites at the Savute Marsh campground, filled mostly with self-driving South Africans. You would think that would impede the wildlife viewing, but in fact did not, as you will read about in my elephants post.

Camp food/cooking

Cooking was done on an open fire.  They brought along something that looked like an iron coffee table, and put that over the fire.

Kitchen facilities

Kitchen facilities

Breakfast consisted of cold cereal, tea, porridge (oatmeal), and fruit.  On moving days, lunch was usually sandwiches (cold cuts), potato salad, and fruit.  Dinner was always a hot meal, with a meat course, starch (potatos, rice, or “pap” — sort of corn/maize porridge), and a vegetable dish (e.g. carrots and potatos).  The food was really, really yummy — the cook did a great job.

Jim and I normally try to eat vegetarian, with Jim being better at sticking to his values than I.  I wimped out and ate the meat in Botswana because it was just easier.  (Jim had told the South African booking company that we were vegetarians, but that piece of information never got to the guides.) Jim just didn’t eat the meat for a few days.  The cook and guide noticed, and asked Jim, who said that he preferred to not eat meat.

The next day, the cook announced that “for the man who does not eat meat, I fixed something special.”  With a flourish, he revealed… chicken!  (In many languages, “meat” means “mammal meat”.)  Faced with that level of attentiveness and care to his needs, Jim (sigh) ate the chicken.

Mokoro camp

For our last two days, we said goodbye to our driver (although we kept our cook) and went out to an island in the Okavango Delta by boat(s).  First we took a speedboat to the Boro village, where we transferred to mokoros — poled dugout canoes — for a two-hour water voyage to our camp.

Getting ferried by what are essentially African gondolas sounds very romantic.  The reality was less so.  The boats were very tippy, so you had to be careful about shifting around.  The seats were basically institutional plastic chairs with no legs, just dropped into the boat, so weren’t that comfortable.  We went there in the afternoon and came back in the morning — and the camp was west, so we had the sun in our eyes both times.  Perhaps because it has been an extremely wet year, there were thousands of gnats, which hovered right at sitting-person-level.  To catch the gnats, many water spiders built webs right at sitting-person-level.  (Note: neither the gnats nor the spiders bit.  They were just annoying.)

Gnats during Mokoro ride

Gnats during Mokoro ride

One of the Belgian youths turned his seat around so that the back of his head caught the gnats and spiders, and the sun was not in his eyes.  That would have been much more pleasant.  Going out in the morning and back in the afternoon would have also been more pleasant.

We went on a game walk on the island, something that we couldn’t do elsewhere.  In other areas, we had been pretty much stapled to the truck because of the small but real danger from lions.  While we did get a safety lecture before our walk on what to do if we encountered lions, hippos, snakes, or wildebeests, I presume that the dangerous animals are rare on that island.  (We did not see any lions, hippos, or snakes, and the wildebeest were a long way away.)

It was nice to get some exercise, and we saw larger herds of animals than we did from the safari truck.  (The truck is noisy.  It can’t really sneak up on a herd the way we could on foot.)  However, we couldn’t get as close on foot, in part because of the need to be stealthy, in part for safety reasons.  While we saw lions from several meters (and in one case, ONE meter, see below) from the truck, on the walk we were usually more like 500m or 100m from herbivores.

Lion hidden from truck behind bush.

One example of how close we got in the truck

We also didn’t see much on the walk that we hadn’t already seen from the truck, aside from an aardvark den (a hole in the sand).

The locals who guided or poled us to the island did sing and dance for us on the second night, and we got a mini-tour of their village, and that part was nice.  Aside from that, however, I could have done without the Okavongo Delta part of the tour.

Non-safari

We spent several days in Gaborone (“Gabs”), the capital.  We ran out to tour the diamond mine in Jwaneng the day after we landed (since the mine only gives tours on Fridays). The mine could have been any heavy equipment plant in North America, except that the second language was Setswana and not Spanish (US) or French (Canada) and there were two more baboons than I would have expected in North America.

Ducky looking out over open-pit diamond mine

Ducky looking out over open-pit diamond mine

We spent the weekend wandering around Gaborone — checking email, letting Katie run on a treadmill at a gym, shopping for things the airlines ban, buying local GSM chips for our cell phones, trying and failing to find local maps, wandering around shopping malls and bazaars — and waiting for our friend B.  We were supposed to leave Gabs on Sunday, but our friend B. sadly had to go to a funeral on Sunday, so we had an extra day in Gabs.

We were going to go to the Khama Rhino Sanctuary in Serowe, but because of the funeral, we had to cut something, so we cut the rhinos.  We found out later that our friend B. is from Serowe; had we realized that, we would have cut something else.

Serowe is also the hometown of Sir Seretse Khama, the first president of Botswana.  Botswana is, unlike its neighbours, a bastion of peace and (relative) prosperity, in large part due to this one amazing man.  Please pause now and read his Wikipedia entry before going on to my next Africa journal blog posting.

05.20.09

Gender and programming

Posted in Hacking, programmer productivity, robobait, Technology trends at 11:44 am by ducky

I had a very brief but very interesting talk with Prof. Margaret Burnett.  She does research on gender and programming. at Oregon State University, but was in town for the International Conference on Software Engineering.  She said that many studies have shown that women are — in general — more risk averse than men are.  (I’ve also commented on this.)  She said that her research found that risk-averse people (most women and some men) are less likely to tinker, to explore, to try out novel features in both tools and languages when programming.

I extrapolate that this means that risk-seeking people (most men and some women) were more likely to have better command of tools, and this ties into something that I’ve been voicing frustration with for some time — there is no instruction on how to use tools in the CS curriculum — but I had never seen it as a gender-bias issue before.  I can see how a male universe would think there was no need to explain how to use tools because the figured that the guys would just figure it out on their own.  And the most guys might — but most of the women and some of the men might not figure out how to use tools on their own.

In particular, there is no instruction on how to use the debugger: not on what features are available, not on when you should use a debugger vs. not, and none on good debugging strategy.  (I’ve commented on that here.)  Some of using the debugger is art, true, but there are teachable strategies – practically algorithms — for how to use the debugger to achieve specific ends.   (For example, I wrote up how to use the debugger to localize the causes of hangs.)

Full of excitement from Prof. Burnett’s revelations, I went to dinner with a bunch of people connected to the research lab I did my MS research in.  All men, of course.  I related how Prof. Burnett said that women didn’t tinker, and how this obviously implied to me that CS departments should give some instruction on how to use tools.  The guys had a different response: “The departments should teach the women how to tinker.”

That was an unsatisfying response to me, but it took me a while to figure out why.  It suggests that the risk-averse pool doesn’t know how to tinker, while in my risk-averse model, it is not appropriate to tinker: one shouldn’t goof off fiddling with stuff that has a risk of not being useful when there is work to do!

(As a concrete example, it has been emotionally very difficult for me to write this blog post today.  I think it is important and worthwhile, but I have a little risk-averse agent in my head screaming, screaming at me that I shouldn’t be wasting my time on this: I should be applying for jobs, looking for an immigration lawyer, doing laundry, or working on improving the performance of my maps code.  In other words, writing this post is risky behaviour: it takes time for no immediate payoff, and only a low chance of a future payoff.  It might also be controversial enough that it upsets people.  Doing laundry, however, is a low-risk behaviour: I am guaranteed that it will make my life fractionally better.)

To change the risk-averse population’s behaviour, you would have to change their entire model of risk-reward.  I’m not sure that’s possible, but I also think that you shouldn’t want to change the attitude.  You want some people to be risk-seeking, as they are the ones who will get you the big wins.  However, they will also get you the big losses.  The risk-averse people are the ones who provide stability.

Also note that because there is such asymmetry in task completion time between above-median and below-median, you might expect that a bunch of median programmers are, in the aggregate, more productive than a group at both extremes.  (There are limits to how much faster you can get at completing a task, but there are no limits to how much slower you can get.)  It might be that risk aversion is a good thing!

There was a study I heard of second-hand (I wish I had a citation — anybody know?) that found that startups with a lot of women (I’m remembering 40%) had much MUCH higher survival rates than ones with lower proportions of women.  This makes perfect sense to me; a risk-averse population would rein in the potentially destructive tendencies of a risk-seeking population.

Thus I think it does make sense to provide academic training in how to use tools.  This should perhaps be coupled with some propaganda about how it is important to set aside some time in the future to get comfortable with tools.  (Perhaps it should be presented as risky to not spend time tinkering with tools!)

UPDATE: There’s an interesting (though all-too-brief!) article that mentions differences in the biochemical responses to risk that men and women produce.  It says that men produce adrenaline, which is fun.  Women produce acetylcholine, which the article says pretty much makes them want to vomit.  That could certainly change one’s reaction to risk..

05.10.09

Arkansas liberalism?

Posted in Maps, Politics at 6:38 pm by ducky

I added a state legislatures partisanship layer to my election map, and also modified a metric which shows kind of how liberal an area is.  For every governor, US senator, or US congressman in a district that is a Democrat, I added one.  For every legislator who is a Republican, I subtracted one.  Now, with the new data, I also add one point for each state legislative chamber that is controlled by Democrats, and subtract one for each that is controlled by Republicans.

This gives me a range of -6 to plus 6 (governor, two US senators, one US congressman, one state senate, one state lower chamber), which I can show in shades of red to blue:

demlegislators-2009

Some things are not surprising: the northeast is very blue; Idaho and Utah are very red.  However, I don’t get Arkansas.  I wouldn’t have thought that it would be culturally very different from its neighbours, yet most of the state has the maximum value of +6.

Is this all due to Clinton?  Did he build a really strong Democratic Party operation in Arkansas?  Or did he throw a bunch of money towards Arkansas, for which they are still grateful?

Can anyone familiar with Arkansas shed any light on this?

UPDATE:

A reader from Arkansas explained that the Arkansas Democratic party is very entrenched and strong, but that the populace is not particularly liberal.  Essentially, people who are Democrats in Arkansas would be Republicans just about anywhere else.  (This is similar to the Liberal Party in BC, which is the most conservative of the three viable parties in BC.  The Liberal Party in BC is much more conservative than the Canadian federal Liberal party.)

05.09.09

Harvard, creativity, and university reform

Posted in University life at 12:59 am by ducky

Jerome Dolittle recently reported via James Fallows that he had asked thirty Harvard first-year students to redesign universities from the ground up; 29 of 30 came up with, as the author put it, “something that looked very much like Harvard, except a little farther out of town”.  He seemed to take this as evidence that Harvard students were not very creative.

This was in response to an article by Randy Pollack talking about how uncreative Chinese MBA students were: when asked to come up with a the most original idea they could for a business, e.g. a restaurant chain, five of six groups came up with the idea of — a restaurant chain!  This was given as evidence of how the Chinese educational system did not foster creativity.

Dolittle seemed to think that the Harvard students were just as uncreative as the Chinese students, but I don’t think that comparison is fair.  I think that reforming education is a much more difficult problem for first-year students than thinking of a business would be for MBA students.

In addition to the age difference and the difference in academic focus, the MBAs had probably encountered hundreds if not thousands of businesses and products in their day-to-day life.  I would bet that the majority of the Harvard freshman had intimate knowledge of exactly one university.  It’s difficult to consider how you can change something if you don’t have an idea of the number of degrees of freedom you have.

Even faculty have difficulty being creative about reforming universities.  Recently there was a New York Times opinion piece End the University as we know it that got quite a bit of buzz in my circles, despite its recommendations being, in my opinion, not very creative:

  1. Restructure the curriculum to be more interdisciplinary.
  2. Abolish permanent departments, replacing them with problem-focused temporary departments (e.g. Water).
  3. Collaborate more across institutions.
  4. Allow dissertations in forms other than things that look like scholarly books.
  5. Give graduate students real-world skills.
  6. Abolish tenure.

Three recommendations (#1,# 3, and #5) are goals that institutions already aspire to.  They might not do it well, but they sure talk about it a lot.

I think people haven’t done #6 because it would lead to either a rise in cost or a decline in quality (or both), not because it wasn’t an obvious thing to try.

Aside from the increased administrative overhead and lack of departmental reputations that #2 would cause, project-based learning has been tried before to some extent.  (Hampshire College is highly individual-project based; Colorado College students take one compressed course at a time.)  One could also easily argue that each graduate student is supposed to create their “department of one”.  (When I got my first MS, I took classes in library science and intellectual property law because that’s what made sense for my area of interest.)

For #4, I believe that it already is possible to do a non-book thesis, particularly in the performing arts.   One friend’s “dissertation” was a symphony.  Another friend made a movie for her anthropology thesis.  While I have a copy of my thesis printed on dead trees, the important version of the thesis is the PDF available on-line.

Even though Taylor’s ideas are not that novel, they got buzz.  I think that means that it is really hard for most people to come up with ideas on how to reform university education.

In contrast to the inexperience of the Harvard freshmen, I have been downright promiscuous with universities.  (I have eight transcripts now, for examplet.) This familiarity helped me identify — fourteen years ago — some core functions of a university institution that I thought could be disaggregated: unidirectional information transfer, interactive learning experiences, caring/paying attention, and certification. I also showed how these pieces could be rearranged by private enterprise and social media. (In later blog posts, I showed how this disaggregation/disintermediation is already happening.)

Now, it is possible that it is a coincidence that I have both unusual intimacy with universities and was able to come up with creative insights about reform.  I suppose it’s also possible that I’m just amazingly brilliant. I don’t think so.  I think that if you see lots of X, then it becomes easier to think creatively about things you could do with X.

It might be that the Harvard students were in fact just as uncreative as the Chinese MBAs.   However, I don’t think Dolittle proved that.

05.04.09

Locally omniscient debugging

Posted in programmer productivity, Technology trends at 4:22 pm by ducky

Update: it turns out that lots of people have done exactly what I asked for: see Instruction-level Tracing:
Framework & Applications
and the OCaml debugger.  Cooool! (Thanks DanE!)

In my user studies, programmers used the debugger far less than I had expected.  Part of that could perhaps be due to poor training in how to use a debugger — it is rare to get good training in how to use a debugger.

However, I think the answer is simpler than that: it is just plain boring and tedious to use a debugger.  One guy did solve a thorny problem by stepping through the debugger, but he had to press “step over” or “step into” ninety times.

And when you are stepping, you must pay attention.  You can’t let your mind wander, or you will miss the event you are watching for.  I can’t be the only person who has done step, step, step, step, step, step, step, boom, “oh crap, where was I in the previous step?”

Omniscient debuggers are one way to make it less tedious.  Run the code until it goes boom, then back up.  Unfortunately, omniscient debuggers capture so much information that it becomes technically difficult to store/manage it all.

I suggest a compromise: store the last N contexts — enough to examine the state of variables back N levels, and to replay if desired.

I can imagine two different ways of doing this.  In the first, the user still has to press step step step; the debugger saves only the state changes between the lines that the user lands on.  In other words, if you step over the foo() method, the debugger only notes any state differences between entering and exiting the foo() method, not any state that is local to foo().  If the user steps into foo(), then it logs state changes inside foo().

In the other method, the user executes the program, and the debugger logs ALL the state changes (including in foo(), including calls to HashTable.add(), etc.).  This is probably easier on the user, but probably slower to execute and requires more storage.

You could also do something where you checkpoint the state every M steps.  Thus, if you get to the boom-spot and want to know where variable someVariable was set, but it didn’t change in the past N steps, you can

  • look at all your old checkpoints
  • see which two checkpoints someVariable changed between
  • rewind to the earlier of the two checkpoints
  • set a watchpoint on someVariable
  • run until the watchpoint.

05.01.09

Churchiness and torture

Posted in Politics at 8:47 am by ducky

CNN released a poll that showed that how often an American Christian goes to church corresponds strongly to how much he/she supports torture.

To a liberal, this makes no sense at all.  The Golden Rule says to treat others as we would like to be treated ourselves, right?  And most people would not want to be tortured, right?  What’s the deal?

It makes sense to me in light of Haight’s findings on morality.  The people who go to church the most often are those for whom belonging to a group is most important, which ties to in-group loyalty.  I can imagine that as in-group loyalty increases, desire to protect the in-group gets fiercer.  Meanwhile, I can imagine that as in-group loyalty increases, respect for/value of people in the out-group decreases.   To put it another way, the higher your loyalty to people who look like you, I bet the less interested you are in preserving the rights of people who don’t look like you.

This is not my value structure.

Update: A friend pointed me to a study that shows that participation in religious rituals (but not how often they prayed) predicts support for suicide bombing!  This was true across cultures — Palestinian Muslims, Israeli Jews, Mexican Catholic, Indian Hindus, Russian Orthodox Christians, UK Protestants, and Indonesian Muslims.  Furthermore, in some of the interviews, they “primed” the interviewee to think about religious affiliation before asking about support for suicide bombing; that turned out to significantly increase reported support for suicide bombing!

This paper thus seems to me to pretty strongly support the CNN poll, albeit indirectly. It seems to me that it not a great leap to replace

  • a suicide bomber from the in-group who kills members of the out-group

with

  • a torturer from the in-group who tortures members of the out-group.

04.27.09

LOLcats ISO code

Posted in Random thoughts, Too Much Information at 11:15 am by ducky

I’ve been working on LOLcat subtitles for Sita Sings The Blues, and a friend asked me what the ISO 639 language code for LOLcat was.

It turns out that the ISO 639 language code LOL does exist, and is for the central African language Mongo.  Who knew that the kittehs were African!?!?

Update: My buddy Luther points out that the African Wildcat is the ancestor of the domesticated housecat.  As he pointed out, “Duh.”

Update2: Luther also asks, “I can haz bank scam?”

04.24.09

On the record: I want torture prosecutions

Posted in Politics at 7:41 am by ducky

A few days ago, I read something somewhere about how disappointing it was that there wasn’t more hue and cry about the recent release of the torture memos.  (Sorry, my computer died and I was somewhat off the air for a few days, so don’t have a citation.)

Initially, I wasn’t going to blog about the release of the memos, but I feel I have to go on the record.  I feel I have to say something in order to be counted, to make the “torture bad” side of the argument one voice stronger.

Initially, I wasn’t going to blog because I didn’t think any more needed to be said.  I’ve already discussed why I think torture is a bad idea.  (Never mind discussions about it being morally wrong, it’s still just flat a bad idea.)  The things that I said — that I thought it was impossible to keep our torturing a secret, impossible to only torture guilty people, and that torture gave faulty information — proved true well before the memos were released.

I was angry and saddened at my country’s cavalier treatment of our military prisoners even before the memos were released.  I had already seen routine torture at Abu Ghraib, and it was already known that we had waterboarded some prisoners.  To hear that we waterboarded one guy 183 times was appalling, but I was already appalled that we did it at all.  The difference between someone who knocks over 90 year-olds for fun and one who doesn’t is far starker than one who knocks over three seniors over versus one who knocks over 183.

I was already angry and saddened at how many of my fellow citizens thought torture was a hunky-dory method; just one more tool in the toolchest for waging war.  To hear that Peggy Noonan thought we should not have released the memos — that we should just avert our eyes and walk on by was jaw-dropping, but my jaw has been on the floor for a long time.

The only thing that has changed is my attitude towards prosecution.  I had gone along with the argument that we shouldn’t spend political capital on dragging something along that would devolve into partisan bickering.  After seeing how stunningly in denial the Right-Wing is about torture being illegal, immoral, and ineffective, I now think we have to prosecute.  If we don’t — if we continue to let a large portion of the country think that torture is okay — then we will torture again.

This is not about retribution.  This is not about vengence.  This is not even about justice.  This is about prevention.  This is about deterrence.  This is about making sure that my country never goes down that slippery slope again.

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »