Why are Redirect Results not allowed in Child Actions in Asp.net MVC 2

The limitation exists because MVC has already started rendering a view to the client. The effect of redirecting from this point is undefined. It could work perfectly, it could continue rendering the original view without redirecting, it could throw a different exception, etc. Since the result of performing this action is undefined, the framework blocks … Read more

What is the point of interfaces in PHP?

The entire point of interfaces is to give you the flexibility to have your class be forced to implement multiple interfaces, but still not allow multiple inheritance. The issues with inheriting from multiple classes are many and varied and the wikipedia page on it sums them up pretty well. Interfaces are a compromise. Most of … Read more

The recognizing power of “modern” regexes

Pattern Recursion With recursive patterns, you have a form of recursive descent matching. This is fine for a variety of problems, but once you want to actually do recursive descent parsing, you need to insert capture groups here and there, and it is awkward to recover the full parse structure in this way. Damian Conway’s … Read more

Way to go from recursion to iteration

Usually, I replace a recursive algorithm by an iterative algorithm by pushing the parameters that would normally be passed to the recursive function onto a stack. In fact, you are replacing the program stack by one of your own. var stack = []; stack.push(firstObject); // while not empty while (stack.length) { // Pop off end … Read more