Nonzero Chance

Development Blog

Latest Autodidactic Project
Kerne Fahey Kerne Fahey

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…

Read More
Python 2’s apply() Absent in Python 3
Kerne Fahey Kerne Fahey

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…

Read More
Proper Password Management
Kerne Fahey Kerne Fahey

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…

Read More
RESTful API Pointer
Kerne Fahey Kerne Fahey

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…

Read More
Third Project Nearing Wrap-Up
Kerne Fahey Kerne Fahey

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…

Read More
Limitations of Closures
Kerne Fahey Kerne Fahey

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…

Read More
Does DRY Apply to Tests?
Kerne Fahey Kerne Fahey

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…

Read More
ChatGPT: of Questionable Utility
Kerne Fahey Kerne Fahey

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…

Read More
A Circular Import of All Things
Kerne Fahey Kerne Fahey

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…

Read More