Previous submission (with 252 points and 91 comments): http://news.ycombinator.com/item?id=5502878
My Code made it to a Hollywood Movie
41–50 of 54 posts
Re: My Code made it to a Hollywood Movie
#42Hmm, 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…
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
#43Earlier 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.
Re: My Code made it to a Hollywood Movie
#44Hmm, 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
#45Earlier 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.
Re: My Code made it to a Hollywood Movie
#46Does 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…
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
#47Earlier 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.
Re: My Code made it to a Hollywood Movie
#48Earlier 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?
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
#49The 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...
Not surprising, considering that the movie is most likely about penetration.
Re: My Code made it to a Hollywood Movie
#50Earlier 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.
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.