WTF Bites



  • @Applied-Mediocrity said in WTF Bites:

    But does it matter? There is no way for anyone to run general purpose programs that are even more fine grained than raw assembly on x86-64 computers. Assembly is "close to metal" as one can get.

    You're right to some degree. If you want to do some very low level optimizations (very CPU specific, typically), you may want to account for the extra layer. You might be writing assembly (not much choice there). At the same time, the front end can only decode and translate a certain number of instructions per cycle. Resulting µops are cached. x86 instructions can result in multiple µops, but certain sequences of x86 instructions can also be fused into single µops. You would look at how the µops are scheduled to various execution units, execution latency, what µops can run concurrently, ...

    You can pretend that all of this is just characteristics of the individual x86 instructions, but at some point that just becomes more effort than acknowledging and accounting for the underlying stuff.



  • @TwelveBaud said in WTF Bites:

    @Tsaukpaetra National Semiconductor has one. It boots directly to 64-bit protected mode, with no support for real mode or v86 mode. No idea why though: it's intended for embedded applications as a system-on-a-chip, with most pins intended to feed directly into various PHYs, and because of that it has fewer address lines than a normal 32-bit chip, not more.

    Do you have the part number? I was aware there were special 386s for embedded systems that were like that, but I didn't know there was a 64-bit version (nor that anybody else besides Intel and AMD did x64).


  • Considered Harmful

    Gaben's mAcHinE LeRniNg

    1.png

    2.png

    Same developer, most of the tags match, first twelve symbols of the title also do. Result: probably "needs context" or something...


  • Considered Harmful

    In order to push schema changes, you have to make a pull request with a SQL file, with the following filename:

    [JIRA_TICKET_ID]/[ISO_DATE];[JIRA_TICKET_ID];[DATABASE_NAME];[SCHEMA_NAME];[DESCRIPTION].sql

    A Jenkins job will parse the relevant info from the filename and run the script for you. Yes, all the info must be correct or the job will crash with a cryptic error.


    Filed under: :trwtf: is they didn't just put the DDL in the filename as well.


  • I survived the hour long Uno hand

    @error said in WTF Bites:

    In order to push schema changes, you have to make a pull request with a SQL file, with the following filename:

    [JIRA_TICKET_ID]/[ISO_DATE];[JIRA_TICKET_ID];[DATABASE_NAME];[SCHEMA_NAME];[DESCRIPTION].sql

    A Jenkins job will parse the relevant info from the filename and run the script for you. Yes, all the info must be correct or the job will crash with a cryptic error.


    Filed under: :trwtf: is they didn't just put the DDL in the filename as well.

    You know a process is really :wtf_owl: when :trwtf: isn't even the fact that the Jira ticket ID has to be in there twice.



  • Not to mention the /. How do you even include that in a filename?


  • Considered Harmful

    @Zerosquare said in WTF Bites:

    Not to mention the /. How do you even include that in a filename?

    https://www.compart.com/en/unicode/U+29F8 🏆



  • @error said in WTF Bites:

    In order to push schema changes, you have to make a pull request with a SQL file, with the following filename:

    [JIRA_TICKET_ID]/[ISO_DATE];[JIRA_TICKET_ID];[DATABASE_NAME];[SCHEMA_NAME];[DESCRIPTION].sql

    A Jenkins job will parse the relevant info from the filename and run the script for you. Yes, all the info must be correct or the job will crash with a cryptic error.

    Dammit. Who accepted that PR from Swampy?



  • @error said in WTF Bites:

    🏆

    I expected someone to post that, but I thought it would be from a different blue avatar.


  • Considered Harmful

    @Zerosquare said in WTF Bites:

    @error said in WTF Bites:

    🏆

    I expected someone to post that, but I thought it would be from a different blue avatar.

    7ace5c74-ec61-4cc6-84b9-99b4c8c95535-image.png ?


    Filed under: If :thats_the_joke: then IDGI



  • @Zerosquare said in WTF Bites:

    different blue avatar

    Me? No. I'm no Unicode expert. I might have known at some point that there is another code point that has a glyph that looks exactly like /, but I don't deal with Unicode shenanigans enough to remember that off hand.



  • @TimeBandit said in WTF Bites:

    @Parody said in WTF Bites:

    I'm sure this government entity will get started on it in, oh, 2025.

    Now we know you're an optimist

    I figure "get started" means "form an exploratory committee to consider whether we need to replace the existing system". We wouldn't want to rush, would we?



  • @Applied-Mediocrity said in WTF Bites:

    @cvi said in WTF Bites:

    @error said in WTF Bites:

    Oh, that obscure concept called money. Who could have anticipated such a niche requirement?

    I can probably count the number of times I've worked on anything involving computations with monetary units on a single hand.

    Do you round up or down?

    Wouldn't s round towards zero?



  • This post is deleted!


  • This post is deleted!


  • Apparently "On Update blah blah" error == "actually posted, not that we'll tell you".


  • kills Dumbledore

    @cvi said in WTF Bites:

    @error said in WTF Bites:

    Oh, that obscure concept called money. Who could have anticipated such a niche requirement?

    I can probably count the number of times I've worked on anything involving computations with monetary units on a single hand.

    Every programming job I've had has involved money as a data type


  • Banned

    @Jaloopa I hope they also involved money as your salary.


  • Considered Harmful

    Theory: we run our development instances in containers so they work everywhere
    Practice: we run our development instances in containers so they don't work anywhere


  • Banned

    @error hey, I've seen that before!

    44f44a99-b7a5-4d31-9232-3dfd2fa93b2a-image.png



  • @Gąska said in WTF Bites:

    @Jaloopa I hope they also involved money as your salary.

    Of course, he's not @Tsaukpaetra 🍹


  • Considered Harmful

    @Gąska said in WTF Bites:

    @error hey, I've seen that before!

    44f44a99-b7a5-4d31-9232-3dfd2fa93b2a-image.png

    :why_not_both: It's JVM running on CentOS in Virtualbox.


  • Notification Spam Recipient

    @error said in WTF Bites:

    @Gąska said in WTF Bites:

    @error hey, I've seen that before!

    44f44a99-b7a5-4d31-9232-3dfd2fa93b2a-image.png

    :why_not_both: It's JVM running on CentOS in Docker in Ubuntu in Virtualbox in Windows 10 in HyperV in VMWare in Windows 7.


    Filed under: I can keep them coming...


  • Considered Harmful

    @Tsaukpaetra said in WTF Bites:

    Filed under: I can keep them coming...

    So can I. :giggity:


  • I survived the hour long Uno hand

    @error said in WTF Bites:

    @Tsaukpaetra said in WTF Bites:

    Filed under: I can keep them coming...

    So can I. :giggity:

    Screenshots or it didn't happen.



  • @topspin said in WTF Bites:

    ☕ operator overloading is evil!

    ☕ is wrong in it's head. It does not matter whether the function is called + or .add, if you use it with the usual meaning, the code will be readable, and if you use it with unusual meaning, the code will be a mess.

    @error said in WTF Bites:

    Operator overloading is evil, but it shouldn't need operator overloading, because there should be a primitive type where the builtin operators work.

    I'll take operator overloading over building everything in any day.

    Because, you know, the set of useful abstractions is pretty large and many can be built in a library if the language just provides operator overloading—and generics. For example with money you might want to take the decimal type, and wrap it in a money type, so you don't accidentally add a phone number to an account balance. And then you start working with multiple currencies, so you extend the money type to, statically or dynamically depending on the specific case, also remembers which currency the value is in, so you don't deduct the price in ¥ from the account in $ by mistake without proper conversion. And then you work on another application and there you might need a newtype for, say, coordinates, or speeds, or whatever.

    So I really prefer languages that provide a lot of rope for building abstractions. Sure, it's also enough rope to hang yourself, and even to shoot yourself in the foot if you try a bit, but code monkeys can hang themselves on shoelaces, so I don't think dumbing down the language is a good way. Better have the senior set up domain-appropriate abstraction and make the monkeys use it as hand-rails.



  • @error said in WTF Bites:

    Theory: we run our development instances in containers so they work everywhere
    Practice: we run our development instances in containers so they don't work anywhere

    Well, if they don't work anywhere, they are simply broken and you have to fix your shit. It would only be strange if they only worked on one machine.



  • @dkf said in WTF Bites:

    The problem with operator overloading is that it is difficult to actually get right, so when it is done it is usually done wrongly, and you instead end up with substantive amounts of code use hidden almost in plain sight

    It's one of those things that is a huge boon to readability when used properly, but requires care.

    if(app.CurrentVersion > new Version("6.2.1")) { ... } is great, and much more semantically clear than having to write the method call if(app.CurrentVersion.isLaterThan(new Version("6.2.1"))) { ... }. Or a vector maths library that lets me do

    Vector3 X = new Vector3(1, 0, 0), Y = new Vector3(0, 1, 0);
    var v = X + Y;
    ... though you always have the fight over whether X*Y should be dot or cross product.

    But I'm deeply unconvinced about C++ stream semantics, which make << and >> fundamentally do different things from their original definition. And although I like equality overrides (I write Java professionally and littering code with .equals makes it less readable), you do have to be careful to do it right.

    Implicit casts, Linq and lambdas are all examples of things that need to be done well or not at all.



  • @Jaloopa Every programming job I've had has involved money as a data type

    Depends where you work I guess - I've never had to deal with this, even when I was writing algorithmic trading code that dealt with large amounts of money (because it was trading integer units of bonds off the markets, not dollars and cents).


  • Considered Harmful

    @TwelveBaud said in WTF Bites:

    @Tsaukpaetra National Semiconductor has one. It boots directly to 64-bit protected mode, with no support for real mode or v86 mode.

    Pretty much everybody except for Intel and AMD have had them all the time :mlp_shrug:

    No idea why though: it's intended for embedded applications as a system-on-a-chip, with most pins intended to feed directly into various PHYs, and because of that it has fewer address lines than a normal 32-bit chip, not more.

    A 64-bit-everything model is still convenient even if your code ends up being rather small. The DEC Alpha had it at a time when 128 MB was considered a lot of RAM.



  • @bobjanova said in WTF Bites:

    It's one of those things that is a huge boon to readability when used properly, but requires care.

    It would help if the normally related operators were defaulted as appropriate. If you define < (or <= if partial ordering is expected to be supported), the >, ==, !=, <= and >= were automatically defined, with option to override them for performance. It would also be possible to default binary - from + and unary -, or unary - from binary - and default constructor.

    ... though you always have the fight over whether X*Y should be dot or cross product.

    Generally dot product, because cross product is a rather weird animal. It is much nicer in languages that allow custom operators.

    @bobjanova said in WTF Bites:

    But I'm deeply unconvinced about C++ stream semantics, which make << and >> fundamentally do different things from their original definition.

    C++ planted itself into a corner with some other choices it made. You can create (static only) “multi-methods” with overloaded functions and argument-dependent lookup, but chaining those is ugly, because the first argument is after the name in parenthesis, so it ends up looking very(very(very(ugly, arg1), arg2), arg3). And you can't add new overloads for member functions, so this.does(not).does(not).does(not) work. And there are no custom operators. So they abused an existing operator instead.

    There would actually have been nicer ways. For example the stream could define a template <class T> Self write(const T&x) { stream_write(*this, x); return *this; } and then you'd define free function stream_write` and call it chained via the convenience wrapper. But it was 25 years ago and they didn't have the experience we have now.

    They've made bigger mistake with streams, like the free function getline that does not fit into the >> chaining anyway, but you have to use it for most string input, because the default behaviour of operator>>(istream &, string &) is utterly brain-damaged (it mirrors the brain-damage of scanf on which it is built, but with scanf you can actually specify the delimiter—though I am not sure it isn't a later addition).

    @bobjanova said in WTF Bites:

    Implicit casts

    Yeah, it took some time for people to learn not to overdo those. MFC in particular had some really surprising auto-conversions.


  • BINNED

    @Bulb said in WTF Bites:

    Generally dot product, because cross product is a rather weird animal.

    Also because the cross product is only defined in ℝ³, whereas a dot product is applicable to any pair of equal-length vectors. So for a Vector2 or Vector4 or Vector893, scalar product is the only option.


  • Banned

    @Bulb said in WTF Bites:

    They've made bigger mistake with streams, like the free function getline that does not fit into the >> chaining anyway

    getline et al. are C functions. They're meant for compatibility with C, and are completely separate from stream API.

    That I prefer to use those legacy C functions over stream API is another matter...


  • BINNED

    @Gąska said in WTF Bites:

    @Bulb said in WTF Bites:

    They've made bigger mistake with streams, like the free function getline that does not fit into the >> chaining anyway

    getline et al. are C functions. They're meant for compatibility with C, and are completely separate from stream API.

    That I prefer to use those legacy C functions over stream API is another matter...


  • Banned

    @Bulb said in WTF Bites:

    C++ planted itself into a corner with some other choices it made. You can create (static only) “multi-methods” with overloaded functions and argument-dependent lookup, but chaining those is ugly, because the first argument is after the name in parenthesis, so it ends up looking very(very(very(ugly, arg1), arg2), arg3). And you can't add new overloads for member functions, so this.does(not).does(not).does(not) work.

    Funny you mention that, because the C++ committee is actively working on solving this particular problem. UFCS (the dot-syntax-for-free-functions thing) has been first conceived all the way back in 2004, and was supposed to be part of C++17, but it was rejected very late into the process for bureaucratic raisins. Then it was supposed to come in 2020 but the same thing happened again.

    So I'd say it isn't a good example of "planting itself into a corner". It's easily fixable, it just wasn't. Compare to the stream retardery, which is there to stay forever.


  • Banned

    @topspin said in WTF Bites:

    @Gąska said in WTF Bites:

    @Bulb said in WTF Bites:

    They've made bigger mistake with streams, like the free function getline that does not fit into the >> chaining anyway

    getline et al. are C functions. They're meant for compatibility with C, and are completely separate from stream API.

    That I prefer to use those legacy C functions over stream API is another matter...

    Oh, that getline. Yeah, forgot about it. I'm actually glad I forgot about most of C++ things...



  • @bobjanova said in WTF Bites:

    @Jaloopa Every programming job I've had has involved money as a data type

    Depends where you work I guess - I've never had to deal with this, even when I was writing algorithmic trading code that dealt with large amounts of money (because it was trading integer units of bonds off the markets, not dollars and cents).

    Another example: I wrote some money-dealing code with currency that cannot be represented as a single number. I had to wrap the number of gold, silver and copper pieces as a struct anyway.

    Of course, that was in a game and you won't find that IRL today. Which actually brings a question: how was pre-decimal British currency handled? Did the Lyons computers have hardware Shilling-Penny-Arithmetic-Unit?


  • Banned

    @Kamil-Podlesak said in WTF Bites:

    Of course, that was in a game and you won't find that IRL today. Which actually brings a question: how was pre-decimal British currency handled? Did the Lyons computers have hardware Shilling-Penny-Arithmetic-Unit?

    Computers that old didn't even have FPUs, so I doubt they'd have currency-optimized instructions either.



  • @Gąska said in WTF Bites:

    It's easily fixable

    "Easily", except for

    bureaucratic raisins

    which tend to make easy things nearly impossible.


  • Discourse touched me in a no-no place

    @Kamil-Podlesak said in WTF Bites:

    Did the Lyons computers have hardware Shilling-Penny-Arithmetic-Unit?

    That always was the original LSD.



  • @Gąska said in WTF Bites:

    @Kamil-Podlesak said in WTF Bites:

    Of course, that was in a game and you won't find that IRL today. Which actually brings a question: how was pre-decimal British currency handled? Did the Lyons computers have hardware Shilling-Penny-Arithmetic-Unit?

    Computers that old didn't even have FPUs, so I doubt they'd have currency-optimized instructions either.

    Actually, they often did have floating point arithmetic unit when built for heavy scientific computations and fixed-point BCD arithmetic units when built for financial purposes.


  • BINNED

    @Gąska said in WTF Bites:

    UFCS (the dot-syntax-for-free-functions thing)

    Since there's probably no way we're ever getting extension methods1, I'd gladly take this instead. If they ever managed to ship it before I retire.

    1 What's the common opinion about them in C#? Look neat to me, but since I've never used them I don't know if the feature is actually good.



  • @Gąska said in WTF Bites:

    That I prefer to use those legacy C functions over stream API is another matter...

    The stream API is an eldrich abomination, but it's the only extensible thing the C++ standard library has. I prefer to be able to define formatting for my types, if nothing then for sake of easier logging, and the C API just can't do that.

    @Gąska said in WTF Bites:

    So I'd say it isn't a good example of "planting itself into a corner". It's easily fixable, it just wasn't. Compare to the stream retardery, which is there to stay forever.

    Now the things are part of the same standard, so they can be evolved together. But the streams were created as a library, so it had to do with the available syntax—and whatever understanding of it the designers had back then.



  • @topspin said in WTF Bites:

    @Gąska said in WTF Bites:

    UFCS (the dot-syntax-for-free-functions thing)

    Since there's probably no way we're ever getting extension methods1, I'd gladly take this instead. If they ever managed to ship it before I retire.

    “Extension methods” and “UFCS” is the same thing except for the fact that C# does not have “free functions”, so it has static methods on random, otherwise empty, class instead.

    1 What's the common opinion about them in C#? Look neat to me, but since I've never used them I don't know if the feature is actually good.

    I believe they are used a lot around collections and LINQ (the interfaces define basic iteration and then a lot of convenience helpers is defined as extension methods), but I haven't worked with C# for years, so I might remember wrong.

    Typeclasses are superior, but they require thick pointers, which would be difficult to retrofit in C++.


  • Java Dev

    @Kamil-Podlesak said in WTF Bites:

    @bobjanova said in WTF Bites:

    @Jaloopa Every programming job I've had has involved money as a data type

    Depends where you work I guess - I've never had to deal with this, even when I was writing algorithmic trading code that dealt with large amounts of money (because it was trading integer units of bonds off the markets, not dollars and cents).

    Another example: I wrote some money-dealing code with currency that cannot be represented as a single number. I had to wrap the number of gold, silver and copper pieces as a struct anyway.

    Of course, that was in a game and you won't find that IRL today. Which actually brings a question: how was pre-decimal British currency handled? Did the Lyons computers have hardware Shilling-Penny-Arithmetic-Unit?

    I know world of warcraft internally does everything in copper; it just formats it into gold/silver/copper on display.



  • @topspin said in WTF Bites:

    What's the common opinion about them in C#

    Personally: They are really convenient and nice to use, but it really breaks your link of where to find code unless you're using an IDE with click through.


  • Banned

    @Bulb said in WTF Bites:

    @Gąska said in WTF Bites:

    So I'd say it isn't a good example of "planting itself into a corner". It's easily fixable, it just wasn't. Compare to the stream retardery, which is there to stay forever.

    Now the things are part of the same standard, so they can be evolved together. But the streams were created as a library, so it had to do with the available syntax—and whatever understanding of it the designers had back then.

    Syntax is the smallest of problems with streams. And none of those problems can ever be "evolved out".



  • @Gąska I agree. I did say it is an eldritch abomination. The stateful setting of formatting options is horrible and the fail flags are even horribler. But nobody proposed any saner replacement and everybody just kind of gave up and defined their formatting functions as << operators and we're stuck with it.



  • @Gąska … and it's actually the limitations of the syntax that forced the idiotic stateful formatting flags. If there was a convenience method calling out to a normal free function, it could have multiple arguments and thus allow providing formatting flags. Or multiple functions for different flags or whatever. But nooooo.

    … and while for error handling it's either exceptions, which is not always desired, or error flags, a convenience method could take care of the state guard business you have to do in any non-trivial custom operator<< implementations.



  • WTF of the day: Zoom on ubuntu.
    I have a laptop (1920px) and 27" 4K monitor (running at 100% because ubuntu). You'd think hiDPI wouldn't be a problem. You'd be wrong. Zoom looks fine on the laptop. Move window to 4K monitor, and they scale. :sideways_owl:


Log in to reply