DIY Factories with Pytest

Pytest’s fixtures are a pretty convenient route to dependency injection throughout your tests. They’re flexible, too, and involve very little “magic.” This means they’re easy to learn, understand, and use correctly. The Pytest documentation explains that a fixture can pass back anything to the caller, including a function. This allows you to essentially create parameterized […]

Turning Asynchronous Networking Inside-Out

Developing asynchronous networking applications is an interesting problem with unique challenges and no shortage of solutions for, particularly in Python. But the way you’ve traditionally had to write your code to make it work well could leave you with a codebase that, while solid, could be challenging to read or follow. I’ll take you through […]

Using the Command Pattern to Write More Testable Python

Often times, when writing Python, I run into a situation that requires me to write a simple validation function. def check_validity(item): return item.value_to_check > 0def check_validity(item): return item.value_to_check > 0 This function is easy to test, and it’s clear what it’s supposed to be doing. But as so often happens, I may need to validate […]

Writing Functional Python

Functional programming has a lot of advantages that have been enumerated over the years. Being a bit of a Pythonista, myself, I can’t help but introduce functional concepts into my Python code. Though Python is not a functional language, it doesn’t mean that your Python code can’t benefit from some of these concepts. Perhaps one […]

Testing In-House iOS Apps with a Simple Python Web Server

There’re a couple of ways to distribute iOS apps. Everyone knows about the App Store, but the more obscure modes of internal distribution are less common and more opaque. For instance, if you’re experimenting with Enterprise in-house distribution, you’re likely using some sort of mobile device management software. But what if you are a developer […]

Novel Image Compression Using Bit Plane Slicing

This semester I’m enrolled in a Visual Computing class at Oakland University. The class is centered around the theory of digital image processing, however I was craving some implementation. During our lecture on bit plane slicing, I became intrigued with its application to image compression and was curious about what sort of performance it could […]