Notes, summaries, assignments, exams, and exercises for Computer science for Vocational training

Book Search App with OpenLibrary API and LocalStorage

Computer science8.38 KB

Obtener elementos del DOM

const resultsContainer = document.getElementById('results');
const favoritesContainer = document.getElementById('favorites');
const readContainer = document.getElementById('read');

Buscar libros en OpenLibrary usando fetch().then()

function fetchBooks(query, limit = 10, callback) {
  fetch(`https://openlibrary.org/search.json?q=${encodeURIComponent(query)}&limit=${limit}`)
    .then(res => res.json())
    .then(data => {
      const books = data.docs || [];
      callback(books);
    })
    .catch(err => {
      console.error("Error fetching books:", err);
    });
}

Guardar en localStorage si no está duplicado

function saveToLocalStorage(key, book) {
  const stored

...
Continue reading "Book Search App with OpenLibrary API and LocalStorage" »

Práctica Pokémon XSLT con Lenguaje de Marcas

Computer scienceUpdated on 6.71 KB

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"><html><head><title>Práctica Pokémon XSLT</title><link rel="stylesheet" type="text/css" href="Practica5_OchandoRodriguezAdrian.css"/></head><body id="cuerpo"> <xsl:apply-templates/></body></html> </xsl:template> <xsl:template match="jugador"><div id="cabecera"><h2>Mi aplicación Pokémon</h2></div><div id="fondo"><div id="menu"><div id="playerData"><h3>Ficha del Entrenador</h3><div id="entrenador"> <xsl:choose> <xsl:when test="./chico"> <img src="files/chico.jpg"
...
Continue reading "Práctica Pokémon XSLT con Lenguaje de Marcas" »

Windows Server 2003: Remote Installation, DHCP, Remote Desktop and DNS

Computer scienceUpdated on 2.83 KB

Remote Installation Services (RIS)

Remote Installation Services (RIS) are defined as software that lets an administrator configure new client computers remotely, without having to work directly on each client computer. The target clients must support remote booting.

Requirements for RIS

The use of Remote Installation Services requires several components that are pre-installed on the Windows 2003 Server operating system, specifically including:

  • Domain Name System (DNS Service)
  • Dynamic Host Configuration Protocol (DHCP)
  • Active Directory

Dynamic Host Configuration Protocol (DHCP)

The Dynamic Host Configuration Protocol (DHCP) is a TCP/IP standard designed to simplify the administration of IP configuration for network equipment. A DHCP server is a server...

Continue reading "Windows Server 2003: Remote Installation, DHCP, Remote Desktop and DNS" »

BIOS Boot Process Steps and AMI BIOS Main Menu Options Explained

Computer scienceUpdated on 3.01 KB

BIOS Boot Process Steps

The steps undertaken by the BIOS during the boot process are:

  1. Hardware Check (POST): The BIOS checks all hardware components. If a bug is found, a warning message is displayed on the screen or a beeping alarm sounds. This check is called the Power-On Self-Test (POST).
  2. Video BIOS Initialization: If the POST process completes without difficulty, the boot process continues. At this point, the video adapter's BIOS starts.
  3. Manufacturer Information: After this, information regarding the BIOS manufacturer and version is displayed.
  4. System Tests: The BIOS initiates a series of system tests. The messages now emerging are shown on the screen.
  5. Device Detection: Next, the BIOS checks the present devices and their characteristics, which
...
Continue reading "BIOS Boot Process Steps and AMI BIOS Main Menu Options Explained" »

XBOOT: Create a Multiboot USB Drive on Windows

Computer scienceUpdated on 11.03 KB

XBOOT: Multiboot ISO USB Creator for Windows

XBOOT is a powerful, Windows-based application designed to create Live Multiboot USB drives or Multiboot ISO files that can then be burned to a CD/DVD. It supports numerous Linux distributions and utilities, offering a choice of Grub or Syslinux bootloaders. A built-in QEMU emulator is also included, allowing you to boot an ISO directly from within Windows.

Official XBOOT Website

http://sites.google.com/site/shamurxboot/

How to Create a Live Multiboot USB with XBOOT

  1. Download, extract, and run the latest version of XBOOT.
  2. Drag and drop your desired ISO files into the XBOOT window. Then, select Create USB. XBOOT - Drag and Drop ISOs - Create USB

  3. From the dropdown list, select your USB Drive. Next, choose a Bootloader (Grub or Syslinux). Finally,

...
Continue reading "XBOOT: Create a Multiboot USB Drive on Windows" »

Shell script

Computer science2.47 KB

Ejercicio de descuentos:

#!/bin/bash

read -p "¿Desea el billete también de vuelta? (s/n): " idavuelta

until [ $idavuelta=="s" ] || [ $idavuelta=="n" ]; do

read -p "¿Desea el billete también de vuelta? (s/n): " idavuelta

done

read -p "¿Tiene carnet joven? (s/n): " carnetjoven

until [ $carnetjoven="s" ] || [ $carnetjoven="n" ]; do

read -p "¿Tiene carnet joven? (s/n): " carnetjoven

done

descuento=0 billete=20

if [ $idavuelta="s" ]; then

descuento=20

billete=" expr $billete \* 2'

fi

if [ $carnetjoven="s" ]j then

descuento=30

fi

costefinal=`expr $billete \* \( 100 - $descuento \) / 100`

echo "El precio final del billete es $costefinal"



Ejercicio de medias:

#!/bin/bash

acu=0

cont=0

read -p "Introduce un numero: " num

while [ $num -ne 0 ]; do

acu=`expr $acu + $num`

cont=...

Continue reading "Shell script" »

OpenSSL Encryption and Decryption Techniques

Computer science109.42 KB

OpenSSL Encryption and Decryption Commands

RC4 Symmetric Encryption

To encrypt the file "fichero.txt" using the RC4 symmetric encryption algorithm:

OpenSSL> rc4 -in c:\cifrado\fichero.txt -out c:\cifrado\cifrado.rc4
enter rc4 encryption password:
Verifying - enter rc4 encryption password:

To decrypt the previously encrypted file:

OpenSSL> rc4 -d -in c:\cifrado\cifrado.rc4 -out c:\cifrado\descifrado.txt
enter rc4 decryption password:

DES Encryption

Encrypting a file:

OpenSSL> des -salt -in c:\csb.log -out c:\csb.bf.txt
enter des-cbc encryption password:
Verifying - enter des-cbc encryption password:

Decrypting a file:

OpenSSL> des -d -in c:\csb.bf.txt -out c:\csb.txt
enter des-cbc decryption password:

Triple DES (DES3) Algorithm

Encrypting...

Continue reading "OpenSSL Encryption and Decryption Techniques" »

Computer Terminology Glossary

Computer science5.84 KB

A

  • ATTACHMENT: A file that is sent with an email.
  • BANDWIDTH: A measurement of the amount of information that a computer network can send or receive. High bandwidth allows images and websites to load quickly on the Internet.
  • BANNER: A rectangular graphic on a website that advertises a business.
  • CASE: An enclosure that holds the computer's components.
  • CODE: A set of words and symbols that give instructions to a computer.
  • CONTENT: The material on a web page, including text and graphics.
  • CROP: To cut off unwanted parts of an image.
  • DATABASE: A large group of data organized in a computer system. It allows you to search and find information easily.
  • DESKTOP: Everything that a user sees on a computer screen.
  • DESKTOP COMPUTER: A computer that is small enough to
...
Continue reading "Computer Terminology Glossary" »

Dijkstra's Algorithm in C: Code & Explanation

Computer science3.5 KB

Dijkstra's Algorithm in C

This code implements Dijkstra's algorithm to find the shortest path from a source vertex to all other vertices in a graph represented as an adjacency matrix. The program reads graph data from an input.txt file and writes the results to an output.txt file.

Code Implementation


#include <stdio.h>
#include <limits.h>
#include <stdbool.h>

#define MAX_VERTICES 100

// Function to find the vertex with minimum distance
int minDistance(int dist[], bool visited[], int vertices) {
    int min = INT_MAX, min_index;

    for (int v = 0; v < vertices; v++)
        if (!visited[v] && dist[v] <= min) {
            min = dist[v];
            min_index = v;
        }

    return min_index;
}

// Dijkstra'
...
Continue reading "Dijkstra's Algorithm in C: Code & Explanation" »

Communication Modes, Data Circuits, OSI Stack, and Network Types

Computer science2.54 KB

Communication Modes

Operability:

  • Simplex Communication: Clearly defined transmitter and receiver functions. Transmission occurs in one direction only. Example: a TV broadcast using a single physical channel and a single unidirectional logical channel.
  • Half-Duplex Communication: Two-way communication where sender and receiver roles are interchangeable, but transmission is not simultaneous. When one device sends, the other must receive. It uses one physical channel and a bidirectional logical channel.
  • Full-Duplex Communication: Bidirectional and simultaneous communication. Sender and receiver roles are not strictly defined.

Data Circuit Components

Circuit Data:

  • Data Terminal Equipment (DTE): The source or destination of information.
  • Data Circuit-Terminating
...
Continue reading "Communication Modes, Data Circuits, OSI Stack, and Network Types" »