• 89 Posts
  • 4.35K Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle


  • Ephera@lemmy.mltomemes@lemmy.worldHonest mistake
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 hours ago

    The grocery store here got rid of 2 out of 5 cashier lines to introduce self-checkout stations. They were in full operation for two months or so. Since then they’ve been mostly closed for whatever reason. Now half of the self-checkouts are back open, but they hung up a sign that you’re only supposed to use them, if you have 10 items or less. Who goes to a grocery store to buy only 10 items? Yeah, I really don’t know what they’re doing. Were they experiencing a massive spike in theft or why did they introduce these self-checkouts only to then nerf them out of usefulness?




  • Hmm, which distro did you try it with? I believe, KDE should support auto-rotating the screen in the newer versions¹. If you tried it with Kubuntu LTS, for example, that would’ve still been an older version, which does not use Wayland by default.

    ¹) More precisely: it should support it when it’s being run under Wayland, which is the default since KDE Plasma 6.







  • Well, it certainly wouldn’t be the first time that I call some code unnecessarily hard to read and others call it pythonic.

    I understand that truthiness has an advantage when you don’t have static types, because it deals somewhat reasonably with most types, and then that is why many experienced Python programmers tend to use it. But I maintain the position that it therefore necessarily also makes it harder to read the code, because you necessarily provide the reader with fewer hints as to what is actually in that variable. It is very much like code using lots of generics in statically typed code.

    As for if Enum.empty?(var), I actually prefer that to checking the length. That syntax in particular, I find a bit too complex – my preferred version is if var.is_empty() – but I still think it makes it easier to read than a length check.
    Of course, there’s the nuance that it’s more syntax to remember for actually writing the code. And in particular in dynamically typed languages, your editor may not be able to auto-complete that, so I can understand just not bothering with the extra syntax and doing len == 0 instead. It’s fine.




  • Yeah, that is a very good question. It’s one of the last commands in the script and initially I thought they had set up the script so that it would abort, if any of the commands before it would fail.

    But then a colleague pointed out that it’s actually the opposite. So, you can tell the shell to abort execution on error by running set -e. But what they had written at the top was set +e, which explicitly turns that off (even though it should be off by default).
    The last command in the script is also exit 0, so it always indicates success.
    So, yeah, they seem to have knowingly made it so that if the script fails, then it doesn’t retry or anything. It tries to plough through as many of the commands as it can manage (ignoring any that fail on the way) and then it always deletes itself.

    I guess, it’s not as egregious of an assumption, because it only runs on a fresh OS. That’s a pretty controlled environment to be executing in, so the chance of something going wrong is rather low.
    Well, and the other question is what else would you do? If the script fails and you don’t delete it, it’s going to re-run on the next boot. What’s going to be different on the next boot to make it succeed then? Might as well do as much as you can and then quit…


  • Ephera@lemmy.mltoLinux@lemmy.mlHow I use Kate Editor
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    1 day ago

    renaming symbols, presenting documentation, formatting files,

    Yes, these are supported via the Language Server Protocol (LSP). I’ve mostly been using it with the Rust LSP server (rust-analyzer) and well, it typically works, but sometimes you have to tell it to restart the LSP server and stuff (which isn’t a huge ordeal, but don’t expect everything to always work as well as in a full-fledged IDE).
    I believe, for formatting, there’s also some non-LSP support.

    showing code diagnostics beyond syntax errors (for example code smells or so),

    This is supported in principle via LSP, too, but it depends on the specific LSP server, how much info it provides. The Rust compiler gives out relatively much on its own, which is passed on by the LSP server, but you can apparently also configure it to use the linter on save.

    have AI integration (explain this, rewrite this, replace this with prompt output, …),

    Not out of the box. There’s a way to define “External Tools”, which basically allows you to run commands and pass arguments to them and then use their output. For example, you should be able to define an External Tool, where you can select some text, then press your keyboard shortcut for that tool, so it sends the selected text to that tool and then it takes the command output and inserts it instead of the selected text.
    While this is a powerful concept, I don’t know, if you hit limitations at some point.

    specific framework integrations (reactjs, django, actix, …),

    Nope, except where this might be covered by LSP. But there’s no obvious way to just install additional plugins, for example. You get about thirty built-in plugins and that’s it.

    and stuff like expanding macros in C/C++ and Rust?

    Well, expanding macros is also possible with the Rust LSP server. Don’t know about other languages.



  • Ephera@lemmy.mltoScience Memes@mander.xyzfloats away in disgust
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    1 day ago

    For me, it’s a matter of this joke being old. If someone had sat down and drawn it as a comic anyways, that would make it cool and the thought of it can be humorous in its own way. But since they didn’t, it’s ultimately just an old joke. It not having been made through manual labor does change my enjoyment of it.

    (And much like the others, I don’t care that it looks well-drawn. I just care that someone decided, fuck it, I’m a silly goose, I’ll spend some time crafting something for no good reason.)



  • Yeah, I’m talking less deep than that. Plenty programming beginners will be reading Python code. And personally, I’m a fulltime software engineer, but just don’t do much Python, so while I had it in the back of my mind that Python does truthiness, I would have still thought that var must be a boolean, because it’s being negated. Obviously, a different variable name might’ve given me more of a clue, but it really doesn’t reduce mental complexity when I can’t be sure what’s actually in a variable.