a textbook example of an algorithm that works very well with union-find is the kruskal's algorithm to find the minimum weight spanning tree given a graph. Using union-find improves the time complexity of the algorithm from O(V²) to O(ElogV).
This happens because kruskal's algorithm essentially selects the cheapest edge not already included in our spanning tree that won't cause a cycle. So union-find is able to speed up this potential cycle check which would otherwise be naively quadratic.
My opticians have always given me a microfiber whenever I got a set of glasses made, and last time I went I asked for a spare as well. Now I have the habit of having one in my pocket at all times so I don't have to devolve back to using the bottom of my tshirt.
Yeah, but the fabric of my shirt seemed noticeably worse at cleaning my glasses, so I stopped using that completely. Having a microfiber on hand at all times is very helpful for that
I swear by Paste as well, since coming from Windows, it mimics the Windows clipboard ui and hence was easy to get used to. I do wish that macOS at some point makes a native clipboard manager.
this, I wanted to make a little utility for getting lyrics for whatever song is currently playing on spotify[1] and ran into the issue for getting the song name without using the API since that's just inconvenient for the end user. The most popular such project does go that way though.[2]
I ended up writing a small library that does that locally cross-platform by using the metadata from the app.[3] The approach is probably not as robust as the API, but much faster and works well.
one thing that caught my eye was the convert comments to code feature. If you can use your voice to dictate comments then combined with copilot it might just be possible to write code without touching the keyboard at all!
of course I guess copilot won't be perfectly accurate right now or even maybe for a long time but it is interesting to imagine a future where the programmer can think and get code written without lifting a finger.
Another nice resource for understanding zk snarks that I found easily digestible was this paper that was shared on hn a few months ago[0]. https://arxiv.org/abs/1906.07221
Incidentally, it's weird to me how we lack internet laws in a lot of aspects yet have strong IT laws when it comes to blocking and censoring websites when needed (eg. porn¹)
This happens because kruskal's algorithm essentially selects the cheapest edge not already included in our spanning tree that won't cause a cycle. So union-find is able to speed up this potential cycle check which would otherwise be naively quadratic.