That sounds very useful!
July 14, 2025 at 6:27 PM
That sounds very useful!
It's true, although I'd note access modifiers aren't really about "security". Even in .NET they're still a "pretty please", you can still get at them via reflection.
June 23, 2025 at 12:25 PM
It's true, although I'd note access modifiers aren't really about "security". Even in .NET they're still a "pretty please", you can still get at them via reflection.
I'm curious what problem "properties should not exist" solves for you, because that implies that "non static methods should not exist", else people will just write methods "T GetFoo()" and "void SetFoo(T value)" as happened long before auto properties.
April 1, 2025 at 7:49 PM
I'm curious what problem "properties should not exist" solves for you, because that implies that "non static methods should not exist", else people will just write methods "T GetFoo()" and "void SetFoo(T value)" as happened long before auto properties.
That use case makes sense. NB: I made a mistake in my code, the accumulator ought to be seeded by a different prime number than the multiplication, e.g. 23, not zero, to make the outcome appear more random.
March 29, 2025 at 2:25 PM
That use case makes sense. NB: I made a mistake in my code, the accumulator ought to be seeded by a different prime number than the multiplication, e.g. 23, not zero, to make the outcome appear more random.
Also, here's a fiddle with a stable string to int function: dotnetfiddle.net/NHCEHE
It's not optimised, there are faster & better ways to do this if it is a bottleneck in your application or key functionality.
It's not optimised, there are faster & better ways to do this if it is a bottleneck in your application or key functionality.
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
dotnetfiddle.net
March 29, 2025 at 9:36 AM
Also, here's a fiddle with a stable string to int function: dotnetfiddle.net/NHCEHE
It's not optimised, there are faster & better ways to do this if it is a bottleneck in your application or key functionality.
It's not optimised, there are faster & better ways to do this if it is a bottleneck in your application or key functionality.
Here's a fiddle to demonstrate: dotnetfiddle.net/zJMQ3D
Both "runs" have consistent randomisation because the same seed(s) are used.
Both "runs" have consistent randomisation because the same seed(s) are used.
C# Online Compiler | .NET Fiddle
Test your C# code online with .NET Fiddle code editor.
dotnetfiddle.net
March 29, 2025 at 9:17 AM
Here's a fiddle to demonstrate: dotnetfiddle.net/zJMQ3D
Both "runs" have consistent randomisation because the same seed(s) are used.
Both "runs" have consistent randomisation because the same seed(s) are used.
Have you tried seeding a Random object with `var random = new Random(int seed)` and then calling `random.Shuffle()` to shuffle your items? I'm not clear on your need to convert your string to int, although Encoding.UTF8.GetBytes may be a path to what you're after there too.
March 29, 2025 at 9:09 AM
Have you tried seeding a Random object with `var random = new Random(int seed)` and then calling `random.Shuffle()` to shuffle your items? I'm not clear on your need to convert your string to int, although Encoding.UTF8.GetBytes may be a path to what you're after there too.