Understanding the Least-Squares Method From the Perspectives of Calculus and Linear Algebra
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. I previously used the least-squares method when trying to implement some computer graphics papers, but at that time I understood it from the perspective of calculus. This year, after taking a linear algebra course, I found that it can also be explained using concepts from linear algebra and that this explanation is more intuitive (it provide...
GAMES101 Study Notes 1
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Because of various matters at school, along with reviewing for and taking exams, it has already been more than four months since I last updated the blog, and even longer since I last wrote a computer graphics post. Summer vacation recently began, and I finally studied the entirety of GAMES101 after previously watching only the ray-tracing se...
USACO23JAN Find and Replace S (Luogu P9013) Solution
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Problem link The reading experience is better on the blog Analysis The statement is very concise: given a series of character replacements, find the minimum number of steps required to turn string sss into string ttt. After receiving the problem, we can first analyze the samples. From the sample BBC→ABC\texttt{BBC} \to \texttt{ABC}BBC→ABC, w...
[Stanford CS144] Lab 4 Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Implementing the TCP State-Transition Diagram The main purpose of Lab 4 is to combine the receiver and sender from the previous labs into a complete TCP protocol stack. Therefore, it is important to become familiar with the TCP state-transition diagram. Here is a TCP state-transition diagram: Establishing a TCP Connection As shown above, TC...
[Stanford CS144] Lab 0–Lab 3 Lab Notes
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Note: Because both the lab guide and the course files[1] explicitly state that code must not be published, the lab notes on this blog mainly record ideas and a few core code snippets; I will not publish the complete repository. Lab 0: Networking Warmup The lab requires implementing a reliable byte stream in memory (ByteStream), which feels r...
CF1774C Solution
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. To complain a little, the official solution was rather difficult to understand. I remained quite confused after reading it for a long time (actually, I am also just not good enough). After understanding it, I felt that this problem was quite clever, so I came to write a solution. Approach We first need to make an observation: for the string ...
Derivation and Implementation of a Dense Neural Network on MNIST
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. upd@2022/11/5: Added the concrete implementation and corrected several notation errors in the derivation. upd@2024/6/8: Corrected a subscript error in the derivation. The main purpose of backpropagation is to calculate the partial derivatives of the neural-network error with respect to parameters such as biases and weights, allowing gradien...
Ray Tracing: The Next Week Study Notes (1)
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. After more than a month of intermittent work, I finally finished the material in the second book. As with the previous two articles, this article records some parts that personally took me a relatively long time to understand, as well as some new features I added on top of the original book. For features already present in the original book,...
Ray Tracing in One Weekend Study Notes (2): Implementing the Camera Class
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Implementing the Camera Class In addition to the Lambertian material, another interesting part of RTOW is the implementation of the camera class, especially the depth-of-field portion. Positioning the Camera Let us first look at a relatively simple part of the camera class—the camera’s position. Three parameters are enough to determine the c...
Ray Tracing in One Weekend Study Notes (1): Lambertian Materials and Radiometry
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Recently (it has been a week since I finished RTOW, and I am only writing these notes now—truly lazy) I spent some time finishing Ray Tracing in One Weekend (hereafter RTOW) I really am not good enough; I did not finish this thing in one weekend and also wrote the code. The book is excellent, and the final rendering was beyond my expectation...
[MIT 6.s081] Xv6 Lab 11: Mmap Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. This is the final lab. I have finally finished them all! Lab 11: mmap Description This lab implements a subset of the mmap() and munmap() system cal...
[MIT 6.s081] Xv6 Lab 10: File System Record
The content below was generated entirely by machine translation. Please verify its accuracy. If anything is unclear, consult the Chinese source version. Update on 2022/9/14: I recently put the lab code on GitHub. If you need a reference, you can find it here: https://github.com/ttzytt/xv6-riscv The different branches contain the different labs. Lab 10: File System Large files Description In xv6’s underlying implementation, a file is described by struct dinode, as follows: 12345678struct din...



![[Stanford CS144] Lab 4 Record](/img/CS144/tcp%E7%8A%B6%E6%80%81%E6%B5%81%E8%BD%AC%E5%9B%BE.jpg)




![[MIT 6.s081] Xv6 Lab 11: Mmap Record](/img/xv6/note/xv6%E4%B9%A6%E5%B0%81%E9%9D%A2.png)