Re: OT: Flash and Javascript (Was: Taunting)

2009-05-25 Thread BCS
Hello Nick, I wish you were a higher-up at Epic ;) They seem to have pretty much the opposite attitude, and I get so worked-up every time I see a quote from CliffyB or any of the others... I'm sorry to disappoint, but gaming is the only case where building to the latest hardware has any

feature request expanded class object? Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-25 Thread nobody
== Quote from Leandro Lucarella (llu...@gmail.com)'s article benefit from using NO_SCAN if your 800M of data are plain old data. Did you tried it? And if you never have interior pointers to that data, your program can possibly avoid a lot of false positives due to the conservativism if you use

Template limits

2009-05-25 Thread bearophile
This post is a partial copy of a post of mine from digitalmars.D.learn. Lot of people seem to ignore that place. This is the only way I have found to create a certain static array at compile time: int sumSqrt(int n) { int result = 0; while (n) { int digit = n % 10; n /=

Re: !in operator?

2009-05-25 Thread Frits van Bommel
Stewart Gordon wrote: Jason House wrote: snip Method 1: if (x !in y) foo(); else{ auto z = x in y; bar(z); } Method 2: auto z = x in y; if (z is null) foo; else bar(z); Method 1 essentially calls in twice while method 2 calls in once. snip But there's no requirement to look it

Re: Template limits

2009-05-25 Thread Don
bearophile wrote: This post is a partial copy of a post of mine from digitalmars.D.learn. Lot of people seem to ignore that place. This is the only way I have found to create a certain static array at compile time: int sumSqrt(int n) { int result = 0; while (n) { int digit =

Re: Finalizing D2

2009-05-25 Thread Lionello Lunesu
Andrei Alexandrescu wrote: grauzone wrote: * std.mmfile: integrate with the garbage collector. It should be there. Why should the GC know about it? To add: in all sane situations, the mmaped region won't contain any pointers, and the GC doesn't have to scan it. Allocating address space is

Re: Template limits

2009-05-25 Thread Max Samukha
On Mon, 25 May 2009 05:57:39 -0400, bearophile bearophileh...@lycos.com wrote: This post is a partial copy of a post of mine from digitalmars.D.learn. Lot of people seem to ignore that place. This is the only way I have found to create a certain static array at compile time: int sumSqrt(int

Re: Asserts inside nothrow function

2009-05-25 Thread downs
Denis Koroskin wrote: I just started using nothrow functions a little bit and came across the following issue. Some of the functions that I'd like to mark as nothrow have debug asserts inside them. They used to throw an Exception, but I'd like to change their behavior and terminate an

Re: Template limits

2009-05-25 Thread bearophile
Max Samukha: Your example can be rewritten like this: [...] Thank you, it works. I have tried using result~=m; in a forward-directed for loop, but that didn't work. I think because result=m~result; creates a new array, while result~=m; tries to extend it, failing (even if with result~=m; D1

Re: Template limits

2009-05-25 Thread Don
bearophile wrote: Max Samukha: Your example can be rewritten like this: [...] Thank you, it works. I have tried using result~=m; in a forward-directed for loop, but that didn't work. I think because result=m~result; creates a new array, while result~=m; tries to extend it, failing (even if

Re: Location of popFront

2009-05-25 Thread Andrei Alexandrescu
Lionello Lunesu wrote: Andrei, I noticed in random.d, uniform template, that popFront is called in different locations for integral compared to floating point types: for integral types you .front first and .popFront afterwards, but for floating point types you start with .popFront and then

Re: Location of popFront

2009-05-25 Thread Lionello Lunesu
Definitely warrants a bug report. I'm busy today but I might find time for it tomorrow. http://d.puremagic.com/issues/show_bug.cgi?id=3025

Re: [OT] n-way union

2009-05-25 Thread Georg Wrede
Andrei Alexandrescu wrote: This is somewhat OT but I think it's an interesting problem. Consider the following data: double[][] a = [ [ 1, 4, 7, 8 ], [ 1, 7 ], [ 1, 7, 8], [ 4 ], [ 7 ], ]; We want to compute an n-way union, i.e., efficiently span all elements in all

Re: [OT] n-way union

2009-05-25 Thread bearophile
Andrei Alexandrescu: Needless to say, nWayUnion is a range :o). It's better for nWayUnion to be a lazy iterable. As probably others have already said, you can keep an heap of pointers, and compute the heap invariant using as opCmp a function that uses the values they point to. When nWayUnion

Re: feature request expanded class object? Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-25 Thread Leandro Lucarella
nobody, el 25 de mayo a las 07:37 me escribiste: == Quote from Leandro Lucarella (llu...@gmail.com)'s article benefit from using NO_SCAN if your 800M of data are plain old data. Did you tried it? And if you never have interior pointers to that data, your program can possibly avoid a lot of

Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-25 Thread Leandro Lucarella
nobody, el 25 de mayo a las 03:24 me escribiste: As other asked, are you using D1 Tango/Phobos? D2? In Tango/D2 you can DMD v2.030 on Linux. enable logging in the GC (using the LOGGING version identifier). How to do it in D2? You should recompile Druntime's GC with -version=LOGGING.

Re: !in operator?

2009-05-25 Thread Leandro Lucarella
Frits van Bommel, el 25 de mayo a las 12:37 me escribiste: Stewart Gordon wrote: Jason House wrote: snip Method 1: if (x !in y) foo(); else{ auto z = x in y; bar(z); } Method 2: auto z = x in y; if (z is null) foo; else bar(z); Method 1 essentially calls in twice

Re: Template limits

2009-05-25 Thread Walter Bright
bearophile wrote: It's a bug in D1, actually. The bug was fixed in D2 but not yet in D1. As you increase the value, D1 will just silently segfault eventually. I believe D1 will be fixed in the next release. So I'll be unable to loop a template 1000 times in D1 too? The problem is that

Re: Template limits

2009-05-25 Thread bearophile
Walter Bright: The problem is that enough recursion will blow up the stack in the compiler. I set a limit below that. But, naturally, for any limit I set someone will try to exceed it. I accept that some limits exist. For many situations a template nesting of 1000 is plenty. My problems

Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-25 Thread nobody
== Quote from Leandro Lucarella (llu...@gmail.com)'s article nobody, el 25 de mayo a las 03:24 me escribiste: As other asked, are you using D1 Tango/Phobos? D2? In Tango/D2 you can DMD v2.030 on Linux. enable logging in the GC (using the LOGGING version identifier). How to do it

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
Georg Wrede wrote: Andrei Alexandrescu wrote: This is somewhat OT but I think it's an interesting problem. Consider the following data: double[][] a = [ [ 1, 4, 7, 8 ], [ 1, 7 ], [ 1, 7, 8], [ 4 ], [ 7 ], ]; We want to compute an n-way union, i.e., efficiently span all

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
bearophile wrote: The most general input is a lazy range of lazy sorted ranges, in this situation the nWayUnion has to first duplicate it into an eager array of such ranges, and then turn it into an heap as before. I guess in most situations you don't have more than thausands of such sorted

Needing templates/compile-time functions for debugging

2009-05-25 Thread Ary Borenszweig
Hi! I'm in need of heavy (long, complicated, interesting, whatever) templates and/or compile-time functions to help me debug the compile-time debugger I'm writing. Can you paste/attach some here, or give me links? Thanks, Ary

Re: Needing templates/compile-time functions for debugging

2009-05-25 Thread Andrei Alexandrescu
Ary Borenszweig wrote: Hi! I'm in need of heavy (long, complicated, interesting, whatever) templates and/or compile-time functions to help me debug the compile-time debugger I'm writing. Can you paste/attach some here, or give me links? Thanks, Ary Have you considered Phobos2 itself?

Re: how to use GC as a leak detector? i.e. get some help info from GC?

2009-05-25 Thread Leandro Lucarella
nobody, el 25 de mayo a las 18:31 me escribiste: == Quote from Leandro Lucarella (llu...@gmail.com)'s article nobody, el 25 de mayo a las 03:24 me escribiste: As other asked, are you using D1 Tango/Phobos? D2? In Tango/D2 you can DMD v2.030 on Linux. enable logging in the GC

Re: Needing templates/compile-time functions for debugging

2009-05-25 Thread BCS
Reply to Ary, Hi! I'm in need of heavy (long, complicated, interesting, whatever) templates and/or compile-time functions to help me debug the compile-time debugger I'm writing. Can you paste/attach some here, or give me links? Thanks, Ary HECK yes!

Re: OT: on IDEs and code writing on steroids

2009-05-25 Thread Yigal Chripun
BCS wrote: Hello Yigal, C# assemblies are analogous to C/C++/D libs. you can't create a standalone executable in D just by parsing the D source files (for all the imports) if you need to link in external libs. you need to at least specify the lib name if it's on the linker's search path or

Re: OT: on IDEs and code writing on steroids

2009-05-25 Thread BCS
Reply to Yigal, BCS wrote: Hello Yigal, C# assemblies are analogous to C/C++/D libs. you can't create a standalone executable in D just by parsing the D source files (for all the imports) if you need to link in external libs. you need to at least specify the lib name if it's on the linker's

Re: [OT] n-way union

2009-05-25 Thread Georg Wrede
Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: This is somewhat OT but I think it's an interesting problem. Consider the following data: double[][] a = [ [ 1, 4, 7, 8 ], [ 1, 7 ], [ 1, 7, 8], [ 4 ], [ 7 ], ]; We want to compute an n-way union,

Re: Needing templates/compile-time functions for debugging

2009-05-25 Thread Robert Clipsham
Ary Borenszweig wrote: Hi! I'm in need of heavy (long, complicated, interesting, whatever) templates and/or compile-time functions to help me debug the compile-time debugger I'm writing. Can you paste/attach some here, or give me links? Thanks, Ary I'd give tools and xf.* a shot, they

Re: [OT] n-way union

2009-05-25 Thread bearophile
Georg Wrede: You probably have to have an array of structs, where each struct contains a reference to a subarray, and a copy of the first value of this subarray. Keeping a cached copy of the first item of the subarray (subrange) may be better in some situations and worse (compared to

Re: [OT] n-way union

2009-05-25 Thread Jason House
Georg Wrede Wrote: Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: This is somewhat OT but I think it's an interesting problem. Consider the following data: double[][] a = [ [ 1, 4, 7, 8 ], [ 1, 7 ], [ 1, 7, 8], [ 4 ], [ 7 ],

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
Georg Wrede wrote: Andrei Alexandrescu wrote: You can assume that each array is sorted. Err, you didn't comment on my algorithm, at the end. So, either it is worthless to an extent not deserving even a dismissal, or you didn't read the rest of the post. I am sorry, at the first two reads

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
bearophile wrote: For Andrei: in my last post I have suggested to remove from the heap the references to the sub-ranges as soon they are exhausted. But lot of tests of mine have shown me that's often not the most efficient strategy: http://www.fantascienza.net/leonardo/ar/list_deletions.html

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
Jason House wrote: Don't get offended, he didn't respond to anyone else's algorithm either. I just wanted to bring what I think is an interesting problem to the table; my response shouldn't be used as a yardstick for one's ability to define a good algorithm. Now that I feel pressured to

Re: [OT] n-way union

2009-05-25 Thread Andrei Alexandrescu
bearophile wrote: For Andrei: in my last post I have suggested to remove from the heap the references to the sub-ranges as soon they are exhausted. But lot of tests of mine have shown me that's often not the most efficient strategy: http://www.fantascienza.net/leonardo/ar/list_deletions.html

Re: What a nice bug!

2009-05-25 Thread Denis Koroskin
Sorry for bumping this thread once, but I came across this issue again today. It took my all the day to cut my project as much as possible while still preserving this bug. Changing nearly anything also vanishes the bug. Here are some examples: 1) There are a few cases where I extend an empty

Re: What a nice bug!

2009-05-25 Thread Denis Koroskin
Sorry for a lot of mistakes in this post, I'm sleepy (it's almost 5 am here) and forgot to make a second pass through the text to fix them.

Re: [OT] n-way union

2009-05-25 Thread Georg Wrede
Andrei Alexandrescu wrote: Georg Wrede wrote: Andrei Alexandrescu wrote: You can assume that each array is sorted. Err, you didn't comment on my algorithm, at the end. So, either it is worthless to an extent not deserving even a dismissal, or you didn't read the rest of the post. I am

Re: [OT] n-way union

2009-05-25 Thread BCS
Hello Jason, I bet BCS had the advantage of a real keyboard ;) you are 89% correct: http://en.wikipedia.org/wiki/Acer_Aspire_One

sqlserver2000 for d2 api ?

2009-05-25 Thread dolive
Who have the sqlserver2000 for d2 api ? Can you give me ? thank you ! doliv...@sina.com

Re: DWT2 built with DSSS

2009-05-25 Thread Kristoffer
Sam Hu skrev: To Kristoffer: I tried and the dwt2 is compiled successfully,but the same problem that can not compile app with DSSS ,nor can compile an app which include more than one module. Is is possible to pass me a copy of your compiled sets?I am as cuirous as depressed what' the

Re: Why do I get stack overflow?

2009-05-25 Thread bearophile
Ary Borenszweig: Thanks. Later in my head I instantiated the template and noticed the problem. In time I have created similar problems in my code 2-3 times, missing a static before some if. Can't the compiler help spot such bugs? If the variables a dynamic if works on are constants

Re: How many people here use stackoverflow.com?

2009-05-25 Thread Nick Sabalausky
hasen hasan.alj...@gmail.com wrote in message news:gv72f1$2s7...@digitalmars.com... So, do you regularly visit http://stackoverflow.com/ or no? No, not really. There's a lot of thing about it I don't like, so I never use it.

[Issue 3010] ICE(mtype.c) function pointer type deduction puts compiler in corrupt state

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3010 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||patch --- Comment #2

[Issue 1994] Assertion failure: 't-deco' on line 597 in file 'mtype.c' - alias of function pointer type

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1994 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||patch CC|

[Issue 2952] Segfault on exit when using array ops with arrays of doubles larger than 8 elements

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2952 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au

[Issue 2952] Segfault on exit when using array ops with arrays of doubles larger than 8 elements

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2952 --- Comment #2 from Don clugd...@yahoo.com.au 2009-05-25 03:02:40 PDT --- I have fixed this but can't post it to the runtime source since dsource is down. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email

[Issue 932] static foreach in second template instantiation uses wrong tupleof

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=932 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 3024] array slicing bypass the stack var escape check

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3024 Koroskin Denis 2kor...@gmail.com changed: What|Removed |Added CC||2kor...@gmail.com

[Issue 3025] New: uniform(float, float) pops first, uniform(int, int) pops last

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3025 Summary: uniform(float,float) pops first, uniform(int,int) pops last Product: D Version: 2.030 Platform: PC OS/Version: Windows Status: NEW Severity:

Re: [Issue 2952] Segfault on exit when using array ops with arrays of doubles larger than 8 elements

2009-05-25 Thread Brad Roberts
d-bugm...@puremagic.com wrote: http://d.puremagic.com/issues/show_bug.cgi?id=2952 --- Comment #2 from Don clugd...@yahoo.com.au 2009-05-25 03:02:40 PDT --- I have fixed this but can't post it to the runtime source since dsource is down. In an earlier thread on one of the newsgroups, Sean

[Issue 339] Alias of function pointer type cannot be forward referenced

2009-05-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=339 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords||diagnostic