Re: formatting a float or double in a string with all significant digits kept

2019-10-08 Thread berni44 via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 20:37:03 UTC, dan wrote: But i would like to be able to do this without knowing the expansion of pi, or writing too much code, especially if there's some d function like writeAllDigits or something similar. You can use the property .dig to get the number of signi

Re: Blog Post #77: Notebook, Part I

2019-10-08 Thread GreatSam4sure via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 10:00:00 UTC, Ron Tarrant wrote: Today starts a new series on the Notebook widget. Over the next few weeks, we'll dig in deep, looking at single-tab and multiple-tab demos, customizing the look of the actual tabs, adding and removing tabs... a whole ton of stuff. S

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 8, 2019 2:42:22 PM MDT mipri via Digitalmars-d-learn wrote: > On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis > > wrote: > > The result of this is that code like > > > > stack.popBack(); > > stack ~= foo; > > stack ~= bar; > > stack.popBack(); > > stack ~= baz; > >

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Oct 08, 2019 at 08:42:22PM +, mipri via Digitalmars-d-learn wrote: > On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis wrote: > > The result of this is that code like > > > > stack.popBack(); > > stack ~= foo; > > stack ~= bar; > > stack.popBack(); > > stack ~= baz; > > > >

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread mipri via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 10:48:45 UTC, Jonathan M Davis wrote: The result of this is that code like stack.popBack(); stack ~= foo; stack ~= bar; stack.popBack(); stack ~= baz; will end up allocating all over the place. Every time you append to the array after shrinking it, you're going to

formatting a float or double in a string with all significant digits kept

2019-10-08 Thread dan via Digitalmars-d-learn
I have a double precision number that i would like to print all significant digits of, but no more than what are actually present in the number. Or more exactly, i want to print the minimum number of digits necessary to recover the original number to within 2 or 3 least significant bits in the

Re: On D's garbage collection

2019-10-08 Thread Max Haughton via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote: I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer

Re: On D's garbage collection

2019-10-08 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 16:43:23 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote: I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instea

Re: On D's garbage collection

2019-10-08 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 16:28:51 UTC, Marcel wrote: I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer

On D's garbage collection

2019-10-08 Thread Marcel via Digitalmars-d-learn
I'm been thinking about using D in conjunction with C11 to develop a set of applications with hard real-time requirements. While initially the goal was to use C++ instead, it has become clear that D's introspection facilities will offer significant advantages. Unfortunately, the project will he

Re: Ranges to deal with corner cases and "random access"

2019-10-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, October 8, 2019 9:40:33 AM MDT Paul Backus via Digitalmars-d- learn wrote: > On Sunday, 6 October 2019 at 20:34:55 UTC, Brett wrote: > > If it can be done and make to work well with ranges it would > > allow many algorithms to be very easily expressed and make > > ranges more powerful.

Re: Ranges to deal with corner cases and "random access"

2019-10-08 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 6 October 2019 at 20:34:55 UTC, Brett wrote: If it can be done and make to work well with ranges it would allow many algorithms to be very easily expressed and make ranges more powerful. You can make it a range by adding an "alias this" to the original array: struct ExtendedArray

Re: DUB mysql-native

2019-10-08 Thread Daniel Kozak via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 14:19:10 UTC, Vino wrote: On Tuesday, 8 October 2019 at 14:02:03 UTC, Vino wrote: On Tuesday, 8 October 2019 at 11:26:24 UTC, Daniel Kozak wrote: [...] Hi Daniel, As stated I have removed those line and ran the below command [...] Hi Daniel, Was able

Re: DUB mysql-native

2019-10-08 Thread Vino via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 14:02:03 UTC, Vino wrote: On Tuesday, 8 October 2019 at 11:26:24 UTC, Daniel Kozak wrote: [...] Hi Daniel, As stated I have removed those line and ran the below command [...] Hi Daniel, Was able to resolve the dub test issue using the you tube video "ht

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread Just Dave via Digitalmars-d-learn
Thanks for the advice. I used a quick and dirty range solution as was suggested. It allowed me to move on as I really wasn't looking to fully implement a queue or stack. Just get something that semantically behaved as such. I'll return later and optimize it with the later suggestions if it's a

Re: DUB mysql-native

2019-10-08 Thread Vino via Digitalmars-d-learn
On Tuesday, 8 October 2019 at 11:26:24 UTC, Daniel Kozak wrote: On Tue, Oct 8, 2019 at 1:15 PM Daniel Kozak wrote: ... It is known issue, you can not use mysql-native right now with anything else than libevent https://github.com/mysql-d/mysql-native/issues/199 Or you can just remove "subConf

Re: DUB mysql-native

2019-10-08 Thread Daniel Kozak via Digitalmars-d-learn
On Tue, Oct 8, 2019 at 1:15 PM Daniel Kozak wrote: > ... > It is known issue, you can not use mysql-native right now with > anything else than libevent > > https://github.com/mysql-d/mysql-native/issues/199 > > Or you can just remove > > "subConfigurations": { > "vibe-d:core": "libevent" > }, > >

Re: DUB mysql-native

2019-10-08 Thread Daniel Kozak via Digitalmars-d-learn
On Tue, Oct 8, 2019 at 10:55 AM Vino via Digitalmars-d-learn wrote: > > Could not resolve configuration for package hub > > From, > Vino.B It is known issue, you can not use mysql-native right now with anything else than libevent https://github.com/mysql-d/mysql-native/issues/199 Or you can jus

Re: Dynamic Arrays as Stack and/or Queue

2019-10-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, October 7, 2019 1:16:31 PM MDT IGotD- via Digitalmars-d-learn wrote: > On Monday, 7 October 2019 at 17:36:09 UTC, Ferhat Kurtulmuş wrote: > >> I'm not talking about memory deletion. I'm talking about push, > >> pop, enqueue, and dequeue behavior. I'd assume in a garbage > >> collected l

Blog Post #77: Notebook, Part I

2019-10-08 Thread Ron Tarrant via Digitalmars-d-learn
Today starts a new series on the Notebook widget. Over the next few weeks, we'll dig in deep, looking at single-tab and multiple-tab demos, customizing the look of the actual tabs, adding and removing tabs... a whole ton of stuff. Sounds like fun, right? Come on over and check it out: https:

DUB mysql-native

2019-10-08 Thread Vino via Digitalmars-d-learn
Hi All, Please correct me what is wrong as I am not able to build a project using dub getting the error "Could not resolve configuration for package hub". dub init HUB C:\Users\userp\Downloads\testhub>dub init HUB Package recipe format (sdl/json) [json]: Name [hub]: Description [A minimal D