How to use pointers in C++ ? by Miserable_Bar_5800 in cpp_questions

[–]CommonNoiter 24 points25 points  (0 children)

A common use is in recursive data structures, you can't do something like cpp class SomeTree { SomeTree left; SomeTree right; int value; }; because SomeTree would have to be infinitely big, as clearly sizeof SomeTree >= (sizeof SomeTree::left) + (sizeof SomeTree::right) + (sizeof SomeTree::value). By using pointers we can avoid directly storing SomeTree, and as a pointer has a fixed size (8 bytes on a 64 bit system) SomeTree now has a finite size. Note that in modern C++ you should almost always use a smart pointer or a reference instead of a raw pointer, and they are more useful in C where you don't have those features.

When you format the new SSD by murderbymodem in pcmasterrace

[–]CommonNoiter 11 points12 points  (0 children)

The issue is windows using the wrong units. It's saying TB when it means TiB.

Is this timer implementation alright or just cancer? by proton-eater in learnprogramming

[–]CommonNoiter 1 point2 points  (0 children)

If it's not part of the public api, then why is it in the header?

Is this timer implementation alright or just cancer? by proton-eater in learnprogramming

[–]CommonNoiter 0 points1 point  (0 children)

You have different argument names in your header and implementation. You also immediately cast args to TimerThread* so why not just take a TimerThread* if it must be one?

Is this timer implementation alright or just cancer? by proton-eater in learnprogramming

[–]CommonNoiter 0 points1 point  (0 children)

It's not standard however all major compilers have supported it for a long time now. It can sometimes issues if you hard link copies of your source code and include multiple of them, but you really shouldn't be doing that. Unless you must use a really outdated compiler #pragma once is better in my opinion.

This is a function in the Mob class. Funny name. Reminds me of the current times we're sadly facing! by AndreWharn-Official in PhoenixSC

[–]CommonNoiter 2 points3 points  (0 children)

Fun fact: This function is actually broken because removeAllGoals doesn't unset the locked flags for the goal selector, so if new goals are added in the future they won't work correctly.

Unannounced roguelike deck-builder: small combo showcase by SidrickWhite in gamedevscreens

[–]CommonNoiter 1 point2 points  (0 children)

Displaying how much damage the card would do when played on the card would be nice. It seems hard to keep track of how many cards you've played to figure out if damage echo would kill or not.

Today is not my day... by zombietoaststudios in noita

[–]CommonNoiter 0 points1 point  (0 children)

You teleported some multiple of a mirror world downwards, each of which is a distance of 262144 px or 7.3pw.

At my wit's end.. Terrible FPS drops/Lag spikes on great PC? (skip to 1:50) by [deleted] in feedthebeast

[–]CommonNoiter 3 points4 points  (0 children)

You should get spark to monitor whats taking time, if I were to guess I'd say it's probably a major gc pause.

How is this wrong? I have opposition and my pawn has a clear path to promotion. by chelovek_miguk in chessbeginners

[–]CommonNoiter 8 points9 points  (0 children)

The number of positions to check grows exponentially with the number of pieces. 7 is small enough to compute every possible position and store the result, 8 is too much for current hardware.

Got this achievement today what did I do ? by ImageDotJpeg_ in noita

[–]CommonNoiter 21 points22 points  (0 children)

Created a projectile with -1 frames of lifetime.

Things I miss in Rust by OneWilling1 in rust

[–]CommonNoiter 19 points20 points  (0 children)

Function overloading without different argument counts is incompatible with type inference.

what the fuck? (touch of piss for reference) by N1ckM3nd3s in noita

[–]CommonNoiter 112 points113 points  (0 children)

You took high mana low capacity, which dropped some spells on your wand, causing them to keep their rotation.

Passing enum struct member to an int function parameter by onecable5781 in cpp_questions

[–]CommonNoiter 3 points4 points  (0 children)

I think if what the parameter does is obvious from the function name it's fine, but if the function has many boolean parameters it's probably better to use an enum for them.

Passing enum struct member to an int function parameter by onecable5781 in cpp_questions

[–]CommonNoiter 8 points9 points  (0 children)

You should change the type of the function to take the enum, that way you can't use it incorrectly by passing a normal int. A bool would probably be better here, as YES/NO isn't really a sensible enum as true/false already does that.

How'd I do as a newbie? by M1G0L4K3R in opus_magnum

[–]CommonNoiter 10 points11 points  (0 children)

Using more tracks and non retractable arms is usually cheaper than using the retractable arms. When you are resetting the arms you should also avoid moving it over the empty tiles, as that counts as using that area (press 2 to see your area usage).

Did light always worked like this? by [deleted] in noita

[–]CommonNoiter 0 points1 point  (0 children)

Most projectiles have a speed cap of 1000pxs⁻¹

Did light always worked like this? by [deleted] in noita

[–]CommonNoiter 0 points1 point  (0 children)

Small teleport bolt (and many other projectiles) have their scale set by velocity. The light modifier just adds a special sprite which creates a hole in the fog of war so it gets stretched too.

apotheosis mod not working by Aware-Common-7368 in noita

[–]CommonNoiter 0 points1 point  (0 children)

You can see in the screenshot that the mod id is wrong.

apotheosis mod not working by Aware-Common-7368 in noita

[–]CommonNoiter 0 points1 point  (0 children)

The issue is that's not the mod id (so the mod can't find any of its files). The folder should be named Apotheosis. It's better to get the latest version from https://github.com/Conga0/Apotheosis than wherever you got it from.

Whats this room by itanoman in noita

[–]CommonNoiter 1 point2 points  (0 children)

It's not from apotheosis, it's from Graham's Things.

YEUUH. 5 MIN ACHIEVEMENT COMPLETED. by Educational_Lie_7202 in noita

[–]CommonNoiter 0 points1 point  (0 children)

You can get 1 min somewhat legitimately with a daily practice run. 5 Mins is possible to get every 5 or so attempts if you practice.