• 0 Posts
  • 7 Comments
Joined 11 months ago
cake
Cake day: August 9th, 2023

help-circle
  • There’s no point looking for logic. These people truly believe granting a licence restricts the rights of people who don’t agree to the licence, which is the exact opposite of what licenses do. It’s blatant misinformation but if you call them out on it (even by quoting their own link) they literally think you’re an astroturfer for AI, because that makes more sense to them than the fact they’re obviously wrong.


  • That reminds me of an issue I had when I was installing Mint. I tried out a live boot first and everything seemed to work except there was no internet connection. Turns out my WiFi card needs a proprietary driver, but no big deal it installed easily enough just from the boot disk. Internet’s working, all looks good, so I go ahead and install Mint proper, remove the live boot usb, start the system, and savour that new Minty smell. But hang on, there’s no WiFi, I forgot to install the driver! Should be an easy enough fix though, it wasn’t hard last time.

    So I go to install the driver and the first thing it says is that it needs the boot disk to get the driver. That makes total sense, can’t install something you don’t have! I plug in the usb again and now it should all be plain sailing, after all it’s just installing a driver that worked 20 minutes ago, right? Sadly no, that would be too easy; for some reason now it’s missing dependencies! Or something along those lines anyway, I forget exactly. But can’t it just install those from the boot disk? Well apparently not, it instead tries to connect to the internet to download them. This obviously fails since I don’t have a WiFi connection, which is why I’m installing the driver in the first place. All I get is a popup saying it can’t install some stuff because there’s no internet connection, fix that to get your internet connection. This is the point where face meets palm. I’m sure there’s some fiddly “proper” way to work around that but the thing is I’m incredibly lazy so I’ll just take the quick option instead. I plug in my phone and use a tethered connection. I run the install again and it finally goes through, at last the system is ready to use! It’s been mostly smooth sailing since then (though I did get annoyed enough at NTFS a couple of months ago that I just reformatted a data drive and wiped a ton of data I probably didn’t need).

    Tl;dr: I had to tether to my phone for a minute. Traumatising!




  • It’s not just repeated moves, a draw can be called if the board is in the same state 3 times at all during the game; if you get to the same position 3 times using different moves that still counts, even if it was a white move the first two times and a black move the third.

    The game also ends after 50 moves with no captures or pawn moves so you can’t play indefinitely by just avoiding those board states. Interestingly those two moves also make it impossible to return to a previous board state (pawns can’t move backwards, extra pieces are never added) so if you’re enforcing both rules in code you can safely discard previous board states every time you reset the move counter.



  • That’s because they’re not necessarily mutually exclusive. The function is being called twice so there’s no way to guarantee the result will be the same both times without knowing what it does under the hood.

    Consider a case where isalpha performs a coin flip, 50% chance each call to return true. The first call returns false so the first condition fails, then the second call returns true so the second condition fails; in 25% of cases neither code block executes.

    You could store the result of the first call in a local variable and reuse it if you really wanted to, but the smart solution is to either use if/else properly or switch to early returns instead.