Obviously, there is no "set" object in D, but I was wondering
what the quickest way to remove duplicates from an array would
be. I was convinced I'd seen a "unique" method somewhere, but
I've looked through the documentation for std.array,
std.algorithm AND std.range, and I've either missed
I am (still) writing a 3D graphics engine, and was considering my
choices for a scene graph.
Originally, I was going to use classes derived from my base
SceneNode class for the nodes of the graph, but would this
instead be a better situation to use template mixins instead of
potentially
I am trying to write a graphics engine for my university capstone
project, and really wanted to give it a try in D, as both a
talking point, and because I love the language. I'm using dub to
build the library, and the demo application that'll use it.
However, I've come across a problem. In
On Thursday, 1 August 2019 at 21:12:51 UTC, ag0aep6g wrote:
`choose`'s parameters aren't lazy. So the second argument is
evaluated even when `previous is null`. That means
`intervalRange` is called on a null `previous`. And that fails,
of course, because `intervalRange` can't access `starts`
I'm having some trouble with a "Program exited with code
-1073741819" error in some code I'm writing and I would
appreciate any help/insight.
The problem stems from some incompatibility between the Phobos
function "choose" and the template function "myFilter" which
returns a range. The code
On Tuesday, 30 July 2019 at 05:30:30 UTC, Jonathan M Davis wrote:
In principle, it's good to use const when you know that data
isn't going to change, but that gets far more complicated when
you're dealing with generic code or even with classes, since as
soon as you use const, everything used
On Monday, 29 July 2019 at 19:38:34 UTC, Jonathan M Davis wrote:
On Monday, July 29, 2019 11:32:58 AM MDT Matt via
Digitalmars-d-learn wrote:
Because const ranges are basically useless, there really isn't
much point in putting const on any range functions even if it
would work
I've noticed that for some ranges in Phobos empty is marked const
(e.g. iota) but for other ranges (e.g. multiwayMerge) it is not
const. Is there a reason why? Isn't empty guaranteed not to alter
the data of the range and so should be const?
This is causing me considerable headaches as I try
Godbolt link: https://godbolt.org/g/t5S976
Playing around with Godbolt, D seems to generate an embarassing
amount of assembly for a simple function (50ish for squaring an
int vs 4 for C++ and 7 for Rust). Even Go compiles to less
assembly.
Is there something I'm missing?
On Saturday, 16 September 2017 at 17:09:34 UTC, David Gileadi
wrote:
Let me preface this by saying I love package managers and think
dub is one of the best things with dlang. However they can also
sometimes be dangerous, as this PyPI incident[1] shows: several
Python packages were uploaded
Meanwhile, the blog post Laeeth gave you shows Mir doing better
on matrix multiplication benchmarks than Eigen, significantly
better when dealing with complex numbers.
I mean by now we should all be jaded enough not to simply take
toy benchmarks as gospel for which is actually fastest in a
Also note, one of the main advantages of Eigen is the whole lazy
evaluation of expressions for compound operations.
I haven't dug in the source, but it's my understanding it's done
through a lot of compile time C++ template hacking
That seems like a good start. I'll probably start contributing
within a few weeks.
In the long run the goal should probably be to have a "go-to" set
of LA libraries, with appropriate data structures that have
friendly bindings to GPU LA computations with DCompute.
On Wednesday, 2 August 2017 at 21:31:19 UTC, Walter Bright wrote:
https://www.reddit.com/r/programming/comments/6r6dwp/netflix_opensources_its_first_d_library_vectorflow/
Speakng of D in data science (where I think it can get traction),
is there a standardized linear algebra library in D?
The one thing I got from that blog post is that the HN and reddit
discussion was overwhelmingly about generics, and how the Go
leadership seems to not give a damn about what its user community
wants...
On Wednesday, 28 June 2017 at 14:21:24 UTC, Mike Parker wrote:
On Monday, 26 June 2017 at 02:55:17 UTC, Matt wrote:
Which version of the compiler? Which version of Windows? I'm
on Windows 10 with 2.074.1 currently and never seen it with
any version of DMD.
DMD is 2.074.1, windows10 pro
On Wednesday, 28 June 2017 at 14:21:24 UTC, Mike Parker wrote:
On Monday, 26 June 2017 at 02:55:17 UTC, Matt wrote:
Which version of the compiler? Which version of Windows? I'm
on Windows 10 with 2.074.1 currently and never seen it with
any version of DMD.
DMD is 2.074.1, windows10 pro
Which version of the compiler? Which version of Windows? I'm on
Windows 10 with 2.074.1 currently and never seen it with any
version of DMD.
DMD is 2.074.1, windows10 pro (10.0.14393)
Hey guys,
New user here. I know the first 5 minutes experience is
important, just to note that rdmd.exe and executables created
with dmd.exe are flagged as malicious by windows defender. It's
easy to create an exception in the windows defender settings, but
I thought I would let you know.
I was planning to use a dynamic array of indices to represent a
deck of cards, and was wondering if there was any easy way to
shuffle the arrays contents? I checked the library docs, but
came to the conclusion that sorting arrays is a much more common
operation :)
If anyone has a suggestion
...And then I realised that I hadn't looked inside std.random.
Question solved, because I am a dumbass.
On Tuesday, 19 May 2015 at 04:58:20 UTC, Matt wrote:
On Monday, 18 May 2015 at 23:19:33 UTC, Andrei Alexandrescu
wrote:
On 5/18/15 10:59 AM, Brian Schott wrote:
I'm considering adding a demo or two to my talk. Does anybody
know what
kind of video setup we will have?
More specifically:
* Is
On Monday, 18 May 2015 at 23:19:33 UTC, Andrei Alexandrescu wrote:
On 5/18/15 10:59 AM, Brian Schott wrote:
I'm considering adding a demo or two to my talk. Does anybody
know what
kind of video setup we will have?
More specifically:
* Is the conference being streamed? If so, will there be a
I am creating a simple SDL_Texture manager, and was wondering if
the following code would work:
---
// 'list' is am assoc array of a struct containing a pointer and
ref counter.
// max_list_length is set to 20 if it's ever found to be 0
// compact list
if(list.length == max_list_length){
On Saturday, 14 March 2015 at 00:28:59 UTC, Ellery Newcomer wrote:
On Friday, 13 March 2015 at 19:05:59 UTC, Matt wrote:
example code, see if I can figure it out, but if you can
advise, that would be fantastic. Thank you for all the help
so far, it's really been appreciated
My penitence for
On Friday, 13 March 2015 at 16:30:07 UTC, Matt wrote:
Thank you, adding the subConfigurations section to dub.json
seems to allow the program to compile and run successfully.
However, to test the code, I first tried in the main program:
---
py_eval!string(import sys\nprint(sys.path));
---
On Friday, 13 March 2015 at 21:12:52 UTC, Robert M. Münch wrote:
Hi, I want to use the Windows OutputDebugString() which is not
defined anywhere.
How do I declare such missing Windows API functions myself? And
with which libaries do I then need to link? Does DMD contain
all necessary Windows
On Friday, 13 March 2015 at 01:40:34 UTC, Ellery Newcomer wrote:
On 03/11/2015 07:59 PM, Matt wrote:
Right, copying site.py into my program's working dir sorts out
the
missing module error, but I now get a syntax error:
file=sys.stderr)
^
SyntaxError: invalid syntax
Error
On Friday, 13 March 2015 at 14:21:15 UTC, Ellery Newcomer wrote:
On Friday, 13 March 2015 at 09:38:45 UTC, Matt wrote:
I used the ~0.9.4 branch in dub, and I'm not sure how to
change configuration. Do you mean I should be using
~master or ~develop?
nope. configurations are a different
On Wednesday, 11 March 2015 at 19:32:05 UTC, Matt wrote:
I'm trying to build a simple platformer using SDL2 and python
to script entities, but I'm struggling to include Pyd. I'm
using DMD v2.066.1, with dub as the package manager, and
derelict for the SDL2 bindings.
Now, when I add Pyd to my
I'm trying to build a simple platformer using SDL2 and python to
script entities, but I'm struggling to include Pyd. I'm using DMD
v2.066.1, with dub as the package manager, and derelict for the
SDL2 bindings.
Now, when I add Pyd to my dub.json everything works fine, but as
soon as I add
On Wednesday, 11 March 2015 at 21:45:20 UTC, Matt wrote:
On Wednesday, 11 March 2015 at 19:32:05 UTC, Matt wrote:
I'm trying to build a simple platformer using SDL2 and python
to script entities, but I'm struggling to include Pyd. I'm
using DMD v2.066.1, with dub as the package manager, and
On Friday, 2 January 2015 at 18:52:11 UTC, Benjamin Thaut wrote:
Am 02.01.2015 um 19:45 schrieb Vlad Levenfeld:
My personal favorite method is to use the primitives in
core.atomic with
a double or triple buffer. To double buffer, keep two buffers
in an
array (data[][] or something) and an
On Saturday, 3 January 2015 at 22:10:49 UTC, Vlad Levenfeld wrote:
On Saturday, 3 January 2015 at 15:44:16 UTC, Matt wrote:
Right, I've been looking at core.atomic, but it has very
little documentation, and it's territory I haven't explored,
yet. Any chance of some pointers along the way?
I'm trying to write a small 3D engine, and wanted to place the
physics in a separate thread to the graphics, using events,
possibly std.concurrency, to communicate between them.
How, then, do I pass large amounts of data between threads? I'm
thinking the physics world state (matrix for each
I am building a PE-COFF file reader, just for education purposes,
and I keep getting a ConvException come up, stating:
---
Unexpected '
---
Now, I have no idea how I'm getting this. The code at that point
looks like the following:
---
// look for the identifier
// this gives us the
On Friday, 3 October 2014 at 13:48:41 UTC, thedeemon wrote:
On Friday, 3 October 2014 at 11:30:02 UTC, Matt wrote:
I am building a PE-COFF file reader
file.seek(0x3c, SEEK_SET);
file.readf(%d, offs); // this is the problem line
Does anyone else see whatever it is that I'm doing wrong?
readf
If I were to use Runtime.loadLibrary(), it claims to merge any D
GC in the shared lib with the current process' GC.
Do I need to version away symbol loading code for each platform?
Or is there already code in Phobos that allows us to do this
independent of platform?
So I just started learning D this weekend, and I'm trying to
understand why the following example will not work... Essentially
what I am trying to do is cast the templated child stored in the
parent container as the correct form, return some T value, and
use auto to return the correct value
Are we able to create DLLs easily enough in D now? Do we still
need to tell our D DLLs to share their GCs with the calling EXE?
And is the wiki page fully up to date on the matter? If not where
can we find the up to date information? Or should we be using
core.runtime.Runtime.loadLibrary()?
On Tuesday, 10 June 2014 at 20:58:41 UTC, Nordlöw wrote:
Is there a way to, programatically (trait), lookup the source
file and position of a user defined type either dynamically or,
even better, statically?
I don't know about the source file, per se, but std.traits has
the
I was wondering if anyone could help with a problem I'm having.
My program compiles properly, and has all up-to-date files and
DLLs (SDL2, SDL2-image, SDL2-ttf, all the other DLLs that are
required by these). However, when I run it, I get object.Error:
Access Violation, which, of course,
On Wednesday, 11 June 2014 at 00:05:25 UTC, safety0ff wrote:
On Wednesday, 11 June 2014 at 00:00:47 UTC, Matt wrote:
Both Window and Input are my own classes, which I've checked
for leaks, and don't appear to have any. They are basically
wrappers around SDL functionality. I can include the
On Wednesday, 11 June 2014 at 01:52:49 UTC, Kapps wrote:
The digitalmars.D.learn newsgroup is a more appropriate place
for this, but as for your issue, one thing to keep in mind is
that static constructors are run before main:
import std.stdio;
static this() {
writeln(Foo);
}
void
On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote:
In Mr. Cehreli's book it says
Additionally, the length of dynamic arrays can be changed by
assigning a value to this property:
int[] array; // initially empty
array.length = 5; // now has 5 elements
while in Mr. Alexandrescu's
On Wednesday, 11 June 2014 at 02:59:40 UTC, Matt wrote:
I previously asked this over in the DigitalMars.D
board(http://forum.dlang.org/thread/huftyrtbomaimuqkm...@forum.dlang.org#post-hrqvqlzzbkgafvjdtjnb:40forum.dlang.org),
but it was suggested I ask it over here instead.
I have the
On Sunday, 27 April 2014 at 00:48:53 UTC, Ali Çehreli wrote:
I think the following is a start:
import std.variant;
class MyClass
{
Variant[string] store;
void attach(T)(string key, ref T var)
{
store[key] = var;
}
void set(T)(string key, T value)
{
I am trying to create a class that can do the following:
---
int sample = 42;
// myObj is an instance of the class I'm writing
myObj.attach (othername, sample);
myObj.set (othername, 69);
writeln (myObj.get (othername), \t, sample); // should
produce '69 69'
---
Currently, my class
49 matches
Mail list logo