• 2 Posts
  • 196 Comments
Joined 11 months ago
cake
Cake day: August 4th, 2023

help-circle

  • Yeah. I figured the day-of-the-month change should definitely happen at UTC midnight. I kindof like the idea that a day of the week lasts from before I wake up to after I go to sleep. (Or at least that there’s no changeover during business hours.)

    But hell. If you wanted to run for president of the world on a platform of reforming date/time tracking but planned for the days of the week to change at midnight UTC, I’d still vote for you.


  • TootSweet@lemmy.worldtoProgrammer Humor@lemmy.mlWorst is UTC vs GMT
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    4 days ago

    Note that the Sun position is not consistent throught the year and varies widely based on your latitude.

    Good call. The definitions of “noon” and “midnight” would need to be formalized a bit more, but given any line of longitude, the sun passes directly over that line of longitude “exactly” once every 24 hours. (I put “exactly” in quotes because even that isn’t quite exactly true, but we account for that kind of thing with leap seconds.) So you could base noon on something like “when the sun is directly over a point on such longitudinal line (and then round to the nearest hour).”

    Could still be a little weird near the poles, but I think that definition would still be sensical. If you’re way up north, for instance, and you’re in the summer period when the sun never sets, you still just figure out your longitude and figure when the sun passes directly over some point on that longitudinal line.

    Though in practice, I’d suspect the area right around the poles would pretty much just need to just decide on something and go with it so they don’t end up having to do calculations to figure out whether it’s “afternoon” or “morning” every time they move a few feet. Heh. (Not that a lot of folks spend a lot of time that close to the poles.) Maybe they’d just decide arbitrarily that the current day of the week and period of the day are whatever they currently are in Greenwich. Or maybe even abandon the use og day of the week and period of the day all together.

    Just the days of the week? you mean that 2024-06-30 23:59 and 2024-07-01 00:01 can both be the same weekday and at the same time be different days? Would the definition of “day” be different based on whether you are talking about “day of the week” vs “universal day”?

    Yup.

    I’m just thinking about things like scheduling dentist appointments at my local dentist. I’d think it would be less confusing for ordinary local interactions like that if we could say “next Wednesday at 20:00” rather than having to keep track of the fact that depending what period of the day it is (relative to landmarks like “dinner time” or “midmorning”) it may be a different day of the week.

    And it’s not like there aren’t awkward mismatches beteen days of the week and days of the month now. Months don’t always start on the first day of the week, for instance. (Hell. We don’t even agree on what the first day of the week is.) “Weeks” are an artifact of lunar calendars. (And, to be fair, so are months.)

    (And while we’re on the topic of months, we should have 13 of 'em. 12 of length 30 each and one at the end of 5 days or on leap years 6 days. And they should be called “first month”, “second month”, “third month”, etc. None of this “for weird historical reasons, October is the 10th month, even though the prefix ‘oct’ would seem to indicate it should be the 8th” bs. Lol.)


  • TootSweet@lemmy.worldtoProgrammer Humor@lemmy.mlWorst is UTC vs GMT
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    7
    ·
    5 days ago

    No, see, how it would work without timezones is:

    • Everyone would use UTC and a 24-hour clock rather than AM/PM.
    • If that means you eat breakfast at 1400 hours and go to bed around 400 hours and that the sun is directly overhead at 1700 hours (or something more random like 1737), fine. (Better than fine, actually!)
    • Every area keeps track of what time of day daily events (like meals, when school starts or lets out, etc) happen. Though I think generally rounding to the nearest whole hour or, maybe in some cases, half hour makes the most sense. (And it’s not even like everyone in the same area keeps the same schedule as it is now.)
    • You still call the period before when the sun is directly overhead “morning” and the period after “afternoon” and similarly with “evening”, “night”, “dawn”, “noon”, “midnight” etc.
    • One caveat is that with this approach, the day-of-the-month change (when we switch from the 29th of the month to the 30th, for instance) happens at different times of the day (like, in the above example it would be close to 1900 hours) for different people. Oh well. People will get used to it. But I think it still makes the most sense to decide that the days of the week (“Monday”, “Tuesday”, etc) last from whatever time “midnight” is locally to the following midnight, again probably rounding to the nearest whole hour. (Now, you might be thinking "yeah, but that’s just timezones again. But consider those timezones. The way you’d figure out what day of the week it was would involve taking the longitude and rounding. Much simpler than having to keep a whole-ass database of all the data about all the different timezones. And it would only come into play when having to decide when the day of the week changes over.)
    • Though, one more caveat. If you do that, then there has to be a longitudinal line where it’s always a different day of the week on one side than it is just on the other side. But that’s already the case today, so not really a drawback relative to what we have today.

  • TootSweet@lemmy.worldtoProgrammer Humor@lemmy.mlWorst is UTC vs GMT
    link
    fedilink
    English
    arrow-up
    148
    arrow-down
    8
    ·
    edit-2
    5 days ago

    The creator of DST gets the first slap. Then the timezones asshole.

    I’m planning to do a presentation at work on how to deal with dates/times/timezones/conversion/etc in the next few weeks some time. I figure it would be a good topic to cover. I’m going to start my talk by saying “first, imagine there is no such thing as timezones or DST.” And then build on that.




  • map := map[string] int {}

    Not sure where you got your examples, but the spacing is pretty wonky on some (which can’t possibly help with confusion) and this one in particular causes a compile-time error. (It’s kindof trying to declare a variable named “map”, but “map” is a reserved word in Go.)

    var test int < bruh what?

    This article gives the reasoning for the type-after-variable-name declaration syntax.

    :=

    Lots of languages have a colon-equals construction. Python for one. It’s not terribly consistent what it means between languages. But in Go it declares and assigns one or more variables in one statement and tells Go to figure out the types of the variables for you so you don’t have to explicitly tell it the types to use.

    func(u User) hi () { … }

    That function (“method”, really, though in Go it’s more idiomatic to call it a “receiver func”) has no return values, so no return type. (Similar to declaring a function/method " void in other languages.)

    The first pair of parens says to make this “function” a “method” of the “User” type (which must be declared in the same package for such a function declaration to work.) The whole “when I call it like u.hi(), don’t make me pass u as a parameter as well as putting u before the period” thing also has precedent in plenty of other languages. Python, again, is a good example.

    Oh, and the second set of parens are where the function’s (non-receiver) parameters go. Your example just doesn’t take any. A function like func (u User) say(msg string) { ... }, for instance, could be called with u.say("Hey."). func (u User) ask(question string) string { ... } has a return type of string. So you could do var ans string = u.ask("Wuzzup?") or ans := u.ask("Wuzzup?").

    I can’t say I was ever too taken aback with Go’s syntax. Just out of curiosity, what languages do you have experience with?


  • Great question! Not really my area of expertise, but probably there are at least a couple of possible avenues. One is decompilation and/or disassembly and static analysis. (Basically use automated tools to reconstruct the original source code as best it can and then read that imperfect reconstruction of the source code to figure out what it does.) Another is isolating it (“air gap” – no network or connectivity to anything you care about) so you’re sure it can’t do any damage and running it with tools that record/report everything it does. (On Linux, one could use strace and/or GDB. On Mac, dtrace. Not sure what the equivalent is for Windows programs running on Windows.)

    Actually, I guess another option could be to set up an isolated system, record a whole bunch of information about it before running the .exe then after running the .exe, examine it to see what you can find on the filesystem or in the registry or in RAM or whatever that might have changed. It wouldn’t catch everything, though. Like if it made a network connection or something but didn’t actually change anything on the filesystem, it might not leave any traces.

    Whatever the case, it’d probably require some specialized tools and expertise. But it’d be an interesting project.




  • You really think most users of x86_64 machines today aren’t being shafted by Microsoft and various other software vendors just like users of smartphones?

    Meanwhile, a certain percentage of smartphone users go out of their way to run things like LineageOS and GrapheneOS and thus aren’t shafted (as much?) by the software vendors.

    All that to say I’m not sure the two worlds are as different as you seem to think.

    And, honestly, I’m ignoring the mention of gaming in your original post. I’m kindof ambivolent and unknowledgeable about that topic. All I know is that I’m very selective about what games I allow to run on my general-purpose computing devices. And on my consoles, I take measures to run games “in jail.” I don’t let my Nintendo Switch connect to the Wifi except on rare occasions and then only let them connect long enough to accomplish what I need.



  • So, first off, none of what I’m about to say would, on its own, be enough to cause me to downvote something. But since you asked about the “mostly…”

    Browsers are ridiculously bulky these days without adding plugins. On top of the bulkiness of the browser itself, “simple” web apps these days without adding to it. Animations use CPU and take time. Rounded corners and extra spaciousness use screen real-estate. I’m typing this on a Raspberry Pi 4. Chromium is unusable. Firefox is barely tolerable. And it doesn’t have to be that way. I’ve got a more powerful box, but it’s not what I’m using right now.

    (Yes, GPTheme is only 34k. But it’d have to be negative in size for that to be an argument that would work on me.)

    Plus, customizations like browser extensions require maintenance. One day OpenAI is going to update their markup and GPThemes is going to break. And if I was using GPThemes with ChatGPT I’d have to either uninstall it or go research whether there’s an update for it. If I set up a new device anywhere, I’d need to either be happy with an inconsistent experience of ChatGPT across devices or make sure I installed GPThemes on all of my devices, which is another step I could leave out to save time.

    Yes, this bit applies to all customizations. I don’t have any aliases in my .bashrc. I honestly prefer to just memorize things. The only real “customization” I ever do to my machines is remapping caps lock to escape. I’m just the sort of person who is very selective about what kind of customizations I consider worth it.

    Again, in the absense of my distaste for “AI” nonsense spilling over into non-AI-specific forums, none of this is a reason to downvote. Just a reason to scroll past. “Not my bag.” And some folks love customizing in ways like this. I definitely don’t have any problem with the fact that other folks’ calculus is different than mine in that regard.

    Since I’ve been so negative here, one thing I do like about GPTheme is the use of GPL-3.0 . I think copyleft is a hell of a good idea.



  • Wait, is this about SQL injection? Are they admitting that If I paste a piece of paper that says '; drop table streets; -- over their street sign it’ll fuck all their shit up?

    If so, this is not a problem that should be fixed by changing the street signs.

    Or is the problem that they’ve got people with limited technical skill manually constructing SQL queries to search these “geographical databases” and not knowing how to properly escape them?

    Or did some intern developer neglect to use a parameterized query and something broke and the management chain at the North Yorkshire Council who don’t even know what pebkac stands for heard “apostraphies are the problem?”

    Maybe they’ve got some image recognition thing on their mail trucks and the apostrophies mess up the otherwise-monospace letter spacing?

    Whatever the case, the whole idea of taking the apostrophies off the signs seems ridiculous to me.



  • TootSweet@lemmy.worldtoProgramming@programming.dev...
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    edit-2
    2 months ago

    This might be an unusual answer, but OpenSCAD. OpenSCAD files are just so much easier to work with when you’re doing 3d printing than some random .stl file that might be non-manifold (have holes, self-intersections, whatever) and is usually really hard to modify in reasonably precise ways.

    If it’s an organic shape (a human form or whatever), then it probably makes sense to share it as an .stl. But if it’s a wall mount for some device or an enclosure for a Raspberry Pi or something, it’d be so much nicer if they’d made it in OpenSCAD rather than FreeCAD or TinkerCAD or whatever.

    If it’s not in OpenSCAD, it’s honestly more often than not unusable. Even if I don’t need to tweak the file. Unless it’s an organic shape kind of art piece, I usually end up recreating the same shape from scratch in OpenSCAD.



  • If you get caught, your professional life is over.

    That seems hyperbolic. Maybe your workplace is super draconian and will immediately fire you in such a case. But different employers have different cultures. Where I work, there are running jokes among the employees about how hard it is to get fired. One of the few cases of a firing we know of involved someone who was so passed-out drunk at his desk that he couldn’t be awoken. And that was after he was given multiple stern talkings to.

    I’ve seen people play WOW and Counter Strike on their office computers in the office in very visible areas.

    Lest you think “yeah, but no place where it’s that hard to get fired is going to have a locked down firewall” this is the same place where I had to make a special request to have http://portswigger.net/ , the official site of Burp Suite Pro, the web application security tool, unblocked so I could evaluate it’s suitability to replace the tool we were using previously. (From what I’ve seen, Burp Suite Pro is kindof the de facto tool for web app security among pen testers, or at least was at the time.) The reason given on the “this site is blocked” page the corporate proxy gave was because it had something to do with alcohol.

    In my time here, I’ve gone to lengths to curcumvent corporate firewalls multiple times. Both for personal aims and because it was necessary to do my job. I’ve never once been repremanded for it.

    OP knows their workplace. OP, be smart, but do if you can get away with it, go for it.