Re: TKD AddProtocolCommand example

2014-05-15 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 21:41:04 UTC, DaveG wrote: Hopefully better formatting of code here: import tkd.tkdapplication; class Application : TkdApplication { private void exitCommand(CommandArgs args) { this.exit(); } private void saveMeCommand(CommandArgs args)

Re: Array!T and find are slow

2014-05-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Thu, 15 May 2014 05:53:45 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: As a workaround, I'm sure we could specialize enforce without lazy for built-in types? No. I don't think that that would work. The problem is that you'd have to be able to overload

Re: Array!T and find are slow

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 15 May 2014 at 06:52:44 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Thu, 15 May 2014 05:53:45 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: As a workaround, I'm sure we could specialize enforce without lazy for built-in types?

[Rosettacode] Growable slices

2014-05-15 Thread bearophile via Digitalmars-d-learn
This task asks for an basic implementation of the the Lempel-Ziv-Welch (LZW) compression/decompression algorithm. I am keeping two D versions, the first one is minimal, and the second is a little more optimized: http://rosettacode.org/wiki/LZW_compression#More_Refined_Version There are of

Re: Array!T and find are slow

2014-05-15 Thread Ary Borenszweig via Digitalmars-d-learn
On 5/15/14, 1:31 AM, Jonathan M Davis via Digitalmars-d-learn wrote: On Thu, 15 May 2014 01:29:23 + Kapps via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wednesday, 14 May 2014 at 23:50:34 UTC, Meta wrote: On the topic of lazy, why *is* it so slow, exactly? I thought

Re: Any chance to avoid monitor field in my class?

2014-05-15 Thread Daniel Murphy via Digitalmars-d-learn
Yuriy wrote in message news:rfirqtgbparjbqxwt...@forum.dlang.org... On Wednesday, 14 May 2014 at 08:47:38 UTC, Daniel Murphy wrote: I'm not getting any errors with the development head. What os/compiler version? Hm, now that's strange. Building with latest public version seems to work.

Re: Array!T and find are slow

2014-05-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On Wed, 14 May 2014 19:50:33 -0400, Meta jared...@gmail.com wrote: On Wednesday, 14 May 2014 at 22:32:01 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: Yeah, much as Andrei would hate to hear it (enforce was his idea, and he quite likes the idiom), the fact that lazy is so inefficient

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wed, 14 May 2014 08:27:45 + monarch_dodra via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 09:01:23 UTC, John Colvin wrote: Why would anyone ever want to sort code-points? Why not? To remove duplicate characters? They might want to sort graphemes, but that's difficult to do in-place (needs O(n) memory, I think...). If out-of-place is good enough

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 15 May 2014 at 13:26:45 UTC, Steven Schveighoffer wrote: On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wed, 14 May 2014 08:27:45 + monarch_dodra via Digitalmars-d-learn

Re: Any chance to avoid monitor field in my class?

2014-05-15 Thread Yuriy via Digitalmars-d-learn
On Thursday, 15 May 2014 at 11:51:38 UTC, Daniel Murphy wrote: This version seems to compile - the new manger can't handle extern(C++) functions with D arrays as arguments or return types. Ok, i can understand that, but what about this one: http://dpaste.dzfl.pl/6a9961e32e6d It doesn't use d

Re: [Rosettacode] Growable slices

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 15 May 2014 at 09:00:13 UTC, bearophile wrote: This task asks for an basic implementation of the the Lempel-Ziv-Welch (LZW) compression/decompression algorithm. I am keeping two D versions, the first one is minimal, and the second is a little more optimized:

Re: TKD AddProtocolCommand example

2014-05-15 Thread Gary Willoughby via Digitalmars-d-learn
On Wednesday, 14 May 2014 at 21:23:02 UTC, DaveG wrote: tkd\window\window.d(426): Error: undefined identifier CommandCallback Added the missing import and now all works fine. Fixed in v1.0.5-beta. Any more issues open them up in github and i'll deal with them there. :)

Re: TKD AddProtocolCommand example

2014-05-15 Thread DaveG via Digitalmars-d-learn
On Thursday, 15 May 2014 at 17:30:22 UTC, Gary Willoughby wrote: On Wednesday, 14 May 2014 at 21:23:02 UTC, DaveG wrote: tkd\window\window.d(426): Error: undefined identifier CommandCallback Added the missing import and now all works fine. Fixed in v1.0.5-beta. Any more issues open them up

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On Thu, 15 May 2014 11:37:07 -0400, monarch_dodra monarchdo...@gmail.com wrote: On Thursday, 15 May 2014 at 13:26:45 UTC, Steven Schveighoffer wrote: On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Wed, 14 May 2014

receiveTimeout minimum reasonable timeout value?

2014-05-15 Thread Charles Hixson via Digitalmars-d-learn
Duration can be specified in nanoseconds, but does it make any sense to have a value of 1 nanosecond? 0? My desire is to check whether a message is in the queue, and then either move it local to the thread, or continue, depending. Secondarily, is there much overhead in calling receiveTimeout

Re: *** GMX Spamverdacht *** RegEx for a simple Lexer

2014-05-15 Thread Tim Holzschuh via Digitalmars-d-learn
Am 13.05.2014 21:53, schrieb Tim Holzschuh via Digitalmars-d-learn: [...] Thank you for all your interesing links and tips, I'll check these out! Tim

Re: TKD AddProtocolCommand example

2014-05-15 Thread Mengu via Digitalmars-d-learn
On Thursday, 15 May 2014 at 17:30:22 UTC, Gary Willoughby wrote: On Wednesday, 14 May 2014 at 21:23:02 UTC, DaveG wrote: tkd\window\window.d(426): Error: undefined identifier CommandCallback Added the missing import and now all works fine. Fixed in v1.0.5-beta. Any more issues open them up

Re: receiveTimeout minimum reasonable timeout value?

2014-05-15 Thread JR via Digitalmars-d-learn
On Thursday, 15 May 2014 at 18:15:46 UTC, Charles Hixson via Digitalmars-d-learn wrote: Duration can be specified in nanoseconds, but does it make any sense to have a value of 1 nanosecond? 0? My desire is to check whether a message is in the queue, and then either move it local to the

Re: TKD AddProtocolCommand example

2014-05-15 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 15 May 2014 at 19:02:58 UTC, Mengu wrote: On Thursday, 15 May 2014 at 17:30:22 UTC, Gary Willoughby wrote: On Wednesday, 14 May 2014 at 21:23:02 UTC, DaveG wrote: tkd\window\window.d(426): Error: undefined identifier CommandCallback Added the missing import and now all works

Re: Why std.algorithm.sort can't be applied to char[]?

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 15 May 2014 at 17:46:52 UTC, Steven Schveighoffer wrote: As far as I'm concerned, if we *can* do it in n.log(n), and somebody provides the implementation, then there is no reason to not offer dchar sorting for char[]/wchar. I think there is nothing wrong with requiring the steps

Seg fault when calling C code

2014-05-15 Thread Andrew Brown via Digitalmars-d-learn
I'm trying to calculate residuals after fitting linear regression, and I've got some code in C using the gsl which should do it. Everything works fine if I use static arrays (below, defining X[15], y[5] etc.). Trouble is, I won't know the number of individuals or covariates until runtime, so

Re: Seg fault when calling C code

2014-05-15 Thread Ali Çehreli via Digitalmars-d-learn
On 05/15/2014 01:55 PM, Andrew Brown wrote: extern(C) { void regress(int nInd, int nCov, ref double[] x, ref double[] y, ref double[] rOut); } I don't think that should even be allowed. C functions should not know or be compatible with 'ref' D parameters. Define the arguments as simple

Re: Seg fault when calling C code

2014-05-15 Thread Andrew Brown via Digitalmars-d-learn
That worked a treat! Thank you very much! On Thursday, 15 May 2014 at 21:11:54 UTC, Ali Çehreli wrote: On 05/15/2014 01:55 PM, Andrew Brown wrote: extern(C) { void regress(int nInd, int nCov, ref double[] x, ref double[] y, ref double[] rOut); } I don't think that should even be

Re: receiveTimeout minimum reasonable timeout value?

2014-05-15 Thread Charles Hixson via Digitalmars-d-learn
On Thursday, May 15, 2014 08:21:41 PM JR via Digitalmars-d-learn wrote: On Thursday, 15 May 2014 at 18:15:46 UTC, Charles Hixson via Digitalmars-d-learn wrote: Duration can be specified in nanoseconds, but does it make any sense to have a value of 1 nanosecond? 0? My desire is to

XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Jack via Digitalmars-d-learn
I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking to try out Mono-D. Then this showed up: http://puu.sh/8NV4V.png Was wondering where I can get those dependencies, or how to solve this particular problem...

Re: XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Kapps via Digitalmars-d-learn
On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote: I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking to try out Mono-D. Then this showed up: http://puu.sh/8NV4V.png Was wondering where I can get those

Re: XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Kapps via Digitalmars-d-learn
On Friday, 16 May 2014 at 01:07:28 UTC, Kapps wrote: On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote: I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking to try out Mono-D. Then this showed up:

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-15 Thread Craig Dillabaugh via Digitalmars-d-learn
On Thursday, 15 May 2014 at 22:25:47 UTC, Tom Browder via Digitalmars-d-learn wrote: I am a volunteer developer with the well-known 3D CAD FOSS project BRL-CAD: http://brlcad.org I have wanted to use D for a long time but I hadn't taken the plunge. Yesterday I advertised to the BRL-CAD

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-15 Thread Craig Dillabaugh via Digitalmars-d-learn
On Friday, 16 May 2014 at 01:16:46 UTC, Craig Dillabaugh wrote: On Thursday, 15 May 2014 at 22:25:47 UTC, Tom Browder via Digitalmars-d-learn wrote: I am a volunteer developer with the well-known 3D CAD FOSS project BRL-CAD: http://brlcad.org I have wanted to use D for a long time but I

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-15 Thread Tom Browder via Digitalmars-d-learn
On Thu, May 15, 2014 at 8:24 PM, Craig Dillabaugh via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 16 May 2014 at 01:16:46 UTC, Craig Dillabaugh wrote: On Thursday, 15 May 2014 at 22:25:47 UTC, Tom Browder via Digitalmars-d-learn wrote: ... What I have not seen yet

Re: XamarinStudio dependency issues(Mono-D)

2014-05-15 Thread Jack via Digitalmars-d-learn
On Friday, 16 May 2014 at 01:11:52 UTC, Kapps wrote: On Friday, 16 May 2014 at 01:07:28 UTC, Kapps wrote: On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote: I recently downloaded Xamarin Studio from the Mono-Develop site(as this was the only available installer on that site) and was looking

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-15 Thread FrankLike via Digitalmars-d-learn
read through your Wiki posting though. One thing that came to mind was you used GMake. Perhaps you should consider using DUB. For example here is the DUB config file for one of my library bindings (in my case I used a static library though): ... Thanks, Craig, I'll look into dub. Best

Objects(from classes) at Compile time? no gc

2014-05-15 Thread Taylor Hillegeist via Digitalmars-d-learn
The subject says it all really. i have this example: import core.memory; class fruit{ int value=5; public int getvalue(){ return value; } } int main(string[] args) { GC.disable; static fruit myfruit; return myfruit.getvalue(); } Most of the smart people will see that i