...

dahart

18621

Karma

2011-10-19

Created

Recent Activity

  • > codegen changes the cost structure of writing code, not the cost structure of knowing what to write.

    Yes, and knowing what to write has always been the more important challenge, long before AI. But - one thing I’ve noticed is that in some cases, LLMs can help me try out and iterate on more concepts and design ideas than I was doing before. I can try out the thing I thought was going to work and then see the downsides I didn’t anticipate, and then fix it or tear it down and try something else. That was always possible, but when using LLMs this cycle feels much easier and like it’s happening much faster and going through more rough draft iterations than what I used to do. I’m trying more ideas than I would have otherwise, and it feels like it’s leading in many cases to a stronger foundation on which to take the draft through review to production. It’s far more reviewing and testing than before, but I guess in short, there might be an important component of the speed of writing code that feeds into figuring out what to write; yes we should absolutely focus entirely on priorities, requirements, and quality, but we also shouldn’t underestimate the impact that iteration speed can have on those goals.

  • This got me through many of the first 100 problems on Project Euler:

        n = 1000000 # must be even
        sieve = [True] * (n/2)
        for i in range(3,int(n**0.5)+1,2):
            if sieve[i/2]: sieve[i*i/2::i] = [False] * ((n-i*i-1)/(2*i)+1)
        …
        # x is prime if x%2 and sieve[x/2]
    
    Edit: I guess I irked someone. :/ Yes this is a memory hog, but to me beautiful because it’s so tiny and simple. I never tried very hard, but I wonder if it could be made a real one-liner.

  • The Pseudosquares Sieve will drop the memory requirements much further from sqrt(n) to log^2(n). https://link.springer.com/chapter/10.1007/11792086_15

  • I hope it helps, Bézier curves are so simple and fun.

    I found a picture of the ‘lerp tree’ that might help even more: https://www.researchgate.net/figure/De-Casteljau-algorithm-t...

    The cool part about this is that you can see the control points of the two split curves in this diagram. The original control points are the bottom edge of the triangle. The left split is the left edge of the triangle, and the right split is the right edge of the triangle.

  • Here’s an interactive picture of how the splitting with lerps works: https://pomax.github.io/bezierinfo/#splitting

    Did you ever doodle parabolas on graph paper by drawing straight lines? That’s one way to see why you can form nonlinear curves using only lerps. (For example https://mathcraft.wonderhowto.com/how-to/create-parabolic-cu...)

    Your thought is correct - this does (in a sense) move along the curve to produce new control points, and the subset does match the curve exactly. And the new control points are non-linear too! (The inner ones, anyway.) Pay attention to how the new control points are chosen - to split you take one control point from each level of the lerp tree.

HackerNews