Round robin scheduling algorithm with examples

Introduction Modern operating systems support multitasking via CPU time sharing. The operating system manages CPU time by implementing a scheduling algorithm. In this article, we are going to briefly discuss round robin scheduling algorithm. To better understand the topic, you may check the following posts… Multitasking terms Scheduling algorithms Evaluate a scheduling algorithm Let us

Hangman in Python

Introduction In this Python code snippet, we are going to implement an easy hangman solver using simple source code. The game code is adapted to work with both Python 2.x and Python 3.x. The example provided is a console based application for beginners. Let us get started with the tutorial… Python 2.x program There is

Python random number generator code

Introduction Ready for more code snippets? In this post, we are going to talk about random numbers in Python. Have you ever thought about what random means or even if randomness makes any sense in the context of computing! (as computers execute instructions blindly). Is randomness useful? can we apply it in real life computational

Python unicode strings tutorial

Introduction Unicode is an important topic in computing but it is a little bit confusing. In particular, it can be more confusing in the context of Python programming language. For that reason, the aim of our article today is to clarify the ambiguity and hopefully put things into perspective. Beginners may get confused because they

Python compare strings

Introduction It is hard (even impossible) to find a real world application not using string comparison. It can be used in database lookup, searching for files on disk, sorting contacts and many other scenarios. String comparison in Python is not hard as we will demonstrate in today’s code snippets. Let us get started… Python string

Difference between re.search and re.match in Python

Table of contents Introduction What is a regular expression? What is Python raw string? Python RE module Python regular expressions syntax summary Regular expressions flags re.match re.search Why use re.match? Regular expression compilation re.match and re.search examples re.fullmatch Match objects re.findall re.finditer re.split re.sub Summary References Introduction Welcome to a new Python code snippets post.

Difference between deadlock and starvation

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