585 karma · joined November 4, 2019
https://jeffhuang.com/
https://gomakethings.com/the-web-is-not-dying/
https://archivebox.io/
https://webmasters.stackexchange.com/questions/25315/hotlinking-what-is-it-and-why-shouldnt-people-do-it
https://goaccess.io/
https://victorzhou.com/blog/minify-svgs/
https://evilmartians.com/chronicles/images-done-right-web-graphics-good-to-the-last-byte-optimization-techniques
https://caniuse.com/#feat=webp
https://uptimerobot.com/
http://www.pgbovine.net/python-tutor-ten-years.htm
http://jeffhuang.com/designed_to_last/
How many of these will still be alive in 10 years? How many times do you have to fix your page to make your page "last"?I guess I was hoping there would be some HNer with specific expertise who can talk about how these tricks are applied in graphics. For example there was some buzz a few years back on how a company managed to trick the brain into seeing the color black in AR (which shouldn't be physically possible without blocking light).
For example, perspective illusions can be used to trick drivers into slowing down: https://www.insider.com/optical-illusions-3d-crosswalk-drivi... or crashing: https://imgur.com/a/kYr94
But I rarely see any of the crazier optical illusion effects used. Maybe these don't affect the population in a consistent enough way to use as a feature? (based on how white/gold and black/blue split the internet)
But I didn't retain much since it wasn't good for building intuition (informal proofs were better for that) and a lot of the corner cases it fixed didn't matter for the real world.
The language of measure theory makes a lot of proofs much shorter and easier to remember though. For example, markov's inequality: https://en.wikipedia.org/wiki/Markov%27s_inequality#In_the_l...
https://probablydance.com/2018/05/28/a-new-fast-hash-table-i...
HN submission with related comments: https://news.ycombinator.com/item?id=17177798
Most programming tasks work with static datasets because memory is volatile. We are always loading the data from somewhere else and usually just once because reactively updating the in-memory collection is nontrivial to hook up. On the other hand, this is the default for databases.
Specifically having half the senior engineers quit because they are now rich while some others become "underleveled" due to stock price falling 50%.
Given two numbers, r1 and r2, if you know their arithmetic mean:
m = (r1 + r2) / 2
and geometric mean: g = sqrt(r1 * r2)
then following Loh's derivation you get a very cute formula: r1 = m - sqrt(m^2 - g^2)
r2 = m + sqrt(m^2 - g^2)
Vieta gives an easy way of finding those means from a quadratic equation: r1+r2=-b and r1*r2=c. So you can plug in m=-b/2 and g=sqrt(c) in the equation above.The fact that you can state roots in terms of their means is the more novel insight to me. (note: Loh doesn't talk about geometric means but I thought using just product of the roots isn't as "symmetric")
If you're a memorizer, your code might as well be obfuscated code:
def quadratic_formula(a, b, c):
return [
(-b - math.sqrt(b ** 2 - 4 * a * c)) / (2 * a),
(-b + math.sqrt(b ** 2 - 4 * a * c)) / (2 * a)
]
If you understand the importance of the expression under the square root (i.e. the sign of the discriminant) you can rename one subexpression: def quadratic_formula(a, b, c):
discriminant = b ** 2 - 4 * a * c
return [
(-b - math.sqrt(discriminant)) / (2 * a),
(-b + math.sqrt(discriminant)) / (2 * a)
]
Of course you can refactor it further with pointless stuff like denom = 2a, but that doesn't add much semantic value. So the above is more or less the vocabulary we have about quadratic equations today.Loh's contribution is a specific way of refactoring the code by first dividing by a:
def quadratic_formula(a, b, c):
b = b / a
c = c / a
discriminant = b ** 2 - 4 * c
return [
-b / 2 - math.sqrt(discriminant) / 2,
-b / 2 + math.sqrt(discriminant) / 2
]
Which then unlocks the ability to talk about the subexpressions in relation to the roots (a la Vieta's formula): def quadratic_formula(a, b, c):
b = b / a
c = c / a
sumOfRoots = -b
productOfRoots = c
averageRoot = sumOfRoots / 2
# Want roots [averageRoot - delta, averageRoot + delta]
# such that:
# productOfRoots == (averageRoot - delta) * (averageRoot + delta)
# == averageRoot ** 2 - delta ** 2
delta = math.sqrt(averageRoot ** 2 - productOfRoots)
return [
averageRoot - delta,
averageRoot + delta
]
Your code is no longer using single-letter variable names!But representation matters. A good chunk of mathematics is just about rewriting the same mathematical fact in a different way. For example the equation of a line could be written with coefficients or in slope/intercept form or in polar coordinates or in homogeneous coordinates or etc etc.
Here the claim is that explicitly giving a name to the variable -b/2 makes the equation easier to think about. I see nothing wrong with that.
tl;dr; the mouse is nesting
The same process still works if you want to calculate the decimals though. Just pretend you're doing (1000000/7) * (1/1000000) or however many digits you want.
I can see it being a bit more complex if you need to track how nodes move across different parents. But it seems like react doesn't handle this: https://github.com/facebook/react/issues/3965#
This guy finished in the top 10 last year and streamed(not live) his solutions so you can see how fast you need to be to be competitive: https://www.youtube.com/watch?v=Hgv6d6rrQxo&list=PLZhotmgEsC...
The really good deals (along comments about caveats that aren't apparent from specs) will usually show up on https://www.reddit.com/r/buildapcsales or https://www.reddit.com/r/buildapc
f(f(f(y))) = 3f(y)
so f(3y) = 3f(y)
This suggests a linear solution but then you get f(x)=sqrt(3)x which doesn't work since it's N -> N.https://codepen.io/search/pens?q=animation
https://dribbble.com/shots/popular/animation
For webgl there's:
https://www.shadertoy.com/results?query=&sort=popular&filter...
https://experiments.withgoogle.com/search?q=WebGL
And for codegolfing, there's https://www.dwitter.net/top/all which restricts you to 140 characters or less.
If you mean the flash-animation community, I also wonder where they disappeared off to. I felt like they peaked in the mid 2000s. Now you just made me remember some newgrounds movies that I am going binge watch for nostalgia now: "There she is!!"(2003) https://www.youtube.com/watch?v=WsWgrf3XLKQ
And if you ignore operations, many datatypes reduce down to very simple mathematical objects. For example even though set and priority queues are very different in code, they both only need membership (R_mem) to fully specify because you can rebuild a priority queue knowing just the members. To specify a list/queue/stack, you only need to additionally know ordering (they denote this relationship as R_ob for "occurs before").
The advantage of converting a datatype (bijectively) to this relational domain is that you can essentially do "state-based" merging. You only need to define: how to convert to the relational domain, how to merge within that domain (which is still rich enough for you to specify relational invariants you need preserved), and how to convert back to the concrete datatype. Contrast this with operation-based syncing, where you would need a quadratic explosion of definitions for how any two operations should merge together. Here you don't even need to handle any particular operation individually (e.g., if it works for push_front, you will likely get push_back for free). Essentially it is saying the semantics of an operation is captured by the delta caused to the characteristic relations of the datatype.
For example there is a paper by Martin Odersky himself on incremental computations on lists (which should be very familiar to you due to your work on Xi's ropes): https://link.springer.com/chapter/10.1007/978-3-642-39038-8_...
[1] https://en.wikipedia.org/wiki/Persistent_data_structure#Fat_...
These parallel programming course notes have an example of using z-order curves which is slightly better yet: http://ppc.cs.aalto.fi/ch2/v7/
And the best solution requires something like Halide https://halide-lang.org/ to find the best traversal order.