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

Sort by
Subject
Level

Implementing Logistic Regression and Naive Bayes in Python

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.86 KB

Logistic Regression Implementation

1. Upload and Prepare Dataset

from google.colab import files
uploaded = files.upload()

2. Import Libraries

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import confusion_matrix

3. Load and Split Data

data = pd.read_csv("Social_Network_Ads.csv")
X = data[['Age','EstimatedSalary']]
y = data['Purchased']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=0)

4. Feature Scaling and Model Training

sc = StandardScaler()
X_train = sc.fit_transform(X_train)
X_test = sc.
... Continue reading "Implementing Logistic Regression and Naive Bayes in Python" »

How the World Wide Web Works: A Technical Breakdown

Classified in Computers

Written on in English with a size of 2.84 KB

How the World Wide Web Works

The World Wide Web is the most widely used part of the internet. When you browse the web, you view multimedia pages containing text, pictures, graphics, sounds, and videos. The web uses hypertext links to allow you to navigate from one place to another.

The web operates on a client/server model: client software (the web browser) runs on your computer, while server software runs on a web host.

To use the web, you need an internet connection and a web browser. You type the URL for the website you wish to visit, and your browser sends a request using the HTTP protocol. This is how the browser and server communicate. When the server finds the requested page, it sends it back to the browser.

How Web Pages Are Organized

The... Continue reading "How the World Wide Web Works: A Technical Breakdown" »

File Systems, Kernels, and High-Performance Networking

Posted by Anonymous and classified in Computers

Written on in English with a size of 25.6 KB

Fast File System (FFS)

Writes

Writes: Writes data to blocks chosen by cylinder groups. Tries to place related blocks near each other and rotationally optimize access. Metadata updates (inodes, directories) are also written in-place within the same group.

Reads

Reads: Very fast because data is grouped by cylinder, minimizing seeks. Sequential reads benefit from rotational optimization and large block sizes (4–8 KB). The first read goes through the inode, then the inode's data block pointers.

Appends

Appends: Allocates the next block near the previous one. Uses rotational delay tables to place the next block just in time for the disk head. Large blocks plus fragments allow efficient small-file appends.

Crash Recovery

Crash Recovery: Uses fsck to walk... Continue reading "File Systems, Kernels, and High-Performance Networking" »

Internet Fundamentals: Protocols, Web Browsers, and Network Architecture

Posted by Anonymous and classified in Computers

Written on in English with a size of 7.49 KB

Internet vs. World Wide Web (WWW)

  • Internet: A global network infrastructure that uses TCP/IP to connect devices worldwide.
  • WWW (World Wide Web): A multimedia service built upon the Internet, utilizing HTML, CSS, web browsers, and hyperlinks.
  • Webpage: A single document accessible via the WWW. | Website: A collection or group of related webpages.

History and Evolution of the Internet

  • 1960s: Development of ARPANET (Advanced Research Projects Agency Network).
  • 1983: Adoption of the TCP/IP protocol suite (developed by Vint Cerf and Bob Kahn).
  • 1989: Invention of the World Wide Web (WWW) by Tim Berners-Lee.
  • 1992: Release of the Mosaic browser (developed at UIUC), popularizing the graphical web.

Understanding the Client-Server Model

  • Client: Initiates a request
... Continue reading "Internet Fundamentals: Protocols, Web Browsers, and Network Architecture" »

Mastering jQuery and Modern Form Validation

Posted by Anonymous and classified in Computers

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

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

Vte60I22Y4rloTJJkNobQnzfKnvzVllIg5VXseVlb8Oo0lemK0wbVL2Ro4ylzQ96mYBvg7I3FlW9EaUPdsbPXfehlUZYxr6v7kaIgqQgAAEIQAACEIBALQHEci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AAAAElFTkSuQmCC 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" »

Universal Data Science Python Template for Machine Learning

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.89 KB

Universal Data Science Python Template

This template provides a streamlined workflow for common data science tasks, including data preprocessing, modeling, and visualization.

Step 1: Import Libraries

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression, LinearRegression
from sklearn.cluster import KMeans, DBSCAN
from sklearn.metrics import accuracy_score, r2_score, silhouette_score

Step 2: Load Dataset

df = pd.read_csv('your_dataset.csv') # Replace with your dataset name
print(df.head())

Step 3: Data Cleaning

df = df.dropna()

Step 4: Feature Selection

X = df.drop(

... Continue reading "Universal Data Science Python Template for Machine Learning" »

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" »