TehPers

joined 2 years ago
[–] TehPers@beehaw.org 5 points 16 hours ago (1 children)

open to any feedback, always willing to learn

A common pattern with executable Python scripts is to:

  • Add a shebang at the top (#!/usr/bin/env python3) to make it easier to execute
  • Check if __name__ == "__main__" before running any of the script so the functions can be imported into another script without running all the code at the bottom
[–] TehPers@beehaw.org 9 points 1 day ago

and then the company suffered a collapse and everyone got laid off.

This feels like the ending to most stories these days. My friend's company shoved AI down his throat, and then the company suffered a collapse and everyone got laid off.

[–] TehPers@beehaw.org 5 points 2 days ago

The never type comes more from type theory and isn't common in other languages (though TS has never). Similar to 0 or the null set, it exists as a "base case" for types. For example, where you have unions of T1 | T2 | ..., the "empty union" is the never type. Similarly, for set theory, a union of no sets is the null set, and in algebra, the summation of no numbers is 0.

In practice, because it can't be constructed, it can be used in unique ways. These properties happen to be super useful in niche places.

[–] TehPers@beehaw.org 6 points 2 days ago (2 children)

Because if it never returns, then it has no return value.

Then how would you annotate having no return value?

[–] TehPers@beehaw.org 3 points 2 days ago (4 children)

I don't know where None comes from (what's the T in Option<T>?)

Assuming you meant (), that's a unit type with one valid value. It's a ZST, but can be created and returned.

! is a bottom type. It's uninhabited. Can't be created. Functions can never return it because they can never construct it. So why's this useful? It can be coerced to any type.

Because the set of valid values for ! is the null set, by contradiction, there do not exist any values valid for the type ! that are invalid for any other type T. Therefore, all valid values of ! are also valid values of any other type T, and you can always convert from it to any other type.

Notably, this is already possible, but language support for it isn't amazing:

enum A {}

fn bar(a: A) {
    let foo: Box<Arc<Rc<Mutex<String>>>> = match a {}
}

Heck you can even do this today:

// `loop {}` never returns, so its type is `!`:
let blah: String = loop {};
[–] TehPers@beehaw.org 1 points 3 days ago

This depends on how the tool is used still. For someone seeking a diagnosis, the tool would be incredible. For someone who wants to use it to discriminate, the tool would be terrible.

Like most tools, the tool itself isn't morally right or wrong. It's the use of the tool that is.

[–] TehPers@beehaw.org 2 points 3 days ago

It also wouldn't work well because it's impossible to diagnose someone with Autism solely from their face. They'd have much better luck making a tool for something like Down syndrome, but even still it would be very fallible.

Autism is widely called "invisible" for a reason lol.

[–] TehPers@beehaw.org 2 points 4 days ago

Do humans also go insane when you ask them if there is a seahorse emoji? If so, I have a fun idea for one of those prank videos.

[–] TehPers@beehaw.org 2 points 5 days ago

This appears to contain the actual text of SF 383.

You linked to a page arguing against it, but the main argument appears to be that the mandated copay of ~$10.50ish is problematic and that it limits the rights of employers to promote a pharmacy over another. Is that correct?

(There seems to be more to the bill than that of course.)

[–] TehPers@beehaw.org 4 points 5 days ago

Because Apple has no 1st amendment responsibilities. The government does.

[–] TehPers@beehaw.org 1 points 5 days ago

The number of times I've been attacked over tone growing up tells me that I either had abusive parents, ~~or~~ and that how you say stuff matters a lot. Intonation can also turn a statement into a question or even make it sarcastic. Words come with baggage beyond their meaning, and using a word with negative connotations can turn a compliment into an insult.

[–] TehPers@beehaw.org 3 points 5 days ago

I'll ignore your last section since that's a separate discussion and a poor explanation of the situation.

Many people believe Mangione is guilty based on all the evidence. Heck, from what I've seen, it seems incredibly likely. However, belief in that isn't enough to condemn someone to either a life sentence or death penalty. While I might believe he's guilty, I won't be the one to state that he is, without a doubt, the one responsible for the murder because I have no evidence of that. This is what due process is for.

Many people don't want him to be guilty because while he likely broke the law, the morality of his actions is a separate and more complicated matter. Depending on one's morals, they may feel as though the murder was just. Whether you do or not is up to you. However, a lot of the commentary you'll see online is going to be based on the commenter's own personal views on the subject. This doesn't mean the commenter believes he is innocent of a crime, but they may believe that his actions were just regardless of it being a crime (since law and morals are separate things entirely).

view more: next ›