What is a “multisorted algebra”, and how do I use it to solve “real problems”?

I believe he was talking about generic programming (he coined the term), whether meant in the context of this talk about the STL, or ‘at large’, in the sense of: programming against a sort of interface that describes something that could fit all (and hopefully several) types (hence multi-sorted), … … provided they have some … Read more

Comparing two values in the form (a + sqrt(b)) as fast as possible?

Here’s a version without sqrt, though I’m not sure whether it is faster than a version which has only one sqrt (it may depend on the distribution of values). Here’s the math (how to remove both sqrts): ad = a2-a1 bd = b2-b1 a1+sqrt(b1) < a2+sqrt(b2) // subtract a1 sqrt(b1) < ad+sqrt(b2) // square it … Read more

Quaternions vs. Euler Angles

Euler angles are more human understandable and also good for decomposing rotations into individual degrees of freedom (for kinematic joints and the like) but have disadvantages like ambiguity and gimbal lock. In practice I would prefer quaternions, as they are easier to compute with (for the computer, not for humans) and more efficient. You have … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)