I want to contradict most of the answers here (and try to explain why).
Before doing that, I'll say that I personally do attribute SO answers which suggest some code gizmo or idiom, but not because of licensing issues - out of appreciation and gratitude, and as a form of documentation of the voodoo I'll be typing in. I think that's the courteous thing to do.
Quoting Richard Stallman here:
We'll kick out those dirty licenses
Ever more, hackers, ever more.
(*) Of course if you intend to use SE material to pursue your own legalistic IP agenda, e.g. registering patents or whatever - then you're digging your own grave my friend. Also I hope you didn't ask a SO question such as "Can u post teh code of teh Microsoft Windows kernel plz".