I want to convert a string like " a,b1, 23 " to a
2D array like:
[["a", "b"],
["1", "2"],
["3", "" ]]
auto html = " a,b1, 23 ";
auto rows = html.strip.chomp("").split("");
string[][] data;
rows.each!(a => data ~= a.split(","));
string[][] result = data.map!(a => a.padRight("",
data[0].length
On Friday, 23 February 2018 at 01:54:07 UTC, Leonardo wrote:
Hi, I'm new to language and games.
Many people say that GC is bad and can slow down your project
in some moments.
What can happen if I create a game using D without worrying
with memory management?
(using full GC)
From my experienc
On Saturday, February 24, 2018 04:33:52 psychoticRabbit via Digitalmars-d-
learn wrote:
> On Saturday, 24 February 2018 at 04:22:12 UTC, Jonathan M Davis
>
> wrote:
> > Why is there anything dodgy going on and why would you need
> > contracts? Contracts actually tend to go very badly with
> > gener
On Saturday, 24 February 2018 at 04:22:12 UTC, Jonathan M Davis
wrote:
Why is there anything dodgy going on and why would you need
contracts? Contracts actually tend to go very badly with
generic code, because whatever they assert has to be generic,
and while that works sometimes, more often th
On Sat, Feb 24, 2018 at 02:54:13AM +, Jonathan via Digitalmars-d-learn
wrote:
> I am having trouble finding many useful explanations of using template
> constraints beyond basic usage.
>
> I would like to have a template constrant to enforce that a type can
> be explicitly cast to another typ
On Saturday, February 24, 2018 04:13:30 psychoticRabbit via Digitalmars-d-
learn wrote:
> On Saturday, 24 February 2018 at 03:58:48 UTC, Jonathan M Davis
>
> wrote:
> > Whether an implicit cast or an explicit cast makes more sense
> > depends entirely on what the code is doing, but either way, the
On Saturday, 24 February 2018 at 03:58:48 UTC, Jonathan M Davis
wrote:
Whether an implicit cast or an explicit cast makes more sense
depends entirely on what the code is doing, but either way, the
conversion needs to be forced inside the function, or you end
up with bugs. Far too often, when
On Saturday, February 24, 2018 03:48:44 psychoticRabbit via Digitalmars-d-
learn wrote:
> On Saturday, 24 February 2018 at 03:43:25 UTC, Jonathan M Davis
>
> wrote:
> > That does not do what the OP requested at all. That tests
> > whether T is one of byte, ubyte, short, ushort, int, uint,
> > long,
On Saturday, 24 February 2018 at 03:43:25 UTC, Jonathan M Davis
wrote:
That does not do what the OP requested at all. That tests
whether T is one of byte, ubyte, short, ushort, int, uint,
long, and ulong, whereas what the OP wants is to test whether T
can be cast to int.
- Jonathan M Davis
On Saturday, 24 February 2018 at 03:30:45 UTC, psychoticRabbit
wrote:
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
I am having trouble finding many useful explanations of using
template constraints beyond basic usage.
I would like to have a template constrant to enforce that
On Saturday, February 24, 2018 03:30:45 psychoticRabbit via Digitalmars-d-
learn wrote:
> On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
> > I am having trouble finding many useful explanations of using
> > template constraints beyond basic usage.
> >
> > I would like to have a temp
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
I am having trouble finding many useful explanations of using
template constraints beyond basic usage.
I would like to have a template constrant to enforce that a
type can be explicitly cast to another type:
void (T)(T t)
On Saturday, February 24, 2018 03:04:53 psychoticRabbit via Digitalmars-d-
learn wrote:
> On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
> > I am having trouble finding many useful explanations of using
> > template constraints beyond basic usage.
> >
> > I would like to have a temp
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
I am having trouble finding many useful explanations of using
template constraints beyond basic usage.
I would like to have a template constrant to enforce that a
type can be explicitly cast to another type:
void (T)(T t)
On Saturday, 24 February 2018 at 02:54:13 UTC, Jonathan wrote:
I am having trouble finding many useful explanations of using
template constraints beyond basic usage.
The constraint is just like static if as to what it allows
inside, so you can check almost anything in there.
Like for the cas
On Saturday, February 24, 2018 02:54:13 Jonathan via Digitalmars-d-learn
wrote:
> I am having trouble finding many useful explanations of using
> template constraints beyond basic usage.
>
> I would like to have a template constrant to enforce that a type
> can be explicitly cast to another type:
I am having trouble finding many useful explanations of using
template constraints beyond basic usage.
I would like to have a template constrant to enforce that a type
can be explicitly cast to another type:
void (T)(T t)
if (cast(int) T)//force `cast(int) T` to be possible
On Friday, 23 February 2018 at 23:11:13 UTC, aberba wrote:
I recently noticed vibe.d now using main loop which call the
vibe.d event loop. Why that change?
Like:
#!/usr/bin/env dub
/+ dub.sdl:
name "hello_vibed"
dependency "vibe-d" version="~>0.8.0"
+/
import vibe.d;
void main()
{
auto se
I recently noticed vibe.d now using main loop which call the
vibe.d event loop. Why that change?
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 the
On Thursday, 22 February 2018 at 04:16:44 UTC, Nick Sabalausky
(Abscissa) wrote:
Are there any tutorials or articles out there for "getting
started with converting a C++ codebase to D one module at a
time?" Or at the very least: tips, tricks, lessions learned,
from those who have come before.
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 the
On Thursday, 22 February 2018 at 08:43:24 UTC, ketmar wrote:
Nick Sabalausky (Abscissa) wrote:
[...]
from my experience (various codebases up to middle size, mostly
C, some C++): fsck the "one module at a time" idea! even in D
modules are interwined, and in C and C++ they're even more so.
On Thursday, 22 February 2018 at 21:12:45 UTC, JN wrote:
Is this expected behaviour?
bar.d
---
void foo(string s)
{
}
app.d
---
import std.stdio;
import bar;
void foo(int x)
{
}
void main()
{
foo("hi");
};
===
Error: function app.foo (int x) is not callable using argument
types (string
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 the OpenBLAS binaries for Windows (libopenblas.dll),
but I am clu
On Friday, 23 February 2018 at 01:54:07 UTC, Leonardo wrote:
What can happen if I create a game using D without worrying
with memory management?
(using full GC)
If you do not worry about memory management at all, it will
probably lead to a need to redesign your game. And that's
regardless wh
On Friday, 23 February 2018 at 01:54:07 UTC, Leonardo wrote:
Hi, I'm new to language and games.
Many people say that GC is bad and can slow down your project
in some moments.
What can happen if I create a game using D without worrying
with memory management?
(using full GC)
Most people who s
27 matches
Mail list logo