Notes, summaries, assignments, exams, and exercises for Computer science for Primary education

Linux Shell Programming with Bash and the vi Editor

Computer science6.71 KB

🐚 Introduction to Shell Programming in Linux

Shell programming is the process of writing shell scripts—sequences of commands executed by the command-line interpreter (the shell, typically Bash) to automate tasks. It leverages command-line utilities, variables, and control flow structures to create powerful programs.

✍️ The vi Editor

The vi (or vim) editor is a text-based, modal editor crucial for writing shell scripts and editing configuration files in Linux. It operates in distinct modes:

ModeFunctionKey Commands
Command ModeThe default mode used for navigation, deletion, copying, and pasting.h, j, k, l for cursor movement; dd to delete a line.
Insert ModeUsed for typing and editing text.i (insert before cursor), a (append after cursor)
...
Continue reading "Linux Shell Programming with Bash and the vi Editor" »

Data Integrity and Number Systems in Computing

Computer science9.13 KB

This is a great request covering two fundamental areas of digital communications and computing!
1. Error Detecting and Correcting Codes
Error control codes are essential for ensuring data integrity during transmission or storage by adding redundancy (extra bits) to the original data.
A. Error Detection Codes
These codes can only signal that an error has occurred but cannot determine the location of the error to fix it.
| Code | Principle | Capability |
|---|---|---|
| Parity Check (Simplest) | An extra bit (parity bit) is added to the data word to make the total number of '1's either even (Even Parity) or odd (Odd Parity). | Detects any single-bit error or any odd number of errors. Cannot detect an even number of errors. |
| Checksum | Data is divided...

Continue reading "Data Integrity and Number Systems in Computing" »

Telecom Standards: Business Values, Bodies, and Acronyms

Computer science2.5 KB

Business Values of Telecom Standardization for Operators

  1. Multiple sources of supply (decrease risk of sole supplier dependencies/lock-in, improve choice at competitive prices).
  2. Interoperability, e.g., multi-vendor networks, service interop.
  3. Assurance that investment in technology should not abruptly change or fail.

Business Values of Telecom Standardization for Vendors

  1. Network vendors can sell to all service operators, freed from vendor-specific R&D.
  2. Reduce customization.
  3. Build reputation / customer confidence - strong standards brand.
  4. Larger markets from wide adoption, greater economies of scale.

Types of Standards Bodies

  1. Accredited
  2. Treaty-based
  3. Partnerships

Telecom Acronyms Explained

  1. ITU: International Telecommunication Union
  2. IETF: Internet Engineering
...
Continue reading "Telecom Standards: Business Values, Bodies, and Acronyms" »

Understanding Information Systems and Network Topologies

Computer science4.61 KB

1. Information System Definition and Functions

An information system is an organized system for the collection, organization, storage, and communication of information. It is the study of networks that people and organizations use to collect, filter, process, create, and distribute data. Essentially, it's a group of components that interact to produce information.

Objectives:

  • Efficient management of data and information
  • Improvement of business processes
  • Creation of value

The main functions are:

  • Capturing internal and external data
  • Data processing
  • Distributing information to users

2. Centralized vs. Distributed Information Systems

Centralized Systems

In a centralized system, all calculations are done on one particular computer.

Distributed Systems

In a distributed...

Continue reading "Understanding Information Systems and Network Topologies" »

File System Journaling: Mechanisms, ext3, and NTFS Recovery

Computer science3.75 KB

Journaling Motivation and Necessity

File System Check (FSck) ensures metadata consistency after crashes but is slow and requires deep file system knowledge. Recovery time should ideally depend on the number of recent writes.

File System Transactions and ACID Properties

Transactions provide ACID guarantees:

  • Atomicity
  • Consistency
  • Isolation
  • Durability

These are used to treat file system operations (like file creation) as transactions. Recovery ensures committed transactions are applied and uncommitted ones are discarded.

ext3 Journaling File System

ext3 is a journaling file system using physical redo logging, adding journaling to existing ext2 structures.

Redo Logging Mechanism in ext3

The process involves writing updates to a journal first, then committing...

Continue reading "File System Journaling: Mechanisms, ext3, and NTFS Recovery" »

Operating System Concepts: Loaders, Memory, Processes, Synchronization

Computer science26.57 KB

Compile and Go Loaders

In this type of loader, the linker and loader instructions are read line by line, their machine code is obtained, and it is directly placed in the main memory at some known address. This means the assembler runs in one part of memory, and the assembled machine instructions and data are directly put into their assigned memory locations. After completion of the assembly process, the loader contains the instruction using which the location counter is set to the start of the newly assembled program. A typical example is WATFOR-77, a FORTRAN compiler which uses such a "load-and-go" scheme. This loading scheme is also called "assemble-and-go".

Advantages

  • Simplicity
  • Quick Testing
  • No Separate Linking
  • Immediate Feedback
  • Low Resource
...
Continue reading "Operating System Concepts: Loaders, Memory, Processes, Synchronization" »

Security Vulnerability Domains and Technical Analysis

Computer science3.94 KB

Security Vulnerability Domains

This table outlines critical domains in security, detailing their underlying assumptions, common flaws, and defensive strategies.

DomainDefinitionPurposeRoot AssumptionTypical FlawExploited byAttacker NeedsObservable EffectConsequenceDifficultyMain DefensesExam Trigger Words
CertificationThird-party statement of complianceBuild trustRequirements well-definedWrong scopeCompliance gamingDocs, audits“Certified but insecure”False sense of securityMediumISO 17000 familyattestation, conformity
RepeatabilitySame tester, same setupReliabilityOperator consistencyHuman variancePoor testingSame labInconsistent resultsInvalid certLowCalibrationsame setup
ReproducibilityDifferent testers, same resultObjectivityMethod independenceWeak
...
Continue reading "Security Vulnerability Domains and Technical Analysis" »

Java File Handling: Reading Text and Managing Files

Computer science4.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" »

Operating System Concepts: Hardware Interaction and Scheduling

Computer science1.45 MB

Operating System Fundamentals

The Operating System (OS) serves several critical roles:

  • It acts as a resource manager, controlling access to the hardware.
  • It provides an abstraction layer, allowing user processes to call functions that access hardware via system calls.

User Mode vs. Supervisor Mode (Kernel Mode)

The CPU enforces separation between user processes and the OS kernel:

  • User Mode: Prohibits privileged instructions.
  • Kernel Mode (Supervisor Mode): Allows access to all hardware and privileged operations.

Program Status Word (PSW)

The PSW is a special register holding vital information, such as:

  • Access privilege mode.
  • Runtime execution conditions (e.g., condition codes).
  • Program Counter (PC) and Stack Pointer (SP).

Simplified Interrupt Handling Flow

  1. A
...
Continue reading "Operating System Concepts: Hardware Interaction and Scheduling" »

Predictive Modeling Techniques in Data Mining

Computer science4.25 KB

CH6

Predictive Modeling Techniques

61) Predictive modeling is perhaps the most commonly practiced branch in data mining. What are three of the most popular predictive modeling techniques?

Answer:

  • Artificial neural networks
  • Support vector machines
  • k-nearest neighbor

62) Why have neural networks shown much promise in many forecasting and business classification applications?

Answer: Because of their ability to "learn" from the data, their nonparametric nature (i.e., no rigid assumptions), and their ability to generalize.

Understanding Neural Networks

63) Each ANN is composed of a collection of neurons that are grouped into layers. One of these layers is the hidden layer. Define the hidden layer.

Answer: A hidden layer is a layer of neurons that takes input...

Continue reading "Predictive Modeling Techniques in Data Mining" »