Skip to content

Commit

Permalink
update notes in computer architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
kekeandzeyu committed Feb 8, 2025
1 parent 669cb56 commit 2742227
Show file tree
Hide file tree
Showing 8 changed files with 75,944 additions and 11 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Computer-Science-Study-Notes

![Favicon](public/assets/photo.png)
![Favicon](public/assets/photo.svg)

> *We are all lost stars, trying to light up the dark.*
Expand Down Expand Up @@ -108,6 +108,14 @@ If someone's original work is used but not mentioned in the following list, or b

10. <https://en.wikipedia.org/wiki/Floating-point_arithmetic>.

11. <https://cplusplus.com/reference/cstring/strcpy>.

12. <https://cplusplus.com/reference/cstring/strncpy>.

13. <https://cplusplus.com/reference/cstring/strcmp/>.



### Topic 6: Operating System

1. CS162: Operating System (UC Berkeley) by Professor John Kubiatowicz, Ion Stoica and the rest of CS162 staff.
Expand Down
2 changes: 1 addition & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 计算机科学学习笔记

![Favicon](public/assets/photo.png)
![Favicon](public/assets/photo.svg)

> *我们都是迷失在璀璨梦境中的繁星,不顾一切只为点亮黑暗。*
Expand Down
Binary file removed public/assets/photo.png
Binary file not shown.
57,862 changes: 57,862 additions & 0 deletions public/assets/photo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18,058 changes: 18,058 additions & 0 deletions public/assets/photo1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/layouts/BaseLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { title, hideLangSwitcher = false } = Astro.props;
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/assets/photo.png" />
<link rel="icon" href="/assets/photo.svg" />

<link rel="preload" href="/fonts/Inter/Inter-Display/InterDisplay-Medium.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/fonts/Inter/Inter-Text/Inter-Medium.woff2" as="font" type="font/woff2" crossorigin>
Expand Down
12 changes: 6 additions & 6 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const pageTitle = 'Computer Science Study Notes';
<div class="details">

<div class="introduction">
<img src="/assets/photo.png" alt="Favicon"/>
<img src="/assets/photo.svg" alt="Favicon"/>
<div class="introduction-text">
<h2>Introduction</h2>
<p class="text">New to this website and the notes? Learn about the background behind these notes!</p>
Expand All @@ -36,11 +36,11 @@ const pageTitle = 'Computer Science Study Notes';
<p class="text">The notes will keep updating as I learn. Feel free to come back at any time!</p>
<Button link="/notes/" children="View Notes"></Button>
</div>
<img src="/assets/photo.png" alt="Favicon"/>
<img src="/assets/photo.svg" alt="Favicon"/>
</div>

<div class="author">
<img src="/assets/photo1.jpg" alt="My Photo"/>
<img src="/assets/photo1.svg" alt="My Photo"/>
<div class="author-text">
<h2>About Me</h2>
<p class="text">Want to know more about me? Click the button below to learn more!</p>
Expand Down Expand Up @@ -74,7 +74,7 @@ const pageTitle = 'Computer Science Study Notes';
<div class="details">

<div class="introduction">
<img src="/assets/photo.png" alt="Favicon"/>
<img src="/assets/photo.svg" alt="Favicon"/>
<div class="introduction-text">
<h2>介绍</h2>
<p>第一次来到这个网站和笔记?想要了解背后的故事?</p>
Expand All @@ -88,11 +88,11 @@ const pageTitle = 'Computer Science Study Notes';
<p>笔记会随着我的学习不断更新。随时欢迎回来!</p>
<Button link="/posts/database-system/" children="查看笔记"></Button>
</div>
<img src="/assets/photo.png" alt="Favicon"/>
<img src="/assets/photo.svg" alt="Favicon"/>
</div>

<div class="author">
<img src="/assets/photo1.jpg" alt="My Photo"/>
<img src="/assets/photo1.svg" alt="My Photo"/>
<div class="author-text">
<h2>关于我</h2>
<p>想要了解更多关于我?点击下面的按钮了解更多!</p>
Expand Down
9 changes: 7 additions & 2 deletions src/pages/notes/computer-architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,13 @@ char str1[6] = {'H', 'e', 'l', 'l', 'o', '\0'};
char str2[6] = "Hello";
```
Here are some common;y-used string functions defined in the `string.h` library:
Here are some commonly-used string functions defined in the `string.h` library:
1. `size_t strlen(const char * str)`: Returns the length of the string (not including the null terminator).
2. `char * strcpy ( char * destination, const char * source )`: Copies the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point).
3.
3. `char * strncpy ( char * destination, const char * source, size_t num )`: Copies the first num characters of source to destination. If the end of the source C string (which is signaled by a null-character) is found before num characters have been copied, destination is padded with zeros until a total of num characters have been written to it.
4. `int strcmp ( const char * str1, const char * str2 );`: Compares the C string `str1` to the C string `str2`, return 0 if str1 and str2 are identical.
5. `int strncmp ( const char * str1, const char * str2, size_t num )`: Compares up to num characters of the C string `str1` to those of the C string `str2`.
6. `char * strcat ( char * destination, const char * source )`: Appends a copy of the source string to the destination string. The terminating null character in destination is overwritten by the first character of source, and a null-character is included at the end of the new string formed by the concatenation of both in destination.
7. `char * strncat ( char * destination, const char * source, size_t num )`: Appends the first num characters of source to destination, plus a terminating null-character.

0 comments on commit 2742227

Please sign in to comment.