Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 19:30:06 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 27 October 2020 at 19:23:22 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: [...] IMHO, your d program cannot have direct control over a spawned process. However, I

Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: Becouse my program use plink.exe running with spawnShell or executeShell. But when my program finish with some crash, or killed with windows task manager by user, Plink still running. How can I stop all process initialized with

Re: dub fetching dependencies for wrong configuration(s)

2020-10-27 Thread ikod via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 17:01:23 UTC, Anonymouse wrote: On Sunday, 4 October 2020 at 21:00:49 UTC, ikod wrote: Thanks, Andre! I'll split requests as you suggested (increasing minor version, so that this change will not hurt anybody who build current requests package for vibe-d). Will

Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 19:23:22 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: [...] IMHO, your d program cannot have direct control over a spawned process. However, I suggest a road map for you, although I am not sure if it works. [...]

Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Jack via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: Becouse my program use plink.exe running with spawnShell or executeShell. But when my program finish with some crash, or killed with windows task manager by user, Plink still running. How can I stop all process initialized with

Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Jack via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 22:14:53 UTC, Dukc wrote: On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: [...] This is a bit heavyweight, but should be doable: have your primary process to start a watchdog process for itself. The watchdog continuosly sends messages to the

Re: How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Dukc via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 15:16:33 UTC, Marcone wrote: Becouse my program use plink.exe running with spawnShell or executeShell. But when my program finish with some crash, or killed with windows task manager by user, Plink still running. How can I stop all process initialized with

Re: How is this an "Access Violation"

2020-10-27 Thread Ruby The Roobster via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 02:05:37 UTC, Ruby The Roobster wrote: Following function when called throws an access violation. I think it has to do with the assert statements, but I don't know why. [...] Okay. I messed up here. It should be: this.base = new atom(...) . I corrected that.

Re: dub fetching dependencies for wrong configuration(s)

2020-10-27 Thread Anonymouse via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 21:15:35 UTC, ikod wrote: On Tuesday, 27 October 2020 at 17:01:23 UTC, Anonymouse wrote: On Sunday, 4 October 2020 at 21:00:49 UTC, ikod wrote: Thanks, Andre! I'll split requests as you suggested (increasing minor version, so that this change will not hurt

synthesising instantiated template parameters and arguments

2020-10-27 Thread Nicholas Wilson via Digitalmars-d-learn
Given template ScopeClass(C) { //... } where C is a, possibly templated, class I want the eponymous member of ScopeClass!(C) to have the same templatedness (both parameters and arguments)as C. For a non-template C this is a simple as: template ScopeClass(C) { class ScopeClass {

Vibe.D TLS problem

2020-10-27 Thread Dukc via Digitalmars-d-learn
I have a Vibe.D server binary that, locally at least, works. But only without TLS. I want to add TLS to it and test it locally with a self-signed certificate. I made one with LibreSSL, stored in `cert.crt` and `key.key`. The application main function: ``` shared static this() { import

Re: this T / variadic template and interfaces

2020-10-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 10:41:06 UTC, Jacob Carlborg wrote: On Tuesday, 27 October 2020 at 09:40:33 UTC, frame wrote: Hmm, a question of design. Is there also a convenient way to pass the arguments to a template or get a Variant[] from it? Convenient, no not that I know of. You can

Re: this T / variadic template and interfaces

2020-10-27 Thread Jacob Carlborg via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 09:40:33 UTC, frame wrote: Hmm, a question of design. Is there also a convenient way to pass the arguments to a template or get a Variant[] from it? Convenient, no not that I know of. You can use a type safe variadic function that takes Variant, if you want to

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Marcone via Digitalmars-d-learn
I want to use isDaemon to automatic stop worker thread if ownner thread is finished

Re: How is this an "Access Violation"

2020-10-27 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 02:05:37 UTC, Ruby The Roobster wrote: void construct(string type,atom base,atom bonded) { base = new atom(base.name.idup,base.mass,base.electro_negativity,base.valence_electrons,base.electrons,base.protons,base.neutrons,base.pos);

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Rene Zwanenburg via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 11:36:42 UTC, Marcone wrote: I want to use isDaemon to automatic stop worker thread if ownner thread is finished Terminating threads without properly unwinding the stack is generally a very bad idea. Most importantly the destructors of stucts on the stack won't

Re: Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Jacob Carlborg via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 08:33:08 UTC, Per Nordlöw wrote: I'm looking for elegant ways of expressing expansion of parameterized strings written to a file at run-time. My primary use case is run-time generation of D code. In the lazy case, something like import std.file : write;

Re: Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Per Nordlöw via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 10:46:42 UTC, Jacob Carlborg wrote: [1] http://mustache.github.io/mustache.5.html [2] https://code.dlang.org/packages/mustache-d Thanks

Getting Qte5 to work

2020-10-27 Thread Josh Dredge via Digitalmars-d-learn
Hi all, I'm completely new to D and while I'm not new to programming in general, I mostly do web development, and what desktop development I've done has all been with easy drag-and-drop GUI builders - so Visual Basic, C# and J# (if that doesn't date me). I'm trying to experiment in new

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Anonymouse via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 08:33:36 UTC, Johann Lermer wrote: or you could use the fact, that receiveTimeout throws an exception, when main ends (although I don't know if this is the intended behaviour; the manual just says that it throws an exception when the sending thread was

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...] It's not really clear what your question is.

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 07:32:30 UTC, Joel wrote: On Tuesday, 27 October 2020 at 07:17:46 UTC, Imperatorn wrote: On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...] It's not really clear what your question is. I'm trying to

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Joel via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 08:14:28 UTC, Imperatorn wrote: On Tuesday, 27 October 2020 at 07:32:30 UTC, Joel wrote: On Tuesday, 27 October 2020 at 07:17:46 UTC, Imperatorn wrote: On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...]

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Joel via Digitalmars-d-learn
On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } struct triangle { vec3d[3] p; } struct mesh { triangle[] tris; } // This here meshCube.tris = { // SOUTH { 0.0f, 0.0f, 0.0f,0.0f, 1.0f, 0.0f,1.0f,

Re: Foreach output into a multi dimensional associative array.

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 October 2020 at 19:05:04 UTC, Vino wrote: Hi All, Request your help on the below on how to store the output to a multi dimensional associative array. Code: import std.stdio: writeln; import asdf: parseJson; import std.conv: to; void main() { string[int][string] aa; string

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 00:46:48 UTC, Marcone wrote: Because when the main thread is completed the worker thread continues to run. Please provide a code example. It's much easier to reason about. Are you creating a thread from a thread and want the 2nd spawned thread to be terminated

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Johann Lermer via Digitalmars-d-learn
You could tell your thread via a shared variable that main has ended: import std.stdio; import std.concurrency; import core.thread; shared bool end = false; void thread () { for (;;) { Thread.sleep (500.msecs); synchronized {

Dynamic Template-Expansion of (Token) Strings

2020-10-27 Thread Per Nordlöw via Digitalmars-d-learn
I'm looking for elegant ways of expressing expansion of parameterized strings written to a file at run-time. My primary use case is run-time generation of D code. In the lazy case, something like import std.file : write; import std.algorithm : substitute; const s = q{int $X =

Re: C++ code to D (multi dem 3d mesh)

2020-10-27 Thread Joel via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 07:17:46 UTC, Imperatorn wrote: On Monday, 26 October 2020 at 23:38:22 UTC, Joel wrote: ``` struct vec3d { float x, y, z; } [...] It's not really clear what your question is. I'm trying to convert from C++ code to D code, see where I've put '// This

Re: this T / variadic template and interfaces

2020-10-27 Thread frame via Digitalmars-d-learn
On Monday, 26 October 2020 at 13:02:33 UTC, Jacob Carlborg wrote: On Monday, 26 October 2020 at 11:14:47 UTC, frame wrote: Is there any way to get this working? I know, I could use a known object to feed the arguments and use that instead - but I want to keep things simple as possible. As

Re: How is this an "Access Violation"

2020-10-27 Thread Imperatorn via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 02:05:37 UTC, Ruby The Roobster wrote: Following function when called throws an access violation. I think it has to do with the assert statements, but I don't know why. [...] OT, but why do you have a function that immediately replaces what you passed?

Re: this T / variadic template and interfaces

2020-10-27 Thread frame via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 11:30:53 UTC, frame wrote: On Tuesday, 27 October 2020 at 10:41:06 UTC, Jacob Carlborg wrote: if (_arguments[i] == typeid(ubyte[])) { auto foo = va_arg!(ubyte[])(_argptr); } The same is working with variadic template. I am missing something? Never mind, I

Re: How Stop Worker Thread if Owner Thread is Finished?

2020-10-27 Thread Marcone via Digitalmars-d-learn
On Tuesday, 27 October 2020 at 12:16:01 UTC, Rene Zwanenburg wrote: On Tuesday, 27 October 2020 at 11:36:42 UTC, Marcone wrote: I want to use isDaemon to automatic stop worker thread if ownner thread is finished Terminating threads without properly unwinding the stack is generally a very bad

How kill executables started with spawnShell or executeShell when program finish?

2020-10-27 Thread Marcone via Digitalmars-d-learn
Becouse my program use plink.exe running with spawnShell or executeShell. But when my program finish with some crash, or killed with windows task manager by user, Plink still running. How can I stop all process initialized with spawnShell or executeShell when program finish? I another works,

Re: dub fetching dependencies for wrong configuration(s)

2020-10-27 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 4 October 2020 at 21:00:49 UTC, ikod wrote: Thanks, Andre! I'll split requests as you suggested (increasing minor version, so that this change will not hurt anybody who build current requests package for vibe-d). Will you make a requests-core?