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

Sort by
Subject
Level

Java File Infection Simulation and Implementation

Classified in Computers

Written on in English with a size of 2.8 KB

This document details the implementation of a Virus class in Java, focusing on binary file manipulation and stream handling.

Java Source Code for Virus Simulation

import java.io.*;
import java.util.*;

/**
 * Write a description of class Virus here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class Virus
{
    // Campos  
    private File virusFile;  // Fichero con el código binario del virus
    public static final int SIZE = 100;

    /**
     * Constructor for objects of class Virus
     */
    public Virus( String nombre )
    {
        this.virusFile = new File(nombre);
    }

    /**
     * Método get para el campo this.virusFile
     * 
     * @return     this.virusFile
     */
    public File getFile(
... Continue reading "Java File Infection Simulation and Implementation" »

Understanding Databases: Concepts and Key Components

Posted by aakankshajayant and classified in Computers

Written on in English with a size of 4.58 KB

What is a Database?

A database is an organized collection of data, visualized as a container of information. The data is typically organized to model relevant aspects of reality. A Database Management System (DBMS) is a software package with computer programs that controls the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications.

A database is an integrated collection of data records, files, and other objects. A DBMS allows different user application programs to concurrently access the same database. Typically, databases available on database servers are accessed through command-line or graphical user interface tools, referred to as front-ends; database servers are referred... Continue reading "Understanding Databases: Concepts and Key Components" »

Understanding Counting Principles, Knowledge Types, and Geometric Thinking

Classified in Computers

Written on in English with a size of 3.56 KB

The Counting Principles

Counting is the action of finding the number of elements in a finite set of objects. Here are the key principles:

  1. The Stable-Order Principle: To count effectively, the list of words used (like one, two, three) must be in a repeatable order.
  2. The One-to-One Principle: This involves assigning one, and only one, distinct counting word to each item being counted.
  3. The Cardinal Principle: When the one-to-one and stable-order principles are followed, the number name given to the final object in a collection represents the total number of items in that collection.
  4. The Order-Irrelevance Principle: This principle highlights that the order in which items are counted doesn't affect the total count.
  5. The Abstraction Principle: These counting
... Continue reading "Understanding Counting Principles, Knowledge Types, and Geometric Thinking" »

3D Cube Transformations in OpenGL: Scaling, Translation, and Rotation

Posted by aditya dani and classified in Computers

Written on in English with a size of 2.4 KB

Introduction

This program demonstrates how to draw a 3D cube in OpenGL and perform various transformations on it, including scaling, translation, and rotation about one axis.

Code

#include <GL/glut.h>

bool movingRight = false;
float xLocation = 0.0f;

void display() {
  glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
  glClear(GL_COLOR_BUFFER_BIT);
  glLoadIdentity();
  glTranslatef(0.0f, 0.0f, -5.0f);
  glTranslatef(xLocation, 0.0f, 0.0f);
  glutWireCube(2.0f);
  glutSwapBuffers();

  if (movingRight)
    xLocation -= 0.05f;
  else
    xLocation += 0.05f;

  if (xLocation < -3.0f)
    movingRight = false;
  else if (xLocation > 3.0f)
    movingRight = true;
}

void reshape(int width, int height) {
  glViewport(0, 0, (GLsizei)width, (GLsizei)
... Continue reading "3D Cube Transformations in OpenGL: Scaling, Translation, and Rotation" »

Oracle PL/SQL and SQL XML Generation Techniques

Classified in Computers

Written on in English with a size of 4.85 KB

PL/SQL Components for Race Management

The following PL/SQL objects demonstrate core database programming concepts, including custom functions for calculation, procedures for data manipulation and ranking, and triggers for auditing.

1. Calculating Global Time: The tempo_global Function

This function calculates the total elapsed time for a specific pilot by summing the duration of all stages recorded in the TempoEtapas table. It includes robust error handling using SQLCODE.

CREATE FUNCTION tempo_global (ID_piloto IN NUMBER)
RETURN NUMBER
IS
    soma_tempo NUMBER;
    coderro NUMBER;
    CURSOR c1 IS
        SELECT tempo_inicio, tempo_fim
        FROM TempoEtapas
        WHERE Piloto_idPiloto = ID_piloto;

BEGIN
    soma_tempo := 0;
    FOR item IN
... Continue reading "Oracle PL/SQL and SQL XML Generation Techniques" »

Refer to the exhibit. A network administrator has segmented the network into two VLANs and configured Router1 for inter-VLAN routing. A test of the network, however, shows that hosts on each VLAN can only access local resources and not resources on t

Classified in Computers

Written on in English with a size of 20.53 KB

  1.  A network technician is configuring port Security on a LAN switch interface. The security policy requires host MAC Addresses to be learned dynamically, stored in the address table, and Saved to the switch running configuration. Which command does the technician Need to add to the following configuration to implement this Policy? Switch(config)# interface fa0/1 
    Switch(config-if)# switchport mode access 
    Switch(config-if)# switchport port-security

·Switch(config-if)# switchport port-security mac-address sticky

  1. On which switch interface would an Administrator configure an IP address so that the switch can be managed Remotely?

·VLAN 1

  1. Refer to the exhibit. Match the packets with Their destination IP address to the exiting interface on the router.
... Continue reading "Refer to the exhibit. A network administrator has segmented the network into two VLANs and configured Router1 for inter-VLAN routing. A test of the network, however, shows that hosts on each VLAN can only access local resources and not resources on t" »

Understanding Cisco IGRP and EIGRP Protocols

Classified in Computers

Written on in English with a size of 3 KB

Understanding IGRP Protocol

What is IGRP?

IGRP is a Cisco-specific protocol developed in the mid-1980s.

IGRP Advantages Over RIP

IGRP calculates a composite metric from a set of route variables. It can be implemented on networks of up to 255 hops in diameter. Additional advantages include:

  • Unequal-cost load sharing
  • An update period three times longer than RIP's
  • A more efficient update packet format

Unlike RIP, which uses UDP, the IGRP process is accessed directly from the IP layer as protocol 9.

IGRP Routing and Process Domains

Using domains allows isolating communications within one domain from others. IGRP uses two types: routing domains and process domains.

  • Routing domains: Defined by Autonomous System (AS) boundaries and communicate via Exterior Gateway
... Continue reading "Understanding Cisco IGRP and EIGRP Protocols" »

SDN

Classified in Computers

Written on in English with a size of 4.17 KB

OPENFLOW:

defines OpenFlow as the first standard communications interface defined between the control and forwarding layers of an SDN architecture. OpenFlow allows direct access to and manipulation of the forwarding plane of network devices such as switches and routers, both physical and virtual 


OPENFLOW CONFIG CONCEPTS


OF Capable Switch: Physical OF switch.  Can contain one or more OF logicalswitches.

OpenFlow Configuration Point: configurationservice

OF Controller: Controls logical switch via OFprotocol

Operational Context: OF logicalswitch

OF Queue: Queues of packets waiting forforwarding

OF Port: forwarding interface. May be physical orlogical.

OF Resource: ports, queues, certificates, flow tables and other  resources of OF capableswitches 

... Continue reading "SDN" »

Advantages of Address Aggregation and Key Characteristics of Routing Protocols

Classified in Computers

Written on in English with a size of 2.95 KB

Discuss the advantages of address aggregation (summarization) with respect to routing table size, routing update exchange, and routing optimization?

Route aggregation and subnetting shrink the size of routing tables used by routers. Without CIDR, a router must maintain many individual entries for routes within the same network. CIDR guarantees more efficient routing and reduces the number of CPU cycles when updating a routing table. It also reduces router memory requirements.

What are the key characteristics or requirements that should be fulfilled by any routing protocol?

A routing protocol should guarantee loop-free paths, calculate multi-hop optimal paths, use simple or composite network metrics, be scalable, converge rapidly, use network resources... Continue reading "Advantages of Address Aggregation and Key Characteristics of Routing Protocols" »

Implementação de Listas Ligadas em C++ (CRUD)

Classified in Computers

Written on in English with a size of 3.44 KB

Listas Ligadas em C++: Adicionar, Excluir, Buscar e Imprimir

Implementação básica de uma lista simplesmente ligada em C++, cobrindo as operações essenciais de manipulação de dados.

Configuração Inicial em C++

#include <iostream>
using namespace std;

Classe Node (Nó)

Define a estrutura fundamental de cada elemento da lista.

class Node {
    public:
        int value; // Pode ser implementado qualquer tipo de dados aqui.
        Node *next;
        
        Node () {
            next = NULL; // Construtor Padrão
        }
        
        Node (int _value) { // Construtor com Atribuição de Valor
            value = _value;
            next = NULL;
        }
};

Classe List (Lista Ligada)

Gerencia a coleção de nós e as operações... Continue reading "Implementação de Listas Ligadas em C++ (CRUD)" »