Re: Write binary data as a file

2022-08-02 Thread Alexander Zhirov via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 15:30:13 UTC, Adam D Ruppe wrote: On Tuesday, 2 August 2022 at 11:10:27 UTC, Alexander Zhirov wrote: As a result, I get only a set of text data. my database layer is doing to!string(that_ubyte) which is wrong. gonna see about pushing a fix It's decided! After

Re: Request assistance resolving linker error: Undefined symbol(s) for architecture x86_64

2022-08-02 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 03, 2022 at 04:28:57AM +, anonymouse via Digitalmars-d-learn wrote: > How do I go about tracking down what's causing the following error: > > ``` > Undefined symbols for architecture x86_64: > "__D3std8internal6memory12__ModuleInfoZ", referenced from: >

Request assistance resolving linker error: Undefined symbol(s) for architecture x86_64

2022-08-02 Thread anonymouse via Digitalmars-d-learn
How do I go about tracking down what's causing the following error: ``` Undefined symbols for architecture x86_64: "__D3std8internal6memory12__ModuleInfoZ", referenced from: __D3loxQe12__ModuleInfoZ in dlux.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command

How to find all modules in a package?

2022-08-02 Thread Domain via Digitalmars-d-learn
I want to find out all public functions in all modules in a package. Can I do that at compile time?

Re: A look inside "filter" function defintion

2022-08-02 Thread frame via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 14:58:52 UTC, pascal111 wrote: Maybe this helps: A template can be seen as a static struct too, so you can access its members with the scope operator "." and if there is only one member of the same name as the template ifself, the compiler auto completes it to

Re: Breaking ";" rule with lambda functions

2022-08-02 Thread pascal111 via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 11:27:05 UTC, Andrey Zherikov wrote: On Monday, 1 August 2022 at 14:15:31 UTC, pascal111 wrote: [...] TBH I don't find lambda syntax strange - it's pretty nice and there are two forms (unlike in C++): short one (`a => a > 0`) and long one (`(a) { return a > 0;

Re: Write binary data as a file

2022-08-02 Thread Adam D Ruppe via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 11:10:27 UTC, Alexander Zhirov wrote: As a result, I get only a set of text data. my database layer is doing to!string(that_ubyte) which is wrong. gonna see about pushing a fix

Re: Write binary data as a file

2022-08-02 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Aug 02, 2022 at 11:10:27AM +, Alexander Zhirov via Digitalmars-d-learn wrote: [...] > ```d > auto result = db.query("select tcxs.settings_file as dbfile from > amts.t_client_xrdp_settings tcxs where tcxs.pid_client = ?", id); > ubyte[] bytes = cast(ubyte[])result.front()["dbfile"]; >

Re: A look inside "filter" function defintion

2022-08-02 Thread pascal111 via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 14:24:50 UTC, frame wrote: On Tuesday, 2 August 2022 at 12:39:41 UTC, pascal111 wrote: Instantiation seems some complicated to me. I read "If a template contains members whose name is the same as the template identifier then these members are assumed to be

Re: A look inside "filter" function defintion

2022-08-02 Thread frame via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 12:39:41 UTC, pascal111 wrote: Instantiation seems some complicated to me. I read "If a template contains members whose name is the same as the template identifier then these members are assumed to be referred to in a template instantiation:" in the provided link,

Re: A look inside "filter" function defintion

2022-08-02 Thread Andrey Zherikov via Digitalmars-d-learn
On Monday, 1 August 2022 at 23:35:13 UTC, pascal111 wrote: I think this line needs explanation: '''D return FilterResult!(unaryFun!predicate, Range)(range); ''' Create an object of type `FilterResult!(unaryFun!predicate, Range)` by passing `range` to its ctor, then return that object.

Re: A look inside "filter" function defintion

2022-08-02 Thread pascal111 via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 04:06:30 UTC, frame wrote: On Monday, 1 August 2022 at 23:35:13 UTC, pascal111 wrote: This is the definition of "filter" function, and I think it called itself within its definition. I'm guessing how it works? It's a template that defines the function called

Re: Breaking ";" rule with lambda functions

2022-08-02 Thread Andrey Zherikov via Digitalmars-d-learn
On Monday, 1 August 2022 at 14:15:31 UTC, pascal111 wrote: We all know the strange syntax of lambda function within filter algorithm like "auto r = chain(a, b).filter!(a => a > 0);". TBH I don't find lambda syntax strange - it's pretty nice and there are two forms (unlike in C++): short one

Write binary data as a file

2022-08-02 Thread Alexander Zhirov via Digitalmars-d-learn
I'm trying to write a mechanism for writing and reading from Postgres. Using the Adama D. Ruppe library. I write data to Postgres in the form of this code: ```d ubyte[] bytes = cast(ubyte[])read("myFile"); PostgresResult resultQuery = cast(PostgresResult) db.query("insert into

Re: Converting JSONValue to AssociativeArray.

2022-08-02 Thread hype_editor via Digitalmars-d-learn
On Monday, 1 August 2022 at 22:47:03 UTC, Steven Schveighoffer wrote: On 8/1/22 2:00 PM, hype_editor wrote: [...] ```d // option 1 string[string] aa_data; foreach(string k, v; data) { aa_data[k] = v.get!string; } // option 2 import std.algorithm : map; import