Earlier quoted context omitted.
What I look at answers on Stack Overflow, the lack of copyright notices on the code makes me feel safe to copy it. Same goes for grabbing code from random person's blog. If they had put explicit copyright notices in the code snippets, I'd assume otherwise.
Your assumptions are likely wrong for those cases. In the case of a random blog, the code likely does not have an associated license, meaning it is copyrighted and any derivative use of it (i.e. copying it) is a violation of their copyright. In the case of stackoverflow, their ToS require people who post code to share it under a Creative Commons license [0]. Unfortunately, if the author of the post didn't realize tha…
Most(*) small snippets of code (e.g., 1-10 lines) on Stack Overflow are probably not copyrightable, at least not under U.S. law. You don't need a license to copy and use something that's not copyrightable.
(*) But not all. As usual, it depends.