Vibe.d and NodeJs with Express

2020-07-12 Thread greatsam4sure via Digitalmars-d-learn
I am thinking of building an App with Vibe. D or NodeJS but my topmost priority is speed and ease of development due to third party libraries integration. I know Vibe. D is faster than NodeJS and I love to use Dlang. My question is can I eat my cake and have it if I go with Dlang and Vibe. D. I

Re: Vibe.d and NodeJs with Express

2020-07-12 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Sunday, 12 July 2020 at 10:01:54 UTC, greatsam4sure wrote: I am thinking of building an App with Vibe. D or NodeJS but my topmost priority is speed and ease of development due to third party libraries integration. How much speed do you need? I doubt you really need every last millisecond,

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Kagamin via Digitalmars-d-learn
You call ShellExecute with "runas" verb: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 12:31:17 UTC, Kagamin wrote: You call ShellExecute with "runas" verb: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea Please give me a litle simple example ruining this command: "netsh winhttp set proxy 127.0.0.1:"

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 12:31:17 UTC, Kagamin wrote: You call ShellExecute with "runas" verb: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea I need return code and stdout.

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 02:10:11 UTC, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. How can I get return code ans stdout of this code: ShellExecute(null, "runas", "cmd", "/c netsh winhttp set proxy 127.0.0.1:

Re: Vibe.d and NodeJs with Express

2020-07-12 Thread Greatsam4sure via Digitalmars-d-learn
On Sunday, 12 July 2020 at 10:44:13 UTC, Sebastiaan Koppe wrote: On Sunday, 12 July 2020 at 10:01:54 UTC, greatsam4sure wrote: [...] How much speed do you need? I doubt you really need every last millisecond, at which point ease of development takes over. Instead it might be better to look

Choosing a non-default linker for dmd (via dub)

2020-07-12 Thread Per Nordlöw via Digitalmars-d-learn
The line dflags "-linker=gold" platform="linux-ldc" # use GNU gold linker in dub.sdl enables me to change linker for LDC. Is it possible to choose a specific linker for DMD aswell in a similar way? I only find the flag `-L` that sets flags but no linker executable. One way is to link

Bind C++ class to DLang : undefined reference to `Canvas::Foo()'

2020-07-12 Thread zoujiaqing via Digitalmars-d-learn
/// Canvas.hpp #include ; class Canvas { static Canvas* Create(); std::string Foo(); std::string Bar(); }; /// Canvas.cpp #include "Canvas.hpp" #include Canvas* Canvas::Create() { return new Canvas(); } std::string Canvas::Foo() { return "Foo"; } std::string Canv

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Kagamin via Digitalmars-d-learn
Well, you can elevate your own program and tell it to run that command, collect the result and send it back through e.g. shared memory.

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 17:19:08 UTC, Kagamin wrote: Well, you can elevate your own program and tell it to run that command, collect the result and send it back through e.g. shared memory. I don't want start with elevation, becouse program must be avaliable even user is not admin. Only ask

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Kagamin via Digitalmars-d-learn
I mean runas your own program.

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 17:28:01 UTC, Kagamin wrote: I mean runas your own program. I need a function that ask for admin at runtime only for one function

Re: Vibe.d and NodeJs with Express

2020-07-12 Thread aberba via Digitalmars-d-learn
On Sunday, 12 July 2020 at 10:01:54 UTC, greatsam4sure wrote: I am thinking of building an App with Vibe. D or NodeJS but my topmost priority is speed and ease of development due to third party libraries integration. I know Vibe. D is faster than NodeJS and I love to use Dlang. My question is c

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Ali Çehreli via Digitalmars-d-learn
On 7/11/20 7:10 PM, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. Here is a hacky solution that attempts the command and fails back to asking the password. It should work on POSIX systems. (Tested on Linux.) im

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 21:50:06 UTC, Ali Çehreli wrote: On 7/11/20 7:10 PM, Marcone wrote: [...] Here is a hacky solution that attempts the command and fails back to asking the password. It should work on POSIX systems. (Tested on Linux.) [...] I need for Windows, it not work on wind

Re: How can I make executeShell ask for Admin Elevation?

2020-07-12 Thread Marcone via Digitalmars-d-learn
On Sunday, 12 July 2020 at 02:10:11 UTC, Marcone wrote: I don't want start program with admin elevation, but ask user for admin permission when some function is called. alias runas = compose!(x => to!bool((cast(int) x) > 32), x => ShellExecute(null, "runas", "cmd", cast(wchar*) "/c \"cd /d %s

Re: how to assign to shared obj.systime?

2020-07-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/11/20 6:15 AM, Arafel wrote: Because the system don't know if just this lock is enough to protect this specific access. When you have multiple locks protecting multiple data, things can become messy. Yes. What I really miss is some way of telling the compiler "OK, I know what I'm do

Re: how to assign to shared obj.systime?

2020-07-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/11/20 1:03 AM, Kagamin wrote: Steven's solution isn't good in the general case Right, you need to know that SysTime is actually a value type, and so it can be implicitly copied without problems with aliasing. In fact, the cast isn't needed to ensure there is no lingering aliasing. I ca