Hexo博客教程
笔记
命令
hexo new "postName" # 新建文章 |
按文章更新时间排序
# Home page setting |
背景设置
把你挑选的背景图片命名为:background.jpg,放在blog\themes\next\source\images里,在blog\themes\next\source\css_custom文件的custom.styl首部添加
body { |
符号链接
# Windows,有些文件需要文件名相同才能打开 |
安装主题
- npm安装在modules下
cd hexo-site |
- git clone安装
cd hexo-site |
Hexo
我的配置
# 设置英文字体 |
Quick Start
npm install hexo-cli -g |
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Create a new post
$ hexo new "My New Post" |
More info: Writing
Run server
$ hexo server |
More info: Server
Generate static files
$ hexo generate |
More info: Generating
Deploy to remote sites
$ hexo deploy |
More info: Deployment
AI爱外卖
项目心得
24.10.9
将AliOss换成本地存储。可是一直插入不成功,使用Swagger调试,甚至数据库什么都接受不到!非常诡异的BUG
原来,是导入了错误的RequestBody,导致前端提交的表单怎么都接受不到!
// 导入了错误的包 |
Nginx
反向代理
server { |
好处:
- 不会暴露服务器,服务器可以安全放在内网,由nginx转发、缓存。
负载均衡
upstream webservers{ |
Swagger
Knife4j:Java MVC框架集成Swagger
API接口文档生成、测试
OS 操作系统
Chapter3 操作系统结构
复杂度管理方法 M.A.L.H
Modularity: 模块化,分而治之
Abstraction: 抽象,接口与实现分离,遵循宽进严出原则。例如虚拟内存、文件系统
对于大型系统,只有模块化和抽象,可能导致划分模块太多,交互关系复杂,因此还需要引入分层和层次结构控制复杂度。
Layering: 分层,每个层级是一套完整机制。通常一个模块只能与本层和上下层交互,不能跨层。例如OSI、TCP/IP
Hierarchy: 层次结构,大的子系统由多个小的子系统组织成。即同级模块的分层
宽进严出原则:容忍各种输入(包括恶意输入),严格控制模块的对外输出
微内核
宏内核架构:单点bug使整个系统崩溃。
微内核:解耦单个功能/模块(如文件系统、设备驱动)作为独立服务隔离运行,使内核成为一个最小功能集。
微内核架构服务隔离,单点出问题系统不会崩溃
内核态部分,称为μkernel
微内核优势:
- 弹性硬件拓展能力
- 硬件异构实现
- 功能安全
- 信息安全
- 时延确定
现代操作系统特征:1)虚拟内存;2)用户态、内核态隔离。
CS61B sp18
Gradescope Autograder
Spring 2018
44个Assn,偏向数据结构
邀请码:MNXYKX
学校:UC Berkeley
直接输入,不要选择2U-UC Berkeley
,否则将提示COURSE ENTRY CODE IS INVALID
Spring 2021
19个Assn,偏向软件工程
邀请码:MB7ZPY
文章收录
The Law of the Broken Futon 浮沙筑高台法则
“Since I’m fine now, can’t I add that missing piece later, when it’s actually needed?” Sometimes, yes. But it’s much harder.
Adding the missing piece later means waiting until the damage is already underway, and hellishly difficult to undo.
A Response to “Why Most Unit Testing is Waste”
(Unit Tests) They are based on programmers’ fantasies about how the function should work. But programmers break down requirements into smaller components all the time – this is how you program. Sometimes there are misunderstandings, but that is the exception, not the rule, in my opinion.
2.1 Mystery of Java Restore
When instantiate an Object,
obj = new Object()
,obj
stores the address of the Object, not the specific data struction.
(That is why all type of variables create memory boxes of 64 bits. It is just the memory of the address.)
Therefore, When we use obj2 = obj
, Java simply copy the addr of obj
and assign it to obj2
(They are pointing to the same Object), that is why when we change obj2.weight
it effects obj.weight
too.
DNS Over Https
Windows
# 模板 |
查看DoH模板:
$ netsh dns show encryption |
ICS5 PA
PA1-1 24.5.30
又开始了ICS之旅,这次又给自己下了一个难度,找到了汪亮老师讲解的ICS 5!
target
第一课的目标是修正一个register错误声明
insteresting
- 中途网易源Bad Gateway 502了,更换清华源,学会了
:%s/163/tuna/g
非常爽! - 又学了几个终端快捷键
- 想到了用
ccache
加速我的PA
problems
union
和struct
的区别?
unioin
在同一个内存空间中存储不同的数据类型。
struct
则是同时存储不同的数据类型。- 为什么要用
union
?阅读i386手册
2.3.1 General Registers
As Figure 2-5 shows, the low-order word of each of these eight registers has a separate name and can be treated as a unit. This feature is useful for handling 16-bit data items and for compatibility with the 8086 and 80286 processors. The word registers are named AX, BX, CX, DX, BP, SP, SI, and DI.
对于CPU来说,可以把AH AX AL看成单独的单元,拆分成小块。所以它们是共用关系。
PA1-2 ALU 24.6.5
target
实现ALU中的各类运算,包括设置标志位
knowledge
Appendix C
Name | Function |
---|---|
CF | Carry Flag ── Set on high-order bit carry or borrow; cleared otherwise. |
PF | Parity Flag ── Set if low-order eight bits of result contain an even number of 1 bits; cleared otherwise. |
ZF | Zero Flag ── Set if result is zero; cleared otherwise. |
SF | Sign Flag ── Set equal to high-order bit of result (0 is positive, 1 if negative). |
OF |
Overflow Flag ── Set if result is too large a positive number or too small a negative number (excluding sign-bit) to fit in destination operand; cleared otherwise. |
Github使用指南
Git配置
远程仓库 - 廖雪峰的官方网站 (liaoxuefeng.com)
- 创建ssh key,在c盘用户目录.git文件夹中
ssh-keygen -t rsa -C "youremail@example.com"
ssh-keygen -l -f ~/.ssh/id_rsa
可以查看秘钥的配置信息,包括邮箱 - 在GitHub账号设置页面,添加ssh key,复制
.ssh/id_rsa.pub
的信息,点击创建即可 - 测试是否成功:
ssh -T git@github.com
注意:如果测试不成功,可能是反向代理的问题
Github 远程仓库
- 在github上新建一个仓库
git remote add origin git@github.com:github账号名称/仓库名称.git
关联仓库,origin是远程库的名字git push -u origin master
把本地库内容(master分支)推送到远程库(oringin),-u
参数表示会把本地master分支和远程master分支关联起来,方便后面简化命令
git remote set-url origin <URL>
更改仓库地址
github trending 热门软件
- 项目含金量 stars 1k+
- fork 拷贝项目到自己的仓库
- pull request 合并分支
NJU
- 学习编程语言如C、Rust
- 精选精读论文
- STFW:比百度更高效的办法
Django动态网页 Python项目
0.0 规范
我要编写一个名为“学习笔记”的 Web 应用程序,让用户能够记录感兴趣的主题,并在学习每个主题的过程中添加日志条目。“学习笔记”的主页对这个网站进行描述,并邀请用户注册或登录。用户登录后,可以创建新主题、添加新条目以及阅读既有的条目。
目录 ll_project 包含 4 个文件, 其中最重要的是 settings.py、urls.py 和 wsgi.py。文件 settings.py 指定 Django 如何与系统交互以及如何管理项目。
在开发项目的过程中,我们将修改其中的一些设置,并添加一些设置。
文件 urls.py 告诉 Django,应创建哪些网页来响应浏览器请求。
文件 wsgi.py 帮助 Django 提供它创建的文件,名称是 web server gateway interface(Web 服务器网关接口)的首字母缩写。
1.0 创建环境
1.1 创建虚拟环境
在独立的项目文件夹下运行
python -m venv ll_env |
将会创造一个ll_env
文件夹
可以使用下面的命令激活虚拟环境。激活虚拟环境后,安装的模组将只在虚拟环境中生效,而不干扰到电脑上Python的模组
source ll_env/bin/activate # Linux系统 |
使用deactive
取消激活虚拟环境
1.2 安装配置Django
pip install --upgrade pip # 更新pip |
Django手册: https://docs.djangoproject.com/en/4.1/ref/models/fields/
gdb使用
NJU gdb六步走
- 启动gdb,加载可执行文件
- 设置断点
break main
入口处设置断点 - 启动程序
run (参数)
- 查看程序当然状态
info register (EIP)
: 显示所有寄存器(或只有EIP寄存器)的内容- 栈:保存过程执行时的数据信息
- 继续下一条指令
step
或si
(机器指令)
- 退出
quit
1.0 Cprograming
原网址: https://www.cprogramming.com/gdb.html
gcc main.c -g -Wall -Werror -o main 启动编译
gdb main 开始debug
list 列出代码
break 行 设置断点
info break 断点信息
run 运行程序
next或step 进行单步编译(next跳过函数)
print <value> 打印变量的值
continue 跳到下一个断点位置
quit 退出