• 18 Posts
  • 65 Comments
Joined 2 years ago
cake
Cake day: June 2nd, 2024

help-circle







  • bleistift2@sopuli.xyztoProgrammer Humor@lemmy.ml•True crime
    link
    fedilink
    English
    arrow-up
    34
    ·
    1 year ago

    The logic is fine. If you rename the variable to isAdmin, it makes perfect sense. Either they are an admin, or they are not an admin, or the state is unknown (here expressed as null). If you want to throw another JS-ism at this, undefined could be assigned before the check has been made.

    I regularly use variables like this. If users is undefined, I haven’t fetched them yet. If they’re a list, then fetching is complete. If they’re null, then there was an error while fetching.







  • Look at the last table in my original post. It contains 26 columns (A–Z), some of which are not shown, and 27 rows (blank–Z). There are 27 rows and 26 columns, regardless of the contents of the table. If the top-left cell (A, blank) were a 1 and (B, blank) were a 2, then (Z, blank) would contain a 26, and ZZ would contain a 702. Nothing about the layout of that table changes.

    To summarize: The table will always be lopsided, if you start counting at 0 or at 1.




  • I have been able to outsource low level parsing to third party libraries

    Hahaha!!!

    Today I watched a Java server crash because a library decided it needed more than 3GB of heap space to read a 10MB file. That was after manually removed background colors from around 100,000 cells, which apparently caused the parser to create even more objects in its internal representation of the sheet.