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

Software Engineering Concepts: A Comprehensive Guide

Computer science7.04 KB

Module 9: Firebase Application

Realtime Database

A cloud-hosted database. Data is stored as JSON and synchronized in real-time to every connected client. Provides easy-to-use services for authentication (email/password, 3rd-party providers like Google/Facebook).

Cloud Firestore

A flexible and scalable database for mobile, web, and development. It offers synchronization, offline support, and ACID transactions.

Cloud Functions

...

Hosting

CSS/JavaScript

Cloud Storage

Provides robust, secure file uploads and downloads for Firebase apps.

Module 10: UML Diagrams

Structural Diagrams

  • Class Diagram: Shows class hierarchy, fields/attributes, and relevant methods.

How to Read

  • Visibility:
    • +: Public
    • -: Private
    • #: Protected (accessed only by child classes)
  • Relationships:
...
Continue reading "Software Engineering Concepts: A Comprehensive Guide" »

Inheritance and Method Overriding in Java: A Comprehensive Guide

Computer science2.3 KB

Inheritance in Java

Inheritance in Java is a mechanism where one object acquires all the properties and behaviors of another object. Inheritance represents the IS-A relationship, also known as a parent-child relationship.

Using inheritance, you can create a general class that defines common traits for a set of related items. This class can then be inherited by other classes, each adding its unique elements.

The keyword extends defines a new class from an existing class. The existing class is called the parent/base/superclass, and the new class is called the child/derived/subclass.

Here's a breakdown:

  • Child classes inherit all members of their parent class.
  • Child classes cannot access the private members of the parent class directly.
  • To access private
...
Continue reading "Inheritance and Method Overriding in Java: A Comprehensive Guide" »

HTML Input Types, Sensors, Random Numbers, and Loops in JavaScript

Computer science3.49 KB

Radio Buttons

Radio buttons allow you to choose only one option among multiple. If an option wasn't previously selected, it can be automatically changed. Radio buttons with the same name are grouped together, ensuring that only one option within that group can be selected at a time.

Gender: Male Female

Checkboxes

Checkboxes allow you to choose one or more options from a list. Unlike radio buttons, a name attribute is not required for grouping.

Activities: Yoga Boxing

To check if a checkbox is selected in JavaScript, you can use the following code within a button's function:

if (document.getElementById("checkbox_id").checked == true)

To reset a checkbox, use:

document.getElementById("checkbox_id").checked = false;

Sensors

Senses allow us to collect information...

Continue reading "HTML Input Types, Sensors, Random Numbers, and Loops in JavaScript" »

Database Security, AutoML, and Data Lake Table Joining

Computer science3.65 KB

Acid Rain: Concurrency-Related Attacks in Database-Backed Web Applications

Motivation:

  • 12 popular self-hosted e-commerce applications (deployed over 2M websites, representing over 50% of all e-commerce websites)
  • 22 critical ACIDRain attacks identified and verified
  • Flexcoin -> Bankrupted

Problem Definition:

An application is vulnerable if:

  • Anomalies Possible: Under concurrent API access, the application may exhibit behaviors (i.e., anomalies) that could not have arisen under serial execution.
  • Sensitive Invariants: The anomalies arising from concurrent access lead to violations of application invariants.

Solution:

  • Execute API calls against a live application and database to generate a (possibly sequential) trace of database activity.
  • Analyze the trace
...
Continue reading "Database Security, AutoML, and Data Lake Table Joining" »

Understanding Bleed, Slug, Trim, and Gutter in Print Design

Computer science3.33 KB

What is bleed? When any image or element on a page touches the edge of the page, extending beyond the trim edge leaving no margin it is said to bleed. It may bleed or extend off one or more sides.

What is slug? Non-printing information (such as a title and date) used to identify a document outside bleed area.

What is Trim - The final size of a printed page after excess edges of paper have been cut off What is Gutter - The area between columns on a page or the blank space between two facing pages in print

Match each file format with the kind of information it would likely be used to save?
o TIFF = A loss-less bit-mapped file format for high-resolution photographic images, typically in print
a EPS = A vector-based file format for high-resolution...

Continue reading "Understanding Bleed, Slug, Trim, and Gutter in Print Design" »

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

Computer science2.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" »

Relational Database Concepts: Keys, Views, and SQL

Computer science14.08 KB

Relational Keys

Superkey: Set of attributes with all those needed to ID a particular row. Candidate key: Minimal superkey; removing any attribute means it is no longer a superkey; can be multiple per relation; "UNIQUE". Strict: Candidate key + at least 1 extra attribute. Primary: Default candidate key, reference for foreign keys; automatically unique; "PRIMARY KEY". Foreign: "Logical pointer" in a dependent relation that refers to the candidate key in the parent relation (not always primary). Natural: Represent conceptual uniqueness constraints external to the DB, e.g., name, address. Artificial: Introduced solely for the DB, no external meaning, e.g., auto-generated ID; single attribute, simple data type. Surrogate: If artificial is used as
...
Continue reading "Relational Database Concepts: Keys, Views, and SQL" »

Computer Hardware and Software Components

Computer science3.85 KB

Computer Hardware and Software Components

Computer hardware is the collection of physical elements that constitutes a computer system. It refers to the physical parts or components of a computer, such as the monitor, mouse, keyboard, etc. All of these are physical objects that can be touched. In contrast, software is a set of instructions that can be stored and run by hardware. Software is any set of machine-readable instructions that directs a computer's processor to perform specific operations. A combination of hardware and software forms a usable computing system.

Operating System (OS)

An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating

...

Continue reading "Computer Hardware and Software Components" »

Software Architecture: Key Concepts and Best Practices

Computer science2.51 KB

Why the 4 + 1 Architecture?

The 4 + 1 architecture model provides different views (logical, process, development, and physical) plus scenarios. This allows for a comprehensive understanding of the system to be built. The 4 + 1 model is also generic.

How Does It Help with Design?

It aids in system design by helping to understand the system's behavior through detailed component design and specifications. This ensures that the functional requirements are met.

Choosing a Construction Methodology

The construction methodology depends on the problem or system being addressed. Therefore, the criterion is paramount when choosing a methodology. Options include:

  • Rational Unified Process
  • CMMI
  • Scrum

Importance of Documentation Standards

Documentation standards facilitate...

Continue reading "Software Architecture: Key Concepts and Best Practices" »

Network Integration Models and Access Methods

Computer science2.8 KB

Models of Network Integration

Typically, a network encompasses a wide range of technologies. Not all technologies meet all the needs of the network administrator. A network of a certain size is usually a mixed-technology network due to the various factors involved.

Key Aspects of Network Integration:

  • Wiring System Response: The wired network forms the backbone of any Local Area Network (LAN). Typically, all servers have at least one connection to the wiring harness, and if they handle substantial traffic, the connection is high-speed. Clients can connect to services through a structured cabling network or wireless connections. Note that the bandwidth of a wireless access point is generally less than that of wired Ethernet access and is shared

...
Continue reading "Network Integration Models and Access Methods" »