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

Sort by
Subject
Level

Flowcharts, Programming Languages, and the C Language

Classified in Computers

Written on in English with a size of 5.56 KB

Understanding Flowcharts

The pictorial or graphical representation of the flow of a program is known as a flowchart. If algorithms or programs are displayed in the form of a picture, then it will be more noticeable and recognizable. We only need to know some specific shapes to represent each process or action. The fundamental shapes and descriptions used in flowcharts are as follows:

  • Rhombus: For decision-making and branching the flow of execution.
  • Rectangle: For processing and assigning variables.
  • Parallelogram: Accessing inputs and printing outputs.
  • Rectangle with Curved Edges: Start/Begin or Stop/End of the program execution.
  • Circle: Connectors to continue the flow of execution.
  • Arrow: Represents the direction of the flow of execution.

j9uY63M2wBnveRcyLNUIT34Tu4aWeSqdlhox9JkprjEzmiyBmtmP8KZOE9ItyPleqb820RulOWNBK3GMhvqLvE3HpnmwwrHzb7DE88UBI3YtVUPP5F33nd5VQA0aF_e2ICZ6AW7YV-ajFuT7HcyJt-c4Xh9Iektloljd0DiRGjXFpHgP_xKeDfpPLZEH2Q


Programming

... Continue reading "Flowcharts, Programming Languages, and the C Language" »

Multi-Threaded TCP Game Server Implementation

Classified in Computers

Written on in English with a size of 1.34 KB

Clientes ligam-se a servidor por TCP para jogarem. Pode ter entre 20 a 30 jogadores, de preferência 30, mas se jogador esperar mais de 1 minuto a partida começa com pelo menos 20. O jogador envia o nome ao servidor e fica à espera que o jogo comece e nessa altura é informado dos nomes dos outros.
1. Apresentar uma classe que implementa a interface em que os métodos têm que ser invocados em multi-thread.
Interface Jogo { List inscrever(String nome);}
public class Cliente {
public Cliente(Socket s) throws Exception {
PrintWriter pw = new PrintWriter(s.getOutputStream(), true);
BufferedReader bf = new BufferedReader(new InputStreamReader(s.getInputStream()));
BufferedReader terminal = new BufferedReader(new InputStreamReader(System.in))
... Continue reading "Multi-Threaded TCP Game Server Implementation" »

Java Binary Tree Methods for World Entity Management

Classified in Computers

Written on in English with a size of 4.28 KB

Practica 6: World Class Implementation

This implementation focuses on managing entities within a World data structure using a binary tree approach.

Method: insert

The insert method handles the placement of an Entity at a specific address.

public void insert(String address, Entity e) {
    if (content == null) escribirContenido(content, e, address);
    if (address.equals("")) escribirContenido(content, e, address);
    else {
        if (address.substring(0, 1).equals("L")) {
            address = address.substring(1, address.length());
            travelLeft().insert(address, e);
        } else {
            address = address.substring(1, address.length());
            travelRight().insert(address, e);
        }
    }
}

Method: escribirContenido

A... Continue reading "Java Binary Tree Methods for World Entity Management" »

How Cell Phones Work: From Analog to Digital

Classified in Computers

Written on in English with a size of 2.15 KB

The Evolution of Mobile Phones

Mobile phones, also known as cell phones, emerged in the 1980s as bulky, analog devices relying on unencoded radio wave transmissions. These early models quickly evolved, shrinking in size and transitioning to digital technology, ushering in the second generation (2G) era. This shift enabled faster transmission speeds and paved the way for features like images, messaging, and sound.

Advancements in Technology: 3G and 4G

The early 2000s witnessed remarkable technological leaps with the introduction of 3G in 2001, followed by 3G+ and 4G. These advancements significantly boosted speed and capacity, transforming mobile phones into versatile multimedia devices capable of much more than just making calls.

How Cell Phones

... Continue reading "How Cell Phones Work: From Analog to Digital" »

Understanding Operating Systems: Traps, Interrupts, System Calls, and Threads

Classified in Computers

Written on in English with a size of 3.94 KB

What is the Key Difference Between a Trap and an Interrupt?

A trap is caused by the program and is synchronous with it. If the program is run again and again, the trap will always occur at exactly the same position in the instruction stream. An interrupt is caused by an external event and its timing is not reproducible.

Why is the Process Table Needed in a Timesharing System?

The process table is needed to store the state of a process that is currently suspended, either ready or blocked. It is not needed in a single-process system because the single process is never suspended.

Is the Process Table Needed in Personal Computer Systems With Only One Process?

No, it is not needed in a single-process system because the single process is never suspended.... Continue reading "Understanding Operating Systems: Traps, Interrupts, System Calls, and Threads" »

Thread Synchronization, Priority Inversion, and CPU Efficiency

Classified in Computers

Written on in English with a size of 2.18 KB

Can the Priority Inversion Problem Happen with User-Level Threads?

The priority inversion problem occurs when a low-priority process is in its critical region and suddenly a high-priority process becomes ready and is scheduled. With user-level threads, it cannot happen that a low-priority thread is suddenly preempted to allow a high-priority thread to run. There is no preemption. With kernel-level threads, this problem can arise.

Does Round-Robin Scheduling Resolve Priority Inversion?

Round-robin scheduling can resolve the issue. Sooner or later, the low-priority process will run and eventually leave its critical region. With priority scheduling, the low-priority process never gets to run at all; with round-robin, it gets a normal time slice periodically,... Continue reading "Thread Synchronization, Priority Inversion, and CPU Efficiency" »

Understanding Computer Output Devices and Printing Technology

Classified in Computers

Written on in English with a size of 3.64 KB

Output Devices

Dot Matrix Printers

Dot matrix printers are known for their ability to handle continuous forms and harsh environments.

Advantages

  • Can print long jobs.
  • Inexpensive to maintain.
  • Can work in dirty atmospheres.
  • Can print different characters.

Disadvantages

  • Expensive to purchase.
  • Noisy operation.
  • Poor quality printing.

Inkjet Printers

Inkjet printers are made up of a print head, ink cartridge, motor, and paper feed mechanism.

General Printer Operation

The following steps describe how a typical printer processes a job:

  1. Data is sent to the printer driver via USB.
  2. The data is converted into a form the printer understands.
  3. The system checks whether the job is able to be printed.
  4. The printer receives data in the printer buffer (temporary memory), allowing
... Continue reading "Understanding Computer Output Devices and Printing Technology" »

MPEG Audio Compression: Understanding the Fundamentals

Classified in Computers

Written on in English with a size of 2.71 KB

Introduction

The principle of MPEG audio compression is quantization. However, the values being quantized are not the audio samples themselves, but rather numbers (called signals) taken from the frequency domain of the sound.

Encoding Process

  1. Bit Allocation: The encoder knows the compression ratio (or bit rate), allowing it to determine how many bits to allocate to the quantized signals. The adaptive bit allocation algorithm uses the bitrate and frequency spectrum of recent audio samples to minimize audible quantization noise (the difference between the original and quantized signal).
  2. Discrete Fourier Transform: Psychoacoustic models, which determine the quantization coarseness, rely on sound frequency. Since the input is audio samples, the first
... Continue reading "MPEG Audio Compression: Understanding the Fundamentals" »

Professional Web Layouts and Modern Design Components

Classified in Computers

Written on in English with a size of 949 bytes

Main Title Section

Secondary Subtitle

Jhvyftubnhybutfvubhjytcvbuhvfycvgkjhvbfx cjgh jvhubuh vbyvby vbuygb hbvhb uv.

Danger Action

Main Title Section

Secondary Subtitle

Jhvyftubnhybutfvubhjytcvbuhvfycvgkjhvbfx cjgh jvhubuh vbyvby vbuygb hbvhb uv.

Danger Action

Hydibfugybsyufbesuy

Main Title Section

Secondary Subtitle

Jhvyftubnhybutfvubhjytcvbuhvfycvgkjhvbfx cjgh jvhubuh vbyvby vbuygb hbvhb uv.

Danger Action

Hqhwvxsvxjvjjkkwqhdyhdighvehdbevdbnmwdbmwbdnvwdvndmdmmdjwdjwmd.

Hqhwvxsvxjvjjkkwqhdyhdighvehdbevdbnmwdbmwbdnvwdvndmdmmdjwdjwmd.

© 2021 Company, Inc.

Java File Handling: Reading Text and Managing Files

Classified in Computers

Written on in English with a size of 4.37 KB

Java File Handling Examples: Reading Text and Managing Files

This document presents two distinct Java examples demonstrating fundamental Input/Output (I/O) operations, including reading data from text files and managing file existence and metadata.

Example 1: Reading and Summing Numbers from a Text File

This program reads characters from a file named pepe.txt using FileReader. It attempts to parse and sum numerical values found within the file. Note the specific logic used for character processing and summation.

Java Code: Summing File Contents (EjerciciosFiletexto2)

package ejerciciosfiletexto2;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author thene
 */
public class EjerciciosFiletexto2 {    
    /**
     * @param args
... Continue reading "Java File Handling: Reading Text and Managing Files" »