WTF Bites



  • @dkf said in WTF Bites:

    @pie_flavor said in WTF Bites:

    Probably something about the fact that it is so obtusely linear that imports are basically just 'dump this file into mine' and they had to create a whole new function syntax so the return type could respect a template parameter defined by an argument type.

    It's mostly deeper than that. The header mess doesn't help, but the major costs are definitely in the optimization stage, not the reparsing (you can see this by building using -O0 and seeing just how much faster that is to compile everything). I think it's something to do with the amount of inlining and template specialization in a typical C++ program.

    Optimisation eats a lot of time, but even debug builds, where optimisations are turned off, are far slower than basically any other language.

    @pie_flavor said in WTF Bites:

    Template syntax is its own bag of tigers.

    It certainly is.

    A language with generics doesn't have the problems that C++ has, because generics are part of the language but templates are a separate super-language like directives that expand into more code.

    Templates are clearly and definitely proper part of the language as they parse with the main parsing pass and to the same AST.

    They do generate separate code for each instantiation, but that's what any statically generic code must do (Java and C# when substituting classes use dynamic polymorphism and for structs C# does load-time code generation).

    @pie_flavor said in WTF Bites:

    Like #include does. Which is fucking moronic and leads to an insane amount more compilation

    It's not moronic. It is supposed to be equivalent to hand-written specific code, so it has to do that. However

    @pie_flavor said in WTF Bites:

    especially when you include the obtuse linearity of the compiler, which among other things means that the template is not expanded once per argument set per project, but once per argument set per file.

    this is the real problem. The templates get compiled in each compilation unit over and over, because no compiler managed to come up with any kind of instance cache. Maybe they'll do something about it when the modules finally get implemented.

    @PleegWat said in WTF Bites:

    And I expect the cases are few and far between that you'd do anything with templates which you couldn't do with generics.

    “Generics” mean different thing for different languages. There are many things you can do with C++ templates, but can't do with Java generics due to lack of associated types. Most of the interesting cases beyond generic collections need associated types and are out of reach of Java. But in languages that have generics with associated types you can do almost everything. Even lack of value parameters can be worked around by defining type-level arithmetic.



  • Google Maps has had a completely wrong name for my small village for years, and it's a pain in the ass sometimes.

    I've tried to "report wrong information" today, but the only options are reporting wrong data for a street, or for a POI. So I reported wrong address for a few places and changed the name there.

    What makes it more infuriating is that our government has a mapping agency that provides a variety of highly detailed topographical maps in computer-readable formats, with license to use in commercial products, and they most definitely include the right name and borders (in fact they probably define the legal name and borders).



  • @blakeyrat said in WTF Bites:

    @djls45 said in WTF Bites:

    Could you explain what the difference is, then?

    You claimed you just tried it. You didn't notice any difference?

    I opened a new Word document, pasted a bunch of lorem ipsum to get several pages of content, put the cursor in the middle of the last line, and pressed PgDn. The cursor moved to the end of the document.
    I even tried PgUp as well, to see how it works and to see if it's functionality different (other than being in the opposite direction).
    If not at the end of the document, the view moves by just a bit less than what is visible, so that the content that sits in view at the top/bottom moves so it is visible at the bottom/top, according to the direction of movement. The cursor moves to the vertical position on the furthest visible line in the target direction and to the nearest horizontal position available on that line, unless it is already sitting on the extreme line in that direction, in which case the cursor moves to the actual extremity of the document.

    Then I opened Chrome and it worked the same way, or at least it seemed to. What does Mac Classic do that is different? What should I expect to see different in Chrome or (if I had it) Mac Classic?


  • BINNED

    0_1537045475273_IMG_6815.PNG

    Wow


  • Fake News

    @topspin 491 MB? Does it need to cache your friends' wall posts and their most recent photos?


  • Discourse touched me in a no-no place

    @topspin I had that except it was reported as 516MB. Now it's installed it claims the app itself is 313MB. 🤷🏽♀


  • BINNED

    @JBert That's the download size from the AppStore.

    The memory usage info in settings says it uses an additional 345MB for "documents and data". Since everything it does is online, that's got to be the cache.



  • @Bulb said in WTF Bites:

    @pie_flavor said in WTF Bites:

    Like #include does. Which is fucking moronic and leads to an insane amount more compilation

    It's not moronic. It is supposed to be equivalent to hand-written specific code, so it has to do that. However

    @pie_flavor said in WTF Bites:

    especially when you include the obtuse linearity of the compiler, which among other things means that the template is not expanded once per argument set per project, but once per argument set per file.

    this is the real problem. The templates get compiled in each compilation unit over and over, because no compiler managed to come up with any kind of instance cache. Maybe they'll do something about it when the modules finally get implemented.

    Each source file may have different #defines set which could influence the contents of #included header files, so the instance cache would also have to carry the set of #defined items in order to work properly.


  • Considered Harmful

    @Bulb said in WTF Bites:

    @PleegWat said in WTF Bites:

    And I expect the cases are few and far between that you'd do anything with templates which you couldn't do with generics.

    “Generics” mean different thing for different languages. There are many things you can do with C++ templates, but can't do with Java generics due to lack of associated types. Most of the interesting cases beyond generic collections need associated types and are out of reach of Java. But in languages that have generics with associated types you can do almost everything. Even lack of value parameters can be worked around by defining type-level arithmetic.

    Rust does that, I think. Traits can have type fields.


  • 🚽 Regular

    @pie_flavor said in WTF Bites:

    @Bulb said in WTF Bites:

    @PleegWat said in WTF Bites:

    And I expect the cases are few and far between that you'd do anything with templates which you couldn't do with generics.

    “Generics” mean different thing for different languages. There are many things you can do with C++ templates, but can't do with Java generics due to lack of associated types. Most of the interesting cases beyond generic collections need associated types and are out of reach of Java. But in languages that have generics with associated types you can do almost everything. Even lack of value parameters can be worked around by defining type-level arithmetic.

    Rust does that, I think. Traits can have type fields.

    It's literally called associated types,



  • TL;DR: 390k sites with a .git folder accessible over HTTP, because they are deployed by idiots who simply use git pull on the live server. Unsurprisingly, the main culprit is PHP.

    0_1537076295919_267b0678-7416-4385-8742-564ae4466394-image.png

    WordPress domitates in this category. Only about 12% of these WP sites use the latest minor versions with the latest security patches. It is because when WP finds the .git (or other VCS) directory, it disables automatic core updates.

    This just gets better and better as you read.



  • @blakeyrat said in WTF Bites:

    @hungrier Somehow I've managed to never make that mistake, I wonder why--

    0_1536598297258_c40f1601-e355-4f2c-9875-13d309eb3fde-image.png

    Oh right. I use an OS that doesn't suck ass.

    Oh, it sucks ass. Just in a different way.



  • @LaoC said in WTF Bites:

    WTF, MS, are you looking for another EU court order?

    New manglement means doing the same stupid shit again.


  • Discourse touched me in a no-no place

    @Bulb said in WTF Bites:

    There are many things you can do with C++ templates, but can't do with Java generics due to lack of associated types.

    And those are one of the things that mean compilation takes a long time. All that additional processing of compile-time constant values isn't free, and that's a technique that is used a lot. By contrast, Java's generics are entirely in the type domain and need only extremely simple and fast code generation to issue. This makes them strictly less powerful (there's lots they can't do) but keeps their costs down too. They're helped by the fact that Java's object type hierarchy is single-rooted; that means that using a concretisation strategy based on supremum types and reference casting at point of use is practical.



  • @djls45 For fuck's sake.

    Where does the cursor end up after you hit page down on the bottom-most line?



  • @djls45 said in WTF Bites:

    Each source file may have different #defines set which could influence the contents of #included header files, so the instance cache would also have to carry the set of #defined items in order to work properly.

    No, it wouldn't. If the same name has different definitions in different compilation units, you get Undefined Behaviour™ and the linker will assume that all definitions of the same symbol are equivalent anyway. An instance cache would just move that assumption a little bit earlier.


  • area_can

    @topspin said in WTF Bites:

    The keys for crontab -e and crontab -r are literally next to each other.

    This is because The Unix Philosophy and the CLI are the most efficient possible way of interfacing with a computer, get better n00b 😎


  • BINNED

    @bb36e said in WTF Bites:

    @topspin said in WTF Bites:

    The keys for crontab -e and crontab -r are literally next to each other.

    This is because The Unix Philosophy and the CLI are the most efficient possible way of interfacing with a computer, get better n00b 😎GIT GUD

    FTFY.



  • @bb36e said in WTF Bites:

    This is because The Unix Philosophy and the CLI are the most efficient possible way of interfacing with a computer

    Do you really want to argue that this isn't a very efficient way of accidentally deleting the crontab contents?

    Have you ever tried to accientally delete the Windows-equivalent under Windows? That's truly a pain.



  • @cvi said in WTF Bites:

    @bb36e said in WTF Bites:

    This is because The Unix Philosophy and the CLI are the most efficient possible way of interfacing with a computer

    Do you really want to argue that this isn't a very efficient way of accidentally deleting the crontab contents?

    Have you ever tried to accientally delete the Windows-equivalent under Windows? That's truly a pain.

    Why would you do that when you can just export EDITOR=rm


  • Discourse touched me in a no-no place

    @ben_lubar said in WTF Bites:

    export EDITOR=rm



  • @dkf: really? export EDITOR=vi is much more cruel.


  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    @dkf: really? export EDITOR=vi is much more cruel.

    export EDITOR=ed


  • BINNED

    @Zerosquare said in WTF Bites:

    @dkf: really? export EDITOR=vi is much more cruel.

    At least you won't be able to overwrite anything. :trollface:


  • Java Dev



  • @blakeyrat said in WTF Bites:

    Where does the cursor end up after you hit page down on the bottom-most line?

    It moves to the end of that line, which is the end of the document.
    Now what?



  • @djls45 It does in Chrome, not in Word or Notepad.



  • This post is deleted!

  • Discourse touched me in a no-no place

    @Zerosquare said in WTF Bites:

    @dkf: really? export EDITOR=vi is much more cruel.

    OK, real evil would be to set EDITOR to something unexpected… in /etc/profile. (And I know the basics of using vi, at least enough that I can exit it without too much trouble.)



  • New Cisco switch, needed for a certain customer support scenario. I haven't touched these since my CCNA days in college. At first, I thought it was pretty cool that I no longer need an old-school serial/COM cable to configure them! It has a web interface now!

    But the web interface doesn't work. No matter which browser I use, it tells me it's an unsupported browser and can't be used. Of course, there is no list of supported browsers. I've tried IE, Edge, Firefox, and Chrome, and it won't let me in with any of those. I'm guessing someone threw together a static HTML page that says "Browser not supported!" so they could pretend to have a 21st century management interface.

    Now I gotta find out how to hook up a serial cable when none of my workstations have serial ports...


  • kills Dumbledore

    @mott555 Any hints in the page source what query string it's looking for? If it's specific versions of browsers you might be able to fake your query string .


  • sekret PM club



  • @Jaloopa said in WTF Bites:

    @mott555 Any hints in the page source what query string it's looking for? If it's specific versions of browsers you might be able to fake your query string .

    Cisco's always 20+ years behind. I guess I can fake an IE 3.0 user agent and see what happens.



  • @mott555 said in WTF Bites:

    But the web interface doesn't work. No matter which browser I use, it tells me it's an unsupported browser and can't be used.

    Did you try Lynx? 🍹



  • MSBuild has an interesting build number...

    Microsoft (R) Build Engine version 15.8.168+ga8fba1ebd7 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    


  • @dkf said in WTF Bites:

    OK, real evil would be to set EDITOR to something unexpected…

    lp? Might be fun...

    Edit: Setting PAGER to lp might also be fun. But technically a valid choice, I guess.


  • Java Dev

    @cvi said in WTF Bites:

    @dkf said in WTF Bites:

    OK, real evil would be to set EDITOR to something unexpected…

    lp? Might be fun...

    Edit: Setting PAGER to lp might also be fun. But technically a valid choice, I guess.

    And then you edit with whiteout and a pen, scan it in and let that Mspaint IDE convert it back to a text file?



  • @Bulb said in WTF Bites:

    @djls45 said in WTF Bites:

    Each source file may have different #defines set which could influence the contents of #included header files, so the instance cache would also have to carry the set of #defined items in order to work properly.

    No, it wouldn't. If the same name has different definitions in different compilation units, you get Undefined Behaviour™ and the linker will assume that all definitions of the same symbol are equivalent anyway. An instance cache would just move that assumption a little bit earlier.

    Some #define statements could result in that: the ones that produce or influence the production of an item that needs to be linked. But many #define statements don't affect linkages, so they wouldn't even have an opportunity to cause undefined behavior, as the (pre-)compiler behavior is contained to that single compilation unit.
    A #define can even be set, reset, or unset on the same command line between different files, so the system was clearly set up to be able to handle different #define replacements in different files.



  • @cvi said in WTF Bites:

    tried to accidentally [...]

    No, I can't say that I've ever successfully split my personality, much less into a planner and a klutz. 🍹



  • @blakeyrat said in WTF Bites:

    @djls45 It does in Chrome, not in Word or Notepad.

    It does in Word, too. I have a Notepad replacement, but it works the same in that.

    Oh! If the Word document isn't already scrolled all the way down to the end of the page, it scrolls down, and then the next PgDn press moves the cursor to the end of the document. Is that the behavior you're talking about?



  • @djls45 Ok fine.

    When your cursor is in the middle of a line, and you hit page down on the last line, on Windows your cursor stays put. (Does not move to the end of the line.)

    On Macintosh, your cursor moves to the end of the line.

    Since I learned typing on a Macintosh, I had muscle-memory to just wail on page down to get to the end of a document and it took me years to adapt to the way Windows does it.

    However, I can see the reasoning behind both approaches-- it's not like one OS is clearly "more wrong" than the other. MacOS says "there's no next line, so I'll take you as far as I can." Windows says "there's no next line, so you don't go anywhere at all".



  • @Atazhaia said in WTF Bites:

    And then you edit with whiteout and a pen, scan it in and let that Mspaint IDE convert it back to a text file?

    Now there's a classy way to edit the git commit messages.



  • @blakeyrat Ah, okay. They must have changed it in the version of Word I'm using. (I'm using Word v15.0.5023.1000 from Office 365 ProPlus.) I do get that behavior in SQL Server Management Studio, though.

    I don't use Page Down much; I prefer using Ctrl+End to move to the end of a document.


  • area_can

    @cvi said in WTF Bites:

    @Atazhaia said in WTF Bites:

    And then you edit with whiteout and a pen, scan it in and let that Mspaint IDE convert it back to a text file?

    Now there's a classy way to edit the git commit messages.

    If I ever interview developers I will do whiteboard coding and take points off their score if they don't write in cursive


  • Notification Spam Recipient

    @dcon said in WTF Bites:

    MSBuild has an interesting build number...

    Microsoft (R) Build Engine version 15.8.168+ga8fba1ebd7 for .NET Framework
    Copyright (C) Microsoft Corporation. All rights reserved.
    

    Is that part of the git commit hash?!?


  • Notification Spam Recipient

    @djls45 said in WTF Bites:

    @cvi said in WTF Bites:

    tried to accidentally [...]

    No, I can't say that I've ever successfully split my personality, much less into a planner and a klutz. 🍹

    What's worse is when the split goes horribly wrong and now everything is spilt all over the floor and spreading...


  • Notification Spam Recipient

    @blakeyrat said in WTF Bites:

    Since I learned typing on a Macintosh, I had muscle-memory to just wail on page down to get to the end of a document

    You poor soul... Apple taught you to think different...



  • @Tsaukpaetra Apple invented this shit.

    ... actually I don't know if they invented Page Down and probably they didn't, but they had the first system which could actually be used as a WYSIWYG desktop publishing machine, so they're the default when it comes to that as far as I'm concerned.



  • @Tsaukpaetra said in WTF Bites:

    Is that part of the git commit hash?!?

    Looks like it. I parsed it as:
    '15.8.168' + '+' + 'ga' + <hash>


  • :belt_onion:

    @dkf said in WTF Bites:

    @Zerosquare said in WTF Bites:

    @dkf: really? export EDITOR=vi is much more cruel.

    OK, real evil would be to set EDITOR to something unexpected… in /etc/profile. (And I know the basics of using vi, at least enough that I can exit it without too much trouble.)

    export EDITOR=:(){ :|: & };:?


Log in to reply