views:

88

answers:

3

I find this code useful and want to copy-paste it into my application which is licensed as public domain.

It is the Android blog, they often show useful code snippets.
There is no way to contact the author, and the only license info I can see is "©2008 Google Inc. All rights reserved."

Should I:

  • Stop worrying and just copy-paste?
  • Reimplement it myself without looking?
  • Copy-paste and then make it look different?
  • Any better solution? ...

Is there a rule like "if shorter than 50 lines then no copyright applies" or something?

+3  A: 

The source code for that blog post is on Google Code here: http://code.google.com/p/android-imagedownloader/ It has an Apache 2.0 license.

Frank
Thanks! I can't take code under this license and put it in the public domain. So the answer is no, I can't reuse the code. Or I should license my project under the Apache 2.0 license or GNU-GPLv3 or any other compatible license, but not public domain.
Nicolas Raoul
+1  A: 

Legally you have no right to release google's code in the public domain and you should have a friend who's never seen the code do a clean-room implementation of this functionality or otherwise comply with the terms of the license.

In practice it doesn't matter at all. Stop worrying and do it. The blog is there to teach you some technique. The author would probably be happy that their writing is benefiting someone and is clearly not seeking any kind of compensation for it. It's already out in the open and publicly viewable. You're doing no harm, and the chance that anyone's going to hire a lawyer and come after you, even a company with deep pockets like google, is infinitesimally tiny. Chances are if it's android related, it's apache anyways. Attribute and move on.

At worst, you'll get a C+D and you'll have to solve the problem then. There are really no damages here to be worried about.

blucz
This is bad advice, especially if the code you copied is distributed under a copyleft license that you're not amenable to. If the infringement was ever discovered you would have to publish the entire source code under the license of the snippet you took. It's not uncommon for people to license things under GPL and then blog about them.
imoatama
It's not copyleft. It's apache. All he needs to do is attribute here.
blucz
+1 I should probably stop worrying... "All he needs to do is attribute here" → I don't think so. Public domain means anybody can do whatever they want with the code, I can't enforce an attribution clause to people who will use my code, it would not be public domain anymore.
Nicolas Raoul
Public domain means public domain--it means he claims no copyright rights. It isn't a license, and it doesn't confer rights to anyone else. If someone else incorporated his code, they would be bound by apache attribution as well, but the point is that he would be protected and completely in the bounds of the apache license. All the apache license requires of _him_ is attribution.
blucz
+3  A: 

Frank seems to have answered your main question - the code is available under an Apache license ie you can use it and are free to distribute works containing it under any license you like, provided you include the disclaimer and copyright notice.

I wanted to address the second part of your question:

Is there a rule like "if shorter than 50 lines then no copyright applies" or something?

The short answer is NO. The long answer is, it's complicated, but probably not.

SCO sued over a handful of very-generic-looking lines of code that seemingly made their way into Linux from Unix. Sometimes it was only 2 or 3 lines in a 100+ line file.

Whilst SCO ultimately lost that case, there are precedents for copying extremely small portions of a work being held as a copyright violation. A list of a few can be found on Ben Sheffner's law blog, the most striking being that sampling 2 seconds of audio was found to be infringing [Bridgeport Music, Inc. v. Dimension Films]

imoatama
+1 interesting!
Nicolas Raoul