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

Sort by
Subject
Level

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" »

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" »

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" »

The Importance of File Management: Types, Systems, and Media

Classified in Computers

Written on in English with a size of 5.44 KB

THE FILE: A file is a set of ordered documents that are related by some circumstance or event. It is essential for a company to have a file that is to sort and classify documentation in a particular way.

Why: It allows to keep, store and safeguard information, It can be easily and quickly found, To comply with the law, It can help in the decision-making process

Types of files:

1) Active: documents that are currently being used and queried

2) Semi-active: documents no longer effective but kept for legal reasons

3) Inactive: documents not valid but with a historical or documentary value

The File system: is the criterion used for ordering information.

  • Alphabetical: Information classified in the order of the alphabet *

  • Numerical: information in which each

... Continue reading "The Importance of File Management: Types, Systems, and Media" »

Software Development Principles and Design Patterns

Classified in Computers

Written on in English with a size of 697.56 KB

Key Concepts in Software Development

Complexity: Involves abstraction and decomposition into smaller, manageable problems.

Changeability: Requires effective management and a well-defined Software Development Life Cycle (SDLC).

Testing Before Implementation: Identifies defects early, saving time and resources.

Microsoft SDL: Emphasizes security considerations throughout all phases of the development cycle, including security and privacy risk assessment.

Understanding UML Diagrams

Sequence Diagram: Provides a time-based view of object interactions through function calls, illustrating the interaction among objects.

State Chart: Depicts the sequence of states an object goes through in response to external events, focusing on the state changes of a single

... Continue reading "Software Development Principles and Design Patterns" »

Computer Network Basics: Concepts, Types, and Hardware

Classified in Computers

Written on in English with a size of 4.75 KB

Understanding Computer Networks

A network is created when more than one device is connected together. A network can be a small collection of computers connected within a building (e.g., a school, business, or home) or it can be a wide collection of computers connected around the world.

Data Packet Transmission

The main purpose of networking is to share data between computers. A file has to be broken up into small chunks of data known as data packets in order to be transmitted over a network. The data is then rebuilt once it reaches the destination computer. Networking hardware is required to connect computers and manage how data packets are communicated. Protocols are used to control how data is transmitted across networks.

Local Area Networks

... Continue reading "Computer Network Basics: Concepts, Types, and Hardware" »

The Scrum Guide: Framework for Delivering High-Value Products

Classified in Computers

Written on in English with a size of 4.04 KB

The Scrum Guide

Framework for developing and sustaining complex adaptive problems, while productively and creatively delivering products of the highest possible value. Scrum is lightweight, simple to understand and difficult to master.

The Scrum Team

The Scrum Team: Self-organizing teams choose how best to accomplish their work, rather than being directed by others outside the team. It is designed to optimize flexibility, creativity, and productivity. It consists of:

  • The Product Owner: Responsible for maximizing the value of the product and the work of the team. Responsible for managing the Product Backlog.
  • The Development Team: Professionals who do the work of delivering a potentially releasable increment of 'Done' product at the end of each Sprint.
... Continue reading "The Scrum Guide: Framework for Delivering High-Value Products" »

Software Development and Ethics: A Comprehensive Overview

Classified in Computers

Written on in English with a size of 5.33 KB

What is a software and what is a good software?

A software is a program on a computer which contains information and data. A good software is the one that fulfills the needs and hasn’t got bugs.

Software vs Hardware

Software: not touchable, variable and implemented in order to achieve goals. Hardware: invariable

SOFTWARE ETHICS:

  • Confidentiality - Not telling the others because they can copy.
  • Competence - To know what you’re doing.
  • Intellectual property rights - not steal others ideas because it’s not moral.
  • Computer misuse - don’t do things that you are not allowed to.
  • Stuxnet: virus that will destroy softwares and hardwares.

SOFTWARE EVALUATION PROCESS:

  • Specification: What do I need?
  • Development: The programmer does it.
  • Validation: Does it work?
... Continue reading "Software Development and Ethics: A Comprehensive Overview" »