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

Sort by
Subject
Level

Network Fundamentals: Protocols, Addressing, Security

Posted by Anonymous and classified in Computers

Written on in English with a size of 17.78 KB

TCP Reliable Transfer and Connection Management

TCP Reliable Transfer

  1. Sequence Numbers

    • Each byte of data is assigned a sequence number. This number is used by the receiver to correctly order the data and ensure there are no missing segments.
  2. Acknowledgements

    • The receiver sends back an ACK to the sender for the sequence number of the next expected byte. If the sender receives the ACK before its timer expires, it knows everything up to that byte was received correctly.
  3. Retransmission

    • If the ACK is not received before the timer expires, the sender retransmits the data.

TCP Connection Management

Managing a TCP connection begins with a three-way handshake, which establishes a connection before any actual data is transmitted.

Steps in Three-Way Handshake

  1. SYN
    • The
... Continue reading "Network Fundamentals: Protocols, Addressing, Security" »

Registro de Películas con Flask y JavaScript

Classified in Computers

Written on in English with a size of 2.92 KB

Integración de Frontend y Backend para Películas

A continuación, se presenta la implementación técnica para el registro y gestión de películas utilizando JavaScript en el cliente y Flask en el servidor.

Implementación del Cliente con JavaScript

El siguiente bloque de código gestiona la captura de datos del formulario y su envío mediante la Fetch API:

const API_URL = 'http://127.0.0.1:5000';

const formulario = document.getElementById("pelicula_Form");
const tituloInput = document.getElementById("titulo");
const directorInput = document.getElementById("director");
const anioInput = document.getElementById("anio");

formulario.addEventListener("submit", registrar_Pelicula);

async function registrar_Pelicula(event) {
    try {
        const
... Continue reading "Registro de Películas con Flask y JavaScript" »

Mastering Modern Web Development: CSS, JavaScript, and Logic

Posted by Anonymous and classified in Computers

Written on in English with a size of 12.74 KB

Key Features of CSS

CSS isn't just about changing colors; it is a robust design language with several powerful features:

  • Separation of Concerns: By keeping content (HTML) separate from presentation (CSS), you can update the entire look of a website by changing just one CSS file.
  • Media Queries (Responsiveness): CSS allows you to create fluid layouts that adapt to different screen sizes, from mobile phones to massive 4K monitors.
  • The Box Model: Every element on a webpage is treated as a rectangular box. CSS gives you precise control over the margins, borders, padding, and content size of these boxes.
  • Animations and Transitions: You can create smooth visual effects (like fading, sliding, or rotating elements) purely with CSS, without needing heavy
... Continue reading "Mastering Modern Web Development: CSS, JavaScript, and Logic" »

Synchronization and CPU Scheduling in Operating Systems

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.87 KB

Chapter 5: Synchronization

Critical Section Conditions

  • Mutual Exclusion: Only one process may be in the critical section at a time.
  • Progress: If the critical section is empty, some waiting process can enter.
  • Bounded Waiting: No starvation; each process waits a bounded number of turns.

Atomic Instructions

  • Test-and-Set: old = *b; *b = TRUE; return old
  • Swap: temp = *a; *a = *b; *b = temp

Spinlocks

  • TAS:
    bool m = false;
    lock() { while (TestAndSet(&m)); }
    unlock() { m = false; }
    
  • Swap:
    bool m = false;
    lock() { bool key = true; while (key) Swap(&m, &key); }
    unlock() { m = false; }
    

Semaphores

  • wait(S): S.val--; if S.val < 0 block
  • signal(S): S.val++; if S.val <= 0 wake one
  • Binary semaphore as mutex: init = 1; lock = wait; unlock = signal

Peterson's

... Continue reading "Synchronization and CPU Scheduling in Operating Systems" »

Essential Linux and Operating Systems Concepts Explained

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.25 KB

Linux and Operating Systems Fundamentals

  • 1. CD-ROM Directory: The CD-ROM contains a directory called /fortycdrom/data.
  • 2. Permissions: -rwxr-xr applies to everyone and members.
  • 3. Process Control: ID 42000 — kill -9.
  • 4. Modern Operating Systems: Applies to all.
  • 5. Child Process: Identified by the process ID.
  • 6. 11-Bit Processor: Maximum value is 2047.
  • 7. Block Special File: Represents a hard disk drive.
  • 8. POSIX Compliant: There are different standards.
  • 9. Code Execution: The following code crashes.
  • 10. Bash Command: alias bubble.
  • 11. Linux Shell: pwd prints the current working directory.
  • 12. Shell Commands: chown is used for ownership.
  • 13. Virtual Machine: Utilizes CPU and memory resources.
  • 14. File Names: ls -al lists files including their names.
  • 15.
... Continue reading "Essential Linux and Operating Systems Concepts Explained" »

Modern Cryptography and Data Security Fundamentals

Posted by Anonymous and classified in Computers

Written on in English with a size of 11.63 KB

Lecture 1: Introduction and Security Concepts

The CIA Triad

  • Confidentiality: Limits access to authorized users. A breach results in unauthorized disclosure.
  • Integrity: Prevents unauthorized modification. A breach results in an altered document.
  • Availability: Ensures timely access. A breach results in a Denial of Service (DoS) attack.

Additional Security Objectives

  • Authenticity: Verifies that the data or sender is real and trustworthy.
  • Accountability: Ensures actions are traceable to specific entities.
  • Non-repudiation: Ensures a party cannot deny their actions, often achieved via digital signatures.

Kerckhoffs's Principle

Security should rely only on the secrecy of the key, not the secrecy of the algorithm. The system remains secure even if the attacker... Continue reading "Modern Cryptography and Data Security Fundamentals" »

Implementing Dijkstra's Algorithm in Java

Classified in Computers

Written on in English with a size of 2.71 KB

This implementation demonstrates how to find the shortest path from a source node to all other nodes in a graph using Dijkstra's Algorithm.

Core Components

  • minDist: Identifies the node with the minimum distance not yet included in the shortest path tree.
  • print: Displays the calculated shortest distances from the source.
  • dijkstra: The primary logic that updates distances based on the adjacency matrix.
import java.util.*;

public class Main {
    static int V;

    // Find the node with the minimum distance not yet in the shortest path tree
    int minDist(int dist[], Boolean boolset[]) {
        int min = Integer.MAX_VALUE, min_value = -1;
        for (int i = 0; i < V; i++) {
            if (!boolset[i] && dist[i] <= min) {
... Continue reading "Implementing Dijkstra's Algorithm in Java" »

Digital Electronics Concepts: Flip-Flops, Registers, and Converters

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.38 MB

1. JK Flip-Flop Operation and Truth Table

Logic Diagram:

wBjcvJtk2sNIQAAAABJRU5ErkJggg==

EAjrov4gZdUr+SxbQQf9fGi1dW7+IBXTQfxEz6pT8lyzwf4VinCuWPVOZAAAAAElFTkSuQmCC

Working Principle

The JK flip-flop is an enhanced version of the gated SR flip-flop. It incorporates clock input circuitry to eliminate the invalid output condition that occurs when both S and R inputs are logic level "1".

Because of the added clock input, the JK flip-flop offers four distinct input combinations:

  • Logic "1" (Set)
  • Logic "0" (Reset)
  • No Change
  • Toggle

The S and R inputs of the preceding SR bistable are replaced by J and K inputs, named after its inventor, Jack Kilby. Thus, J = S and K = R.

The two 2-input AND gates in the gated SR bistable are replaced by two 3-input NAND gates. The third input of each NAND gate connects to the outputs Q and $\bar{Q}$. This cross-coupling allows the... Continue reading "Digital Electronics Concepts: Flip-Flops, Registers, and Converters" »

Core Web Development Concepts: Languages, Protocols, and Frameworks

Posted by Anonymous and classified in Computers

Written on in English with a size of 332.62 KB

JavaScript: The Heart of Interactive Web Development

JavaScript is a powerful and widely used programming language mainly used for making websites interactive and dynamic. It works on the client-side, which means it runs inside the user's web browser. JavaScript allows web pages to respond to user actions like clicking buttons, typing in text boxes, hovering over images, and more. It works together with HTML (for structure) and CSS (for design) to build modern and user-friendly websites. It is easy to learn and used by almost every website today.

Apart from the client-side, JavaScript is also used on the server-side using platforms like Node.js, which allows building full web applications using JavaScript alone. It is a platform-independent language,... Continue reading "Core Web Development Concepts: Languages, Protocols, and Frameworks" »

Python Fundamentals: Code Examples and Exercises

Posted by Anonymous and classified in Computers

Written on in English with a size of 10.65 KB

Python Operations and Operators

This section covers fundamental operations and operators in Python, which are symbols used to perform operations on values and variables.

# Examples of different operators
a = 10 // 3  # Floor Division
a = 10 % 3   # Modulo Operator
a = 3        # Assignment
b = 1        # Declaring variables
a == b       # Comparison

Types of Operators

Operators are used for operations between values and variables. The main types are:

  • Assignment Operators: Used to assign values to variables.
  • Logical Operators: Used to combine conditional statements.
  • Comparison Operators: Used to compare two values.
  • Arithmetic Operators: Used with numeric values to perform common mathematical operations.
  • Bitwise Operators: Used to compare binary numbers.
... Continue reading "Python Fundamentals: Code Examples and Exercises" »