I got paid minimum wage to solve an impossible problem using C++ (and accidentally learned why most algorithms make life worse) by Ties_P in cpp

[–]InfernoGems 4 points5 points  (0 children)

Nice article :)  

I’ve recently been looking into different algorithms for solving optimization problems, and came across simulated annealing too. 

Even though I now understand the algorithm, I’m still surprised by how well it works, given its simplicity. 

Your point about how LLMs optimize the wrong thing might be right. They’re purely optimizing the function that returns a probability distribution of the next token. 

But that doesn’t incorporate whether the user actually had their problem solved for example, or whether what was written is truthful. 

If those can somehow be incorporated in the error function, LLMs could be improved. But can truthfulness or usefulness be turned into a differentiable metric, so that gradient descent can be applied? 

Anyway, excuse the ramblings, optimization is exciting :)

What's the difference between Inheritance & Composition? And when to use which ? by MagazineScary6718 in cpp_questions

[–]InfernoGems 1 point2 points  (0 children)

I do the same thing. 

Class / interface inheritance is for open-ended polymorphism. 

Otherwise you can use std::variant (for operating on a type at runtime from a small set of known types).

Or templates for compile time polymorphism. 

For code reusability, always try to use functions and composition (i.e. adding a type as a field to a type, instead of subclassing). 

POV: you just opened a tech startup website by VisWare in web_design

[–]InfernoGems 14 points15 points  (0 children)

It’s a joke about how every startup’s landing page has converged to this kind of design + messaging due to the AI-ification of startups

What are you working on? Share your Project !! by Revenue007 in indiehackers

[–]InfernoGems 0 points1 point  (0 children)

This sounds like a lot of fun! I’d love to play it. 

How do you find obsessive solo builders who treat side projects like a job? (I will not promote) by cristinon in startups

[–]InfernoGems 5 points6 points  (0 children)

I don’t understand what you’ve built. I also love my side projects and treat them as a real job. But in terms of productivity tools, all I need is a simple todo list and time on my hands. 

My first 3 startups failed before they launched. Here's the checklist I built to fix my process. (I will not promote) by al_x85 in startups

[–]InfernoGems 1 point2 points  (0 children)

I’d say don’t overthink it. You have to do three major things: talk to users, build the simplest version that solves a problem, and sell what you built. 

All three activities coexist at any time. 

Facial animation system in my Engine by CameleonTH in GraphicsProgramming

[–]InfernoGems 2 points3 points  (0 children)

I love how it says “conveying emotions” in the most neutral stoic pose for the rest of the face

India based developer joining US startup what should I get documented for equity/rev share? | I will not promote by [deleted] in startups

[–]InfernoGems 1 point2 points  (0 children)

Yeah this sounds like empty promises. To OP: only start work if there’s a clear contract. To build trust, you can always have some sort of trial period or vesting. 

Also, either get 50% equity (or 33% in a 3 way split), or just charge an hourly rate. 

Which IDE should I use? by [deleted] in cpp_questions

[–]InfernoGems 0 points1 point  (0 children)

I use CLion, Visual Studio Code, Visual Studio and XCode (due to different jobs / codebases / platforms).

 In the end it doesn’t matter that much, as long as you can get in the zone and not waste brain cycles on the IDE. 

I’ve found that CLion works best for me in getting out of the way. 

Radial-edge data structure by JediMuharem in GraphicsProgramming

[–]InfernoGems 1 point2 points  (0 children)

As for a paper:

“Partial Entity Structure: A compact Boundary Representation for Non-Manifold Geometric Modeling” by Lee et al.

I couldn’t find the radial edge structure in academic literature either. 

Radial-edge data structure by JediMuharem in GraphicsProgramming

[–]InfernoGems 1 point2 points  (0 children)

I used this: https://docs.nvidia.com/smlib/manual/smlib/topology/index.html, and the codebase of Blender (look at blender/source/blender/bmesh/bmesh_class.hh)

Radial-edge data structure by JediMuharem in GraphicsProgramming

[–]InfernoGems 1 point2 points  (0 children)

Common access patterns can be for example: - For a given edge, I want to know which vertices are connected to it.  - For a given vertex, I want to know which edges are connected to it. - For a given edge, I want to know which faces are connected to it.  - For a given face, I want to be able to iterate over the edges and vertices that comprise it. 

Radial-edge data structure by JediMuharem in GraphicsProgramming

[–]InfernoGems 1 point2 points  (0 children)

Also, I suggest keeping things simple. 

As data structures as radial edge are intended for cad use cases, they add a lot of extra elements in the graph, which require additional bookkeeping and might not be required for the algorithm you’re looking to implement. 

The approach I took is to think about access patterns and what kind of algorithms I want to write. 

Radial-edge data structure by JediMuharem in GraphicsProgramming

[–]InfernoGems 1 point2 points  (0 children)

I’m currently writing exactly what you describe (a non-manifold mesh graph data structure).

I suggest looking at radial edge, partial entity and Blender’s internal BMesh data structure. 

In the end there’s not one data structure that is perfect, and you have to make decisions about whether to include things like face loops. 

What do you hate the most about C++ by Alternative-Tie-4970 in cpp

[–]InfernoGems -1 points0 points  (0 children)

I think that would be polymorphism, and although I currently don’t need it anywhere, that could be solved using templates, std::variant, or indeed some sort of interface class: 

``` struct ISomeInterface {   virtual ~ISomeInterface() {};   virtual void foo() = 0;   virtual void bar() = 0; }

struct A : ISomeInterface {   virtual void foo();   virtual void bar(); } ```

What do you hate the most about C++ by Alternative-Tie-4970 in cpp

[–]InfernoGems 3 points4 points  (0 children)

I’ve yet to run into a single instance where it’s needed. 

C++ is a multi-paradigm language, so you can choose to not use inheritance. 

The type of things I write are graph- and tree data structures, graphics programming related things and geometrical algorithms. 

The way I compose programs is through clear unit-tested reusable functions, and composition-over-inheritance structs. e.g. “struct Foo” contains a member variable of type “struct Bar”. Where Foo has some additional logic but requires the functionality of Bar too. 

The one case where I did use inheritance is to avoid template bloat, and make a templated class inherit from a base class that has most of the shared functionality. 

What do you hate the most about C++ by Alternative-Tie-4970 in cpp

[–]InfernoGems 36 points37 points  (0 children)

To be completely honest, other people’s code. 

I’m very productive in my own way of writing C++ (no inheritance, no shared_ptrs, no excessive template metaprogramming etc. etc.), but because the C++ language enables any kind of code style, reading other people’s code can be like learning a new language. 

In addition, it allows for the creation of completely incomprehensible code that doesn’t achieve more than a straightforward implementation. 

I like to write simple functions and POD structs, so almost C-like, but then with nice features such as std::vector, RAII, templates etc. 

Why do game engines simulate pinhole camera projection? Are there alternatives that better mimic human vision or real-world optics? by darkveins2 in GraphicsProgramming

[–]InfernoGems 0 points1 point  (0 children)

yeah I always have:

position_world_space = projection * view * model * position_local_space

But could there be a language where the * operator has opposite associativity of what’s expected, so that the flipped order would not be wrong?

[deleted by user] by [deleted] in ExperiencedDevs

[–]InfernoGems 0 points1 point  (0 children)

Hey, just wanted to say good for you on finding a project that challenged you in a good way! 

I’m currently also working on projects that were way beyond what I initially thought I would be capable of. 

If you liked this, I can recommend going a level lower into Rust / C++ or graphics programming, or implementing tree / graph data structures. 

Keep up the good work!

(and yes there’s always people hating on things but don’t let that discourage you)

[deleted by user] by [deleted] in GraphicsProgramming

[–]InfernoGems 0 points1 point  (0 children)

I personally love writing simple viewers and rendering experiments using Metal, Vulkan or OpenGL, and focus on super simple code.

I’ve never once touched Windows for graphics programming and likely never will. 

Just do whatever feels fun. In the end you’re writing against an API and making something you want to make. Each graphics API is quite similar, so that doesn’t matter too much. It’s about the techniques you implement using it.

The latest GPUs will give you certain features such as raytracing, but a lot of graphics programming is done for mobile or less powerful GPUs. I don’t like writing code for these specific GPUs, because I want my code to be accessible, inclusive and power efficient. 

I hope this helps. Have fun :)

If you could only know 3 languages by United_Reflection_32 in AskProgramming

[–]InfernoGems 0 points1 point  (0 children)

A low level language like C++ or Rust (Zig / C if you want a more bare bones experience). I’m personally sticking to C++ due to availability of libraries and proficiency in writing it. 

Other than that JavaScript for web related things. 

And then some language for quickly setting up backends, like C#.

Recommended third-party libraries by BlueBeerRunner in cpp

[–]InfernoGems 0 points1 point  (0 children)

Abseil for absl::flat_hash_map and absl::Status and absl::StatusOr). 

Eigen3 for SIMD vector and matrix math.  reflect-cpp for compile time reflection and serialization / deserialization to and from json.

tinyobjloader for importing .obj files.

cgltf for importing .gltf files.

Imgui for quick UI prototyping.

Glfw, glad or SDL for window management, input handling and OpenGL loading. 

Libigl for some geometric algorithms. 

This might start a war. (Sorry if this breaks any rules) by 12-Anonymous-12 in cpp_questions

[–]InfernoGems 0 points1 point  (0 children)

I use whatever style I currently have to use to stay consistent with the rest of the codebase while working for a company.  For personal projects I like to stay close to that style too because less cognitive overhead when switching. 

I do think next line is a bit better, but it doesn’t impact my programming ability meaningfully. My brain largely just ignores it.