On 11/02/2017 5:38 PM, WhatMeWorry wrote:
On Saturday, 11 February 2017 at 03:10:35 UTC, WhatMeWorry wrote:
I followed the instructions for derelict.fmod.
// Load the Fmod library.
DerelictFmod.load(); // compiles fine.
// Load the Fmod studio library.
DerelictFmodStudio.load();
but
On Friday, 10 February 2017 at 23:57:18 UTC, bitwise wrote:
https://github.com/dlang/phobos/blob/cd7846eb96ea7d2fa65ccb04b4ca5d5b0d1d4a63/std/experimental/allocator/mallocator.d#L63-L65
Looking at Mallocator, the use of 'shared' doesn't seem correct
to me.
[...]
IIRC you're supposed to use
On Saturday, 11 February 2017 at 03:10:35 UTC, WhatMeWorry wrote:
I followed the instructions for derelict.fmod.
// Load the Fmod library.
DerelictFmod.load(); // compiles fine.
// Load the Fmod studio library.
DerelictFmodStudio.load();
but the Studio load
On Friday, 10 February 2017 at 23:57:18 UTC, bitwise wrote:
https://github.com/dlang/phobos/blob/cd7846eb96ea7d2fa65ccb04b4ca5d5b0d1d4a63/std/experimental/allocator/mallocator.d#L63-L65
Looking at Mallocator, the use of 'shared' doesn't seem correct
to me.
The logic stated in the comment
Hi, everyone.
I have a thread running in Dll. But it always halts because of
access violation exception when GC begins collecting.
This is the thread stack frame in vs2013.
testSendSms.exe!_D4core6thread6Thread9isRunningMFNbNdZb() + 0x1
bytes D
I followed the instructions for derelict.fmod.
// Load the Fmod library.
DerelictFmod.load(); // compiles fine.
// Load the Fmod studio library.
DerelictFmodStudio.load();
but the Studio load ..\common\derelict_libraries.d(122,5): Error:
undefined identifier 'DerelictFmodStudio'
In
On Friday, 10 February 2017 at 15:12:28 UTC, Jonathan M Davis
wrote:
Module-level and static variables all get put in the
executable. So, declaring a static array like that is going to
take up space. A dynamic array would do the same thing if you
gave it a value of that size. The same thing
https://github.com/dlang/phobos/blob/cd7846eb96ea7d2fa65ccb04b4ca5d5b0d1d4a63/std/experimental/allocator/mallocator.d#L63-L65
Looking at Mallocator, the use of 'shared' doesn't seem correct
to me.
The logic stated in the comment above is that 'malloc' is thread
safe, and therefore all
On Friday, 10 February 2017 at 13:33:55 UTC, Bastiaan Veelo wrote:
Thanks, I should have spotted that.
Bastiaan.
No, you don't even have to spot things like that. If you assert()
the result that is. (Not a rant, half of us wouldn't probably
have bothered).
10.02.2017 19:31, Jonathan M Davis via Digitalmars-d-learn пишет:
On Friday, February 10, 2017 19:06:53 drug via Digitalmars-d-learn wrote:
10.02.2017 18:02, Jonathan M Davis via Digitalmars-d-learn пишет:
On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn
wrote:
I found
On Friday, February 10, 2017 19:06:53 drug via Digitalmars-d-learn wrote:
> 10.02.2017 18:02, Jonathan M Davis via Digitalmars-d-learn пишет:
> > On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn
wrote:
> >> I found error - years should start from 1, not 0.
> >> But if months or
10.02.2017 18:02, Jonathan M Davis via Digitalmars-d-learn пишет:
On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn wrote:
I found error - years should start from 1, not 0.
But if months or days start from 0 std.datetime throws exception and
don't for years - it isn't clear
On Friday, February 10, 2017 11:21:48 Bastiaan Veelo via Digitalmars-d-learn
wrote:
> // enum int maxarray = 0;
> enum int maxarray = 2_000_000;
>
> double[maxarray] a, b, c, d;
>
> void main() {}
>
>
> Compiled using "dub build --arch=x86_64 --build=release" on
> Windows (DMD32 D Compiler
On Friday, February 10, 2017 14:35:28 drug via Digitalmars-d-learn wrote:
> I found error - years should start from 1, not 0.
> But if months or days start from 0 std.datetime throws exception and
> don't for years - it isn't clear that zero year is negative one (in that
> mean that stdTime for
On Friday, 10 February 2017 at 12:58:19 UTC, Stefan Koch wrote:
If you want it to modify the array you have to use a ref elem.
If you do you will see that foreach is a little slower.
Thanks, I should have spotted that.
Bastiaan.
On Friday, 10 February 2017 at 12:57:38 UTC, biozic wrote:
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo
wrote:
void foreach_loop()
{
foreach(n, elem; d[])
elem = a[n] * b[n] / c[n];
}
It's fast because the result of the operation (elem) is
On Friday, 10 February 2017 at 13:13:24 UTC, evilrat wrote:
On my machine (AMD FX-8350) actually almost no difference
oops, it skips flags with -run -_-
sorry
dmd loops.d -release
Function 0 took: 16 ╬╝s and 5 hnsecs
Function 1 took: 55 secs, 262 ms, 844 ╬╝s, and 6 hnsecs
Function 2 took:
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo wrote:
Depending on the machine this is run on, for() performs a
factor 3-8 slower than foreach(). Can someone explain this to
me? Or, taking for() as the norm, how can foreach() be so
blazingly fast?
Thanks!
On my machine (AMD
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo wrote:
Benchmarking for() against foreach():
/
enum size_t maxarray = 500_000;
double[maxarray] a, b, c, d;
void main()
{
import std.stdio;
import std.datetime;
import std.random;
for (int n = 0; n <
On Friday, 10 February 2017 at 12:39:50 UTC, Bastiaan Veelo wrote:
void foreach_loop()
{
foreach(n, elem; d[])
elem = a[n] * b[n] / c[n];
}
It's fast because the result of the operation (elem) is discarded
on each iteration, so it is probably optimized away.
Benchmarking for() against foreach():
/
enum size_t maxarray = 500_000;
double[maxarray] a, b, c, d;
void main()
{
import std.stdio;
import std.datetime;
import std.random;
for (int n = 0; n < maxarray; n++)
{
a[n] = uniform01;
b[n] = uniform01;
10.02.2017 14:15, drug пишет:
unittest
{
import std.datetime : SysTime, UTC;
{
auto st = SysTime();
st.timezone(UTC());
long date = st.fromISOExtString("2017-02-10T00:00:00Z").stdTime,
time_of_day =
On Thursday, 9 February 2017 at 23:49:19 UTC, Era Scarecrow wrote:
Other optimizations could be to make it multiple levels,
taking the basic 100 elements and expanding them 2-3 levels
deep in a lookup and having it do it in more or less a single
operation. (100 bytes for 1 level, 10,000 for 2
On Friday, 10 February 2017 at 11:21:48 UTC, Bastiaan Veelo wrote:
// enum int maxarray = 0;
enum int maxarray = 2_000_000;
double[maxarray] a, b, c, d;
void main() {}
Compiled using "dub build --arch=x86_64 --build=release" on
Windows (DMD32 D Compiler v2.073.0), the exe size is 302_592
// enum int maxarray = 0;
enum int maxarray = 2_000_000;
double[maxarray] a, b, c, d;
void main() {}
Compiled using "dub build --arch=x86_64 --build=release" on
Windows (DMD32 D Compiler v2.073.0), the exe size is 302_592
bytes v.s. 64_302_592 bytes, depending on the array length.
Is that
unittest
{
import std.datetime : SysTime, UTC;
{
auto st = SysTime();
st.timezone(UTC());
long date =
st.fromISOExtString("2017-02-10T00:00:00Z").stdTime,
time_of_day =
On Friday, 10 February 2017 at 09:34:39 UTC, berni wrote:
On Friday, 10 February 2017 at 09:25:04 UTC, Daniel Kozak wrote:
Now I tried this with a named instead of a magic constant e.g.
immutable VALUE=-1;
arr.each!"a[]=VALUE";
And it doesn't work anymore. I've no clue, why... Can you
help
On Friday, 10 February 2017 at 09:25:04 UTC, Daniel Kozak wrote:
Now I tried this with a named instead of a magic constant e.g.
immutable VALUE=-1;
arr.each!"a[]=VALUE";
And it doesn't work anymore. I've no clue, why... Can you help
me?
Because it does not see VALUE, you need to use
On Friday, 10 February 2017 at 09:03:16 UTC, berni wrote:
Now I tried this with a named instead of a magic constant e.g.
immutable VALUE=-1;
arr.each!"a[]=VALUE";
And it doesn't work anymore. I've no clue, why... Can you help
me?
each is a template. As per the template documentation
Dne 10.2.2017 v 10:03 berni via Digitalmars-d-learn napsal(a):
On Tuesday, 7 February 2017 at 19:06:22 UTC, berni wrote:
auto arr = uninitializedArray!(int[][])(ROWS,COLS);
arr.each!"a[]=-1";
This looks like what I was looking for. At least I think I understand
what's going on here. The
On Tuesday, 7 February 2017 at 19:06:22 UTC, berni wrote:
auto arr = uninitializedArray!(int[][])(ROWS,COLS);
arr.each!"a[]=-1";
This looks like what I was looking for. At least I think I
understand what's going on here. The other two suggestions are
beyond my scope yet, but I'll come back,
$> dmd Special/special.d Common/common.o Special/special.d(4):
Error: module common is in file 'common.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import
This is not a linker error. It's a compiler error. You need
common.d for
32 matches
Mail list logo