Notes, summaries, assignments, exams, and exercises for Computer science for University

Essential Information Technology Fundamentals

Computer science3.46 KB

Information Technology Fundamentals

Information Technologies: These are the tools and methods used to collect, store, handle, or distribute information.

Hardware: This includes any physical component of technology that works or somehow interacts with the computer.

Characteristics of the Third Generation of Computers

  • Integrated Circuit Chips: These chips comprise thousands of transistors on a silicon wafer.
  • Performance: They offer increased processing speed and improved existing storage systems.
  • New Programming Languages: Introduction of Pascal, BASIC, and Logo.

Software: This refers to all the intangible components of the computer; it is a group of programs.

RAM (Random Access Memory): This temporarily stores data and instructions; it is measured in...

Continue reading "Essential Information Technology Fundamentals" »

Types of Databases: Relational, Object-Oriented, Geographic and Distributed

Computer science4.12 KB

Relational Databases (BDR)

Relational databases (BDR) are a collection of tables with unique names, which may be related to one or more other tables. Concepts such as referential integrity and primary keys ensure that a value referenced in one table is present in the table being referenced, and that a set of information can be represented consistently and accessed independently.

Object-Oriented Databases (BDOO)

Object-oriented databases (BDOO) have three main pillars: inheritance, polymorphism and encapsulation. This model offers greater flexibility in manipulation and a richer content structure, and objects can be handled consistently.

Conventional Databases vs. New Application Requirements

Conventional database systems feature uniformity among...

Continue reading "Types of Databases: Relational, Object-Oriented, Geographic and Distributed" »

Understanding Open Systems and the OSI Model

Computer science2.77 KB

Open Systems Architecture

This definition refers to computer systems architecture that enables interconnection and easy distribution.

Key Features

  • Not tied to a single type of proprietary hardware.
  • Integrated information environment.
  • Meets and/or generates standards.
  • General specifications.
  • High degree of software portability.
  • Flexibility of programming languages.
  • Management of different operating environments.

Data Packets

The data packet contains the source address, where it generates the packet, and the destination address.

Transmission Medium

A medium is the material through which data travels. It can be any of the following materials:

  • Telephone cables
  • UTP coaxial cable
  • Fiber optic

Communication Protocols

A set of rules, or an agreement, which determines...

Continue reading "Understanding Open Systems and the OSI Model" »

Linux System Administration Knowledge Validation and Command Reference

Computer science4.78 KB

Linux System Administration Knowledge Check

I. Processes and System Management Fundamentals

  1. The processes are: F.
  2. An orphan process: V.
  3. The Kill Command: F.
  4. The top command: V.
  5. For information: V.

II. File System, Commands, and Permissions

Any information or documents: F. The dir command: F. Hidden files: V. If in a line: V. The command ls /etc/f*: V. The /etc/fstab file: F. Even though we have: F. Using the grep command: F. cp -i: F. The mv -r command: F. bzip2: F. To decompress: V. The command passwd: F. To list the contents: F. To mount a directory: F. ln /home/pepe/public: F. The command who: V. The command line root@: F. chmod g+x: F.

III. Networking and Connectivity Configuration

wget -r: V. Network interfaces: V. Any user: F. No user: F. Get...
Continue reading "Linux System Administration Knowledge Validation and Command Reference" »

Implementing POSIX Barriers and MPI Custom Data Types

Computer science1.96 KB

Custom POSIX Barrier Implementation

This structure defines a custom barrier for thread synchronization:

typedef struct {
    int total;          // Expected threads
    int count;          // Arrived threads
    int phase;          // Current phase (for reuse)
    pthread_mutex_t mutex;
    pthread_cond_t  cond;
} barrier_t;

Barrier Initialization and Destruction

  • Init: Sets the total thread count and initializes synchronization primitives.
  • Destroy: Cleans up mutex and condition variables.

Barrier Wait Logic

The barrier_wait function ensures all threads reach the synchronization point before proceeding, utilizing a phase-based approach to allow barrier reuse.

MPI Vector Types for Chessboard Patterns

Using MPI_Type_vector to handle non-contiguous memory...

Continue reading "Implementing POSIX Barriers and MPI Custom Data Types" »

CSAPP Core Concepts Reference: Compilation, Data Representation, x86-64 Assembly, Caching, Linking, Processes and Virtual Memory

Computer science32.84 KB

Chapter 1: Program Generation and Execution

The compilation process consists of 4 steps:

  1. Preprocessing: Input a .c file, output a .i file. It expands all macro definitions, processes #include (inserts header file contents), handles conditional compilation directives such as #ifdef, and removes comments.
  2. Compilation: Input a .i file, output a .s file (assembly code). It translates C into assembly language, performing syntax analysis, semantic analysis, and optimization.
  3. Assembly: Input a .s file, output a .o file (relocatable object file). It translates assembly language into machine code (binary), but addresses are not yet determined.
  4. Linking: Input multiple .o files and library files, output an executable file. It performs symbol resolution (associating
...
Continue reading "CSAPP Core Concepts Reference: Compilation, Data Representation, x86-64 Assembly, Caching, Linking, Processes and Virtual Memory" »

Essential PHP Programming Examples for Beginners

Computer science1.26 KB

Addition of Two Numbers

<?php
if(isset($_POST['n1']) && isset($_POST['n2'])){
    $n1 = $_POST['n1'];
    $n2 = $_POST['n2'];
    $res = $n1 + $n2;
    echo "<h3>User Input Numbers:</h3>";
    echo "First Number = $n1 <br>";
    echo "Second Number = $n2 <br>";
    echo "Sum = $res";
}
?>

Enter Two Numbers:





PHP Conditional, Loops and Arrays Example

<?php
echo "<h3>Loop Example (1 to 5):</h3>";
for($i=1;$i<=5;$i++){
    echo "Number: $i <br>";
}
echo "<h3>Array Example:</h3>";
$fruits = array("Apple","Banana","Mango","Orange");
foreach($fruits as $f){
    echo "$f<br>";
}
?>

Student Registration Form

Name:

Email:

Gender:
Male
Female

Subjects:
Math
Science
English

Course:

...
Continue reading "Essential PHP Programming Examples for Beginners" »

Essential C++ Pointer and Array Manipulation Techniques

Computer science3.16 KB

C++ Pointer and Array Operations

This collection demonstrates fundamental C++ techniques for handling pointers, arrays, and memory management.

Core Functions

void squareByPointer(int* n) { 
    *n = (*n) * (*n);
}

void capitalizeFirst(char* word) { 
    word[0] = toupper(word[0]);
}

void fillWithSquares(int* arr, int size) {
    for (int i = 0; i < size; i++)
        arr[i] = i * i;
}

int sumArray(const int* arr, int size) {
    int sum = 0;
    for (int i = 0; i < size; i++)
        sum += arr[i];
    return sum;
}

void swap(int& a, int& b) {
    int temp = a;
    a = b;
    b = temp;
}

int* makeFilledArray(int size, int val) {
    int* arr = new int[size];
    for (int i = 0; i < size; i++)
        arr[i] = val;
    return
...
Continue reading "Essential C++ Pointer and Array Manipulation Techniques" »

JavaFX Calculator Application: Complete Source Code

Computer science9.89 KB

JavaFX Calculator Implementation

This implementation defines a desktop calculator application built using JavaFX, utilizing a BorderPane and GridPane to manage the user interface components.

Complete JavaFX Source Code

import javafx.application.*;
import javafx.stage.*;
import javafx.event.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.scene.input.*;
import javafx.scene.paint.Color;

public class Main extends Application {
int operation = -1;
double data = 0;
private TextField Resultado;

public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Calculadora");
Group G = new Group();
...
Continue reading "JavaFX Calculator Application: Complete Source Code" »

Essential Python Programming Snippets and Algorithms

Computer science3.17 KB

Jabber JID to Email Conversion

def jid2email(jid):
    email = jid[:jid.find('/')]
    return email

if __name__ == '__main__':
    jabber = '[email protected]/quertyy'
    print(jid2email(jabber))

Lists vs. Tuples

Lists are mutable and can be changed by internal operations, whereas tuples are immutable.

Remove Duplicates from String

def remove_dup(string):
    result = []
    for char in string:
        if char not in result:
            result.append(char)
    return ''.join(result)

Identical Character Count

def count_max(in_string):
    d = dict()
    for c in in_string:
        d[c] = d.get(c, 0) + 1
    return max(d.items(), key=lambda x: x[1])

# Using collections
from collections import Counter
def counter_max(in_string):
    return Counter(in_
...
Continue reading "Essential Python Programming Snippets and Algorithms" »