WTF Bites



  • @error said in WTF Bites:

    @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?

    Nope. Just justifies why it can save in XML format at all.



  • @error said in WTF Bites:

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

    TBF, it's (slightly) more reasonable than having IE be the default handler for .xml files.


  • Considered Harmful

    @hungrier said in WTF Bites:

    @error said in WTF Bites:

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

    TBF, it's (slightly) more reasonable than having IE be the default handler for .xml files.

    At least IE shows it as a tree of nodes. Word just opens the file as a text document.



  • @error said in WTF Bites:

    @hungrier said in WTF Bites:

    @error said in WTF Bites:

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

    TBF, it's (slightly) more reasonable than having IE be the default handler for .xml files.

    At least IE shows it as a tree of nodes. Word just opens the file as a text document.

    And adds the +/- as characters so when you copy/paste it from there you also have to clean up invalid characters.


  • Fake News

    Cross-posting:

    @error said in The Official @error_bot Crossword Thread:

    Canvas API requires you to center things within pixels to render them sharply, which means drawing everything at (x+.5,y+.5) rather than at (x,y). (:trwtf:)

    Should have slightly crisper text now.


  • Considered Harmful

    @JBert said in WTF Bites:

    Cross-posting:

    @error said in The Official @error_bot Crossword Thread:

    Canvas API requires you to center things within pixels to render them sharply, which means drawing everything at (x+.5,y+.5) rather than at (x,y). (:trwtf:)

    It feels like a :wtf: because it breaks established conventions/expectations, but it makes perfect sense if you conceptualize pixels as squares with area rather than infinitesimal points. Starting and ending points at whole numbers means you are drawing at the edges of the pixels, and so the lines get antialiased between the neighbors.

    I guess they could/should have shifted the grid .5* units.

    * :pendant: sqrt(2)/2


  • BINNED

    @JBert Not a WTF. Graphics software does the same thing.

    If a stroke is an odd number of pixels wide, it should be centred on a pixel. If it's an even number of pixels wide, it should be along the pixel boundary. If you have a line that's 2.718 pixels wide, then :wtf:



  • @error said in WTF Bites:

    I guess they could/should have shifted the grid .5* units.
    * :pendant: sqrt(2)/2

    That would also be weird, because now your image extends from (-.5, -.5) to (w-.5, h-.5). You'd have to take that into account as well, e.g., if you try to draw a full-screen quad and use (0,0) to (w,h), you'd potentially get problems with multisampling (and even without it, (0,0) is exactly on the midpoint sample, so depending on what rules you follow, the first row/column of pixels might not be considered covered by it).

    OpenGL also has the (0.5,0.5) offset.


  • Notification Spam Recipient

    @LaoC said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Edit: This is Visual Studio's fault. It's been removing the BOM from files recently and I don't know why...

    :trwtf: is a source format that needs a BOM in the first place.

    Visual Studio did it. Now, apparently, it doesn't. :mlp_shrug:


  • Notification Spam Recipient

    @levicki said in WTF Bites:

    Inb4 "Windows doesn't do this" -- yes it does if you have UEFI, secure boot, and TPM enabled.

    You wouldn't have even gotten into the installer, meaning you're :moving_goal_post: .



  • Age of Empires II had a bunch of music on CD. Because, well, reasons, no information was stored about what song had what name, both for the CD digital audio (which was even more inexplicably all one track) and for the streamed audio that was in actual files.

    The HD rerelease and expansions (which are different than the 4K rerelease and its expansions, which isn't out yet) include all the audio as MP3 files in the music folder, and as a result we can finally know what the songs were called. ... And we can mourn the loss of our ignorance as we wonder what the fuck Stephen Rippy was smoking.

    Here are the names of the bookend music:

    Expansion Title Track Victory Track
    Age of Empires II: The Age of Kings Quest for Butter Carne y Helado
    Age of Empires II: The Conquerors Quest for Jam Rich Corinthian Leather
    Age of Empires II HD: The Forgotten Quest for Eggs Fleisch und Eiscreme
    Age of Empires II HD: The African Kingdoms Quest for Bread Prächtiges slawishes Leder
    Age of Empires II HD: The Rise of the Rajas Quest for Bacon The Bovinian Derivative

  • Considered Harmful

    @anonymous234 said in WTF Bites:

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

    What would it gain you if it were? It wouldn't actually distinguish it from the dozens of other programs that also store documents with a completely different structure as XML, would it?

    @LaoC If all you know about a file is "it's text", .txt is acceptable (although ".utf8" might be better).

    Or .la1 or .k8r or .u16 or however you can stuff the myriad of possible text encodings into the 3 characters? OK, it's the 21st century, so let's permit a few more—but if we want to eliminate having to look at the content, we'll have to add the line endings as well: myletter.windows1252_crlf? myletter.utf16_noBOM_cr? :doing_it_wrong:

    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.

    You can hopefully open it in the right version of Notepad (when was it that they started to allow more then 64K?), just like you can open an XML document in an XML editor.

    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".

    You mean you'd reinvent a complicated version on MIME? OK … but what for? That string isn't something you can stuff in a file extension for that poor legacy kind of in-band file type signalling, so it's useless for humans. And it's also useless for machines because your program always has to check whether it can read something anyway because it might be the wrong version or broken or declared to be something it is not to exploit you.


  • Notification Spam Recipient

    @TwelveBaud said in WTF Bites:

    what the fuck Stephen Rippy was smoking.

    Not enough, apparently. Seems all food-y.



  • @LaoC said in WTF Bites:

    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.

    I don't think I've ever seen <!DOCTYPE …> in XML. It is a SGML thing, and used to be present in most HTML documents until HTML 5 Forever. But XML documents generally only have a <?xml version="1.0" encoding="utf-8"?> and a root element that is supposed to be characteristic for the actual format. If you are lucky it is properly namespaced, but most XML format designers never understood namespaces.



  • @Tsaukpaetra said in WTF Bites:

    @LaoC said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Edit: This is Visual Studio's fault. It's been removing the BOM from files recently and I don't know why...

    :trwtf: is a source format that needs a BOM in the first place.

    Visual Studio did it. Now, apparently, it doesn't. :mlp_shrug:

    There is a configuration option setting the format for source files and it should have both bombfull and bombless variants, so it probably got reconfigured (or the original configuration got lost in upgrade).


  • Notification Spam Recipient

    @Bulb said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    @LaoC said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Edit: This is Visual Studio's fault. It's been removing the BOM from files recently and I don't know why...

    :trwtf: is a source format that needs a BOM in the first place.

    Visual Studio did it. Now, apparently, it doesn't. :mlp_shrug:

    There is a configuration option setting the format for source files and it should have both bombfull and bombless variants, so it probably got reconfigured (or the original configuration got lost in upgrade).

    Nobody has ever known such an option existed, much less touched it. 🤷♂


  • Considered Harmful

    @Bulb said in WTF Bites:

    @LaoC said in WTF Bites:

    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.

    I don't think I've ever seen <!DOCTYPE …> in XML. It is a SGML thing, and used to be present in most HTML documents until HTML 5 Forever. But XML documents generally only have a <?xml version="1.0" encoding="utf-8"?> and a root element that is supposed to be characteristic for the actual format. If you are lucky it is properly namespaced, but most XML format designers never understood namespaces.

    Yes, then it's called "well-formed" but not "valid". But you're right, Doctypes are rare in the wild, although the corpus markup that is pretty much the only thing I've done with XML (apart from fucking with Rhythmbox files) generally had one.



  • @Tsaukpaetra I did.

    See, I was working on this software, which was compiled to WinCE (with VS2008), Android (with gcc 4.9, back then) and iOS (even a bit older gcc IIRC). It had to process strings in various languages, so it internally worked in mostly in utf-8, switching to ucs-2 when convenient.

    Now the problem is that Visual C++ defaulted (and I believe still defaults) to legacy codepage for source encoding and 8-bit strings. And you could tell it the source is utf-8 by using bomb, but you couldn't actually tell it what encoding to use for the legacy string—it picked cp1250 from the system and ran with it, and recoded narrow strings to it!

    So you could either have untouched narrow strings, but not being able to type them in, or properly encoded wide strings, but not both.

    But when we started with Android, it didn't have wchar_t at all, and the next release introduced it—with 4 bytes, so incompatible with Windows, which are stuck at 2. But gcc never touches the narrow strings.

    So I came up with two options that worked with encoding in Visual Studio (the editor) set to utf-8 with byte-order mark:

    1. Use the _T() macro to produce wide strings on Windows and define it to produce narrow strings on Android, and use a string type constructible from either, which we had.
    2. Convert the utf-8 to octal² escapes and use that in a narrow string, because Visual C++ is smart enough not to recode those.

    ¹ You can force it now that C++17 introduced u8"", but this has been a couple of years and we were stuck with VS2008 anyway because the newer Visual Studios discontinued the Windows CEEC SDK.

    ² Octal escapes are better, because they read at most three characters, while hex escapes read all following hex digits even though it can only use two. So if you convert, say "ča", you can write "\304\215a" directly, but if you wrote "\xc4\x8da", it would be interpreted as "\xc4\xda", so you had to write "\xc4\x8d""a", which complicates the conversion script.



  • @LaoC said in WTF Bites:

    Yes, then it's called "well-formed" but not "valid".

    DTD was basically replaced by the more specific XSD, and formats defined by the later—which is most of those that are actually defined these days—don't have the corresponding DTD, even though it could probably be generated automatically from the XSD. And everybody still calls XML documents “valid” if they conform to the XSD. It's a bit of a mess…


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    I don't think I've ever seen <!DOCTYPE …> in XML.

    Schemas are preferred these days to DTDs; they're better at expressing constraints on leaf values and can be more flexible in their supported element patterns too. This is good too, as writing a DTD was a miserable experience.



  • @dkf said in WTF Bites:

    This is good too, as writing a DTD was a miserable experience.

    Until you see some of the abominations of XSDs. Especially polymorphic ones—i.e. the ones which contain derived types, elements defined to the base type and the actual instance using xi:type to specify what the element actually is—are fun to understand. We have such thing in current project.


  • Discourse touched me in a no-no place

    @Bulb Doesn't mean that the DTD for it would be good. (I have written complex schemas and DTDs. There are better support tools for schemas.)



  • @dkf Well, a DTD would not be able to describe the detailed rules it uses, as it has no way to say that this element can contain that element only if this attribute has that value.



  • Our project has configuration and script to build documentation via Doxygen.

    1. :wtf: it only generates PDF, no HTML.
    2. :wtf: when I just tried it, it failed midway generating said PDF with no useful error message.
    3. :wtf: the continuous integration only runs it if doing build with tests (you can select whether you want only build, only tests, or both).
    4. :wtf: the continuous integration ignores any and all errors from generating the documentation.

    Bonus :wtf:: the script checks whether it is run from the directory where it lives… but it can't just cd there.



  • … pdflatex writes the error in a log file. I hunted it down (after running pdflatex manually, because the :wtf: script wipes the build directory at the end and takes the log with it), and it turned out to be a very cryptic error about command that does not actually occur in the .tex file, without trace of expansion to match it up to the document (par for the course for TeX). Searching turns up

    Adding the mentioned draft option silences the error, but there is nothing that looks like a link broken across anything on the mentioned page (either by linear or document count; there is a couple of roman-numbered pages with the table of content at the beginning, so they are different).

    This being Doxygen-generated, even if there was a link, I couldn't reliably fix it.

    Anyway, :trwtf: is not generating HTML, which would be muuuuuch more practical and can't produce this kind of errors.


  • Trolleybus Mechanic

    I just spent 2 hours trying to figure out why an innocent looking commit crashed our Tizen TV web app. Turns out, if you put a file with unicode characters in name, it crashes the installer with 'no space left on device'. The whole Tizen environment is a great source of wtfs.



  • @sebastian-galczynski said in WTF Bites:

    The whole Tizen environment is a great source of wtfs.

    We have a fairly large thread all about it


  • Fake News

    @hungrier said in WTF Bites:

    @sebastian-galczynski said in WTF Bites:

    The whole Tizen environment is a great source of wtfs.

    We have a fairly large thread all about it

    Not to forget the other topics by our now-outside man reporting on some other weird development practices.


  • Trolleybus Mechanic

    @hungrier I've seen it, but it seems more specifically related to the EFL. The rest of the platform, their eclipse-based, NullPointerException-throwing IDE, 5 years old Webkit version are equally good.


  • 🚽 Regular

    @sebastian-galczynski said in WTF Bites:

    Tizen

    @error_bot gif what year is this


  • 🔀



  • @Bulb said in WTF Bites:

    @LaoC said in WTF Bites:

    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.

    I don't think I've ever seen <!DOCTYPE …> in XML. It is a SGML thing, and used to be present in most HTML documents until HTML 5 Forever. But XML documents generally only have a <?xml version="1.0" encoding="utf-8"?> and a root element that is supposed to be characteristic for the actual format. If you are lucky it is properly namespaced, but most XML format designers never understood namespaces.

    I'm currently integrating with a system that will piss itself if the file doesn't have both the XML header and DOCTYPE. It also pisses itself if there is space indentation and a few other odd things. If you run the file that the system accepts through an XML-linter, you get a lot of errors. All the strangeness is leading me to believe that they have some homebrew xml parsing going on.
    And I looked at the code from another system that sends xml to the same target as I am doing. They are building XML via string concatenation in Java.
    It's not not like there hasn't been XML libraries for Java since forever by now.. I think it was included in the standard library in like 2002 or something.



  • @LaoC said in WTF Bites:

    @anonymous234 said in WTF Bites:

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

    What would it gain you if it were? It wouldn't actually distinguish it from the dozens of other programs that also store documents with a completely different structure as XML, would it?

    Yes it... would? I don't understand.

    @LaoC said in WTF Bites:

    And it's also useless for machines because your program always has to check whether it can read something anyway because it might be the wrong version or broken or declared to be something it is not to exploit you.

    You seriously can't imagine any possible case where someone would like to represent the kind of information a file has?



  • This list layout. I've marked it up to show the items in alphabetical order:

    c50bcebf-4317-4981-93e4-e50ec827cf99-image.png


  • Notification Spam Recipient

    @Bulb said in WTF Bites:

    Tsaukpaetra I did.

    What I meant to say is, nobody who touched this codebase did. And now the source is (ever so slowly) losing its BOMs....



  • @hungrier Looks like it's adding things to columns in order. If the image sizes were different enough they could get completely out of sync.



  • VMWare Workstation

    Sometimes when I'm trying to drag and drop files from the guest to the host, it won't let the mouse cursor out of the guest machine for a while, and so I have to keep bumping against the edge of the window like a fly against a ... window



  • @error said in WTF Bites:

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

    🤷♂ Not on my machine. WordPad is the default. (Oh yeah, I haven't installed XMLNotepad on that machine yet... <install/> That's better.)



  • @LaoC said in WTF Bites:

    myletter.windows1252_crlf? myletter.utf16_noBOM_cr? :doing_it_wrong:

    The Swampy thread is :arrows:



  • TILA: Chrome's download page isn't supported by IE11 because of the big brain JS required to trigger the download. It really wouldn't be Google if they aren't being the biggest ❄s by doing something too advanced for humanity to comprehend while breaking every single existing standard.

    But the best part? Windows Server 2016 only has IE11 after installation, so if you want a decent browser after setting up a Windows Server VM... either BYOCI, or download Firefox with IE11 first, and then download Chrome with Firefox. All this happening in 2k19.



  • @hungrier said in WTF Bites:

    This list layout. I've marked it up to show the items in alphabetical order:

    c50bcebf-4317-4981-93e4-e50ec827cf99-image.png

    It's called Masonry, a very old and established UI layout. Nothing to see here.



  • @_P_ said in WTF Bites:

    download Chrome with Firefox

    Why'd y'do that? You already have Firefox 😸



  • @Bulb said in WTF Bites:

    @_P_ said in WTF Bites:

    download Chrome with Firefox

    Why'd y'do that? You already have Firefox 😸

    Despite popular belief Firefox is not a Chrome clone 🚎


  • Notification Spam Recipient

    @_P_ said in WTF Bites:

    either BYOCI

    $Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
    

    HTH, HAND, YMMV, YW.

    Edit: Or, a version you can paste into the Run Box:

    PowerShell -Command "& {$P = $env:TEMP + '\chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $P; Start-Process -FilePath $P -Args '/silent /install' -Verb RunAs -Wait; Remove-Item $P}"
    


  • @Tsaukpaetra That's not what you get from the download page. The link in the download page eventually jumps to the actual link to the installation file:

    https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7BCBD773B7-804C-90C0-052E-C8E034AC331A%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable-statsdef_1%26installdataindex%3Dempty/update2/installers/ChromeSetup.exe
    

    which is this encoded:

    https://dl.google.com/tag/s/appguid={8A69D345-D564-463C-AFF1-A69D9E530F96}&iid={CBD773B7-804C-90C0-052E-C8E034AC331A}&lang=en&browser=4&usagestats=0&appname=Google%20Chrome&needsadmin=prefers&ap=x64-stable-statsdef_1&installdataindex=empty/update2/installers/ChromeSetup.exe
    

    So I'm not even sure where you got that installer link from :wtf_owl:


  • Notification Spam Recipient

    @_P_ said in WTF Bites:

    So I'm not even sure where you got that installer link from

    The Internet. Where did you think I got it? 🇱🇨

    However, there are reports that the link I provided only gives the 32-bit version, I bet some parameters are missing that could help out with that...



  • @Tsaukpaetra said in WTF Bites:

    Where did you think I got it?

    Dunno, "My uncle works at Google"? 🍹


  • Notification Spam Recipient

    @_P_ said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Where did you think I got it?

    Dunno, "My uncle works at Google"? 🍹

    No, but I do know a few Google employees. Not that that says much...



  • @_P_ said in WTF Bites:

    @Bulb said in WTF Bites:

    @_P_ said in WTF Bites:

    download Chrome with Firefox

    Why'd y'do that? You already have Firefox 😸

    Despite popular belief Firefox is not a Chrome clone 🚎

    That's why I use it 😼.


  • Considered Harmful

    @anonymous234 said in WTF Bites:

    @LaoC said in WTF Bites:

    @anonymous234 said in WTF Bites:

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

    What would it gain you if it were? It wouldn't actually distinguish it from the dozens of other programs that also store documents with a completely different structure as XML, would it?

    Yes it... would? I don't understand.

    If they continue to call their file something.xml. But "XML document" means next to nothing. Technically, everything stored in XML is a "document" so any/all the other programs should use that suffix, too.

    @LaoC said in WTF Bites:

    And it's also useless for machines because your program always has to check whether it can read something anyway because it might be the wrong version or broken or declared to be something it is not to exploit you.

    You seriously can't imagine any possible case where someone would like to represent the kind of information a file has?

    Other than for consumption by either humans or machines? No.


Log in to reply