Re: Backslash escaping weirdness

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Am Tue, 01 Mar 2016 05:14:13 + schrieb Nicholas Wilson : > On Tuesday, 1 March 2016 at 04:48:01 UTC, Adam D. Ruppe wrote: > > On Tuesday, 1 March 2016 at 04:18:11 UTC, Nicholas Wilson wrote: > >> What is causing these errors? I'm using \t and \n in string > >>

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Yuxuan Shui via Digitalmars-d-learn
On Saturday, 5 March 2016 at 14:18:31 UTC, Atila Neves wrote: With a small number of threads, things work as intended in the code below. But with 1000, on my machine it either crashes or throws an exception: import std.stdio; import std.parallelism; import std.range; void main() {

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Got it now: https://issues.dlang.org/show_bug.cgi?id=15768 writeln() creates a copy of the stdout struct in a non thread-safe way. If stdout has been assigned a File struct created from a file name this copy includes a "racy" increment/decrement of a reference count to the underlying C-library

Re: Dub and unit-threaded import problem

2016-03-05 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Saturday, 5 March 2016 at 15:05:50 UTC, Casey wrote: { "name": "unittest", "preBuildCommands": [ "dub run unit-threaded -c gen_ut_main -- -f bin/ut.d" ], "mainSourceFile": "bin/ut.d", "excludedSourceFiles": ["source/app.d"], "dependences": {

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 05 Mar 2016 14:18:31 + schrieb Atila Neves : > void main() { > stdout = File("/dev/null", "w"); > foreach(t; 1000.iota.parallel) { > writeln("Oops"); > } > } First thing I tried: void main() { stdout = File("/dev/null", "w");

Re: Create Windows "shortcut" (.lnk) with D?

2016-03-05 Thread 岩倉 澪 via Digitalmars-d-learn
On Sunday, 6 March 2016 at 05:00:55 UTC, BBasile wrote: If you don't want to mess with the Windows API then you can dynamically create a script (I do this in CE installer): This might be an option but I'd prefer to use the Windows API directly. I don't know vb script and maintaining such a

Re: Create Windows "shortcut" (.lnk) with D?

2016-03-05 Thread BBasile via Digitalmars-d-learn
On Sunday, 6 March 2016 at 03:13:23 UTC, 岩倉 澪 wrote: I'm creating a small installation script in D, but I've been having trouble getting shortcut creation to work! I'm a linux guy, so I don't know much about Windows programming... [...] Any help would be highly appreciated as I'm new to

Create Windows "shortcut" (.lnk) with D?

2016-03-05 Thread 岩倉 澪 via Digitalmars-d-learn
I'm creating a small installation script in D, but I've been having trouble getting shortcut creation to work! I'm a linux guy, so I don't know much about Windows programming... Here are the relevant bits of code I have: import core.sys.windows.basetyps, core.sys.windows.com,

Re: Dub and unit-threaded import problem

2016-03-05 Thread Casey via Digitalmars-d-learn
On Saturday, 5 March 2016 at 18:01:48 UTC, Atila Neves wrote: On Saturday, 5 March 2016 at 15:05:50 UTC, Casey wrote: Hello, I'm just starting a small project with dub and unit-threaded, but I'm getting an issue where the file "unit_threaded.d" cannot be found. [...] You mispelled

Re: Dub and unit-threaded import problem

2016-03-05 Thread Casey via Digitalmars-d-learn
On Saturday, 5 March 2016 at 18:01:48 UTC, Atila Neves wrote: On Saturday, 5 March 2016 at 15:05:50 UTC, Casey wrote: Hello, I'm just starting a small project with dub and unit-threaded, but I'm getting an issue where the file "unit_threaded.d" cannot be found. [...] You mispelled

Re: If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Anon via Digitalmars-d-learn
On Saturday, 5 March 2016 at 14:18:31 UTC, Atila Neves wrote: With a small number of threads, things work as intended in the code below. But with 1000, on my machine it either crashes or throws an exception: import std.stdio; import std.parallelism; import std.range; void main() {

Re: Wrap array into a range.

2016-03-05 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Saturday, 5 March 2016 at 16:28:51 UTC, Alexandru Ermicioi wrote: I have to pass an array to a function that accepts an input range. Therefore I need to transform somehow array into an input range. Is there a range that wraps an array in standard library? You just need to import

Whether there is a same module likt C#'s "Windows.Storage" NameSpace?

2016-03-05 Thread FrankLike via Digitalmars-d-learn
Hi,everyone, Whether there is a module, like C#'s "Windows.Storage" NameSpace, you can operate the Android phone or ios phone, you can open the phone's folder on windows7? Thank you . Frank.

Wrap array into a range.

2016-03-05 Thread Alexandru Ermicioi via Digitalmars-d-learn
I have to pass an array to a function that accepts an input range. Therefore I need to transform somehow array into an input range. Is there a range that wraps an array in standard library?

Re: Application with WinMain does not start

2016-03-05 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 5 March 2016 at 13:16:19 UTC, Minas Mina wrote: I added a WinMain function to my application because I don't want it to open a console when running on windows. But now it doesn't even start... extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,

Re: Application with WinMain does not start

2016-03-05 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 5 March 2016 at 14:01:11 UTC, Mike Parker wrote: If you use WinMain, you do not need that flag. Actually, I need to amend that. It isn't needed with WinMain when using the Microsoft linker, but it is when using OPTLINK. The MS linker recognizes WinMain and treats it as

If stdout is __gshared, why does this throw / crash?

2016-03-05 Thread Atila Neves via Digitalmars-d-learn
With a small number of threads, things work as intended in the code below. But with 1000, on my machine it either crashes or throws an exception: import std.stdio; import std.parallelism; import std.range; void main() { stdout = File("/dev/null", "w"); foreach(t; 1000.iota.parallel)

Dub and unit-threaded import problem

2016-03-05 Thread Casey via Digitalmars-d-learn
Hello, I'm just starting a small project with dub and unit-threaded, but I'm getting an issue where the file "unit_threaded.d" cannot be found. Details: DMD version: DMD64 2.070.0 Dub version: 0.9.24 Dub Config: { "name": "pst", "targetType": "executable", "targetPath":

Application with WinMain does not start

2016-03-05 Thread Minas Mina via Digitalmars-d-learn
I added a WinMain function to my application because I don't want it to open a console when running on windows. But now it doesn't even start... extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { bool b = true;

Re: Dub and unit-threaded import problem

2016-03-05 Thread Atila Neves via Digitalmars-d-learn
On Saturday, 5 March 2016 at 15:05:50 UTC, Casey wrote: Hello, I'm just starting a small project with dub and unit-threaded, but I'm getting an issue where the file "unit_threaded.d" cannot be found. [...] You mispelled "dependencies". Atila