WTF Bites



  • @Kian That said, I've never actually used CComObject::CreateInstance(). I've programmed very little in ATL, and when creating objects, I'd use CoCreateInstance(blah, blah, &mySmartPointer) instead.


  • I survived the hour long Uno hand

    @Kian said in WTF Bites:

    it would mean that most of our infrastructure is built on shaky, unreliable foundations!

    I mean, have you seen how many Cloud Web Servers are running Apache on Linux these days? 🚎



  • How can you be so incompetent that you decide to change a table name, but you don't search/replace it everywhere in your code ???

    @copyright (C) 2014 onwards Microsoft, Inc. (http://microsoft.com/)
    

    Oh, right. Nevermind


  • kills Dumbledore

    @TimeBandit said in WTF Bites:

    How can you be so incompetent that you decide to change a table name, but you don't search/replace it everywhere in your code

    Breaking change, implementation detail. Shouldn't be needed


  • kills Dumbledore

    Found in a web.config

        <!--​ Application ID for MSN Live Search -->
    

    How old is this site?


  • Notification Spam Recipient

    @Jaloopa said in WTF Bites:

    Found in a web.config

        <!--​ Application ID for MSN Live Search -->
    

    How old is this site?

    I think there's something similar in ours regarding Federated login? I think? But it's not enabled.



  • So, in another forum I just saw someone announce a Node module intended to ease file uploads. Fair enough, it's a bit of a hassle (then again, not that complicated).

    Then they began to talk about "compressing files before upload to save bandwidth".

    I proceeded to tell the guy that this was a dumb idea as it has next to no gains in the normal use cases, i.e. uploading images and videos.

    But what about documents like Word or PDF files, he countered?

    I then took my thesis (about 150 pages, roughly 10.1 MB) which I had written in Word. Zipping the file resulted in a file size of 10.0 MB. Same for the PDF.

    Yeah, that's really a worthwhile undertaking. Plus, if you're uploading huge files on a regular basis using browser uploads you're doing it wrong anyway.



  • @Rhywden said in WTF Bites:

    Word

    docx files are zips. Rename the docx to zip and browse on in! (I'm sure if you modify it, you'll probably break something...)



  • @dcon I kind of figured that after seeing the compression result :)

    The guy is currently trying to tell me that they're doing "thousands of huge file uploads" daily.

    I'm not sure if he ever heard of SFTP or FTPS - I mean, there must be a reason why those protocols' acronyms include an "F". :sadface:


  • I survived the hour long Uno hand

    @Rhywden
    Secure Failed Transport Protocol
    Failed To Put Shit [In the right place]



  • @dcon said in WTF Bites:

    @Rhywden said in WTF Bites:

    Word

    docx files are zips. Rename the docx to zip and browse on in! (I'm sure if you modify it, you'll probably break something...)

    Not only are they zips... they're compressed zips. :pendant:


  • Notification Spam Recipient

    @anotherusername said in WTF Bites:

    @dcon said in WTF Bites:

    @Rhywden said in WTF Bites:

    Word

    docx files are zips. Rename the docx to zip and browse on in! (I'm sure if you modify it, you'll probably break something...)

    Not only are they zips... they're compressed zips. :pendant:

    Oh yeah, forgot you could have a zip file with no compression....


  • BINNED

    @Rhywden said in WTF Bites:

    I proceeded to tell the guy that this was a dumb idea as it has next to no gains in the normal use cases, i.e. uploading images and videos.
    But what about documents like Word or PDF files, he countered?
    I then took my thesis (about 150 pages, roughly 10.1 MB) which I had written in Word. Zipping the file resulted in a file size of 10.0 MB. Same for the PDF.

    There is a difference between image/video and your thesis. You can use a lossy compression on the former, while you need lossless transformation to get full marks on your thesis. Well, if you have images in your docx file, you can transcode the embedded media.

    1. If the original media has a data size higher than its sensor's dynamic range. You can remove all of the noise bits
    2. If the original media has a higher dynamic range than what sharpest of human eyes can perceive, again you can cut the fat
      :pendant:


  • @dse said in WTF Bites:

    There is a difference between image/video and your thesis. You can use a lossy compression on the former, while you need lossless transformation to get full marks on your thesis.

    But in the typical upload case, the image/video file has already had that lossy compression applied. Further attempts to compress the file are going to have negligible benefit.


  • BINNED

    @HardwareGeek said in WTF Bites:

    @dse said in WTF Bites:

    There is a difference between image/video and your thesis. You can use a lossy compression on the former, while you need lossless transformation to get full marks on your thesis.

    But in the typical upload case, the image/video file has already had that lossy compression applied. Further attempts to compress the file are going to have negligible benefit.

    1. I have seen el-cheapo Point&Shoot cameras have just too many number of bits than what their lens/cmos is really capable of.
    2. Point number 2 still applies, unless you are some sort of videophile and claim to have supernatural vision.
    3. You can reduce the size, at the same time, to preserve the quality.


  • @dse True, but then you're no longer in the realm of "a Node module intended to ease file uploads," you're talking about image processing and determining the image quality of some random, (probably) already-compressed image file (if it even is an image) and whether the original quality is so low that further compression is possible without further degradation.

    @dse said in WTF Bites:

    If the original media has a higher dynamic range than what sharpest of human eyes can perceive, again you can cut the fat

    We don't know what it's being uploaded to. Perhaps it's going to be used for further manipulation of some sort, or print publication, or enlarged to billboard-size, and the extremely high quality is necessary.

    This is (as far as we know from the information provided so far) a general-purpose file upload utility. I wouldn't expect it to know or care what the contents of the file are, much less do lossy transformation of the content.


  • BINNED

    @HardwareGeek said in WTF Bites:

    This is (as far as we know from the information provided so far) a general-purpose file upload utility. I wouldn't expect it to know or care what the contents of the file are, much less do lossy transformation of the content.

    @HardwareGeek ✋ 🤚 Ok you win the :pendant: 🏆 this time. The library could still have an option to determine the intended use-case though. If the module is not going the extra miles (yes image processing too) then it is useless.



  • @dse said in WTF Bites:

    @HardwareGeek Ok you win the :pendant: 🏆 this time.

    I want to win the :pendant: :badger:. I miss my :badger::badger:.



  • @dse said in WTF Bites:

    while you need lossless transformation to get full marks on your thesis

    I wonder if anyone has researched lossy compression schemes for English text?

    Edit: yes, they actually have.



  • @anonymous234 said in WTF Bites:

    @dse said in WTF Bites:

    while you need lossless transformation to get full marks on your thesis

    I wonder if anyone has researched lossy compression schemes for English text?

    yes ppl txt it all the time lol



  • @Rhywden I thought most browsers could already gzip-compress stuff? Although I have no idea if that applies to uploads, or how to force it, etc.

    And yes, most files that are actually worth compressing are already compressed.


  • FoxDev

    @anonymous234 said in WTF Bites:

    I thought most browsers could already gzip-compress stuff?

    They all support it.

    @anonymous234 said in WTF Bites:

    Although I have no idea if that applies to uploads, or how to force it, etc.

    Dunno about uploads, but I know for downloading, so long as the browser sends Accept-Encoding: gzip, the server can choose to GZIP the data (I'm not aware of an ability to force it to).

    deflate is another supported option, but I think gzip is more common.



  • @anonymous234 said in WTF Bites:

    @dse said in WTF Bites:

    while you need lossless transformation to get full marks on your thesis

    I wonder if anyone has researched lossy compression schemes for English text?

    Edit: yes, they actually have.

    There's already a practical example right there on the page, but I don't want to spend $30 to find out how lossy it is.


  • Java Dev

    @anonymous234 It does not work for uploads, because while support is required in HTTP/1.1 it is impossible to know at the time of creating the request whether the server supports that, so requests always have to be compatible with HTTP/1.0 servers. It also does not work for headers at all, while message headers are a significant part of HTTP traffic. HTTP/2 does support compression for both request and response, both headers and payload.

    @RaceProUK said in WTF Bites:

    deflate is another supported option, but I think gzip is more common.

    If I remember correctly, the only difference between deflate and gzip is that the latter includes an additional binary header.



  • @PleegWat said in WTF Bites:

    it is impossible to know at the time of creating the request whether the server supports that

    The vast majority of the time when you're uploading something, you just downloaded a bunch of stuff from that exact server, so you already know what it supports. And if you don't...



  • @Maciejasjmj said in WTF Bites:

    @scudsucker said in WTF Bites:

    More than 3/4 of my code is error-testing and recovery;

    ON ERROR RESUME NEXT covers both!

    So does PLEASE COME FROM.

    Well, no, it doesn't, but it doesn't make any less sense. That VB5/6 is less sensible than a joke extension to a joke language means that VB5/6 is the real joke.



  • @RaceProUK said in WTF Bites:

    but I think gzip is more common.

    brotli is supported by Chrome.


  • Discourse touched me in a no-no place

    @PleegWat said in WTF Bites:

    If I remember correctly, the only difference between deflate and gzip is that the latter includes an additional binary header.

    Well, there's one other key thing: some webservers fuck up deflate compression. There's three compression schemes in the zlib set, and they differ just in what that binary header is: of the schemes deflate and compress, one has no header at all and the other has a very small header (the gzip scheme has a much larger header that can have user-useful metadata in it). But which one you get when you ask for a compression scheme to be used by a webserver is uncertain, and it is a common misconfiguration to get told that one is in use when the other is. The one that works reliably (i.e., when it is selected, it works correctly) is gzip despite all the extra overhead. :(


  • Discourse touched me in a no-no place

    @anotherusername said in WTF Bites:

    The vast majority of the time when you're uploading something, you just downloaded a bunch of stuff from that exact server, so you already know what it supports. And if you don't...

    You don't actually know that at all. Due to the complexity of message routing inside web servers (partial proxies, etc.), you have to determine the information on a per-URL basis. Or, as you noted, via OPTIONS though that inevitably introduces more overhead in the interaction due to the latency of needing to wait for the other end to respond. It might be worthwhile for a large file upload.



  • This post is deleted!

  • area_can

    http://www.salon.com/2016/12/24/hacker-house-blues-my-life-with-12-programmers-2-rooms-and-one-21st-century-dream-2/

    I lived in an illegal Airbnb with 12 roommates split between two rooms. There were six people packed into my bedroom alone — seven, if you included the guy who lived in the closet...

    I had moved to San Francisco to break into the tech world after being accepted into one of those ubiquitous 12-week coding boot camps. I had dreams of becoming a programmer, hoping one day I could land a remote contracting gig — a job where I could work from wherever and make a good living.


  • area_can

    @bb36e if this is the dream please wake me up


  • Notification Spam Recipient

    I worked on a project where the js/css would be minified then gzipped. When the file was requested, the web server would serve the gzipped file as-is, but add a Transfer-Encoding: gzip header to the response...



  • I just got pulled into a 24-person Skype conversation (:wtf:) where I knew exactly two people, one of whom was the contractor from hell we encountered months ago. He is wishing all his contacts a merry Christmas at once. I won't be able to report if he wishes everyone a happy New Year the same way, because unlike other Skype features, "Block this user" still works.


  • Discourse touched me in a no-no place

    @bb36e That sort of thing makes me tremendously angry. Someone is making way too much profit off that arrangement, and endangering lives to do so (as I bet the place isn't fire-certified for that sort of occupancy). The wreckage of lives reported also makes me tremendously angry. In fact, that makes me more angry than the gouging asshole that is renting the place out.

    Also, the quoted failure rate for startups seems high, and I don't see any reason to doubt it. That's a very bad sign; profit margins at the VCs will be down and they're already not usually very thick. I'm ever so happy to be not working in that area.


  • I survived the hour long Uno hand

    @dkf Programming is the new acting: for every movie star there's a hundred waitresses in LA dreaming big dreams.


  • BINNED

    @Yamikuronue said in WTF Bites:

    Programming is the new acting: for every movie star there's a hundred waitresses in LA dreaming big dreams.

    And the back room is for Gambling and Porn. Sure you can make good money but everybody else looks down on you.


  • Discourse touched me in a no-no place

    @Yamikuronue said in WTF Bites:

    Programming is the new acting

    Yes, but it's more like they're being used to channel money from VCs (via failed startups) into rental property owners, who are just exploiting the situation with very little input on their part. Or perhaps really to the banks that the apartment owner has borrowed from (I'm not exactly sure which party is really taking the profit from this). To add insult to injury, the effort of the programmers is going to be effectively wasted (due to the terrible chance of success) and they're very miserable in the process. The whole thing is just utterly exploitative.

    I need to stop thinking about this. I don't want to go to sleep angry over something happening on another continent.


  • Fake News

    @dkf It's just history repeating itself. When there's a sudden influx of people, it's the store owners / landlords who get the profits. See for example the Californian gold rush.


  • BINNED

    @dkf said in WTF Bites:

    Or perhaps really to the banks that the apartment owner has borrowed from (I'm not exactly sure which party is really taking the profit from this). To add insult to injury, the effort of the programmers is going to be effectively wasted (due to the terrible chance of success) and they're very miserable in the process. The whole thing is just utterly exploitative.

    Nope. It is the tech companies:

    Hey you wide-eyed young-college-grad 😍 I will pay you a -figure salary. Come join the cabal 👁 👁 🌈 and feel the hype. We have free food too.
    🤵 That is so kind of you! Thanks I did not know my expertise was so highly valued!
    This tiny shack 🏚 is only 1 hour from and you can rent it only for 3000/month!!!!
    🤵 Ok I guess, no chance I can buy anything anyways. Why do you look so familiar?


  • Discourse touched me in a no-no place

    @dse said in WTF Bites:

    Nope. It is the tech companies

    They're not the worst in this particular hall of shame.


  • area_can

    @dkf said in WTF Bites:

    They're not the worst in this particular hall of shame

    Hey, go to bed! Here!


  • Notification Spam Recipient

    @bb36e said in WTF Bites:

    @dkf said in WTF Bites:

    They're not the worst in this particular hall of shame

    Hey, go to bed! Here!

    TIL @bb36e considers rabbits beds...


  • area_can

    @Tsaukpaetra they're soft and fuzzy enough that just looking at one makes me sleepy


  • area_can

    Here is a website as viewed on a 1920x1080 desktop(!!) screen.

    I almost forgot I was looking at the blog, thank goodness for the hero thingamajig (the article text is in that little white rectangle at the bottom).

    0_1482855074983_capture.png



  • Our "upgraded" software no longer supports printing reports directly -- you have to use the export to PDF function and print that instead. (TRWTF.)

    Since it's web-based (accessed with Chrome), I wondered if the entire report preview pane was possibly just an iframe, and if so, how hard it'd be to write a userscript that would just grab the URL from the PDF export option and set the iframe src to that; it'd then display the report in Chrome's native PDF previewer which, IIRC, does support printing.

    So I inspected it.

    Not only was it not an iframe...

    0_1482860475133_Untitled.png

    I decided I'm not touching it.


  • I survived the hour long Uno hand

    @anotherusername for WTDWTF mod! He's got the work ethic down pat!

    :trollface:



  • @izzion Not necessarily. The desire to not wade neck-deep into a pile of 💩 does not necessarily indicate laziness. They're not mutually exclusive, to be sure, and laziness would be expected to result in avoidance of unpleasant work, but the avoidance may very well be due solely to the unpleasantness, rather than to being work.



  • @izzion @HardwareGeek it actually isn't my job, so I'm allowed.

    Also, it turns out that they're solving the original problem in a way that's better than I could've anyway -- that whole thing is going away, and it's just opening a popup window with a PDF in it. (This after sending an email that said they weren't.)


  • I survived the hour long Uno hand

    Hey, what do you know, setting up your site so that it just has valuable PDFs sitting around that are only visible if you know the link isn't a viable security option! They must have been using the NY Times Paywall software to "secure" access to the data...


Log in to reply