On Monday, 2 October 2023 at 02:47:37 UTC, Joel wrote:
How can I improve this code? Like avoiding using foreach.
You could fold into a hash that counts the occurrences like that:
```d
import std.uni : toLower;
import std.array : split, array;
import std.stdio : writeln;
import std.algorithm :
On Tuesday, 3 October 2023 at 01:55:43 UTC, Andrey Zherikov wrote:
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
[...]
Slightly improved:
```d
import std;
[...]
Thanks .. the thing with ref result is very clever!
Should `ref result` be `return result`?
Kind regards,
On Tuesday, 3 October 2023 at 20:22:30 UTC, Andrey Zherikov wrote:
On Tuesday, 3 October 2023 at 19:57:06 UTC, christian.koestlin
wrote:
On Tuesday, 3 October 2023 at 01:55:43 UTC, Andrey Zherikov
wrote:
On Monday, 2 October 2023 at 18:46:14 UTC, christian.koestlin
wrote:
[...]
Slightly
Recently I wanted to wrap a small d program around an external
process and stream its stdout/stderr to the original
stdout/stderr of the d program (no other output while the
external process is running).
I first tried to implement this with vibe's fibers, but after
failing first try, I
On Saturday, 1 October 2022 at 17:50:54 UTC, tsbockman wrote:
On Saturday, 1 October 2022 at 10:02:34 UTC, Salih Dincer wrote:
On Saturday, 1 October 2022 at 08:26:43 UTC, tsbockman wrote:
`StringBuilder` is a utility shared across the entire project:
Appender not good enough; at least in
On Thursday, 6 October 2022 at 07:06:52 UTC, Preetpal wrote:
Is there a way to install packages "globally" using dub?
For example, when using the node package manager (NPM) you can
install a package "globally" (so it is available for the
current user from the command line) using the
Dear Dlang experts,
up until now I was perfectly happy with implementing `(override)
string toString() const` or something to get nicely formatted
(mostly debug) output for my structs, classes and exceptions.
But recently I stumbled upon