See this answer for what I think of "How to do X in Y" questions. To quote:
Ideally, algorithms, ideas and approaches should be first and foremost and not code in language X. I mean, the answerer can use whatever language they feel they're comfortable in (e.g., the river detection question had answers in MATLAB, python and Mathematica), but the focus of the question should not be an explicit "give be the codez in X". Questions like show me how in any language and I'll work it out myself are also most welcome here.
Explicit requests for code in language X should be off-topic. The primary reason for not allowing questions that simply want code in X is because then we'll get overrun by which ever language is most commonly used in the particular field, and other folks who are more inclined towards theory and algorithm development part of it might be put off and leave. I can easily see MATLAB/openCV questions just flooding us if we opened the gates (in fact, we get a few such questions which you don't see because they are either promptly migrated or nuked right here).
However, Jonas had a point that it should be OK for users to present their problem (with code if necessary) in whatever language they're using, as long as the approach is clear from their code (i.e., no brainfuck or golfscript like code). Further more, there will be no guarantees of an answer in that particular language, i.e., if someone knows a good algorithm and explains it via Mathematica/MATLAB/python for an OpenCV question, then it should be fine. It's up to the OP to translate it (they can always go to Stack Overflow for help with that). I think this is a very reasonable position and will help foster a language-agnostic culture, instead of the language-free culture we've been having up until now. Some examples of good, recent questions like this are:
In both cases, the OP was looking for a solution in a particular language, but were both happy to learn of a possible approaches in different languages and I presume, are working on translating whatever helped.
Coming to your examples, the first question should not have been asked here. It was originally asked on Stack Overflow, and Endolith, a good contributor to this site recommended dsp.se. However, I won't fault him for that, because the SO version looked more like a conceptual question, which would've been a good fit, whereas the OP decided to dump his code here. The answer barely passes the minimum characters required. I'll ship it back to SO sometime soon.
The second one though, is very much on-topic. Note the last line: "The result inverse contains complex values, that confuses me." That is the crux of the question. The rest is just to support the story. It is clear that the problem is a conceptual one and the OP merely provided his code to guide the question and perhaps confirm if his problem is with the code or with his understanding. These are actually the kind of questions that would be very interesting on this site. Couple of others with code/language in the question, but has a theoretical/conceptual answer is