Recent submissions

Comment · 5 months ago
I don't understand the point of the inverse sticky technique. Scrolling too fast still breaks the experience (content refuses to scroll), and in a way that, at least to me, feels more disruptive than blanking for a fraction of a second. I might just be too used to blanking.

Also ... shouldn't browsers just be able to render the diff without any of the trickery? Is the browser's job actually that hard for long pages, or are they just not optimising for this? Or is there some other reason for the virtualisation (e.g. memory usage)?

Comment · 2 years ago
I haven't read all of that, but the problem at hand seems significantly less complicated.

We're mapping the numbers from 1 to 1000 to distinct numbers up to 8258, and the README claims that we should expect 2.1% of the resulting numbers to be prime. I see no reason for this claim, and as I understand it, the 2.1% comes from pi(1000) / 8258, which seems like nonsense to me.

Comment · 2 years ago
I'm not sure I understand the prime density thing. Of the numbers up to 8258, about 12.5% are prime. Accounting for the fact that about a quarter of these primes ends in 101, i.e. cannot occur, I would expect about 10.7% = 12.5% * (3/4) / (7/8), which is fairly close to the observed 9.4%.

The 2.1% in the README seems to be the density of primes < 1000 among numbers up to 8258. That's not what was counted.

Comment · 2 years ago
Remember that transformers are "inside-out", i.e. `StateT (ExceptT e m) a` is isomorphic to `m (Except e (State a))`. If we want to keep state if an exception occurs, you need a `m (State (Except e a))` which is `ExceptT e (StateT m) a`.
Comment · 2 years ago
Comment · 2 years ago
Both, since a transpiler is a type of compiler.
Comment · 2 years ago
Not actually all-pairs max flow, you can fix the source and consider all possible sinks. In the AoC problem we also know that the min-cut is 3, so we can abort the flow algorithm as soon as we have found a 4-flow.
Comment · 2 years ago
grep doesn't eat the colours, apt detects that it is not outputting to a TTY and suppresses the colours. Try `printf 'a \e[36mb\e[0m c\n' | grep a`, the colour is preserved just fine.

Some tools have an option to force coloured output regardless, e.g. GCC's `-fdiagnostics-color` or grep's own `--colour=always`, but apt doesn't seem to have anything like that.

In theory one could have a command in the style of nohup or stdbuf which sets up a PTY to trick the command into outputting colours. So one could run `fakepty apt search whatever | grep another` ...

Comment · 2 years ago
Comment · 2 years ago
Some switch around the "s" and "sh" sounds, so it is pronounced roughly like "shtratsiatella". "st" at the beginning of a word is pronounced as "sht" in German.
Comment · 2 years ago
Comment · 3 years ago
Comment · 3 years ago
Unicode is useful for languages other than English, and has nothing to do with anyone's libido.
Comment · 3 years ago
Note that there's also a /usr/bin, with complete GNU coreutils (or at least most of them), and vim.
Comment · 3 years ago
They also got the conversion wrong: 1.5 liters is 0.4 gallons, not 0.3.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton