Re: Error: array operation d1[] + d2[] without assignment not implemented

2014-09-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 13 September 2014 at 14:18:57 UTC, deed wrote: struct Vector (T) { T[]arr; void opSliceAssign (T[] a) { arr[] = a[]; } } unittest { auto v = Vector!double([1, 2]); double[] d1 = [11, 12]; double[] d2 = [21, 22]; double[] d3 = new double[](2); d3[] = d1[] + d2[];

Re: Error: array operation d1[] + d2[] without assignment not implemented

2014-09-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
Operations like ar1[] op= ar2[] op ar3[] is only for arrays. There is no operator overloading for this staff.

Docs for PR

2014-09-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
How generate documentation for phobos PR?

Why if(__ctfe)?

2014-09-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
Why not static if(__ctfe) ?

Re: Why if(__ctfe)?

2014-09-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 13:28:17 UTC, Rene Zwanenburg wrote: On Tuesday, 16 September 2014 at 13:17:28 UTC, Adam D. Ruppe wrote: On Tuesday, 16 September 2014 at 13:11:50 UTC, Ilya Yaroshenko wrote: Why not static if(__ctfe) ? ctfe is a runtime condition. The function has the same

Re: dub can't read files from cache

2014-09-17 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 16 September 2014 at 17:11:14 UTC, Ruslan wrote: Note. ╨а╤Г╤Б╨╗╨░╨╜ is a cyrillic word. That should not affect because dub only displays so. Если Вы программируете (не только на D), то Вам стоит сменить учетную запись на латинскую. От кириллической много проблем, в особенности

Re: dub can't read files from cache

2014-09-18 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 18 September 2014 at 10:45:24 UTC, Kagamin wrote: Windows has full support for unicode, since it's an OS based on unicode. It's old C code, which is not unicode-ready, and it remains not unicode-ready without changing behavior. Modern code like phobos usually tries to be

Re: dub can't read files from cache

2014-09-18 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 18 September 2014 at 16:05:15 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 18 Sep 2014 15:53:02 + Ilya Yaroshenko via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Seriously, console application (in Russian lang. Windows) is not unicode-ready. that's

Re: dub can't read files from cache

2014-09-18 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 18 September 2014 at 16:05:15 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 18 Sep 2014 15:53:02 + Ilya Yaroshenko via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Seriously, console application (in Russian lang. Windows) is not unicode-ready. that's

Re: dub can't read files from cache

2014-09-18 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 18 September 2014 at 16:05:15 UTC, ketmar via Digitalmars-d-learn wrote: On Thu, 18 Sep 2014 15:53:02 + Ilya Yaroshenko via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Seriously, console application (in Russian lang. Windows) is not unicode-ready. that's

Re: DMD Zip for Mac OS X

2015-02-28 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 28 February 2015 at 06:45:58 UTC, Mike Parker wrote: I'm not a Mac user and I'm fairly clueless about it. The DMD zip for OS X contains one executable. I assume it's a 64-bit binary. Is that true? Hi! Probably, yes. Anyway dmd compiles 64-bit binaries on OS X. Ilya

Re: Merging one Array with Another

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
fix: completeSort(x.assumeSorted, y); x = x.chain(y).uniq.array; or (was fixed) y = y.sort().uniq.array; completeSort(x.assumeSorted, y); x ~= y;

Re: stdx.data.json - enhancement suggestions

2015-05-02 Thread Ilya Yaroshenko via Digitalmars-d-learn
You can use std.json or create TrustedInputRangeShell template with @trasted methods: struct TrustedInputRangeShell(Range) { Range* data; auto front() @property @trusted { return (*data).front; } //etc } But I am not sure about other parseJSONStream bugs.

Re: Merging one Array with Another

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
fix: completeSort(x.assumeSorted, y); x = x.chain(y).uniq.array; or completeSort(x.assumeSorted, y.uniq.array); x ~= y; On Friday, 1 May 2015 at 19:34:20 UTC, Ilya Yaroshenko wrote: If x is already sorted x = x.completeSort(y).uniq.array; On Friday, 1 May

Re: stdx.data.json - enhancement suggestions

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
This line can be removed: .map!(ch = ch.idup) On Friday, 1 May 2015 at 20:02:46 UTC, Ilya Yaroshenko wrote: Current std.stdio is deprecated. This ad-hoc should works. auto json = File(fileName) .byChunk(1024 * 1024) //1 MB. Data cluster equals 1024 * 4

Re: stdx.data.json - enhancement suggestions

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
Current std.stdio is deprecated. This ad-hoc should works. auto json = File(fileName) .byChunk(1024 * 1024) //1 MB. Data cluster equals 1024 * 4 .map!(ch = ch.idup) .joiner .map!(b = cast(char)b) .parseJSON;

Re: Merging one Array with Another

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
Both variants are wrong because uniq needs sorted ranges. Probably you need something like that: x = x.chain(y).sort.uniq.array; On Friday, 1 May 2015 at 19:08:51 UTC, Per Nordlöw wrote: What's the fastest Phobos-way of doing either x ~= y; // append x = x.uniq; // remove duplicates

Re: Merging one Array with Another

2015-05-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
If x is already sorted x = x.completeSort(y).uniq.array; On Friday, 1 May 2015 at 19:30:08 UTC, Ilya Yaroshenko wrote: Both variants are wrong because uniq needs sorted ranges. Probably you need something like that: x = x.chain(y).sort.uniq.array; On Friday, 1 May 2015 at 19:08:51 UTC, Per

new pragma(inline) syntax

2015-06-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
Are `foo` and `bar` always inlined? struct S { pragma(inline, true): void foo(T)(T t) {} void bar(T)(T t) {} }

Re: new pragma(inline) syntax

2015-06-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 13 June 2015 at 19:13:20 UTC, Ilya Yaroshenko wrote: Are `foo` and `bar` always inlined? struct S { pragma(inline, true): void foo(T)(T t) {} void bar(T)(T t) {} } I am confused becuase they are templates.

GC and MMM

2015-08-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
Hi All! Does GC scan manually allocated memory? I want to use huge manually allocated hash tables and I don't want to GC scan them because performance reasons. Best regards, Ilya

Re: good reasons not to use D?

2015-11-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 30 October 2015 at 10:35:03 UTC, Laeeth Isharc wrote: Any other thoughts? Floating point operations can be extended automatically (without some kind of 'fastmath' flag) up to 80bit fp on 32 bit intel processors. This is worst solution for language that want to be used in

Re: conver BigInt to string

2015-11-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 5 November 2015 at 16:53:50 UTC, Namal wrote: On Thursday, 5 November 2015 at 16:45:10 UTC, Meta wrote: On Thursday, 5 November 2015 at 16:29:30 UTC, Namal wrote: Hello I am trying to convert BigInt to string like that while trying to sort it: string s1 = to!string(a).dup.sort;

Re: good reasons not to use D?

2015-11-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 2 November 2015 at 17:07:33 UTC, Laeeth Isharc wrote: On Sunday, 1 November 2015 at 09:07:56 UTC, Ilya Yaroshenko wrote: On Friday, 30 October 2015 at 10:35:03 UTC, Laeeth Isharc wrote: Any other thoughts? Floating point operations can be extended automatically (without some kind

Re: ndslice help.

2015-12-30 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 30 December 2015 at 18:53:15 UTC, Zz wrote: Hi, Just playing with ndslice and I couldn't figure how to get the following transformations. given. auto slicea = sliced(iota(6), 2, 3, 1); foreach (item; slicea) { writeln(item); } which gives. [[0][1][2]] [[3][4][5]] what

Re: sliced().array compatibility with parallel?

2016-01-09 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 9 January 2016 at 23:20:00 UTC, Jay Norwood wrote: I'm playing around with win32, v2.069.2 dmd and "dip80-ndslice": "~>0.8.8". If I convert the 2D slice with .array(), should that first dimension then be compatible with parallel foreach? I find that without using parallel, all

Re: sliced().array compatibility with parallel?

2016-01-09 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 9 January 2016 at 23:20:00 UTC, Jay Norwood wrote: I'm playing around with win32, v2.069.2 dmd and "dip80-ndslice": "~>0.8.8". If I convert the 2D slice with .array(), should that first dimension then be compatible with parallel foreach? [...] It is a bug (Slice or Parallel

Re: sliced().array compatibility with parallel?

2016-01-09 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 9 January 2016 at 23:20:00 UTC, Jay Norwood wrote: I'm playing around with win32, v2.069.2 dmd and "dip80-ndslice": "~>0.8.8". If I convert the 2D slice with .array(), should that first dimension then be compatible with parallel foreach? [...] Oh... there is no bug. means

Re: std.experimental.allocator optlink error

2015-11-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 20 November 2015 at 12:31:37 UTC, Tofu Ninja wrote: On Tuesday, 10 November 2015 at 11:39:56 UTC, Rikki Cattermole wrote: One already exists. I've confirmed it in the build scripts. It only effects Windows. Any fix for this right now? No,

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 12 January 2016 at 21:48:39 UTC, Per Nordlöw wrote: Have anybody been thinking about adding a scale-hierarchy structure on top of ndslice? I need this to implementing some cool signal/image processing algorithms in D. When processing an image this structure is called a Mipmap.

Re: ndslice: convert a sliced object to T[]

2016-06-15 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 14:14:23 UTC, Seb wrote: ``` T[] a = slice.ptr[0.. slice.elementsCount]; ``` This would work only for slices with continuous memory representation and positive strides. -- Ilya

Re: get number of columns and rows in an ndarray.

2016-06-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 21:51:25 UTC, learner wrote: Hi, How can i get the number of cols and rows in and ndarray that has already been created? learner Also `sl.length!0`, `sl.length!1`, etc --Ilya

Re: ndslice, using a slice in place of T[] in template parameters

2016-01-10 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 10 January 2016 at 23:24:24 UTC, Jay Norwood wrote: On Sunday, 10 January 2016 at 22:23:18 UTC, Ilya Yaroshenko wrote: Could you please provide full code and error (git gists)? -- Ilya ok, thanks. I'm building with DMD32 D Compiler v2.069.2 on Win32. The dub.json is included.

Re: ndslice, using a slice in place of T[] in template parameters

2016-01-10 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 11 January 2016 at 00:39:04 UTC, Jay Norwood wrote: On Sunday, 10 January 2016 at 23:31:47 UTC, Ilya Yaroshenko wrote: Just use normal arrays for buffer (median accepts array on second argument for optimisation reasons). ok, I think I see. I created a slice(numTasks, bigd) over an

Re: ndslice, using a slice in place of T[] in template parameters

2016-01-10 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 10 January 2016 at 22:00:20 UTC, Jay Norwood wrote: I cut this median template from Jack Stouffer's article and was attempting to use it in a parallel function. As shown, it builds and execute correctly, but it failed to compile if I attempting to use medians[i] =

Re: ndslice, using a slice in place of T[] in template parameters

2016-01-10 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 10 January 2016 at 23:24:24 UTC, Jay Norwood wrote: On Sunday, 10 January 2016 at 22:23:18 UTC, Ilya Yaroshenko wrote: Could you please provide full code and error (git gists)? -- Ilya ok, thanks. I'm building with DMD32 D Compiler v2.069.2 on Win32. The dub.json is included.

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:09:06 UTC, Per Nordlöw wrote: On Wednesday, 13 January 2016 at 08:31:58 UTC, Ilya Yaroshenko wrote: If you describe additional required features for ndslice, I will think how they can be implemented in the Mir/Phobos. --Ilya Ok, great. BTW: What is Mir?

Re: c style casts

2016-01-15 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 15 January 2016 at 10:16:41 UTC, Warwick wrote: I though C style casts were not supported? But when I accidentaly did int i; if (uint(i) < length) it compiled and worked fine. Whys that? This is not a cast. You call constructor `uint(int x)`. In the same time

Re: foreach( i, e; a) vs ndslice

2016-01-19 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 18 January 2016 at 23:33:53 UTC, Jay Norwood wrote: I'm playing with the example below. I noticed a few things. 1. The ndslice didn't support the extra index, i, in the foreach, so had to add extra i,j. 2. I couldn't figure out a way to use sliced on the original 'a' array. Is

Re: Wrap array into a range.

2016-03-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 5 March 2016 at 16:28:51 UTC, Alexandru Ermicioi wrote: I have to pass an array to a function that accepts an input range. Therefore I need to transform somehow array into an input range. Is there a range that wraps an array in standard library? You just need to import

Re: Expression template

2016-07-26 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 10:35:12 UTC, Etranger wrote: I'll have time 2 months from now as I'm getting married in 2 weeks :) Congratulations!

Re: Library for serialization of data (with cycles) to JSON and binary

2016-08-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 6 August 2016 at 16:11:03 UTC, Neurone wrote: Is there a library that can serialize data (which may contain cycles) into JSON and a binary format that is portable across operating systems? JSON: http://code.dlang.org/packages/asdf Binary: http://code.dlang.org/packages/cerealed

Re: I need a @nogc version of hashOf(). What are the options?

2016-08-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 7 August 2016 at 16:42:47 UTC, Gary Willoughby wrote: I need a @nogc version of hashOf(). Here's one i'm currently using but it's not marked as @nogc. https://github.com/dlang/druntime/blob/master/src/object.d#L3170 What are the options now? Is there anything D offers that I could

Re: Initialization of dynamic multidimensional array

2017-02-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 5 February 2017 at 20:33:06 UTC, berni wrote: With X not known at compile time: auto arr = new int[][](X,X); for (int i=0;i

Re: multi-dimensional arrays, not arrays of arrays

2017-02-18 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 18 February 2017 at 10:37:21 UTC, XavierAP wrote: Does D provide anything like this? Otherwise, was this ever considered and were reasons found not to have it? They are implemented as part of the Mir project. We call them ndslices. https://github.com/libmir/mir-algorithm Docs:

Re: Pointers vs functional or array semantics

2017-02-25 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 25 February 2017 at 11:06:28 UTC, data pulverizer wrote: I have noticed that some numerical packages written in D use pointer semantics heavily (not referring to packages that link to C libraries). I am in the process of writing code for a numerical computing library and would

Re: MurmurHash3 behaviour

2016-08-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 19 August 2016 at 20:28:13 UTC, Cauterite wrote: Regarding the MurmurHash3 implementation in core.internal.hash, it is my understanding that: // assuming a and b are uints bytesHash([a, b], 0) == bytesHash([b], bytesHash([a], 0)) Is this correct? I'm just not quite certain of

Re: MurmurHash3 behaviour

2016-08-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 20 August 2016 at 09:15:00 UTC, Ilya Yaroshenko wrote: On Friday, 19 August 2016 at 20:28:13 UTC, Cauterite wrote: Regarding the MurmurHash3 implementation in core.internal.hash, it is my understanding that: // assuming a and b are uints bytesHash([a, b], 0) ==

Re: ndslice and RC containers

2016-09-25 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 22 September 2016 at 20:23:57 UTC, Nordlöw wrote: On Thursday, 22 September 2016 at 13:30:28 UTC, ZombineDev wrote: ndslice (i.e. Slice(size_t N, Range) ) is a generalization of D's built-in slices (i.e. T[]) to N dimensions. Just like them, ... Please note that the support for

Re: How to debug (potential) GC bugs?

2016-10-04 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 25 September 2016 at 16:23:11 UTC, Matthias Klumpp wrote: Hello! I am working together with others on the D-based appstream-generator[1] project, which is generating software metadata for "software centers" and other package-manager functionality on Linux distributions, and is used

Re: ndslice and RC containers

2016-09-22 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 22 September 2016 at 13:30:28 UTC, ZombineDev wrote: On Thursday, 22 September 2016 at 12:38:57 UTC, Nordlöw wrote: [...] ndslice (i.e. Slice(size_t N, Range) ) is a generalization of D's built-in slices (i.e. T[]) to N dimensions. Just like them, it doesn't handle memory

Re: Fast multidimensional Arrays

2016-08-29 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 29 August 2016 at 15:46:26 UTC, Steinhagelvoll wrote: On Monday, 29 August 2016 at 14:55:50 UTC, Seb wrote: On Monday, 29 August 2016 at 14:43:08 UTC, Steinhagelvoll wrote: It is quite surprising that there is this much of a difference, even when all run sequential. I believe this

Re: Floating-point Modulus math.fmod

2016-11-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 6 November 2016 at 21:45:28 UTC, Fendercaster wrote: I'm not quite sure if this is the right forum to ask this question: I've been trying to implement the "floating-point modulus" function from the math library. Equivalently that's what I've tried in Python too. Problem is - the

Re: Complex numbers are harder to use than in C

2016-11-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 19 November 2016 at 19:42:27 UTC, Marduk wrote: On Saturday, 19 November 2016 at 16:17:08 UTC, Meta wrote: On Saturday, 19 November 2016 at 09:38:38 UTC, Marduk wrote: [...] D used to support complex numbers in the language (actually it still does, they're just deprecated).

Re: Making floating point deterministic cross diffrent platforms/hardware

2016-11-20 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 20 November 2016 at 21:42:30 UTC, ketmar wrote: On Sunday, 20 November 2016 at 21:31:09 UTC, Guillaume Piolat wrote: I think you can roughly have that with ldc, always using SSE and the same rounding-mode. ARM. oops. No problem with ARM + x86 for double and float.

Re: Neural Networks / ML Libraries for D

2016-10-26 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 25 October 2016 at 13:56:45 UTC, Saurabh Das wrote: On Tuesday, 25 October 2016 at 11:55:27 UTC, maarten van damme wrote: There is mir https://github.com/libmir/mir which is geared towards machine learning, I don't know if it has anything about neural networks, I've yet to use it.

Re: [Semi-OT] I don't want to leave this language!

2016-12-08 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 8 December 2016 at 09:57:21 UTC, Guillaume Piolat wrote: On Wednesday, 7 December 2016 at 12:12:56 UTC, Ilya Yaroshenko wrote: R, Matlab, Python, Mathematica, Gauss, and Julia use C libs. --Ilya As a C lib, you have the possibility of not initializing the runtime, which leaves

extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
It was in DMD sources. How it can be used? Are methods virtual? How multiple inheritance works? Can this be used in betterC mode? What different between classes in C++? Thanks, Ilya

BetterC classes

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
Hi Is it possible to use classes, which do not have monitor and other DRuntime stuff? Object can be allocated/deallocated using allocators, but they are very complex for betterC mode (monitor, mutex, object.d dependency). Can we have something more primitive? Ilya

Re: extern(C++) struct - what is it?

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 16 December 2016 at 13:02:11 UTC, Nicholas Wilson wrote: On Friday, 16 December 2016 at 12:40:19 UTC, Ilya Yaroshenko wrote: [...] Like any other struct. [...] Thank you Nicholas

Re: [Semi-OT] I don't want to leave this language!

2016-12-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 13:14:52 UTC, Kagamin wrote: On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote: Good D code should be nothrow, @nogc, and betterC. BetterC means that it must not require DRuntime to link and to start. Without runtime you won't have asserts (C

Re: [Semi-OT] I don't want to leave this language!

2016-12-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 11:48:32 UTC, bachmeier wrote: On Wednesday, 7 December 2016 at 06:17:17 UTC, Picaud Vincent wrote: Considering scientific/numerical applications, I do agree with Ilya: it is mandatory to have zero overhead and a straightforward/direct interoperability with C.

Re: [Semi-OT] I don't want to leave this language!

2016-12-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 7 December 2016 at 12:36:49 UTC, Dejan Lekic wrote: On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote: Good D code should be nothrow, @nogc, and betterC. BetterC means that it must not require DRuntime to link and to start. I started Mir as scientific/numeric

Re: [Semi-OT] I don't want to leave this language!

2016-12-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 6 December 2016 at 17:00:35 UTC, Jonathan M Davis wrote: So, while there are certainly folks who would prefer using D as a better C without druntime or Phobos, I think that you're seriously overestimating how many folks would be interested in that. Certainly, all of the C++

Re: BetterC classes

2016-12-16 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 16 December 2016 at 16:24:18 UTC, Daniel N wrote: On Friday, 16 December 2016 at 15:17:15 UTC, Ilya Yaroshenko wrote: Hi Is it possible to use classes, which do not have monitor and other DRuntime stuff? Object can be allocated/deallocated using allocators, but they are very

Re: [Semi-OT] I don't want to leave this language!

2016-12-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
Hi e-y-e, The main problem with D for production is its runtime. GC, DRuntime, Phobos is big constraint for real world software production. Good D code should be nothrow, @nogc, and betterC. BetterC means that it must not require DRuntime to link and to start. I started Mir as

Re: [Semi-OT] I don't want to leave this language!

2016-12-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 6 December 2016 at 08:14:17 UTC, Andrea Fontana wrote: On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko Phobos/Druntime are pretty good for a lot of projects. In theory

Re: [Semi-OT] I don't want to leave this language!

2016-12-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 5 December 2016 at 20:49:50 UTC, e-y-e wrote: On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote: [...] You know from the 15th December I will have a month of free time, and I would love to get myself up to speed with Mir to contribute to it. If you don't mind me

Re: [Semi-OT] I don't want to leave this language!

2016-12-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 6 December 2016 at 13:02:16 UTC, Andrei Alexandrescu wrote: On 12/6/16 3:28 AM, Ilya Yaroshenko wrote: On Tuesday, 6 December 2016 at 08:14:17 UTC, Andrea Fontana wrote: On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko Phobos/Druntime are pretty good for a lot of

Re: BitArray Slicing

2016-12-21 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 21 December 2016 at 09:08:51 UTC, Ezneh wrote: Hi, in one of my projects I have to get a slice from a BitArray. I am trying to achieve that like this : void foo(BitArray ba) { auto slice = ba[0..3]; // Assuming it has more than 4 elements } The problem is that I get an

Re: BitArray Slicing

2016-12-21 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 21 December 2016 at 12:00:57 UTC, Ezneh wrote: On Wednesday, 21 December 2016 at 11:49:06 UTC, Ilya Yaroshenko wrote: [...] Thanks, I'll check that solution to see if it fits my needs. As an off-topic question, is there any plan in Mir to implement the Tiny Mersenne Twister[1]

Re: ndslice summary please

2017-04-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Thursday, 13 April 2017 at 15:00:16 UTC, Dejan Lekic wrote: On Thursday, 13 April 2017 at 10:00:43 UTC, 9il wrote: On Thursday, 13 April 2017 at 08:47:16 UTC, Ali Çehreli wrote: [...] The reasons to use mir-algorithm instead of std.range, std.algorithm, std.functional (when applicable):

Re: DIP-1000 and return

2017-03-08 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 2 January 2017 at 15:28:57 UTC, Nordlöw wrote: Should I file a bug report? Yes please

Re: Why doesn't this chain of ndslices work?

2017-03-06 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 15 May 2016 at 12:30:03 UTC, Stiff wrote: On Sunday, 15 May 2016 at 08:31:17 UTC, 9il wrote: On Saturday, 14 May 2016 at 21:59:48 UTC, Stiff wrote: Here's the code that doesn't compile: import std.stdio, std.experimental.ndslice, std.range, std.algorithm; [...] Coming soon

Re: problem with opIndex

2017-09-29 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 29 September 2017 at 19:31:14 UTC, Joseph wrote: I am trying to have a multi-dimensional array and opIndex has to have both an arbitrary number of parameters and allow for slicing. You may want to look into ndslice package source code [1] --Ilya [1]

Re: how to use unknown size of array at compile time for further processing

2017-10-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Sunday, 1 October 2017 at 14:23:54 UTC, thorstein wrote: [...] Sorry, I'm still really confused with the results from my function: [...] Replace arrayT ~= rowT; with arrayT ~= rowT.dup; Also, you may want to look into ndslice package [1]. [1] https://github.com/libmir/mir-algorith

Re: Best syntax for a diagonal and vertical slice

2017-08-26 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 22 July 2017 at 20:55:06 UTC, kerdemdemir wrote: We have awesome way for creating slices like: a = new int[5]; int[] b = a[0..2]; But what about if I have 2D array and I don't want to go vertical. Something like : int[3][3] matrix = [ [ 1, 2, 3 ], [ 4, 5, 6 ],

Re: 24-bit int

2017-09-01 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as such? This is for 24-bit stuff like audio. It would respect endianness, allow for arrays int24[] that work properly, etc. Hi, Probably you

Re: 24-bit int

2017-09-02 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 2 September 2017 at 03:29:20 UTC, EntangledQuanta wrote: On Saturday, 2 September 2017 at 02:49:41 UTC, Ilya Yaroshenko wrote: On Friday, 1 September 2017 at 19:39:14 UTC, EntangledQuanta wrote: Is there a way to create a 24-bit int? One that for all practical purposes acts as

Re: Double ended arrays?

2017-10-07 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 7 October 2017 at 07:38:47 UTC, Chirs Forest wrote: I have some data that I want to store in a dynamic 2d array... I'd like to be able to add elements to the front of the array and access those elements with negative integers as well as add numbers to the back that I'd acess

Re: @nogc formattedWrite

2017-10-09 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 7 October 2017 at 18:14:00 UTC, Nordlöw wrote: Is it currently possible to somehow do @nogc formatted output to string? I'm currently using my `pure @nogc nothrow` array-container `CopyableArray` as @safe pure /*TODO nothrow @nogc*/ unittest { import std.format :

Why 2 ^^ 1 ^^ 2 = 2?

2017-10-22 Thread Ilya Yaroshenko via Digitalmars-d-learn
.. i thought it should be (2 ^^ 1) ^^ 2 = 4

Re: Difference in reduce in std and mir

2017-12-29 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 26 December 2017 at 16:12:07 UTC, Seb wrote: On Tuesday, 26 December 2017 at 15:56:19 UTC, Vino wrote: Hi All, What is the difference between std.algorithm.reduce and mir.ndslice.algorithm.reduce. From, Vino.B Mir's reduce works on Slices whereas Phobos's reduce works on

Re: Help using lubeck on Windows

2018-02-23 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Friday, 23 February 2018 at 12:13:11 UTC, Arredondo wrote: Help using lubeck on Windows I'd like to experiment with linear algebra in D, and it looks like lubeck is the way to do it right now. However, I'm having a hard time dealing with the CBLAS and LAPACK dependencies. I downloaded