Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
palmtree3000
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
palmtree3000
6y ago
Apparently [1] it returns Option<Element>. [1] https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.D...
32.
▲
by
palmtree3000
6y ago
I was briefly very excited when I read that article, actually. But as devit points out in a sibling comment, that technique is only relevant to cases where you're adding more than 2 numbers. Multiplication initially seemed like a very
33.
▲
by
palmtree3000
6y ago
overflowing_add, like I was using above, is explicitly wrapping. I've found it very difficult to provoke rustc into emitting an ADC: the only case where it does so AFAICT is when adding u128s, which are implemented using u64s. Not sure
34.
▲
by
palmtree3000
6y ago
It's not always superior! For example, I've been working on a big integer library. Addition is a bit annoying, because you need to add 3 numbers (the prior carry bit, and the two digits you're adding) and get out a new carry
35.
▲
by
palmtree3000
6y ago
Here's one: https://www.pandemiceconomist.com/2020/04/costs-and-benefits... TL;DR (copied directly from the post): With these values, if a lockdown of two years or less will stop the COVID-19 pandemic, it is
36.
▲
by
palmtree3000
7y ago
I didn't: I assumed that[1] was sufficient. But (I assume, knowing little about C++) you're right that it's actually not an infinite loop, it's signed integer underflow. Given that, I'll file a bug. [1] https:/
37.
▲
by
palmtree3000
7y ago
Yep. Here's an example I found once: https://godbolt.org/z/XQBcR9 pub fn mul1(mut a: i32, b:i32) -> i32 { let mut out = 0; while a != 0 { out += b; a-=1; } out
38.
▲
by
palmtree3000
8y ago
The Rust HashMap and HashSet implementations are generic over hasher: you can pick a faster one if you don't have to worry about getting ddos'd. Last I checked, the go-to fast hasher was fnv: https://doc.servo.org/
39.
▲
by
palmtree3000
9y ago
It's interesting to run some numbers here. Say you're a software company that's totally dedicated to removing CO2 from the atmosphere: you run a business, but that's just to fund your CO2 reduction efforts. Should you re
40.
▲
by
palmtree3000
10y ago
The incident you linked to wasn't a nuclear explosion: the rocket the nuke was sitting on exploded. FTA: "The W53 warhead landed about 100 feet (30 m) from the launch complex's entry gate; its safety features operated correct
41.
▲
It's Not Impostor Syndrome If You Really Do Suck
(particularvirtue.blogspot.com)
2 points
by
palmtree3000
10y ago
|
0 comments
42.
▲
Programmer Language
(particularvirtue.blogspot.com)
2 points
by
palmtree3000
10y ago
|
1 comments
43.
▲
Show HN: Nations Graph – a visualization of world history in Haskell and JS
(rocurley.github.io)
7 points
by
palmtree3000
11y ago
|
1 comments
44.
▲
by
palmtree3000
11y ago
I've been doing exactly this, and lenses make this pretty painless: https://github.com/rocurley/Nations-Graph/blob/master/Nation...
45.
▲
by
palmtree3000
13y ago
I'm probably taking your comment far too seriously, but.... The Sun's reference frame is privileged compared to ours: it is far closer to being an inertial reference frame[0], deviating from wobble induced by Jupiter and its long
46.
▲
by
palmtree3000
14y ago
It's interesting that the headline, and the article, seem to focus on the fact that the crops were genetically modified, rather than that they were treated with roundup. This seems questionable; I would guess (although I'm no biologist), th
47.
▲
by
palmtree3000
14y ago
I'm fairly certain that wouldn't be an issue. Relativity means that any (let's say non-accelerating, to keep us within the context of special relativity) reference frame is just as good as another. In the spacecraft's reference frame, it's
48.
▲
by
palmtree3000
14y ago
It's probabilistic, but there are patterns (lines with significantly greater prime densities than others).
49.
▲
by
palmtree3000
14y ago
This is, in fact, solvable; you can use plank units, which result from setting universal constants to 1. As an example, setting the speed of light to 1 means that time can now be measured in meters. https://en.wikipedia.org/wiki/Planck_uni