Deterministic function in MySQL

From the MySQL 5.0 Reference: Assessment of the nature of a routine is based on the “honesty” of the creator: MySQL does not check that a routine declared DETERMINISTIC is free of statements that produce nondeterministic results. However, misdeclaring a routine might affect results or affect performance. Declaring a nondeterministic routine as DETERMINISTIC might lead … Read more

What is the difference between an Idempotent and a Deterministic function?

In more simple terms: Pure deterministic function: The output is based entirely, and only, on the input values and nothing else: there is no other (hidden) input or state that it relies on to generate its output. There are no side-effects or other output. Impure deterministic function: As with a deterministic function that is a … Read more

Is the order of static class initialization in C# deterministic?

Straight from ECMA-334: 17.4.5.1: “If a static constructor (§17.11) exists in the class, execution of the static field initializers occurs immediately prior to executing that static constructor. Otherwise, the static field initializers are executed at an implementation-dependent time prior to the first use of a static field of that class.” And: 17.11: The execution of … Read more

Does using heap memory (malloc/new) create a non-deterministic program?

In the context of realtime systems, there is more to determinism than a repeatable “execution path”. Another required property is that timing of key events is bounded. In hard realtime systems, an event that occurs outside its allowed time interval (either before the start of that interval, or after the end) represents a system failure. … Read more

Mapping two integers to one, in a unique and deterministic way

Cantor pairing function is really one of the better ones out there considering its simple, fast and space efficient, but there is something even better published at Wolfram by Matthew Szudzik, here. The limitation of Cantor pairing function (relatively) is that the range of encoded results doesn’t always stay within the limits of a 2N … Read more