I know, I know: "Never edit the code, leave it for the review!". But please, hear me out before answering.
What should I do if I encounter a code that doesn't work, but I'm 99.99% sure it's because OP was trying to adapt the code to fit the format of this site?
There are a few situations where this can happen:
- OP has added comments, but on the wrong format, so the code doesn't run
- For instance used
//
instead of#
, or%
in front of comments.
- For instance used
- Some variable names are mixed up, but it's quite clear what the intention is
- A variable is named
Mask
through the entire code, except a few places where it's calledMasque
. It's very likely that this is because OP has translated the variable names from her/his native language so that it's clear for everyone what it means.
- A variable is named
Note:
I've tested the code in the question and it doesn't run as it is. When I make the changes I suggest it runs and produces the same output OP has provided. OP doesn't respond to comments.
Questions:
- Should such a question be closed since it contains broken code?
- Can I edit the question if I'm 99.99% sure my edit is correct, since I've tested it and reproduced OP's results? (I know this goes against the general rule: "Don't edit code! Leave it to the review", but in this case it's not really up for review)
- Should I just leave it be?
The question that made me ask this question: https://codereview.stackexchange.com/questions/126336/inpainting-algorithm-using-conjugate-gradient-for-colored-images-using-matlab#comment257440_126336