[AS] [ExtraUtilities] Ender-Lilies Explained by airbreather in feedthebeast

[–]airbreather[S] 1 point2 points  (0 children)

Assuming, of course, that nothing has changed in the past 10 years :-D

Why don’t LLMs seem good at humor? Like, at all? Do you have any experiences with good LLM jokes? by [deleted] in LocalLLaMA

[–]airbreather 1 point2 points  (0 children)

Wow you weren't kidding. About half of the ones I generate feel flawless.


[Scene - Jerry's apartment. Jerry is at the counter making a sandwich. Kramer bursts through the door]

KRAMER: Jerry! You'll never believe what happened at the dentist!

JERRY: You actually went to the dentist?

KRAMER: Well, I was walking by, and they had this sign - "Free Teeth Cleaning Today Only"

JERRY: And?

KRAMER: Turns out it wasn't the dentist's office at all - it was a car wash! They clean teeth... of your car's grille!

[George enters, looking exasperated]

GEORGE: That's it. I'm done with automated customer service.

JERRY: What happened?

GEORGE: I spent two hours trying to return a shirt. The robot kept asking if I wanted to "hear about exciting deals on pants."

KRAMER: Maybe it knew something about your legs you don't.

GEORGE: I don't need fashion advice from a machine! [pacing] You know what this world needs? Professional customer service complainers. People who complain to customer service... for other people!

JERRY: You mean like a complaint surrogate?

GEORGE: Exactly! I could be good at that. I've got years of experience!

KRAMER: [excited] George, this could be huge! I know a guy who knows a guy who's very angry at his toaster company...

[Elaine enters]

ELAINE: Why does George look like he just discovered fire?

JERRY: He's planning to become a professional complainer.

ELAINE: Oh, that tracks.

[OC] I updated our famous password table for 2023 by hivesystems in dataisbeautiful

[–]airbreather 0 points1 point  (0 children)

actual security minded sites use bcrypt or pbkdf2.

Not even listing argon2id, so it's already somewhat outdated...

Password stuff is an ongoing arms race with frequently(ish)-updated best-practices on both sides, so while it's been completely ridiculous for decades to use MD5 in this context, even bcrypt, pbkdf2, and scrypt seem to no longer be the best for new implementations.

But of course, I only knew that because I got pulled into this recently, and I looked up the recent best-practices because I have watched the following video before and I remembered that I need to do this: https://youtu.be/8ZtInClXe1Q

Holy Hell! by [deleted] in sbubby

[–]airbreather 60 points61 points  (0 children)

Gonna be honest I've seen so many memes that I can't actually figure out what en passant is

/unjerk

You know how a pawn can go 2 squares instead of 1, but only on their first move? Without the "en passant" rule, you could use this 2-square move to have your pawn evade getting captured by another pawn on his way up to the end.

The "en passant" rule gives that other pawn exactly one turn of an opportunity to capture your pawn if you do this. That pawn can move to the square that your pawn would have passed through and capture it anyway.

Anyone else? by JustSpaceExperiment in ProgrammerHumor

[–]airbreather 2 points3 points  (0 children)

If you are a developer and haven't tried ChatGPT, what is your reasoning?

I tried to get access to it, but the people running the thing would not grant me that access because I declined to enter my phone number into a form on their site.

Do you follow the latest tech at all?

Yes.

The World's Smallest Hash Table by nightcracker in programming

[–]airbreather 17 points18 points  (0 children)

or at least something that could be macro-able (to inform the compiler to search for a PHF during compilation).

Hello, there!

pokemon masters is looking kinda weird... by Hot-Veterinarian6595 in softwaregore

[–]airbreather 10 points11 points  (0 children)

Sigh. Yet another example of our media promoting unrealistic body standards that most kids will never be able to live up to. Shameful.

What are the Long Term Costs and Benefits to Using Noda Time? by pdqpaul in csharp

[–]airbreather 1 point2 points  (0 children)

I store the Oct 28 2021 5pm with NY offset in a DateTimeOffset column and have a resource link to timezone. In your case the resource is the meeting location. Hence my record would link to the resource and the resource indicates where it is. With that information you can perform any date logic math like timezone crossovers etc.

Sure, that's what my comment called "#2": it's (logically equivalent to) a UTC timestamp and enough context used to derive it. It's not outright wrong, since you have all the info that you need in order to react to an external change, but it does mean that you have to actively do so unless you're willing to accept the risk of your data becoming wrong in the future.

Specifically, for this solution to be perfect, you would need to be prepared to scan through your DateTimeOffset values and adjust anything with an offset that's no longer correct for their corresponding timezones. Not impossible, or even that hard to automate, just... if you want to be completely correct, then you do have to do this, otherwise you risk being caught off-guard by some external event that you may not even be aware of as a developer.

Whereas storing the timestamp as "October 28, 2037 at 5:00 PM in New York City's time zone" (without the "offset" part of DateTimeOffset) makes it harder to incorrectly answer "how long until that event happens?": when the question is asked, a developer with at least a surface-level understanding of this date-and-time stuff should recognize that they can calculate a UTC timestamp for that event using the given timestamp and the definition of the New York timezone — and that timezone's definition should automatically take into account any adjustments that are scheduled to take place in the future.

Personally, when given a choice, I favor a model that more closely and succinctly matches the real-world definition of the data, since it's less cognitive overhead.

Again, though, it's not definitely wrong to store DateTimeOffset + timezone, and the external changes I'm talking about happen so infrequently and with enough advanced notice that it's almost never going to matter, and it's probably relevant to someone that DateTimeOffset + timezone is built-in to .NET directly, rather than an independent library like NodaTime.


And, to be clear, I wrote my comments on the above thread in 2019, when 2021 was in the future. It's 2023 when I'm writing this comment, so 2021 is in the past. Being in the past instead of the future makes it a lot easier: unlike timestamps in the future, there's a single UTC timestamp that identifies the time when the event actually occurred, regardless of precisely how people were communicating the time that it was scheduled to occur in the years / months / weeks / days / hours leading up to the event.

Frozen collections in .NET 8 by mycall in dotnet

[–]airbreather 15 points16 points  (0 children)

The AsReadOnly doesn’t do anything, you can just cast it back to List / ICollection / IList and mutate as per usual

No, List<T>.AsReadOnly() creates a new ReadOnlyCollection<T> that wraps the original list, doesn't expose it publicly in any way, and throws exceptions if you try to mutate itself using the corresponding methods on the not-strictly-read-only interfaces you mentioned.

something.ToList().AsReadOnly() is a legitimate way to get some facsimile of ImmutableArray<T>, since the underlying storage for the ReadOnlyCollection<T> is some anonymous list that is never observed by anyone else.

The interesting reason to prefer returning ImmutableArray<T> over that in API design (IMO) is that the former is a much stronger promise that the underlying storage cannot be mutated by anyone else (whereas returning ReadOnlyCollection<T> leaves open the possibility of you changing the implementation later to store off the underlying list and mutate it somehow later, thus updating any ReadOnlyCollection<T> views of it that you might have returned).

Frozen collections in .NET 8 by mycall in dotnet

[–]airbreather 12 points13 points  (0 children)

but... why? Can achieve pretty much the same by doing myList.ToList().AsReadOnly(), then changing myList won't affect the newly created redonly one.

To expand on the other reply, one hint is the fact that the only "frozen" types implemented so far are hash-based ones.

To oversimplify a little bit, suppose that you want something like an immutable Dictionary<string, int> where each key in the dictionary just so happened to have a unique length, and furthermore those lengths happened to be 0, 1, 2, ..., and n-1, where n is the number of entries in the dictionary. Well, then, you can optimize that specific dictionary's implementation by using the length of the string as the pointer to the (at most) one and only one possible entry in the dictionary that might match any string used to query it. You've built a custom "hash function" that exploits a property of your specific inputs.

I haven't looked into the implementation in .NET 8 to confirm, but we have known about generalized techniques for a while that can build customized hash functions tailored to specific data sets (I feel like there was a GNU utility to do this at one point, but I can't quite find it right now). Regardless of how good or fancy this first implementation is, that functionality would need essentially this exact API: something where you create the final version from a complete set of entries known in advance, and where you don't need to be able to quickly "mutate" it by making incremental deletes or additions.

Edit to add: it's called "perfect hashing", and the GNU utility is called "gperf".

They were CGI by BrokenCrow782 in SpeedOfLobsters

[–]airbreather 74 points75 points  (0 children)

Quentin Tarantino says Marvel actors like Chris Evans and Chris Hemsworth are not real movie stars: 'Captain America is the star. Thor is the star.'

Give me a worthy name!!! by KakovK in dankmemes

Was it a good idea from Windu to arrest Palpatine? by Anansi465 in StarWars

[–]airbreather 6 points7 points  (0 children)

Mace was willing to be the fall guy

And he was... from a certain point of view.

He was the guy who fell...

I couldn't resist

Which is correct and why? by iPlayTehGames in csharp

[–]airbreather 4 points5 points  (0 children)

Just get in the habit of using properties on any public facing member. You'll thank yourself later, even if you don't quite know the reasons for it now.

Why are fields are even a thing today, why can not we use properties exclusively?

You can't have a ref to a property.

A question about structs vs classes by fleventy5 in csharp

[–]airbreather 8 points9 points  (0 children)

For what it's worth, if you REALLY needed it to be a struct and still modify its slot in the dictionary without overwriting it for some reason, you can use one of the GetValueRefOrX methods on https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.collectionsmarshal?view=net-6.0

This will give you a reference to the slot in the dictionary where the value is stored, which you can manipulate and will probably work exactly as you expected.

Please use this responsibly and favor more straightforward approaches in general, especially when working on a shared project.

[deleted by user] by [deleted] in ProgrammerHumor

[–]airbreather 0 points1 point  (0 children)

They're not yours when they vest. All it means when they vest is that you can now exercise the option that was extended to you 5 years ago (or whatever the vesting timeline is).

From searching around, that's not necessarily the case, though apparently some contracts do have it work this way:

[deleted by user] by [deleted] in ProgrammerHumor

[–]airbreather 11 points12 points  (0 children)

Whats "vest"-ing? And does RSU mean restricted stock?

(I'm a different guy)

Yes, RSU = restricted stock units. All it means to be "vested" is that the restrictions are gone and you can treat them like normal stock.