Live data from Hacker News

My Code made it to a Hollywood Movie

hackoftheday.securitytube.net

41–50 of 54 posts

Re: My Code made it to a Hollywood Movie

#41
post #4

Previous submission (with 252 points and 91 comments): http://news.ycombinator.com/item?id=5502878

Interesting factoid about the points and comments. I wonder if a resubmission of the same popular post a few months later will gather the same amount of points and comments?

Re: My Code made it to a Hollywood Movie

#42

Hmm, as far as I can tell most of the pointer casts I see there are unnecessary. - ifr_name is cast to char pointer. It's already a char array. - A few memcpy() calls cast their arguments to void pointer. This is just silly. All pointer types implicitly convert to that. This anti-pattern can create bugs with some 64-bit compilers if you fail to declare a function prototype (implicit `int` from undeclared function, ca…

> The file ends in `.c`, but the return type of `malloc` is cast to different pointer types

I was taught this way, and lint used to complain if I didn't. Just because it's legal not to cast doesn't also mean it's bad to cast.

Re: My Code made it to a Hollywood Movie

#43
post #12

Earlier quoted context omitted.

The Internship (2013) http://www.imdb.com/title/tt2234155/ Good and funny movie, and realistic (if you don't mind the Google logo everywhere) Antitrust (2001, also known as "Startup") http://www.imdb.com/title/tt0218817/ Good movie that shows some C, Java and HTML code and also explains "open source". Miguel de Icaza helped them, so you see GNU/Linux desktops and GNOME shell and bash.

"The Internship" is less realistic than you'd think.

It's true. Getting a "cold one" with employees is somewhat common place.

Re: My Code made it to a Hollywood Movie

#44
post #42

Hmm, as far as I can tell most of the pointer casts I see there are unnecessary. - ifr_name is cast to char pointer. It's already a char array. - A few memcpy() calls cast their arguments to void pointer. This is just silly. All pointer types implicitly convert to that. This anti-pattern can create bugs with some 64-bit compilers if you fail to declare a function prototype (implicit `int` from undeclared function, ca…

> The file ends in `.c`, but the return type of `malloc` is cast to different pointer types I was taught this way, and lint used to complain if I didn't. Just because it's legal not to cast doesn't also mean it's bad to cast.

And just because a tool tells you to do it ... I'll let you fill in the rest.

Re: My Code made it to a Hollywood Movie

#45
post #12
post #7

Earlier quoted context omitted.

Actually, do we have a list of good computer movies ? I liked the movie hackers when I was a kid and first came out with Jolie and everything but it's kinda ridiculous and the approach is very hollywood-esque. I found Sneakers to be a great movie. War Games was kinda old to get me involved when I first saw it. Tr0n is unwatchable (at least the latest version). I like the matrix (imho best karate one-on-one fighting s…

The Internship (2013) http://www.imdb.com/title/tt2234155/ Good and funny movie, and realistic (if you don't mind the Google logo everywhere) Antitrust (2001, also known as "Startup") http://www.imdb.com/title/tt0218817/ Good movie that shows some C, Java and HTML code and also explains "open source". Miguel de Icaza helped them, so you see GNU/Linux desktops and GNOME shell and bash.

The Internship has nothing to do with how the internship program at Google works in reality.

Re: My Code made it to a Hollywood Movie

#46
post #14

Does including GPL code in your project (movie) makes this project (movie) GPL too and requires release of all movie source code? (i.e. 3d models, scenes, screenplay, etc.) And if yes, if someone will rebuild whole movie, will it be possible to download binary version of it compiled by some Joe for free?

Unless the GPL license is different from what I read here ( http://www.gnu.org/licenses/gpl.html ) then it does not extend to make the entire film subject to the GPL license. The GPL license only extends to "covered works" (works based on the GPL'd work). If the entire movie was based on the GPL'd work then the GPL could extend to the entire movie and its source assets. For example, if the code of the GPL'd work form…

No, you are interpreting the license text in the wrong context. Covered works in an legal context mean derivative work, as in: "A “derivative work” is a work based upon one or more preexisting works" - United States Copyright Act in 17 U.S.C. § 101

Based upon don't mean "central pillar". If a copyrighted song plays in a movie, it would still count. The song do not need to be a "central pillar" of the movie.

The film could however argue that 1), the small amount of code is not copyrightable, or 2) that they have a permission under fair use.

To answer if something is copyrightable, you have to dig quite deep into case law. Simple pure silence for a set period of time has been granted that status. Its a quite difficult argument to make.

fair use is also a difficult one, since it normally looks down on for-profit exploitation. However, they do look if the market for the original work is "harmed" by the infringement, which in this case is obviously not.

Pressed, the film could be sued and might be found infringing. Had it been 10s of a song, I would say 99% certainty that it would be found infringing. 1 page of a program is less tested in court.

Re: My Code made it to a Hollywood Movie

#47
post #42

Earlier quoted context omitted.

> The file ends in `.c`, but the return type of `malloc` is cast to different pointer types I was taught this way, and lint used to complain if I didn't. Just because it's legal not to cast doesn't also mean it's bad to cast.

And just because a tool tells you to do it ... I'll let you fill in the rest.

...you make the intent clear?

Re: My Code made it to a Hollywood Movie

#48

Earlier quoted context omitted.

And just because a tool tells you to do it ... I'll let you fill in the rest.

...you make the intent clear?

I get the impression from some of these responses that you folks would prefer:

    struct foo *bar = (struct foo*)malloc(sizeof(struct foo));
Over:

    struct foo *bar = malloc(sizeof(*bar));
I suppose the former is more clear by somebody's definition but I am going to continue to consider it somewhat ridiculous.

Re: My Code made it to a Hollywood Movie

#49

The network scanner NMAP has appeared in a lot of movies before. Fyodor has a page on it: http://nmap.org/movies/ . Apparently it even made an appearance in a soft-porn movie...

> Apparently it even made an appearance in a soft-porn movie...

Not surprising, considering that the movie is most likely about penetration.

Re: My Code made it to a Hollywood Movie

#50

Earlier quoted context omitted.

...you make the intent clear?

I get the impression from some of these responses that you folks would prefer: struct foo *bar = (struct foo*)malloc(sizeof(struct foo)); Over: struct foo *bar = malloc(sizeof(*bar)); I suppose the former is more clear by somebody's definition but I am going to continue to consider it somewhat ridiculous.

I do something like this:

    char * buffer = ( char * )malloc( sizeof( char ) * 32 ) ;
Why? because i like to look at my code written that way.

If i code for somebody else's preference,i do it their way,if i code for my own consumption,i code it the way it pleases me.

Post reply on HN