WTF Bites



  • @Gąska said in WTF Bites:

    @Zerosquare American doctors are big on opioids.

    There's been a big crackdown on it, recently, though, due to the excessive problems with addictions and overdoses.


  • Notification Spam Recipient

    @loopback0 said in WTF Bites:

    Get fucked

    That reminds me. My little brother (8) decided he needed to change his school account password. Guess what happened this morning?

    Yeah, we were looping around trying to reset his password because for some insane reason they didn't set a recovery email address and natch his new choices for security questions were gibberish.

    The actual password he chose? new#1234, apparently as described in the "how to choose a secure password screen.


  • BINNED

    <img [snip] oncontextmenu="var d = new Date(); alert('Copying Prohibited by Law - This image and all included logos are copyrighted by Shopper Approved \251 '+d.getFullYear()+'.'); return false;">
    

    Noooooo you can’t just right click on our 130 × 50 px graphic!!!!


  • 🚽 Regular

    @dcon said in WTF Bites:

    @loopback0 Well fuck. I can't have abacab?

    If I'm reading that right, you can't have hdUejqRN either. (q and R are consecutive) Or sR2jvu6A (three letters in a row)


  • 🚽 Regular

    @Tsaukpaetra said in WTF Bites:

    @loopback0 said in WTF Bites:

    Get fucked

    That reminds me. My little brother (8)

    :frystare:



  • @kazitor said in WTF Bites:

    Noooooo you can’t just right click on our 130 × 50 px graphic!!!!

    We were required to do something similar despite me pointing out that there are lots of ways to get at that image anyway, and it's just an annoyance. The WTF here is probably not on the developer.


  • Discourse touched me in a no-no place

    @kazitor said in WTF Bites:

    Noooooo you can’t just right click on our 130 × 50 px graphic!!!!

    The silly thing is that if you know the size of the image, setting it as a CSS background for an empty element does a better job of stopping access. (It doesn't actually stop access. Anyone with half a clue opens the developer console and just picks the thing out of the page assets. The only true way of stopping someone from getting the image is never giving it to them in the first place… or making the image out of a enormous number of 1×1 pixel divs and earning themselves a place on this site. 😆 )



  • @dkf said in WTF Bites:

    enormous number of 1×1 pixel divs

    and anybody with half a clue will simply cut it out of a screenshot…


  • Considered Harmful

    @dkf said in WTF Bites:

    enormous number of 1×1 pixel divs

    Or overlapping R G B divs with appropriate opacity!

    Obviously we care about performance, so we won't be generating it server-side. Instead we fetch image data with Ajax and generate those divs... wait a minute 🏆


  • 🚽 Regular

    @dkf said in WTF Bites:

    Anyone with half a clue opens the developer console and just picks the thing out of the page assets. takes a screenshot

    :hanzo:


  • Fake News

    @Applied-Mediocrity said in WTF Bites:

    @dkf said in WTF Bites:

    enormous number of 1×1 pixel divs

    Or overlapping R G B divs with appropriate opacity!

    Obviously we care about performance, so we won't be generating it server-side. Instead we fetch image data with Ajax and generate those divs... wait a minute 🏆

    That can still be captured in a screenshot.

    What about quickly alternating the R G B so that (hopefully) only the human eye blurs things together? Screenshot-proof and it might earn your site a "best viewed at 60 hertz" footer.


    Filed under: I shall now have to and go find the Evil Ideas Thread, won't I?



  • @JBert said in WTF Bites:

    it might earn your site a "best viewed at 60 hertz" footer.

    And "best viewed without photosensitive epilepsy", too.


  • Considered Harmful

    @JBert said in WTF Bites:

    blurs things together

    We have invented computers for that! Blur the image, then download and run a custom-trained ML image sharpening model on it to restore it every time the document loads.



  • @JBert said in WTF Bites:

    Filed under: I shall now have to and go find the Evil Ideas Thread, won't I?Temporal Dithering



  • @Zecc said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    @loopback0 said in WTF Bites:

    Get fucked

    That reminds me. My little brother (8)

    :frystare:

    Um, honey, about that 0.3% vasectomy failure rate...



  • @hungrier Status: It's still only happening on this one machine, but it seems to be more frequent.


  • Notification Spam Recipient

    @Zecc said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    @loopback0 said in WTF Bites:

    Get fucked

    That reminds me. My little brother (8)

    :frystare:

    It's an important man page!



  • @loopback0 said in WTF Bites:

    edit: This is a credit card company.

    EBCDIC RIDES AGAIN!

    @kazitor said in WTF Bites:

    Noooooo you can’t just right click on our 130 × 50 px graphic!!!!

    It's not fiscally responsible, but you could sue them for copyfraud. The copyright date is as of when the original image was created, not "present day no matter what".



  • @TwelveBaud said in WTF Bites:

    The copyright date is as of when the original image was created, not "present day no matter what".

    Create the image dynamically every time it is fetched; date created is always now(). Tada! Perpetual copyright.


  • BINNED

    @HardwareGeek said in WTF Bites:

    @TwelveBaud said in WTF Bites:

    The copyright date is as of when the original image was created, not "present day no matter what".

    Create the image dynamically every time it is fetched; date created is always now(). Tada! Perpetual copyright.

    That isn’t how it works. But then indefinitely prolonging copyright isn’t how a reasonable person would think “for limited times” works either, so you might just get away with it.



  • I wonder what kind of horror exists on the back-end to require this set of password restrictions:

    password-restrictions.png



  • @hungrier plain text password stored in XML that was generated starting with echo $PASSWORD" | genxml.sh

    Just wanted to make your nightmare more vivid.


  • Notification Spam Recipient

    Forgive my ignorance, but... aren't the objects passed in to event handlers copies? What is this code trying to do modifying an EventData object?

            private void OnLoadStartTimestampQueryEvent(ShellServices.LoadStartTimestampQueryEvent e)
            {
                e.LoadStartTimestamp = 0.0f;
    
                var restartState = _stateMachine.CurrentState as ShellStates.RestartGameState;
                if (restartState != null)
                {
                    e.LoadStartTimestamp = restartState.LoadStartTimestamp;
                    return;
                }
    
                var loadingState = _stateMachine.CurrentState as ShellStates.LoadingIntoGameState;
                if (loadingState != null)
                {
                    e.LoadStartTimestamp = loadingState.LoadStartTimestamp;
                    return;
                }
            }
    

  • Considered Harmful

    @Tsaukpaetra No reason to assume they would be. If there's a setter on LoadStartTimestamp, it can modify heck knows what (but likely the object which raised the event, i.e., this).


  • Banned

    @Tsaukpaetra I'm pretty sure normal function call semantics apply - primitives and structs are passed by value, objects are passed by reference. Since the event-sending logic can be completely arbitrary, the code might make sense in the context. As an example, some "cancelable" GUI events expose a modifiable boolean property in event object and you're supposed to set it to true/false so the sender knows it has to be canceled.


  • Notification Spam Recipient

    @Gąska said in WTF Bites:

    Since the event-sending logic can be completely arbitrary, the code might make sense in the context.

    Yeah, I suppose I'm not giving enough context.

    This handler is from a message pump that raises events from a received network stream that deserializes into these EventArgs objects, so the only thing that should be caring about the data should be the event receivers (i.e. the function pasted above), and as far as I know the event data (if modified) isn't then serialized and sent back over the network stream as a callback.

    I'll just put an assert(false) here and see if it blows up. :rofl:

    If nothing is raising those events then obviously I don't need to care about converting the contents of the function appropriately.

    I'm so glad I'm given so much leeway on this project. I've wacked several thousand lines of useless code already! And only several hundred of those lines were copy-pasta-with-one-line-changed sections!



  • Shared WTF between myself, Chromium and Microsoft Teams.

    Yesterday, pretty much out-of-the-blue, Microsoft Teams stopped receiving sound from my headset's mic. I'm not sure what happened, except that previously I had been using the "Default" device, which I could no longer select in Teams (it shows up in other places, like Discord -- I'm guessing Teams filters it if there are other options available).

    Now, in Chromium+Alsa, the default device is a bit special: it corresponds to the default device defined in the .asoundrc (Alsa configuration file). Additionally, Chromium+Alsa is a bit special, since it doesn't actually correctly enumerate the audio devices. All hardware devices end up being listed as Microphones, and there are no Output/Speaker devices, other than the special default one that's always added to either list. (The enumeration bypasses devices defined in the .asoundrc, which is also ... annoying.) Either way, the default devices work, so I didn't really care ... until now.

    Long story short: Microsoft Teams is now using the following Microphone
    microsux.png
    It's totally not a copy of the default device entry, just added a second time with a different name, I promise. 😠



  • @Tsaukpaetra Just take a look at CancelEventArgs...



  • @BernieTheBernie said in WTF Bites:

    CancelEventArgs

    I've heard of the arguments about cancel culture, but I didn't know it was event-based.


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    CancelEventArgs

    I've heard of the arguments about cancel culture, but I didn't know it was event-based.

    It's usually an overreaction to an event.



  • @cvi said in WTF Bites:

    Yesterday, pretty much out-of-the-blue, Microsoft Teams stopped receiving sound from my headset's mic.

    Hm, happened to me once or twice—and I do use pulseaudio—and fixed itself after restarting teams and/or pulling some plug and plugging it back in.



  • @Tsaukpaetra said in WTF Bites:

    aren't the objects passed in to event handlers copies?

    They can be modified, and putting things into event args parameters that are passed to your handler is quite a common pattern for allowing event handlers to 'return' things to the event source (e.g. allowing handlers to modify or prevent downstream behaviour).

    If the event source isn't looking at that information though - or if it's not being returned through the network so the real event source gets to see it - then it may be pointless in your case. But the problem is elsewhere, not here.



  • @Bulb said in WTF Bites:

    Hm, happened to me once or twice—and I do use pulseaudio—and fixed itself after restarting teams and/or pulling some plug and plugging it back in.

    For the record: I tried turning it off and on again (and a few other things) before I went ahead and patched the Chromium source to add the additional fake audio device entry. ;-)

    The problem really was that Teams filtered the Default audio device from its list of selectable devices. E.g. Discord or a WebRTC test page in a different tab would find and be able to use the device just fine.


  • 🚽 Regular

    @Bulb said in WTF Bites:

    @cvi said in WTF Bites:

    Yesterday, pretty much out-of-the-blue, Microsoft Teams stopped receiving sound from my headset's mic.

    Hm, happened to me once or twice—and I do use pulseaudio—and fixed itself after restarting teams and/or pulling some plug and plugging it back in.

    Skype has a tendency to deny the existence of my camera until I do a hard reboot. Meanwhile, "Camera" works just fine. :irate-shrug:



  • @Bulb said in WTF Bites:

    pulling some plug and plugging it back in.

    ERROR: No Magic Wand found on system.



  • @Tsaukpaetra Since EventArgs (and its descendants) are a reference type, changes are visible both to the code that raised the event (the message pump that presumably doesn't care?) and the other event handlers. The underlying multicast delegate is ordered, so if you know that this event handler is always called first, another event handler can make use of the changed data. However, it can be difficult to figure out in what order those registrations happen, so it's ... not recommended.



  • Just noticed this upcoming song on a youtube playlist

    2c966e51-d282-4cdf-9aa6-a3ec8b83b8cb-image.png



  • My :wtf: bite of the day: the linear algebra library I'm using in this project (Armadillo) has no way to easily avoid printing error messages on the terminal when a function fails, even though that function has ways to signal calling code that it is failing (i.e. it's not a critical error that's totally unrecoverable).

    Details:

    I'm trying to invert a matrix, and sometimes the matrix isn't inversible. In my case, that's actually fine because I know that this happens when some special conditions are met and I just need to handle that case a bit differently. But knowing that a specific matrix isn't inversible is not trivial (especially when it involves numerical accuracy e.g. it fails if the determinant is "small enough", but what that actually means is almost impossible to predict), so the easiest way to know that is to try and invert it, and let the code fail. When that happens, the function returns false (or throws an exception, depending on which one I'm using), so I just need to test that. Easy-peasy.

    Except that it fails and prints an error message on the terminal. Which I don't want to see as it is useless (I know it's failing, it just returned false!), it may confuse the user (the message containing about zero useful information), and it may also end up slowing things down when enough messages are written (i.e. in pathological cases where every call to this function fails...).

    So I can:

    1. add a global #define that will turn off all error messages, everywhere. Including other places where actually I would like very much to have those messages. I can do that in Release (actually many messages are already only shown in Debug, which is fine, but not this one...), but not really in Debug.
    2. add various tests before inverting the matrix to manually try and guess if it is inversible or not. But as I said, it's likely to never match exactly what the numerical code does, plus it's adding an overhead to the code (both in terms of lines of code, and in runtime!).
    3. wrap each and every single call to the inversion function by setting the error stream to a null stream and resetting afterwards to the previous one.

    I'm going for 3 at the moment.

    But it's boring and annoying.


  • Discourse touched me in a no-no place

    @remi said in WTF Bites:

    Except that it fails and prints an error message on the terminal.

    Seriously, printing a message should be the caller's job, not the baseline function, as they might (do, in your case!) have a better idea for what to do about the problem.


  • Discourse touched me in a no-no place

    @remi said in WTF Bites:

    invert a matrix

    ezgif-4-9b81a2a3acbb.gif



  • @dkf said in WTF Bites:

    Seriously, printing a message should be the caller's job, not the baseline function, as they might (do, in your case!) have a better idea for what to do about the problem.

    Yes, that's exactly my gripe with them! To add insult to injury, the message I get is some generic failure info of the form function(): matrix is singular or not positive definite which is totally useless to anyone but myself as the developer. Even to me it's close to useless as it doesn't say anything about which matrix, so it actually took me a while to find out which of the calls to that function was causing the message, and in which of the thousands of times it's called when running on my data, to diagnose the issue.



  • @remi said in WTF Bites:

    1. add a global #define that will turn off all error messages, everywhere. Including other places where actually I would like very much to have those messages. I can do that in Release (actually many messages are already only shown in Debug, which is fine, but not this one...), but not really in Debug.

    If you can do that with a define it means you are compiling the library and therefore should be able to delete the offending log statement, no?


  • Java Dev

    @remi said in WTF Bites:

    wrap each and every single call to the inversion function by setting the error stream to a null stream and resetting afterwards to the previous one.

    There are ways to intercept stream output and post-process it, though in this case that would probably still involve parsing human-translated text. This would allow ignoring this specific error (possibly in this specific situation) and passing on the rest, possibly with extra annotation of where the error arose.

    On linux, I know of pipe, fmemopen, open_memstream, and fopencookie. Note pipe is definitely the most portable of those, and I have no clue on the windows situation.



  • @Bulb that's true, but I don't like fiddling with the source code of 3rd-party libraries. It's the kind of things that you forget when you upgrade to a newer version (or where your patches break at some point), plus it requires digging into the internals.

    Also it would entirely remove the message from all calls to that function -- which wouldn't be a bad thing because really, having that message hard-coded isn't convenient, but at the same time there are other places I call the function where I'm not expecting it to fail so I'm less opposed to having the message in those cases (since they indicate something that's really a bug, not just an edge case that is properly handled somewhere else).



  • @PleegWat that sounds... overly complicated, when there are already functions available to get and set the error stream!

    Still, you get points for creativity, I guess. 👍



  • @remi said in WTF Bites:

    that sounds... overly complicated, when there are already functions available to get and set the error stream

    Well, this is WTDWTF. What did you expect?



  • @Zerosquare
    blakeyrat: I didn't ask for help!


  • Java Dev

    @remi said in WTF Bites:

    @PleegWat that sounds... overly complicated, when there are already functions available to get and set the error stream!

    Still, you get points for creativity, I guess. 👍

    The point of those would be to allow finer control than merely having errors on or off. Though I agree it's probably overkill. And as mentioned, it would involve parsing output intended to be human-readable, which I am not generally a fan of.



  • @PleegWat I'm still not sure what would be the point compared to changing the error stream around the offending call. To parse the output you need to know exactly what the message looks like i.e. which function writes it, so why not wrap the call to that function directly and instead defer that to a global handler that's very far from the call?

    OK, I guess if I was calling the function in several places in the code, and wanted to suppress messages in all calls, then intercepting the messages would require writing the catching code only once, as compared with many times if I have to wrap each call in set/reset error stream. But in my case it's the opposite, there is only one of those calls where I want to ignore the message, so I would have to add some special logic to that catching code to distinguish between call sites.



  • @remi said in WTF Bites:

    @Bulb that's true, but I don't like fiddling with the source code of 3rd-party libraries. It's the kind of things that you forget when you upgrade to a newer version (or where your patches break at some point), plus it requires digging into the internals.

    Rough sack needs a rough patch they say.

    I've been applying patches to 3rd party dependencies in every other project. If you do it as a patch during the build, after update it will either apply and almost certainly work too, or fail obviously and you update the patch. Most Linux distribution packages do it too, so it's not exactly unusual.

    Of course if you find yourself working for $BigCorpLLC::DeptA and find the build system patches base component provided by $BigCorpLLC::DeptC while $BigCorpLLC::DeptC is both a system integrator of the overall project and maintains the system for the target hardware, it's a definite :wtf: (partially caused by the fact that people in $BigCorpLLC::DeptA didn't really understand $buildSystem a iota and $BigCorpLLC::DeptC people understood it only a iota despite having support from developers of $buildSystem).


Log in to reply