This is CS50
internet
routers
TCP/IP
IP
#.#.#.#
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| IHL |Type of Service| Total Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Identification |Flags| Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Time to Live | Protocol | Header Checksum |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Destination Address |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Example Internet Datagram Header
TCP
ports
80 HTTP
443 HTTPS
...
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Source Port | Destination Port |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Sequence Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Acknowledgment Number |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data | |U|A|P|R|S|F| |
| Offset| Reserved |R|C|S|S|Y|I| Window |
| | |G|K|H|T|N|N| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Checksum | Urgent Pointer |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options | Padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
TCP Header Format
DNS
Fully Qualified Domain Name | IP Address |
| |
| |
| |
| |
| |
| |
| |
| |
Fully Qualified Domain Name | IP Address |
| |
| |
| |
| |
| |
| |
| |
| |
DHCP
HTTP
HTTPS
https://www.example.com
https://www.example.com/
https://www.example.com/path
https://www.example.com/file.html
https://www.example.com/folder/
https://www.example.com/folder/file.html
https://www.example.com/folder/file.html
https://www.example.com/folder/file.html
https://www.example.com/folder/file.html
https://www.example.com/folder/file.html
https://www.example.com/folder/file.html
GET
POST
...
GET / HTTP/2
Host: www.harvard.edu
...
HTTP/2 200
Content-Type: text/html
...
developer tools
HTTP/2 301
Location: https://www.harvard.edu/
…
GET / HTTP/2
Host: harvard.edu
...
HTTP/2 404
Content-Type: text/html
...
200 OK�301 Moved Permanently�302 Found�304 Not Modified�307 Temporary Redirect�401 Unauthorized�403 Forbidden�404 Not Found�418 I'm a Teapot�500 Internal Server Error�503 Service Unavailable�...
GET / HTTP/1.1
Host: safetyschool.org
...
HTML
tags
attributes
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
http-server
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
hello, title
hello, body
https://www.example.com
https://www.example.com/path?key=value
https://www.example.com/path?key=value&key=value
break
https://www.youtube.com/watch?v=jjR0nsb9Kmw
regular expressions
regexes
. any single character (except line terminators)
* zero or more times
+ one or more times
? 0 or 1 time
{n} n occurrences
{n,m} at least n occurrences, at most m occurrences
…
[0123456789] any one of the enclosed characters
[0-9] any one of the range of characters
\d any digit
\D any character that is not a digit
…
^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
developer tools
CSS
properties
type selector
class selector
ID selector
attribute selector
...
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<style>
</style>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<link href="styles.css" rel="stylesheet">
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
frameworks
Bootstrap
developer tools
JavaScript
conditionals
if (x < y)�{
}
if (x < y)�{
}
if (x < y)�{
}
else
{�
}
if (x < y)�{
}
else
{�
}
if (x < y)�{
}
else if (x > y)
{�
}
else
{�
}
if (x < y)�{
}
else if (x > y)
{�
}
else
{�
}
variables
let counter = 0;
let counter = 0;
counter = counter + 1;
counter = counter + 1;
counter += 1;
counter++;
loops
for (let i = 0; i < 3; i++)
{
}
for (let i = 0; i < 3; i++)
{
}
while (true)
{
}
while (true)
{
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
hello, title
hello, body
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<script>
</script>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<script src="scripts.js"></script>
<title>
hello, title
</title>
</head>
<body>
hello, body
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
<script>
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>
hello, title
</title>
</head>
<body>
hello, body
<script src="scripts.js"></script>
</body>
</html>
blur�change�click�drag�focus�keyup�load�mousedown�mouseover�mouseup�submit�touchmove�unload�...
Bootstrap Table