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

Sort by
Subject
Level

Python Classes, Objects, and Inheritance Fundamentals

Classified in Computers

Written on in English with a size of 4.11 KB

Understanding Objects in Programming

An object is a software entity that contains data (attributes) and methods. It represents a real-world entity that can be distinctly identified.

Every object has a unique:

  • Identity: The name of the object (e.g., the variable name).
  • State: The data stored in the object, which defines its properties.
  • Behavior: The actions an object can perform, defined by its methods.

Can an object be passed as an argument to a function?

Yes. In Python, objects are passed by reference. This means any changes made to the object's attributes within the function will permanently alter the original object. This behavior is similar to how lists and dictionaries are handled. Think of it as sharing a key to a single locker rather than getting... Continue reading "Python Classes, Objects, and Inheritance Fundamentals" »

Mastering Stacks, Deques, Trees, and Graph Data Structures

Classified in Computers

Written on in English with a size of 21.54 KB

A stack is a fundamental data structure in computer science that follows the Last In, First Out (LIFO) principle. This means that the last element added to the stack is the first one to be removed. You can think of it like a stack of plates: you can only add or remove the top plate.

### Key Concepts of a Stack:

1. Basic Operations:
   - Push: This operation adds an element to the top of the stack.
   - Pop: This operation removes the element from the top of the stack and returns it.
   - Peek (or Top): This operation returns the top element of the stack without removing it.
   - IsEmpty: This operation checks whether the stack is empty.

2. Implementation:
   Stacks can be implemented using arrays or linked lists. Here are the details for... Continue reading "Mastering Stacks, Deques, Trees, and Graph Data Structures" »

Microprocessor vs. Microcontroller: Understanding the Key Differences

Classified in Computers

Written on in English with a size of 2.45 KB

Microprocessor vs. Microcontroller

ii) Differentiate Between a Microprocessor and a Micro-Controller

Microprocessor

Definition:

A microprocessor is a central processing unit (CPU) on a single integrated circuit (IC) chip that performs the processing functions of a computer.

Functionality:
  • It only includes the CPU core and lacks other components like memory, I/O ports, timers, and other peripherals.
  • Requires external components like memory (RAM, ROM), input/output devices, timers, and other peripherals to function as a complete system.
Usage:
  • Primarily used in systems requiring high computational power and flexibility, such as desktop computers, laptops, servers, and high-end embedded systems.
  • Suited for applications where customization of peripherals
... Continue reading "Microprocessor vs. Microcontroller: Understanding the Key Differences" »

Pattern Printing Programs in C and Python — Pyramid & String

Classified in Computers

Written on in English with a size of 4.26 KB

Number Pyramid of Integers

Write a program to generate the following patterns of integers:

              1
            121
           12321
         1234321

Corrected C Program (Number Pyramid)

The following C program prints the above centered palindrome number pyramid. It prompts for the number of rows.

#include <stdio.h>

int main()
{
    int i, j, row;
    printf("Enter number of rows: ");
    if (scanf("%d", &row) != 1) {
        printf("Invalid input.\n");
        return 1;
    }

    for (i = 1; i <= row; i++)
    {
        for (j = 1; j <= row - i; j++)
        {
            printf(" ");
        }
        for (j = 1; j <= i; j++)
        {
            printf("%d", j);
        }
        for (j = i - 1; j >= 1; j--)
... Continue reading "Pattern Printing Programs in C and Python — Pyramid & String" »

Essential .NET Concepts: CLR, FCL, MSII

Classified in Computers

Written on in English with a size of 3.35 KB

Key .NET Concepts Defined

Managed Code Explained

Managed code is the code executed by the .NET runtime (CLR), which provides memory management, security, and exception handling.

.NET Framework Class Library (FCL)

FCL is a collection of reusable classes, interfaces, and value types that provide core functionalities like file handling, data access, and networking in .NET applications.

Boxing in VB.NET

Boxing is the process of converting a value type (e.g., Integer) into an object type (Object), allowing it to be stored in the heap.

Option Explicit Statement

In VB.NET, Option Explicit forces variable declarations before use, preventing errors due to undeclared variables.

Progress Bar Control Use

A Progress Bar control visually represents the progress of... Continue reading "Essential .NET Concepts: CLR, FCL, MSII" »

Core Concepts of Industrial Automation: TIA, SCADA, and DCS Systems

Posted by Anonymous and classified in Computers

Written on in English with a size of 23.38 KB

Industrial Automation Fundamentals

Defining Industrial Automation and Its Impact

Industrial automation refers to the use of control systems, such as computers, robots, and Programmable Logic Controllers (PLCs), to handle processes and machinery in industries, significantly reducing human intervention. It fundamentally enhances efficiency, precision, and safety in modern manufacturing.

The Revolution in Manufacturing

Automation has revolutionized manufacturing through several key areas:

  • Increased Productivity: Automation enables 24/7 operations, substantially boosting output and throughput.
  • Improved Quality: Consistent, repeatable processes reduce errors and ensure uniform product quality.
  • Cost Efficiency: Automation reduces reliance on manual labor
... Continue reading "Core Concepts of Industrial Automation: TIA, SCADA, and DCS Systems" »

Python Fundamentals and String Methods for Data Preparation

Posted by Anonymous and classified in Computers

Written on in English with a size of 5.02 KB

Day 1: Python Basics for AI/ML Preparation

Output Statements

  • print() – Displays output to the console.
  • end=" " – Prevents a new line after the print statement.
  • sep="," – Specifies the character used to separate multiple items in the output.

Input and Type Casting

  • The input() function always returns a string data type.
  • Adding strings results in *concatenation* (e.g., "5" + "10" = "510").
  • Use int() or float() for numerical input conversion:

    Example: num = int(input("Enter a number: "))

Variables and Data Types

  • Common types include int (integer), float (decimal), str (string), and bool (boolean).
  • Use type(variable) to check the data type of any variable.

Formatted Strings (f-Strings)

  • Used for easy string formatting and embedding variables:

    Example: print(

... Continue reading "Python Fundamentals and String Methods for Data Preparation" »

Essential Linux Commands: A Practical Reference

Classified in Computers

Written on in English with a size of 3.95 KB

Essential Linux Commands

File and Directory Management

  • mkdir: Create a new directory.
  • ls: List contents of a directory.
  • rm: Remove files or directories (-r for recursive).
  • cp: Copy files or directories.
  • mv: Move or rename files or directories.
  • cat: Display file contents or create files.
  • less: View file contents one page at a time.
  • head: Display the first 10 lines of a file.
  • tail: Display the last 10 lines of a file.

System Information

  • uname: Show system information (kernel, version, etc.).
  • top: Display running processes and resource usage.
  • df: Show disk space usage.
  • df -h: Show disk usage in human-readable format.
  • free: Display memory usage (RAM and swap).

File Creation and Editing

  • touch: Create an empty file or update its timestamp.
  • echo: Write text to a file
... Continue reading "Essential Linux Commands: A Practical Reference" »

Networking Essentials: TCP, IP, Routing, and SDN

Classified in Computers

Written on in English with a size of 3.21 MB

sMdRTz2CZp8AAAAASUVORK5CYII= 3sIS9NlspZMAAAAASUVORK5CYII=

8clQpOLAAAAAElFTkSuQmCC Pyzl774gh3lYAAAAAElFTkSuQmCC

QltAtfyLfn4RSLxAPwfE7YF1nxk+l4AAAAASUVORK5CYII= wGzRdTNkcDQPAAAAABJRU5ErkJggg==

CJ95H4KO90AAAAASUVORK5CYII= x82xiFmBI28qw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YRjmBsBijGEYhmEYhmEY5gbAYoxhGIZhGIZhGOYGwGKMYRiGYRiGYRjmBsBijGEYhmEYhmEY5l+H6P8BBqj548EamC8AAAAASUVORK5CYII= Z5DXRcURVEURckLuRi5kA8jVynb5GqsFsXIBTV0FUVRFEVRlAqIMf8P5Uj1SXWgZd0AAAAASUVORK5CYII=


rz22msWh1JO8rwbxMGwixhudsQx8SOEEHeCBIkQQngI8CVQOJv1XIj7nereDWJnECnVxfgIIURNSJAIIYQQQgghyoZiSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlQ4JECCGEEEIIUTYkSIQQQgghhBBlIkn+Ap8cqHZgf97HAAAAAElFTkSuQmCC wf2VtgLtGg7TgAAAABJRU5ErkJggg== h9ln1IBfnHvLQAAAABJRU5ErkJggg==

dbzB5RFEVRFEUpalRZURRFURRFURSlINEOdEVRFEVRFEVRChJVVhRFURRFURRFKUhUWVEURVEURVEUpSBRZUVRFEVRFEVRlAJE5P8BBNjgB+siH5YAAAAASUVORK5CYII= HHCNDVzGWfbp6Mjw43ecYaMOfkFRRFEXZjIoZRWnjcKwMxwpsbZ4IpX3AcVIcM7M110Jlz4TjXxjMoLVj1xRFUfYsgP8HTC7DNUfOHwwAAAAASUVORK5CYII= AAAAAElFTkSuQmCC B+6MyUcHUtKBAAAAAElFTkSuQmCC

1. TCP Congestion Control

Slow Start: TCP initializes congestion window (cwnd) to a small size and doubles it every Round Trip Time (RTT) until a loss occurs (exponential growth) or the slow start threshold is reached.

Congestion Avoidance: After reaching the threshold, cwnd is incremented by one segment for each RTT, growing linearly to avoid congestion.

Fast Recovery: When triple duplicate ACKs are detected, TCP halves the cwnd and reduces the slow start threshold to half of the cwnd size before the loss, then transitions to congestion avoidance.

2. TCP RTT and Timeout

Estimating RTT: Uses Smoothed Round Trip Time (SRTT) which is a weighted average of previous RTT measurements.

Timeout Calculation: Often calculated as Timeout=SRTT+4×RTT

... Continue reading "Networking Essentials: TCP, IP, Routing, and SDN" »

Linux File System Architecture and Key Components

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.55 KB

Understanding Linux File Management Subsystem

The Linux File Management Subsystem, an integral part of the Linux kernel and user space, meticulously handles all aspects related to files. This includes their creation, storage, retrieval, permissions, and overall structure. Its primary role is to ensure that data is stored efficiently and securely on disk, remaining readily accessible whenever needed.

Core Components of Linux File Management

File System Interface

  • Provides system calls such as open(), read(), write(), and close(), which user programs utilize to interact with files.
  • Abstracts the underlying complexity of physical storage devices.

Virtual File System (VFS)

  • Acts as a crucial abstraction layer, offering a common interface to various file
... Continue reading "Linux File System Architecture and Key Components" »