• 0 Posts
  • 86 Comments
Joined 2 years ago
cake
Cake day: July 1st, 2023

help-circle








  • Cethin@lemmy.ziptoLGBTQ+@lemmy.blahaj.zoneScience!
    link
    fedilink
    English
    arrow-up
    7
    ·
    1 month ago

    I think your point is actually “even things that are right and obvious are not always obviously right” or something like that. It’s obvious to all of us that 1+1=2, and it is correct, but it isn’t correct because it’s obvious. It just happens to be both obvious and correct, but for very different reasons.



  • Cethin@lemmy.ziptoProgrammer Humor@programming.devIFS=$'\n'
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 months ago

    The way this should work is it’s set as either left-to-right or right-to-left. (C:)/1/2/3.ext or ext.3/2/1/(:C). It shouldn’t render part of it one direction and part of it the other direction logically. It’s probably impossible to fix at this point, but this makes a lot more sense.







  • Discord has quite a few good features that IRC doesn’t. I will agree that it being used as a replacement for a forum, while also being unsearchable, is amazingly stupid. However, it’s used by almost everyone for a reason, and to ignore that (if you were to develop and alternative) ensures you won’t succeed. Yeah, we don’t need every feature from Discord, but easy voice/text/video chats, image/file sharing, and all the other useful things are required. Yeah, we can probably lose the emotes and crap and be fine.


  • This will actually run much slower. It saves space, but it has to do a bunch of math every time it needs to store or load a string I stead of just outputting it. Maybe if you had really limited cache space this could run faster (since it could save on fetching from RAM/storage), but, unless you’re storing some really long strings, it won’t make a difference.


  • No, it doesn’t. It can’t know if you need a full set of characters or only a subset of them, so it can’t optimize like this. If you know you only need to represent capital letters and a few punctuations, you can do something like the OP. The compiler has to assume you could need the full range of characters represented by the format though (especially since it doesn’t even know if you’ll continue to use them as characters—you may want to do arithmetic on them).

    Definitely premature optimization, and not even ose to optimal either. It’s next to useless, but I think the OP was just having fun.


  • If you’re ever doing optimizations like this, always think in binary. You’re causing yourself more trouble by thinking in decimal. With n bits you can represent 2^n different results. Using this you can figure out how many bits you need to store however many different potential characters. 26 letters can be stored in 5 bits, with 6 extra possibilities. 52 letters can be stored in 6 bits, with 12 extra possibilities. Assuming you want an end of string character, you have 11 more options.

    If you want optimal packing, you could pack this into 48 bits, or 6 bytes/chars, for 8 characters.