Introduction Today, we are going to discuss how to convert numbers to strings and visa versa. It is a straightforward Python topic but it is important as well. There are various real life scenarios where type conversion is required. Before elaborating more, let us mention two example use cases to get a taste of what
Introduction Welcome to a new Python code snippets post. Today, we are going to talk about the regular expressions module (i.e RE module). The goal of this post is to clarify the main difference between re.search and re.match operations. Also, we will briefly discuss other operations provided by the RE module. Let us get started...
Introduction Welcome to a new operating systems post. Today, we are going to clarify the difference between swapping and paging. The goal is to focus on the main difference between the two and see why is it sometimes confusing. Let us give it a try… Modern operating systems support multitasking and virtual memory. I recommend
Introduction In computer systems, competition on limited resources such as CPU, drives, printers, database records, etc. requires proper synchronization otherwise, undesired effects may arise. In today's operating systems post, we are going to talk about deadlocks and starvation when a process or thread hangs up but never stop or finish the intended task. The primary
Introduction If you search for the phrase “Process vs Thread” I bet you, most of the articles you may find follow a typical structure. You will probably find a list of points in a tabular or bullet format contrasting process vs thread. Some articles are excellent but many lack a proper context. In this post,
Introduction Python programming language is a dynamically typed language. In other words, variable types are not explicitly declared as in statically typed languages (ex. C++). Instead, type checking is performed at runtime as opposed to compile time. The debate of which is better? a dynamically typed or statically typed language is not discussed in this
Introduction Welcome to a new code snippet in Python. Today, we are going to clarify the difference between items() and iteritems() methods when using a Python dictionary. Let us first quickly refresh our memory about lists, tuples and dictionaries in Python: A list is an array data structure that can be edited A tuple is
Introduction In this post, I am going to show how to setup gitlab CI so that a build is triggered whenever a new feature or bug fix branch is opened for review (i.e. merge request, note: if you use Github, it is called a pull request). The build should also be triggered whenever new (ex.
Introduction In today's Python code snippet, we are going to talk about deleting, removing and popping list elements: remove method: takes a value as input, searches for it, removes the first match. If the item is not found it errors out ValueError: list.remove(x): x not in list del function: removes an item at a specific
Welcome to a new Python code snippet. In this post, we are going to suggest a couple of methods to flatten a list of lists. The final output is going to be a one dimensional list. Let us take an example: # Given the following list of lists # Write code to flatten it. The