Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sa46
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
sa46
3y ago
Using iOS private relay can cause this as well.
92.
▲
by
sa46
3y ago
Do you have any cases studies or success stories for non-Google repos? I miss code search but I’m not sure how close Kythe is to code-search-in-a-box.
93.
▲
by
sa46
3y ago
I wrote our own little Go and Postgres job queue similar in spirit. Some tricks we used: - Use FOR NO KEY UPDATE instead of FOR UPDATE so you don't block inserts into tables with a foreign key relationship with the job table. [1] - We
94.
▲
by
sa46
3y ago
That is the definition of a hypocrite. Reasonable hypocrisy remains hypocrisy. From Oxford Languages: > the practice of claiming to have moral standards or beliefs to which one's own behavior does not conform
95.
▲
by
sa46
3y ago
Fun article if a little silly. As the author notes, the primary reason muskets started to overtake bows is because you can train shooting in five minutes where archery takes months. The transition is a classic example of a disruptive innova
96.
▲
by
sa46
3y ago
Table renames don’t break anything. Changing columns must be done to both tables in a transaction. Unit tests verify that the table columns match.
97.
▲
by
sa46
3y ago
I love temporal tables. I built an implementation in Postgres [1] in a few hundred lines of PLPGSQL. We've run the implementation for several years across a few hundred tables for an ERP product. The core ideas of the implementation: -
98.
▲
by
sa46
3y ago
This line in particular is a head-scratcher: > Advanced inter-document relations and analysis. No JOINs. No pain. […] queries allow for multi-table, multi-depth document retrieval, efficiently in the database, without the use of complic
99.
▲
by
sa46
3y ago
Yep, I used that trick as well. The evolution we went through: 1. Each test runs all migrations on a fresh database. Each test spends 2.1 seconds on db setup. 2. Each test suite runs all migrations. Each test copies the template database fr
100.
▲
by
sa46
3y ago
I've tried--macOS doesn't make it easy. It's not a clear performance win since tmpfs with Postgres fsync=off is mostly memory-backed storage via the page cache already. Another problem is that parallel tests can exhaust memor
101.
▲
by
sa46
3y ago
> What I do think would be awesome would be an embeddable Postgres library/binary that could use a single state file on your local filesystem for development I wired Postgres up for our local dev. I don't believe in mocking the
102.
▲
by
sa46
3y ago
What the author wants (and I do too) is a normal, full fledged editor that highlights the code under review. Bonus points for easy commenting. You can sort of do it with IntelliJ with git blame annotations but it’s clunky. I don’t really ca
103.
▲
by
sa46
3y ago
How do networks manage the larger number of IPv6 addresses? My cursory digging indicates that the secret sauce is to grant large IPv6 prefixes and delegate routing to the prefix. An informative-looking Reddit comment says there are 100k IPv
104.
▲
by
sa46
3y ago
The conformance suite tests encode and decode for single messages; you wouldn’t run it for a custom framing implementation; The gRPC interop tests are closer to what you’d want. Framing appears higher up the stack, as an RPC transport, or s
105.
▲
by
sa46
3y ago
Go cannot catch data races at compile time (like Rust) but can catch a subset of data races at run time with the race detector. Go provides imperfect, opt-in protection.
106.
▲
by
sa46
3y ago
Rust protects against data races, not race conditions. https://doc.rust-lang.org/nomicon/races.html
107.
▲
by
sa46
3y ago
Vulnerable to SQL injection since it’s wrapping string args with single. https://github.com/dmagda/pg-compute-node/blob/main/compute/... Personally, I’d prefer to create plv8 functions out of band (
108.
▲
by
sa46
3y ago
6 bookings per second at $200 per booking is $103M processed per day. Each booking likely represents dozens to hundreds of requests. Then, for every visit resulting in a booking there’s probably hundreds of non-booking visits.
109.
▲
by
sa46
3y ago
Oh neat, that’s what that’s called. I did something similar in ignorance. I needed a histogram metric with multiple lock-free writers and a single reader. - create two ring buffers (left/right; I called them hot/cold) - store the
110.
▲
by
sa46
3y ago
I use a hand-rolled Money class that’s an ergonomic wrapper around big.js, an arbitrary precision decimal library. I think using a separate language is massive overkill.
111.
▲
by
sa46
3y ago
You can reproduce that example with slog verbatim by changing zap to slog. For example: https://pkg.go.dev/golang.org/x/exp/slog#example-Group
112.
▲
by
sa46
3y ago
There is. See slog.LogValuer https://pkg.go.dev/golang.org/x/exp/slog#LogValuer
113.
▲
by
sa46
3y ago
Of all the Google dev tools, I miss Critique the most. GitHub is terrible at giving enough context to efficiently review a PR on a second or third pass. I think coupling commits with review progress was a mistake.
114.
▲
by
sa46
3y ago
Does “at least 20 users” imply the list of blocked domains is all blocked domains with at least 20 users? If so, I would have expected a much longer tail.
115.
▲
by
sa46
3y ago
Chrome dev tools are an engineering marvel; the downside is it’s quite hard to find the perfectly shaped tool. I spent about a week tracking down a memory leak in our web app. About 5 days in I discovered you could compare heap snapshots wh
116.
▲
by
sa46
3y ago
His BillG story is a really fun read: https://www.joelonsoftware.com/2006/06/16/my-first-billg-rev...
117.
▲
by
sa46
3y ago
Threads can certainly run in parallel with one another if the OS schedules them on different cores. I did a quick experiment and the main thread and worker threads run in parallel. https://github.com/jschaf/web-worker-e
118.
▲
by
sa46
3y ago
I thought the primary purpose of web workers was that the browser can run the workers in parallel to the main thread. As the spec says: > [Web workers] allow long tasks to be executed without yielding to keep the page responsive
119.
▲
by
sa46
3y ago
Most languages include unstructured logging libraries in the standard library, including Go. Structured logging is usually provided by third party libraries.
120.
▲
by
sa46
3y ago
> Yeah, TIMESTAMPTZ expressions don’t index nicely because they’re nondeterministic Could you expand on why it's not deterministic? I thought timestamptz was 8-byte microseconds since the epoch. Is the problem that the timestamptz u
More ›