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

Sort by
Subject
Level

C++ Algorithms: Frequency Counting, ISBN Validation, and Horner's Method

Classified in Computers

Written on in English with a size of 5.51 KB

Counting Frequencies Algorithm in C++

This C++ implementation demonstrates a method for counting the frequencies of input integers while maintaining a sorted list of unique values. It utilizes custom functions for insertion and shifting elements.

Data Structure Definition

#include <iostream>
#include <vector>
using namespace std;

struct lon{
    int dig, vez; // digit, count (vezes)
};

Helper Functions: Shifting and Positioning

The mover function shifts elements to make space for a new insertion, and donde_poner finds the correct sorted position for a new digit.

void mover(vector<lon>& a, const int& pos, const int& ini){
    for(int i = pos; i > ini; --i){
        a[i].dig = a[i-1].dig;
        a[i].vez = a[i-1]
... Continue reading "C++ Algorithms: Frequency Counting, ISBN Validation, and Horner's Method" »

TCP/IP Transport Layer Fundamentals Explained

Classified in Computers

Written on in English with a size of 4.01 KB

TCP/IP Transport Layer Fundamentals

1. Transport Layer Header & Session Description

On the basis of the transport layer header shown in the diagram (not provided), what statements describe the established session?

This TCP header contains a Telnet request.

2. TCP/IP Data Encapsulation & Known Port Numbers

With TCP/IP data encapsulation, which range of port numbers identifies all known applications?

0-1023

3. Purpose of Port Numbers in TCP Headers

Why are port numbers included in the TCP header of a segment?

To allow a receiver to transmit data to the appropriate application.

4. OSI Model Layer for Reliable Flow Control

What OSI model layer is responsible for regulating the flow of information from the source to destination, reliably and accurately?... Continue reading "TCP/IP Transport Layer Fundamentals Explained" »

CPU Register Types and Functions

Classified in Computers

Written on in English with a size of 3.48 KB

CPU Internal Registers

Internal registers are a set of temporary storage units available to the Central Processing Unit (CPU) for its operation. They serve as high-speed storage locations within the CPU itself.

The size of these registers depends on the function to be performed and the type of CPU. They generally match the size of the Data Bus or the Address Bus.

Classification of CPU Registers

CPU registers are broadly classified into two main types:

  • Inaccessible Registers: Not directly controllable by the user.
  • Accessible Registers: Controllable by the user.

Inaccessible Registers

Inaccessible registers are those whose operation or content the user cannot directly control. They are for the exclusive and restricted use of the CPU. From the user's... Continue reading "CPU Register Types and Functions" »

Understanding Network Devices and Protocols in IT

Classified in Computers

Written on in English with a size of 3.46 KB

1. Device Type in the Central Area

Which term correctly identifies the device type that is included in the central area?

2. Factory Default Settings

All devices shown in the image have factory default settings. How many broadcast domains are represented in the topology shown?

3. Appropriate Device Type for Interference

The most appropriate type for use in an environment where there are multiple sources of interference (EMI or RFI) corresponds to:

4. PDU in the Transport Layer

The PDU in the transport layer of the OSI model is:

5. Development of IPv6

What is the main reason for the development of IPv6?

6. Application Layer Protocol for File Transfer

What protocol in the application layer is commonly used to facilitate the transfer of files between a client... Continue reading "Understanding Network Devices and Protocols in IT" »

Machine Learning Algorithms: Concepts and Criteria

Classified in Computers

Written on in English with a size of 4.32 KB

Decision Trees

Key Characteristics

  • Advantages:
    • Easy to implement
    • Can extract rules
    • Non-incremental (more efficient and practical, without backtracking)
  • Disadvantages:
    • Objective function must be discrete
    • Primarily for classification problems

Stop Criteria

  • All examples belong to the same class
  • All samples have the same value for attributes
  • The gain on each split is insignificant
  • The number of samples has reached a certain limit

Overfitting Problem

If the number of nodes is too large, decisions are made based on very small partitions of the samples, which reduces generalization ability.

Formulas

Entropy (Ent):

Ent(S) = -(p+ * log2(p+)) - (p- * log2(p-))

Where:

  • S is the set of examples for that node.
  • p+ is the probability of positive outcomes.
  • p- is the probability
... Continue reading "Machine Learning Algorithms: Concepts and Criteria" »

Key Concepts in Operating Systems

Classified in Computers

Written on in English with a size of 3.92 KB

Operating System Process Management

Process States

Different states a process can be in:

  • Execution: The process is executing instructions and has been granted CPU time.
  • Ready: A process is ready to be executed, waiting for its turn to use its time slice and access system resources.
  • Blocked: The process is held or blocked for some reason, waiting for an event (e.g., I/O completion).

Process State Transitions

Transitions between process states:

  • Transition A: Occurs when a running process needs a resource, signal, etc., to continue execution and moves to the blocked state.
  • Transition B: Occurs when a process has used its allocated CPU time slice and moves from execution back to the ready state.
  • Transition C: Occurs when a process in the ready state moves
... Continue reading "Key Concepts in Operating Systems" »

Memory Paging and Virtual Address Space Management

Classified in Computers

Written on in English with a size of 3.18 KB

Memory Paging Fundamentals

Paging consists of dividing physical memory into fixed-size sections called frames and logical memory into sections of the same size called pages.

The paging system solved the problem of allocating blocks of equal size using physical memory called page frames.

Page Faults and Replacement

A page fault occurs when referring to a page that is not loaded in any page frame. A page replacement (or page out) is required because the total virtual address space of all processes exceeds the size of physical storage.

Functional Requirements

  • Administration of address space.
  • Address translation.
  • Management of physical memory.
  • Memory protection.
  • Shared memory.
  • Load monitoring system.
  • Mapping files into memory, program execution on remote nodes,
... Continue reading "Memory Paging and Virtual Address Space Management" »

Vijeo Designer HMI XBT-G Configuration

Classified in Computers

Written on in English with a size of 5.33 KB

1) Entering Configuration Screen

To enter the configuration screen from runtime mode:

  • It depends on the configuration of the last application downloaded.

2) Dip Switch Settings

According to the dip switch settings shown in the figure:

  • Starting from the CF card is disabled, you can download, and forced closure is disabled.

3) Screen Ventilation

To facilitate the ventilation of the screen, the manufacturer recommends a minimum distance of 100mm from any adjoining structure or equipment.

4) XBT-G LED Indicator

If the LED on the right side of the XBT-G screen lights orange, this means:

  • Backlight is off.

5) COM1 Connector (SUB D25)

The female SUB D25 connector, COM1, of the XBT-G screen is used for:

  • Serial communication with the PLC.

6) XBT-G Back Protection

The

... Continue reading "Vijeo Designer HMI XBT-G Configuration" »

Comparative Analysis of Operating System Memory Management (Linux, Solaris, W2K)

Classified in Computers

Written on in English with a size of 3.34 KB

Memory Management in Linux

Page Allocation Mechanism

Linux defines a mechanism for dealing with contiguous blocks of pages corresponding to blocks of contiguous page frames in main memory. For this, it uses the buddy system, where the kernel maintains a list of groups of contiguous page frames of fixed size.

Page Replacement Algorithm

The Linux page replacement algorithm is based on the Clock algorithm (also known as NUR or NRU), which associates a use bit and a modification bit with each page in main memory.

Memory Management in Solaris

Paging System

Machine-Independent Data Structures

For paged virtual memory, Solaris uses a series of data structures that are independent of the machine:

  • Page Table: Each process has a table with an entry for every
... Continue reading "Comparative Analysis of Operating System Memory Management (Linux, Solaris, W2K)" »

Fundamentals of C Programming and Computer Concepts

Classified in Computers

Written on in English with a size of 4.69 KB

Computer and Program Concepts

Program: A set of instructions to the computer written in a language understood by it.

Computer: Electronic machine.

Byte: The amount of information used by a computer to represent a character; a byte is a string of 8 bits.

Machine code: Binary encoding of a set of instructions.

Languages and Translators

Assembly language: A language that uses mnemonic codes to specify hardware operations.

Mnemonic code: An easy-to-remember word that represents a task to be performed by the processor.

High-level language: Languages that use terminology closer to human language.

Compiler: A program that translates a program written in a high-level language into machine language.

Linker: A program tasked with incorporating the library functions... Continue reading "Fundamentals of C Programming and Computer Concepts" »