Notes, summaries, assignments, exams, and exercises for Computer science for Other courses

Essential Object-Oriented Programming Concepts Defined

Computer science11.61 KB

Core OOP Definitions

Class and Object

  • Class: A user-defined data structure that binds data members and operations (methods) into a single unit.
  • Object: An instance of a class. Objects are used to perform actions or allow interactions based on the class definition.

Variables and Attributes

  • Method: An action performed using the object's attributes.
  • Attributes: Characteristics or properties of a class. Also known as instance variables (declared outside methods, belonging to one object). They are accessible through static and public methods.
  • Class Variable: Declared using the static keyword; shared among all objects of the class.
  • Local Variables: Declared inside methods, constructors, or blocks; they exist only while the method runs. They cannot be accessed
...
Continue reading "Essential Object-Oriented Programming Concepts Defined" »

Web Application Security: Vulnerabilities and Mitigations

Computer science1.73 MB

Web Security Fundamentals

Vte60I22Y4rloTJJkNobQnzfKnvzVllIg5VXseVlb8Oo0lemK0wbVL2Ro4ylzQ96mYBvg7I3FlW9EaUPdsbPXfehlUZYxr6v7kaIgqQgAAEIQAACEIBALQHEci2i6bkhhrpMT82oCQQgAAEIQAACEBgPAcTyeLhORKq5E6z84MJENA2FgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwQQyz1pKIoJAQhAAAIQgAAEINA9AcRy98zJEQIQgAAEIAABCECgJwT+L8xpiAEBloqFAAAAAElFTkSuQmCC NF+gw7WaYNgAAAABJRU5ErkJggg== bpX7OFi9HIwAAAABJRU5ErkJggg== aXgG7JY0aGX+AzUxEfBqKaiqwN+Lqr8dhK3JtUSkuu9jiG7CmeBLI0AibpQApn3VjsogYpJsbULXZBVNqNbpV99GfuLaO+y1OBhQCQmAiCfwnQcZEIpS5hYAQEAJCQAgIgVAEJMiQfSEEhIAQEAJCQAiEhYAEGWHBKoMKASEgBISAEBACEmTIHhACQkAICAEhIATCQkCCjLBglUGFgBAQAkJACAgBCTJkDwgBISAEhIAQEAJhIfANRHwpmb9j0SIAAAAASUVORK5CYII= ntAAAAAElFTkSuQmCC wcCnzcg8p0c5gAAAABJRU5ErkJggg==

Common Cross-Site Scripting (XSS) Types

XSS TypeExample PayloadDescription
Reflected XSS<script>alert(1)</script>Injected payload reflected immediately in server response.
Stored XSS<img src="x" onerror="alert(1)">Payload stored on server (e.g., in database), executed later.
DOM-Based XSSURL: #<script>alert(1)</script>Payload executed via client-side JavaScript manipulation.
Event Handler XSS<a onclick="alert(1)">Click</a>Injects event attributes to run JS on user actions.
Attribute Injection"><script>alert(1)</script>Breaks out of HTML attribute to inject malicious code.
JavaScript URI XSS<a href="javascript:alert(1)">Click</a>Runs JS via link clicks
...
Continue reading "Web Application Security: Vulnerabilities and Mitigations" »

C Programming Algorithms: Coin Change, Knapsack, MST, Shortest Path

Computer science8.06 KB

Problem Statement 16: Coin Change

Given a set of coins and a value, find the minimum number of coins to satisfy the given value.

Test Case 1:

Coins: {25, 20, 10, 5}, Value: 50 cents

Used coin: 25 cents

Used coin: 25 cents

Total number of coins: 2

Test Case 2:

Coins: {25, 20, 10, 5}, Value: 73 cents

Used coin: 25 cents

Used coin: 25 cents

Used coin: 20 cents

Used coin: 3 cents

Total number of coins: 4

Code:

-
#include int main { int amount =
50; int coins[] = {25, 20, 10, 5}; int
numCoins = 0;
printf("Amount: %d cents\n", amount);
for (int i = 0; i while (amount >= coins[i]){
amount -= coins 1;
numCoins++;
printf("Used
coin: %d cents\n", coins[i]);
}
printf("Total number of coins: %din", numCoins); return 0; }

Problem Statement 19: -#include #include int i,j,k,...

Continue reading "C Programming Algorithms: Coin Change, Knapsack, MST, Shortest Path" »

Bitcoin Consensus and Ethereum Smart Contracts

Computer science106.85 KB

Bitcoin Consensus

The Problem: Decentralized Network

  • Bitcoin operates without a central authority; all users must agree on transaction history.
  • It faces the Byzantine Generals Problem; although unknown to each other, participants must establish trust.
  • Trust is established using consensus protocols, incentives, and cryptography.

How It Works

  • The Bitcoin algorithm operates on nodes.
  • Any device (computer) running the full Bitcoin software and connected to the internet acts as a connection point for creating blocks and verifying transactions.
  • When a block is created, nodes communicate to verify the transactions and ensure they follow the algorithm's rules.
  • Each node maintains a complete copy of the Bitcoin blockchain.

Participants in the Ecosystem

  • Full Nodes:
...
Continue reading "Bitcoin Consensus and Ethereum Smart Contracts" »

Early vs Late Binding and Major Programming Paradigms

Computer science2.69 KB

Early Binding

Early binding — the binding that can be resolved at compile time by the compiler is known as static or early binding. The method definition and the method call are linked during compile time. This happens when all information needed to call a method is available at compile time. Early binding is more efficient than late binding.

Late Binding

Late binding — it is a runtime process. The method definition and the method call are linked during runtime. Execution speed is lower in late binding. Overriding methods are bound using late binding.

Programming Paradigms

Below are common programming paradigms and their characteristics.

Object-Oriented Programming (OOP)

Object-oriented programming is a programming paradigm based on the concept...

Continue reading "Early vs Late Binding and Major Programming Paradigms" »

Understanding Microprocessor Architecture and Core Components

Computer science6.55 KB

  1. Introduction to Microprocessor

Definition:

  • “The microprocessor is a multipurpose, clock driven, register based, digital-integrated circuit which accepts binary data as input, processes it according to instructions stored in its memory, and provides results as output.”
    • “Microprocessor is a computer Central Processing Unit (CPU) on a single chip that contains millions of transistors connected by wires.” Introduction:
    • A microprocessor is designed to perform arithmetic and logic operations that make use of small number-holding areas called registers.
    • Typical microprocessor operations include adding, subtracting, comparing two numbers, and fetching numbers from one area to another.
  • Components of Microprocessor
    • Microprocessor is capable of performing
...
Continue reading "Understanding Microprocessor Architecture and Core Components" »

Master Your Financial Plan: App Features and Navigation

Computer science7.2 KB

1. Login

Enter your provided username and password to access the application.

2. Tony’s Introduction

Click the Play button to watch the introductory video. To proceed, select Start Using the App.

3. Plans Page

This page displays your created financial plans. If you are a first-time user, you will see a single button; click the icon to create your first plan. If you have existing plans, use the following options:

  • DQkEAOw== Create a new plan
  • 8BAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAgMBAg Clone an existing plan
  • JiCgAqgKjjQov3wwkqCK4HY5BA0iFAhQ4cQJQKBJ Delete an existing plan

4. Summary Page

View a comprehensive summary of your income, anticipated income, income tax, and both liquid and illiquid assets.

5. Navigation Menu

MAgYpIrQii0pDLJWK0aDQdgSqUGAoIQADs= represents the Menu button. Clicking this icon opens a slider menu, which is accessible from every page within the application....

Continue reading "Master Your Financial Plan: App Features and Navigation" »

Chops 6: New Interface, Multi-Document Editing & Live Preview

Computer science2.88 KB

Welcome to Chops 6

This new version of Chops is full of exciting new features. Want to take a look?

New interface

Chops now has a more consistent, fast, and attractive interface. Also, the program windows are dockable, and you can customize the program in many different ways. Try the Options tab and the Window Layout button.

Edit several documents at once

Another key development in Chops is the ability to work with several documents at once. Now you can create a summary of a document in the same window or compare differences between two texts, for example. Try opening a new blank document and clicking the Options tab, or drag the open document tab to rearrange the desktop layout.

Live preview and contextual tabs

Try clicking the picture accompanying...

Continue reading "Chops 6: New Interface, Multi-Document Editing & Live Preview" »

Enhancing Information Systems Security: A Comprehensive Approach

Computer science99.04 KB

exam 2

exa 4

Establishing Internal Controls for Information Systems Security

With the establishment of the following sub-elements of internal control, the computer system aims to determine the fundamental basis on which to set out the requirements for managing the security of information systems.

Preventing and Avoiding Threats in Systematic Areas

  • Controls to prevent and deter threats, risks, and contingencies in systematic areas.
  • Access control systems, databases, programs, and information.
  • Using privilege levels for access, keywords, and user control.
  • Monitoring user access, information, and program usage.

Ensuring Physical Security of Systems

  • Existence of manuals and instructions, as well as dissemination and enforcement of system regulations.
  • Controls on the
...
Continue reading "Enhancing Information Systems Security: A Comprehensive Approach" »

Parcial_2_antonio_B

Computer science3.52 KB


Criteria to organize files · quick-access necessary when a single record is accessed. -not needed if a file will be processed in batches. Easy to update-a file on CD-ROM updates and never ease storage is not considered economic. -minimum data redundancy. -redundancy can be used to speed up access. · a single-index · Maintenance cheaper. -fewer errors.· Reliability A directory can have subdirectories, thus forming a hierarchical structure in the shape of an inverted tree, is symbolized by a bar of division (/) Some directories on Linux: • / bin Contains executable programs that are part of the Linux operating system . Many Linux commands like cat, cp, ls, more and tar are located in this directory. • / bootIt contains the kernel (or...

Continue reading "Parcial_2_antonio_B" »