Category Archives: Technical Scripter

Junk File Organizer in Python

Basically, as a lazy programmer my desktop is full of files (Junk Files). Due to the large number of files, it is a daunting task to sit and organize each file. To make that task easy the below Python script comes handy and all the files are organized in a well-manner within seconds. Screenshot before… Read More »

Convoy Effect in Operating Systems

Prerequisites : Basics of FCFS Scheduling (Program for FCFS Scheduling | Set 1, Program for FCFS Scheduling | Set 2 ) Convoy Effect is phenomenon associated with the First Come First Serve (FCFS) algorithm, in which the whole Operating System slows down due to few slow processes. Image Source : FCFS algorithm is non-preemptive… Read More »

The prisoner’s dilemma in Game theory

Two members of a criminal gang are arrested and imprisoned. Each prisoner is in solitary confinement with no means of communicating with the other. The prosecutors lack sufficient evidence to convict the pair on the principal charge. They hope to get both sentenced to a year in prison on a lesser charge. Simultaneously, the prosecutors… Read More »

Serial Sort v/s Parallel Sort in Java

We often need to sort array while programming. For this, we use inbuilt method provided by Java in Arrays class i.e sort(). sort() method uses merge sort or Tim Sort to sort the array elements. In both the cases sort() method sequentially sort the elements of an array. In Java 8, there is a new… Read More »

Reading and Writing to text files in Python

Python provides inbuilt functions for creating, writing and reading files. There are two types of files that can be handled in python, normal text files and binary files (written in binary language,0s and 1s). Text files: In this type of file, Each line of text is terminated with a special character called EOL (End of… Read More »

Formatted text in Linux Terminal using Python

This article demonstrates how to print formatted text in Linux terminal using Python programming language. Formatted text(also called styled text or rich text) as opposed to plain text, has styling information like: color (text color, background color), style (bold or italic), and some other special features like Strike-through text, underlined text, hyperlinks, etc. In a… Read More »

Desktop Notifier in Python

This article demonstrates how to create a simple Desktop Notifier application using Python. A desktop notifier is a simple application which produces a notification message in form of a pop-up message on desktop. Notification content In the example we use in this article, the content that will appear as notification on desktop is the top… Read More »

Missionaries and Cannibals

Question: In this problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, that the missionaries present on the bank cannot be outnumbered by cannibals. The boat cannot cross the river by itself with no people on board.… Read More »

random header | Set 2 (Distributions)

Set 1 (Generators) Distributions I. Uniform : uniform_int_distribution: It produces random integer values i, which are uniformly distributed on the closed interval [a,b], which is described by the following probability mass function: operator(): It generates the random number that are distributed according to the probability function. min: It returns the greatest lower bound of the… Read More »

Double Brace Initialization in Java

When we use a collection in your code, we typically do following. Declare a variable for a temporary collection. Create a new empty collection and store a reference to it in the variable. Put things into the collection. Pass the collection to the method. For example: Output: [one, two, three] Above are normal steps we… Read More »