WTF Bites


  • Discourse touched me in a no-no place

    @pie_flavor said in WTF Bites:

    This is the part where Java really fucked up.

    Alas, no. It turns out that making Blarg<Foo> be a subclass of Blarg<Object> fucks up in some cases (the ones where you want to write an object into your blarg and aren't obeying the type constraint). This sort of thing results in occasional problems with arrays (which do have this property, and consequently need runtime checks to make sure that you don't break things; this part is the fucked up bit, and too much relies on the fucked-ness for it to be fixed now) and the type logic is actually correct for generics. Types are more complicated than they seem.

    Java's syntax for the type logic is, of course, annoyingly verbose.


  • Discourse touched me in a no-no place

    @JBert said in WTF Bites:

    Since both Java-the-language and Java-the-bytecode-format are designed by committee, JVM makers got to complain that existing bytecode should keep working.

    The rumours at the time (and circumstantial evidence subsequently) were that it was IBM who forced Sun to accept keeping the old stuff around. Certainly, for many years afterwards you would still deal with the old classes whenever doing something with Websphere. Given that the reason that the old Vector and Hashtable classes (and also StringBuffer) were effectively killed was that they had sucky performance due to all the locking baked into them and the locking didn't make all multithreaded use safe anyway, it all just looked to most developers like a great reason to avoid Websphere.

    Like that was needed. 😆


  • :belt_onion:

    This post is deleted!

  • :belt_onion:

    @Bulb said in WTF Bites:

    @Benjamin-Hall said in WTF Bites:

    @Gąska since I'm a novice, that all sounded like discussions of cricket to me. Like...I know all the words, but they don't make sense.

    It's simply histerical raisins at its best.

    And that complication was carried forward for backward compatidebility all the way to the present day.

    With extra special meaningless error messages:

    "If the length of the formatted message exceeds 128K bytes, then FormatMessage will fail and a subsequent call to GetLastError will return ERROR_MORE_DATA.



  • Why the EF is the Azure SQL Server different platform from locally installed Microsoft SQL Server (as in, when you have a database project, you have to change settings depending on whether you want to deploy in one or the other)?


  • Notification Spam Recipient

    @Bulb Probably because some functionality doesn't exist in Azure SQL Server (database mail, xp_dirtree, etc.)?



  • @Vault_Dweller Could be. Which leaves the question why it has different feature-sets…



  • @Kamil-Podlesak said in WTF Bites:

    I honestly have absolutely no idea what you're talking about. Maybe you're confusing that with C# 2.0 or something, because in Java is was exactly the opposite.

    One of the justifications for erasure was 'your old code can still work' - in contrast to hard baked generic types like .Net (or C++ templating) where List and List<int> are different classes.

    But then they also told people "don't use Vector, use List<T>" - so all that old code that used Vector couldn't just accept your List<T> anyway, even if it was erasured to just be List.


  • Notification Spam Recipient

    @dkf said in WTF Bites:

    @Carnage said in WTF Bites:

    @BernieTheBernie said in WTF Bites:

    @boomzilla said in WTF Bites:

    setFoo( new Boolean( false ) )

    That's wrong. The author obviously intended

    setFoo( new Boolean( ! Boolean.TRUE ) )
    

    FTFY

    setFoo( Boolean.getBoolean("false") )
    

    And if you know what that does, you'll know why it needs to be killed with fire, from orbit!

    Not javaie enough

    setFoo(BooleanUtils.isTrue(Boolean.valueOf(Optional.ofNullable(value).orElse("false"))))


  • Discourse touched me in a no-no place

    @bobjanova said in WTF Bites:

    But then they also told people "don't use Vector, use List<T>" - so all that old code that used Vector couldn't just accept your List<T> anyway, even if it was erasured to just be List.

    It meant that you didn't need to do a Big-Bang migration. You could instead take your old code and use it with the new runtime, and then convert bits and pieces over time. Some idiots never converted, but that's on them…


  • Discourse touched me in a no-no place

    @DogsB said in WTF Bites:

    setFoo(BooleanUtils.isTrue(Boolean.valueOf(Optional.ofNullable(value).orElse("false"))))

    The reason why mine was so thorough :trwtf: is that these are equivalent:

    setFoo( Boolean.getBoolean("false") )
    
    setFoo( "true".equals(System.getProperty("false")) )
    

    It's not parsing the value at all, it's fetching a system property and comparing that for string equality with "true". If some 🃏 launches your application with -Dfalse=true you're going to be very puzzled.



  • @dkf said in WTF Bites:

    @bobjanova said in WTF Bites:

    But then they also told people "don't use Vector, use List<T>" - so all that old code that used Vector couldn't just accept your List<T> anyway, even if it was erasured to just be List.

    It meant that you didn't need to do a Big-Bang migration. You could instead take your old code and use it with the new runtime, and then convert bits and pieces over time. Some idiots never converted, but that's on them…

    You didn't have to do a big bang migration in .NET either, the non-generic collections continued to work there too and the generic collections implement the non-generic version of the iteration interfaces, so if you used those, you could even pass the new collections to old code – I suppose Java had that too (I didn't Java at the time to know for sure; I did do C# shortly after 2.0 came out).


  • Notification Spam Recipient

    @dkf said in WTF Bites:

    @DogsB said in WTF Bites:

    setFoo(BooleanUtils.isTrue(Boolean.valueOf(Optional.ofNullable(value).orElse("false"))))

    The reason why mine was so thorough :trwtf: is that these are equivalent:

    setFoo( Boolean.getBoolean("false") )
    
    setFoo( "true".equals(System.getProperty("false")) )
    

    It's not parsing the value at all, it's fetching a system property and comparing that for string equality with "true". If some 🃏 launches your application with -Dfalse=true you're going to be very puzzled.

    Congrads! you've just won Friday! 😺




  • Fake News

    @Zerosquare :hanzo: in at least two places, one being a whole thread even



  • @Bulb said in WTF Bites:

    Since both Java-the-language and Java-the-bytecode-format are designed by committee, JVM makers got to complain that existing bytecode should keep working. That might be a huge part of why the types are erased: that way JVMs don't need to keep track of generics and just work with classes like they always did.

    Each Java version brings changes (new features) to the bytecode and the JVM, the alternate implementations were always behind and often never got the newer features at all, and Sun never gave a fuck about them anyway.

    Actually, back in the 1.2/1.3/1.4 days, IBM JVM was very good. It actually had JIT, and even when Sun added it too, the IBM one was still way better (by an order of magnitude). If wasn't until 1.5 that Sun catched up, and even then the IBM was worth using for the diagnostic options.
    On the positive side, IBM influence moved the Java world to production-valid space. On the negative side, IBM design is obviously inspired by the Wisdom of the Great Old Ones (do you have any other explanation of J2EE 1?).



  • First thought I had: "maybe there's a thread about it already?"
    Second thought: "if there's one, someone will post the link, so :kneeling_warthog:"

    (Thanks.)



  • @bobjanova said in WTF Bites:

    @Kamil-Podlesak said in WTF Bites:

    I honestly have absolutely no idea what you're talking about. Maybe you're confusing that with C# 2.0 or something, because in Java is was exactly the opposite.

    One of the justifications for erasure was 'your old code can still work' - in contrast to hard baked generic types like .Net (or C++ templating) where List and List<int> are different classes.

    But then they also told people "don't use Vector, use List<T>" - so all that old code that used Vector couldn't just accept your List<T> anyway, even if it was erasured to just be List.

    You can use Vector<T> or Vector and both works. You can use Vector<T> or Vector directly wherever List<T> is needed. If the API has argument of type Vector or Vector<T>, then you need to copy data by new Vector(anotherList). Usually, however, everyone just used Vector (with generics or not) until the old library got new version.

    It does not matter at all if you use generics or not, it's about interface and implementation.



  • @Gąska said in WTF Bites:

    Windows 10 chose #2

    And have now changed back to option 1.



  • @Kamil-Podlesak said in WTF Bites:

    It's the only way to create archive in Visual Studio.

    :cluebat:


  • Banned

    @dcon said in WTF Bites:

    @Gąska said in WTF Bites:

    Windows 10 chose #2

    And have now changed back to option 1.

    Typo. Windows 10 has always been #1. Windows 8 has been #2 until Windows 10 release.



  • @Gąska said in WTF Bites:

    @dcon said in WTF Bites:

    @Gąska said in WTF Bites:

    Windows 10 chose #2

    And have now changed back to option 1.

    Typo. Windows 10 has always been #1. Windows 8 has been #2 until Windows 10 release.

    Thanks. I read the article yesterday. Misremembered.


  • Notification Spam Recipient

    @Gąska said in WTF Bites:

    @pie_flavor if not Microsoft and not JetBrains, then who uses lowercase properties? 🤔

    The plot thickens!

    People who use vi!




  • Discourse touched me in a no-no place



  • Today is not my day... 😿


  • Notification Spam Recipient

    @Zerosquare said in WTF Bites:

    Today is not my day... 😿

    🎵 It's Friday Friday...



  • Horizon Zero Dawn (PC):

    e8c3356e-87a4-4eb5-a70f-dcf5567e97e6-image.png

    Yes, 0.96% was indeed just shy of 1%. And they were not kidding about it taking a while.


  • Banned

    @cvi your game is right where you left it.



  • WTF of my day: So, since Rocket.Chat does not quite properly sync LDAP users on its own (yes, I know 1800 users are a lot but still, could you sync all of them and not merely 70%?), I simply created a sync script of my own.

    Wasn't too hard, the user table is easily understood and thus I had a proper script up within an hour.

    However, today something barfed and the logs stated that there was a duplicate email address between two user entries. As that's supposed to be a unique property, it's a bit of a problem.

    But I definitely created the user entries like they were supposed to! I even checked the source code, it does precisely the same thing?

    I just found the issue: LDAP entries get an uidNumber. I naively assumed that it would not only be unique but also autoincrement.

    It is not.

    Basically, when a user gets deleted from LDAP, it's uidNumber is can be re-issued. And as Rocket.Chat uses that to map the LDAP user to its own user entry, you can easily guess where the problem came from.
    My sync script simply did not delete old users.

    I'll hazard a guess and say that this is probably also responsible for the sync issue as the users making this problem are also the ones who were not synced to begin with.



  • @Rhywden Good grief, a uidNumber assignment also isn't static - I found several existing users who now have different uidNumbers. What a mess...


  • Notification Spam Recipient

    @Rhywden said in WTF Bites:

    @Rhywden Good grief, a uidNumber assignment also isn't static - I found several existing users who now have different uidNumbers. What a mess...

    Quality!




  • ♿ (Parody)

    @El_Heffe said in WTF Bites:

    No more capslock.

    You monsters.



  • @cvi said in WTF Bites:

    Horizon Zero Dawn (PC):

    e8c3356e-87a4-4eb5-a70f-dcf5567e97e6-image.png

    Yes, 0.96% was indeed just shy of 1%. And they were not kidding about it taking a while.

    Earlier today I read that it uses about 18 GB of RAM while building its shader cache, hitting virtual memory pretty hard on many machines. (My gaming machine only has 16, for example.)



  • You know the famous (and apocryphal) "640kB ought to be enough for anybody" quote?

    I think we should have an opposite one to convey the opposite fallacy. Something like "Everybody ought to have 32 GB (and a gigabit Internet connection)".



  • @Zerosquare said in WTF Bites:

    From the same article:

    1.7 million pre-print academic papers now up for grabs

    Cornell University has collected all the content on arXiv, the free repository of scientific papers awaiting peer-reviewed publication, to build a tidy text-based dataset for machine-learning engineers to play with.

    The dataset, covering nearly 30 years of publications, is now hosted on Kaggle, a Google-owned data science platform, for anyone to download. It is hoped that by making the data public, it’ll encourage developers to train AI tools like recommendation engines or help users search for interesting papersSciGen more easily.

    FTFLOLs



  • @Parody said in WTF Bites:

    Earlier today I read that it uses about 18 GB of RAM while building its shader cache, hitting virtual memory pretty hard on many machines. (My gaming machine only has 16, for example.)

    Unfortunately, I didn't pay any attention to resource utilization (after posting the above, I went back to a book I was reading and left it to crunch on its own for the ~20 minutes or so the process ended up taking).

    18GB of RAM does sound quite heavy, especially considering that the minimum requirement mentions just 8GB of RAM, and the recommended specs list 16GB.

    The 100GB of hard drive space requirement isn't exactly lightweight either (though that one seems to be a bit of an overestimate. As far as I can see it takes "just" slightly more than 70GB here.)


  • BINNED

    @cvi said in WTF Bites:

    The 100GB of hard drive space requirement isn't exactly lightweight either (though that one seems to be a bit of an overestimate. As far as I can see it takes "just" slightly more than 70GB here.)

    The rest is page file, obviously. 🐠



  • WTF of my day: While my school has two networks (one for BYOD, one for the school's own devices), everything sensitive is connected to a completely separate network. Said network is administrated through a contracted company.

    I'm not too sure why this special network is necessary in the first place because everything connected to it is basically a thin client anyway and connects via VPN to a remote desktop but, oh well...

    ... anyways, our administration team got new laptops to connect to this network and also some wireless mice to go with it. The laptops are locked down in a way that you cannot even set the wallpaper.

    They promptly had problems with being locked out of their accounts on a regular basis due to "too many login attempts". Other schools using the same system reported this problem as well.

    The cause? Well, if the wireless mice were moved in the slightest of ways (like, someone from the cleaning crew was wiping the desk) they'd wake up the laptop from sleep. This would count as a login attempt. And the software used obviously has no cooldown so the "login attempt counter" simply increases until you either have a successful login or you're locked out when hitting a certain number.

    The proposed solution? If you're done for the day then you're required to switch off the mouse. :wtf:

    (that's what was reported to me. As this piece of shit tech falls completely out of my purview, I can only say: Not my circus, not my monkeys)


  • Discourse touched me in a no-no place

    @Rhywden said in WTF Bites:

    The proposed solution? If you're done for the day then you're required to switch off the mouse. :wtf:

    :trwtf: is using a mouse with a laptop.



  • @dkf Well, some people don't like the trackpad, so...


  • Discourse touched me in a no-no place

    @Rhywden Well yes. But seriously, the actually right approach here is to file a critical bug with the company responsible for this while saying that the easiest fix, if they can't provide reliable service, is to reduce the amount being paid to them pro rata for the amount of office time that staff are locked out of their own accounts by the company's incompetence. Nothing like dropping the threat of taking money away for getting idiots to take their head out of their collective asses.



  • @dkf Yeah, but that's something for our superior department to do... my school has zero say in this.


  • Discourse touched me in a no-no place

    @Rhywden Oh well. The admin team just needs to phone up the support line then whenever things aren't working. They might want to put that on speed dial for their own convenience.


  • BINNED

    @Rhywden said in WTF Bites:

    Well, if the wireless mice were moved in the slightest of ways (like, someone from the cleaning crew was wiping the desk) they'd wake up the laptop from sleep. This would count as a login attempt.

    :sideways_owl: :trwtf:



  • https://maven.apache.org/maven-ci-friendly.html says:

    A note about the used properties. You can only use those named ${revision}, ${sha1} and/or ${changelist} and not other named properties […]

    :wtf_owl: Warum, kurwa, warum?

    And before you think it's because they are special in some way, no, they are not. They are normal properties like any other used anywhere else that you set on command-line, via system properties or inside the pom.xml (or its parents). You have to set them in one of those ways from your CI system.


  • BINNED

    PEBKAC bite: I'm in the middle of taking some of my cow-orkers MATLAB "programs" and porting them to something at least halfway sane. As usual with MATLAB stuff, it's full of formulas, which I need to carefully copy+pasteconvert.

    There's some stuff that looks conceptually like this (just much longer and more complicated):

    v = [a1+b1+c1;
         a2+c2;
         a3+c3];
    

    Ugh, that's terribly aligned (when there's actually a lot more stuff), so for reading it I've temporarily changed it to:

    v = [a1+b1+c1;
         a2   +c2;
         a3   +c3];
    

    That was last week. Today I try to run the program again and get some weird error message: Error using vertcat. Dimensions of matrices being concatenated are not consistent.
    Normally you get that when you try to concatenate vectors of different size, e.g. a 3d vector and a 2d vector. But all of these are scalars? I just checked again...

    >> line1 = a1+b1+c1;
    >> line2 = a2   +c2;
    >> line3=  a3   +c3;
    >> size(line1)
    ans =
         1     1
    >> size(line2)
    ans =
         1     1
    >> size(line3)
    ans =
         1     1
    

    Everythings fine, should work. Right? So what about the equivalent:

    v = [line1;
         line2;
         line3];
    

    This also works! What?! :wtf:

    And then it hit me: In Matlab you separate rows in a row vector (or matrix) with ; and columns with,:

    >> size([1, 2])
    ans =
         1     2
    >> size([1; 2])
    ans =
         2     1
    

    But you can also separate colums with just a space. So whitespace gets implicitly treated like a comma and I just changed the second and third row above to have 2 columns instead of one. And this only happens inside the square brackets to build a matrix, not on the lines where I declared individual variables.
    "Oh shit, I added some whitespace for readability last week and that's still there".:headdesk: :headdesk: :headdesk:

    And people complain about Python. At least there it's only used for indentation, not in the middle of the line, and it's also pretty much the first thing you learn about.



  • @topspin Nobody expects the unary operator+!



  • @topspin If Matlab source code ever leaks, I am absolutely not going to look at its parser. The thing is probably cursed. Oh wait...


Log in to reply