• 0 Posts
  • 33 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle
  • Trantarius@programming.devtoScience Memes@mander.xyzCFCs
    link
    fedilink
    English
    arrow-up
    5
    arrow-down
    39
    ·
    4 months ago

    Y2K specifically makes no sense though. Any reasonable way of storing a year would use a binary integer of some length (especially when you want to use as little memory as possible). The same goes for manipulations; they are faster, more memory efficient, and easier to implement in binary. With an 8-bit signed integer counting from 1900, the concerning overflows would occur in 2028, not 2000. A base 10 representation would require at least 8 bits to store a two digit number anyway. There is no advantage to a base 10 representation, and there never has been. For Y2K to have been anything more significant than a text formatting issue, a whole lot of programmers would have had to go out of their way to be really, really bad at their jobs. Also, usage of dates beyond 2000 would have increased gradually for decades leading up to it, so the idea it would be any sort of sudden catastrophe is absurd.




  • When you hit the windows key (aka meta-key or super-key) it brings up the app launcher. You get a dock at the bottom with pinned or running apps (like a taskbar), and all of your open windows are presented in a sort of mini-version that lets you switch between them or move them between workspaces. There is a search bar that you can immediately type into to open any app with a .desktop file. There is also a button to bring up the app grid which shows your apps kind of like a mobile device’s home screen.






  • Well letters don’t really have a single canonical shape. There are many acceptable ways of rendering each. While two letters might usually look the same, it is very possible that some shape could be acceptable for one but not the other. So, it makes sense to distinguish between them in binary representation. That allows the interpreting software to determine if it cares about the difference or not.

    Also, the Unicode code tables do mention which characters look (nearly) identical, so it’s definitely possible to make a program interpret something like a Greek question mark the same as a semicolon. I guess it’s just that no one has bothered, since it’s such a rare edge case.




  • I find that much harder to read than a for loop. You are making a helper function to only use it once, which is kind of confusing when it is totally unnecessary. Also, distinguishing between two groups only inside the setter line is weird. Applying the modification to one group, then the other, is more obvious. Considering the alternative isn’t really longer, and only using basic loop syntax, I would just use the loop. If you really want to add the “set dots visibility” explanation into it, just use a comment, that’s what they’re for.

    I literally just now misunderstood your code and had to change my comment to correct for it.


  • Use:

    items=[...]
    for o in items:
        ...
    

    This is the most direct way of doing what you want. The first option might allocate a new array each iteration, which is unnecessary. The match statement is both a pain in the ass to write and less direct, which at best compiles to the same thing and at worst has you doing a bunch of totally unneeded comparisons.

    If this ‘i’ variable you used isn’t just an incrementing counter, use the last option. If it is though, it’s an extra counter you don’t actually need.

    The performance difference here would be so small I doubt you could even observe it. So, you really shouldn’t worry about this particular pattern. Compiler optimizations are more likely to trigger on simple, direct code, so writing it as directly as possible is probably the fastest option anyway.



  • That’s not entirely accurate. The first amendment mentions both freedom of speech and freedom of press. Freedom of speech is for individuals sharing ideas, not just reporters. That applies both conceptually and legally. Hate speech is seen as a necessary exemption by many, because of the potential ramifications (see comic). That isn’t the same thing as saying free speech wouldn’t apply even without said exemption; even though it may lead you to the same conclusion.




  • Trantarius@programming.devtoRisa@startrek.websiteAdblock
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 months ago

    It sounds to me like they we were going for more of a realistic future than a utopia. The money free utopia thing never seemed that important, I suspect it’s only used in later shows for consistency with TOS. It’s far more important to trek to criticize and reflect modern society, which is a lot harder to do if your characters are living in a utopia. I haven’t seen Picard yet though, so I’m just extrapolating from your description.