The story of Kubernetes , the leading container orchestration platform, is a tale of mathematical innovation, wartime necessity, and the open-source revolution. It begins, perhaps unexpectedly, with the work of Omar Khayyam , the 11th-century Persian polymath known for his contributions to mathematics, astronomy, and poetry. Khayyam's work on solving cubic equations …
Two words that strike fear in the heart of every software developer: "release process". Whether deploying a new version of a billion-person social network or a tiny little open source library, release processes are often manual, complicated, and easy to mess up. Much has been said on the "new version …
When writing a pyproject.toml file, the project section is optional. However, if it does exist, two of its properties are required : name version If these two properties are not there, the section will be ignored. This is a lie. But it is not a big lie: it is almost …
Now that travel is more realistic, I have started to optimize how well I can work on the go. I want to be able to carry as few things as possible, and have the best set-up possible. Charging The "center" of the mobile set-up is my Anker Power Bank . It …
Popular products often have a "Getting Started" tutorial in order to guide you in using them for the first timees. Those guides are easy to follow, pleasant to use, and lead you do make bad design choices. Follow the "Getting Started" guide to get a feel for the product. Then …
One of my favorite Podcasts, Podcast.__init__ , always makes sure to ask one question towards the end of every episode: when should you not use the tool or technique introduced in this episode? This is a great question. When people have a poor answer I assume that the tool is …
Originally published on Enable Architect . Modern computer systems supply business-critical services everywhere -- from Amazon providing shopping services to Healthcare.gov providing enrollment in health insurance plan. We all rely on such systems. But, unfortunately, these systems are complex and can fail in surprising ways. By now, it is a well-understood …
This article was originally published on Enable Architect Many people have had the insight that DevOps is about people. Often, they will summarize it as "DevOps is about empathy". I have found, however, that idealizing empathy is just as bad as thinking that DevOps is about a single technology. I …
With in-person conferences starting to open up, I need to clear the dust off of some skills that have not been used in a while. One of those is how to pack for travel. This list works for me. It will probably not work for you as-is. Among other things …
Sometimes you will be working on hairy and complicated feature in a shared repository. Maybe it's for work. Maybe it's an open source project. As a responsible person, you are working on a branch. The usual way of working involves a lot of "intermediate" check-ins. Those serve, if nothing else …
It is possible to work with Python quite a bit and not be aware of some of the subtler details of package management. Since Python is a popular “glue” language, one of its core strengths is integrating with libraries written in other languages: from database drivers written in C, numerical …
A story about looking for a universe, and finding a pi(e) This is fine. You need not feel shame. Many want to create a universe. But it is good you are being careful. A universe with sentient beings is a big moral responsibility. It is good to start with …
Many people have written about the logistical challenges of food in a conference. You trade off not just, as Chris points out, expensive food versus terrible food, but also the challenges of serving the food to everyone at once. One natural method of crowd control is the buffet line. People …
DRY, or Don't Repeat Yourself is frequently touted as a principle of software development. "Copy-pasta" is the derisive term applied to a violation of it, tying together the concept of copying code and pasta as description of software development bad practices (see also spaghetti code ). It is so uniformly reviled …
Computers work on binary code. If statements take one path: true, or false. For computers, bright lines and clear borders make sense. Humans are more complicated. What's an adult? When are you happy? How mature are you? Humans have fuzzy feelings with no clear delination. I was more responsible as …
I have written before about my Inbox Zero methodology. This is still what I practice, but there is a lot more that helps me. The concept behind "Universal Binary" is that the only numbers that make sense asymptotically are zero, one, and infinity. Therefore, in order to prevent things from …
The Labyrinth is a children’s movie. The main character is 16 years old, and solving a logic puzzle that will literally decide if she lives or dies. In fiction, characters are faced with realistic challenges: ones they can solve, even if they have to make an effort. So, it …
The choice in parameters for back-off configuration is important. It can be the difference between a barely noticable blip in service quality and an hours-long site outage. In order to explore the consequences of the choice, I wrote a little fictional ditty about a fictional website. I hope you enjoy …
In the 1986 movie Labyrinth, a young girl (played by Jennifer Connelly) is faced with a dilemma. The adorable Jim Henson puppets explain to her that one guard always lies, and one guard always tells the truth. She needs to figure out which door leads to the castle at the …
(I have shown this technique in my mailing list . If this kind of thing seems interesting, why not subscribe?) Imagine you want to log something that is, potentially, expensive to calculate. For example, in DEBUG mode, you would like to count the classes of the objects in gc.get_objects() and …
(This article is based on the one I originally published on OpenSource.com.) In 2010, the My Little Pony franchise was rebooted with the animated show My Little Pony: Friendship is Magic . The combination of accessibility to children with the sophisticated themes the show tackled garnered a following that cut …
Numbers in Python come in all shapes and forms. The reason different kind of representations of numbers exist is because they all have different trade-offs. These trade-offs are often surprising! Integers The most surprising things about integers is how easily they stop being integers. Dividing two integers, for example, 4 …
John H. Conway passed away ten days ago, and I think it's only now I can write a proper eulogy. I was first introduced to his work, if not his name, when I was at the end of elementary school. I am sure everyone has heard about the Game of …
The Twisted Requests ( treq ) package is an HTTP client built on the popular Twisted library that is used for web requests. Async libraries offer the ability to do large amounts of network requests in parallel with relatively little CPU impact. This can be useful in HTTP clients that need to …
It has been a long time since I learned how to program, and it is easy to forget some of the hard-won lessons in the beginning. Easy until I try to teach people to program. There is a lot of accidental and inherent complexity in programming, but I am ready …
This was originally sent to my newsletter . I send one e-mail, always about Python, every other Sunday. If this blog post interests you, consider subscribing. The underappreciated else keyword in Python has three distinct uses. if/else On an if statement, else will contain code that runs if the condition …
What is a threat? From a game-theoretical perspective, a threat is an attempt to get a better result by saying: "if you do not give me this result, I will do something that is bad for both of us ". Note that it has to be bad for both sides: if …
(This is based on the series published in opensource.com as 9 articles: 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ) Python contributor Tim Peters introduced us to the Zen of Python in 1999. Twenty years later, its 19 guiding principles continue to be relevant within the community. The …
(This is based on my article on opensource.com ) Unit test suites help maintain high-quality products by signaling problems early in the development process. An effective unit test catches bugs before the code has left the developer machine, or at least in a continuous integration environment on a dedicated branch …
There is a lot of Python code in the wild which does something like: raise ValueError("Could not fraz the buzz:" f"{foo} is less than {quux}") This is, in general, a bad idea. It does not matter if the exception is fairly generic, like ValueError or specific like CustomFormatParsingException …
This has previously been published on opensource.com . The Zen of Python is loose enough and contradicts itself enough that you can prove anything from it. Let's meditate upon one of its most famous principles: "Explicit is better than implicit." One thing that traditionally has been implicit in Python is …
The following post was originally published on OpenSource.com as part of a series on seven libraries that help solve common problems. Imagine you have a "shapes" library. We have a Circle class, a Square class, etc. A Circle has a radius , a Square has a side , and maybe Rectangle …
One of the items of feedback I got from the article about interface immutability is that it did not give any concrete feedback for how to design interfaces. Given that they are forever, it would be good to have some sort of guidance. The first item is that you want …
(The following talks about zope.interface interfaces, but applies equally well to Java interfaces, Go interfaces, and probably other similar constructs.) When we write a function, we can sometimes change it in backwards-compatible ways. For example, we can loosen the type of a variable. We can restrict the type of …
The Stack Overflow Survey Results for 2019 are in! There is some official analysis, that mentioned some things that mattered to me, and some that did not. I decided to dig into the data and see if I can find some things that would potentially interest my readership. import csv …
I am the parent of two young kids. It is easy to sink into random stuff, and not follow up on goals. Strict time management and prioritization means I get to work on open source projects, write programming books and update my blog with a decent cadence. Since a lot …
A while ago, I decided I wanted to self-publish a book on improving your Python skills. It was supposed to be short, sweet, and fairly inexpensive. The journey was a success , but had some interesting twists along the way. From the beginning, I knew what technology I wanted to write …
"It is a truth universally acknowledged, that a shared state in possession of mutability, must be in want of a bug." -- with apologies to Jane Austen As Ms. Austen, and Henrik Eichenhardt , taught us, shared mutable state is the root of all evil. Yet, the official documentation of functools tells …
There is a lot of code that overloads the __call__ method. This is the method that "calling" an object activates: something(x, y, z) will call something.__call__(x, y, z) if something is a member of a Python-defined class. At first, like every operator overload, this seems like a …
A couple of months ago, a successful attack against the Node ecosystem resulted in stealing an undisclosed amount of bitcoins from CoPay wallets . The technical flow of the attack is well-summarized by the NPM blog post . Quick summary: nodemon , a popular way to run Node applications, depends on event-stream . The …
JSON is a useful format. It might not be ideal for hand-editing, but it does have the benefit that it can be hand-edited, and it is easy enough to manipulate programmatically. For this reason, it is likely that at some point or another, checking in a JSON file into your …
If you want to speak to me, 1-on-1, about anything, I want to be able to help. I am a busy person. I have commitments. But I will make the time to talk to you. Why? I want to help. I think I'll enjoy it. I like talking to people …
(Thanks to Nelson Elhage and Saivickna Raveendran for their feedback on earlier drafts. All mistakes that remain are mine.) When talking about garbage collection, the notion of "generational collection" comes up. The usual motivation given for generational garbage collection is that "most objects die young". Therefore, we put the objects …
As my friend Thursday said in her excellent talk (sadly, not up as of this time) naming things is important. Avoiding in-jokes is, in general, a good idea. It is with mixed feelings, therefore, that my pun-loving heart reacted to Chris's disclosure that the most common suggestion was to call …
(Thanks to Brian for his feedback. All mistakes and omissions that remain are mine.) Some commands have a --dry-run option, which simulates running the command but without taking effect. Sometimes the option exists for speed reasons: just pretending to do something is faster than doing it. However, more often this …
(Thanks to Mark Rice for his helpful suggestions. Any mistakes or omissions that remain are my responsibility.) Some Python projects are designed to be libraries, consumed by other projects. These are most of the things people consider "Python projects": for example, Twisted, Flask, and most other open source tools. However …
(Thanks to Avy Faingezicht and Donald Stufft for giving me encouragement and feedback. All mistakes that remain are mine.) "eyes have they, but they see not" -- Psalms, 135:16 Eyes are expensive to maintain. They require protection from the elements, constant lubrication, behavioral adaptations to protect them and more. However …
When I was in my early 20s, I was OK at programming, but I definitely didn't like it. Then, one evening, I read the Python tutorial. That evening changed my mind. I woke up the next morning, like Neo in the matrix, and knew Python. I was doing statistics at …
A common way to expose an API in Python is as inheritance . Though many projects do that, there is a better way. But first, let's see. How popular is inheritance-as-an-API, anyway? Let's go to the Twisted website. Right at the center of the screen, at prime real-estate, we see: What's …
Assume MyClass._dangerous(self) is a private method. We could have implemented the same functionality without a private method as follows: Define a class InnerClass with the same __init__ as MyClass Define InnerClass.dangerous(self) with the same logic of MyClass._dangerous Make MyClass into a wrapper class over InnerClass …