• 0 Posts
  • 14 Comments
Joined 3 months ago
cake
Cake day: August 15th, 2024

help-circle
  • pixelscript@lemm.eetoMemes@lemmy.mlSwitch for Christmas
    link
    fedilink
    English
    arrow-up
    14
    ·
    edit-2
    1 day ago

    It’s basically a power strip:

    but specifically for cables that carry Internet traffic instead of electrical power.

    A more direct analogy would be a telephone switchboard (which is why it is called a “switch”), basically a computerized version of those old-timey operator ladies who used to sit in a room waiting for you to make a phone call, and they’d physically move a plug connected to your phone and plug it directly into the phone line of whoever you were trying to call. That, but for computers trying to talk to one another over network cables instead of making telephone calls.


  • It is. But that’s not saying much.

    I may have had to keep a few of the waypoints of the trail in my head for, oh, a week or so, just long enough to scribble it on a history test. Then that information was immediately cleared out to make way for whatever other junk we had to temporarily memorize next chapter.

    Only a vague, blurry notion that the Oregon Trail A) existed and B) was a trail to (presumably) somewhere in Oregon remains with me today. Oregon City is certainly not a part of that notion.

    Not to shit on the Oregon Trail or Oregon City in particular, of course. I would be truly baffled to meet anyone that retained, in significant detail, even a tenth of what any grade school history class purportedly taught them.



  • It’s “I am working” not “I be working”.

    From how it’s used and understood, it’s a lot closer to, “I am in a situation where I find myself working from time to time”. “I am working” suggests you’re doing it right now, “I be working” does not. This example is a unique, condensed way to convey a very specific idea that your idea of “proper English” cannot convey without a boatload of extra words.

    If that’s still bothersome to you, well, I guess have fun kicking that proverbial land-crawling fish back into the sea if that’s where you get your jollies. IMO some prescriptivism is okay to get people on the same page, but the moment you use it as a cudgel to beat people who are very clearly already being understood, you’re being a prude.




  • pixelscript@lemm.eetoProgrammer Humor@lemmy.mlComenting code
    link
    fedilink
    English
    arrow-up
    21
    ·
    edit-2
    2 months ago

    I recognize three kinds of comments that have different purposes.

    The first kind are doc block comments. These are the ones that appear above functions, classes, class properties, methods. They usually have a distinct syntax with tags, like:

    /*
     * A one-line description of this function's job.
     *
     * Extra details that get more specific about how to use this function correctly, if needed.
     *
     * @param {Type} param1
     * @param {Type} param2
     * returns {Type}
     */
    function aFunctionThatDoesAThing(param1, param2) {
        // ...
    }
    

    The primary thing this is used for is automatic documentation generators. You run a program that scans your codebase, looks for these special comments, and automatically builds a set of documentation that you could, say, publish directly to a website. IDEs can also use them for tooltip popups. Generally, you want to write these like the reader won’t have the actual code to read. Because they might not!

    The second kind is standalone comments. They take up one or more lines all to themselves. I look at these like warning signs. When there’s something about the upcoming chunk of code that doesn’t tell the whole story obviously by itself. Perhaps something like:

    /* The following code is written in a weird way on purpose.
    I tried doing <obvious way>, but it causes a weird bug.
    Please do not refactor it, it will break. */
    

    Sometimes it’s tempting to use a standalone comment to explain what dense, hard-to-read code is doing. But ideally, you’d want to shunt it off to a function named what it does instead, with a descriptive doc comment if you can’t cram it all into a short name. Alternatively, rewrite the code to be less confusing. If you literally need the chunk of code to be in its confusing form, because a less confusing way doesn’t exist or doesn’t work, then this kind of comment explaining why is warranted.

    The last kind are inline comments. More or less the same use case as above, the only difference being they appear on the same line as code, usually at the very end of the line:

    dozen = 12 + 1; // one extra for the baker!
    

    In my opinion, these comments have the least reason to exist. Needing one tends to be a signal of a code smell, where the real answer is just rewriting the code to be clearer. They’re also a bit harder to spot, being shoved at the ends of lines. Especially true if you don’t enforce maximum line length rules in your codebase. But that’s mostly personal preference.

    There’s technically a fourth kind of comment: commented-out code. Where you select a chunk of code and convert it to a comment to “soft-delete” it, just in case you may want it later. I highly recommend against this. This is what version control software like Git is for. If you need it again, just roll back to it. Don’t leave it to rot in your codebase taking up space in your editor and being an eyesore.



  • Fellow tattooless here. Uh, neither?

    I simply don’t see the appeal of putting on something I can’t easily take off if I wanted to, for its own sake. Yeah, tattoos aren’t permanent, a removal process exists. But they cost money and require an appointment to be rid of, on top of the investment of time, money, and pain to buy in. The barrier to entry and the barrier to exit are both too high for my liking.

    Ideally you get a tattoo and enjoy it for life. I can’t commit to that kind of decision. Not for a funny body picture. If I need a memento to cherish memory of a thing or event I’ll get a tchotchke or something.

    I have no complaints about others’ tattoos. They’re more often than not incredible works of art.


  • There are exactly three kinds of manpages:

    1. Way too detailed
    2. Not nearly detailed enough
    3. There is no manpage

    I will take 1 any day over 2 or 3. Sometimes I even need 1, so I’m grateful for them.

    But holy goddamn is it awful when I just want to use a command for aguably its most common use case and the flag or option for that is lost in a crowd of 30 other switches or buried under some modal subcommand. grep helps if you already know the switch, which isn’t always.

    You could argue commands like this don’t have “arguably most common usecases”, so manpages should be completely neutral on singling out examples. But I think the existence of tl;dr is the counterargument.

    Tangent complaint: I thought the Unix philosophy was “do one thing, and do it well”? Why then do so many of these shell commands have a billion options? Mostly /s but sometimes it’s flustering.


  • pixelscript@lemm.eetoGaming@lemmy.mlNintendo files lawsuit against Palworld
    link
    fedilink
    English
    arrow-up
    20
    arrow-down
    7
    ·
    edit-2
    2 months ago

    It’s speculated that the patent in question (or one of) is one that essentially protects the gameplay loop of Pokémon Legends Arceus.

    https://ipforce.jp/patent-jp-P_B1-7545191

    Running the first claim of the invention through Google Translate yields this massive run-on sentence description:

    The computer causes a player character in a virtual space to take a stance to release a capture item when a first category group including a plurality of types of capture items for capturing a field character placed on a field in a virtual space is selected based on an operation input of pressing an operation button, and causes a player character in the virtual space to take a stance to release the capture item when a second category group including a plurality of types of combat characters that engage in combat is selected, and determines an aiming direction in the virtual space based on a directional input, and further selects the capture item included in the first category group when the first category group is selected, and the combat character included in the second category group when the second category group is selected, based on an operation input using an operation button different from the operation button , and causes the player character in the virtual space to take a stance to release the capture item when a first category group including a plurality of types of capture items for capturing a field character placed on a field in a virtual space is selected, and determines an aiming direction in the virtual space based on an operation input using an operation button different from the operation button, A game program which, based on an operation input of releasing the operation button pressed when having the player character perform an action, has the player character perform an action of releasing the selected capture item in the aiming direction if the capture item is selected, and has the player character perform an action of releasing the selected combat character in the aiming direction if the combat character is selected, and when the capture item is released and hits the field character, makes a capture success determination as to whether the capture is successful, and when the capture success determination is judged to be positive, sets the field character hit by the capture item to a state where it is owned by the player, and when the combat character is released to a location where it can fight with the field character, starts a fight on the field between the combat character and the field character.

    Essentially, Nintendo has a patent on video games that involve throwing a capsule device at characters in a virtual space to capture them and initiate battle with them. In other words, they have a patent on the concept of Poké Balls (as they appear and function in Legends Arceus, specifically).

    Palworld has “Pal Spheres”, which are basically just Poké Balls with barely legally distinct naming.

    If this sounds like an unfairly broad thing for Nintendo to have a patent on, I’m not so sure I agree. It’s not like they’re trying to enforce a blanket patent on all creature collectors. Just the concept of characters physically throwing capsule devices at creatures.

    If you think about it, that’s kind of the one thing that sets Pokémon apart from others in the genre. If there’s anything to be protected, that’s it. It’s literally what Pokémon is named after–you put the monster in your pocket, using the capsule you threw at it.

    Palworld could have easily dodged this bullet. They claim they aren’t inspired by Pokémon, and that they’re instead inspired by Ark: Survival Evolved. Funny, then, that Ark doesn’t have throwable capsules, yet Palworld decided to add them. I’m not sure I buy their statement. And if this is indeed the patent being violated, I don’t think a court will buy it either.

    I’m not trying to be a Pokémon apologist here. I want Palworld to succeed and give Pokémon a run for its money. But looking at the evidence, it’s clear to me Pocketpair flew a little too close to the sun here. And they’re kind of idiots for it.

    I’m just surprised they aren’t getting nailed for the alleged blatant asset theft.


  • The other day I learned that you can just grep an unmounted filesystem device. It will read the entire disk sequentially like it’s one huuuuge file. And it will reveal everything on that disk… whether a file inode points to it or not.

    Used it to recover data from a file I accidentally clobbered with an errant mv command. It’s not reliable, but when you delete a file, it’s usually not truly gone yet… With a little luck, as long as you know a unique snippet that was in it, you can find it again before the space gets something else written there. Don’t even need special recovery tools to do it, just use dd in a for loop to read the disc in chunks that fit in RAM, and grep -a for your data.



  • pixelscript@lemm.eetoMemes@lemmy.mlZen Z
    link
    fedilink
    English
    arrow-up
    2
    arrow-down
    1
    ·
    edit-2
    3 months ago

    An analog clock is just three sets of loading bars with their ends glued together. You can tell geometrically what proportion of each division of time (day, hour, and minute) are spent and what proportion remains. You don’t even need the numbers.

    If you need stopwatch-level precision, sure, a digital display is superior. But how often do you need that? Most of what I need clocks for is, “Oh, it’s about a quarter to noon, I have a lunch appointment to get to”.

    It is my personal preference to visually intuit that the clock hands are roughly separating the hour into 3/4 spent and 1/4 remaining and use that to know how much time I have left to the hour, rather than read the symbols “42” on the display and manually do the mental gymnastics of “well that’s basically 45, which is three quarters of the way to 60 minutes”.

    I’ll admit this benefit is marginal.