Thread: How much right to I have to copy?

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    204

    Post How much right to I have to copy?

    Let's say I need a algorithm in a particular language that needs to perform a particular task. I find such an algorithm on a university web site. As expected, it is about twenty lines of code. I take the algorithm, change one of two input variables, rename the all the internal variables, rearrange the steps, and modify the output. After all this, my algorithm still bears a similarity to the original. Usually there is more than one way to skin a cat, and I'm not sure weather or not this really counts as a second way. I also can't say for sure that there is a second, more distinctive, way. Is this modified code mine? What does one do when they've searched high and low for something more original, and can't find anything practical?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    It would probably be considered a "derived work", though I am not an expert on such matters. University licenses are usually not very strict. Read the license agreement to see the restrictions on derived works.

    I can tell you in advance what it would mean for you if the license was one of three common licenses.
    • "In the public domain": you can do whatever you want, even take the original code and call it your own.
    • BSD-style license: same as in the public domain, except that you may be required to put the original developer in your credits. (You'd probably want to do that anyway. )
    • GNU GPL (General Public License): you can modify the code and are in fact encouraged to do so, but you must release the modified code under the GPL as well. Basically this means that you have to give the source code to whoever wants it. I put my programs under this license anyway (usually).

    Post a link to the license agreement if you like.

    If the license is too restrictive, find the same code somewhere else under a less restrictive license. [edit] And if you can't do that, contact the original author of the code. They may be willing to give you a break. [/edit]
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Registered User Queatrix's Avatar
    Join Date
    Apr 2005
    Posts
    1,342
    I also put my code under the GPL, In the Public Domain someone can take your code not change one character and copyright it as their own, it's just not right .

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Copyright on a 20-line code snippet seems un-enforceable unless the code itself is somehow a distinct artistic creation (like, obfuscated code). I wouldn't worry about it.

    Also, copyright doesn't cover the problem of "I do this in the same way as he does.", that's a patent issue. In general, it's safe to assume code you pull off of university websites is not patented.
    Callou collei we'll code the way
    Of prime numbers and pings!

  5. #5
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >After all this, my algorithm still bears a similarity to the original.

    Your "algorithm" is the same as the original, textually changing a few things doesn't change the underlying algorithm.


    >Is this modified code mine?

    The short answer is, no. It's like taking someones novel and renaming all the characters, that doesn't make it your book.

  6. #6
    Fear the Reaper...
    Join Date
    Aug 2005
    Location
    Toronto, Ontario, Canada
    Posts
    625
    I think the safe way would be to quote the source. And then say you were inspired by it.
    Teacher: "You connect with Internet Explorer, but what is your browser? You know, Yahoo, Webcrawler...?" It's great to see the educational system moving in the right direction

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    If you understand the algorithm, just rewrite the whole thing from scratch without looking at the other code. If you cannot do that, then you don't understand the algorithm used and you are copying the code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Gcc can't find obvious copy constructor
    By SevenThunders in forum C++ Programming
    Replies: 13
    Last Post: 03-19-2009, 02:41 PM
  2. calling copy constructor from template
    By Ancient Dragon in forum C++ Programming
    Replies: 3
    Last Post: 09-28-2005, 01:54 PM
  3. dynamic memory alloccation & returning objects
    By haditya in forum C++ Programming
    Replies: 8
    Last Post: 04-21-2005, 11:55 PM
  4. Quick ? on copy constructor
    By Traveller in forum C++ Programming
    Replies: 3
    Last Post: 05-03-2002, 10:31 AM
  5. Copy Constructor Help
    By Jubba in forum C++ Programming
    Replies: 2
    Last Post: 11-07-2001, 11:15 AM