December 2005 Archives

Bush speech analysis redux

| | Comments (2)

Well, today on my lunch hour I extended my little word frequency application to look at phrases as well. I got some interesting results.

Below is a sample of some of the common two-word phrases Mr. Bush used in his speech:

RankTerm Count
0in iraq 31
1of the 28
2the terrorists 24
3in the 21
4and we 14
5we will 13
6to the 13
7middle east 11
8and the 11
9the world 11
10the middle 10

Not too surprising... and not very interesting. Let's try three:

RankTerm Count
0the middle east 10
1the american people 7
2the united states 6
3i want to 6
4in iraq and 5
5the war on 5
6and we will 5
7war on terror 5
8freedom in iraq 5
9the terrorists and 5
10when the terrorists 5
11setting an artificial 5
12an artificial deadline 5

A little more interesting. The phrase I want to was said by Mr. Bush six times during the speech. Freedom in Iraq was invoked five times. Near the bottom of the table we see the phrase setting an artificial deadline split across two entries; I remember that that piece of rhetoric really struck me when I first read the transcript. Obviously, Mr. Bush and his administration want to connote that setting any deadline for troop withdrawl in Iraq is artificial.

I don't know about you, but the word artificial produces in me a peculiar emotional reaction. If we turn to Google to define the word, note the first word of the first definition: contrived. We're real Americans, god damn it. We're genuine. In any case, I guess these are the emotions to which these phrases were intended to appeal.

Let's look at the four-word phrases:

0the war on terror 5
1setting an artificial deadline 5
2in the middle east 4
3we were not in 4
4were not in iraq 4
5an artificial deadline would 4
6send the wrong message 4
7the wrong message to 4
8wrong message to the 4
9changed our approach to 3
10the united states and 3
11of freedom in iraq 3
RankTerm Count

The war on terror is the first entry. No surprise there.

So, I ran this program all the way up to phrases of rank eleven, and I had one phrase that occured more than once among the set of all phrases:

RankTerm Count
0setting an artificial deadline would send the wrong message to the 3

There we go again. This phrase is said three times during the speech. We don't want to send the wrong message to people - we're hard-working, honest Americans! Or so, I think that's what we're supposed to feel.

I'd like to point out that I'm not taking a position with these posts as to whether or not we should be in Iraq. Instead, I'm mostly interested in how the administration - and past administrations - might influence our emotions by doing a quantitative analyses on the speech. Repetition, after all, is powerful reinforcement.

I could say more on this subject; I could also do some more analyses in the future, on different speeches and documents. Is there any interest in this? And if so, who and what? And how can I improve this little program? Any other thoughts? Thanks a million to all those who have provided me feedback so far, by the way.

Heather left for America today. :( I will, however, join her in four days. :)

President Bush made a speech to the nation on December 14, 2005. I only recently became aware of this because since I am in Japan. Here is the transcript as recorded by CNN.

Much has been said about Mr. Bush invoking the attacks of September 11, terrorism, and the like when defending the war in Iraq. I read the speech and indeed he does mention, for example, September 11 several times. It got me to thinking, are there other words and phrases that Mr. Bush consistently uses in his speeches, possibly to bolster his cause?

I wrote a computer program to identify the most frequently used words. Below is a selected excerpt of the data generated by this program. In the extended entry, I have included the full output, for any interested parties.

RankTerm Count
8iraq 60
16terrorists 30
21freedom 22
31iraqi 18
39democracy 15
45saddam 13
48war 13
55east 11
56middle 11
60security 10
63victory 10
70weapons 8
76enemy 8
77hussein 8
92september 7
93men 7
9511 7
106fight 6
111wrong 6
112political 6
116deadline 6
119terror 5
123women 5

The entire word count of the speech turned out to be 3988. The word tokenization algorithm needs to be adjusted; currently it regards contracted words - such as they're - as separate words; in this case they and re. Despite this, some interesting things are revealed.

Even though it is a very simple analysis, the data reveal some interesting things. September, for example, is indeed mentioned seven times in the speech. Freedom nears the top of the list with a whopping 22 times. By my reckoning, that word comprises more than half of one percent of the entire text of the speech - not an insignificant amount. One more revealing item we might extract is an apparent inherent sexism in the speech. Men is listed seven times, while women is listed only five. Interesting.

I'm interested in extending this program to determine not just what words are common, but what phrases crop up often in speech. I imagine that we can extract much more meaningful insight from such an analysis.

Party at A & M's

|

Del.icio.us is down right now due to "emergency maintenance." It was down last week as well for what seemed to be almost a full day, despite the claims that they would be back "in an hour." Ever since Yahoo bought that service, it seems to be a little flaky. I need to use my bookmarks at work, and its slows my productivity if I can't.

This past Saturday I had the good forture of being invited to Andrew and Momo's place for a kind of end-of-the-year party. I also had the bad fortune of having had to work that day until after 8:00... I didn't get to their place until well past nine, so I couldn't stay too long. It was a big bummer, but it was fun while I was there. Sorry guys! Like I said, if you're up for it, maybe we could grab a drink at the Hub or one of the Belgian pubs, perhaps? I'm in town until the 24th.

This past Monday, the US Supreme Court agreed to hear about a case dealing with the controversial redistricting of the state of Texas, spearheaded by former House of Representatives Majority Leader Tom Delay. Redistricting is a process of dividing a state into a set of districts each of which is represented by a single House member. Traditionally, the redistricting takes place every ten years, and naturally the incumbent party plays a big role in influencing the district lines in such a way that it is favorable to their party. What Tom Delay, Governor Rick Perry and the rest of the Texas Republicans did in Texas in 2003, however, was seen by many as a particularly egregious abuse of redistricting for political gain; moreover, detractors are upset because the redistricting occured considerably in advance - seven years, in fact - of the traditional census-aligned ten-year interval expiry. You might remember the news story about the Texas Democrat legistors that fled into Oklahoma in order to deny the legislature the quorum needed to vote on the bill. You may also remember that Tom Delay ended up using the Federal Aviation Administration to track down the Dems' plane. Ring a bell?

In any case, as you may know, Gerrymandering is the term for this kind of excessive political redistricting. There were some related high-profile cases that the Supreme Court heard quite recently, one of which concerned Texas, about racial gerrymandering. A map of one of the districts for this case is particularly illustrative:

TX18.gif

The plaintiffs in this case alleged that Texas redrew its district along primarily racial demographic data, and that that is responsible for the unusual shape of the district. In Bush v. Vera, Texas employed the use of a computer program in order to analyze this demographic data and draw the surrounding contours. In Bush v. Vera, the Supreme court ruled by a 5-to-4 margin that the redistricting was predominantly a product of the race data, and thus, they argued, it warranted strict scrutiny analysis.

If we can use sophisticated computer programs to data mine and assist in the drawing of lines to help garner political power, surely we can create a system in which all parties feel that the redistricting was an equitable transaction? I propose not a computer program, but a game, perhaps something in the tradition of an n-person cake-cutting problem. The stakeholders here would be the sitting legislators. Each legislator could keep his or her redistricting rights or alternatively cede them to his or her party, if applicable. Each shareholder then, in succession, claims perhaps any 110,000 person area of the state. Given the population of Texas and the fact that it has 32 districts, each legislator would have around six terms "at bat." With this scheme, and demographic data-transparency and access to computer programs that help interpret that data, I think we could create a more equitable system.

A plausible objection to this scheme is that order plays a part in determining who gets the most desirable districts from the outset. A possible solution to this to instead employ a parallel game, meaning that all stakeholders choose their district lines simultaneously. If competing coalitions don't have their acts together and their proposed districts overlap, then the overlapped areas (that is, only the intersecting areas) are left unclaimed and are left for a subsequent round. Perhaps a weakness in both this and the serial game is that they may fail to addresses potential marginalization of independents and third parties by big-party strong-arming. It is healthy to encourage the existence of more third parties, I think. There are other weaknesses that I haven't yet worked out yet, I'm sure. Any thoughts?

I have to mention here that a Seattle Times article makes mention of the fact that, in 1990, a federal court redrew the district lines. Is that usual, or is it as a consequence of the 1995 Bush v. Vera decision? Sadly, I am ignorant on this point. Hopefully somebody can educate me on this matter.

I am very interested in this development. I am also very skeptical that the redistricting will be ruled unconstitutional, since in the 1995 case the decision centered on race and voting rights, and I suspect that the Republican Party officials have learned from that episode. If race does turn out to be a factor, though, it could be extremely damaging to Republicans and the Administration, especially in light of the Katrina/New Orleans debacle. Oral arguments are to be heard March 1 and I will be watching very closely.

Making Firefox searches easier

|

I discovered an extremely useful Mozilla Firefox feature the other day. If you search a lot on the web - like I do - try this out.

For the sake of illustration, I suggest Google.com. Now, right-click in the text box, and a context menu will come up on the screen. Select Add a Keyword for this Search. I suggest entering Google Search in the Name field, and google in the Keyword field. Now, go up to the title bar of your browser. If you wanted to search, say, for how to make an omelet, type google how to make an omelet in the address bar and hit enter. Cool, no?

On a completely unrelated note, did you know that Amazon sells crepe makers? Mmmmmmm... crepes...

I found my clone

|

Hey! I got my picture in the Metropolis! Looks like I've put off that diet too long...

I also found my clone recently. The other day I was listening to old episodes of For Immediate Release: The Hobson and Holtz Report. Neville Hobson created a Frappr entry for FIR - I'm entry #100, by the way - and I was browsing the photos of the other listeners and there he was - my clone. Or perhaps I am his? In any case, Frappr is another cool technology built upon the Google Maps API.

Speaking of Google APIs, they've released another one for development of personalized home page modules. I don't know if this has reached the main channels yet - I picked it up on the Google blog RSS. Very cool.

Maverickism vs. Orderly Conduct

|

My coworker Okugawa didn't come into work today. He had to go to the hospital for a bloody nose, and is expected to be out of work for a week! (At least, as far as my understanding went.) That's some bloody nose. I hope he's OK.

Last Sunday, in celebration of our friend Tak's birthday, we had the pleasure of feasting and listening to Momo sing and play piano at the U.S. military hotel, The New Sanno. Man, that place is a fortress, and you can really sense it when you approach it. The food, as usual, was great, and the entertainment was - naturally - top-notch. Good job Momo!

It was a little weird being in that hotel, though. It was like being in America again, but not in a good way. Not in a bad way either, really, but definitely in an uncomfortable way. Keep in mind that I haven't been back to the States in about twenty months, so maybe I'm somewhat sensitive to these things. My discomfiture arose, I think, out of the way the hotel agents - apparently armed forces personnel themselves - interacted with the clients. It was bureaucracy incarnate. The agents were programmed automata broadcasting and executing official procedure. I don't mean this in a figurative sense, and I hasten to add that I certainly don't mean it in a derogatory sense either. On the contrary, I think it's a testament to the efficacy of the armed forces training program. Each agent, if called upon, could serve as an interface to this massive social computer that is the armed forces. It was interesting, spooky, and revulsive all at the same time.

This attitude isn't solely the province of the armed forces. These kinds of attitudes, I find, often crop up in so-called Corporate America, and the massive advertising, propaganda, and social programming networks in place in our great nation. On the other hand, there definitely is a palpable sense that Maverickism is an ideal towards which one should strive. Our government provides myriad economic incentives for entrepreneurs. Our culture's entertainment is rife with cowboys, guns a-blazing with shoot-first, ask-questions-later attitudes: Die Hard, Lethal Weapon, XXX, and any Schwarzeneggar action movie are great examples. Why the dichotomy? What's going on here?

In Detroit recently, two women were arrested for lying prone and praying at a BP station. They were released on bail for $1000, after which time they again commenced praying in front of the courthouse, at which time they were prompty arrested again. I think that these women's actions were hilariously weird, but nevertheless benign. I support their right to worship and express in any way they see fit, as long as it doesn't create a hazard to public safety. In fact, among the reasons cited for their arrest were that they posed a safety hazard. I'm no safety expert, so it is very difficult for me to comment on the legitimacy of this reason. What I will comment on, however, are the charges that were leveled against the two women: disorderly conduct.

I recognize the need for the judiciary to have a kind of catch-all designation for misdemeanours that don't fall neatly under any other classification. Naturally there is a danger of infringement upon civil liberties, but nonetheless I think that there are some legitimately harmful acts that cannot easily be categorized. In this case in particular I'm not so sure if the charges were appropriate, but that's beside the point. It's the phraseology itself that interests me the most. Disorderly conduct, in many ways, is the kind of conduct that forged America. We're sending mixed messages to our people when we encourage such behavior at one stroke and then criminalize it the next. What's going on here? Is it the mere image of Maverickism that is condoned? I think it is more than that, because a lot of the people who have found success in America have done so in part because of a strong streak of independence. If we're sending contradictory messages to people, does that mean we should pick a message? Is there value in propagating social programming with such profound cognitive dissonance? On the other hand, is it avoidable? Any thoughts?

I had another great lesson with Kojima-sensei today. I encouraged her to start a blog. Stay tuned.

Steven Spielberg's The Lost World was on last week - I believe it was NHK. I'm not generally a big fan of these kinds of movies, but there was definitely something in The Lost World that undoubtedly would cause the average Japanese to shout すごい! - perhaps, in this context, best translated as Jesus! in English.

Take the scene in which the Tyrannosaurus Rex is wandering the suburbs in search of her child. She suddenly stumbles upon the back yard of an affluent family. Undeterred by the heated protestations of the family dog - mercilessly tethered to its doghouse - the dinosaur drinks from the swimming pool. It then turns its attention to the barking dog. The film cuts to a scene inside the house, where the family members are gathering in a little boy's bedroom. The next scene, filmed from inside the house through the window, shows the doghouse suspended from the dinosaurs massive, crushing jaw. Oh no! She ate Sparky!

Had I still been living in America, I would have either laughed off or dismissed the whole scene. Monsters chewing up the family pet, after all, are a standard literary device - however cliched - in horror and science fiction films of the West. They're par for the course. The emotion Spielberg sought to imprint on viewers through this scene was one of horror, but with a big dose of amusement. To American sensibilities, it's kind of hilarious - stemming from the absurdity of it all, perhaps, and the wanton violence. (Are there other reasons, too?). In my experience, family pets and the like are generally immune from this kind of thing in Japanese cinema and television. I think that they are generally regarded as too cute to have anything really horrible happen to them. (Counter-examples are welcome) Cuteness, as many people who have lived in Japan can tell you, is a value that is highly regarded in Japanese society. In the Japanese tradition this cuteness generally exempts one from gratuitous suffering, let alone death. In any case, the episode with The Lost World really drove home the idea that the reason that many Japanese like a lot of Western cinema - however banal - has little or nothing to do with plot, character development, or theme. It is the fact that these films are revealing windows into the soul of collective America.

This view was reinforced the other day when Heather told me about one of her students. This student - one whom Heather highly respects - revealed to her his favorite Western movie: Sleepless in Seattle. In America, if anyone told me his or her favorite movie was Sleepless in Seattle, I would furrow my brow, scowl, and throw back my head in a pretentous display of revulsion. If he or she were a good friend I might torment them for a week or two. In Japan, though, it's a different story. Sleepless in Seattle is an interesting movie because it's pretty close to an idealization of American life, and I believe that that is what resonates with Japanese audiences. I've seen this from the flipside as well. Tanpopo, that feel-good movie I recently watched about a woman struggling with her ramen shop, is extremely cliched and banal. But these cliches are instructive, because they are not ones to which I am accustomed. The collective ideals and values of Japanese culture cannot help but crack through the seams in popular cinema, just as American cinema is saturated with maverick, devil-may-care themes and attitudes.

Have you seen many Japanese films? What have you found interesting about them? To my Japanese readers, what Western films do you like, and why?

This is going to be a pretty technical post. I apologize if you have no interest in this kind of thing.

Lately I've been working on a computational geometry project at work in which, given a terrain mesh and a static object mesh, I need to cull the faces in the terrain mesh for which any of the vertices are inside the projection of that static object onto the terrain. Initially I thought that this would be a good application of one of the many convex hull-generation algorithms out there; however, according to the specification, some of the static objects have shapes that are not convex, so I learned soon that this approach was not going to work. I tried to find a solution on the web but it's difficult to formulate these kinds of queries without having a good, concise way to describe them; in the end I found nothing useful. I thought about it, though, and soon I hit upon a workable solution.

Our inputs to this problem are both the vertices and the faces of the static object:

blob.gif

and the terrain:

grid.gif

.If we can find an outline of the static object, composed of a contiguous array of edges, that can contain contains all of the vertices and faces and nothing else, our problem is halfway done.

Let's take a look at our sample static object. Observe that each edge in this object is an outer, or peripheral, edge if and only if it is incident to exactly one face. This makes intuitive sense because an edge can be at most incident upon two faces, and if an edge does touch two faces then it is clearly not a peripheral edge. We now have an unordered sequence of all edges that are incident upon exactly one face; we must order them in such a way that it describes an outline of the static object.

The way in which I went about doing this is as follows: for the first edge in our set of outer edges, get the set of all edges incident to one of the two vertices of that edge. One of the edges in this set will also be in our set of all outer edges; push this edge into a list and iteratively examine subsequent vertices of pushed edges. Our outline is complete. We can then remove all edges from the grid that are within this outline.

blobAndGrid.gif

This hulling algorithm works, but its efficiency can be improved by maintaining lists of incident edges for each vertex. Furthermore, please be aware that the algorithm, as it stands, does not support meshes with holes, or meshes in which nontrivial segments of the mesh are connected by a single vertices. With some adjustment, this functionality can be supported, though. The current implementation does work fine, though, for meshes in which there are disparate, non-zero y-coordinates (elevation).

Does anyone find this useful?

I just found an incredibly useful programming resource: koderz.com, "Searching 225,816,744 lines of code." Code searches are possible based on strings, languages, and types of licenses. I ran a search for Delaunay triangulation for C++, and 28 files came up. Very cool and useful, even if only as a reference.

Somebody posted a very cool use of the Google Maps API - for a car racing game - on our corporate wiki. It's not really a game yet, per se, but it presents some interesting possibilities. There's also a link at the bottom with a page describing how the guy did it. Sorry, Japanese only - but everyone can race, I think.

Maaaaan, I feel like an ass.

My landlord called me this past Sunday morning and asked about this NTT (Nippon Telephone and Telegraph) bill that apparently went to her instead of me, and she asked me to clear it up because she naturally didn't want either of us to have to accrue interest. I was pretty mortified by this and I immediately went to the convenience store to try to pay the balance off. Just to be sure, I called NTT the next day - Monday - to verify that the account had been taken care of. The guy I talked with at NTT spoke quickly and excitedly, so it was difficult to determine exactly what he said, but he did say that there was no problem left on the account, and that everything had been taken care of Sunday. At least, I think I made that out. In any event, I did what any foreigner in Japan learns to do and just went with my gut instinct and decided to believe that everything was OK. What more could I do? Well, I could have called my landlord to apprise her of the situation, but I kept forgetting about it.

Last night, we celebrated Andrew's last day at his job (Again, congratulations!). Naturally we went to the karaoke place and we all had a few drinks. Anyway, I looked down at my cell phone and saw that someone had called. "Hmmmm," I thought, "I wonder who that would be?" I looked at the call log, and according to the caller ID my landlord had called - at 11:02! "Oh man, the payment didn't go through! And now we won't be able to get into our apartment!" I thought to myself... which was a completely ludicrous prospect, by the way. When we did get home (everything was OK), I immediately sent off an email apologizing for not picking up the phone when she called, asking what could have gone wrong, appologizing profusely, etc., etc....

Well.

This morning I saw that there was another call on my phone. I looked at the incoming call log and saw that it was Heather. However, my landlord was nowhere on that list! I flipped over to outgoing calls and sure enough, there was my landlord's number - at 11:02, in the morning, for this past Sunday. In other words, for when I called her back four minutes after she called me last Sunday.

I could wax philosophic at this point about the negative effects of modern technology on how we interact with each other, and how misinterpreting the increasingly large amount of data we receive can sometimes result in serious misunderstandings. But I don't really believe that. I can't bring myself to place the blame on technology itelf. In order words, I am a total ass.

Well, I sent her another email this morning explaining the situation. She must think I'm a big goofball.