Sunday, January 31, 2010

Movie Review: The Hurt Locker (2009)

The Hurt Locker is set soon after the 2003 U.S. invasion of Iraq and follows a 3-man Explosives Ordinance Disposal (EOD) team: Sergeant James, Sergeant Sanborn and Specialist Eldridge. Sergeant James joins the team near the end of a one-year tour of duty, following the death of Sergeant Thompson. As the senior in rank, James is the team leader. He is also the EOD Tech (i.e. the one who handles the explosive device). Sanborn is Ranger qualified and acts as a mentor to Eldridge. Eldridge is the young one, fighting his fear of dying in combat.

James has two things against him as a leader. First, he is a replacement team leader close to the end of a tour of duty. i.e. these are short timers counting the days until the end of the tour. Second, he is very aggressive, choosing to tackle difficult problems directly instead of conservatively. And this is the defining conflict of the movie.

A lot of things about the setting are very well done. The overall competence of American forces, especially American NCOs, was on full display. The difficulties in working in insurgent environments where it was hard to tell who was on which side. The desire to help the Iraqi's against the desire to take the safe way out. The tension of going into an environment where nothing is secure and everything is fluid and can easily turn deadly without warning. They even showed the tension within the Army between those who viewed their role as security and combat versus those who viewed victory as something that would only be gained by connecting with the population (in the early days, the political leadership was decidedly on the security/combat only view.)

But in the interest of setting up the story, there are many things that are unreasonable. An EOD team was a highly valuable asset, and would not have been risked travelling without an escort. They would not have been employed as light infantry (something alluded to at one point). A Colonel, (especially one that is not combat arms) would not have been allowed to be outside secure areas without escort (but at least they had the sense to tease him in film about his acknowledged incompetence in potential combat roles). And an EOD tech whose job it was to concentrate intently on a single narrow thing (the explosive device) would not be a team leader with the responsibility for an entire team. The parts taken from disarmed explosives would have been taken for investigation and study, not allowed to be hiding underneath some soldier's bed.

But all is forgiven with how well the conflict between James and Sanborn is done. Every scene becomes a way to address this tension in another way. James aggressiveness versus Sanborn's conservationism (of the "I am a soldier who intends to use my experience to complete my mission and live" variety, not the political variety). James single focus on the technical task and challenge of disarming explosives versus Sanborn's view of situations as a whole. And with all that, the fact that James is in fact the team leader, even if Sanborn is tactically more competent (note that Sanborn is Ranger qualified, something that is made explicit when he fills the role of sniper in one scene.)

One thing that the director and writer find hard to get is motivation. The feel of the environment seems pretty good, showing the confusion and lack of clarity in what can be seen. The characters seem reasonable (the writer spent time with a team, and claims the characters are composites. Even if he put character qualities that should not be in a single person together). But we don't quite get the motivations of the characters. Leaders do not get the luxury of focusing on one technical detail while they ignore their men (the Specialist track is for this group). People who are highly trained in very technical skills e.g. EOD techs) do not tend to turn into cowboys. And a Specialist (which usually implies a few years of experience) near the end of a year long combat tour does not get congratulated for not becoming frozen in a combat situation.

Even so, with what they did get right, it is probably one of the better movies on the current wars (see my other reviews). And the depiction of conflict between James and Sanborn makes it a good film.

Wednesday, January 27, 2010

Installing rSymPy on Ubuntu. JDK problem (and soln)

I've started using rSymPy, because I find myself having to being able to take derivatives and integrals again. And maybe a Computer Algebra System is something worth learning. I'm learning both Sage as well as Sympy.

Sympy has the advantage of running in pure Python. And with the recent version of Jython 2.5, it means Sympy can run on the Java Virtual Machine. And someone figured out that meant that you could call Sympy from R, using the rJava interface, using the rSymPy package

The problem is configuring R to use rJava. This can be tricky, because R has to be configured to use the Java Development Kit. Under Ubuntu, I have two machines that I had to put this on. It turns out this was easy for one machine, but difficult for the other.

The instructions are to configure R by running the following as root (or sudo)

R CMD javareconf

But then when installing rJava, I got the following error:

configure: error: One or more Java configuration variables are not set.
Make sure R is configured with full Java support (including JDK).

The problem was the JDK. When running javareconf I see:

Java home path : /usr/lib/jvm/java-6-openjdk/jre

Hmm, I thought I was using the Sun Java JDK. So I uninstall openjdk and reinstall the Sun provided JDK. After this, I run javareconf and get what I expect:

Java home path : /usr/lib/jvm/java-6-sun-

Now, when I use install.packages() to install rSymPy, it works.

Friday, January 01, 2010

Three Primes: Latodami Nature Center, North Park, PA 1/1/2010

[Photos at bottom]

I recently made the jump to a digital SLR after many happy years of using 35mm film SLRs and rangefinders. What really did it: when the local Ritz camera started paring down its film offerings, in particular I no longer have a ready supply of the Kodak 400CN (chromo-negative, meaning it comes out as black and white). Ok, my auto-focus SLR was also getting long in the tooth with the pop-up flash not working, and I've long since given up on using the meters built into my manual SLR and rangefinder (so I'm one of the few photographers my age who use an analog lightmeter.)

I got a Pentax K-x. Main features: it is compact (one of the smallest SLRs with the APS sized sensor) and my Pentax lens collection still works. Like most consumer digital SLRs, it comes with a 18-55mm zoom lens. But like most kit lenses, you get what you pay for. Ok for tourist shots in nice, well lit places where you want simple snapshots, but to get low-light or depth of field effects, you need something else. Options are to spend $1000+ on good zoom lenses, or use primes. (non-zoom lenses). Primes are smaller. They are cheaper. And I already own a few good ones.

It has been a while since I've gone for a decent shoot, so today I decide to take it through its paces. Like any proper project, I need a goal. Today's goal: Three primes. The task, go on a shoot with three prime lenses. In 35mm, you choose the primes so that they are separated by a set ratio, either 1:2 or 1:1.5. So I used to use 24mm:50mm:100mm or 35mm:50mm:75mm. I'm not sure how this works in digital, but I suffer because of the 1:1.5 magnification factor caused by using the APS sensor found in most digital SLRs as opposed to 35mm film. So I go out with the following lenses:
SMC Pentax 2.8 24mm (36mm equivalent)
SMC Pentax-A 2.8 28mm (42mm equivalent)
SMC Pentax-F 1.7 50mm (75mm equivalent)

Some other complications. The 50mm is the only one of these lenses with Auto-Focus. The 24mm does not even have autoexposure. So three lenses, each of them require different operating practices. The 50mm is the easy one. Everything works. The 28mm is not terribly hard either. All exposure and TTL functions work with the -A series lenses as long as the Aperature ring is set to the 'A' position. So I have a functioning non-AF 'Normal' lens. But not with 24mm lens. No 'A' position, so the camera cannot talk to the lens. In my film AF camera, this could not be used, because the built in exposure meter would not work. In the Pentax K-x, it is possible to program one of the buttons (the 'green' button) so that even though the exposure meter did not display, the camera can set the shutter speed for what it thought was correct exposure given the aperture set on the ring when the camera is in manual exposure mode. Then it is your job to set any compensation. The other issue is when putting one of the non-AF lenses on the camera. Because the camera cannot communicate with the lens, you have to tell the camera what the focal length is via the control wheel and a button.

There are a few tasks to undertake today. First is to get used to operating the camera. In particular, a camera that has buttons while wearing gloves because of the snow. The second task is to get used to the effects of magnification on focal length. For digital SLRs, the conversion of focal length for the APS sized sensor is ~ 1:1.5 (only a few upper end DSLRs have full-frame 35mm sensors). Part of being a good photographer is to know the effects of focal length, and compare it to the effects of changing your own position in composition (how it compresses the scene, depth of field, relative sizes and locations of objects in frame, etc.) And the only way to get this is practice. Which digital cameras are supposed to be good for.

Some notes:
- The 24mm is manageable, which is better then I feared. Again what makes it work is the ability of the camera to quickly set a baseline metered position, then you use your old manual exposure skills to make tradeoffs between stops of over or under exposure, as well as the tradeoff between shutter speed and aperture for DoF effects.
- The 28mm pretty much works just like any other lens. I prefer to use manual focusing anyway since I'm as fast as the camera for anything reasonably close.
- The K-x has rubber grip for the right hand which makes the whole hold on when wearing gloves thing not too bad.
- There are only a few buttons on the back. The hardest one is the four-way button set with center button that a lot of cameras have. And the Pentax has the usual 1/2 chiclet sized buttons here. But at least it does not get any smaller, because I think this is as small as I can get while wearing winter gloves, and it is a hassle.

All in all, not a bad shoot. I need more practice working with exposure, and learning how to compensate with the snow (the fact that it was overcast probably saved me today). And I see drooling over camera catalogs in my future)

Marker 1

Trail posts

Snow on bark with 50mm

Snow on bark with 28mm

Bench on trail

Post and nail

Birdhouse on trail

Class of stumps