WTF Bites



  • @hardwaregeek said in WTF Bites:

    @tsaukpaetra Considering that it's a file called global_constants.h, or something like that — yes, I'm pretty sure the person who wrote it did mean to make it a constant.

    BTW, I should mention that I learned this in the context of a bug ticket to clean up the thousands of warnings the compiler generates every time we compile.

    #pragma warning (disable : nnnn) hopefully?



  • @dcon Yeah, something like that; I'm not sure of the exact syntax, but it's not my job to fix it. Some other ones, maybe, but not those. I might get to fix some of the "This violates the language spec and will probably be an error in a future version of the compiler" warnings. :rolleyes:





  • @scholrlea BTW, @pie_flavor, are you still in touch with Ryan86ed? Did you get a chance to explain to him what function calls/method invocations were, and in the process of trying to do this, was it your head which exploded first, or his?


  • Considered Harmful

    @scholrlea Topic got locked. No, I never did explain to him. He can go ahead and read the Java tutorials.


  • Considered Harmful

    I figured out why my version badges aren't showing when I upload my plugins.
    https://i.imgur.com/tzgflWv.png
    How the fuck do I end up with a duplicate file? In a jar built by Gradle? And this only happens sometimes.


  • Discourse touched me in a no-no place

    @pie_flavor said in WTF Bites:

    How the fuck do I end up with a duplicate file?

    That's pretty strange, but there's nothing technically in the ZIP format to stop it from happening. It's just broke as heck to actually do it.



  • @pie_flavor said in WTF Bites:

    I figured out why my version badges aren't showing when I upload my plugins.
    https://i.imgur.com/tzgflWv.png
    How the fuck do I end up with a duplicate file? In a jar built by Gradle? And this only happens sometimes.

    Maybe one of them is a .info<space> file? (Yeah the programs-that-cant-handle-spaces thread is :arrows:)


  • area_can

    @dcon said in WTF Bites:

    Maybe one of them is a .info<space> file

    But in that case, the one with the space shouldn't have the VS code icon since info_ files wouldn't have any file/application association set...


  • 🚽 Regular

    @anotherusername said in WTF Bites:

    @zecc variable redefinition within the same context isn't a problem for Javascript either.

    Yeah, but that's because variable hoisting means variable declarations are brought to the top and assignments are separate things. I wonder though...

    (function(){
      console.log( 1, f() );
    
      function f(){ return 1; }
    
      console.log( 2, f() );
    
      function f(){ return 2; }
    
      console.log( 3, f() );
    })();
    
    // Output is:
    // 1 2 
    // 2 2 
    // 3 2
    

    I honestly didn't know what to expect, but this is what I find makes more sense (considering).



  • @bb36e said in WTF Bites:

    @dcon said in WTF Bites:

    Maybe one of them is a .info<space> file

    But in that case, the one with the space shouldn't have the VS code icon since info_ files wouldn't have any file/application association set...

    argh. right. In the case, one of the letters in the basename is a weird unicode value!


  • area_can

    @dcon said in WTF Bites:

    argh. right. In the case, one of the letters in the basename is a weird unicode value!

    Or the zip file could be set to RAID for redundancy


  • BINNED

    @cartman82 said in WTF Bites:

    An "SEOCEO expert" sent this pitch video to superuser.com

    Good god, that's unbearable without a bingo sheet.

    Reminds me it's kinda ironic that IBM of all people made an actual ad out of that trope.

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


  • BINNED

    How I hate these people coming up with security policies that make no sense at all. WhyTF does Firefox not remember the login password to my (cheap, shitty) router? :wtf:

    I remember several years ago I came across an internal site where the password manager refused to work (I think it was some kind of Outlook/Office web login thing) and searching for the cause. Apparently:

    Mozilla support site: "Some websites do not allow for passwords to be saved for security reasons."

    by using an attribute autocomplete="off". And since Firefox actually implements that shit, there's JS bookmarklets to remove that attribute from pages.

    Aside: Geez, it's none of your fucking business if I want to save passwords. Especially fucking banks. If you cared for security so much, you wouldn't restrict passwords to exactly 5 character.

    Anyways, I checked this and I can't find such an attribute on the password form, so the boormarklet doesn't work. Yet, they still managed to prevent Firefox from saving the password somehow.

    Anybody got an idea how that works and how to work around it?



  • @zecc yeah, function definitions are special because they get hoisted along with the function itself. Variable definitions (var x= or let x=) get hoisted (so the variable exists), but the actual assignment part of it happens at the location where the definition occurred.

    (function () {
      var a = 1;
      console.log(a);
      var a = 2;
      console.log(a);
    })();
    

    Logs 1, then 2.

    eta: also, 'use strict' will prevent using an undeclared variable, but doesn't prevent use-before-assign. The declaration is hoisted, so the variable exists, but is undefined.

    (function () {
      'use strict';
      console.log(a);
      var a = 1;
    })();
    

    Logs undefined. If you remove the variable declaration, though, it will throw an a is not defined error (both in strict mode or normal).


  • Notification Spam Recipient

    @topspin said in WTF Bites:

    Anyways, I checked this and I can't find such an attribute on the password form, so the boormarklet doesn't work. Yet, they still managed to prevent Firefox from saving the password somehow.

    Hmmm are they using a unique Realm every time? Other than that, no idea.


  • Considered Harmful

    @dcon It ain't.


  • BINNED

    @tsaukpaetra said in WTF Bites:

    Hmmm are they using a unique Realm every time? Other than that, no idea.

    Not knowledgeable enough about that stuff to know what that means. :/

    0_1515968886245_router_login_page.png

    Kind of Ironic that Firefox tells me the form isn't https so it's insecure.

    The form seems to use this field, which doesn't have an autocomplete=off attribute:

    <span class="login_infoText" id="login_infoText">Geben Sie Ihr EasyBox-Kennwort ein, um auf Ihre Einstellungen zugreifen zu können.</span>
    <div class="rowWrapper">
    	<div class="left">
    		<input class="ctrlElement" id="login_Password" maxlength="32" type="password">
    	</div>
    	<div class="right">
    		<a class="ctrlButton purple" id="btn_login" href="javascript:void(0)" unselectable="on">Anmelden</a>
    	</div>
    </div>
    <div class="rowWrapper">
    	<div class="right">
    		<a class="ctrlButton grey" id="btn_forgotton_password" href="javascript:void(0)" unselectable="on">Kennwort vergessen</a>
    	</div>
    </div>
    

    I pasted the main .html of the landing page here, but I don't think it contains the required referenced parts:



  • @topspin One trick I always use when a website isn't recognized by my password manager is to insert a form with a basic username/password input that does a POST to some arbitrary part of the site that doesn't accept input and usually that's enough for my browser to recognize it and having the password saved makes it fill the form more easily.


  • BINNED

    I broke teh Firefoxen:

    >> data
    Object { 930: {…}, 931: {…}, 932: {…}, 933: {…}, 934: {…}, 935: {…}, 936: {…} }
    >> data /* (expanded in console) */
    {…}
    931: Object { ObjectName: "931", Unavailable: true }
    932: Object { ObjectName: "932", Idle: true }
    933: Object { ObjectName: "933", Idle: true }
    934: Object { ObjectName: "934", Idle: true }
    935: Object { ObjectName: "935", Unavailable: true }
    936: Object { ObjectName: "936", Unavailable: true }
    __proto__: Object { … }
    >> _.forEach(data, (ext, key) => console.log(key, ext));
    930 Object { ObjectName: "930", Idle: true, Pauses: […] }
    931 Object { ObjectName: "931", Unavailable: true }
    932 Object { ObjectName: "932", Idle: true }
    933 Object { ObjectName: "933", Idle: true }
    934 Object { ObjectName: "934", Idle: true }
    935 Object { ObjectName: "935", Unavailable: true }
    936 Object { ObjectName: "936", Unavailable: true }
    Object { 930: {…}, 931: {…}, 932: {…}, 933: {…}, 934: {…}, 935: {…}, 936: {…} }
    

    Ummm... FF, where does 930 waddle off to when I expand the object? Smoke break?


  • Discourse touched me in a no-no place

    @anotherusername said in WTF Bites:

    The declaration is hoisted

    Misread that as “The declaration is hosed” and thought that yes, it is indeed…


  • 🚽 Regular

    @onyx Woah! You even broke my Firefox!

    0_1516028308235_0c8343f8-9b5b-4ba4-8b45-a86e59194be1-image.png

    Edit: seriously, :wtf:? I have to experiment more with this later.

    0_1516028419110_55b14d85-7537-45fc-a245-60cf20692823-image.png

    Edit: I couldn't resist and experimented some more. It got worse.

    0_1516029110164_1b5ff085-7cf1-4b16-83b8-605e44160875-image.png

    Another: it seems to consistently skip the lowest key that looks like a positive integer, unless it is "0".

    Yet another edit: well, kind of. Sometimes this happens:

    0_1516029559789_64109142-6c5a-4963-9b1c-c3fea34515dd-image.png



  • @dkf said in WTF Bites:

    @pie_flavor said in WTF Bites:

    How the fuck do I end up with a duplicate file?

    That's pretty strange, but there's nothing technically in the ZIP format to stop it from happening. It's just broke as heck to actually do it.

    I've also seen ZIPs containing filenames like ../../../foo that don't show up at all in some viewers.
    In fact, when I was poking holes in an atrocious Magento extension, this was one of the fun problems: the client sent the list of files he wanted in a request, the (insecure) code happily created a zip archive from those files and sent it back. Asking for a file called ../../../../../../../../../etc/passwd zipped the content of /etc/passwd into a file called ../../../../../../../../../etc/passwd. Oops?



  • @dcoder said in WTF Bites:

    an atrocious Magento extension,

    Isn't that redundant?


  • And then the murders began.

    I have barely touched Java since I graduated college almost 10 years ago (worked on one project for less than ten hours). But somehow, Pluralsight's "Skill IQ" assessment thinks that I'm an Expert in it. Even though I got half the questions wrong.

    0_1516050515770_c250e1ae-4189-4600-b459-8ba8916eb68e-image.png

    Methinks their assessments are full of 💩.



  • @unperverted-vixen I actually got an Oracle certification in Java 7 when I was in high school. The test was really easy, the bar is pretty low when it comes to Java.


  • BINNED

    @unperverted-vixen Beat you! ;-)
    I haven't touched Java since 1.4, I'm definitely not even "proficient". Any of the actual Java experts on this board must be laughing at these questions.

    I especially like how I got the "is goto a keyword" question correct even though I thought Java has no goto. 🤷♂

    0_1516052298448_java.png


  • And then the murders began.

    @topspin said in WTF Bites:

    @unperverted-vixen Beat you! ;-)
    I haven't touched Java since 1.4, I'm definitely not even "proficient". Any of the actual Java experts on this board must be laughing at these questions.

    "No wonder we keep getting incompetent 'experts' applying."

    At least if C# dies I apparently have a fallback. ;)

    I especially like how I got the "is goto a keyword" question correct even though I thought Java has no goto. 🤷♂

    It's a reserved keyword - so you can't use it in your code as a variable name or some-such, but it doesn't have any actual function.



  • Seems that some journalists just jot down the tech blurb from companies:

    As the first comment put it: Completely outlandish figures.

    Let's break it down? 370 miles on 71 kWh accumulator. They state that a 10 minutes charge (wireless even!) is enough for 240 miles.

    Which means that 46 kWh get delivered in 10 minutes. That would mean a power output of 276 kW. Nevermind the insane current this would require.


  • BINNED

    @unperverted-vixen 272 / 300 for C++. Fucking setprecision question, now I'm sad.



  • @rhywden said in WTF Bites:

    370 miles on 71 kWh accumulator

    Stretching it a bit.

    Corresponds to around 2.5 l/100 km with a gasoline engine (at 0.025 l/km, you need 11.2 kg for 370 miles and at 225 g/kWh the engine gets 50 kWh out of that; and 50 kWh actual work from 71 kWh battery is ~70% efficiency, which an electric drive-train should be able to get). 2.5 l/km would be very good for gasoline-powered car and this one, while small, would be rather heavy due to all the batteries.

    @rhywden said in WTF Bites:

    They state that a 10 minutes charge (wireless even!) is enough for 240 miles.

    That would mean a 4C battery, i.e. full charge in ¼ h. I've never heard of more than 2C, i.e. full charge in ½ h, so far.

    @rhywden said in WTF Bites:

    That would mean a power output of 276 kW. Nevermind the insane current this would require.

    The parameters of charging stations are surprisingly hard to find. But maximum for current stations seems to be 850 V, 125 A. That is 106 kW input. Stretching it even further.

    Edit: grr, brainos. I've done the calculations right, but typed the numbers wrong.



  • 0_1516105253377_6112b987-bb7c-4b17-9c83-7c7f67c2237a-image.png

    SVN commit (on linux so far) fails if there is "# "in filename.

    svn: E155011: Directory '/home/cartman/Downloads/ipdata/ASP.Net/C#/MSSQL' is out of date
    svn: E160013: File not found: transaction '0-6', path '/ipdata/ASP.Net/C#/MSSQL'
    

    I know my C# is out of date, but come on.

    SVN is turning out to be a terrible idea, btw.


  • Discourse touched me in a no-no place

    @cartman82 said in WTF Bites:

    SVN commit (on linux so far) fails if there is "# "in filename.

    No repro from a casual reading of your setup. /tmp/hash_test and /tmp/x are the same branch of the repository at the same state prior to the following sequence:

    Adding a file to one copy

    [pjh_main:root@hpdesktop tmp]# touch hash_test/C#/testdir/testfile
    [pjh_main:root@hpdesktop tmp]# ls hash_test/C#/testdir/testfile
    hash_test/C#/testdir/testfile
    [pjh_main:root@hpdesktop tmp]# svn add hash_test/C#/testdir/testfile
    A         hash_test/C#/testdir/testfile
    [pjh_main:root@hpdesktop tmp]# svn ci -m "TAGNAME-0 adding file" hash_test/
    Adding         hash_test/C#/testdir/testfile
    Transmitting file data .done
    Committing transaction...
    Committed revision 43631.
    

    Testing, and updating, the other copy:

    [pjh_main:root@hpdesktop tmp]# svn st -u x
            *            x/C#/testdir/testfile
            *    43630   x/C#/testdir
    Status against revision:  43631
    [pjh_main:root@hpdesktop tmp]# svn update x
    Updating 'x':
    A    x/C#/testdir/testfile
    Updated to revision 43631.
    [pjh_main:root@hpdesktop tmp]# 
    


  • @unperverted-vixen Wow that's a bad test. I had a maybe 8-hours Java course more than 15 years ago and since then I've never used it. Basically all I know about Java comes from reading TD:wtf: and inferring from what seems logical (*).

    And yet I'm "proficient" and doing better than half of those who took the test.

    Also, I guess questions are random because I didn't get one about goto, and I got two that were almost the same.

    0_1516108043189_684bbd1d-3d30-4dfe-a084-6fb9fb17f537-image.png

    (*) like, a "Linked"-something-container should have something to do with a "linked list", not with the order of items... well I got that one wrong, so either I'm not logical or Java isn't...



  • @PJH

    Renamed the dir to Csharp. Commited. Works.
    Renamed it back to C#. Commited. The same crash.

    ~/Downloads $ find ipdata/ASP.Net/C#/ -printf "%p\t%k KB\n"
    ipdata/ASP.Net/C#/	4 KB
    ipdata/ASP.Net/C#/MySQL	4 KB
    ipdata/ASP.Net/C#/MySQL/ipcountryisp.aspx	8 KB
    ipdata/ASP.Net/C#/MSSQL	4 KB
    ipdata/ASP.Net/C#/MSSQL/ipcountryisp.aspx	8 KB
    

    Dunno man.


  • Discourse touched me in a no-no place

    @cartman82 said in WTF Bites:

    Renamed it back to C#. Commited. The same crash.

    Sounds like someone isn't encoding their URLs right.


  • Discourse touched me in a no-no place

    This post is deleted!

  • Discourse touched me in a no-no place

    @cartman82 Pass then. Just repeated it with those paths and WOMM.

    Tool version information
    [pjh_main:root@hpdesktop data]# svn --version
    svn --version
    svn, version 1.9.7 (r1800392)
       compiled Aug 10 2017, 19:20:08 on x86_64-redhat-linux-gnu
    
    Copyright (C) 2017 The Apache Software Foundation.
    This software consists of contributions made by many people;
    see the NOTICE file for more information.
    Subversion is open source software, see http://subversion.apache.org/
    
    The following repository access (RA) modules are available:
    
    * ra_svn : Module for accessing a repository using the svn network protocol.
      - with Cyrus SASL authentication
      - handles 'svn' scheme
    * ra_local : Module for accessing a repository on local disk.
      - handles 'file' scheme
    * ra_serf : Module for accessing a repository via WebDAV protocol using serf.
      - using serf 1.3.7 (compiled with 1.3.7)
      - handles 'http' scheme
      - handles 'https' scheme
    
    The following authentication credential caches are available:
    
    * Plaintext cache in /root/.subversion
    * Gnome Keyring
    * GPG-Agent
    
    history -a
    
    [pjh_main:root@hpdesktop data]# bash --version
    bash --version
    GNU bash, version 4.1.2(2)-release (x86_64-redhat-linux-gnu)
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    
    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    history -a
    [pjh_main:root@hpdesktop data]# 
    
    
    


  • @pjh Similar versions.

    BTW, is your repository link http-based or does it use svn:// protocol?


  • Discourse touched me in a no-no place

    @cartman82 said in WTF Bites:

    @pjh Similar versions.

    BTW, is your repository link http-based or does it use svn:// protocol?

    svn+ssh://svn.example.com/path/to/file



  • @pjh said in WTF Bites:

    @pjh Similar versions.
    BTW, is your repository link http-based or does it use svn:// protocol?

    svn+ssh://svn.example.com/path/to/file

    We are HTTP only because that's what https://rhodecode.com/ supports by default, and our admin isn't too detail oriented or capable.

    I bet if you switched to http, you'd get the same shit. Also, awful upload speed for many small files.


  • Discourse touched me in a no-no place

    @cartman82 said in WTF Bites:

    and our admin isn't too detailsecurity oriented or capable.

    ?



  • @pjh said in WTF Bites:

    and our admin isn't too detailsecurity oriented or capable.

    ?

    That too. I mentioned a few times https, but he's been soundly ignoring me.

    It's like that guy is working for a fixed commission or has max number of work hours prescribed by a union or something. Everything he does, he makes it a point to invest minimal amount of effort possible. It's maddening.



  • @unperverted-vixen It's more that the right now the Java certs - especially the OJFJA and OJCA levels - are what the MCSE was in the late 1990s: a watered-down joke of a test that is used by idiots as an alternative to college for getting an IT job. Because it is so widely taken, and so widely used as a measuring stick by brain-dead HR drones, they had to water it down tremendously just to ensure that they got more passes than fails, and even then I am pretty sure that the median hovers around 50% because most of the people taking the tests at that level couldn't find the Enter key on the keyboard right in front of them even with a roadmap.

    I took the OCA for java 7 in 2014. I spent far too long preparing for a test that turned out to be on the level of "What is a String used for?" which I could have passed with no prep at all. Yet, the pass rate remains low.

    Not that Oracle gives a crap; Java wasn't what they bought Sun for anyway, so being able to squeeze a ton of money out of idiots, and keep squeezing every time they release a major update, is just gravy to them. Watering the test down is a great idea in their eyes, especially since it let's them play up the importance of the upper-tier tests to those who, you know, actually give half a shit about software quality (not that many people who do are using Java in the first place). As long as the people making the hiring decisions still think it means something, that's golden to them.

    As for what they did buy it for, well, I can't say with certainty, but I would guess the answer lies in Oracle's main product, and in certain semi-FOSS alternative which Sun had been promoting and supporting at the time which Larry wanted to crush or co-opt.

    Would he really spend $7 billion just to squash MySQL, when it wasn't really much of a competitor to Oracle in the first place and the purchase was likely to (and did) hurt Oracle's bottom line? Well, it is Larry Ellison we're talking about - I'm pretty sure he would do it just for shits and giggles, and fuck his stockholders.



  • @bulb said in WTF Bites:

    2.5 l/km would be very good for gasoline-powered car

    I think you mean something different.



  • @unperverted-vixen said in WTF Bites:

    Pluralsight's "Skill IQ" assessment thinks that I'm an Expert in it. Even though I got half the questions wrong.

    Because that put you in the top 0.1% of all respondents?



  • @anotherusername said in WTF Bites:

    @bulb said in WTF Bites:

    2.5 l/km would be very good for gasoline-powered car boat

    I think you mean something different.

    That looks more believable



  • @cartman82 said in WTF Bites:

    SVN commit (on linux so far) fails if there is "# "in filename.

    I ran into something like that a while ago. Can't remember the details. I think I posted somewhere on here too. Can't be bothered to search. (I think it was when I was trying to checkout a specific revision during my svn->git conversion)



  • @scholrlea said in WTF Bites:

    "What is a String used for?"

    Duh. EVERYTHING!



  • @anotherusername said in WTF Bites:

    @bulb said in WTF Bites:

    2.5 l/km would be very good for gasoline-powered car

    I think you mean something different.

    Let's work that out for My Fellow Murkins

    1 / (2.5 L/km) = 0.4 km/L == (0.4L * 3.9gal.) / 0.62 miles/km == 0.1 gal. / 0.62 miles = 0.16 mpg

    Sounds good to me! (Compared to an AFV, maybe)

    So... does 2.5 L/kWh sound more likely?


Log in to reply