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

Sort by
Subject
Level

Web Application Security: Vulnerabilities and Mitigations

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.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" »

Shell script

Classified in Computers

Written on in English with a size of 2.47 KB

Ejercicio de descuentos:

#!/bin/bash

read -p "¿Desea el billete también de vuelta? (s/n): " idavuelta

until [ $idavuelta=="s" ] || [ $idavuelta=="n" ]; do

read -p "¿Desea el billete también de vuelta? (s/n): " idavuelta

done

read -p "¿Tiene carnet joven? (s/n): " carnetjoven

until [ $carnetjoven="s" ] || [ $carnetjoven="n" ]; do

read -p "¿Tiene carnet joven? (s/n): " carnetjoven

done

descuento=0 billete=20

if [ $idavuelta="s" ]; then

descuento=20

billete=" expr $billete \* 2'

fi

if [ $carnetjoven="s" ]j then

descuento=30

fi

costefinal=`expr $billete \* \( 100 - $descuento \) / 100`

echo "El precio final del billete es $costefinal"



Ejercicio de medias:

#!/bin/bash

acu=0

cont=0

read -p "Introduce un numero: " num

while [ $num -ne 0 ]; do

acu=`expr $acu + $num`

cont=... Continue reading "Shell script" »

Jose Andres Gutierrez Vargas: Software Developer Profile

Classified in Computers

Written on in English with a size of 3.33 KB

Jose Andres Gutierrez Vargas

Email: [email protected]
Phone: [Your Phone Number]

Professional Summary

Results-driven and highly motivated Software Developer with extensive expertise in backend and frontend development, RESTful APIs, and database management. Skilled in SQL and NoSQL databases, with in-depth experience in Node.js for building scalable and high-performance applications. Adept at optimizing system performance, troubleshooting technical issues, and implementing innovative solutions.

Former Frontend Developer at Google, where I contributed to the development of dynamic and interactive web applications, enhancing user experiences through cutting-edge technologies. Passionate about software development, staying updated with the latest... Continue reading "Jose Andres Gutierrez Vargas: Software Developer Profile" »

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

Posted by Anonymous and classified in Computers

Written on in English with a size of 8.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" »

8051 Microcontroller: LCD Interfacing and ADC0804 Control

Classified in Computers

Written on in English with a size of 2.51 KB

LCD Interfacing with 8051

#include <reg51.h>

sbit rs = P2^0;
sbit rw = P2^1;
sbit e = P2^2;

void msdelay(unsigned int time) {
    unsigned int i, j;
    for(i = 0; i < time; i++)
        for(j = 0; j < 1275; j++);
}

void lcd_cmd(unsigned char command) {
    P1 = command;
    rs = 0;
    rw = 0;
    e = 1;
    msdelay(1);
    e = 0;
}

void lcd_init() {
    lcd_cmd(0x38); // 2 lines and 5x7 matrix
    msdelay(10);
    lcd_cmd(0x0F);
    msdelay(10);
    lcd_cmd(0x01);
    msdelay(10);
    lcd_cmd(0x80);
    msdelay(10);
}

void lcd_data(unsigned char disp_data) {
    P1 = disp_data;
    rs = 1;
    rw = 0;
    e = 1;
    msdelay(1);
    e = 0;
}

void main() {
    unsigned char a[4] = "KTU";
    int l = 0;
    lcd_init();
    while(
... Continue reading "8051 Microcontroller: LCD Interfacing and ADC0804 Control" »

Database Management Systems and ERD Fundamentals

Posted by Anonymous and classified in Computers

Written on in English with a size of 36.02 KB

Introduction to Database Management Systems

A database is a structured collection of data stored on a computer system. It is managed using a Database Management System (DBMS), which provides the necessary tools for data storage, retrieval, and modification.

Core Benefits of Using a DBMS

  • Reduced Data Redundancy: A DBMS helps minimize repeated data through organizational rules such as normalization.
  • Enhanced Data Accuracy: The system uses specific rules, such as referential integrity, to maintain data consistency.
  • Support for Multiple Users: Many people can access and use the database simultaneously without encountering operational problems.

Centralized vs. Distributed Databases

  • Centralized: All data is stored in a single, primary location. This setup
... Continue reading "Database Management Systems and ERD Fundamentals" »

Grammar Analysis and Context-Free Language Exercises

Posted by Anonymous and classified in Computers

Written on in English with a size of 4.14 KB

Hexadecimal Integer Grammar Analysis

Consider the following grammar for hexadecimal integers:

  • <hex literal> ::= 0x<number>
  • <number> ::= <number><number> | <digit>
  • <digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F

The string 0xF3 is an element of the language generated by this grammar.

Derivation Sequences and Parse Trees

1. How many distinct derivation sequences exist for this string?

There exist 6 distinct derivation sequences:

  • <hex literal> ⇒ 0x<number> ⇒ 0x<number><number> ⇒ 0x<digit><number> ⇒ 0x<digit><digit> ⇒ 0xF<digit> ⇒ 0xF3
  • <hex literal> ⇒ 0x<number> ⇒ 0x<number><number> ⇒ 0x<number&
... Continue reading "Grammar Analysis and Context-Free Language Exercises" »

Client-Side Web Application Development Examples

Classified in Computers

Written on in English with a size of 8.49 KB

Client-Side Web Application Logic

Course Registration Script

This script handles the client-side logic for a course registration form. It fetches available courses, populates a selection dropdown, and processes form submissions to register new entries via an API.

DOM Element Selection and Initialization

The script begins by selecting necessary DOM elements for interaction and notification display.

const init = async function () {
  const selectEl = document.querySelector("select");
  const formEl = document.querySelector("form");
  const notifEl = document.querySelector(".success-notif");
  const errNotifEl = document.querySelector(".fail-notif");

Notification Dismissal Logic

Functionality to close success and error notification boxes is implemented

... Continue reading "Client-Side Web Application Development Examples" »

C++ Code Examples: Essential Algorithms & Programs

Classified in Computers

Written on in English with a size of 5.54 KB

C++ Code Examples: Essential Algorithms & Programs

Here are some fundamental C++ code examples covering various algorithms and programming concepts:

Factorial Calculation

#include <iostream>
using namespace std;

long factorial(int x) {
 int i, f = 1;
 for (i = 1; i <= x; i++) {
 f = f * i;
 }
 return f;
}

int main() {
 int n;
 cout << "Enter the number: ";
 cin >> n;
 if (n < 0) {
 cout << "Factorial is not defined for negative numbers";
 } else {
 cout << "Factorial = " << factorial(n);
 }
 return 0;
}

String Length Finder

#include <iostream>
using namespace std;

int main() {
 int length = 0, i;
 char s[20];
 cout << "Enter the string: ";
 cin.getline(s, 20);
 for (i = 0; s[i] != '\0'
... Continue reading "C++ Code Examples: Essential Algorithms & Programs" »

Database Fundamentals: Normalization, Storage, and SQL Queries

Classified in Computers

Written on in English with a size of 4.08 KB

This document summarizes key concepts and solutions from previous database exam questions.


Relational Schema with Functional Dependencies

  • Schema: R(A, B, C, D, E, F)
  • Dependencies: C → F, E → A, EC → D, A → B
  1. Candidate Keys: CE
  2. Prime Attributes: C, E
  3. Second Normal Form (2NF):
    • No, because of partial dependencies:
      • C → F (partial dependency)
      • E → A, B (partial dependency)

EMP_DEPT Table Analysis

  1. Functional Dependencies:
    • Ssn → Ename, Bdate, Address, Dnumber, Dname, Dmgr_ssn
    • Dnumber → Dname, Dmgr_ssn
    • Dmgr_ssn → Dnumber, Dname
    • Dname → Dnumber, Dmgr_ssn
  2. First Normal Form (1NF):
    • Split names into first_name and last_name.
  3. Second Normal Form (2NF):
    • Already in 2NF because there are no partial dependencies.

EMP_PROJ Table Normalization

  1. Functional Dependencies:
... Continue reading "Database Fundamentals: Normalization, Storage, and SQL Queries" »