std::vector<bool>
fits eight booleans into one byte.
std::vector<bool>
fits eight booleans into one byte.
Ah don’t worry, if you do fopen(file, "w")
on Windows and forget to use "wb"
flag, it will automatically replace all your \n
with \r\n
when you do fwrite
, then you will try to debug for half a day your corrupted jpeg file, which totally never happened to me because I’m an experienced C++ developer who can never make such a novice mistake.
It depends on whether you are printing to a terminal or to a file (and yes the terminal is also a file), and even then you can control the flushing behaviour using something like unbuffer
printf
is superior and more concise, and snprintf
is practically the only C string manipulation function that is not painful to use.
Try to print a 32-bit unsigned int as hexadecimal number of exactly 8 digits, using cout
. You can do std::hex
and std::setw(8)
and std::setfill('0')
and don’t forget to use std::dec
afterwards, or you can just, you know, printf("%08x")
like a sane person.
Just don’t forget to use -Werror=format
but that is the default option on many compilers today.
C++23 now includes std::print
which is exactly like printf
but better, so the whole argument is over.
As long as your byte consists of 8 bits.
Home-made tvorog is just cottage cheese without the temperature or fermentation control, you just let the fresh milk get sour and curd on it’s own then strain the curd. So it’s more acidic and less uniform.
The commercialy produced tvorog is made using the skimmed milk after most of the fat is extracted to make butter, so it’s like 1% fat and 10% protein. Cottage cheese keeps the fat content.
You can ‘fix’ tvorog to be more like cottage cheese by boiling it with fresh milk, it will remove much of the sourness and add back fat content.
Eh, who is still using paper books to learn programming languages? Every popular language has a website with online manuals.
Well, except C, because it’s crammed together with C++ on https://cplusplus.com/ and https://cppreference.com/
And socks just grow organically after 3 years of coding.
Being direct is good. But ‘too complex, refactor’ as an explanation is just one word longer than ‘fuck off’. You need to explain in detail why the solution is bad and which parts should be changed, in this case it just shows that the reviewer did not actually read the code.
It’s a basic GIMP knowledge, really. Don’t forget to add an alpha channel to your layer after step 2, otherwise it won’t work.
It’s because you now need to do systemctl restart sshd
instead of /etc/init.d/sshd restart
, I see no other reason than having to learn new syntax.
Arguably, init.d scripts were easier to understand, and systemd is a bit of a black box, it somehow works, but who knows where it writes logs or saves the process pid (it’s all in the documentation somewhere), with init.d script you can just open the script itself and look.
Jumping from loose-typed language to strict-typed language will be hard.
It’s also a matter of your general programming experience. Once you write, like, ten thousand lines of meaningful code in Python, learning C# should take you a month or two at most, you’ll know most programming concepts and algorithms intrinsically, and the rest is just learning syntax.
It’s just C++ without templates. So whatever element you want to put into std::list, it must virtually inherit std::list::value_type. And of course there will be a macro-based list monstrosity inside Boost.
it’s used to verify that OpenGL ES2 works on your system. It’s the variant of 3D graphics drivers that is used on smartphones. Many apps nowadays write their GFX frontend with GLES2 so it uses the same code on phones and PCs, and if they compile the app to run in the web browser, WebGL is also based on GLES2.
What about systemctl poweroff
?
I had the root canal done without an anesthesia, because I did not want a needle sticking into my gum.
It was tolerable, I did not cry or anything like. The nerve was mostly dead anyway.
The dentist took his sweet time removing the nerve piece by piece with a probe, instead of just drilling the whole tooth through. It did not matter at the end anyway, because he filled the canal afterwards. And the molar has three roots, so he repeated that two more times.
I guess it depends on your pain tolerance.
SDL2, with Android NDK, commandline version.
Inside the building it’s the first floor, even if it’s exactly at the sea level altitude. Outside the building it’s the ground. Basement levels start at minus one, there is no zeroth floor.
It flies, so I don’t get the joke. I’m an embedded developer BTW.