
Source Code in TV and Films - ColinWright
http://moviecode.tumblr.com/post/72844286142/in-episode-3-of-series-2-of-airwolf-computer
======
varelse
This was from _the best_ episode of that entire series in a rare instance of
the writers not trying to shoehorn a helicopter dogfight into an otherwise
mundane domestic misadventure (assuming you're willing to accept that a
helicopter can fly above the atmosphere and attempt to start WWIII of course).

------
teddyh
Didn’t the same thing happen in Superman III? I seem to recall a computer
display is shown with various advanced-looking outputs and then they also run
a LIST command, which lists a BASIC (or maybe COMAL) program written to…
display various advanced-looking outputs. Using the PRINT statement. Followed
by many individual lines of PRINT "" to make the screen clear.

~~~
blauwbilgorgel
Iron Man (2008) shows that Iron Man boots with the Mozilla JavaScript
documentation. It seems to favor RegExp. Maybe that was shoddy movie research,
maybe we should be glad that Iron Man does not run on W3Schools tutorials,
maybe Jeff Atwood is right when he said: _any application that can be written
in JavaScript, will eventually be written in JavaScript._

~~~
bri3d
The butchered Iron Man suit built in a cave boots with a Lego Mindstorms RCX
IR firmware uploader: [http://deeperdesign.wordpress.com/2010/02/26/is-iron-
man-mad...](http://deeperdesign.wordpress.com/2010/02/26/is-iron-man-made-of-
lego/)

------
egeozcan
This made me remember the code from Vivek Ramachandran being used in the movie
White House Down and him writing a blog post about it including the quirks in
the code[0]

[0]: [http://hackoftheday.securitytube.net/2013/04/my-code-made-
it...](http://hackoftheday.securitytube.net/2013/04/my-code-made-it-to-
hollywood-movie.html)

------
Tloewald
My favorite example is from Terminator, blogged about here (not by me):

[http://www.pagetable.com/?p=64](http://www.pagetable.com/?p=64)

When I first saw the movie I was with a friend who laughed out loud at that
point and said "hey, that's 6502 assembler".

I guess "I know UNIX" from Jurassic Park doesn't count.

------
leephillips
This compendium of source code as decoration is somewhat addictive. Thank you?

------
snake_plissken
Very cool insights.

An aside, I wish Airwolf was as amazing a TV show at age 26 as it was when I
was age 9.

------
rz2k
In case anyone is feeling nostalgic, almost all of the episodes are available
for free streaming on IMDb, including this one s2e3 "Moffett's Ghost"

[http://www.imdb.com/title/tt0086662/episodes?season=2](http://www.imdb.com/title/tt0086662/episodes?season=2)

------
obituary_latte
When I was a kid, I wanted hair like Stringfellow Hawke so bad. I don't feel
the same way now after reading this and learning he can't read hex :(

------
notatoad
The overzealous headline-fixer strikes again. I can't remember what it was
this morning, but it was better than this. The name of the blog an article is
posted on is not an accurate or useful headline when the link only references
a single article on that blog.

~~~
ColinWright
Original title was:

    
    
        Source Code in TV and Films: There's
        a bug in AirWolf's code ...
    

As you say, better than the generic title now.

I can understand why the moderators change a lot of the titles, I really can.
And I can understand that it's potentially too time consuming to vet every
single title that gets submitted, and hence it kind of needs to be automatic.
But I really can't help thinking that on a forum called " _Hacker_ News" there
would be some kind of hack that says: Hang on, this is clearly adding
something to the original title - maybe it's reasonable to allow that.

------
tricolon
FYI this tumblr is run by HN's own John Graham-Cumming (jgrahamc). Previous
discussion:
[https://news.ycombinator.com/item?id=7006317](https://news.ycombinator.com/item?id=7006317)

------
return0
The programmer should have traveled in time to read this:
[http://msdn.microsoft.com/en-
us/library/ms233801.aspx](http://msdn.microsoft.com/en-
us/library/ms233801.aspx)

~~~
ColinWright
Why? They are getting the indexing right. What's wrong is generating a random
number from 1 to 16 inclusive. They use RND(1) to generate a random float from
0 to 1, including 0, not including 1. They multiply by 15 (that's the mistake)
to get a random float from 0 to 15, not including 15. They use INT to round
down to get an INT from 0 to 14 inclusive, then add 1.

That gives them an INT from 1 to 15 (inclusive) to access the list of digits.

The mistake is they want an INT from 1 to 16, so they should have multiplied
by 16.

Your link is to a page that talks about the difference between MID, which
indexes from 1, and substring, which indexes from 0. Indexing from 1 is not
the error, so I don't see why your link is relevant.

------
elwell
Pair-programming at its finest:
[http://www.youtube.com/watch?v=u8qgehH3kEQ](http://www.youtube.com/watch?v=u8qgehH3kEQ)

------
sixothree
The show Revolution uses source code from some open source computer vision
projects and Prince of Persia if I remember correctly.

------
return0
Another interesting trivia would be to figure out what actors are typing when
they type on keyboards vs what we see on screen.

------
coin
-1 for disabling pinchzoom on mobile devices. Why disable useful functionality?

------
raldi
Any guesses as to what the subroutine on line 1000 does?

~~~
rootbear
I think it might have to do with formatting the displayed output. There are
nine columns in the display and the loop at line 45 puts nine values into L$.
But why the GOSUB only occurs when I is 9 or 16 isn't clear.

~~~
derekp7
Actually it is an old school delay loop -- it runs an empty loop from 1 to
200, which on the old computers would take some significant fraction of a
second. This adds a slight delay after printing each line. Proper programming
would call a sleep or usleep function, of course.

~~~
raldi
Oh, when I looked at this earlier, the second page of code wasn't there, so we
had to guess what line 1000 looked like. I see the page has been updated (or
my browser got its act together).

------
gmrple
He is not right either... 15 is 0xF. 16 is 0x10.

~~~
fr0sty
He is correct, that the value 16 given to MID$ as a 'start' will yield an "F"
because the 'start' argument to the MID$ function is one-based.

This is the string:

    
    
         A$ = "0123456789ABCDEF"
    

And calling the function will give you: MID$ (A$,1,1) => "0" ... MID$
(A$,15,1) => "E" MID$ (A$,16,1) => "F"

MID$ (

~~~
Falling3
Ah, thanks! I was scratching my head on that one...

------
brainburn
Assuming of course the programmer wanted to output an F.

~~~
Angostura
Since A$ contains an F, it seems like a reasonable assumption that it was
expected in the output.

