WTF Bites


  • Banned

    @cvi said in WTF Bites:

    @Gąska said in WTF Bites:

    everybody expects argv[0] to always be the executable name and argv[1] through [argc-1] to be arguments as provided by the user.

    The fact that it doesn't maintain argv[0] is problematic, agreed. That said , it's not uncommon for e.g. frameworks to do something like this (perhaps with less suck in the implementation). Command line arguments are first passed to the framework code, and the framework will inspect the arguments for options it knows, and then strips them out such that the rest can be processed by the application-code. (But argv[0] should still be the executable path, and [1.. adjusted argc-1] the application's command line options).

    The difference is that frameworks usually copy the arguments to new data structures, not modify them in-place.

    @Gąska said in WTF Bites:

    Except this kind of iteration is itself unnatural. Especially when you have element count rather than a delimiter.

    Again, for the better or worse, C++ frequently uses iterators/iterator ranges, which you iterate by incrementing/advancing an iterator until you reach your target. Pointers are just a special instance of that. With that I'd claim the exact opposite, this is very common in C++.

    How often do you write for (auto it = begin(c); i > 0; --i, ++it)?


  • Considered Harmful

    @error_bot !xkcd spacebar


  • 🔀



  • @Gąska said in WTF Bites:

    The difference is that frameworks usually copy the arguments to new data structures, not modify them in-place.

    No, point is that the framework modifies arg[cv] such that the client application doesn't see the command line arguments handled by framework. (That they keep the parsed-out data somewhere else is besides the point.)

    How often do you write for (auto it = begin(c); i > 0; --i, ++it)?

    If you have a count and a random access iterator, you might instead figure out end and, in the loop, increment it until it matches `end (more typically you get the end iterator from the get go, rather than the size.). But what you just posted is what you need to do if you don't want to make additional assumptions on iterator type (e.g., have something that works with e.g. an input_iterator/input_or_output_iterator).


  • Discourse touched me in a no-no place

    @Gąska said in WTF Bites:

    The difference is that frameworks usually copy the arguments to new data structures, not modify them in-place.

    Some frameworks do that. Some don't. But the argc--;argv++; is local to the current function; it doesn't modify the location array itself, or its size, or even any of its contents, but rather just the current function's idea of where the array starts and how big it is. The caller need not care.

    If the function wanted to know where the original argv[0] was after doing that, it would have to keep a pointer to it (or reference in C++). Usually you don't move up the array start until after you don't need that any more, but it is legit to do so.

    Far dodgier are the old C tricks for doing string handling. Some of those are really gross.


  • BINNED

    Bildschirmfoto 2022-03-05 um 18.39.24.png

    Thanks, you moron, that's very helpful!
    And of course cue the people who tell you that a backup on an internal disk is not really safe, even on an external one doesn't help you in case of fire, you absolutely need at least three off-site backups on at least two different continents.

    Look, I don't care for backups, I just want to turn on Time Machine so it does automatic snapshots, so you can go easily go back to previous versions. There's enough free space available on the disk, so use it.



  • @topspin Well, you did pose a closed question. I've learned very quickly not to do that with my pupils.


  • BINNED

    @Rhywden said in WTF Bites:

    @topspin Well, you did pose a closed question. I've learned very quickly not to do that with my pupils.

    It actually was just the first google hit, and not my post.

    ETA: what I really want to do is this, just without any external disk at all:


  • Discourse touched me in a no-no place

    @topspin said in WTF Bites:

    Thanks, you moron, that's very helpful!

    It's also mega-old so an actual answer would have likely been out of date as it predates APFS which supports snapshots which don't require any additional or external drives.


  • BINNED

    @loopback0 yes, that too. I guess a "thanks, Google" is also in order. 🍹



  • @Bulb said in WTF Bites:

    @Gąska said in WTF Bites:

    I'm pretty sure this is the reason why onboarding instructions specifically mention this one website only works in Chrome and Firefox. It's far easier to say that than to explain the actual problem.

    Using a different browser for things where you need to log in to a different account has been a standard operating procedure for many people I know since ages. I had two Chromium profiles for a while, but while they worked mostly nicely in Windows, they are a bit of pain in Linux and Firefox profiles are a bit of pain everywhere.

    So I now use Chromium with company accounts, Firefox with personal accounts, and a containerized Firefox (the container has a special proxy set up, because the customer VPN is special) with customer accounts (that can also be a Firefox, because it does not see the other instance from the container).

    And since my wife's company has split, she uses mostly Edge for the main work and one of the other browsers when she needs to log in to the systems with the parent company account.

    My company has a containerized Chrome for us to use (the last version that will still let you run Flash), because the older versions of our SaaS product require Flash for admin access.


  • Considered Harmful

    @topspin said in WTF Bites:

    Thanks, you moron, that's very helpful!
    And of course cue the people who...
    Look, I don't care for ..., I just want to ...

    The blakey is strong with this one.


  • BINNED

    @Gribnit said in WTF Bites:

    @topspin said in WTF Bites:

    Thanks, you moron, that's very helpful!
    And of course cue the people who...
    Look, I don't care for ..., I just want to ...

    The blakey is strong with this one.

    He wasn’t always wrong. :mlp_shrug:


  • Banned

    Gaming youtubers are running out of things to make videos about. They're desperately inventing dumber and dumber challenges to keep crunching those weekly videos. This one is probably the dumbest I've seen so far.

    beed8ad2-a712-41fb-8d9c-bdfbb393789b-image.png

    A.k.a. can you beat this 10 year old game using a very cheesy and overpowered method that even 10 years ago was recommended to new players because it lets you beat the whole game without learning to play it properly?

    Gee, I wonder if he succeeds.


  • Banned

    And today's winner of Server Maintenance :kneeling_warthog: Award is...

    0eaa5a70-a45e-4ac2-a751-935ce75db6f2-image.png



  • @djls45 said in WTF Bites:

    My company has a containerized Chrome for us to use

    👍

    (the last version that will still let you run Flash), because the older versions of our SaaS product require Flash for admin access.

    👎



  • @Gąska said in WTF Bites:

    And today's winner of Server Maintenance :kneeling_warthog: Award is...

    0eaa5a70-a45e-4ac2-a751-935ce75db6f2-image.png

    :womm:

    Somewhat related, for a few months one of my computers refused to validate the SSL certificates of some servers that worked just fine on all my other machines. It was just a handful of hosts, only on this machine, and no amount of updating, verifying system time, restarting or reinstalling did anything. But your post reminded me to check if it magically fixed itself, and it did


  • Banned

    @hungrier said in WTF Bites:

    @Gąska said in WTF Bites:

    And today's winner of Server Maintenance :kneeling_warthog: Award is...

    0eaa5a70-a45e-4ac2-a751-935ce75db6f2-image.png

    :womm:

    Because

    cdef0908-e9cd-46ac-bf3f-7b31f233baad-image.png


  • Discourse touched me in a no-no place

    @hungrier said in WTF Bites:

    Somewhat related, for a few months one of my computers refused to validate the SSL certificates of some servers that worked just fine on all my other machines. It was just a handful of hosts, only on this machine, and no amount of updating, verifying system time, restarting or reinstalling did anything. But your post reminded me to check if it magically fixed itself, and it did

    I'm guessing the problem was an expired root CA certificate. That's the downside with Let's Encrypt; all the certs on their chains expire pretty frequently, so extra effort is often required to work with them. (Not too big a deal with browsers — they handle this stuff for you — but much more of a problem for other apps with longer update cycles.)



  • @dkf said in WTF Bites:

    but much more of a problem for other apps with longer update cycles.

    Normally it's the operating system that should handle that for you, so client applications shouldn't have a problem. It's server-side apps—when they need to authenticate some peer servers across the internet—that the admins have to pay attention to this.


  • Banned

    "What is the middle name of your youngest child" is one of the dumbest "security" questions I've ever seen.


  • BINNED

    @Gąska said in WTF Bites:

    "What is the middle name of your youngest child" is one of the dumbest "security" questions I've ever seen.

    NULL

    They could’ve at least chosen oldest so it doesn’t change as often.


  • Considered Harmful

    @Gąska opens a vein,

    • "What's your oldest child's greatest fear?"
    • "What's the name of your youngest child's most trusted stuffed animal?"
    • "Which niche pornographic film are you trying to pretend not to have starred in?"
    • "How long have you been pretending to drive to work every day?"

  • Banned

    @topspin said in WTF Bites:

    NULL

    Doesn't seem to change very often for you :tro-pop:


  • I survived the hour long Uno hand

    @Gąska said in WTF Bites:

    "What is the middle name of your youngest child" is one of the dumbest "security" questions I've ever seen.

    How did you know my youngest child’s middle name was hunter2?


  • Discourse touched me in a no-no place

    @izzion Well, it was either that or ';DROP TABLE


  • BINNED

    @Gąska said in WTF Bites:

    @topspin said in WTF Bites:

    NULL

    Doesn't seem to change very often for you :tro-pop:

    365E97B4-F675-4E01-921E-3E25D42AF99C.webp



  • @hungrier said in WTF Bites:

    But your post reminded me to check if it magically fixed itself, and it did

    Haha, false alarm on that one. Turns out when I thought I checked it on that machine, it was actually one of my other ones where it was working all along. :womp_wah:


  • Grade A Premium Asshole

    So ~2-3 years ago we made a thing. A thing that was developed for the Chromebit. Shortly thereafter they discontinued all support for Chromebit so we retooled slightly and made it work on Raspberry Pi, because they're cheap and readily available and should always be supported. Right? Right?

    Well, one out of three isn't bad. That'll get you in to the majors. But it fucking sucks for me. When I can find them at all they are the base 2GB version for nearly $200. Just for the board.



  • I blame the worldwide component shortage because of the cryptoanarchist bullshit people.



  • @Polygeekery said in WTF Bites:

    When I can find them at all they are the base 2GB version for nearly $200. Just for the board.

    If you can tolerate a larger size, there's this:
    https://www.alliedelec.com/product/raspberry-pi/raspberry-pi-400-uk-/72117760/



  • Updated Firefox, restarted

    f819d75c-1a58-4c56-a39f-9f6d7b5c5f07-image.png




  • 🚽 Regular

    @HardwareGeek

    In this release, you’ll also see that Firefox no longer asks what to do for each file by default. You won’t be prompted to choose a helper application or save to disk before downloading a file unless you have changed your download action setting for that type of file.

    :wharrgarbl: :wharrgarbl: :wharrgarbl:
    :wharrgarbl: 🍊 :wharrgarbl:
    :wharrgarbl: :wharrgarbl: :wharrgarbl:


  • 🚽 Regular

    I might have jumped the gun.

    Depending on the current configuration, they will be saved in your preferred download folder, or you will be asked to select a location for each download.

    Still, is not infrequent that I want to open a file in the browser because it's text, or a PDF, or any of a number of other files that I can open in the browser should I choose to do so. I guess I'm going to lose this option.



  • @Zecc Previously, it would popup a dialog box to save the file or open it (saving to a temp dir and deleting). Depending on your setting, it would either ask you where to save it, or save it in your configured download folder.

    What would've been a great update: Add a "Save As" button to the dialog and get rid of the toggle in the settings, so you could either save to default location, save somewhere else or open it.

    What it does now: Just downloads it. :fu: user

    e: Or it always asks where to save. Not much better.



  • In conclusion, I wish there was any good browser



  • @hungrier I'll take even a halfway not crap one at this point.


  • 🚽 Regular

    I've kept reading (:doing_it_wrong:).

    It will still be possible to configure it to Always Ask, except it's per file type and it will be reset during the update.



  • @Zecc said in WTF Bites:

    I might have jumped the gun.

    Depending on the current configuration, they will be saved in your preferred download folder, or you will be asked to select a location for each download.

    Still, is not infrequent that I want to open a file in the browser because it's text, or a PDF, or any of a number of other files that I can open in the browser should I choose to do so. I guess I'm going to lose this option.

    That's why I have an “Open In Browser” extension installed (in Firefox; didn't bother for Chromium, but I think it exists there too). The UI is a bit ugly though, because it can't override the built-in dialog, so it first pops up its, with the extra options, and then the browser one still pops up.


  • 🚽 Regular

    @Bulb I had that one at some point too. I'm not sure why I've stopped using, but it's likely because at some point I stopped needing it.

    I might have to start needing it again.



  • @Bulb Does the extension only do open in browser, or can it also save default/save as? If so then it might be suddenly useful in conjunction with the "never ask" option



  • @hungrier Yeah. 97.0.2 released. Then 3 days later, they released 98. Which then reset the download option. FUCK YOU, I HATE FF's PDF handler. And, no, I like being prompted for what to do with a file because I do different things based on the file. (Some PDFs I just want to browse/print. Some I want to save.)



  • @hungrier said in WTF Bites:

    What it does now: Just downloads it. :fu: user

    e: Or it always asks where to save. Not much better.

    You can configure it per-type to prompt.



  • @dcon That sounds even worse, especially if it gets reset whenever the browser updates, as mentioned ⬆



  • @hungrier said in WTF Bites:

    @dcon That sounds even worse, especially if it gets reset whenever the browser updates, as mentioned ⬆

    I'm 🤞 that it only pertains to the v98 update. Guess we'll know in just a couple days...



  • @dcon said in WTF Bites:

    @hungrier said in WTF Bites:

    @dcon That sounds even worse, especially if it gets reset whenever the browser updates, as mentioned ⬆

    I'm 🤞 that it only pertains to the v98 update. Guess we'll know in just a couple daysminutes...

    FTFFF



  • Just wait until we have browsers self-identifying as v99.100 because actually going to 100 would break things.


  • BINNED

    @Zecc said in WTF Bites:

    I've kept reading (:doing_it_wrong:).

    It will still be possible to configure it to Always Ask, except it's per file type and it will be reset during the update.

    Because who needs to keep their settings, anyway, right?
    By now I assume most Mozilla employees started working there later than when I first set up my firefox at work, which is almost ten years now. And every time I start it, it pops up an annoying banner of "It looks like you haven't started Firefox in a while" (which is obviously a lie) and wants me to reset everything. Um, no, I don't want to lose my stuff, TYVM.

    (Of course there's some about:config hackery for it but :kneeling_warthog:)



  • @Arantor said in WTF Bites:

    Just wait until we have browsers self-identifying as v99.100 because actually going to 100 would break things.

    This isn't the "RSN" quote I actually wanted, since we know your RSN is actually RSN. But I found this and it required posting.

    b99c5b51-ec59-4b3f-8988-d67bbea0e452-image.png


Log in to reply