Here's another blog post on this theme! https://github.com/kach/art-deco/blob/main/art-deco.ipynb
HN user
hardmath123
Re: Low FPS webcam - here's an approach that attempts to analyze coin tossing data from the _sound_ rather than the _video_, since sound is typically recorded at a much higher sampling rate (high enough to "hear" the spinning of the coin). https://cs.stanford.edu/~kach/can-one-hear-the-fate-of-a-coi...
Relatedly: The Second Eigenvector of the Google Matrix
A lot of replies here are missing the key idea behind Penrose: that the "substance" and "style" of any mathematical diagram are separable. For example, the "substance" of a diagram might be a collection of sets with known subset relationships:
Set A, B, C
IsSubset(B, A)
IsSubset(C, A)
That same substance can then be rendered in many different styles, e.g. as a Venn diagram or as a tree diagram (substance vs. style is a lot like HTML vs. CSS). Importantly, Penrose's vision is that experts will author libraries of domains and styles, and end-users need only express the substance of their diagrams (i.e. the three lines of code above).
The second beautiful idea in Penrose is that diagram generation is expressed as a constrained optimization problem. This lets you easily experiment with layouts by writing constraints and sampling a variety of potential diagrams via stochastic search.
These two ideas set Penrose apart from most other diagram software out there. I really hope it gains wider adoption. Give it a try!
I was inspired by this Rest of World post https://restofworld.org/2022/wordle-viral-turkish-japanese-t... to make a Hindi-language "Wordle" https://kach.github.io/shabdle/ just for fun. It was a little tricky figuring out how to adapt the game for Hindi's script, but I'm quite happy with my solution of using U+25CC ("dotted circle") to mark missing consonants.
Indeed, you can "learn" (by gradient descent) new parameters to this algorithm, to generate fractals in any target shape that you want! https://hardmath123.github.io/chaos-game-fractal-foliage.htm...
This reminds me of a small experiment I did with a friend, where we asked different people to independently write the HTML and CSS for a website (without communicating), and then put the HTML and CSS files together to see how well they worked. https://kach.github.io/generative-adversarial-web-developmen...
You might also like this little book, "Computational Cooking," which is also, in a way, a meditation on the language of recipes. http://diyhpl.us/~bryan/papers2/CompCook.html
If you liked this, you might enjoy this little trick you can do with moiré patterns -- near the end of the post, I talk a little bit about the math behind the FFT connection. https://hardmath123.github.io/moire.html
I don't know about "practical," but you might enjoy this: https://github.com/kach/recreational-rosette
See also: "Words that do Handstands" (2019), where similar tricks are used to hallucinate an ambigram font!
You might also like the nearley playground, which lets you write a grammar in BNF and see all possible parsings of an input. You can even press a button and generate a random string that matches your grammar! https://omrelli.ug/nearley-playground/
See also, a post from mid-2020 that does something similar with a "softened" Life: http://hardmath123.github.io/conways-gradient.html
Similar post from mid-2020, using PyTorch instead of JAX, and using a "continuous" (gradient-based) hill-climbing: http://hardmath123.github.io/conways-gradient.html
And the HN discussion from the time: https://news.ycombinator.com/item?id=23095190
Relatedly: Can one hear the fate of a coin? https://cs.stanford.edu/~kach/can-one-hear-the-fate-of-a-coi...
Parsers in nearley.js [1] are written in a very readable EBNF-like DSL; then they get desugared down to a JS file that's a lot like your snippet.
You might like Frink! https://frinklang.org
See also: using differentiable approximations of cellular automata in PyTorch to reverse Conway's Game of Life; in some cases, you can get striking Turing patterns similar to what's described in this paper! http://hardmath123.github.io/conways-gradient.html
How cool! I was on the fence about whether or not to put up the source code— I'm _glad_ I did!
Do you have a recommendation for a good reference that teaches about the various metrics for point-cloud distance? (I only used Chamfer distance because I hazily recalled it from some undergrad class taken a while ago...)
Thank you! That means a lot to me. :)
See also: this short piece about detecting bias in coin tosses by listening to the “ping” they make when tossed. https://cs.stanford.edu/~kach/can-one-hear-the-fate-of-a-coi...
Here’s a plug for the “nearley playground,” which is a great way to interactively build/debug BNF grammars.
Actually, he’d be very unlikely, even with the imagined high tech that I gave him, to be able to control whether the coin came down heads or tails—especially if you provide the coin.
It's funny, Dennett talks about a "coin tossing machine" as a virtual impossibility, but Persi Diaconis actually had one built! It is described in this paper: https://statweb.stanford.edu/~susan/papers/headswithJ.pdf
Physicists have calculated that if you really want to predict coin flips, you have to know the location of every electron in the visible universe and its gravitational effect on the coin.
This is not really true either. Coin tosses leak a lot of information into the physical world. For example, here is a short paper on trying to predict the outcome of a coin toss by analyzing the sound of the "ping!" it makes: https://cs.stanford.edu/~kach/can-one-hear-the-fate-of-a-coi...
A gem in the EFF's letter (https://github.com/github/dmca/blob/master/2020/11/2020-11-1...)
To borrow an analogy from literature, travelers come upon a door that has writing in a foreign language. When translated, the writing says "say 'friend' and enter." The travelers say "friend" and the door opens. As with the writing on that door, YouTube presents instructions on accessing video streams to everyone who comes asking for it.
"un-" is indeed a funny prefix. You might enjoy (or be frustrated by) this analysis… https://hardmath123.github.io/un-unravelable.html
NetNewsWire is wonderful! Brent Simmons is writing it for love (https://inessential.com/2015/06/30/love) and it really shows.
https://ranchero.com/netnewswire/
Here is their "How to Support NNW" page. https://github.com/Ranchero-Software/NetNewsWire/blob/main/T...
[Author here - pleasantly surprised to see this on the front page! :)]
As children, we do not understand that the things we love do not belong only to us. Then, I was not prepared to relinquish music to anyone else’s ownership. Now, I have finally loosened my grip.
Re: Earley being forgotten, I've been working on the "nearley" Earley parsing library for JS for many years now and it now has a very solid user-base (200+ dependents on npm). It's probably not the fastest a JS-based parsing library could be, but it's certainly no longer forgotten! Here's a small sample of some of the amazingly varied projects using Earley parsing (via nearley) today… https://nearley.js.org/#projects-using-nearley
See Denend's thesis, around pg. 44
https://repositories.lib.utexas.edu/bitstream/handle/2152/74...