• 0 Posts
  • 7 Comments
Joined 2 years ago
cake
Cake day: July 16th, 2023

help-circle



  • We can avoid expensive branches (gasp) by using some bitwise arithmetic to achieve the so-called “absolute value”, an advanced hacker technique I learnt at Blizzard. Also unlike c, c# is not enlightened enough to understand that my code is perfect so it complains about “not all code paths returning a value”.

    private bool IsEven(int number)
    {
        number *= 1 - 2*(int)(((uint)number & 2147483648) >> 31);
        if (number > 1) return IsEven(number - 2);
        if (number == 0) return true;
        if (number == 1) return false;
        throw new Exception();
    }
    


  • sus@programming.devtoMicroblog Memes@lemmy.worldWelp
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    14 days ago

    Up and until the rule applies to so many countries that the sites just make the requirement universal, this will do nothing to stop bots as the bots will all just operate from countries that are not under age restriction laws. Even after that it’s likely the bot operators will just use fake IDs and similar, as it’s unlikely website operators would setup reliable verification of identity for every single country they want to serve.