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

Computer System Components and Data Storage Definitions

Computer science3.67 KB

Computer Hardware and Software Fundamentals

Defining Hardware

Hardware is used to describe the physical parts of a computer system that you can touch. Examples include monitors, keyboards, printers, hard drives, wiring, the CPU, etc.

Essential Hardware Components

The following are key components of a computer system:

  • Keyboard

    A tool used for typing, similar to a typewriter.

  • Monitor

    The screen on your computer that you look at when you are using the computer.

  • Mouse

    A piece of plastic input device. Older models typically had a ball on the bottom and two buttons on the top. When you click the mouse, you usually use the left button. It allows you to click on and select items on your screen.

  • Printer

    A machine that transfers data from the computer onto paper.

...
Continue reading "Computer System Components and Data Storage Definitions" »

Mastering Java: From Basics to Advanced OOP Principles

Computer science187.84 KB

Java Programming Fundamentals and Features

Java is a high-level, object-oriented, platform-independent programming language developed by Sun Microsystems (now owned by Oracle) in 1995. Java follows the principle "Write Once, Run Anywhere (WORA)", meaning a Java program can run on any system that has a Java Virtual Machine (JVM).

Key Features of Java

  • Simple: Easy to learn and use.
  • Object-Oriented: Based on the concept of classes and objects.
  • Platform Independent: Runs on any operating system using the JVM.
  • Portable: Programs can be moved easily from one platform to another.
  • Secure: Provides security through bytecode verification and the JVM.
  • Robust: Features strong memory management and exception handling.
  • Multithreaded: Supports the execution of multiple
...
Continue reading "Mastering Java: From Basics to Advanced OOP Principles" »

Mastering MATLAB: Powering Technical Computing

Computer science2.61 KB

MATLAB stands for Matrix Laboratory. It is a high-performance programming language and software environment developed by a company called MathWorks. It is primarily used for technical computing, heavy mathematical calculations, data analysis, and algorithm development.

Here is a breakdown of what makes MATLAB unique and how it is used:

Core Capabilities of MATLAB

  • Matrix Math: Unlike traditional programming languages that work mainly with single numbers, MATLAB is specifically designed to operate on whole matrices and arrays at once. This makes solving complex mathematical and engineering problems much faster.
  • Data Visualization: It has powerful built-in tools for plotting data. You can easily create 2D and 3D graphs, charts, and custom visual representations
...
Continue reading "Mastering MATLAB: Powering Technical Computing" »

Multimedia Architecture and JPEG Compression Methods

Computer science1.46 MB

Global Structure of Multimedia Systems

The Global Structure of Multimedia represents the overall organization of multimedia systems into different domains that work together to capture, process, store, transmit, and present multimedia information.

It provides a framework for understanding how multimedia components interact within a multimedia environment.

8YzfipAAAABklEQVQDAD69+mtfIzhYAAAAAElFTkSuQmCC

Main Domains of Multimedia Structure

  • Device Domain
  • System Domain
  • Application Domain


JPEG Compression Process Steps and Examples

j+Npku3hg9AAAAAElFTkSuQmCCAAChDREAAABDYXB0dXJlZF9BcHBfSW5mb2V5SmpiMjF3SWpvaVkyOXRMbWhoYlhKdlkzTnBkRnd2TGsxaGFXNUJZM1JwZG1sMGVTSjkAAFEMFAAAAFNhbXN1bmdfQ2FwdHVyZV9JbmZvU2NyZWVuc2hvdAAAoQsYAAAAUGhvdG9FZGl0b3JfUmVfRWRpdF9EYXRheyJvcmlnaW5hbFBhdGgiOiJcL2RhdGFcL3NlY1wvcGhvdG9lZGl0b3JcLzBcLzM3NTAyYTUwMTY3ZjhhZDZhMDRkZTY5MWVmZmZkY2IzZTljN2JiYzQyNDY3ZmM3NDc1ZTIwNDM3NmQzNGE0MzhfNjI1MzMucG5nIiwicmVwcmVzZW50YXRpdmVGcmFtZUxvYyI6LTEsInN0YXJ0TW90aW9uVmlkZW8iOi0xLCJlbmRNb3Rpb25WaWRlbyI6LTEsImlzTW90aW9uVmlkZW9NdXRlIjpmYWxzZSwiaXNUcmltTW90aW9uVmlkZW8iOmZhbHNlLCJjbGlwSW5mb1ZhbHVlIjoie1wibUNlbnRlclhcIjowLjQ5OTk5OTk0MDM5NTM1NTIsXCJtQ2VudGVyWVwiOjAuNTA4OTQ1NTg0Mjk3MTgwMixcIm1XaWR0aFwiOjEsXCJtSGVpZ2h0XCI6MC4xODA1MTk1MzYxMzc1ODA4NyxcIm1Sb3RhdGlvblwiOjAsXCJtUm90YXRlXCI6MCxcIm1IRmxpcFwiOjAsXCJtVkZsaXBcIjowLFwibVJvdGF0aW9uRWZmZWN0XCI6MCxcIm1Sb3RhdGVFZmZlY3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Y3VzWE9yaWdpbmFsXCI6LTEsXCJyZWZvY3VzWU9yaWdpbmFsXCI6LTEsXCJ3YXRlck1hcmtSZW1vdmVkXCI6ZmFsc2UsXCJ3YXRlck1hcmtSZW1vdmVkT3JpZ2luYWxcIjpmYWxzZX0iLCJpc0JsZW5kaW5nIjp0cnVlLCJpc05vdFJlRWRpdCI6ZmFsc2UsInNlcFZlcnNpb24iOiIxNzAwMDAiLCJuZGVWZXJzaW9uIjoxLCJyZVNpemUiOjQsImlzU2NhbGVBSSI6ZmFsc2UsInJvdGF0aW9uIjoxLCJhZGp1c3RtZW50VmFsdWUiOiJ7XCJtQ3JvcFN0YXRlXCI6MTMxMDc2fSIsImlzQXBwbHlTaGFwZUNvcnJlY3Rpb24iOmZhbHNlLCJpc05ld1JlRWRpdE9ubHkiOmZhbHNlLCJpc0RlY29SZUVkaXRPbmx5IjpmYWxzZSwiaXNBSUZpbHRlclJlRWRpdE9ubHkiOmZhbHNlfQAAoQsWAAAAT3JpZ2luYWxfUGF0aF9IYXNoX0tleTg2YmVmZTE3NjJmYmFiNjA0NmMxZjQwNzBkMjY2ZjlmNmM4NGRiOGExMGRkZTVjZDcxMmJkMmZjMjUyOGY1N2UvNjI1MzNTRUZIawAAAAQAAAAAAKENUgcAAE0AAAAAAFEMBQcAACYAAAAAAKEL3wYAAHsGAAAAAKELZAAAAGQAAAA8AAAAU0VGVA==

  1. Step 1: The input image is divided into small blocks having 8×8 dimensions. The dimensions sum up to 64 units. Each unit of the image is called a pixel.
  2. Step 2: JPEG uses the YCbCr model instead of the RGB model. In the second step, RGB is converted into YCbCr (Luminance
...
Continue reading "Multimedia Architecture and JPEG Compression Methods" »

TD MyAdvantage: Trip Management and Activation Steps

Computer science3.61 KB

Trip Details

  • On the Trip Details screen, you can view the specifics of your trip.
  • After reviewing the star rating, click View map and 3 events to see specific trip events.
  • The yellow icon on the map indicates a medium-severity event that impacted your trip score.
  • Click on an event to see more details.

Declining a Trip

  • Select Trips to Review.
  • Select Review for the trip you wish to address.
  • If you were not the driver for this trip, select No.
  • You have successfully declined the trip.

Accepting a Trip

  • From the TD MyAdvantage Dashboard, click Trips to Review.
  • Select Review for the trip you would like to process.
  • If you were the driver for this trip, select Yes.
  • You have successfully accepted the trip.

Activating on an iOS Device

  • To begin, select Activate from the
...
Continue reading "TD MyAdvantage: Trip Management and Activation Steps" »

Mastering jQuery and Modern Form Validation

Computer science7.25 KB

1. Modern Validation APIs (Constraint Validation API)

For advanced tracking and custom error messaging, JavaScript provides the Constraint Validation API. This API gives you deep programmatic control over HTML5 validation states.

Key Properties & Methods

  • element.validity: An object containing boolean properties describing the validity state of the input.
    • validity.valueMissing: True if required but empty.
    • validity.typeMismatch: True if the syntax doesn't match the type (e.g., an invalid email).
    • validity.tooShort: True if it doesn't meet minlength.
    • validity.valid: True if the element passes all validation checks.
  • element.setCustomValidity(string): Sets a custom error message. If you pass an empty string "", the field becomes valid again.
  • element.checkValidity(
...
Continue reading "Mastering jQuery and Modern Form Validation" »

Mastering Process Synchronization: Critical Sections and Semaphores

Computer science7.56 KB

The Critical Section Problem

In a multi-threaded or multi-process system, shared data can easily become corrupted if multiple processes try to modify it at the same time. This issue is known as a race condition.

To prevent this, we identify the section of code where shared resources are accessed as the Critical Section. The goal is to ensure that only one process executes in its critical section at any given moment.

do {
    [ Entry Section ]   <-- Request permission to enter
        Critical Section   <-- Manipulate shared data
    [ Exit Section ]    <-- Release permission
        Remainder Section  <-- Non-shared code
} while (true);

To be a valid solution, any mechanism managing the critical section must satisfy three strict requirements:...

Continue reading "Mastering Process Synchronization: Critical Sections and Semaphores" »

Software Engineering: Inheritance, Cloud, and SDLC

Computer science3.41 KB

Understanding Inheritance in OOP

In object-oriented programming, Inheritance is a mechanism where a new class (derived class) acquires the properties and behaviors (data members and member functions) of an existing class.

Types of Inheritance

  • Single Inheritance: In single inheritance, a single derived class is inherited from only one base class. It is the simplest form of inheritance.
  • Multiple Inheritance: Multiple inheritance occurs when a single derived class is inherited from more than one base class.
  • Hierarchical Inheritance: In this type, multiple derived classes are inherited from a single base class.
  • Multilevel Inheritance: In multilevel inheritance, a derived class is inherited from another derived class, creating a chain of inheritance.
  • Hybrid
...
Continue reading "Software Engineering: Inheritance, Cloud, and SDLC" »

DBMS vs RDBMS: Key Differences and Core Concepts

Computer science3.15 KB

What is a DBMS?

A Database Management System (DBMS) is software that enables users to define, create, maintain, and control access to a database. It acts as an interface between users and a database, allowing users to interact with data without needing to know how it is stored internally. It serves as a bridge between data and application programs/users.

Popular DBMS Examples

  • MySQL
  • Oracle Database
  • Microsoft SQL Server
  • MongoDB

Types of DBMS

  • Hierarchical DBMS: Data organized like a tree.
  • Network DBMS: Data linked in a network structure.
  • Relational DBMS (RDBMS): Data stored in tables (most common).
  • NoSQL DBMS: Used for unstructured or big data.

DBMS Architecture

The 3-Level Architecture is essential for database design:

  • Internal Level: How data is physically
...
Continue reading "DBMS vs RDBMS: Key Differences and Core Concepts" »

FCFS and SJF CPU Scheduling C Program Example

Computer science3.03 KB

FCFS and SJF CPU Scheduling C Program Example

Corrected and formatted C source code for FCFS and SJF scheduling.

FCFS Scheduling C Implementation

#include <stdio.h>

int FCFS() {
    int bt[15], n, i, wt[15];
    float twt = 0, tat = 0, att, awt;
    printf("\nTHE FCFS SCHEDULING\n");
    printf("Enter the number of processes: ");
    scanf("%d", &n);
    printf("Enter burst time of all the processes:\n");
    for (i = 0; i < n; i++) {
        printf("P%d: ", i + 1);
        scanf("%d", &bt[i]);
    }

    wt[0] = 0;
    // for calculating waiting time of each process
    for (i = 1; i < n; i++)
        wt[i] = bt[i - 1] + wt[i - 1];

    printf("ProcessID\tBurstTime\tWaitingTime\tTurn Around Time\n");
    for (i = 0; i <
...
Continue reading "FCFS and SJF CPU Scheduling C Program Example" »