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

help-circle

  • Ephera@lemmy.mltolinuxmemes@lemmy.worldDesktop PTSD
    link
    fedilink
    English
    arrow-up
    3
    ·
    4 days ago

    On KDE, I’d recommend getting a KWin Script for tiling. Krohnkite is what people use currently.

    It’s not as buttery smooth as dedicated tiling window managers and it can be a bit glitchy at times, but it is better than one might expect and significantly easier (and likely less glitchy) than trying to get bspwm to work in Plasma.





  • Interesting and valid point, but Kotlin’s when is not actually pattern-matching. It really is just syntactic sugar for if-else, like you’ve demonstrated.
    Actual pattern-matching allows matching on the structure of a data type. So, you formulate a pattern to describe the structure and then you can choose different code paths based on whether the pattern matches or you can also access fields inside of this data type.

    Rust allows pattern-matching even in variable assignments, which is going to look funky, but I think it shows quite well that pattern-matching isn’t just a fancy switch statement: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=3a8d126fa0cb9736597793915b00dd5d

    So what happens is that:

    • there’s a check whether the data type has the described structure, and
    • where the pattern contains wildcards (like variable ‘slots’), the corresponding field values from the data type get put into those wildcards.

    When someone writes this in Rust:

    let x = 1;
    

    It’s still pattern matching under the hood, but the pattern x is just a singular wildcard, so the right-hand side just gets ‘assigned’ to that variable name.

    And with these simple examples, you might think that being able to access field values this way is silly, since you can also access them via my_data_type.foo, but it becomes more useful with deeply nested data types, and in particular in statically typed languages, it allows you to work with different data types without type casting. So, it would be more useful of a feature for TypeScript than it might be for JavaScript.


  • A video game I play recently added on-screen panic buttons, so for all the items you might want to use in a pinch. It’s a turn-based game, so you really have all the time in the world to check your items, but they’re still all listed there to remind you of the options you have. And of course, I still manage to completely ignore them when I get into a panic. 🫠


  • It should be noted that theoretically, we don’t know how this external API is implemented. The vast majority of APIs are REST APIs and with REST APIs, there’s a decent chance that you can download an OpenAPI definition from the server which provides the API.

    REST APIs are basically APIs which use HTTP(S) for transport and then there’s some specific rules how the API should be designed. Often times, these rules are not strictly followed and people still refer to such an API as “REST”, because they assume that any HTTP API is a REST API. But yeah, similarly the guides you’ll find will likely also work with general HTTP APIs.


  • Sounds to me like they’re not trying to create a website for now, but rather just process some data, which they can later display in a static webpage.

    So, I’m guessing something like this:

    +--------+     +---------+     +----------+
    | Static |     | Their   |     | External |
    | Web    |---->| Own     |---->| API      |
    | Page   |     | Backend |     |          |
    +--------+     +---------+     +----------+
    

    But yes, unless there’s a lot of data to crunch, the design one would usually go for is rather:

    +-----------+     +----------+
    | *Dynamic* |     | External |
    | Web       |---->| API      |
    | Page      |     |          |
    +-----------+     +----------+
    

    So, the data calculations would happen in the user’s browser. You would still need some hosting for that webpage, but there’s lots of free services to put a simple webpage up.

    And yes, when you go with that latter design, then JavaScript would be the typical choice. It’s still possible to do it with Rust, using WebAssembly (e.g. a colleague of mine has built a small statistics webpage which gets data directly from GitHub, using the Leptos framework), but it is definitely the less beaten path.

    Having said all that, frankly, fuck the usual way of doing things. If you’re comfortable with Hugo for frontend work, then I think it’s legit to build a little backend to take over the dynamic part. Better to build a useful project and learn something than to get stuck trying to learn the ‘correct’ path of doing it. Especially if you’d rather learn about Rust than JS.


  • Ephera@lemmy.mltoLinux@lemmy.mlKDE Plasma 6.4 released
    link
    fedilink
    English
    arrow-up
    6
    ·
    13 days ago

    Those Spectacle changes look good. The old UI made some amount of sense, if the primary use-case was taking complete screenshots, but even for that, there’s probably a single shortcut to do that directly.
    And I do find, I generally want a smaller cutout these days, because you can just fit more stuff onto modern displays, some of which is going to irrelevant.


  • Ephera@lemmy.mltoMemes@sopuli.xyzFuck off Babish
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    2
    ·
    13 days ago

    My favorite is when you get told to cook something in water and there’s always just this implicit “with salt” in there.

    Except when it isn’t. For example, you should only add salt to lentils after cooking, otherwise their hull turns hard.

    Well, and they also don’t tell you how much salt to use. Yesterday, I cooked millet and just added as much salt as I would add to noodles.
    But then I had to leave them in the pot to soak for half an hour, because they wouldn’t soften (is that also from the salt?). Which meant they had soaked up all the salt water and the millet was far too salty in the end.


  • Ephera@lemmy.mltoComic Strips@lemmy.worldExcuse Me?
    link
    fedilink
    English
    arrow-up
    9
    ·
    13 days ago

    Oh damn, I suspected as much, but I interpreted the arm in the third panel to be part of the jaw. So I thought, maybe with the big ears it might be a Dingo, but that seemed awfully specific for what should be the fairly obvious setup for a joke…


  • Yeah, the wording is confusing. A long time ago, there was no paid software, there was only software where you got the source code and other software where e.g. it was pre-installed on some hardware and the manufacturer didn’t want to give the source code.

    In that time, a whole movement started fighting for software freedom, so they called their software “free”.


  • Well, it didn’t feel like I’m tweaking to my needs (that came afterwards on top), it rather felt like I’m just undoing design decisions that someone made to cater to their specific needs.

    And I named the time mainly to give an idea of how much there was to tweak. My main problems were:

    • That I could not undo some of those unusual design decisions.
    • That it doesn’t exactly make the system more robust when you need lots of non-default settings.

  • Well, that was just kind of one example to illustrate that it isn’t just a static screenshot, you actually see what’s going on in real-time. It’s also useful when you’re running a longer operation, like OS updates or encoding a video, and want to see when it’s done or that it hasn’t failed. You can just tell when the command output has stopped moving or a popup has appeared…

    But thanks for the recommendation anyways!



  • I tried it a few years ago. I was really impressed by how lightweight and gorgeous it is. In particular, I found it really cool and actually useful that you got a live view of your other workspaces on your panel. You could even fullscreen a video on your other workspace and then watch (a very small version of) it in your panel.

    But yeah, even though I came back to it multiple times, I never ended up sticking around. It would crash regularly (not the worst thing, since recovery was generally seamless, but still meh), but in particular, it had some peculiar design decisions.

    For example, if you double-click a window titlebar in virtually any window manager, it will maximize. In Enlightenment, I believe it got shaded (i.e. the contents of the window got hidden and only the titlebar was still visible).

    Another prominent one was that its applet for connecting to WiFi and such didn’t support NetworkManager, but rather only ConnMan. If you’ve never heard of ConnMan, yeah, I only know it from Enlightenment, too. Similarly, my distro (openSUSE) didn’t package it either (and openSUSE was said to offer a relatively good Enlightenment experience). That’s something which should just work, because you can’t expect people to look up how they can connect to WiFi while they can’t reach the internet.

    And yeah, these are just the big ones that stuck in my head. There were lots of smaller usability issues, too. Many things you could fix by changing the configuration, but we’re talking many in an absolute sense, too, i.e. you might spend an hour or more just tweaking things so that they behaved like you might expect.