Re: Is there an efficient byte buffer queue?

2018-10-10 Thread Dukc via Digitalmars-d-learn
On Monday, 8 October 2018 at 10:31:33 UTC, Nicholas Wilson wrote: Try searching for "circular buffer". I'm sure http://code.dlang.org/packages/iopipe has them in some form but I can't find them with a cursory search.

Re: Why are 2-D arrays reversed?

2018-10-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, October 10, 2018 4:26:40 PM MDT Chris Katko via Digitalmars-d- learn wrote: > On Wednesday, 10 October 2018 at 16:00:42 UTC, Steven > > Schveighoffer wrote: > > On 10/10/18 9:22 AM, Chris Katko wrote: > >> int[][] data = > >> > >> [ > >> [1, 0, 1, 0, 0], > >>

Re: static foreach

2018-10-10 Thread Neia Neutuladh via Digitalmars-d-learn
On 10/10/2018 04:03 PM, James Japherson wrote:> Says that it cannot interpret X(the class that contains the static> opApply). It's a bit hard to diagnose the problem you're getting using that function when we don't have the code that uses it. Or the context that's referenced with the foreach

static foreach

2018-10-10 Thread James Japherson via Digitalmars-d-learn
I have a static opApply in a class and I need to iterate over all the members statically using foreach // Iterates over all members static int opApply(int delegate(cPiece) dg) { alias T = typeof(this); foreach (m; __traits(derivedMembers,

Using . notation abstractly

2018-10-10 Thread James Japherson via Digitalmars-d-learn
struct Dispatcher(Base...) { static auto opDispatch(string name, T...)(T vals) { pragma(msg, " - ", name); return Dispatcher!(Base, name).init; } } struct Dispatch { alias X = Dispatcher!void; alias X this; }

Re: Why are 2-D arrays reversed?

2018-10-10 Thread Chris Katko via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 16:00:42 UTC, Steven Schveighoffer wrote: On 10/10/18 9:22 AM, Chris Katko wrote: int[][] data = [     [1, 0, 1, 0, 0],     [1, 0, 1, 0, 0],     [1, 0, 1, 1, 1],     [1, 0, 0, 1, 0],     [5, 1, 1, 1, 0] ]; when drawn with

Re: Copy parameters from function passed as an alias

2018-10-10 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 12:10:06 UTC, bauss wrote: On Wednesday, 10 October 2018 at 08:16:11 UTC, Kagamin wrote: How do you want to use parameter names of an arbitrary function? What I want to do is pass a function to a template and that template creates a function with the same

Re: typo mapNode[6]* exits; instead of mapNode*[6] exits; but whats it mean ?

2018-10-10 Thread Codifies via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 13:36:20 UTC, Simen Kjærås wrote: mapNode[6]* can be read right-to-left as 'a pointer to an array right... hence the failed attempt at an array copy... now I understand...

Re: Why are 2-D arrays reversed?

2018-10-10 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/10/18 9:22 AM, Chris Katko wrote: int[][] data = [     [1, 0, 1, 0, 0],     [1, 0, 1, 0, 0],     [1, 0, 1, 1, 1],     [1, 0, 0, 1, 0],     [5, 1, 1, 1, 0] ]; when drawn with data[i][j], prints the transpose of "data": [1, 1, 1, 1, 5] [0, 0, 0, 0, 1] [1,

Re: Home Brew dmd update 2.082

2018-10-10 Thread aliak via Digitalmars-d-learn
On Sunday, 7 October 2018 at 13:24:39 UTC, Joel wrote: It's been a over a month, and there still isn't an update for dmd 2.082 on macOS using Home Brew?! I get this (with 'brew upgrade dmd'): Error: dmd 2.081.2 already installed Yeah... :(

Re: typo mapNode[6]* exits; instead of mapNode*[6] exits; but whats it mean ?

2018-10-10 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 13:24:42 UTC, Codifies wrote: I'm not sure I understand what mapNode[6]* means! (the second version is what I wanted an array of 6 pointers) oddly when assigning a null to one element of the array it cause an error as it was trying to do an array copy... so

Re: Why are 2-D arrays reversed?

2018-10-10 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 13:22:41 UTC, Chris Katko wrote: int[][] data = [ [1, 0, 1, 0, 0], [1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 0, 0, 1, 0], [5, 1, 1, 1, 0] ]; when drawn with data[i][j],

typo mapNode[6]* exits; instead of mapNode*[6] exits; but whats it mean ?

2018-10-10 Thread Codifies via Digitalmars-d-learn
I'm not sure I understand what mapNode[6]* means! (the second version is what I wanted an array of 6 pointers) oddly when assigning a null to one element of the array it cause an error as it was trying to do an array copy... so what's going on and what does that definition actually mean ?

Why are 2-D arrays reversed?

2018-10-10 Thread Chris Katko via Digitalmars-d-learn
int[][] data = [ [1, 0, 1, 0, 0], [1, 0, 1, 0, 0], [1, 0, 1, 1, 1], [1, 0, 0, 1, 0], [5, 1, 1, 1, 0] ]; when drawn with data[i][j], prints the transpose of "data": [1, 1, 1, 1, 5] [0, 0, 0, 0, 1] [1,

Re: Copy parameters from function passed as an alias

2018-10-10 Thread bauss via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 08:16:11 UTC, Kagamin wrote: How do you want to use parameter names of an arbitrary function? What I want to do is pass a function to a template and that template creates a function with the same parameters as the function passed to it, if it wasn't clear.

Re: Process Pipes

2018-10-10 Thread Colin via Digitalmars-d-learn
On Tuesday, 9 October 2018 at 09:15:09 UTC, Gorker wrote: Hi all, I'm on macOS 10.11.6 with dmd 2.081.2 and I've a problem with std.process. --- gork ():foo gorker$ gcc -c -Iinclude -o foo.cpp.o src/foo.cpp In file included from src/foo.cpp:2: include/foo/foo.hpp:22:10: warning: scoped

Re: Process Pipes

2018-10-10 Thread Danny Arends via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 09:16:43 UTC, Gorker wrote: On Wednesday, 10 October 2018 at 08:31:36 UTC, Kagamin wrote: Maybe read them with parallelism? http://dpldocs.info/experimental-docs/std.parallelism.parallel.2.html thanks, but I'd rather avoid having to use threads just for this

Re: Process Pipes

2018-10-10 Thread Gorker via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 08:31:36 UTC, Kagamin wrote: Maybe read them with parallelism? http://dpldocs.info/experimental-docs/std.parallelism.parallel.2.html thanks, but I'd rather avoid having to use threads just for this reason. some other suggestion?

Re: Process Pipes

2018-10-10 Thread Kagamin via Digitalmars-d-learn
Maybe read them with parallelism? http://dpldocs.info/experimental-docs/std.parallelism.parallel.2.html

Re: Can i watch folders/files for changes with D language?

2018-10-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-10-09 19:20, Ephrahim wrote: I intend to make this a command line tool for a start, but i'll need a GUI sooner or later. So i also need help pointing me to the best available GUI library D has. It's difficult to specifying a single best GUI library. But I'll mention DWT [1] [2]. It

Re: Copy parameters from function passed as an alias

2018-10-10 Thread Kagamin via Digitalmars-d-learn
How do you want to use parameter names of an arbitrary function?

Re: Process Pipes

2018-10-10 Thread Gorker via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 08:02:29 UTC, Kagamin wrote: stderr buffer is full (it's about 8kb or so) and gcc waits when you read from it. Thank you for your kind reply, How to just try to read from stdout (not blocking), and then try to read from stderr (not blocking)? I mean, how to

Re: Process Pipes

2018-10-10 Thread Kagamin via Digitalmars-d-learn
stderr buffer is full (it's about 8kb or so) and gcc waits when you read from it.

Re: Can i watch folders/files for changes with D language?

2018-10-10 Thread Russel Winder via Digitalmars-d-learn
On Tue, 2018-10-09 at 17:20 +, Ephrahim via Digitalmars-d-learn wrote: > Hi Everyone, i'm planning on developing a software for > synchronizing folder contents across multiple computers. The > software will evolve very quickly into virtual Remote Desktop > Access system. > So i've been