This commit is contained in:
Michael Zhang 2019-03-04 22:23:46 -06:00
parent 36bfaddae3
commit 62c9333765
No known key found for this signature in database
GPG Key ID: 5BAEFE5D04F0CE6C
5 changed files with 27 additions and 2 deletions

6
.editorconfig Normal file
View File

@ -0,0 +1,6 @@
root = true
[*]
end_of_file = lf
insert_final_newline = true
trim_trailing_whitespace = true

View File

@ -1,4 +1,5 @@
+++
title = "all pages"
template = "listing.html"
page_template = "post.html"
+++

View File

@ -1,6 +1,5 @@
+++
title = "about me"
template = "post.html"
+++
Hi there! I'm a Computer Science student at the University of Minnesota, and I've got a wide variety of interests under this field. I've been doing web development for a long time and now I'm looking into security, programming language development, and software development!

View File

@ -0,0 +1,20 @@
+++
title = "interesting cs analogies"
+++
stupid analogies i think of in my free time
## socket server + multiple clients analogy
If you think about it, a server waiting for clients is kind of like the host at the front of a restaurant leading guests to tables. They don't actually take orders or serve food, they just stand at the front and wait for new guests to arrive. Then there's another waiter that's specifically assigned to take that table's orders.
When a server binds to, for example, `localhost:3000`, what the server really gets is a file descriptor; this is what's meant by:
```c
int socket(int domain, int type, int protocol);
int bind(int socket, const struct sockaddr *address, socklen_t address_len);
```
The `listen` library call then marks this socket as one that's open for connections, similar to marking the restaurant staff as a host rather than a waiter.
According to the manpage for `accept`, when a connection-mode socket accepts a connection, it'll "extract the first connection on the queue of pending connections, create a new socket with the same socket type protocol and address family as the specified socket, and allocate a new file descriptor for that socket." This new socket would be the waiter who actually takes your orders.

View File

@ -1,6 +1,5 @@
+++
title = "my setup"
template = "post.html"
+++
## desktop