Classic pagination bug: a product search feels instant on the first few pages, then gets slower the deeper it goes. A few hundred pages in, response times stretch into seconds and CPU usage goes up. OFFSET is the culprit, and the fix is a one-line change to the query.
@elhoir220582@yourclouddude That’s true, as described there isn't one. What’s missing is routing between subnets, and for that there needs to be a router or a Layer 3 switch.
@tanujDE3180 B. Many HTTP clients, like fetch and Axios, decide success from the status code With a 200, each caller has to check "success" by hand, and failed logins don't appear in 4xx alerts
@PythonPr [1, 10, 3] but twice.
b = a doesn't copy the list. a and b point to the same list object.
b[1] = 10 changes that object, which a also points to.
@Umesh__digital Design B. Reading the database column is enough to understand what it stores. No need to check the documentation each time to see if salary is annual/monthly/etc.
@Careerbuddha111 If order_date is a timestamp, '2024-01-31' is read as midnight on Jan 31.
BETWEEN stops at 2024-01-31 00:00:00, and orders later that day are missed.
On a DATE column the query is correct as written.
@Umesh__digital Usually the database query costs more than parsing the JSON, so gRPC's speed rarely matters.
REST is also simpler and works from any browser or HTTP client. gRPC needs generated clients and gRPC-Web for browsers.
gRPC is often used for internal services
https://t.co/GNC64OVcdz
When two services need to talk to each other, REST and gRPC are the two most common choices. Both work. But they solve for different things. Here's when to reach for which.
@kav_kavi11 "Bearer" is the auth scheme.
The Authorization header has the format "<scheme> <credentials>", and the server reads the scheme to know how to check the credentials.
Bearer means presenting the token is enough, with no extra proof of identity.
0.1 + 0.2 = 0.30000000000000004
Not a JavaScript bug. Not a Python bug. Every language using IEEE 754 floats does this. The reason is baked into how 64 bits store decimals, and why 0.1 in binary can't be represented exactly.
@clcoding 4.
a ^ b (symmetric difference) contains the elements found in only one set: {2, 8}.
The intersection a & b is {4, 6}. Each has length 2.
@tanujDE3180 First, check who sends them: one client polling in a loop, a scraper, or real users. If it's one source, rate limit it or fix the client. If it's real traffic, cache the response.
The Tokyo edge server does exactly that.
It downloads logo.png from Virginia on the first request only, then serves its own copy to every request after that.
Copying every file to every location in advance is possible (push CDNs do it), but many of those copies could end up being stored in cities where nobody requests them.