725 karma · joined May 11, 2018
1. Fantasy. They have interesting and engaging fantasy worlds. There's a lot of mixed results here, I personally don't think DBZ or Cradle are that interesting.
2. The main characters are empowered to actively participate in events that surround them. The trope here is that they fight back against the latest unfairness of the world, but more creative storytelling can make this very fresh and interesting.
3. The main characters aren't defined by their circumstances. They prove themselves by their work ethic or cleverness, not by being born to a powerful family.
Most works in this category are rehashes of CRPG or Xianxia tropes. I'd personally recommend Mother of Learning as the best progression fantasy I've read.
My boring hash function of choice is Sha-384. The Sha-512 computation is faster on Intel hardware, and ASICS to crack it are far more expensive than Sha-256 because of bitcoin.
If you're hashing passwords or something, use a "harder" hash like Argon2 or Scrypt.
* Differentiate retryable and non-retryable errors. If the service can't return success because the DB it queries is borked, it should send a non-retryable error. Then it won't get overwhelmed by retries from upstream.
* Retry configuration should have sane defaults. Even "retry once" is too often; many services aren't overprovisioned for 100% increase in traffic. What ended up working here for us was having the retry module collect req/sec statistics, then only allowing 20% of that number in retries/second. Individual requests can be retried twice. That was small enough to not push over any services, but enough retries to compensate for garden-variety unavailability.
* Services shouldn't serve requests first-come-first-served under load. When SHTF, fairness means everyone has to suffer long delays, often much longer than rpc timeout. Instead, serve them in an unfair order - the most recent requests to come in are the most likely to have a caller still interested in them. Answer those!
* Use headless services in kubernetes. By exposing the replicaset to the client, the client can load balance itself more intelligently. Retries should go to different replicas than the failing request. Furthermore, you can perform request hedging to different replicas than the lagging request.
* Define a degraded form of your in-memory object-graph. If a feature is optional to the core business flow, it shouldn't take down your whole product. This one is a lot more involved. We needed custom monitoring for degraded responses, in-memory collection and storage of "guesses" to substitute for degraded portions of the object graph, as well as some other work I can't think of right now. This does enable an organization to compartmentalize better, having faster, less fearful deploys of newer initiatives.
The strength of types, in my opinion, is composability. Most config files I've seen have ultimately pulled in input from another source and used that to create their output. Types would allow the configuration to be checked for correctness even in the face of unknowns.
[0] https://www.depesz.com/2019/02/19/waiting-for-postgresql-12-...
Many people think of Complex Numbers as vectors, and I think of negative numbers as vectors too. They have both magnitude and orientation, even if the orientation is only 1-dimensional. When you multiply complex numbers, the resulting "vector" has magnitude equal to the product of the magnitudes, and angle (from the positive x-axis) equal to the sum of the angles. So you can actually calculate these products without actually multiplying the numbers themselves, but instead only considering magnitude and angle (this only really matters with complex numbers). But the definition of a vector, that is has magnitude and direction, doesn't apply to 0. It doesn't have any direction, so it's technically not a vector. Adding angles doesn't make sense to something that just doesn't have angles. Zero is actually a mess when considering multiplication, and is generally excluded from the set of numbers you get to play with under multiplication. Another number you don't get to use for the same reason is infinity. A professor once told me an interesting insight, that zero is messed up in the same way that complex infinity is messed up. Neither has orientation, both have magnitudes that consume the other number when multiplying. And if you think about it, you could `s/0/infinity/g` in integer multiplication tables and they'd still work exactly the same.
[0] https://en.wikipedia.org/wiki/Gaussian_integer#Gaussian_prim...
> Although it may seem a little strange these days, in those days it was a long way from the east coast to the west coast, and of course we had no conference calls in those days too. That whole business about object-oriented programming was developing on the west coast and on the east coast we were mostly working on data abstraction, and the two worlds were kind of separated. So I knew the name, but we didn’t run into each other at conferences and there wasn’t much crosstalk going on.
> In the 1980s, I was asked to give a keynote at OOPSLA, which I think it was maybe the second OOPSLA. It hadn’t been in existence very long. So I decided that this was a good opportunity to learn about what was going on in object- oriented languages. So I started reading all the papers and I discovered that hierarchy was being used for two different purposes. One was simply inheritance. So I have a class, it implements something, I can build a subclass, I can borrow all that implementation, change it however I want, add a few extra methods, change the representation. Whatever I want to do, I just sort of borrow the code and keep working on it.
> The other way it was being used was for type hierarchy. So the idea was that the superclass would define a supertype, and then a subclass would extend this to become a subtype. I thought this idea of type hierarchy was very interesting, but I also felt that they didn’t understand it very well. I remember reading papers in which it was clear they were very confused about it, because one in particular that I remember said that a stack and a queue were both subtypes of one another. This is clearly not true because if you wrote a program that expected a stack and you got a queue instead, you would be very surprised by its behavior. The difference between LIFO and FIFO is a big deal.
> This led me to start thinking about “What does it really mean to have a supertype and subtype?” And I came up with a rule, an informal rule which I presented in my keynote at OOPSLA which simply said that a subtype should behave like a supertype as far as you can tell by using the supertype methods. So it wasn’t that it couldn’t behave differently. It’s just that as long as you limited your interaction with its objects to the supertype methods, you would get the behavior you expected.
[...]
> Meanwhile I was working on distributed computing, I was particularly interested in viewstamped replication and some of the other work that was going on in my group at the time, and I wasn’t really thinking about this until sometime in the ’90s when I got an email from someone who said, “Can you tell me if this is the correct meaning of the Liskov substitution principle?” So that was the first time I had any idea [laughs] that there was such a thing, that this name had developed.
[0] https://amturing.acm.org/pdf/LiskovTuringTranscript.pdf page 29
I forget exactly what the scenario was but the request was not being sent with credentials so a 401 was returned, which immediately prompted a retry with the credentials. I'd probably agree that this is covering up an issue that should be fixed.
I'll tentatively assume you got some of the same visceral recoil I got from that mental image. And that we agree that following everything Hollywood does is probably not for the best. So I'll ask you: if you could solve this however you'd like (by passing laws, let's say), how would you do it?
> I can also ban you if I don’t like you. Or if I think it’s funny, or really any other reason.
Additionally, Twitch will not allow banned users to appear on other streams including tournament streams. There was a kerfluffle recently where a Twitch-banned player was also banned from a tournament they tried to compete in, solely because the tournament organizer didn't want to jeopardize their streamability.
I hope I've impressed upon you that a Twitch ban is effectively a ban on all opportunities that involve money in the esports scene. There are incredibly few esports careers that could survive a Twitch ban, and not a single one would be unaffected.
> Multiple Chinese celebrities publicly renounced brands they had endorsed but which have stuck by earlier statements about Xinjiang (or not indicated any change). These include H&M, as well as Adidas, Nike, Puma and Uniqlo. Zhou Dongyu, an actress, dropped her deal with Burberry because she said the British maker of posh trench-coats, a member of the Better Cotton Initiative (BCI), a due-diligence consortium, had not “clearly and publicly stated its stance on cotton from Xinjiang”
> Several apparel firms, including Muji, Fila China and the Chinese operation of Hugo Boss, gave testimonials on Chinese social media that they support Xinjiang cotton (all three of those companies have also issued statements from corporate headquarters acknowledging concerns about allegations of forced labour in Xinjiang).
> Other firms have apparently taken down earlier statements about Xinjiang. They include PVH, which owns Calvin Klein, and Inditex, which owns Zara, among other brands.
Why would I not know this is an option? The word "sorting" appears in every single study guide I've seen. It's used as part of a solution in a large number of practice problems. I'm legitimately curious about what study materials you've used that leaves you uncomfortable with sorting.
EDIT: I might've misunderstood your question. When Amazon asked me this interview question, I'd never seen it before and didn't know beforehand what to do to solve it. I thought to try sorting a list within the first minute of working on it, because that's what you do with Leetcode style problems. I had prepared before the interview, so "let's try sorting" was not a stroke of brilliance it was a basic attempt to use a common tool.
This is only half true in my opinion. A lot of the interview questions I've gotten are pretty straightforward, for example given two lists of length M and N, brute force searching their product space is O(M*N), but if you sort one list the complexity reduces to O(NlogN + MlogN). I get the impression that the interviewer did expect me to sort, and writing code to do that was good enough.
On the other hand everyone shares stories about the really hard "gotcha" problems with clever optimal solutions. I've only been given one of those[0], and I did not come up with the optimal solution but I still passed the interview. I wrote a halfway solution that was better than bruteforce and I explained why any attempt I'd make to remove terms from the big O expression wouldn't work (obviously I could remove more if I was clever enough or given unlimited time).
So I would sum up my experience with they expect you to do better than brute force within 30 minutes, and to give them an intelligent conversation. I don't think this is easy, but it's not as impossible as you make it out to be.
[0] https://techdevguide.withgoogle.com/resources/former-intervi...
It seems they have a max size of 512 bytes[0] which they reject[1] if the encoded length exceeds.
[0] https://github.com/backtrace-labs/stuffed-record-stream/blob...
[1] https://github.com/backtrace-labs/stuffed-record-stream/blob...