• 2 Posts
  • 141 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle





  • 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.



  • 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.







  • pelya@lemmy.worldtolinuxmemes@lemmy.worldOrwelluan
    link
    fedilink
    arrow-up
    2
    ·
    5 months ago

    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.



  • pelya@lemmy.worldtoLinux@lemmy.mlWhat is eg2gears-wayland?
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    7 months ago

    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.



  • 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.