WTF Bites



  • As most banks do, my bank has an online banking portal to check balances and do simple things you don't want to go to the branch or call by phone for. I'm mostly happy with the service, but it has a couple of snags.

    First, it has "wish it were 2 factor" auth:
    0_1513611717879_fbfcf4fd-6dd4-46d7-9e2a-0b5fbe0cc6ec-image.png
    That's asking me for my National Id number, my online PIN, and my "username" which is a second password in all but name (shows up as asterisks and must have a number).

    And more annoyingly, when the page finishes loading it focuses the NIN field and selects anything that is written there. I'm just fast enough that I can input my NIN and PIN before the page finishes loading, so I often end up writing my password in the clear text field (I look at the keyboard when typing passwords, even if I can touch-type the rest of the time, so I don't realize I'm writing on the clear field until I look back up). So my password is shown to anyone that might glance at my monitor, and then I have to retype the NIN and the password.

    I hate forms that take away focus from where you are typing to some other field.



  • @onyx said in WTF Bites:

    And then we wonder why web pages are slow these days...

    0_1513608992192_ezgif.com-video-to-gif.gif

    This is almost realtime (I think it's slightly slower in reality) recording of web development console. I'm looking for a JS library that lets you set a mask on any input field and, hopefully, makes it easy to handle date inputs with multiple formats (most of them only seem to support MM/DD/YYYY and nothing else). This is me logging a value in a function that just returns the mask string for the field (it happens to be undefined, this is not important, the returned mask is correct).

    I'm not typing. I'm not moving my mouse. It's just sitting there, polling the contents of the <input> element every 300ms (according to docs).

    Why? Why in the fuck would you not just use the change event? Why in the fuck is this looping every 300 fucking milliseconds? What possible explanation is there for this other than fucking laziness and/or incompetence?

    I... just... I give up. I'm throwing out all the C++ and as-optimized-as-I-can-get-it PHP, I'm dropping our well tuned Postgres DB, I'm rewriting everything in Node and fucking Redis. Because if no one else cares any more, why the fuck should I?

    Catching all possible scenarios where the user could change the value in a text box is harder than it sounds. The change event should fire eventually, but doesn't fire immediately. Key events will fire when the keyboard is used to interact with the input box, but not the mouse. HTML5 tried to solve this by adding an input event (which should do what you want), but not all browsers support it. There are events to detect cut and paste (and drag and drop), but not all browsers support those either.

    That said, polling probably isn't the proper way to do it, but it's a sufficiently complex problem (and the proper solution sufficiently ugly and hackish) that I can see why you'd say fuggit and just do polling.


  • BINNED

    @anotherusername Turns out it was looking for dynamically added elements. I disabled it in my initialization of elements, but apparently to do that you have to disable it in global config. Which makes sense, yes, but the docs were so clear about it I didn't even understand what half of the options were without reading the comments three times for each line.



  • @gąska said in WTF Bites:

    @ben_lubar oh, that. Well that's weird, considering that X-COM 2 has been fully localized to Polish, and some names include Polish diacritics.

    Do you own XCOM 2? If so, can you add your name to the character pool and send me the .bin file for the character pool from Documents\My Games\XCOM 2?


  • Banned

    @ben_lubar I don't.


  • Winner of the 2016 Presidential Election

    @pie_flavor said in WTF Bites:

    @gąska Well, I enjoy my code being superior to yours. 🚃 But seriously, it just looks cleaner to me. If you don't think that it looks cleaner, then don't install it. Stick with good old whatever-you-use. But it definitely appeals to me.

    Same here. Or at least I like the idea of it. I needed to test it out though.



  • @onyx be that the case, it should really use a MutationObserver to do that, if the browser supports it.


  • BINNED

    @anotherusername said in WTF Bites:

    @onyx be that the case, it should really use a MutationObserver to do that, if the browser supports it.

    Honestly, at this point, if I can make it work without murdering the browser, I'll be happy.

    I'm still considering throwing it out though, it seems as if the entire freaking thing is inside a huge try / catch and it just silently swallows any errors thrown in callbacks. Which makes it a joy to debug, as well as you can imagine.



  • @onyx oh, so the polling is just to find input elements, not to actually watch their contents.

    If it doesn't poll to find new input elements, what do you have to do to manually tell it to check and/or to add one manually (from the page's script)? Most likely, telling it to poll after the page is done loading will be all you need. If you are dynamically adding text boxes, then telling it to check once after any time you've added them should be sufficient; if you can't do that, then you could set a global mutation observer that finds new text boxes and manually asks it to watch them.


  • BINNED

    @anotherusername It also seems to reinitialize them, at least it refreshes the mask (not sure about rebinding events, I didn't look into it that deeply).

    In any case, I'm already handling all the binding myself after rendering whichever template needed rerendering, I didn't want it to do that in the first place, it just has (IMHO) asinine defaults.



  • @anotherusername https://caniuse.com/#feat=input-event So basically if you're not supporting old versions of IE, or Opera Mobile (why), you should be fine for textual <input> elements at least.

    (Meant to quote but accidentally submitted a blank reply so fuckit)


  • ♿ (Parody)

    @anotherusername said in WTF Bites:

    @pleegwat said in WTF Bites:

    @dcoder said in WTF Bites:

    The same people who used strlen as a hashing function?

    What

    The

    :wtf:

    To be fair, it wasn't used for anything that required a terribly good hashing method. It was basically a bucket sort. When a built-in function was invoked, a lookup had to be done to get the code for that function. To speed up the lookup, the functions were sorted into a bunch of different buckets; since it knew which bucket the function would be found in, it only had to look through the things in that bucket to find it. The buckets he used were arranged by the length of the function name. Not the best, but fairly easy to calculate -- even mentally.

    Yeah, simpler hashing for stuff like that can make sense.

    I also feel like this is kind of running afoul of our rule about not making fun of personal pet projects, because that's what PHP was at the time.

    That's more of a front page (a what, now?) thing.


  • Discourse touched me in a no-no place

    @boomzilla said in WTF Bites:

    Yeah, simpler hashing for stuff like that can make sense.

    The silly thing is that a surprisingly good hash function isn't really all that much more complicated than strlen().


  • BINNED

    0_1513632328540_wtfquora.png

    I don't know about the rest of you, but I don't normally upvote answers I'm not satisfied with.


  • ♿ (Parody)

    @dkf said in WTF Bites:

    @boomzilla said in WTF Bites:

    Yeah, simpler hashing for stuff like that can make sense.

    The silly thing is that a surprisingly good hash function isn't really all that much more complicated than strlen().

    Yeah, I'm sure there are better ones than that, but it's also easy to overcomplicate and make everything too slow by taking too much time hashing.


  • Discourse touched me in a no-no place

    @boomzilla said in WTF Bites:

    it's also easy to overcomplicate

    Oh yes. For sure.


  • Considered Harmful

    https://i.imgur.com/K3UPl90.png

    0 of 8? Why's 8 the maximum? That's annoying. Not that I'm using more than 8, but why the hell would they hard-code a maximum like that? Why not just have a number input box, with a warning that more than 8 or so could hit your performance?


  • Considered Harmful

    Also, more indexing bullshit. If I click D: and open the Downloads folder from the main screen, then it's immediately in by-date order. But if I click the Downloads item in the This PC drop-down, it starts off in alphabetical order, loads forever, and then switches to by-date order. And the folders are at the top, whereas opening the folder from D: puts the folders at the bottom.



  • @pie_flavor said in WTF Bites:

    https://i.imgur.com/K3UPl90.png

    0 of 8? Why's 8 the maximum? That's annoying. Not that I'm using more than 8, but why the hell would they hard-code a maximum like that? Why not just have a number input box, with a warning that more than 8 or so could hit your performance?

    I assume it's either some deal Microsoft made with mobile data providers or it's something like the "nobody can possibly be awake for more than the same 18 hour period every day" thing.



  • @pie_flavor said in WTF Bites:

    Also, more indexing bullshit. If I click D: and open the Downloads folder from the main screen, then it's immediately in by-date order. But if I click the Downloads item in the This PC drop-down, it starts off in alphabetical order, loads forever, and then switches to by-date order. And the folders are at the top, whereas opening the folder from D: puts the folders at the bottom.

    The fast one is a folder, the slow one is a library.


  • :belt_onion:

    @gąska said in WTF Bites:

    There are many ways to do redirect without triggering SSL error.

    Late to the party, but, uh....... Nope.


  • Considered Harmful

    @ben_lubar said in WTF Bites:

    I assume it's either some deal Microsoft made with mobile data providers

    It's not a literal mobile hotspot. It's just a repeater for the existing connection. There's no SIM card in here. I use it to host LAN games since uni wifi blocks regular connectivity - friends just connect to me and they keep their internet while being able to join my server.

    @ben_lubar said in WTF Bites:

    The fast one is a folder, the slow one is a library.

    I confess to not know the difference.



  • @pie_flavor said in WTF Bites:

    But if I click the Downloads item in the This PC drop-down, it starts off in alphabetical order, loads forever, and then switches to by-date order.

    IIRC, I had a similar issue. There's an incantation from googeling you can try (Properties -> Customize -> Optimize this folder for -> General Items). That fixed the slow loading for me.


  • Java Dev

    :wtf:

    Why would anyone include XP support for a X299 MB? XP has been completely obsolete for nearly 4 years now, as well as I can't imagine XP being able to take advantage of anything from modern hardware. Why go through the effort of writing drivers for it?


  • area_can

    @atazhaia space cadet pinball


  • Java Dev

    @bb36e said in WTF Bites:

    @atazhaia space cadet pinball

    Only the i9-7980XE is able to calculate the pixel-perfect physics of Space Cadet Pinball at full speed. A game so far ahead of its time that it has taken until now to develop desktop hardware powerful enough to handle it!


  • And then the murders began.

    @pie_flavor said in WTF Bites:

    @ben_lubar said in WTF Bites:

    The fast one is a folder, the slow one is a library.

    I confess to not know the difference.

    A library is a union of multiple folders. By default, both your personal _____ folder & the public one in C:\Users\Public, but you can add additional folders too if you want.


  • Banned

    @gąska said in WTF Bites:

    2064: Read Only Memories. A game where you can type in your own custom pronouns, but the barman needs a reminder how to serve beer. Where you can choose if you eat halal or gluten-free, but the only responses to Tomcat's exposition about operating systems is "I don't understand a word" and "sarcastic I don't understand a word".

    Minor spoiler: not once in the whole game you ever visit a restaurant, so your dietary choice doesn't matter. A huge missing opportunity - I'd love to see what happens if your preferred food is "goddamnit Turing".


  • 🚽 Regular

    https://www.youtube.com/watch?v=EdcsFZG5ms4

    (not saying it's a restaurant. I just like this song)



  • JavaScript and Regular Expressions.

    0_1513702820518_7293b80a-ee2a-4091-a6e8-0bc6e2827e06-image.png



  • @chaostheeternal said in WTF Bites:

    JavaScript and Regular Expressions.

    0_1513702820518_7293b80a-ee2a-4091-a6e8-0bc6e2827e06-image.png

    That should only happen if you use the y flag (sticky).

    That's what the g flag does: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex


  • Considered Harmful

    Ironic.
    https://my.mixtape.moe/opkmuj.mp4

    Edit: Also, for you people who doubted me, this is video evidence. Those circles that appear? That signifies that it's a tap (you can see one time that it doesn't appear, interpreting it as a swipe, 5 seconds in).

    edit edit: seriously? a screen recorder also records mic by default? and amidst the fifty-odd notifications I got about the recorder, the fact that it was recording mic was not among them? audio track removed. WTF, guys.


  • Fake News

    @tsaukpaetra said in WTF Bites:

    @ben_lubar said in WTF Bites:

    @tsaukpaetra said in WTF Bites:

    Status: Why, oh why, is this even a thing?

    0_1513275083272_592e7ac3-2193-4e2f-9e43-84678ac9b51c-image.png

    There's an option to turn off HTML parsing.

    Yeah, apparently it's -UseBasicParsing.

    My problem is that it's not HTML that's being returned, it's a JSON object. So, why is it asking Internet Explorer to thunk it out when it has a perfectly good JSON functionality already?

    I was wondering why you don't use Invoke-RestMethod, but then again it also has a -UseBasicParsing so it might give the same error.




  • Considered Harmful

    @hungrier Maybe <video>? (Side note: Why do we have an upload button which knows the difference between images and other files, but not between videos and other files?)
    But it's not about whether it's easy to swipe. It's about whether it's easy to tap and not swipe. You did a whole lot of intentional swiping and one tap.



  • @pie_flavor said in WTF Bites:

    Maybe <video>?

    :kneeling_warthog:

    But anyway I can assure you taps work no problem for me, and both horizontal and vertical swipes do what they should. I don't know if there's something Different™ on your device but the new system works a lot better for me than the old one.


  • Considered Harmful

    @hungrier Here's an interesting bit. Usually it's not that egregious. It might fuck up a couple of times while reading, but nothing serious. But it is always like this at one particular time of the day, and one time only: biology class.



  • @pie_flavor Maybe you're getting all horned up in biology class and it's interfering with the capacitive sensor on your phone 🚟


  • Considered Harmful

    @hungrier Ever seen Ferris Bueller's Day Off? Take the English teacher, and now imagine if he was half-asleep, and every so often just stared off vacantly into space for about ten seconds. That'd be my biology teacher. She really needs to invest in some coffee. Anyway, she couldn't 'horn up' a damn thing.


  • 🚽 Regular

    This post is deleted!

  • Considered Harmful



  • Found today in some code I inherited: calling various functions inside assert() (as in, assert(do_something())).

    Worked for the dev (in debug). Weirdly (!!!) did not work for users (in release). :headdesk:



  • @remi "Don't do that" is in our coding standard, for that very reason.



  • At my company, we're officially allowed to carry over 80 hours of PTO per year, and 0 hours of comp time. Unofficially, our HR guy doesn't impose the PTO cap until the second pay period of the new year and "forgets" to zero comp time.

    Coworker who's been with the company 18 years and works 60-hour weeks discovered that, due to how his previous time off was allotted, he had 184 hours to carry over, rather than the ~100 he thought. He'd planned to take off the next two weeks to avoid losing hours, but clearly that wouldn't be enough. He went to see what could be done about this, given his history with the company, reputation for honest hard work, and plenty of unpaid overtime on a famous museum's marquee-level project.

    What's being done about this is he was ordered to leave immediately and not return until Jan 8. All PTO hours over 80 are voided as of 1/1/18 (which means when he gets back he'll have 48 instead). No compensation will be provided, as "the low departmental revenue doesn't justify the expenditure." (Nevermind that the department has 7 unfilled positions to grab money from...) Any further discussion should be addressed to the acting department head when he returns from vacation, not that he can do anything about it.

    I don't think my coworker's coming back.



  • @pie_flavor said in WTF Bites:

    "You will have to rewrite your browser to comply with our requirements, which include using our browser."


  • Considered Harmful

    This post is deleted!


  • @twelvebaud ...if they're voiding all his PTO over 80 hours as of 1/1/18, why are they forcing him to continue taking PTO until the 8th? :wtf:

    Also, how the hell does someone end up with nearly 100 more hours of PTO than they realized that they had?


  • I survived the hour long Uno hand

    @anotherusername
    I could see it as forcing him to take the comp time, but that doesn't really answer why he'd be down to 48 hours PTO by the 8th.

    Edit... Unless he already had planned vacation for the 1st - 8th and they were like "I don't care what you do after the 1st, but don't show up again before then and you'll be at 80 hours PTO as of the 1st"



  • @ben_lubar Didn't they explicitly make an exception for Chrome and Firefox in Windows 8 to avoid getting into monopoly abuse problems?

    Seems weird that they change their minds now.



  • Why are IDEs so insistent in explicitly naming their build systems?

    You don't see Photoshop having an "encoding system" that you have to use to save images as JPEG. You just save them.


Log in to reply