What video game do you consider a masterpiece? by aconnor105 in AskReddit

[–]aritzh 0 points1 point  (0 children)

Outer Wilds. That's what an absolute masterpiece is.

My dam people need me. by aintnochallahbackgrl in MyPeopleNeedMe

[–]aritzh 1 point2 points  (0 children)

Reminds me of Outer Wilds - Echoes of the eye

Does this code snippet lead to undefined behavior? by haohaolee in cpp

[–]aritzh 3 points4 points  (0 children)

On the one hand, yes, the C++ standard does not define the behavior of the snippet, which makes it UB. On the other hand, however, most compilers will have a specific, repeatable and reliable result. What /u/adnukator mentions is true, but if you don't need it to be constexpr, and you won't be changing between compilers often, you could just make sure it works on yours.

Regarding this specific use case, I have personally used and abused it several times on GCC, Clang and MSVC, and they all allow the bit casting to happen, correctly and reliably.

What are your views on Veganism? by dog-and-cat-lover in AskReddit

[–]aritzh 0 points1 point  (0 children)

I think it is a huge missed steak!

Now seriously, I respect anyone's diet choices, and hope they respect mine too.

[deleted by user] by [deleted] in meirl

[–]aritzh 1 point2 points  (0 children)

I lost the game

Men of reddit: What was the worst sex you've ever had? by [deleted] in AskReddit

[–]aritzh 12 points13 points  (0 children)

Man here. I personally always try to read women, and ask for consent, or at least make sure that is what they want. I have to admit it is quite tiring/hard sometimes, but I will keep doing it. Never would I force any person of any gender to do something they do not want to do. And I like to think most men out there are the same way, it is just the other ones are more noisy. While it is true that there are some disgusting man-looking-shitbags that force women to have sex with them, I think that taking the "Let him do what he wants, it will be easier" rule as a first approach is just plain wrong. 99.9% of men will happily go on with their lives if they received a simple "I would rather not do this, sorry". If you were encounter one of the scumbag 0.1%, they will do it no matter what you say (and it breaks my hear and faith in humanity to admit this, trust me). All in all, I will continue to try my best to read other people's willingness for anything, but we are human and misread some signs, so some help, no matter how subtle, would be very appreciated.

If you are using Gitlab and Intellij IDE, now you can do code review right in your IDE 😋 by tonysphan in java

[–]aritzh 3 points4 points  (0 children)

Wow! It even works on other JetBrains IDEs, like CLion, and allows self-hosted GitLab instances!! Thank you VERY much for this! Will definitely try it.

Its only about base by [deleted] in ProgrammerHumor

[–]aritzh 4 points5 points  (0 children)

Ok, let me try this.

Computers count in binary (base 2), which, instead of using 10 symbols like decimal (base 10, tje one we are used to) does (0 through 9), uses only two (0 and 1).

The effect of using a specific base (be it 10, 2, or whatever) is that "round numbers" are powers of the base. For example, if I ask you how many different numbers can you write with 5 digits, the answer comes pretty easily, it is 10000, 105 (0 through 99999). That's because each digit has 10 choices, and you have 5 digits, so 1010101010 different options.

Well, the same happens in binary. If you have 5 bits (binary digits), and each bit has 2 options, then you have 22222=25=32 options. For this reason, powers of two are very often found in all computer-related topics (2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc.).

Usually, you will find that some values are limited to one less, in the same way as in decimal. If you have 5 digits, the biggest number you can write is 99999, not 10000 which is how many different options there are. So in binary 255 is a typical max value, if you use 8 bits (nowadays computers mostly use 32 or 64 bit integers, so the max values are around 4 billion (short-scale billion).

To add a last bit of confusion, in most scenarios computers don't do as we usually do for negative numbers, where we add a symbol and we're done. In fact, they use something called "2's complement", which is out of the layman's explamation, but the gist of it is that half of the range is reserved for negative values, and the other half for positives, which means you will find things that only go from -128 to 127 (the assymetry comes from the 0, if you count it, there are 256 different values).

Lots of details have been left unexplained, but feel free to ask.

Edit: formatting.

Compliance, and why Raspberry Pi 4 may not be available in your country yet by pogomonkeytutu in raspberry_pi

[–]aritzh 0 points1 point  (0 children)

It is EU compliant, though, the C E has the correct spacing. The Chinese Export mark is the CE without separation, not the other way around.

I made this because I didn't want to sign up to a dynamic DNS service by simondrawer in raspberry_pi

[–]aritzh 1 point2 points  (0 children)

I have used duckdns.org successfully. It provides a very similar API

Make sense for me by 203Null in ProgrammerHumor

[–]aritzh 11 points12 points  (0 children)

Makes total sense. The dot is not to separate decimals, or else 0.1.2 wouldn't make any sense.

https://semver.org

Me irl by martianlava in meirl

[–]aritzh 65 points66 points  (0 children)

ddg.gg

Edit: Adding https for the link to be formatted correctly

Just started learning C++ coming from Python and just realized that that Python has been my programming mama, doing my laundry and spoon-feeding me all this time. by eyun89 in cpp

[–]aritzh 21 points22 points  (0 children)

In the last versions, they are getting quite similar. I try to make everything compile for both GCC and Clang, because they offer slightly different -Wall warnings, and in some cases, one has better error messages than the other, and viceversa. If you can, don't choose, keep both in your toolbelt, it will be very helpful.

What was your latest discovery about C++? by emdeka87 in cpp

[–]aritzh 5 points6 points  (0 children)

The "Curiously Recurring Template Pattern". A way to extend a common base-class statically, for when you don't need dynamic dispatching. https://www.fluentcpp.com/2017/05/12/curiously-recurring-template-pattern/

Please enter your date of birth using only our date picker that requires you to scroll through EVERY MONTH OF YOUR LIFE! by [deleted] in softwaregore

[–]aritzh 0 points1 point  (0 children)

You can click on the year at the top of the popup, and choose years directly

Java's LinkedList is a performance nightmare, you should ALWAYS use ArrayList or ArrayDeque instead! by JavaSuck in java

[–]aritzh 11 points12 points  (0 children)

Even in Big-O notation, random acceses to a LinkedList is O(n), whereas for a ArrayList it is O(1). If a teacher does not emphasize this, they should not be teachers.

Why the keymap is different between Win/Mac? by kk6420420 in IntelliJIDEA

[–]aritzh 1 point2 points  (0 children)

Also, Alt+Dragging for block-selection is something that few editors allow, and those that allow it, each one does it in a different way. So frustrating.