Re: vectorization of a simple loop -- not in DMD?

2022-07-13 Thread Siarhei Siamashka via Digitalmars-d-learn
On Tuesday, 12 July 2022 at 13:23:36 UTC, ryuukk_ wrote: I wonder if DMD/LDC/GDC have built in tools to profile and track performance Linux has a decent system wide profiler: https://perf.wiki.kernel.org/index.php/Main_Page And there are other useful tools, such as callgrind. To take

Re: Using Sequence Range as a SortedRange.

2022-07-13 Thread D Lark via Digitalmars-d-learn
On Wednesday, 13 July 2022 at 22:35:35 UTC, D Lark wrote: On Wednesday, 13 July 2022 at 18:27:22 UTC, D Lark wrote: I am trying to use a sequence range as a sorted range so that I can apply a search on it. For instance this might be used to implement integer square root as so: [...] For

Re: Using Sequence Range as a SortedRange.

2022-07-13 Thread D Lark via Digitalmars-d-learn
On Wednesday, 13 July 2022 at 18:27:22 UTC, D Lark wrote: I am trying to use a sequence range as a sorted range so that I can apply a search on it. For instance this might be used to implement integer square root as so: [...] For the first snippet, I did not get to that point, but it

Re: How to create Multi Producer-Single Consumer concurrency

2022-07-13 Thread Bagomot via Digitalmars-d-learn
On Wednesday, 13 July 2022 at 19:06:48 UTC, Ali Çehreli wrote: On 7/13/22 02:25, Bagomot wrote: > How to do the same with `taskPool` instead of `spawnLinked`? You are hitting the nail on the head. :) std.parallelism, which taskPool is a concept of, is for cases where operations are

Re: How to create Multi Producer-Single Consumer concurrency

2022-07-13 Thread Ali Çehreli via Digitalmars-d-learn
On 7/13/22 02:25, Bagomot wrote: > How to do the same with `taskPool` instead of `spawnLinked`? You are hitting the nail on the head. :) std.parallelism, which taskPool is a concept of, is for cases where operations are independent. However, producer and consumer are by definition dependent,

Using Sequence Range as a SortedRange.

2022-07-13 Thread D Lark via Digitalmars-d-learn
I am trying to use a sequence range as a sorted range so that I can apply a search on it. For instance this might be used to implement integer square root as so: ```dlang auto square(N)(N n) { return n * n; } auto isqrt(int n) { import std.range: sequence, assumeSorted; auto seq

Re: How can I convert a file encode by CP936 to a file with UTF-8 encoding

2022-07-13 Thread rocex via Digitalmars-d-learn
On Wednesday, 13 July 2022 at 12:00:43 UTC, Adam D Ruppe wrote: On Wednesday, 13 July 2022 at 11:47:56 UTC, rocex wrote: How can I convert a file encode by CP936 to a file with UTF-8 encoding My lib doesn't have it included but the basic idea is to take this table:

Re: How can I convert a file encode by CP936 to a file with UTF-8 encoding

2022-07-13 Thread Adam D Ruppe via Digitalmars-d-learn
On Wednesday, 13 July 2022 at 11:47:56 UTC, rocex wrote: How can I convert a file encode by CP936 to a file with UTF-8 encoding My lib doesn't have it included but the basic idea is to take this table: https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT and do the

How can I convert a file encode by CP936 to a file with UTF-8 encoding

2022-07-13 Thread rocex via Digitalmars-d-learn
How can I convert a file encode by CP936 to a file with UTF-8 encoding

Re: How to create Multi Producer-Single Consumer concurrency

2022-07-13 Thread Bagomot via Digitalmars-d-learn
On Tuesday, 16 June 2020 at 09:10:09 UTC, Ali Çehreli wrote: On 6/12/20 3:02 PM, adnan338 wrote: > So there are multiple "download finished" message producers, and one > consumer of those messages. Furthermore, that producer has a callback > that triggers an UI object. That's almost exactly