• 1 Post
  • 9 Comments
Joined 1 year ago
cake
Cake day: June 25th, 2023

help-circle


  • __LINE__ returns the line of code its on, and % 10 means “remainder 10.” Examples:

    1 % 10 == 1
    ...
    8 % 10 == 8
    9 % 10 == 9
    10 % 10 == 0 <-- loops back to 0
    11 % 10 == 1
    12 % 10 == 2
    ...
    19 % 10 == 9
    20 % 10 == 0
    21 % 10 == 1
    

    In code, 0 means false and 1 (and 2, 3, 4, …) means true.

    So, if on line 10, you say:

    int dont_delete_database = true;
    

    then it will expand to:

    int dont_delete_database = ( 10 % 10 );
    // 10 % 10 == 0 which means false
    // database dies...
    

    if you add a line before it, so that the code moves to line 11, then suddenly it works:

    // THIS COMMENT PREVENTS DATABASE FROM DYING
    int dont_delete_database = ( 11 % 10 );
    // 11 % 10 == 1, which means true
    



  • I’m not really involved in javascript land so im parroting off of what i’ve heard for “why js over ts?”

    • it reduces file size since you no longer need to ship source maps
    • ctrl+clicking stuff will take you to the definition rather than an unhelpful type declaration
    • if you spot a bug in the library, you can edit the source directly than having to recompile/reimport
    • ts adds some unnecessary type “gymnastics” (can’t speak for what this means), when all they really want is intellisense thru jsdoc

    So mainly: devs who don’t prefer strongly typed languages, and library devs who find typescript to be less transparent and more time consuming for new and old contributors than it’s worth



  • Mint is great, i’d say stick to it if it’s working! :P

    Unless you want to branch out, I don’t think it’s much of a failure to return back home to a “noob distro.” To my eyes no such thing exists, they are just working operating systems and there’s nothing noob or beginner about that

    I do use Arch, but because I’ve had bad luck with (proprietary) OS’s in general, so being able to choose exactly what to install and being able to fix it myself (if something ever happens) is something I value a lot. But I will say it takes a delicate type of nerd to handle that 🤣



  • There’s one for hearing too i think, so while i’m like a 4 when it comes to sight, i feel hearing the sound in my “minds ear” makes up for it. The limit is how much of the song I remember, otherwise i can loop a part of the song as much as I like, and switch to whatever other song I want :) (And not just songs but the sound of my gf’s voice for example. Not as effortless as the songs, but still possible)