网络搜索

网站 URL 备注
哔哩哔哩 https://search.bilibili.com/all?keyword={query}
知乎 https://www.zhihu.com/search?type=content&q={query}
百度贴吧 https://tieba.baidu.com/f?ie=utf-8&kw={query}&fr=search 优先搜索吧名
小红书 https://www.xiaohongshu.com/search_result?keyword={query}&source=web_search_result_notes 需要登录
淘宝 https://s.taobao.com/search?q={query}&commend=all&search_type=item&sourceId=tb.index&ie=utf8
京东 https://search.jd.com/Search?keyword={query}&enc=utf-8
咸鱼 https://www.goofish.com/search?q={query}
Yandex https://yandex.com/search/?text={query}
GitHub https://github.com/search?q={query}&type=repositories
tldr https://tldr.inbrowser.app/pages/common/{query} mannual查Linux命令
必应翻译 https://cn.bing.com/translator?ref=TThis&text={query}&from=en&to=zh-Hant 英译中
DeepL翻译 https://www.deepl.com/translator#en/zh/{query} 英译中
Wiki外部网站 https://encyclopedia.thefreedictionary.com/{query}
求闻百科 https://www.qiuwenbaike.cn/wiki/{query}
Wolfram|Alpha https://www.wolframalpha.com/input?i={query}&lang=zh
  • 有时候站内搜索没有搜索引擎准确,可以使用搜索引擎过滤网站
    过滤站点:
http://<ENGINE.URL>/search?text=site%3A<SITE.URL>%20{query}

启动应用

功能 路径 参数
当前目录启动终端 wt.exe -d “{current_folder}”
Golden Dict查词 GoldenDict.exe -s {query}
启动ipython wt.exe ipython
查看网络连接 control.exe ncpa.cpl
编辑环境变量(需要管理员权限) rundll32 sysdm.cpl,EditEnvironmentVariables

信息系统架构

  • 信息化系统:前台 + 后台 + 数据库
  • B/S 模式
  • 前端 -> Server[Apache->PHP(TP6.0)] -> SQL DataBase
  • 运行逻辑:
    • Client发送require请求(http协议),包含header(length、refer信息)、body(数据)
    • Apache接受请求,给PHP做处理
    • PHP读取、处理数据;判断数据是否损毁、是否需要退回
    • 数据更新到前端,并返回结果(success/fail)
阅读全文 »

“When in doubt go to the library.” – J.K.Rowling

Catalog

Article1: What Are You Going to Do With That?

What Are You Going to Do With That?

William Deresiewicz(《国家》杂志撰稿人和《新共和》杂志编辑)在斯坦福大学的演讲

The question my title poses, of course, is the one that is classically aimed at humanities majors. What practical value could there possibly be in studying literature or art or philosophy? So you must be wondering why I’m bothering to raise it here, at Stanford, this renowned citadel of science and technology. What doubt can there be that the world will offer you many opportunities to use your degree?

(学习文学、艺术或哲学能有什么用呢?所以你肯定纳闷,我为什么在在以科技堡垒而闻名的斯坦福提出这个问题呢?在大学学位给人带来众多机会的问题上还有什么可怀疑的吗?)

But that’s not the question I’m asking. By “do” I don’t mean a job, and by “that” I don’t mean your major. We are more than our jobs, and education is more than a major. Education is more than college, more even than the totality of your formal schooling, from kindergarten through graduate school. By “What are you going to do,” I mean, what kind of life are you going to lead? And by “that,” I mean everything in your training, formal and informal, that has brought you to be sitting here today, and everything you’re going to be doing for the rest of the time that you’re in school.

(但那不是我提出的问题。这里的“做”并不是指工作,“那”并不是指你的专业。我们不仅仅是要个工作,教育不仅仅是学一门专业。教育也不仅仅是上大学,甚至也不仅是从幼儿园到研究生院的正规学校教育。我说的“你要做什么”的意思是你要过什么样的生活?我所说的“那”指的是你得到的正规或非正规的任何训练, 那些把你送到这里来的东西,你在学校的剩余时间里将要做的任何事。)

阅读全文 »

笔记

命令

hexo new "postName" # 新建文章
hexo new page "pageName" # 新建页面
hexo generate # 生成静态页面至public目录
hexo server # 开启预览访问端口(默认端口4000,'ctrl + c'关闭server)
hexo deploy # 部署到GitHub
hexo help # 查看帮助
hexo version # 查看Hexo的版本

按文章更新时间排序

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -updated # 默认是-date

背景设置

把你挑选的背景图片命名为:background.jpg,放在blog\themes\next\source\images里,在blog\themes\next\source\css_custom文件的custom.styl首部添加

body {
background:url(/images/background.jpg);
background-attachment: fixed;
}

符号链接

# Windows,有些文件需要文件名相同才能打开
# -d 目录符号链接
mklink /d C:\file\path\Target C:\file\path\Source

安装主题

  1. npm安装在modules下
cd hexo-site
npm install hexo-theme-next
  1. git clone安装
cd hexo-site
git clone https://github.com/next-theme/hexo-theme-next themes/next
# Upgrade
cd themes/next
git pull origin master
# Configuration
cp themes/next/_config.yml _config.next.yml

Hexo

我的配置

# 设置英文字体
global:
family: Source Serif Pro

# layout\_partials\head\head.njk 设置中文字体
{{ next_font() }}
{{ next_vendors('fontawesome') }}
<link href="https://fonts.googleapis.com/css?family=Noto+Serif+SC&display=swap" rel="stylesheet">
# source\css\_variables\base.styl 添加中文字体
$font-family-chinese = "Noto Serif SC"

codes:
family: IBM Plex Mono

codeblock:
theme:
light: stackoverflow-light

Quick Start

npm install hexo-cli -g
hexo init blogFolderName
cd blog
npm install
hexo server

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

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.

阅读全文 »

Windows

# 模板
netsh dns add encryption server=<IP Address> dohtemplate=<DOH Template> autoupgrade=yes udpfallback=no

# 腾讯
netsh dns add encryption server=1.12.12.12 dohtemplate=https://doh.pub/dns-query autoupgrade=yes udpfallback=no

netsh dns add encryption server=120.53.53.53 dohtemplate=https://doh.360.cn/dns-query autoupgrade=yes udpfallback=no

查看DoH模板:

$ netsh dns show encryption

223.5.5.5 加密设置
----------------------------------------------------------------------
DNS-over-HTTPS 模板 : https://dns.alidns.com/dns-query
自动升级 : yes
UDP 回退 : no

0.0 规范

我要编写一个名为“学习笔记”的 Web 应用程序,让用户能够记录感兴趣的主题,并在学习每个主题的过程中添加日志条目。“学习笔记”的主页对这个网站进行描述,并邀请用户注册或登录。用户登录后,可以创建新主题、添加新条目以及阅读既有的条目。

目录 ll_project 包含 4 个文件, 其中最重要的是 settings.pyurls.pywsgi.py。文件 settings.py 指定 Django 如何与系统交互以及如何管理项目。
在开发项目的过程中,我们将修改其中的一些设置,并添加一些设置。
文件 urls.py 告诉 Django,应创建哪些网页来响应浏览器请求。
文件 wsgi.py 帮助 Django 提供它创建的文件,名称是 web server gateway interface(Web 服务器网关接口)的首字母缩写。

1.0 创建环境

1.1 创建虚拟环境

在独立的项目文件夹下运行

python -m venv ll_env

python -m ensurepip --default-pip # 重装pip

将会创造一个ll_env文件夹
可以使用下面的命令激活虚拟环境。激活虚拟环境后,安装的模组将只在虚拟环境中生效,而不干扰到电脑上Python的模组

source ll_env/bin/activate # Linux系统
source ll_env/Scripts/activate # Windows系统

(ll_env)
work_directory$ # 命令提示符前会显示(ll_env)

使用deactive取消激活虚拟环境

1.2 安装配置Django

pip install --upgrade pip # 更新pip
pip install django # 安装Django
django-admin startproject ll_project . # 初始化Django
python manage.py migrate # 生成数据库
python manage.py runserver # 生成预览,可以在本地8000端口看到网页
Django手册: https://docs.djangoproject.com/en/4.1/ref/models/fields/
阅读全文 »

NJU gdb六步走

  1. 启动gdb,加载可执行文件
  2. 设置断点 break main 入口处设置断点
  3. 启动程序 run (参数)
  4. 查看程序当然状态
    • info register (EIP): 显示所有寄存器(或只有EIP寄存器)的内容
    • 栈:保存过程执行时的数据信息
  5. 继续下一条指令
    • stepsi(机器指令)
  6. 退出 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     退出
阅读全文 »

Task Scheduler

WIN+R, taskschd.msc
在这里可以设置定时任务、登录任务。
有些软件的开机自启动就设置在这里。比起组策略有更多的可选项(延迟启动,网络和电源要求等)

Group Policy Editor

WIN+R, gpedit.msc
在这里可以设置一些开关机时执行的任务

Computer Configuration -> Windows settings -> Scripts -> Shutdown -> Properties -> Add

静默运行脚本

Task Scheduler没有办法隐藏窗口
在Task Scheduler运行该vbs脚本,目标脚本路径作为参数即可实现静默运行。

' minRun.vbs
' Run minRun.vbs Task Scheduler在可选参数提供实际脚本地址
' 检查是否提供了批处理文件路径参数
If WScript.Arguments.Count = 0 Then
WScript.Echo "Error: No batch file path provided."
WScript.Quit 1
End If

' 获取批处理文件路径参数
Dim batchFilePath
batchFilePath = WScript.Arguments(0)

' 检查批处理文件是否存在
If Not FileExists(batchFilePath) Then
WScript.Echo "Error: Batch file not found at " & batchFilePath
WScript.Quit 1
End If

' 创建 WScript.Shell 对象
Set oShell = CreateObject("Wscript.Shell")

' 执行批处理文件
' 使用 0 表示不等待批处理文件执行完成
' 使用 True 表示以同步方式运行(等待批处理执行完成)
oShell.Run batchFilePath, 0, True

' 清理
Set oShell = Nothing

' 检查文件是否存在的辅助函数
Function FileExists(filePath)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
FileExists = fso.FileExists(filePath)
End Function

1.0 编辑

% 表示注释
; 表示不显示结果,只执行语句
clear 清除内存变量
clc 清除全部
pretty 用分式表示公式
simplify 化简命令
exp(x) 指数, e^x
log2(x) 以2为底数的对数
阅读全文 »
0%