Perhaps a bit of a strange question.
What if I had designed a new quick, superquick sort and posted the code on DaniWeb first?
Later I could make a scientific article out of my effort.
Would I still be the owner? Or would it be Dani or DaniWeb?
Not a strange question at all, and we got it quite often when the TOS explicitly claimed copyright to any posts made (it doesn't appear to do so any longer).
In the past, ownership of post content was in practice only to absolve us of responsibility for storing, editing, and deleting posts as necessary under the rules, and any IP for purposes of external copyright would still be happily relinquished by Dani and Daniweb LLC. But legally, you'd still need to request it.
Now it's not so clear, but without any claim of copyright, I'd lean toward default ownership of any IP going to the original author being how the law works. That's my interpretation, of course. I'll let Dani confirm or deny my assumptions. ;)
If you are the coder/programmer/author who wrote it, it remains yours no matter where you put it (=website/public display etc) until you sell it. No business/person (DaniWeb LLC, Dani or whoever) can claim ownership of it. Its just illegal.
Unfortunately, it's not just a question of being able to prove ownership. It's also being able to afford to prove ownership. If someone with deep pockets wants it then they can just tie you up in litigation until you are broke. That's why I think that once you've posted the code (the algorithm) you can pretty much say goodbye to ownership.
Any code that is short enough to fit into a post would be devily hard to retain copyright control over anyway, plus algorithms themselves are most likely unpatentable - there haven't been a huge number of cases yet to it's not 100% clear - But algorithms have in the past been deemed unpatentable because they are considered either "laws of nature" or as "abstract concepts/ideas".