Wikipedia:Reference desk/Archives/Computing/2012 July 12

From Wikipedia, the free encyclopedia
Computing desk
< July 11 << Jun | July | Aug >> July 13 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


July 12[edit]

How do I research US law regarding disposition of pirated works? References?[edit]

SHORT VERSION: How do I research US law regarding disposition of purchased pirated tangible works (assuming they haven't been seized by police)?

  • I think the law should be : The buyer must be refunded, and they don't need to return it, and do need to destroy it, and debt incurred for pirated goods (e.g. if no refund can be obtained) is not valid. But I don't know what they are, and I don't know where to start to find out (other than "go to law school" or "consult an attorney").

Computing-related? Well, similar questions seem rather evenly spread between Computing, and Miscellaneous, with a bunch in Entertainment and elswhere... I have done a bunch of work improving some of wikipedia's copyright articles...but I'm stuck.


LONG VERSION:

  • Situation:
  • In the US, a person buys a copy of a copyrighted work (an artist's print, for example) and it's an unauthorized copy (a copy made without the authorization of the copyright holder).

1. (a) Is the person entitled under law to their money back?

  • (b) Do they need to return the work? Destroy it? What can/must they do with it?

2. Note: I think the following question has the same answer as 1 (a), but I'm asking it anyway, in case there's something relevant, though the questions above are more important to me. Question: If the person can't get their money back from the seller, and used a credit card to buy it, are they entitled under law to not pay for it if they file the appropriate dispute with their credit card company (without getting a ding on their credit report for a 'bad debt')? (In other words, I think that iff the answer to 1 (a) is yes, the answer to this question is yes too.)

NOTES:

  • I'm quite familiar with the usual legalities of credit card disputes, chargebacks and the main legislation - FCBA, FCRA, FDCPA, FACTA...
  • I'm also fairly familiar with copyright in general. Assume it's a recent work; copyright expiration is irrelevant.
  • I'd be happy with just a pointer to a secondary source where I'd be able to do further research myself, but, I'm not interested in an answer that doesn't include references of some kind - I want to know what laws exist, not what someone thinks it should be...
  • I think the answersshould be yes, a refund is required, and they don't need to return it, and do need to destroy it, and debt incurred for pirated goods is not valid. But I don't know what they are.

I came close to finding answer in statute.
§ 509. Seizure and forfeiture:
They "may be seized and forfeited to the United States."
Let's assume the pirated goods have not been seized. That's the case I'm most interested in, and I can't find any statute that covers this question. --Elvey (talk) 16:59, 12 July 2012 (UTC)[reply]

In the UK, this would be covered by the Sale of Goods Act where goods must be "as described". Unless it's made clear at the time of purchase that it's an unauthorised copy without the copyright holder's permissions, then it's clearly not "as described" and the purchaser would be entitled to sue for their money back. I don't know US consumer rights, but wonder whether researching general consumer rights might not help? --Phil Holmes (talk) 17:09, 12 July 2012 (UTC)[reply]
I suspect that the answer to this is to be found not in copyright law but in law on fraud (recourse for the person who unwittingly bought stolen goods) and receipt of stolen goods (for disposition of the goods). Just a suggestion/idea. --Mr.98 (talk) 21:20, 12 July 2012 (UTC)[reply]
This source (edited by Elvey: link disabled, as google says the site is spreading malware) says, "In the end, the only individual not liable for infringement in a transaction is the ultimate retail buyer (unless the buyer sells the infringing work)." --jpgordon::==( o ) 21:43, 12 July 2012 (UTC)[reply]
That's interesting. This page regarding software piracy from the US Copyright Office left me with the impression that with the case of software, even the ultimate retail buyer could be liable, since infringement does not require you to be knowingly doing it. ("And if you do buy an illegal backup copy, you will be engaging in copyright infringement if you load that illegal copy onto your computer, i.e., the unauthorized reproduction of the infringing computer program into memory. ... Anyone found to have infringed a copyrighted work may be liable for statutory damages up to $30,000 for each work infringed and, if willful infringement is proven by the copyright owner, that amount may be increased up to $150,000 for each work infringed. "). But just that's my interpretation, not a legal opinion... --Mr.98 (talk) 10:44, 13 July 2012 (UTC)[reply]
Thanks, all! Regarding the last two comments, looks like your sources suggest you're both right; it seems the retail buyer is not liable if it's a tangible work, but is if it's software. It looks like the statutory definition of "reproduction"/"unauthorized reproduction" is key; if it's narrow...

Mr.98: 1(a) is probably partly answerable as you suggested-good point. But piracy isn't theft; the original hasn't been taken from its rightful owner; it's just that copies have been made. So I doubt laws regarding "stolen property" would apply. As far as I can tell, the buyer has no legal obligation to turn in, return or destroy the item.

Whoops - I should have asked this in misc, not computing, as my question is about tangible works, not software. --Elvey (talk) 21:54, 18 July 2012 (UTC)[reply]

C++ Help[edit]

I have just downloaded the latest version of Xcode from Apple's App Store so that I have a compiler for C++ but am confused by part of the setup process. Here, scroll down to "If your Xcode (version 3.2.1 or higher) window does has an iPhone OS option, then try the following." First of all, in my version, there is no 'Command Line Utility' as mentioned in the instructions; there is only 'Command Line Tool' as in the screenshot. Secondly, I can't see how to select C++ stdc++ and this becomes a problem later when, in another document, I am told to create a string with first line 'string s="hello";' and Xcode can't work with this, instead advising me to correct it to 'std::string s="hello"'. Can someone please tell me how to get it right? I'm only just beginning to learn C++ and I'd hate to fall at the first hurdle, i.e. setting it up. Thanks. meromorphic [talk to me] 19:13, 12 July 2012 (UTC)[reply]

Regarding the diff between "Command Line Tool" and "Command Line Utility", I suspect they renamed it at some point in the development process but failed to update all the documentation accordingly. StuRat (talk) 19:24, 12 July 2012 (UTC)[reply]
Don't be discouraged. C++ is widely known as a "platform-specific programming language," and despite decades of effort to standardize it, C++ is still platform-specific. So the example code you see on your school website "might" not work exactly as-is on a different system. On the same note: your "bug" is an issue with the C++ Standard Library: anything that starts with "std" is a member of that library. So, a "std::string" is a standard C++ string, used for storing text, and accessible via standard string utilities.
You can safely use "std::string" - in fact, many programmers consider this to be better practice, because it never assumes that your string is standard unless you say it is. Xcode is trying to help you by not making any assumptions! Many compilers automatically include standard libraries - allowing you to drop the pesky std:: namespace preposition. Many programmers dislike it when the compiler does that sort of thing automatically - it might not be your intent to use the "std" namespace.
So, you have two options: at the top of your file, include the line "using namespace std;" ... or manually prepend std:: before each standard library function or object. Nimur (talk) 19:35, 12 July 2012 (UTC)[reply]
Ah, that's brilliant! Thank you both and especially you Nimur, for your extremely informative reply. meromorphic [talk to me] 19:47, 12 July 2012 (UTC)[reply]
"Many compilers automatically include standard libraries - allowing you to drop the pesky std:: namespace preposition" – this makes no sense. You have to #include <string> if you want to use STL strings, with or without the std:: prefix, and you have to specify "using namespace std" (or "using std::string") if you want to omit the std:: prefix. There may be so-called "C++" implementations that don't require those things, but they aren't really C++. -- BenRG (talk) 20:27, 12 July 2012 (UTC)[reply]
To be fair, the root-cause is often an auto-generated precompiled header that includes standard libraries and namespaces. For example, Microsoft Visual C++ creates an entire set of headers and project configuration files at the start of every project. The novice C++ programmer can not always decipher how many things are going on behind the scenes of an IDE, which is why many teachers prefer to train students without an IDE. Nimur (talk) 21:57, 12 July 2012 (UTC)[reply]

Mysql query help[edit]

Hi Wikipedians,

I've come for help on another SQL task I need a query for, first up I the sample data:

The "cartridge" table

cartridge_id
CART1
CART2
CART...
CART(N)

then the "printers" table

Model Cartridges_which_work
Model A CART2,CART3
Model B CART1,CART3
Model C CART3,CART4
Model Z CART2,CART99

I am looking for a query which will result in something like the following

Cart_id Printers
CART2 Model A,Model Z
CART3 Model A,Model B,Model Z

I am kinda lost, I know that I have to use 'group_concat' and 'join' but I can't quite put my finger on how exactly. Guidance rather than a working example would be much appreciated (still rather new at sql in general)

Thanks in advance great jedis! PrinzPH (talk) 23:55, 12 July 2012 (UTC)[reply]

If this were some other DBMS, I would utilize a table-returning or list-returning function to perform the split, but I don't think you can do that in MySQL. (My searches for MySQL based split functions yielded many results, but none I found produced a multi-row result in a form that could then be fed back into the calling query.) The next best thing appears to be the FIND_IN_SET function (see [1]). This will allow you to match rows from the cartridge table to the printer table. Something like:
	SELECT c.cartridge_id, p.model
	FROM cartridge c
	JOIN printers p ON FIND_IN_SET(c.cartridge_id, p.Cartridges_which_work) > 0
This may not be the most efficient method, but if it works, you should be able to wrap the results up with a GROUP BY and use the group_concat function to get the end results you are looking for. -- Tom N (tcncv) talk/contrib 01:18, 13 July 2012 (UTC)[reply]
I know we're not supposed to, but why is the printers table not even meeting first normal form. Some exercise in masochism? --Tagishsimon (talk) 01:36, 13 July 2012 (UTC)[reply]
This is what I noticed too. If you have the ability to change the schema, you should have only one printer model listed per row. You would have several rows for each cartridge, each containing one printer they are compatible with. This will make it easy to get a table that has the same information you are looking for in the end with just a simple where clause. Formatting it into a list could probably be done with some creative SQL, but would make more sense to do on the software side of things. Database Normalization explains why this change would be a very good thing to do. 209.131.76.183 (talk) 11:57, 13 July 2012 (UTC)[reply]
Indeed. To go further, I'd anticipate you'd have three tables; one listing printers, one listing cartridges, and a link table containing two columns being a foreign key pointer to a printer and a foreign key pointer to a cartridge. --Tagishsimon (talk) 12:27, 13 July 2012 (UTC)[reply]
Oh wow thanks for the replies... I never formally studied SQL so a couple of the concepts you mention are new to me and make a lot of sense. I am trying to streamline our company's database which for the longest time have been kept in excel form which is why it looks like the way it does. I will make the changes to the schema as suggested. I do not have a lot of time to dedicate to learning all the nuances of this, could you guys provide links to the top fundamentals I should know (aside from the Database Normalization and 1NF linked about). Again, thank you very much! PrinzPH (talk) 17:18, 13 July 2012 (UTC)[reply]
Update: Just finished skimming through 1NF, and geez! I never realized how ignorant I was when it came to SQL. Very enlightening PrinzPH (talk) 17:42, 13 July 2012 (UTC)[reply]
And, just to state it explicitly, your "printers" table should look more like this (although I'd name it "PRINTER_CARTRIDGES", if that's all it's designed to tell you):
PRINTER_MODEL CARTRIDGE_ID
Model A CART2
Model A CART3
Model B CART1
Model B CART3
Model C CART3
Model C CART4
Model Z CART2
Model Z CART99
Your simplest SELECT statement would then look like this:
SELECT PC.CARTRIDGE_ID,PC.PRINTER_MODEL
  FROM PRINTER_CARTRIDGES PC
 ORDER BY PC.CARTRIDGE_ID,PC.PRINTER_MODEL;
This would functionally give you what you want, although it doesn't put all printers which use a given cartridge on a single line. Also note that, while we didn't use the CARTRIDGE table in this query, it's still useful to have, in that we can use it to verify that each CARTRIDGE_ID is valid before we enter it into the PRINTER_CARTRIDGES table. Without this, you typically end up with entries like "CART2", "CRTRDG 2", "CART02", "2", "02", "two", "II", "cartridge 2", etc., which makes for a real nightmare. StuRat (talk) 18:50, 13 July 2012 (UTC)[reply]
Much appreciated Stu! :) I have made the changes and things have definitely been easier. Warm regards PrinzPH (talk) 18:56, 16 July 2012 (UTC)[reply]
You're welcome. I will mark this Q resolved. StuRat (talk) 20:11, 16 July 2012 (UTC)[reply]
Resolved