Re: Performance of tables slower than built in?

2019-05-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 22 May 2019 at 08:25:58 UTC, Basile B. wrote: On Wednesday, 22 May 2019 at 00:22:09 UTC, JS wrote: I am trying to create some fast sin, sinc, and exponential routines to speed up some code by using tables... but it seems it's slower than the function itself?!? [...] Hi, lookup

Re: Performance of tables slower than built in?

2019-05-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 22 May 2019 at 00:22:09 UTC, JS wrote: I am trying to create some fast sin, sinc, and exponential routines to speed up some code by using tables... but it seems it's slower than the function itself?!? [...] Hi, lookup tables ARE faster but the problem you have here, and I'm su

Re: Bitfields

2019-05-22 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2019-05-21 at 18:22 +, Boris-Barboris via Digitalmars-d-learn wrote: […] > > Never used it myself, but BitArray with careful handling of > endianess might fit your task. > > https://dlang.org/phobos/std_bitmanip.html#.BitArray.this.2 > https://dlang.org/phobos/std_bitmanip.html#.peek

Re: Bitfields

2019-05-22 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2019-05-21 at 19:14 +, Era Scarecrow via Digitalmars-d-learn wrote: > […] > I worked on/with bitfields in the past, the limit sizes is more > or less for natural int types that D supports. Rust bitfield crate and it's macros are the same, the underlying type for a bitfield must be

Re: Bitfields

2019-05-22 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 22 May 2019 at 08:54:45 UTC, Russel Winder wrote: On Tue, 2019-05-21 at 19:14 +, Era Scarecrow via Digitalmars-d-learn wrote: […] I worked on/with bitfields in the past, the limit sizes is more or less for natural int types that D supports. Rust bitfield crate and it's

viber.d: How to have dynamic query parameter?

2019-05-22 Thread Anh Huynh via Digitalmars-d-learn
Hi, I need to implement an Rest API that has kind of dynamic query parameter, which is an idea of getting Redis hash's field. I have some redis entries set as below * hmset foo:personA key_a key_b foo bar * hmset foo:personB key_a key_b foo bar The API endpoint looks like this [code] /get_p

DLS server can't install on my pc

2019-05-22 Thread greatsam4sure via Digitalmars-d-learn
I am having some difficulty installing DLS for dlang 1.16.4 the visual studio code plugin for Dlang on my pc-windows 10 Lenovo laptop ci7. it actually install in my ci3 running windows 10. It says this app can't install on this pc. I will be appreciate any help

Re: BetterC + Windows + setjmp longjmp

2019-05-22 Thread Lobachevsky via Digitalmars-d-learn
I have been experimenting with setjmp / longjmp under Windows as a way to break out of an endless loop. With my experiments, longjmp appears to silently exit the process, no stack trace, nothing. Black emptiness. I stared with the C program described in https://docs.microsoft.com/en-us/wind

Re: BetterC + Windows + setjmp longjmp

2019-05-22 Thread kinke via Digitalmars-d-learn
On Wednesday, 22 May 2019 at 16:37:36 UTC, Lobachevsky wrote: I have been experimenting with setjmp / longjmp under Windows as a way to break out of an endless loop. With my experiments, longjmp appears to silently exit the process, no stack trace, nothing. Black emptiness. I don't think br

Why function does not work with delegate

2019-05-22 Thread Alex via Digitalmars-d-learn
In gtkD one can use a lambda directly: X.addOnButtonPress((GdkEventButton* e, Widget w) ... but if I try move the lambda in to a variable so I can use it with multiple handlers, I get an error: // x is a function and does not work auto x = (GdkEventButton* e, Widget w) ... X.a

Re: Why function does not work with delegate

2019-05-22 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 22, 2019 at 10:33:52PM +, Alex via Digitalmars-d-learn wrote: > In gtkD one can use a lambda directly: > > X.addOnButtonPress((GdkEventButton* e, Widget w) ... > > but if I try move the lambda in to a variable so I can use it with > multiple handlers, I get an error: > >

Re: Why function does not work with delegate

2019-05-22 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 22 May 2019 at 22:33:52 UTC, Alex wrote: auto x = (GdkEventButton* e, Widget w) ... X.addOnButtonPress(x); Why is x not a delegate? Because you didn't ask for one and it didn't have to be. Just add the delegate keyword to ask for one: auto x = delegate(GdkEventButton* e

Re: Meson build system user learning D.

2019-05-22 Thread Mike Brockus via Digitalmars-d-learn
On Tuesday, 21 May 2019 at 10:59:40 UTC, Russel Winder wrote: On Tue, 2019-05-21 at 05:21 +, Mike Brockus via Digitalmars-d-learn wrote: […] The solution from Reddit solves the problem for 'dub' but as part of my project C to D I wanted to use Meson and run test with whatever is availabl

Re: Meson build system user learning D.

2019-05-22 Thread Russel Winder via Digitalmars-d-learn
On Thu, 2019-05-23 at 04:21 +, Mike Brockus via Digitalmars-d-learn wrote: > […] > > That is cool that Atila was kind enough to accept the meson.build > file. But how do I use the written meson.build that is > apparently in the subdirectory directory "build"? Just asking > because normal