Recent movies – May 2012

This would be movies I’ve watched recently, as opposed to movies that have come out recently, though most are relatively recent (past few years).

Contagion (2011) – Let’s have a pandemic! Wait, didn’t we already do that years ago in Outbreak? Anyway, here we have a great cast, good performances, reasonably good tracking and escalation of the story, but then it doesn’t really seem to go anywhere besides “let’s follow a few people while civilization crumbles due to pandemic”. Meh, just depressing. 5/10

Real Steel (2011) – Giant robots fighting! Yeah! I was expecting this to be more of an adult movie, given the PG-13 rating, but it becomes obvious it’s a kid movie quite soon after the kid lead is introduced. Fun, well filmed, the giant robot effects are excellent, and the setup is quite good. Unfortunately as it progresses the story falls farther and farther into “kid action movie” ruts, predictable and unrealistic, which is really unfortunate. By the end I just wanted it to end. 6/10 (includes +1 for giant robots!)

The Twilight Saga, Breaking Dawn – Part 1 (2011) – Damned sparkly vampires. I consider watching this series part of both an ongoing attempt to keep current with pop culture, and as prep work for when my daughter is old enough to enter the cult. Yes, I’ve watched all the previous movies; no, I have not read the books. Anyway, enough caveats… This movie is not great. I found some parts interesting and worth watching, and there were at times actual emotions being shown in this episode where previously the emotional range was mostly stuck in moping angst. At the end of the day, though, the story just doesn’t progress very far — it seems like 1/2hr of movie stretched over almost 2hrs. Maybe this is overdone fan service, maybe the book was badly split between the movies, or maybe just bad film making, but overall I found it slow and dull. 4/10

Underworld Awakening (2012) – Ass-kicking vampires and werewolves. Almost the polar opposite of Twilight, the Underworld series is lots of cool action sequences with few story sequences to carry the story. In this particular case there is a fair bit of story to cover – time has passed, the world has changed. Explaining this is not done too badly, and for the most part the story holds together, though it’s obviously more of a “4th in the series of N” plot as opposed to standing on it’s own. I should note that while it’s still just as fun to watch Kate Beckinsale kick ass in skin-tight latex and leather outfits, there is a bit more suspension of disbelief required that her character never ages — the original movie was 9 years ago, after all. All in all, fun but no depth. 6/10

Killshot (2008) – Mickey Rourke is a cold-blooded hitman. I liked this more than I expected at the beginning. Rourke’s Native American assassin is quite good – believably brutal and cold, following his code, getting the job done. The rest of the cast is adequate, though all are at times annoying (some because of story, some because of acting). The story meanders a bit, and there are some slow bits and a lot is predictable, but eventually it gets where it’s going. Not great, but not bad. 6/10

A Girl Cut In Two (2007) – Very French. I think I enjoyed the locations, look, and general atmosphere of this movie more than the rest. The characters seemed stereotypical and plastic caricatures, the story simplistic and uninspired, and overall I never really cared where things were going. I was surprised, for a French movie with sex as such a main thread, that almost all the sex was implied and not shown even in obscured ways — I wonder if this was a version cleaned up for North American release. In any case, the overall response I feel is “very French”, especially the ending. Perhaps I would appreciate this more if I grew up in France, but sadly at least in this case, I did not. 4/10

Stop-Loss (2008) – When young US soldiers come home from the Middle East. I was entirely prepared to not like this, the premise runs the risk of overplaying either the pro- or anti-war stances, not digging to far into character or going way overboard, or just not being interesting to me. What I found, however, was an engrossing story, with compelling characters and surprising depth, and involving performances. I was especially pleased with many choices made in the writing — there were several places it seemed inevitable the story would go based on standard Hollywood storytelling tropes, and it did not. Well done. 8/10

X-Men: First Class – In the beginning, there was Xavier. Watched this for the second time, as my wife and daughter had not seen it. Still enjoyed it, but it’s still not great. Character development for anyone not involved in the later story (previous movies) is limited, and generally speaking there’s a lack of depth and attention to detail in the story. It also really bugs me all the changes they’ve made to the X-Men franchise from the comics, as contrasted with some of the other comic franchises which have recently been made into movies. But still, fun to see all the familiar mutants, and as a whole it’s more enjoyable than annoying. 7/10

Apache unexpectedly adding Vary: Host header to requests

So, I’ve been banging my head against an issue where Apache was unexpectedly adding the Vary: Host HTTP header to responses for certain requests. Unfortunately, this results in the responses not being cacheable by default by some proxies, most importantly in our case by Akamai.

After many Google searches resulted in nothing useful, I decided to just search through the Apache source code, and found this in modules/mappers/mod_rewrite.c:


/* If some HTTP header was involved in the condition, remember it
* for later use
*/
if (ctx->vary_this) {
ctx->vary = ctx->vary
? apr_pstrcat(r->pool, ctx->vary, ", ", ctx->vary_this,
NULL)
: ctx->vary_this;
ctx->vary_this = NULL;
}
}

So I went back through the Apache config, and did indeed find a RewriteCond rule that matched against the HTTP Host: header and altered the request accordingly.

The fix for this is simple, once the root cause was revealed — add the NV (or novary) flag to the RewriteCond line, which (as documented here) results in:

If a HTTP header is used in the condition, this flag prevents this header from being added to the Vary header of the response.
Using this flag might break proper caching of the response if the representation of this response varies on the value of this header. So this flag should be only used if the meaning of the Vary header is well understood.

And now things are working as I expected. Hopefully this post will eventually percolate into Google and help someone else banging their heads against a wall about this in future!

More stuff here, and Introverts

I’ve pretty much given up on Facebook at this point, and use Twitter as a read-only resource, so I’m going to try and post more here.

As this is a public blog, as opposed to a social media site which is ostensibly limited to my ‘friends’ I will by necessity not be quite as candid, but I’m not really all that guarded in public anyway.

So, for today’s post, I wanted to share a really good TED talk by Susan Cain titled “The power of introverts”. As I strongly self-identify as an introvert I thought the talk was quite interesting and well worth the time.

So, let’s try embedding this…

Movie – Body of Lies

I recently watched Body of Lies. At a high level, it’s a movie about an increasingly jaded CIA agent in the Middle East (Leonardo DiCaprio) and his jerk of a handler back in the US (Russell Crowe).

The prodction quality overall was great — there was some excellent use of real Middle Eastern locations and people. The acting was good, especially DiCaprio. And the plot overall was fairly interesting, as contorted spy stories go.

So all in all sounds good — but I didn’t like the movie. And not in the “this is a hard movie to watch, but worth watching anyway” way, but in the “meh, whatever” way. Why? Because the story never made me care what happened to the lead characters. Sure, it was vaguely interesting to see what would happen next, but I didn’t have any investment in the protagonist making it through.

So, yeah, meh. I give it a 6/10. It’s worth watching if you’re interested in spy stuff and how they operate in the Middle East, otherwise you’re not really missing much.

Find lost Android device

This looks pretty cool. You lose your Android device, go to the Android Market and remotely install this tool (for free!), and it sends the primary Gmail account associated with the phone a report of the device’s location (assuming it has battery, wifi or data access, etc).

http://blog.mylookout.com/2011/02/planb/

This is probably old news, but I’m still finding old Android stuff that’s new to me!

Movies – Battle for Terra

I’ve decided to try and post more movie reviews, since it appears the only one I’ve actually posted here was in Jan 2009. And I do watch a few movies, and heaven knows I have opinions. :)

So, first up is Battle for Terra (IMDB), which is from back in 2007 but I finally got around to watching it this past week. I’m giving it a 8/10. Also, the website appears surprisingly good, I didn’t check it out before watching the movie.

The story here is that we’re on a distant alien world, populated by various flying/floating alien life forms including a race of sentient aliens with an advanced society and culture, but fairly simple technology, who live in harmony with nature. We’re primarily following one female (I suppose?) alien youth who’s a bit of a rebel. Trouble arrives in the form of a dying ship full of the last humans fleeing the destruction of all human civilization due to interplanetary civil war.

The majority of the humans are military types, and they are in favour of taking the planet by force and terraforming it, which will change the atmosphere and kill all the indigenous life. One soldier’s fighter/scout ship is damaged during an initial sample collection run through the alien city, and he’s saved by the alien protagonist, who creates a bubble of oxygenated air for the soldier with the assistance of the soldier’s robot companion.

I don’t want to go through entire plot or give away the ending, but overall I found it surprisingly well crafted. Optimistic and with a strong ethical backbone, but at the same time reasonably realistic, and willing to forego many of the common plot elements from the standard crop of animated and/or alien and/or sci-fi militaristic movies in the past decade. I liked that the writers were willing to take a slightly different path, and I think the movie was better for it. I could’ve done with a bit more alien-ness in the aliens (they are apparently male/female, and have extremely similar thought processes to the humans), but I expect that was done so it was easier for a wider audience to relate, and to ease some more complicated plot corners.

This is an entirely computer animated movie, and not realistically stylized or using motion capture that I could tell, so there’s only voice acting. No complaints there, and none of the voices were obviously recognizable enough to be distracting.

The styling and detail of the animation is not hugely detailed, going for a rounded and simplified look instead of full-on realism, but is smooth and very consistent, and quite visually appealing. It enhances the feeling that you’re on an alien world and seeing it from an alien perspective, though giving the humans more detailed and sharper look than the alien life might’ve helped with this.

So, all in all, quite a good movie, and worth the time to watch it. Which is not something I find myself saying about many movies these days.

JMX java.lang naming between Windows and Linux (and a bit of OpenNMS)

I’ve been banging my head against something here at work, so thought I’d post the solution up on the Interwebs to hopefully prevent cranial trauma for others.

First, if you don’t know what JMX is, you can read about it on the lovely Wikipedias here: JMX. Basically, it’s a technology that lets you monitor the internals of a running Java process, which is very useful for troubleshooting.

I setup JMX monitoring on the Java app and in OpenNMS, which was pretty straight forward, then sat back and waited to see what data was collected. And that’s when the headaches started, because different data was collected from the Java processes running on Linux than on Windows. Specifically, OpenNMS was not collecting any data from the Linux boxes about different types of memory usage in the Java process, which is one of the key things I wanted to get.

After a bunch of poking around, I found the lovely command line jmxsh utility, which allowed me to do some quick lists of JMX mbeans exposed on each machine. And it showed me this…

Linux – Sun java 1.6.0_24 running as Tomcat 7 using normal startup script

1. java.lang:type=Memory
2. java.lang:type=MemoryPool,name=PS Eden Space
3. java.lang:type=MemoryPool,name=PS Survivor Space
4. java.lang:type=MemoryPool,name=Code Cache
5. java.lang:type=GarbageCollector,name=PS MarkSweep
6. java.lang:type=Runtime
7. java.lang:type=ClassLoading
8. java.lang:type=Threading
9. java.lang:type=Compilation
10. java.lang:type=MemoryPool,name=PS Perm Gen
11. java.lang:type=GarbageCollector,name=PS Scavenge
12. java.lang:type=OperatingSystem
13. java.lang:type=MemoryPool,name=PS Old Gen
14. java.lang:type=MemoryManager,name=CodeCacheManager

Windows – Sun java 1.6.0_25 running as Tomcat 7 service using jvm.dll

1. java.lang:type=Memory
2. java.lang:type=GarbageCollector,name=Copy
3. java.lang:type=MemoryPool,name=Code Cache
4. java.lang:type=Runtime
5. java.lang:type=ClassLoading
6. java.lang:type=MemoryPool,name=Perm Gen [shared-rw]
7. java.lang:type=Threading
8. java.lang:type=MemoryPool,name=Perm Gen [shared-ro]
9. java.lang:type=Compilation
10. java.lang:type=MemoryPool,name=Eden Space
11. java.lang:type=MemoryPool,name=Survivor Space
12. java.lang:type=GarbageCollector,name=MarkSweepCompact
13. java.lang:type=OperatingSystem
14. java.lang:type=MemoryPool,name=Tenured Gen
15. java.lang:type=MemoryPool,name=Perm Gen
16. java.lang:type=MemoryManager,name=CodeCacheManager

As you may notice, there’s a PS prepended to a bunch of those names on Linux but not on Windows, and the OpenNMS JMX config (jmx-datacollection-config.xml) didn’t have the PS entries for MemoryPool items. To fix the problem I edited the config and duplicated the affected entries, and updating only the name and objectname to add the PS but not changing the rest of the definitions. In this way (I hope) it will still see separate entries in the JMX config, but collect them into the same back-end databases for display.

A quick grep for Memory in my jmx-datacollection-config.xml now shows:

[...]
<mbean name="JVM MemoryPool:Eden Space" objectname="java.lang:type=MemoryPool,name=Eden Space">
<mbean name="JVM MemoryPool:PS Eden Space" objectname="java.lang:type=MemoryPool,name=PS Eden Space">
<mbean name="JVM MemoryPool:Survivor Space" objectname="java.lang:type=MemoryPool,name=Survivor Space">
<mbean name="JVM MemoryPool:PS Survivor Space" objectname="java.lang:type=MemoryPool,name=PS Survivor Space">
<mbean name="JVM MemoryPool:Perm Gen" objectname="java.lang:type=MemoryPool,name=Perm Gen">
<mbean name="JVM MemoryPool:PS Perm Gen" objectname="java.lang:type=MemoryPool,name=PS Perm Gen">
<mbean name="JVM MemoryPool:Old Gen" objectname="java.lang:type=MemoryPool,name=Old Gen">
<mbean name="JVM MemoryPool:PS Old Gen" objectname="java.lang:type=MemoryPool,name=PS Old Gen">

This seems to be collecting the expected memory stats regardless of platform. Yay!

Music in the Cloud

Now that Apple has announced their iCloud service, I thought I’d jot down some thoughts on music storage in the cloud — that is, on some company’s central server instead of on your PC, MP3 player, and other devices you own.

tl;dr – It’s a great shortcut for the music industry’s new business model of suing consumers en masse.

If you’re not familiar with this topic, see these. (most not available in Canada yet, but for reference…)
Amazon Cloud Player (damn, Amazon has crappy URLs)
Google Music Beta
Apple iTunes Cloud

First, let’s look at some underlying technology. Stay with me, it gets interesting in a bit. ;)

One central principle of any system where many people are storing the same thing is deduplication — that is, when you upload a file and someone else uploads the same file, only one copy of the file itself is actually stored, and the tracking system has two records pointing to the same file. Any other means of setting up a system like this would require ridiculous amounts of storage space, and whatever else Amazon, Google, and Apple are, they are not stupid.

One way to do this is through the storage layer itself, using something like Opendedup or various similar commercial solutions. But if you have everyone uploading all their files through a common interface, as all these cloud systems do, it’d be simple enough to just do a quick checksum on the file (preferably before upload to save time/bandwidth) and match it to the checksum of any existing files in the system. If the file exists already, just add another pointer to that file. If it doesn’t exist, upload the new one. This is certainly what Amazon and Google are doing. In the case of a file matched with iTunes Match, you don’t even upload a file, they just point to Apple’s official AAC version of the same track.

This means that any cloud-based system that’s charging you based on the “size” of similar files that many people upload is a scam. After the first person uploads a file there is no reason for additional storage to be used when a second, third, or one millionth person uploads the same file, aside from the space used for the file tracking system.

It also means that any cloud system can quickly and simply generate a list of every user who has uploaded the same file. More on that later.

Thinking on iTunes Match, I’m not entirely sure how that system would match tracks with random MP3 files (let’s assume you ripped them from a CD using something besides iTunes, and didn’t ‘acquire’ them using other means). I would think ripped MP3 files would not be generated exactly the same on every different PC and not easily identifiable as a specific audio track by checksum, and Apple certainly can’t trust the easily manipulated metadata within the MP3 file for identification. It seems likely that iTunes Match may only match music ripped using iTunes itself, which associates additional metadata from the physical CD with the music files, or that the service can identify by checksum as an authorized download. Going back to Apple’s information, at no point does the iTunes Match announcement discuss matching “random MP3 files you acquired from somewhere”, just “songs you’ve already ripped yourself” or “bought from another online store”.

It’s possible that the technology Apple acquired from Lulu might have some kind of magical audio scanning system that looks at the actual contents of an MP3 file and compares it to audio tracks in a central database, but that seems like a lot of work. Far easier for Apple to just restrict sources of files to ones they can easily identify.

Now, let’s move on to tracking and privacy.

If you have a bunch of MP3 files on your PC and audio playing device of choice there are very limited ways that anyone can authoritatively find out what they are, for example if they wanted to initiate legal actions alleging you stole music (whether or not you really did). If you’re using iTunes to manage the files on your device then Apple likely has some data collection options, but there are still privacy issues with them scanning your library and collecting specific details about the contents (though I have to admit I haven’t read the terms & conditions on iTunes lately, so maybe they’re working around that). If you are actively sharing files that’s different, there are means of collecting data across the network about what you are doing, but if you just have a bunch of files sitting on your machine and are not sharing them you’re not likely to be hit up with a lawsuit.

However, if you are uploading files to a centralized storage service (for music or any other files), you have effectively handed over any and all expectations of privacy about your files to whoever is running that service. This is especially the case when the storage service is specifically intended for content that is illegal when duplicated without authorization and licensing — like, say, music.

In and of itself this doesn’t seem particularly bad — I’m sure you wouldn’t be actively torrenting music and then uploading to iTunes Cloud. That would just be dumb. But it’s entirely possible that a friend could give you a MP3 of a music track that he likes, and you have no idea where it comes from or who else has a copy, and you upload it with all the rest of your ripped files. Maybe you rip a track to MP3 from your own CD, give a copy to a friend, and unknown to you their kid gets a copy and puts it out on a torrent.

Then you upload the file to the cloud, and suddenly you’re added to a list of everyone else using the system who has uploaded that file, tracked by it’s unique checksum fingerprint. It would be foolish to think that Apple and the others haven’t made agreements with the music labels to review those lists, perhaps even as they’re trending, and hand them over for legal action if the file is found to be an unauthorized copy (ie, not one that the music labels provided to an authorized reseller). I’m sure there will be details in the terms and conditions of use allowing them to do this, there are usually clauses about illegal activities rendering all privacy protections void.

I wouldn’t be surprised that the music labels would even release versions of new tracks via the illegal torrent scene that are specifically intended to generate these lists, allowing them to take action much more quickly, because they will already have proof of the origin of the file. This is already possible, but there’s a lot of legwork involved now that makes it prohibitive — tracking a downloader, forcing their ISP to divulge their contact info, collecting all the downloaded files after getting a court order to seize their PC(s), then doing detailed computer forensics work to compare the files to the original, all while preserving the chain of evidence. The cloud service removes this requirement — the list of users who have uploaded an unauthorized file is readily available.

So… yeah. Cloud based music services providing quick and accurate evidence for music industry lawsuits.

But remember, it’s all about convenience for users!

Useful Android apps

I got a Nexus S phone a week and a bit ago, and am quite enjoying Android. Here are some apps I’ve been using — let me know if you have others to suggest! Though I’m not likely to pay for any apps… :)

I think you can get any of these from the Android Marketplace, some come with Android.

  • Google Reader – I actually don’t like this one much, if anyone has a good RSS reader app let me know, otherwise I’ll just keep reading my feeds on a computer
  • Android Music (the one built in) – actually works quite well for any MP3 files I’ve copied over
  • Google Listen – once you get used to it, not bad for audio podcasts; would like something that also handled video podcasts
  • MoboPlay – good video player; if/when VLC ever comes to Android I’ll certainly switch to that (unless it’s a pay app)
  • WordPress – pretty good, though I’m not using it to write this…
  • Facebook – yeah, I use it
  • Amazon Kindle – have a few free books on it, am planning to try some from the library as well – the phone is a bit small for reading, but I’ll give it a try
  • Password Safe – same password management app I use on Windows (and Password Gorilla on the Mac)
  • AndFTP and AndSCP – seem to be good file transfer apps, though so far USB has been easier
  • Wifi Analyzer – excellent multiple views of wireless networks
  • Google Translate – Bri has been having lots of fun with this one, especially with the voice input
  • Google Sky – looks very cool, look forward to it being warm enough outside to play with it
  • Google Goggles – also very cool, snap a picture and it uses the power of the Internet to recognize what it is
  • Angry Birds – all versions ad supported and free, yay!

Aside from this, I’ve been looking for a nice and clean way to manage media between a desktop and Android device. In particular, I’m looking for something that will manage copying media files to the device, downloading both audio and video podcasts, and not require iTunes.

I did look at DoubleTwist, and it looks nice and seems to work as advertised, but requires iTunes. I also looked at Songbird, but wasn’t happy when it asked to check my Google Reader account for media and then just sat spinning for a long, long time. I might try it again though, and just skip the Google Reader part.

Any other suggestions?

New laptop

I bought a new laptop yesterday. My old one (bought off-lease about 3 years ago) had a busted screen due to dropping my old work laptop on it last week — no damage to the work laptop, but the corner of it scratched along my screen, d’oh. Getting too old for juggling laptops I guess. The old one also had issues with the hard drive, it would get very unhappy and lock the machine for minutes at a time when hot, and the battery was only good for about 10 minutes (just long enough to move to another power outlet). So it was time for a new one.

I was planning to hit Canada Computers in Ajax, but had to go to Best Buy anyway to get a new cel phone (my almost-3yr-old phone also had display issues, but just from wear), so while I was there I decided to check out the laptop section. BestBuy’s laptop selection is pretty vast, there must’ve been 40 different models on display. I think more laptops than phones.

My basic criteria for the laptop was as follows:
- max budget of $600+tax
- prefer non-Intel graphics processor
- Need at least 2Gb RAM and 200Gb drive
- Looks good, but not stupidly styled
- Whatever else I can get for that price

My basic usage is for standard Internet use/browsing, occasionally watching downloaded 720p videos, and low-end gaming (LOTRO and DDO at low/medium graphics settings). So not particularly strenuous requirements for a full-fledged laptop.

The one I chose is a HP G62-318CA (link to HP’s specs), which seemed a reasonable value. Best Buy has it for $499. If you don’t want to click through to the specs, it has a triple-core AMD Phenom II processor (not very fast, but OK), 3Gb RAM and 320Gb drive, ATI Radeon HD4250 graphics (not very fast, but OK), 15.6″ WXGA screen, Blu-ray RO/DVD RW drive, and the usual assortment of ports.

The BestBuy guy seemed surprised at the triple-core and Blu-ray drive for that price, and I was inclined to agree.

After using the machine for a bit my impressions are as follows:
- There’s no separation between the touch pad and the rest of the casing, just a raised bit. There are buttons for the trackpad. This is a bit strange at first, but I like the design because you can’t get dust & other bits stuck in the corners of the trackpad.
- Speed is quite acceptable for a low-end laptop, definitely better than a netbook
- The display is quite nice, quite bright
- I like the styling in general
- Plays LOTRO on mostly medium settings at 1280×720 at 25-30fps, with a few of the more demanding performance options turned off
- Not wild about the Realtek network adapter
- Reverse of most laptops, keys along are primarily for audio/brightness/wifi control and require pressing a FN key to get F1/F2/F3/…, which is a bit odd at first but I’m coming around to it — might try to investigate if it can be inverted to be more like a normal keyboard though
- Quick launch keys down the left side of the keyboard for DVD player, calculator, email, etc are quite annoying, especially if you accidentally hit them in the middle of a game — actively looking for a way to disable or remap them