Nonzero Chance
Development Blog
Latest Autodidactic Project
So my latest autodidactic project is a food tracker in the style of Livestrong’s MyPlate. I'm encouraged to learn to query an API so this one talks to the USDA's FoodData Central API. I spent most of…
Python 2’s apply() Absent in Python 3
They took out apply() in Python 3 and I'm a little put out. It used to accept a callable as argument 1, [optionally] an argument list as argument 2, and [optionally] an argument dict as argument 3. It'd…
Proper Password Management
I’m using the Python module bcrypt to encrypt passwords. That’s a wrapper around a C library that implements the OpenBSD Blowfish algorithm. It follows the UNIX convention for passwords: they’re…
RESTful API Pointer
I learned by chance that when you have a site that's just REST API endpoints, what you do with the / url, is to output in json a list of all the endpoints on the site. I did one better and added…
Third Project Nearing Wrap-Up
And… done. Just got the last REST endpoint taken care of. Still using the higher-order-function/closure frequently. The code is hard on the eyes, frankly. I don't author a higher-order function…
Limitations of Closures
I've come to the end of the code I can write with higher-order functions and closures. There's four endpoint suites that I’ve handled with them; each serves objects out of its table, lists associations…
Closures and Higher-Order Functions to Reduce Code Reuse
I’m using the same solution to reduce code reuse that I did on the previous course project, since they’re both RESTful APIs. Since it’s all being done in a functional paradigm, I started using higher…
Does DRY Apply to Tests?
I don't know if this is a good thing: I can copy & paste my tests for another endpoint in this app and globally replace a few variable names and class names. Then I run the tests, they all just pass…
ChatGPT: of Questionable Utility
ChatGPT is so confident as it types out buggy, worthless code for me and eagerly explains how it's supposed to work. I'm not worried about AI taking programmers' jobs anytime soon. I've cranked out…
A Circular Import of All Things
While working with Django for the first time, I got an inexplicable error. I couldn’t solve it until I used the python debugger to step through the offending program, and got a clue that I'd made…