StasB
stasb.bsky.social
StasB
@stasb.bsky.social
1 followers 6 following 7 posts
Love hardcore software engineering. My blog: https://github.com/ctapobep/blog/issues
Posts Media Videos Starter Packs
StasB @stasb.bsky.social ยท Sep 26
In #SQL null != null, so if you pass a search param and it could be null, you must explicitly issue 'or is null'. But #PostgreSQL has a special operator for this:

๐‘ ๐‘’๐‘™๐‘’๐‘๐‘ก ... ๐‘ค๐˜ฉ๐‘’๐‘Ÿ๐‘’ ๐‘ ๐‘œ๐‘š๐‘’_๐‘๐‘œ๐‘™ ๐ข๐ฌ ๐ง๐จ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐œ๐ญ ๐Ÿ๐ซ๐จ๐ฆ ?

Looks awkward, but not as awkward as the alternatives.
StasB @stasb.bsky.social ยท Sep 19
Did you know that locks in one table can block operations in another one? If table B references table A and we update A, the newly inserted B may have nothing to reference anymore. So it has to wait. So.. In #PostgreSQL the right way to do pessimistic querying is through SELECT โ€ฆ FOR ๐๐Ž ๐Š๐„๐˜ UPDATE.
StasB @stasb.bsky.social ยท Sep 16
Did you know you could compare multiple fields at a time in #SQL?
StasB @stasb.bsky.social ยท Sep 15
How do computers juggle between processes & threads? CPU has a clock component that generates interrupts every N millisec. OS maps this interrupt to its schedule() function. So the CPU gets interrupted in the middle of our code โ†’ jumps into OS โ†’ OS decides which thread to call next.
#computerscience
StasB @stasb.bsky.social ยท Sep 12
#Microservices (esp. #Kafka) folks confuse Idempotence and Deduplication. One is about ACTUALLY processing the request twice as if it was processed once. The other is about DROPPING the repeated requests. Deduplication is used if we can't make operation idempotent.

See: github.com/ctapobep/blo...
Idempotence is not the same as Request Deduplication ยท Issue #29 ยท ctapobep/blog
There's a common confusion about Idempotence among the adepts of the message-oriented architecture - they often confuse it with Deduplication. This confusion started long time ago. E.g. the book En...
github.com
StasB @stasb.bsky.social ยท Sep 12
I don't understand why people prepare for interviews. Sure, the beginners simply don't know any better. But experienced people? ๐Ÿค”

Learning a skill and preparing for interviews are very different: one is shallow, another is deep. There are people who never learn because they always prepare.
StasB @stasb.bsky.social ยท Sep 11
Many will be surprised, but all the answers are correct. Why? Because O() is the UPPER boundary. E.g. O(Nยฒ) says the number of operations doesn't exceed Nยฒ. What we USUALLY want to write is ฮ˜(N logN).

#computerscience #algorithms