Skip to content

Commit

Permalink
update: 240709 ver 1
Browse files Browse the repository at this point in the history
  • Loading branch information
V1CeVersaa committed Jul 9, 2024
1 parent a3fc7b1 commit 91339f2
Show file tree
Hide file tree
Showing 21 changed files with 481 additions and 271 deletions.
10 changes: 10 additions & 0 deletions docs/Computer Science/Algorithm/03 Trees.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ typedef struct TreeNode {
}
```

=== "Delete"

删除分为三种情况:

- 删除叶节点:直接删除即可;
- 删除只有一个儿子的节点:直接删除,然后把儿子接上;
- 删除有两个儿子的节点:
- 将该节点替换为左子树的最大值,或右子树的最小值;
- 递归删除左子树的最大值,或右子树的最小值。

## 3 Threaded Binary Trees

- 如果一个节点的左子节点为空的,那么将左指针指向中序遍历的前驱节点;
Expand Down
19 changes: 19 additions & 0 deletions docs/Computer Science/Programming Basis/tmux.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,22 @@
!!! info "What is tmux?"
tmux’s authors describe it as a terminal multiplexer. Behind this fancy term hides a simple concept: Within one terminal window you can open multiple windows and split-views (called "panes" in tmux lingo). Each pane will contain its own, independently running shell instance (bash, zsh, whatever you're using). This allows you to have multiple terminal commands and applications running side by side without the need to open multiple terminal emulator windows.

## 快捷键基础速通

快捷键前缀:`Ctrl + b`

- `Ctrl + b number`:切换会话;
- `Ctrl + b %`:划分左右两个窗格;
- `Ctrl + b "`:划分上下两个窗格;
- `Ctrl + b 方向键`:光标以当前窗格按照方向键方向切换窗格;
- `Ctrl + b c`:创建新窗口;
- `Ctrl + b ;`:切换到上一个窗格;
- `Ctrl + b o`:切换到下一个窗格;
- `Ctrl + b x`:关闭当前窗格;
- `Ctrl + b !`:将当前窗格拆分为独立窗口;
- `Ctrl + b d`:分离当前会话;
- `Ctrl + b s`:列出所有会话;
- `Ctrl + b $`:重命名当前会话;
- `Ctrl + b z`:当前窗格全屏显示,再按一次会恢复;

我觉得差不多够了。
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Object Oriented Programming

!!! info
本部分对应 《C++之旅》的第三章到第七章,并且包含了《C++ Primer》的某些内容。主要是以实现类似于标准库 `vector` 的容器类 `Vector` 为例。

## Template

10 changes: 10 additions & 0 deletions docs/Computer Science/Programming Language/C++/Standard Library.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ vector 支持了更多的迭代器运算,一方面可以使得迭代器的每
- `iter1 - iter2`:返回两个迭代器之间的距离;
- `>` `>=` `<` `<=`:若某个迭代器在另一个迭代器之前,则认为前者小于后者;

### String

需要使用 `#!C++ #include<string>` 来使用 `string``string` 是一个可变大小的字符序列,支持快速随机访问,但是在尾部以外的部分插入或者删除元素的速度可能很慢。

- 定义变量并初始化:`#!C++ string s1 = "hello";`
- 输入输出:`#!C++ cout << s1; cin >> s1;`
- 赋值:`#!C++ string s2 = s1;`,这是合法的,其实就是拷贝(对比 C 字符串);
- 拼接:`#!C++ string s3 = s1 + s2;``#!C++ s1 += s2;``s1``s3` 都变成了 `hellohello`



### Array

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 01 Variable and Types

## Built-in Types


### String

#### f-string

> [f-strings from Python documentation](https://docs.python.org/3.11/reference/lexical_analysis.html#formatted-string-literals)



### Interconversion between types

17 changes: 17 additions & 0 deletions docs/Computer Science/Programming Language/Python/03IO
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 02 Input and Output




## File I/O

打开文件首先要使用 `open()` 函数,`open(filename, mode, encoding="utf-8")` 会返回一个 file object:第一个参数是包含了文件名的字符串;第二个参数是指定了文件使用方式的字符串,常见的有:

- `r`:只读模式(默认);
- `w`:只写模式,创建新文件(覆盖同名文件),并且先截断文件;
- `a`:追加模式,打开一个文件用于追加到末尾,如果文件不存在则创建;
- `*b`:`b` 作为后缀,表示二进制模式;
- `+`:读写模式,打开用于更新;
- `t`:文本模式(默认);

默认的参数是 `r` 并且与 `rt` 同义,也就是通常情况下,文件是以 text mode 模式打开的,从文件中读写字符串,这些字符串是以特定的形式编码的,返回参数都是 `str`,可以在 `open()` 函数中指定 `encoding` 参数来指定编码方式,不然就以平台默认的字节编码解码。
52 changes: 52 additions & 0 deletions docs/Computer Science/Web/Javascript/Javascript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Javascript

## 1 Basic Syntax

### 1.1 script 标签

可以使用 `<script>` 标签将 JavaScript 代码插入到 HTML 页面中,如果指定了 `src` 属性,就可以将外部的 JavaScript 文件引入到 HTML 页面中,同时 `<script>` 标签内的代码就会被忽略,一个单独的 `<script>` 标签不可以同时有 `src` 属性和内部代码。

```html
<script src="script.js"></script>
<script> alert('Hello, World!'); </script>
```

### 1.2 代码结构

语句是执行行为/Action 的语法结构和命令,JavaScript 语句以分号 `;` 结尾并分割,但是如果在语句末尾存在换行符的时候,分号就大多情况下会自动插入。但是经常会有特殊的例子:

<div class="grid" markdown>

```javascript
alert('Hello');

[1, 2].forEach(alert);
```

```javascript
alert('Hello')

[1, 2].forEach(alert);
```

</div>

第二种情况会被视为 `alert('Hello')[1, 2].forEach(alert);`,就只会显示一个 `hello`,所以在 JavaScript 中,最好还是手动添加分号。

### 1.3 变量与常量

使用 `let` 或者 `var` 来创建一个变量,但是现代一般使用 `let`,比如 `let message` 就创建了一个名为 `message` 的变量,`message = "hello"` 就将 `message` 赋值成为 `hello`,变量名可以包含字母、数字、下划线和美元符号,甚至可以有非英文字母,但是不能以数字开头,同时推荐使用驼峰命名法。

不允许连续声明同一个变量,变量的值可以随时改变,JavaScript 是一种动态类型语言,变量的类型可以随时改变。

使用 `const` 可以创建一个常量,比如 `const BIRTHDAY = "28.08.2005` 就创建了一个常量,常量不可以被修改。

在教程给出的例子中,我们会发现其实下面的代码会输出 `John``John`,因为 `admin` 只是保存了 `name` 的值,而不是 `name` 的引用。
```javascript
let name = "John", admin = name;
alert(admin);
name = "susy";
alert(admin);
```

### 1.4 数据类型
File renamed without changes.
5 changes: 5 additions & 0 deletions docs/Reading/The Western Heritage/Chapter01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Chapter 1 The Birth of Civilization

***Culture may be defined as the ways of living built up by a group and passed on from a generation to another.*** It includes behavior such as courtship and child-rearing practices; material things such as tools, clothing, and shelter; and ideas, institutions, and beliefs. **Language**, apparently a uniquely human trait, **lies behind our ability to create ideas and institutions and to transmit culture from one generation to another.** Our flexible and dexterous hands enable us to hold and make tools and so to create the material artifacts of culture. Because ***culture is learned and not inherited***, it permits rapid adaption to changing conditions, making possible the spread of humanity to almost all the lands of the globe.

During the **Paleolithic**,
9 changes: 3 additions & 6 deletions docs/Reading/The Western Heritage/The Western Heritage.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# The Western Heritage

!!! Info
未完工!我会加紧进度的!

!!! Warning
本文仅作为本人对《The Western Heritage》一书的笔记,除记录知识以外再无其它意义
# The Western Heritage



## *Chapter 1 The Birth of Civilization*
## Table of Contents

***Culture may be defined as the ways of living built up by a group and passed on from a generation to another.*** It includes behavior such as courtship and child-rearing practices; material things such as tools, clothing, and shelter; and ideas, institutions, and beliefs. **Language**, apparently a uniquely human trait, **lies behind our ability to create ideas and institutions and to transmit culture from one generation to another.** Our flexible and dexterous hands enable us to hold and make tools and so to create the material artifacts of culture. Because ***culture is learned and not inherited***, it permits rapid adaption to changing conditions, making possible the spread of humanity to almost all the lands of the globe.

During the **Paleolithic**,
Loading

0 comments on commit 91339f2

Please sign in to comment.