

I didn’t know Malfoy was royalty.
I didn’t know Malfoy was royalty.
The logic is fine. If you rename the variable to isAdmin
, it makes perfect sense. Either they are an admin, or they are not an admin, or the state is unknown (here expressed as null
). If you want to throw another JS-ism at this, undefined
could be assigned before the check has been made.
I regularly use variables like this. If users
is undefined
, I haven’t fetched them yet. If they’re a list, then fetching is complete. If they’re null
, then there was an error while fetching.
Angular provides a utility to update its packages. If you naively update every single one manually, you’ll get errors because the library will be incompatible with itself. Maybe other flavors of SPA have update scripts, too?
ng update core@<the next major version> /cli@<the next major version>
Don’t skip versions! /
For each problem you might want a package for, there are at least 3 packages, sometimes lots more. You need to sift through them in order to get the one that works and is maintained.
Very efficient. I’m starting to feel this is what users see when they interact with websites, anyway. Only the cross should be “donation_dialog_button_close”.
If that’s the only error mechanism, sure. Exceptions in most languages tend to be relatively expensive, though, and most have a cheaper idiomatic way of returning error codes; you’d want to use those if they’re available, right?
I think not being able to get the current time from the system is very exceptional. And I think exceptional circumstances should act that way and not “look like” normal executions. To me, that means letting hell break loose, and not “silently” return a 1 instead of a 0.
By similar reasoning, “Exceptions in most languages tend to be relatively expensive” is a very weak argument. We don’t expect this error-throwing code to execute a lot.
You’re writing a CLI tool to handle JSON data. Just making sure: You know jq
exists, right?
I see why that’s an issue.
If your distro ships with the tool inxi
, you can dump a lot of data about your system with inxi -Fazy
. Folks might be better able to help you then. The -z
flag filters sensitive information.
I just put a bunch of stuff on this pc and would rather not have to switch back to mint.
If you move that stuff to a partition that’s different from where root lives, switching operating systems shouldn’t be a problem. You can just mount the data partition on your new OS, if the need arises.
By then we’ll have vendor lock-in. WhO cOuLd’Ve FoReSeEn ThAt?
Another thing LLMs have going for them is that they’re dirt cheap. Sure, it may only be correct one third of the time, but it costs 5% of the ‘good’ solution. So using the LLM and degrading quality makes business sense.
RegExes. For instance, in JavaScript, 'foobar'.match(/(foo)(bar)/)
is ['foobar', 'foo', 'bar']
Anybody capable of using a CLI knows that the right answer is:
Dijkstra points out why: https://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831.html
So you might need to try different file extensions.
No, you don’t. The HTTP response header will tell you what type it is.
I’m not sure what you’re talking about. You need to know the name of the file before you can download it.
For instance, my lemmy client, says in its HTML that its favicon is <link id="favicon" rel="shortcut icon" type="image/x-icon" href="https://sopuli.xyz/pictrs/image/9c6eeb58-bf66-4a15-9537-0a822f3c4feb.png">
. If I were to blindly download /favicon.ico
, I’d naturally get a 404 page:
$ curl https://sopuli.xyz/favicon.ico -i
HTTP/2 404
# more data
Devices are configurable via software. If windows managed to “flip a switch” on the WiFi chip, it would affect Linux as well if it didn’t reset it on boot.