Knapsack problem/Unbounded answer in PARI/GP

Hi, I flagged your answer as incorrect, and I will apologise if the name of the flag "incorrect" might have caused offence, but its the name of the flag used on RC when someone thinks that the example given strays too far from the task description and unfortunately might have an impolite handle to the uninitiated.

The problem I saw with your code was that all the output printed were not of the maximal value. It printed the best values so far as it converged to the maximal. I would expect, (and you could check by looking at a few of the other examples outputs), that the only printout should be of one or more (probably one or all four), of the maximal values. It would be good to carry on the conversation on the relevant talk page here. --Paddy3118 05:25, 31 October 2010 (UTC)

Frankly -- and don't take this poorly -- but it did offend me.
The code functioned as intended and as documented. That way is sensible -- if you scale these instances up they could run for hours or days, and getting feedback in that time is useful.
Further, the "fix" is obvious -- don't output, save the appropriate line(s), then output at the end. But this wouldn't add anything to the program, adds clutter, and removes the nice scaling property I mentioned.
If you want to keep it, feel free to "fix" it. I won't, because I think the fixed version is worse.
CRGreathouse 05:29, 31 October 2010 (UTC)
Hi again, I'll take your points and give replies:
  • I explained that no offence was meant. Sorry if it spoilt your RC experience.
  • My points were about getting the code to better fit the task description, and fit in better with the other examples. In this case scale is something that is good enough to do the task given. We do welcome talk of scalability and allow multiple solutions that address any other issues that contributors might want to bring up, but the program was on its own and so I thought it should accomplish the task as output from other examples does. When there are examples in other languages, with output, then it is good to either follow their examples or be aware of and probably explain answers that may be different.
  • The fix may well be obvious but in this case I thought that it should be given. You have shown that you know how to do it, but without the fix being in place I think that you cannot make a fair comparison with other language examples that use brute force but go that bit extra to only print the right answer, rather than a lot of wrong answers followed by the right answer. Other examples use different algorithms to add scalability.
  • I'm afraid I don't write PARI/GP so will not personally be applying a fix (I converted the code to Python and executed the Python to confirm my initial opinion).
I guess we still disagree, but that's life. Thanks for your contributions to RC I do welcome them, as I do value the site and all who contribute. --Paddy3118 06:08, 31 October 2010 (UTC)
It's OK, the problem is fixed as far as I'm concerned. CRGreathouse 06:10, 31 October 2010 (UTC)
That is, the code that bothers you is gone and the template that bothers me is gone. That there is no Pari code for that problem is of no particular consequence. CRGreathouse 06:11, 31 October 2010 (UTC)

Welcome!

(I started the practice of leaving greeting notes in early 2010, so I missed leaving one when you signed up. Anyway, I hope this helps.) Welcome to Rosetta Code! I'm Mike, and I noticed you created an account.

Some quick things you should be aware of:

Template:Mylang Helps you show what languages you're familiar with, and helps us become aware of skills with languages we haven't seen.
Category:Unimplemented tasks by language A place to find tasks missing solutions in various languages.
Blogs, twitter, facebook... We have them, and are interested in yours.
Special:Webchat Logs you into #rosettacode on the Freenode IRC channel. Not usually the most active communications medium, but occasionally helpful. It's logged at http://irclog.perlgeek.de/rosettacode/today.
Rosetta Code:Village Pump A general Q/A and discussion area.
Rosetta Code:Finances For most of Rosetta Code's history, expenses have been paid out of my pocket. I can't afford that much longer, and so you can see the state of Rosetta Code's finances, and how you may help. If you enjoy or are excited about the site, please consider reading through it.

Sorry for the boilerplate; it can be a bit difficult giving an individual greeting to each person. If you post information about your technical interests and background, I'll probably read it. If you already have put that kind of information on your user page, I probably already have; I'm always interested in how people do and can benefit from Rosetta Code.--Michael Mol 12:31, 1 November 2010 (UTC)