Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 05/01/2017 10:51 PM, Stanislav Blinov wrote: On Monday, 1 May 2017 at 16:31:10 UTC, Nick Sabalausky (Abscissa) wrote: If we had a type similar to TaggedAlgebraic... Destroy? It's too strict: you have to specify concrete types beforehand. No, that's why my suggestion was: "If we had a t

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Stanislav Blinov via Digitalmars-d
On Tuesday, 2 May 2017 at 02:51:02 UTC, Stanislav Blinov wrote: Lost one else. Should be static if (traits & (AllocatorTraits.sharedInstance | AllocatorTraits.noGC)) @nogc shared { mixin AllocatorInterface!(); } else static if (traits & AllocatorTraits.sharedInsta

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Stanislav Blinov via Digitalmars-d
On Monday, 1 May 2017 at 16:31:10 UTC, Nick Sabalausky (Abscissa) wrote: If we had a type similar to TaggedAlgebraic... Destroy? It's too strict: you have to specify concrete types beforehand. This spills over into user code and makes it far less versatile that can be achieved. Currently w

Re: alias this on module

2017-05-01 Thread Jonathan Marler via Digitalmars-d
On Monday, 1 May 2017 at 23:06:00 UTC, Petar Kirov [ZombineDev] wrote: The common thing between modules and the other aggregate types (classes, interfaces, unions and structs) is that members of the former behave as if they were static members of the later. The difference, of course, is that si

Re: alias this on module

2017-05-01 Thread via Digitalmars-d
On Monday, 1 May 2017 at 21:50:02 UTC, Jonathan Marler wrote: On Monday, 1 May 2017 at 12:41:19 UTC, Steven Schveighoffer wrote: On 4/30/17 7:59 PM, Jonathan Marler wrote: On Sunday, 30 April 2017 at 23:44:32 UTC, Steven Schveighoffer wrote: On 4/30/17 7:35 PM, Jonathan Marler wrote: Any reaso

Re: [OT] Algorithm question

2017-05-01 Thread MysticZach via Digitalmars-d
On Monday, 1 May 2017 at 16:56:58 UTC, MysticZach wrote: The goal is to have the first hit be the one you return. The method: if a random pick doesn't satisfy, randomly choose the partition greater than or less than based on uniform(0..array.length-1), and do the same procedure on that partiti

Re: alias this on module

2017-05-01 Thread Jonathan Marler via Digitalmars-d
On Monday, 1 May 2017 at 12:41:19 UTC, Steven Schveighoffer wrote: On 4/30/17 7:59 PM, Jonathan Marler wrote: On Sunday, 30 April 2017 at 23:44:32 UTC, Steven Schveighoffer wrote: On 4/30/17 7:35 PM, Jonathan Marler wrote: Any reason why "alias this" doesn't work at the module level? If I rec

Re: The D ecosystem in Debian with free-as-in-freedom DMD

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 11 April 2017 at 23:02, Johannes Pfau via Digitalmars-d wrote: > Am Tue, 11 Apr 2017 14:21:57 + > schrieb Matthias Klumpp : > >> can be used by Automake >> (native), > > Do you maintain D support for automake? I wrote some basic D support > for autoconf and libtool > (https://github.com/D-P

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Andrej Mitrovic via Digitalmars-d
On Monday, 1 May 2017 at 19:02:11 UTC, H. S. Teoh wrote: 1) Suppose my base class has 3 ctors, and I only want my derived class to inherit 1 of them. Does this DIP allow for that? Initially when designing the DIP I haven't thought about this use-case, but I've had more thought put into it rec

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Andrej Mitrovic via Digitalmars-d
On Monday, 1 May 2017 at 18:34:43 UTC, H. S. Teoh wrote: so the fact that they now have different syntaxes was seen as an advantage. Yeah, I remember that decision. I don't think I've ever agreed with it, though. :o) We'll see.. I don't personally find it very important, I'm fine with eithe

Re: DMD VS2017 Support

2017-05-01 Thread Igor via Digitalmars-d
On Monday, 1 May 2017 at 18:30:53 UTC, Rainer Schuetze wrote: VS 2017 uses a "private" registry that the Visual D installer doesn't have access to. I'll change the registry location in the next release. Please note that the next dmd installer will also detect VS2017 and setup directories co

Re: DConf Hackathon Ideas

2017-05-01 Thread Jacob Carlborg via Digitalmars-d
On 2017-05-01 16:51, Mike Parker wrote: I love SDL and much prefer it over JSON for DUB configs. Use it for all of my D projects. It looks cleaner and supports comments. I really would hate to see support dropped. +1 I would be fine with YAML as well. -- /Jacob Carlborg

Re: [OT] Algorithm question

2017-05-01 Thread MysticZach via Digitalmars-d
On Monday, 1 May 2017 at 16:56:58 UTC, MysticZach wrote: // choose a random partition proportionally auto j = uniform(da.length - 1); if (j < i) { // the lower partition int a = randomlySatisfyImpl(da[0..i], j); if (a != -1) return a; else return randomlySatisfyIm

Re: CTFE Status 2

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 06:23:08PM +, Stefan Koch via Digitalmars-d wrote: > On Sunday, 30 April 2017 at 19:52:27 UTC, H. S. Teoh wrote: > > On Sun, Apr 30, 2017 at 01:26:09PM +, Stefan Koch via Digitalmars-d > > wrote: > > > On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote:

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 02:55:28PM +, Mike Parker via Digitalmars-d wrote: > DIP 1004 is titled "Inherited Constructors. > > https://github.com/dlang/DIPs/blob/master/DIPs/DIP1004.md [...] I'm appalled that the only discussion that has come up so far is related to syntax rather than semantics

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 04:08:36PM +, Andrej Mitrovic via Digitalmars-d wrote: > On Monday, 1 May 2017 at 15:33:47 UTC, Basile B. wrote: > > On Monday, 1 May 2017 at 14:55:28 UTC, Mike Parker wrote: > > > DIP 1004 is titled "Inherited Constructors. [...] > > > All review-related feedback on an

Re: DConf Hackathon Ideas

2017-05-01 Thread Stefan Koch via Digitalmars-d
On Monday, 1 May 2017 at 17:04:42 UTC, Iain Buclaw wrote: On 1 May 2017 at 16:51, Mike Parker via Digitalmars-d wrote: On Monday, 1 May 2017 at 14:38:11 UTC, Joseph Rushton Wakeling wrote: On Thursday, 27 April 2017 at 16:33:02 UTC, singingbush wrote: SDL should be dropped. Deprecated, s

Re: DMD VS2017 Support

2017-05-01 Thread Rainer Schuetze via Digitalmars-d
On 01.05.2017 10:03, Igor wrote: On Monday, 1 May 2017 at 01:54:30 UTC, evilrat wrote: On Sunday, 30 April 2017 at 16:05:10 UTC, Igor wrote: I should also mention that compiling using DUB works. It only doesn't work from VS. Check your VisualD settings and make sure it has DMD path set up.

Re: CTFE Status 2

2017-05-01 Thread Stefan Koch via Digitalmars-d
On Sunday, 30 April 2017 at 19:52:27 UTC, H. S. Teoh wrote: On Sun, Apr 30, 2017 at 01:26:09PM +, Stefan Koch via Digitalmars-d wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: > [ ... ] Big news! The first step to include debug info has been done. Yes this means y

Re: DConf Hackathon Ideas

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 06:02:53PM +, Moritz Maxeiner via Digitalmars-d wrote: > On Monday, 1 May 2017 at 17:04:42 UTC, Iain Buclaw wrote: > > [...] > > > > We should make XML the default config format for DUB. > > > > [...] > > > > /Runaway! > > Well, at least nearly everyone hates XML eq

Re: DConf Hackathon Ideas

2017-05-01 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 1 May 2017 at 17:04:42 UTC, Iain Buclaw wrote: [...] We should make XML the default config format for DUB. [...] /Runaway! Well, at least nearly everyone hates XML equally, which may be an indicator of a good compromise.

Re: DConf Hackathon Ideas

2017-05-01 Thread Joakim via Digitalmars-d
On Thursday, 27 April 2017 at 14:53:02 UTC, Mike Parker wrote: This year, DConf has an extra day tacked on for problem solving in the form of a hackathon. The intent is to work on issues people find frustrating in the D ecosystem. While there will be time given at the event for proposals, and t

Re: [OT] Algorithm question

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 02:38:09PM +, Ivan Kazmenko via Digitalmars-d wrote: > On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: > > Given a set A of n elements (let's say it's a random-access range of > > size n, where n is relatively large), and a predicate P(x) that > > specifies some

Re: [OT] Algorithm question

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 12:31:48PM +, Andrea Fontana via Digitalmars-d wrote: > On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: > > 1) "Random shooting": > > > > auto r = ... /* elements of A */ > > for (;;) { > > auto i = uniform(0, r.length); > > if

Re: [OT] Algorithm question

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 11:32:19AM +, Mike B Johnson via Digitalmars-d wrote: [...] > Since most real world problems would require selecting elements more > than once it may be far more efficient to sort by P(x)(filter) then > simply select a random element. > > e.g., > > a = A.filter(x->P(x

Re: [OT] Algorithm question

2017-05-01 Thread H. S. Teoh via Digitalmars-d
On Mon, May 01, 2017 at 08:42:05AM +, John Colvin via Digitalmars-d wrote: [...] > You can recover O(n) calls to P by caching the results. Sorry, I forgot to specify that P(x) can be different each time. Also, the input A may also be different each time, albeit remain the same length (though

Re: DConf Hackathon Ideas

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 1 May 2017 at 16:51, Mike Parker via Digitalmars-d wrote: > On Monday, 1 May 2017 at 14:38:11 UTC, Joseph Rushton Wakeling wrote: >> >> On Thursday, 27 April 2017 at 16:33:02 UTC, singingbush wrote: >>> >>> SDL should be dropped. >> >> >> Deprecated, sure. But dropping it seems a bad idea give

Re: [OT] Algorithm question

2017-05-01 Thread MysticZach via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a predicate P(x) that specifies some subset of A of elements that we're interested in, what's the best algorithm (in terms of b

Re: DConf Hackathon Ideas

2017-05-01 Thread Mike Parker via Digitalmars-d
On Monday, 1 May 2017 at 15:36:16 UTC, bachmeier wrote: On Monday, 1 May 2017 at 14:51:19 UTC, Mike Parker wrote: I love SDL and much prefer it over JSON for DUB configs. Use it for all of my D projects. It looks cleaner and supports comments. I really would hate to see support dropped. I'm

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/30/2017 05:39 PM, Andrei Alexandrescu wrote: The allocators design is interesting in that it has a full DbI core, on top of which resides a thin dynamically-type interface (IAllocator and ISharedAllocator). We're still exploring the idioms enabled by this interaction. -- Andrei I assume t

Re: What are we going to do about mobile?

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 1 May 2017 at 18:18, Iain Buclaw wrote: > On 1 May 2017 at 17:47, Johannes Pfau via Digitalmars-d > wrote: >> Am Mon, 1 May 2017 14:44:35 +0200 >> schrieb Iain Buclaw via Digitalmars-d : >> >>> On 1 May 2017 at 14:40, Iain Buclaw wrote: >>> > So that's 3 build servers - 1x ARM7, 1x ARM8, and

Re: What are we going to do about mobile?

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 1 May 2017 at 17:47, Johannes Pfau via Digitalmars-d wrote: > Am Mon, 1 May 2017 14:44:35 +0200 > schrieb Iain Buclaw via Digitalmars-d : > >> On 1 May 2017 at 14:40, Iain Buclaw wrote: >> > So that's 3 build servers - 1x ARM7, 1x ARM8, and 1x x86. ;-) >> >> With the latter also testing all cr

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Andrej Mitrovic via Digitalmars-d
On Monday, 1 May 2017 at 15:33:47 UTC, Basile B. wrote: On Monday, 1 May 2017 at 14:55:28 UTC, Mike Parker wrote: DIP 1004 is titled "Inherited Constructors. [...] All review-related feedback on and discussion of the DIP should occur in this thread. [...] Destroy! An obvious omission in the

Re: What are we going to do about mobile?

2017-05-01 Thread Johannes Pfau via Digitalmars-d
Am Mon, 1 May 2017 14:44:35 +0200 schrieb Iain Buclaw via Digitalmars-d : > On 1 May 2017 at 14:40, Iain Buclaw wrote: > > So that's 3 build servers - 1x ARM7, 1x ARM8, and 1x x86. ;-) > > With the latter also testing all crosses we can do (there are 18 > different gdc cross-compilers in Ubunt

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Basile B. via Digitalmars-d
On Monday, 1 May 2017 at 15:33:47 UTC, Basile B. wrote: On Monday, 1 May 2017 at 14:55:28 UTC, Mike Parker wrote: DIP 1004 is titled "Inherited Constructors. [...] All review-related feedback on and discussion of the DIP should occur in this thread. [...] Destroy! An obvious omission in the

Re: DConf Hackathon Ideas

2017-05-01 Thread bachmeier via Digitalmars-d
On Monday, 1 May 2017 at 14:51:19 UTC, Mike Parker wrote: I love SDL and much prefer it over JSON for DUB configs. Use it for all of my D projects. It looks cleaner and supports comments. I really would hate to see support dropped. I'm not even sure what it would mean to "drop" support for SD

Re: DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Basile B. via Digitalmars-d
On Monday, 1 May 2017 at 14:55:28 UTC, Mike Parker wrote: DIP 1004 is titled "Inherited Constructors. [...] All review-related feedback on and discussion of the DIP should occur in this thread. [...] Destroy! An obvious omission in the syntax variations [1] - alias this() = super.this(); or

Re: DConf Hackathon Ideas

2017-05-01 Thread Andre Pany via Digitalmars-d
On Thursday, 27 April 2017 at 22:57:48 UTC, Moritz Maxeiner wrote: On Thursday, 27 April 2017 at 19:55:44 UTC, Andre Pany wrote: On Thursday, 27 April 2017 at 17:47:19 UTC, Moritz Maxeiner wrote: [...] As workaround this is possible. Every developer and in every continious integration build

DIP 1004 Preliminary Review Round 1

2017-05-01 Thread Mike Parker via Digitalmars-d
DIP 1004 is titled "Inherited Constructors. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1004.md All review-related feedback on and discussion of the DIP should occur in this thread. Due to DConf taking place during the review period, the period will be extended by a week. The review peri

Re: DConf Hackathon Ideas

2017-05-01 Thread Mike Parker via Digitalmars-d
On Monday, 1 May 2017 at 14:38:11 UTC, Joseph Rushton Wakeling wrote: On Thursday, 27 April 2017 at 16:33:02 UTC, singingbush wrote: SDL should be dropped. Deprecated, sure. But dropping it seems a bad idea given that various projects do still use it for their DUB package config. NOBODY U

Re: DConf Hackathon Ideas

2017-05-01 Thread Joseph Rushton Wakeling via Digitalmars-d
On Thursday, 27 April 2017 at 16:33:02 UTC, singingbush wrote: SDL should be dropped. Deprecated, sure. But dropping it seems a bad idea given that various projects do still use it for their DUB package config. NOBODY USES IT! Probably not true. Perhaps a hackathon project could be to

Re: [OT] Algorithm question

2017-05-01 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a predicate P(x) that specifies some subset of A of elements that we're interested in, what's the best algorithm (in terms of b

Re: OT: Re: DConf Hackathon Ideas

2017-05-01 Thread Nicholas Wilson via Digitalmars-d
On Monday, 1 May 2017 at 12:35:11 UTC, Petar Kirov [ZombineDev] wrote: On Saturday, 29 April 2017 at 00:54:59 UTC, Nicholas Wilson wrote: On Friday, 28 April 2017 at 13:31:33 UTC, Petar Kirov [ZombineDev] wrote: Other applications include: * compiling/transpiling D functions to targets like JS,

Re: DConf Hackathon Ideas

2017-05-01 Thread Steven Schveighoffer via Digitalmars-d
On 4/29/17 5:42 AM, Daniel N wrote: On Thursday, 27 April 2017 at 14:53:02 UTC, Mike Parker wrote: This year, DConf has an extra day tacked on for problem solving in the form of a hackathon. The intent is to work on issues people find frustrating in the D ecosystem. While there will be time give

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Andrei Alexandrescu via Digitalmars-d
On 05/01/2017 08:12 AM, Guillaume Piolat wrote: On Sunday, 30 April 2017 at 21:43:26 UTC, Andrei Alexandrescu wrote: A pass through the root allocators (Mallocator, GCAllocator etc) figuring out what attributes could be meaningfully attached would be welcome. The rest would rely on inference.

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 12:38:32 UTC, Andrea Fontana wrote: On Monday, 1 May 2017 at 12:31:48 UTC, Andrea Fontana wrote: If you find an element that doesn't satisfy P(x) move it on top of array (swap!) and then try again with uniform(1, r.length - 1) and so on. Whoops i mean uniform(1, r.le

Re: alias this on module

2017-05-01 Thread Steven Schveighoffer via Digitalmars-d
On 4/30/17 7:59 PM, Jonathan Marler wrote: On Sunday, 30 April 2017 at 23:44:32 UTC, Steven Schveighoffer wrote: On 4/30/17 7:35 PM, Jonathan Marler wrote: Any reason why "alias this" doesn't work at the module level? If I recall correctly, a module is really just a "class" under the hood, but

Re: What are we going to do about mobile?

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 1 May 2017 at 14:40, Iain Buclaw wrote: > So that's 3 build servers - 1x ARM7, 1x ARM8, and 1x x86. ;-) With the latter also testing all crosses we can do (there are 18 different gdc cross-compilers in Ubuntu, for 12 distinct architectures).

Re: What are we going to do about mobile?

2017-05-01 Thread Iain Buclaw via Digitalmars-d
On 16 April 2017 at 11:54, Iain Buclaw wrote: > On 16 April 2017 at 11:20, Johannes Pfau via Digitalmars-d > wrote: >> Am Sun, 16 Apr 2017 10:13:50 +0200 >> schrieb Iain Buclaw via Digitalmars-d : >> >>> >>> I asked at a recent D meetup about what gitlab CI used as their >>> backing platform, and

Re: [OT] Algorithm question

2017-05-01 Thread Andrea Fontana via Digitalmars-d
On Monday, 1 May 2017 at 12:31:48 UTC, Andrea Fontana wrote: If you find an element that doesn't satisfy P(x) move it on top of array (swap!) and then try again with uniform(1, r.length - 1) and so on. Whoops i mean uniform(1, r.length) of course :)

Re: OT: Re: DConf Hackathon Ideas

2017-05-01 Thread via Digitalmars-d
On Saturday, 29 April 2017 at 00:54:59 UTC, Nicholas Wilson wrote: On Friday, 28 April 2017 at 13:31:33 UTC, Petar Kirov [ZombineDev] wrote: Other applications include: * compiling/transpiling D functions to targets like JS, SPIR-V, I got you covered ;) I know, and I'm looking forward to usi

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 11:57:32 UTC, Ola Fosheim Grøstad wrote: Ah, found a sensible search term: «pseudorandom permutation» http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/FCrypto/slides/LubyRackoff.pdf If you go down this path, please share links. Useful stuff actually. A readable paper

Re: [OT] Algorithm question

2017-05-01 Thread Andrea Fontana via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: 1) "Random shooting": auto r = ... /* elements of A */ for (;;) { auto i = uniform(0, r.length); if (P(r[i])) return r[i]; } Advantages: If a large percentage of elements in A sat

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Guillaume Piolat via Digitalmars-d
On Sunday, 30 April 2017 at 21:43:26 UTC, Andrei Alexandrescu wrote: A pass through the root allocators (Mallocator, GCAllocator etc) figuring out what attributes could be meaningfully attached would be welcome. The rest would rely on inference. Thanks, Andrei IAllocator being fully @nog

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
Ah, found a sensible search term: «pseudorandom permutation» http://cse.iitkgp.ac.in/~debdeep/courses_iitkgp/FCrypto/slides/LubyRackoff.pdf If you go down this path, please share links. Useful stuff actually.

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 11:15:28 UTC, Ola Fosheim Grøstad wrote: But permutations is the way to go if you want scientific quality. I take that back: «Polynomial pseudo-random number generator via cyclic phase» http://www.sciencedirect.com/science/article/pii/S0378475409001463 Might be what y

Re: [OT] Algorithm question

2017-05-01 Thread Mike B Johnson via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: I'm been thinking about the following problem, and thought I'd pick the brains of the bright people around these parts... [...] Since most real world problems would require selecting elements more than once it may be far more efficien

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 11:08:56 UTC, Ola Fosheim Grøstad wrote: E.g. find a set of cyclic random generators and break down N into a sum of these cycle-sizes, then just keep track of the seed for each. If they are 2^N then you could use xor to get more randomness between runs. Also in the al

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 10:51:46 UTC, Ola Fosheim Grøstad wrote: Keep also in mind that you can split the original array in two, so it might be sufficient to have the permutations for various 2^M sizes if those are easier to generate (my guess, maybe through some xor magic?) E.g. if N = 21

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 08:44:25 UTC, Ola Fosheim Grøstad wrote: Does it exist? Yes, because you can build permutation tables for it, but you'll have to find the closed form for it that is efficient... Can you do that without selecting a specific N? It is easy for N=2 and N=3 at least. E.g.

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 09:01:33 UTC, Ola Fosheim Grøstad wrote: array of indexes and mutate that instead, still O(N). If you cache in a heap you get O(N log N). To avoid confusion: I didn't mean a literal "heap", but some kind of search structure that tracks and draws from unused indice ran

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Stanislav Blinov via Digitalmars-d
On Monday, 1 May 2017 at 04:54:28 UTC, Andrei Alexandrescu wrote: On 4/30/17 8:43 PM, Stanislav Blinov wrote: On Sunday, 30 April 2017 at 21:43:26 UTC, Andrei Alexandrescu wrote: On 04/27/2017 07:35 PM, Stanislav Blinov wrote: IAllocator is too high level an interface, it doesn't carry any inf

Re: [OT] Algorithm question

2017-05-01 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 1 May 2017 at 09:58:39 UTC, Timon Gehr wrote: On 01.05.2017 11:51, Moritz Maxeiner wrote: [...] This deterministically chooses 0. (uniform is right-exclusive.) I assume you mean uniform(0,2). Yes. [...] Counterexample: [1,0,1,1]. The first element is chosen with probab

Re: [OT] Algorithm question

2017-05-01 Thread Timon Gehr via Digitalmars-d
On 01.05.2017 11:51, Moritz Maxeiner wrote: On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a predicate P(x) that specifies some subset of A of elements that we're interested

Re: [OT] Algorithm question

2017-05-01 Thread Moritz Maxeiner via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a predicate P(x) that specifies some subset of A of elements that we're interested in, what's the best algorithm (in terms of

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 08:42:05 UTC, John Colvin wrote: I like this one (warning, just thought of, untested): auto r = ... /* elements of A */ auto nRemaining = r.length; while (nRemaining) { auto i = uniform(0, nRemaining); if (P(r[i])) return r[i]; else swap(r[i], r[-

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Is there an algorithm for *incrementally* generating a random permutation of indices? Does it exist? Yes, because you can build permutation tables for it, but you'll have to find the closed form for it that is efficient... Can you do th

Re: [OT] Algorithm question

2017-05-01 Thread John Colvin via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: I'm been thinking about the following problem, and thought I'd pick the brains of the bright people around these parts... Given a set A of n elements (let's say it's a random-access range of size n, where n is relatively large), and a p

Re: [OT] Algorithm question

2017-05-01 Thread Ola Fosheim Grøstad via Digitalmars-d
On Monday, 1 May 2017 at 04:15:35 UTC, H. S. Teoh wrote: Which elements of A satisfy P(x) is not known ahead of time, nor is the relative proportion of elements that satisfy P(x) or not. O(N) given P(x)===false for all x... What you want is probably average case analysis, not worst case?

Re: DMD VS2017 Support

2017-05-01 Thread Igor via Digitalmars-d
On Monday, 1 May 2017 at 01:54:30 UTC, evilrat wrote: On Sunday, 30 April 2017 at 16:05:10 UTC, Igor wrote: I should also mention that compiling using DUB works. It only doesn't work from VS. Check your VisualD settings and make sure it has DMD path set up. See under Tools>Options>Projects

Re: Interesting PRs: bringing type system legitimacy to shared allocators

2017-05-01 Thread Sebastiaan Koppe via Digitalmars-d
On Friday, 28 April 2017 at 22:18:54 UTC, Atila Neves wrote: Done. I also added to the README that it has its own versions of the range constraints from Phobos that can be used with `@models`. Atila Example of an error message in the README would be great too.