Why the order of evaluation for expressions involving user variables is undefined?

The order of evaluation of expressions in the select is undefined. For the most part, you only notice this when you have variables, because the errors result in erroneous information. Why? The SQL standard does not require the order of evaluation, so each database is free to decide how to evaluate the expressions. Typically such … Read more

Why is $a + ++$a == 2?

All the answers explaining why you get 2 and not 1 are actually wrong. According to the PHP documentation, mixing + and ++ in this manner is undefined behavior, so you could get either 1 or 2. Switching to a different version of PHP may change the result you get, and it would be just … Read more

Reordering factor gives different results, depending on which packages are loaded

This happens because: gmodels imports gdata gdata creates a new method for reorder.factor Start a clean session. Then: methods(“reorder”) [1] reorder.default* reorder.dendrogram* Now load gdata (or load gmodels, which has the same effect): library(gdata) methods(“reorder”) [1] reorder.default* reorder.dendrogram* reorder.factor Notice there is no masking, since reorder.factor doesn’t exist in base Recreate the problem, but this … Read more

Operator precedence table for the C programming language

Explanation Prec. denotes operator precedence, where group 1 has the highest precedence and group 17 the lowest. Assoc. denotes operator associativity, where such is applicable. Associativity can be either left-to-right or right-to-left. Sources My ambition with this post is to provide a operator precedence table on-site at Stack Overflow, which is correct and canonical. This … Read more