Re: Mallocator and 'shared'

2017-02-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Monday, 13 February 2017 at 01:30:57 UTC, ag0aep6g wrote: This doesn't make sense to me. b depends on a. If I run thread 1 alone, I can expect b to be 1, no? Thread 2 can then a) read 0, write 1; or b) read 1, write 2. How can b be 0 when the writeln is executed? An example like this

Re: Mallocator and 'shared'

2017-02-12 Thread ag0aep6g via Digitalmars-d-learn
On 02/13/2017 01:27 AM, Moritz Maxeiner wrote: __gshared int a = 0; // thread 1: a = 1; int b = a; writeln(b); // thread 2: a += 1; In the above, you may expect `b` to be either 1, or 2, depending on how the cpu interleaves the memory access, but it can, in fact, also be 0, since neither the

Re: Can this implementation of Damm algorithm be optimized?

2017-02-12 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 13 February 2017 at 00:56:37 UTC, Nestor wrote: On Sunday, 12 February 2017 at 05:54:34 UTC, Era Scarecrow wrote: Ran some more tests. Wow! Thanks for the interest and effort. Certainly. But the bulk of the answer comes down that the 2 levels that I've already provided are the

Re: Can this implementation of Damm algorithm be optimized?

2017-02-12 Thread Nestor via Digitalmars-d-learn
On Sunday, 12 February 2017 at 05:54:34 UTC, Era Scarecrow wrote: On Saturday, 11 February 2017 at 21:56:54 UTC, Era Scarecrow wrote: Just ran the unittests under the dmd profiler, says the algorithm is 11% faster now. So yeah slightly more optimized. Ran some more tests. Without

Re: Mallocator and 'shared'

2017-02-12 Thread ag0aep6g via Digitalmars-d-learn
On Sunday, 12 February 2017 at 20:08:05 UTC, bitwise wrote: It seems like you're saying that 'shared' should mean both 'thread safe' and 'not thread safe' depending on context, which doesn't make sense. Makes sense to me: A `shared` variable is shared among threads. Accesses are not

Re: Mallocator and 'shared'

2017-02-12 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 12 February 2017 at 20:08:05 UTC, bitwise wrote: It seems that methods qualified with 'shared' may be what you're suggesting matches up with the 'bridge' I'm trying to describe, but again, using the word 'shared' to mean both 'thread safe' and 'not thread safe' doesn't make sense.

Re: Alexa Skill written in D

2017-02-12 Thread extrawurst via Digitalmars-d-announce
On Sunday, 12 February 2017 at 07:06:00 UTC, Laeeth Isharc wrote: On Wednesday, 11 January 2017 at 12:16:06 UTC, extrawurst wrote: [...] [...] Hi Stephan. I think at the time C# was not possible, and not sure if java was. I don't know those languages so well, but if someone would like

[Issue 14976] object file output is unstable/different

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14976 ZombineDev changed: What|Removed |Added CC|

A mini book for learning computer prgramming in D (complete newbies)

2017-02-12 Thread aberba via Digitalmars-d-announce
Its a work in progress and needs some good formatting and language polish. Try it on your kid :) https://github.com/aberba/learn-coding

Re: Mallocator and 'shared'

2017-02-12 Thread bitwise via Digitalmars-d-learn
On Saturday, 11 February 2017 at 04:32:37 UTC, Michael Coulombe wrote: On Friday, 10 February 2017 at 23:57:18 UTC, bitwise wrote: [...] A shared method means that it can only be called on a shared instance of the struct/class, which will have shared fields. A shared method should be

D is #3 in Github's "The top weekend languages 2016"

2017-02-12 Thread Antonio Corbi via Digitalmars-d-announce
Glad to share this article with you all: https://medium.com/@hoffa/the-top-weekend-languages-according-to-githubs-code-6022ea2e33e8#.vvtcmyh88 A. Corbi

Re: two points

2017-02-12 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 02/09/2017 03:02 AM, Walter Bright wrote: It took me a while to find it, because you were using a pseudonym that I did not recognize. There are a number of frequent contributors to D using pseudonyms, and all have this issue with varying degrees. [...] I suppose I could write a cheat sheet

Re: Questionnaire

2017-02-12 Thread Xavier Bigand via Digitalmars-d-announce
Le 08/02/2017 à 19:27, Ilya Yaroshenko a écrit : I can answer for the product on which I am working (Home Design 3D), others are video games made with Unity which is imposed by the editor. On Home Design 3D the development teams have the choice of technologies to use, but we have to convince

[Issue 17161] [REG 2.072.2] Massive Regex Slowdown

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17161 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 17161] [REG 2.072.2] Massive Regex Slowdown

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17161 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/5a2491a847beb035b37ee2a270029499065b1919 Fix Issue 17161 - Revert all changes to std.regex from

Re: Codecov and CyberShadow failure

2017-02-12 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 9 February 2017 at 17:41:09 UTC, Jack Stouffer wrote: On Wednesday, 8 February 2017 at 21:05:45 UTC, Jack Stouffer wrote: ... Still can't find the root cause. I'm also unable to recreate the problem locally using the same commands as the doc builder. We currently have nine PRs

[Issue 17123] [REG 2.073] Issues with return @safe inference

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17123 --- Comment #6 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/7dd10aaf145981ce994e17abece5d90765222625 fix Issue 17123 - [REG 2.073] Issues with return @safe

[Issue 17130] [Reg 2.074] ambiguous implicit super call when inheriting core.sync.mutex.Mutex

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17130 ZombineDev changed: What|Removed |Added Status|RESOLVED|REOPENED

[Issue 14976] object file output is unstable/different

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14976 --- Comment #2 from Martin Nowak --- A common solution in other compilers (clang) is to use an ordered hash table, consisting of a hash table for O(1) access and an array for ordered processing. Would be a good fit here as well.

Re: Passing variables, preserving UDAs: A Gripe

2017-02-12 Thread Timon Gehr via Digitalmars-d
On 08.02.2017 14:09, John Colvin wrote: On Wednesday, 8 February 2017 at 07:57:15 UTC, Timon Gehr wrote: On 07.02.2017 22:59, Nick Sabalausky wrote: Suppose I have some code that operates on a variable's value and its UDAs. And I want to refactor that code into a reusable function. Sounds

Re: D on the Weekends

2017-02-12 Thread Andrei Alexandrescu via Digitalmars-d
On 02/12/2017 12:50 AM, Adam Wilson wrote: Somebody did some analytics on what languages get used on the weekends and D made the list. https://medium.com/@hoffa/the-top-weekend-languages-according-to-githubs-code-6022ea2e33e8#.2jmihhgb2 Good work everyone! Also kudos to @nordlow whose

Re: D on the Weekends

2017-02-12 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 12 February 2017 at 05:50:09 UTC, Adam Wilson wrote: Somebody did some analytics on what languages get used on the weekends and D made the list. https://medium.com/@hoffa/the-top-weekend-languages-according-to-githubs-code-6022ea2e33e8#.2jmihhgb2 I don't understand the

[Issue 17177] New: AutoImplement fails on function overload sets with "cannot infer type from overloaded function symbol"

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17177 Issue ID: 17177 Summary: AutoImplement fails on function overload sets with "cannot infer type from overloaded function symbol" Product: D Version: D2 Hardware: x86_64

[Issue 17176] https://dlang.org/phobos/std_stdio.html#.File.tmpfile broken link

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17176 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/565ab34cb0e83ba8149812bf6c580a1becc1ab1d fix issue 17176 -

creating a temporary fifo (tmpfile but for fifo)

2017-02-12 Thread Timothee Cour via Digitalmars-d
* std.stdio.tempfile creates an (unnamed) File. How do I create a temporary fifo instead? my workaround is to use tempnam but docs says it's not recommended ( http://man7.org/linux/man-pages/man3/tempnam.3.html) * could we allow specifying a directory name for tmpfile?

[Issue 17176] https://dlang.org/phobos/std_stdio.html#.File.tmpfile broken link

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17176 ag0ae...@gmail.com changed: What|Removed |Added Keywords||pull CC|

Re: usage of ref foreach with variadic functions fails with "cannot be ref"

2017-02-12 Thread error via Digitalmars-d-learn
On Sunday, 12 February 2017 at 03:34:19 UTC, Michael Coulombe wrote: Do you have a complete code example that gives your error? I can't reproduce it (DMD v2.073.0): int foo(T...)(T vars) { int i = 0; foreach(ref v ; vars) { v = 5; i += v; } return i; } void

Re: Alexa Skill written in D

2017-02-12 Thread Walter Bright via Digitalmars-d-announce
On 1/12/2017 2:08 AM, Chris wrote: On Wednesday, 11 January 2017 at 19:26:06 UTC, Walter Bright wrote: On 1/11/2017 2:09 AM, Chris wrote: On Sunday, 8 January 2017 at 22:54:58 UTC, Walter Bright wrote: Yes. I can't because anything I post gets autobanned. Why is that? Probably because I

Re: Gc collects trigger access violation exception

2017-02-12 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 11 February 2017 at 03:21:29 UTC, mashomee wrote: Hi, everyone. I have a thread running in Dll. But it always halts because of access violation exception when GC begins collecting. [...] It's great that you're found a workaround. If you weren't doing something funky to

[Issue 17176] New: https://dlang.org/phobos/std_stdio.html#.File.tmpfile broken link

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17176 Issue ID: 17176 Summary: https://dlang.org/phobos/std_stdio.html#.File.tmpfile broken link Product: D Version: D2 Hardware: x86 OS: Mac OS X Status:

[Issue 17176] https://dlang.org/phobos/std_stdio.html#.File.tmpfile broken link

2017-02-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17176 Timothee Cour changed: What|Removed |Added CC|