Re: Create object from a library's Class returns Null

2019-05-28 Thread dangbinghoo via Digitalmars-d-learn
On Wednesday, 29 May 2019 at 05:04:54 UTC, dangbinghoo wrote: On Wednesday, 29 May 2019 at 02:42:23 UTC, Adam D. Ruppe wrote: Object.factory is pretty unreliable and has few supporters among the developers. I wouldn't suggest relying on it and instead building your own factory functions. oh,

Re: Create object from a library's Class returns Null

2019-05-28 Thread dangbinghoo via Digitalmars-d-learn
On Wednesday, 29 May 2019 at 02:42:23 UTC, Adam D. Ruppe wrote: Object.factory is pretty unreliable and has few supporters among the developers. I wouldn't suggest relying on it and instead building your own factory functions. oh, that's bad news, but the hibernated library is using this

Re: Create object from a library's Class returns Null

2019-05-28 Thread Adam D. Ruppe via Digitalmars-d-learn
Object.factory is pretty unreliable and has few supporters among the developers. I wouldn't suggest relying on it and instead building your own factory functions.

Re: Create object from a library's Class returns Null

2019-05-28 Thread dangbinghoo via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 14:24:30 UTC, dangbinghoo wrote: On Tuesday, 28 May 2019 at 14:16:44 UTC, Nick Treleaven wrote: On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote: yeah, I made a typo mistake in the forum post, but the code in github repo is really with no typo problem.

Re: How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread Mike Brockus via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 18:13:17 UTC, GoaLitiuM wrote: On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote: How can I structure a Meson build project in D to use dub as a method for dependencies like urld, d2sqlite or unit-threaded? If that is not what Meson users of D do then what

Re: Reuse/reset dynamic rectangular array?

2019-05-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/28/19 4:58 PM, Robert M. Münch wrote: On 2019-05-28 01:52:28 +, 9il said: myRectData[] = null; :-/ Ok... doesn't look to complicated ;-) Still learning a lot about D... Keep in mind, this does not reuse the allocated arrays, it simply resets them to point at nothing (and will

Re: Reuse/reset dynamic rectangular array?

2019-05-28 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-28 01:52:28 +, 9il said: myRectData[] = null; :-/ Ok... doesn't look to complicated ;-) Still learning a lot about D... -- Robert M. Münch http://www.saphirion.com smarter | better | faster

Re: Blog Post #0039 - File Dialog V - Adding SaveAs and Titlebar Filename Reflection

2019-05-28 Thread Ron Tarrant via Digitalmars-d-learn
Hi WebFreak. I'm glad you're getting something out of it. I started this because it's the kind of thing I wished was out there. It's good to know I'm not the only one. On Tuesday, 28 May 2019 at 12:58:12 UTC, WebFreak001 wrote: Could you maybe add screenshots to each blog post? I've had a

Re: 1 - 17 ms, 553 ╬╝s, and 1 hnsec

2019-05-28 Thread KnightMare via Digitalmars-d-learn
Why not simply 17.5531 ms ("%.4f ms") to get rid of the non-ASCII µ prefix? fwiw I like this solution for the output. It is very clear to me. +1 and without space 17.5531ms

Re: How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread GoaLitiuM via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 18:13:17 UTC, GoaLitiuM wrote: On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote: How can I structure a Meson build project in D to use dub as a method for dependencies like urld, d2sqlite or unit-threaded? If that is not what Meson users of D do then what

Re: How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread GoaLitiuM via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 18:11:09 UTC, Mike Brockus wrote: How can I structure a Meson build project in D to use dub as a method for dependencies like urld, d2sqlite or unit-threaded? If that is not what Meson users of D do then what is the pure Meson of things way? C

How can I structure a Meson build project in D to use DUB.

2019-05-28 Thread Mike Brockus via Digitalmars-d-learn
How can I structure a Meson build project in D to use dub as a method for dependencies like urld, d2sqlite or unit-threaded? If that is not what Meson users of D do then what is the pure Meson of things way? C https://github.com/squidfarts/c-example D https://github.com/squidfarts/d-example

Re: [TWiD] static foreach loop variable

2019-05-28 Thread Nick Treleaven via Digitalmars-d-learn
Ok, thanks for explaining. Nice idea.

Re: [TWiD] static foreach loop variable

2019-05-28 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 13:43:45 UTC, Nick Treleaven wrote: Hi, Last week's TWiD had a tip that didn't make sense: http://dpldocs.info/this-week-in-d/Blog.Posted_2019_05_20.html#tip-of-the-week template Locals(int i) { alias Whatever = int; } static foreach(i; [1, 2, 3]) {

Re: Create object from a library's Class returns Null

2019-05-28 Thread dangbinghoo via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 14:16:44 UTC, Nick Treleaven wrote: On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote: class NSconf { String name; ... } Does this class have a non-default constructor? yes, I didn't provide constructor, as Class will have a

Re: Create object from a library's Class returns Null

2019-05-28 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote: class NSconf { String name; ... } Does this class have a non-default constructor?

Re: Create object from a library's Class returns Null

2019-05-28 Thread Nick Treleaven via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote: writeln(Object.factory("gwlib.entity.nsconf.NSConf")); Typo, should be NSconf.

[TWiD] static foreach loop variable

2019-05-28 Thread Nick Treleaven via Digitalmars-d-learn
Hi, Last week's TWiD had a tip that didn't make sense: http://dpldocs.info/this-week-in-d/Blog.Posted_2019_05_20.html#tip-of-the-week template Locals(int i) { alias Whatever = int; } static foreach(i; [1, 2, 3]) { Locals!i.Whatever; } The body is just `int;`. Not sure how to reach Adam.

Re: Blog Post #0039 - File Dialog V - Adding SaveAs and Titlebar Filename Reflection

2019-05-28 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 09:47:23 UTC, Ron Tarrant wrote: Good day to you all. 'Tis another Tuesday and time for a new blog post. This is a continuation of the series on Dialogs and further, a continuation of the mini-series-within-a-series on file Dialogs. The subject is in the title as

Blog Post #0039 - File Dialog V - Adding SaveAs and Titlebar Filename Reflection

2019-05-28 Thread Ron Tarrant via Digitalmars-d-learn
Good day to you all. 'Tis another Tuesday and time for a new blog post. This is a continuation of the series on Dialogs and further, a continuation of the mini-series-within-a-series on file Dialogs. The subject is in the title as is fitting for a blog post about putting things in the

Create object from a library's Class returns Null

2019-05-28 Thread dangbinghoo via Digitalmars-d-learn
hi there, I have a set of DB entity class in a library and creating Object from another project which linked with the library returns Null. I don't know what's wrong there. the source is like this: a. I have a library with such a structure: gwlib/source/gwlib/entity/nsconf.d

Re: rdmd takes 2-3 seconds on a first-run of a simple .d script

2019-05-28 Thread Andre Pany via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 06:06:24 UTC, Seb wrote: On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote: On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote: [...] I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1

Re: rdmd takes 2-3 seconds on a first-run of a simple .d script

2019-05-28 Thread BoQsc via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 06:06:24 UTC, Seb wrote: On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote: On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote: [...] I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1

Re: Example of append & rectangualar arrays?

2019-05-28 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-05-27 13:14:47 +, 9il said: Appender!(T[][]) can append rows of type T[]. It does not check their lengths, the T[][] is an array of arrays, not a matrix. To append columns one needs an array of Appenders, Appenders!(T[])[]. And to have appenders on both dimensions?

Re: rdmd takes 2-3 seconds on a first-run of a simple .d script

2019-05-28 Thread Seb via Digitalmars-d-learn
On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote: On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote: [...] I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1 second instead of 2 seconds. Kind regards André