February 24, 2003
Unmanned Aerial President Crashes on Korean Peninsula

March 8, 2041

WASHINGTON DC--Citing what Northrop Grumman engineers have identified as a flaw in specially designed navigation software, spokespeople for the Presidential Cabinet confirmed late Wednesday that the 53rd President of the United States, the first entirely autonomous, mechanical, airborne leader in the western world, has crashed and is likely unrecoverable. "This is a black day for America," noted a solemn administration spokeswoman. "But it may also be a day of great courage. The American people took a great leap forward when they elected [the President]; may we not now retreat from that great vision."

The President, widely known by his Northrop development codename "Skipper," was reportedly surveilling the former Korean De-Militarized Zone when a software flaw led him to "invert" positioning data he received from a network of satellites and ground-based antennae. "Though specific details of the mishap are certainly classified, we can say that a sudden, systematic mis-transformation of positioning data lead the President to believe that up was down and down was up," explains an unidentified Northrop engineer. "He lost compass and got locked into a fatal feedback flightpath. The closer he got to the ground, the higher he tried to fly, bringing him closer to the ground until he crashed at an apparently high velocity."

A controversial figure since his election last year, President Skipper gained the confidence of the American people after taking quick, decisive action against a rogue satellite many feared equipped with legacy nuclear weapons. "Nothing beats a President capable of extra-atmospheric sorties with his own air-to-air missiles," boasts Admiral Wayne Nubbs, head of the U.S. Joint Chiefs. "He's got high-powered lasers mounted right on his head. No traditional leader can compete with that."

Though popular for his daring, low-orbit exploits and courageous penetration of foreign, hostile airspace, the President faced mounting pressure at home to reign in military spending and address perennial domestic problems. "Skipper faced some understandable skepticism when it came to military spending," opines Katherine Zahone, Executive Director of the non-partisan BudgetScope. "Though he was elected by the American people, he was built by major military contractors. That was a real political liability, no question about it."

Scheduled to be sworn in over the weekend, the Vice President, codenamed "Little Boy," though little-used over the past year, is reportedly prepared to assume official Presidential duties. "It's true he hasn't seen much action," noted a Northrop engineer during a January New York Times interview. "To be frank, we've basically been using him to make toast and heat up coffee. But he's got every capability that the Skipper's got. With 45 minutes' notice we can scramble the Cabinet and he can be airborne with the latest intelligence and a full payload."

link

Posted by Brian Stefans at February 24, 2003 08:18 PM
Comments

Let's see an example by converting our favoriteNumber variable from a stack variable to a heap variable. The first thing we'll do is find the project we've been working on and open it up in Project Builder. In the file, we'll start right at the top and work our way down. Under the line:

Posted by: Elizabeth on January 19, 2004 12:53 AM

For this program, it was a bit of overkill. It's a lot of overkill, actually. There's usually no need to store integers in the Heap, unless you're making a whole lot of them. But even in this simpler form, it gives us a little bit more flexibility than we had before, in that we can create and destroy variables as we need, without having to worry about the Stack. It also demonstrates a new variable type, the pointer, which you will use extensively throughout your programming. And it is a pattern that is ubiquitous in Cocoa, so it is a pattern you will need to understand, even though Cocoa makes it much more transparent than it is here.

Posted by: Charity on January 19, 2004 12:53 AM

The rest of our conversion follows a similar vein. Instead of going through line by line, let's just compare end results: when the transition is complete, the code that used to read:

Posted by: Martha on January 19, 2004 12:53 AM

Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.

Posted by: Salamon on January 19, 2004 12:54 AM

We can see an example of this in our code we've written so far. In each function's block, we declare variables that hold our data. When each function ends, the variables within are disposed of, and the space they were using is given back to the computer to use. The variables live in the blocks of conditionals and loops we write, but they don't cascade into functions we call, because those aren't sub-blocks, but different sections of code entirely. Every variable we've written has a well-defined lifetime of one function.

Posted by: Effemia on January 19, 2004 12:54 AM
-->