Then on Apr 13 '10 at 5:24 the OP answers their own question with code clearly copied straight from the genuine answer. The OP's answer has added or contributed nothing of value. No edits were made to any question or answer so timings are clear, and the OP plagiarized.
That's not a duplicate answer, so I think the accusation of plagiarism is a little too strong. Yes, the OP's answer is based on mosg's original answer, but it's not an exact duplicate. Read the comments on mosg's answer. People shouldn't be discouraged from posting the code that they finally got to work, they should be encouraged to do that.
Whether the OP should have accepted his own answer or not is debatable. Sure, it would have been nice of him to accept mosg's answer as a way of saying thanks, but I don't see anything wrong with accepting your own answer it it contains the version of the code that finally worked as you wanted. This is not rep farming. The OP doesn't gain anything from accepting his own answer. Instead he passed up 2 free reputation points that he could have gotten for accepting someone else's answer. Instead he thought it would be better to accept the answer that he finally got to work. I don't think we should be punishing people for that.