Re: Hipreme's Tip of of the day #09 - Using D shared libraries with dub

2023-09-09 Thread Kyle Ingraham via Digitalmars-d-learn
On Monday, 4 September 2023 at 23:57:03 UTC, Hipreme wrote: Hello again! -- As of some requests in DConf, I'll post here some things related (or not) to dub recipes. Since there is so many ways to build D and dub is quite the main way, I'll try to show other uncommon ways to use it, this is

Re: dub does not correctly link on Macbook Pro 2019 (intel)

2023-08-19 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 19 August 2023 at 22:53:53 UTC, Sergey wrote: On Saturday, 19 August 2023 at 21:35:25 UTC, Alexander wrote: Completely new to D, and when trying to setup the toolchain, Could you please specify the versions of macOS and DMD? Probably DMD is broken for macOS - could you try to use

Re: dub does not correctly link on Macbook Pro 2019 (intel)

2023-08-19 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 19 August 2023 at 21:35:25 UTC, Alexander wrote: Completely new to D, and when trying to setup the toolchain, DMD seems to work fine, but dub is running into linker issues. On my Intel iMac I have to set `MACOSX_DEPLOYMENT_TARGET`: ``` MACOSX_DEPLOYMENT_TARGET=11 dub run ```

Re: Mir-algorithm tutorial?

2023-08-19 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 19 August 2023 at 08:59:40 UTC, Ferhat Kurtulmuş wrote: On Saturday, 19 August 2023 at 01:44:16 UTC, Kyle Ingraham wrote: On Friday, 18 August 2023 at 12:14:45 UTC, Ferhat Kurtulmuş wrote: I think the main problem is the mir libraries won't get updates since Ilya recently said

Re: Mir-algorithm tutorial?

2023-08-18 Thread Kyle Ingraham via Digitalmars-d-learn
On Friday, 18 August 2023 at 12:14:45 UTC, Ferhat Kurtulmuş wrote: I think the main problem is the mir libraries won't get updates since Ilya recently said that he was not an open source developer anymore. That’s unfortunate for D but hopefully beneficial for Ilya. Was it said somewhere

Re: Linker Error with Template Function

2022-10-15 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 1 October 2022 at 21:18:05 UTC, Ali Çehreli wrote: On 10/1/22 11:15, Kyle Ingraham wrote: > storing structs as > `void*` in a wrapper struct with information about their module and > identifier saved elsewhere. Perhaps unrelated but that part reminded me of the following

Re: Linker Error with Template Function

2022-10-01 Thread Kyle Ingraham via Digitalmars-d-learn
On Tuesday, 13 September 2022 at 08:43:45 UTC, Nick Treleaven wrote: On Tuesday, 13 September 2022 at 03:00:17 UTC, Kyle Ingraham wrote: Any suggestions for being able to call one function for any instance given but maintain flexible return types? Not sure if it helps, but you can define

Re: Linker Error with Template Function

2022-09-12 Thread Kyle Ingraham via Digitalmars-d-learn
On Tuesday, 13 September 2022 at 01:46:14 UTC, Paul Backus wrote: On Tuesday, 13 September 2022 at 00:57:58 UTC, Kyle Ingraham wrote: I am writing a library where I would like to be able to store instances of a type of class to an associative array for later usage. Each class stored has to

Linker Error with Template Function

2022-09-12 Thread Kyle Ingraham via Digitalmars-d-learn
I am writing a library where I would like to be able to store instances of a type of class to an associative array for later usage. Each class stored has to implement a function as part of the required interface. The argument given is always the same type but the return value should be

Re: Is there a way to

2022-09-12 Thread Kyle Ingraham via Digitalmars-d-learn
On Sunday, 11 September 2022 at 00:56:39 UTC, Adam D Ruppe wrote: On Sunday, 11 September 2022 at 00:32:18 UTC, Kyle Ingraham wrote: I can't use default parameters because I want to be able to call the delegate with arguments extracted from a URL path at runtime Some kind of wrapper might

Re: Is there a way to

2022-09-10 Thread Kyle Ingraham via Digitalmars-d-learn
On Sunday, 11 September 2022 at 00:04:55 UTC, Adam D Ruppe wrote: On Saturday, 10 September 2022 at 23:37:30 UTC, Kyle Ingraham wrote: How can I write a type that is strict for the first two parameters but tolerant of any other parameter following those? That's not a type per se, but you can

Is there a way to

2022-09-10 Thread Kyle Ingraham via Digitalmars-d-learn
Is there a way to write a delegate type as being specific for some parameters and tolerant of anything for others? For example, I can specify this type: ```d alias MyDelegateType = void delegate(string name, int age); ``` It would be compatible with a pointer to this function converted to a

Re: A look inside "filter" function defintion

2022-08-14 Thread Kyle Ingraham via Digitalmars-d-learn
On Tuesday, 2 August 2022 at 12:39:41 UTC, pascal111 wrote: but I'm still stuck. Do you have a down-to-earth example for beginners to understand this concept? I often go back to this post when writing templates: https://dlang.org/blog/2020/07/31/the-abcs-of-templates-in-d/ It helped me when

Re: How to make a new dub subpackage? [Answered]

2021-12-01 Thread Kyle Ingraham via Digitalmars-d-learn
Thanks for the writeup. How are you using this functionality?

Re: Payload Details with std.net.curl:post

2021-11-28 Thread Kyle Ingraham via Digitalmars-d-learn
On Sunday, 28 November 2021 at 07:27:35 UTC, ikod wrote: On Sunday, 28 November 2021 at 01:06:45 UTC, Kyle Ingraham wrote: On Saturday, 27 November 2021 at 22:18:48 UTC, ikod wrote: On Saturday, 27 November 2021 at 20:31:16 UTC, Kyle Ingraham Hi Kyle, ``` object.Exception@C:\Users\Kyle

Re: Payload Details with std.net.curl:post

2021-11-27 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 27 November 2021 at 22:18:48 UTC, ikod wrote: On Saturday, 27 November 2021 at 20:31:16 UTC, Kyle Ingraham wrote: On Saturday, 27 November 2021 at 19:21:28 UTC, frame wrote: On Saturday, 27 November 2021 at 17:41:55 UTC, Kyle Ingraham wrote: I was afraid of that. Thank you for

Re: Payload Details with std.net.curl:post

2021-11-27 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 27 November 2021 at 19:21:28 UTC, frame wrote: On Saturday, 27 November 2021 at 17:41:55 UTC, Kyle Ingraham wrote: Is there a way to see that information? Google's API does not seem to provide much more than a status code as to the reason for the failure. No, and it's a shame

Payload Details with std.net.curl:post

2021-11-27 Thread Kyle Ingraham via Digitalmars-d-learn
Happy Saturday everyone. I am using `std.net.curl:post` to request an OAuth access token from a Google API. Initially I was getting a 400 status code back but could not tell why. I used the `verbose` option on `HTTP()` to get more details: ```D char[] tokenResponse; auto connection = HTTP();

Re: regarding what seems (to me) unnecessary casts on integer expressions

2021-06-04 Thread Kyle Ingraham via Digitalmars-d-learn
On Saturday, 5 June 2021 at 00:24:01 UTC, someone wrote: On Saturday, 5 June 2021 at 00:24:01 UTC, someone wrote: ? 0 : cast(ushort)(this.pintBottom1 - 1); } It looks like you’re being caught by D’s arithmetic conversions: https://dlang.org/spec/type.html#usual-arithmetic-conversions “If

Re: Does is(f == function) work?

2021-03-09 Thread Kyle Ingraham via Digitalmars-d-learn
On Tuesday, 9 March 2021 at 11:58:45 UTC, Andrey Zherikov wrote: On Tuesday, 9 March 2021 at 02:57:46 UTC, Adam D. Ruppe wrote: try is(typeof(f) == function) it is kinda weird but that's the trick Thanks! Should it work for in this case as well? alias f = (){};

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-25 Thread Kyle Ingraham via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 20:15:08 UTC, Ali Çehreli wrote: On 2/23/21 7:52 PM, Kyle Ingraham wrote: Where would one find information on this There are Point and Polygon struct templates on the following page where one can pick e.g. the dimension (e.g. three dimensional space) by a

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-24 Thread Kyle Ingraham via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 06:18:02 UTC, H. S. Teoh wrote: Usually it's when there's a decision that needs to be made at compile-time (or desirable to be made at compile-time for whatever reason). For example, if there are two very different branches of code that should run depending

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-23 Thread Kyle Ingraham via Digitalmars-d-learn
On Wednesday, 24 February 2021 at 03:57:37 UTC, Adam D. Ruppe wrote: On Wednesday, 24 February 2021 at 03:52:57 UTC, Kyle Ingraham wrote: The part that got my attention was `bool isBGR`. I was under the impression that compile-time or template parameters were only for types. No, you can pass

Compile-Time Function Parameters That Aren't Types?

2021-02-23 Thread Kyle Ingraham via Digitalmars-d-learn
I was reading the code for the DCV library and came across this function: https://github.com/libmir/dcv/blob/master/source/dcv/imgproc/color.d#L128 Here is a shortened form: [return type] rgbbgr2gray(bool isBGR, V)([run-time parameters]){[implementation]} and an example call:

Re: Problem Computing Dot Product with mir

2021-02-22 Thread Kyle Ingraham via Digitalmars-d-learn
On Monday, 22 February 2021 at 07:14:26 UTC, 9il wrote: On Sunday, 21 February 2021 at 16:18:05 UTC, Kyle Ingraham wrote: I am trying to convert sRGB pixel values to XYZ with mir using the following guide: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html [...] mir-glas is

Problem Computing Dot Product with mir

2021-02-21 Thread Kyle Ingraham via Digitalmars-d-learn
I am trying to convert sRGB pixel values to XYZ with mir using the following guide: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html My problem is that I cannot figure out how to calculate a dot product using mir. Here is my code: import std.stdio; import mir.glas.l1 : dot;

Re: struct constructor with rvalue param of same struct type

2021-01-18 Thread Kyle Ingraham via Digitalmars-d-learn
I’m sorry that this isn’t a solution to your problem but your code caught my attention. What is your snippet supposed to do?

Re: Simple BeamUI project won't link

2021-01-02 Thread Kyle Ingraham via Digitalmars-d-learn
On Friday, 18 December 2020 at 19:14:25 UTC, Daren Scot Wilson wrote: So maybe beamui isn't ready for the real world. It's a one-off personal tool for image processing, maybe will go up on Github, so I don't need anything super-solid or well established. OTOH, if it's too much on the WIP side

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
On Thursday, 3 December 2020 at 01:19:05 UTC, bachmeier wrote: On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: What did I do wrong in constructing the bindings? If it helps the library provides a function called EdsRelease for cleaning-up allocated objects. Is the

Re: D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
On Thursday, 3 December 2020 at 00:58:20 UTC, Paul Backus wrote: On Thursday, 3 December 2020 at 00:30:06 UTC, Kyle Ingraham wrote: // EDSDKTypes.h typedef struct __EdsObject* EdsBaseRef; typedef EdsBaseRef EdsCameraListRef; // [...] // edsdk.d struct EdsBaseRef; alias EdsBaseRef

D Bindings for C Opaque Pointers

2020-12-02 Thread Kyle Ingraham via Digitalmars-d-learn
Hello all. I am new to D and loving the experience so far. I am trying to make use of a C library from Canon that provides a header and a pre-compiled binary containing implementations of declarations found in the header. I used the excellent guide at