Re: Real simple question... for good programmers

2022-10-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/22/22 5:53 PM, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Find in assoc array then iterate

2022-10-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/22/22 12:53 AM, Kevin Bailey wrote: Steven, Just because you don't see the value doesn't mean I don't. You should try to be more helpful, or don't bother. I just mean that I don't understand what iterating from a random position in the AA is. Why not iterate from the beginning? It

Re: Real simple question... for good programmers

2022-10-22 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); [...] Is there a clever way that I can discard all the extra null strings in the resultant string array? Easiest way is to use [`filter`][1].

Re: Find in assoc array then iterate

2022-10-22 Thread Kevin Bailey via Digitalmars-d-learn
ah, I knew that I could iterate over byKey, but I didn't know that it was a tangible thing, that you could hold in your hand. This should be fine, and I'll use your template trick for passing it to a function. Thanks Paul and Ali!

Re: is dmd a virus?

2022-10-22 Thread Daniel via Digitalmars-d-learn
On Saturday, 22 October 2022 at 13:29:00 UTC, Salih Dincer wrote: On Saturday, 22 October 2022 at 09:49:28 UTC, Salih Dincer wrote: On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 -->

Re: Real simple question... for good programmers

2022-10-22 Thread Daniel via Digitalmars-d-learn
On Saturday, 22 October 2022 at 22:01:09 UTC, Enjoys Math wrote: On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Real simple question... for good programmers

2022-10-22 Thread Enjoys Math via Digitalmars-d-learn
__MWE Code:__ ``` module DlangForumsMWE; import std.stdio; import std.algorithm.mutation; int main() { //string[] tokens = userSID.output.split!isWhite; //writeln("tokens = ", tokens); auto tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: Find in assoc array then iterate

2022-10-22 Thread Ali Çehreli via Digitalmars-d-learn
On 10/22/22 08:21, Kevin Bailey wrote: > his claim that there was no value. I think he was questioning the need for iterating from a point forward inside an unordered container. When the container is unordered, the elements that are accessed after a found element could be anything. I think

Re: Real simple question... for good programmers

2022-10-22 Thread Ali Çehreli via Digitalmars-d-learn
On 10/22/22 14:53, WhatMeWorry wrote: > > > string[] tokens = userSID.output.split!isWhite; > writeln("tokens = ", tokens); Could you please show minimal compilable code that demonstrates the issue. I spent some time with some guesses but failed (to get my code to compile with

Re: Real simple question... for good programmers

2022-10-22 Thread Enjoys Math via Digitalmars-d-learn
On Saturday, 22 October 2022 at 21:53:05 UTC, WhatMeWorry wrote: string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Real simple question... for good programmers

2022-10-22 Thread WhatMeWorry via Digitalmars-d-learn
string[] tokens = userSID.output.split!isWhite; writeln("tokens = ", tokens); tokens = ["SID", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",

Re: How to use dub with ldc

2022-10-22 Thread ryuukk_ via Digitalmars-d-learn
On Saturday, 22 October 2022 at 18:08:51 UTC, tobi wrote: Hi, I'm new to D and I would like to get the dlang-tour onto my local machine. As far as I know, on my Pinebook Pro using aarm64 architecture, I must use the LDC compiler. The dlang-tour readme says to run `dub run dlang-tour --

Re: Find in assoc array then iterate

2022-10-22 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 22 October 2022 at 15:21:07 UTC, Kevin Bailey wrote: OTOH, a forward iterator (i.e. copyable but does not need to go backwards) solves the problem elegantly and efficiently. The builtin function [`byKeyValue`][1] returns a forward range (D's version of a forward iterator) over

Re: How to use dub with ldc

2022-10-22 Thread rikki cattermole via Digitalmars-d-learn
If you only have one compiler available, dub will use it (doesn't matter if its dmd/ldc/gdc). rdmd is a tool that wraps dmd/ldc/gdc. https://github.com/dlang/tools/blob/master/rdmd.d If you only have ldc in your PATH variable, rdmd just "just work".

How to use dub with ldc

2022-10-22 Thread tobi via Digitalmars-d-learn
Hi, I'm new to D and I would like to get the dlang-tour onto my local machine. As far as I know, on my Pinebook Pro using aarm64 architecture, I must use the LDC compiler. The dlang-tour readme says to run `dub run dlang-tour -- --lang-dir .` which will run `rdmd` commands. Is there a way

Re: Find in assoc array then iterate

2022-10-22 Thread Kevin Bailey via Digitalmars-d-learn
Siarhei, Thanks for this possibility. I didn't know D had "pointers" like this. Unfortunately, it appears that you can't pick up where you left off with that pointer? You have to re-scan forward? bachmeier, I didn't reply to Steven's question; I replied to his claim that there was no

Re: Find in assoc array then iterate

2022-10-22 Thread Tejas via Digitalmars-d-learn
On Friday, 21 October 2022 at 22:03:53 UTC, Kevin Bailey wrote: I'm trying to do this equivalent C++: unordered_map map; for (auto i = map.find(something); i != map.end(); ++i) ...do something with i... in D, but obviously with an associative array. It seems that it's quite

Re: is dmd a virus?

2022-10-22 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 22 October 2022 at 09:49:28 UTC, Salih Dincer wrote: On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell It's our sweet virus... It must have happened to

Re: is dmd a virus?

2022-10-22 Thread ryuukk_ via Digitalmars-d-learn
On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell It's obviously not We need to contact these companies and let them know about the false positive Someone who has an

Re: [Help Needed] - Debugging compilation time

2022-10-22 Thread ryuukk_ via Digitalmars-d-learn
On Saturday, 22 October 2022 at 12:27:21 UTC, Hipreme wrote: On Friday, 21 October 2022 at 18:10:39 UTC, ryuukk_ wrote: I tried your project: Linux x64 ``` git clone https://github.com/MrcSnm/HipremeEngine.git cd HipremeEngine dub build (once to download dependencies if any) time dub build -f

Re: Find in assoc array then iterate

2022-10-22 Thread bachmeier via Digitalmars-d-learn
On Saturday, 22 October 2022 at 04:53:09 UTC, Kevin Bailey wrote: Steven, Just because you don't see the value doesn't mean I don't. You should try to be more helpful, or don't bother. Programs are written to do things that have value. Programming languages are designed to support that

Re: [Help Needed] - Debugging compilation time

2022-10-22 Thread Hipreme via Digitalmars-d-learn
On Friday, 21 October 2022 at 18:10:39 UTC, ryuukk_ wrote: I tried your project: Linux x64 ``` git clone https://github.com/MrcSnm/HipremeEngine.git cd HipremeEngine dub build (once to download dependencies if any) time dub build -f real0m4.604s user0m3.686s sys 0m0.900s ``` 4.6

Re: is dmd a virus?

2022-10-22 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell It's our sweet virus... There is not a single day I spend without it.  SDB@79

Re: is dmd a virus?

2022-10-22 Thread bauss via Digitalmars-d-learn
On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell Yeah it's a virus. I would stay far away from it...

Re: is dmd a virus?

2022-10-22 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 22 October 2022 at 07:40:39 UTC, MGW wrote: is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell Yes, it's a virus...  No, it's a false positive

is dmd a virus?

2022-10-22 Thread MGW via Digitalmars-d-learn
is dmd a virus? https://www.virustotal.com report: Cybereason --> Malicious.779f29 VBA32 --> BScope.Trojan.DShell

Re: Find in assoc array then iterate

2022-10-22 Thread Siarhei Siamashka via Digitalmars-d-learn
On Friday, 21 October 2022 at 22:03:53 UTC, Kevin Bailey wrote: I'm trying to do this equivalent C++: unordered_map map; for (auto i = map.find(something); i != map.end(); ++i) ...do something with i... in D, but obviously with an associative array. It seems that it's quite