deterministic

Deterministic initialization and dependency injection (constructor based)

My demo application I'm working on has a very long startup routine. The application I'm trying to replace with the new ideas log a lot to the console during that (imagine: "now loading data... reticulating splines... login to third party service..."). After spending the whole day learning DI basically from scratch, I create the whole (!...

LR: Can I make the pseudorandom in LoadRunner deterministic?

There are a couple of sources for random in LoadRunner scenarios: rand () function Random think time deltas (runtime settings) Random pacing time components (runtime settings) Random parameters (as part of the VUGen test) I use those functionalities, and I could live with their pseudorandomness. I cannot, however, live with the fa...

How can I check if a sql query is deterministic?

What I mean by deterministic is that the query will always return exactly the same result set. Is there a way to do this? ...

If sorting records by a number in the record, but some records have the same number, the order is not gauranteed but shouldn't be random?

Let's say if we are sorting some records by a number in record: Name Number_of_Language_Known John 3 Mary 2 Peter 3 Mike 1 ... If we are not also sorting by Name, then the order of John and Peter is not guaranteed, but it shouldn't be random if the records never changed? I think it should be true in most environment (that is, not...

Can UB cause several single-threaded app runs to produce different outputs?

Is it possible for code that meets the following conditions to produce different outputs for each run for the same input? The code is single threaded, though it does link against a thread-safe runtime library. There are no explicit calls to rand() or time() or their friends. There are some heap memory allocations. There might be some...

What does deterministic mean?

I am reading the Java Hashmap documentation but I don't understand this sentence. Note that the iteration order for HashMap is non-deterministic. If you want deterministic iteration, use LinkedHashMap. What does deterministic mean? ...

Mysql query with user-defined-function - why function was called twice?

I have a 1:1 relation between tables Entity and Contact (that corresponds to object 's inherirance). fn_match(id) is UDF which returns boolean and returns true if record matches some special criteria (additional queries inside function). That's a query: select * from Entity a inner join Contact b on a.id = b.id where fn_match(a.i) It ...

Sources of non-determinism

My supposedly deterministic program produces one of a few slightly different outputs on different runs. The input, compiler and computer are unchanging. I'm not sure which output is right because it always looks reasonable. Besides a stray call to rand(), how could this be possible? ...

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

I've done some searching and I think the following code is guaranteed to produce output: B.X = 7 B.X = 0 A.X = 1 A = 1, B = 0 static class B { public static int X = 7; static B() { Console.WriteLine("B.X = " + X); X = A.X; Console.WriteLine("B.X = " + X); } } static class A { public static in...

Property determinism

Is there any way in C# to mark a property as deterministic? The reason I ask is that I often find myself declaring a local variable and reading a property into it, instead of accessing the property multiple times. Is there any way that I can decorate the property as deterministic, such that the compiler could then optimize multiple acc...

Floating point comparison - Result between different runs

I know that I can not compare two floating point or double numbers for absolute equality on C++/C. If for some reason, I write a if condition which uses the absolute equality, is it guaranteed that the if condition will return the same result on different runs of the program for same data? Or it is purely non-deterministic and the result...

If a language (L) is recognized by an n-state NFA, can it also be recognized by a DFA with no more than 2^n states?

I'm thinking so, because the upper bound would be the 2^n, and given that these are both finite machines, the intersection for both the n-state NFA and the DFA with 2^n or less states will be valid. Am I wrong here? ...