On Thursday, 9 February 2017 at 21:36:46 UTC, Ali Çehreli wrote:
On 02/09/2017 12:44 PM, jmh530 wrote:
> I think the issue is that create_file doesn't write to
stdout, it writes
> to file.
Correct. Pipe works by piping the standard input/output streams.
> Other than reading the file and then d
On Thursday, 9 February 2017 at 16:20:29 UTC, berni wrote:
dmd only compiles in the files you actually pass to it. rdmd
will try to find the required files automatically.
Since you didn't pass the file with the function to dmd, it
knows it exists, but leaves it out of the final link (it
assum
On Thursday, 9 February 2017 at 19:39:49 UTC, Nestor wrote:
OK I changed the approach using a multidimensional array for
the matrix so I could ditch arithmetic operations altogether,
but curiously after measuring a few thousand runs of both
implementations through avgtime, I see no noticeable
Dne 9.2.2017 v 23:08 Ali Çehreli via Digitalmars-d-learn napsal(a):
On 02/09/2017 02:04 PM, Nestor wrote:
> I tried running each algoritm a few times through avgtime using
> different digit lengths
avgtime profiles the whole process, right? It measures everything that
is involved in that litt
On 02/09/2017 02:04 PM, Nestor wrote:
> I tried running each algoritm a few times through avgtime using
> different digit lengths
avgtime profiles the whole process, right? It measures everything that
is involved in that little program. At least OS starting the program, D
runtime initializing,
On Thursday, 9 February 2017 at 21:43:08 UTC, Daniel Kozak wrote:
Any idea of what might be happening here?
Did you try it with different backends? llvm (ldc), gcc(gdc)?
Not really, just standard dmd.
I tried running each algoritm a few times through avgtime using
different digit lengths (up
Dne 9.2.2017 v 22:29 Nestor via Digitalmars-d-learn napsal(a):
On Thursday, 9 February 2017 at 20:46:06 UTC, Daniel Kozak wrote:
Maybe you can try use static array instead of dynamic
static immutable ubyte[10][10] QG10Matrix = ...
I shaved it to this to discard unneccessary time-consuming fun
On 02/09/2017 12:44 PM, jmh530 wrote:
> I think the issue is that create_file doesn't write to stdout, it writes
> to file.
Correct. Pipe works by piping the standard input/output streams.
> Other than reading the file and then deleting it, I don't know
> what else to try.
create_file must wri
On Thursday, 9 February 2017 at 20:46:06 UTC, Daniel Kozak wrote:
Maybe you can try use static array instead of dynamic
static immutable ubyte[10][10] QG10Matrix = ...
I shaved it to this to discard unneccessary time-consuming
functions:
static immutable ubyte[10][10] QG10Matrix = [
[0,3,1
On Thursday, 9 February 2017 at 19:39:49 UTC, Nestor wrote:
On Thursday, 9 February 2017 at 18:34:30 UTC, Era Scarecrow
wrote:
On Thursday, 9 February 2017 at 17:36:11 UTC, Nestor wrote:
I was trying to port C code from the article in Wikiversity
[1] to D, but I'm not sure this implementation i
Dne 9.2.2017 v 21:10 berni via Digitalmars-d-learn napsal(a):
On Thursday, 9 February 2017 at 19:10:55 UTC, Daniel Kozak wrote:
Dne 9.2.2017 v 17:20 berni via Digitalmars-d-learn napsal(a):
[...]
Ah ok, I understand. So calling with "dmd Special/special.d
Common/common.d" works.
But when
Dne 9.2.2017 v 20:39 Nestor via Digitalmars-d-learn napsal(a):
On Thursday, 9 February 2017 at 18:34:30 UTC, Era Scarecrow wrote:
On Thursday, 9 February 2017 at 17:36:11 UTC, Nestor wrote:
I was trying to port C code from the article in Wikiversity [1] to
D, but I'm not sure this implementati
I haven't used std.process before and am trying to play around
with it.
In the code below, the first file writes some text to an output
file. My goal is to be able to read what is written to that file
without creating the file itself. I'm not sure it's possible, but
the second file is my atte
On Thursday, 9 February 2017 at 19:10:55 UTC, Daniel Kozak wrote:
Dne 9.2.2017 v 17:20 berni via Digitalmars-d-learn napsal(a):
[...]
Ah ok, I understand. So calling with "dmd Special/special.d
Common/common.d" works.
But when I compile common.d to common.o (with dmd -c common.d)
and remo
On Thursday, 9 February 2017 at 18:34:30 UTC, Era Scarecrow wrote:
...
Actually since you're also multiplying by 10, you can
incorporate that in the table too...
I forgot to comment that what is multiplied by ten is not the
value but the starting position in the array (a way to emulate a
mat
On Thursday, 9 February 2017 at 18:34:30 UTC, Era Scarecrow wrote:
On Thursday, 9 February 2017 at 17:36:11 UTC, Nestor wrote:
I was trying to port C code from the article in Wikiversity
[1] to D, but I'm not sure this implementation is the most
efficient way to do it in D, so suggestions to op
Dne 9.2.2017 v 17:20 berni via Digitalmars-d-learn napsal(a):
dmd only compiles in the files you actually pass to it. rdmd will try
to find the required files automatically.
Since you didn't pass the file with the function to dmd, it knows it
exists, but leaves it out of the final link (it as
On Thursday, 9 February 2017 at 17:36:11 UTC, Nestor wrote:
I was trying to port C code from the article in Wikiversity [1]
to D, but I'm not sure this implementation is the most
efficient way to do it in D, so suggestions to optimize it are
welcome:
import std.stdio;
static immutable char[]
On Thursday, 9 February 2017 at 17:36:11 UTC, Nestor wrote:
Hi,
I was trying to port C code from the article in Wikiversity [1]
to D, but I'm not sure this implementation is the most
efficient way to do it in D, so suggestions to optimize it are
welcome:
import std.stdio;
static immutable
Hi,
I was trying to port C code from the article in Wikiversity [1]
to D, but I'm not sure this implementation is the most efficient
way to do it in D, so suggestions to optimize it are welcome:
import std.stdio;
static immutable char[] QG10Matrix =
"031759864270921548634206871359175098342
Hi,
I was trying to run the example code from
https://dlang.org/phobos/std_stdio.html#.File.lockingBinaryWriter
which is very short, as follows.
===
import std.algorithm, std.range, std.stdio;
void main()
{
enum size = 500;
writef("P5\n%d %d %d\n", size, size, ubyte.max);
On Wednesday, 8 February 2017 at 17:57:49 UTC, kinke wrote:
On Wednesday, 8 February 2017 at 17:21:03 UTC, Oleg B wrote:
If I understand correctly with vanilla LDC I can't
cross-compiling from host linux-x86_64, but with your patch I
can. Right?
Right. Joakim Noah has worked on LDC for Androi
dmd only compiles in the files you actually pass to it. rdmd
will try to find the required files automatically.
Since you didn't pass the file with the function to dmd, it
knows it exists, but leaves it out of the final link (it
assumes it might come from a library or something). That's why
y
On Thu, Feb 09, 2017 at 03:39:18PM +, berni via Digitalmars-d-learn wrote:
> Now I try to run it with rdmd and dmd and get quite different results:
dmd only compiles in the files you actually pass to it. rdmd
will try to find the required files automatically.
Since you didn't pass the file wi
I've got two source files in two directories:
Common/common.d
module common;
import std.stdio;
int main(string[] args)
{
Foo foo = cast(Foo)Object.factory("special.Bar");
foo.do_something();
return 0;
}
abstract class Foo {
abstract void do_something();
}
Special/special.d
On Thursday, 9 February 2017 at 15:00:21 UTC, angel wrote:
On Thursday, 9 February 2017 at 14:39:41 UTC, angel wrote:
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
I'm looking for a better way to do this, if possible:
Or actually, maybe this will suite your case better:
```
templa
On Thursday, 9 February 2017 at 14:39:41 UTC, angel wrote:
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
I'm looking for a better way to do this, if possible:
```
class Tool
{
string name;
}
T namedTool(alias Variable, T)()
{
T result = new T;
result.name = Variable.str
On Thursday, 9 February 2017 at 13:30:07 UTC, jkpl wrote:
I'm looking for a better way to do this, if possible:
```
class Tool
{
string name;
}
T namedTool(alias Variable, T)()
{
T result = new T;
result.name = Variable.stringof;
return result;
}
void main()
{
Tool grep;
I'm looking for a better way to do this, if possible:
```
class Tool
{
string name;
}
T namedTool(alias Variable, T)()
{
T result = new T;
result.name = Variable.stringof;
return result;
}
void main()
{
Tool grep;
grep = namedTool!(grep,Tool);
assert(grep.name == "gr
On Thursday, 9 February 2017 at 11:22:28 UTC, Suliman wrote:
Docs says that:
"The total size of a static array cannot exceed 16Mb."
But when I am creation array of:
int [1000_000] x; // 1000_000 is equal ~ 0,95MB
app crush on start.
Should it's reserve this memory with guaranty? I mean that
aft
On Thursday, 9 February 2017 at 12:13:36 UTC, Daniel Kozák wrote:
V Thu, 09 Feb 2017 11:22:28 +
Suliman via Digitalmars-d-learn
napsáno:
Docs says that:
"The total size of a static array cannot exceed 16Mb."
But when I am creation array of:
int [1000_000] x; // 1000_000 is equal ~ 0,95MB
On Thursday, 9 February 2017 at 12:16:26 UTC, jkpl wrote:
On Thursday, 9 February 2017 at 11:22:28 UTC, Suliman wrote:
Docs says that:
"The total size of a static array cannot exceed 16Mb."
But when I am creation array of:
int [1000_000] x; // 1000_000 is equal ~ 0,95MB
app crush on start.
Shou
On Thursday, 9 February 2017 at 11:22:28 UTC, Suliman wrote:
Docs says that:
"The total size of a static array cannot exceed 16Mb."
But when I am creation array of:
int [1000_000] x; // 1000_000 is equal ~ 0,95MB
app crush on start.
Should it's reserve this memory with guaranty? I mean that
aft
V Thu, 09 Feb 2017 11:22:28 +
Suliman via Digitalmars-d-learn
napsáno:
> Docs says that:
> "The total size of a static array cannot exceed 16Mb."
> But when I am creation array of:
> int [1000_000] x; // 1000_000 is equal ~ 0,95MB
> app crush on start.
>
> Should it's reserve this memory wit
Docs says that:
"The total size of a static array cannot exceed 16Mb."
But when I am creation array of:
int [1000_000] x; // 1000_000 is equal ~ 0,95MB
app crush on start.
Should it's reserve this memory with guaranty? I mean that after
app start it should take +0.95MB of RAM in task manager.
35 matches
Mail list logo