On Monday, 29 April 2019 at 14:38:54 UTC, 9il wrote:
On Saturday, 27 April 2019 at 22:25:58 UTC, Ferhat Kurtulmuş
wrote:
[...]
Hello Ferhat,
You can use RCArray!T or Slice!(RCI!T) [1, 2] as common thread
safe @nogc types for D and C++ code.
See also integration C++ example [3] and C++ heade
On Sat, Apr 27, 2019 at 2:55 AM Andre Pany via Digitalmars-d-learn
wrote:
>
> On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm
> wrote:
> > Hello.
> >
> > Is there a current "Best Practices" for logging in D?
> >
> > For the actual logging, I know of `std.experimental.logger`.
> > Ho
On Monday, 29 April 2019 at 14:39:29 UTC, rikki cattermole wrote:
float f = uniform01();
Its already initialized on module load.
If you do want to custom seed it, you'll probably want to cast
the seed to uint instead and have your own instance of the
random number generator.
On Monday, 29 A
On Monday, 29 April 2019 at 14:36:49 UTC, number wrote:
And how to use the d libs instead? is this the way to go?
```
Random rnd = Random(Clock.currTime().second);
uniform01(rnd); //(or whatever)
```
https://dlang.org/phobos/std_random.html#unpredictableSeed
How to call srand() with time()?
```
void main()
{
import core.stdc.stdlib : rand, srand;
import core.stdc.time : time;
srand(time(null));
}
```
Error: function core.stdc.stdlib.srand(uint seed) is not callable
using argument types (long)
cannot pass argument time(null) of type long
On Saturday, 27 April 2019 at 22:25:58 UTC, Ferhat Kurtulmuş
wrote:
Hi,
I am wrapping some C++ code for my personal project (opencvd),
and I am creating so many array pointers at cpp side and
containing them in structs. I want to learn if I am leaking
memory like crazy, although I am not faci
float f = uniform01();
Its already initialized on module load.
If you do want to custom seed it, you'll probably want to cast the seed
to uint instead and have your own instance of the random number generator.
On Monday, 29 April 2019 at 00:53:34 UTC, Paul Backus wrote:
On Sunday, 28 April 2019 at 23:10:24 UTC, Ferhat Kurtulmuş
wrote:
You are right. I am rewriting the things using mallocs, and
will use core.stdc.stdlib.free on d side. I am not sure if I
can use core.stdc.stdlib.free to destroy arrays
fwrite, fputc - that's missing C library.