SecurePZ | I need a password right now!

The ultimate timesaver! We’ve all been there, trying to sign up for a new website, and boom - asked to create a new password, why? Like should I not use the same password everywhere? No sir, no! Haven’t you seen the breaches and log4j crazy stories? And sometimes, even the default password generator on chrome fails us. Frustrating, right? That’s where I came in. I was in a rush and needed a password, but all the other extensions out there took too many clicks to generate and copy a password....

December 23, 2022 · 1 min · 197 words · Me

Guard Clauses | Simplify Your Code

📷 Photo: Stable Diffusion As a programmer, you want your code to be efficient, readable, cool, and easy to maintain. One way to achieve this is by using guard clauses and early return statements. These techniques can help you simplify your code and make it easier to follow. In this post, I’ll explore what guard clauses and early return statements are, and how they can help you write better code....

December 19, 2022 · 2 min · 249 words · Me

List Comprehensions | Get Your Lists Together

📷 Photo: Stable Diffusion List comprehensions are a powerful and concise way to create lists in Python. They are a neat way to generate lists by applying operations to each element of a collection in a single line of code. With list comprehensions, you can create lists in a fraction of the time it would take with traditional loops, and your code will be much easier to read. Let’s say you want to create a list of the squares of the first 10 numbers....

December 15, 2022 · 3 min · 446 words · Me

Decorators | Decorate Functions and Classes

Python decorators are a powerful feature of the language that allows you to modify or extend the behavior of a function or a class without modifying its source code. A decorator is basically a function that takes another function or class as an argument and returns a new function or class that can be used instead of the original one. 📷 Photo: Stable Diffusion In this tutorial, I will cover the following topics:...

November 9, 2022 · 6 min · 1167 words · Me

RandDist | Bend the rules for randoms

Random generator with custom distribution function One day, I was tasked with creating a synthetic dataset of electricity consumption for a large number of houses over a long period of time to complement a real dataset. I realized that a normal distribution wouldn’t work, so I couldn’t use numpy.random.normal. We eventually didn’t use the synthetic dataset in our final work, but I had a neat class that was ready to be packaged as a pip package at the end of the day....

May 25, 2022 · 1 min · 205 words · Me