• 1 Post
  • 15 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



  • Agreed. First LMG needs to clean house to make it a mentally safe work environment so there is never a repeat of Madison’s case … cause wtf. Second, an apology to Billet Labs … cause wtf. Third, they need to slow down the pace of work so the employees can focus on quality and accuracy.

    The rate at which they pump out content is, in my opinion, unsustainable for the employees and unsustainable for the semi-regular viewer as well

    I’ve noticed my recommendations have largely stopped showing me LTT videos over the past several months, probably because youtube recognizes that im not watching a large % of their videos, so why would youtube recommend the next one? i feel like their pace is thinning out their semi-regular viewers and leaving a highly devout community. To me, the semi-regulars are what add balance to the community rather than it becoming an echo chamber.

    I think by slowing down, LTT will be in a much healthier happier place in the long term, even if the numbers don’t obviously show it. That said, idk if I can see their videos in the same light knowing what’s happened behind the curtains. I think for rn, that might be it for me.




  • There’s not enough symbols on my keyboard, so let’s invent a code so we can write other symbols

    1. lets say & means start of code
    2. and say ; means end of code
    3. Between the start and end is the code

    Now let’s make some real symbols

    • ¢ can be &cent;
    • © can be &copy;
    • ÷ can be &divide;

    I want to tell other people how to use our new code, but if I tell them to “just write &divide;” it’ll turn my message into “just write ÷” !! So how can we fix this?

    What if we make & its own code?

    • &amp; —> &
    • &amp;divide; —> &divide; ???

    Yes! That’ll work :)

    This is how &amp; came to be, and it’s specifically used in HTML as a way to write those symbols above (and escape other a few other symbols for similar reasons we did with &amp;)

    As for why & shows up as &amp;, there are 2 main places I can see this happening:

    1. The editor you use to write it automatically converts an & —> &amp;. But the user typed in &amp; (making it &amp;amp;). I think this is most likely. I’m guessing the title of posts automatically do the conversion, but the post body and comments do not because it uses a raw markdown editor
    2. In some contexts the & specifically doesn’t get converted? like how you can write `&amp;` to get &amp; as opposed to seeing


  • 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 🤣