Re: Indexed graphics for retro engine?

2019-09-18 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 19 September 2019 at 03:47:05 UTC, Shadowblitz16 wrote: Is there a way to make a indexed graphics library that can handle importing and exporting true color images? I don't see why not. I would guess something like this could be simulated with pointers and references right?

Re: combining libraries into 1 or 1 for each system?

2019-09-18 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 19 September 2019 at 03:44:28 UTC, Shadowblitz16 wrote: let's say I have a project the relies on multiple packages.. is it possible to combine these libraries into a single one (or 1 per os) for final shipment of a program? I assume you're referring to dub packages, in which case

Re: Collect Statistics efficiently and easily

2019-09-18 Thread Brett via Digitalmars-d-learn
On Tuesday, 17 September 2019 at 14:06:41 UTC, Paul Backus wrote: On Tuesday, 17 September 2019 at 01:53:39 UTC, Brett wrote: Many times I have to get statistical info which is simply compute statistics on a data set that may be generating or already generated. The code usually is M =

Re: Indexed graphics for retro engine?

2019-09-18 Thread Shadowblitz16 via Digitalmars-d-learn
*indexed color images and shapes

Indexed graphics for retro engine?

2019-09-18 Thread Shadowblitz16 via Digitalmars-d-learn
Is there a way to make a indexed graphics library that can handle importing and exporting true color images? I would guess something like this could be simulated with pointers and references right?

Re: Indexed graphics for retro engine?

2019-09-18 Thread Shadowblitz16 via Digitalmars-d-learn
oh I would also like to be able to draw indexed images shapes as well.

combining libraries into 1 or 1 for each system?

2019-09-18 Thread Shadowblitz16 via Digitalmars-d-learn
let's say I have a project the relies on multiple packages.. is it possible to combine these libraries into a single one (or 1 per os) for final shipment of a program?

How do I install modules into my project?

2019-09-18 Thread Shadowblitz16 via Digitalmars-d-learn
how do I install modules into my project? I have installed dub and tried doing "dub add tkd" and "dub install tkd" to install this library https://github.com/nomad-software/tkd however I get this error when building.. Severity Code Description Project FileLineSuppression State

Re: Is there a way to do the same thing in entry and return of a bunch of functions?

2019-09-18 Thread Stefanos Baziotis via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 01:03:27 UTC, Nicholas Wilson wrote: I think a mixin that does string LOG_SCOPE = q{ callDepth++; scope(exit) callDepth--; } is probably the easiest. for bonus points string LOG_SCOPE = q{ callDepth++; debug_log(__FUNCTION__);// or __PRETTY_FUNTION__

Re: Deprecation message sources

2019-09-18 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-09-17 22:55, Johan Engelen wrote: Wow. How come this is not caught by the CI testing? That issue seems to be because "writeln" is printing "type", which is an enum. For enums, "writeln" prints the actual name of the enum member and not the value. It seems it extracts the names of

Re: Deprecation message sources

2019-09-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/18/19 11:09 AM, H. S. Teoh wrote: On Wed, Sep 18, 2019 at 10:48:27AM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: On 9/17/19 8:14 PM, Jonathan M Davis wrote: [...] I suspect that deprecation messages are being triggered simply by code trying to use Nullable in template

Re: segmentation fault when running void main() {}

2019-09-18 Thread berni via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:57:53 UTC, ag0aep6g wrote: You're probably hitting this issue: https://issues.dlang.org/show_bug.cgi?id=19116 Yes, sounds similar. I tried PR 9981, but that didn't work on my machine. Similar message, just an other file, that cannot be compiled

Re: Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Sep 18, 2019 at 12:37:28PM +, Simen Kjærås via Digitalmars-d-learn wrote: [...] > template MergeOverloads(T...) { > alias MergeOverloads = T[0]; > static if (T.length > 1) { > alias MergeOverloads = MergeOverloads!(T[1..$]); > } > } > > I would however label that

Re: Deprecation message sources

2019-09-18 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Sep 18, 2019 at 10:48:27AM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 9/17/19 8:14 PM, Jonathan M Davis wrote: [...] > > I suspect that deprecation messages are being triggered simply by > > code trying to use Nullable in template constraints rather than just > > when

Re: static if (is (T==Complex))

2019-09-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/18/19 7:10 AM, berni wrote: Is it possible to simplfy this? static if (is (T==Complex!double) || is (T==Complex!float) || is (T==Complex!real)) https://dlang.org/phobos/std_traits.html#TemplateOf import std.traits : TemplateOf; static if(__traits(isSame, TemplateOf!T, Complex))

Re: Deprecation message sources

2019-09-18 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/17/19 8:14 PM, Jonathan M Davis wrote: On Tuesday, September 17, 2019 2:34:00 PM MDT Steven Schveighoffer via Digitalmars-d-learn wrote: On 9/17/19 4:16 PM, Anonymouse wrote: On Tuesday, 17 September 2019 at 19:31:53 UTC, Steven Schveighoffer wrote: I'd hate to say the answer is to

Re: Program exited with code -11

2019-09-18 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:36:30 UTC, Arjan wrote: On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends "Program exited with code -11" Not signal 11? On unix/linux I assume? Same thing. This is a segmentation fault. Compile the program with the -g switch to dmd, then

Re: segmentation fault when running void main() {}

2019-09-18 Thread ag0aep6g via Digitalmars-d-learn
On 17.09.19 20:03, berni wrote: I'm trying to install D on my old 32-bit machine (debian stable). First I tried to install a precompiled version and now I followed [1]. In both cases, I always get a segmentation fault when I try to run a compiled program. You're probably hitting this issue:

Re: Program exited with code -11

2019-09-18 Thread Danny Arends via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:36:30 UTC, Arjan wrote: On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends wrote: Hey all, "Program exited with code -11" Not signal 11? On unix/linux I assume? It's on linux yes... No idea if it is a signal or an exitcode, the only

Re: Program exited with code -11

2019-09-18 Thread Arjan via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 13:22:03 UTC, Danny Arends wrote: Hey all, "Program exited with code -11" Not signal 11? On unix/linux I assume?

Program exited with code -11

2019-09-18 Thread Danny Arends via Digitalmars-d-learn
Hey all, I have written some code to analyze massive gzipped files (using std.iopipe), tested it on small subsets of the gzip files, and everything works using small 20 to 50 Mb files. However when I try to run the code on 2.7 Gb file sizes the program always crashes with the following

Re: Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread berni via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 12:37:28 UTC, Simen Kjærås wrote: How to resolve this, though? The simplest solution is to not use selective imports: import std.math; import std.complex; writeln(abs(complex(1.0,1.0))); writeln(abs(1.0)); That works. But: I'm trying to

Re: When should we use Modules and when Should we use Classes?

2019-09-18 Thread Adam D. Ruppe via Digitalmars-d-learn
You can only have one instance of a module, so it is really more a collection of types, functions, etc. that help each other do a particular job. Then structs and classes can have multiple objects of each type so you use them to do most the stuff you run. You can make class objects in a loop

Re: Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 12:03:28 UTC, berni wrote: The following code doesn't compile: import std.stdio; void main() { import std.complex: abs, complex; import std.math: abs; auto a = complex(1.0,1.0); auto b = 1.0; writeln(abs(a)); writeln(abs(b)); } The

Re: Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread Daniel Kozak via Digitalmars-d-learn
On Wed, Sep 18, 2019 at 2:05 PM berni via Digitalmars-d-learn wrote: > > The following code doesn't compile: > > >import std.stdio; > > > >void main() > >{ > >import std.complex: abs, complex; > >import std.math: abs; > > > >auto a = complex(1.0,1.0); > >auto b = 1.0; > > > >

Re: Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread Andrea Fontana via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 12:03:28 UTC, berni wrote: The following code doesn't compile: import std.stdio; void main() { import std.complex: abs, complex; import std.math: abs; auto a = complex(1.0,1.0); auto b = 1.0; writeln(abs(a)); writeln(abs(b)); } What

Problem with using std.math: abs and std.complex: abs at the same time

2019-09-18 Thread berni via Digitalmars-d-learn
The following code doesn't compile: import std.stdio; void main() { import std.complex: abs, complex; import std.math: abs; auto a = complex(1.0,1.0); auto b = 1.0; writeln(abs(a)); writeln(abs(b)); } The error message depends on the order of the two import statements.

Re: static if (is (T==Complex))

2019-09-18 Thread berni via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 11:25:21 UTC, Norm wrote: I usually do something like the following: Ah great. I was looking for "is(T == Complex!R, R)". :-) Thanks!

DUB WTF?

2019-09-18 Thread Daniel Kozak via Digitalmars-d-learn
Why is dub automaticaly changing dub.sdl from packages to dub.json?

Re: static if (is (T==Complex))

2019-09-18 Thread Norm via Digitalmars-d-learn
On Wednesday, 18 September 2019 at 11:10:11 UTC, berni wrote: Is it possible to simplfy this? static if (is (T==Complex!double) || is (T==Complex!float) || is (T==Complex!real)) I usually do something like the following: --- import std.traits; template isComplexReal(T) { enum

static if (is (T==Complex))

2019-09-18 Thread berni via Digitalmars-d-learn
Is it possible to simplfy this? static if (is (T==Complex!double) || is (T==Complex!float) || is (T==Complex!real))

When should we use Modules and when Should we use Classes?

2019-09-18 Thread BoQsc via Digitalmars-d-learn
Would be nice to have a short summary or detailed answer on this. Some resources to discuss this topic: https://dlang.org/spec/class.html https://dlang.org/spec/module.html

Re: segmentation fault when running void main() {}

2019-09-18 Thread berni via Digitalmars-d-learn
On Tuesday, 17 September 2019 at 18:13:06 UTC, Adam D. Ruppe wrote: Did you make sure the old version was totally uninstalled before the new version was attempted to be built? This thing often happens because of a compiler/runtime version mismatch, typically because the old version didn't get