Re: Step by step tutorials for using bindings in D

2023-03-28 Thread eXodiquas via Digitalmars-d-learn
On Monday, 27 March 2023 at 00:06:36 UTC, Inkrementator wrote: I'm surprised this worked, according to `man ld`, the -L flag takes a dir as input, not a full filepath. Can you please post your full dub config? I'm intrigued. Hello again and thank you very much. I got it now, I got OpenGL,

Re: Step by step tutorials for using bindings in D

2023-03-26 Thread eXodiquas via Digitalmars-d-learn
On Sunday, 26 March 2023 at 14:09:19 UTC, Inkrementator wrote: # Practical Walkthrough Two ways to go about this: 1. Get SFML dynamic library somewhere 2. Create a project called sfmltest 3. Add BindBC-SFML dependency via dub 4. Put SFML dynamic library files into the directory where you will

Step by step tutorials for using bindings in D

2023-03-24 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, once again, I am here for your help. My last questions were answered really competently so I try again. :P So, maybe this is a stupid question, but I have read a lot about Bindings to C and C++ libraries for D. For example the Derelict project (or now

Vibe.d serve files from filesystem

2023-01-11 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, I build a web tool that allows people to upload some files. Those files should not be public, so I copy them into a folder hidden away on the filesystem. But, I want an authenticated user to be able to look at them. Those files are PDFs and mp3/4s. So my idea was to use an

Re: Vibe.d MongoDB database connection

2022-12-26 Thread eXodiquas via Digitalmars-d-learn
On Sunday, 25 December 2022 at 23:05:08 UTC, eXodiquas wrote: Hello everyone, I tried to fix this problem myself but I just can't get it to work and you guys were great help for me on the last problems I encountered, so I give it a shot again. :P [...] I looked a bit closer into the

Vibe.d MongoDB database connection

2022-12-25 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, I tried to fix this problem myself but I just can't get it to work and you guys were great help for me on the last problems I encountered, so I give it a shot again. :P I worked through the "D Web Development" book by Kai Nacke and I tried to setup a MongoDB connection for

Re: Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
On Monday, 27 September 2021 at 17:14:11 UTC, Ali Çehreli wrote: [...] Woah, thanks everyone for the ridiculous precise and helpful answers I got here. This forum never disappoints. :P I now try to fully understand the answers and implement the solution to the problem in a cleaner way.

Re: Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
On Monday, 27 September 2021 at 16:49:15 UTC, Dga123 wrote: On Monday, 27 September 2021 at 16:23:50 UTC, eXodiquas wrote: Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. [...] But

Mixin programming foreach

2021-09-27 Thread eXodiquas via Digitalmars-d-learn
Howdy ho everyone, I found this forum very helpful for my (maybe) stupid questions, so I give it a try again because I don't understand what's happening here. First of all, I'm not exactly sure what this code here, from the documentation at https://dlang.org/articles/mixin.html, does:

Re: Return complete multi-dimensional array after appending

2021-09-15 Thread eXodiquas via Digitalmars-d-learn
On Wednesday, 15 September 2021 at 21:02:29 UTC, Paul Backus wrote: On Wednesday, 15 September 2021 at 20:32:12 UTC, eXodiquas wrote: ```d [1,0,3,4,0,5] .fold!((a, e) => e != 0 ? a[0] ~ e : a[1] ~ e)(cast(int[][]) [[],[]]) .flatten .writeln ``` This should sort all non 0s into the `a[0]`

Return complete multi-dimensional array after appending

2021-09-15 Thread eXodiquas via Digitalmars-d-learn
Howdy everyone. :) Today I came across a small problem (I mean, I could solve it by writing a function that solves my problem, but maybe there is something in std that can help me here). Let's say we have the following code: ```d void main() { int[][] a = [[],[]]; (a[0] ~ 5).writeln; //

Re: Piping from terminal into D program

2021-09-04 Thread eXodiquas via Digitalmars-d-learn
On Saturday, 4 September 2021 at 18:20:51 UTC, WebFreak001 wrote: On Saturday, 4 September 2021 at 15:41:51 UTC, eXodiquas wrote: [...] to extend on Brian Tiffin's reply, you can read from the standard input stream (the data piped to your program) using std.stdio's `stdin` [...] Brian

Piping from terminal into D program

2021-09-04 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, I created a small little D program that reads in a string from the command line and shuffles the letters of the nouns a bit around. This is pretty straight forward, but what I see now happening is a bit strange, at least for me. I am reading the args out of the main function

Re: (Maybe) Strange Behaviour of Field Initialization

2021-04-28 Thread eXodiquas via Digitalmars-d-learn
On Wednesday, 28 April 2021 at 15:35:57 UTC, Adam D. Ruppe wrote: On Wednesday, 28 April 2021 at 15:09:36 UTC, eXodiquas wrote: ```d class Particle : Drawable { CircleShape shape = new CircleShape(5); This `new` is actually run at compile time, so every instance of Particle refers to the

(Maybe) Strange Behaviour of Field Initialization

2021-04-28 Thread eXodiquas via Digitalmars-d-learn
Hello everyone, I am playing around with DSFML and drawing some stuff on the screen. It works like a charm but I got some unexpected behavior when building a `Particle` class. My class looks like this: ```d class Particle : Drawable { CircleShape shape = new CircleShape(5); this(int x,

Re: Operator Overloading with multiple return types

2019-03-15 Thread eXodiquas via Digitalmars-d-learn
On Friday, 15 March 2019 at 21:46:50 UTC, Ali Çehreli wrote: On 03/15/2019 02:43 PM, Sebastiaan Koppe wrote: On Friday, 15 March 2019 at 21:35:12 UTC, eXodiquas wrote: Is there any way to achive this behaivour with D2? Yep. Just make the return type in the function declaration `auto`. You

Operator Overloading with multiple return types

2019-03-15 Thread eXodiquas via Digitalmars-d-learn
Hi everyone, i'm currently working on a small physics engine and I thought it would be a nice feature to overload the operators of my vector struct so I don't have to make ugly function calls just to add and "multiply" my vectors. The problem now is that overloading the addition and