Re: DerelictGL3 slow compilation speed with contexts

2017-09-12 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 21:55:23 UTC, Igor wrote: Hi All, I switched from using free functions in DerelictGL3 to DerelictGL3_Contexts and compilation speed in optimized build using DMD went from 2 seconds to 7 minutes and using LDC from 2 seconds to 10 seconds. Is this a known

Re: Adding empty static this() causes exception

2017-09-12 Thread lobo via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:59:52 UTC, Joseph wrote: On Tuesday, 12 September 2017 at 10:08:11 UTC, Moritz Maxeiner wrote: [...] The compiler shouldn't arbitrarily force one to make arbitrary decisions that waste time and money. My solution was to turn those static this's in to

Re: Adding empty static this() causes exception

2017-09-12 Thread nkm1 via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:59:52 UTC, Joseph wrote: The compiler shouldn't arbitrarily force one to make arbitrary decisions that waste time and money. You might want to educate yourself about arbitrary decisions that waste time and money:

DerelictGL3 slow compilation speed with contexts

2017-09-12 Thread Igor via Digitalmars-d-learn
Hi All, I switched from using free functions in DerelictGL3 to DerelictGL3_Contexts and compilation speed in optimized build using DMD went from 2 seconds to 7 minutes and using LDC from 2 seconds to 10 seconds. Is this a known problem? Are there any workarounds?

Re: Assertion Error

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:44:19 UTC, vino wrote: Hi All, I have a small piece of code which executes perfectly 8 out of 10 times, very rarely it throws an assertion error, so is there a way to find which line of code is causing this error. You should be getting the line number as

Re: Adding empty static this() causes exception

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 19:59:52 UTC, Joseph wrote: On Tuesday, 12 September 2017 at 10:08:11 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an

Re: Adding empty static this() causes exception

2017-09-12 Thread Joseph via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 10:08:11 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an interface. On one file when I add an empty static this() it

Assertion Error

2017-09-12 Thread vino via Digitalmars-d-learn
Hi All, I have a small piece of code which executes perfectly 8 out of 10 times, very rarely it throws an assertion error, so is there a way to find which line of code is causing this error. From, Vino.B

Re: Array Printing

2017-09-12 Thread vino via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 13:55:17 UTC, lithium iodate wrote: On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output As a fan of stuffing as much as possible into one line: void

Re: Ranges seem awkward to work with

2017-09-12 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, September 12, 2017 13:47:47 Azi Hassan via Digitalmars-d-learn wrote: > On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: > > Now, a lot of library functions seem to expect ranges as inputs > > and return ranges as output. > > Unless I'm mistaken, it was done on purpose

Re: Array Printing

2017-09-12 Thread Anton Fediushin via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 13:15:01 UTC, Vino.B wrote: Hi, Sorry, it didn't work, the genrated out is as below Oops, sorry. It should look like this: writefln("%-(%s\n%)", array);

Re: Array Printing

2017-09-12 Thread lithium iodate via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output As a fan of stuffing as much as possible into one line: void main() { import std.stdio; import std.range; import

Re: Ranges seem awkward to work with

2017-09-12 Thread Azi Hassan via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 01:13:29 UTC, Hasen Judy wrote: Now, a lot of library functions seem to expect ranges as inputs and return ranges as output. Unless I'm mistaken, it was done on purpose to reduce the amount of memory allocations in the standard library so that it becomes

Re: Array Printing

2017-09-12 Thread Azi Hassan via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34", "C:\\Temp\\TEST2\\BACKUP\\dir2", "36", "C:\\Temp\\TEST3\\BACKUP\\dir1", "69"]

Re: Array Printing

2017-09-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Request your help in printing the below array output as per the below required output You can just loop over it and write the components with the tab separator. Did you try that?

Re: Array Printing

2017-09-12 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 07:28:00 UTC, Anton Fediushin wrote: On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34",

How and what do you use for server to server (secure, fast) communication?

2017-09-12 Thread aberba via Digitalmars-d-learn
I'm planning to use in a stateless microservices setup.

Re: Web servers in D

2017-09-12 Thread aberba via Digitalmars-d-learn
On Friday, 25 August 2017 at 05:25:09 UTC, Hasen Judy wrote: What libraries are people using to run webservers other than vibe.d? Don't get me wrong I like the async-io aspect of vibe.d but I don't like the weird template language and the fact that it caters to mongo crowd. I think for D

Re: Adding empty static this() causes exception

2017-09-12 Thread Biotronic via Digitalmars-d-learn
The simplest example of a cycle is probably this: module A; import B; int n1 = 17; static this() { n1 = n2; } // module B; import A; int n2 = 42; static this() { n2 = n1; } What's the value of n1 and n2 after module constructors are run? Since both module constructors can run

Re: Adding empty static this() causes exception

2017-09-12 Thread Biotronic via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an interface. On one file when I add an empty static this() it crashes while the other one does not. The exception that happens is

Re: Adding empty static this() causes exception

2017-09-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 09:11:20 UTC, Joseph wrote: I have two nearly duplicate files I added a static this() to initialize some static members of an interface. On one file when I add an empty static this() it crashes while the other one does not. The exception that happens is

Adding empty static this() causes exception

2017-09-12 Thread Joseph via Digitalmars-d-learn
I have two nearly duplicate files I added a static this() to initialize some static members of an interface. On one file when I add an empty static this() it crashes while the other one does not. The exception that happens is Cyclic dependency between module A and B. Why does this occur on

Re: Problems with the DLangUI TreeWidget

2017-09-12 Thread Vadim Lopatin via Digitalmars-d-learn
On Monday, 11 September 2017 at 17:57:14 UTC, pezi_pink wrote: On Monday, 11 September 2017 at 09:00:36 UTC, Vadim Lopatin Fixed in v0.9.121 See example1 / TreeWidget for sample of adding / removing of items. Fantasic! Thank you very much :) Feel free to submit issues on

Re: extern(C) and slices

2017-09-12 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 06:23:57 UTC, Jacob Carlborg wrote: It looks like the length needs to come first [1]. I think it would be technically possible if you flipped the parameters but you would become dependent on the ABI as well. I would recommend a wrapper instead. [1]

Re: Array Printing

2017-09-12 Thread Anton Fediushin via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34", "C:\\Temp\\TEST2\\BACKUP\\dir2", "36", "C:\\Temp\\TEST3\\BACKUP\\dir1", "69"]

Array Printing

2017-09-12 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34", "C:\\Temp\\TEST2\\BACKUP\\dir2", "36", "C:\\Temp\\TEST3\\BACKUP\\dir1", "69"] ["C:\\Temp\\TEST2\\PROD_TEAM\\dir1", "34",

Re: extern(C) and slices

2017-09-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-09-12 01:03, Nordlöw wrote: If I have a function like `extern(C) void f(void *x, size_t x_sz)` can I instead declare it as `extern(C) void f(void[] x)` ? It looks like the length needs to come first [1]. I think it would be technically possible if you flipped the parameters but