Readit News logoReadit News
wenderen commented on Solving Project Euler: Problem 45   loriculus.org/blog/euler-... · Posted by u/wenderen
cbarrick · 4 months ago
Same algorithm in Rust finds 2172315626468283465 in about 3 seconds on my M1 Pro.

    $ time cargo run --release
        Finished `release` profile [optimized] target(s) in 0.02s
         Running `target/release/p45`
    0
    1
    40755
    1533776805
    57722156241751
    2172315626468283465
    cargo run --release  2.95s user 0.04s system 98% cpu 3.029 total
Runs on the Rust Playground too: https://play.rust-lang.org/?version=stable&mode=release&edit...

wenderen · 4 months ago
Neat! I translated my code to Rust line-for-line and the iterator approach significantly outperforms it.

Rust newbie q - why use `x.wrapping_sub()` instead of regular old `x - 1`? Seems like we're never going to underflow `usize` for any of the 3 formulae?

wenderen commented on Solving Project Euler: Problem 45   loriculus.org/blog/euler-... · Posted by u/wenderen
moi2388 · 4 months ago
The mask hides the whole sentence except the answer. Lol.
wenderen · 4 months ago
To help debug - which browser are you using and on which OS?
wenderen commented on I hate screenshots of text   parkscomputing.com/page/i... · Posted by u/paulmooreparks
wenderen · 4 months ago
This article is a specific case of a more general piece of advice: ask questions well (provide context like clickable links, trim down your query to the minimal reproducible case, pose high-precision questions, etc.).
wenderen commented on Gmail AI gets more intrusive   daveverse.org/2025/11/07/... · Posted by u/speckx
glerk · 4 months ago
Google must have some awful PMs and designers. The worst UX decision I have seen recently is AI auto-dubbing all youtube videos by default with no way to disable this behavior globally. How could you miss that people can be fluent in multiple languages and if I click on a video in a foreign language, I most likely want the original soundtrack? Clearly, the intention was to boost some metric “X users are using this feature” with no regard for the actual user.
wenderen · 4 months ago
In addition to the feature being auto-on (for me, at least) and unasked-for, you also need to perform multiple clicks through non-obvious menus (I think one of them was "Audio track"?) to get to the original audio. Another layer of obnoxiousness.
wenderen commented on Everything Else   newleftreview.org/sidecar... · Posted by u/speckx
Noumenon72 · 8 months ago
When I got to "There are hells on earth and Dubai is one" I scrolled back, thinking I had missed where they described that. Either it was left out of this book excerpt or the author has a prior revulsion at people being employed for tourism that makes their examples seem self-evidently awful to them only.
wenderen · 8 months ago
> I scrolled back, thinking I had missed where they described that

The explanation of that phrase is in... the very next three sentences.

wenderen commented on Surnames from nicknames nobody has any more   blog.plover.com/lang/etym... · Posted by u/JNRowe
wenderen · a year ago
Lawrence => Law => Lawson
wenderen commented on Advent of Code 2024   adventofcode.com/2024/abo... · Posted by u/thinkingemote
criddell · a year ago
> You don't need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far.

The use of “pretty far” gives them a bit of an out, but I think this statement is a little disingenuous. Last year, at least, a bunch of the problems needed fairly sophisticated algorithms to find the solution in a reasonable amount of time.

To me, a little programming knowledge is what somebody who is six weeks into their introduction to programming class has. They know variables, loops, lists, and maybe associative arrays.

wenderen · a year ago
Anecdote to support your comment: The Chinese Remainder Theorem has featured in Advent of Code at least twice IIRC. Not an algorithm the average programmer (average is a very fuzzy term, yeah) would know.

Deleted Comment

u/wenderen

KarmaCake day575June 7, 2013View Original