I hate complicated solutions. But as much as I despise it, there are a lot of times that I find myself driving towards it. In this blog post, I will share my thoughts on excessive indirection, bad abstraction layers, and some ways on how I avoid them.
An abstraction layer is a way of simplifying the underlying complexity of a subsystem. It allows separation of concerns to facilitate interoperability and platform independence. The purpose of implementing abstraction layers is to provide a clear and easier-to-use interface over an existing set of functionality. …
A lot of data science and ML projects I’ve worked with are written by people who are not coders first. Their primary concern is a working model and not a maintainable software so it’s quite reasonable that the code they write is not as production-ready as what you would expect from a software developer. In this article, I’ve listed some of the most common code smells I encounter when I’m refactoring DS/ML applications. I hope that this list will be helpful for some folks in developing their “code nose”.
Code smells can serve as an indicator that there might be…
Whenever a project written in Python gets big enough, it becomes relatively unwieldy compared to other strictly typed languages. This is due in part to Python’s dynamically typed nature. Python runtime does not check for consistency in data types. This means that variables can change its data type throughout its lifetime and Python does not check the data types of objects being passed around. This becomes problematic when working with a large codebase since a good chunk of bugs can be traced to data type mismatch.
A recent suite of Python native features can be used to provide some sort…
Any python class which implement the descriptor protocol can be considered a descriptor class. And any class containing a descriptor class (either in its class dictionary or in the dictionary in one of its parents) will be referred in this article as an owner class.
Python descriptors are objects that implement the descriptor protocol. It gives you the ability to create objects that have special behaviour when they’re accessed as attributes of other objects. Python descriptor protocol is the mechanism that powers the properties, methods, static methods, and class methods.
The dunder methods below are the definition of the descriptor…
Say for example you accidentally modified /usr/bin/chmod* , how will you revert to the original permission?
You can run the loader directly, and pass it the command you want to run:
/lib/ld-linux.so /bin/chmod +x /bin/chmod
Your path to the loader might vary, and on a 64-bit system you need to choose the right one based on how chmod was compiled; the 64-bit version is named something like /lib/ld-linux-x86–64.so -Michael
Data/Software Engineer. Likes coffee and figuring things out