I have asked this question first on Stack Overflow but then someone said it's off-topic and I should ask it on Code Review. Now on Code Review the question seems is again off-topic. Where should I ask it after all?
Addressing your comment to this question here on MSO:
The problem about writing code on Code Review that doesn't originate from you is that on Stack Exchange, all content is licensed under a Creative Commons license. Writing code on a Stack Exchange site that isn't yours is problematic since you are not legally allowed to do that. You don't own the licensing of that code.
Therefore, it is not so much about us not being helpful, it is about us trying to protect you - legally speaking.
This topic has also been brought up on Code Review's meta site: Why is only my own written code on-topic?
What is the question ?
It is a code review. So it doesn't belong to Stack Overflow. They were right to point you to Code Review.
Does it belong on Code Review now ?
No it doesn't. Why ?
From the Help Center
Since it is not your code, it doesn't.
I think the comments are pretty clear about what the issue is with the post.