Hacker Newsnew | past | comments | ask | show | jobs | submit | clashmeifyoucan's commentslogin

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.


I ordered a pack of 100 off amazon, and I have them everywhere -- desk, laptop back, suitcase, car, bookshelf, etc...


Realistically, I wash my t-shirt much more often than any microfiber cloth...


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.

[1] https://github.com/SwagLyrics/SwagLyrics-For-Spotify

[2] https://github.com/johnwmillr/LyricsGenius

[3] https://github.com/SwagLyrics/SwSpotify


it appears the author has changed the link, so this is deadlinked now.


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

[0]: https://news.ycombinator.com/item?id=24815649


not OP but the two features of fish that stood out for me so much that I make it my default shell on remote servers are

1) the autocomplete suggestion as you type a command [1]

2) scrolling thru commands after partially writing one only shows entries that match the written text

3) knowing if a command will work before pressing enter -- saves from a lot of gotchas.

all of these read like features nice to have but not essential, but when you're using something every day, it's worth it :)

[1]: https://fishshell.com/docs/current/tutorial.html#autosuggest...


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¹)

[1] https://internetfreedom.in/why-is-porn-being-blocked-in-indi...


thanks for making this! The undo from insert mode¹ one sold it for me :)

[1] https://vimtricks.com/p/undo-from-insert-mode/


Um. I think that's wrong, though. Pressing c-u just erases to the beginning of the line in insert mode, it's not an undo.


Ah, I guess should've tried before saying. Just excited there's a way.


Oh, I was excited too:) So excited that I immediately tried it...


Updated the post, thanks!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: