I love many things and coding is one of them!
How to Parse Command Line Arguments in Bash
Bash scripts take in command-line arguments as inputs both sequentially and also, parsed as options. The command-line utilities use these arguments to conditionally trigger functions in a Bash script or selectively choose between environments to execute the script. In Bash, these are configured in different ways. In this article, we...
Python: Deep and Shallow Copy Object
In this article, we'll take a look at how to deep and shallow copy the objects in Python. The short answer is that you can use methods of the copy module, for both operations: import copy shallow_copy_list = copy.copy(original_list) deepcopy_list = copy.deepcopy(original_list) Though,...
Abstract Factory Design Pattern in Python
Design patterns help make code understandable, scalable, and reusable. There are different categories of design patterns, depending on the problems being addressed. When code is modularized, it's easier to add newer features without making drastic changes to the project. The Abstract Factory Design Pattern is a creational pattern that provides...
Creating a REST API with Django REST Framework
REST APIs are an industry-standard way for web services to send and receive data. They use HTTP request methods to facilitate the request-response cycle and typically transfer data using JSON, and more rarely - HTML, XML and other formats. In this guide, we will create a REST API in Python...
Calculate Factorial With Java - Iterative and Recursive
Calculating a factorial of a number is a straightforward task. A factorial of a number is the product of that number (positive integer) and all positive integers less than that number. In other words - multiplying a number by all of the whole numbers from that number to 1. 0!...
A factorial of a number is the product of that integer and all the positive integers that are lesser than or equal to it. It has to be a positive integer - otherwise, the logic extends to negative infinity. In other words - calculating a factorial means multiplying all whole...
Calculate a Factorial With Python - Iterative and Recursive
By definition, a factorial is the product of a positive integer and all the positive integers that are less than or equal to the given number. In other words, getting a factorial of a number means to multiply all whole numbers from that number, down to 1. 0! equals 1...
Observer Design Pattern in Python
Software Design Patterns help accelerate the development process by providing a reusable blueprint for your code to solve a particular problem. We follow Design Patterns to write generalized, reusable, and readable code that could be easily understood by others familiar with the patterns we've applied. They encapsulate cumulative experience of...
Python: How to Remove a Character from a String
In this guide, we'll take a look at how to remove a character from a string in Python. Strings, and especially user-generated input may contain unwanted characters, such as special characters in a username field we don't want to store. In those cases, we might prefer to remove specific characters...