hadeedji
✅ How to learn Relational Databases?
Hello, sorry this is somewhat off topic for this server, but I think people here will be able to reccomend something. I'm looking to learn a database software, I've settled on postgres and now I want to learn. But I want to go at it from a theory side, not just knowing what SQL commands are what they do, but more the "why" of things. When I studied discrete math in uni we did relations, and I have a vague idea that the relation in relational database comes from that, so I want to explore that side. I hope I'm making sense, if anyone has any suggestions it'll be great. When I look for tutorials etc on postgres, all I get is people teaching how to make tables and how to run queries etc. I did find some things on normal forms, which seemed to be more what I was looking for. Any ideas would be appreciated, thanks!
7 replies
✅ Simplest way to take a 2d grid of pixel colors and display a window
Here's the situation, I'm going through a book on raytracing (raytracing in a weekend) and it's teaching to write a software renderer, rendering to a grid of pixels then writing it to a ppm file.
That's well and good, now I wanna make it so it spawns a window of the given size, and displays the grid of rgb pixels I have. But I have no experience with any graphics apis. I don't want to go for a game engine like unity or monogame, I want the simplest thing imaginable.
I'm on windows, cross platform is not a concern. I don't know if I should be looking at Directx or opengl or anything else, never did any graphics stuff like that. Not really a C# question sorry, just looking for advice, thanks a lot!
8 replies
✅ Positional record with alternate constructor
Say we have this record:
And we wanna provide a way for it to be initialized from doubles too:
But the compiler complains "A constructor declared in 'record' with parameter list must have 'this' constructor"
It wants me to do something like this:
This doesn't feel right to me, seems like I'm going against the language and doesn't look like idiomatic C#. Because we're setting the fields then setting them again. But I don't see why this can't work, it should be possible to specify a constructor with some other parameters than the primary constructor, assuming all the fields get initialized. I'm looking for ways to achieve this result with idiomatic C# that isn't a lot of code, like removing the positional parameters and writing those properties manually. Thank you.
19 replies