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/)AZ
Posts
1
Comments
188
Joined
1 yr. ago

  • The buffalo thing pisses me off the most. Entire cultures are defined by that animal and it's incredibly significant to the history of the prairies and the continent as a whole. So it seems to me pretty disrespectful to go to these people and go "um actually what you've been calling this animal for centuries is wrong actually because Linnaeus or whatever"

  • It's worth noting that a number of languages comparable C in use case and performance (including its predecessors COBOL, Fortran and ALGOL) start indexing at 1 just fine because they have proper array types and don't make heavy use of pointers poking and peeking wherever they like (eg by using references instead).

    Decoupling indices from memory offsets doesn't get in the way of performance and actually often allows better optimization because the compiler knows you aren't sharing pointers between arrays or some other shenanigans; see Fortran, the GOAT of fast array processing. This also allows improved type safety and thus memory safety; see index types in Ada/SPARK and the fact that it's the only 'legacy' language that's gotten comprehensive compile-time memory safety analysis (though the latter is moreso from the less willy-nilly pointers in general)

  • The fruit flies you've seen eating fresh fruit are probably Drosophila suzukii (spotted wing fruit fly). Most (all?) other Drosophila species (including the model organism Drosophila melanogaster) only feed on rotting fruit. Though they'll consume the sugars too, not just the microorganisms. So standard lab diets include sugar along with yeast and often cornmeal.

    There are also some more distantly related flies that feed on fresh fruit and are commonly called fruit flies, eg Ceratitis capitata (Mediterranean fruit fly)

  • What? The closest thing to an abolition of slavery by British authorities was Dunmore's Proclamation which was proclaimed well after the Revolution had turned into open war. The American Revolution wasn't motivated by any real or perceived threat to the institution of slavery.

  • I'm not sure if there's anything enable_if can do that concepts can't do somewhat better but yeah there's definitely a lot of subtleties that reflection is going to make nicer or possible in the first place

  • You already can do that with C++20 concepts and the requires expression

     
        
    template <typename T>
    concept has_member_foo = requires(T t) {
        t.foo();
    };
    
    // Will fail to instantiate (with nice error 
    // message) if t.foo() is ill-formed
    template <has_member_foo T>
    void bar(T t) {
        // ...
    }
    
    // abbreviated form of above
    void baz(has_member_foo auto t) {
        // ...
    }
    
    // verbose form of above
    template <typename T> requires
        has_member_foo<T>
    void biz(T t) {
        // ...
    }
    
    // same as above but with anonymous concept
    template <typename T> requires
        requires(T t) { t.foo(); }
    void bom(T t) {
        // ...
    }
    
    // If already inside a function
    if constexpr (has_member_foo<T>) {
        // ...
    }
    
    // Same but with anonymous concept
    if constexpr (requires(T t) { t.foo(); }) {
        // ...
    }
    
    
      
  • Y tho

    Jump
  • There's a bunch of species of cactus (family Cactaceae) but only Rhipsalis baccifera is found in the old world. Even weirder is that it's not just found in the Americas and sub-Saharan Africa but also Sri Lanka for some reason.