On Monday, 16 January 2017 at 14:47:23 UTC, Era Scarecrow wrote:
static char[1024*4] buffer; //4k reusable buffer, NOT
thread safe
Maybe I'm wrong, but I think it's thread safe. Because static
mutable non-shared variables are stored in TLS.
On Thursday, 26 January 2017 at 23:10:02 UTC, albert-j wrote:
On Thursday, 26 January 2017 at 13:21:38 UTC, Dukc wrote:
import std.stdio, std.algorithm, std.range, std.array;
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b = [3, 4, 6];
auto sortedB = sort(b.dup);
auto c = a
. filter!(i =>
On Tuesday, 17 January 2017 at 11:40:15 UTC, Nestor wrote:
Thanks, but unfortunately this function does not produce proper
UTF8 strings, as a matter of fact the output even starts with
the BOM. Also it doesn't handle CRLF, and even for LF
terminated lines it doesn't seem to work for lines
On Thursday, 26 January 2017 at 13:21:38 UTC, Dukc wrote:
import std.stdio, std.algorithm, std.range, std.array;
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b = [3, 4, 6];
auto sortedB = sort(b.dup);
auto c = a
. filter!(i => !sortedB.contains(i))
. array
;
assert(c == [1, 2, 5, 7]);
If
On Thursday, 26 January 2017 at 19:30:54 UTC, Suliman wrote:
But I still not understand where the data is location in first
variant?
It is stored in the file itself. The File struct is pretty small,
it just provides access to the contents of the file, it doesn't
actually hold that content
In the past I asked Adam about when I should use keyword `new`
with structures and got next answer:
"The File in the first one is put on the stack as a reference
counted
local object whereas the second one would be on the garbage
collected
heap, which often isn't what you want for files since
On Thursday, 26 January 2017 at 08:22:09 UTC, albert-j wrote:
What is the D idiom for removing array elements that are
present in another array?
Is this the right/fastest way?
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b = [3, 4, 6];
auto c = a.remove!(x => b.canFind(x));
assert(c == [1, 2, 5,
On Thursday, 26 January 2017 at 19:01:41 UTC, Tofu Ninja wrote:
Actually.. if I do dub describe on the root package it lists
both the exe and the lib as targets but the build settings for
the lib has "targetType": 6 which according to
dub/source/dub/compilers/buildsettings.d is
On Thursday, 26 January 2017 at 18:26:27 UTC, Tofu Ninja wrote:
On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote:
On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
Is this not doable?
I guess an alternative question, is there any way to have
multiple binaries(an
On Thursday, 26 January 2017 at 18:42:29 UTC, Suliman wrote:
On Thursday, 26 January 2017 at 17:52:24 UTC, H. S. Teoh wrote:
On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via
Digitalmars-d-learn wrote:
I read docs and can't understand what's wrong. Or I am do not
understand it, or there is
On Thursday, 26 January 2017 at 17:52:24 UTC, H. S. Teoh wrote:
On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via
Digitalmars-d-learn wrote:
I read docs and can't understand what's wrong. Or I am do not
understand it, or there is come mistake.
Let's look at function
On Thursday, 26 January 2017 at 18:10:12 UTC, Tofu Ninja wrote:
On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
Is this not doable?
I guess an alternative question, is there any way to have
multiple binaries(an executable and a bunch of shared libs)
built from a single dub
On Thursday, 26 January 2017 at 18:00:57 UTC, Tofu Ninja wrote:
Is this not doable?
I guess an alternative question, is there any way to have
multiple binaries(an executable and a bunch of shared libs) built
from a single dub package? Or should I just give up on trying to
use dub for
On Sunday, 22 January 2017 at 08:16:49 UTC, Tofu Ninja wrote:
Trying to get a dub sub package to output as a shared lib but
for some reason I can only get it to output as a static lib.
dub.json
---
{
"name": "tofueng",
"targetType": "executable",
"targetPath" : "game",
On Thu, Jan 26, 2017 at 05:38:59PM +, Suliman via Digitalmars-d-learn wrote:
> I read docs and can't understand what's wrong. Or I am do not understand it,
> or there is come mistake.
>
> Let's look at function https://dlang.org/phobos/std_stdio.html#.File.byLine
>
> auto byLine(Terminator =
On Thursday, 26 January 2017 at 17:38:59 UTC, Suliman wrote:
I read docs and can't understand what's wrong. Or I am do not
understand it, or there is come mistake.
[...]
You have to import typecons.
On Thursday, 26 January 2017 at 11:44:27 UTC, Nicholas Wilson
wrote:
On Thursday, 26 January 2017 at 08:22:09 UTC, albert-j wrote:
What is the D idiom for removing array elements that are
present in another array?
Is this the right/fastest way?
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b =
I read docs and can't understand what's wrong. Or I am do not
understand it, or there is come mistake.
Let's look at function
https://dlang.org/phobos/std_stdio.html#.File.byLine
auto byLine(Terminator = char, Char = char)(KeepTerminator
keepTerminator = No.keepTerminator, Terminator
On Thursday, 26 January 2017 at 05:20:07 UTC, Profile Anaysis
wrote:
(On the contrary, declarations in C or C++ looks rather
unintuitive from this perspective: `T a[4][5][6]` is means
that `a` is an array of 4 arrays of 5 arrays of 6 arrays of
`T`. Note how we have to read left-to-right but
On Thursday, 26 January 2017 at 08:22:09 UTC, albert-j wrote:
What is the D idiom for removing array elements that are
present in another array?
Is this the right/fastest way?
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b = [3, 4, 6];
auto c = a.remove!(x => b.canFind(x));
assert(c == [1, 2, 5,
On Thursday, January 26, 2017 05:44:04 Profile Anaysis via Digitalmars-d-
learn wrote:
> I am using static arrays because the size of the matrix is fixed.
> I need to allocate them though because that is what my
> matrix_history contains.
If I understood correctly, you want a dynamic array of
Sorry. I mistyped some of my examples. Obviously dropped some
news:
auto a = new int[](4);
auto b = new int[][](4);
And the static arrays should be:
int[4] c;
int[][4] d;
And I would also like managed to overlook there is no static
array in sight here:
auto y = new int[1][2][][](3,4);
The
On Thursday, 26 January 2017 at 05:50:03 UTC, Profile Anaysis
wrote:
It is inconsistent with dynamic arrays and mixing them creates
a mess in the order of indices.
I best someone was asleep at the wheel when programming the
code for static arrays. (probably someone different than who
What is the D idiom for removing array elements that are present
in another array?
Is this the right/fastest way?
int[] a = [1, 2, 3, 4, 5, 6, 7, 4];
int[] b = [3, 4, 6];
auto c = a.remove!(x => b.canFind(x));
assert(c == [1, 2, 5, 7]);
On Wednesday, 25 January 2017 at 22:59:55 UTC, Jonathan M Davis
wrote:
So, yes, if all you're planning to do is look at the pointer to
the first element in the array, then [0] is safer, but odds
are quite low that that's actually what you're going to do, and
in all of the other cases, you
25 matches
Mail list logo