I have almost identical (I believe it at least) implementation (D and
C++) of the same algorithm that uses Kalman filtering. These
implementations though show different results (least significant
digits). Before I start investigating I would like to ask if this issue
(different results of float
22.07.2019 15:53, rikki cattermole пишет:
https://godbolt.org/z/EtZLG0
hmm, in short - this is my local problem?
22.07.2019 16:26, Guillaume Piolat пишет:
Typical floating point operations in single-precision like a simple (a
* b) + c will provide a -140dB difference if order is changed. It's
likely the order of operations is not the same in your program, so the
least significant digit should be differe
22.07.2019 17:19, drug пишет:
22.07.2019 16:26, Guillaume Piolat пишет:
Typical floating point operations in single-precision like a simple
(a * b) + c will provide a -140dB difference if order is changed.
It's likely the order of operations is not the same in your program,
so the least sign
24.07.2019 18:51, Greatsam4sure пишет:
Good day everyone. I am thinking, if there is a way to contact any
person on dlang forums through mail or any other means. How do I get
their email from their forum post?
I use thunderbird to read the forum and every post contains email of its
author,
24.07.2019 18:45, Greatsam4sure пишет:
int main(){
double mum = 0;
Write("enter a number: ")
readf(" %s\n",&num);
Writeln(num);
}
How do I return the complete number the user enter since I don't since
the user can enter numbers of various length with dmd approximating it.
I will appr
03.08.2019 12:26, Andrey пишет:
Hello, how to get name of my application (project) that we write in
dub.json? Is there any compile-time constant like __MODULE__?
You can get it using $DUB_PACKAGE from Environment variables
(https://dub.pm/package-format-sdl), for example using preBuildCommands
05.09.2019 14:17, berni пишет:
Point[long] q;
q[1] = Point(3);
Leads to:
test.d(7): Error: cannot modify struct q[1L] Point with immutable members
But why do you try to modify immutable data? What is your point? Could
you describe you use case?
05.09.2019 14:28, berni пишет:
On Thursday, 5 September 2019 at 11:22:15 UTC, drug wrote:
05.09.2019 14:17, berni пишет:
Point[long] q;
q[1] = Point(3);
Leads to:
test.d(7): Error: cannot modify struct q[1L] Point with immutable
members
But why do you try to modify immutable data? What
05.09.2019 15:46, berni пишет:
On Thursday, 5 September 2019 at 12:15:51 UTC, drug wrote:
One solution could be using either pointer to `const(Point)` or class
here (to avoid pointer using) https://run.dlang.io/is/rfKKAJ
OK. This are two solutions and although I'll probably not going to use
a
05.09.2019 17:31, berni пишет:
On Thursday, 5 September 2019 at 13:27:55 UTC, drug wrote:
[...]when you put it into an AA you modify old value
Why?!? :-o When putting it into an AA it will be copied to a different
place in memory, but the value is still the same, it's not modified.
Sorry, bu
On 9/25/19 11:35 PM, Boris Carvajal wrote:
On Wednesday, 25 September 2019 at 14:20:00 UTC, Anonymouse wrote:
I added some deprecations in my project and am going through my
templates trying to silence the warnings that suddenly popped up. This
template works, but it triggers deprecation warnin
28.09.2019 5:15, Hossain Adnan пишет:
On Wednesday, 25 September 2019 at 11:46:04 UTC, Ron Tarrant wrote:
Hi y'all,
I've been Googling how to do this, but coming up with nothing
definitive. Are there any articles for how to do this for:
Linux?
For Linux there are 3 new options:
1. Appima
On 10/10/19 6:47 PM, Just Dave wrote:
In C# you can do something like:
if (obj is Person)
{
var person = obj as Person;
// do stuff with person...
}
where you can check the type of an object prior to casting. Does D have
a similar mechanism? It's so widely use
struct Foo
{
this(ref const(Foo) other) {}
this(const(Foo) other) {}
}
I'm trying to update dmd version and starting from 2.086 my code doesn't
compile due to the error above. What is the reason of that? Is it
temporarily situation?
On 10/16/19 6:40 PM, rikki cattermole wrote:
On 17/10/2019 4:29 AM, drug wrote:
struct Foo
{
this(ref const(Foo) other) {}
this(const(Foo) other) {}
}
I'm trying to update dmd version and starting from 2.086 my code
doesn't compile due to the error above. What is the reason of that?
I'd like to add (and modify) section to ELF executable to implement
DTrace probes. DTrace does it in probe assembly:
```
__asm__ __volatile__ (
"990: nop
.pushsection .note.stapsdt,\"?\",\"note\"
.balign 4
.4byte 992f-991f, 994f-993f, 3
991: .asciz \"stapsd
16.11.2019 13:01, Avery Stupidman пишет:
Hello,
I have a function "angle" that returns the angle (in degrees) of a right
triangle given the length of the its lengths as type "real". It works,
but when trying to test the equality of the angle with the seemingly
identical value, I'm informed th
On 12/11/19 2:18 PM, Pavel Shkadzko wrote:
I have the following project structure.
my_proj/
script_1/runme_1.d
script_2/runme_2.d
evaluator.d
The project has a library dependency:
"dependencies": {
"mir": "~>3.2.0",
},
The "evaluator.d" script contains some general functio
On 12/11/19 6:52 PM, Pavel Shkadzko wrote:
It works like this, yes. However, by default it builds a "library" while
I want to run "evaluator" as a script which uses other scripts by
calling their functions.
Doing:
dub --compiler=ldc2 --single evaluator.d // throws an error
source\evaluator.
On 12/23/19 10:16 AM, Soulsbane wrote:
On Sunday, 22 December 2019 at 17:20:51 UTC, BoQsc wrote:
There are lots of editors/IDE's that support D language:
https://wiki.dlang.org/Editors
What kind of editor/IDE are you using and which one do you like the most?
VSCode with this extension:
https
06.01.2020 20:08, Per Nordlöw пишет:
alias A = Algebraic!(long, string);
A x;
x = 42;
That's because you try to assign int, not long. This works:
alias A = Algebraic!(long, string);
A x;
x = 42L;
06.01.2020 22:48, Steven Schveighoffer пишет:
I think his question is, why shouldn't this work? e.g., this works:
Ah, indeed. Sorry for noise.
On 1/13/20 2:45 PM, mark wrote:
In the D tour example shown here
https://tour.dlang.org/tour/en/basics/ranges
there is the following import:
import std.range : drop, generate, take;
But generate is not used so I think it ought to be deleted to avoid
confusion.
done - https://github.com/dlang
On 1/13/20 3:11 PM, drug wrote:
On 1/13/20 2:45 PM, mark wrote:
In the D tour example shown here
https://tour.dlang.org/tour/en/basics/ranges
there is the following import:
import std.range : drop, generate, take;
But generate is not used so I think it ought to be deleted to avoid
confusion.
On 1/15/20 6:26 PM, TodNaz wrote:
Hello!
Maybe someone came across ... I use sdl 2 derelcit, and wanted to draw
text (not English, but Russian, for example). And when called in
TTF_RenderUTF8_Blended, the text is drawn with incorrect characters
(with these: ""). And with wstribg and TTF_Render
On 1/24/20 4:37 PM, Andrey wrote:
Hello,
I'm trying to bind C library for Tcl/Tk in D code. There is a function
called "Tcl_CreateInterp()" which I declared as extent(C). When I call
this function then layout of memory become broken - one of my global
wstring variables loses it's value.
I don'
On 1/30/20 2:50 PM, Martin Tschierschke wrote:
When building my small vibe.d app I am getting this messages twice:
/usr/include/dmd/phobos/std/range/primitives.d(174,38): Deprecation:
alias byKeyValue this is deprecated - Iterate over .byKeyValue instead.
/usr/include/dmd/phobos/std/range/primi
On Saturday, 8 February 2020 at 23:37:56 UTC, realhet wrote:
Hello,
class A{
int i = 42;
}
Is there a way to get that 42? (Input is the class A and the
name of the field 'i')
A.i.init returns 0, so it doesn't care about the class.
classinfo.m_init can be an option, but maybe there's a nic
Currently this code does not compiles:
```
unittest
{
class MyClass
{
T opCall(T)(T p)
{
return p;
}
}
import std.container.array : Array;
Array!MyClass arr;
}
```
but if you comment out `opCall` in MyClass this code compiles. This is
caus
On 2/28/20 11:48 AM, Namal wrote:
Hello,
I don't understand why this simple code causes a compiler error..
import std.stdio;
void main(){
int b = 0;
for (b; b<3; b++){
writeln(b);
}
}
$Error: b has no effect
Same works perfectly fine in C++
#include
int main(){
int i = 0;
On 2/28/20 12:25 PM, Виталий Фадеев wrote:
Now I reading Template doc for up skill...
I recommend this nice tutorial
https://github.com/PhilippeSigaud/D-templates-tutorial
On 3/5/20 10:47 AM, mark wrote:
In Adam Ruppe's D Cookbook there're these lines in a ref counting example:
RefCountedObject o = void; // What does this mean/do?
o.data = new Implementation();
o.data.refcount = 1;
I don't understand the first line; could someone explain please?
In D all vars
On 3/5/20 2:03 PM, mark wrote:
I want to use the Porter stemming algorithm.
There's a D implementation here:
https://tartarus.org/martin/PorterStemmer/d.txt
The main public function's signature is:
char[] stem(char[] p, int i, int j)
But I work entirely in terms of strings (containing indivi
It's too complex
On 3/6/20 3:45 PM, Виталий Фадеев wrote:
On Friday, 6 March 2020 at 12:35:29 UTC, Виталий Фадеев wrote:
Searching info for object casting with checking class type at runtime.
Like this:
class A
{
//
}
class B
{
int bVar;
}
unittest
{
A a = new A();
A x = c
07.03.2020 13:20, mark пишет:
I have this struct (with details omitted
[ snip ]
Should Deb be a class rather than a struct?
Do you consider using pointers in AA:
```
Deb*[string] debForName;
```
07.03.2020 13:58, mark пишет:
change #1:
if (line.empty) {
if (deb != null && deb.valid)
debs.insert(deb);
else // report incomplete
deb = null;
continue;
07.03.2020 15:05, Dibyendu Majumdar пишет:
Hi,
I am trying to understand
https://github.com/dlang/dmd/blob/master/src/dmd/backend/barray.d.
Two questions:
1. What does this mean and why is it needed?
line 95: alias array this;
This means that `array` can be used instead of `this`
2. The s
07.03.2020 15:58, Steven Schveighoffer пишет:
Hm... I'd say:
1. Don't use a pointer for the element. Just use the struct directly.
Using a pointer is bad because it's now going to compare pointers, and
not the element data. Not only that, but RBNodes are stored as
heap-allocated structs, so
the specification says that in betterC mode the main function should
have extern(C) linkage. Accidentally I found that dmd does not demand it
in contrast to ldc. Is it bug of dmd or the specification can be relaxed?
On 3/12/20 7:33 AM, Noor Wachid wrote:
I usually go with SFML (C++) library to write simple visualization. Is
there any similiar library in D?
https://code.dlang.org/packages/dsfml
15.03.2020 22:39, Ferhat Kurtulmuş пишет:
The original C++ class
https://github.com/opencv/opencv/blob/master/modules/core/include/opencv2/core/types.hpp#L315:
template class Size_
{
public:
typedef _Tp value_type;
//! default constructor
Size_();
Size_(_Tp _width, _Tp _h
15.03.2020 23:25, Ferhat Kurtulmuş пишет:
On Sunday, 15 March 2020 at 20:21:57 UTC, drug wrote:
15.03.2020 22:39, Ferhat Kurtulmuş пишет:
What is the D version of `createSizeIntWH`? In C++ it returns a
pointer but in D version it returns an instance.
extern(C++){
cv.Size_!int createS
15.03.2020 23:53, Ferhat Kurtulmuş пишет:
I doubt it because in
https://dlang.org/spec/cpp_interface.html#using_cpp_classes_from_d
cpp code:
Derived *createInstance(int i)
d code:
extern (C++){
...
Derived createInstance(int i);
}
Ah, really, you use classes on D side.
On 3/16/20 10:11 AM, Ferhat Kurtulmuş wrote:
On Sunday, 15 March 2020 at 22:25:27 UTC, Arine wrote:
On Sunday, 15 March 2020 at 21:27:32 UTC, Ferhat Kurtulmuş
extern(C++, cv){
extern(C++, class) struct Size_(_Tp){
@disable this();
~this() { }
final _Tp area() const;
final dou
On 3/16/20 12:24 PM, Ferhat Kurtulmuş wrote:
Ok, here is a solution. I opened my lib (yielded by my auxilary cpp)
using 7zip. There are two files containing symbol names, 1.txt and
2.txt. I searched for names of member functions. They were not there
because c++ compiler does not compile membe
Before I lived in assurance that asserts are actual only in debug mode
and in release mode they are nothing (except `assert(0)`). But today my
whole life is going sour because I stumbled upon assert in release mode
and of course that assert is failing.
This doc https://dlang.org/spec/expressio
On 3/23/20 2:14 PM, Steven Schveighoffer wrote:
E.g. https://dlang.org/dmd-osx.html#switch-release
There are also other switches like -boundscheck and -check. It’s
possible you have some library or project that is causing the behavior.
-Steve
Thank you, Steve.
In my case I guess it was my
Is it true that user defined types are resolved to ScopeDsymbol and
basic types aren't?
23.04.2020 14:01, Russel Winder пишет:
Hi,
I need to start a process before the tests run, and terminate it after
the tests run. A module with a shared static constructor and shared
static destructor sounds like the way of doing this since the
constructor is run before main and the destructor af
23.04.2020 14:41, drug пишет:
terminate it after in ``
terminate it after in `shutdown()`
26.04.2020 11:06, mark пишет:
snipped
Sorry for offtopic, imho both Qt and Gtk are too complex in case of
virtual list/tree view. I think the reason is they are retained mode
gui. I gave up to use them for that and develop custom virtual tree view
that is easy in use and currently capable t
27.04.2020 06:38, Jon Degenhardt пишет:
Is there a better way to write this?
--Jon
I don't know a better way, I think you enlist all possible ways - get a
value using either `front` or special range member. I prefer the second
variant, I don't think it is less consistent with range paradigm
27.04.2020 18:28, data pulverizer пишет:
I'm probably not the first person to say this but. Isn't @trusted an odd
label to give unsafe functions and open to abuse by unscrupulous
programmers? It almost says "nothing to see, this here piece of code is
a-ok". Shouldn't it be explicitly labelled a
01.05.2020 10:38, Chris Katko пишет:
I'm making anagrams. According to the nextPermutation() docs, I need to
'sort by less' to get all permutations. ... Except the doc page doesn't
mention how to do that, nor does std.algorithm.sort show how to sort a
string. ... and the google results on the d
01.05.2020 15:29, Steven Schveighoffer пишет:
Don't do this, use to!(dchar[]) as you have above. This will create
incorrect dchars for non-ascii text.
-Steve
Argh, as always you're right. Funny that I never did that and sadly that
I posted wrong code. Thank you, Steven, for correction of
01.05.2020 18:04, notna пишет:
hmmm, whích results in:
Error: cannot use [] operator on expression of type dchar
try this:
```D
import std;
void main()
{
string word = "Привет";
dchar[] line3 = to!(dchar[])(word.dup) // make a copy to get a
range of mutable char
06.05.2020 06:25, data pulverizer пишет:
```
onlineapp.d(14): Error: template std.concurrency.spawn cannot deduce
function from argument types !()(void delegate(double x, double y, long
i, shared(double[]) z) pure nothrow @nogc @safe, double, double, long,
shared(double[])), candidates are:
/
06.05.2020 07:25, data pulverizer пишет:
On Wednesday, 6 May 2020 at 03:56:04 UTC, Ali Çehreli wrote:
On 5/5/20 8:41 PM, data pulverizer wrote:> On Wednesday, 6 May 2020 at
03:33:12 UTC, Mathias LANG wrote:
>> On Wednesday, 6 May 2020 at 03:25:41 UTC, data pulverizer
wrote:
> Is there somethin
06.05.2020 07:52, data pulverizer пишет:
On Wednesday, 6 May 2020 at 04:04:14 UTC, Mathias LANG wrote:
On Wednesday, 6 May 2020 at 03:41:11 UTC, data pulverizer wrote:
Yes, that's exactly what I want the actual computation I'm running is
much more expensive and much larger. It shouldn't matter
06.05.2020 09:24, data pulverizer пишет:
On Wednesday, 6 May 2020 at 05:44:47 UTC, drug wrote:
proc is already a delegate, so &proc is a pointer to the delegate,
just pass a `proc` itself
Thanks done that but getting a range violation on z which was not there
before.
```
core.exception.Ra
06.05.2020 09:43, data pulverizer пишет:
On Wednesday, 6 May 2020 at 05:50:23 UTC, drug wrote:
General advice - try to avoid using `array` and `new` in hot code.
Memory allocating is slow in general, except if you use carefully
crafted custom memory allocators. And that can easily be the reason
06.05.2020 10:42, data pulverizer пишет:
On Wednesday, 6 May 2020 at 07:27:19 UTC, data pulverizer wrote:
On Wednesday, 6 May 2020 at 06:54:07 UTC, drug wrote:
Thing are really interesting. So there is a space to improve
performance in 2.5 times :-)
Yes, `array` is smart enough and if you call
06.05.2020 11:18, data pulverizer пишет:
CPU usage now revs up almost has time to touch 100% before the process
is finished! Interestingly using `--boundscheck=off` without
`--ffast-math` gives a timing of around 4 seconds and, whereas using
`--ffast-math` without `--boundscheck=off` made no
06.05.2020 12:07, wjoe пишет:
Hello,
I'm choking on a piece of C++ I have no idea about how to translate to D.
template typename std::enable_if< std::is_const::value == true,
void>::type* = nullptr>
constexpr const char *modifier() const {
return "[in] ";
}
06.05.2020 16:57, Steven Schveighoffer пишет:
```
foreach(i; 0..n) // instead of for(long i = 0; i < n;)
```
I guess that `proc` delegate cant capture `i` var of `foreach` loop so
the range violation doesn't happen.
foreach over a range of integers is lowered to an equivalent for loop,
so tha
06.05.2020 13:23, data pulverizer пишет:
On Wednesday, 6 May 2020 at 08:28:41 UTC, drug wrote:
What is current D time? ...
Current Times:
D: ~ 1.5 seconds
Chapel: ~ 9 seconds
Julia: ~ 35 seconds
Oh, I'm impressed. I thought that D time has been decreased by 1.5
seconds but it is 1.5
07.05.2020 17:49, data pulverizer пишет:
On Thursday, 7 May 2020 at 02:06:32 UTC, data pulverizer wrote:
On Wednesday, 6 May 2020 at 10:23:17 UTC, data pulverizer wrote:
D: ~ 1.5 seconds
This is going to sound absurd but can we do even better? If none of
the optimizations we have so far
17.05.2020 17:35, Vinod K Chandran пишет:
It worked. Thanks :) I have one more question. Which is better, to
include all the switch cases inside a single try catch or write separate
try catch for each switch cases ?
all the switch cases inside a single try catch is better
On 5/18/20 11:47 PM, Vinod K Chandran wrote:
On Sunday, 17 May 2020 at 19:37:05 UTC, drug wrote:
17.05.2020 17:35, Vinod K Chandran пишет:
It worked. Thanks :) I have one more question. Which is better, to
include all the switch cases inside a single try catch or write
separate try catch for
On 5/20/20 12:03 PM, realhet wrote:
On Wednesday, 20 May 2020 at 01:18:24 UTC, Paul Backus wrote:
On Tuesday, 19 May 2020 at 23:15:45 UTC, realhet wrote:
I think what you want is `std.meta.staticMap`. Something like this:
alias FieldNameTuple2(T) = staticMap!(FieldNameTuple,
BaseClassesTuple!T
23.05.2020 12:27, Tim пишет:
class Sprite{
/// Postional components of the sprite
int* x, y;
SDL_Surface* image_surface;
auto parent;
this(const char* path, auto parent){
writeln(*x);
this.parent = parent;
}
void update(){
// Copy lo
On 7/20/20 10:04 PM, Ecstatic Coder wrote:
I'm currently implementing a small open source backup tool (dub), and
therefore I need to accurately store the file modification SysTime in
binary format, so that I can later load this SysTime from the snapshot
file to compare it with the current file
On 7/21/20 2:44 PM, Ecstatic Coder wrote:
Ah thanks for telling me :)
The loaded byte array in the union type was indeed the same as the saved
one, so I immediately thought it was crashing because of some hidden
pointer for timezone or something which was then pointing to garbage at
reloadin
On 9/3/20 1:47 PM, Curious wrote:
Given the following:
=a==
void main(string[] args)
{
FILE* fp = fopen(args[1].ptr, "r");
if (!fp) throw new Exception("fopen");
}
=b==
void main(string[] args)
{
FILE* fp = fopen(args[1].dup.ptr, "r");
if (!fp) throw new Exce
On 9/3/20 3:36 PM, Thomas wrote:
Hi!
I am following some examples in C++ about how OpenGL is working. There
are great tutorials out there and most of it works also with D.
For my code I am using gfm.math.matrix (Version 8.0.3) to be able to
calculate the mouse position in a 3d world.
Now I ha
On 9/4/20 10:27 AM, glis-glis wrote:
On Thursday, 3 September 2020 at 14:34:48 UTC, Jacob Carlborg wrote:
Oh, multiple binaries, I missed that. You can try to add multiple
configurations [1]. Or if you have executables depending on only one
source file, you can use single-file packages [2].
T
05.09.2020 22:17, Andy Balba пишет:
Where do I fine where IOMode is defined.. as in the last line of ...
module vibe.core.stream;
import vibe.internal.traits : checkInterfaceConformance,
validateInterfaceConformance;
import vibe.internal.interfaceproxy;
import core.time;
import std.algorithm
05.09.2020 23:19, Andy Balba пишет:
https://github.com/vibe-d/eventcore/blob/a027c233c2542de8372bbff25d0a4804f32a094e/source/eventcore/driver.d#L1087
@drug: thank you..I'm now left with resolving @blocking
you are welcome!
Probably this?
https://github.com/vibe-d/vibe-core/blob/6ceb462ab
On 9/10/20 4:06 PM, Joseph Rushton Wakeling wrote:
Hello folks,
Is there any way to define UDAs such that they automatically inherit
other UDA definitions?
For example, suppose I define:
enum BaseUDA { A, B }
Is there a way to define `AnotherUDA` such that if `hasUDA!(T,
AnotherUDA)`
Can't you put a var on the stack?
```
auto instance = create();
instance
.do_lazy()
.do_something();
```
On 9/18/20 4:30 PM, drug wrote:
Can't you put a var on the stack?
```
auto instance = create();
instance
.do_lazy()
.do_something();
```
Ah, I totally missed your point. Now I see you can't...
On 9/29/20 3:41 PM, mw wrote:
I remember I used to able to build this package:
https://github.com/AntonMeep/profdump
but now, I cannot.
Since that package haven't changed for 2 years, maybe it's a dub bug?
System information
$ uname -a
Linux 4.15.0-117-generic #118-Ubuntu SMP Fri Sep 4 20:
On 9/29/20 4:38 PM, drug wrote:
It reproduces. As a workaround you can use
```
dub run profdump
```
this command works as expected, I guess it is a bug of dub
Do not execute this command in cloned `profdump` repository - it will
fail too. It works if is called from other places, for example i
On 10/5/20 12:05 PM, Alaindevos wrote:
On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote:
On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
Can I say python has pip, ruby has bundle and D has dub.
Meaning they perform th
On 10/20/20 9:42 AM, Per Nordlöw wrote:
If I want GC-free string formatting and outputting to stdout/stderr what
packages should I prefer at code.dlang.org?
Probably https://code.dlang.org/packages/nogc
There are two other way:
```D
import std;
void main()
{
int[] a = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ];
// using foreach
foreach (i; 0..a.length)
write(a[i], ", ");
writeln;
// using stride
writeln(stride(a, 2));
}
```
On 11/2/20 1:50 PM, Severin Teona wrote:
Hi guys!
I build the druntime for an ARM Cortex-M based microcontroller and I
trying to create an application and link it with the druntime. I am also
using TockOS[1], which does not implement POSIX thread calls and other
OS-dependent implementations.
On 12/1/20 2:40 PM, Johannes Loher wrote:
...
However, I am having trouble running the unit tests when using the
...
This can be one of solution https://github.com/dlang/dub/pull/2050
On 12/1/20 5:18 PM, Johannes Loher wrote:
Am 01.12.20 um 14:55 schrieb drug:
On 12/1/20 2:40 PM, Johannes Loher wrote:
...
However, I am having trouble running the unit tests when using the
...
This can be one of solution https://github.com/dlang/dub/pull/2050
Thanks! Let's see if it gets
Phobos provides this by SortedRange:
https://dlang.org/phobos/std_range.html#.SortedRange
Example of usage:
https://run.dlang.io/is/WW2bn0
On 12/20/20 9:31 PM, jmh530 wrote:
On Wednesday, 2 December 2020 at 12:51:11 UTC, drug wrote:
[snip]
Thanks! Let's see if it gets merged or if a slightly more involved
solution is needed.
Remake it - https://github.com/dlang/dub/pull/2052
This has more chances to be merged
Looks like this
On 12/21/20 7:31 PM, jmh530 wrote:
On Monday, 21 December 2020 at 11:31:49 UTC, drug wrote:
[snip]
Unfortunately I'm very busy. But I check it again and it turns out
that the fix does not resolve the problem completely. This PR just
remove the single file from testing so currently dub does not
On 12/22/20 10:52 AM, drug wrote:
On 12/21/20 7:31 PM, jmh530 wrote:
On Monday, 21 December 2020 at 11:31:49 UTC, drug wrote:
[snip]
Unfortunately I'm very busy. But I check it again and it turns out
that the fix does not resolve the problem completely. This PR just
remove the single file fro
On 12/22/20 8:32 PM, jmh530 wrote:
On Tuesday, 22 December 2020 at 15:06:09 UTC, drug wrote:
[snip]
But what do you mean exactly by "work with dependency"? As I
understand, `dub test` does not run unit tests in dependencies and
single file packages work with dependencies in general. Do you m
On 12/23/20 3:23 PM, Godnyx wrote:
Any ideas?
Just fix your typos:
```D
import std : printf, toStringz;
void put(A...)(string prompt, A args) {
static foreach (ulong i; 0..args.length) {
static if (is(typeof(args[i]) == string))
printf("%s\n", args[i].toStringz);
On 1/13/21 4:47 PM, Roguish wrote:
On Wednesday, 13 January 2021 at 13:30:48 UTC, Roguish wrote:
Anything else I need to know when debugging on Linux, without an IDE?
One specific question I have is: what's the difference between -g and
-debug and -d-debug?
Also, what does it mean to "alway
On 1/13/21 4:47 PM, Roguish wrote:
Also, what does it mean to "always emit a stackframe" (compiler option
-gs) ?
Short answer - sometimes the compiler does not emit a stackframe (due to
optimization for example). In general if you are able to debug your
binary by gdb then you don't need to
On 1/14/21 6:46 PM, dog2002 wrote:
I need to make some operations with all the files in a directory and
subdirectories. Currently, I do it like this:
import std;
void DirIteration(string path) {
try {
foreach(entry; dirEntries(path, SpanMode.shallow, false)) {
//SpanMode.shallow
On 1/14/21 6:55 PM, drug wrote:
But this method consumes a huge amount of memory (up to 4 GB and
more). Is there a more appropriate way to walk directories recursively
that does not consume a lot of memory?
DirEntry is a struct. First of all I would try this:
```D
foreach(ref entry; dirEntri
1 - 100 of 389 matches
Mail list logo