Re: My friend can't install DMD 2.076.0 after he deleted contents of C:\D

2017-09-16 Thread Enjoys Math via Digitalmars-d-learn
On Sunday, 17 September 2017 at 05:30:51 UTC, Enjoys Math wrote: Series of messages from installer: DMD v2.076.0 is installed on your system Press 'OK' to replace by DMD 2.076.0 An error occurred when removing DMD v2.076.0 Run 'dmd-2.076.0.exe /f to force install And using the command line

My friend can't install DMD 2.076.0 after he deleted contents of C:\D

2017-09-16 Thread Enjoys Math via Digitalmars-d-learn
Series of messages from installer: DMD v2.076.0 is installed on your system Press 'OK' to replace by DMD 2.076.0 An error occurred when removing DMD v2.076.0 Run 'dmd-2.076.0.exe /f to force install And using the command line has no effect - it repeats the above. He got into this situation by

Re: My friend can't install DMD 2.076.0 after he deleted contents of C:\D

2017-09-16 Thread rikki cattermole via Digitalmars-d-learn
On 17/09/2017 6:30 AM, Enjoys Math wrote: Series of messages from installer: DMD v2.076.0 is installed on your system Press 'OK' to replace by DMD 2.076.0 An error occurred when removing DMD v2.076.0 Run 'dmd-2.076.0.exe /f to force install And using the command line has no effect - it

Novel Undo

2017-09-16 Thread Mr Parks via Digitalmars-d-learn
Is there a way to integrate a undo/redo system in an already existing app without a huge amount of recording to support it? I.e., converting to using commands. I'd like to specify what is going to be modified and what needs to be done to restore the state. Given D's strong meta capabilities, I

Re: Temporarily adding -vgc to a DUB build

2017-09-16 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 16 September 2017 at 21:45:34 UTC, Nordlöw wrote: How do I temporarily enable -vgc when building my app with DUB? I've tried DFLAGS=-vgc /usr/bin/dub build --build=unittest but it doesn't seem to have any effect as it doesn't rebuild directly after the call /usr/bin/dub build

Re: Convert user input string to Regex

2017-09-16 Thread Ky-Anh Huynh via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:23:14 UTC, Adam D. Ruppe wrote: On Saturday, 16 September 2017 at 03:18:31 UTC, Ky-Anh Huynh wrote: Is there a way to transform user input string to a regular expression? For example, I want to write a `grep`-like program import std.regex; auto re =

Temporarily adding -vgc to a DUB build

2017-09-16 Thread Nordlöw via Digitalmars-d-learn
How do I temporarily enable -vgc when building my app with DUB? I've tried DFLAGS=-vgc /usr/bin/dub build --build=unittest but it doesn't seem to have any effect as it doesn't rebuild directly after the call /usr/bin/dub build --build=unittest I'm using DUB version 1.5.0 Or is adding a

Re: Gtk toArray List funkiness

2017-09-16 Thread Joseph via Digitalmars-d-learn
On Saturday, 16 September 2017 at 20:54:21 UTC, Mike Wey wrote: On 16-09-17 20:58, Joseph wrote: https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d has the code foreach ( int i, string selection ; fs.getSelections()) {   writeln("File(s) selected [%d]

Re: Gtk toArray List funkiness

2017-09-16 Thread Mike Wey via Digitalmars-d-learn
On 16-09-17 20:58, Joseph wrote: https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d has the code foreach ( int i, string selection ; fs.getSelections()) {   writeln("File(s) selected [%d] %s",i,selection); } which is invalid for the demo, but foreach

Gtk toArray List funkiness

2017-09-16 Thread Joseph via Digitalmars-d-learn
https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/TestWindow/TestWindow.d has the code foreach ( int i, string selection ; fs.getSelections()) { writeln("File(s) selected [%d] %s",i,selection); } which is invalid for the demo, but foreach ( int i, string selection ;

Re: How to get DnD to work in GTKD?

2017-09-16 Thread Joseph via Digitalmars-d-learn
On Saturday, 16 September 2017 at 17:08:52 UTC, Joseph wrote: On Saturday, 16 September 2017 at 14:33:53 UTC, Mike Wey wrote: On 16-09-17 06:33, Joseph wrote: [...] You will also need to set an TargetList to tell gtk that you want to receive text: ``` TargetList lst = new TargetList([]);

Re: How to get DnD to work in GTKD?

2017-09-16 Thread Joseph via Digitalmars-d-learn
On Saturday, 16 September 2017 at 14:33:53 UTC, Mike Wey wrote: On 16-09-17 06:33, Joseph wrote: I've used null in place of [te]. I'm not sure what target entry is for and if that is the problem or what. I am trying to drag files from windows explorer to a grid or label(I duplicated the

Re: Binary serialization of a struct

2017-09-16 Thread Sergei Degtiarev via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:30:51 UTC, Joseph wrote: Are there any simple direct serialization libraries... I want something straight forward without allot of plumbing on my end. You may also take a look at https://github.com/sdegtiarev/persistentObject This is small module for

Re: How to use the Among method with a string array

2017-09-16 Thread Andrew Chapman via Digitalmars-d-learn
On Saturday, 16 September 2017 at 12:09:28 UTC, Adam D. Ruppe wrote: On Saturday, 16 September 2017 at 11:18:45 UTC, Andrew Chapman wrote: string[] fruit = ["apple", "pear", "strawberry"]; How do I use "among" to see if "apple" is present. E.g. I want to do this: if ("apple".among(fruit))

Re: How to get DnD to work in GTKD?

2017-09-16 Thread Mike Wey via Digitalmars-d-learn
On 16-09-17 06:33, Joseph wrote: I've used null in place of [te]. I'm not sure what target entry is for and if that is the problem or what. I am trying to drag files from windows explorer to a grid or label(I duplicated the code above for the label) and none the callbacks are ever called. I

Re: Binary serialization of a struct

2017-09-16 Thread Azi Hassan via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:30:51 UTC, Joseph wrote: Are there any simple direct serialization libraries where I can mark elements of a class or struct that I want serialized with an attribute and it will take care of all the rest(including recursive structures, arrays, etc) then

Re: extern(C) enum

2017-09-16 Thread nkm1 via Digitalmars-d-learn
On Saturday, 16 September 2017 at 03:06:24 UTC, Timothy Foster wrote: You are correct, however 6.7.2.2 "Enumeration specifiers" states: "Each enumerated type shall be compatible with char, a signed integer type, or an unsigned integer type. The choice of type is implementation-defined, but

Re: How to use the Among method with a string array

2017-09-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 16 September 2017 at 11:18:45 UTC, Andrew Chapman wrote: string[] fruit = ["apple", "pear", "strawberry"]; How do I use "among" to see if "apple" is present. E.g. I want to do this: if ("apple".among(fruit)) among doesn't take an array, but rather a list of arguments:

How to use the Among method with a string array

2017-09-16 Thread Andrew Chapman via Digitalmars-d-learn
Hi all, sorry for the very simple question, but I'm looking at the "among" function in std.comparison: https://dlang.org/phobos/std_algorithm_comparison.html#among If I have a string array: string[] fruit = ["apple", "pear", "strawberry"]; How do I use "among" to see if "apple" is present.