I see you've also posted this on StackOverflow, please see our FAQs re. cross-posting (at a minimum, you should always include a link to the other post)
From: FAQ: Is it OK if I cross-post?
- First, avoid cross-posting to other websites.
- If you must, always link to those other posts, and update with any solutions.
Why? - Not doing so is generally considered to be rude - someone might spend their time answering the question on StackOverflow, for example, when it’s already been answered here. And once you have an answer in one place, it's polite to update all of your questions accordingly.