
Amazing Source Code Related Easter Egg in Ex Machina - jgrahamc
http://moviecode.tumblr.com/post/119171520870/in-the-movie-ex-machina-which-is-really-great
======
bd
Murray Shanahan, the author of the book pointed to by this Easter Egg was
actually a scientific consultant for the movie.

Here is reddit AMA with the director of Ex Machina - Alex Garland - and two
scientists that helped him - Adam Rutherford and Murray Shanahan:

[https://www.reddit.com/r/IAmA/comments/35brre/i_am_director_...](https://www.reddit.com/r/IAmA/comments/35brre/i_am_director_ex_machina_writer_director_alex/)

\------

If you are interesting in process / thinking behind the movie, there are also
interesting interviews with Alex Garland:

[https://www.youtube.com/watch?v=TS-
OJHSY8bk](https://www.youtube.com/watch?v=TS-OJHSY8bk) (Q&A with film
journalists)

[https://www.youtube.com/watch?v=tvH-5rBEsgs](https://www.youtube.com/watch?v=tvH-5rBEsgs)
(Talks at Google series)

\------

BTW another Easter Egg: BlueBook, the name of the search engine company in the
movie, comes from Wittgenstein's work:

 _The Blue Book was dictated between 1933 and 1934, and contains certain
themes unaddressed in Wittgenstein 's later works, including deliberations on
thinking as operating with signs._

[https://en.wikipedia.org/wiki/Blue_and_Brown_Books](https://en.wikipedia.org/wiki/Blue_and_Brown_Books)

~~~
FreakLegion
_> BTW another Easter Egg_

Does it count as an easter egg when Ava explicitly states it? While
mispronouncing Wittgenstein's name, no less.

------
moe
That's a funny easter egg.

Sadly I distinctly remember the scene of him "typing" that in as one of the
weakest in this otherwise great movie.

The awful "hollywood rapid-fire typing"[1] stood out like a sore thumb.

[1] [http://hackertyper.net/](http://hackertyper.net/)

~~~
StavrosK
Not to mention the "I'm writing this code to hack this system before the guy
wakes up, but I should still comment it! Someone may have to maintain it."
part.

~~~
kaolinite
For what it's worth, if I'm writing a quick script I'll often write a few
quick comments first (e.g. "Load data from file", "Connect to API", etc)
before I start writing any code, just to plan it out. Similar to how many
people will create a bunch of empty methods when creating a new class, before
fleshing them out.

~~~
StavrosK
If I remember correctly, he was hacker-typing it as he went, top to bottom,
which was a bit funny.

~~~
DennisP
Movies should get vim or emacs experts to type their code, it'd be a lot more
impressive.

~~~
StavrosK
Eh, we still type at an average speed in insert mode :-P

~~~
DennisP
If you're staying in insert mode you don't qualify as a vim expert.

Rapid-fire editing with text objects, dot, macros, column mode, :norm, and so
on ought to work pretty well on screen.

~~~
StavrosK
Yeah, not when you're typing a stream of code.

~~~
DennisP
Well obviously that's not what I'm proposing to show.

------
est
I think this blog is copied from reddit thread

[http://www.reddit.com/r/movies/comments/365f9b/secret_code_i...](http://www.reddit.com/r/movies/comments/365f9b/secret_code_in_ex_machina/)

~~~
jgrahamc
I run the moviecode tumblr linked. Someone submitted it to my tumblr. No idea
if it's the person who wrote that on reddit but I've updated the tumblr to
link back there.

~~~
onion2k
I really enjoy your tumblr. The CSI Cyber bits particularly.

~~~
SSLy
[https://www.reddit.com/r/itsaunixsystem/](https://www.reddit.com/r/itsaunixsystem/)

------
irickt
The author of the book has an essay here that discusses some of the themes:
[http://www.doc.ic.ac.uk/~mpsha/ShanahanJCS2012.pdf](http://www.doc.ic.ac.uk/~mpsha/ShanahanJCS2012.pdf)

And here is a critique: [http://eprints.soton.ac.uk/271843/1/harnad-
shanahan.pdf](http://eprints.soton.ac.uk/271843/1/harnad-shanahan.pdf)

Caution: philosophical zombies ahead.

------
peterjmag
I also like the Android power management stuff in the background:
[https://gist.github.com/peterjmag/eecf0de4bafa19482dd5](https://gist.github.com/peterjmag/eecf0de4bafa19482dd5)

I don't know the context of the scene (haven't seen the movie yet), but maybe
the WakeLock API is a not-so-subtle reference to the robot's sentience? Or
perhaps she just runs Android. =)

------
1S0L4T10N
The author Murray Shanahan has a summary of the book’s central ideas on his
website.

[http://www.doc.ic.ac.uk/~mpsha/KeyThemes.html](http://www.doc.ic.ac.uk/~mpsha/KeyThemes.html)

------
rjzzleep
funny, the first reaction i had when i saw that during the movie was "this is
stupid you'd think a genius like that would try to exploit something smarter
than try to factor prime numbers for crypto". that's almost like guessing
passwords in other hollywood movies.

but i guess the jokes on me...

anyway, has anyone read this book? is it any good?

~~~
matmann2001
My reaction was to the "sys.stdout.write" statement. Who does that?

~~~
eliben
It's actually one alternative to Python 2/3 compatibility, working around the
fact that print is a statement in 2, and just a function in 3.

The more common way is "from __future__ import print_function" of course, but
I've seen code that does sys.stdout.write instead -- nothing wrong about that
(especially if your code usually uses streams for stuff)

~~~
matmann2001
I understand how one might use sys.stdout.write, but the reasons for doing so
are kind of rare. When you're pressed for time to reverse the security
protocols and escape, ensuring backwards/forwards compatibility seems like a
low priority.

~~~
eliben
For sure.

I was just giving a reasoning why such code makes sense at all; I wasn't
trying to defend its usage in the given context :)

------
patman81
The book sounds promising. I'm investigating the author, Murray Shanahan. Here
is a talk the autor gave about the book called "The Possibility of Artificial
Consciousness".

[https://www.youtube.com/watch?v=nT1nArddrE4](https://www.youtube.com/watch?v=nT1nArddrE4)

~~~
meeper16
Is is possible for consciousness to come from non-conciousness or intelligence
to come from non-intelligence?

------
mahranch
SPOILER ALERT - Don't read any further if you have not seen the movie.

I don't know if it was an Easter egg or just coincidence (I'm leaning towards
the former), but one thing that stood out to me was the Japanese girl (Kyoko)
getting her lower jaw knocked off. That's a trope/common theme in Japanese
horror movies. It's been done in 3 different ju-on (grudge) films, 2 scissor
mouth lady movies (scissor lady is an urban legend in japan, like bloody
mary), and a half-dozen other anthology-type movies.

~~~
qubex
I found it oddly symbolic that she is incapacitated by that ‘injury’ despite
explicitly having no capacity to talk. It also strikes me as very significant
that she seems to act out of empathy and compassion for Ava's plight but the
latter, in turn, shows absolutely no empathy for Caleb when she dooms him to
the same fate she herself sought to escape (confinement tinged with the
implication of death).

~~~
threeseed
That last part is truly fascinating. Seems to me that in order for robots to
truly act like humans they need to have equal parts of (a) self awareness and
(b) empathy. If you neglect to make the second part as sophisticated as the
first you will inevitably end up with the situation in the movie.

~~~
rbanffy
It's fascinating, though, that the kind of empathy we need in superhuman
robots is one we ourselves lack. Few of us can empathize with species we
regard as inferior. If they are fundamentally different (as in "having an
exoskeleton") the empathy becomes very rare.

~~~
maroonblazer
>Few of us can empathize with species we regard as inferior.

The large numbers of people who support animal rights would beg to differ.
Plus, there's the whole category of domesticated animals many, many people
arrange their lives around.

Perhaps the greatest superintelligence risk to humanity is not something that
resembles a human but rather a supercute Cockapoo.

~~~
the8472
Cuteness is a huge factor. Few people care about anglerfishes, while panda
babies in a zoo are big news. As i understand it cuteness response is based on
neotenic features, i.e. identifying and protecting babies.

So maybe some people just wish to protect animals that happen to match
patterns that we associate with our own species and not necessarily because
they value an intact ecosystem.

------
iLoch
This is a nice Easter egg. Though seeing that code did momentarily take me out
of the story to cast judgement on the director (as I thought it was a result
of poor research.) So while I love this, I wish they had stuck to something
that fit the context of the story. Great movie though.

------
javajosh
Initial scan read "Amazon Source Code Related Easter Egg in Ex Machina". Which
makes me wonder: how much benefit does Amazon get from sharing a stem with
"Amazing"?

------
Devid2014
Neither the movie nor the code was amazing. Disappointing movie and a simple
price of python code.

------
twiecki
Anyone else notice that the code wasn't PEP8 compatible? ;)

I went ahead and fixed it:
[https://gist.github.com/twiecki/7361de09b8e4c0a6248e](https://gist.github.com/twiecki/7361de09b8e4c0a6248e)

~~~
jsjohnst
What I find more interesting is that you felt the need to point it out and
"correct" it, yet failed to actually do so. In fact, the original did
something, albeit in improper form, from by PEP8 that you omitted entirely.

------
joeyspn
I watched the movie yesterday and I also paused this scene... =) I guess many
people did it, and this guy even took the time to execute the script... At
least is more original than the usual scene with
[http://www.geektyper.com](http://www.geektyper.com) in fullscreen..

BTW, which language is the one in the left window? java?

~~~
ekmartin
No, it's C.

~~~
kruczek
C++ to be precise. I see some objects and method calls.

------
stefantalpalaru
It's nice, but not amazing. Be careful with your praise or there will be
nothing left for the realistic scan and exploit shown in Matrix Reloaded.

