HNHacker News
TopNewBestAskShowJobs

renhanxue

805 karma · joined January 15, 2024

submissionscomments
renhanxue··on Offline card payments should be possible no later than 1 July 2026
We usually use an app for that (Swish, it's kind of like Venmo I guess, developed in collaboration between the six largest banks). We don't really do transaction reversals in the same way or as commonly as in the US.

Paying for a used car in cash would actually be difficult because handling an amount greater than the equivalent of around USD $1k immediately starts tripping KYC/AML flags at any bank if you try to deposit it, and it's hard to use in day to day life because few places other than grocery stores even accept cash anymore.

renhanxue··on Offline card payments should be possible no later than 1 July 2026
I'm Swedish and if someone insists on doing a transaction using cash when Swish or card is available, I'd immediately start to wonder if it's for some kind of more or less shady reason, probably tax evasion at the very least.
renhanxue··on Offline card payments should be possible no later than 1 July 2026
Yeah, that's kind of my default assumption as well. If someone is insisting on cash I'd assume it's for tax evasion purposes.
renhanxue··on Offline card payments should be possible no later than 1 July 2026
I am Swedish and have lived here all my life and I have no idea what the current banknotes look like. I have literally never used them. I remember what they used to look like 20 years ago, but I know they have changed since then.
renhanxue··on A SQL Heuristic: ORs Are Expensive
B-tree skip scan does not address the problem in the article at all.
renhanxue··on A SQL Heuristic: ORs Are Expensive
The core issue the article is pointing to is that most database indexes are B-trees, so if you have a predicate on the form (col_a = 'foo' OR col_b = 'foo'), then it is impossible to use a single B-tree lookup to find all rows that match the predicate. You'd have to do two lookups and then merge the sets. Some query optimizers can do that, or at least things that are similar in spirit (e.g. Postgres bitmap index scan), but it's much more expensive than a regular index lookup.
renhanxue··on A SQL Heuristic: ORs Are Expensive
The article is specifically discussing cases where you have predicates on different columns OR'ed together, like col_a = 'foo' OR col_b = 'foo'.
renhanxue··on What Problems to Solve (1966)
What a baffling comment. Feynman won a Nobel prize for his work on quantum electrodynamics, and yet he's not known for theory work?

Also, Feynman never wrote any books. His "textbooks" are lecture notes, mostly compiled by other people.

renhanxue··on What Problems to Solve (1966)
Astrophysicist Angela Collier's video essay "the sham legacy of Richard Feynman" [0] is a good introduction. Her accounts of her own encounters with "Feynman bros" are heart-wrenching.

[0] https://www.youtube.com/watch?v=TwKpj2ISQAc

renhanxue··on Show HN: I modeled the Voynich Manuscript with SBERT to test for structure
The hypothesis that the manuscript is a palimpsest (that is, written on an old parchment that was scraped clean of a previous text; such recycling was common because parchment was expensive) has been thoroughly rejected. That sort of thing is detectable, in fact there's an entire field of research dedicated to recovering lost texts from palimpsests, but the Voynich manuscript shows absolutely no signs of that.
renhanxue··on Show HN: I modeled the Voynich Manuscript with SBERT to test for structure
These days the manuscript is quite conclusively dated to the first half of the 15th century; the parchment it's written on is definitely from that period, since it's been carbon dated to 1404–1438 with 95% confidence. The general style is also consistent with that dating. For example, medievalist Lisa Fagin Davis writes in a recent paper: "[t]he humanistic tendencies of the glyphset, the color palette, and style of the illustrations suggest an origin in the early fifteenth century" [0].

Edward Kelly was born over a hundred years later, so him "being at the right time" seems to be a bit of a stretch.

[0]: https://ceur-ws.org/Vol-3313/keynote2.pdf

renhanxue··on Migrating to Postgres
If you, for whatever obscure reason, need to preserve whitespace and key ordering, that is you want something that is effectively just a text column, then you should use JSON over JSONB.

I can't think of any case at all, no matter how contrived, where you'd want to use the non-B versions of the JSON aggregate functions though.

renhanxue··on After 53 years, a failed Soviet Venus spacecraft is crashing back to Earth
Marco Langbroek, who did the reentry forecast that the linked article is based on, convincingly argues[0] that the bus did separate and reenter separately (in 1981) and what remains in orbit is just the lander. There are several independent pieces of evidence that are consistent with this; the orbital decay pattern, the radar cross section and optical telescope observations all point to only the lander itself remaining.

See also his blog[1] for an up-to-date reentry forecast.

[0]: https://www.thespacereview.com/article/4384/1

[1]: https://sattrackcam.blogspot.com/2025/04/kosmos-842-descent-...

renhanxue··on Porting Tailscale to Plan 9
> In 1999, Intel introduced the Pentium III processor with SSE instructions.

I kinda expected this paragraph to continue with

> This has made a lot of people very angry and been widely regarded as a bad move.

renhanxue··on Good-bye core types; Hello Go as we know and love it
Both (for example) Russ Cox and Ian Lance Taylor have contributed some very notably bad ideas to the project, yes. Does rephrasing it to "Rob Pike and people who think like him" make you happier?
renhanxue··on Good-bye core types; Hello Go as we know and love it
I've coded golang for four years. Web services. I hated it at the start and I hate it even more now. The generics are miserable to use and are very limited in what they can do, the standard library is awful (database/sql in particular is offensively bad, but you have to use it because all the third party tools rely on its interfaces), there's footguns and dangerous syntax subtleties everywhere, and the idea of the zero values for uninitialized struct fields is to me an even worse mistake than the concept of null. At least if you make a mistake with null the program crashes, which is obvious, instead of just silently doing the wrong thing, which is not. The language claims to be simple; it's not, it's just pointlessly restrictive in weird ways wherever it happens to offend Rob Pike's personal sense of aesthetics. At least it compiles quickly, I guess???

I wish we could use some boring language that works, like C# or Kotlin.

renhanxue··on FFmpeg School of Assembly Language
If you really care about performance though you'd want to be a lot more specific than this. I've seen image processing code that not only does things like avoid specific instructions on some CPU families (like for example it avoids the vpermd instruction on Zen1/2/3 CPU's because of excessive latency), but also queries the CPU cache topology at runtime and uses buffer allocation strategies that ensure that it can work in data batches that fit in cache.
renhanxue··on Caltrain's electric fleet more efficient than expected
Aerodynamic drag is proportional to cross sectional area. A train only has maybe 2-3x the drag of a car at the same speed, but it has on the order of 100 to 1000x the mass and momentum. It takes forever for drag to do anything to a train at speed.
renhanxue··on Caltrain's electric fleet more efficient than expected
Try out the video game Derail Valley and you'll get a decently realistic idea of just how much trains tend to just coast along without any power input. On flat ground you just need a little nudge every once in a while to keep going.
renhanxue··on Caltrain's electric fleet more efficient than expected
I think you completely misunderstood the article. It says that the electricity used to power these trains was estimated to cost $19m a year, but the trains are a bit more efficient than expected, so the new estimate is only $16.5m/year.

Most if not all electric trains powered by overhead wires have regenerative braking that feeds back to the grid as standard, and Caltrain's new Stadler units definitely do. Nobody paid extra for regenerative braking, it's just the default way to do things on electric trains, to the point that it'd be weird not to have it. Even diesel-electrics often have a kind of regenerative braking, but they don't have anywhere to store the recovered energy so they just convert it to heat via huge resistors.

renhanxue··on Caltrain's electric fleet more efficient than expected
They've significantly increased the timetable frequency though, so they're running more trains, and those trains are accelerating and running much faster than the old diesel-electrics. I don't think you're comparing like for like.
renhanxue··on Caltrain's electric fleet more efficient than expected
It's not the electric motor torque that makes the difference. Caltrain used to use traditional locomotives, you'd have a single F40PH or MP36PH at one end pulling a bunch of unpowered carriages. Those locomotives were diesel-electric though, that is the diesel is only there to act as a generator while the traction motors are electric.

The Stadler KISS units are so much faster because they're EMU's (Electric Multiple Units), that is most of the wheels in a 7-car consist are powered with their own traction motors. An F40PH makes 3000 hp (2200 kW) while a Caltrain 7-car KISS consist can put out 9400 hp (7000 kW) continuous and about 50% more than that in short duration overload mode for starting. That's the reason it accelerates so much faster.

Traditional locomotive trains are completely obsolete in any sort of commuter service with frequent stops, there's just no way for them to keep up with EMU's or even DMU's. You can't solve it by just putting bigger engines on the locomotives, you wouldn't have enough weight on the wheels to make sufficient tractive effort.

renhanxue··on 100x defect tolerance: How we solved the yield problem
There's a bunch of places in Europe that use waste heat from datacenters in district heating systems. Same thing with waste heat from various industrial processes. It's relatively common practice.
renhanxue··on A 94x speed improvement demonstrated using handwritten assembly
That's exactly what I was thinking of, but I didn't know for sure. Thanks for confirming.
renhanxue··on A 94x speed improvement demonstrated using handwritten assembly
NVENC/NVDEC and similar technologies use what is effectively an ASIC that happens to be integrated on the GPU. It doesn't use the general purpose GPU cores. This is the reason why the limitations on e.g. which codecs it supports are so strictly tied to the hardware generation; it's just fixed function hardware.

There's no reason you can't bundle the same kind of ASIC on a CPU too, and indeed Intel does do that with QuickSync. For video game capture/screen recording though (which is a big part of what people tend to do with NVEnc) it might be a bit more convenient for the chip to be on the GPU? I don't know, not a GPU expert.

renhanxue··on Bill Atkinson doxxed Douglas Adams in 1987
Also in Sweden. Most people, almost everyone, have their phone numbers and addresses listed in publicly searchable databases. Everyone's taxable income is public too (accessing it online costs a nominal fee from an aggregator service).

It's fine, it's not really abused that much. You can request a protected identity from the authorities if you really do have stalkers but it's a bureaucratic hassle. Mainly since everything in this society relies on anyone wanting to do business with you to be able to look your existence up using your personal number.

renhanxue··on INNER JOIN ON vs WHERE clause (2009)
Also, using the ON clause is consistent with the syntax for outer joins, where you have to use it (because there's a very important logical difference between putting the condition in the ON clause vs in the WHERE clause).
renhanxue··on SQL Tips and Tricks
Unfortunately EXCEPT is almost never what you actually want. It's a set operator, like UNION, and just like UNION it also has the side effect of removing duplicates from the result set unless you explicitly say EXCEPT ALL.

Because it's a set operator and not a join, it's usually very hard for the query planner to optimize it beyond the most trivial cases. It usually ends up being one of the last steps in the query plan. In a good query plan you almost always want to eliminate rows you don't care about as early as possible so you don't have to drag them along in every join operation only to have the data discarded at the end, but if you're using EXCEPT instead of the explicit anti-semi-join operator (that is NOT EXISTS(<subquery>)), you're making that very difficult for the query planner.

EXCEPT and INTERSECT are sometimes a handy shortcut when you're writing some quick and dirty query by hand, but I have literally never used either of them in a production query. You almost always want to use EXISTS() and NOT EXISTS(). They explicitly communicate intent, which is appreciated both by people reading the query and by the query planner, and they lack the footguns some of the other alternatives have.

renhanxue··on The big Baltic bomb cleanup
The Baltic has seen some incredible amounts of abuse over the years. It doesn't stop at the massive amounts of conventional munitions like bombs and naval mines, nor even at the chemical weapons. The Swedish nuclear weapons program dumped several hundred barrels of intermediate-level radioactive waste in the Baltic during the 50's and 60's.

Then there's the environmental problems, where the Baltic has it all, really. There are severe eutrophication and oxygen depletion issues, but of course it doesn't end there. It's just severely polluted with everything from heavy metals like mercury and cadmium to persistent organic pollutants like polychlorinated biphenyls (PCB's), various other dioxins and dioxin-likes, DDT... the list goes on. The Swedish food agency recommends that children, adolescents, women who breastfeed or are or intend to become pregnant should not eat fish from the Baltic more than twice a year.

renhanxue··on Why Not Comments
I saw someone quip (on twitter, I think) many years ago something like:

"A junior engineer writes comments that explain what the code does. A mid-level engineer writes comments that explain why the code does what it does. A senior engineer writes comments that explain why the code isn't written in another way."

(except punchier, of course. I'm not doing the quip justice here)

← PreviousPage 2 of 4Next →