Sunday, January 26, 2014

Secret Identities

Grounded in reality. That’s the hot trend being used almost exclusively in DC Comics superhero movies and television shows involving characters such as Batman, Superman, and Green Arrow.

Grounded in misunderstanding is what I’d called it.

Case in point: secret identities.

Here’s a typical line of reasoning from What ‘Man Of Steel’ Gets Right About Lois Lane:
It’s long been the running gag of the Superman universe – that the world’s populace and his closest friends are unable to comprehend that Superman and Clark Kent are one in the same, only one of them happens to be wearing glasses. While it is somewhat conceivable that Supes’ fans and Clark’s acquaintances are too knuckle-headed to see the truth (particularly in the early days of his existence, as we suspect that modern day Superman will have some major problems when it comes to social media, smart phones, and citizen reportership), it’s always been dunderheaded that Superman’s perennial love interest, Lois Lane, is consistently in the dark as to who is who. The main issue with the lovely Lois not seeing the obvious is that she is not only a highly intelligent woman, she is a woman who investigates things for a living. Rooting out truths and seeing beyond the status quo is not only what Lois does, but it’s who she is. Open your eyes, Lois!
This logic leads to an inevitable conclusion:
This is all a longwinded way of saying that we’re used to Lois Lane not knowing who Superman really is, and it’s a tremendous relief that this particular element of the story (no matter how traditional and accepted it may be) is excised almost immediately in Zack Snyder’s Man of Steel.
The problem with this line of reasoning is that it never goes far enough.

Nothing about the the superhero genre stands up to logical scrutiny. Not the superpowers that defy the laws of science; not the costumes; and certainly not the secret identities. The Incredibles had it dead right: if superheroes actually existed, they’d be sued into seclusion.

It’s not “somewhat conceivable that Supes’ fans and Clark’s acquaintances are too knuckle-headed to see the truth.” Once Superman reveals himself, it doesn’t require an investigative reporter to uncover his secret; a child could do it.

Our brains are too good at recognizing faces and voices to be fooled by superficial disguises. If you can recognize the actor doing a voice-over in a commercial, you can recognize Peter Parker’s voice through Spider-Man’s mask. A pair of glasses, a slouch, and a mild-mannered persona are simply not an effective disguise (unless you’re Count Olaf from A Series of Unfortunate Events).

Take the test yourself. See if you can match each of the Clark Kents on the left with the Superman on the right.



The correct answers are A8, B7, C5, D2, E3, F4, G1, and H6. If you missed any, make an appointment with your eye doctor or neurologist immediately.

If you’re being intellectually honest, you’d have to admit that there’s no way Superman could keep his secret identity hidden once he revealed himself to the world. Realistically, it’s inevitable that everyone should come to know that the boy raised as Clark Kent is the hero known as Superman.

And it would be a huge mistake to buy into that “realism.”

Clark is what binds Superman to humanity. Clark is what makes him one of us, not some alien with god-like powers.

It gives him something to lose. He wants to belong. How can he walk among as, as one of us, when we’re aware of his powers. People tend to be a little reserved when they know you can incinerate them with a look.

In short, secret identities are plot devices used to introduce conflict into the story and allow the audience to more easily identify with superheroes through their “normal” alter egos. They’re not intended to be plausibly realistic.

So the next time you watch a movie or TV show and the superhero distorts their voice to protect their identity, ask yourself: does this really make the story more plausible or does it just highlight the implausibility of the entire concept. Wouldn’t it be easier just to accept the conventions of the genre rather than expect a “fix” for them?

If you can believe a man can fly, go one step further and believe in secret identities. Otherwise you’re just saying “I can totally believe in Gandalf and all his magical powers, unless of course he’s wearing a mask and no one can recognize him, in which case it totally ruins the story for me.”

And if you absolutely insist on an explanation for how a superhero keeps their identity secret, go with super-hypnosis. It’s certainly more plausible than anything Christopher Nolan, Zack Snyder, or The CW has given us.

Monday, January 20, 2014

Lock and Load

If you’re thinking of using a national guard armory as a one stop shopping location for all your zombie eradication needs during the coming apocalypse, you might want to revise your plans. Apparently they’re not all stocked to the brim with guns, ammunition, grenades, explosives, vehicles, survival gear, and other sundry items.

We checked out this armory on a trip to Tyler, TX and were dismayed to learn that the only weapon present was the howitzer sitting out front. Even worse, the only way we could use it to kill zombies was to push it off a roof and have it squish them.



Forewarned is forearmed. We'll be doing all our looting at Academy and Walmart.

Friday, January 17, 2014

Three Things

I wrote my first program using punch cards when I was in high school.

In college, I wrote most of my programs on dumb terminals connected to mainframes and minicomputers. By the time I graduated I owned my first computer, a Commodore 64. 

I first sent an email and surfed the web while I was working at NASA, my first job out of college.

At home, I had a separate phone line so that I could dial in for an internet connection and receive phone calls at the same time. When I got a high speed internet connection, my computers were set up in the study because that's where the line entered the house.

How far we have come to things that now seem mundane.

As a programmer, there were three advancements that significantly changed the way I worked.

The first was the personal computer, and not just the ones that I bought for my own use. When I started working at NASA, no one had a computer sitting on their desk. You went down to the lab and used one of the computers or terminals there. Even the actual personal computers we had were used communally.

Having your own personal computer meant that you could work whenever you wanted, not when a computer became free or the lab was open. And when portable computers became affordable you could work not only whenever you wanted but also wherever you wanted. 

The second advancement was software: Graphical User Interfaces (GUIs), Integrated Development Environments (IDEs), and Software Development Kits (SDKs). These changes were mostly incremental, but the sum of them has been significant. 

I shudder to think how difficult it would be to write an iPhone app having only one application open at a time, using a command line debugger, and having to replicate all of the functionality provided by the SDK. 

For sure, there's still a lot of software developed using makefiles and command prompts, but modern programming tools and software have made possible entirely new classes of applications. Thirty years ago touch based applications that ran on computers you held in your hand was something you saw on Star Trek, not everywhere you went. 

The third advancement is access to information. This is the one that's most amazing to me and would be the hardest to give up. 

When I first started programming, if you were fixing a bug in your code or designing an algorithm, you figured it out on your own, got help from a coworker, or searched through documentation. Today, you enter a few key words or phrases into a search engine, and have nearly instantaneous access to world wide content relating to your query.

If you’re a programmer and take the awesomeness of internet for granted, try going without it for a few months. 

On second thought, whether you program or not, if you aren't amazed by how much information we receive through technology that interconnects us, try shutting off your cell phone, cable, and WiFi for a few months.

Wednesday, January 15, 2014

Tuesday, January 7, 2014

Pattern Matching Constants in CLIPS

In CLIPS, there are three basic templates for matching a constant in a rule pattern. The constant, in this case 387, can be placed directly in the pattern as a literal constraint:
(defrule rule-387
   (data (value 387))
   =>)
A predicate constraint can be used to evaluate an expression testing for equality:
(defrule rule-387
   (data (value ?x&:(eq ?x 387)))
   =>)
A test conditional element can be used to evaluate an expression testing for equality:
(defrule rule-387
   (data (value ?x))
   (test (eq ?x 387))
   =>)
An empirical analysis can be performed to determine which template is most efficient as the number of rules and distinct constants increase. A common set of constructs will be used with each group of rules to trigger pattern matching as a single fact is repeatedly modified:
(deftemplate data
   (slot index)
   (slot value))

(deffacts start
   (data (index 1000000) (value 100000)))

(defrule loop
   (declare (salience 1))
   ?f <- (data (index ?i&~0))
   =>
   (modify ?f (index (- ?i 1)) (value (- ?i 1))))
Using CLIPS 6.24 to run the common rules in conjunction with groups of 1, 100, 400, 700, and 1000 rules using each of the three templates produces the following results.



The literal constraint is the most efficient, which is what you’d intuitively expect after an examination of the code. It directly compares a value in a fact to a value stored in the pattern network.

The predicate constraint and test conditional element are less efficient as they require a function evaluation. The predicate constraint is slightly more efficient because it’s evaluated at an earlier stage of pattern matching than the test conditional element. If all of the referenced variables in a predicate constraint are bound within the pattern, then the evaluation can be performed in the pattern network. Test conditional elements and expressions containing variables bound in other patterns are evaluated in the join network, which is primarily used to unify variable bindings across multiple patterns.

CLIPS 6.30 provides significantly better performance for literal constraints:



In situations where multiple patterns satisfy the criteria for sharing, literal constraints are not evaluated one at a time. Instead the next node in the pattern network is determined using a hashing algorithm which requires just a single computation regardless of the number of literal constraints. So for this particular benchmark, the execution time does not increase for literal constraints as the number of rules and distinct literals is increased.

Bottom line: regardless of which version of CLIPS you’re using, use literal constraints rather than predicate constraints or test conditional elements.

The code for these benchmarks is available here.