Random dice game - sims and DP solution

TL;DR: I saw a random dice game on social media with no satisfying solutions in the comments, so I played around with it using simulation to test my intuition and then worked out the optimal strategy using dynamic programming. The game The game has $n$ rounds. You start with $0$ dollars and a 20 sided die (d20) showing the number $1$. Each round, you can take money equal to the number shown, or reroll.
Read more

Advent of Code 2024 Notes

TL;DR - Misc notes from the 2024 Advent of Code in Python and Ocaml and a little bit of Golang. The repo with my solutions to the Advent of Code 2024 problems can be found here. This is a bunch of random notes from this year’s event, no full write-ups or anything for now just general notes and take-aways. Languages Learned a bunch of Ocaml (even though I didn’t use it everyday as intended)
Read more

Simple tail recursion examples

TL;DR: re-write the recursive function so that the 1st call doesn’t need to wait for the result from the remaining calls, all the way down to the base case, before returning. Recursive functions continue calling themselves until the base case is hit - and then they return. The continued calls keep pushing frames onto the stack and can lead to a stack overflow for large inputs. Some languages include an optimization that cleans this up, provided that the function is written in a way that it doesn’t need to wait for the results for all the other recursive calls to resolve to return.
Read more

Adding Basic OAuth Flow to a MPA

TL;DR - For newdepths.xyz I wanted to add a simpler way for users to log in, in that way they can avoid creating a new password just for this little site. I also wanted to implement all the parts of the flow to get a good feel for them and how they fit together. Of course there are a lot of libraries that handle this well, but I think that doing it manually with low stakes is a great way to learn how everything fits together.
Read more

Podcast Notes and Key Takeaways

TL;DR- just notes and takeaways from recent podcast episodes. They’ll mostly be about product development, software engineering, or other tech stuff (GIS related probably). Podcasts Takeaways and notes from recent podcasts I’ve listened to - I’m finding that taking actual notes is helping me retain info and more actively listen lately - and I figured why not share publicly in case it gets someone else interested in listening to (or not) the episode.
Read more