Skip Navigation

User banner
Posts
5
Comments
391
Joined
2 yr. ago

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

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

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

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

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

    1. Type letter 'c' using the text tool, as you've already done
    2. Create a new layer from text
    3. Duplicate layer
    4. Transform - flip horizontally
    5. Merge two layers

    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.

  • We want to inhibit when running stuff like pacman, wget, cp or mv

    There is already a separate systemd-inhibit command that does exactly what you need. Trust your users, they are capable of googling it (most of the time).

    Only pacman and wget will benefit from suspend inhibition, because it will prevent breaking network connections. cp and mv will resume working just fine even when you hibernated your laptop while cp was executing. And in that case it's less bug-prone to scan your system for active TCP connections to external addresses instead of adding a hack wakelock inside your terminal or inside wget.

    It is also a poor idea to mess up with system-wide settings from some command when the user does not expect it, you'll likely to get a thousand invalid bug reports that sleep mode is broken when some service randomly decides to use wget to continuously read from local Unix socket.

  • Yup. Now we have long-range WiFi filling that niche.

    • They split off from Google.
    • They are not using satellites, they shine a lazer from one fixed tower to another, with range about 20 km.
  • That's because the article that started the whole argument tried very hard to present an expected behavior for embedded chips as a security hole.

  • Linux desktop on Android have been attempted many times with variable success, and it goes way beyond command line, see UserLAnd

    It brings all Linux desktop apps to your phone, and all you need is Bluetooth mouse.

    Do you need to edit an audio file? Try looking on Play Store, every audio editor has ads and subscription and offers only cropping and equalizer. But what if you need cross-fade? Open your Linux VM - bam! Audacity! All the audio editing tools you can ever need, and ten times more that you'll never use!

    Do you need to make a meme? Go download some shitty meme maker from Play Store, that will only let you add text to ten preset images. Or get a photo editor that has twenty sepia effects but won't let you combine two images. But a simple sudo apt-get install gimp command in your Linux VM, and you get a pixel-perfect image editor with transparency support, layer support, and a thousand brushes, and you can even plug a graphics tablet into your Android tablet and have stylus pressure making brush strokes of different width, or just use an Android tablet with stylus support, the pressure works there too.

    Do you want some more esoteric thing like sqlite3 database viewer? Well, Linux VM is your only choice.

    It becomes even more important if you want to buy a cheap Android tablet and ise it as a kiosk for some business. Run the backend server on your Linux VM, run the frontend in the Android web browser, and you don't need to buy an expensive POS terminal.

  • Nope. You'll only know how good is it when you run it on the actual hardware. Yeah you can install apps on Android emulator, but what makes or breaks custom ROM is driver support on actual hardware.

  • Permanently Deleted

    Jump
  • Should have used three spreadsheets. Excel tends to run slowly when a spreadsheet has more than a million cells in it.

  • There was no mention of over-the-air exploit, so eh.

  • Anyway, having direct unprivileged R/W access to platform memory is indeed a security hole, no matter the vendor.

    It is not. ESP32 is an embedded chip with less than one megabyte of RAM. It cannot run apps or load websites with any malicious code, it only runs the firmware that you flash on it, nothing else, and of course your firmware has full access to every chip feature. If your firmware has a security hole, it's not the chip's fault.

  • My bad, I was talking about custom tabs, which are provided by Chrome or Firefox.

    WebView is a separate app, and you can switch between WebView and custom tabs somewhere in system settings.