RSSAmplifier

Blog

Nicolas Hahn

nicolas-hahn.comRSS feed ↗5 posts

Latest posts

Why doesn't Rust's BTreeMap have a with_capacity() method?

Disclaimer: I discovered a previous explanation here but I found it a little confusing, so I’m hoping mine is easier to follow. Rust’s HashMap (and HashSet and Vec ) collections both offer an initialization method fn with_capacity(capacity: usize) that allocates enough memory up front to hold capacity elements. Why don’t BTreeMap (and BTreeSet ) also have this method? The answer lies in the…

One Program Written in Python, Go, and Rust

Update (2019-07-04): Some kind folks have suggested changes on the implementations to make them more idiomatic, so the code here may differ from what’s currently in the repos. This is a subjective, primarily developer-ergonomics-based comparison of the three languages from the perspective of a Python developer, but you can skip the prose and go to the code samples , the performance comparison if…

SET Card Game Solver with OpenCV and Python

Sets are indicated by cards that have the same outline color. SET was a game I used to play with my family years ago, and I was reintroduced to it recently while attending the Recurse Center . I was looking for an excuse to play with OpenCV, and teaching a computer to play SET seemed like a good choice. A quick primer on SET: each card has four attributes: shape, color, number, and fill, each of…

Four weeks at the Recurse Center

I just finished my fourth of twelve weeks at the Recurse Center . I’m a third of the way done - time has been moving far too quickly. Still, I feel like I’ve learned more in this time than the full year prior. I’ve learned that in order to effectively learn a new subject, I need both a concrete project in mind, and a reason for learning that is connected to one of my core axioms. Many times I’d…

Recurse Center TODO List

Less than a week to go until my batch at the Recurse Center starts. I’ve spent a good amount of time coming up with things to work on - for fun, profit, and hopefully a bit more direction on where I want to take this whole “programming as a vocation” thing. The last few weeks I’ve spent traveling, relaxing, taking care of things I’ve been putting off, but all the while jotting down various ideas…