October 4th, 2018
Cool Python Data Structures
In my time spent researching Python this week I stumbled across some really interesting data structures. Python has a vast standard library, with many data structures that specialize in certain tasks. It reminds me of Java’s standard library, except that Python data structures either have their own literal syntax or a built-in function for construction! This discovery post looks at three data structures that I found especially interesting.
Tuples are a commonly used data structure in Python. They hold immutable records, and are often used as immutable lists. One thing I didn't know is that tuples support 'tuple unpacking', which spreads their contents across multiple variables.
December 14th, 2018
Features of Python Classes
In this discovery post, I'm exploring some interesting features of Python classes. Python fully supports the object oriented paradigm, and I wrote about object oriented features such as the data model in past articles. Learning all the object oriented features of a language assists in creating APIs. Hopefully this knowledge helps me create better Python objects.
September 24th, 2018
Python's Data Model
This summer I started a trend of picking a different programming language each season to explore. The language of the summer was Groovy, which was selected because I used Groovy at work. For the fall I’ve decided to deep dive into Python. Python was the first language I learned, beginning with CS101 my freshman year of college.
Python is well documented as a beginner friendly language. It is taught at most colleges to introduce programming. The ease of learning Python does come at a price. Very few master the language since they feel there is no need to1. The goal of dissecting Python this fall is to truly understand everything the core language has to offer. To begin, I will explore Python’s data model.
November 1st, 2020
Concurrency and Parallelism Concepts Translated into Python
Parallelism, multithreading, multi-process programming, and asynchronous programming; Concepts dealing with concurrency are often the most difficult to learn when learning a new programming language. There are often many different approaches available and it’s hard to know the best approach (look no further than Java: Concurrency in Practice, a 350 page book on writing proper concurrency code in Java). Python is no different, with multiple evolving libraries, and, for added confusion, a global interpreter lock (GIL) which restricts Python code to a single thread when running on its default CPython interpreter. In this article, I attempt to demystify concurrent programming in Python and work with libraries such as
December 15th, 2018
From Protocols to ABCs in Python
Python provides many different techniques for declaring interfaces. Some are informal such as protocols, while some are strict such as ABCs. The lack of an
interface keyword makes learning all the different techniques a bit more difficult. This discovery post explores different options for creating interfaces in Python.
October 28th, 2019
Unit Testing AWS Infrastructure with Python
From October 2018 to May 2019, I moved the infrastructure for both my websites to AWS. The process for building and tearing down this infrastructure is automated with IaC, specifically Terraform. I've had a lot of fun working with Terraform and learning the different design patterns for infrastructure in the cloud.
After my infrastructure was built, I realized I needed a way to test that my IaC was behaving as expected. The obvious solution to this requirement was a unit test suite. I implemented this unit test suite in Python with the help of the AWS SDK. This article explains why I took the time to write unit tests and walks through of the basics of testing AWS infrastructure in Python.
March 31st, 2020
Interesting Aspects of Numpy
In my new role at work, a good chunk of my programming is Python based and revolves around data analysis. I already knew Python, however I wanted a review libraries such as numpy and learn libraries such as pandas and matplotlib. This article discusses numpy, short for "Numerical Python". The goal of this article isn't to teach numpy to beginners, instead focusing on library aspects I found most interesting.
April 19th, 2020
Interesting Aspects of Pandas
In my previous article I walked through interesting aspects of numpy. I first learned numpy back in college during a course on Artificial Intelligence. With my daytime work becoming more Python based these past few months, I took numpy back up.
Before this winter, I never used pandas. Pandas is a data analysis library similar to numpy. In fact, pandas uses numpy arrays in many of its exposed methods. While numpy exposes an array data structure, pandas has two main data structures:
DataFrame. In general, pandas is commonly used for manipulating and analysing time series or table data (think SQL table or excel spreadsheet)1.
November 25th, 2017
The following code uses generators to create a fibonacci sequence.
December 22nd, 2018
How Languages Enforce Multiple Inheritance
I recently read a book discussing multiple inheritance in Python. Python is one of the few object oriented languages that permits multiple inheritance of classes. Many other languages include workarounds for multiple inheritance. For example, Java allows for classes to implement multiple interfaces. On the other hand, PHP allows for classes to use multiple traits. This article looks at programming languages I use and how they enforce multiple inheritance or available workarounds.
November 14th, 2017
Sorting Lists with Comparison Functions
January 24th, 2018
First Look at RabbitMQ
Recently I looked at RabbitMQ, a message broker used to communicate between different parts of an application. An analogy I really liked is that RabbitMQ puts a post office in an application, where producers put messages in a post office box, which are then routed to consumers1.