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

C++ Algorithms: Frequency Counting, ISBN Validation, and Horner's Method

Computer science5.51 KB

Counting Frequencies Algorithm in C++

This C++ implementation demonstrates a method for counting the frequencies of input integers while maintaining a sorted list of unique values. It utilizes custom functions for insertion and shifting elements.

Data Structure Definition

#include <iostream>
#include <vector>
using namespace std;

struct lon{
    int dig, vez; // digit, count (vezes)
};

Helper Functions: Shifting and Positioning

The mover function shifts elements to make space for a new insertion, and donde_poner finds the correct sorted position for a new digit.

void mover(vector<lon>& a, const int& pos, const int& ini){
    for(int i = pos; i > ini; --i){
        a[i].dig = a[i-1].dig;
        a[i].vez = a[i-1]
...
Continue reading "C++ Algorithms: Frequency Counting, ISBN Validation, and Horner's Method" »

Distributed Systems: Invocation Semantics and Architectural Layers

Computer science2.41 KB

1. Maybe Semantics

Used in protocols like UDP or CORBA methods that return results. It is uncertain whether an object has been executed once or not at all. This approach does not apply any measures of fault tolerance and can suffer from omission failures if the invocation or the response is lost. If a timeout is set, the answer could be received after its expiry (asynchronous). This semantic is useful in applications where it is acceptable to have two failed invocations.

2. At-Least-Once Semantics

Used in consultations or SUN RPC. The client receives a result, ensuring the method was executed at least once, or receives an exception stating no results were obtained. This can achieve broadcast messages for those that did not respond. Depending on...

Continue reading "Distributed Systems: Invocation Semantics and Architectural Layers" »

Abstraction, Syntax, and Semantics in Software Design

Computer science3.51 KB

What is Abstraction? Types and Principles

Abstraction is a mental process involving the understanding of phenomena or situations that involve many details. It consists of two key aspects:

  • Highlighting the most relevant details of the object under study.
  • Ignoring irrelevant details of the object (at that specific level of abstraction).

Abstraction is fundamental for designing programs that are shorter, readable, easy to maintain, and reliable—i.e., quality software.

Programming languages are the tools used by programmers to implement these abstract models. Abstraction in programming is typically divided into two types:

  1. Operational Abstraction: It is based on the use of procedures and/or functions without worrying about how they are implemented.
...
Continue reading "Abstraction, Syntax, and Semantics in Software Design" »

Windows Server 2008: Disk Quota Management & Security Audits

Computer science3.28 KB

Disk Quota Management in Windows Server 2008

Windows Server 2008 offers two distinct types of disk quotas to help manage storage utilization:

  • NTFS Disk Quotas

    Available in all versions of Windows Server 2008, NTFS Disk Quotas allow administrators to manage the disk space used by users. Quotas are set for each volume. While users receive warning messages when exceeding their quota, event logging is the primary communication channel for disk quota management.

  • File Server Resource Manager (FSRM)

    Windows Server 2008 supports File Server Resource Manager (FSRM) for advanced quota management. FSRM enables the management of space utilization for specific folders and volumes. Users approaching or exceeding their limits will automatically receive email notifications.

...
Continue reading "Windows Server 2008: Disk Quota Management & Security Audits" »

Web Page Creation and CMS Management Essentials

Computer science2.46 KB

Web Page Creation

Application of Hyperlinks

A hyperlink is a cross-reference to another document. It consists of a point (the object where you insert the hyperlink) and a destination (the document or section displayed when the link is activated).

There are several ways to create hyperlinks:

  • Internal Hyperlinks: Links to a specific part of the same document. To create these, you must first define the destination by setting an anchor or bookmark within the document.
  • External Links: Links to other documents that are displayed, executed, or downloaded from the internet. These require specific attributes to define how the linked document is displayed.

Types of External Links

  • Relative URLs: These refer to documents located in the same folder as your HTML
...
Continue reading "Web Page Creation and CMS Management Essentials" »

Java Student Class: Attributes, Methods, and Status

Computer science3.34 KB

This document presents a Java class named Student, demonstrating object-oriented programming principles. It includes attributes, constructors, getters, setters, and methods to calculate average grades and determine student status.

Test Class

import java.io.*;
public class Test {
    public static void main(String[] args) throws IOException {
        Student student = new Student("John", true, 3, 2, 5, 43);
        student.show();
    }
}

Student Class

import java.io.*;
public class Student {
    private int note1, note2, note3;
    private String name;
    private int age;
    private boolean sex; // attributes

    public Student() {
        this.name = "NN";
        this.sex = false;
        this.note1 = 0;
        this.note2 = 0;
        this.
...
Continue reading "Java Student Class: Attributes, Methods, and Status" »

TCP/IP Networking Concepts and Protocols Explained

Computer science3.85 KB

1. Server Type for Initial Network Client Connection

Which server type would a network client most likely use first when connecting to a network, such as a school network?

DHCP

2. Data Encapsulation Process

What does encapsulate the data? Explain briefly.

The information is converted into data by a specific application. Then, using TCP, the data is divided into segments, and each is assigned a header that includes the source and destination port numbers. Next, the IP protocol header assigns IP addresses (physical and logical). Finally, the Ethernet protocol sends the segments, which are framed with an Ethernet header and trailer containing the source and destination MAC addresses.

3. Identifying Application for Incoming Segments

If an Internet server

...

Continue reading "TCP/IP Networking Concepts and Protocols Explained" »

Data Persistence & Management in Extended MVC Architectures

Computer science2.46 KB

Data Management Function in Extended MVC

The Data Management (DM) component provides the basic infrastructure for the storage and retrieval of objects within a system. Its primary purpose is to isolate the impacts of underlying data management technologies on the overall software architecture.

Specifying Data Management: Common Approaches

The most direct approach for this persistence layer is to provide a shadow class within the Data Management (DM) component for each persistent class in the other architectural components, such as the Problem Domain (PD) components. The standard DAO (Data Access Object) pattern is widely used for this task.

Essential Features for Data Management Construction

Three important features for constructing the Data Management...

Continue reading "Data Persistence & Management in Extended MVC Architectures" »

DNS Fundamentals and Name Resolution Mechanisms

Computer science2.63 KB

What is a DNS Service?

A DNS service is a distributed database that stores hierarchical information associated with domain names on a network.

Primary Uses of DNS

  • Name Resolution: Given the full name of a host, the service retrieves its IP address.
  • Reverse Address Resolution: This is the inverse of the previous mechanism. Given an IP address, it retrieves the name associated with it.
  • Mail Server Resolution: Given a domain name, it identifies the server through which email delivery should be handled.

Core Components of the DNS Service

The main components include:

  • The DNS Client: A program that runs on the user's computer and generates DNS resolution requests for names to be sent to a DNS server.
  • DNS Servers: These answer customer requests. Recursive
...
Continue reading "DNS Fundamentals and Name Resolution Mechanisms" »

Understanding Computer Software: Base and Application Types

Computer science3.48 KB

Software Fundamentals

Software: Part of computer logic. All programs managed by the computer. A set of rules and instructions.

1. System Software (SW Base)

A set of programs that control the computer and form the base of application software. It allows the inner workings and facilitates user interaction and machine-to-machine communication.

1.1 Operating Systems (OS)

The closest layer to the machine, it acts as an intermediary between the user and the machine. It is the first program loaded into memory and is essential to operate the machine. Two types of interfaces exist: text and graphics.

Functions of an Operating System:
  • Planning, supervision, and load initialization when running a program.
  • Manage all system resources.
  • Initiate and control I/O units
...
Continue reading "Understanding Computer Software: Base and Application Types" »