Sunday, December 18, 2016

Rogue One: A Star Wars Review

Spoiler-free intro

If you haven't seen the movie yet, you might want to not read past the spoiler alert warning below.

So, you've no doubt seen reviews that say Rogue One is the best Star Wars film, and reviews that claim it's utterly disappointing. I liked it a lot, and I think it's a movie that gets better the closer you look at it. I definitely plan to see it again, and see how much more I can pick out of it.

I have a theory about how people's enjoyment of Rogue One related to their overall level of nerdiness, specifically their level of Star Wars nerdiness. The theory goes like this: I think that the graph of enjoyment vs Star Wars nerdiness has two peaks, one on the low end, and one on the high end, with a substantial dip in between.

If you only know the Star Wars films a little bit, or just aren't that much of nerd, in general, Rogue One is a pretty serviceable Sci-Fi action adventure, with some shootouts, some chases, and some amazing visual effects. If you're a super-fan, you get all of that, AND a truly prodigious number of cameos, offhand references, and call-outs to just about every Star Wars movie or TV series, from the original trilogy, to the prequels, to The Force Awakens, to Rogue One  to Rebels. I wouldn't be surprised if there's a reference to the Star Wars Christmas Special hidden in there somewhere.

In the middle, we run into the unfortunate people who just really liked the original 3 films (and maybe The Force Awakens), and are headed into Rogue One expecting more of the same I expect these people to come out a little disappointed with Rogue One, because it's really quite different from the original Star Wars movies. This is, I believe, intentional, and brilliant in its own way, but it's definitely going to turn some people off.

Here are some of the ways in which Rogue One carves out new territory in the Star Wars universe, and some of my favorite bits of clever film-making in it.





SPOILERS START HERE!!!!





Mirrors and reflections

We all remember how the original Star Wars started, I hope. There's the opening text crawl, and then we jump right into the action. A small space ship, fleeing under heavy fire, retreats into the background, and then their pursuer comes into view - a mind-bogglingly-massive grey wedge of death, the Super Star Destroyer.

Roque One has no text crawl, but it does open on a scene in space, relatively peaceful, or so it seems. And then a great grey wedge starts to intrude into the scene. For just a fraction of a moment, your brain says "Oh, it's one of those giant Imperial ships", but then you realize it just doesn't look right, and the camera tilts and pans, revealing that you're looking at the edge of a planetary ring. As you're settling in, waiting to see what happens, a small ship (an Imperial shuttle, this time) crosses the frame, and heads into the background. Where as in Star Wars, we're immediately ready to cheer on the rebels, in this scene, we don't yet know what to think of this spaceship, heading alone down to land on the planet. It's obviously not good news for the locals, though...

So, there's an obvious echo here between the original and the prequel. There's just enough similarity to trip you up if you think you know what you're about to see. It's a bit like watching the original Star Wars through a blurry lens, or in a fun-house mirror. Rogue One does a lot of this.

It's in the nature of sequels, and even more so in the nature of prequels, to be defined to some extent by how they fit together with, and how they differ from, the original film. It's a bit like how people who have a twin will often grow up to define themselves in terms of their differences from their sibling.

As an immediate prequel to the original movie, Rogue One basically ends right where Star Wars begins. This single moment becomes the mirror in which the original Star Wars is reflected both back in time and backwards in outlook.

When The Empire Strikes Back was released, Star Wars was re-titled as Star Wars: A New Hope. What comes before hope? Despair. Rogue One's story picks up at probably the lowest point of the Rebellion agains the Empire. The rebels can't decide on strategy, they've lost control over some of their own best operatives, and now they've learned of a super-weapon, the Death Star, which has been created specifically to crush the rebellion once and for all.

It's very dark in here

Some people have called Rogue One a "dark" film, and that's true on all sorts of different levels. First off, it's actually literally dark in places where the original is light, and vice-versa. Tatooine, the location of most of the beginning of Star Wars, is a blindingly-bright, glaring white sand desert. The first location we visit in Rogue One is a black sand beach, with clouds overhead. It's literally exactly the opposite of Tatooine.

When we first see the main bad guy (Darth Vader) in Star Wars, he's in a black outfit, surrounded by foot soldiers wearing white armor. In Rogue One, the main villain appears wearing a white outfit, accompanied by a squad of stormtroopers in black armor.

This is a fairly subtle bit of film-making, but I think it's brilliant. It could have easily gone some other way, with Orson Krennic, the weapons director, wearing any of the other Imperial uniforms we've seen before, and accompanied by the traditional white-armored Storm Troopers. But it's subtly "off", and sets up the expectation that this movie is not going to follow the familiar conventions and story arcs of the series.

War is hell, and hell is the Middle East (or Jedha)

Somewhat ironically, for a series of films called "Star Wars", the previous films never really touched on the chaos, terror, and moral grey areas of fighting a war. Rogue One finally does that, in a big way. There has been a lot of talk about the "it's a war movie" aspect of the film, with critics comparing it to WWII movies or Vietnam movies. There are obvious parallels there, but this also feels to me like a war movie with its roots in Afghanistan and Syria, a throughly-modern take on the nature of fighting a war.

There's a scene where a group of rebels ambush an Imperial patrol, disabling their armored vehicle and killing the stormtroopers. It's the first real fighting we see in the movie, and it's important for setting the tone of the "rebellion on the ground", as opposed to the "rebellion in theory" that we're introduced to when Jyn meets Mon Mothma and the rest of the Rebel leadership after being rescued from imperial custody.

The whole sequence is just fraught with references to recent middle eastern conflicts. There's the tank ambush itself, which feels like a reference to 1988's The Beast, a film about the Soviet invasion of Afghanistan. Then there are the rebels hiding in caves outside the city proper, a definite nod the the Mujahideen of Afghanistan, as well as the later Al-Qaeda in Pakistan.

The war machines of the Empire are literally powered by the ancient religious treasures of the local population, a reference to both ISIL's destruction of historic sites, and their use of captured oil production infrastructure to finance their war against the governments of the region.

In the middle of the chaos of the tank battle, the nominally-heroic Captain Cassian shoots one of the local rebels, in order to keep Jyn safe. He doesn't even hesitate, he just does it. That kind of divided loyalty is the very essence of modern coalition warfare.

In the end, the Empire solves their rebel "problem" by blasting the entire city from space, with a "precision" shot from the Death Star. Just like the "smart bombs" used in recent real-world conflicts, the single-reactor shot from the Death Star does far less damage than the Empire is easily capable of, but it still causes massive amounts of "collateral damage". It's a very Apocalypse Now, "We had to destroy the village in order to save it" moment.

And speaking of Apocalypse Now, what about Saw Gerrera? Here's a high-ranking Rebel commander, who's gone off the grid on Jedha, commanding his own personal band of fanatics in a mountain stronghold, leading guerrilla attacks on the Imperial troops, in a way that the "official" rebellion leadership does't approve of. The Rebel leadership dispatches an intelligence officer / field agent to track Gerrerra down, but because this film doesn't perfectly copy any of its inspirations, Captain Caspian isn't ordered to kill Gerrerra, but instead is supposed to use him to find Galen Erso, who he is ordered (secretly) to kill.

You call these people "heroes"?

We've got Galen Erso, a collaborator, complete with the classic "If I didn't do it, they'd just get someone else to" excuse. He tries to sabotage the Empire's war machine form the inside, perhaps in guilt over what he's helped to build. In the end, this man, who nobody in the rebellion will even remember, is in fact the only reason the Empire didn't manage to totally destroy the Rebellion, one planet at a time.

Saw Gerrera, an insane ex-rebel, who's decided to fight the war on his own terms. Bodhi Rook, the Imperial shuttle pilot, defects on Galen Erso's orders. He's supposed to take the news of the Death Star's weakness to the rebellion. Unfortunately, Erso sends him to Gerrera, not knowing that his former friend has gone off the deep end. Gerrera's men blindfold Rook, in a scene that echoes the CIA's "extraordinary rendition" program, and deliver him to Gerrara, who tortures Rook, just to be sure of the truth of the message from his former friend. After torturing him, Gerrera just discards Rook, even though we later learn that it would take very little actual effort to help him recover from his experience.

Let's hear it for Captain Cassian. He's the anti- Han Solo. Instead of being a smuggler who reluctantly gets pulled into the rebellion, he's a Special Ops soldier who's engaged in all sorts of dirty tactics for the rebellion, a man who's so completely bought in to the cause, that's he's perfectly happy to lie to everybody who's working with him, and accept a mission to use a young woman to get to her father, then assassinate him. When he finally has that moment of clarity, and realizes that he can't just execute Erso in cold blood, it actually feels like it means something.

And then there's the hero/viewpoint character, Jyn. She's an orphan, of course (what is it with orphans in Star Wars?), but instead of secretly being the child of the big bad guy, who's been raised by the rebels until she can challenge her parent and save the galaxy, she's...basically a nobody. Her father's kind of important to the Death Star project, but I'd bet that other than his boss (who has a much higher opinion of his skills than even Erso does), nobody in the Imperial hierarchy has even heard of him.

Miscellaneous cool bits

Darth Vader is back, and he's completely terrifying. The scene in Vader's castle establishes the quiet menace with which Vader keeps the Empire under tight control. And the scene at the end of Rogue One, where he's in full-on psycho killer mode, stabbing rebel soldiers left and right, slicing through bulkheads? That's the Vader we know from the end of The Empire Strikes Back, and from the climactic lightsaber duel at the end of Return of The Jedi - a dark Jedi who's perfectly willing to give in to his hate, to his savage bloodlust, and use that power to beat down whatever gets in his way. Also a great call-out to The Force Awakens' Kylo Ren, who has those same emotional tendencies, without the control to go with it.

I love everything about Chirrut Îmwe, the blind monastic warrior. He's not a Jedi Knight, but he's everything that we loved about Ben Kenobi from the original, and he finally puts the "Midichlorian" nonsense from the prequels to rest for good. The Force isn't a bacterial infection, it's a mystical connection between every living thing, and if you believe, if you give yourself over to it, you can achieve amazing things.

One subtle bit that I loved was his reciting his mantra, walking utterly unharmed through a killing field of covering fire, right up to the control console for the communication relay...and then totally fumbling for the switch. Because of course, he can't just see the switch - he's blind. He can "see" all of the soldiers via the Force, he can get all of them to miss him (or maybe not shoot in his particular direction?), but the switch is just a dead metal lever - it can't be easily seen or influenced through the Force.

Alan Tudyk plays K-2SO, who's a sarcastic pilot who dies on the final mission to try to "get the signal out". That one's a bit heavy-handed by Rogue One standards, but I loved Firefly, so I'll let that one slide.

And this is now two Star Wars films in a row with a female lead, and a major secondary male character, who don't fall in love, but do develop a strong friendship through their adventures. I get really sick of the idea that every movie needs to have a romantic sub-plot, and I'm glad to see the idea of platonic friendships between men and women being treated as just as relevant as romantic entanglements.

Monday, February 22, 2016

Apple vs the FBI

What's up with Apple and the FBI?

Several of my friends and family have asked me about this case, which has been in the news a lot recently. A whole lot of news stories have been written trying more-or-less successfully to explain what's going on here, often with ill-fitting analogies to locks and keys, and it seems like a lot of people (including some of our presidential candidates) are just as confused about what's going on now as they were when the whole thing started. The Wired article above is really very good, but it's long, fairly-technical, and doesn't cover the non-technical side of things particularly well.

So, since y'all asked, here are some of my thoughts on the case. I'm going to be kind of all over the map here, because I've gotten questions about the moral side of things as well as the technical. I'm going to mostly skip over the legal side of things (because I'm unqualified to comment), except for a couple of specific points.

On the off-chance that someone stumbles across this who doesn't already know who I am, I'm a computer programmer, and I have worked on encryption and digital security software for a number of different companies, including 3 of the 5 largest PC manufacturers.

I'm going to try to stay away from using any analogies, and just explain the actual technology involved as simply as I can, since I know you can handle a bit of jargon, and the analogy-slinging I see on Facebook isn't making things any clearer for people, as far as I can see. There will be links to Wikipedia articles in here. You don't need to read them, but they are there in case you want to read more about those subjects.

First, a very quick run-down of what this is all about:
  • The FBI has an iPhone that was used by Syed Rizwan Farook, one of the shooters in the San Bernardino shootings last December.
  • The phone is locked (of course), and the FBI wants Apple to help them unlock it, and in fact has a court order requiring Apple to do so.
  • Apple is refusing to do what the FBI wants, for some fairly-complicated reasons.
  • A whole lot of people, including information security experts, law experts, and politicians, have weighed in on how they think this should go.

So, what's my take on all this?

Encryption does not work the way you might think it does, from watching movies or TV.


In the movies, you always see "hackers" running some piece of software that puts up a progress bar, and the software makes gradual progress over the course of seconds or minutes, until the encryption is "broken", and the spy gets access to the data they need. In the real world, unless the encryption implementation is fundamentally-broken by design, the only way to break in is by trying every possible key (we call this a "brute force attack"), and there are an enormous number of possible keys. You could get in with the very first key you try, or you might end up checking every possible key before you find the right one. Nothing about this process gives you any information about whether you're "close" to getting the right key, or whether you've still got billions of keys to try.

The data on the iPhone is encrypted with a key long enough that trying to decrypt it through brute force is essentially impossible.

The data on the iPhone is encrypted using AES, the Advanced Encryption Standard, which was developed by the US government for companies like Apple to use to secure data for their customers. as far as anybody knows, brute-force is the only way to attack AES, and with a 256-bit key (as is used on the iPhone), it'd take literally billions of years to try every possible key, if you used all of the computing power in the world.

Apple doesn't have that key to hand it over to the FBI

The key used to encrypt data on the iPhone is derived from a combination of a device-specific key, and the pass-code which the user has set on the phone. There's no way to extract the device-specific key from the phone, and there's no record of which phone uses which device-specific key. This is done on purpose, because if you could get that data, it'd make it much easier for anyone to extract your personal data from your phone.

Given that you can't get the device-specific key, then even if all of the data was extracted from the phone, you'd be faced with performing a brute-force attack on the encryption (which is impossible, see above).

You don't need the device-specific key if you can guess the pass-code to the phone

Obviously, if the phone has a 4-digit pass-code, you only need to try 1,000 10,000 different codes in order to unlock it (0000-9999). You could sit an FBI intern down in a cubicle with the phone, and a day or so later, it'd be unlocked. That'd be a really boring shift for them, but you could still do it. If the phone has a 6-digit lock code, that becomes substantially less-convenient, and you're into the range of a full-time job for a year or more.

But you might not be able to do that either, depending on the phone's settings. One of the security settings you can set on the iPhone is for it to erase the data on the phone after 10 incorrect password attempts. The FBI seems to think that this option is enabled for Farook's iPhone.

Here's what the FBI says that they want Apple to do

The FBI wants Apple to produce a custom version of iOS (the iPhone software), and load it onto Farook's iPhone, to enable them to quickly try all of the possible pass-codes.

This custom software would:

  1. Disable the "erase after 10 incorrect codes are entered" feature (of course)
  2. Allow the FBI to feed possible pass-codes to the iPhone from a connected computer, rather than requiring some poor intern to enter each one by hand.
  3. Reduce the amount of time required between entering each code, so they can check them faster. That wouldn't matter if there was a 4-digit code set, so maybe Farook used a longer code.


Can Apple do it?

Apparently so, or at least Apple CEO Tim Cook hasn't made the claim that they can't comply with the court order, just that they shouldn't be required to. It probably would not be that much work, actually. Items 1 and 3 up there should be trivially-easy to change, and #2 is probably not a huge amount of work for someone who's familiar with interfacing the iPhone to a PC. Somewhere between "one guy working over the weekend" and "two guys working on it for a week" is probably a reasonable guess.

Here's why Apple says that they shouldn't be forced to do this


It's a violation of their customers' privacy

Tim Cook says in his open letter that the FBI's request amounts to:
The government is asking Apple to hack our own users and undermine decades of security advancements that protect our customers — including tens of millions of American citizens — from sophisticated hackers and cybercriminals. 
Earlier models of the iPhone were much simpler for Apple to bypass the pass-code on, and they've expended substantial effort over the last few revisions to make it much harder for people to break into iPhones (and newer ones are even more-secure than the phone in this case). This is valuable protection for the individual customers' data, and has contributed in large part to reducing the number of phones stolen, since they can be locked in such a way that they can't be easily re-sold. This same cryptographic technology is also what keeps trade secret information that's stored on businesspeople's phones from being copied as a matter of course overtime they travel to any foreign country.

This is not a normal subpoena, it's a special court order

Normally, law enforcement agencies will get a court order to compel a company or individual to turn over information or physical evidence that is relevant to a particular investigation. Apple has cooperated in previous investigations (and even in this specific case) with those sorts of orders. This is something else entirely.

Using the All Writs Act, an obscure 18th-century law, the FBI is trying to force Apple to engage in an activity that they wouldn't otherwise do (and which will have a negative impact on their business and customers). The All Writs act has some significant restrictions in terms of when it can be invoked, but there's remarkably-little restriction on what a court can use it to order.

Once the FBI successfully uses the All Writs Act to force Apple to produce a custom version of iOS, they will have established a precedent where they can use it to compel Apple (or any other technology company) to take whatever actions they think might be helpful to aid any investigation they might launch. Lest you think I'm veering into conspiracy-theory territory here, consider the following:

Several statements that the FBI has made to the court and in the news are either extremely naive or deliberately misleading.

The FBI has made statements both in their court filings and in the press which are simply untrue. If it weren't for the fact that the people making these claims are actual forensics experts (or work with such experts), I'd be inclined to say that they just don't know what they're talking about. Given that they do work for the FBI, I think it's reasonable to hold them to a much higher standard of clueful-ness.

It's just for this one phone for this one investigation

I can't believe that anybody would think they could get this argument past a judge. Of course if this tool exists, the FBI (and every other police/security agency in the US and every other country in the world) will require that a this custom firmware version be loaded on whatever iPhones they might have picked up in the course of an investigation. And it'd be so much easier if they could just hold on to the firmware themselves, and apply it themselves to iPhones where they have a warrant. This isn't even a "slippery slope" argument, it's just what will obviously happen.

Several news articles have mentioned China, but really any country that has a poor human rights record would obviously misuse this tool, if it was available. In particular, the Gulf states have an atrocious record on human rights, and a track record of forcing technology companies to compromise customer security to make things easier on their state security agencies (See: Saudi Arabia and Blackberry).

There may be critical information on this phone that leads to other terrorists that Farook was in contact with.

It's very unlikely that there's actually any information on this phone that'd be useful to the FBI investigation. First off, this isn't even Farook's personal phone. It's the work phone that was issued to him by his employer, the County of San Bernardino. I mean, you can never underestimate the intelligence of criminals, but what kind of idiot would plan their attack on a county facility using their county-supplied phone?

In any case, Farook destroyed his own personal phone, as well as a laptop and several other devices, before carrying out the attack. If he went to all that trouble to destroy evidence, it seems unlikely that he just plain forgot to destroy his work phone. It's much more-likely that there was never anything remotely-incriminating on it to begin with.

Secondly, the FBI already has access to backups of that phone all the way up to 1 month before the attack. So they'd only be potentially getting information that was added to the phone in the last couple of weeks before the attack.

And finally, almost all of the relevant data you might get from that phone is already in the FBI's hands through other channels. They've already got access to the call records, emails, and other communications from that phone and Farook's other devices.

Apple can make this hack so that it only works on this one iPhone, eliminating any risk to Apple's other customers.

Well, sure, in a trivial sense. In a much more-significant sense, this is a content-free statement. In the trivial sense, Apple cannot course add extra code to this custom version of iOS so that it only works on Farook's phone. But really, they can't do that - they have to test it first, of course, so that means it has to be installable on at least two phones. And it'd obviously be trivial to change which phones it works on later, which brings us back to the original "it's only for this one phone" nonsense above.

Additionally, this runs into conflict with the requirements of the "All Writs Act", which is the justification for this order. They're not allowed to create an "undue burden" on Apple, and having Apple set up a whole new internal process for creating thousands of custom versions of iOS for every investigation in which it might be useful is not a trivial thing.

Right now, Apple needs to be very careful about which OS updates it digitally "signs", which is the process that's needed to allow the software to be installed on customers' phones. There are hundreds or maybe thousands of Apple employees who have access to the tools and the source code to make changes in iOS. But that final step of signing an update is necessarily restricted, because the key for that process allows you to say to the world "this software is approved by Apple". They're presumably quite careful with that key. You can make the argument (and people have) that digitally-signing a file is essentially the same as a physical signature, and you shouldn't be able to compel someone to sign something digitally any more than you can legally compel them to sign a physical piece of paper.

I don't know about Apple, but at one of my former employers, we kept our code-signing key, and the laptop with the software for signing our updates, physically locked up in a safe. The key was actually split into multiple parts, which were only accessible to certain people. Because if you can sign software, you can make it do anything you want. You can remove the DRM which is used to secure purchased content, steal all of a customer's personal data, anything.

There's a larger issue at stake here - the very idea of privacy is under attack

Ever since the ratification of the Bill Of Rights, there has been a back-and-forth argument in this country over the right balance between the citizen's right to privacy, and the state's need for security. Since the development of effective commercial cryptography in the late 20th century, the debate has gotten significantly more-heated.

Privacy is a basic right, guaranteed by the Bill of Rights here in the US

The 4th Amendment to the US Constitution says:
The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

This controls the sorts of searches that the police (FBI, etc) can perform. In particular, they need probable cause, and a court-issued warrant. Over the last few centuries, that's been dialed back a bit, and US citizens are routinely searched without a warrant, and without probable cause. But there are still limits, and if you, your home, or your stuff is unreasonably-searched, you can contest that in court (and you might even win).

When the constitution was written, the founding fathers could not have imagined the sort of surveillance technology we have today.

In 1789, if you wanted to have a private conversation with a friend or family member, you could take them aside into a room, or go for a walk in the woods, and if you couldn't see anybody else, chances are nobody would overhear what you had to say. With a wax seal on your mail, you could see whether it had been tampered with (or read by someone else) in transit.

Modern communication systems (email, telephone, chat) are much easier to listen in on, and when new technology comes along, it has typically taken a while for the Supreme Court to come to the conclusion that whatever new-fangled communication system you use, it's essentially the same as a letter, for legal purposes. Tapping phone lines without a warrant used to be totally legal. Same with intercepting email and other electronic communications.

The question of whether or not you can be compelled to unlock your own phone, even if it contains potentially-incriminating evidence, is possibly still open, despite the fact that that seems like an obvious violation of the 5th Amendment.

Strong encryption flips the balance of privacy back to the way things were in the 18th century

When you have access to strong encryption, you have privacy by default. This is as it should be. Until the early 1990s, most encryption that was available commercially was just terrible. Since the development of the World Wide Web, the level of sophistication of the cryptography available to individuals and commercial users has vastly improved.

The US government has fought the availability of effective encryption for decades

After World War II, a war which the Allies won in part due to their ability to decrypt German secret messages, the US government set up the NSA to ensure that they had a lead in cryptographic technology. And until the growth of academic cryptographic research in the 1980s and 1990s, their expertise was unmatched. The NSA has a weird double mission. On the one hand, they're supposed to protect US military and civilian communications from foreign spies. On the other side, they're supposed to develop ways to break encryption used by other organizations, to support US intelligence-gathering. When it comes to commercial encryption, these goals are directly in conflict.

When the first truly effective encryption systems began to become commercially available, the NSA tried to keep their ability to listen in on communications by restricting the length of keys that could be used in software that was being exported. Eventually, it became obvious that that was only going to disadvantage US software makers, and the restriction was lifted.

During the Clinton administration, the NSA proposed Clipper, a cryptography system that would make it easy for law enforcement to listen in on communications (with a warrant, at least in principle), but would be very difficult for foreign governments, hackers, and others to break. It turned out to have a number of fundamental flaws, and was pretty quickly killed.

More-recently, the NSA has been possibly caught inserting a flaw into a security standard that they helped develop.

Law enforcement and security agencies now have much greater ability to collect data that's not specifically protected with encryption

Despite better security of communications overall, the security apparatus has continued to press the boundaries of what information they can gather without a proper warrant. Here are a few recent(wish) examples.

The FISA court

In order to allow allow Federal law enforcement and intelligence agencies to obtain search warrants, without having to publicly disclose what they're searching for, and who they're searching, Congress created a parallel court system, the Federal Intelligence Surveillance Court. This court provides search warrants, and has been involved in issuing court orders to compel commercial companies to cooperate with the NSA in collecting data, including information on US citizens, which the NSA is explicitly barred from collecting.

Telephone metadata collection

The NSA has been, for many years, collecting telephone meta-data (who's calling whom) for essentially all telephone call placed inside the United States (and several other countries). This only came to light because of Edward Snowden's whistle-blowing, because of course they got the authority for that from the secret FISA court.

StingRay

The StingRay system is basically a "fake" cell tower that broadcasts a signal that causes every mobile phone within range to report its location. They can be used to track the location of mobile-phone users in bulk, and can also apparently be used to intercept calls. These systems have been provided to local police forces via grants from the Department of Homeland Security, and they're used in a variety of ways that are at best quasi-legal (in that they haven't been specifically declared illegal yet).

Automated number plate readers

These machines are just about everywhere. They're used to automatically collect tolls, the police use them to search for cars that are associated with wanted criminals, repo men use them to look for cars that the owners have stopped making payments on, etc, etc. My local city has them mounted on the parking enforcement golf-carts, so they can just cruise down the street and collect the location and license plate numbers of every single car parked anywhere in the city.

And again, there's no law telling either the police or the private companies what they can or can't do with this information, so it gets used (and mis-used) for all sorts of things. The police have no need and no right to know where my car is at all times, as long as I'm actually following the parking rules.

What happens now?

I think there's a good chance that the court will make the "right" decision here, and side with Apple after considering their response. Either way, you should expect that Apple (and other manufacturers) will make additional efforts to ensure that they themselves cannot circumvent their own security systems. If the court makes the "wrong" decision, then there will be a whole lot more of these court orders issued in the near future, and that's bad news for privacy.


Monday, September 08, 2014

Predictions for Apple's big announcement event tomorrow

So, Apple has scheduled some new product announcements tomorrow, which will certainly include a new iPhone (it’s the right time of year for that). There’s a lot of buzz on the internet about the event, based on oblique references from various Apple employees that this event is about much more than just a new iPhone.

Despite the fact that I haven’t worked there in a decade, some people have asked me what I think Apple’s going to announce. For everybody’s amusement, here are my predictions, so we can all have a good laugh about them tomorrow. But first, some background:

I’m really bad at this

As many of my friends and family already well know, I have a history of really, really bad predictions of what Apple will and won’t do. A couple of notable failure in the past include:

“Apple wouldn’t buy NeXT. That would make no sense. They might license some of the technology”
When I said this, Apple was actually currently in negotiations to purchase NeXT, which ended up being their largest acquisition value-wise, until they acquired Beats Electronics this year.

“Mac OS X will never ship. It’s a doomed project”
This was while I was working on the OS X team, and more than a little depressed at the level of infighting and backstabbing going on between various teams. It took almost another year, but OS X 1.0 did actually ship,

“Clearly, the Mac will be transitioning to a new architecture again. It won’t be X86, though”
I had assumed X86-64 on AMD processors was the new target. I take some satisfaction from the fact that Apple relatively-quickly obsoleted the X86 processors in Macs, for 64-bit capable ones.  I *almost* got this one right, but I underestimated how much influence non-technical factors would have on the decision.

That’s a common theme amongst many of the times that I mis-predict what Apple is going to do - because I’m this hyper-logical engineer-type person, it always surprises me when they do something that’s not the “right” decision technically, but makes sense economically or in some other way.

Predictions

Okay, so here are my logical predictions, almost none of which will likely come to pass.

What I think of the popular rumors


iPhone 6
No doubt that this is going to be announced. It’ll be lighter, better battery life, faster. Rumors are that there will be a physically much-larger model, with a 5.5 inch screen. That’s totally ridiculous. We’ve all seen someone using one of those massive Android phones, and I think we can all agree that they look like total dorks. No way that Apple is going to make an iPhone that you have to use both hands to use.

iWatch
Not a chance in hell that Apple will produce a smart watch like the Galaxy Gear or Moto 360. Again with the “dork” factor - who even wears a watch those days? I haven’t worn a watch since I got my first  Palm Pilot, back in the day. My iPhone goes with me nearly everywhere I go, already. I look at higher-end wristwatches, and I can appreciate the craftsmanship, but I have no more interest in wearing them than any other piece of jewelry. If Apple does introduce a piece of “wearable technology”, then it won’t be a conventional watch. I could see something playing up the health-monitor angle, but a wristwatch? No way. A $300 accessory for my iPhone that saves me the effort of pulling my phone out of my pocket to read the calendar notifications? Ridiculous.

”Obvious” things, which I haven’t seen rumors about


New Macs
Weirdly, there’s not much buzz about this in the rumor-sphere. There was a little bit of buzz about that early on, given that the event is at the Flint Center, where the introduction of the original Macintosh was held, as well as the iMac, the machine that saved the whole Macintosh line. But the rumor mill died out, partly due to lack of information, and I think partly due to people being unable to figure out how a new Mac development would be any kind of big deal.

What kind of announcements could they make about the Mac that’d revitalize that line, and the company, again? There are a couple of “obvious” things they could do, based on the technology that Apple’s products are built on, and recent changes in their products.

A new Macbook Air, based on a 64-bit ARM processor
The 64-bit ARM processor in the iPhone 5s and iPad Air is this close to being a capable desktop replacement, and we already know that OS X runs on ARM (after all, iOS is basically OS X with a few additions/deletions, and maintaining processor-neutrality is something Apple’s been focused on since the Intel transition.

What would you get with this new Mac? All-day battery life, at least, but given that you could then run both iOS and OS X on the same hardware, it would make even more sense to unify them. There are already *far more* applications for iOS than for OS X, and integrating iOS app support would tie in nicely with the changes to full-screen mode that we’ve seen in recent versions of OS X.

The Mac App store already exists, so for people writing OS X apps, it’d be a simple re-compile to target the new architecture. Also, the most-recent Mac Pro was a design focussed much more on exploiting the GPU, rather than being dependent on the CPU. Any apps that are optimized for the Mac Pro will run great on an ARM machine with a proper GPU. All in all, the pain of moving to a new architecture will be much lower now than it was for the Intel transition in 2005/2006.

30th Anniversary Mac
Oh, and it’s the 30th anniversary of the Mac, so a “30th Anniversary Mac” seems like a good bet. Not sure whether that’d be a new iMac (to keep with the all-in-one form factor), or a laptop (the most-popular Mac form factor these days). Unlike the much-mocked “20th Anniversary Mac”, I expect this to actually be a product that the average Mac user would want, and that they’ll actually be able to buy.

Apple TV finally “grows up” and stops being a “hobby” for Apple
As someone who’s worked on Smart TV software, I can tell you that the problems with the TV watching experience today aren’t really the sorts of things you can solve with better hardware and software. They’re structural problems in the way TV content is produced, delivered, and consumed. Why does your fancy digital cable box take 2 seconds to switch channels? Why is your DVR’s interface so ugly? Why can’t you watch back episodes of your favorite show for any reasonable price, until they’re released on DVD? Why is it so *much* more convenient to pirate content than it is to pay for it?

It’s all down to *lack of integration* - the cable company, the folks making the set-top box, and the people making the content that makes having cable worthwhile all work for different companies, with different goals.

Apple has enough money in the bank to outright buy AMC, CBS, HBO and Netflix with cash. They’d have to borrow a little bit to buy Comcast, but not actually all that much. That’d change the TV landscape a bit, I think.

Conclusions

Based on my previous track record, here's what I think you should expect:
  • iPhone 6, with a comically-large screen. In a year, I'll deny I ever mocked "phablets" as a bad idea.
  • An iWatch (not with that name), which is a "me too" smart watch. People will buy it, because it'll be oh-so pretty. But in a year, nobody will be wearing one anymore.
  • No new Macs, except for an utterly-unremarkable "30th Anniversary Macintosh", which will be a gold-plated turd, just like the 20th Anniversary Mac
  • Apple TV continues to be that weird box that your Apple fanboy friend / relative has, that you just don't "get" why they have it.

Tuesday, February 05, 2013

One down, 11 to go

January OneGameAMonth post-mortem

January is over, and I'm done working on Rocks! (for now, at least), and it's time to go over what worked, what didn't, and what I'll do differently for February.

First, here's a link to the current version:

And here's the Github repository with the source code:

What I was trying to do:
This was the first month of the One Game A Month challenge, and I really wanted to make sure I finished something, so I'd get started off on the right foot. To that end, I tried to shrink the scale of what I was trying to do for January to something I was sure I'd be able to finish. Rather than design a game from scratch, I started with a well-known design, and implemented it on an unknown (to me) technology stack. So, I decided to do a clone of Asteroids, running in the web browser, using the canvas element for graphics, and the Web Audio API for sound.

I wanted to produce something with a retro feel, true to the spirit of the original, even if it wasn't exactly the same in execution. And I decided to do the whole thing without the use of any frameworks or libraries, both because I thought that the game was simple enough that I could just bang it out without much help, and because I wanted to actually learn the browser APIs, not some third-party library.

What went right:
Got something working very fast, then iterated
By the end of the first week, I had a playable game, if not a very interesting one. That took a lot of the pressure off, knowing that even if I ran out of time, I'd have *something* to show for it.

Scope creep (mostly) avoided
Although lots of really great ideas came to me while working on Rocks!, I managed to avoid the temptation to add in a bunch of extra features. I feel especially good about this given that I didn't quite meet the initial goals - I'd have felt a lot worse if I didn't manage to make a complete game, because I'd gotten distracted by doing something cool, but not part of the core gameplay.

Proper "retro-twitch" feel
I spent a fair amount of time tweaking the controls, to get ship movement that felt "right". I think this is something that really distinguishes my game from the other Asteroids-like games that were submitted to OneGameAMonth last month. My ship is very responsive, it turns and accelerates quickly enough to get out of trouble, which makes the player feel like they're in control of their own fate.

No Art
I didn't want to spend a lot of time drawing terrible art that I then hated. I figured that going with the vector approach would encourage (enforce?) a simple graphical design, and save me from spending hours tweaking art trying to make it look less goofy. My inability to draw well is going to be an ongoing issue for the next 11 games, too.

I "Finished" on time
Actually a bit ahead of time. Which is good, because a bunch of "real world" stuff came up in the last few weeks of January.

What went wrong:
Spent much more time on art & sound than expected
Despite the fact that I went with a totally minimalist look & sound, I still had to do a fair amount of tweaking. But with everything defined in code (see next item), it was pure tedium to make any changes in the graphics or sound.

No creative tools
I ended up doing the entire art design by sketching things out on graph paper and manually copying down the coordinates into my code. This wasn't *terrible*, but it was tedious and error-prone. I didn't produce an editor for shapes and sounds because that sounded like more work than actually finishing the game. For *this* game, that was arguably true - but a couple of features got left out, rather than going through the process of manually designing graphics & sound for them. I'm planning on using the same technologies in future games, so I'll be able to amortize the effort to produce the tools over several projects. Conveniently enough, the optional theme element for OneGameAMonth February is "sound", so I'll have good incentive to build (or find) at least a rudimentary sound editor.

What ended up on the cutting-room floor:
* High score board
* Touch browser controls
* Enemies
* Hyperspace

These are all things I intended to do, but just didn't get around to. Technically, there is a high-score board, it just doesn't allow you to put in your initials. This is because I didn't feel like I could implement it without needing to make some major changes somewhere else.

I didn't do touch controls for keyboard-less tablets and phones because I wanted to do the controls on a kind of virtual arcade cabinet presentation. I never did get any designs for that panel that I liked, so you still can't play the game out your iPad,

Enemies were going to be UFOs like in Asteroids, with an occasional power-up coming from each enemy shot down. I think I could get a fairly rudimentary version of alien AI done in a couple of days, but I just ran out of time.

What about February?
February will be crazy busy for me, so I'll be setting my sights low for this month as well. The massively-multiplayer infinite-world Sci-Fi adventure game will have to wait a month or two.

Amongst other things, I will be adopting some helpful libraries and/or frameworks, rather than trying to do everything myself. In particular, it'd be an interesting exercise to build a videogame using the Enyo.js framework, since we've never really pushed that particular use case, Enyo being more focused toward native-equivalent mobile productivity apps.

Friday, January 11, 2013

Rocks! Update #2 - it's a game

It's an actual game now!

So, first things first - here's the current version of Rocks!

Rocks!

New features include:

  • updated graphics - random rock shapes, and a progression of sizes
  • on-screen instructions
  • better sounds
  • proper collision detection
  • particle effects when things are destroyed
  • more than one level
  • a "shield" that will prevent rocks from running into you

It's looking a lot more like a real game now.

Sound design is hard

Oddly enough, the hardest thing for me so far has been making those decidedly "retro", simple sound effects. The Web Audio API is very powerful, but it's also very much focused on doing sophisticated manipulation of sampled sound. I certainly could have grabbed appropriate sampled sounds, or built some in Audacity, but I wanted to push the "classic" feel of the thing, and I thought - "I've done this sort of thing before, how hard can it be"? Besides, attaching a couple of huge sample files to a game that's currently under 20kb total in size felt a bit like the tail wagging the dog.

Of course, the last time I tried to create synthesized sounds from scratch was probably 30 years ago, on an 8-bit home computer with a fixed-voice synthesizer chip. There's something to be said for the existence of fewer choices helping to focus your efforts. When you're faced with an API that supports multi-channel surround sound, arbitrary frequency- and time-domain manipulation, 3-D positional audio, dynamics compression, and all the rest, it's a little difficult to figure out how to just make a simple "beep".

Here's what I've learned so far about using the Web Audio API:

Web Audio is based on a connected graph of nodes, leading from one or more sources through the graph to the ultimate audio output
This is enormously-flexible, and each of the individual node types is jut about as simple as it can be to do the thing it's designed for. There's a "gain" node that just multiplies the input by a constant and feeds it to the output, for instance. The source nodes don't have individual volume controls (because there's the gain node for that).

There's one weird quirk to my old-school sensibilities, which is that every note requires making another source node and connecting it to the node graph. When a note stops playing, the source node is automatically removed and garbage collected. If you want to play the same sound over and over, you're continuously creating and destroying nodes and connecting them to the graph.

There's a simple oscillator source node that's very flexible
You can easily create an oscillator that uses an arbitrary waveform (square, triangle, sine, on user-defined), plays at a specific frequency, and starts and stops at a specific time. This is about 80% of what you need to make a "beep", but:

Oddly, there's no built-in ADSR envelope support
Back in the day, we'd set up ADSR (attack, decay, sustain, release) parameters for a sound, which would control how quickly it came up to full volume, how loud it was as the note progressed, and how quickly it faded. There are probably about 10 different ways to do the same thing in Web Audio, but nothing with the same simplicity.

There's no simple white-noise source
This is a bit of a weird omission, in that noise sources are the basic building blocks of a lot of useful effects, including explosions, hissing, and roaring noises. And again, there's probably 10 different ways to solve this with the existing building blocks, each with their own limitations and quirks. I ended up using Javascript to create a buffer of random samples, which I could then feed through filters to get the appropriate noises for thrust and explosions.

The API is very much a work in progress
Despite the fact I wasn't trying to anything particularly sophisticated, I ran into a few bugs in both Safari and Chrome. I imagine a certain amount of this is to be expected with an in-development API that hasn't been standardized yet.


Next Up: Enemies!

The next big feature for Rocks! is to have some enemies to chase you around and shoot at you.

Saturday, January 05, 2013

One Game a Month, One Blog a Month?

A New Year Brings a Fresh Start

I swear, I'm not going to start this post out with how disappointed I am at my lack of writing output over the last year. Oops...


The Problem

No matter how much I promise myself I'm going to update my blog more often, it tends to languish. I have a bunch of half-written articles waiting to be published, but in the absence of any compelling deadline, I can continue to look at them as "not quite ready for public view" for forever.


A possible solution

Something I've seen work really well for other people who struggle with producing consistent output are what I think of as "creative challenges". Things like the "take a picture every day for a year" challenge that a lot of people are doing to improve their photography.

I just can't face the idea of a "blog a day" challenge, though - I like the idea of something a little more long-form, and a daily deadline would force me to cut corners to an extent I'm not ready for yet.

So instead, I signed up for the OneGameAMonth challenge. Game design is one of my non-programming passions, so I feel like I'll be able to stay motivated and really try to see this through. A month is a long-enough deadline that I feel like I can produce something worth examining, and the practical problems and "stuff I learned along the way" should provide ample material for *at least* one blog entry a month.


The Plan

I haven't planned the whole 12 months out yet, but here's what I do know my plans:
  • I will create a variety of games in different formats, including video games, board games, and card games
  • I will explore different genres in each format
  • Everything I do will be open-source on my Github account
  • I will write at least one blog entry every month, about the current game
  • If I don't finish a game in a particular month, I will not give up - I'll just do something less ambitious for the next month


The Proof

And to prove that I'm not completely full of it, here's the in-progress game for January, after two days of after-hours hacking:

It's named Rocks!

And here's the GitHub repository for it.

This is an HTML5 Canvas & WebAudio version of the old Asteroids arcade game. Because it uses some cutting-edge web features, it only runs properly in recent WebKit-based browsers. That's Google Chrome and Safari. Future games will likely be more cross-platform, but I wanted to learn a bit about the Web Audio API.


What I've learned on this project so far

This first version is very limited, and frankly pretty buggy:
  • There's no proper collision detection - it's hard to die, unless you try to hit a rock with the ship
  • The asteroids don't start larger and break up into smaller ones
  • There's no level progression, and no game-over when you die 3 times
  • No enemy UFOs yet
  • There are missing sound & visual effects
And the code is, frankly, a mess. But on the other side, there's a lot I've learned over the last two days:
  • All of the rendering is done using the Canvas line-drawing primitives
  • The sounds are synthesized on-the-fly using Web Audio units instead of sampled sounds
  • The animation is driven using requestAnimationFrame, so it should throttle back when in the background
  • The whole thing is less than 11k in size, and there's about 400 lines of Javascript in the main game file. That's smaller than a typical iOS app icon...

Friday, February 10, 2012

The simplest possible computer

The simplest possible computer

So, if we were going to build a model of the simplest possible computer, where would we start? As it turns out, you probably have such a model in your home already.


Many homes have what's known as a "three-way" switch, which is a light switch that you can turn on and off from two different locations. This circuit can be used as a simple digital computer.





By properly labeling the switch positions and the light bulb, we can use them to solve a logic problem.


Let's say that you need a system to tell you whether to have dessert with your lunch, but you have some specific rules to follow:

1. If you have a salad for lunch, you'll have dessert.

2. If you have soup for lunch, you'll have dessert.

3. If you have both soup and salad for lunch, you'll skip dessert (since you'll be over-full).

4. If you haven't had anything for lunch, you won't have dessert (because dessert on an empty stomach will make you sick).


Here's how to solve this problem with the three-way switch:


If necessary, flip one of the switches so that the light is off. Label the positions that the switches are currently in. Label one "had soup", and the other "had salad". Label the other two positions "no soup" and "no salad", respectively. Hang a sign on the light bulb that reads "have dessert".


Congratulations! You now have a computer that will tell you, based on whether you've had soup and/or salad, whether you should have dessert. Try it out, and you'll find that it follows the rules given above, and the light will only come on if you've had either soup or salad (but not both).


This isn't all that exciting by itself, but this same circuit can be used to solve an entire family of related logic problems, just by changing the labels on the switches and the light bulb. This ability to use the same logic to solve many different problems is the source of the flexibility of computers, and is what enables them to be useful for so many different things.


A new project!

I'm working on a "book" in my spare time. I put book in quotes there, because I don't know that it'll actually get to the level of being published on dead trees. Due to the subject matter, it would make more sense to publish it online (or perhaps, via something like iBooks) in any case.

It's intended to be an introduction to Computer Science for non-nerds (and/or younger folk), which I'm sure is well-covered ground, but the unique direction I'm planning on taking is to start "at the bottom" with the most basic principles and work my way up.

This is based on conversations I've had with family and friends over the last few decades, at family gatherings, at parties, and on road trips. I get the impression that a lot of folks think that there's this mysterious "other level" beneath what they understand about their computer that requires a lot of formal training to understand. I want to show that things aren't really that complicated at the lower level, and that all of the complexity is layered on top of a very simple foundation.

And, I find the subject really interesting, so I enjoy writing about it. I'm going to set up a website for he new project soon, but in the meantime, I'll put an excerpt up here to see what people think.

Update: Here it is - The Simplest Possible Computer

Wednesday, June 08, 2011

Time for a reboot...

Okay, it's now been more than a year and a half since I updated this blog. I need to get back on the horse. Stay tuned for an update soon (really)!

Sunday, January 24, 2010

JavaScript by example: functions and function objects

I've been working in JavaScript a lot these last couple of months, and I feel like I've learned a lot. I wanted to show some of the more interesting aspects of JavaScript that I've had the opportunity to bump into. I'll use some simple examples along the way to illustrate my points.

Note: If you want to follow along with the examples in this blog post (and the followup posts), you'll probably want to use an interactive JavaScript environment. I tend to use Firebug with Firefox when I'm trying stuff out, but there shouldn't be anything in these examples that won't work in the WebKit console in Safari or Chrome, or in Rhino, for that matter.

Functions

A simple function is defined and used in JavaScript thusly:

function add(x, y) {
return x + y;
}
console.log(add(3, 5)); // this prints "8" to the console

This does just about what it looks like it does. There's no trickery here (the trickery comes later on). Let's say that we want a version of this function that takes a single argument, and always adds 5 to it. You could do that like this:

function add5(a) {
return add(a, 5);
}

console.log(add5(3)); // prints "8"

But what if you're going to need a bunch of these one-argument variants on the add function? Well, since functions are first-class objects in JavaScript, you can do this:

function make_adder(v) {
var f = function(x) {
return add(x, v);
};
return f;
}

var add7 = make_adder(7); //create a function
console.log(add7(3)); // prints "10"

This is only slightly more complicated than the original example. One possibly subtle point here is that the returned function "captures" the value of v that was passed into make_adder. In a more formal discussion, you'd call this a closure.

Sunday, June 07, 2009

PuzzleTwist is now available!

My latest creation is now up on the iTunes App Store. It's called PuzzleTwist, and it's a puzzle game where you unscramble a picture by rotating the pieces.  As each piece is rotated into place, others will rotate as well - some in the same direction, some in the opposite direction. The key to solving the puzzle is to figure out what order to move the pieces in.

One unique feature is that the rules for each puzzle are different - some are simple, some are more complex. A few are so difficult that I can't solve them without looking at the solution.

Once you've solved a puzzle, you can save the resulting picture in the Photo Library on your iPhone, and then use it as the wallpaper image for the phone, or assign it to one of your contacts.

PuzzleTwist also keeps track of the best reported scores, so you can compare your scores versus the rest of the world.

If you're a puzzle fan, you should check it out. Here's the iTunes store link.

On a side note, this application was approved much faster than the previous applications I submitted. Perhaps the App Store review team is coming out from under their backlog.

Tuesday, May 12, 2009

The eyes have it - a tale of 3 vision problems

I'm recovering from a head cold today, so rather than try to do heavy programming work, I decided to write up a personal story that I've been thinking about lately, for a variety of reasons. 

As anyone who knows me personally can probably attest, I wear glasses and have pretty bad eyesight.  Not many of my friends, and probably not even all of my family, know that I have three distinct vision problems, only one of which is actually addressed by my glasses. I'm going to tell y'all about all three, more or less in the order that I found out about them, and the ways in which they've been treated.

Disclaimer: I'm not an eye doctor, nor an expert in human vision. This is all about what my experience has been. It's entirely likely that I'll make at least one glaring error in my use of some technical term. Feel free to correct me.

Chapter 1: Nearsightedness and Astigmatism
Okay, that probably looks like two different problems, but they're both refractive issues, and they're caused by misshapen eyeballs, and so are corrected easily with eyeglasses. If I remember correctly, I got my first pair of glasses in the 5th grade, when I was 10 years old or so. 

I was pretty astounded at the difference when I put them on - for the first time, I could see the leaves on trees as individual objects. I asked my eye doctor how bad my vision was compared to the 20/20 that's considered "normal" and got the unsatisfying response that the 20/x scale wasn't really a useful measure for people with strong nearsightedness. Since I can barely find the eyechart on the wall at 20 feet without my glasses, I can now understand where he was coming from.

There was some consternation amongst the various parties involved about how it is that I could have gone without glasses as long as I had without anybody noticing that I was blind as a bat. For whatever reason, there wasn't any mandatory screening for vision problems in my elementary school. I got screened for a number of other potential issues, amusingly including colorblindness, but nobody ever stuck an eye chart up on the wall and had me read it.

The biggest issue was probably a simple (dare I say child-like?) assumption on my part that everybody else saw things more or less the same way that I did. So, since I couldn't see the blackboard if I was sitting in the back row, I assumed that nobody else could, either. And if it was critical to the learning process for us to be able to read what the teacher was writing, the school would have arranged the classroom such that it was possible, right?

It probably didn't help that I was also a bit of a daydreamer and a slacker. I think that when I said I didn't know that we had homework due, my teachers and my Mom assumed that I just wasn't paying attention, when in reality, I might have simply not seen the homework assignment written on the board.

As I get older, and more and more of my friends have children, it's occurring to me that there might actually be something useful for other people to learn from my experiences. I think the lesson here is actually a pretty simple one. Parents, talk to your kids about what their sensory experiences are. If someone had at any point between age 2 and age 10 simply asked me whether or not I could see some distant object, or count the number of birds on a telephone wire, or even tacked up an eye chart on the wall and tested me, I might have gotten into glasses sooner.

Alright, so I got glasses at age 10, which helped a lot with being able to see what was written on the blackboard, probably made it a lot safer for me to ride my bicycle around, and generally greatly improved my quality of life. Problem solved, right? Not so much. It turns out that I had another problem, which went unnoticed for several more years, despite going to the eye doctor regularly.

Chapter 2: Strabismus, or the "turned" eye
My right eye has a tendency to turn outwards and upwards, away from whatever it is that I'm looking at. When I was younger, this happened involuntarily, and fairly frequently. These days, I can do it "at will" which is a pretty great way to weird people out if they haven't seen it before. It still tends to happen spontaneously when I'm tired, or when I'm drunk.

Since my left eye is (evidently) my dominant eye, the turning out of my right eye didn't cause me much difficulty, except in one critical visual skill - depth perception. As best as I can remember, I was hit in the face by a baseball or softball while trying to catch it at least a dozen times during my youth. I was also considered pretty "clumsy" in general by most of my friends. 

An interesting aside is that your brain actually uses a lot of other cues besides the convergence of your eyes to judge depth, so it's not exactly true that I didn't have any depth perception. It is true that I had really bad depth perception up close, which is where convergence counts the most - hence my spectacularly-bad performance in the whole "get the glove up in front of the ball before it hits you" task.

This particular quirk in my vision went for quite a while before being discovered. In fact, I think it wasn't noticed until I was examined by a new eye doctor for the first time. The doctor who examined me actually had an intern working with him at the time. When he discovered the eye turn, he called the intern in so he could see how it worked.

Having established that I had this eye problem, the question then became what to do about it. The treatment for this problem varies depending on the ultimate cause, but can include everything from eye exercises, to wearing an eye patch, to surgery. At the time, it was widely believed that any treatment for this condition was essentially useless after about age 10 or so. 

The only recommendation from the eye doctor was that they could put a "prism" correction in my eyeglass lenses, which would help reduce any eyestrain I felt from the misaligned eye. As it turned out, the prism correction didn't do very much, either positive or negative, for me, though it did help my eye appear to other people to be pointing in the right direction.

In the years since, I've met several people who've had the Strabismus surgery, mostly as young children, and overall the success rate doesn't seem to be particularly high. I opted not to have the surgery, and it's worked out pretty well for me. I'd say that if you (or your child) have Strabismus, and someone suggests surgery, you'd do well to get a second opinion, and/or try some of the other treatments, before going forward with the surgery.

Chapter 3: Amblyopia, or "lazy" eye
 It turns out that if you have Strabismus from an early age, and/or if your eyes have significant differences in their refractive power (which mine do), then you've got an excellent chance of developing Amblyopia, which is where your brain adapts to ignore the input from the defective eye.

I had always known that the vision in my right eye was considerably worse than in my left eye, even when I wore my glasses. I had assumed (there's that word again) that the difference had something to do with the difference in astigmatism and nearsightedness between the two eyes. While that was probably part of the cause, it wasn't the whole story.

It turns out that my brain had mostly adapted to not use my right eye, though I still had some amount of vision from it. My right eye provided some peripheral vision on that side, and was essentially ignored for everything else. 

An interesting consequence of this that I discovered sometime in my twenties, was that I actually couldn't read if I covered up my left eye. This was a very strange experience. I could see through my right eye fairly well, and there was an image with shapes on it that I knew I ought to be able to recognize, but I wasn't able to make sense of them, at all.

Chapter 4: What I did about it
It bugged me that my eye was pointing out into space like that, and it really freaked me out that I had one eye that really didn't work at all, so I decided to try to "fix" it. You'll recall that the eye doctor told me that there really wasn't much to be done about this since I was "too old". I figured that if it wasn't going to work, it wasn't likely to hurt to try some things.

And I also figured that you hear about people who suffer traumatic brain injuries of one sort or another, and need to spend years in therapy, while their brain works around the damage. By comparison, working around a mental block on my right eye should be easy, right?

I started working on getting my right eye to point in the right direction. Since I did this on my own, I wasn't following anybody else's accepted eye training program, I just did the things that made sense to me. 

I strengthened my eye muscles and stretched them by repeatedly moving my eyes back and forth to the very limits of their motion. Sometimes I'd go left to right, sometimes top to bottom, sometimes in circles one way or another. I did this for a few minutes at a time, working up to about 1/2 an hour or so. 

I did these self-invented exercises nearly every night for probably a year or so, before I started noticing an improvement. When I first started, it was relatively easy for me to over-strain my right eye by trying to force it to the limit of its motion. Let me tell you, a cramp in your eye muscles is no fun at all. I still have a couple of positions that my right eye really doesn't like to go into, but the range of motion is much improved.

Concurrent with the work on the eye muscles, I tried closing my left eye when I was performing various everyday tasks - watching TV, shopping, driving (not in heavy traffic!), or just walking around. Doing that was always very tiring, and a bit stressful. I tended to get headaches if I tried to do it for very long.

Sometime after I moved to California, I had a breakthrough - occasionally, I'd briefly get my eyes to align properly as I was going about my everyday business, and the whole world would suddenly snap into 3-D perspective. It was really disorienting the first couple of times it happened, but I soon enough got used to it. 

It's a little like those "magic eye" random-dot stereograms. At first, it takes a while to get the knack of getting your eyes to cross by the right amount. Then suddenly, you get it right, and the image jumps out at you. After that, it gets easier to do. Over the course of several more years, I gradually trained myself to keep my eyes pointed in the same place, such that it's now second-nature.

I did go through an irritating period where the convergence of my vision wasn't 100% correct, but I was starting to pick out more detail with my right eye. That caused some double vision and headaches, from time to time. These days, I only have double vision sometimes at night.

Chapter 5: Closing Thoughts
Well, this is already ridiculously long, so I guess I'll save some of the amusing anecdotes I was originally going to include in here for a follow-up post. Mostly I wanted to get the story down so the folks that have heard me wise-cracking about "now" being able to see in 3-D know what I've been talking about. 

I also hope that if someone with relatively mild Strabismus and/or  Amblyopia comes across this article, they'll be somewhat encouraged by my success in overcoming them, even after having a late start. Everybody's case is going to be different, but personally, I'm glad that I made the effort.

Wednesday, April 22, 2009

Release early, release often...

Six Apps In Six Months - or, Why Mark Can't Schedule
That was the plan, anyway - but I haven't been able to keep myself on track. It's really difficult to release something when you're the only engineer working on it. It's hard to resist the temptation to just keep polishing the thing, or try out some new ideas, until you're well and truly past your milestone. Ah, well.

Beta Test Now Open
In the interest of trying to keep the pipeline flowing, I've just released "The Picture Puzzle Game Without an Interesting Name" to a select group of Beta testers. Since I don't want anyone to miss out on the fun of seeing what you get when I'm forced to release something that I don't think is ready, I'll put a link here to Starchy Tuber's Secret Beta page, where you can sign up to Beta test my latest creation.

If you like puzzle games, or if you're just interested in seeing how the sausage is made, the Starchy Tuber Secret Beta program is the place to be!

I reserve the right to limit Beta signups to the first 100 applicants (ha! as if...).

Grr. I just found a typo on the Beta Sign Up instructions. I'll go fix that...

Wednesday, March 25, 2009

Easter Pictems - a marketing experiment


I'm trying an experiment. There's a free version of Pictems up on the App Store now, loaded with just the subset of items appropriate for Easter.

This version is called "Easter Pictems", appropriately enough, and you can get it here, if you're curious about Pictems, but didn't feel like ponying up the $2.99 to find out whether you liked it.

I'm hoping that folks will download the free version and like it enough to upgrade to the full version. This seems to be a common tactic among developers on the App Store. Of course, people have to find out about your free app if it's to be of any value as a marketing tool. I'll update this post if anything dramatic happens with sales.

In related news, product #2 is coming along nicely. It's a puzzle game, along the lines of the sliding-squares puzzles you might be familiar with, but with a twist (literally, in this case). For this game, the idea of Free and Pay versions makes a lot of sense, so I'm going to release both at the same time. Here's a preview of the (as yet unnamed) puzzle game:

Thursday, March 05, 2009

Obsolescence is a pain in the neck...

I'm trying to clean out some of the unused/unloved technology around the house. An interesting case that I'm currently working on is Yvette's old laptop. She used this thing back in her college days, and it'd be nice to be able to get the data off it (for nostalgic purposes), then send it to the great computer graveyard.

It's an approximately 20-year old NEC DOS-based laptop, with a black-and-white LCD screen, and a massive 20 MB hard drive. It boots and seems to run just fine, a bit of a miracle in itself, but I haven't yet figured out how to get the data off of it.

You'd think that it'd be relatively easy to copy the data off this thing, but:

1. Accessing the floppy drive causes the computer to reboot.

2. Neither the serial port nor the modem are recognized by the communications software installed on the thing, so I can't transfer data that way.

3. This computer is old enough that those (and the printer port) are only external I/O ports - there's no USB, no network port, and no wireless network ability.

I took the thing apart, and discovered that the hard drive in it is actually an IDE drive. Wow - that's almost a current-generation drive technology. I figured I could just get an adapter, and connect the old hard drive directly to a new system. Piece of cake, right? I've already got a Firewire-to-IDE external drive case, so it ought to be just a matter of hooking things up.

Not so fast. They do make a 44-pin to 40 pin adaptor just for connecting laptop 40-pin drives to an IDE connector, and I can connect that adapter to my Firewire-to-IDE external drive enclosure, and the drive spins up on power-up and everything. However, it isn't recognized properly. Apparently the firewire-IDE adapter doesn't work correctly with this drive. If I had to take a guess, I'd guess that the adapter doesn't support IDE drives which don't do DMA transfers.

It's a bit frustrating to have a drive that I know is readable, and have no way to get the data off of it. I'll probably try another IDE bridge and see if it works with this drive, but if that's a bust, I may be in the market for an OLD PC that I can connect the drive to, copy the data off of it, and then recycle.

There may be a trip to Weird Stuff Warehouse in my near future...

Monday, February 16, 2009

Grr. Blogger hates me.

It won't even scale images correctly if I use the "upload image" tool. Oh, well. click the image to see the full comic...

A New Kind of Science meets XKCD

400 pages down, 450 to go. Here's my impression so far, with a little help from xkcd:

Conspiracy Theories



String Theory

Saturday, February 07, 2009

A New Kind Of Science

I'm currently struggling my way through Stephen Wolfram's book A New Kind Of Science. So far, I've made it to about page 200 or so (of 850, not including almost 350 pages of end-notes). I'm not going to review it until (unless?) I've gotten to the end, but so far, I'm not very impressed. This book is really frustrating to read.

For starters, the title of the book ends up getting repeated over and over in the text. It's fairly common when writing about new phenomena or new ideas to assign names to them, for purposes of shorthand if nothing else. But no - phrases like "a new kind of science", or "the new kind of science I've discovered", or "the new kind of science described in this book" appear over and over in the first few chapters. This is really hard to read, and gives the impression of really trying to "sell" the idea that there's some kind of radical new idea here, which, 1/4 of the way in, there is so far no sign of.

It's also really hard to read a book where the author seems to be taking personal credit for well-known results in computer science, without so much as a reference to the work other people have done in the area. There are some references in the end-notes, but the main text doesn't seem to make any kind of distinction between what's new, and what's well-known or borrowed. For someone who isn't familiar with the field, it'd be easy to get the impression that Wolfram invented everything here.

I expected that this book would be fascinating. I've been interested in Cellular Automata since the 80's, and some of the things people have been able to do with the Game Of Life, or the Wireworld CA are pretty amazing. So far, though, there's been a lot of build up for the "big discovery", and some fairly rough-shod introduction to CA theory, but I feel like I'm not making much progress towards any kind of goal.

Yesterday, in an attempt to see whether it's just me that's having a problem with this book, I did a search for reviews of the book. The results were not encouraging.

I'd really like to hear from anybody who has made it all the way through this book. In particular, I'd like to know if I should just skip ahead to the grand conclusion, or slog through the rest of the text.