WTF Bites



  • @bb36e said in WTF Bites:

    One of these three options is not like the other...

    0_1509583883442_Screenshot_20171101-205035.png

    So how many firstborn son sacrifices earn you a $5 Amazon gift card?


  • Notification Spam Recipient

    @maciejasjmj If it's more than 1 you might have a problem



  • @vault_dweller said in WTF Bites:

    @maciejasjmj If it's more than 1 you might have a problem

    Does it have to be my firstborn son?


  • Notification Spam Recipient

    @maciejasjmj Historically yes, but I'm sure they're open for negotiations


  • Discourse touched me in a no-no place

    @maciejasjmj In these enlightened times, I'm sure your firstborn daughter (or other non-gender-specific offspring) will be suitable instead.



  • @bb36e said in WTF Bites:

    @tsaukpaetra said in WTF Bites:

    So somewhere along the line, the government became untrusted

    Have you been living under a rock for the past 50 years? 🚎

    Well, until my parents found me.
    🥌🥌🥌
    🥌👶🥌


  • Notification Spam Recipient

    @dkf said in WTF Bites:

    @maciejasjmj In these enlightened times, I'm sure your firstborn daughter (or other non-gender-specific offspring) will be suitable instead.

    What about firstdead grandparent? Would that work?


  • Winner of the 2016 Presidential Election

    @djls45 said in WTF Bites:

    @bb36e said in WTF Bites:

    @tsaukpaetra said in WTF Bites:

    So somewhere along the line, the government became untrusted

    Have you been living under a rock for the past 50 years? 🚎

    Well, until my parents found me.
    🥌🥌🥌
    🥌👶🥌

    That explains a lot.



  • Obligatory I-hate-fortran-and-fortran-tools--post #7551235.

    Messing with building some fortran source. Original source builds "fine" (at least for what passes as "fine" around fortran codes, I suppose). My custom build doesn't. Same machine/same compiler.

    I get the following error:

    error #8284: If the actual argument is scalar, the dummy argument shall be scalar unless the actual argument is of type character or is an element of an array that is not assumed shape, pointer, or polymorphic.

    Granted, I do have some different flags passed to the compiler. Process of elimination yields that removing -warn all suppresses that error. Enabling warnings produces errors? :wtf:

    Anyway, not my code, just need to build it. Don't want to disable -warn all across the board, though, so... eh? -diag-disable 8284 maybe?

    Cannot disable Fortran error message 8284

    That's totally a lie -- I can disable it by not enabling warnings in the first place. :-/



  • I'm too lazy to find a Discourse/StackOverflow thread, but here's something interesting from SO:

    In particular, I noticed this from the question:

    This has been raised here before - but was marked as status-bydesign

    Doesn't SO use a non-relational database? Which means that any username updates would have to crawl through the entire database to find all references to the user in order to update the name?



  • SewageOverflow's Rob (sort of like TV's Frank, but lamer) said:

    It's a community wiki question, and displays 'KiwiBastard' as one of the contributors:

    However, clicking the link to their profile, it turns out their username has changed

    Not a WTF. The name was changed in compliance to a Cease and Desist from Simon Travaglia.




  • area_can

    I guess this is what I get for running debian testing...

    ~ $ sudo apt-get -o Acquire::http::Dl-Limit=200k dist-upgrade
    ...
    Do you want to continue? [Y/n] y
    Get:1 http://debian.mirror.rafal.ca/debian testing/main amd64 libapt-pkg5.0 amd64 1.6~alpha3 [915 kB]
    0% [1 libapt-pkg5.0 2,627 B/915 kB 0%]
     **** Seccomp prevented execution of syscall 0000000035 on architecture amd64 ****
    E: Method http has died unexpectedly! 
    E: Sub-process http returned an error code (31)
    
    ~ $
    

    seems like it only happens when I try to limit the download rate. bummer



  • @djls45 said in WTF Bites:

    I'm too lazy to find a Discourse/StackOverflow thread, but here's something interesting from SO:

    In particular, I noticed this from the question:

    This has been raised here before - but was marked as status-bydesign

    Doesn't SO use a non-relational database? Which means that any username updates would have to crawl through the entire database to find all references to the user in order to update the name?

    Nah... just add a corresponding datetime field to every username field and make a "username_changelog" table, and on every access that includes a username have the query left join username_changelog on username = username_changelog.username_old and username_dt < username_changelog.changed_dt. If that returns anything, continue walking the changelog forward until you find the current username.

    Also, you should definitely make all the other primary key fields hold meaningful values that might change, too. (:doing_it_wrong:)


  • area_can

    @anotherusername this seems like a webscale solution, do you mind if I write a medium article about it?



  • @bb36e said in WTF Bites:

    @anotherusername this seems like a webscale solution, do you mind if I write a medium article about it?

    Feel free to steal it. I only ask that you don't give me the credit for it.



  • @bb36e As opposed to a large one or a small one?


  • Notification Spam Recipient

    @djls45 said in WTF Bites:

    @bb36e As opposed to a large one or a small one?

    As opposed to a rare or well-done one, of course.


  • Considered Harmful

    @tsaukpaetra said in WTF Bites:

    @djls45 said in WTF Bites:

    @bb36e As opposed to a large one or a small one?

    As opposed to a rare or well-done one, of course.

    As opposed to one which is not attuned to the spirit realm?



  • My WTF of the day: So, I once again took a look at Syncfusion's offerings of nuget packages for controls so I don't have to reinvent the wheel. Included the package I wanted into my project and promptly ran into a minor issue I wanted to clear up before trying stuff at random. Since my issue is a rather common one, I thought to myself: "I cannot be the only one with that question?" and traipsed off to their forum.

    After using their search feature I promptly found a promising thread in the list of search results. Clicked on that result - and landed in the thread overview for the package in question? :wtf:

    But still, my search result was happily quite at the top of that overview, so I clicked on it again - and found myself in the thread overview again. Which was no wonder when I looked at the indicated URI you get upon mouseover of the link - there simply was no ID for the thread or something.

    So I created an incident in their bug tracker. And then wondered. And then pressed F12. And found the below image - I guess absolutely even the least HTML-inclined person on this forum here can discern what went wrong:

    0_1509915838930_2e44a9e0-ec92-4c1e-890c-80cb65e233f8-image.png

    I only hope that their C# developers and the forum guys are not on the same team.



  • @rhywden said in WTF Bites:

    My WTF of the day: So, I once again took a look at Syncfusion's offerings of nuget packages for controls so I don't have to reinvent the wheel. Included the package I wanted into my project and promptly ran into a minor issue I wanted to clear up before trying stuff at random. Since my issue is a rather common one, I thought to myself: "I cannot be the only one with that question?" and traipsed off to their forum.

    After using their search feature I promptly found a promising thread in the list of search results. Clicked on that result - and landed in the thread overview for the package in question? :wtf:

    But still, my search result was happily quite at the top of that overview, so I clicked on it again - and found myself in the thread overview again. Which was no wonder when I looked at the indicated URI you get upon mouseover of the link - there simply was no ID for the thread or something.

    So I created an incident in their bug tracker. And then wondered. And then pressed F12. And found the below image - I guess absolutely even the least HTML-inclined person on this forum here can discern what went wrong:

    0_1509915838930_2e44a9e0-ec92-4c1e-890c-80cb65e233f8-image.png

    I only hope that their C# developers and the forum guys are not on the same team.

    Quick! Make a topic with the ID <script>alert(/XSS/)</script>


  • Notification Spam Recipient

    @ben_lubar said in WTF Bites:

    @rhywden said in WTF Bites:

    My WTF of the day: So, I once again took a look at Syncfusion's offerings of nuget packages for controls so I don't have to reinvent the wheel. Included the package I wanted into my project and promptly ran into a minor issue I wanted to clear up before trying stuff at random. Since my issue is a rather common one, I thought to myself: "I cannot be the only one with that question?" and traipsed off to their forum.

    After using their search feature I promptly found a promising thread in the list of search results. Clicked on that result - and landed in the thread overview for the package in question? :wtf:

    But still, my search result was happily quite at the top of that overview, so I clicked on it again - and found myself in the thread overview again. Which was no wonder when I looked at the indicated URI you get upon mouseover of the link - there simply was no ID for the thread or something.

    So I created an incident in their bug tracker. And then wondered. And then pressed F12. And found the below image - I guess absolutely even the least HTML-inclined person on this forum here can discern what went wrong:

    0_1509915838930_2e44a9e0-ec92-4c1e-890c-80cb65e233f8-image.png

    I only hope that their C# developers and the forum guys are not on the same team.

    Quick! Make a topic with the ID <script>alert(/XSS/)</script>

    I doubt you get to choose your own topic IDs...



  • @rhywden that looks like a combination of several things... first of all, they're not using quotes around the href (obvious... that's what you were implying, right), but secondly, there's a whitespace character showing up in the href somehow.

    Here's their template code:

    <div class="thread-title regular">
        <a href=/forums/{{:PlatformShortName}}/{{:ThreadId}}>{{:ThreadTitle}}</a>
        {{if StickyThread}}<span class="sticky-icon  img-responsive"><p class="sticky-desc small">Sticky Thread</p></span>{{/if}}
        {{if ThreadMovedTo > 0}}<a id="moved-icon" href=/forums/{{:PlatformShortName}}/{{:ThreadId}}><span class="icon moved img-responsive"></span></a>{{/if}}
    </div>
    <div class="thread-detail">{{:CreateDate}} by {{:CreatedBy}} |
    <a href=/forums/{{:PlatformShortName}}>{{:PlatformName}}</a>
    </div>
    

    I deduce that {{:PlatformShortName}} has a trailing whitespace character. The HTML code that they're generating is invalid:

    <a href=/forums/xamarin.forms/sfimageeditor /ThreadId>ThreadTitle</a>
    

    And it's getting "fixed" to become

    <a href="/forums/xamarin.forms/sfimageeditor" ThreadId="">ThreadTitle</a>


  • @anotherusername said in WTF Bites:

    @rhywden that looks like a combination of several things... first of all, they're not using quotes around the href (obvious... that's what you were implying, right), but secondly, there's a whitespace character showing up in the href somehow.

    Here's their template code:

    <div class="thread-title regular">
        <a href=/forums/{{:PlatformShortName}}/{{:ThreadId}}>{{:ThreadTitle}}</a>
        {{if StickyThread}}<span class="sticky-icon  img-responsive"><p class="sticky-desc small">Sticky Thread</p></span>{{/if}}
        {{if ThreadMovedTo > 0}}<a id="moved-icon" href=/forums/{{:PlatformShortName}}/{{:ThreadId}}><span class="icon moved img-responsive"></span></a>{{/if}}
    </div>
    <div class="thread-detail">{{:CreateDate}} by {{:CreatedBy}} |
    <a href=/forums/{{:PlatformShortName}}>{{:PlatformName}}</a>
    </div>
    

    I deduce that {{:PlatformShortName}} has a trailing whitespace character. The HTML code that they're generating is invalid:

    <a href=/forums/sfimageeditor /ThreadId>ThreadTitle</a>
    

    And it's getting "fixed" to become

    <a href="/forums/sfimageeditor" ThreadId="">ThreadTitle</a>
    

    Instead of checking developer tools, can you check View Source? I'm pretty sure your browser is doing the "fixing".



  • @anotherusername What really gets me: How does stuff like that make it into production and stay there? I mean it‘s pretty obvious to anyone that this is broken.


  • 🚽 Regular

    @scholrlea said in WTF Bites:

    Consider the signal officially boosted, SidAlpha.
    Dirty Devs: Blood of Old Developer threatens DMCA and Lawsuit against me – 22:20
    — SidAlpha

    Which game were those images taken from and why didn't he credit them?


  • Discourse touched me in a no-no place

    @rhywden said in WTF Bites:

    How does stuff like that make it into production and stay there?

    I think I'll take “What is testing and why might some people want to consider using it?” for $20.


  • Discourse touched me in a no-no place

    @zecc said in WTF Bites:

    Which game were those images taken from

    According to comments on the video, it's Hellblade: Senua's Sacrifice (which I'd never heard of before, but it looks pretty).



  • @ben_lubar said in WTF Bites:

    Instead of checking developer tools, can you check View Source?

    I did check view source... that template code I posted was the source.

    I'm pretty sure your browser is doing the "fixing".

    Yes, the browser is fixing the invalid HTML generated by whatever :wtf: nest of JS that turns that template code into actual HTML.

    edit: I think they fixed it?


  • ♿ (Parody)

    @djls45 said in WTF Bites:

    Doesn't SO use a non-relational database?

    No:

    Stack Overflow uses...Database SQL Server 2014 CTP2 running Microsoft Windows Server 2012 R1 x64

    (Allegedly)



  • @boomzilla Ah. Could be that they're using a relational database to store data flatly. :P



  • @anotherusername Yes, I got a reply to my ticket that they fixed the issue. I can say that about them: When you open tickets they answer within 24 hours even on the free support level.

    And to preempt the question: Yes, the answers are also usable and related to the content of the ticket.



  • @rhywden Well, I mean... they still didn't put double quotes around the href, or anything crazy like that. It does look like they've successfully stripped the trailing whitespace off of that one variable, though, which was breaking everything.



  • @anotherusername said in WTF Bites:

    @rhywden Well, I mean... they still didn't put double quotes around the href, or anything crazy like that. It does look like they've successfully stripped the trailing whitespace off of that one variable, though, which was breaking everything.

    What more do you want? Perfection?!?!

    🚎

    ;)



  • Magento wart of the day:

    Controller code:

    if ($this->getRequest()->has('item') && !$this->getRequest()->getPost('update_items') && !($action == 'save')) {
        $items = $this->getRequest()->getPost('item');
        $items = $this->_processFiles($items);
        $this->_getOrderCreateModel()->addProducts($items);
    }
    

    Model function addProducts:

    public function addProducts(array $products)
    {
        foreach ($products as $productId => $config) {
            $config['qty'] = isset($config['qty']) ? (float)$config['qty'] : 1;
            try {
                $this->addProduct($productId, $config);
            }
            catch (Mage_Core_Exception $e){
                $this->getSession()->addError($e->getMessage());
            }
            catch (Exception $e){
                return $e;
            }
        }
        return $this;
    }
    

    That's right, if a general exception occurs instead of our custom one, let's just return it to the caller, who will merrily ignore it. We can't see any errors so everything is fine, right? 👼



  • @dcoder said in WTF Bites:

    Magento wart of the day:

    Controller code:

    if ($this->getRequest()->has('item') && !$this->getRequest()->getPost('update_items') && !($action == 'save')) {
        $items = $this->getRequest()->getPost('item');
        $items = $this->_processFiles($items);
        $this->_getOrderCreateModel()->addProducts($items);
    }
    

    Model function addProducts:

    public function addProducts(array $products)
    {
        foreach ($products as $productId => $config) {
            $config['qty'] = isset($config['qty']) ? (float)$config['qty'] : 1;
            try {
                $this->addProduct($productId, $config);
            }
            catch (Mage_Core_Exception $e){
                $this->getSession()->addError($e->getMessage());
            }
            catch (Exception $e){
                return $e;
            }
        }
        return $this;
    }
    

    That's right, if a general exception occurs instead of our custom one, let's just return it to the caller, who will merrily ignore it. We can't see any errors so everything is fine, right? 👼

    It's an implementation of method chaining where you need to check the type of the returned value, which is even worse than doing nothing.


  • area_can

    support.apple.com/en-ca/ht208240

    If you type the letter “i” and it autocorrects to an “A” with a symbol
    If you updated your iPhone, iPad, or iPod touch to iOS 11 or later and find that when you type the letter “i” it autocorrects to the letter “A” with a symbol, learn what to do.
    ...
    Try setting up Text Replacement for the letter "i"
    ...


  • Considered Harmful

    @bb36e said in WTF Bites:

    https://support.apple.com/en-ca/ht208240

    If you type the letter “i” and it autocorrects to an “A” with a symbol
    If you updated your iPhone, iPad, or iPod touch to iOS 11 or later and find that when you type the letter “i” it autocorrects to the letter “A” with a symbol, learn what to do.
    ...
    Try setting up Text Replacement for the letter "i"
    ...

    This can't possibly be real.
    *checks link*
    Holy fuck.


  • Java Dev

    I think HP can't version numbers. It keeps reminding me that there is a driver update for Intel Serial IO Driver (30.63), whereas installing it says the installed driver version is newer (30.100). Also, as the support assistant can't detect install success itself it asks me about it afterwards and then promptly ignores my answer that the driver is correctly installed and keeps on reminding me.

    (I know, tr:wtf: is using the HP Support Assistant, but that's not the biggest :wtf: of the company-provided Windows image.)


  • kills Dumbledore

    @atazhaia sounds like either alphabetical or decimal ordering: either "1" < "6" or 30.100 == 30.1 < 30.63



  • @djls45
    They actually make (an anonymized version of) their database available publicly. One of the SQL bloggers I follow cleans it up a bit and redistributes it; they use it for performance tuning & demonstrations.

    From what gets distributed publicly, they actually do store the data in a fairly heavily normalized format; posts (both questions and answers) go in one table, comments go in another and tie back to specific posts, and votes go in a third and tie to posts or comments.



  • @izzion That doesn't explain why someone would need to edit something to get their name updated on it. That part, at least, appears to take some of the user's information (other than the primary key) and stores it with the post/comment.



  • @djls45
    Without having dug into the actual Users database, my first guess would be that when you rename it actually deactivates your old account and creates a new account for you, so your UID actually changes.



  • @izzion That sounds way more complicated than just changing the name on the account, because with the system you suggest might be the case, there has to be either another table for user ID history or a column in the user table for the previous user ID. And then, either way, the code has to follow the link-chain in order to update the user's ID on a post/comment.


  • BINNED

    (nice onebox, too)


  • Discourse touched me in a no-no place

    @djls45 said in WTF Bites:

    @izzion That doesn't explain why someone would need to edit something to get their name updated on it. That part, at least, appears to take some of the user's information (other than the primary key) and stores it with the post/comment.

    Remember the baked/raw stuff we had with Discourse? Might be something like that.



  • @izzion said in WTF Bites:

    @djls45
    Without having dug into the actual Users database, my first guess would be that when you rename it actually deactivates your old account and creates a new account for you, so your UID actually changes.

    I'd hate to see the database schema/application-level stuff that would cause problems, then, if you just changed the name field on the user record without changing the UID. Because if user records have a UID, then it -- and not the name -- should be used as the foreign key.

    Deactivating and recreating the user account to change their name indicates that somewhere, something is going to lose its cookies if that UID doesn't correspond to that user name for ever and all of eternity. And that is definitely :doing_it_wrong:. Most likely, they're using the user name as a foreign key everywhere else, instead of using a meaningless (and thus, one that will never need to be changed) automatically-generated UID for that purpose.


  • Notification Spam Recipient

    @blek said in WTF Bites:

    (nice onebox, too)

    Nginx does this too IIRC.


  • Notification Spam Recipient

    Apparently she likes my face oils? :wtf: 😕



  • @pjh said in WTF Bites:

    @djls45 said in WTF Bites:

    @izzion That doesn't explain why someone would need to edit something to get their name updated on it. That part, at least, appears to take some of the user's information (other than the primary key) and stores it with the post/comment.

    Remember the baked/raw stuff we had with Discourse? Might be something like that.

    It should be pretty much trivially simple to query all of that user's posts and automatically re-bake them. If that takes too long, do it in the background and tell them it might take a few hours for their old posts to be re-attributed, and if it's causing too much of a load on the server, add a site-wide "USER_CANNOT_CHANGE_NAME_MORE_THAN_ONCE_PER_X_DAYS" setting.


Log in to reply