Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.

Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.

Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.

Really hoping he hasn’t brought the jinx with him.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 1 Post
  • 338 Comments
Joined 6 months ago
cake
Cake day: August 13th, 2024

help-circle
  • There used to be an undocumented setting in early versions of MS-DOS that would allow the setting of the command option character to something other than the slash, and if you did that, the slash automatically became the path separator. All you needed was SWITCHAR=- in your CONFIG.SYS and DOS was suddenly very Unix-y.

    It was taken out after a while because, with the feature being undocumented, too many people didn’t know about it and bits of software - especially batch files, would have been reliant on things being “wrong”. The modern support for regular slash in API calls probably doesn’t use any of the old SWITCHAR code, but it is, in some way, the spiritual descendant of that secret feature.

    Here’s an old blog that talks about it: https://learn.microsoft.com/en-gb/archive/blogs/larryosterman/why-is-the-dos-path-character



  • palordrolap@fedia.iotoProgrammer Humor@programming.devErrors
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    9 days ago

    Urge to analyse… rising…

    My first guess would be to take out that semicolon on line 264. JavaScript will often happily take a new line as end of statement if it makes sense to do that, so in theory, that semicolon is not needed. And it might be a Greek question mark your prankster colleague put in your code when you weren’t looking.

    And then I’d be tracing parentheses, curlies, quotes and so on, because that error could be the point the parser gave up trying to make sense of the code rather than where the error actually is.

    And if that didn’t find it, I’d put in a deliberate error at an earlier, known line to see where the parser thinks that error is. If it’s offset by 20 lines, then I know the original error is probably offset by a similar amount.


  • Ah, misleading use of terminology that indicates one thing, but will win in court even if it actually means, or can later be said to mean, another.

    I hope those involved in helping companies win these lawsuits choke on bones from food sold as boneless. Because that won a court case after “boneless” was redefined as a cooking method.

    I don’t want them to choke to death. Just a little lesson, you know?


  • You seem to be familiar with Bash syntax. But others may not be.

    If by this you mean that the Bash syntax for doing certain things is horrible and that it could be expressed more clearly in something else, then yes, I agree, otherwise I’m not sure this is a problem on the same level as others.

    OP could pick any language and have the same problem. Except maybe Python, but even that strays into symbolic line noise once a project gets big enough.

    Either way, comments can be helpful when strange constructs are used. There are comments in my own Bash scripts that say what a line is doing rather than just why precisely because of this.

    But I think the main issue with Bash (and maybe other shells), is that it’s parsed and run line by line. There’s nothing like a full script syntax check before the script is run, which most other languages provide as a bare minimum.



  • I feel like there could be a decent intermediate option here. It quickly glosses over page sizes and then talks about the modulus operator, but misses the fact that bitwise operations can emulate modulus for powers of two, which is generally the sorts of sizes that pages tend to be, and bitwise is generally much faster than the division that modulus performs.

    In short, x % z is generally equivalent to x & (z-1) when z is a power of two and is often much faster.

    Now, I get that the compiler might be clever enough to turn a modulus operation of the right size into a bitwise operation, but it’s still necessary that the programmer specify that power-of-two size for their circular buffer in the first place.

    I would be curious as to whether this “greyer” magic has any benefit when not performing the page table hack.


  • Sometimes, programs that need to start up an editor will honour the $EDITOR environment variable, which should contain the name of, or full path to, a user’s preferred editor.

    It’s not set by default though, and a lot of things will naturally default to vi or even ed. Something to be set in a .profile, .bashrc or similar.

    $VISUAL is another variable that is used for similar purposes.

    The resemblance to certain two letter commands is not entirely a coincidence.


  • It doesn’t help that some of the duplicates aren’t duplicates at all but some SO admin or mod hasn’t read or understood the question properly and points the asker at something that’s actually only vaguely related or irrelevant.

    I’m pretty sure I’ve also heard of askers providing links to other questions that are similar to but not quite what they’re interested in, explained why their question is different and yet it’s one of those linked questions that ends up being identified as being identical to the asker’s question.

    There may also be at least one pair of questions that each point back at the other as being the original, and there’s no useful information in either. (I don’t know why this idea is in my head though, so maybe it was a joke I read somewhere.)

    Either way, the admins and mods there do not like to be told they are wrong and will shut things down fast if it starts looking like they’ve made a mistake. Unfortunately for them, stories like this get out anyway.

    Petty little overlords of the toxic waste dump of their own making.



  • This is actually the correct way to do it in JavaScript, especially if the right hand side is more than 1.

    If JavaScript thinks i contains a string, and let’s say its value is 27, i += 1 will result in i containing 271.

    Subtraction doesn’t have any weird string-versus-number semantics and neither does unary minus, so i -=- 1 guarantees 28 in this case.

    For the increment case, ++ works properly whether JavaScript thinks i is a string or not, but since the joke is to avoid it, here we are.



  • Many of an engineering bent, including programmers / coders / developers / whatever we’re called this week, have an innate desire to tinker with things and add “just one more feature”. This is known as “feature creep” as more and more metaphorical little bells and whistles are added. See also: “Bells and whistles” itself, “creeping featurism”, “feeping creatures” (ho-ho), and variants thereof.

    Searching some of those actually finds other terms that other responders have mentioned.

    Most of my stuff over the years has been hobby or job-adjacent rather than my actual job to produce the tools I did, so I think what really helped me to stop working on the very few things that were requested by other people was not being a user of the tool I created.

    I still had to “use” things to test them, but once they were in real use, I didn’t have to see them all the time and think “I could just add this little thing here / there / etc.”

    It was only at the request of the users that specific new features were added.

    Getting someone else to design the interface is often helpful, assuming they’re not an absolute fool.

    A few years later, a very similar tool I made, one that I was a user of, got a lot more tinkering and feature churn. Maintaining backwards compatibility reigned some of that in, but there were a couple of times where that wasn’t possible.



  • Unfortunately, modern Labour are centrist, much like the US Democrats, so we see rather a lot of surprisingly right-leaning decisions from what ought to be a left-leaning party. “Liberal” isn’t a completely accurate term for them these days.

    We also have a third party called “Liberal Democrats” who were positioned in that centrist position until Labour moved right and stole it from them. Now they still try to sit between, pleasing hardly anyone.

    When there was a left-leaning leader running the Labour party a few years ago, much panic ensued among the rich and powerful, and dirty tricks and smear campaigns were undertaken to get him as far out of the way as possible.

    It probably didn’t help that he didn’t particularly want to be PM, but he was the only man who would do it.

    Edit: Reworded for accuracy.



  • North Korea believes that the south was stolen by Western/US imperialism, and that it is Western influence that keeps it separate from unification under the Kim family. A whole “We’re not the separatists. They are.” kind of deal.

    With the West currently being on the side of Ukraine’s independence, the North Korean troops are probably being told that this is a fight against that imperialism, especially with Russia being former and now current enemy of the West.

    One side-effect of Trump’s pending plan to end that war will undoubtedly be sending some disillusioned, surviving Koreans back home, waiting any day for the reunification with their southern brothers.

    I mean, there is an element of truth to all this. If we take our eye off that particular ball, so to speak, South Korea ends up reunifying with the North in a way they very much won’t like.


  • Minecraft Bedrock is written in and compiled from C++ and is completely closed-source.

    The original Java version is technically also closed-source, but Java bytecode is relatively easy to decompile to a high level and Mojang (and surprisingly, even Microsoft*) tend to look the other way when people do that.

    It seems like this was written for the Java version, but I’m not completely sure whether it’s simply a protocol conversion, in which case, the protocols are already well known, and converting it to work with Bedrock might not be too difficult.

    Yes, there are open-source alternatives, but nowhere near as many people play those as play Minecraft, which is probably why that was the target platform and not one of the others.

    *For now.