• 0 Posts
  • 16 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
    35
    ·
    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.





  • What? Nautilus (ubuntu default file browser) finds drives wherever they are mounted and lists as their own location, as if it was windows. That includes the default mount point. Even if it wasn’t detected, it can still get to the mount point by browsing through the file system normally.

    Installing software can be done via a software manager (included in ubuntu and most other distros). Software not in the manager is usually distributed as a portable binary (also common on windows) or an app image (even easier to use than an installer). Once installed, that software is the same as on windows.

    Besides basic file manipulation, installing/running software, and web browsing, what else does the average user even do? All of it can be done on linux, with or without CLI.



  • I use gnome 4 because it is the most “out of the way” DE. I disable the dock and use an extension to hide the top bar, so there is literally nothing on my screen but the program(s) I’m using. I haven’t found another DE that let’s me do that (hiding the dock/taskbar doesnt count, cause it still comes up when you get the mouse too close which is super annoying).

    I also like the window presenter thing, which I first started using with KDE. I prefer gnome’s implementation though, since it is the same key to bring up the window selector and the app launcher. I often want to switch to a window only to find it isn’t open, or I want to open a program that already is open but hidden behind other windows, so it makes sense to put them together. I also can’t be bothered to learn more than one hotkey. I’ve tried to obtain this overall behavior in KDE, but I found it was a whole lot of configuration just to get what gnome already does, so I might as well just use gnome.

    I found the “touchscreen-y” interface bothersome at first, but I’ve gotten used to it. The biggest issue is not showing a large number of app entries efficiently, but it’s pretty trivial to remove the entries you don’t actually need with alacarte.

    Gnome’s default apps (like the newish gnome text editor) are getting too simplistic for my preference, but again it’s super easy to swap them out.


  • That’s kind of what GPL tries to do. It stipulates that any derivative must also be open source. However, no license can be truly effective at preventing corporations from using it without blocking legitimate uses too. Even GPL doesn’t prevent EEE, since they could just make the extensions proprietary (as long as they are not outright modifications of the original source). Even if the extensions aren’t proprietary, they could depend on servers that are. A license that doesn’t allow extensions or forks would defeat the whole purpose of being open source, so that’s not an option. The only way to stop them from using it would be to specifically exclude them and anybody else making over $X a year (from any source, since they can just lose money on threads until EEE is complete). But that would also exclude any fair implementation that just happens to be profitable. It would also make complying with the license more complicated, so people will switch to an alternative with a more permissive license anyway.