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

Sort by
Subject
Level

Understanding CIDR, Subnetting, and Supernetting in IP Addressing

Classified in Computers

Written on in English with a size of 3.13 KB

Drawbacks of Classful Addressing

Subnets have a fixed number of host addresses, leading to many unused/wasted IP addresses.

Solutions for IP Address Shortages

Short-term: Classless addressing
Long-term: IPv6

CIDR (Classless Inter-Domain Routing)

CIDR uses a hierarchical addressing scheme based on VLSM (Variable Length Subnet Masking).

Advantages of CIDR

  • Replaces classful addressing with a more flexible and less wasteful classless scheme.
  • Enhances route aggregation.

How VLSM Works

VLSM further subnets existing subnets by taking bits from the host ID, creating a multi-level hierarchy with "sub-subnets."

Supernetting

Supernetting combines continuous network addresses into a new address defined by the subnet mask. Multiple networks are combined into a larger... Continue reading "Understanding CIDR, Subnetting, and Supernetting in IP Addressing" »

Automated Fact-Checking of Text Summaries for Relational Databases

Classified in Computers

Written on in English with a size of 4.06 KB

Verifying Text Summaries of Relational Data Sets

Relational data is often summarized by text.
• The focus of this paper is the problem of verifying, in an automated fashion, whether text claims are consistent with the actual database.
• The authors proposed a tool for verifying text summaries of relational data sets, which works similarly to a spell checker and marks up claims that are believed to be erroneous.
• The system converts claims into SQL queries and then evaluates them.
• The main problem is converting natural language claims to SQL queries.
• The tool is called AggChecker.

AggChecker

• AggChecker consists of two parts: a relational data set and a text document.
• The text contains claims about the data.
• The goal is to
... Continue reading "Automated Fact-Checking of Text Summaries for Relational Databases" »

Fruteria: Añadir, Comprar y Pagar Frutas

Classified in Computers

Written on in English with a size of 3.49 KB

int opcion=0;

double cantidad, vuelto;

double pago, total = 0;

string[,] fruta = { { 'Manzana', '4.9' }, { 'Pera', '5.5' }, { 'Naranja', '8.6' }, { 'Platano', '2.7' } ,{ 'Fresa', '1.9' } ,{ 'Piña', '2.4' }, { 'Papaya', '4.2' }, { 'Sandia', '3.4' } ,{ 'Durazno', '3.5' } };

String[,] añaFruta = newString[50, 5];

int i=0, j=0;

int añadir = 0,tFruta=0;

do{

do{

i = 0;

Console.Write('_________________________ ' +

'FRUTERIA .... '+

'1) AÑADIR FRUTA. ');

while (i < 9)

{ Console.Write(i+2+') '+fruta[i,0]+' ');

i++;

}

if(añadir>0)

{j = 11;

i = 0;

tFruta = añadir+9;

while (i < añadir)

{Console.Write(j + ') ' + añaFruta[i, 0] + ' ');

j++;i++;

}

}

else { tFruta = 9; }

Console.Write(tFruta + 2+') Pagar. ');

opcion = int.Parse(Console.ReadLine(

... Continue reading "Fruteria: Añadir, Comprar y Pagar Frutas" »

SQL Queries and Data Modeling

Classified in Computers

Written on in English with a size of 9.73 KB

Aggregate Functions

How many hotels are there?

SELECT COUNT(*) FROM Hotel;

What is the average price of a room?

SELECT AVG(price) FROM Room;

What is the total revenue per night from all double rooms?

SELECT SUM(price) FROM Room WHERE type = 'D';

How many different guests have made bookings for August?

SELECT COUNT(DISTINCT guestNo) FROM Booking WHERE (dateFrom <= DATE'2004-08-01' AND dateTo >= DATE'2004-08-01') OR (dateFrom >= DATE'2004-08-01' AND dateFrom <= DATE'2004-08-31');

Subqueries and Joins

List the price and type of all rooms at the Grosvenor Hotel.

SELECT price, type FROM Room WHERE hotelNo = (SELECT hotelNo FROM Hotel WHERE hotelName = 'Grosvenor Hotel');

List all guests currently staying at the Grosvenor Hotel.

SELECT * FROM Guest... Continue reading "SQL Queries and Data Modeling" »

Introduction to Computer Systems and Assembly Language Programming

Classified in Computers

Written on in English with a size of 7.29 KB

Computer System

Components:

  • CPU
  • Memory (ROM/RAM)
  • I/O unit

BCD (Binary-Coded Decimal)

  • Add 0110 to the result if it falls between 1010 and 1111.

Overflow

  • Occurs when both numbers being added are positive or negative, and the result exceeds the maximum representable value.

IEEE-754 Standard

  • 32 bits: 1 sign bit, 8 exponent bits, 23 mantissa bits
  • NAN (Not a Number): Represents an error, exponent with all 1s and a sign bit of 0.
  • Always add trailing zeros to complete the required number of bits.

Decoder

  • Converts input to output using 2^n AND gates.

Memory

  • Components: Address, data, enable, read, write

Control Unit

  • Hardware instruction logic
  • Decodes and monitors the execution of instructions.

ALU (Arithmetic Logic Unit)

  • Performs numerical and logical evaluations.
  • Receives
... Continue reading "Introduction to Computer Systems and Assembly Language Programming" »

Midterm Answers: Memory Protection, Power-On Self Test, Command Information, and More

Classified in Computers

Written on in English with a size of 1.96 KB

Midterm Answers

1. What is the main element of the Address Unit that allows memory protection of one application program from others? ATT/DATT


2. Which program runs first when the computer’s power is turned on? POST


3. a) Write COMD.EXE command that would provide information about DIR command:

help dir

b) Write UNIX/Linux shell (sh, ksh or bash) command that would provide information/help about ls command:

man ls


4. What is the space reserved on the RTS when a function is called? stack frame


5. What is the name of UNIX/Linux keyboard file? stdin


6. How many passwords may be used to control access to the systems firmware? 2


7. a) Upon process creation, does complete process image exist in memory? yes

b) Upon process terminations, does complete process

... Continue reading "Midterm Answers: Memory Protection, Power-On Self Test, Command Information, and More" »

Key Concepts in IT: Client Facilities, XML, and Security

Classified in Computers

Written on in English with a size of 3.59 KB

Client Facilities

Client Facilities: Performance, ensure integrity, updates, risk confidential. Static pages, forms, active content, plugins, stand-alone applications.

XML

XML (Extensible Markup Language): Preferred form for B2B and internal documents with legal effect. Key benefits: non-proprietary, platform independent, HTTP compatibility, international support, extensible, self-defining, common tools, and transformation. Complementary techniques: UDDI (Universal Description, Discovery, and Integration), WSDL (Web Services Description Language) – web service design. Signatures have legal effect.

Components

Components: Good because turn-key systems tend to be too large and inflexible. Advantages: higher quality and design, maintenance shared,... Continue reading "Key Concepts in IT: Client Facilities, XML, and Security" »

Java Programs: Character Frequency, Inheritance, Palindrome, Matrix Multiplication & Polymorphism

Classified in Computers

Written on in English with a size of 5.03 KB

Character Frequency

FREQUENCY

import java.util.Scanner;
class Test2 {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
System.out.print("ENTER THE STRING:");
String abc = s.nextLine();
System.out.println("Enter The Character for checking:");
char ch = s.nextLine().charAt(0);
int count = 0;
for(int i = 0; i < abc.length(); i++) {
if(ch == abc.charAt(i)) {
count++;
}
}
System.out.println("The given character repeats " + count + " times");
} }

OUTPUT

ENTER THE STRING: MALAYALAM
Enter The Character for checking:
M
The given character repeats 2 times

Inheritance Example

import java.util.Scanner;
class Employee {
String name = "Name";
String address = "Address";
int age = 23, phn_no = 123456789, salary = 500000;
void printsalary() {
System.out.println(

... Continue reading "Java Programs: Character Frequency, Inheritance, Palindrome, Matrix Multiplication & Polymorphism" »

Computer Science: Algorithms, Complexity, and Pioneers

Classified in Computers

Written on in English with a size of 4.6 KB

Algorithm Complexity

  • O(1): Parity Check
  • O(log n): Binary Search
  • O(n): Sequential Search
  • O(n log n): QuickSort
  • O(n2): Bubble Sort

Computer Science Fields

Theoretical Computer Science

  • Mathematical Logic
  • Automata Theory
  • Computability
  • Computational Complexity
  • Cryptography
  • Combinatorial Optimization

Practical Computer Science

  • Artificial Intelligence
  • Computer Architecture
  • Computer Graphics
  • Databases
  • Software Engineering
  • Distributed Systems
  • Computer Security
  • Human-Computer Interaction

Turing Machine Elements

  • Possible States
  • Initial State
  • Final State
  • Current State
  • Finite Set of Symbols
  • Input Symbols

Abstract Machines

Theoretical models for analyzing computability and algorithm complexity. Includes Automata and State Machines.

Deterministic Turing Machine (DTM)

For each state, there... Continue reading "Computer Science: Algorithms, Complexity, and Pioneers" »

Python Functions and Errors: Time, Triangle, Bonus, and Digits

Classified in Computers

Written on in English with a size of 4.09 KB

TIME DIFFERENCE

def time_difference(time1, time2):
time1=time_to_seconds(time1)
time2=time_to_seconds(time2)
diffinsecond=time2-time1
hours=diffinsecond//3600
minutes=(diffinsecond-(hours*3600))//60
seconds=diffinsecond-(hours*3600)-(minutes*60)
return(make_time_string(hours,minutes,seconds))

# Predefined helper functions. Do not edit them.
def time_to_seconds(time):

x = list(map(int, time.split(":"))
return x[0] * 3600 + x[1]*60 + x[2]

def make_time_string(hours, mins, seconds):
return "{:02d}:{:02d}:{:02d}".format(hours, mins, seconds)

TYPE OF TRIANGLE

def triangle(side1, side2, side3):
if side1+side2<>
return "Not a triangle"
elif side1==side2 and side2==side3:
return "Equilateral"
elif... Continue reading "Python Functions and Errors: Time, Triangle, Bonus, and Digits" »