Binary search isn't about search II. Loop invariant of leftmost element search

In the first “Binary search isn’t about search” post, we spoke about using assert statements to enforce your loop invariants. Our plain old everyday binary search invariant can be summarized as such: For all x in L[0:l]1, x is strictly less than T, the element we are searching for. For all y in L[r:len(L)]2, y is strictly greater than T, the element we are searching for. Or, if we want to be even terser, we could note this as simply...

March 8, 2025

PHP and Web Dev Phobia

PHP is, for better and for worse, the Python of web dev in my eyes. It is exceptionally easy to get started, in a way which I think younger developers may not be fully aware of. So here I’d like to make them aware of it! That’s right, this is a Slowstart for people who have never touched PHP or web dev before. Start the way we usually do on this blog, with the “tutorial-in-a-box” by installing Vagrant and Virtualbox so you can create a disposable virtual machine with just a few commands....

September 3, 2024