Re: inlining or not inlining...

2011-02-12 Thread ivan
Jim Wrote: > spir Wrote: > > > On 02/12/2011 12:15 PM, Jim wrote: > > > Sorry about that, but I think that is a closely related discussion. > > > @inline is certainly a verb -- even imperative mood, so not just asking > > > for information. > > > Why do you need information if you can't affect

Re: inlining or not inlining...

2011-02-12 Thread ivan
ivan Wrote: > Jim Wrote: > > > spir Wrote: > > > > > On 02/12/2011 12:15 PM, Jim wrote: > > > > Sorry about that, but I think that is a closely related discussion. > > > > @inline is certainly a verb -- even imperative mood, so not just askin

Re: Problem with writeln

2010-03-01 Thread Ivan
at C:\dmd2\windows\bin\..\..\src\phobos\std\stdio.d:1310 #7 0x004033ea in _Dmain (args = { [0] = "D:\\ivans\\Projects\\D\\eclipse-workspace-d\\ifs3d\\ifs3d.exe" }) at ivan\ifs3d\ifs3d.d:98 #8 0x00411534 in extern (C) int rt.dmain2.main(int, char**) . void runMain(void*) () from dmain2 #

Re: Problem with writeln

2010-03-01 Thread Ivan
On 1.3.2010 12:47, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 04:11:28 -0500, Ivan wrote: The part of code in my main method is this: try { writefln("Starting main loop..."); global.loop.start(); writefln("Main loop finished..."); } catch(Exception e) { writefl

Re: Problem with writeln

2010-03-01 Thread Ivan
On 1.3.2010 14:43, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 07:14:23 -0500, Ivan wrote: On 1.3.2010 12:47, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 04:11:28 -0500, Ivan wrote: The part of code in my main method is this: try { writefln("Starting main

Re: Problem with writeln

2010-03-05 Thread Ivan
On 1.3.2010 17:15, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 10:42:00 -0500, Ivan wrote: On 1.3.2010 14:43, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 07:14:23 -0500, Ivan wrote: On 1.3.2010 12:47, Steven Schveighoffer wrote: On Mon, 01 Mar 2010 04:11:28 -0500, Ivan wrote

Thrift 0.9.0 D tutorial broken by dmd 2.061

2013-01-07 Thread Ivan Ribeiro
Hi, Since I have upgraded my dmd from version 2.060 to 2.061 the cliend.d and server.d is not compiling anymore (thrift-0.9.0/tutorial/d). Someone with same problem? Best regards, Ivan [irocha@irrlab d]$ pwd /data/D/thrift-0.9.0/tutorial/d [irocha@irrlab d]$ make dmd -I../../lib

Re: #D_lang vs #Dlang hashtags

2013-03-14 Thread Ivan Kazmenko
as good as it does "C" or "C++". Any suggestions? - Ivan Kazmenko.

Why won't this compile using DMD?

2012-08-12 Thread Ivan Trombley
I'm stumped. Can anyone tell me why this won't compule using DMD (v2.060)? It compiles and runs just fine using GDC: import std.stdio; import std.concurrency; shared class Data { public: this(int count) { m_count = count; } int count() const { return m_count; } private:

Re: Why won't this compile using DMD?

2012-08-12 Thread Ivan Trombley
On Sunday, 12 August 2012 at 14:31:37 UTC, Simen Kjaeraas wrote: The problems all have to do with one thing - shared class Data does not mean every instance of the class is shared, only that all member functions are. Excellent, thanks. I assumed that since the class was marked as shared then an

Re: Ubuntu 12.04 and DMD 2.060

2012-08-15 Thread Ivan Trombley
On Tuesday, 7 August 2012 at 00:12:55 UTC, Alex Rønne Petersen wrote: Hi, Has anyone managed to get the 2.060 .deb working on Ubuntu 12.04? On all 12.04 systems I have access to, all D programs consistently segmentation fault in gc_init(). I'm having the same issue.

Re: Fragile ABI

2012-08-18 Thread Ivan Trombley
On Thursday, 16 August 2012 at 15:54:12 UTC, Piotr Szturmaj wrote: Kagamin wrote: You can also use C++ to develop COM components which have standardized ABI. ...only on Windows. Code compiled with VC has a different vtable layout than code compiled with say GCC, so even on Windows there is

Re: [OT] Which IDE / Editor do you use?

2013-09-15 Thread Ivan Kazmenko
erface for every language I decide to write in. And sometimes CodeBlocks for larger projects. Ivan Kazmenko.

Re: [OT] Best algorithm for extremely large hashtable?

2013-11-15 Thread Ivan Kazmenko
sentations at the hash indices will suffice. On the other hand, if you plan to visit 10^12 nodes, and the graph is not very sparse or very dense (and not regular in any obvious way besides what is described), perhaps you won't get the required compression level (1/1000) anyway. Ivan Kazmenko.

Re: Worst-case performance of quickSort / getPivot

2013-11-16 Thread Ivan Kazmenko
rth a bugreport. What do you guys think? Ivan Kazmenko.

Re: Worst-case performance of quickSort / getPivot

2013-11-16 Thread Ivan Kazmenko
uaranteed-n-log-n algorithm instead of (3) when it goes too deep. This comes at a (small) cost of checking the current depth on every call to quicksort. The above is just my retelling of a great short article "A Killer Adversary for Quicksort" by M. D. McIlroy here: http://www.cs.dartmouth.edu/~doug/mdmspe.pdf Ivan Kazmenko.

Re: Worst-case performance of quickSort / getPivot

2013-11-16 Thread Ivan Kazmenko
On Sunday, 17 November 2013 at 01:07:20 UTC, Ivan Kazmenko wrote: Now, the assumption of picking a pivot in O(1) comparisons covers a broad variety of pivot choices, including first/last/middle/random element, median of three or five, median of medians, or any combination of these. The random

Re: Worst-case performance of quickSort / getPivot

2013-11-17 Thread Ivan Kazmenko
On Sunday, 17 November 2013 at 03:58:58 UTC, Andrei Alexandrescu wrote: On 11/16/13 5:07 PM, Ivan Kazmenko wrote: The above is just my retelling of a great short article "A Killer Adversary for Quicksort" by M. D. McIlroy here: http://www.cs.dartmouth.edu/~doug/mdmspe.pdf Nice stor

Re: Worst-case performance of quickSort / getPivot

2013-11-17 Thread Ivan Kazmenko
On Sunday, 17 November 2013 at 01:48:14 UTC, Craig Dillabaugh wrote: On Sunday, 17 November 2013 at 01:07:20 UTC, Ivan Kazmenko wrote: Regarding an ideal pivot choice for quicksort, I'd like to emphasize that it is simply non-existent. Here's why. Let us measure quicksort performa

Re: Worst-case performance of quickSort / getPivot

2013-11-17 Thread Ivan Kazmenko
On Sunday, 17 November 2013 at 13:07:40 UTC, Timon Gehr wrote: On 11/17/2013 02:07 AM, Ivan Kazmenko wrote: The random pick fails in the following sense: if we seed the RNG, construct a killer case, and then start with the same seed, we get Theta(n^2) behavior reproduced. Hence, in no sense

Re: dtutor.org: a call to action

2013-05-05 Thread Ivan Kazmenko
dopted to some parts of D development, provided that some of the current developers will like the idea and be really willing to try it. - Ivan Kazmenko.

Re: dtutor.org: a call to action

2013-05-05 Thread Ivan Kazmenko
de these design and development contests, and the number of participants in algorithm branch is much larger: the entry barrier is lower, the short time frame is comfortable, and it is generally more fun. Still, this type of contests (component) would require a considerable effort to start. - Ivan Kazmenko.

Re: about "with statement"

2013-06-09 Thread Ivan Kazmenko
On Sunday, 9 June 2013 at 11:56:42 UTC, Andrej Mitrovic wrote: There are some bugs with it currently, but I think they're fixable. Currently, "with" does not look into "alias this" members which somewhat limits its usefulness: http://d.puremagic.com/issues/show_bug.cgi?id=6711 http://d.purem

Re: [up for grabs]Two-way string searching

2013-06-17 Thread Ivan Kazmenko
nd 6. Reference implementation didn't work for me, but it may be actually my fault...) Given the points above, I won't make any decisions based on data from that page :) . Ivan Kazmenko.

Re: Automatic typing

2013-07-02 Thread Ivan Kazmenko
f silently picking one of them. Ivan Kazmenko.

Re: Worst-case performance of quickSort / getPivot

2013-11-28 Thread Ivan Kazmenko
than swaps. It would be a regression to disallow sorting of entities with disabled assignment. Ivan Kazmenko.

Re: bugtracker and auto-tester down

2013-12-29 Thread Ivan Kazmenko
On Sunday, 29 December 2013 at 17:12:14 UTC, John Colvin wrote: On Sunday, 29 December 2013 at 12:57:43 UTC, Ivan Kazmenko wrote: I can't access http://d.puremagic.com/issues/ for at least an hour now. On a related note, http://d.puremagic.com/test-results/ seems to be down, too. works

bugtracker and auto-tester down

2014-01-19 Thread Ivan Kazmenko
I can't access http://d.puremagic.com/issues/ for at least an hour now. On a related note, http://d.puremagic.com/test-results/ seems to be down, too.

Re: Question about arrays

2014-01-22 Thread Ivan Kazmenko
flag "-L/STACK:268435456" to set it to 256 mebibytes instead). On Linux, you can control the stack size externally with ulimit tool. Ivan Kazmenko.

Re: Implement the "unum" representation in D ?

2014-02-21 Thread Ivan Kazmenko
note that the binary fraction for 1/11 has period 10, and for 1/13 the period is 12. Thus repeating decimal for a fraction p/q will take up to q-1 bits when we store it as a repeating decimal, but log(p)+log(q) bits when stored as a rational number (numerator and denominator). Ivan Kazmenko.

Re: Implement the "unum" representation in D ?

2014-02-22 Thread Ivan Kazmenko
On Friday, 21 February 2014 at 20:27:18 UTC, Frustrated wrote: On Friday, 21 February 2014 at 09:04:40 UTC, Ivan Kazmenko wrote: Thus repeating decimal for a fraction p/q will take up to q-1 bits when we store it as a repeating decimal, but log(p)+log(q) bits when stored as a rational number

Re: Implement the "unum" representation in D ?

2014-02-22 Thread Ivan Kazmenko
On Saturday, 22 February 2014 at 14:17:23 UTC, Ivan Kazmenko wrote: Sometimes there is a non-degenerate pre-period part before the period: 13/10 = 1.0100110011 = 1.0(1001) as a binary fraction, the "1.0" part being the pre-period and the "(1001)" part the period. The s

Re: version(unittest) in imported modules

2014-03-02 Thread Ivan Kazmenko
debug=BinaryHeap" seems like a good way to give 2. Perhaps the same can be done for RedBlackTree? Such checks are not exactly unit tests, they vary from one application of a container to another. Ivan Kazmenko.

Re: ddox-generated Phobos documentation is available for review

2014-03-11 Thread Ivan Kazmenko
http://dlang.org/library Looks nice! I second the opinion that Disqus might have a better alternative. Its loading after the page was rendered looks clumsy, its style does not match that of dlang.org's... the whole thing is somehow out of place. Ivan Kazmenko.

Re: Table lookups - this is pretty definitive

2014-04-01 Thread Ivan Kazmenko
nt it by actually using the cache in between, but it still wins against my attempts so far.) Ivan Kazmenko.

Re: Table lookups - this is pretty definitive

2014-04-01 Thread Ivan Kazmenko
On Tuesday, 1 April 2014 at 21:34:29 UTC, Ivan Kazmenko wrote: On Tuesday, 1 April 2014 at 18:35:50 UTC, Walter Bright wrote: 2. The latter function wins, no wonder though, since there's no branching. (I tried to augment it by actually using the cache in between, but it still wins ag

Problem with writeln

2010-02-28 Thread Ivan Senji
Hi! I haven't been using D for a long long long time unfortunately. Recently I decided to give it a try again, downloaded D2.040, setup descent (btw. descent looks great) and ddbg. After some time I managed to get my old program compiling again and it works great. That is... it works great

Re: DQuick a GUI Library (prototype)

2014-09-27 Thread Ivan via Digitalmars-d
On Tuesday, 20 Augu2013 at 21:22:48 UTC, Flamaros wrote: I want to share a short presentation of the project I am working on with friends. It's a prototype of a GUI library written in D. This pdf contains our vision of what the project would be. Samples are directly extracted from our prototy

Re: Ambiguous mangling of symbols declared in nested scopes

2014-07-16 Thread Ivan Kazmenko via Digitalmars-d
ng how such a bug survived until now! Can all (meaningful) scopes of a module be numbered internally to distinguish them? Some way, like lambdas are. Or is it too much of a change? If they can, the scope's unique ID can then go into the mangled name. Ivan Kazmenko.

Won a programming contest using D - Thank you for the tool!

2014-08-17 Thread Ivan Kazmenko via Digitalmars-d
Hi, I just won a three-month-long programming contest (Al Zimmermann's Programming Contest - Alphabet City) using the D programming language as my main tool. I want to share my happiness, and express my deep gratitude, to the people who work on this tool. You are a part of what made this a

Re: Won a programming contest using D - Thank you for the tool!

2014-08-18 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 18 August 2014 at 07:10:02 UTC, bearophile wrote: Ivan Kazmenko: My contest program, now on GitHub: https://github.com/GassaFM/alphabet-city/ dmd bug: wrong file and line for array bounds check< Did you report the bugs? Yeah, that one got reduced to https://issues.dlang.

Re: Won a programming contest using D - Thank you for the tool!

2014-08-18 Thread Ivan Kazmenko via Digitalmars-d
o follow. The mechanism for inner iteration makes it convenient: just write foreach (o; call (1) as a function) put (2) as a body and the body (2) is automatically converted into a delegate. This syntax coincides with my way of thinking about the problem, so I'm delighted to use it. Ivan Kazmenko.

Re: Won a programming contest using D - Thank you for the tool!

2014-08-19 Thread Ivan Kazmenko via Digitalmars-d
r a few weeks later, as I'm busy with other stuff until the beginning of September. Ivan Kazmenko.

Re: Won a programming contest using D - Thank you for the tool!

2014-08-19 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 18 August 2014 at 18:04:50 UTC, Ali Çehreli wrote: On 08/18/2014 03:11 AM, Ivan Kazmenko wrote: > my program usually hit an out-of-memory error very soon. It > worked fine when compiled with 64-bit DMD but failed to collect > the garbage in time with 32-bit DMD and with r

Re: RFC: scope and borrowing

2014-09-11 Thread Ivan Timokhin via Digitalmars-d
I am in no way a language guru, but here are a few things that bother me in your proposal. Thought I'd share. 1. AFAIK, all current D type modifiers can be safely removed from the topmost level (i.e. it is OK to assign immutable(int[]) to immutable(int)[]), because they currently apply to part

Re: RFC: scope and borrowing

2014-09-12 Thread Ivan Timokhin via Digitalmars-d
11.09.2014 22:45, "Marc =?UTF-8?B?U2Now7x0eiI=?= " пишет: ... This troubles me the most, because currently return type of a function may depend only on types of its arguments, and there is a lot of templated code written in that assumption. I'm sorry, I don't understand what you mean here. Th

Re: RFC: scope and borrowing

2014-10-03 Thread Ivan Timokhin via Digitalmars-d
29.09.2014 18:17, "Marc =?UTF-8?B?U2Now7x0eiI=?= " пишет: * What is ElementType!(ByLineImpl!(char, "\n")) in the example from the wiki page [1]? OK, I think I have an idea, but it's not overly elegant. First of all, I would like to note that the same issue exists with, for example, findSubstr

Re: RFC: scope and borrowing

2014-10-04 Thread Ivan Timokhin via Digitalmars-d
04.10.2014 17:38, "Marc =?UTF-8?B?U2Now7x0eiI=?= " пишет: On Friday, 3 October 2014 at 19:08:10 UTC, Ivan Timokhin wrote: 29.09.2014 18:17, "Marc =?UTF-8?B?U2Now7x0eiI=?= " пишет: ... Now, an idea that I have is that bare scope should be just a syntactic sugar for self-owned

Re: RFC: scope and borrowing

2014-10-04 Thread Ivan Timokhin via Digitalmars-d
04.10.2014 21:01, Ivan Timokhin пишет: 04.10.2014 17:38, "Marc =?UTF-8?B?U2Now7x0eiI=?= " пишет: I think the key is in separating the scope attribute and the owner. The former needs to be part of the type, the latter doesn't. In this vein, it's probably a good idea to restr

Re: problem with size_t and an easy solution

2014-12-08 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 8 December 2014 at 08:46:49 UTC, bearophile wrote: Freddy: Why not keep size_t implictly convertable but disallow it for usize. This is an interesting idea. (But the name "uword" seems better). The char, wchar (word char) and dchar (double word char) types seem to disagree. Th

Re: problem with size_t and an easy solution

2014-12-08 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 8 December 2014 at 14:31:50 UTC, ketmar via Digitalmars-d wrote: On Mon, 08 Dec 2014 13:49:30 + Ivan Kazmenko via Digitalmars-d wrote: Personally, when I face the need for a size_t, I usually can (and do) use auto instead. And even if I have to spell it, I don't care too

Re: problem with size_t and an easy solution

2014-12-09 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 9 December 2014 at 03:14:23 UTC, ketmar via Digitalmars-d wrote: somehow Walter can't accept that after emiting the first error compiler is in undefined state, and trying to pretend that it is in well-defined state or guess what well-defined state must be is a nonsense. A well-des

Re: problem with size_t and an easy solution

2014-12-10 Thread Ivan Kazmenko via Digitalmars-d
On Wednesday, 10 December 2014 at 02:15:04 UTC, ketmar via Digitalmars-d wrote: On Tue, 09 Dec 2014 17:28:15 + Ivan Kazmenko via Digitalmars-d wrote: A well-designed language allows to recover from errors with good probability if compiler can recover from error, it should not report the

Re: problem with size_t and an easy solution

2014-12-10 Thread Ivan Kazmenko via Digitalmars-d
On Wednesday, 10 December 2014 at 10:59:17 UTC, ketmar via Digitalmars-d wrote: > that is absolutely nonsense, you *CAN'T* "recover" from > invalid code. > that is the fact. fact: Earth is not a sphere. fact: you > can't > automatically recover from invalid code. That sounds much like an opini

Re: [DRAFT] This Week in D - Jan 18

2015-01-19 Thread Ivan Timokhin via Digitalmars-d
19.01.2015 04:42, Adam D. Ruppe пишет: Anyone like to do a quick proofread of the next edition of This Week in D? http://arsdnet.net/this-week-in-d/jan-18.html Do NOT post this publically yet - it is just a draft, I want to do the broad public release/announcement either later tonight or first

Re: An exegesis of Walter's reference counted slice

2015-02-24 Thread Ivan Timokhin via Digitalmars-d
Andrei Alexandrescu wrote: > I modified Walter's sample code to this: > http://dpaste.dzfl.pl/f3d854feede9. It uses malloc for both the array > and the reference count, and also uses @trusted minimally. I inserted > assert()s here and there to clarify the workings. Nothing big except for > the car

Re: An exegesis of Walter's reference counted slice

2015-02-25 Thread Ivan Timokhin via Digitalmars-d
Andrei Alexandrescu wrote: > On 2/24/15 1:33 PM, Ivan Timokhin wrote: >> Is there any plan to allow safe conversions to T[] (in restricted >> circumstances, of course)? > > We'd want to avoid it because that would necessitate the whole "scope" > parapher

Re: An exegesis of Walter's reference counted slice

2015-02-25 Thread Ivan Timokhin via Digitalmars-d
On Wed, Feb 25, 2015 at 08:06:48AM -0800, Andrei Alexandrescu wrote: > On 2/25/15 1:58 AM, Ivan Timokhin wrote: > > Oh. So, whenever you pass a reference-counted slice around, you need to do > > it with the full inc/dec protocol, which, as Walter has mentioned several > > ti

Re: dmd codegen improvements

2015-08-18 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 18 August 2015 at 10:45:49 UTC, Walter Bright wrote: ... 3. data flow analysis optimizations like constant propagation, dead code elimination, register allocation, loop invariants, etc. Modern compilers (including dmd) do all three. So if you're comparing code generated by dmd/gd

Re: dmd codegen improvements

2015-08-18 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 18 August 2015 at 23:30:26 UTC, Walter Bright wrote: On 8/18/2015 4:05 PM, H. S. Teoh via Digitalmars-d wrote: Maybe when I get some free time this week, I could look at the disassembly of one of my programs again to give some specific examples. Please do. Sorry to repeat myself

Re: dmd codegen improvements

2015-08-21 Thread Ivan Kazmenko via Digitalmars-d
On Friday, 21 August 2015 at 01:29:12 UTC, H. S. Teoh wrote: On Fri, Aug 21, 2015 at 01:20:25AM +, jmh530 via Digitalmars-d wrote: On Friday, 21 August 2015 at 00:00:09 UTC, H. S. Teoh wrote: The gdc version, by contrast, inlines *everything*, This could be why I've observed performance

Re: Today was a good day

2016-01-15 Thread Ivan Kazmenko via Digitalmars-d
On Wednesday, 13 January 2016 at 03:38:45 UTC, Andrei Alexandrescu wrote: I tried a static rng but found out that pure functions call sort(). Overall I'm not that worried about attacks on sort(). So, sort() is still Introsort (O(n log n) worst case), but topN() can show quadratic performance?

Re: topN using a heap

2016-01-16 Thread Ivan Kazmenko via Digitalmars-d
On Saturday, 16 January 2016 at 15:25:50 UTC, Andrei Alexandrescu wrote: That's quite a bit of work, so 3934 uses an alternate strategy for finding the smallest 10: 1. Organize the first 11 elements into a max heap 2. Scan all other elements progressively. Whenever an element is found that is

Re: topN using a heap

2016-01-16 Thread Ivan Kazmenko via Digitalmars-d
On Saturday, 16 January 2016 at 15:25:50 UTC, Andrei Alexandrescu wrote: 3. At the end, swap the largest in the heap with the 10th and you're done! And why this? Do we additionally require the k-th element to arrive exactly on k-th place?

Re: topN using a heap

2016-01-17 Thread Ivan Kazmenko via Digitalmars-d
On Sunday, 17 January 2016 at 03:26:54 UTC, Andrei Alexandrescu wrote: On 1/16/16 9:37 PM, Timon Gehr wrote: Ivan's analysis suggests that even something significantly larger, like n/log(n)² might work as an upper bound for k. I'm not clear on how you got to that boundary. There are a few im

Re: topN using a heap

2016-01-17 Thread Ivan Kazmenko via Digitalmars-d
faster for k close to boundary and special inputs). So, provide the default but let the user choose. Ivan Kazmenko.

Re: topN using a heap

2016-01-17 Thread Ivan Kazmenko via Digitalmars-d
On Sunday, 17 January 2016 at 16:06:31 UTC, Andrei Alexandrescu wrote: On 01/17/2016 06:41 AM, Ivan Kazmenko wrote: The average case is O(n + (k log n log k)) for small enough k. So, any k below roughly n / log^2 (n) makes the second summand less than the first. I don't understand ho

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
On Sunday, 17 January 2016 at 22:20:30 UTC, Andrei Alexandrescu wrote: On 01/17/2016 03:32 PM, Ivan Kazmenko wrote: Here is a more verbose version. OK, very nice. Thanks! I've modified topN to work as follows. In a loop: * If nth <= r.length / log2(r.length)^^2 (or is similarly c

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 18 January 2016 at 12:00:10 UTC, Ivan Kazmenko wrote: On Sunday, 17 January 2016 at 22:20:30 UTC, Andrei Alexandrescu wrote: All - let me know how things can be further improved. Thx! Here goes the test which shows quadratic behavior for the new version: http://dpaste.dzfl.pl

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 18 January 2016 at 12:00:10 UTC, Ivan Kazmenko wrote: Here goes the test which shows quadratic behavior for the new version: http://dpaste.dzfl.pl/e4b3bc26c3cf (dpaste kills the slow code before it completes the task) Correction: this is the result of removing a uniform call in

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 18 January 2016 at 23:18:03 UTC, Ilya wrote: A RNGs don't improve worst case. It only changes an permutation for worst case. --Ilya Still, use of RNG makes it impossible to construct the worst case beforehand, once and for all. In that sense, this is a regression.

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
theoretical standpoint (not taking current D purity rules into account), I'd say using a pointer (which may be modified by GC) is as pure as just allowing a static RNG (a global one, or even another instance dedicated specifically to sort/topN). Ivan Kazmenko.

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
ardless of whether n is close to the edge. Ivan Kazmenko.

Re: topN using a heap

2016-01-18 Thread Ivan Kazmenko via Digitalmars-d
. At the very least, googling for "median of medians in practice" and such yields the tag wiki from StackOverflow.com: "The constant factor in the O(n) is large, and the algorithm is not commonly used in practice.". Ivan Kazmenko.

Re: topN using a heap

2016-01-19 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 19 January 2016 at 13:52:08 UTC, Andrei Alexandrescu wrote: On 01/18/2016 09:21 PM, Ivan Kazmenko wrote: Do you think sort and topN would be attackable if they used a per-process-seeded RNG as per Xinok's idea? -- Andrei Yes, but with a little interactivity (not generatin

Re: So... add maxCount and maxPos?

2016-01-20 Thread Ivan Kazmenko via Digitalmars-d
e make things a bit more clear. Don't know how much of a justification that is. Ivan Kazmenko.

Re: So... add maxCount and maxPos?

2016-01-20 Thread Ivan Kazmenko via Digitalmars-d
On Thursday, 21 January 2016 at 01:11:19 UTC, Andrei Alexandrescu wrote: On 01/20/2016 04:22 PM, Ivan Kazmenko wrote: 1. The minimum or maximum element itself. I write it as a.minPos.front. That's almost fine, but maybe there is a more expressive way? Sadly, no. I'm very willing

Re: So... add maxCount and maxPos?

2016-01-21 Thread Ivan Kazmenko via Digitalmars-d
On Thursday, 21 January 2016 at 12:17:26 UTC, default0 wrote: On Thursday, 21 January 2016 at 02:36:05 UTC, Ivan Kazmenko wrote: An alternative would be to define min(one argument) to just be that argument. That would be consistent with what we have now, but violates the principle of least

Re: The Quick Mom Algorithm

2016-02-02 Thread Ivan Kazmenko via Digitalmars-d
On Friday, 29 January 2016 at 22:47:44 UTC, Andrei Alexandrescu wrote: http://dpaste.dzfl.pl/05a82699acc8 While thinking of MoM and the core reasons of its being slow (adds nice structure to its input and then "forgets" most of it when recursing), I stumbled upon a different algorithm. It's m

Re: Idempotent partition around median of 5?

2016-02-05 Thread Ivan Kazmenko via Digitalmars-d
< b[4]); enforce (equal (b, c)); } while (nextPermutation (a)); } - Another interesting task would be to make the function stable, but I don't see how it is possible with such flat structure. Ivan Kazmenko.

Re: Idempotent partition around median of 5?

2016-02-05 Thread Ivan Kazmenko via Digitalmars-d
On Saturday, 6 February 2016 at 00:59:17 UTC, Andrei Alexandrescu wrote: On 02/05/2016 06:36 AM, Ivan Kazmenko wrote: Another interesting task would be to make the function stable, but I don't see how it is possible with such flat structure. Under what circumstances isn't you

Re: Idempotent partition around median of 5?

2016-02-05 Thread Ivan Kazmenko via Digitalmars-d
On Saturday, 6 February 2016 at 07:06:27 UTC, Ivan Kazmenko wrote: On Saturday, 6 February 2016 at 00:59:17 UTC, Andrei Alexandrescu wrote: On 02/05/2016 06:36 AM, Ivan Kazmenko wrote: Another interesting task would be to make the function stable, but I don't see how it is possible with

Mention GSoC on the front page?

2016-04-14 Thread Ivan Kazmenko via Digitalmars-d
front page of dlang.org as well? It could fit under Contribute, or maybe a separate section closer to the top. Ivan Kazmenko.

Compiling with -profile=gc makes program crash - why?

2016-04-20 Thread Ivan Kazmenko via Digitalmars-d
guarantees that the spawned thread finishes before the main thread, but the third example, also crashing, seems to contradict that: -prfail3.d- import std.concurrency; void someWork () {auto x = [1];} void main () { spawnLinked (&someWork); try {receive ((int) {});} catch (LinkTerminated o) {} } - Ivan Kazmenko.

Re: Compiling with -profile=gc makes program crash - why?

2016-04-20 Thread Ivan Kazmenko via Digitalmars-d
On Wednesday, 20 April 2016 at 22:27:36 UTC, Ivan Kazmenko wrote: I'm trying to use DMD option "-profile=gc". With this option, the following simple program crashes with 2.071.0 down to 2.069.0 but still works on 2.068.2. The command line is "dmd -g -profile=gc p

Re: Compiling with -profile=gc makes program crash - why?

2016-04-21 Thread Ivan Kazmenko via Digitalmars-d
On Thursday, 21 April 2016 at 09:23:26 UTC, tcak wrote: I'm trying to use DMD option "-profile=gc". You are using "spawn". So it is a multithreaded program. -profile=gc doesn't work with multithreadd programs. Always creates problems. Humm, when I searched whether it should work, I only fo

Re: Compiling with -profile=gc makes program crash - why?

2016-04-21 Thread Ivan Kazmenko via Digitalmars-d
On Thursday, 21 April 2016 at 10:57:12 UTC, Ivan Kazmenko wrote: Humm, when I searched whether it should work, I only found a reassuring post by Walter[1] almost a year ago. The issue tracker does not seem to contain an entry either. Perhaps I should create one, then. [1] http

Re: Researcher question – what's the point of semicolons and curly braces?

2016-05-03 Thread Ivan Kazmenko via Digitalmars-d
On Tuesday, 3 May 2016 at 04:24:37 UTC, Adam D. Ruppe wrote: But I'm really curious what the gendered aspect turns out as. I suspect the effect, if it indeed exists, would be strongly tied to the oft-repeated lie that "girls aren't good at math" - math famously uses a lot of symbols, so that as

Re: RCArray is unsafe

2015-03-04 Thread Ivan Timokhin via Digitalmars-d
Excuse me if I miss something obvious, but: void main() { auto arr = RCArray!int([0]); foo(arr, arr[0]); } void foo(ref RCArray!int arr, ref int val) { { auto copy = arr; //arr's (and copy's) reference counts are both 2 arr = RCA

Re: readln() doesn't stop to read the input.

2015-03-27 Thread Ivan Kazmenko via Digitalmars-d
worth noting, the best place for such questions in D.learn group: http://forum.dlang.org/group/digitalmars.D.learn Ivan Kazmenko.

Re: Quit running foreign unittests >_

2015-04-27 Thread Ivan Kazmenko via Digitalmars-d
bug = RBDoChecks;" line. This looks inconsistent. For RedBlackTree, compile the following with or without -unittest option and run for a visible difference in speed (runs momentarily or for a few seconds): - import std.container; void main() { auto t = redBlackTree!int; foreach (i; 0..3000) t.insert(i); } - Ivan Kazmenko.

Re: Quit running foreign unittests >_

2015-04-27 Thread Ivan Kazmenko via Digitalmars-d
On Monday, 27 April 2015 at 15:29:05 UTC, Steven Schveighoffer wrote: On 4/27/15 10:30 AM, Ivan Kazmenko wrote: On Monday, 27 April 2015 at 11:30:04 UTC, Steven Schveighoffer wrote: The problem is as follows: 1. Unit tests for some library are written for that library. They are written to

Re: Quit running foreign unittests >_

2015-04-27 Thread Ivan Kazmenko via Digitalmars-d
don't see whether it fits the larger picture, but still think it's worth to consider. Ivan Kazmenko.

Re: Quit running foreign unittests >_

2015-04-28 Thread Ivan Kazmenko via Digitalmars-d
f containers (say, N operations with a container), and if integrity checks are enabled at this time, it totals to N^2 trivial operations which may not be feasible. Ivan Kazmenko.

Re: Lets talk about fibers

2015-06-04 Thread Ivan Timokhin via Digitalmars-d
On Thu, Jun 04, 2015 at 07:24:47AM +, Liran Zvibel wrote: > If you can come up with another programming model that leverages > fibers (and is popular), and moving fibers between threads makes > sense in that model, then I think the discussion should be how > stronger that other model is with fi

Re: std.experimental.collection.functional.slist

2015-06-19 Thread Ivan Timokhin via Digitalmars-d
A couple of thoughts: 1. It seems that an allocator is a public field of SList. Should it be so? What happens if someone changes an allocator while the list holds nodes allocated with the old one? 2. Only dynamic allocator customisation is supported (unlike C++ containers). Is this deliberate? 3

Re: std.experimental.collection.functional.slist

2015-06-19 Thread Ivan Timokhin via Digitalmars-d
On Fri, Jun 19, 2015 at 01:49:14PM +, Jonathan M Davis wrote: > On Friday, 19 June 2015 at 13:36:22 UTC, Andrei Alexandrescu > wrote: > >> 3. Shouldn't `front` functions be const? > > > > Good point. Made const. > > That's not necessarily a good idea. What if the element type > can't even be

Re: std.experimental.collection.functional.slist

2015-06-19 Thread Ivan Timokhin via Digitalmars-d
On Fri, Jun 19, 2015 at 06:36:26AM -0700, Andrei Alexandrescu wrote: > On 6/19/15 4:51 AM, Ivan Timokhin wrote: > > 2. Only dynamic allocator customisation is supported (unlike C++ > > containers). Is > > this deliberate? > > Yes; I think C++'s approach to all

Re: std.experimental.collection.functional.slist

2015-06-19 Thread Ivan Timokhin via Digitalmars-d
Correct me if I'm wrong, but it seems that the GC is unaware of any memory coming from an allocator (unless it's a GCAllocator, of course), so it won't scan it. If that's the case, that's bound to cause problems if T has indirections. On Thu, Jun 18, 2015 at 11:32:05PM +, Andrei Alexandrescu w

Dscanner: intentionally unused variable

2018-01-06 Thread Ivan Trombley via Digitalmars-d
While working with SDL, I found that I kept using the same pattern over and over: - Get the current clip rectangle. - Set a new clip rectangle. - restore the old clip rectangle on scope (exit). Instead of writing that code again and again, I wrote a simple function that returns a struct which r

  1   2   >