WTF Bites



  • @levicki said in WTF Bites:

    @cvi said in WTF Bites:

    std::reverse_copy?

    That requires your data to be in a vector so it's useless for this case. There should be something like plain memcpy() but in reverse.

    No, it does not. It requires anything that can be manipulated with BidirectionalIterators, which, by design, includes plain old arrays.

    If you are wondering why this is even a thing, note that Microsoft Next Generation Cryptography (aka CNG) is storing key material in various blobs in big-endian format. Note also that they are incapable of designing a simple function which will import a raw binary representation of an RSA key from memory without using blood magic and witchcraft.

    Poorly documented structures with unusual layout are par of the course for Microsoft, though it of course is a :wtf:.



  • @levicki said in WTF Bites:

    That requires your data to be in a vector so it's useless for this case.

    You can pass it a set of plain pointers, since they fulfil the requirements for bidirectional iterators (and, thus, any other iterator as well).

    Edit: :hanzo:'d by @Bulb. Whatever he said.


  • Java Dev

    @_P_ said in WTF Bites:

    @Benjamin-Hall said in WTF Bites:

    Whatever you do, don't do this: implement the "99 bottles of beer" song in SQL.

    SELECT
            ( 100 - level ) || ' bottle' || CASE WHEN level != 99 THEN 's' END || ' of beer on the wall'
            || chr(10)
            || ( 100 - level ) || ' bottle' || CASE WHEN level != 99 THEN 's' END || ' of beer'
            || chr(10)
            || 'Take one down, pass it around'
            || chr(10)
            || ( 99 - level ) || ' bottle' || CASE WHEN level != 98 THEN 's' END || ' of beer on the wall'
            FROM dual CONNECT BY level <= 99;
    
    DELIMITER $$
    DROP PROCEDURE IF EXISTS bottles_$$
    CREATE PROCEDURE `bottles_`(INOUT bottle_count INT, INOUT song  text)
    BEGIN
    DECLARE bottles_text VARCHAR(30);
    
    
    IF bottle_count > 0   THEN
    
    
       IF bottle_count != 1 THEN
       SET bottles_text :=  ' bottles of beer ';
       ELSE SET bottles_text = ' bottle of beer ';
       END IF;
    
       SELECT concat(song, bottle_count, bottles_text, ' \n') INTO song;
       SELECT concat(song, bottle_count, bottles_text,  'on the wall\n') INTO song;
       SELECT concat(song, 'Take one down, pass it around\n') INTO song;
       SELECT concat(song, bottle_count -1 , bottles_text,  'on the wall\n\n') INTO song;
       SET bottle_count := bottle_count -1;
       CALL bottles_( bottle_count, song);
     END IF;
    END$$
    
    SET @bottles=99;
    SET max_sp_recursion_depth=@bottles;
    SET @song='';
    CALL bottles_( @bottles, @song);
    SELECT @song;
    

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Guess they like kinda-sorta-golfing it?


  • Notification Spam Recipient

    @_P_ said in WTF Bites:

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Same argument could be made for FizzBuzz



  • @PleegWat said in WTF Bites:

    @_P_ said in WTF Bites:

    @Benjamin-Hall said in WTF Bites:

    Whatever you do, don't do this: implement the "99 bottles of beer" song in SQL.

    SELECT
            ( 100 - level ) || ' bottle' || CASE WHEN level != 99 THEN 's' END || ' of beer on the wall'
            || chr(10)
            || ( 100 - level ) || ' bottle' || CASE WHEN level != 99 THEN 's' END || ' of beer'
            || chr(10)
            || 'Take one down, pass it around'
            || chr(10)
            || ( 99 - level ) || ' bottle' || CASE WHEN level != 98 THEN 's' END || ' of beer on the wall'
            FROM dual CONNECT BY level <= 99;
    
    DELIMITER $$
    DROP PROCEDURE IF EXISTS bottles_$$
    CREATE PROCEDURE `bottles_`(INOUT bottle_count INT, INOUT song  text)
    BEGIN
    DECLARE bottles_text VARCHAR(30);
    
    
    IF bottle_count > 0   THEN
    
    
       IF bottle_count != 1 THEN
       SET bottles_text :=  ' bottles of beer ';
       ELSE SET bottles_text = ' bottle of beer ';
       END IF;
    
       SELECT concat(song, bottle_count, bottles_text, ' \n') INTO song;
       SELECT concat(song, bottle_count, bottles_text,  'on the wall\n') INTO song;
       SELECT concat(song, 'Take one down, pass it around\n') INTO song;
       SELECT concat(song, bottle_count -1 , bottles_text,  'on the wall\n\n') INTO song;
       SET bottle_count := bottle_count -1;
       CALL bottles_( bottle_count, song);
     END IF;
    END$$
    
    SET @bottles=99;
    SET max_sp_recursion_depth=@bottles;
    SET @song='';
    CALL bottles_( @bottles, @song);
    SELECT @song;
    

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Guess they like kinda-sorta-golfing it?

    So, typical "let's flex on Rosetta Code" pro coder move?



  • @Vault_Dweller said in WTF Bites:

    @_P_ said in WTF Bites:

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Same argument could be made for FizzBuzz

    FizzBuzz output is not completely static.



  • @Tsaukpaetra said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    That text on the right is NSFW!

    Consider me extremely curious how you derived meaning from the garbage and humbly asking for a translation.

    Must not do so, because it's NSFW.
    ♋
    👮♂


  • Notification Spam Recipient

    @_P_ said in WTF Bites:

    @Vault_Dweller said in WTF Bites:

    @_P_ said in WTF Bites:

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Same argument could be made for FizzBuzz

    FizzBuzz output is not completely static.

    Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

    Seems pretty static to me 🤷♂


  • ♿ (Parody)

    @Vault_Dweller said in WTF Bites:

    @_P_ said in WTF Bites:

    @Vault_Dweller said in WTF Bites:

    @_P_ said in WTF Bites:

    :trwtf: is not putting the entire string as the only row. It's just a fixed string, like "Hello, World!".

    Do people really like to reinvent 99 bottles of beer that much?

    Same argument could be made for FizzBuzz

    FizzBuzz output is not completely static.

    Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".

    Seems pretty static to me 🤷♂

    Not after you drink those 99 bottles of beer they won't.



  • @boomzilla So what you're saying is, 99 bottles of beer contains a lot of fizz that will give you quite a buzz?



  • Bite: YouTube playlists have developed this annoying "feature"/bug where they don't advance to the next song if the browser tab isn't visible/isn't active. Doesn't have to have focus, just has to be the active tab of the window. Since I get most of my music that way, I've had to open them in a separate window off to the side. I'll have to try to see if I can bury it under other windows and have it still work or if they've screwed up that as well.

    I blame Javascript. Why? Just because.



  • @Benjamin-Hall Time to pull out TamperMonkey?



  • @Bulb said in WTF Bites:

    @Benjamin-Hall Time to pull out TamperMonkey?

    I'd have to learn how to use it. :kneeling_warthog:



  • @Benjamin-Hall It's likely somebody did already. There is plenty of youtube hacks on the 'net, so maybe there is a right one for working this around too.



  • @Benjamin-Hall said in WTF Bites:

    @Bulb said in WTF Bites:

    @Benjamin-Hall Time to pull out TamperMonkey?

    I'd have to learn how to use it. :kneeling_warthog:

    If you mean TamperMonkey, it's as easy as writing JavaScript. If you mean interacting with the Youtube player, that's Different™

    @Bulb said in WTF Bites:

    @Benjamin-Hall It's likely somebody did already. There is plenty of youtube hacks on the 'net, so maybe there is a right one for working this around too.

    Personally I'd like one that introduces a delay after finishing a video in a playlist, so I have time to like the video if I like the video, and/or to stop it from auto advancing if I'm reading the comments. I tried (not very hard) to do that but then got distracted and never picked it back up.



  • @hungrier said in WTF Bites:

    if I'm reading the comments.

    4e893b93-9fcf-44b7-81a9-7caaa1cd2a95-image.png


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    Whether it is acceptable or not depends on your style guide (some prohibit using break in for loops).

    That's because some style guides are fucking retarded.


  • BINNED

    @dkf said in WTF Bites:

    @Zerosquare said in WTF Bites:

    Whether it is acceptable or not depends on your style guide (some prohibit using break in for loops).

    That's because some style guides are fucking retarded.

    I mean, if you want to enforce shitty code, this seems like a great rule. 🏆



  • WTF of my day: So I have this MacMini which had a bit of an issue with my 21:9 monitor (said issue being a black screen after boot unless I rebooted a random number of times after which it finally engaged). I also chose ... poorly when it came to storage size because, as it turned out, 128GB is not enough for XCode development even when XCode is the only large application on the disc.

    Solved the latter problem by moving the /user folder to an external Thunderbolt 512GB drive (speed tests showed a negligible difference between the internal and the external drive - that thing is fast). Solved the former one by installing the Catalina Beta where it seems that they finally fixed the problem - no more black screens.

    With the release version now out I wanted to move back from the Beta to the Stable branch - that part worked fine. But the subsequent update to Xcode failed for reasons - at least Windows does give you an error code of some kind. MacOS? Not so much. It just failed. 🤷♂

    Okay, since there's not much on the disc anyway and what there is, is covered by backups and Github, why not reinstall from scratch? Thus command-R, wipe the discs and reinstall.

    Hey, this installer allows me to install MacOS to the external disc! Makes much more sense: More space and no speed difference!

    So the installer did its thing and in the end... I got the error "-1008f"

    That was the whole of the error message, mind. Just the error code and the URL for Apple support. Cue a bit of searching (needless to say, the "minus" in front of the code was not a good idea, search-engine-wise) and a lot of confusion.

    Okay, let's try this installing thing again. Shutdown => Command-R ... and it seems to try to download something from the internet because it just asked me for the WLAN-key. Even though the Mini is connected to the wired LAN... okay, if you want WLAN you shall have it. Downloading aaaaand ... -1008f immediately. Wat.

    Clearing NVRam and the rest also didn't help.

    Command-Control-Option-R also yielded the same (ever tried to press those keys while also trying to push the power button - which is not on the keyboard?)

    In the end, Command-Option-R let me get to the installation screen where I opted to install the whole thing on the internal SSD again.

    Turns out that this T2 security chip does not let you boot off external media unless you deactivate that feature. To deactivate that feature you need to boot into the Recovery Shell (said Command-R thing which did not work anymore due to -1008f). But even if I had managed to get there I wouldn't have been able to access the Security program because it needs an administrator account. Which I deleted by wiping the discs.

    This whole idiocy would not have been an issue if the damn installer did a simple check if the security settings prevent it from booting into the medium it was offering me to install to. :trwtf:



  • @Rhywden By iDiots, for iDiots ™



  • @Mason_Wheeler Believe me if I didn't have to develop for iOS I wouldn't touch that with a 10-foot pole.



  • @Rhywden said in WTF Bites:

    @Mason_Wheeler Believe me if I didn't have to develop for iOS I wouldn't touch that with a 10-foot pole.

    I'm in the same sucky boat. My school is all Apple all the way, and I've got an iOS app I'm supporting. It's cured me of any lingering temptation to buy Apple stuff for personal use.



  • @Rhywden said in WTF Bites:

    128GB is not enough for XCode development

    I think that's closer to the truth...



  • @Rhywden said in WTF Bites:

    (needless to say, the "minus" in front of the code was not a good idea, search-engine-wise)

    :facepalm:



  • @levicki The point was, which you may have missed, that the installer lets you happily install something which it then cannot run, due to circumstances under the full control of the installer. And when it cannot run, it returns an error message no one can make any heads or tails out of - there's no mention of this error code on the official support pages and the support forums have several instances of this code - and every single one of those instances has it caused by something else (some people reported that they got their logic boards replaced when they went to the Apple Store...)

    I'm also not sure why there needs to be a physical administrator account on the machine in a partition, given the fact that you need to unlock the machine using your Apple ID in order to be allowed to re-install the OS?

    And, no, Windows does NOT do this. The only thing Secure Boot prevents is that you cannot read the secured storage device unless you unlock it. It will happily let you overwrite everything while also booting from external media. Done that often enough on various Surface devices.


  • Banned

    Why does password reset email say that if I didn't request password reset, my account might be compromised and I should change my password?


  • Discourse touched me in a no-no place

    @Rhywden said in WTF Bites:

    And, no, Windows does NOT do this.

    Toby Faire, controlling what devices you can boot off is more of a BIOS thing.


  • Considered Harmful

    SMS message:

    1:15pm: Remember to pickup your order today between 12:00pm and 1:00pm.


  • Considered Harmful

    @GÄ…ska said in WTF Bites:

    Why does password reset email say that if I didn't request password reset, my account might be compromised and I should change my password?

    If you didn't request password reset, then your email may be compromised, so you should change your email password and reset all passwords to all accounts that use that email?


  • Banned

    @error @levicki they specifically mentioned that the account on their site is compromised. Didn't say anything about email.



  • @GÄ…ska Also, initiating a password reset doesn't need your email. Completing it does, so if it was your email that was compromised it'd be too late anyway



  • @levicki said in WTF Bites:

    @Rhywden said in WTF Bites:

    @levicki The point was, which you may have missed, that the installer lets you happily install something which it then cannot run, due to circumstances under the full control of the installer.

    Saying that you not enabling boot from external devices in Startup Security Utility is under full control of the OS installer is a bit of a stretch.

    Yes, I get that the error message should have been more clear (or preferrably it shouldn't attempt to install to external drive), but if I am not mistaken we are talking about recovery mode OS install directly from the Internet? It is probably a bit more limited than the usual installer which you run as an app from the live OS.

    It's the exact same installer. It wouldn't even make sense to create two different installers.

    Not sure, but if someone stole both your Apple ID and your Mac they won't be able to unlock it and steal data unless they also have local admin credentials?

    Yeah, no. First of all, your AppleID is per default allowed to reset your local passwords (unless you expressly disable that option) and secondly the way they word this, it's more a feature to render the device unusable if stolen.


  • đźš˝ Regular

    Updating Meld, the merge tool. (under Windows)

    I don't know what the uninstaller did, because the directory with all the files was left behind. I guess it removed the start menu shortcuts only.

    Trying to install the new version in D:\Dev\Tools\Meld fails with "An error occurred while attempting to create the directory: D:\Dev\Tools". Well duh, the directory already exists. :rolleyes: Edit to clarify: I deleted the previous Meld directory before running the uninstaller. I will not delete or otherwise move the rest of the contents of D:\Dev\Tools just to please the installer.

    Installing to C:\Program Files (x86)\Meld worked. I know this because I've looked for it in the start menu, after the installer simply exited without any further feedback.



  • 007ae45a-6018-4478-8848-d7614d47efc8-image.png
    Having 4 almost identical classes is already confusing, but... :wtf: does "has no user interface and is not visible at runtime" mean? I assume it's not talking about GUIs. I guess it means that you can't edit it after setting it, and you can't find a reference to it unless you keep it yourself?


  • Banned

    @anonymous234 said in WTF Bites:

    :wtf: does "has no user interface and is not visible at runtime" mean?

    I think an intern didn't know what to write so they wrote whatever.



  • @anonymous234 said in WTF Bites:

    :wtf: does "has no user interface and is not visible at runtime" mean? I assume it's not talking about GUIs.

    I think it obviously is talking about GUIs. Because the “component” concept originates in GUI (Windows.Forms), but spread to non-GUI contexts as well.


  • Considered Harmful

    WhyTF does the Edit context menu item for XML files open Word?



  • @Bulb But even in GUIs, a timer has no user interface and is not visible at runtime. It's not like WinForms literally draws a little stopwatch on the corner of the application.


  • Banned

    @anonymous234 I believe it was meant to say "doesn't run on UI thread so cannot be used to do anything UI", but the writer misunderstood something.


  • đźš˝ Regular

    @anonymous234 said in WTF Bites:

    @Bulb But even in GUIs, a timer has no user interface and is not visible at runtime.

    Well... it's visible for some value of "runtime".

    acf8a1a9-bc68-4b82-ba02-524b80c880e3-image.png



  • @error Office can save files as ".xml". Probably a feature added at some point during the brief "XML is the future" craze, so now it must remain there forever.

    Somehow during that period, a lot of people forgot the difference between a serialization format and a complete file format. It makes as much sense as using the extension ".bytes".


  • Considered Harmful

    @anonymous234 said in WTF Bites:

    @error Office can save files as ".xml". Probably a feature added at some point during the brief "XML is the future" craze, so now it must remain there forever.

    Somehow during that period, a lot of people forgot the difference between a serialization format and a complete file format. It makes as much sense as using the extension ".bytes".

    Toby faire, the same could be said about a lot of "file types". What's in a .txt file—ASCII, Latin-, KOI-8R or UTF-16? And did they set us up the BOM? Is this .csv file actually a "comma separated value" file (likely not), and if not, which of the gazillion variants is it? This .html file, does it conform to anything but the "put some angle brackets in there and see" standard?
    At least valid XML has a DOCTYPE line that probably lets you find out a bit more about it. Supposedly, though I wouldn't be surprised if MS treated that as optional.



  • @anonymous234 said in WTF Bites:

    @error Office can save files as ".xml". Probably a feature added at some point during the brief "XML is the future" craze, so now it must remain there forever.

    Somehow during that period, a lot of people forgot the difference between a serialization format and a complete file format. It makes as much sense as using the extension ".bytes".

    Of course Office can save as xml. That's what the .docx/etc. files are, really.


  • Java Dev

    @anonymous234 said in WTF Bites:

    It makes as much sense as using the extension ".bytes".

    You mean the extension .dat, or the MIME type application/octet-stream?



  • @Benjamin-Hall The problem is not XML files, it's that the extension is literally ".xml" instead of something like ".xmldoc" (or, well, ".docx").

    @LaoC If all you know about a file is "it's text", .txt is acceptable (although ".utf8" might be better). You know from that that you can open the file in notepad, which is better than nothing. But storing an HTML file as a .txt is what would be bad, because you're discarding the information that the text can be rendered in a browser.

    If I had to invent a way to declare file types I'd try to make it hierarchical, so something like .docx could be "ZIP/UTF-8/XML/Microsoft Office Open XML®/Paged document".


  • Considered Harmful

    @PleegWat .dat is anything other than NBT? 🚎


  • Considered Harmful

    @Benjamin-Hall said in WTF Bites:

    @anonymous234 said in WTF Bites:

    @error Office can save files as ".xml". Probably a feature added at some point during the brief "XML is the future" craze, so now it must remain there forever.

    Somehow during that period, a lot of people forgot the difference between a serialization format and a complete file format. It makes as much sense as using the extension ".bytes".

    Of course Office can save as xml. That's what the .docx/etc. files are, really.

    No, the docx format is a much bigger wtf than that.



  • @error said in WTF Bites:

    @Benjamin-Hall said in WTF Bites:

    @anonymous234 said in WTF Bites:

    @error Office can save files as ".xml". Probably a feature added at some point during the brief "XML is the future" craze, so now it must remain there forever.

    Somehow during that period, a lot of people forgot the difference between a serialization format and a complete file format. It makes as much sense as using the extension ".bytes".

    Of course Office can save as xml. That's what the .docx/etc. files are, really.

    No, the docx format is a much bigger wtf than that.

    .docx is xml wrapped in a zip file, with a bunch of other crap. But you need to write the xml to be able to make them, so office being able to save in straight xml makes total sense. You just go half-way then stop.


  • Considered Harmful

    @Benjamin-Hall said in WTF Bites:

    .docx is xml wrapped in a zip file, with a bunch of other crap. But you need to write the xml to be able to make them, so office being able to save in straight xml makes total sense. You just go half-way then stop.

    And this justifies Word making itself the default XML editor? Or even an option to edit arbitrary XML files?



  • @anonymous234 said in WTF Bites:

    You know from that that you can open the file in notepad, which is better than nothing.

    That's about all that file extensions can say in general. They tell the OS "whatever application is associated with .txt or .docx or .boner should be able to handle what's in this file, and should be launched when you double click it."


Log in to reply