Re: Request our suggestio: better way to insert data from Array!string[string] into a database table

2020-11-16 Thread Vino via Digitalmars-d-learn
On Monday, 16 November 2020 at 18:30:01 UTC, Max Haughton wrote: On Monday, 16 November 2020 at 17:44:08 UTC, Vino wrote: Hi All, Request your suggestion, we have a program which call's an api, the output of the api is parsed using json parser and the result is stored in an array(Array!stri

Why can not use tray/catch inside finally block?

2020-11-16 Thread Marcone via Digitalmars-d-learn
Some operations in finally block may throw and can not be used inside nothrow functon. Why can not use tray/catch inside finally block?

Re: Can't pass [] to extern function object method

2020-11-16 Thread frame via Digitalmars-d-learn
On Monday, 16 November 2020 at 21:58:44 UTC, Jack wrote: What is the function prototype like and how are you declaring that struct? The struct is very simple, it contains: struct S { SysTime a; ulong b; double c; ubyte[] d; string e; } And I tried: bool foo(S[] params);

Re: Can't pass [] to extern function object method

2020-11-16 Thread Jack via Digitalmars-d-learn
On Monday, 16 November 2020 at 21:31:44 UTC, frame wrote: I have a DLL in D-code which returns an object and want to pass a struct S[] to a member function of that object. The first element is passed correctly, the rest is just garbage. In fact the next item is just a single byte with value 0x1

Re: Regex and manipulating files

2020-11-16 Thread Jack via Digitalmars-d-learn
On Monday, 16 November 2020 at 10:51:51 UTC, Bloris wrote: I've to convert a linux dash script because it is too slow and i decded to do it in D. I'm totally new to this and i think it could be a good exercise to learn this language. The shell script does some simple jobs like: 0) Run the scri

Can't pass [] to extern function object method

2020-11-16 Thread frame via Digitalmars-d-learn
I have a DLL in D-code which returns an object and want to pass a struct S[] to a member function of that object. The first element is passed correctly, the rest is just garbage. In fact the next item is just a single byte with value 0x11 following some 0x00. It doesn't matter if I'm using S[]

Re: magically a static member on init?

2020-11-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 15, 2020 at 10:06:55AM +, Martin via Digitalmars-d-learn wrote: > On Sunday, 15 November 2020 at 00:29:41 UTC, H. S. Teoh wrote: > > if you don't like the semantics, don't use it; always allocate the > > field in the class ctor instead. > > Hi, i neither like it nor dislike it - it

Re: Request our suggestio: better way to insert data from Array!string[string] into a database table

2020-11-16 Thread Max Haughton via Digitalmars-d-learn
On Monday, 16 November 2020 at 17:44:08 UTC, Vino wrote: Hi All, Request your suggestion, we have a program which call's an api, the output of the api is parsed using json parser and the result is stored in an array(Array!string[string] data), then these stored result are inserted into MySQ

Re: presence of function template prevents diagnostic

2020-11-16 Thread Max Haughton via Digitalmars-d-learn
On Monday, 16 November 2020 at 17:03:32 UTC, Steven Schveighoffer wrote: On 11/14/20 5:44 PM, kdevel wrote: $ dmd -version=X -i foo $ ./foo void A.bar(int s) Is the latter behavior intended or a bug? That seems like a bug. It shouldn't be less ambiguous because you *added* an overload that

Request our suggestio: better way to insert data from Array!string[string] into a database table

2020-11-16 Thread Vino via Digitalmars-d-learn
Hi All, Request your suggestion, we have a program which call's an api, the output of the api is parsed using json parser and the result is stored in an array(Array!string[string] data), then these stored result are inserted into MySQL table, for inserting the data into the table we use the

Re: presence of function template prevents diagnostic

2020-11-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/14/20 5:44 PM, kdevel wrote: $ dmd -version=X -i foo $ ./foo void A.bar(int s) Is the latter behavior intended or a bug? That seems like a bug. It shouldn't be less ambiguous because you *added* an overload that can also handle it... -Steve

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread frame via Digitalmars-d-learn
On Monday, 16 November 2020 at 13:38:11 UTC, frame wrote: On Monday, 16 November 2020 at 13:12:02 UTC, data pulverizer wrote: Not seeing an error in Developer Tools. I don't expect to because the loading sign remains there as if it is continuously trying to load and doesn't display any errors

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread frame via Digitalmars-d-learn
On Monday, 16 November 2020 at 13:12:02 UTC, data pulverizer wrote: Not seeing an error in Developer Tools. I don't expect to because the loading sign remains there as if it is continuously trying to load and doesn't display any errors. You have to inspect the Console-Tab inside the DevTools

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread data pulverizer via Digitalmars-d-learn
On Monday, 16 November 2020 at 08:16:44 UTC, WebFreak001 wrote: On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer wrote: Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread data pulverizer via Digitalmars-d-learn
On Monday, 16 November 2020 at 08:04:24 UTC, frame wrote: On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer wrote: Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0%): st

Regex and manipulating files

2020-11-16 Thread Bloris via Digitalmars-d-learn
I've to convert a linux dash script because it is too slow and i decded to do it in D. I'm totally new to this and i think it could be a good exercise to learn this language. The shell script does some simple jobs like: 0) Run the script with some options 1) sed/grep regex to catch a portion of

Re: Git-repo-root relative path

2020-11-16 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 16 November 2020 at 10:21:27 UTC, Per Nordlöw wrote: Which DUB packages do you prefer? https://code.dlang.org/packages/dlibgit seems good. But that requires `libgit` to be installed. It would be nice to have a fallback to calling `git`.

Git-repo-root relative path

2020-11-16 Thread Per Nordlöw via Digitalmars-d-learn
I need a function that gets the relative path of a file in a Git-repo and preferrably also its status. Either via an external call to `git` or optionally via `libgit` (if available). Which DUB packages do you prefer?

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread WebFreak001 via Digitalmars-d-learn
On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer wrote: Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0%): starting up...". It stays at 0.0% and doesn't go away and gi

Re: Issue with opening files on VSCode "D Language utility extension pack"

2020-11-16 Thread frame via Digitalmars-d-learn
On Monday, 16 November 2020 at 01:38:10 UTC, data pulverizer wrote: Hi All, On VS Code "D Language utility extension pack", I notice that if I open a random D file, on the bottom left of the IDE, a message says "D: workspace/(0.0%): starting up...". It stays at 0.0% and doesn't go away and gi