Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: At the very least, there is no crash when changing `struct Foo` to `static struct Foo`, so it is perhaps related to `Foo` being an inner struct with a

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: OK, this at least reproducibly crashes here, too (-m32 and -m64 on Windows, tried dmd 2.069.0 and 2.067.1).

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:04:49 UTC, Random D user wrote: I need to look into this more. Ok. This is minimal app that crashes for me. If someone could try this: class App { this() { } void crash( int val ) in { assert( val == 1 ); } body

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:45:25 UTC, Random D user wrote: Ok. This is minimal app that crashes for me. If someone could try this: Interesting. With dmd 2.064.2, your example compiles and runs fine. With dmd 2.065.0, it does not compile, complaining that there is no opCmp for `Foo`s.

Re: AA struct hashing bug?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 01:23:40 UTC, Ivan Kazmenko wrote: On Monday, 7 December 2015 at 22:03:42 UTC, Alex Parrill wrote: On Monday, 7 December 2015 at 18:48:18 UTC, Random D user Tested the same code with -m32 and -m64 on Windows. Works for me, too. I tried this again. And it seems

Re: AA struct hashing bug?

2015-12-08 Thread Ivan Kazmenko via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 11:04:49 UTC, Random D user wrote: On Tuesday, 8 December 2015 at 01:23:40 UTC, Ivan Kazmenko wrote: On Monday, 7 December 2015 at 22:03:42 UTC, Alex Parrill wrote: On Monday, 7 December 2015 at 18:48:18 UTC, Random D user Tested the same code with -m32 and -m64

Re: benchmark on binary trees

2015-12-08 Thread visitor via Digitalmars-d-learn
using Apache Portable Runtime(APR) like in the C version : http://dpaste.dzfl.pl/6ca8b5ffd6dc works like a charm, 2.061s on my machine ! if file name is binarytrees.d dmd -w -inline -O -release -I/usr/include/apr-1.0 -L/usr/lib/x86_64-linux-gnu/libapr-1.so -of"binarytrees" "binarytrees.d"

Re: How to make a transparent wrapper type?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Monday, 7 December 2015 at 20:03:07 UTC, Namespace wrote: This seems to work: struct RefVal(T) { private T* ptr; this(T* val) { ptr = val; } ref auto opAssign(U)(auto ref U value) { *ptr = value;

Re: How to make a transparent wrapper type?

2015-12-08 Thread Random D user via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 10:26:18 UTC, Random D user wrote: On Monday, 7 December 2015 at 20:03:07 UTC, Namespace wrote: This seems to work: struct RefVal(T) { private T* ptr; this(T* val) { ptr = val; } ref auto

Re: Reset all Members of a Aggregate Instance

2015-12-08 Thread Marc Schütz via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 05:13:51 UTC, Chris Wright wrote: On Tue, 08 Dec 2015 14:12:02 +1100, Daniel Murphy wrote: On 4/12/2015 8:38 AM, Chris Wright wrote: An object reference is just a pointer, but we can't directly cast it. So we make a pointer to it and cast that; the type system

Re: benchmark on binary trees

2015-12-08 Thread visitor via Digitalmars-d-learn
C++ version : real0m3.587s user0m9.211s sys 0m7.341s

Re: Question about mysql-d Object

2015-12-08 Thread Martin Tschierschke via Digitalmars-d-learn
On Monday, 7 December 2015 at 16:11:19 UTC, Daniel Kozak wrote: On Monday, 7 December 2015 at 14:40:12 UTC, Martin Tschierschke wrote: When I do the following: auto mysql = new Mysql("localhost", 3306, "mt", "", "verwaltung"); auto rows = mysql.query("select field from my_table limit 50");

Re: Question about mysql-d Object

2015-12-08 Thread Daniel Kozak via Digitalmars-d-learn
V Tue, 08 Dec 2015 14:34:53 + Martin Tschierschke via Digitalmars-d-learn napsáno: > On Monday, 7 December 2015 at 16:11:19 UTC, Daniel Kozak wrote: > > On Monday, 7 December 2015 at 14:40:12 UTC, Martin Tschierschke > > wrote: > >> When I do the

Re: Question about mysql-d Object

2015-12-08 Thread Daniel Kozak via Digitalmars-d-learn
V Tue, 08 Dec 2015 14:34:53 + Martin Tschierschke via Digitalmars-d-learn napsáno: > On Monday, 7 December 2015 at 16:11:19 UTC, Daniel Kozak wrote: > > On Monday, 7 December 2015 at 14:40:12 UTC, Martin Tschierschke > > wrote: > >> When I do the

Re: Real Time-ing

2015-12-08 Thread Kagamin via Digitalmars-d-learn
prev=now; call(); wait(prev+dur-now); call();

Re: Real Time-ing

2015-12-08 Thread Taylor Hillegeist via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 15:50:35 UTC, Kagamin wrote: Oops, no. next+=dur; wait(next-now); call(); what calls does this use from the std library? to get the current time? Wait a amount of time?

Re: Question about mysql-d Object

2015-12-08 Thread Martin Tschierschke via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 15:14:06 UTC, Daniel Kozak wrote: [...] >> A nested loop, did not worked either: >> >> foreach(row;rows){ >> foreach(field;row){ >> writeln(field);} >> } [...] Now I took a work around, getting the field names in a separate mysql-request, but they should be

Real Time-ing

2015-12-08 Thread Taylor Hillegeist via Digitalmars-d-learn
So, I mostly do programming that is of run to completion verity. But I have a dream of calling functions periodically. So my question is: What is the best (most time accurate) way to call a function every n time units? What is the best way to measure the jitter of these calls? I'm also

Re: Real Time-ing

2015-12-08 Thread Kagamin via Digitalmars-d-learn
Oops, no. next+=dur; wait(next-now); call();

Re: Real Time-ing

2015-12-08 Thread Taylor Hillegeist via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 15:35:18 UTC, Taylor Hillegeist wrote: So, I mostly do programming that is of run to completion I took a stab at the problem: http://dpaste.dzfl.pl/2eef530d00fc 0 nsecs with jitter of :5 nsecs 498937256 nsecs with jitter of :1062744 nsecs 499036173

Re: Real Time-ing

2015-12-08 Thread Chris Wright via Digitalmars-d-learn
On Tue, 08 Dec 2015 15:35:18 +, Taylor Hillegeist wrote: > So, I mostly do programming that is of run to completion verity. > But I have a dream of calling functions periodically. So my question is: > > What is the best (most time accurate) way to call a function every n > time units?

Re: Regression?

2015-12-08 Thread Jack Stouffer via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 01:35:26 UTC, Sebastiaan Koppe wrote: Thanks for your advice. But that is not what I asked for. The question was, why doesn't this work anymore with the latest (2.068.0 and 2.068.1) compiler: ``` auto ls =

Re: The @@@BUG@@@ the size of China - std.conv.d - Target parse(Target, Source)(ref Source s, uint radix)

2015-12-08 Thread John Carter via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 00:40:29 UTC, tsbockman wrote: Someone still needs to review the PR, though. Thanks! Looks like it's been merged already. It was a double problem... I failed to read the bit about advancing the ref and then the old big @@@BUG@@@ comment in the unit test made

Re: Regression?

2015-12-08 Thread Jack Stouffer via Digitalmars-d-learn
On Wednesday, 9 September 2015 at 01:35:26 UTC, Sebastiaan Koppe wrote: Thanks for your advice. But that is not what I asked for. The question was, why doesn't this work anymore with the latest (2.068.0 and 2.068.1) compiler: ``` auto ls =

Using gdb by some process to let this process monitor its state by itself

2015-12-08 Thread drug via Digitalmars-d-learn
Is it possible to invoke gdb by some process that using data from gdb this process can inspect itself? For example I'd like to generate breakpoints for gdb with conditions and if this conditions meet get for example pointer to some data structure from gdb and process it by means of D, not gdb,

Re: Real Time-ing

2015-12-08 Thread BBaz via Digitalmars-d-learn
On Tuesday, 8 December 2015 at 16:40:04 UTC, Taylor Hillegeist wrote: On Tuesday, 8 December 2015 at 15:35:18 UTC, Taylor Hillegeist wrote: So, I mostly do programming that is of run to completion I took a stab at the problem: http://dpaste.dzfl.pl/2eef530d00fc 0 nsecs with jitter of