Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)C
Posts
0
Comments
522
Joined
3 yr. ago

  • Yes. Have a structure with 2 BigInts. Treat one as the numerator. The other as denominators.

    It might not be efficient or fast. But it is possible.

  • In C, goto is basically a necessity though. There is really no good way of error handling.

    Options:

    1. Using goto
     
        
    void func(void *var) {
        void * var2 = malloc();
        if var == Null {
            goto err;
        }
    
        do_something();
    
    err:
        free(var2);
    }
    
      

    1. Early returns:
     
        
    void func(void *var) {
        void * var2 = malloc();
        if var == Null {
            free(var2);
            return;
        }
    
        do_something();
    
        free(var2);
    }
    
      

    1. Skipping with conditionals:
     
        
    void func(void *var) {
        bool error = false;
        void * var2 = malloc();
        if var == Null {
            error = true;
        }
    
        if !error {
            do_domething()
        }
    
        free(var2);
    }
    
      

    1. Early return + cleanup function.

     
        
    void cleanup(void *var2) {
        free(var2);
    }
    
    void func(void *var) {
        void * var2 = malloc();
        if var == Null {
            cleanup(var2);
            return;
        }
    
        cleanup(var2);
    }
    
      

    Option 1 is really the only reasonable option for large enough codebases.

    Option 2 is bad because duplicate code means you might change the cleanup in one code path but not some other. Also duplicate code takes up too much valuable screen space.

    Option 3 has a runtime cost. It has double the amount of conditionals per error point. It also adds one level of indentation per error point.

    Option 4 is same as option 2 but you edit all error paths in one single place. However, this comes at the cost of having to write 2 functions instead of 1 for every function that can error. And you can still mess up and return while forgetting to call the cleanup function.

    You must also consider that erroring functions are contagious, just like async ones. I'd say most of the time a function is propagated upwards, with very few being handled just as it ocurrs. This means that whichever downside your option has, you'll have to deal with it in the whole call stack.

  • Deleted

    Permanently Deleted

    Jump
  • You're not stupid for it. Since it makes sense.

    However, due to the way we "calculate" the sizes of infinite sets, you are wrong.

    Even integers and all integers are the same infinity.

    But reals are "bigger" than integers.

  • Show one use case of Blockchain outside cryptocurrency. It must also be a better solution than a traditional database.

  • The good thing about the raspberry pi is that it costed less than 30€. At 200 it's no longer a tinkerer toy.

  • If you don't understand the "problem" part in the "what problem does this tool fix?" Then you probably don't need that tool. You should probably try the program they mentioned that didn't fix their specific problem. Since that program probably has way more users and a more entry-level documentation.

  • Bash might be better than IE. But I think we can agree that it is no longer a good shell.

    Its syntax is awful, and lacks many features that other shells have.

    It is only so widely used because it is a de facto standard. If bash was created today, barely no one would us it.

  • For me it's the opposite. Lossy ones (the ones that seem to maintain quality while lowering size by a lot) are magic to me but lossless is understandable.

    What do you mean "treat this image as a wave and do an inverse Fourier transform on it in order to discard the high frequency low amplitude noise". wtf? Straight up magic.

  • When I want to draw raw polygons, I use wgpu. When I want a GUI I used iced. And when I want both, I use wgpu+imgui.

    Learning wgpu is quite steep, and it has tons of boilerplate. So unless you're certain that you will use it a lot. I would just use iced.

    When I say wgpu I mean wgpu+winit. Though winit is quite simple and light. So the main part is wgpu.

  • They may be worse than a very good programmer. But will be much faster answer. The real captcha is not to check if the answer is correct. It is to check the time it takes to answer.

    Except humans that are not very good programmers will just give up and answer quite fast. Or just click away lol.

  • LLVM

    Jump
  • I haven't read 90% of your comment since it is out of the topic of the discussion. The "trap" is trying to argue with mee about something I haven't even mentioned.

  • Deleted

    Permanently Deleted

    Jump
  • As far as I'm aware, no one replied to the original comment. Maybe someone from lemmy.ml commented? I have many of them blocked. That might be the issue.

  • Deleted

    Permanently Deleted

    Jump
  • Yes that is me. Someone's beliefs are their opinion, that is correct, whether they are ignorant or not.

    I'm not saying I should be immune for criticism or retaliation. In fact I wish my comment was criticized so I can know what part of it people disagree with. Instead I'm met with "go eat farts, transphobe".

    In my opinion, claiming that "it is possible to not have fascism and whatever 'trans rights' means to you at the same time" is not transphobic.

  • Deleted

    Permanently Deleted

    Jump
  • I'm awaiting my ban from lemmy.world for being a something-phobe if that's the case. I don't think repeating xenophobe and transphobe is original though. What should they ban me for? I would think the logical next step is racism, but that doesn't end in phobe so it would be a waste of an opportunity.

  • Maybe that was true in the past. However, I wouldn't be surprised if ad blockers haven't multiplied by at least 100x. Ironically, due to YouTube increasing ad time to "compensate" for ad blockers.

    It used to be 1 ad per video, which you could skip after 5 seconds. Then 1 at the start, 1 at the end.

    I used to not block ads, willingly. Since they fund the content creators.

    However, then they started with ads in the middle of the video. Unskippable ads. More than 1 ad in a row. I had to use an ad blocker in order to be able to actually watch youtube.

    The content creators don't need my ad anyway. They earn way more money than the average person. And a single ad-watcher can watch more ads in 1 video than I used to do in 50, so they don't lose much from me.

    I can't understand this move by Google. Sure, they made more on YouTube, but the AdBlock I installed because of it now also blocks google ads in the entire internet. Surely they made a loss on that, right?

  • Deleted

    Permanently Deleted

    Jump
  • No thank you. I like using third party apps. I don't need to see or interact with those instances anyway. There's plenty more where people can accept that having a different opinion does not make you a something-phobe.

  • Deleted

    Permanently Deleted

    Jump
  • Op asked why we got banned. I said, lol. That's what this thread is for.

  • Deleted

    Permanently Deleted

    Jump
  • Never got banned from reddit.

    Got banned from .ml for "xenophobia" (calling someone a Russian bot)

    Got banned from blhaja too for "transphobia" (saying that leftists should focus on taxing the rich instead of giving subsidies to trans ppl)

  • LLVM

    Jump
  • I don't know whatever that language is doing is called, but it's not reference counting. It's doing some kind of static code analysis, and then it falls back to reference counting.

    If you call that reference counting, what stops you from calling garbage collectors reference counting too? They certainly count references! Is the stack a reference count too? It keeps track of all the data in a stack frame, some of it might be references!