Skip Navigation

User banner
Posts
15
Comments
647
Joined
2 yr. ago

  • I've achieved something today. Not anything useful, but still something.

  • Browser-based notifications are easy to turn off, and it's probably the only way to get a message on a desktop PC without subscribing to email or using RSS. Also you don't need to install an app on your phone.

  • Password strength is usually checked inside your browser, not on the server.

  • But it's very convenient! When you have a BSOD, you don't need your core dumped, you simply unplug your DRAM+ and send it to Microsoft using paper mail.

  • 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

  • To separate is to part, not to pert. Easy.

  • I wouldn't put it past ancient China palace regulations. They worked really hard to differentiate themselves from commoners. In the brothel scene they all bathed naked, including Maomao.

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

  • It's way less expensive for state-sponsored hackers to blackmail your country's official to leak backdoor keys than try to break the unbreakable crypto using a nuclear-powered GPU farm.

  • Synchronous translators are still very much in demand, as well as technical and legal translators.

  • Sometimes I'm searching for a recipe to some obscure Linux tool and finding my own answers on Stackoverflow from ten years ago.

  • We have WSL, it's good enough

  • Still no 5GHz WiFi. Also, a blatant ripoff connector compatibility of Raspberry PI.

  • As long as your byte consists of 8 bits.

  • Saving arbitrary metadata is the exact use case for pickle module, you just put it together with your numpy array into a tuple. jpeg format has support for storing metadata, but they are an afterthought like .mp3 tags, half of applications do not support them.

    I can imagine multichannel jpeg to be used in photo editing software, so you can effortlessly create false-color plots of your infrared data, maybe even apply a beauty filter to your Eagle Nebula microwave scans.

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

  • You can achieve this with apps like Next Track or Volumee and a regular Android phone. Or you can buy a phone with extra buttons, but the button mapping function depends on the manufacturer's Android skin, so the quality varies.

  • What, pickle.dump your enormous Numpy array not good enough for you anymore? Not even fancy zlib.compress(pickle.dumps(enormousNumpyArray)) will satisfy you? Are you a scientist or a spectral data photographer?

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