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

Sort by
Subject
Level

Essential Terminology for Graphic Design, Printing, and Web Projects

Classified in Computers

Written on in English with a size of 3.55 KB

Core Graphic Design Concepts and Terminology

Vector Graphics and File Types

  • Vector allows for resizing without loss in quality.
  • Vector graphics are smaller in file size.
  • PNG file type (Portable Network Graphics).
  • SVG (Scalable Vector Graphics).

Digital Asset Sourcing

  • He found the images online, but they were in the public domain.
  • The team member created the images himself.

The whole is greater than the sum of the parts.

Typography and Text Handling

  • Kerning: The spacing between specific pairs of characters.
  • Leading: The distance between each line of text.

Font Classifications

  • Script
  • Decorative
  • Serif
  • Sans Serif

Text Overflow

Even though it's not visible, the excess text is still in the bounding area, and a small plus (+) symbol is displayed at the bottom of the... Continue reading "Essential Terminology for Graphic Design, Printing, and Web Projects" »

Arduino Programming Reference: Variables, Functions & Syntax

Classified in Computers

Written on in English with a size of 12.76 KB

Variables

Array

int myInts[6];
int myPins[] = {2, 4, 8, 3, 6};
int mySensVals[6] = {2, 4, -8, 3, 2};
char message[6] = "hello";

Bool

int LEDpin = 5;       // LED on pin 5
int switchPin = 13;   // momentary switch on 13, other side connected to ground
bool running = false;

void setup()
{
  pinMode(LEDpin, OUTPUT);
  pinMode(switchPin, INPUT);
  digitalWrite(switchPin, HIGH);      // turn on pullup resistor
}

void loop()
{
  if (digitalRead(switchPin) == LOW)
  {
    delay(100);                        // delay to debounce switch
    running = !running;                // toggle running variable
    digitalWrite(LEDpin, running);     // indicate via LED
  }
}

Char

char myChar = 'A';
char myChar = 65;      // both are equivalent

Double

Double precision... Continue reading "Arduino Programming Reference: Variables, Functions & Syntax" »

SkinnerDB: Reinforcement Learning for Query Optimization

Classified in Computers

Written on in English with a size of 3.78 KB

SkinnerDB: Regret-Bounded Query Evaluation via Reinforcement Learning

INTRODUCTION AND PROBLEM DEFINITION:

The work is on query optimization, more specifically: SkinnerDB focuses on finding the optimal Join Order. Because it has the most impact in practice.

SkinnerDB aims to get expected near optimal results without needing any a-priori information. It does not make strong assumptions either.

CONTRIBUTIONS:

  • Introduced a new quality criterion for query evaluation strategies that compares expected and optimal execution cost.
  • Proposed several adaptive execution strategies based on reinforcement learning.
  • Formally proved correctness and regret bounds for those execution strategies.
  • Experimental comparisations of those strategies, implemented in SkinnerDB,
... Continue reading "SkinnerDB: Reinforcement Learning for Query Optimization" »

C Programming Basics: Examples and Explanations

Classified in Computers

Written on in English with a size of 2.72 KB

C Programming Basics

Printing a Message

int main() { print("Hello!!!"); }

Variables and Mathematical Calculations

int main() // Main function

{

int a = 25; // Initialize a variable to 25

int b = 17; // Initialize b variable to 17

int c = a + b; // Initialize c variable to a + b

print("c = %d ", c); // Display decimal value of c

}

Floating-Point Math

int main() // Main function

{

float r = 1.0; // Set radius to 1.0

float c = 2.0 * PI * r; // Calculate circumference

print("circumference = %f \n", c); // Display circumference

}

Arrays

int main() // Main function

{

int p[] = {1, 2, 3, 5, 7, 11}; // Initialize the array

print("p[0] = %d\n", p[0]); // Display what p[0] stores

print("p[3] = %d\n", p[3]); // Display what p[3] stores

p[3] = 101; // Assignment

}

... Continue reading "C Programming Basics: Examples and Explanations" »

Understanding Key Computer Science Concepts

Posted by Lijia and classified in Computers

Written on in English with a size of 3.47 KB

Fetch-Execute Cycle

  1. The address in the program counter is transferred within the CPU to the Memory Address Register (MAR).
  2. During the next clock cycle, two things happen simultaneously:
    • The instruction held in the address pointed to by the MAR is fetched into the Memory Data Register (MDR).
    • The address stored in the program counter is incremented.
  3. The instruction stored in the MDR is transferred within the CPU to the Current Instruction Register (CIR).

Sound Sampling

  1. The amplitude of the sound wave is determined to get an approximation of the sound wave.
  2. This is encoded as a sequence of binary numbers and converted to a digital signal.
  3. Increasing the sampling rate will improve the accuracy of the recording.

Run-Length Encoding (RLE)

  1. RLE is a lossless
... Continue reading "Understanding Key Computer Science Concepts" »

Understanding Computer Architecture: Key Components and Functions

Classified in Computers

Written on in English with a size of 2.95 KB

List and Briefly Define the Four Main Elements of a Computer

A computer is composed of four fundamental elements:

  • Main memory: Stores both data and instructions.
  • Arithmetic and Logic Unit (ALU): Capable of operating on binary data.
  • Control Unit: Interprets the instructions in memory and ensures their execution.
  • Input and Output (I/O) Equipment: Operated by the control unit to facilitate interaction with the external world.

Define the Two Main Categories of Processor Registers

Processor registers can be broadly classified into two categories:

  • User-Visible Registers: These registers are accessible to programmers using machine or assembly language. They help minimize references to main memory by optimizing register usage. High-level language compilers

... Continue reading "Understanding Computer Architecture: Key Components and Functions" »

ISO OSI and TCP/IP Networking Models Explained

Classified in Computers

Written on in English with a size of 3.98 KB

The ISO OSI Reference Model

Created in 1984 by ISO, the model consists of seven layers:

  • Layer 1: Physical Layer – Global connections, transmitting raw bits, no buffering.
  • Layer 2: Data Link Layer – Secured channels, reducing connection errors, structuring, and transmission controls.
  • Layer 3: Network Layer – Multiple connectivity, chosen quality, and transmission systems.
  • Layer 4: Transport Layer – Quality selection, recurring connections, user-to-user connection, and transparent data transport.
  • Layer 5: Session Layer – Manages sessions between users and machines.
  • Layer 6: Presentation Layer – Acts as the translator.
  • Layer 7: Application Layer – Includes protocols like HTTP.

TCP/IP Reference Model

The TCP/IP model is the standard family... Continue reading "ISO OSI and TCP/IP Networking Models Explained" »

Java Programming Concepts: A Comprehensive Guide

Classified in Computers

Written on in English with a size of 4.47 KB

  • A class is a template used to create objects and declare data types and methods in a program.
  • Public - Modifier used to declare classes and interfaces. Void - Method that returns no value. Main - Marks the start and end of program execution.
  • Scanner class - Used to get user input for types like String and Int.
  • Exceptions: Try-catch block, throw statement.
  • Inheritance provides a powerful and natural mechanism for organizing and structuring software programs. It improves clarity in the design of classes.
  • A subclass provides specialized behavior based on elements provided by the superclass. Using inheritance, programmers can reuse the code in the superclass many times.
  • Reading and Writing to Files:
    1. Import java.io file.
    2. File inputFile = new File("input.
... Continue reading "Java Programming Concepts: A Comprehensive Guide" »

C++ Object-Oriented Programming Concepts Explained

Classified in Computers

Written on in English with a size of 2.39 KB

Inheritance

Inheritance is the capability of a class to derive properties and characteristics from another class.

Deep Copy vs. Shallow Copy

Deep Copy

In a deep copy, an object is created by copying the data of all variables and allocating new memory resources with the same values. To perform a deep copy, you must explicitly define a copy constructor and assign dynamic memory if required. This also necessitates dynamic memory allocation in other constructors, requiring custom copy constructors and overloaded assignment operators.

box(box& sample) { 
  length = sample.length; 
  breadth = new int; 
  *breadth = *(sample.breadth); 
  height = sample.height; 
}

Shallow Copy

In a shallow copy, an object is created by simply copying the data of all... Continue reading "C++ Object-Oriented Programming Concepts Explained" »

Java Socket Programming and Nmap Network Scanning

Classified in Computers

Written on in English with a size of 3.5 KB

Java Socket Programming Implementation

Code: Server-Side

import java.io.*;
import java.net.*;

public class MyServer {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(6666);
            Socket s = ss.accept();
            DataInputStream dis = new DataInputStream(s.getInputStream());
            String str = (String) dis.readUTF();
            System.out.println("Message: " + str);
            ss.close();
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}

Client-Side Code:

import java.io.*;
import java.net.*;

public class MyClient {
    public static void main(String[] args) {
        try {
            Socket s = new Socket("localhost", 6666);
... Continue reading "Java Socket Programming and Nmap Network Scanning" »