• 0 Posts
  • 25 Comments
Joined 1 year ago
cake
Cake day: June 2nd, 2023

help-circle


  • I am always amazed by how the japanese are often times very willing to experiment and be inventive in terms of melding their own culinary culture with foreign ones, considering the isolationist and conservative history and reputation they have overall as a people.

    To me, that simply says that food really is one of the universal languages.

    I’d love to try this dish if just for experimentation, although I suspect it wouldn’t be something I’d have more than once lol


  • Yeah, no judgement here, when one is poor they gotta do what they gotta do, and ketchup is probably cheaper than decent tomato sauce in some parts of the world I would imagine.

    That said, I am willing to bet that the same pasta but with actual prepared tomato sauce (that means put it on the stove, let it simmer, add some salt, maybe a bit of pepper or a pinch of chili flakes if you like, and a drop of EVO oil when it comes off the heat) in place of ketchup would be even better.

    Although in your case, the ketchup recipe likely brings back happy emotions relating to your childhood which, after all, are also part of the food experience. Cheers!


  • ugo@feddit.ittoLinux@lemmy.mlGoldilocks distro?
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    9 days ago

    +1. Arch is super easy to install, just open the install guide on the wiki and do what it says.

    It’s also really stable nowadays, I can’t actually remember the last time something broke.

    As a counterpoint, on ubuntu I constantly had weird issues where the system would change something apparently on its own. Like the key repeat resetting every so often (I mean multiple times an hour), weirdness with graphic drivers, and so on.

    That said, I also appreciate debian for server usage. Getting security updates only can be desirable for something that should be little more than an appliance. Doing a dist upgrade scares the shit out of me though, while on arch that’s not even close to a concern.


  • As an italian my strong belief is that your wife should put whatever she wants on pizza. Hell it’s a flatbread with condiments, go crazy. It’s meant for it. If you want a none pizza with left meat, you should have a none pizza with left meat.

    Now if you put ketchup on pasta, I will judge your culinary literacy. Ketchup makes for a terrible pasta sauce


  • Meh. Been developing professionally with C++ for 10 years at this point. I’m one of the weird people that kinda likes C++ and its pragmatism despite all its warts.

    I’d like C++ better if it didn’t have inheritance. There are better solutions to model interfaces, and without inheritance people can’t write class hierarchies that are 10 levels deep with a different set of virtual functions overridden (and new virtual functions added) at each level.

    And yes, that is not hypothetical. Real codebases in the real world shipping working products do that, and it’s about as nice as you can imagine.


  • You do have a terminology mismatch. In C++, an abstract class is a class with at least one pure virtual method.

    Such classes cannot be instantiated, so they are useful only as base classes.

    An interface is more of a concept than a thing.

    Sure you can say that Iterable is an interface that provides the Next() and Prev() methods and you can say that Array is an Iterable because it inherits from Iterable (and then you override those methods to do the correct thing), and that’s one way to implement an interface in C++.

    But you can also say that Iterable<T> is a class template that provides a Next() and Prev() methods that call the methods of the same name on the type that they wrap (CRTP aka static polymorphism).

    Or you can say that an algorithm that scans a collection T forward requires the collection to have a Next() method by calling Next() on it.

    And I can think of at least 2 other ways to define an interface that isn’t using abstract classes.

    And even if using abstract classes, inheriting from them is definitely the least flexible way to use them to define an interface, because it doesn’t allow one to do something like mocking functionality in tests, because it’s not possible to redefine the class to be tested to inherit from the test interface implementation with mocked functionality, so one still needs something to the effect of dependency injection anyway.

    So yeah, abstract class is very different from inheritance, and it’s also very different from interface, even though it relates to both.


  • I think it’s possible that the filesystem ran out of inodes, so even though there is space on disk, there is no space in the filesystem metadata to store new files.

    Now, I don’t know off the top of my head how to check this, but I assume the answer is on the internet somewhere (am on phone and can’t help much more than this, sorry)




  • Use uBlock Origin. Not AdBlock, not AdBlock Plus, not any other crapware. Looking at AdBlock website they have a blurb about only keeping anonymised data and never selling it and yada yada yada, because it goes against their company ethics.

    Company ethics. AdBlock is owned by a company. A for-profit entity. How do you think they make their money? Either they sell the data they have gathered (why does an ad blocking extension need to gather user data?) or they have agreements with ad companies.

    Compare the websites of AdBlock and uBlock Origin. The first thing on uBlock Origin website is a link to the publicly available source code. That’s trustworthy. AdBlock’s website has a handpicked list of 5 star reviews.

    TL; DR: please switch to uBlock Origin and ditch AdBlock, they (the company behind AdBlock) likely have agreements with advertisers (including Google and YouTube) to make money. Your data is being harvested by using AdBlock. You cannot look at the code for AdBlock. AdBlock is not trustworthy.



  • if you’re using windows and expect any privacy at all […] throw that notion out the window

    Correct. And the same is true even if you are using linux, macOS, android, or a butterfly to manipulate bits to send a message through the internet.

    Because if your message ends up on the screen of a windows user, it’s also going to be eaten by AI.

    And forget the notion of “anything you post on the internet is forever”, this is also true for private and encrypted comms now. At least as long as they can be decrypted by your recipient, if they use windows.

    You want privacy and use linux? Well, that’s no longer enough. You now also need to make sure that none of your communications include a (current or future) windows user as they get spyware by default in their system.

    Well maybe not quite by default, yet



  • Reread the OP. They say:

    not on GNOME, because you have a panel at the top

    And

    when usign GTK apps on those [non-GNOME] desktops

    So you would not “access the controls above the app”, because having controls above the app is not covered by this scenario.

    The scenario is:

    1. You don’t have a top panel
    2. You have a maximized GTK app

    Which makes the close button be in the corner of the screen, but without actually extending to it.

    On topic: never knew this was a problem, guess I got spoiled by the Qt environment


  • I remember playing lots of sims 2 as a kid. Could not play sims 3 due to not having a pc that could run it, and I found sims 4 extremely disappointing.

    Been keeping an eye on Life by You and Paralives for modern takes at the genre.

    I wonder if EA will try to innovate with sims 5 and if they’ll try to optimize the unbelievable loading times (talking about sims 4 here) due to the competition or if they hope to coast on reputation alone.




  • ugo@feddit.ittoProgrammer Humor@lemmy.mlgot him
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    edit-2
    4 months ago

    Since my previous example didn’t really have return value, I am changing it slightly. So if I’m reading your suggestion of “rewriting that in 3 lines and a single nested scope followed by a single return”, I think you mean it like this?

    int retval = 0;
    
    // precondition checks:
    if (!p1) retval = -ERROR1;
    if (p2) retval = -ERROR2;
    if (!p3 && p4) retval = -ERROR3;
    
    // business logic:
    if (p1 && !p2 && (p3 || !p4))
    {
        retval = 42;
    }
    
    // or perhaps would you prefer the business logic check be like this?
    if (retval != -ERROR1 && retval != -ERROR2 && retval != -ERROR3)
    {
        retval = 42;
    }
    
    // or perhaps you'd split the business logic predicate like this? (Assuming the predicates only have a value of 0 or 1)
    int ok = p1;
    ok &= !p2;
    ok &= p3 || !p4;
    if (ok)
    {
        retval = 42;
    }
    
    return retval;
    

    as opposed to this?

    // precondition checks:
    if(!p1) return -ERROR1;
    if(p2) return -ERROR2;
    if(!p3 && p4) return -ERROR3;
    
    // business logic:
    return 42;
    

    Using a retval has the exact problem that you want to avoid: at the point where we do return retval, we have no idea how retval was manipulated, or if it was set multiple times by different branches. It’s mutable state inside the function, so any line from when the variable is defined to when return retval is hit must now be examined to know why retval has the value that it has.

    Not to mention that the business logic then needs to be guarded with some predicate, because we can’t early return. And if you need to add another precondition check, you need to add another (but inverted) predicate to the business logic check.

    You also mentioned resource leaks, and I find that a more compelling argument for having only a single return. Readability and understandability (both of which directly correlate to maintainability) are undeniably better with early returns. But if you hit an early return after you have allocated resources, you have a resource leak.

    Still, there are better solutions to the resource leak problem than to clobber your functions into an unreadable mess. Here’s a couple options I can think of.

    1. Don’t: allow early returns only before allocating resources via a code standard. Allows many of the benfits of early returns, but could be confusing due to using both early returns and a retval in the business logic
    2. If your language supports it, use RAII
    3. If your language supports it, use defer
    4. You can always write a cleanup function

    Example of option 1

    // precondition checks
    if(!p1) return -ERROR1;
    if(p2) return -ERROR2;
    if(!p3 && p4) return -ERROR3;
    
    void* pResource = allocResource();
    int retval = 0;
    
    // ...
    // some business logic, no return allowed
    // ...
    
    freeResource(pResource);
    return retval; // no leaks
    

    Example of option 2

    // same precondition checks with early returns, won't repeat them for brevity
    
    auto Resource = allocResource();
    
    // ...
    // some business logic, return allowed, the destructor of Resource will be called when it goes out of scope, freeing the resources. No leaks
    // ...
    
    return 42;
    

    Example of option 3

    // precondition checks
    
    void* pResource = allocResource();
    defer freeResource(pResource);
    
    // ...
    // some business logic, return allowed, deferred statements will be executed before return. No leaks
    // ...
    
    return 42;
    

    Example of option 4

    int freeAndReturn(void* pResource, const int retval)
    {
        freeResource(pResource);
        return retval;
    }
    
    int doWork()
    {
        // precondition checks
    
        void* pResource = allocResource();
    
        // ...
        // some business logic, return allowed only in the same form as the following line
        // ...
    
        return freeAndReturn(pResource, 42);
    }