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

Sort by
Subject
Level

Key Concepts: Node.js Modules, Express Routing, Body Parser

Classified in Computers

Written on in English with a size of 6.67 KB

Understanding Node.js Modules & Core Functionality

In Node.js, modules are fundamental. They represent reusable blocks of code that can be exported from one file and imported into another, promoting a modular and organized application structure. Node.js features a built-in module system, allowing developers to utilize core modules, create custom modules, or integrate third-party modules.

Core Modules in Node.js

Core modules are pre-packaged with Node.js, offering essential functionalities for common tasks like file system operations, HTTP request handling, and path manipulation.

Some commonly used core modules in Node.js are:

  • fs (File System): For interacting with the file system.
  • http (HTTP): For creating HTTP servers and clients.
  • path (Path)
... Continue reading "Key Concepts: Node.js Modules, Express Routing, Body Parser" »

Python String Methods and Iteration Techniques

Posted by Anonymous and classified in Computers

Written on in English with a size of 4.56 KB

Essential Python String Manipulation Methods

1. strip()

  • Purpose: Removes any leading (start) and trailing (end) whitespace or specified characters from a string.
  • Example: " hello ".strip()"hello"
  • Use Case: Useful for cleaning input data.

2. ljust(width)

  • Purpose: Left-justifies the string in a field of given width, padding with spaces on the right.
  • Example: "Hi".ljust(5)"Hi "
  • Use Case: Formatting output neatly.

3. rindex(substring)

  • Purpose: Returns the last occurrence index of the given substring in the string. Raises an error if the substring is not found.
  • Example: "hello world".rindex("o")7
  • Use Case: Finding positions of characters or words starting from the end of the string.

4. isspace()

  • Purpose: Returns True if the string contains
... Continue reading "Python String Methods and Iteration Techniques" »

IoT Protocols, Communication Models, & Deployment Strategies

Classified in Computers

Written on in English with a size of 1.64 MB

IoT Protocols

Link Layer Protocols

  • 802.3 Ethernet Standards

    A collection of wired Ethernet standards that provide data rates from 10 Mb/s to 40 gigabits per second. The shared medium in Ethernet can be a coaxial cable, twisted-pair wire, or optical fiber. This shared medium carries communication for all devices on the network.

  • 802.11 Wi-Fi Standards

    A collection of wireless Local Area Network (WLAN) communication standards.

Network/Internet Layer

  • Responsible for sending IP datagrams from the source network to the destination network.
  • Handles host addressing and packet routing based on IPv4 or IPv6.
  • Datagrams contain a source and destination address, which are used to route them from the source to the destination across multiple networks.
  • IPv4 uses 32-
... Continue reading "IoT Protocols, Communication Models, & Deployment Strategies" »

Blockchain Cryptography: ECC, Hashing, and Consensus

Posted by Anonymous and classified in Computers

Written on in English with a size of 19.16 KB

Elliptic Curve Cryptography (ECC) in Blockchain

Elliptic Curve Cryptography (ECC) is a public-key cryptography technique based on the mathematics of elliptic curves over finite fields. It is widely used in blockchain systems such as Bitcoin and Ethereum for generating secure public-private key pairs and digital signatures. The main advantage of ECC is that it provides high security with smaller key sizes, making it faster and more efficient.

The Mathematical Equation of ECC

The general equation of an elliptic curve is:

y2 = x3 + ax + b

  • a and b are constants that define the shape of the curve.
  • The curve is defined over a finite field Fₚ (where p is a prime number) for cryptographic applications.
  • To be a valid elliptic curve, it must satisfy the condition:
... Continue reading "Blockchain Cryptography: ECC, Hashing, and Consensus" »

Operating System Memory Management and Deadlock Prevention

Posted by Anonymous and classified in Computers

Written on in English with a size of 6.41 KB

Operating System Memory Management Fundamentals

The Operating System (OS) is responsible for crucial memory decisions: determining which programs reside in memory, where they are placed, how memory is protected, and what actions to take when memory resources are exhausted.

Parkinson's Law Applied to Computing

Parkinson’s Law states that programs expand to fill the memory available to hold them.

Models for Organizing Memory

Three primary models exist for structuring memory:

  • Model A (User on Top, RAM on Bottom):
    • Pros: Fast execution.
    • Cons: No protection (e.g., used in MS-DOS).
  • Model B (ROM on Top, User on Bottom):
    • Pros: OS protected.
    • Cons: Slow and not flexible.
  • Model C (Drivers at Top, User in Middle, RAM at Bottom):
    • Pros: Fast and secure.
    • Cons: Complex
... Continue reading "Operating System Memory Management and Deadlock Prevention" »

Software Engineering Principles and System Design

Classified in Computers

Written on in English with a size of 301.21 KB

Software Engineering and Processes

Agile Manifesto

  • Individuals/Interactions over Processes
  • Working software over documentation
  • Collaboration over negotiation
  • Responding to change over following a plan

Requirements Engineering

Descriptions of the services that a system should provide and the constraints on its operation.

Functional

What the system should do.

Non-functional

Not directly concerned with the specific services delivered by the system to its users.

Quality Attributes

A scenario describing quality attributes typically involves these elements:

  1. Source: Origin of the stimulus.
  2. Stimulus: The event arriving.
  3. Artifact: Where the event arrives.
  4. Environment: Conditions in which the scenario takes place.
  5. Response: The result of the event.
  6. Response Measure: Must
... Continue reading "Software Engineering Principles and System Design" »

Operating System Concepts: Hardware Interaction and Scheduling

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.45 MB

Operating System Fundamentals

The Operating System (OS) serves several critical roles:

  • It acts as a resource manager, controlling access to the hardware.
  • It provides an abstraction layer, allowing user processes to call functions that access hardware via system calls.

User Mode vs. Supervisor Mode (Kernel Mode)

The CPU enforces separation between user processes and the OS kernel:

  • User Mode: Prohibits privileged instructions.
  • Kernel Mode (Supervisor Mode): Allows access to all hardware and privileged operations.

Program Status Word (PSW)

The PSW is a special register holding vital information, such as:

  • Access privilege mode.
  • Runtime execution conditions (e.g., condition codes).
  • Program Counter (PC) and Stack Pointer (SP).

Simplified Interrupt Handling Flow

  1. A
... Continue reading "Operating System Concepts: Hardware Interaction and Scheduling" »

Processor and Memory Interface: CPU Datapath, Registers & ALU

Posted by Anonymous and classified in Computers

Written on in English with a size of 967.85 KB

Processor & Memory Interface

Processor & Memory Interface: The maximum size of the memory that can be used in any computer is determined by the addressing scheme. For example, a computer that generates 16-bit addresses is capable of addressing up to 216 = 65,536 (≈ 64K) memory locations. Machines whose instructions generate 32-bit addresses can utilize a memory that contains up to 232 = 4,294,967,296 (≈ 4G) locations, whereas machines with 64-bit addresses can access up to 264 ≈ 1.84 × 1019 locations. The number of locations represents the size of the address space of the computer.

The connection between the processor and its memory consists of address, data, and control lines. The processor uses the address lines to specify the... Continue reading "Processor and Memory Interface: CPU Datapath, Registers & ALU" »

Java Programming: Classes, Objects, and Key Concepts

Classified in Computers

Written on in English with a size of 5.28 KB

Classes (الصفوف)

  • A class consists of variables (fields) and methods.
  • Variables are data members of a class.
  • Methods are functions that define the class's behavior.

Variables (المتغيرات)

  • Declared with a data type and a name.
  • Can be public or private.
  • Examples: int age, String name.

Methods (الأساليب)

  • Functions that perform specific tasks.
  • Can have parameters and return values.
  • Types:
    • Void methods: Don't return a value.
    • Return type methods: Return a value.
    • Static methods: Can be called without creating an object.
    • Instance methods: Require an object to be called.
    • Abstract methods: Declared without a body; used in abstract classes.
    • Overloaded methods: Multiple methods with the same name but different parameters.

Constructors (البناؤون)

... Continue reading "Java Programming: Classes, Objects, and Key Concepts" »

Vector Databases & RAG for Semantic Search and Retrieval

Posted by Anonymous and classified in Computers

Written on in English with a size of 206.28 KB

1. Vector Databases — High-Dimensional Embeddings

Store and search high-dimensional vector embeddings. Used in semantic search, similarity search, and RAG pipelines.

Indexing Techniques

  • Flat Index (Brute Force) → accurate but slow.
  • Approximate Nearest Neighbor (ANN) → fast and scalable.
    • Algorithms: HNSW, FAISS, Annoy.
    • f3Q1622KC84AAAAASUVORK5CYII= 8pk5+AsHqPHAAAAAElFTkSuQmCC

3. Retrieval-Augmented Generation (RAG)

Overview

Enhances LLM output by integrating retrieved external knowledge.

  • Reduces hallucination and outdated responses.
  • Improves factual grounding.

RAG Workflow

  1. Indexing: Convert raw data (PDF, HTML, Word) → embeddings.
  2. Retrieval: Retrieve relevant document chunks using similarity search.
  3. Generation: LLM synthesizes results with the query to produce the final answer.

Retrieval Types

TypeDescriptionExample
Sparse
... Continue reading "Vector Databases & RAG for Semantic Search and Retrieval" »