tags:

views:

78

answers:

4

I have an open source project under Apache License 2.0. Normally, I would just include the License Terms and Conditions comment at the top of each code file.

What about code that I copied from someone's blog, or website? Is putting a link referring to the site enough? And I still leave the License Terms and Conditions there even though the code was written by someone else?

What's the proper way of doing this?

+7  A: 

You can't relicense code that isn't yours as you don't own the copyright. If the code is already under a license you must use that, and provide that license as part of your package.

If the code isn't under a license then personally I'd look for an alternative piece of code which is licensed under the Apache license, obviously retaining the copyright statement in the code, and note the source and copyright it in the documentation for your project.

If you can't do that why not email the code author asking if they'd state a license for it? If they choose a license different to yours then you should make it clear that piece of code is under a different license in both the code itself and your documentation.

(Of course I am not a lawyer, nor do I play one on TV, and as licensing is a legal agreement you should consult one rather than take advice from random strangers on the internet)

blowdart
That depends on how the code you take was licensed. Many of the "permissive" licenses allow you to do anything you like with the code, including re-license it.
anon
Of course it depends on the license MS-Pl doesn't, Creative Commons doesn't. BSD is an interesting one - there was an outcry when some Linux folks lifted a BSD networking piece and relicensed it under the GPL before including it in the kernel - within the license rules, but not in keeping with the spirit because NetBSD couldn't take the changes back.
blowdart
can I re-write code and use it as mine?
01
I guess it depends what the code does. If it's an implementation of a well known algorithm then sure. If by rewrite all you're doing is changing variable names then no, probably not. If you use the sample as inspiration, through it away and reimplement the functionality without using the original code that's probably ok. Probably. These things take lawyers to figure out.
blowdart
Ok, so for a http://creativecommons.org/licenses/by/2.5/, it would be fine to include it and reference the link?
seanlinmt
It allows sharing and "remixing" so yes, you could take that code and include it in your project as long as you acknowledge the source and put the lifted code under that license. If you rewrite it the decent thing to do is still acknowledge the source.
blowdart
+5  A: 

Don't copy a code from a blog unless it is explicitely Public Domain or under a compatible license.

If it is under compatible license you just mention it at the license header at the top of the relevant file. (and also include a clause into your about dialog) This last bit might not be required by certain licenses, but is still a good way to say thanks.

EFraim
+5  A: 

What about code that I copied from someone's blog, or website? Is putting a link referring to the site enough?

IANAL, but you can not go about altering peoples license without getting permission from them. If the code you copied from the blog is under a conflicting license to Apache you can not include it in your project. There is a fair use argument, but its pretty slippery (Eg. I just copied something so small that it really needs no attribution).

So, I would recommend you read all the fine print on the blog you copied the sample from, and if you have any doubts shoot off an email to the author explaining what you are doing. In general people are fine with a hyperlink to their blog post in the source, but every person is allowed to license their IP under whatever license they choose.

Sam Saffron
+1  A: 

I see this as a serious problem, in that anything that is out there without an explicit license may as well not be out there. For example, I can't find any mention of what license is required on http://snippets.dzone.com/. I come across this site frequently in searches. They claim to be a "public source code repository", but what's "public" mean?

Similarly on gist.github.com, though there people seem to be a bit better about putting an explicit license in their files.

You, as a user of these sites with a piece of code you'd like to use in front of you, can't solve this problem. In an ideal world, the developer submitting something would include an explicit license, but that seems unlikely. The best we can reasonably hope for is for these kinds of sites to force users to choose a license when pasting anything.

In most cases, these snippets aren't significant enough to have any commercial value or to warrant any restrictive licensing, but without an affirmative action on the part of the person submitting, it remains theirs, with all rights reserved other than those that have been explicitly granted to others.

Kevin Peterson