Re: Get milliseconds from time and construct time based on milliseconds

2024-05-28 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 28 May 2024 at 17:37:42 UTC, bauss wrote: I have two questions that I can't seem to find a solution to after looking at std.datetime. First question is how do I get the current time but in milliseconds? Second is how do I construct a time ex. systime or datetime based on

Re: How does one attach a manifest file to a D executable on Windows?

2024-05-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 24 May 2024 at 21:04:53 UTC, Ferhat Kurtulmuş wrote: On Friday, 24 May 2024 at 19:07:24 UTC, solidstate1991 wrote: I have tried resource compiling, then using `dflags` in dug to add the resulting obj file, but I still get the issue of the old GUI style. I did that before, but I

Re: How does one attach a manifest file to a D executable on Windows?

2024-05-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 24 May 2024 at 19:07:24 UTC, solidstate1991 wrote: I have tried resource compiling, then using `dflags` in dug to add the resulting obj file, but I still get the issue of the old GUI style. I did that before, but I don't remember now. Probably you will figure that out based on

Re: FIFO

2024-05-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 13 May 2024 at 15:07:39 UTC, Andy Valencia wrote: On Sunday, 12 May 2024 at 22:03:21 UTC, Ferhat Kurtulmuş wrote: https://dlang.org/phobos/std_container_slist.html This is a stack, isn't it? LIFO? Ahh yes. Then use dlist Thank you. I read its source, and was curious so I wrote

Re: Find homography in D?

2024-05-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 21 April 2024 at 14:57:33 UTC, Paolo Invernizzi wrote: Hi, Someone can point me to a D implementation of the classical OpenCV find homography matrix? Thank you, Paolo Now, we can do image stitching using DCV. It needs improvements though.

Re: FIFO

2024-05-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote: I need a FIFO for a work scheduler, and nothing suitable jumped out at me. I wrote the following, but as a newbie, would be happy to receive any suggestions or observations. TIA! [...] I don't know your use case, maybe you

Re: FIFO

2024-05-12 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 12 May 2024 at 21:08:24 UTC, Andy Valencia wrote: On Sunday, 12 May 2024 at 19:45:44 UTC, Ferhat Kurtulmuş wrote: On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote: I need a FIFO for a work scheduler, and nothing suitable jumped out at me. ...

Re: FIFO

2024-05-12 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote: I need a FIFO for a work scheduler, and nothing suitable jumped out at me. I wrote the following, but as a newbie, would be happy to receive any suggestions or observations. TIA! [...] "next" is not a usual range primitive

Re: FIFO

2024-05-12 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 11 May 2024 at 23:44:28 UTC, Andy Valencia wrote: I need a FIFO for a work scheduler, and nothing suitable jumped out at me. I wrote the following, but as a newbie, would be happy to receive any suggestions or observations. TIA! [...]

Re: Find homography in D?

2024-04-30 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 21 April 2024 at 14:57:33 UTC, Paolo Invernizzi wrote: Hi, Someone can point me to a D implementation of the classical OpenCV find homography matrix? Thank you, Paolo Just for future records in the forum. //

Re: Find homography in D?

2024-04-21 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 21 April 2024 at 14:57:33 UTC, Paolo Invernizzi wrote: Hi, Someone can point me to a D implementation of the classical OpenCV find homography matrix? Thank you, Paolo Kinda some work but it should be doable using DCV and mir.lubeck in theory DCV can compute, not sift or surf

Re: Statically compiled binary with C interop crashes.

2024-04-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 17 April 2024 at 11:03:22 UTC, yabobay wrote: I'm using [dray](https://code.dlang.org/packages/dray) in my project with dub, here's the relevant parts of the dub.json: [...] İt seems your issue is related to the raylib itself, neither the binding you use nor the d programming

Re: How to set include paths of a c source in dub when using importc

2024-04-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 17 April 2024 at 00:40:28 UTC, Alex Bryan wrote: If you're not using gdc exclusively, you'll want to take a look at this: https://github.com/dlang/dub/pull/2818 I knew there was something wrong there.

Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 22:00:16 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:41:41 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) Andrew Cattermole wrote:

Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:41:41 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) Andrew Cattermole wrote: On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote: These don't work for me:

Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:39:10 UTC, Ferhat Kurtulmuş wrote: On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) Andrew Cattermole wrote: On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote: These don't work for me: "dflags": ["-Iinclude"] "importPaths": [     "include" ], The

Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) Andrew Cattermole wrote: On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote: These don't work for me: "dflags": ["-Iinclude"] "importPaths": [     "include" ], The importc docs do not help either. Appears it hasn't been documented in

Re: How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 13 April 2024 at 21:21:24 UTC, Richard (Rikki) Andrew Cattermole wrote: On 14/04/2024 8:59 AM, Ferhat Kurtulmuş wrote: These don't work for me: "dflags": ["-Iinclude"] "importPaths": [     "include" ], The importc docs do not help either. Appears it hasn't been documented in

How to set include paths of a c source in dub when using importc

2024-04-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
These don't work for me: "dflags": ["-Iinclude"] "importPaths": [ "include" ], The importc docs do not help either.

Re: How to add a character literal to a string without ~ operator?

2024-04-04 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 4 April 2024 at 21:23:00 UTC, user1234 wrote: On Thursday, 4 April 2024 at 19:56:50 UTC, Ferhat Kurtulmuş wrote: [...] ```d module runnable; import std.stdio : writeln; import std.range : chain; void main() @nogc { auto s = chain("as ", "df ", "j"); // s is lazy

Re: How to add a character literal to a string without ~ operator?

2024-04-04 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote: I'm looking for more readable standard function to add a **character** literal to a **string**. The `~` operator is clearly not great while reading a source code. I'm not here to discuss that. I'm looking for a function inside standard

Re: Alguien me dice como podria conectarme a una base de datos en SQL server?

2024-03-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 14 March 2024 at 16:42:04 UTC, dany wrote: Hola a todos necesito conectarme a una base de datos sql y ps no me sale :'( quisiera saber como podria porfis, ayuda :') import std.stdio; import std.json; //import std.database.mysql; //import raylib; import ddbc; void main() {

Re: Recommendation about templating engine library

2024-03-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 11 March 2024 at 14:26:01 UTC, Andrea wrote: Hi folks, Working on a side project I have the need to generate text files (mainly D source code) via a templating system. My use case is to have some JSON data populated at runtime from an API and fill-in placeholders in the text with

Re: Are exceptions caught in unittests?

2024-02-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 16 February 2024 at 08:48:08 UTC, Jonathan M Davis wrote: On Friday, February 16, 2024 1:06:26 AM MST Ferhat Kurtulmuş via Digitalmars- d-learn wrote: [...] 1. assertThrown does not test whether something somewhere in what you called threw an exception. It asserts that it catches

Re: Are exceptions caught in unittests?

2024-02-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 16 February 2024 at 07:43:24 UTC, Ferhat Kurtulmuş wrote: When I tried to catch exceptions in my unit test, I found that exceptions were not thrown or caught in the unit test blocks. So, I cannot use assertThrown at all. Is this a bug or expected behavior that I don't know? Using

Re: Are exceptions caught in unittests?

2024-02-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 16 February 2024 at 07:54:01 UTC, Richard (Rikki) Andrew Cattermole wrote: This should be working. I don't know what is going on. All I can suggest is to use a debugger to see if it is indeed throwing and then catching. A test code like this works, but unittest doesn't. This is

Are exceptions caught in unittests?

2024-02-15 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
When I tried to catch exceptions in my unit test, I found that exceptions were not thrown or caught in the unit test blocks. So, I cannot use assertThrown at all. Is this a bug or expected behavior that I don't know? Using LDC 1.36.0 on Windows.

Re: D: Convert/parse uint integer to string. (@nogc)

2023-11-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 24 November 2023 at 09:35:00 UTC, BoQsc wrote: I tried to look into https://dlang.org/phobos/std_conv.html Most of the functions inside `std.conv` seem to be dependant on [Garbage Collection](https://dlang.org/spec/garbage.html). And I couldn't find a straightforward way to

Re: extern (c)

2023-10-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 11 October 2023 at 12:36:58 UTC, Paul wrote: What does the extern (c) attribute(?) do? Does it tell the compiler/linker to build the function like a C compiler would build a C function? If so what does that mean? Does it tell the compiler/linker to let C functions know it exists?

Re: Struct nested function

2023-09-13 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 13 September 2023 at 05:58:13 UTC, vino wrote: Hi All, Request your help, I have a struct which has many functions, I need to run a function from within another function(From Display function execute the runner function), an example as below From, Vino The problem starts

Re: D web browser?

2023-09-08 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 8 September 2023 at 06:42:13 UTC, Joe wrote: Is there a D library that lets one access the web through a browser like interface? I need to access some URLS as if I was browsing them(it needs to run scripts in the page). E.g., C# has WebBrowser that lets one programmatically control

Re: How can I execute C++ functions from Dlang?

2023-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 19 August 2023 at 20:50:23 UTC, thePengüin wrote: On Saturday, 19 August 2023 at 20:16:47 UTC, Ferhat Kurtulmuş wrote: On Saturday, 19 August 2023 at 19:41:47 UTC, thePengüin wrote: On Monday, 14 August 2023 at 07:36:31 UTC, Ferhat Kurtulmuş wrote: [...] estoy usando el de 64 o

Re: How can I execute C++ functions from Dlang?

2023-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 19 August 2023 at 19:41:47 UTC, thePengüin wrote: On Monday, 14 August 2023 at 07:36:31 UTC, Ferhat Kurtulmuş wrote: On Monday, 14 August 2023 at 06:40:04 UTC, thePengüin wrote: hola a todos quisiera ejecutar este codigo de c++ ` #include \ using namespace std; int main() {

Re: Mir-algorithm tutorial?

2023-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
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 that he was not an open source developer anymore. That’s unfortunate

Re: Mir-algorithm tutorial?

2023-08-18 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 18 August 2023 at 09:57:11 UTC, Ki Rill wrote: On Friday, 18 August 2023 at 09:32:31 UTC, Ferhat Kurtulmuş wrote: I believe the most recent docs for mir-algorithm is here http://mir-algorithm.libmir.org/ Thanks. Yes, that's the only thing. However, it's not a good starting point

Re: Mir-algorithm tutorial?

2023-08-18 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 18 August 2023 at 07:54:04 UTC, Ki Rill wrote: Is there an up-to-date tutorial? It's just painful that I cannot find anything helpful on this topic. The official mir-algorithm GitHub repo links to articles with old code that won't build if I copy-paste it. I'm left hunting down

Re: Finding duplicate elements

2023-08-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 15 August 2023 at 17:59:27 UTC, vino wrote: Hi All, Request your help in finding duplicate element without sorting as per the below example ``` Example: string[] args = [" test3", "test2 ", " test1 ", " test1 ", " "]; Output Required: If duplicate element found then print

Re: How can I execute C++ functions from Dlang?

2023-08-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 14 August 2023 at 06:40:04 UTC, thePengüin wrote: hola a todos quisiera ejecutar este codigo de c++ ` #include \ using namespace std; int main() { return 0; } int foo(int i, int j) { cout \<\< i\<\ ?Tu usas ambos de 64 bit o 32 bit para compiladores? No

Re: Loading Textures in OpenGL

2023-07-23 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 23 July 2023 at 18:06:46 UTC, Ruby The Roobster wrote: On Sunday, 23 July 2023 at 17:45:53 UTC, Ferhat Kurtulmuş wrote: On Sunday, 23 July 2023 at 17:35:03 UTC, Ruby The Roobster [SNIP] Thank you. I'm still trying to work out how it works. It seems as if the creator tried the

Re: Loading Textures in OpenGL

2023-07-23 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 23 July 2023 at 17:35:03 UTC, Ruby The Roobster wrote: On Sunday, 23 July 2023 at 17:02:40 UTC, Ferhat Kurtulmuş wrote: On Sunday, 23 July 2023 at 16:21:05 UTC, Ruby The Roobster wrote: I'm currently trying to load two textures and apply them to a rectangle, following

Re: Loading Textures in OpenGL

2023-07-23 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 23 July 2023 at 16:21:05 UTC, Ruby The Roobster wrote: I'm currently trying to load two textures and apply them to a rectangle, following [this](https://learnopengl.com/Getting-started/Textures) which is linked to from the README file of the bindbc OpenGL bindings. [...] DCV uses

Re: How to read live output from another process ?

2023-06-29 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 23 June 2023 at 23:37:29 UTC, Vinod K Chandran wrote: Hi all, I am trying to create a program which burns time codes to a video. I am using ffmpeg for this. So far, I can successfully start ffmpeg in another thread and stop it when I need. But I can't read the live outputs from

Re: How to setup dub project for contributing to a dub package?

2023-06-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 23 June 2023 at 15:22:33 UTC, Ki Rill wrote: Recently, I tried to set up `dcv` with `dub` to improve a few things in the library, but I faced some strange issues. [...] I recommend adding DCV sub packages separately. Don't add the entire thing to your dub dependencies. Just only

Re: How to setup dub project for contributing to a dub package?

2023-06-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 23 June 2023 at 15:52:44 UTC, Richard (Rikki) Andrew Cattermole wrote: First things first, dcv is added to the dub-registry, so use this. https://code.dlang.org/packages/dcv ```json "dependencies": { "dcv": "~>0.3.0" } ``` For ffmpeg the binding tells you what to add for

Re: pregunta preguntona, acerca de el resultado de remoteAddress()

2023-06-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 14 June 2023 at 19:50:21 UTC, Danico wrote: que significa los ultimos numeros de 192.168.0.13:50732 , cuando hago un remoteAddress() y en un servidor socket? Es un numero de puerto. No estoy seguro que preguntar en un idioma otra que ingles es un buena idea aqui. Lee esto por

Re: What's dxml DOMEntity(R) type ?

2023-06-06 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 6 June 2023 at 14:16:37 UTC, Steven Schveighoffer wrote: On 6/5/23 6:43 AM, Ferhat Kurtulmuş wrote: On Monday, 5 June 2023 at 10:01:01 UTC, John Xu wrote: [...] ```d import dxml.dom; import std.stdio;     DOMEntity!string xmlRoot;     int main()     {     string xml = "";

Re: What's dxml DOMEntity(R) type ?

2023-06-05 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 5 June 2023 at 10:01:01 UTC, John Xu wrote: The parseDOM returns a DOMEntity(R) type, how do I write a xmlRoot as global variable? I need its detailed type (auto / Variant doesn't work). import dxml.dom; ?? xmlRoot; int main() { string xml =

Re: what is the aftermath of dip74

2023-05-10 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 10 May 2023 at 18:15:36 UTC, Richard (Rikki) Andrew Cattermole wrote: We do not, no. Reference counting is not currently in the language, although you can fake it with structs. Its a huge shame, but it should be added at some point because the compiler would tell the backend

Re: Getting a total from a user defined variable

2023-04-20 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 20 April 2023 at 19:41:21 UTC, Joel wrote: ```d import std; struct Person { string name; ulong age; } void main() { auto p=[Person("Joel", 43), Person("Timothy", 40)]; writeln("Total: ", p.reduce!((a,b) => a.age+b.age)(0UL)); // how do I get the total of ages

Re: Variable length arrays under -betterC?

2023-04-18 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 18 April 2023 at 06:20:43 UTC, Richard (Rikki) Andrew Cattermole wrote: On 18/04/2023 1:33 PM, Salih Dincer wrote: I understand from the thread this: D gives us -betterC but nothing from the Phobos.  So he says, see what you have, do what the hell you want! Am I wrong about this?

Re: What do you think about using Chat GPT to create functions in D?

2023-04-14 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 3 April 2023 at 23:38:52 UTC, Marcone wrote: What do you think about using Chat GPT to create functions in D? I asked Chat-GPT to create a function in D that was similar to the rsplit() function in Python. It returned this code to me: import std.algorithm; import std.array; import

Re: better video rendering in d

2023-03-21 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 21 March 2023 at 17:46:00 UTC, H. S. Teoh wrote: On Tue, Mar 21, 2023 at 05:29:22PM +, monkyyy via Digitalmars-d-learn wrote: On Tuesday, 21 March 2023 at 17:18:15 UTC, H. S. Teoh wrote: > [...] I vaguely remember an hour and half for 5 minutes of video when its extremely

Re: compile: link dynamic OR static library in Windows

2023-02-04 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 4 February 2023 at 15:52:33 UTC, Alexander Zhirov wrote: PS C:\sources\pxe-restore\source> dmd -i app.d -LC:\msys64\home\user\postgresql-15.1\installed\mingw64\lib\libpq.dll lld-link: error: C:\msys64\home\user\postgresql-15.1\installed\mingw64\lib\libpq.dll: bad file type. Did

Re: Are there some helpers in Phobos equivalent to std::set_difference of ugly c++

2023-02-03 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 3 February 2023 at 15:53:35 UTC, Richard (Rikki) Andrew Cattermole wrote: ```d import std.stdio, std.algorithm.setops, std.array; void main() { int[] v1 = [1, 2, 5, 5, 5, 9]; int[] v2 = [2, 5, 7]; int[] v3 = setDifference(v1, v2).array; writefln!"%s \\ %s = %s"(v1,

Are there some helpers in Phobos equivalent to std::set_difference of ugly c++

2023-02-03 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I could not find a thing doing this. And I don't want to write it from scratch. Getting a range as output is ok too. What I need is the following: ```c++ const std::vector v1{1, 2, 5, 5, 5, 9}; const std::vector v2{2, 5, 7}; std::vector diff; std::set_difference(v1.begin(),

Re: Graphical progressive fill

2022-12-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 11 December 2022 at 06:50:44 UTC, Joel wrote: I've been trying to fill in areas with a colour but can't work it out. I want something like the effect where it fills with diamonds. Not all at once but building up in the main program loop. # # # #

Re: Allocate a string via the GC

2022-05-23 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 23 May 2022 at 09:38:07 UTC, JG wrote: Hi, Is there any more standard way to achieve something to the effect of: ```d import std.experimental.allocator; string* name = theAllocator.make!string; ``` Pointers are not used for strings in d. string is an alias for

Re: I need some help for my DCV update

2021-11-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 27 November 2021 at 11:35:21 UTC, Salih Dincer wrote: I also found similar errors but couldn't solve them. I think it has to do with mir.slice.kind. Exactly Kind Topology... I won't use parallel for it as a workaround until it is solved in the mir-algorithm.

Re: I need some help for my DCV update

2021-11-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 26 November 2021 at 09:16:56 UTC, Ferhat Kurtulmuş wrote: I am working on the DCV to make it compilable with the recent versions of LDC, mir libraries, and stuff. I have not yet simply forked it to work on it. I am including modules one by one for my convenience instead. Hope, I am

Re: I need some help for my DCV update

2021-11-26 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 26 November 2021 at 09:31:42 UTC, drug wrote: On 26.11.2021 12:16, Ferhat Kurtulmuş wrote: InputTensor = Slice!(ubyte*, 2LU, mir_slice_kind.contiguous) and KernelTensor = Slice!(float*, 2LU, mir_slice_kind.contiguous). The key argument of slices is a pointee type - InputTensor

I need some help for my DCV update

2021-11-26 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I am working on the DCV to make it compilable with the recent versions of LDC, mir libraries, and stuff. I have not yet simply forked it to work on it. I am including modules one by one for my convenience instead. Hope, I am close to the end. Here is my temporary repo:

Re: I need some help for my DCV update

2021-11-26 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 26 November 2021 at 09:16:56 UTC, Ferhat Kurtulmuş wrote: I am working on the DCV to make it compilable with the recent versions of LDC, mir libraries, and stuff. I have not yet simply forked it to work on it. I am including modules one by one for my convenience instead. Hope, I am

Re: Data conversion

2021-11-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 16 November 2021 at 19:44:04 UTC, Ferhat Kurtulmuş wrote: On Tuesday, 16 November 2021 at 19:18:50 UTC, pascal111 wrote: [...] sscanf of C is an option where you cannot use to!T. However, it is a c library function, and it doesn't throw an exception on unexpected inputs.

Re: Data conversion

2021-11-16 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 16 November 2021 at 19:18:50 UTC, pascal111 wrote: I used "to" keyword which "std.conv" includes for data conversions, but I think that there are some other ways for data conversions, or maybe there are common ways like casting, I hope to know about. For example, next program are

Re: Crosscompile to Windows

2021-11-05 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 5 November 2021 at 18:11:35 UTC, Luis wrote: There is a obvious way to crosscompile a dub project to Windows from a Linux dev machine ? I don't know if it is possible with dmd. But with LDC you can use mtriple. https://wiki.dlang.org/Cross-compiling_with_LDC

Re: I need a detailed document about druntime.

2021-10-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 11 October 2021 at 15:24:07 UTC, Adam D Ruppe wrote: On Monday, 11 October 2021 at 15:18:11 UTC, Ferhat Kurtulmuş wrote: "Each call to initialize must be paired by a call to terminate.' It is so the refcount works out. When you call initialize, it does something like: if(refcount

Re: I need a detailed document about druntime.

2021-10-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 11 October 2021 at 15:09:12 UTC, Adam D Ruppe wrote: On Monday, 11 October 2021 at 14:56:19 UTC, Ferhat Kurtulmuş wrote: What I want is to bypass runtime initialization if it is already initialized. That what it does by itself, you can call it and it has an internal count. Thank

I need a detailed document about druntime.

2021-10-11 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I want to know what happens if either Runtime.initialize or terminate is called without matching each other. And why there is no ready-to-use thing like initCount which is accessible in the code? What I want is to bypass runtime initialization if it is already initialized. The below code is my

Re: Template mixin problem with EnumMembers

2021-10-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 2 October 2021 at 22:24:56 UTC, Adam Ruppe wrote: On Saturday, 2 October 2021 at 22:07:23 UTC, Ferhat Kurtulmuş wrote: [...] You used .stringof. That's undefined behavior. Never use stringof. (except for debugging writes) [...] Thank you Adam! I should stop using stringof.

Template mixin problem with EnumMembers

2021-10-02 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
The below code works as expected on https://run.dlang.io/, but not on my computer. And I don't know why? I want to access enum members like Options.OUT_FILE_NAME instead of Options.StringOption.OUT_FILE_NAME. Please note that the solutions like "alias something = int;" don't work for me.

Re: How to do "C++ classes"?

2021-09-20 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 20 September 2021 at 15:56:44 UTC, Ferhat Kurtulmuş wrote: On Monday, 20 September 2021 at 15:45:08 UTC, Adam D Ruppe wrote: On Monday, 20 September 2021 at 15:35:02 UTC, Ferhat Kurtulmuş wrote: I thought it's stack-allocated and scoped. It is. But when I try to return a class

Re: How to do "C++ classes"?

2021-09-20 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Monday, 20 September 2021 at 15:45:08 UTC, Adam D Ruppe wrote: On Monday, 20 September 2021 at 15:35:02 UTC, Ferhat Kurtulmuş wrote: I thought it's stack-allocated and scoped. It is. But when I try to return a class instance from a function, it still works? dmd only makes that an error

Re: How to do "C++ classes"?

2021-09-20 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 18 September 2021 at 22:16:32 UTC, Adam D Ruppe wrote: On Saturday, 18 September 2021 at 15:38:38 UTC, rempas wrote: I'm seeing in the page about "BeterC" and in the part about the [retained features](https://dlang.org/spec/betterc.html#retained), the #11 says about "COM classes

Re: How to simply parse and print the XML with dxml?

2021-09-09 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 9 September 2021 at 17:17:23 UTC, tastyminerals wrote: Maybe I missed something obvious in the docs but how can I just parse the XML and print its content? ``` import dxml.parser; auto xml = parseXML!simpleXML(layout); xml.map!(e => e.text).join.writeln; ``` throws

Re: foreach() behavior on ranges

2021-08-24 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 24 August 2021 at 19:06:44 UTC, Alexandru Ermicioi wrote: On Tuesday, 24 August 2021 at 09:15:23 UTC, bauss wrote: [...] Actually the range contracts don't mention that it needs to be a by value type. It can also be a reference type, i.e. a class. [...] True for any forward

Re: How to get element type of a slice?

2021-08-23 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Saturday, 21 August 2021 at 02:59:39 UTC, Jesse Phillips wrote: On Thursday, 19 August 2021 at 04:03:31 UTC, jfondren wrote: On Thursday, 19 August 2021 at 03:32:47 UTC, Jesse Phillips wrote: On Tuesday, 17 August 2021 at 12:33:03 UTC, Ferhat Kurtulmuş wrote: Hey, thank you again but, I

Re: How to call destructor before free without dropping @nogc?

2021-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 19 August 2021 at 15:38:19 UTC, evilrat wrote: On Thursday, 19 August 2021 at 15:12:03 UTC, Ferhat Kurtulmuş Btw, based on https://github.com/dlang/druntime/blob/master/src/object.d#L4209: import core.lifetime; import core.stdc.stdio; import core.stdc.stdlib; extern (C) void

Re: How to call destructor before free without dropping @nogc?

2021-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 19 August 2021 at 15:38:19 UTC, evilrat wrote: On Thursday, 19 August 2021 at 15:12:03 UTC, Ferhat Kurtulmuş This is cool, but even in unit tests for malloc wrapper there is only simple case with class without references to another class and no dtor. If you examine the entire

Re: How to call destructor before free without dropping @nogc?

2021-08-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 19 August 2021 at 07:30:38 UTC, Bienlein wrote: Hello, I allocate some instance of class C manually and then free the memory again: [...] I just wanted to leave this here. https://github.com/AuburnSounds/Dplug/blob/master/core/dplug/core/nogc.d

Re: How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 13:14:44 UTC, Steven Schveighoffer wrote: On 8/17/21 8:21 AM, Ferhat Kurtulmuş wrote: Hello folks, Hope everyone is doing fine. Considering the following code, in the first condition, I am extracting the type Point from the slice Point[]. I searched in the

Re: How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:49:02 UTC, drug wrote: 17.08.2021 15:21, Ferhat Kurtulmuş пишет: [...] https://dlang.org/library/std/range/primitives/element_type.html Yes, that is neat. Thank you.

Re: How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:32:45 UTC, Paul Backus wrote: On Tuesday, 17 August 2021 at 12:21:31 UTC, Ferhat Kurtulmuş wrote: Hello folks, Hope everyone is doing fine. Considering the following code, in the first condition, I am extracting the type Point from the slice Point[]. I

Re: How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:26:36 UTC, jfondren wrote: On Tuesday, 17 August 2021 at 12:21:31 UTC, Ferhat Kurtulmuş wrote: [...] This one's not in std.traits: ```d import std.range : ElementType; struct Point { int x, y; } unittest { Point[] points;

Re: How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 17 August 2021 at 12:26:36 UTC, jfondren wrote: On Tuesday, 17 August 2021 at 12:21:31 UTC, Ferhat Kurtulmuş wrote: [...] This one's not in std.traits: ```d import std.range : ElementType; struct Point { int x, y; } unittest { Point[] points;

How to get element type of a slice?

2021-08-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
Hello folks, Hope everyone is doing fine. Considering the following code, in the first condition, I am extracting the type Point from the slice Point[]. I searched in the std.traits, and could not find a neater solution something like ElementTypeOf!T. Is there any neater solution for it?

Re: Can I make system calls directly from D?

2021-07-09 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 9 July 2021 at 08:08:57 UTC, rempas wrote: I just wonder if I'm able to do system calls directly from D or If I have to create bindings from "unistd.h" from C I don't know if it covers what you want but, druntime has those definitions:

Re: Trivial simple OpenGl working example

2021-07-09 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 9 July 2021 at 06:16:08 UTC, Ferhat Kurtulmuş wrote: On Friday, 9 July 2021 at 05:17:28 UTC, Виталий Фадеев wrote: [...] [...] Dear Vitaly (Google translates it like that :)), I didn't touch that game for a while. I have just tried to compile and those are the steps to build

Re: Trivial simple OpenGl working example

2021-07-09 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 9 July 2021 at 05:17:28 UTC, Виталий Фадеев wrote: On Thursday, 8 July 2021 at 17:20:14 UTC, Ferhat Kurtulmuş wrote: On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: Hi! Each ends with error. Dear Vitaly (Google translates it like that :)), I didn't touch that

Re: Trivial simple OpenGl working example

2021-07-08 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Thursday, 8 July 2021 at 13:51:51 UTC, Виталий Фадеев wrote: Hi! I searching trivial simple D/OpenGL working in 2021 year example. It may be triangle. It may be based on any library: SDL, GLFW, Derelict, etc. Can you help me ? this one of mine [1] was very simple in the beginning. It

Re: How to use a shared library created in cython?

2021-04-12 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 11 April 2021 at 20:08:15 UTC, affonso elias ferreira junior wrote: Hi everyone, I'm trying to use a shared library created in Cython. example. [...] I am on my mobile phone, and cannot reproduce. But i see that this cast(int function()) should be cast(int function(int)). Try

Re: Creating a .di file for a custom C library

2021-03-30 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 30 March 2021 at 04:01:12 UTC, Brad wrote: I would like to use an updated version of the Termbox library (written in C) with D. I have the .h file. This is new territory for me (why try something easy - right?). I think I need to create a .di file that corresponds to the .h

Re: Creating 1000 instances

2021-02-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 19 February 2021 at 10:02:05 UTC, Siemargl wrote: On Friday, 19 February 2021 at 08:29:36 UTC, Ferhat Kurtulmuş wrote: Since classes are reference types all instances of files will be the same reference of "new File()", which you probably don't want. Is any differences between x

Re: Creating 1000 instances

2021-02-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 19 February 2021 at 08:29:36 UTC, Ferhat Kurtulmuş wrote: On Friday, 19 February 2021 at 08:04:19 UTC, Виталий Фадеев wrote: [...] files = new File[]( 1000 ); files[] = new File(); // add this Since classes are reference types all instances of files will be the same reference of

Re: Creating 1000 instances

2021-02-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 19 February 2021 at 08:41:06 UTC, Ferhat Kurtulmuş wrote: On Friday, 19 February 2021 at 08:29:36 UTC, Ferhat Kurtulmuş wrote: On Friday, 19 February 2021 at 08:04:19 UTC, Виталий Фадеев wrote: [...] files = new File[]( 1000 ); files[] = new File(); // add this Since classes are

Re: Creating 1000 instances

2021-02-19 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Friday, 19 February 2021 at 08:04:19 UTC, Виталий Фадеев wrote: We have: class File { // WIN32_FIND_DATAW data; } void fastReadDir() { File[] files; // reserve space, allocating instances files = new File[]( 1000 ); // <--- trouble here ?

Re: Web crawler/scraping

2021-02-17 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 17 February 2021 at 12:12:56 UTC, Carlos Cabral wrote: Hi, I'm trying to collect some json data from a website/admin panel automatically, which is behind a login form. Is there a D library that can help me with this? Thank you I found this but it looks outdated:

Re: Real simple unresolved external symbols question...

2021-02-10 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 9 February 2021 at 19:37:17 UTC, WhatMeWorry wrote: I'm trying to create a super simple dynamic library consisting of two files: [...] remove /NOENTRY, and include "mixin SimpleDllMain;" in one of the sources. And link with druntime. link /DLL file2.obj fileB.obj

Need help for opencvd git submoduling

2021-02-07 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I am wrapping opencv::cuda modules based on c/c++ wrapper files of gocv. This might be more of a git question. Can one link a folder from a repo to be a subfolder of another git repo? Do I have any option other than submoduling the entire Go repo? I want

Re: list system drives

2021-02-01 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Tuesday, 2 February 2021 at 06:31:27 UTC, Виталий Фадеев wrote: Give, please, Dlang tools for list system drives. Some like a: enumVolumes(); // [ 'C:\', 'D:\' ] I have found this code by a google search. I don't know who the author was. I had to touch it a little since the codebase

Re: How do I get the output of the time bash command?

2021-01-27 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Wednesday, 27 January 2021 at 09:35:21 UTC, Anthony wrote: I'm trying to read the timed output of a pipeShell command but it only results in empty output. Does anyone know why this is? ``` auto p = pipeShell("time ls"); foreach(str; p.stdout.byLine) {

  1   2   3   >