Notes, summaries, assignments, exams, and problems for Computer science

Deadlock and Semaphores: Concurrency in Operating Systems

Computer science2.21 KB

Understanding Deadlock

A deadlock is a critical situation in which two or more computer programs, sharing the same resource, effectively prevent each other from accessing that resource. This results in both programs ceasing to function or becoming unresponsive.

Historically, the earliest computer operating systems ran only one program at a time, making all system resources available to that single program. As operating systems evolved to run multiple programs concurrently through interleaving, programs initially had to specify their resource needs in advance to avoid conflicts.

The advent of dynamic resource allocation, where programs could request further resources after execution began, introduced the problem of deadlocks. Addressing deadlocks...

Continue reading "Deadlock and Semaphores: Concurrency in Operating Systems" »

IPv6 Packet Structure: Base Header and Extension Headers

Computer science2.54 KB

IPv6 Packet Format: Base Header

Each IPv6 packet consists of a mandatory base header followed by the payload. The payload is made up of two parts: optional extension headers and the upper-layer data. The base header is 40 bytes long, whereas the extension headers and the data from the upper layer can contain up to 65,535 bytes of information.

The base header has 8 fields:

  • Version: A 4-bit field that defines the version of IP, such as IPv4 or IPv6. For IPv6, the value of this field is 6.
  • Priority: A 4-bit field that defines the priority of the packet, which is important in connection with traffic congestion.
  • Flow Label: A 24-bit field designed for providing special handling for a particular flow of data.
  • Payload Length: A 2-byte field used to define
...
Continue reading "IPv6 Packet Structure: Base Header and Extension Headers" »

Digital Media Fundamentals: Audio, Video, and Compression Standards

Computer science6.6 KB

This section addresses key concepts regarding digital media processing, file formats, and data requirements.

  1. Stereo vs. Mono Audio Data Requirements

    Question: What is the difference between stereo and mono audio?

    Answer: Stereo audio usually requires twice as much data as mono audio.

  2. Quickest Audio Format for Web Download

    Question: Which audio format would be quickest to download from a website?

    Answer: AAC (Advanced Audio Coding).

  3. Audio File Format Compatibility

    Statement: All audio file formats will work on all media players.

    Answer: FALSE. Compatibility depends on the specific media player and the codecs supported.

  4. Defining Bit Depth

    Question: What is bit depth?

    Answer: Bit depth is the number of bits it is possible to have in each sample or frame of

...
Continue reading "Digital Media Fundamentals: Audio, Video, and Compression Standards" »

Pascal Code Examples: Arrays, Matrices, and Logic

Computer science5.97 KB

Pascal Code Examples

1. String Search in Array

This program searches for a given name within an array of strings.

Program Pzim;
var
  vet1: array[1..10] of string;
  nome: string;
  i, j: integer;
begin
  j := 0;
  for i := 1 to 10 do
  begin
    write('Enter the names: ');
    readln(vet1[i]);
  end;
  write('Enter the name to be searched: ');
  readln(nome);
  for i := 1 to 10 do
  begin
    if (nome = vet1[i]) then
    begin
      writeln('FOUND');
      j := j + 1;
    end;
  end;
  if (j = 0) then
    writeln('NOT FOUND');
end.

2. Merging Two Arrays

This program merges two arrays (vet1 and vet2) into a third array (vetx).

Program Pzim;
var
  vet1: array[1..5] of integer;
  vet2: array[1..10] of integer;
  vetx: array[1..15] of integer;
...
Continue reading "Pascal Code Examples: Arrays, Matrices, and Logic" »

Report Creation Wizard: Step-by-Step Data Selection

Computer science3.42 KB

Faster Report Creation via Database Window

Another faster way is from the Database window with the object selected (reports) by double-clicking on Create report by using assistant.

First Wizard Window: Field Selection

The first wizard window appears, asking us to enter the fields to include in the report.

  1. Select the table or query where you will fetch data from the Tables/Queries box. This will be the source of the report.
  2. If you pull data from multiple tables, it is best to create a query for the data and then choose that query as the source of the report.
  3. Select the fields by clicking on the field to select it and clicking the > button, or simply double-click on the field.
  4. If you select a field by mistake, press the < button to remove it from
...
Continue reading "Report Creation Wizard: Step-by-Step Data Selection" »

Database Application Lifecycle: Stages and Key Considerations

Computer science3.73 KB

The stages of the database application lifecycle are:

  1. Planning: System and project planning.
  2. Definition: Defining the scope and limits of the database implementation and its interactions with other systems.
  3. Requirements: Collection and analysis of requirements from various sources.
  4. Database Design: Conceptual, logical, and physical database design.
  5. DBMS Selection: Choosing the appropriate Database Management System (DBMS).
  6. Application Design: Designing the application programs that will use and process the database.
  7. Prototyping: Building prototypes of the application for testing and feedback (optional).
  8. Implementation: Creating the database definitions and application programs.
  9. Conversion and Loading: Converting and loading data from an old system to
...
Continue reading "Database Application Lifecycle: Stages and Key Considerations" »

Spreadsheet Tips: Protection, Formatting, and Printing

Computer science3.3 KB

Tasks 10–20

  1. Protect and password-protect sheets in a workbook: Tools > Protection > Protect Sheet > enter a password to unprotect.
  2. Set a background image on a sheet: Format > Sheet > Background > Browse > select image file.
  3. Fill a series (numeric or chronological): numerical and chronological (date, month, etc.): write the first two values, select them, click the bottom-right corner (AutoFill handle) of the selected range and drag.
  4. Apply color to cells or ranges: Format > Cells > Fill (Shading) or Format > Font > Color, respectively.
  5. Draw cell borders: Format > Cells > Border (choose line style, color, and which edges to apply).
  6. Hide gridlines on a sheet: Tools > Options > View > uncheck Gridlines.
...
Continue reading "Spreadsheet Tips: Protection, Formatting, and Printing" »

Spreadsheet Essentials: Cells, Formulas, and Data Management

Computer science2.56 KB

Understanding Spreadsheet Basics

What is a Spreadsheet?

A spreadsheet is a grid with rows and columns, primarily designed for numeric data but also accommodating alphabetic entries to organize information effectively.

Each individual spreadsheet is referred to as a sheet. Each sheet has a label or name, visible at the bottom of the workbook or worksheet interface. When a new workbook is created, Excel typically opens with three default sheets: Sheet 1, Sheet 2, and Sheet 3. These names can be customized by the user, and additional sheets can be added or removed as required.

Workbook Explained

A workbook is the collection of worksheets within a single document. Multiple workbooks can be open simultaneously in separate windows.

Active Cells and Selection

A...

Continue reading "Spreadsheet Essentials: Cells, Formulas, and Data Management" »

Programming Language Basics & Database Models

Computer science3.29 KB

Programming Language Fundamentals

Level Classification

  • Low Level: Resembles the language used by the computer directly.
  • High Level: Resembles human language, abstracting machine details.

Generations of Programming Languages

  • 1st Generation (1GL): Machine Language
  • 2nd Generation (2GL): Assembler
  • 3rd Generation (3GL): High-level languages (e.g., Fortran, Pascal, C, C++, Cobol)
  • 4th Generation (4GL): Languages for specific purposes (e.g., web development, PHP, Java, HTML)

Key Programming Concepts

Program

A set of instructions or orders based on a programming language that a computer interprets to solve a problem or perform a specific function.

Programming Language

Tools that allow us to create programs and software. An artificial language used to define a sequence...

Continue reading "Programming Language Basics & Database Models" »

Computer System Components: I/O, Buses & Peripherals Explained

Computer science3.15 KB

Input/Output (I/O) Units

I/O units connect the system to the outside world, enabling the introduction and extraction of information. These units typically consist of registers operated by control buses, storing address information from the data bus. Their outputs are externally accessible for connecting to various devices.

Another crucial function of I/O units is to adapt:

  • The format of signals from outside to the format of internal signals.
  • Working speeds.
  • Voltage levels.
  • Binary codes.

System Buses

All elements of a programmable microsystem are interconnected by information channels, commonly known as buses. These buses are composed of multiple lines, each designed to transmit information of a specific type. The number of lines forming a bus determines...

Continue reading "Computer System Components: I/O, Buses & Peripherals Explained" »