I am wondering if it is appropriate that an Asker answered his own question based on someone's else answer on the same question. It happened to me in this question.
I answered the question and the code worked properly as I tested it on my own data before submitting my answer. The code simply read the raster file and create a centroid point shapefile that has same name of the raster file. The asker mentioned that he had a problem with the code, but the problem is actually in the raster file name - the whole name is numbers (based on his comment), and I advised him that shapefile cannot start with numbers.
Later I found he copied my code and modify it a little bit of less than 10% modification. Then accepted his own answer and users upvote his answer which is actually based on my answer.
Is that action is acceptable? As far as I understand, users who answer questions try to guide the askers to solve their problem, but not to copy the answer and credit it to himself.