How do I post code questions to Stack Overflow?

I advise you to go through the following link before attempting to post to Stackoverflow (SO) : How do I ask a good question? - Help Center

SO is one of the most restrictive communities when it comes to etiquette and if you do not comply with the rules your question will either be closed, deleted, heavily edited and/or not answered at the very least.

Prepare your question well, be clear about your problem and follow the guide I posted above.

Do not under any circumstance post a snippet of code without explanation of the problem and expectations and with the intention of having it debugged by others.

Finally, be patient, if your question is too specific it might take a while before someone carves out the time to go into the details.