Reducing array.length triggers reallocation

2015-12-27 Thread milentin via Digitalmars-d-learn
I've just started learning D and noticed a bug, but wanted to confirm it here before reporting it. According to spec: "If the new array length is shorter, the array is not reallocated, and no data is copied. It is equivalent to slicing the array". Contradicted by a trivial program: void

Re: 2016Q1: std.blas

2015-12-27 Thread Russel Winder via Digitalmars-d-announce
On Sat, 2015-12-26 at 19:57 +, Ilya Yaroshenko via Digitalmars-d- announce wrote: > Hi, > > I will write GEMM and GEMV families of BLAS for Phobos. > > Goals: >   - code without assembler >   - code based on SIMD instructions >   - DMD/LDC/GDC support >   - kernel based architecture like

Re: Redesign of dlang.org

2015-12-27 Thread anonymous via Digitalmars-d
On 26.12.2015 21:21, Jacob Carlborg wrote: It does work, but it looks like it affected other bowers as well (Firefox). That's weird. Does it look bad? BTW, I still think that a custom look would be better. Something like the search field in Firefox. It has a the magnifier icon which acts

Re: D Consortium as Book / App Publisher... ?

2015-12-27 Thread Joakim via Digitalmars-d
On Wednesday, 23 December 2015 at 12:54:39 UTC, Jakob Jenkov wrote: I really want to put these paid blogging ideas into use one day, but maybe D isn't the place to do it. Or - maybe D is exactly the right use case. D doesn't already have a ton of available material, but still as a decent size

[Issue 15479] COFF: phobos/win64.mak failed to make clean with MODEL=32mscoff

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15479 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/678e1b46180fc192ec5520899a0c35b0c5934cf8 Issue 15479 - COFF:

Re: What's wrong with my debugger?

2015-12-27 Thread Rainer Schuetze via Digitalmars-d-learn
On 24.12.2015 14:57, Chris wrote: On Thursday, 24 December 2015 at 09:30:24 UTC, Rainer Schuetze wrote: In the locals window, mago displays all instances of variables, but with the same value (which might be some uninitialized value of a different declaration than expected). The Visual Studio

Is there a FIX engine written in D?

2015-12-27 Thread Kokyo via Digitalmars-d
Hi there, I've just read a thread about low latency programming using D. As a Java user, I'm developing low latency applications in the financial area. In Java, there are some comprehensive FIX engines like QuickFix/J or lightweight engines like Falcon available as open source. I like to

Re: Is there a FIX engine written in D?

2015-12-27 Thread tcak via Digitalmars-d
On Sunday, 27 December 2015 at 09:27:18 UTC, Kokyo wrote: Hi there, I've just read a thread about low latency programming using D. As a Java user, I'm developing low latency applications in the financial area. In Java, there are some comprehensive FIX engines like QuickFix/J or lightweight

Re: How to use GDC to get .a file on Linux?

2015-12-27 Thread tcak via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:19:21 UTC, FrankLike wrote: Hi, Now I need get the .a file on Linux,target system is ARM. If you use gcc ,you will use the 'ar' to get .a file, but how to do by GDC ? And how to get the execute file by .a file and .d file? Thank you. I couldn't have

Re: What is happening here?

2015-12-27 Thread Charles via Digitalmars-d
On Sunday, 27 December 2015 at 15:10:07 UTC, TheDGuy wrote: I don't understand this: https://www.youtube.com/watch?v=j_VCa-5VeP8=youtu.be The variable "discriminant" is below zero but it jumps right into the if statement? The video is private, so we can't see it. I think you wanted

[Issue 15480] std.algorithm.iteration.map not accepting multiple lambdas

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15480 --- Comment #2 from karthikeyan --- Seems this depends upon https://issues.dlang.org/show_bug.cgi?id=5710. Atleast can this assert be removed or replaced by some other logic to check for void functions? --

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread SimonN via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:41:10 UTC, TheDGuy wrote: It looks like the debugger is not working correctly because i changed the code to this: [...] and the same problem appears. I can't watch youtube here. What numbers does your input generate? Which 'if' doesn't fire? What results

Re: What is happening here?

2015-12-27 Thread Bubbasaur via Digitalmars-d
On Sunday, 27 December 2015 at 15:10:07 UTC, TheDGuy wrote: I don't understand this: https://www.youtube.com/watch?v=j_VCa-5VeP8=youtu.be The variable "discriminant" is below zero but it jumps right into the if statement? Please paste the code here: http://dpaste.dzfl.pl/ Bubba.

Re: Redesign of dlang.org

2015-12-27 Thread anonymous via Digitalmars-d
On 27.12.2015 15:04, Jacob Carlborg wrote: https://drive.google.com/open?id=0B7UtafxGD9vEQTVjeXZhSDdRZDA The caret seems to be a bit high maybe, but otherwise that's how it's supposed to look. Feel free to criticize, of course.

pl0stuff an optimizing pl0 > c transcompiler

2015-12-27 Thread Stefan Koch via Digitalmars-d-announce
Hello again. I'd like to announce a simple pl0 trans-compiler. https://github.com/UplinkCoder/pl0stuff with my parser generator it took me about 3 hours to get the compiler running. The implemented optimizations are * function-call-inclining * nested-block-simplification, *

Re: D Consortium as Book / App Publisher... ?

2015-12-27 Thread Joakim via Digitalmars-d
On Sunday, 27 December 2015 at 14:44:37 UTC, Ola Fosheim Grøstad wrote: On Sunday, 27 December 2015 at 08:25:58 UTC, Joakim wrote: recently). Rather, the goal would be a site for hobbyists to learn how to use the language to its fullest, without having to dive into the source and github PRs

Re: specifying an auto array type

2015-12-27 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 27 December 2015 at 07:40:55 UTC, Ali Çehreli wrote: It looks like you need map(), not each(): import std.algorithm; import std.typecons; import std.array; void main() { auto a = [ 1, 2 ]; auto arr = a.map!(e => tuple(2 * e, e * e)).array; static assert(is(typeof(arr)

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:39:18 UTC, SimonN wrote: On Sunday, 27 December 2015 at 16:01:37 UTC, TheDGuy wrote: Sry: if((x1 < 0) & (x2 >= 0)){ This looks like a bug, with & instead of &&. -- Simon It looks like the debugger is not working correctly because i

[Issue 15434] [REG2.068] object.d imports from rt (breaking inline builds)

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15434 yazan.dab...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: How to use GDC to get .a file on Linux?

2015-12-27 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:19:21 UTC, FrankLike wrote: Hi, Now I need get the .a file on Linux,target system is ARM. If you use gcc ,you will use the 'ar' to get .a file, but how to do by GDC ? And how to get the execute file by .a file and .d file? Thank you. Just use ar on the

[Issue 15480] std.algorithm.iteration.map not accepting multiple lambdas

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15480 --- Comment #3 from karthikeyan --- Seems related : https://github.com/D-Programming-Language/phobos/pull/1917 --

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:03:16 UTC, Bubbasaur wrote: On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 Tell me one thing, what is the value returned? Well It's working here:

Re: Redesign of dlang.org

2015-12-27 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-27 13:06, anonymous wrote: That's weird. Does it look bad? https://drive.google.com/open?id=0B7UtafxGD9vEQTVjeXZhSDdRZDA b) It would require Javascript, right? I have no idea. -- /Jacob Carlborg

[Issue 15480] New: std.algorithm.iteration.map not accepting multiple lambdas

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15480 Issue ID: 15480 Summary: std.algorithm.iteration.map not accepting multiple lambdas Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8

Re: 2016Q1: std.blas

2015-12-27 Thread Ilya Yaroshenko via Digitalmars-d-announce
On Sunday, 27 December 2015 at 10:28:53 UTC, Russel Winder wrote: On Sat, 2015-12-26 at 19:57 +, Ilya Yaroshenko via Digitalmars-d- announce wrote: Hi, I will write GEMM and GEMV families of BLAS for Phobos. Goals:   - code without assembler   - code based on SIMD instructions   -

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread SimonN via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:01:37 UTC, TheDGuy wrote: Sry: if((x1 < 0) & (x2 >= 0)){ This looks like a bug, with & instead of &&. -- Simon

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:48:44 UTC, SimonN wrote: On Sunday, 27 December 2015 at 16:41:10 UTC, TheDGuy wrote: It looks like the debugger is not working correctly because i changed the code to this: [...] and the same problem appears. I can't watch youtube here. What numbers does

Re: Mockup of my doc dream ideas

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d
I've started some parsing of ddoc sections and continue work on the formatter: http://dpldocs.info/experimental-docs/std.algorithm.searching.findSplit.html I'm pretty happy with how this is turning out. Going to add more rich info to params later - I realize I can't parse all constraints,

Re: How to instantiate a map with multiple functions

2015-12-27 Thread karthikeyan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 02:21:11 UTC, Ali Çehreli wrote: On 12/26/2015 05:26 PM, Karthikeyan wrote: > if I need to map on a array of tuples will that work with the tuple being > unpacked or do I need to get it as single element and do unpacking myself? Unfortunately, there is no

What is happening here?

2015-12-27 Thread TheDGuy via Digitalmars-d
I don't understand this: https://www.youtube.com/watch?v=j_VCa-5VeP8=youtu.be The variable "discriminant" is below zero but it jumps right into the if statement?

Re: Three Cool Things about D

2015-12-27 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 12/26/15 4:17 PM, Daniel Kozak via Digitalmars-d-announce wrote: https://strongloop.com/strongblog/compare-javascript-templates-jade-mustache-dust/ Andrei Alexandrescu via Digitalmars-d-announce napsal So, pro 26, 2015 v 8∶58 : On 12/26/15 1:35 PM,

Re: Official Announcement: 'Learning D' is Released

2015-12-27 Thread Mike Parker via Digitalmars-d-announce
On Saturday, 26 December 2015 at 19:09:22 UTC, Kingsley wrote: On Saturday, 26 December 2015 at 17:58:52 UTC, Guillaume Piolat wrote: Really appreciate the attention to detail that went into it. This is a fantastic book - thanks very much to Mike for all the effort and attention he put into

Is it possible to elegantly create a range over a binary heap?

2015-12-27 Thread Gary Willoughby via Digitalmars-d-learn
I have a binary tree storing ints implemented using an array. The internal state looks like this: 8,7,6,4,1,3,5,2 When extracting this data, it is returned as 8,7,6,5,4,3,2,1. Is it possible to elegantly add a range on top of the internal state to return the correct value order I would

Re: D Consortium as Book / App Publisher... ?

2015-12-27 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 27 December 2015 at 08:25:58 UTC, Joakim wrote: recently). Rather, the goal would be a site for hobbyists to learn how to use the language to its fullest, without having to dive into the source and github PRs to extract all that info themselves. Obviously, learning D might

Re: How to use GDC to get .a file on Linux?

2015-12-27 Thread FrankLike via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:24:17 UTC, tcak wrote: On Sunday, 27 December 2015 at 15:19:21 UTC, FrankLike wrote: Hi, Now I need get the .a file on Linux,target system is ARM. If you use gcc ,you will use the 'ar' to get .a file, but how to do by GDC ? And how to get the execute

Is this an rvalue reference problem?

2015-12-27 Thread Gary Willoughby via Digitalmars-d-learn
See the following code: import std.stdio; void foo(ref int x) { writefln("%s", x); } void main(string[] args) { int y = 0; foo(y++); } When compiled it produces this error: test.d(11): Error: function test.foo (ref int x) is not callable using argument types (int)

Re: Three Cool Things about D

2015-12-27 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 12/27/15 1:27 AM, Rory McGuire via Digitalmars-d-announce wrote: On 26 Dec 2015 22:00, "Andrei Alexandrescu via Digitalmars-d-announce" > wrote: > > On 12/26/15 1:35 PM, Rory McGuire via

Re: 2016Q1: std.blas

2015-12-27 Thread Andrei Alexandrescu via Digitalmars-d-announce
On 12/27/15 12:23 AM, Basile B. wrote: On Saturday, 26 December 2015 at 19:57:19 UTC, Ilya Yaroshenko wrote: - allocators support. GEMM requires small internal allocations. - @nogc nothrow pure template functions (depends on allocator) Do you mean using std.experimental.allocators and

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread SimonN via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:52:39 UTC, TheDGuy wrote: I don't understand why my program goes into the if statement if the debugger shows, that the variable "discriminant" is below zero even though: "if(discriminant > 0)"? I have a hard time believing this. Does the problem persist if

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread Bubbasaur via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 Tell me one thing, what is the value returned? Well It's working here: http://dpaste.dzfl.pl/18b27ea26b08 Maybe you would like to change the code above to

Re: Is this an rvalue reference problem?

2015-12-27 Thread tsbockman via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:05:39 UTC, Gary Willoughby wrote: If I remove the post-increment of the y variable if works. Is this an rvalue reference issue? Would you expect this to work? This should work with *pre*-increment, but not post-increment. Post-increment works like this: int

Re: Is this an rvalue reference problem?

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:05:39 UTC, Gary Willoughby wrote: void foo(ref int x) foo(y++); If I remove the post-increment of the y variable if works. Is this an rvalue reference issue? Yes, but more than that, what, exactly, would you expect from that? The order of operations

Re: Struct destructors not always called?

2015-12-27 Thread Jeremy DeHaan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:47:52 UTC, Adam D. Ruppe wrote: On Sunday, 27 December 2015 at 18:40:55 UTC, Jeremy DeHaan wrote: I was playing around with some code today and I noticed that in some cases struct destructors are not called. struct destructors are called when the struct

Re: Is it possible to elegantly create a range over a binary heap?

2015-12-27 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 27 December 2015 at 17:23:35 UTC, Gary Willoughby wrote: I have a binary tree storing ints implemented using an array. The internal state looks like this: 8,7,6,4,1,3,5,2 When extracting this data, it is returned as 8,7,6,5,4,3,2,1. Is it possible to elegantly add a range on top

Re: Is this an rvalue reference problem?

2015-12-27 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:54:25 UTC, Adam D. Ruppe wrote: On Sunday, 27 December 2015 at 16:05:39 UTC, Gary Willoughby wrote: [...] Yes, but more than that, what, exactly, would you expect from that? The order of operations with the postfix ++ operator and ref would probably lead to

Re: Ranges: How to take N last of elements of range

2015-12-27 Thread Jakob Ovrum via Digitalmars-d-learn
On Saturday, 26 December 2015 at 05:31:59 UTC, Ur@nuz wrote: On Friday, 25 December 2015 at 20:06:04 UTC, drug wrote: 25.12.2015 17:13, Ur@nuz пишет: [...] You can do following http://dpaste.dzfl.pl/41c57f89a5a0 The reason of compile error is your using a range as a separator, change it

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
On Sunday, 27 December 2015 at 16:00:34 UTC, jkpl wrote: On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 You could post the code also, personnaly I'm always almost at 2 meters from my screen, with zoom,

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread jkpl via Digitalmars-d-learn
On Sunday, 27 December 2015 at 15:53:55 UTC, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 You could post the code also, personnaly I'm always almost at 2 meters from my screen, with zoom, so I can't read the code...

Re: Struct destructors not always called?

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 December 2015 at 18:40:55 UTC, Jeremy DeHaan wrote: I was playing around with some code today and I noticed that in some cases struct destructors are not called. struct destructors are called when the struct ceases to exist in the program. A global variable never ceases to

Re: Struct destructors not always called?

2015-12-27 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 27 December 2015 at 19:04:11 UTC, Jeremy DeHaan wrote: So are these left dangling or do they actually get cleaned up at the program exit? They are left dangling right now. You can clear it yourself by defining a `static ~this() { .destroy(your struct); }` somewhere in the module.

each! vs foreach parallel timings

2015-12-27 Thread Jay Norwood via Digitalmars-d-learn
I'm doing some re-writing and measuring. The basic task is to take 10K samples (in struct S samples below) and calculate some metrics (just per sample for now). It isn't evident to me how to write the parallel foreach in the same format as each!, so I just used the loop form that I

Re: Double precision?

2015-12-27 Thread Bubbasaur via Digitalmars-d-learn
On Sunday, 27 December 2015 at 20:06:53 UTC, TheDGuy wrote: I don't know what my computer is doing today: x and y are coordinates and if x is any number from 0 to 150 the result of x/width is always zero Dividing Integers will result in Integer: int x = 10, width = 50;

[Issue 15480] std.algorithm.iteration.map not accepting multiple lambdas

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15480 --- Comment #1 from karthikeyan --- I took a local copy of the std.algorithm.iteration as myiteration.d and used it for debugging. Commenting out the following two lines make this work

How to use GDC to get .a file on Linux?

2015-12-27 Thread FrankLike via Digitalmars-d-learn
Hi, Now I need get the .a file on Linux,target system is ARM. If you use gcc ,you will use the 'ar' to get .a file, but how to do by GDC ? And how to get the execute file by .a file and .d file? Thank you.

Struct destructors not always called?

2015-12-27 Thread Jeremy DeHaan via Digitalmars-d-learn
I was playing around with some code today and I noticed that in some cases struct destructors are not called. for example: impost std.stdio; SomeStruct global; void main() { SomeStruct inMain; writeln(global.thing); writeln(inMain.thing); writeln(getSomeInt()); } int

[Issue 15434] [REG2.068] object.d imports from rt (breaking inline builds)

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15434 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #3

Double precision?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
I don't know what my computer is doing today: code: double normalized_i = (x / width) - 0.5; double normalized_j = (y / height) - 0.5; writeln(x); writeln(normalized_i); writeln(y);

Re: Reducing array.length triggers reallocation

2015-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2015 02:09 AM, milentin wrote: > I've just started learning D and noticed a bug, but wanted to confirm it > here before reporting it. > > According to spec: "If the new array length is shorter, the array is not > reallocated, and no data is copied. It is equivalent to slicing the >

Re: each! vs foreach parallel timings

2015-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2015 04:17 PM, Jay Norwood wrote: On Sunday, 27 December 2015 at 23:42:57 UTC, Ali Çehreli wrote: That does not compile because i is size_t but apply_metrics() takes an int. One solution is to call to!int: foreach( i, ref a; parallel(samples[])){ apply_metrics(i.to!int,a);}

Re: each! vs foreach parallel timings

2015-12-27 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 27 December 2015 at 23:42:57 UTC, Ali Çehreli wrote: On 12/27/2015 11:30 AM, Jay Norwood wrote: > samples[].each!((int i, ref a)=>apply_metrics(i,a)); Are you using an older compiler? That tuple expansion does not work any more at least with dmd v2.069.0 but you can use

Re: Reducing array.length triggers reallocation

2015-12-27 Thread Ivan Kazmenko via Digitalmars-d-learn
On Sunday, 27 December 2015 at 22:36:32 UTC, Ali Çehreli wrote: [Several hours later...] You know what... I bet there is no actual allocation at all. I think what happens is, the code calls GC.realloc(24) and realloc() does not do anything. However, it still reports to the profiler that

Re: D Consortium as Book / App Publisher... ?

2015-12-27 Thread Rikki Cattermole via Digitalmars-d
On 28/12/15 3:44 AM, Ola Fosheim Grøstad wrote: On Sunday, 27 December 2015 at 08:25:58 UTC, Joakim wrote: recently). Rather, the goal would be a site for hobbyists to learn how to use the language to its fullest, without having to dive into the source and github PRs to extract all that info

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
On Sunday, 27 December 2015 at 22:51:27 UTC, Ali Çehreli wrote: On 12/27/2015 07:53 AM, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 YouTube says that the video has been removed by the user. That's exactly the reason why I don't like even dpaste.

Re: each! vs foreach parallel timings

2015-12-27 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 27 December 2015 at 23:42:57 UTC, Ali Çehreli wrote: That does not compile because i is size_t but apply_metrics() takes an int. One solution is to call to!int: foreach( i, ref a; parallel(samples[])){ apply_metrics(i.to!int,a);} It builds for me still, and executes ok,

Re: Variable below zero but if statement doesn't grab?

2015-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2015 07:53 AM, TheDGuy wrote: Any idea what i am doing wrong? https://www.youtube.com/watch?v=j_VCa-5VeP8 YouTube says that the video has been removed by the user. That's exactly the reason why I don't like even dpaste. There is no guarantee that such threads will be useful forever.

Re: specifying an auto array type

2015-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2015 08:42 AM, Jay Norwood wrote: > However, I was trying to use each!, with the intention of then moving to > parallel processing by samples blocks. My guess is this would be more > efficient than using parallel map or amap, which would parallel process > by function application, if I

GTKD drawing area remains white even SourceRgb is changed

2015-12-27 Thread TheDGuy via Digitalmars-d-learn
My code: http://dpaste.com/1X3E1HW i store colors in the accumulator-array and draw them via "cr.rectangle()". Because i have some problems with the code i set the SourceRgb-color to a constant value but if i execute the program, the window remains white.

Re: each! vs foreach parallel timings

2015-12-27 Thread Ali Çehreli via Digitalmars-d-learn
On 12/27/2015 11:30 AM, Jay Norwood wrote: > samples[].each!((int i, ref a)=>apply_metrics(i,a)); Are you using an older compiler? That tuple expansion does not work any more at least with dmd v2.069.0 but you can use enumerate():

Re: Better watch out! D runs on watchOS!

2015-12-27 Thread Joakim via Digitalmars-d-announce
On Monday, 28 December 2015 at 01:17:15 UTC, Dan Olson wrote: A little progress report. More to come later when I get something pushed to github. I bought a returned Apple Watch yesterday at discount for $223.99 US and tried to see how much of D would work on it using my iOS fork of LDC.

Better watch out! D runs on watchOS!

2015-12-27 Thread Dan Olson via Digitalmars-d-announce
A little progress report. More to come later when I get something pushed to github. I bought a returned Apple Watch yesterday at discount for $223.99 US and tried to see how much of D would work on it using my iOS fork of LDC. There were a few bumps, like dealing with embedded bitcode (a watchOS

How to config the GDC on linux target for ARM linux?

2015-12-27 Thread FrankLike via Digitalmars-d-learn
Now I build a project for ARM linux on ubuntu 15.04 ,but build error. I download the 'wiringPi' from http://wiringPi.com,convert the *.h to *.d.then build the 'aa.so' file: #! /bin/sh dfiles="max31855.d max5322.d mcp23008.d mcp23016.d mcp23016reg.d mcp23017.d mcp23s08.d mcp23s17.d mcp23x08.d

Re: Is there a FIX engine written in D?

2015-12-27 Thread Andy Smith via Digitalmars-d
On Sunday, 27 December 2015 at 09:51:42 UTC, tcak wrote: On Sunday, 27 December 2015 at 09:27:18 UTC, Kokyo wrote: Hi there, I've just read a thread about low latency programming using D. As a Java user, I'm developing low latency applications in the financial area. In Java, there are some

Re: Is it possible to elegantly create a range over a binary heap?

2015-12-27 Thread Ivan Kazmenko via Digitalmars-d-learn
On Sunday, 27 December 2015 at 20:01:47 UTC, Gary Willoughby wrote: On Sunday, 27 December 2015 at 17:23:35 UTC, Gary Willoughby wrote: I have a binary tree storing ints implemented using an array. The internal state looks like this: 8,7,6,4,1,3,5,2 When extracting this data, it is returned

[Issue 15481] New: Reducing array.length triggers reallocation

2015-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15481 Issue ID: 15481 Summary: Reducing array.length triggers reallocation Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: Reducing array.length triggers reallocation

2015-12-27 Thread milentin via Digitalmars-d-learn
On Sunday, 27 December 2015 at 22:36:32 UTC, Ali Çehreli wrote: I don't understand why that happens. I found one related bug: https://issues.dlang.org/show_bug.cgi?id=13750 I can understand that assignment to arr.length cannot be @nogc but I would expect a check against length so that there

Re: Voting For std.experimental.ndslice

2015-12-27 Thread Jack Stouffer via Digitalmars-d
On Thursday, 24 December 2015 at 17:10:25 UTC, Jack Stouffer wrote: On Sunday, 13 December 2015 at 05:10:17 UTC, Jack Stouffer wrote: This is the voting thread to decide if the proposed addition to Phobos, std.experimental.ndslice, should be accepted. Voting ends in three days. Have a merry

Re: "Programming in D" ebook is at major retailers

2015-12-27 Thread Vidar Wahlberg via Digitalmars-d-announce
Hi Ali. I've been reading your book recently and wish to comment on how excellent it is. It's easy to read, the concepts are well explained and I've learned lots about the language. I've always found D documentation a bit lacking, your book fills many of these gaps. Thank you for writing