Humor is not allowed on the technical SO sites unless it is made explicit and falls within acceptable humor levels.
The following rules will ensure your humor is clearly indicated. It will minimize negative votes or having your question closed by moderators.
Announce that a joke is eminent or immediately state that what was written was intended to be humor:
"I will take a quick detour from the topic to add some humor."
"All kidding aside"
" Duck! Joke!"
You can also put the word joke within enclosing delimiters using ASCII or ideally UNICODE so that those who use alternative scripts may be aware of your humor. EBCDIC has been deprecated and is not supported.
Emoticons can be used, but given their ambiguity and possible parsing issues with programming language syntax, they are not recommended.
In addition to these rules, always read your humor and ensure the humor level falls within an acceptable range. If your humor causes abdominal pain, it can be flagged and removed by moderators. Please be advised that using a very high level of humor can pose a chocking hazard, since some users may be eating while reading your humor. If you cannot determine the humor level, err on the side of caution and omit the humorous portion.