C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 03-31-2007, 03:10 PM   #1
Registered User
 
Join Date: Aug 2005
Posts: 185
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?
thetinman is offline   Reply With Quote
Old 03-31-2007, 03:18 PM   #2
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
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.
dwks is offline   Reply With Quote
Old 04-01-2007, 03:26 PM   #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 .
Queatrix is offline   Reply With Quote
Old 04-02-2007, 09:50 AM   #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!
QuestionC is offline   Reply With Quote
Old 04-02-2007, 09:57 AM   #5
Crazy Fool
 
Perspective's Avatar
 
Join Date: Jan 2003
Location: Canada
Posts: 2,596
>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.
Perspective is offline   Reply With Quote
Old 04-02-2007, 10:14 AM   #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
Happy_Reaper is offline   Reply With Quote
Old 04-02-2007, 10:43 AM   #7
Registered User
 
Join Date: Jan 2005
Posts: 7,251
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.
Daved is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 06:29 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22