On Sunday, 24 May 2020 at 15:24:14 UTC, 9il wrote:
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote:
[...]
BTW, the code example above doesn't compiles.
OT:
Instead of
[...]
you can generate the same common D array using Mir:
auto a = [2, 2, 4].iota!int(1).ndarray;
On Sunday, 24 May 2020 at 14:35:33 UTC, jmh530 wrote:
On Sunday, 24 May 2020 at 14:21:26 UTC, Pavel Shkadzko wrote:
[snip]
Sorry for the typo. It should be "auto arrSlice = a.sliced;"
Try using fuse
/+dub.sdl:
dependency "mir-algorithm" version="*"
+/
import std.stdio;
import std.conv;
On Sunday, 24 May 2020 at 14:21:26 UTC, Pavel Shkadzko wrote:
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote:
I am confused by the return value of Mir shape.
Consider the following example.
[...]
Sorry for the typo. It should be "auto arrSlice = a.sliced;"
And another typo
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote:
I am confused by the return value of Mir shape.
Consider the following example.
[...]
Sorry for the typo. It should be "auto arrSlice = a.sliced;"
I am confused by the return value of Mir shape.
Consider the following example.
///
import std.stdio;
import std.conv;
import std.array: array;
import std.range: chunks;
import mir.ndslice;
int[] getShape(T : int)(T obj,
On Sunday, 24 May 2020 at 11:21:00 UTC, 9il wrote:
On Saturday, 23 May 2020 at 18:15:32 UTC, Pavel Shkadzko wrote:
[...]
If the common nd-array isn't jugged (a parallelotop), you can
use fuse function.
--
/+dub.sdl:
dependency "mir-algorithm" version="~>3.8.12"
+/
import std.stdio:
On Saturday, 23 May 2020 at 19:59:30 UTC, Ali Çehreli wrote:
On 5/23/20 11:15 AM, Pavel Shkadzko wrote:> I have tried to
implement a simple flatten function for multidimensional
[...]
Thank you, I was lacking practical examples for templates with
"if" constructs, ehh.
I have tried to implement a simple flatten function for
multidimensional arrays with recursive templates but got stuck.
Then I googled a little and stumped into complex
https://rosettacode.org/wiki/Flatten_a_list#D implementation
which requires your arrays to be either TreeList or Algebraic.
On Saturday, 9 May 2020 at 22:48:46 UTC, Simen Kjærås wrote:
On Saturday, 9 May 2020 at 19:54:44 UTC, Pavel Shkadzko wrote:
[...]
The GC keeps a list of roots - that is, objects that are known
to be active and should not be collected. The static freelist
is one of those - since it's static
I have been reading about memory management in D on
https://wiki.dlang.org/Memory_Management and found an example of
a free list (pattern?): "Free lists are a great way to accelerate
access to a frequently allocated and discarded type.".
Here is the example of free list:
On Wednesday, 11 March 2020 at 06:12:55 UTC, 9il wrote:
On Wednesday, 11 March 2020 at 00:24:13 UTC, jmh530 wrote:
[...]
Almost the same, just fixed import for `each` and a bit polished
/+dub.sdl:
dependency "mir-algorithm" version="~>3.7.18"
+/
import mir.ndslice;
import
On Monday, 13 January 2020 at 20:47:07 UTC, p.shkadzko wrote:
On Sunday, 12 January 2020 at 13:07:33 UTC, dnsmt wrote:
On Saturday, 11 January 2020 at 16:45:22 UTC, p.shkadzko wrote:
I am trying to run example code from
https://tour.dlang.org/tour/en/dub/lubeck
...
This is Linux Manjaro
I've been skimming through https://dlang.org/spec/ddoc.html in
order to understand how can one use ddoc to generate nice htmls.
I tend to use markdown to log some daily work or copy down code
examples. For learning purposes I wanted to try ddoc for this but
could not find any information on
On Monday, 13 January 2020 at 10:28:48 UTC, mark wrote:
I'm just starting out learning D.
Andrei Alexandrescu's "The D Programming Language" is 10 years
old, so is it still worth getting? (I don't know how much D has
changed in 10 years.)
Start with "Programming in D" by Ali:
On Wednesday, 11 December 2019 at 16:06:30 UTC, drug wrote:
Add to dub.json:
"targetType": "executable"
and it will build executable. Or rename evaluator.d to app.d
It is confused that there is no app.d so it thinks that you
build a library.
I added "targetType" and now everything works
On Wednesday, 11 December 2019 at 13:00:32 UTC, drug wrote:
I would restructure your
folders this way:
my_proj/
source/
script_1/runme_1.d
script_2/runme_2.d
evaluator.d
then using `dub --compiler=ldc2`
It works like this, yes. However, by default it builds a
I have the following project structure.
my_proj/
script_1/runme_1.d
script_2/runme_2.d
evaluator.d
The project has a library dependency:
"dependencies": {
"mir": "~>3.2.0",
},
The "evaluator.d" script contains some general functions that
convert dataset and pass it to
17 matches
Mail list logo