Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

Essential Shell Scripting Examples for Linux Automation

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.37 KB

1. Armstrong Number Checker

Write a shell script to check whether a given number is an Armstrong number.

echo "Enter a number"
read c
x=$c
sum=0
while [ $x -gt 0 ]
do
r=$(( $x % 10 ))
n=$(( $r * $r * $r ))
sum=$(( $sum + $n ))
x=$(( $x / 10 ))
done
if [ $sum -eq $c ]
then
echo "This is an Armstrong number"
else
echo "This is not an Armstrong number"
fi

2. Calculate Area of a Circle

Write a shell script to find the area of a circle.

echo "Enter radius"
read r
echo "Area is"
echo "3.14 * $r * $r" | bc

3. Average of Command Line Arguments

Write a shell script to find the average of numbers entered as command line arguments.

sum=0
for i in $*
do
sum=$((sum + i))
done
echo "Summation of $# numbers is: $sum"
N=$#
avg=$(echo "$sum / $N" | bc -l)
echo "Average = $avg"
... Continue reading "Essential Shell Scripting Examples for Linux Automation" »

Data Structures: Queues, Trees, Graphs, and Searching Algorithms

Posted by Anonymous and classified in Computers

Written on in English with a size of 497.48 KB

Understanding Data Structures and Algorithms

8. Queues: FIFO Operations

A queue is a linear data structure that follows the First-In, First-Out (FIFO) principle. The element inserted first will be removed first, similar to people waiting in a line. It has two primary operations:

  • enqueue(): Adds an element to the rear of the queue.
  • dequeue(): Removes an element from the front of the queue.

Enqueue Operation Algorithm (Array-based):

  1. Check if the queue is full (rear == size - 1).
  2. If not full, increment rear.
  3. Insert the new element at queue[rear].

Example:

if (rear == size - 1)
    printf("Queue Overflow");
else {
    rear++;
    queue[rear] = value;
}

Dequeue Operation Algorithm:

  1. Check if the queue is empty (front > rear).
  2. If not empty, retrieve the element
... Continue reading "Data Structures: Queues, Trees, Graphs, and Searching Algorithms" »

Python Data Structures for Customer Analytics

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.84 KB

Experiment 5: Customer Analytics Database

This Python experiment demonstrates the practical application of core data structures: Tuples, Lists, Sets, and Dictionaries to build a basic Customer Analytics System.

# Experiment Code:
# Tuple: Fixed dataset structure (immutable)
dataset_schema = ("CustomerID", "Name", "PurchaseAmount", "Segment")
# List: Stores purchase amounts (mutable, ordered)
purchase_amounts = []
# Set: Stores unique customer IDs
unique_customers = set()
# Dictionary: Stores complete customer records
customer_records = {}

while True:
    print("\n--- Menu Customer Analytics ---")
    print("1. Add Customer Data")
    print("2. View Purchase Amounts (List)")
    print("3. View Dataset Schema (Tuple)")
    print("4. View Unique
... Continue reading "Python Data Structures for Customer Analytics" »

Fundamental Computer Science Concepts & Algorithms

Classified in Computers

Written on in English with a size of 1.64 MB

Arithmetic Progressions (AP)

Sum of terms = n[(1st term + last term)]/2

Geometric Progressions (GP)

Sum of terms = [1st term(1 - quotientn)/(1 - quotient)] (Swap positions of 1 & quotient if quotient > 1)

Logarithms

  • loga(x/y) = logax - logay
  • logaxn = nlogax
  • logab = (logcb/logca)

Permutations

For a set of n objects: The total number of permutations is n!

For arranging 'r' objects from a set of 'n' objects: The number of permutations is nPr = n! / (n-r)!. (e.g., ways to arrange 3 objects from a set of 5 is 5 * 4 * 3, since there are 5 possibilities for the first object, followed by 4, then 3.)

Combinations

For selecting 'r' objects from a set of 'n' objects: The number of combinations is nCr = n! / (r! * (n-r)!). (Divide by r! since there are r! ways

... Continue reading "Fundamental Computer Science Concepts & Algorithms" »

Core 5G Enabling Technologies and Sensor Network Architecture

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.47 KB

5G Enabling Technologies

5G is made possible by a combination of advanced radio, network, and computing technologies. These enabling technologies work together to deliver high data rates, ultra-low latency, massive connectivity, and high reliability.

1. Millimeter Wave (mmWave) Communication

5G uses high-frequency bands (typically 24 GHz–100 GHz) known as millimeter waves.

  • Provides extremely high data rates
  • Suitable for dense urban areas, stadiums, and hotspots
  • Limited range, so it requires more base stations and small cells

2. Massive MIMO (Multiple Input Multiple Output)

Uses a large number of antennas at the base station.

  • Increases spectral efficiency
  • Supports multiple users simultaneously
  • Improves data rates and coverage

3. Network Slicing

Divides... Continue reading "Core 5G Enabling Technologies and Sensor Network Architecture" »

Mastering C++ Operator Overloading: A Practical Tutorial

Posted by Anonymous and classified in Computers

Written on in English with a size of 5.41 KB

In C++, Operator Overloading is a compile-time polymorphism feature that allows you to grant custom meanings to existing C++ operators (like +, -, *, ==, etc.) when they are applied to user-defined data types (objects).

It does not let you create new operators (you cannot invent a ** operator), nor does it change the precedence or associativity of existing ones. It simply makes your custom objects behave intuitively, like built-in data types.

1. Syntax of Operator Overloading

To overload an operator, you define a special member function using the operator keyword followed by the symbol you want to overload.

ReturnType operator Symbol (Arguments) {
    // Custom logic here
}

2. Overloading Unary Operators

A unary operator operates on a single operand.... Continue reading "Mastering C++ Operator Overloading: A Practical Tutorial" »

C Programming Concepts: Arrays, Functions, Structures, and Stacks

Posted by Anonymous and classified in Computers

Written on in English with a size of 300.77 KB

1. Arrays: Definition, Types, and Implementation

An array is a collection of elements of the same data type stored in contiguous memory locations. It is used to store multiple values in a single variable and can be accessed using index numbers. The indexing in an array starts from 0. Arrays help manage and process data efficiently, especially when dealing with large volumes of similar data.

Types of Arrays Based on Dimensions

  • One-Dimensional Array: It stores data in a linear list format.
  • Multi-Dimensional Array: It stores data in matrix form (like 2D, 3D arrays), which is useful in applications like image processing and tables.

Types of Arrays Based on Memory Allocation

  1. Static Array:

    The size of the array is fixed at compile-time. Memory is allocated

... Continue reading "C Programming Concepts: Arrays, Functions, Structures, and Stacks" »

Formulaire d'Inscription et Collecte de Données

Classified in Computers

Written on in English with a size of 518 bytes

Formulaire d'Identification et d'Inscription

Veuillez renseigner les informations suivantes pour votre dossier :

  • Nom :
  • Prénom :
  • CIN :
  • Tél :

Validation des Coordonnées Personnelles

Veuillez confirmer les informations ci-dessous :

  • Nom :
  • Prénom :
  • CIN :
  • Tél :

Splunk SPL Mastery: Essential Commands and Data Modeling

Posted by Anonymous and classified in Computers

Written on in English with a size of 4.02 KB

Aggregation and Charting Commands

  • Stats vs. Eventstats vs. Streamstats: stats collapses events for aggregation; eventstats retains events for per-event comparison; streamstats performs rolling, order-sensitive calculations.
  • Chart vs. Timechart: Use chart for non-time data with over/by; use fillnull to handle gaps. timechart bins _time automatically; define intervals using span=12h. Note: chart count over X by Y differs from chart count by X,Y.

Data Manipulation and Filtering

  • Eval: Use tostring(field, "duration") for numeric time formatting; case() for multi-condition logic; and coalesce(field1, field2, …) to prevent null values.
  • Where vs. Search: where is a post-pipe, type-sensitive command. Strings treated as numbers result in nulls; cast using
... Continue reading "Splunk SPL Mastery: Essential Commands and Data Modeling" »

Operating System Concepts: Process, Memory, and Disk Management

Posted by Anonymous and classified in Computers

Written on in English with a size of 64.1 KB

Primary Functions of an Operating System

An operating system (OS) is system software that acts as an interface between the user and the computer hardware. Its primary functions are:

  • Process Management: Creation, scheduling, and termination of processes.
  • Memory Management: Allocation and deallocation of memory.
  • File Management: Organization, storage, and retrieval of files.
  • Device/I-O Management: Controls peripheral devices.
  • Security & Protection: Prevents unauthorized access.

What Is a Batch Processing System?

  • A batch operating system groups similar jobs (with the same requirements) together and executes them as a single batch without user interaction.
  • A resident monitor reads jobs sequentially from input and submits them to the CPU.
  • Advantage: Less
... Continue reading "Operating System Concepts: Process, Memory, and Disk Management" »