HNHacker News
TopNewBestAskShowJobs

sa46

1,425 karma · joined December 2, 2015

Building AI for distributors, contractors, and manufacturers.

Paratrooper to programmer.

http://github.com/jschaf

hn@schafer.dev

submissionscomments
sa46··on Do AI detectors work? Students face false cheating accusations
Most engineers, including good ones, that I've interviewed have no interesting GitHub contributions. GitHub is also game-able. Bootcamps, in particular, push their graduates to build an interesting GitHub portfolio.

I've found that talking through projects is a weak indicator of competence. It's much easier to memorize talking points than to produce working code.

sa46··on Show HN: Vortex – a high-performance columnar file format
Parquet also encodes the physical layout using footers [1], as does ORC [2]. Perhaps the author meant support for semi-structured data, like the spans you mention.

[1]: https://parquet.apache.org/docs/file-format/

[2]: https://orc.apache.org/specification/ORCv2/#file-tail

sa46··on Build systems, not heroes
React will soon do it that way. React 19 will introduce a compiler that automatically memoizes all components and hooks.
sa46··on Good Retry, Bad Retry
> Monoliths _force_ you to update your caller and callee at the same time

It's possible to migrate method calls incrementally (create a new method or add a parameter). In large codebases, it's necessary to migrate incrementally. The techniques overlap those of changing an RPC method.

sa46··on Don't defer Close() on writable files (2017)
I use a similar pattern, cribbed from one of the Go databases that aspired never to ignore errors. The difference is that errs.Capture preserves existing errors and formats the error with a message--important if generalized to handle any error function.

    package errs

    // Capture runs errFunc and assigns the error, if any, to *errPtr. Preserves the
    // original error by wrapping with errors.Join if the errFunc err is non-nil.
    func Capture(errPtr *error, errFunc func() error, msg string) {
        err := errFunc()
        if err == nil {
            return
        }
        *errPtr = errors.Join(*errPtr, fmt.Errorf("%s: %w", msg, err))
    }


I conventionally use mErr to distinguish from err.

    func doThing() (_ string, mErr error) {
        f, err := os.Open("foo")
        if err != nil {
            return "", fmt.Errorf("open file: %w", err)
        }
        // Use the file...
        defer errs.Capture(&mErr, f.Close, "close file")

        return "", nil
    }
sa46··on The Elements of APIs (2021)
Contains similar advice to resource-oriented design and Google's API Improvement Proposals [1]. I've been pretty happy with resource-oriented design--makes for a very uniform API and avoids much of the bike-shedding over decisions like the filter [2] and pagination format.

[1]: https://google.aip.dev/121

[2]: https://google.aip.dev/160

> Your GETs support a filter query parameter, which works for every attribute of the resource being retrieved.

That's not easy in practice. You'd have to filter the entire collection on the server or database. For large tables, you'd need to index attributes and build the appropriate predicate, which can be challenging for normalized tables.

sa46··on Making database systems usable
Composite types can be atomic--a string is a composite type. The point (123, 456) is a composite type but is atomic.

Good discussion at https://dba.stackexchange.com/questions/2342/what-is-atomic-...

sa46··on Making database systems usable
I wish there were a way to specify the expected join cardinality syntactically for 1:1 joins.

    SELECT * FROM order JOIN_ONE customer USING (customer_id)
Malloy has join_one: https://docs.malloydata.dev/documentation/language/join
sa46··on Build your own SQLite, Part 1: Listing tables
This is essentially a prepared statement, right?

https://www.sqlite.org/c3ref/stmt.html

sa46··on Military sexual assaults far exceed DoD estimates, new report finds
Link to the actual report [1].

The DOD estimates 4.3-8.4 percent of women experience unwanted sexual contact, based on 8,500 reports, extrapolated to 29,000 estimated incidents. The author argues that the actual rate is 24% of women, using the median estimate from a range of independent studies.

DOD's most significant change was moving the prosecution authority for sexual assault to a separate tribunal in 2023.

[1]: https://watson.brown.edu/costsofwar/files/cow/imce/papers/20...

sa46··on A wonderful coincidence or an expected connection: why π² ≈ g
Pi seconds is a nano-century. So 1 year = pi*10^7 seconds
sa46··on Scaling One Million Checkboxes to 650M checks
Just spitballing: could you change the database to a bool array? Guard it with a RWMutex and persist on server shutdown. The bottleneck probably moves to pushing updates from a single server, but Go can probably handle a few tens of thousands of goroutines.
sa46··on Alexa is in millions of households and Amazon is losing billions
Interestingly, there is an app, Chatterbaby [1], that claims to detect why a baby is crying based on the acoustic features of the cry. I've used it with middling success.

That'd be a neat integration: "Alexa, why is my baby crying?"

[1]: https://www.chatterbaby.org/pages/

https://www.nature.com/articles/s41390-019-0592-4

sa46··on Show HN: I made a tool to HTTPS your localhost
I need to map localhost:3000. Ports aren't a part of the hostname, so I can't use /etc/hosts.
sa46··on Show HN: I made a tool to HTTPS your localhost
One downside of self-signed certs is that browsers will to upgrade all localhost ports to HTTPS thanks to HSTS. In practical terms, that meant:

- we needed to upgrade all dev servers to serve both HTTPS and HTTP. - we downgraded server to server comms to HTTP (something about invalid cert chain)

I think the ideal solution is to use “local” domain names but that requires a DNS resolver (via Tailscale or similar).

sa46··on gRPC: The Bad Parts
You’re likely thinking of Cap’n’Proto or flatbuffers. Protobuf definitely requires parsing. Zero values can be omitted on the wire so there’s not a fixed layout, meaning you can’t seek to a field. In order to find a fields value, you must traverse the entire message, and decode each tag number since the last tag wins.
sa46··on Draw an iceberg and see how it will float
The HTML source code is a well-commented, fun read.

- There's a fair bit of math to model drag, mass, and density using the specific gravity of ice and seawater (with tweaks to make it more realistic for 2d).

- Try adding a polygon that overlaps itself (self-intersects).

- You can paste images! The code traces the image and picks the most complex polygon.

sa46··on Feature flags in Bazel builds
You'll get wildly different answers depending on who you ask. Most ex-Googlers appreciate Bazel. Folks used to ergonomic single-language builds dislike it.

In my experience, Bazel works best when:

- You have a monorepo.

- You have one engineer who knows it in and out and can stay current.

- You use several languages well-supported by Bazel (Protobuf, Go, Java, Kotlin).

The benefits are a single way to build and run all tests and binaries across all languages. Bazel CI providers (BuildBuddy, EngFlow) are much nicer than YAML engineering in other CI systems.

I have an old comment that's still representative of my experience: https://news.ycombinator.com/item?id=32831555

sa46··on Sharing details on a recent incident impacting one of our customers
Microsoft is prone to severe breaches a few times per year.

https://firewalltimes.com/microsoft-data-breach-timeline/

sa46··on Act on Press
https://instant.page/ is a take on this idea for web. On mouse down or hover for an <a> element, start a prefetch.

This technique hides about 80 ms of latency when triggered on mousedown and up to a few hundred milliseconds for hover.

sa46··on Migrating Uber's ledger data from DynamoDB to LedgerStore
One interesting caveat is that Uber only uses the Zig toolchain, not the Zig language.

https://www.uber.com/en-US/blog/bootstrapping-ubers-infrastr...

sa46··on Merging Remix and React Router
I haven’t used Remix, but I regret choosing react-router due to frequent major version upgrades.
sa46··on So We've Got a Memory Leak
Joshua Bloch, of Effective Java fame, used the term unintentional object retention as a more precise term for memory “leaks” in garbage collected languages.
sa46··on Coronal mass ejection impact imminent, two more earth-directed CMEs
I used to be a logistics officer for an Infantry battalion.

Most of the comments down thread underestimate water consumption. Depending on the climate, you'll want the following daily quantities [1]:

- 2-3 gallons for drinking

- 1.5 gallons for hygiene (can skip for a while)

- 0.5 gallons for food prep

The planning factor for military operations was 8 gallons per person per day. Water is heavy—8 pounds per gallon—and acquiring, storing, and moving it is a large effort.

[1] https://cascom.army.mil/g_staff/g3/TTD/Products/QM-How-to-Ha...

sa46··on ETag and HTTP Caching
That’s a strong assertion. There’s plenty of status codes that indicate something bad happened at the HTTP level but don’t convey information about the RPC.

- 404 might mean the URL was wrong

- 405 might mean swapping POST with PUT

sa46··on ETag and HTTP Caching
I prefer to treat HTTP as a transport layer. A 200 means the transport succeeded but doesn’t indicate that the RPC succeeded.
sa46··on Online Encyclopedia of Integer Sequences
Is the set of integer sequences uncountably infinite? It seems like Cantor's diagonal argument would work here.

1. Number all sets from 0.

2. Construct a new set by picking the i^th number from each set.

sa46··on How web bloat impacts users with slow devices
Pinch to zoom magnifies part of the page. That’s less helpful for text because you have to scroll the smaller viewport to read a complete line of text.

On iOS, there’s a text scale button in the URL bar which does the trick.

sa46··on Show HN: We built the fastest spreadsheet
Is the pricing per user? $15/mo for an entire org sounds too good to be true.
sa46··on Why is Prettier rock solid?
I suspect the author meant that gofmt doesn’t break lines, which dramatically simplifies the complexity. See https://journal.stuffwithstuff.com/2015/09/08/the-hardest-pr... for a fun, related read.
← PreviousPage 3 of 15Next →