Re: Benchmarking sigmoid function between C and D

2018-04-08 Thread Daniel Kozak via Digitalmars-d-learn
I would say he has, becaue AFAIK mir.math.common using LLVM intrinsics On Sat, Apr 7, 2018 at 11:53 PM, Guillaume Piolat via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote: > >> On Saturday, 7 April 2018 at 19

Re: Is std.variant.visit not @nogc?

2018-04-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 9 April 2018 at 03:20:58 UTC, helxi wrote: Is std.variant.visit not @nogc? These error messages REALLY need to be fixed. visit, being a template, is @nogc or not based on the arguments passed to it as well as its own body, so while the error messages point to visit itself, these a

Is std.variant.visit not @nogc?

2018-04-08 Thread helxi via Digitalmars-d-learn
import std.variant, core.stdc.stdio; Algebraic!(T, string) fib_nth(T)(T n) { return n % 15 ? n % 5 ? n % 3 ? Algebraic!(T, string)(n) : Algebraic!(T, string)("Fizz") : Algebraic!(T, string)

Re: Game and GC

2018-04-08 Thread solidstate1991 via Digitalmars-d-learn
On Monday, 9 April 2018 at 01:01:18 UTC, Chris Katko wrote: Why... associative arrays? Wouldn't that become expensive when you hit 1,000s, or 10,000's of objects, for something as tiny as a coordinate (two or three floats) lookup? Well, that's the other reason why I was looking for a different

Re: Checking if a function pointer is set or null

2018-04-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 09, 2018 00:25:08 solidstate1991 via Digitalmars-d-learn wrote: > Would the if(!(myFunctionPointer is null)){} work is I > intended? You can also do if(myFunctionPointer !is null) - Jonathan M Davis

Re: Checking if a function pointer is set or null

2018-04-08 Thread Uknown via Digitalmars-d-learn
On Monday, 9 April 2018 at 00:25:08 UTC, solidstate1991 wrote: Would the if(!(myFunctionPointer is null)){} work is I intended? Yes, that works as you expect https://run.dlang.io/is/ZTtm0P

Re: Game and GC

2018-04-08 Thread Chris Katko via Digitalmars-d-learn
On Monday, 9 April 2018 at 00:25:21 UTC, solidstate1991 wrote: On Saturday, 24 February 2018 at 07:12:21 UTC, Guillaume Piolat wrote: From my experience a combination of the following is necessary: - not having the audio thread registered - using pools aggressively for game entities Also you c

Checking if a function pointer is set or null

2018-04-08 Thread solidstate1991 via Digitalmars-d-learn
Would the if(!(myFunctionPointer is null)){} work is I intended?

Re: Game and GC

2018-04-08 Thread solidstate1991 via Digitalmars-d-learn
On Saturday, 24 February 2018 at 07:12:21 UTC, Guillaume Piolat wrote: From my experience a combination of the following is necessary: - not having the audio thread registered - using pools aggressively for game entities Also you can save a lot of clockcycles if you put @nogc everywhere you do

Re: stirling numbers and multidimensional arrays

2018-04-08 Thread ag0aep6g via Digitalmars-d-learn
On 04/08/2018 06:15 PM, popgen wrote: I am trying to implement some code to calculate Stirling numbers.  The code shown below provides the correct calculation but throws a Segmentation fault: 11 once it is done running. I suspect there is something with the way I am setting up the multidimensio

stirling numbers and multidimensional arrays

2018-04-08 Thread popgen via Digitalmars-d-learn
I am trying to implement some code to calculate Stirling numbers. The code shown below provides the correct calculation but throws a Segmentation fault: 11 once it is done running. I suspect there is something with the way I am setting up the multidimensional array. import std.stdio; impor

Re: toString contains null for struct with function/method

2018-04-08 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 8 April 2018 at 15:04:49 UTC, number wrote: the write() shows a 'null' if the struct has a function/method. why is that? ``` import std.stdio; void main() { struct S { int i; } S s; writeln(s);// S(0) wri

Re: SMTP Mail

2018-04-08 Thread Vino via Digitalmars-d-learn
On Friday, 25 August 2017 at 02:13:42 UTC, Adam D. Ruppe wrote: On Tuesday, 22 August 2017 at 12:52:24 UTC, Vino.B wrote: Request your help on sending Mails, I am able to receive mails with empty body the line "smtp.message ="Example Message" doesn't seem to be working and also please let me

Re: std.datetime.systime: days Deprecation message

2018-04-08 Thread Vino via Digitalmars-d-learn
On Saturday, 7 April 2018 at 18:12:00 UTC, Alex wrote: On Saturday, 7 April 2018 at 17:25:07 UTC, Vino wrote: Hi All, Request your help on the below Deprecation message. import std.datetime.systime: Clock, days, SysTime; void main (int AgeSize) { int AgeSize = 1 auto ct2 = Clock.currTime(),

toString contains null for struct with function/method

2018-04-08 Thread number via Digitalmars-d-learn
the write() shows a 'null' if the struct has a function/method. why is that? ``` import std.stdio; void main() { struct S { int i; } S s; writeln(s);// S(0) writeln(typeid(s).sizeof); // 8 struct S2

Re: HTTP-methods and encoding

2018-04-08 Thread Vindex via Digitalmars-d-learn
On Sunday, 8 April 2018 at 06:51:22 UTC, ikod wrote: On Saturday, 7 April 2018 at 23:54:21 UTC, Vindex wrote: On Saturday, 7 April 2018 at 15:58:14 UTC, Seb wrote: On Saturday, 7 April 2018 at 13:02:39 UTC, Vindex wrote: There is an error on some sites when using HTTP-methods (std.net.curl.get

Re: Benchmarking sigmoid function between C and D

2018-04-08 Thread kinke via Digitalmars-d-learn
On Sunday, 8 April 2018 at 05:35:10 UTC, Arun Chandrasekaran wrote: Did you also generate the bar graph plot using D? Heh nope, I used LibreOffice Calc for that.