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

  • I hate both of them. The first one is very clunky with all the ". The second one is not self-docummenting at all, and it makes some enums impossible.

    For example, you can't represent:

     
        
    enum A {
        B(u32)
        C(u32)
        D
    }
    
      

    It would be

     
        
    A {
        | u32
        | u32
        | ()
    }
    
      

    Also, the pipe is very awkward to type, specially depending on keyboard layout. Since it's a rare character. If you need to separate between enums and struts and really don't want to use the enum and struct keywords, you can use different delimiters, like:

     
        
    A [
     u32,
     u32
    ]
    
    B {
     u32,
     u32
    }
    
      
  • To counteract this, I usually accept it right away and move on. But then I feel weird. Like, should I compliment back? It now feels weird that the compliment was over so fast. I don't think there's a good way to accept a compliment.

  • In my experience, nobody really knows what OOP is, everyone has a different definition.

    Most of the "OOP" features are implemented in languages that are not OOP. The only one that is to me an OOP-exclusive feature is class-inheritance. So IMO OOP=class inheritance.

    There is plenty of criticism about inheritance, specially among rust lovers. Since rust implements other features associated with classes, except class inheritance. Such as: methods (and self keyword), interfaces (traits), default interface method implementation.

    Anti-OOPs usually argue that encapsulation and interface is a much better alternative to class inheritance.

    Some things class inheritance is criticized for:

    Diamond inheritance problem: If there is class A. B and C inherit from A and override its methods. D inherits B and C without overriding them. What implementation should D inherit? B or C? Same happens if only B or C overrides.

    Encourages having multiple layers of abstraction: it's not uncommon to see huge inheritance chains. MyCustomList -> OrderedVector -> OrderedList and Vector -> List -> Collection -> Iterator. Just by looking at MyCustomList, you don't know the entire chain, you just see "OrderedVector". You have to follow many nested links until you can know it all, and then you have to retain that knowledge along with tens of other inheritance chains.

    Not ideal for performance: Inheritance encourages designs where the compiler will need to add a v-table to classes. These tables make implementation of OOP patterns much easier, but they require additional overhead when calling methods. Note that v-tables are not OOP specific, rust needs them also for trait objects. However, rust encourages designs with small amount of trait objects.

    Not as intuitive as claimed: People are taught OOP with simple examples involving real-world objects like: car -> vehicle -> object. However, these situations are rare except in some specific cases like UIs, video games, simulations. In most other cases, you are dealing with concepts rather than objects. And even when you're dealing with objects, it's not a clear cut. Sometimes it might happen that bicycle -> car. Even though not intuitive, in some situations this may be a useful inheritance. But when bicycle inherits car, it no longer resembles the inheritance-chain of the real world, so that's extra work for the brain.

  • If I have to search something in a repo, I just clone it and use my IDE. GitHub search sucks, but I don't think it's possible to have a web experience that is on par with an actual environment an IDE.

  • I guess that's another way to avoid the overflow problem

  • C:

     C
        
    int increment(int i) {
        return (int) (1[(void*) i])
    
      

    However, if you wanna go blazingly fast you gotta implement O(n) algorithms in rust. Additionally you want safety in case of integer overflows.

     rust
        
    use std::error::Error;
    
    #[derive(Debug, Error)]
    struct IntegerOverflowError;
    
    struct Incrementor {
        lookup_table: HashMap<i32, i33>
    }
    
    impl Incrementor {
        fn new() -> Self {
            let mut lut = HashMap::new();
            for i in 0..i32::MAX {
                lut.insert(i, i+1)
            }
            Incrementor { lookup_table: lut }
        }
    
        fn increment(&self, i: i32) -> Result<i32, IntegerOverflowError> {
            self.lookup_table.get(i)
                .map(|i| *i)
                .ok_or(IntegerOverflowError)
    }
    
      

    On mobile so I don't even know if they compile though.

  • Some people would not select google though. And google can't afford people knowing that there's competitors to Google! So better fuck everyone over by just disabling the integration.

  • Notice how you didn't even consider the possiblity of just china and Taiwan being separate countries. Which is how many civil wars end (the US civil war is not the only civil war). It is also the ending that causes less harm overall. The taiwanese don't die, and the Chinese don't "give in to separatists", because they are not separatists. You can't separate from a state you never belonged to. The taiwanese were never part of communist china.

  • What the taiwanese want is sovereignty.

    The threat of blowing up TSMC if invaded helps with their sovereignty because it both avoids the Chinese attacking them and helps the Americans defend them.

  • Don't worry. This is just third party AIs. Google's AIs will still be trained on them without your permission.

  • When the working class kills a CEO, there's a reward by the FBI and is found in a week. When a company does it, the world is silent.

  • You would think that because of that, people would melt them down when they became no longer useful as currency.

  • The [...] Is doing some heavy lifting.

    That's like saying that "I hope the black people that killed my parents suffer greatly" shouldn't be said. You can't just " I hope [...] black people [...] suffer greatly" it.

  • You can't have a distance in a "different direction". That's what the |x| is for, which is the modulus. If you rotate a triangle, the length of the sides don't change.

  • It's not fine to assume a 90° angle. The distance between B and C is 0. Therefore the angle formed by AB and AC is 0°.

    If the angle is 90°, then BC should be sqrt(2), not 0. Since the length of both sides is 1. sqrt(|i|2+|1|2) = sqrt(2).

  • This triangle is impossible.

    If the distance between B and C is 0, B and C are the same points. If that is the case, the distances between A and B and A and C must be the same.

    However, i ≠ 1.

    If you want it to be real (hehe) the triangle should be like this:

     
        
        C
        | \
    |i| |  \ 0
        |   \
        A---B
         |1|
    
      

    Drawing that on mobile was a pain.

    As the other guy said, you cannot have imaginary distances.

    Also, you can only use Pythagoras with triangles that have a 90° angle. Nothing in the meme says that there's a 90° angle. As I see it, there are only 0° and 180° angles.

    Goodbye, I have to attend other memes to ruin.

  • Nowadays reliability and coverage is actually the selling point.

    They may all have enough speed, but usually the expensive ISPs are more reliable. Mostly because the "cheap ISP"s are just the expensive ones in a trenchcoat selling excess bandwidth. But when the excess bandwidth is no longer excess, the cheap ones are the first to be cut off.

    So if you don't need 99.99...% uptime, the cheap ones are much better.

  • This user was not using git though, he was using vs code. That button doesn't say "git reset" it says "discard all changes". And btw, what it does is "git clean", which is something that git can do.

    Just below the button there is a list of all the changes. In his case, there were 3000 changes of the type "file creation". Discarding a file creation can only be made one way: deleting the file.

    Anyway, this user is presumably in his learning phase, I would not assume that he knows what git reset or git restore actually do.

  • There is a warning. IIRC it says "are you sure you want to discard all changes? This action is unreverisble". In the context of version management. Creating a file is a change. And just below the button to discard all changes is the list of changes. In that list he could've seen 3000 changes of the type "file creation", when you discard a file creation, it means to undo the creation, which is a deletion.

    The button days what is going to do. There is a warning about what it's going to do. And there is a list of the exact changes it's going to undo.

    The only way to avoid this from happening is to not have the button exist. In that case, the users that actually want to discard all changes would be unable to do so.