Hacker News new | past | comments | ask | show | jobs | submit login
Amazing Source Code Related Easter Egg in Ex Machina (moviecode.tumblr.com)
244 points by jgrahamc on May 17, 2015 | hide | past | favorite | 57 comments



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_...

------

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 (Q&A with film journalists)

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


> BTW another Easter Egg

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


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/


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.


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.


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


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


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


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.


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


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


Rapid-fire editing with text objects [...] ought to work pretty well on screen.

I wish they'd just do away with the rapid-fire crap altogether. It breaks the immersion. A mildly witty easter egg does not compensate for making every nerd in the audience of your nerd-movie cringe...

Just show some realistic typing, with mistakes and perhaps a quick copy/paste.


I'm not saying anything extreme, just something realistic for an accomplished vimmer, which is impressive enough and would do the opposite of making nerds cringe.


Edit: Some spoilers maybe in here...

Though I appreciate the fact that it was genuine code, the fact that after a couple of minutes from that scene we discover that Caleb was actually just disabling security locks (basically reversing security measures to unlock doors when power's out instead of locking) right before he went on to talk wit Ava, which seemed a bit weird to me that he needed to write code for, especially some seemingly generic Python code.


I was just impressed that it was actually a programming language and looked like valid Python.


That site just made me laugh out loud.


Ok, that is an awesome web site.


I think this blog is copied from reddit thread

http://www.reddit.com/r/movies/comments/365f9b/secret_code_i...


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.


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



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

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

Caution: philosophical zombies ahead.


I also like the Android power management stuff in the background: 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. =)


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


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?


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


My reaction was:

1) Jeez, who comments their code in a such crisis situation

then,

2) Man, no wonder he got selected. He must be a good programmer


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)


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.


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 :)


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


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


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.


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).


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.


> 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.

They need much more than that. Basically a whole set of moral values[1] that closely align with those of humans.

A bit of a simplified example: If you were to create an AI that maximizes human happiness as a primary goal you might end up with some sort of lotus eater machine with millions of humans in vats, experiencing their happiest moments in an endless loop, supported by drugs that enhance their endorphin release.

Even if an AI were capable to analyze your emotional state and to follow your reasoning it doesn't mean it has to agree with it. Empathy does not prevent you from saying "I understand your pain, but I have more important things to do".

[1] http://wiki.lesswrong.com/wiki/Terminal_value


Note that insofar as lack of empathy goes, Ava might be said to have the same lack of concern for the wellbeing of others as does Nathan, who like her manipulated Caleb for personal aims and like her seemed to be unconcerned about caging other sentient creatures. So it's all very entwined, at least in terms of storyline. Whether it's intentional or not I cannot really say.


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.


>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.


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.


Animal rights supporters are "few of us".


I have a lot of empathy for my bees.


Kyoko generally seemed to have child like levels of self awareness (can't not dance). Stabbing the man she doesn't like makes sense, but locking somebody up requires greater reflection (the ability to predict their actions, knowing Caleb would likely report the escape). It wasn't clear to me how much the two worked together versus merely working in parallel.


Why did Kyoko strip off her skin to reveal herself to be an android then?


So Caleb would have a reason to cut his own skin. That seemed motivated more by "the next scene needs it" than internals.


also, why did Kyoko spill the wine on Caleb, and why did Nathan seem to expect it ? Was it Nathan's idea to have her do that so that he could demonstrate his callousness to Caleb ?


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.


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"?


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


[deleted]


i thought the movie was excellent. random code isn't the point at all. its just an easter egg.


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

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


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.


You missed an = on line 30. You might want to fix that. ;)


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 in fullscreen..

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


No, it's C.


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


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: