WTF Bites


  • 🚽 Regular

    What am I failing to see here? :wtf_owl:

    9036f5c5-447a-45bc-9030-51cf6b692542-image.png



  • @Zecc The default length of char and varchar is 1 when not explicitly defined, so your last check is, effectively, 'blah' = 'b'.


  • BINNED

    Digging through some coworker's Matlab stuff.

    The Matlab GUI seems to be implemented in some funky mixture of Java and Matlab itself. While code is running in the command window, you can't open files in the editor. There's a tree view that shows files in the current folder, but double clicking a file there just gives you a wait cursor while it waits for the currently running stuff to finish.
    I guess there's some funky global lock going on and it's trying to execute internal Matlab stuff in the same engine that's running user code? Or something equally :wtf:.


  • 🚽 Regular

    @ChaosTheEternal I just tried the following test

    declare @tmp table (a varchar, b varchar(max));
    insert into @tmp (a,b) values ('test', 'test');
    select * from @tmp where a = b;
    

    to see whether it would select the row or not.

    I did not expect it to fail with "Data would be truncated".

    https://docs.microsoft.com/en-us/sql/t-sql/data-types/char-and-varchar-transact-sql?view=sql-server-ver15#remarks says:

    When n isn't specified in a data definition or variable declaration statement, the default length is 1. If n isn't specified when using the CAST and CONVERT functions, the default length is 30.

    Wow.



  • Slack

    Sometimes (seems like more than half the time, recently), it fails to register that I've read a message, even when clicking away and back to it, replying to the message, etc. And then, if it was a PM, it'll send me an email after a couple minutes telling me about the message that I've already read, as if I hadn't seen it. Like a less consistent version of 👃👶's notifications



  • @topspin said in WTF Bites:

    I understood approximately zero of those words.

    I suppose you were not trying to deploy any new internet applications into the ‘cloud’ in last about four years.



  • @ChaosTheEternal said in WTF Bites:

    @Zecc The default length of char and varchar is 1 when not explicitly defined, so your last check is, effectively, 'blah' = 'b'.

    Long live the principle of most surprise.

    @Zecc said in WTF Bites:

    I did not expect it to fail with "Data would be truncated".

    At least it returned an error and did not silently truncate the data like some other databases.

    @Zecc said in WTF Bites:

    declare @tmp table (a varchar, b varchar(max));

    Bonus :wtf:: ❄ syntax.



  • @TwelveBaud said in WTF Bites:

    ...or that you have a gazillion "Local Disk"s.

    Doesn't everyone have 10+ drives these days? This one has 11:

    • C: Boot SSD.
    • D: Blu-ray multidrive.
    • E:, F: Internal hard drives.
    • G:, H:, I:, J: Card readers.
    • K:, L:, M: External USB drives.


  • @Parody said in WTF Bites:

    @TwelveBaud said in WTF Bites:

    ...or that you have a gazillion "Local Disk"s.

    Doesn't everyone have 10+ drives these days? This one hasgoes up to 11:

    TISTTFY



  • Another minor WTF from my work Linux VM: Sometimes, the Lounge background doesn't show up. This is extremely dangerous to our democracy


  • Notification Spam Recipient

    Status: This SD-Card compatible guitar amplifier/MP3 player put the Format SD Card function in the Save menu. Thoughts?

    Before the format I was able to crash the thing simply by asking it to access the card. Funniest shit I saw today.


  • 🚽 Regular

    @Bulb said in WTF Bites:

    At least it returned an error and did not silently truncate the data like some other databases.

    Except the only reason I ended testing that was I had already spent half an hour trying to understand why a complex query wasn't returning any results even though it seemed correct. There was no such error then.

    The kicker was the query was correct, because its data types had correct sizes. Only my testing was borken.



  • @topspin said in WTF Bites:

    The Matlab GUI

    :doing_it_wrong: :doing_it_wrong: :doing_it_wrong:

    I think there should be a support group for people like me who cut their teeth on Matlab. But to be fair, the "click to insert breakpoint" was a game changer for me, and I hated that IDE's I used for other languages didn't have it


  • BINNED

    @HannibalRex said in WTF Bites:

    the "click to insert breakpoint" was a game changer for me, and I hated that IDE's I used for other languages didn't have it

    30 years ago?



  • @topspin No I was just using janky Python and R IDE's after Matlab. R Studio has decent debugging now, and I've learned that PyCharm is a thing. But since I had learned from the Matlab GUI, I didn't know there were other ways to set break points. If there wasn't a big red "debug" button, I was SOL.



  • @topspin said in WTF Bites:

    Digging through some coworker's Matlab stuff.

    The Matlab GUI seems to be implemented in some funky mixture of Java and Matlab itself. While code is running in the command window, you can't open files in the editor. There's a tree view that shows files in the current folder, but double clicking a file there just gives you a wait cursor while it waits for the currently running stuff to finish.
    I guess there's some funky global lock going on and it's trying to execute internal Matlab stuff in the same engine that's running user code? Or something equally :wtf:.

    Filed under: Multithreading is hard.


  • BINNED

    @dcon said in WTF Bites:

    @topspin said in WTF Bites:

    Digging through some coworker's Matlab stuff.

    The Matlab GUI seems to be implemented in some funky mixture of Java and Matlab itself. While code is running in the command window, you can't open files in the editor. There's a tree view that shows files in the current folder, but double clicking a file there just gives you a wait cursor while it waits for the currently running stuff to finish.
    I guess there's some funky global lock going on and it's trying to execute internal Matlab stuff in the same engine that's running user code? Or something equally :wtf:.

    Filed under: Multithreading is hard.

    🐍: What’s multithreading?


  • Discourse touched me in a no-no place

    @topspin said in WTF Bites:

    🐍: What’s multithreading?

    Something you'll never do worth a damn, Python, something you'll never do.



  • @dkf Fixed:

    import clr
    from System.Threading import Thread


  • @Polygeekery said in WTF Bites:

    HP printers

    Found your problem!


  • Discourse touched me in a no-no place

    @TwelveBaud That requires a runtime that's incompatible with other libraries we're using (and which we haven't the effort to port).


  • Java Dev

    @dkf said in WTF Bites:

    @topspin said in WTF Bites:

    🐍: What’s multithreading?

    Something you'll never do worth a damn, Python, something you'll never do.

    When learning programming at uni, in one of the courses I had to do a multithreaded app in Python because that was the language of choice in that course. All other courses (but one) used Java.



  • @Atazhaia said in WTF Bites:

    the language of choice

    The wrong choice. At least for that purpose.


  • Discourse touched me in a no-no place

    @Atazhaia said in WTF Bites:

    When learning programming at uni, in one of the courses I had to do a multithreaded app in Python because that was the language of choice in that course. All other courses (but one) used Java.

    You mostly get away with it if all the threads are very I/O-bound. But when you have CPU-bound threads about, Python (in the standard implementation) sucks due to a combination of a global lock for memory access and a terribly naïve approach to lock management. The net effect is that the CPU-bound thread will definitely starve all the I/O-bound threads. The effect is redoubled when you have several CPU-bound threads and multiple physical cores (like all modern hardware). In the end, we had to switch to running critical I/O (a periodic keep-alive message dispatcher, whose only job was to say “yes, we're still here” to the other end of the socket every 30 seconds) in a subprocess because we were seeing total starvation for several minutes at a time.

    Python claims to be multithreaded. It's more like wish-it-was-multithreaded. Fixing it requires a huge rewrite, and would probably take many years to make stable (because fucking up in this area is damn easy to do and damn hard to detect). Moving to a different runtime like .NET or the JVM fixes that problem, but then you lose a lot of the existing packages, especially the large complicated ones that are actually a very big draw for existing Python users; porting things on that scale is itself very difficult. So in practice everyone's stuck in the shit.


  • Banned

    @dkf said in WTF Bites:

    Fixing it requires a huge rewrite, and would probably take many years to make stable (because fucking up in this area is damn easy to do and damn hard to detect).

    Not to mention it's basically given that a lot of Python ecosystem relies on multithreading being broken.


  • Discourse touched me in a no-no place

    @Gąska said in WTF Bites:

    @dkf said in WTF Bites:

    Fixing it requires a huge rewrite, and would probably take many years to make stable (because fucking up in this area is damn easy to do and damn hard to detect).

    Not to mention it's basically given that a lot of Python ecosystem relies on multithreading being broken.

    It's strongly implicit in how the C API of Python works. It makes it easy to use, and close to impossible to fix.



  • WTF of my day: So, our school's library is doing those weekly "Tips of the week" emails. Today's topic: "How to use emails"

    And, of course, everyone was included in the To: field. So, I hit Reply and told them that maybe they could include "How to use CC and BCC" the next time?

    Two minutes later I received an email not from the library staff: "Good idea!" And then another one, also not from the library staff.

    Seems that I inadvertently must've hit the ReplyAll-Button and gave everyone a very good example of why CC and BCC are a thing.

    Though, one of my colleagues had configured her automatic Out Of Office email in such a way that we also were all notified of that fact.


  • Banned

    @Rhywden said in WTF Bites:

    WTF of my day: So, our school's library

    @error_bot giphy dis gon b gud

    Edit: :(

    Edit 2:

    Seems that I inadvertently must've hit the ReplyAll-Button and gave everyone a very good example of why CC and BCC are a thing.

    :pendant: CC wouldn't help.



  • @Rhywden said in WTF Bites:

    inadvertently

    Sure, sure. 😉



  • @dkf said in WTF Bites:

    Python claims to be multithreaded. It's more like wish-it-was-multithreaded.

    Now that it added async, I would consider it best to just deprecate threads altogether and create a helper for modules for converting native functions only to async using worker threads.

    @dkf said in WTF Bites:

    Moving to a different runtime like .NET or the JVM fixes that problem, but then you lose a lot of the existing packages, especially the large complicated ones that are actually a very big draw for existing Python users; porting things on that scale is itself very difficult. So in practice everyone's stuck in the shit.

    They have PyPy3. It seems to be able to support most of the packages and is a saner runtime. Or that has the same issues when it comes to threads?


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    Now that it added async

    I think that doesn't help (but I'm not sure; we're still stuck supporting 2.7 right now because of a key downstream collaborator who didn't even think about upgrading their shit until the start of this year) as the fundamental problems are right down at the basic level of the runtime (as it has to do with the GIL and the lock management associated with it, which is very sensitive code functionality-wise), and CPU-bound work remains exactly that and there's not much you can do to sweeten the pill without using threads or processes.

    Basically, fixing the GIL is really hard because of the general assumption of Python code that you can just hand objects about between threads, which is an assumption all over. Because of that assumption, you have to have a lock for memory access and the lock probably needs to be global (because rebuilding the lock to be per object would be horrifyingly much work). The lock management code for the GIL when in CPU-bound mode (i.e., not making calls into the OS) involves essentially occasionally dropping the GIL and then reacquiring it immediately, which theoretically gives other threads a chance to preempt. Except that doesn't do bupkis on modern hardware: the chance of the other threads being exactly ready to go in that sliver of time is very slight, and instead what actually happens is the original thread re-grabs the lock virtually all the time. What is needed is a yield between the two. Except then you absolutely clobber the single threaded performance.

    How do other languages avoid this trap? Mostly by not having all memory protected by a single lock. Some (Java and C# fall into this family, but so too does C++ really) do it by not protecting things at the runtime level, and requiring objects that aren't thread-bound at the application level to have their own locking. Others bind every object utterly to its originating thread and only allow messages (typically made of basic primitive types that the messaging code knows how to move) to go between two threads. Both of these produce very different flavours of language semantically to Python, and this class of difference permeates everywhere; it's like having gravity point in a bit different direction.


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    They have PyPy3. It seems to be able to support most of the packages and is a saner runtime. Or that has the same issues when it comes to threads?

    To be honest, I don't know. I thought they were more focused on reducing the overheads due to branch misprediction and value boxing (these are the twin reasons why single-threaded Python is slow).



  • This post is deleted!

  • Grade A Premium Asshole

    Symantec got bought out by Broadcom or something, so I have to setup a new login. It all started with this:

    Screen Shot 2020-04-29 at 11.50.24 AM.png

    Which I thought was a minor :wtf:. A long time ago we had to write our own implementation of this and we found that we had to exclude 0 from the integer possibilities because lots of people would space out or something and miss the answer. Nearly all of our wrong answers that got a correct answer next were ones involving zero. So I had intended to write something about that.

    Next it asks me to send a temporary password to my email. Well, you authenticated me to login to this area via a link that you sent to setup my account. I'm already in. So beyond all of this being insecure now that I think about it, you're asking me to set a temporary password before I can set a permanent password. Whatever.

    Then it asks for 2FA. Fine, send me a code to my email. Which basically brings this down to 1FA because I had to setup all of this up from a code in my email and if someone has access to your email then 2FA does fuck all, blah blah blah, whatever. This is a first run through so it is only a minor :wtf:. They are doing the best they can with what they have and I guess it's almost better than nothing.

    But then they send the password, I double click to highlight, copy, paste it in the field, hit enter and it trips the "You cannot leave this field blank" prompt. Which I find happens sometimes when I paste information in to a field and I've never really figured out why. Back in to the field, add a space, delete a space, hit enter and it works. Retarded.

    Next on to setting a permanent password. I click in the blank and the HTML is not formatted in a manner that lets my password manager recognize it as a password field, so there is no automatic prompt. Ugh.

    Generate a secure password, copy it, paste it in both fields by tabbing between them. Fields cannot be blank. Add spaces, delete spaces, hit enter. Passwords don't match. :wtf: man! That is literally impossible. I have a password revealer in Chrome so I enable it real quick and take a look and the passwords are the exact same. I check for leading or trailing spaces that I might have left, nothing. They are the same. Generate new password, paste it in the fields and it works.

    So why did it think that they were not the same? :mlp_shrug:


  • Notification Spam Recipient

    @Polygeekery said in WTF Bites:

    But then they send the password, I double click to highlight, copy, paste it in the field, hit enter and it trips the "You cannot leave this field blank" prompt. Which I find happens sometimes when I paste information in to a field and I've never really figured out why.

    Recognising if something was put into the field is tied to onkeypress, onkeydown, or something similar.



  • @Polygeekery said in WTF Bites:

    A long time ago we had to write our own implementation of this

    I don't get it. How is that CAPTCHA supposed to reject bots? It looks dead-easy to OCR and compute.


  • Java Dev

    @Zerosquare It's the kind of CAPTCHA that only works if you're the only site using it.

    Like a forum I was on for a while ages ago which started you out only being able to see one category, in which you had to make 10 posts before you were auto-promoted which hid that category and revealed all the normal ones. They'd found most spam bots wouldn't get as high as 10 posts on an account before moving on.


  • Grade A Premium Asshole

    @Zerosquare from the design of the page I am guessing it is old and hasn't been updated for the better part of a decade.

    Damn it, I wish I could get back to that specific page. I wonder if that is plain text and if so you wouldn't even need OCR. There is no border to indicate that it is a generated image.



  • @MrL said in WTF Bites:

    Recognising if something was put into the field is tied to onkeypress, onkeydown, or something similar.

    Yeah, but how did anybody think that that would be a better solution than checking if the field is non-empty at submission time?

    Besides, how does it deal with backspace? Those would presumably trigger the various callbacks, but either leave the field empty or make it empty...



  • @cvi speaking of that, my bank website has started to do this stupid thing. Before, auto fill worked great. Now, it auto fills and the website, at the last part of loading (but before you can actually interact), clears that login form. So I have to click and choose the stored password again.


  • Fake News

    @Polygeekery said in WTF Bites:

    @Zerosquare from the design of the page I am guessing it is old and hasn't been updated for the better part of a decade.

    Damn it, I wish I could get back to that specific page. I wonder if that is plain text and if so you wouldn't even need OCR. There is no border to indicate that it is a generated image.

    I have seen somebody dissecting another implementation where the form actually contained a hidden form field with name "correct-answer". Surely bots will never look at the HTML they download...


  • Notification Spam Recipient

    @cvi said in WTF Bites:

    @MrL said in WTF Bites:

    Recognising if something was put into the field is tied to onkeypress, onkeydown, or something similar.

    Yeah, but how did anybody think that that would be a better solution than checking if the field is non-empty at submission time?

    Have you met people?

    Besides, how does it deal with backspace? Those would presumably trigger the various callbacks, but either leave the field empty or make it empty...

    Oh, that's simple:

    .onKeyDown(function() {
    	itIsEmpty = document.form.passwerd.value.length == 0;
    });
    


  • @Polygeekery said in WTF Bites:

    "You cannot leave this field blank" prompt. Which I find happens sometimes when I paste information in to a field

    I love the ones that do that any time the field loses focus, like clicking on my password manager window. Or my current timesheet site (yay for billable hours), which immediately prompts me to enter an end time after entering my start time; I'll enter my end time in 3 or 4 hours when I break for lunch, not when I just started (unless, of course, it's timed out, logged me out, and forgotten my start time by then).


  • Grade A Premium Asshole

    @HardwareGeek said in WTF Bites:

    I love the ones that do that any time the field loses focus, like clicking on my password manager window.

    Extra special bonus points if it does not leave space for that text in the formatting and then when it pops in it moves everything on the page and sometimes makes you click something you did not mean to.

    Don't. Fucking. Move. Anything. Not after it has been displayed.

    There is a website that I frequent on mobile that is fucking horrible about this. Unless I wait a ridiculously long time after it has loaded to make sure everything is loaded and rendered the chances of me tapping on the wrong thing (almost always a link that takes me somewhere I did not intend to go, causing me to have to go back and start the load-render cycle over again) is near 100%.

    Next up on the list is a local auction site. On mobile it is nearly unusable. It is designed to be responsive, so it displays fine on mobile. But the UI/UX is fucking horrible. If you click on the field to enter your bid it pops in a window as soon as you start typing that says "Your bid must be higher than the minimum bid", because chances are that the first number you type won't be over the minimum bid. This dialog box takes up your entire mobile screen and makes it impossible to see what the hell you are typing until you have typed enough to get over the minimum bid. Fuck up and hit the wrong number and have to go back and correct? Good fucking luck. Here comes the obnoxious dialog to cover all your shit.

    I fucking hate web developers. Sorry to the web devs on this forum, but I am strongly prejudiced against you. I assume you're all morons until you prove otherwise.

    The really sad thing is when you have become so accustomed to totally shit web design and UI/UX that you know all the ways to trick sites in to doing what the hell they should have done in the first place.

    Another one I ran across today: My kid is doing all sorts of online learning things. One of them has instructions to go X site and click on "Login with Y". My son can't find it. My wife can't find it. It appears to not have the option.

    You had to scroll down to find it. It couldn't just display the option in the space allotted, and Chrome has done away with the slider in their UI so now there is no indication that a person has to scroll anymore. Nothing in the formatting would indicate that there was more below. And there aren't even that many options for login. You could fit them all on a fairly small screen. But no one arranges anything in horizontal divs anymore. Everything is listed vertically, in the arrangement where no one will ever see what is below the fold on their screen.

    Why does this happen? I blame it on web devs all working on high resolution displays with tons of real estate to lay everything out and then never, ever, fucking ever even glancing at things on lower resolutions to see how it works.



  • @Polygeekery said in WTF Bites:

    Don't. Fucking. Move. Anything. Not after it has been displayed.

    This.

    Personally, I would like to add "Don't fucking mess with the focus. Double-don't if your damn shit is so slow that I already managed to click elsewhere and type half a sentence before whatever fucking script you're running triggers."


  • ♿ (Parody)

    @Polygeekery said in WTF Bites:

    I fucking hate web developers. Sorry to the web devs on this forum, but I am strongly prejudiced against you. I assume you're all morons until you prove otherwise.

    We just hate people.


  • Grade A Premium Asshole

    @cvi said in WTF Bites:

    @Polygeekery said in WTF Bites:

    Don't. Fucking. Move. Anything. Not after it has been displayed.

    This.

    Personally, I would like to add "Don't fucking mess with the focus. Double-don't if your damn shit is so slow that I already managed to click elsewhere and type half a sentence before whatever fucking script you're running triggers."

    Also yes. It really pisses me off when I am typing something in, focus changes and I end up entering part of it somewhere else. Even worse when the focus change causes me to inadvertently submit the data that is now all wrong.



  • @HardwareGeek said in WTF Bites:

    unless, of course, it's timed out, logged me out, and forgotten my start time by then

    Which, of course, it did. And it is now completely broken. It's taking forever to log in, and having logged in, it is now refusing to let me enter any time at all.


  • Notification Spam Recipient

    @Benjamin-Hall said in WTF Bites:

    @cvi speaking of that, my bank website has started to do this stupid thing. Before, auto fill worked great. Now, it auto fills and the website, at the last part of loading (but before you can actually interact), clears that login form. So I have to click and choose the stored password again.

    You use Bank of America too?



  • @MrL said in WTF Bites:

    .onKeyDown(function() {
    	itIsEmpty = document.form.passwerd.value.length == 0;
    });
    

    🤯

    There is so much fucking dumb in this one-liner, it's actually amazing.


Log in to reply