├── .github └── workflows │ └── publish.yml ├── .gitignore ├── .npmignore ├── .vscode ├── notes.code-snippets ├── settings.json └── tasks.json ├── README.md ├── docs ├── .vuepress │ ├── components │ │ ├── Foo │ │ │ └── Bar.vue │ │ ├── OtherComponent.vue │ │ └── demo-component.vue │ ├── config.js │ ├── enhanceApp.js │ ├── public │ │ ├── SourceHanSansSC-Regular.subset.cn-punct.otf │ │ ├── _home.css │ │ ├── card.css │ │ ├── custom.css │ │ ├── en.css │ │ ├── fonts-cm │ │ │ ├── cmunbi.ttf │ │ │ ├── cmunbx.ttf │ │ │ ├── cmunit.ttf │ │ │ ├── cmunrm.ttf │ │ │ ├── cmunss.ttf │ │ │ ├── cmunsx.ttf │ │ │ ├── cmuntb.ttf │ │ │ ├── cmunti.ttf │ │ │ ├── cmuntt.ttf │ │ │ └── cmuntx.ttf │ │ ├── fonts │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ ├── KaTeX_AMS-Regular.woff2 │ │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ │ ├── KaTeX_Fraktur-Bold.woff │ │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ │ ├── KaTeX_Fraktur-Regular.woff │ │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ ├── KaTeX_Main-Bold.woff2 │ │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ │ ├── KaTeX_Main-BoldItalic.woff │ │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ ├── KaTeX_Main-Italic.woff2 │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ ├── KaTeX_Main-Regular.woff2 │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ ├── KaTeX_Math-Italic.woff2 │ │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ │ ├── KaTeX_SansSerif-Bold.woff │ │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ │ ├── KaTeX_SansSerif-Italic.woff │ │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ │ ├── KaTeX_SansSerif-Regular.woff │ │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ │ ├── KaTeX_Script-Regular.ttf │ │ │ ├── KaTeX_Script-Regular.woff │ │ │ ├── KaTeX_Script-Regular.woff2 │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ ├── KaTeX_Size1-Regular.woff2 │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ ├── KaTeX_Size2-Regular.woff2 │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ ├── KaTeX_Size3-Regular.woff2 │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ ├── KaTeX_Size4-Regular.woff │ │ │ ├── KaTeX_Size4-Regular.woff2 │ │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ │ ├── KaTeX_Typewriter-Regular.woff │ │ │ └── KaTeX_Typewriter-Regular.woff2 │ │ ├── imgs │ │ │ ├── bilibili-logo.png │ │ │ ├── joshua-tree.jpg │ │ │ ├── outbound-smaller.svg │ │ │ ├── outbound.svg │ │ │ ├── steam-logo.png │ │ │ └── youtube-logo.png │ │ ├── jp.css │ │ ├── katex.min.css │ │ └── var.css │ └── styles │ │ ├── index.styl │ │ └── palette.styl ├── index.md ├── langs │ ├── README.md │ ├── en │ │ ├── be-vs-ae.md │ │ ├── friends │ │ │ ├── s01e01.md │ │ │ ├── s01e02.md │ │ │ └── s01e03.md │ │ ├── imgs │ │ │ ├── all-set.png │ │ │ ├── all-set2.png │ │ │ ├── good-to-go.png │ │ │ └── oyster-card.png │ │ ├── learned-in-uk.md │ │ ├── misuses.md │ │ ├── others.md │ │ └── think-of-about.md │ └── jp │ │ ├── beginner-unit-1-3.md │ │ ├── beginner-unit-4-6.md │ │ ├── beginner-unit-7-9.md │ │ ├── duolinguo.md │ │ ├── grammar.md │ │ └── imgs │ │ ├── french-verb-inflection.png │ │ ├── hiragana.png │ │ ├── huoyong-origin.jpg │ │ ├── huoyong.jpg │ │ └── katakana.png ├── math │ ├── README.md │ ├── info-theory.md │ ├── linear-algebra.md │ ├── linear-algebra │ │ ├── lt1.mp4 │ │ ├── lt2-to3d.mp4 │ │ ├── lt3-to1d.mp4 │ │ └── lt4-rank.mp4 │ ├── math-sea.md │ ├── probability.md │ └── stats.md ├── ml │ ├── README.md │ ├── grad-descent-algos.md │ ├── graphical-model.md │ ├── imgs │ │ └── interpretability │ │ │ ├── attribution.png │ │ │ ├── dim1.png │ │ │ ├── dim2-origin.png │ │ │ ├── dim2.png │ │ │ ├── disambiguation.gif │ │ │ ├── disambiguation1.png │ │ │ ├── disambiguation2.png │ │ │ ├── paper-space.png │ │ │ ├── papers.png │ │ │ ├── terms.png │ │ │ └── viz.png │ ├── learning-theory.md │ ├── materials │ │ └── 20210202-interpretability-slides-yzhang.pdf │ ├── new │ │ ├── ai-art.md │ │ └── nerf.md │ ├── nn-interpretability.md │ ├── pca.md │ ├── pytorch.md │ ├── reinforcement-learning.md │ ├── rule-learning.md │ └── svm.md ├── music │ ├── music.md │ └── piano.md ├── others │ ├── 2015-summary.md │ ├── 2018-uk.md │ ├── 3d-vision.md │ ├── README.md │ ├── causal-reasoning.md │ ├── characters.md │ ├── combinatorial-optimization.md │ ├── cryptography.md │ ├── driving.md │ ├── dynamic-programming.md │ ├── floating-point-number.md │ ├── genetics.md │ ├── glasses.md │ ├── health-tips.md │ ├── imgs │ │ ├── 2015 │ │ │ ├── 20150312-230444.jpg │ │ │ ├── 20150526-234304.png │ │ │ ├── 20150527-172004.png │ │ │ ├── 20150614-194300.jpg │ │ │ ├── 20150629-001837.png │ │ │ ├── 20150901-165912.png │ │ │ ├── 20151123-090055.png │ │ │ ├── 20151128-235627.png │ │ │ ├── 20151222-095516.png │ │ │ ├── 20160104-161801.png │ │ │ ├── 20160121-181647.jpg │ │ │ ├── changelog-backup.png │ │ │ └── changelog.png │ │ ├── 2018 │ │ │ ├── 20180830-111949.jpg │ │ │ ├── 20180901-132743.jpg │ │ │ ├── 20180906-122650.jpg │ │ │ ├── 20180910-123816.jpg │ │ │ ├── 20180925-114313.jpg │ │ │ ├── 20181020-114728.jpg │ │ │ ├── 20181020-115923.jpg │ │ │ ├── 20181020-150126.jpg │ │ │ ├── 20181021-101119.jpg │ │ │ ├── 20181021-133042.jpg │ │ │ ├── 20181023-181317.jpg │ │ │ ├── 20181124-121314.jpg │ │ │ ├── 20181124-151018.jpg │ │ │ ├── 20181125-103302.jpg │ │ │ ├── 20181125-104532.jpg │ │ │ ├── 20181125-124045.jpg │ │ │ ├── 20181125-132247.jpg │ │ │ ├── 20181204-130306.jpg │ │ │ ├── 20181204-133632.jpg │ │ │ ├── 20181219-175502.jpg │ │ │ ├── 20181220-170001.jpg │ │ │ ├── 20181221-122116.jpg │ │ │ ├── 20181222-162931.jpg │ │ │ ├── 20181224-202756.jpg │ │ │ ├── 20181226-160802.jpg │ │ │ ├── 20181227-115309.jpg │ │ │ ├── 20181227-150852.jpg │ │ │ ├── 20181227-155828.jpg │ │ │ ├── 20181228-143239.jpg │ │ │ ├── 20181229-145516.jpg │ │ │ ├── 20181229-150540.jpg │ │ │ ├── 20181229-151231.jpg │ │ │ ├── 20181231-235949.webm │ │ │ ├── 20190101-144141.jpg │ │ │ ├── 20190102-125535.jpg │ │ │ ├── 20190123-180838.jpg │ │ │ ├── 20190518-190812.jpg │ │ │ ├── 20190524-214049.jpg │ │ │ ├── 20190524-220412.jpg │ │ │ ├── 20190525-093747.jpg │ │ │ ├── 20190525-094000.jpg │ │ │ ├── 20190525-100000.jpg │ │ │ ├── 20190525-100955.jpg │ │ │ ├── 20190525-173032.jpg │ │ │ ├── 20190525-230040.webm │ │ │ ├── 20190526-115403.jpg │ │ │ ├── 20190526-115608.jpg │ │ │ ├── 20190526-155438.jpg │ │ │ ├── 20190526-162316.jpg │ │ │ ├── 20190712-175121.jpg │ │ │ ├── 20190726-130100.jpg │ │ │ ├── 20190801-133824.jpg │ │ │ ├── 20190817-125015.jpg │ │ │ ├── 20190820-182111.jpg │ │ │ └── 20190830-081810.jpg │ │ ├── alpha-beta-example.png │ │ ├── alpha-beta-general-case.png │ │ ├── covid.jpg │ │ ├── doctor-strange.jpg │ │ ├── game-tree.webp │ │ ├── glasses │ │ │ ├── ears-position.jpg │ │ │ └── ears2.jpg │ │ ├── good-guy.webp │ │ ├── interesting │ │ │ ├── celeste.webp │ │ │ ├── dev-doodles-sylas.webp │ │ │ ├── dontstarve.webp │ │ │ ├── genshin-ost-bts.jpg │ │ │ ├── kda-dance-bts.jpg │ │ │ ├── kda-music-video.jpg │ │ │ ├── lol-a-new-dawn-bts.jpg │ │ │ ├── lol-a-new-dawn.jpg │ │ │ ├── lol-divine-sword-irelia.jpg │ │ │ ├── lol-immortal-journey-talon.jpg │ │ │ ├── mc-canon.jpg │ │ │ ├── mc-redstone-computer.jpg │ │ │ ├── mc-the-peach-blossom-spring.jpg │ │ │ ├── nier-automata-ost-origin.jpg │ │ │ ├── nier-automata-ost.jpg │ │ │ ├── ori-blind-forest.jpg │ │ │ ├── photography-challenge.jpg │ │ │ ├── pipa-liudehai.jpg │ │ │ ├── professional.jpg │ │ │ ├── project-vayne.gif │ │ │ ├── singer.jpg │ │ │ ├── typography.jpg │ │ │ ├── vision-flow.png │ │ │ └── wswx.webp │ │ ├── misc │ │ │ ├── 2020-11-30.png │ │ │ ├── 2020-12-06.png │ │ │ ├── 2021-01-19-2333.png │ │ │ ├── 2021-03-10-0K.png │ │ │ └── 2021-05-26-vscode-pets.gif │ │ ├── p-np-npc.svg │ │ ├── prism-rainbow.svg │ │ ├── review │ │ │ ├── find+.png │ │ │ └── nips.png │ │ ├── whatif.png │ │ └── xkcd-tsp.png │ ├── interesting-stuff.md │ ├── literature-review-the-hard-way.md │ ├── map.md │ ├── minimax.md │ ├── misc.md │ ├── p-np.md │ ├── tmp.md │ └── workout.md ├── programming │ ├── README.md │ ├── imgs │ │ ├── nicematrix-basic.png │ │ ├── nicematrix-border.png │ │ ├── nicematrix-colorcell.png │ │ ├── nicematrix-colwidth.png │ │ └── nicematrix-tabularnote.png │ ├── latex-nicematrix.md │ ├── latex.md │ └── python │ │ ├── cuda-oom.md │ │ ├── cuda.md │ │ ├── imgs │ │ ├── cuda-certificate.png │ │ ├── grid-of-thread-blocks.png │ │ └── mpl │ │ │ ├── fig-vs-axes.png │ │ │ └── sharedxylabel.png │ │ ├── jupyter-notebooks.zip │ │ ├── logging.md │ │ ├── matplotlib.md │ │ ├── miniconda.md │ │ ├── mpi4py.md │ │ ├── mpl-scientific-style.ipynb │ │ ├── mpl-scientific-style.md │ │ ├── multi-and-sub-process.md │ │ ├── multi-thread.md │ │ ├── python.md │ │ └── user-snippets.md ├── reading │ ├── 200-years-of-surgery.md │ ├── README.md │ ├── find-your-other-half.md │ ├── love.md │ ├── papers │ │ ├── 2011-kinectfusion1.md │ │ ├── 2015-dynamicfusion.md │ │ ├── 20231121-sugar.md │ │ ├── 20231122-compact-3dgs.md │ │ ├── 20231122-depth-reg-3dgs-few-shot.md │ │ ├── 20231130-sparsegs.md │ │ ├── 20231201-fsgs.md │ │ ├── 20231206-hifi4g.md │ │ └── README.md │ ├── reward-and-half-life.md │ ├── uncocoro.md │ └── what-you-want.md └── software │ ├── README.md │ ├── docker.md │ ├── ffmpeg.md │ ├── imgs │ └── vimcheatsheet.gif │ ├── powershell.md │ ├── shell.md │ ├── ubuntu.md │ ├── vim.md │ └── windows │ ├── autohotkey.md │ ├── context-menu.md │ ├── general.md │ └── imgs │ └── fill-form.gif ├── package-lock.json ├── package.json ├── syntaxes ├── plaintextc.tmLanguage.json ├── shelldoc.tmLanguage.json └── shellsession.tmLanguage.json └── tools ├── post-process.js └── pre-process.js /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: "Publish" 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | publish: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: "Setup Node.js environment" 14 | uses: actions/setup-node@v3 15 | with: 16 | node-version: 18 17 | 18 | - name: "Checkout branch: ${{ github.ref }}" 19 | uses: actions/checkout@v2 20 | with: 21 | path: master 22 | fetch-depth: 0 # Fetch all history to get correct 'Last updated' information 23 | 24 | - name: "Checkout branch: gh-pages" 25 | uses: actions/checkout@v2 26 | with: 27 | ref: gh-pages 28 | path: gh-pages 29 | fetch-depth: 0 30 | 31 | - name: "Clean install dependencies and build" 32 | working-directory: master 33 | ## /home/runner/work/notes/notes/master 34 | run: | 35 | export NODE_OPTIONS=--openssl-legacy-provider 36 | npm ci 37 | npm run build 38 | # node tools/post-process.js 39 | 40 | - name: "Copy dist files" 41 | ## Need to specifiy a working-directory, otherwise it cannot find the path 42 | working-directory: gh-pages 43 | ## /home/runner/work/notes/notes/gh-pages 44 | run: | 45 | git rm -r * 46 | mv ../master/docs/.vuepress/dist/* . 47 | 48 | - name: "Deploy" 49 | working-directory: gh-pages 50 | run: | 51 | git config --global user.name "github-actions[bot]" 52 | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" 53 | 54 | git reset HEAD~ 55 | git add -A 56 | git commit -m "publish '${{ github.event.head_commit.message }}'" 57 | git push -f 58 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | docs/.vuepress/dist -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | pids 2 | logs 3 | node_modules 4 | npm-debug.log 5 | coverage/ 6 | run 7 | dist 8 | .DS_Store 9 | .nyc_output 10 | .basement 11 | config.local.js 12 | basement_dist 13 | -------------------------------------------------------------------------------- /.vscode/notes.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "accent bold": { 3 | "prefix": "accent", 4 | "body": "accent**$1**$0" 5 | }, 6 | "img with caption": { 7 | "prefix": "imgwithcaption", 8 | "body": [ 9 | "
", 10 | " \"\"", 11 | "
$2
", 12 | "
" 13 | ] 14 | }, 15 | "img": { 16 | "prefix": "imgindiv", 17 | "body": [ 18 | "
", 19 | " \"\"", 20 | "
" 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.snippetSuggestions": "top", 3 | "markdown.extension.completion.root": "docs" 4 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "dev", 8 | "type": "shell", 9 | "command": "npm run dev", 10 | "group": { 11 | "kind": "build", 12 | "isDefault": true 13 | } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ADEPT Principle 2 | 3 | Make explanations ADEPT: Use an Analogy, Diagram, Example, Plain-English description, and then a Technical description. 4 | 5 | 6 | 7 | ## 排版 8 | 9 | - 括号,中英文混排:如果括号里全是英文,则用半角括号 (Parenthesis),此外则使用(全角括号) 10 | 11 | - [x] 中文标点(破折号,省略号)样式修正[^cn-punct1] 12 | 13 | ```html 14 | ——…… 15 | ``` 16 | 17 | - [x] 相邻全角标点挤压[^cn-punct2] 18 | 19 | ```html 20 | 「 21 | ``` 22 | 23 | - [2024-08-24 更新] Chrome 120 (2023-12-04) 已经通过 [`text-spacing-trim`](https://developer.mozilla.org/en-US/docs/Web/CSS/text-spacing-trim) 属性默认支持标点挤压(要求该 OpenType 字体支持 `halt` 或 `chws` 特性)[^cn-punct3] 24 | - 同时计划未来引入 `text-autospace` 属性在中文和英文之间自动增加间距,就不用手动加空格了 25 | - [OpenType font features guide](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_fonts/OpenType_fonts_guide) 26 | - Discovering availability of features in fonts ([Wakamai Fondue](https://wakamaifondue.com/beta/)) 27 | 28 | - 考虑到 Markdown 语法的局限性,支持使用 [`markdown-it-attrs`](https://github.com/arve0/markdown-it-attrs) 来附加样式,比如居中 GFM 表格 29 | 30 | ``` 31 | | header1 | header2 | 32 | | ------- | ------- | 33 | | column1 | column2 | 34 | 35 | {{.center}} 36 | ``` 37 | 38 | ## Asset Handling 39 | 40 | ### 图片 41 | 42 | 使用相对路径 `./relative/path` 43 | 44 | ### 可选样式表 (CSS) 45 | 46 | 把 CSS 文件放到 `.vuepress/public` 目录下,该目录下的文件会被复制到网站的根目录,使用时路径为 `{base}/foo.css` (此处相当于 `/notes/foo.css`) 47 | 48 | 比如 KaTeX 数学环境样式 49 | 50 | ```html 51 | 52 | ``` 53 | 54 | ## Misc. 55 | 56 | 在新标签页打开链接,以及外链图标 57 | 58 | ```html 59 | 60 | ``` 61 | 62 | --- 63 | 64 | Some styles are based on [Dev on Windows with WSL](https://dowww.spencerwoo.com/). 65 | 66 | [^cn-punct1]: https://www.thetype.com/2019/03/14918/ 67 | [^cn-punct2]: https://www.bilibili.com/video/BV1Lr4y127qp/ 68 | [^cn-punct3]: https://developer.chrome.com/blog/css-i18n-features#cjk_punctuation_kerning_text-spacing-trim -------------------------------------------------------------------------------- /docs/.vuepress/components/Foo/Bar.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /docs/.vuepress/components/OtherComponent.vue: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /docs/.vuepress/components/demo-component.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 16 | -------------------------------------------------------------------------------- /docs/.vuepress/enhanceApp.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Client app enhancement file. 3 | * 4 | * https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements 5 | */ 6 | 7 | export default ({ 8 | Vue, // the version of Vue being used in the VuePress app 9 | options, // the options for the root Vue instance 10 | router, // the router instance for the app 11 | siteData // site metadata 12 | }) => { 13 | // ...apply enhancements for the site. 14 | } 15 | -------------------------------------------------------------------------------- /docs/.vuepress/public/SourceHanSansSC-Regular.subset.cn-punct.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/SourceHanSansSC-Regular.subset.cn-punct.otf -------------------------------------------------------------------------------- /docs/.vuepress/public/_home.css: -------------------------------------------------------------------------------- 1 | main.home { 2 | max-width: 800px; 3 | } 4 | 5 | main.home strong { 6 | color: #888; 7 | font-weight: bold; 8 | } 9 | 10 | #joshua-tree { 11 | float: right; 12 | width: 200px; 13 | margin: 0.8em 0.2em 0.4em 1em; 14 | } 15 | 16 | @media (max-width: 719px) { 17 | #joshua-tree { 18 | float: none; 19 | width: 100%; 20 | margin: 0.5em 0 0; 21 | } 22 | } 23 | 24 | hr { 25 | height: 1px; 26 | width: 100%; 27 | background: linear-gradient(to right, #dadcdf, transparent 60%); 28 | margin: 1em 0; 29 | border: none; 30 | } 31 | 32 | /* SLOT MACHINE */ 33 | 34 | #outer { 35 | display: flex; 36 | align-items: flex-start; 37 | justify-content: center; 38 | } 39 | 40 | #outer>div:not(#slot-machine) { 41 | line-height: 2; 42 | margin-top: 32px; 43 | } 44 | 45 | #slot-machine { 46 | position: relative; 47 | height: 96px; 48 | overflow: hidden; 49 | text-align: center; 50 | user-select: none; 51 | padding: 0 1em; 52 | margin-left: 0.6em; 53 | margin-right: 0.6em; 54 | } 55 | 56 | #slot-machine::before { 57 | position: absolute; 58 | top: 32px; 59 | left: 0; 60 | height: 32px; 61 | width: 100%; 62 | content: ""; 63 | border: 1px solid #dfe1e5; 64 | border-radius: 9px; 65 | box-sizing: border-box; 66 | } 67 | 68 | #slot-machine::after { 69 | position: absolute; 70 | top: 0; 71 | left: 0; 72 | height: 100%; 73 | width: 100%; 74 | content: ""; 75 | /* background: linear-gradient(to bottom, white, transparent, white); */ 76 | /* For Safari compatibility */ 77 | background: linear-gradient(to bottom, white, rgba(255, 255, 255, 0), white); 78 | } 79 | 80 | /* @media (prefers-color-scheme: dark) { 81 | #slot-machine::after { 82 | background: linear-gradient(to bottom, #333333, transparent, #333333); 83 | } 84 | 85 | body { 86 | background: #333333; 87 | } 88 | } */ 89 | 90 | :root { 91 | color-scheme: light; 92 | } 93 | 94 | #tiles { 95 | position: relative; 96 | } 97 | 98 | #btn-group { 99 | margin: 0 auto; 100 | width: -moz-fit-content; 101 | width: fit-content; 102 | } 103 | 104 | #btn-feelingLucky { 105 | background-color: #f8f9fa; 106 | border: 1px solid #f8f9fa; 107 | border-radius: 4px; 108 | margin: 11px 4px; 109 | margin-right: 0; 110 | padding: 0 16px; 111 | line-height: 2; 112 | font-size: 14px; 113 | transition: border-color 0.5s ease-in; 114 | transition: box-shadow 0.5s ease-in; 115 | } 116 | 117 | #btn-feelingLucky:hover { 118 | box-shadow: 0 1px 1px rgb(0 0 0 / 10%); 119 | border: 1px solid #dadce0; 120 | } 121 | 122 | #btn-feelingLucky:focus { 123 | border: 1px solid #529cda; 124 | outline: none; 125 | } 126 | 127 | #target { 128 | transition: opacity 0.5s ease-in; 129 | opacity: 0; 130 | text-align: center; 131 | font-size: 14px; 132 | color: #a8a9aa; 133 | user-select: none; 134 | margin: 0 auto 1em; 135 | } 136 | 137 | #target>a { 138 | color: #81B0D8; 139 | } -------------------------------------------------------------------------------- /docs/.vuepress/public/card.css: -------------------------------------------------------------------------------- 1 | a.card { 2 | display: flex; 3 | flex-direction: row; 4 | padding: 1.5rem; 5 | margin-top: 1.5rem; 6 | background: #f7f9fa; 7 | border-radius: 0.5rem; 8 | transition-duration: 0.2s; 9 | position: relative; /* so that the logos can be placed absolutely */ 10 | } 11 | 12 | a.card:last-of-type { 13 | margin-bottom: 1.5rem; 14 | } 15 | 16 | a.card:hover { 17 | box-shadow: 0 4px 6px -1px rgb(0 0 0 / 10%), 1px 1px 4px -1px rgb(0 0 0 / 6%); 18 | z-index: 2; 19 | } 20 | 21 | a.card.has-bts { 22 | border-bottom: 1px dashed #dadcdd; 23 | border-bottom-left-radius: 0; 24 | border-bottom-right-radius: 0; 25 | } 26 | 27 | a.card.has-bts + a.card { 28 | border-top: 1px dashed #dadcdd; 29 | margin-top: 0; 30 | border-top-left-radius: 0; 31 | border-top-right-radius: 0; 32 | } 33 | 34 | a.card > div.cover { 35 | max-width: 300px; 36 | margin-right: 1.5rem; 37 | pointer-events: none; 38 | } 39 | 40 | a.card > div { 41 | display: flex; 42 | flex-direction: column; 43 | justify-content: center; 44 | } 45 | 46 | a.card p { 47 | margin: 0; 48 | line-height: 1.5; 49 | margin-bottom: 0.5rem; 50 | color: #747a81; 51 | z-index: 1; 52 | } 53 | 54 | a.card p.title { 55 | margin-top: 0; 56 | font-size: 1.25rem; 57 | font-weight: 600; 58 | color: #242a31; 59 | } 60 | 61 | a.card p a { 62 | color: #529cda; 63 | } 64 | 65 | a.card img.logo { 66 | margin: 0 1.5rem 1.5rem 0; 67 | max-height: 16px; 68 | width: auto; 69 | position: absolute; 70 | bottom: 0; 71 | right: 0; 72 | z-index: 0; 73 | } 74 | 75 | a.card img.logo[src$="bilibili-logo.png"] { 76 | max-height: 20px; 77 | } 78 | 79 | a.card img.logo[src$="steam-logo.png"] { 80 | max-height: 22px; 81 | } 82 | 83 | /* Reset links styles */ 84 | 85 | .theme-default-content:not(.custom) a.card, 86 | .theme-default-content:not(.custom) a.card:hover { 87 | text-decoration: inherit; 88 | color: inherit; 89 | font-weight: inherit; 90 | } 91 | 92 | /* Mobile devices */ 93 | 94 | @media (max-width: 500px) { 95 | a.card { 96 | flex-direction: column; 97 | } 98 | 99 | a.card > div.cover { 100 | max-width: 400px; 101 | margin-right: 0rem; 102 | margin-bottom: 1.5rem; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /docs/.vuepress/public/custom.css: -------------------------------------------------------------------------------- 1 | /* Override */ 2 | 3 | body { 4 | font-family: 'Source Sans Pro', Lato, "Helvetica Neue", "Microsoft Yahei", sans-serif, "Segoe UI Emoji"; 5 | } 6 | 7 | .sidebar { 8 | background: #f7f8f9; 9 | } 10 | 11 | .sidebar ul li { 12 | font-size: 14px; 13 | } 14 | 15 | .sidebar-toggle { 16 | background: transparent; 17 | } 18 | 19 | .markdown-section { 20 | max-width: 800px; 21 | } 22 | 23 | .markdown-section a { 24 | font-weight: normal; 25 | } 26 | 27 | .markdown-section h1 a, 28 | .markdown-section h2 a, 29 | .markdown-section h3 a, 30 | .markdown-section h4 a { 31 | font-weight: 600; 32 | } 33 | 34 | .markdown-section h2 code { 35 | font-size: 1.5rem; 36 | } 37 | 38 | code, 39 | .markdown-section code, 40 | .markdown-section pre, 41 | .markdown-section pre > code { 42 | font-family: Consolas, monospace, "Microsoft Yahei"; 43 | } 44 | 45 | kbd { 46 | box-shadow: inset 0 -1px 0 rgba(186, 186, 186, 0.7); 47 | margin-bottom: 2px; 48 | } 49 | 50 | /* --- */ 51 | 52 | img { 53 | border: 1px solid lightgrey; 54 | } 55 | 56 | @media (min-width: 800px) { 57 | img { 58 | max-width: 80%; 59 | } 60 | } 61 | 62 | figure { 63 | text-align: center; 64 | } 65 | 66 | figcaption { 67 | text-align: center; 68 | color: gray; 69 | margin-top: 0.6em; 70 | } 71 | 72 | p + ul { 73 | margin-top: -0.2em; 74 | } 75 | 76 | .markdown-section strong { 77 | font-weight: bold; 78 | } 79 | 80 | strong.accent { 81 | color: var(--color-green); 82 | } 83 | 84 | .green { 85 | color: var(--color-green); 86 | } 87 | 88 | abbr { 89 | cursor: help; 90 | } 91 | 92 | details summary { 93 | cursor: pointer; 94 | } 95 | 96 | summary:focus { 97 | outline: none; 98 | } 99 | 100 | .docsify-copy-code-button { 101 | font-family: Consolas, monospace, "Microsoft Yahei"; 102 | padding: 0.4em 0.8em 0.48em !important; 103 | } 104 | 105 | /* Heading styles */ 106 | /* (main: 800px) + (padding: 15px * 2) + (sidebar: 300px) */ 107 | @media (min-width: 1130px) { 108 | h2::before, 109 | h3::before, 110 | h4::before { 111 | font-size: 0.8em; 112 | color: #b7c1cc; 113 | position: absolute; 114 | left: 0; 115 | text-align: right; 116 | } 117 | 118 | h2::before { 119 | content: "#"; 120 | transform: translateX(calc(-100% + 0.5rem)) translateY(5px); 121 | } 122 | h3::before { 123 | content: "##"; 124 | transform: translateX(calc(-100% + 0.5rem)) translateY(4px); 125 | } 126 | h4::before { 127 | content: "###"; 128 | transform: translateX(calc(-100% + 0.5rem)) translateY(3px); 129 | } 130 | } 131 | 132 | /* 133 | * flasky.css_t 134 | * ~~~~~~~~~~~~ 135 | * 136 | * :copyright: Copyright 2010 by Armin Ronacher. 137 | * :license: Flask Design License, see LICENSE for details. 138 | */ 139 | 140 | /* scrollbars */ 141 | 142 | ::-webkit-scrollbar { 143 | width: 6px; 144 | height: 6px; 145 | } 146 | 147 | ::-webkit-scrollbar-button:start:decrement, 148 | ::-webkit-scrollbar-button:end:increment { 149 | display: block; 150 | height: 10px; 151 | } 152 | 153 | ::-webkit-scrollbar-button:vertical:increment { 154 | background-color: #fff; 155 | } 156 | 157 | ::-webkit-scrollbar-track-piece { 158 | background-color: #eee; 159 | border-radius: 3px; 160 | -webkit-border-radius: 3px; 161 | } 162 | 163 | ::-webkit-scrollbar-thumb:vertical { 164 | height: 50px; 165 | background-color: #ccc; 166 | border-radius: 3px; 167 | -webkit-border-radius: 3px; 168 | } 169 | 170 | ::-webkit-scrollbar-thumb:horizontal { 171 | width: 50px; 172 | background-color: #ccc; 173 | border-radius: 3px; 174 | -webkit-border-radius: 3px; 175 | } 176 | -------------------------------------------------------------------------------- /docs/.vuepress/public/en.css: -------------------------------------------------------------------------------- 1 | li em { 2 | opacity: 0.5; 3 | } -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunbi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunbi.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunbx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunbx.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunit.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunit.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunrm.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunrm.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunss.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunss.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunsx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunsx.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmuntb.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmuntb.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmunti.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmunti.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmuntt.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmuntt.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts-cm/cmuntx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts-cm/cmuntx.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/bilibili-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/imgs/bilibili-logo.png -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/joshua-tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/imgs/joshua-tree.jpg -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/outbound-smaller.svg: -------------------------------------------------------------------------------- 1 | 2 | 23 | 25 | 26 | 28 | image/svg+xml 29 | 31 | 32 | 33 | 34 | 35 | 37 | 57 | 62 | 67 | 68 | -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/outbound.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/steam-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/imgs/steam-logo.png -------------------------------------------------------------------------------- /docs/.vuepress/public/imgs/youtube-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/.vuepress/public/imgs/youtube-logo.png -------------------------------------------------------------------------------- /docs/.vuepress/public/jp.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap'); 2 | 3 | .jp, 4 | .jp code { 5 | font-family: 'Noto Sans JP', sans-serif !important; 6 | } 7 | -------------------------------------------------------------------------------- /docs/.vuepress/public/var.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --color-green: #269961; 3 | } -------------------------------------------------------------------------------- /docs/.vuepress/styles/palette.styl: -------------------------------------------------------------------------------- 1 | // Adapted from https://github.com/spencerwooo/dowww 2 | 3 | $accentColor = #297abd 4 | $accentColor075 = #529cda // lighten($accentColor, 25%) 5 | $badgeTipColor = #297abd 6 | // $primaryFont = 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Microsoft Yahei', sans-serif 7 | // $secondaryFont = Lato, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Microsoft Yahei', sans-serif 8 | $primaryFont = 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Source Han Sans SC VF', 'Source Han Sans CN', 'Microsoft Yahei', Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji' 9 | $secondaryFont = -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans CJK SC', 'Source Han Sans SC', 'Source Han Sans SC VF', 'Source Han Sans CN', 'Microsoft Yahei', Helvetica, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji' 10 | 11 | @font-face { 12 | font-family: "CN Punctuation"; 13 | src: url("/notes/SourceHanSansSC-Regular.subset.cn-punct.otf") format("opentype") 14 | } 15 | 16 | $cnFont = 'CN Punctuation', -apple-system, BlinkMacSystemFont, 'Noto Sans CJK SC', 'Source Han Sans SC', 'Source Han Sans CN', 'Microsoft Yahei', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji' 17 | -------------------------------------------------------------------------------- /docs/langs/README.md: -------------------------------------------------------------------------------- 1 | # Language Study -------------------------------------------------------------------------------- /docs/langs/en/be-vs-ae.md: -------------------------------------------------------------------------------- 1 | # 英式和美式 2 | 3 | | 单词/词组 | BE | AE | 4 | | --------- | ------------------ | ------------------ | 5 | | 单程/往返 | single/return trip | one-way/round trip | 6 | | 地铁 | underground/tube | subway | 7 | | 地下通道 | subway | underpass | 8 | | 秋天 | autumn | fall | 9 | 10 | | 发音 | BE | AE | 11 | | ------------------------------------ | ----------- | ----------- | 12 | | tomato | /təˈmɑːtəʊ/ | /təˈmeɪdoʊ/ | 13 | | Z | zed /zɛd/ | zee /ziː/ | 14 | | rock | /rɒk/ | /rɑːk/ | 15 | 16 | > In most English-speaking countries, including the **United Kingdom**, Canada, India, Ireland, New Zealand, Zambia and Australia, the letter's name is **zed /zɛd/**, ... but in **American English** its name is **zee /ziː/** 17 | > 18 | > — [Z - Wikipedia](https://en.wikipedia.org/wiki/Z) 19 | 20 | 21 | -------------------------------------------------------------------------------- /docs/langs/en/friends/s01e01.md: -------------------------------------------------------------------------------- 1 | # *Friends* S01 E01 2 | 3 | 4 | 5 | ::: tip Convention 6 | **整句加粗**表示 常见词、短语 的非常见用法 7 | 很多单词或短语还有其它用法,这里就不全部列举了 8 | 用 (UPPERCASE) 简短地概括该单词 / 短语的含义(见 [Cambridge Dictionary](https://dictionary.cambridge.org/) 词条的格式) 9 | ::: 10 | 11 | ## Words 12 | 13 | ==chalk== - 粉笔 14 | ==sob== - 啜泣 15 | ==gorgeous== - very beautiful or pleasant 16 | ==metaphor== - 隐喻,暗喻 17 | ==rip== - 撕破;猛地扯开 18 | ==spit== - 吐;啐唾沫(常表示愤怒或鄙视);怒斥 19 | ==smash== - 打碎;打烂 20 | ==bond== - 联结(羁绊😏);债券(化学)键 21 | ==hanger== - 衣架 22 | ==beacon== - 灯塔(昔日)烽火 23 | ==upbeat== - 欢快的,full of hope, happiness, and good feelings 24 | ==parachute== /ˈpær.ə.**ʃuː**t/ - 降落伞 25 | ==couch== - 沙发,a sofa 26 | 27 | --- 28 | 29 | ==figure== 30 | 31 | - `v.` MAINLY US. to expect or think that something will happen 32 | [+(that)] *We figured (**that**) you'd want to rest after your trip.* 33 | 34 | --- 35 | 36 | ==fixate== 37 | 38 | - `v.` to think about something too much and find it difficult to stop 39 | *High achievers sometimes fixate **on** their own flaws.* 40 | 41 | --- 42 | 43 | ==take== 44 | 45 | - `v.` (ACCEPT) **to accept or have** 46 | *Do they take credit cards here?* 47 | *He continually abuses her, and she just sits there and takes it.* 48 | 49 | --- 50 | 51 | ==freak== 52 | 53 | - `n.` (STRANGE) a thing, person, animal, or event that is extremely unusual or unlikely, and not like any other of its type 54 | - `v.` to become or cause someone to become extremely emotional 55 | freak (*sb*) out 56 | 57 | --- 58 | 59 | ==hit== 60 | 61 | - `v.` (EFFECT) **if an idea or thought hits you, you suddenly think of it** 62 | *That's when it hit me that my life would never be the same again.* 63 | 64 | --- 65 | 66 | ==change== 67 | 68 | - `v.` **to remove one set of clothes and put a different set on yourself** or a young child, especially a baby, or to remove dirty sheets from a bed and put clean ones on it 69 | *You don't need to change - you look great as you are.* 70 | 71 | --- 72 | 73 | ==head== 74 | 75 | - `v.` to go in a particular direction 76 | *I was heading **out of** the room when she called me back.* 77 | *We were heading **towards** Kumasi when our truck broke down.* 78 | *He headed straight **for** (= went towards) the fridge.* 79 | 80 | --- 81 | 82 | ## Phrases 83 | 84 | ==go out== 85 | 86 | - to leave a room or building, especially in order to do something for entertainment 87 | - **to have a romantic and usually sexual relationship with someone** 88 | - ... 89 | 90 | --- 91 | 92 |
93 | 94 | ==go through *sth*== 95 | 96 | - (EXPERIENCE) to experience a difficult or unpleasant situation 97 | - see [S01E03](s01e03.html#go-through-2) 98 | - ... 99 | 100 |
101 | 102 | --- 103 | 104 | ==feel like (doing) *sth*== 105 | 106 | - to have a wish for something, or to want to do something, at a particular moment 107 | *I feel like (hav**ing**) a nice cool glass of lemonade.* 108 | to want to do something that you do not do 109 | *He was so rude I felt like slapp**ing** his face.* 110 | 111 | --- 112 | 113 |
114 | 115 | ==steer clear of *sb/sth*== 116 | 117 | - to avoid someone or something that seems unpleasant, dangerous, or likely to cause problems 118 | *They warned their children to steer clear of drugs.* 119 | 120 |
121 | 122 | --- 123 | 124 | ==stay out of *sth*== 125 | 126 | - to not become involved in an argument or discussion 127 | *It's better to stay out of their arguments.* 128 | 129 | --- 130 | 131 | ==spell *sth* out== 132 | 133 | - to explain something in a very clear way with details 134 | *The government has so far refused to spell out its plans/policies.* 135 | -------------------------------------------------------------------------------- /docs/langs/en/friends/s01e02.md: -------------------------------------------------------------------------------- 1 | # *Friends* S01 E02 2 | 3 | 4 | 5 | ## Words 6 | 7 | ==carpet== - 地毯 8 | ==chaotic== - in a state of chaos 9 | ==thigh== /θaɪ/ - 大腿 10 | ==veil== - 面纱,面罩 11 | ==presumably== /prɪˈzjuː.mə.bli/ - 大概;想必是 12 | ==anecdote== - 趣闻;逸事 13 | ==spit== ... 14 | ==tilt== - `n.`/`v.` 倾斜 15 | ==hairline== - 发际线 16 | 17 | --- 18 | 19 | ==dread== 20 | 21 | - `v.` to feel extremely worried or frightened about something that is going to happen or that might happen 22 | *He's dreading the exam - he's sure he's going to fail.* 23 | _[+ -ing verb] I'm dreading hav**ing** to meet his parents._ 24 | 25 | --- 26 | 27 | ==stomp== 28 | 29 | - `v.` to walk with intentionally heavy steps, especially as a way of showing that you are annoyed 30 | *She stomped up the stairs and slammed her bedroom door.* 31 | 32 | --- 33 | 34 | ==terrific== 35 | 36 | - `adj.` very good 37 | *You look terrific!* 38 | very great 39 | *The police car drove past at a terrific speed.* 40 | 41 | --- 42 | 43 | ==way== 44 | 45 | - `n.` INFORMAL. (WANT) If someone gets or has their way, what they want happens 46 | *If she doesn't get/have her (own) way, she sulks like a four-year-old.* 47 | 48 | --- 49 | 50 | ==well== 51 | 52 | - `v.` (of liquid) to appear on the surface of something or come slowly out from somewhere 53 | *Dirty water welled **(up) out of** the damaged pipe.* 54 | *As she read the letter tears welled **up** in her eyes.* 55 | 56 | ## Phrases 57 | 58 | ==sit through *sth*== 59 | 60 | - to stay until the end of an event such as a meeting or performance that is very long or boring 61 | *We had to sit through two hours of speeches.* 62 | 63 | --- 64 | 65 | ==as far as *sb* is concerned== 66 | 67 | - in a particular person's opinion(虽然学过,但是还没有熟练使用) 68 | *As far as I'm concerned, feng shui doesn't work.* 69 | 70 | --- 71 | 72 | ==run *sth* by *sb*== 73 | 74 | - INFORMAL. to tell someone about something so that that person can give their opinion about it 75 | 76 | --- 77 | 78 | ==put sth in(to) perspective== 79 | 80 | - to compare something to other things so that it can be accurately and fairly judged(不是很理解) 81 | *Total investments for this year reached $53 million, and, to put this into perspective, investments this year were double those made in 2013.* 82 | *You can put your worries into perspective when you realise how many people in the world are so much worse off than you.* ([Wiktionary](https://en.wiktionary.org/wiki/put_something_into_perspective)) 83 | ***Let's try to put these numbers into perspective*** ([What If We Detonated All Nuclear Bombs at Once? - Kurzgesagt](https://youtu.be/JyECrGp-Sw8?t=41)) 84 | *The proposed classification of approaches to open black box models should also be useful for putting the many research open questions in perspective.* (A Survey of Methods for Explaining Black Box Models - Guidotti et al.) 85 | [LinusTechTips - 新 Mac Pro...老莱怎么看](https://www.bilibili.com/video/av55391946) 12:12 86 | 87 | --- 88 | 89 | ==bring *sth* up== 90 | 91 | - to start to talk about a particular subject 92 | *She's always bringing up her health problems.* 93 | 94 | --- 95 | 96 | ==take the heat off *sb*== 97 | 98 | - INFORMAL. If someone or something takes the heat off you, he, she, or it reduces the amount of criticism you have to deal with 99 | *he deputy's resignation over the scandal has taken some of the heat off his superior.* 100 | 101 | --- 102 | 103 | ==run into *sb*== 104 | 105 | - to meet someone you know when you are not expecting to 106 | 107 | (==run into *sth*== 还有其他意思) 108 | 109 | --- 110 | 111 | ==steer clear of== 112 | 113 | 见 [S01E01](s01e01.html#steer) 114 | 115 | --- 116 | 117 | ==roll with the punches== 118 | 119 | - INFORMAL. to be able to deal with a series of difficult situations 120 | Coping with and withstanding adversity by being flexible (Urban Dictionary) 121 | 见招拆招 122 | 123 | --- 124 | 125 | ==work out==(不接宾语) 126 | 127 | - to happen or develop in a particular way 128 | *Let's hope this new job works out well for him.* 129 | - to exercise in order to improve the strength or appearance of your body 130 | - to be the result of a calculation 131 | *These figures work out differently each time I add them.* 132 | *The safe load for a truck of this size works out **at** nearly 20 tons.* 133 | 134 | --- 135 | 136 | ==work out *sth*== 137 | 138 | - (DISCOVER) to discover an answer, develop an idea, or calculate an amount 139 | *You can use a calculator to work out the solution.* 140 | 141 | ## Others 142 | 143 | - [stand-up comedy](https://en.wikipedia.org/wiki/Stand-up_comedy) 144 | - lasagne /ləˈzæn.jə/ - (USUALLY UK) 意大利千层面 145 | (US USUALLY lasagna) 146 | -------------------------------------------------------------------------------- /docs/langs/en/friends/s01e03.md: -------------------------------------------------------------------------------- 1 | # *Friends* S01 E03 2 | 3 | 4 | 5 | ## Words 6 | 7 | - ==leather== - 皮革 8 | - ==wrist== /rɪst/ - 手腕 9 | - ==flick== - 轻拍;轻弹 10 | - ==odds== - `n.` [plural] 几率 11 | - ==whimper== - 呜咽 12 | - ==yardstick== - 准绳;(好坏或成败的)衡量标准;码尺 13 | - ==innate== - 与生俱来的;固有的 14 | - ==chew== - 咀嚼 15 | - ==row== - `v.` **划(船)** 16 | 17 | --- 18 | 19 | ==walk== 20 | 21 | - `v.` [T] to go with someone to a particular place, for example because you want to protect them from danger, or show them the way: 22 | *He offered to walk her home/**to** the station.* 23 | 24 | --- 25 | 26 | ==cushion== 27 | 28 | - `n.` 靠垫;软垫 29 | - `v.` to make the effect or force of something softer;缓和冲击 30 | *The soft grass cushioned his fall.* 31 | 32 | --- 33 | 34 | ==puff== 35 | 36 | - `n.` (SMOKING) an act of smoking 37 | *She **took a** puff **on** her cigarette and thought for a moment.* 38 | 39 | --- 40 | 41 | ==herd== 42 | 43 | - `n.` 44 | - a large group of animals of the same type that live and feed together 牧群;兽群 45 | - MAINLY DISAPPROVING. a large group of people that is considered together as a group and not separately 人群;芸芸众生 46 | 47 | --- 48 | 49 | ==bash== 50 | 51 | - `v.` 52 | - INFORMAL. to hit hard 53 | - [T] to criticize someone severely 54 | 55 | --- 56 | 57 | ==dump== 58 | 59 | - (PUT DOWN) to put down or drop something in a careless way 60 | *He came in with four shopping bags and dumped them on the table.* 61 | 62 | --- 63 | 64 | ==put== 65 | 66 | - `v.` (EXPRESS) **to express something in words** 67 | *She wanted to tell him that she didn't want to see him any more, but she didn't know **how to** put **it**.* 68 | *Has everyone had a chance to put their point of view?* 69 | 70 | ## Phrases 71 | 72 | ==go with *sb/sth*== 73 | 74 | - INFORMAL. to accept an idea or agree with a person 同意;接受 75 | 76 | --- 77 | 78 |
79 | 80 | ==go through *sth*== 81 | 82 | - (EXAMINE) to examine something that contains a collection of things carefully in order to organize them or find something 83 | *I'm going through my wardrobe and throwing out all the clothes I don't wear any more.* 84 | *Remember to go through the pockets before you put those trousers in the washing machine.* 85 | - see [S01E01](s01e01.html#go-through-1) 86 | - ... 87 | 88 |
89 | 90 | --- 91 | 92 | ==put *sth* out== 93 | 94 | - 关(灯),熄灭(火,烟头) 95 | *Firefighters have been called to put out the **fire** in the city centre.* 96 | 97 | ## Others 98 | 99 | 05:45 -- 06:04 虚拟语气 100 | 101 | **Phoebe:** It's not mine, I didn't earn it, if I kept it, it would be like stealing. 102 | **Rachel:** Yeah, but if you spent it, it would be like shopping! 103 | **Phoebe:** Okay. Okay, let's say I bought a really great pair of shoes. Do you know what I'd hear, with every step I took? 104 | 105 | --- 106 | 107 | ==nursery rhyme== - 童谣;儿歌 108 | 109 | --- 110 | 111 | ==a thing or two== 112 | 113 | - some matters, facts, or information 一些事情;些许知识,一星半点 114 | *Why don't you ask Andrew about it? He **knows** a thing or two **about** (= has some knowledge of) computers.* 115 | 116 | --- 117 | 118 | ==have had it with *someone/something*== 119 | 120 | - to not be willing to continue to deal with someone or something 121 | *I’ve had it with this job – I’m quitting.* 122 | 123 | --- 124 | 125 | ==(every) now and then== 126 | 127 | ALSO (every) now and again 128 | 129 | - sometimes but not very often; from time to time 偶尔 130 | 131 | --- 132 | 133 | ==déjà vu== 既视感 134 | 135 | [逮虾户](https://www.youtube.com/watch?v=dv13gl0a-FA) 🚐💨 136 | -------------------------------------------------------------------------------- /docs/langs/en/imgs/all-set.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/en/imgs/all-set.png -------------------------------------------------------------------------------- /docs/langs/en/imgs/all-set2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/en/imgs/all-set2.png -------------------------------------------------------------------------------- /docs/langs/en/imgs/good-to-go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/en/imgs/good-to-go.png -------------------------------------------------------------------------------- /docs/langs/en/imgs/oyster-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/en/imgs/oyster-card.png -------------------------------------------------------------------------------- /docs/langs/en/learned-in-uk.md: -------------------------------------------------------------------------------- 1 | # 在英国学英语 2 | 3 | ==liner== 内衬 4 | 5 | --- 6 | 7 | ==film== 8 | 9 | - `n.` 影片;胶卷;**膜** 10 | (食品包装很常用这个词) 11 | - `v.` 拍电影;蒙上薄膜 12 | 13 | --- 14 | 15 | ==bag== 16 | 17 | 超市结账时问你要不要袋子用的就是 bag 18 | 19 | --- 20 | 21 | ==chill== 22 | 23 | - `n.` 寒意 24 | - `v.` 使寒冷,使恐怖;(非正式)**放松,休息**([Urban Dict](https://www.urbandictionary.com/define.php?term=chilling)) 25 | 26 | --- 27 | 28 | ==counter== 29 | 30 | - `n.` 计数器;(商店、银行等的)**柜台** 31 | - `v.` 反驳;抵制;抵消 32 | - `adj./adv.` 相反的 / 地,反对的 / 地 33 | (😏 MOBA 游戏的 BP 环节中有 counter pick 的说法) 34 | 35 | --- 36 | 37 | ==call== 38 | 39 | - `v.` 喊,叫;打电话;**到,访问**(车站时刻表上常见) 40 | - `n.` ... 41 | 42 | --- 43 | 44 | ==express== 45 | 46 | - `v.` 表达,表示 47 | - `n.` **特快列车,快递服务** 48 | - `adj.` **特快的,快速的** 49 | 50 | --- 51 | 52 | 往(银行/会员等)卡里**存钱**是 save money 53 | 但表示**充值**用 top-up 54 | 充了钱,储蓄或余额叫 savings 55 | 56 | ::: details 眼见为实 57 | ![add-money](./imgs/oyster-card.png) 58 | ::: 59 | 60 | --- 61 | 62 | ==I'm good== 63 | 64 | 除了用来回复 How are you? 之外,常用于 65 | 66 | ― Do you want some chips with your sandwich? 67 | ― No, I'm good. Thanks. 68 | (我听到过 I'm alright) 69 | (另:) 70 | 71 | ― Do you have any questions? 72 | ― No, I'm good. 73 | 74 | 也可用作委婉拒绝。 75 | 76 | ― Do you wanna go to a strip club? 77 | ― I'm good. 78 | 79 | 80 | 81 | --- 82 | 83 | ==You're good (to go) / You're all set== 84 | 85 | 你的事情都办好了 86 | 87 | ::: details 眼见为实 88 | ![good-to-go](./imgs/good-to-go.png) 89 | 90 | ![all-set](./imgs/all-set.png) 91 | 92 | ![all-set2](./imgs/all-set2.png) 93 | ::: 94 | 95 | 问法可以是 Am I all set? 96 | 97 | --- 98 | 99 | ==till== 100 | 101 | - `prep./conj.` 直到(utill 的非正式形式) 102 | - `n.` **收银台,(现金出纳机的)放钱的抽屉** (A cash register or drawer for money in a shop, bank, or restaurant) 103 | - `v.` 耕作,犁地 104 | 105 | --- 106 | 107 | ==attraction== 108 | 109 | - `n.` 吸引;吸引力;**A place which draws visitors by providing something of interest or pleasure** 110 | 111 | --- 112 | 113 | ==quote== 114 | 115 | - `v./n.` 引用;**报价** 116 | 117 | travel insurance quotes 118 | 119 | --- 120 | 121 | ==北约音标字母== 122 | 123 | 打电话需要报字母的时候会用到(比如给银行打电话需要报名字,邮编等) 124 | 125 | 比如 B - Bravo 126 | 注意 [Z 的读音](be-vs-ae.html#z)(听到过 Z - Zet) 127 | 128 | [说 26 个英文字母时用单词怎么表达? - 栗子的回答 - 知乎](https://www.zhihu.com/question/19737171/answer/200385911) 129 | [北约音标字母 - 维基百科](https://zh.wikipedia.org/zh-cn/北约音标字母) 130 | 131 | --- 132 | 133 | ==serve== 134 | 135 | - `v.` 服务;提供;**发球** 136 | - `n.` **发球** 137 | -------------------------------------------------------------------------------- /docs/langs/en/misuses.md: -------------------------------------------------------------------------------- 1 | # 常见误用 2 | 3 | ## 容易念错的单词 4 | 5 | - iron(r 不发音) 6 | ironic(r 发音) 7 | - island, isle(s 不发音) 8 | - suite(同 sweet) 9 | - receipt(p 不发音) 10 | - Richard(ar 发 /ə/ 的音) 11 | 12 | 13 | 14 | - rise /raɪz/ 15 | 16 | ## 容易误用的单词/短语 17 | 18 | - **high** 19 | 20 | ❌ 想要表达精力旺盛,兴奋 21 | ✔ Feeling euphoric, especially from the effects of **drugs** or **alcohol** 22 | 嗨起来可以说 get excited, get pumped up, get hyped up 23 | 24 | - **play** 25 | 26 | ✔ play sports/games/soccer/guitar, play with little children 27 | ❌ play with your friends 除非你还是小孩;用在成人之前有...不可描述的含义 28 | 玩可以用 hang out 29 | ❌ play Weibo/Instagram 30 | ✔ use Weibo/Instagram 31 | 32 | - **hello** 33 | 34 | 听起来太正式;另外语气上如果是 hello? 有种认为别人无视你而感到不满的感觉 35 | 打招呼不如 hi 或 hey 常用,需要引起别人注意时也可以用 hi, excuse me 36 | 正式程度 hello > hi > hey 37 | (在英国的实际体会:hello 还是很常听到的,包括朋友见面,并且语气也很热情;所谓太正式应该是美国人视角😂) 38 | 39 | - **I want** 40 | 41 | 有点命令的意味;同样的还有把 please 用在句首的时候 42 | 可以用 can I have 43 | 44 | - **black** 45 | 46 | 一般是指黑人 47 | 晒黑可以用 get tanned/darker 48 | 49 | ## TODO 50 | 51 | https://www.bilibili.com/video/av25637075 52 | https://www.bilibili.com/video/av27550050 53 | 54 | ## 部分来源 {docsify-ignore} 55 | 56 | - bilibili @KatAndSid 57 | - bilibili @阿滴英文 58 | -------------------------------------------------------------------------------- /docs/langs/en/others.md: -------------------------------------------------------------------------------- 1 | # 其他总结 2 | 3 | accent**be worth doing** 4 | 5 | --- 6 | 7 | accent**over time** 8 | 9 | if something happens over time, it happens gradually during a long period 10 | 11 | --- 12 | 13 | accent**from time to time** 14 | 15 | sometimes, but not regularly or very often 16 | -------------------------------------------------------------------------------- /docs/langs/en/think-of-about.md: -------------------------------------------------------------------------------- 1 | # think of 与 think about 2 | 3 | ::: tip Source 4 | [think of 和 think about 用法上有哪些区别?- 史蒂芬的专栏](https://mp.weixin.qq.com/s/Qh7fRcWlrxe2DTgqbNey9Q) 5 | ::: 6 | 7 | I think of 可以理解为「想到」,如 I thought of an idea(我想到一个主意)。 8 | 9 | think about 可以理解为「考虑」、「思考」,如 I'm thinking about the idea(我在考虑这个主意)。 10 | 11 | 但从中文的翻译来看,是完全能分得清的,但是我们从另外一个大的方面来谈这个问题,能够帮我们触类旁通,举一反三。 12 | 13 | 即 of 和 about 有什么区别? 14 | 15 | 比如 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
know ofknow about
hear ofhear about
speak/say ofspeak/say about
dream ofdream about
complain ofcomplain about
41 | 42 | 那我来总结一下: 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 |
of指第一反应,下意识里的东西,并不需要深入的,即非条件反射,说的是一个事情的整体而非细节。
about指需要用到大脑思考的、深入的东西,并不是下意识的东西,说的是一个事情更细更具体的东西。
56 | 57 | 因此: 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
think of想到,这是突然间的想法。
think about思考,考虑,这是需要大脑深入思考的。
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
speak/say of提到,= mention
speak/say about谈论,= talk about
84 | 85 | 例:Speaking/Saying of this, could you let know what you think? 说到这件事,你可以告诉我你的想法吗? 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 |
know of只是知道有这个事物而已,只是有个下意识的印象,不涉及具体细节,如只是听过名字,只是听别人提起过。
know about除了知道有这个事物,还知道这个事物额外的信息。
99 | 100 | know her:认识她 101 | know of her:听说过她、或者见过面(对整体有下意识的印象) 102 | know about her:知道和她有关的一些信息。 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 |
hear of听说过这个东西(对整体有下意识的印象)。
hear about听说过这个东西很多信息。
116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 |
dream of梦想,不是真实梦境,这也是下意识的东西。
dream about真实做梦梦见。
129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 |
complain of对整件事的存在持否定态度的抱怨,一定是坏事,比如 illness, noise,bad luck。
complain about对事情的某方面持否定态度,比如抱怨客户、供应商。譬如,客户本身的存在并不是一件坏事,但客户的某些方面不好,所以会 complain about。
142 | -------------------------------------------------------------------------------- /docs/langs/jp/beginner-unit-7-9.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 标准日本语初级(下)7-9 单元 3 | --- 4 | 5 | # 标准日本语 初级(下)7-9 单元总结 6 | 7 | 8 | 9 | 10 | 11 | ## 12 | -------------------------------------------------------------------------------- /docs/langs/jp/duolinguo.md: -------------------------------------------------------------------------------- 1 | 表示经过、通过、穿过某个地方用 2 | 爬山爬树用 3 | 4 | 更礼貌: 5 | 更口语: 6 | 7 | 晚饭吃什么呢? 8 | 我**要**咖喱 9 | 10 | 名词、形容动词 11 | 副词 12 | 13 | 列举做某事(比如和朋友**去去**韩国,**去去**日本) 14 | 形 + + 15 | 16 | 想要对方做某事 17 | 形 + 18 | 19 | 自己想要做某事 20 | 形(去掉)+ 21 | 不想要做某事(否定)+ 22 | -------------------------------------------------------------------------------- /docs/langs/jp/grammar.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 日本語の文法 3 | --- 4 | 5 | # 6 | 7 | 8 | 9 | ## 一点点语言学小知识 10 | 11 | **传统的**语言形态分类[^morphological-typology]: 12 | 13 | - ==分析语==——依赖于**词序** (word order),助词、介词等特征来表达意思,**很少有词形变化** 14 | 例如:**现代汉语**,完全无词形变化,语法功能由额外文字来表示。名词不分主格宾格,属格用「的」连接。动词本身不随人称、时态等变化;过去时用「了」,现在时用「正在」;被动语态用「被」。 15 | 16 | (开个脑洞:编程「语言」依赖的就是词序,可以被解析为[抽象语法树](https://zh.wikipedia.org/zh-cn/%E6%8A%BD%E8%B1%A1%E8%AA%9E%E6%B3%95%E6%A8%B9),很分析)[^nlp] 17 | 18 | - 一个相关的概念是==孤立语==,指**语素-单词比** (morpheme-per-word ratio) 很低的语言(某种意义上也即意味着很少有词形变化) 19 | 20 | - ==综合语==——依赖于**词形变化**[^compared-to-derivation]来表达意思 21 | 动词变位(**人称**、**数**、阴**性**阳性、现在过去将来**时态**、完成**体**未完成体、主动被动**语态**、陈述祈使虚拟等**语气**、**敬语**,等等), 22 | 名词形容词等变格(主**格**宾格、单**数**复数、阴**性**阳性) 23 | 24 | - ==黏着语==——变词语素(词缀)只表示一种意思或语法功能(在大部分情况下) 25 |  例如:**日语** [TODO](https://zh.wikipedia.org/zh-cn/%E9%BB%8F%E7%9D%80%E8%AF%AD#%E6%97%A5%E8%AA%9E) 26 | 29 | 30 | - ==屈折语==——变词语素(词缀)经常同时表达多种意思或语法功能 31 |  例如:**英语**动词词缀 -s 意味着**现在时**,**第三人称**,**单数** 32 |  更典型**法语**的动词变位[^french] 33 | 34 | - **多式综合语**——构词法更加复杂 35 | 36 | 在实际状况中,绝大多数语言都并不能单纯地被分类至某一分类。把上述分类视作不同的性质会更加适当。英语一般被划分为屈折语,但是其(和南非语)在印欧语系中是最具有分析语性质的。 37 | 38 | 日语是典型的黏着语,有众多动词词形变化(日语语法中称为**活用**),次多形容词变化。日语名词则基本没有词形变化,更具有孤立语性质。一般来说黏着语的动词变化很规则,日语中明显不规则的动词只有两类(TODO)。 39 | 40 | ::: tip 🧊 冷知识 41 | 很多著名的人工语言都是黏着语,例如[世界语](https://zh.wikipedia.org/wiki/%E4%B8%96%E7%95%8C%E8%AF%AD),克林贡语——《星际迷航》,昆雅语、黑暗语——《魔戒》 42 | ::: 43 | 44 | ## 日语语法 45 | 46 | ::: details 教育文法 vs. 学校文法 47 | - ==教育文法==是面向非母语学习者的一套语法系统。 48 | **优点**是简单、容易上手,对动词活用形的分类更容易理解,对各种助词介绍得很好。 49 | **缺点**是系统性不足。另外在日语学习的后期,很多时候需要直接参考面向日本人的材料(比如词典),如果不具备「学校文法」相关的知识会遇到一定的障碍。 50 | 51 | - ==学校文法==则是以日本中学生为对象的语法。 52 | **优点**是更系统、规整,动词分类(变形?) 53 | **缺点**是对于初学者可能太复杂。另外作为众多日语语法体系之一,也免不了对某些语法现象的解释不太合理或者值得商榷。 54 | 55 | 《新标日》采用的是「教育文法」,《标准日语语法》(顾明耀) 则是基于「学校文法」的(更适合中文母语者的)微调版本。 56 | ::: 57 | 58 | ### 体言 59 | 60 | ——名词、代名词、数词 61 | 62 | - 无词形变化 63 | - 需要接上助词来构成句子成分,比如后续分别构成主语、宾语、定语、状语,后续助动词构成谓语 64 | - 可以被定语修饰 65 | 66 | 67 | 68 | ### 用言 69 | 70 | ——动词、形容词、形容动词 71 | 72 | ::: details 日语现代语基本活用表 73 |
74 | 75 |
日语现代语基本活用表 - 雨宫 Lin 的文章 - 知乎
76 |
77 | ::: 78 | 79 | ### 助词 80 | 81 | ## 参考材料 82 | 83 | - 《标准日本语》第二版. 人民教育出版社. 84 | - 顾明耀.《标准日语语法》第二版. 高等教育出版社. 85 | - [日语的语法怎么背?- 碳酸氢镭的回答 - 知乎](https://www.zhihu.com/question/352141891/answer/1370307293) 86 | - Wikipedia 87 | 88 | **教育文法 vs. 学校文法** 89 | 90 | - [浅谈日语中的两大语法体系——学校语法与教育语法](https://www.bilibili.com/read/cv3292464/) 91 | - [日语教学中「学校教育」和「日本语教育」之间的区别及优劣是什么?- 知乎](https://www.zhihu.com/question/20448242) 92 | 93 | [^morphological-typology]: 现在的语言类型学研究不再使用上述仅仅四五个粗略的标签来进行分类,因为其只体现了语言的大致特征,有很多无法覆盖的语法细节。见 [World Atlas of Language Structure (WALS)](https://en.wikipedia.org/wiki/Morphological_typology#WALS) 94 | 95 | [^nlp]: 虽说分析语听起来更容易「分析」,但在目前以神经网络为代表的自然语言处理 (NLP) 技术中,作为分析语的中文反而比英语处理起来更难。首先分词 (tokenization) 就是一个难题,此外综合语的各种词缀(单复数,时态等)比起分析语的语序也更容易处理。 96 | 97 | [^compared-to-derivation]: 词形变化(也译作**屈折变化**)指单词(或词根)的变化,以导致语法功能改变,进而使其代表的意义也有所改变。==派生==则是在单词上加上派生词素,藉以从现有词汇中添加意义不同的新词。 98 | 一个直观的认识是:在词典中,单词的词形变化不会列出来,但派生词会。例如英语词典会把 readable 和 readability 分开词条列在其词根 read 之下,但不会把 reads 和 reading 以词条列出来。 99 | 100 | [^french]:
法语第一组动词变位(图源维基百科) 101 | -------------------------------------------------------------------------------- /docs/langs/jp/imgs/french-verb-inflection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/jp/imgs/french-verb-inflection.png -------------------------------------------------------------------------------- /docs/langs/jp/imgs/hiragana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/jp/imgs/hiragana.png -------------------------------------------------------------------------------- /docs/langs/jp/imgs/huoyong-origin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/jp/imgs/huoyong-origin.jpg -------------------------------------------------------------------------------- /docs/langs/jp/imgs/huoyong.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/jp/imgs/huoyong.jpg -------------------------------------------------------------------------------- /docs/langs/jp/imgs/katakana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/langs/jp/imgs/katakana.png -------------------------------------------------------------------------------- /docs/math/README.md: -------------------------------------------------------------------------------- 1 | # Math -------------------------------------------------------------------------------- /docs/math/info-theory.md: -------------------------------------------------------------------------------- 1 | # 信息论相关概念 2 | 3 | 4 | 5 | 假设有一个正四面体的骰子,投掷一次的结果由**随机变量** $X$ 表示(取值可能为 1 到 4),如果这个骰子是均匀的,那么发生每一种可能的**随机事件**的概率 $P(X=x)$ 都为 $\frac{1}{4}$,其中 $x \in \{1,2,3,4\}$(后文简记为 $P(x)$) 6 | 7 | ## 随机事件的「信息量」 8 | 9 | ——某个随机事件 $x$ 的「信息量」为其概率的倒数 $\frac{1}{P(x)}$ 10 | 11 | 乍一看这个定义有点无中生有,不妨这样理解:对于一个随机事件 $x$ 12 | - 其发生的概率 $P(x)$ 越高,那么当它发生的时候也是意料之中,没什么「新意」 13 | - 而如果 $P(x)$ 越小,$x$ 发生的时候就会觉得不同寻常,有点信息 14 | 15 | ## 信息熵 (entropy) 16 | 17 | ——理论最优编码长度 18 | 19 | $$ 20 | H(X) = \mathbb{E}_{x \sim P}\left[\log\frac{1}{P(x)}\right] 21 | $$ 22 | 23 | ## 交叉熵 (cross entropy) 24 | 25 | ——在 $P$ 的期望下 $Q$ 的编码长度 26 | 27 | 实际编码长度 28 | 29 | $$ 30 | \text{CrossEntropy}(P\;\|\;Q) = \mathbb{E}_{x \sim P}\left[\log\frac{1}{Q(x)}\right] 31 | $$ 32 | 33 | ## 相对熵 (relative entropy) 34 | 35 | ——额外编码长度 36 | 37 | 也即 ==KL 散度== 38 | 39 | $$ 40 | \text{KL}(P\;\|\;Q) = \mathbb{E}_{x \sim P}\left[\log\frac{P(x)}{Q(x)}\right] 41 | $$ 42 | 43 | --- 44 | 45 | ## JS 散度 46 | 47 | ## 参考材料 48 | 49 | 信息熵是什么? - 返朴的回答 - 知乎 50 | https://www.zhihu.com/question/22178202/answer/667876061 51 | 信息熵是什么? - 忆臻的回答 - 知乎 52 | https://www.zhihu.com/question/22178202/answer/161732605 53 | 编码 54 | https://blog.csdn.net/AckClinkz/article/details/78740427 55 | 形象举例 56 | https://www.zhihu.com/question/22178202/answer/124805730 57 | 58 | https://zhuanlan.zhihu.com/p/149186719 59 | 60 | https://machinelearningmastery.com/cross-entropy-for-machine-learning/ 61 | 62 | Section 8.6 63 | https://www.princeton.edu/~cuff/ele201/kulkarni_text/information.pdf 64 | -------------------------------------------------------------------------------- /docs/math/linear-algebra/lt1.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/math/linear-algebra/lt1.mp4 -------------------------------------------------------------------------------- /docs/math/linear-algebra/lt2-to3d.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/math/linear-algebra/lt2-to3d.mp4 -------------------------------------------------------------------------------- /docs/math/linear-algebra/lt3-to1d.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/math/linear-algebra/lt3-to1d.mp4 -------------------------------------------------------------------------------- /docs/math/linear-algebra/lt4-rank.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/math/linear-algebra/lt4-rank.mp4 -------------------------------------------------------------------------------- /docs/math/probability.md: -------------------------------------------------------------------------------- 1 | # 概率论 2 | 3 | ## 频率学派与贝叶斯学派 4 | 5 | 假定参数 $\theta$ 决定分布 $D$,分布 $D$ 产生样本集 $\mathcal{X}$ 6 | 7 | - **频率派**把需要推断的**参数 $\theta$ 看做是固定的未知常数**,即概率虽然是未知的,但最起码是确定的一个值,同时,**样本 $\mathcal{X}$ 是随机的**,所以频率派重点研究样本空间,大部分的概率计算都是针对样本 $\mathcal{X}$ 的分布; 8 | - 而**贝叶斯派**的观点则截然相反,他们认为**参数 $\theta$ 是随机变量**,而**样本 $\mathcal{X}$ 是固定的**,由于样本是固定的,所以他们重点研究的是参数的分布1 9 | 10 | 所以,在贝叶斯学派的观点下,$\Pr(\theta)$ 是==先验==,$\Pr(\mathcal{X}|\theta)$ 是==似然==(不准确,似然函数不是概率),$\Pr(\theta|\mathcal{X})$ 是==后验==,$\Pr(\mathcal{X})$ 是==证据==(evidence) 11 | 12 | --- 13 | 14 | ## 各种分布 15 | 16 | 伯努利分布(0-1 分布)--- 扔一次硬币 17 | 二项分布 --- 扔多次硬币 18 | 超几何分布 19 | 20 | 多项分布 --- 扔多次骰子 21 | 22 | --- 23 | 24 | ## 统计测试 25 | 26 | Fisher's exact test *TODO* 27 | 28 | ## 参考文献 {docsify-ignore} 29 | 30 | 1. [从贝叶斯方法谈到贝叶斯网络](https://blog.csdn.net/v_july_v/article/details/40984699) 31 | -------------------------------------------------------------------------------- /docs/math/stats.md: -------------------------------------------------------------------------------- 1 | # 统计 2 | 3 | ## 随机模拟 4 | 5 | https://cosx.org/2013/01/lda-math-mcmc-and-gibbs-sampling 6 | 7 | --- 8 | 9 | TODO 随机化算法,如 Gibbs sampling;确定性算法(deterministic algorithm),如 EM 算法? 10 | -------------------------------------------------------------------------------- /docs/ml/README.md: -------------------------------------------------------------------------------- 1 | # Machine Learning -------------------------------------------------------------------------------- /docs/ml/graphical-model.md: -------------------------------------------------------------------------------- 1 | # 概率图模型 2 | 3 | ::: warning 4 | UNDER CONSTRUCTION 5 | ::: 6 | 7 | ## 林达华综述 2013 8 | 9 | 10 | 11 | ### 图模型 12 | 13 | 按照采用什么类型的图来表达变量之间的关系可以分为 14 | 15 | 1. 贝叶斯网络 → 有向无环图 16 | 2. 马尔可夫随机场 → 无向图 17 | 18 | 这种分类主要是为了研究和学习的便利,在实际应用中常常结合使用 19 | 20 | 建模和推断两步 21 | 22 | ### 建模部分的发展方向 23 | 24 | 在实际问题中,事先设计合适的模型结构是很难的 25 | → 结构学习,先只设计模型需要满足的约束,然后在学习的过程中形成实际结构 26 | 27 | 主要问题就是如何发现变量之间的内部关联,做法没有固定的形式, 28 | 例如先选完全图连接所有的变量,然后选择一个子图来描述它们的实际结构, 29 | 又或者,你可以引入潜在节点(latent node)来建立变量之间的关联 30 | 31 | 另一个方向就是非参数化,典型的非参数化模型就是基于狄利克莱过程(Dirichlet Process)的混合模型 32 | 33 | ### 统计推断 34 | 35 | 完成模型的设计之后,下一步就是通过一定的算法从数据中去估计模型的参数,或推断我们感兴趣的其它未知变量的值 36 | 37 | 一般而言,确切推断(exact inference)的复杂度很高,于是,人们退而求其次,转而探索具有多项式复杂度的近似推断(approximate inference)方法,主要有三种: 38 | 39 | 1. 基于平均场逼近 (mean field approximation)的 variational inference(EM 算法就属于这类型算法的一种特例) 40 | 2. Belief propagation(最早作为精确推断技术提出,后来衍生出多种近似推断算法 -- 西瓜书) 41 | 3. 蒙特卡罗采样(Monte Carlo sampling) 42 | 43 | (蒙特卡罗方法本身也是现代统计学中一个非常重要的分支) 44 | 45 | --- 46 | 47 | ## 🍉书 48 | 49 | 概率图模型是一类用图来表达变量相关关系的概率模型,分类同上 50 | 51 | ### 常见模型 52 | 53 | 隐马尔可夫模型(Hidden Markov Model,简称 HMM)是结构最筒单的动态贝叶斯网 54 | 马尔可夫随机场(Markov Random Field,简称 MRF)是典型的马尔可夫网 55 | 条件随机场(Conditional Random Field,简称 CRF)是一种判别式无向图模型 56 | 57 | ### 学习与推断 58 | 59 | 给定参数 $\Theta$ 求解某个变量 $x$ 的分布,就变成对联合分布中其他无关变量进行积分的过程,这称为「边际化」(marginalization) 60 | 61 | 精确推断 62 | 1. 变量消去 63 | 2. 信念传播 64 | 65 | 近似推断 66 | 1. 采样法 67 | 2. 变分推断 68 | 69 | ### 话题模型 70 | 71 | --- 72 | 73 | ## Misc. 74 | 75 | ### EM 算法 76 | 77 | 在有隐变量(无法观测)的概率模型中,用最大似然或最大后验估计参数的方法 78 | 79 | 80 | 81 | k-means 就是典型的 EM 算法 82 | 83 | ## 阅读材料 84 | 85 | https://ermongroup.github.io/cs228-notes/ 86 | -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/attribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/attribution.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/dim1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/dim1.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/dim2-origin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/dim2-origin.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/dim2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/dim2.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/disambiguation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/disambiguation.gif -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/disambiguation1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/disambiguation1.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/disambiguation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/disambiguation2.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/paper-space.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/paper-space.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/papers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/papers.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/terms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/terms.png -------------------------------------------------------------------------------- /docs/ml/imgs/interpretability/viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/imgs/interpretability/viz.png -------------------------------------------------------------------------------- /docs/ml/learning-theory.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 计算学习理论 3 | --- 4 | 5 | # 计算学习理论 (Computational Learning Theory) 6 | 7 | 8 | 9 | ::: warning 10 | UNDER CONSTRUCTION 11 | ::: 12 | 13 | ## 什么是「学习」 14 | 15 | 先定义一些概念 16 | 17 | - ==样本空间== $\mathcal{X}$,其中样本 $x$ 通常由向量表示 18 | 19 | - ==标记空间== $\mathcal{Y}$,考虑二分类问题时,$\mathcal{Y} = \lbrace+1,-1\rbrace$ 或 $\lbrace0,1\rbrace$ 20 | 21 | - $\mathcal{X}$ 中的样本服从一个隐含未知的==样本分布== $\mathcal{D}$ (underlying data-generating distribution),即 $x\sim\mathcal{D}$(有些地方 $\mathcal{D}$ 定义在 $\mathcal{X}\times\mathcal{Y}$ 之上,即 $(x,y)\sim\mathcal{D}$,*TODO*) 22 | 23 | - ==标记函数== $f\colon\mathcal{X}\to\mathcal{Y}$(未知,是学习器想学习到的) 24 | 也被称为 concept,$c\colon\mathcal{X}\to\mathcal{Y}$,$c\in\mathcal{C}$ (concept class) 25 | 26 | - ==样例集== $D=\lbrace(x^{(1)},y^{(1)}),(x^{(2)},y^{(2)}),\cdots,(x^{(m)},y^{(m)})\rbrace$,先从 $\mathcal{D}$ 中采样 $x^{(i)}$,然后由 $f$ 标记得到 $y^{(i)}$,独立地多次采样得到样例集 $D$,这就是**独立同分布假设 (i.i.d. assumption)** 27 | 28 | - 学习器的输出,==假设函数== $h\colon\mathcal{X}\to\mathcal{Y}$,所有可能的 $h$ 的集合叫做**假设空间** $\mathcal{H}$(比如所有形如 $h=ax+b$ 的线性函数),$\mathcal{H}$ 由 [inductive bias](https://en.wikipedia.org/wiki/Inductive_bias) 决定(即对某**类** $h$ 的偏好) 29 | 30 | - ==损失函数== **loss function**,$\ell\colon\mathcal{Y}\times\mathcal{Y}\to\mathbb{R}$,学习理论主要研究二分类问题,常使用 0-1 loss,即 $\ell=1_{h(x) \neq y}$,其中 $1$ 为指示函数 31 | 32 | 得到一个假设函数 $h$ 后,我们如何评估它的好坏 33 | 34 | - ==泛化误差==,在样本分布 $\mathcal{D}$ 之下 loss 的期望 35 | $$ E(h;\mathcal{D}) = \mathbb{E}_{x\sim\mathcal{D}}\thinspace[\ell(h(x),y)]. $$ 36 | - ==经验误差==,在样例集上的平均 loss 37 | $$ \widehat{E}(h;D)=\frac{1}{m}\sum_{i=1}^m \ell\mathopen{}\left(h(x^{(i)}), y^{(i)}\right)\mathclose{}. $$ 38 | 39 | ## PAC 学习框架 40 | 41 | ## VC 维 42 | 43 | ## 阅读材料 44 | 45 | - Mehryar Mohri, Afshin Rostamizadeh, Ameet Talwalkar. Foundations of Machine Learning. *The MIT Press*. 2012. (Chapter 2, 3) 46 | - 周志华. 机器学习.(第 12 章,计算学习理论) 47 | - Shalev-Shwartz, Shai, and Shai Ben-David. Understanding machine learning: From theory to algorithms. *Cambridge University Press*. 2014. (Chapter 2, 3) 48 | - [Stanford CS229T/STATS231: Statistical Learning Theory](https://web.stanford.edu/class/cs229t/) 49 | -------------------------------------------------------------------------------- /docs/ml/materials/20210202-interpretability-slides-yzhang.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/materials/20210202-interpretability-slides-yzhang.pdf -------------------------------------------------------------------------------- /docs/ml/new/ai-art.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/ml/new/ai-art.md -------------------------------------------------------------------------------- /docs/ml/new/nerf.md: -------------------------------------------------------------------------------- 1 | # NeRF: Neural Radiance Fields 2 | 3 | NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis 4 | 5 | https://www.it-jim.com/blog/nerf-in-2023-theory-and-practice/ 6 | 7 | https://yconquesty.github.io/blog/ml/nerf/ 8 | -------------------------------------------------------------------------------- /docs/ml/pca.md: -------------------------------------------------------------------------------- 1 | # PCA -------------------------------------------------------------------------------- /docs/ml/pytorch.md: -------------------------------------------------------------------------------- 1 | # PyTorch 小笔记 2 | 3 | ## 基本流程 4 | 5 | ```python 6 | model = SomeNetwork() ## Your own model 7 | ## Get `inputs` and `labels` from your dataset 8 | preds = model(inputs) ## Forward pass 9 | loss = loss_func(preds, labels) ## Compute loss 10 | loss.backward() ## Backward pass 11 | optimizer.step() ## Update model weights 12 | ``` 13 | 14 | ## `NaN` problems 15 | 16 | 只需一句 17 | 18 | ```python 19 | torch.autograd.set_detect_anomaly(True) 20 | ``` 21 | 22 | PyTorch 会自动检查是否出现 `NaN` 值,并且打印出详细的信息(会影响性能,所以仅在排查问题时使用) 23 | -------------------------------------------------------------------------------- /docs/ml/reinforcement-learning.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 强化学习 3 | --- 4 | 5 | # 强化学习 (Reinforcement Learning) 6 | 7 | 8 | 9 | ::: warning 10 | UNDER CONSTRUCTION 11 | ::: 12 | 13 | ::: callout 🥥 In a Nutshell 14 | 设想你正在下一局(你)不知道规则的棋,下了几十(上百)步之后,裁判突然宣布「你输了」 15 | ──(如何下得更好)这就是强化学习 16 | ::: 17 | 18 | ::: warning TODO 19 | 强化学习的特点:不知道规则->?,几十上百步->? 20 | ::: 21 | 22 | ==强化学习==是通过与环境交互来解决**连续决策**的问题,而**监督学习**可以看作是**单轮决策**(预测)问题 23 | 24 | - ==可能的状态== **state**,$s \in S$(棋盘的局面) 25 | - ==允许的动作== **action**,$a \in A(s)$(即可以落子的位置) 26 | - A ==(probabilistic) transition model==,$P(s^\prime;s, a) \colon S \times A \times S \to [0,1]$(比如黑白棋的翻转,围棋的提子) 27 | - ~~==效用函数== **utility function**,$u(s,p)$,即玩家 $p$ 在游戏结束时(状态 $s$)获得的「收益」~~ 28 | 29 | ## 马尔可夫决策过程 (Markov Decision Processes, aka MDPs) 30 | 31 | TODO 32 | 33 | ## 从 Model-based 到 Model-free 34 | 35 | ## 阅读材料 36 | 37 | - Stuart Russell and Peter Norvig. Artificial Intelligence: A Modern Approach. *Prentice Hall*. 3rd 2009. 38 | (Chapter 17: Making Complex Decisions; Chapter 21: Reinforcement Learning) 39 | - 周志华. 机器学习. 2016 年第 1 版.(第 16 章,强化学习) 40 | 41 | 其它 42 | 43 | - [这里有一篇深度强化学习劝退文 - 知乎专栏](https://zhuanlan.zhihu.com/p/33936457) 2018-02-25 44 | -------------------------------------------------------------------------------- /docs/ml/rule-learning.md: -------------------------------------------------------------------------------- 1 | # ? 2 | 3 | > 🚧... 4 | 5 | - first-order logic? 6 | - a single rule of inference, called resolution? 7 | - clausal form? a restricted clausal form called Horn clause logic 8 | - Gödel's incompleteness theorems? 要么自相矛盾,要么不完备 9 | - 证明论?模型论?类型论(似乎不再是数理逻辑了)? 10 | 11 | ## 数理逻辑 12 | 13 | - accent**well-formed formula** (abbr. **wff**), a finite sequence of symbols from a given alphabet that is part of a formal language (well-formed 又有什么要求🤔) 14 | - accent**atomic formula** (aka **atom**),不含逻辑连接词的,或者说不含 sub-formulas 的 wff 15 | - accent**文字**,accent**literal**,an **atom** or its negation 16 | - accent**子句**,accent**clause**,an expression formed from a finite collection of **literal**s 17 | - accent**Horn clause**,是文字 (literal) 的析取 (disjunction),并且最多只有一个肯定文字 18 | - A Horn clause with exactly one positive literal is a **definite clause** 19 | - A Horn clause without a positive literal is called a **goal clause** 20 | - 注意 Horn clauses 的合取是合取范式 21 | - accent**句子**,accent**sentence**,没有自由变量的公式🤔 22 | - accent**theory**,一组句子🤔 23 | - A set of Horn clauses is called a **logic program** [1] 24 | 25 | 26 | 27 | - Boolean logic 28 | - accent**合取范式**,accent**conjunctive normal form** (**CNF**) or accent**clausal normal form**,是若干个子句 (clause) 的合取 (conjunction),其中子句为文字 (literal) 的析取,也即 **AND of ORs** 29 | - 所有文字的合取当然是 CNF 的,每个文字都看作一个子句 30 | - 所有文字的析取也是 CNF 的(注意:同时也是 DNF 的),看作只有一个子句(🤔这种情况很反直觉,至于为什么会定义这种标准形式,说是在自动定理证明中有用) 31 | - accent**析取范式**,accent**disjunctive normal form** (**DNF**),即 **OR of ANDs** 32 | 33 | 34 | 35 | - **演绎**,**deduction**,从一般到特殊,从一般性规律出发来探讨具体事物 36 | - **归纳**,**induction**,从特殊到一般,从个别事物出发概括出一般性规律 37 | - accent**归结**,accent**resolution**, 38 | 39 | ## 规则学习 40 | 41 | ### 命题规则学习 42 | 43 | - 序贯覆盖 44 | - 剪枝优化 45 | 46 | ### 一阶规则学习 47 | 48 | FOIL (First-Order Inductive Learner) 49 | 50 | 序贯覆盖,自顶向下(从一般到特殊) 51 | 52 | 本质只是把命题规则学习的过程稍加改变使其能应用在一阶规则上 53 | 54 | ### 归纳逻辑程序设计 55 | 56 | ILP (Inductive Logic Programming) 57 | 58 | 自底向上 59 | 60 | #### 最小一般泛化 61 | 62 | LGG (Least General Generalization),从名字就能看出来,给定若干规则,希望总结成一条相对泛化的规则,但同时又不要太过泛化(最小泛化),可以用最大公约数来类比 63 | 64 | - 对于两条规则(🤔应该需要写成合取的形式) 65 | - 先找都有的谓词,然后对其中相同位置的常量进行考察,若相同则保留,若不相同则替换为变量(泛化) 66 | - 对于不是都含有的谓词,直接忽略,否则 LGG 就不能特化成该规则 67 | 68 | 🤔RLGG 69 | 70 | ### 递归结 71 | 72 | inverse resolution,四种方式,在一阶规则里要用到 置换 和 合一 两种操作 73 | 74 | ## 阅读材料 75 | 76 | 1. Stephen Muggleton. Inductive Logic Programming. *New Generation Computing*. 1991. ([PDF](https://www.doc.ic.ac.uk/~shm/Papers/ilp.pdf)) 77 | 最有用的是附录 A,正文不是很懂,只看到有很多种 operations 78 | 2. 周志华. 机器学习. 2016 年第 1 版.(第 15 章,规则学习) 79 | -------------------------------------------------------------------------------- /docs/ml/svm.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 支持向量机 3 | --- 4 | 5 | # 支持向量机 (SVM) 6 | 7 | 8 | 9 | 线性分类器 10 | 11 | 超平面 12 | 13 | $$ 14 | \boldsymbol{w}^{\top}\boldsymbol{x}+b=0 15 | $$ 16 | 17 | $\boldsymbol{w}$ 和 $b$ 的值可以同步缩放 18 | 19 | 从几何意义来说,$\boldsymbol{w}$ 为该超平面的法向量,$\boldsymbol{w}^{\top} \boldsymbol{x}$ 也即内积 $\lang\boldsymbol{w},\boldsymbol{x}\rang = \|\boldsymbol{w}\|\|\boldsymbol{x}\|\cos\theta$,可以理解为 $\boldsymbol{x}$ 在 $\boldsymbol{w}$ 方向上的投影长度(乘以 $\|\boldsymbol{w}\|$),该超平面由所有在 $\boldsymbol{w}$ 方向上投影长度为 $-\frac{b}{\|\boldsymbol{w}\|}$ 的点组成,原点到超平面的距离也即 $-\frac{b}{\|\boldsymbol{w}\|}$。 20 | 21 | 任意点 $\boldsymbol{p}$ 到超平面 $(\boldsymbol{w},b)$ 的距离为 22 | 23 | 此处应有图 24 | 25 | $$ 26 | r=\frac{1}{\|\boldsymbol{w}\|}\left|\boldsymbol{w}^{\top} \boldsymbol{p}+b\right| 27 | $$ 28 | 29 | 间隔 $\gamma$ 30 | 31 | $$ 32 | \frac{2}{\|\boldsymbol{w}\|} 33 | $$ 34 | 35 | 线性支持向量机 36 | 37 | $$ 38 | \begin{aligned} 39 | \min_{\boldsymbol{w},b} & \quad \frac{1}{2}\|\boldsymbol{w}\| \\ 40 | \text{s.t.} & \quad y_i(\boldsymbol{w}^{\top}\boldsymbol{x}_i+b) \ge 1 41 | \end{aligned} 42 | $$ 43 | 44 | 对偶型 45 | 46 | ## 拉格朗日乘子法 47 | 48 | ——从有约束优化到无约束优化 49 | 50 | Khan Academy 51 | 52 | ## KKT 条件 53 | 54 | 61 | 62 | # 阅读材料 63 | 64 | - [机器学习工程师面试宝典 05:支持向量机](https://github.com/HaoMood/homepage/blob/master/files/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0%E5%B7%A5%E7%A8%8B%E5%B8%88%E9%9D%A2%E8%AF%95%E5%AE%9D%E5%85%B8-05-%E6%94%AF%E6%8C%81%E5%90%91%E9%87%8F%E6%9C%BA.pdf) by [张皓](https://haomood.github.io/homepage/) 65 | -------------------------------------------------------------------------------- /docs/music/music.md: -------------------------------------------------------------------------------- 1 | # 十二平均律 2 | 3 | 4 | 5 | - [音乐也有科学道理?Do、Re、Mi...都是如何确定的?李永乐老师讲音律](https://www.bilibili.com/video/BV124411e7Wk) 6 | - [人们为什么选择了十二平均律?- hnsjc](https://zhuanlan.zhihu.com/p/140709959) 7 | -------------------------------------------------------------------------------- /docs/music/piano.md: -------------------------------------------------------------------------------- 1 | # 钢琴 2 | 3 | ## 五线谱 4 | 5 | [五線譜:一次搞懂所有你該知道的、基本的事情 - 好和弦](https://nicechord.com/post/notation-essentials/) 6 | -------------------------------------------------------------------------------- /docs/others/2015-summary.md: -------------------------------------------------------------------------------- 1 | # 2015 Summary 2 | 3 | ::: tip Repost 4 | Originally posted on 2016-01-25 5 | ::: 6 | 7 | ## Memento 8 | 9 |
10 | changelog 11 |
App WhatIsGone(Hints:《奇特的一生》《在我入睡前》)
12 |
13 | 14 |
15 | Unity, Minecraft 16 |
Unity 3d, my Minecraft (2015-03-12)
17 |
18 | 19 |
20 | Eloquent JavaScript 21 |
Eloquent JavaScript (2015-05-26)
22 |
23 | 24 |
25 | IT Home 26 |
Building native app using HTML, JavaScript, CSS (2015-05-27)
27 |
28 | 29 |
30 | HK 31 |
Hong Kong (2015-06-14)
32 |
33 | 34 |
35 | ML, ex1 36 |
Machine Learning, Coursera (2015-06-29)
37 |
38 | 39 |
40 | SAE, Python, Vim 41 |
SAE, Python, Vim (2015-09-01)
42 |
43 | 44 |
45 | Prolog 46 |
Prolog project (2015-11-23)
47 |
48 | 49 |
50 | SSH 51 |
Spring, Spring MVC, Hibernate (2015-11-28)
52 |
53 | 54 |
55 | Win10 uwp app 56 |
Windows 10 UWP app (2015-12-22)
57 |
58 | 59 |
60 | Jess project 61 |
Jess project (2016-01-04)
62 |
63 | 64 |
65 | Beef hotpot 66 |
Beef hotpot (2016-01-21)
67 |
68 | 69 | ***“Version control” of myself*** 70 | 71 | 85 | -------------------------------------------------------------------------------- /docs/others/3d-vision.md: -------------------------------------------------------------------------------- 1 | # 入门 2 | 3 | 4 | 5 | ## Incremental SfM (Structure from Motion) 6 | 7 | ![](http://colmap.github.io/_images/incremental-sfm.png) 8 | 9 | ## SMPL 10 | 11 | [SMPL: a skinned multi-person linear model](https://dl.acm.org/doi/10.1145/2816795.2818013) 12 | 13 | 23 joints 14 | 15 | 10 shape parameters $\boldsymbol{\beta}$,23 pose parameters $\boldsymbol{\theta}$ (joint relative rotations) 16 | 17 | [SMPL 论文解读和相关基础知识介绍](https://zhuanlan.zhihu.com/p/256358005) 18 | 19 | 蒙皮 (skinning) 20 | Rigid Skinning,Linear Blend Skinning 21 | 22 | SMPL made Simple 23 | https://smpl-made-simple.is.tue.mpg.de/ 24 | 25 | https://meshcapade.wiki/SMPL 26 | 27 | [SMPLify](https://people.eecs.berkeley.edu/~kanazawa/papers/SMPLify.pdf) estimates the 3D shape and pose (i.e., SMPL model) from a single 2D image. 28 | 29 | ## 旋转 30 | 31 | SO(3) 和 so(3) 32 | 33 | https://zhuanlan.zhihu.com/p/87802961 34 | 35 | > There are many well-known parametrizations of rotations, such as: the Euler angles (the angles of three successive rotations about main axes), the unit quaternion (also known as the Euler parameters), the axis-angle vector (also known as the exponential map). 36 | > 37 | > ― Parametrization and Range of Motion of The Ball-and-Socket Joint, 2001 38 | 39 | rotation vector 40 | 41 | http://motion.pratt.duke.edu/RoboticSystems/3DRotations.html 42 | 43 | 旋转矩阵默认按列排列,即每列为新坐标系下的基向量 44 | 45 | **世界坐标系**(绝对旋转)与**自身坐标系**(相对旋转)。计算机械臂上的关节时,先计算末端(相对旋转),再计算父关节旋转,因为旋转父关节会改变子关节的自身坐标系 (TODO) 46 | 47 | 旋转矩阵 / 向量默认是相对于世界坐标系 $A_2A_1 = A_3$ 表示 $A_3$ 为先 $A_1$ 后 $A_2$ 两个世界坐标系旋转的复合 48 | 49 | 假如现在想保留 $A_1$ 为世界坐标系旋转(比如整个躯干的旋转),$A_2$ 则修改为相对旋转 $A_{21}$(比如手臂相对于躯干) 50 | 51 | $A_1A_{21} = A_3$ 52 | 53 | 相对旋转右乘(先执行),绝对旋转左乘(后执行),也即前面所说先末端后躯干 54 | 55 | 其它:https://www.yuque.com/yunyoujun/blog/quaternion-and-spatial-rotation 56 | 57 | ## 不同坐标系下的旋转矩阵转换 58 | 59 | 从 Blender, Unity 这些软件中导出相机参数时,往往和我们实际使用的坐标系或者相机默认位姿(比如 opencv)定义不同,需要进行转换 60 | 61 | 比较好的方法是使用 c2w 矩阵作为不同坐标系间的桥梁 62 | 63 | 对于一个 c2w 变换 64 | 65 | $$ 66 | \bf{T}_{\text{c2w}} = \begin{bmatrix} 67 | \bf{R} & \bf{t} \\ 68 | \bf{0} & 1 69 | \end{bmatrix} = \begin{bmatrix} 70 | x_1 & y_1 & z_1 & t_1 \\ 71 | x_2 & y_2 & z_2 & t_2 \\ 72 | x_3 & y_3 & z_3 & t_3 \\ 73 | 0 & 0 & 0 & 1 74 | \end{bmatrix} 75 | $$ 76 | 77 | - $\bf{t}$ 是相机中心在世界坐标系下的位置 78 | - $(x_1, y_1, z_1)$ 是相机坐标系的 $x$ 轴单位向量 $(1, 0, 0)$ 在世界坐标系下的对应方向 79 | - $(x_2, y_2, z_2)$ 对应 $y$ 轴方向 80 | - $(x_3, y_3, z_3)$ 对应 $z$ 轴方向 81 | 82 | 所以,如果能从 Blender 中获得相机在世界坐标系下的 位置 和你想使用的相机坐标系 3 个轴的方向,就可以直接构造出实际需要的 $\bf{T}_{\text{c2w}}$ 矩阵 83 | 84 | Unity 的左右手系问题另说 85 | 86 | ## Inverse Kinematics 87 | 88 | 正向运动学 (forward kinematics) 是已知运动模型(如机械臂,人体骨架)$\bf{M}$ 和关节角度 $\bf{\Theta}$(如欧拉角、轴角,或称旋转 $\bf{R}$),求解各末端执行器或人体关节的位置 $\bf{P}$ 89 | 90 | $$ 91 | \bf{P} = \text{FK}(\bf{R}, \bf{M}) 92 | $$ 93 | 94 | 逆向运动学 (inverse kinematics) 则是已知目标位置 $\bf{P}$,求解各关节角度 $\bf{\Theta}$ 95 | 96 | $$ 97 | \bf{R} = \text{IK}(\bf{P}, \bf{M}) 98 | $$ 99 | 100 | [HybrIK: A Hybrid Analytical-Neural Inverse Kinematics Solution for 3D Human Pose and Shape Estimation](https://openaccess.thecvf.com/content/CVPR2021/html/Li_HybrIK_A_Hybrid_Analytical-Neural_Inverse_Kinematics_Solution_for_3D_Human_CVPR_2021_paper.html) 101 | 102 | Numerical solutions 103 | 104 | e.g., [Introduction to Inverse Kinematics with Jacobian Transpose, Pseudoinverse and Damped Least Squares methods](https://mathweb.ucsd.edu/~sbuss/ResearchWeb/ikmethods/SdlsPaper.pdf) 105 | 106 | Heuristic methods 107 | 108 | e.g., [FABRIK: A fast, iterative solver for the Inverse Kinematics problem](https://www.sciencedirect.com/science/article/abs/pii/S1524070311000178) (humanoid) 109 | 110 | 先只考虑连杆结构,完整的迭代分两部分: 111 | 112 | - 一阶段,先将末端执行器「拉」到目标位置,沿着机械臂依次更新「拉扯」父节点,直到根节点; 113 | - 二阶段,此时大概率根节点位置已经被改变了,这不符合实际设定,于是需要重复前面所做的操作,只不过这次是从根节点开始更新至末端执行器。 114 | 115 | 对于人形骨架,则需要 hierarchically 使用上述方法 116 | 117 | ## Motion Retargeting 118 | 119 | ## Others 120 | 121 | - 视觉 SLAM 十四讲:从理论到实践 122 | 123 | - https://github.com/NVlabs/nvdiffrast 124 | 125 | - https://pyrender.readthedocs.io/en/latest/ 126 | 127 | - Multiple View Geometry in Computer Vision 128 | https://www.robots.ox.ac.uk/~vgg/hzbook/ 129 | 130 | - State Estimation for Robotics 131 | http://asrl.utias.utoronto.ca/~tdb/bib/barfoot_ser17.pdf 132 | -------------------------------------------------------------------------------- /docs/others/README.md: -------------------------------------------------------------------------------- 1 | # Others -------------------------------------------------------------------------------- /docs/others/causal-reasoning.md: -------------------------------------------------------------------------------- 1 | # 因果推断 2 | 3 | ::: callout 4 | 冰淇淋的销量与溺死的人数 5 | ::: 6 | 7 | ::: warning 8 | UNDER CONSTRUCTION 9 | ::: 10 | 11 | 辛普森悖论,[对撞因子](https://zh.wikipedia.org/wiki/%E5%B0%8D%E6%92%9E%E5%9B%A0%E5%AD%90) 12 | 13 | https://www.guokr.com/article/6222/ 14 | 15 | ## 阅读材料 16 | 17 | - [因果推断 | 统计之都](https://cosx.org/tags/%E5%9B%A0%E6%9E%9C%E6%8E%A8%E6%96%AD) 18 | - [因果关系是什么?结构因果模型入门 - 知乎专栏](https://zhuanlan.zhihu.com/p/33860572) 19 | - [Structural Causal Models (by Bruno Gonçalves)](https://medium.com/data-for-science/causal-inference-part-iv-structural-causal-models-df10a83be580) 20 | - [Invited Talk: Causal Learning (by Marloes Maathuis) - NeurIPS 2020](https://nips.cc/virtual/2020/public/invited_16169.html). ([PDF](https://stat.ethz.ch/~mmarloes/meetings/SlidesMaathuisNeurIPS2020.pdf)) 21 | -------------------------------------------------------------------------------- /docs/others/characters.md: -------------------------------------------------------------------------------- 1 | # 常用特殊字符 2 | 3 | ## 中文标点 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
「 」“ ”‘ ’
14 | 15 | 中文破折号使用「——」`U+2014`x2 或「」`U+2E3A`,使用思源黑体并设置 `lang=zh-CN` 16 | 17 | [不离不弃的破折号 — The Type](https://www.thetype.com/2019/03/14918/) 18 | 19 | ## Emoji 和符号 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
😂×🠖·
35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |
CharNameUnicodeLaTeXUsage
-hyphenU+2010-form a compound word (editor-in-chief)
en dashU+2013--connect symmetric items, such as two ends of a range (pages 101–181) and others (Kullback–Leibler divergence)
em dashU+2014---indicate a pause in a sentence,类似于中文破折号
horizontal barU+2015aka quotation dash
two-em dashU+2E3A
84 | 85 | 86 | 87 | ## Box-drawing Characters 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 |
120 | 121 |
root/
122 | ├── subfolder/
123 | │   └── submodule.py
124 | └── main.py
125 | 
126 | ┌─────┐
127 | │     │
128 | └─────┘
129 | -------------------------------------------------------------------------------- /docs/others/combinatorial-optimization.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 组合优化 3 | --- 4 | 5 |
6 | xkcd: Traveling Salesman Problem 7 |
8 | 9 | # 组合优化 (Combinatorial optimization) 10 | 11 | 12 | 13 | 简单来说,==组合优化==是指从一个**有限集合**中寻找**最优组合**(或**排列**)的问题(属于离散优化问题),比如 14 | 15 | ::: definition 背包问题 (Knapsack problem) 16 | 给定一组物品,每种物品都有其对应的重量和价格——基础集,ground set 17 | 在限定的总重量内              ——约束条件 18 | 如何选择一组物品使得总价值最高       ——优化目标 19 | ::: 20 | 21 | ::: definition 旅行商问题 (Traveling Salesman Problem, TSP) 22 | 给定一系列城市(以及两两之间的距离) 23 | 希望访问所有城市恰好一次并返回起点城市 24 | 找到满足条件的最短回路 25 | ::: 26 | 27 | ::: definition 车辆路径问题 (Vehicle Routing Problem, VRP) ——送快递 28 | 给定一个仓库和一系列客户的位置 29 | 从仓库出发经过所有客户的位置(期间可以返回仓库) 30 | 车辆(车队)的最短路线是什么 31 | 其中还需考虑约束条件:车辆的载重量有限 32 | ::: 33 | 34 | 组合优化问题的难点在于——随着问题规模增长,其可行解的数量呈指数增长,一般都是 **NP-hard** 35 | 36 | 以 TSP 为例 37 | 38 | ## 精确求解 39 | 40 | 既然是 **NP-hard** 问题,那就不存在多项式时间的解法,只能在暴力搜索 $O(n!)$ 的基础上尽量不那么暴力 41 | 42 | ### 分支定界 (branch and bound) 43 | 44 | 搜索树 + 剪枝(alpha-beta 剪枝就是分支定界法的一个特例) 45 | 46 | [Concorde TSP solver](https://www.math.uwaterloo.ca/tsp/concorde.html) 47 | cutting plane algorithm + branch and bound 48 | 49 | ### 动态规划 (dynamic programming) 50 | 51 | $O(2^n n^2)$ 52 | 53 | ## 近似求解 54 | 55 | LKH, Lin-Kernighan heuristic for k-opt moves 56 | 57 | GA-EAX evolutionary algorithm 58 | 59 | ### 近似算法 60 | 61 | 比如贪心算法、局部搜索、线性规划等 62 | 63 | 解的质量有保证 64 | 65 | ### 启发式算法 66 | 67 | 比如模拟退火、演化算法、粒子群算法等 68 | 69 | 可以在给定时间内找到较好的解 70 | 71 | ### 深度学习 72 | 73 | 监督学习:在固定的问题规模(城市数量)下效果较好,但在大规模情况下训练不实际 74 | 强化学习:能泛化使用到不同问题规模 75 | 76 | 代表工作 77 | 78 | - Oriol Vinyals et al. “Pointer Networks”. *NeurIPS*. 2015. 79 | - Irwan Bello et al. “Neural Combinatorial Optimization with Reinforcement Learning”. *ICLR workshop*. 2017. 80 | - Wouter Kool et al. “Attention, Learn to Solve Routing Problems!” *ICLR*. 2019. 81 | 82 | 其它 83 | 84 | [Information, Computation, Optimization: Connecting the Dots in the Traveling Salesman Problem](https://youtu.be/q8nQTNvCrjE) 85 | -------------------------------------------------------------------------------- /docs/others/cryptography.md: -------------------------------------------------------------------------------- 1 | # 密码学 (Cryptography) 2 | 3 | > 密码学是关于如何在敌人存在的环境中通信 4 | > Ronald Linn Rivest 5 | 6 | ## 对称加密 7 | 8 | ## 非对称加密 9 | 10 | ### RSA 11 | 12 | 注意公钥与私钥的地位对等 13 | 14 | **数字签名** 15 | 16 | 思考:为什么先对明文哈希再签名(貌似最后只是实践上的原因) 17 | 18 | **中间人攻击与 CA** 19 | 20 | **SSL** 21 | -------------------------------------------------------------------------------- /docs/others/dynamic-programming.md: -------------------------------------------------------------------------------- 1 | # 动态规划 2 | 3 | https://leetcode-cn.com/problems/predict-the-winner 4 | -------------------------------------------------------------------------------- /docs/others/floating-point-number.md: -------------------------------------------------------------------------------- 1 | # 浮点数 2 | 3 | 相对定点数 4 | 5 | https://www.zhihu.com/question/19848808 6 | https://zhuanlan.zhihu.com/p/28162086 7 | https://zhuanlan.zhihu.com/p/58731780 8 | 9 | ![](https://upload.wikimedia.org/wikipedia/commons/b/b6/FloatingPointPrecisionAugmented.png) 10 | -------------------------------------------------------------------------------- /docs/others/genetics.md: -------------------------------------------------------------------------------- 1 | # 遗传学知识回顾 (genetics) 2 | 3 | ## 基本概念 4 | 5 | - ==染色体==,**chromosome**,由一个长链 DNA 分子和被称为**组蛋白 (histone)** 的蛋白质构成 6 | - ==DNA==,脱氧核糖核酸,由核苷酸构成的双链分子 7 | - ==基因==,**gene**,**具有遗传效应(编码蛋白质)的** DNA 或 RNA **片段**,每个 DNA 分子包含**许多个**基因 8 | - **基因**包含==编码区==和==非编码区==,启动子位于非编码区 9 | - **编码区**又分为==外显子==和==内含子==,内含子又是非编码序列(*有待考证*) 10 | - ==基因组==,**genome**,指包含在该生物的 DNA(部分病毒是 RNA)中的全部遗传信息,即其完整的 DNA 序列,包括基因和非编码 DNA 11 | 12 | --- 13 | 14 | - ==顺式作用原件==,**cis-regulatory element**,位于基因的旁侧,是可以调控**其旁侧基因**表达的**非编码 DNA 序列**,包括启动子 (promoter)、增强子、应答元件等; 15 | - 通过与转录因子 (transcription factor) 结合来调控基因; 16 | - cis 表示 "on this side",即和被调控的基因在同一个 DNA 分子上 17 | - ==增强子==,**enhancer**,increase the likelihood that transcription of a particular gene will occur 18 | - ==反式作用原件==,**trans-regulatory element**,是可以调控**别的基因**表达的**基因** 19 | - 更具体一点,就是编码转录因子的基因 20 | - cis-regulatory 有时也叫 **cis-acting**,cis-regulation;trans-regulatory 同样 21 | 22 | --- 23 | 24 | - ==in vivo==,in the living,在活体内(进行于活体内的实验) 25 | - ==in vitro==,in the glass,在玻璃里(进行于试管内 / 活体外的实验) 26 | - ==ChIP-seq==,chromatin immunoprecipitation (ChIP) + massively parallel DNA sequencing TODO 27 | 28 | --- 29 | 30 | ==中心法则==:DNA 制造 RNA,RNA 制造蛋白质,蛋白质反过来协助前两项流程,并协助 DNA 自我复制 31 | 32 | - DNA → RNA,==转录== (transcription) 33 | - RNA → 蛋白质,==翻译== (translation) 34 | - DNA → DNA,==DNA 复制== 35 | 36 |
37 | Central dogma of molecular biology 38 |
Central dogma of molecular biology (source: Wiki)
39 |
40 | 41 | ## 转录 (Transcription) 42 | 43 |
44 | 45 |
Overview of transcription (source: Khan Academy)
46 |
47 | 48 |
49 | Transcription 50 |
Transcription (source: Wiki)
51 |
52 | 53 | - ==转录因子==,**transcription factor**,是指能够结合在某基因上游特异核苷酸序列(如启动子,增强子)上的**蛋白质**,这些蛋白质能调控该基因的转录 54 | - 真核生物的 RNA 可以进一步被处理,可能包括**聚腺苷酸化**,==端帽==和==剪接== 55 | 56 | 详见 [Wiki](https://en.wikipedia.org/wiki/Transcription_%28biology%29) 57 | 58 | ## 可变剪接 (Alternative Splicing) 59 | 60 | During the process of **pre-mRNA → mature mRNA** 61 | Particular exons of a gene may be *included* or *excluded* under particular conditions (e.g. in particular tissues) 62 | 63 | There are numerous modes of alternative splicing observed, of which the most common is **exon skipping** 64 | 65 |
66 | DNA alternative splicing (from Wiki) 67 |
68 | 69 | 详见 [Wiki](https://en.wikipedia.org/wiki/Alternative_splicing) 70 | 71 | ## More 72 | 73 | [Gene expression and regulation - Khan Academy](https://www.khanacademy.org/science/ap-biology/gene-expression-and-regulation) 74 | -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150312-230444.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150312-230444.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150526-234304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150526-234304.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150527-172004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150527-172004.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150614-194300.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150614-194300.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150629-001837.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150629-001837.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20150901-165912.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20150901-165912.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20151123-090055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20151123-090055.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20151128-235627.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20151128-235627.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20151222-095516.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20151222-095516.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20160104-161801.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20160104-161801.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/20160121-181647.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/20160121-181647.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2015/changelog-backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/changelog-backup.png -------------------------------------------------------------------------------- /docs/others/imgs/2015/changelog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2015/changelog.png -------------------------------------------------------------------------------- /docs/others/imgs/2018/20180830-111949.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20180830-111949.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20180901-132743.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20180901-132743.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20180906-122650.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20180906-122650.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20180910-123816.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20180910-123816.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20180925-114313.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20180925-114313.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181020-114728.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181020-114728.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181020-115923.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181020-115923.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181020-150126.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181020-150126.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181021-101119.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181021-101119.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181021-133042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181021-133042.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181023-181317.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181023-181317.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181124-121314.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181124-121314.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181124-151018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181124-151018.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181125-103302.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181125-103302.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181125-104532.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181125-104532.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181125-124045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181125-124045.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181125-132247.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181125-132247.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181204-130306.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181204-130306.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181204-133632.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181204-133632.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181219-175502.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181219-175502.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181220-170001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181220-170001.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181221-122116.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181221-122116.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181222-162931.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181222-162931.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181224-202756.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181224-202756.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181226-160802.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181226-160802.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181227-115309.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181227-115309.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181227-150852.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181227-150852.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181227-155828.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181227-155828.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181228-143239.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181228-143239.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181229-145516.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181229-145516.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181229-150540.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181229-150540.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181229-151231.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181229-151231.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20181231-235949.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20181231-235949.webm -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190101-144141.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190101-144141.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190102-125535.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190102-125535.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190123-180838.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190123-180838.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190518-190812.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190518-190812.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190524-214049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190524-214049.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190524-220412.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190524-220412.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-093747.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-093747.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-094000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-094000.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-100000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-100000.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-100955.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-100955.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-173032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-173032.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190525-230040.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190525-230040.webm -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190526-115403.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190526-115403.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190526-115608.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190526-115608.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190526-155438.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190526-155438.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190526-162316.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190526-162316.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190712-175121.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190712-175121.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190726-130100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190726-130100.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190801-133824.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190801-133824.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190817-125015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190817-125015.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190820-182111.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190820-182111.jpg -------------------------------------------------------------------------------- /docs/others/imgs/2018/20190830-081810.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/2018/20190830-081810.jpg -------------------------------------------------------------------------------- /docs/others/imgs/alpha-beta-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/alpha-beta-example.png -------------------------------------------------------------------------------- /docs/others/imgs/alpha-beta-general-case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/alpha-beta-general-case.png -------------------------------------------------------------------------------- /docs/others/imgs/covid.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/covid.jpg -------------------------------------------------------------------------------- /docs/others/imgs/doctor-strange.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/doctor-strange.jpg -------------------------------------------------------------------------------- /docs/others/imgs/game-tree.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/game-tree.webp -------------------------------------------------------------------------------- /docs/others/imgs/glasses/ears-position.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/glasses/ears-position.jpg -------------------------------------------------------------------------------- /docs/others/imgs/glasses/ears2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/glasses/ears2.jpg -------------------------------------------------------------------------------- /docs/others/imgs/good-guy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/good-guy.webp -------------------------------------------------------------------------------- /docs/others/imgs/interesting/celeste.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/celeste.webp -------------------------------------------------------------------------------- /docs/others/imgs/interesting/dev-doodles-sylas.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/dev-doodles-sylas.webp -------------------------------------------------------------------------------- /docs/others/imgs/interesting/dontstarve.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/dontstarve.webp -------------------------------------------------------------------------------- /docs/others/imgs/interesting/genshin-ost-bts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/genshin-ost-bts.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/kda-dance-bts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/kda-dance-bts.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/kda-music-video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/kda-music-video.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/lol-a-new-dawn-bts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/lol-a-new-dawn-bts.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/lol-a-new-dawn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/lol-a-new-dawn.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/lol-divine-sword-irelia.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/lol-divine-sword-irelia.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/lol-immortal-journey-talon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/lol-immortal-journey-talon.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/mc-canon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/mc-canon.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/mc-redstone-computer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/mc-redstone-computer.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/mc-the-peach-blossom-spring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/mc-the-peach-blossom-spring.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/nier-automata-ost-origin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/nier-automata-ost-origin.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/nier-automata-ost.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/nier-automata-ost.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/ori-blind-forest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/ori-blind-forest.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/photography-challenge.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/photography-challenge.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/pipa-liudehai.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/pipa-liudehai.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/professional.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/professional.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/project-vayne.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/project-vayne.gif -------------------------------------------------------------------------------- /docs/others/imgs/interesting/singer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/singer.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/typography.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/typography.jpg -------------------------------------------------------------------------------- /docs/others/imgs/interesting/vision-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/vision-flow.png -------------------------------------------------------------------------------- /docs/others/imgs/interesting/wswx.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/interesting/wswx.webp -------------------------------------------------------------------------------- /docs/others/imgs/misc/2020-11-30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/misc/2020-11-30.png -------------------------------------------------------------------------------- /docs/others/imgs/misc/2020-12-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/misc/2020-12-06.png -------------------------------------------------------------------------------- /docs/others/imgs/misc/2021-01-19-2333.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/misc/2021-01-19-2333.png -------------------------------------------------------------------------------- /docs/others/imgs/misc/2021-03-10-0K.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/misc/2021-03-10-0K.png -------------------------------------------------------------------------------- /docs/others/imgs/misc/2021-05-26-vscode-pets.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/misc/2021-05-26-vscode-pets.gif -------------------------------------------------------------------------------- /docs/others/imgs/review/find+.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/review/find+.png -------------------------------------------------------------------------------- /docs/others/imgs/review/nips.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/review/nips.png -------------------------------------------------------------------------------- /docs/others/imgs/whatif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/whatif.png -------------------------------------------------------------------------------- /docs/others/imgs/xkcd-tsp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/others/imgs/xkcd-tsp.png -------------------------------------------------------------------------------- /docs/others/literature-review-the-hard-way.md: -------------------------------------------------------------------------------- 1 | # Literature Review the Hard Way 2 | 3 | 寻找和自己领域相关的文章应该算是个永恒的需求了,不论是为了文献调研还是为了追踪每年会议期刊新发表的大量论文。 4 | 5 | ## 顺藤摸瓜式 6 | 7 | 从本质上说这无非是一个**搜索问题**,最常见的方式即为:从一些 seed 文章开始,定位到其中 related work 部分,顺藤摸瓜找到更多的文章。其中挑选 seed 文章有如下偏好: 8 | 9 | - 如果有现成的综述文章当然好 10 | - 时间上最近的文章比旧的文章好 11 | 12 | ## Brute-force 13 | 14 | 但是——如果想搜索的关键词很宽泛,或者某领域还未 well-defined,那还可以考虑一下暴力搜索。为了不那么暴力,还需要下面两个工具: 15 | 16 | - [**dblp**](https://dblp.uni-trier.de/) **计算机文献数据库** 17 | 18 | 它最好的地方在于把各个会议期刊的论文列表都整理出来了,并且是一个个完整的页面(不分页或者懒加载),便于一次性查找关键词 19 | 20 | dblp 21 | 22 | - [**find+**](https://chrome.google.com/webstore/detail/find%20-regex-find-in-page/fddffkdncgkkdjobemgbpojjeffmmofb?hl=en) **正则搜索与高亮**(Chrome 插件) 23 | 24 | 然后就可以使用 `(keyword1|keyword2|...)` 的正则表达式搜索啦。搜索出结果之后再点 Persistent Highlights(建议不要在搜索之前开启),就可以粗筛出可能感兴趣的文章了 25 | 26 | find+ 27 | 28 | 先列出自己关注的顶会顶刊,再搜集一些关键字,就可以挨个搜索了。热门的领域每年产出的文章数量还是很多的,工作量不小,之后就是漫长的读论文时间了。 29 | -------------------------------------------------------------------------------- /docs/others/map.md: -------------------------------------------------------------------------------- 1 | # Mean Average Precision (mAP) 2 | 3 | ::: warning 4 | UNDER CONSTRUCTION 5 | ::: 6 | 7 | ## 参考材料 8 | 9 | - [Breaking Down Mean Average Precision (mAP) - Ren Jie Tan - Medium](https://towardsdatascience.com/breaking-down-mean-average-precision-map-ae462f623a52) 10 | -------------------------------------------------------------------------------- /docs/others/misc.md: -------------------------------------------------------------------------------- 1 | # 无题 2 | 3 | ### 2021.05.26 4 | 5 |
6 | 7 |
VS Code Pets
8 |
9 | 10 | ### 2021.03.10 11 | 12 |
13 | 14 |
15 | 16 | ### 2021.01.19 17 | 18 |
19 | 20 |
21 | 22 | ### 2020.12.07 23 | 24 | > No code is the best way to write secure and reliable applications. Write nothing; deploy nowhere. 25 | > 26 | > [No Code](https://marketplace.visualstudio.com/items?itemName=writenothing.no-code) - VS Code Marketplace - **5,825,050** installs (in 4 days) 27 | > Trivia: Markdown All in One has 1,981,617 installs. 28 | 29 | ### 2020.12.06 30 | 31 |
32 | 33 |
34 | 35 | ### 2020.11.30 36 | 37 |
38 | 39 |
40 | 41 | 2021-11-20 注:如今已知能分解的最大质数为 143(即 11 乘以 13),20 年前是 15。 42 | Vandersypen, L., Steffen, M., Breyta, G. et al. “Experimental realization of Shor's quantum factoring algorithm using nuclear magnetic resonance”. *Nature* 414, 883–887 (2001). 43 | -------------------------------------------------------------------------------- /docs/others/tmp.md: -------------------------------------------------------------------------------- 1 | # TMP 2 | 3 | ## Kalman Filter 4 | 5 | https://www.kalmanfilter.net/default.aspx 6 | 7 | 如何通俗并尽可能详细地解释卡尔曼滤波? - 米开朗基罗赵的回答 - 知乎 8 | https://www.zhihu.com/question/23971601/answer/375355599 9 | 10 | Python 示例 11 | https://www.delftstack.com/howto/python/opencv-kalman-filter/ 12 | 13 | OpenCV usage tip 14 | https://stackoverflow.com/a/51328346/8682688 15 | 16 | ## 3D model 17 | 18 | **rigging** and **skinning** 19 | -------------------------------------------------------------------------------- /docs/others/workout.md: -------------------------------------------------------------------------------- 1 | # 健身知识 2 | 3 | > **给训练入门者一个诚心诚意的忠告:** 4 | > 5 | >   放弃大多数小肌群训练,从今天起,每天做一次大肌群训练(胸、背、臀、腿)6\~10 组,搭配核心肌群训练(腹部、下背部)1\~3 组,最后做 HIIT(高强度间歇训练)15 到 30 分钟。不到半年,你就会惊喜地看到自己的改变。到那时,你一开始担心的小问题,可能也就随风而逝了。 6 | >   健康、塑形、减脂、撑衣……一切从大肌群训练开始。抓大放小,才是增肌或减脂运动入门时的王道。 7 | > 8 | > ⸺《硬派健身》 9 | 10 | ## 肌肉酸痛 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/programming/README.md: -------------------------------------------------------------------------------- 1 | # Programming -------------------------------------------------------------------------------- /docs/programming/imgs/nicematrix-basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/imgs/nicematrix-basic.png -------------------------------------------------------------------------------- /docs/programming/imgs/nicematrix-border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/imgs/nicematrix-border.png -------------------------------------------------------------------------------- /docs/programming/imgs/nicematrix-colorcell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/imgs/nicematrix-colorcell.png -------------------------------------------------------------------------------- /docs/programming/imgs/nicematrix-colwidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/imgs/nicematrix-colwidth.png -------------------------------------------------------------------------------- /docs/programming/imgs/nicematrix-tabularnote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/imgs/nicematrix-tabularnote.png -------------------------------------------------------------------------------- /docs/programming/latex-nicematrix.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: nicematrix 3 | --- 4 | 5 | # 好用的 LaTeX 表格:`nicematrix` 包 6 | 7 | ::: tip CTAN 链接 8 | 9 | ::: 10 | 11 | ## 基本用法 12 | 13 | ```latex 14 | \usepackage{nicematrix} 15 | ``` 16 | 17 | 使用 `\Block` 创建单元格,可跨行、跨列、换行,还有可选参数比如 `l`,`c`,`r`(横向对齐),`fill`,`draw`(颜色)等等。 18 | 19 | ```latex {2} 20 | \begin{NiceTabular}{ccc}[hvlines] 21 | & \Block{1-2}{Multi-column} \\ 22 | \Block{2-1}{Multi-row} & John & Steph \\ 23 | & Sarah & \Block{}{A line\\ break} \\ 24 | \end{NiceTabular} 25 | ``` 26 | 27 |
28 | basic 29 |
30 | 31 | ## 表格脚注 32 | 33 | ```latex 34 | \usepackage{enumitem} % 依赖 35 | \usepackage{booktabs} % \toprule etc. 36 | ``` 37 | 38 | ```latex {6} 39 | \begin{NiceTabular}{llr} 40 | \toprule 41 | \RowStyle[bold]{} 42 | Last name & First name & Birth day \\ 43 | \midrule 44 | Achard\tabularnote{A note.} 45 | & Jacques & 5 juin 1962 \\ 46 | Lefebvre\tabularnote{Another note.} 47 | & Mathilde & 23 mai 1988 \\ 48 | Vanesse & Stephany & 30 octobre 1994 \\ 49 | Dupont & Chantal & 15 janvier 1998 \\ 50 | \bottomrule 51 | \end{NiceTabular} 52 | ``` 53 | 54 |
55 | tabularnote 56 |
57 | 58 | ### 脚注编号 59 | 60 | 可以修改 `notes/style` 选项使用数字编号(默认为 `\textit{\alph{#1}}`) 61 | 62 | ```latex {2} 63 | \begin{table}[!t] 64 | \NiceMatrixOptions{notes/style=\arabic{#1}} 65 | \begin{NiceTabular}{llr} 66 | ... 67 | \end{NiceTabular} 68 | \end{table} 69 | ``` 70 | 71 | ::: tip 72 | 命令 `\NiceMatrixOptions` 的作用域是当前 TeX Group,即 `{...}` 和 `\begin...\end`。在 preamble 中则为全局设置。 73 | 74 | 也可使用如下层级语法 75 | 76 | ```latex 77 | \NiceMatrixOptions{ 78 | notes={ 79 | style = \arabic{#1}, 80 | label-in-tabular = ..., 81 | ... 82 | } 83 | } 84 | ``` 85 | ::: 86 | 87 | ## 行样式 88 | 89 | 使用 `\RowStyle[optional args]{args}` 改变当前行的样式 90 | 91 | 可选参数包括 `nb-rows`,`rowcolor`,`color`,`bold` 等 92 | 样式参数比如 `\rotate`,`\bfseries`,`\sffamily` 93 | 94 | ```latex {3,5} 95 | \begin{NiceTabular}{cccc} 96 | \hline 97 | \RowStyle[cell-space-limits=3pt]{\rotate} 98 | first & second & third & fourth \\ 99 | \RowStyle[nb-rows=2,rowcolor=blue!50,color=white]{\sffamily} 100 | 1 & 2 & 3 & 4 \\ 101 | I & II & III & IV 102 | \end{NiceTabular} 103 | ``` 104 | 105 | ## 列宽度 106 | 107 | 可以使用 `array` 包中的 `w/W/p/b/m` 列样式 108 | 109 | ```latex 110 | \begin{NiceTabular}{m[l]{2cm}m[c]{2cm}m[r]{2cm}}[hvlines] 111 | some very long text & center & some very very very very long text \\ 112 | left & some very very very long text & right 113 | \end{NiceTabular} 114 | ``` 115 | 116 |
117 | column width 118 |
119 | 120 | ## 单元格背景色 121 | 122 | ```latex {3,4} 123 | \begin{NiceTabular}{ccc}[hvlines] 124 | \CodeBefore 125 | \cellcolor{yellow!25}{1-1,1-3} 126 | \rectanglecolor{blue!15}{2-2}{3-3} 127 | \Body 128 | a & b & c \\ 129 | e & f & g \\ 130 | h & i & j \\ 131 | \end{NiceTabular} 132 | ``` 133 | 134 |
135 | colorcell 136 |
137 | 138 | ## 边框 139 | 140 | ```latex 141 | \NiceMatrixOptions{cell-space-top-limit=3pt} 142 | \begin{NiceTabular}{*{6}{c}}[corners,hvlines] 143 | & & & & A \\ 144 | & & A & A & A \\ 145 | & & & A \\ 146 | & & A & A & A & A \\ 147 | A & A & A & A & A & A \\ 148 | A & A & A & A & A & A \\ 149 | & A & A & A \\ 150 | & \Block{2-2}{B} & & A \\ 151 | & & & A \\ 152 | \end{NiceTabular} 153 | ``` 154 | 155 |
156 | border 157 |
158 | -------------------------------------------------------------------------------- /docs/programming/python/cuda-oom.md: -------------------------------------------------------------------------------- 1 | # CUDA Out of Memory 2 | 3 | 一般直接使用 PyTorch 提供的快照功能 4 | 5 | 6 | 7 | ```python 8 | # enable memory history, which will add tracebacks and event history to snapshots 9 | torch.cuda.memory._record_memory_history() 10 | 11 | run_your_code() 12 | torch.cuda.memory._dump_snapshot("my_snapshot.pickle") 13 | ``` 14 | 15 | 16 | 17 | --- 18 | 19 | 其它方法: 20 | 21 | 一般来说肯定是程序里显存泄露了,可以先查找残留的无法释放的 tensor 22 | 23 | ```python 24 | import gc 25 | import torch 26 | 27 | gc.collect() 28 | 29 | # 获取所有残留的 Tensor 30 | leaked_tensors = [obj for obj in gc.get_objects() if isinstance(obj, torch.Tensor)] 31 | 32 | # 打印详细信息 33 | for tensor in leaked_tensors: 34 | print(f"Shape: {tensor.shape} | Device: {tensor.device} | Size: {tensor.element_size() * tensor.nelement() / 1024**2:.2f} MB") 35 | ``` 36 | 37 | 观察是否有比较大的 tensor。此外还可以查询其引用信息 38 | 39 | ```python 40 | for tensor in leaked_tensors: 41 | print(f"\nTensor 形状: {tensor.shape}, 设备: {tensor.device}") 42 | 43 | # 获取所有直接引用该 Tensor 的对象 44 | referrers = gc.get_referrers(tensor) 45 | print(f"引用者数量: {len(referrers)}") 46 | 47 | # 打印引用者的类型和关键信息 48 | for ref in referrers: 49 | if isinstance(ref, (list, dict, tuple)): 50 | print(f"引用者类型: {type(ref)}, 内容片段: {str(ref)[:100]}...") 51 | else: 52 | print(f"引用者类型: {type(ref)}") 53 | # 如果是自定义对象,尝试获取其属性名 54 | if hasattr(ref, "__dict__"): 55 | print(f"对象属性: {vars(ref)}") 56 | ``` 57 | 58 | 到这一步之后如果还是不太容易看出残留的引用关系,可以使用 `objgraph` 库来可视化(非常好用),需要安装 [Graphviz](https://graphviz.org/)(命令行里能调用 `dot` 可执行文件),核心用法只有一行 59 | 60 | ```python 61 | objgraph.show_backrefs(obj, filename="backrefs.png") 62 | ``` 63 | 64 | 可以调整 `max_depth`,`too_many` 参数来控制可视化的详细程度 65 | 66 | --- 67 | 68 | 有时发现单独执行 `torch.cuda.empty_cache()` 并不能释放显存,但是先执行 `gc.collect()` 之后再执行 `empty_cache()` 又发现的确有显存可以释放。对此 DeepSeek 的解释为 69 | 70 | > 1. **​Python 对象层**​​(由 GC 管理) 71 | > - 当 Python 中 `torch.Tensor` 对象的引用计数归零时,**​​仅标记**​​底层显存可回收 72 | > - 但 Python 的垃圾回收器(GC)可能未及时运行,导致对象未真正销毁 73 | > 2. **CUDA 缓存层**​​(由 PyTorch 管理) 74 | > - `empty_cache()` 只能释放**​​已被 Python 标记为可回收**​​的显存 75 | > - 如果 Python 对象未销毁,PyTorch 无法感知这些显存可释放 76 | -------------------------------------------------------------------------------- /docs/programming/python/cuda.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: CUDA 3 | --- 4 | 5 | # 加速计算基础──CUDA Python 编程 6 | 7 | ::: callout 💡 某程序员遇到了一个问题,打算用并行来解决它──于是现他在有个两问题了。 8 | ::: 9 | 10 | 本文大部分内容来自 NVIDIA Deep Learning Institute 11 | 12 | ## Numba 简介 13 | 14 | > Numba 是一个**支持类型特化**的**即时** **函数编译器**,用于为 CPU 或 GPU 加速**以数字计算为主的** Python 函数。此定义很长,下面就让我们逐一解析这些术语: 15 | > 16 | > - **函数编译器**:Numba 用于编译 Python 函数,而非整个应用程序,亦不定义函数。Numba 不会取代 Python 解释器,而仅作为另一个 Python 模块,将普通函数转化为执行速度更快的函数(通常情况下)。 17 | > - **类型特化**:Numba 可为您当前使用的特定数据类型生成专门的执行代码,从而加速函数运行。Python 函数专为处理通用数据类型而设计,这为其带来了极大的灵活性,但也严重拖慢了运行速度。实际上,您只需调用具有少量参数类型的函数,即可让 Numba 为每个类型组生成快速执行代码。 18 | > - **即时**:Numba 在函数首次被调用时即会开始编译函数。确保编译器了解您将使用的参数类型。此特性还支持在 Jupyter Notebook 中以交互方式使用 Numba,正如使用传统应用程序一样简单。 19 | > - **以数字计算为主**:Numba 目前以处理基本数据类型为主,如 `int`、`float` 和 `complex`。字符串处理支持极为受限,且许多字符串处理函数还无法在 GPU 上获得有效加速。若要借助 Numba 获得最佳加速效果,您可能需要搭配使用 NumPy 数组。 20 | 21 | CUDA 编程方式包括 22 | 23 | - **CUDA C/C++**(最高效、灵活) 24 | - **PyCUDA**(完全对接 CUDA C/C++,性能次佳,不过需编写 C 代码,通常还要修改 Python 代码) 25 | - **Numba**(Python 最友好,也能为 CPU 加速) 26 | 27 | `@jit` `@njit` 加速 CPU(实时编译成机器码) 28 | 29 | `@vectorize`(GPU 并行,ufunc) 30 | 31 | ::: tip Best Practice 32 | 尽量减少 CPU (Host) 和 GPU (Device) 间的数据传输,即便中途遇到在 GPU 上并不比在 CPU 上运行快的函数,也需遵照此规则 33 | 34 | [CUDA Best Practices Guide](https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html) 35 | ::: 36 | 37 | `@cuda.jit` 38 | 39 | `cuda.to_device` `copy_to_host()` 40 | 41 | ## 自定义 CUDA 核函数 42 | 43 | ### 线程结构 44 | 45 | - ==Thread==,GPU 工作的最小单元 46 | - ==Block==,由多个 thread 组成,拥有**共享内存** 47 | - ==Grid==,由多个 block 组成,是 GPU 上的函数(即核函数)执行的单元 48 | 49 |
50 | Grid of thread blocks 51 |
Thread hierarchy. source
52 |
53 | 54 | `cuda.gird` 55 | 56 | `cuda.gridsize` 57 | 58 | 练习:使用网格跨度 (stride) 处理超大数据集 59 | 60 | ### 原子操作 61 | 62 | `cuda.atomic.*` 63 | 64 | ## CUDA 多维网格与共享内存 65 | 66 | 练习:矩阵转置与矩阵乘法 67 | 68 | …… 69 | 70 | ## 😎 71 | 72 |
73 | cuda certificate 74 |
75 | -------------------------------------------------------------------------------- /docs/programming/python/imgs/cuda-certificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/python/imgs/cuda-certificate.png -------------------------------------------------------------------------------- /docs/programming/python/imgs/grid-of-thread-blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/python/imgs/grid-of-thread-blocks.png -------------------------------------------------------------------------------- /docs/programming/python/imgs/mpl/fig-vs-axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/python/imgs/mpl/fig-vs-axes.png -------------------------------------------------------------------------------- /docs/programming/python/imgs/mpl/sharedxylabel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/python/imgs/mpl/sharedxylabel.png -------------------------------------------------------------------------------- /docs/programming/python/jupyter-notebooks.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/programming/python/jupyter-notebooks.zip -------------------------------------------------------------------------------- /docs/programming/python/logging.md: -------------------------------------------------------------------------------- 1 | # Logging 2 | 3 | ## 基本使用 4 | 5 | ```python 6 | import logging 7 | 8 | logging_level = logging.DEBUG 9 | fmt = "%(asctime)s [%(levelname)-5.5s] [%(name)s] %(message)s" 10 | logging_formatter = logging.Formatter(fmt) 11 | 12 | logger = logging.getLogger(__name__) 13 | logger.setLevel(logging_level) 14 | 15 | ## add a default (console) handler 16 | ## otherwise you cannot change the default STDOUT logging level/formatter 17 | handler = logging.StreamHandler() 18 | handler.setLevel(logging_level) 19 | handler.setFormatter(logging_formatter) 20 | logger.addHandler(handler) 21 | 22 | # ## file handler 23 | # handler = logging.FileHandler(filename, encoding="utf-8") 24 | # handler.setLevel(logging_level) 25 | # handler.setFormatter(logging_formatter) 26 | # logger.addHandler(handler) 27 | 28 | logger.debug("...") 29 | logger.error("...") 30 | ... 31 | ``` 32 | 33 | ## 给不同日志等级设置不同的颜色 34 | 35 | ```python {18,31} 36 | import re 37 | from platform import system 38 | 39 | def _add_ansi_color(msg, level): 40 | if level >= 40: ## ERROR (red) 41 | color = "31" 42 | elif level >= 30: ## WARNING (yellow) 43 | color = "33" 44 | elif level >= 20: ## INFO (normal) 45 | color = "0" 46 | else: ## DEBUG (dim) 47 | color = "2" 48 | return f"\x1b[{color}m{msg}\x1b[0m" 49 | 50 | def stream_handler_emit(self: logging.StreamHandler, record: logging.LogRecord): 51 | try: 52 | msg = self.format(record) 53 | msg = _add_ansi_color(msg, record.levelno) 54 | self.stream.write(msg + self.terminator) 55 | self.flush() 56 | except RecursionError: 57 | raise 58 | except Exception: 59 | self.handleError(record) 60 | 61 | def file_handler_emit(self: logging.FileHandler, record: logging.LogRecord): 62 | if self.stream is None: 63 | self.stream = self._open() 64 | try: 65 | msg = self.format(record) 66 | msg = re.sub(r"\x1b\[\d+m", "", msg) 67 | self.stream.write(msg + self.terminator) 68 | self.flush() 69 | except RecursionError: 70 | raise 71 | except Exception: 72 | self.handleError(record) 73 | 74 | if system() == "Windows": 75 | # raise NotImplementedError("TODO: test compatibility on Windows") 76 | pass 77 | else: 78 | logging.StreamHandler.emit = stream_handler_emit 79 | logging.FileHandler.emit = file_handler_emit 80 | ``` 81 | 82 | ## 避免第三方库的日志污染 83 | 84 | 有时偷懒直接将全局 logging level 设为 DEBUG,然而发现导入的第三方库(比如 `asyncio`)也把日志打印出来了,解决方法如下 85 | 86 | ```python {4} 87 | import asyncio 88 | 89 | logging.basicConfig(level=logging.DEBUG, format=fmt) 90 | logging.getLogger("asyncio").setLevel(logging.WARNING) 91 | ``` 92 | 93 | 其中具体的 logger 名称可以在 `logging.Logger.manager.loggerDict` 中查看 94 | 95 | ## 多进程下保存日志的一种方法 96 | 97 | 保存日志到自定义 stream,可以在使用多进程时分别保存各子进程的日志,注意 logger 应该在子进程中创建 98 | 99 | ```python {4} 100 | logger = logging.getLogger("name") 101 | logger.setLevel(loglevel) 102 | 103 | log_stream = io.StringIO() 104 | handler = logging.StreamHandler(log_stream) 105 | handler.setLevel(loglevel) 106 | handler.setFormatter(logging.Formatter(fmt)) 107 | logger.addHandler(handler) 108 | logger.propagate = False 109 | 110 | logger.debug("...") 111 | ... 112 | 113 | print(log_stream.getvalue().strip()) 114 | ``` 115 | -------------------------------------------------------------------------------- /docs/programming/python/miniconda.md: -------------------------------------------------------------------------------- 1 | # Miniconda 2 | 3 | ## 环境变量 4 | 5 | 有时在 Windows 上安装完之后[环境变量](https://support.microsoft.com/zh-cn/topic/%E5%A6%82%E4%BD%95%E7%AE%A1%E7%90%86-windows-xp-%E4%B8%AD%E7%9A%84%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F-5bf6725b-655e-151c-0b55-9a8c9c7f747d)并没有被设置好,需要手动在 `PATH` 中加入 6 | 7 | ``` 8 | %USERPROFILE%\miniconda3 9 | %USERPROFILE%\miniconda3\Library\bin 10 | %USERPROFILE%\miniconda3\Scripts 11 | ``` 12 | 13 | 重新打开命令行,然后执行 14 | 15 | ``` 16 | conda init 17 | ``` 18 | 19 | 对于 PowerShell,还需以管理员权限执行 20 | 21 | ```powershell 22 | set-executionpolicy remotesigned 23 | ``` 24 | 25 | 以允许在启动时运行 conda 初始化脚本 26 | 27 | --- 28 | 29 | 有时 conda 已经事先在机器上(比如在 bash 下)装好了,后来切换到 zsh 可能就会 `conda not found`,其实很可能是从其它机器复制过来的 `.zshrc` 里的 conda 路径不匹配了 30 | 31 | 图方便可以找到 conda 安装目录执行 32 | 33 | ```shell 34 | # cd ~/miniconda3/bin 35 | ./conda init zsh 36 | ``` 37 | 38 | ### conda 镜像 39 | 40 | [SUSTech Anaconda Mirror](https://mirrors.sustech.edu.cn/help/anaconda.html) 41 | 42 | ## 常用包 43 | 44 | ``` 45 | scipy numpy pandas matplotlib scikit-learn notebook 46 | ``` 47 | 48 | ## Managing environments 49 | 50 | ```shelldoc 51 | # Create an environment 52 | # Notation: [optional argument] 53 | # `-n` is short for `--name` 54 | conda create -n [python=3.6] [--clone ] 55 | conda env list 56 | conda activate 57 | conda env remove -n 58 | ``` 59 | 60 | See [Manage environments — conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) 61 | 62 | ## Managing packages 63 | 64 | ```shelldoc 65 | conda search ## search for available packages 66 | conda install 67 | conda list [regex] [-n ] ## list packages in, by default, the current environment 68 | conda remove 69 | ``` 70 | 71 | For comparison 72 | 73 | ```shelldoc 74 | pip install 75 | pip show 76 | pip uninstall 77 | ``` 78 | -------------------------------------------------------------------------------- /docs/programming/python/mpi4py.md: -------------------------------------------------------------------------------- 1 | # 进程间通信之──mpi4py 2 | 3 | 进程间通信 (IPC) 的方式有很多,比如(本地)套接字 (sockets),不过在超算集群上可能就用不了了 4 | 5 | ==MPI== ([Message Passing Interface](https://en.wikipedia.org/wiki/Message_Passing_Interface)) 6 | 7 | Single Process Multiple Data (SPMD) Model: 8 | 9 | ``` 10 | mpirun [ options ] [ ] 11 | ``` 12 | 13 | Multiple Instruction Multiple Data (MIMD) Model: 14 | 15 | ``` 16 | mpirun [ global_options ] [ local_options1 ] 17 | [ ] : [ local_options2 ] 18 | [ ] : ... : 19 | [ local_optionsN ] 20 | [ ] 21 | ``` 22 | 23 | ## 示例 24 | 25 | ```python 26 | from mpi4py import MPI 27 | 28 | comm = MPI.COMM_WORLD 29 | rank = comm.Get_rank() 30 | 31 | if rank == 0: 32 | data = {'a': 7, 'b': 3.14} 33 | comm.send(data, dest=1, tag=11) 34 | print("Sent.") 35 | elif rank == 1: 36 | data = comm.recv(source=0, tag=11) 37 | print("Received.") 38 | print(data) 39 | ``` 40 | 41 | ```shell 42 | mpiexec -n 2 python script.py 43 | # or `mpirun -np 1 python script0.py : -np 1 python script1.py` 44 | ``` 45 | 46 | **Output** 47 | 48 | ``` 49 | Sent. 50 | Received. 51 | {'a': 7, 'b': 3.14} 52 | ``` 53 | 54 | ## 阅读材料 55 | 56 | - [MPI for Python - Tutorial](https://mpi4py.readthedocs.io/en/stable/tutorial.html) 57 | -------------------------------------------------------------------------------- /docs/programming/python/mpl-scientific-style.md: -------------------------------------------------------------------------------- 1 | # Matplotlib 学术样式 2 | 3 | - 刻度 (ticks) 4 | - 刻度放到图的内部 5 | - 主、副刻度 6 | - 图例 (legend) 边框 7 | 8 | ``` 9 | savefig.bbox : tight ## 'tight' or 'standard'. 'tight' is incompatible with pipe-based animation backends but will work with temporary file based ones 10 | 11 | xtick.direction : in ## direction: in, out, or inout 12 | ytick.direction : in ## direction: in, out, or inout 13 | 14 | legend.fancybox : False ## if True, use a rounded box for the legend background, else a rectangle 15 | ``` 16 | 17 | ## 代码控制 18 | 19 | ```python 20 | import matplotlib.pyplot as plt 21 | import numpy as np 22 | from matplotlib.ticker import MultipleLocator, FormatStrFormatter 23 | 24 | fig, ax = plt.subplots() 25 | ax.plot(t, s) 26 | 27 | ## Major and minor ticks 28 | ax.xaxis.set_major_locator(MultipleLocator(20)) 29 | # ax.xaxis.set_major_formatter(FormatStrFormatter('%d')) 30 | ax.xaxis.set_minor_locator(MultipleLocator(5)) 31 | 32 | plt.show() 33 | ``` 34 | -------------------------------------------------------------------------------- /docs/programming/python/multi-and-sub-process.md: -------------------------------------------------------------------------------- 1 | # Python 多进程与子进程 2 | 3 | ## 多进程 `multiprocessing` 4 | 5 | 进程池与 map 6 | 7 | ```python {20,24,28} 8 | import time 9 | from multiprocessing import Pool 10 | 11 | Num_Processes = 4 12 | 13 | def func_single_arg(a): 14 | time.sleep(1) 15 | return a * a 16 | 17 | def func_multi_args(a, b): 18 | time.sleep(1) 19 | return a * b 20 | 21 | def main(): 22 | single_arg_list = [1, 2, 3, 4] 23 | multi_args_list = [(1, 2), (3, 4), (5, 6), (7, 8)] 24 | 25 | with Pool(Num_Processes) as pool: 26 | ## 使用多进程运行接受单个参数的函数 27 | results = pool.map(func_single_arg, single_arg_list) 28 | print(results) 29 | 30 | ## 使用多进程运行接受多个参数的函数 31 | results = pool.starmap(func_multi_args, multi_args_list) 32 | print(results) 33 | 34 | ## imap 可以与 tqdm 配合显示进度条(实际上并不准确,见后文) 35 | results = pool.imap(func_single_arg, single_arg_list): 36 | print(results) 37 | 38 | if __name__ == "__main__": 39 | main() 40 | ``` 41 | 42 | ``` 43 | [1, 4, 9, 16] 44 | [2, 12, 30, 56] 45 | [1, 4, 9, 16] 46 | ``` 47 | 48 | ### Gracefully interrupt Pool with `Ctrl-C` 49 | 50 | ```python 51 | def pool_init(): 52 | # ignore the SIGINI in sub process 53 | def sig_int(signal_num, frame): 54 | pass 55 | 56 | signal.signal(signal.SIGINT, sig_int) 57 | 58 | pool = Pool(n_processes, pool_init) 59 | ... 60 | ``` 61 | 62 | ```python 63 | try: 64 | ... 65 | except KeyboardInterrupt: 66 | ... 67 | ``` 68 | 69 | ## 子进程 `subprocess` 70 | 71 | `run` 72 | 73 | ## `tqdm` 和 `imap` 并不能显示真正的进度 74 | 75 | ```python 76 | ## Python 3.8+ 77 | import time 78 | from multiprocessing import Pool 79 | 80 | from tqdm import tqdm 81 | 82 | Num_Processes = 5 83 | Num_Args = 10 84 | 85 | def func(a): 86 | time.sleep((Num_Args - a) * 0.2) 87 | result = a ** 2 88 | print(f"a={a} squared is {result}") 89 | return result 90 | 91 | def main(): 92 | arg_list = range(Num_Args) 93 | print(f"{arg_list=}") 94 | 95 | with Pool(Num_Processes) as pool: 96 | results = list( 97 | tqdm( 98 | pool.imap(func, arg_list), 99 | total=len(arg_list), 100 | bar_format="{l_bar}{bar:30}{r_bar}{bar:-30b}", 101 | ) 102 | ) 103 | print(f"{results=}") 104 | 105 | if __name__ == "__main__": 106 | main() 107 | ``` 108 | 109 | Output 110 | 111 | ``` 112 | arg_list=range(0, 10) 113 | 0%| | 0/10 [00:00 "C:\\Users\\/somewhere" (on Windows) 11 | 12 | gettempdir() 13 | ``` 14 | 15 | ## 在命令行打印进度 16 | 17 | ```python 18 | print(f"{progress:.2f}%", end="\r", flush=True) 19 | ``` 20 | 21 | 或者使用 `tqdm` 22 | 23 | ```python 24 | from functools import partial 25 | 26 | from tqdm import tqdm as std_tqdm 27 | 28 | tqdm = partial(std_tqdm, bar_format="{l_bar}{bar:30}{r_bar}{bar:-30b}", leave=False) 29 | 30 | bar = tqdm(items, desc="description", total=len(items)) 31 | for item in bar: 32 | ... 33 | bar.write("...") 34 | ``` 35 | 36 | ## GUI 相关 37 | 38 | ### 弹出消息框 39 | 40 | ```python 41 | from tkinter import Tk, messagebox 42 | 43 | ## Get rid of the root window 44 | root = Tk() 45 | root.title("Title") 46 | root.attributes("-alpha", 0.0) 47 | root.wm_state("iconic") 48 | 49 | messagebox.showinfo("Title", "Message") 50 | 51 | root.destroy() 52 | ``` 53 | 54 | ### 弹出 Toast 消息 (Windows) 55 | 56 | ```python 57 | # pip install winrt 58 | 59 | import winrt.windows.data.xml.dom as dom 60 | from winrt.windows.ui.notifications import ToastNotification, ToastNotificationManager 61 | 62 | title = "Hello" 63 | msg = "world!" 64 | 65 | def toast(title, msg): 66 | toast_xml = f"\ 67 | \ 68 | {msg}\ 69 | \ 70 | " 71 | 72 | toast_xmldoc = dom.XmlDocument() 73 | toast_xmldoc.load_xml(toast_xml) 74 | 75 | notifier = ToastNotificationManager.create_toast_notifier(title) 76 | notifier.show(ToastNotification(toast_xmldoc)) 77 | 78 | toast(title, msg) 79 | ``` 80 | 81 | [Toast schema - Microsoft Docs](https://docs.microsoft.com/en-us/uwp/schemas/tiles/toastschema/schema-root) 82 | 83 | Toast XML example: 84 | 85 | ```python 86 | from winrt.windows.ui.notifications import ToastTemplateType 87 | 88 | template = ToastTemplateType.TOAST_IMAGE_AND_TEXT01 89 | toast_xmldoc = ToastNotificationManager.get_template_content(template) 90 | print(toast_xmldoc.get_xml()) 91 | ``` 92 | 93 | ### 打包成 exe 94 | 95 | ``` 96 | pyinstaller --onefile --noconsole main.py 97 | ``` 98 | 99 | #### 附:更改图标 100 | 101 | 用 Resource Hacker 打开要改图标的 exe,`Action > Replace Icon ...`,然后选择一个有图标的 exe 替换(比如 `pythonw.exe`) 102 | -------------------------------------------------------------------------------- /docs/reading/200-years-of-surgery.md: -------------------------------------------------------------------------------- 1 | # 《手术两百年》 2 | 3 | 4 | 5 | ## 理性之光 6 | 7 | - (一两百年以前)**对人体的认识**,两个里程碑: 8 | - 维萨里的[解剖](https://zh.wikipedia.org/zh-cn/%E5%AE%89%E5%BE%B7%E9%9B%B7%E4%BA%9A%E6%96%AF%C2%B7%E7%BB%B4%E8%90%A8%E9%87%8C#%E3%80%8A%E4%BA%BA%E4%BD%93%E7%9A%84%E6%9E%84%E9%80%A0%E3%80%8B) 9 | - 哈维的[循环](https://en.wikipedia.org/wiki/William_Harvey#De_Motu_Cordis_(Anatomical_Account_of_the_Motion_of_the_Heart_and_Blood)) 10 | - (之后)**对疾病的认识** 11 | 12 | ## 手术基石 13 | 14 | 手术三大基石:止血,麻醉,消毒 15 | 16 | 帕雷,钳夹止血法(针线缝合血管),「外科学之父」 17 | 18 | [死亡率 300% 的手术](https://en.wikipedia.org/wiki/Robert_Liston#Liston's_most_famous_cases) 19 | 20 | 1846 年,[莫顿](https://zh.wikipedia.org/zh-cn/%E5%A8%81%E5%BB%89%C2%B7%E8%8E%AB%E9%A1%BF),乙醚麻醉剂,历史第一次公开的无痛手术 21 | 22 | ## 长驱直入 23 | 24 | X 射线,医疗影像 25 | 26 | 输血(血型,血液保存) 27 | 28 | 1983 年,腹腔镜手术,微创手术的开端 29 | 30 | ## 攻入颅腔 31 | 32 | 哈维・库欣,神经外科之父 33 | 34 | 重要工具:CT(X 射线计算机断层成像),NMRI(核磁共振成像) 35 | 36 | 显微外科手术 37 | 38 | 帕金森 39 | 40 | ## 打开心脏 41 | 42 | 低温手段 43 | 44 | 1954 年,李拉海,交叉循环 45 | 46 | 1958 年,人工心肺机 47 | 48 | 介入治疗,导管顺着静脉到达心脏(1929 年,[沃纳・福斯曼](https://zh.wikipedia.org/zh-cn/%E6%B2%83%E7%BA%B3%C2%B7%E7%A6%8F%E6%96%AF%E6%9B%BC)) 49 | 50 | 人工心脏(等待心脏移植的过渡) 51 | 52 | ## 生死「器」约 53 | 54 | 器官移植,血管连接,三点吻合法 55 | 56 | 排异,环孢素 57 | 58 | 1954 年,第一例成功的肾移植手术,同卵双胞胎 59 | 60 | 来源:遗体捐献,干细胞培养 61 | 62 | ## 重病之王 63 | 64 | 癌症 65 | 66 | ## 手术未来 67 | 68 | 干细胞与组织工程学 69 | 70 | 计算机辅助 71 | 72 | 微创 73 | 74 | 基因 75 | 76 | 人工智能 😂 77 | 78 | 覆盖贫困地区 79 | -------------------------------------------------------------------------------- /docs/reading/find-your-other-half.md: -------------------------------------------------------------------------------- 1 | # 相亲「方法论」 2 | 3 | ::: tip 来源 4 | [大家通过相亲都明白了什么道理,得了什么感悟?– 知乎](https://www.zhihu.com/question/23605963/answer/2956807872) 5 | ::: 6 | 7 | 数量换质量 8 | 9 | 我在 30 岁之前从来没谈过恋爱,从 30 岁评上副教授工作稳定下来开始,就开始从各种渠道,包括同事同学家里人介绍、十几个交友软件(青藤、二狗、她说……)、四个脱单公众号上寻找资源,不到两年的时间里,累积加到的女生微信大概有 300 个左右,约线下见面的有 152 个,线下见面三次以上的有 33 个,发展到恋人关系的累积 2 个(最后和第二个结婚) 10 | 11 | 我从小就不太会和女性打交道,为了脱单,我是真的将相亲当成一项研究在运作 12 | 13 | 研究最重要的是什么,是样本数据 14 | 有样本数据的积累,我才能挖掘藏在现象背后的原理和逻辑 15 | 有样本,我才能提出和验证猜想和新方法 16 | 有样本的支撑,我才能不断迭代和改进,并在新的样本集里测试迭代 17 | 18 | 这 300 个女性就是支撑我研究的核心样本集 19 | 20 | 我按照职业和年龄大致把相亲对象分成四个组,确保同时接触的女生具有不同的职业背景和生活状态,以免聊串了;为了加快迭代,我通常同时接触 3-4 个不同组的女生,在加好友后第一周会提出见面,如果约三次都不出来则进入淘汰池,每个周末至少见两人,线下见面后如果第一面能过关且我也能过对方那关(不拉黑且愿意继续接触)则进行接下来的流程,反之则进入淘汰池;接下来第二面、第三面,依次进行入围和淘汰;所有主动或被动进入淘汰池的女生我都会写一个 200-500 字的技术总结,对对方软硬件条件和需求、加微信找话题的话术、约会地点和活动类型选择等方面做详细记录 21 | 22 | 通过数据的不断积累,我在以下方面做出迭代改进 23 | 24 | 30 | 31 |
32 | 33 | 1. 改进调整我本人的需求 34 | 35 | 我在最初开始相亲的时候,我不会对对方提出任何要求,只说相信缘分,来者不拒,尽量扩大样本集 36 | 但随着样本集的扩大,我也在逐渐调整我的策略 37 | 38 | 比如,我开始不要求学历,所以初期的样本集学历下至职高上至博士都有,经过交流,基本确信 985 以下的人士对我来说基本不具备交流价值,后期我就直接写明,要求本硕博至少有一个阶段就读于 985 或博士就读于 QS 前 150,对后续的样本集进行提纯以减少工作量 39 | 40 | 比如,我很喜欢皮肤白的女生,所以对于照片上皮肤白的女生都会重点关注,但经过样本分析总结,发现在照片上显得白的女生通常是拍照 p 图好手和化妆好手,实际真人的白程度甚至不如全人口平均水平,因此到后来我就不再纠结于照片上是否白净,以此扩大样本量 41 | 42 | 2. 改进约会安排 43 | 44 | 在经过大量样本积累和分析之后,我对约会时的话术、日程安排、消费水平、开什么车都做了详细梳理计划 45 | 46 | 例如,针对不同职业背景设定了几种约会套路: 47 | 48 | 对于高学历背景的医生、大学老师等,我会从第二次约会起依次带她去参观我就职的医疗器械实验室、我毕业的大学和中学、我最喜欢的博物馆,展示我的专业能力和知识,往往能获得对方的认可甚至仰慕 49 | 50 | 对于中小学老师,我会将约会的主导权交给对方,自己只负责结账,其他时候像个乖乖的小学生 51 | 52 | 对于其他学历在硕士及以下的职场女性,我会开上我哥的 macan,订餐时藏在巷子里的预约制日料或者牛排馆,既不会有过高的消费,也能一定程度上体现我的财力和品味(虽然我自己平常并不会去这种店) 53 | 54 | 这样的套路不一定对每个人都有效,但是起码能够做到在大部分女生那里不因此减分 55 | 56 | 通过海量数据的积累,我成功将自己从不善言辞、面对女生说不出话的羞涩男孩变成相亲例无虚发的老司机,也成功找到了和我条件最为匹配的女孩,和我同龄,知名 985 八年制临床,知名三甲医院内科医生,长相清纯身材苗条,家里虽然是农村的但是淳朴本分,结婚的时候没要彩礼,我后来问她,第一次见到我是什么感觉,她说长相一般没心动,但是说话和穿着打扮得体、约会安排非常舒心省心,深入交流后发现有才华有能力,就心动了,我可能永远不会让她知道,同款的约会安排我至少用过三十次,为了整理出这个最优模式,至少积累了 100 个相亲对象的数据 57 | 58 |
59 | 60 | --- 61 | 62 | ::: callout 63 | 💬 可能很多人无法接受甚至反感这种行为模式(有些描述连我也感觉过于物化了),但是总的来说:清醒认识自己需求且坦诚的人 > 迷迷糊糊始终依靠感觉/本能行事的人 > 故意欺骗的人 64 | ::: 65 | -------------------------------------------------------------------------------- /docs/reading/love.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar: auto 3 | --- 4 | 5 | # 像少年一样去爱,像成人一样克制(转载) 6 | 7 | ::: tip Source 8 | 来源已不可考,能搜到的最早记录是 2009-12-14 的一篇[转载](https://www.pplzw.com/zh-hk/mingrenmy/lizhi/15922.html) 9 | ::: 10 | 11 | 高中的时候,我曾经交往过一个女朋友。 12 | 13 | 有一天我半夜从梦中醒来,突然无比的想她。那时候手机还没有像现在这样普及,我的思念自然无从寄托。在床上瞪了一会儿眼睛以后,我跳起来麻利地穿好衣服,出门去找她了。尽管第二天上早自习我就能够见到她。 14 | 那时候我以为了方便学习的名义在外面自己租房住,所以也不会遇到宿管大爷这种阻碍,可以来一场说走就走。 15 | 出了门才发现外面下着大雪,地上已经有着厚厚的积雪,天空中雪花还如筛灰一般落下。但心怀着爱情的炽热,我丝毫没觉得冷。北方下雪的冬夜格外寂静,此时已经是凌晨两点以后,街上没有一个行人,只有我自己踏在积雪上的声音格外清晰。 16 | 我穿过那条横穿这个小县城的街道,来到我当时女朋友家的楼下。 17 | 然而我什么都做不了,楼门紧锁,况且即使开着我也没勇气在半夜里去挑战她母亲的忍耐度。 18 | 于是我在楼下冒着大雪站了一会儿,抽了一支烟,惆怅了一阵子之后,就顺道拐去了网吧…… 19 | 20 | 直到很久以后,时过境迁,妹子已经再无联系,而我也不是那能半夜扛住风雪的鸡血少年,我才领悟自己当时的心态。 21 | 那不过是一种表演罢了,除了把自己感动一下,制造一点自己痴情的假象,一点意义都没有。 22 | 23 | 在感情中,我们往往觉得自己掏心掏肺,所做所为能够感天动地,闻者伤心,见者叹息,为什么偏偏感动不了你?我们总是容易用一种自虐的方式制造出一种痴情的假象来使得自己站在感情的道德制高点上,获得一种畸形的满足感和安全感。 24 | 其实无论是雪夜去对方家楼下站会儿或者是冒着大雨给她送一杯奶茶什么的,自己回想起来往往觉得如乔峰大战聚贤庄、关羽千里走单骑一样壮怀激烈,而对于对方来说,一杯奶茶就是一杯奶茶,无法承载起你想要在上面寄托的山崩地裂的情怀。 25 | 少年的时候,总是迫不及待地将自己的满腔爱意表达出来,而结果往往是陷入表演之中而不自知。所以两个人的记忆才会出现偏差,那些你觉得刻骨铭心的过去,对方往往没有同样的感觉,甚至茫然不知。 26 | 好比大夏天里你穿越半个地球带着一件皮大衣送过来,然后霸道地给对方穿上一样。对你而言你付出了很多,但是对方根本不需要啊。 27 | 在你的记忆中,你漂洋过海翻山越岭送温暖,不说东西,光这份心就可鉴日月,感动天地,而在对方的记忆中,是有个傻逼千里迢迢地赶来添堵。 28 | 29 | 当然我们都有矫情的时候,在一起的时候,适当来一场互相配合愿打愿挨的表演也有益身心健康,有助感情升温。但一定要记住,这种事儿其实双方都该心知肚明,一方知道自己是恃宠而骄,提出的要求也恰到好处,对方也乐意配合完成,之后大家皆大欢喜。 30 | 我现在极力使得自己避免陷入这种表演之中,向别人表演自己的感情,表演自己的情绪,表演自己的伤悲。 31 | 大家都很忙,谁也无暇去感受你的伤悲,也没空替你去传播。何况即使有人愿意聆听你的伤悲,也不过是增添一些茶余饭后的谈资罢了。 32 | 即使真的伤悲,那也埋在心里吧。说出来,在意的人听了心塞,不在意的人不会在乎,厌恶你的人拍手称快,那又是何必呢。 33 | 34 | 成长的标志就是懂得克制自己。 35 | 克制自己的情绪,克制自己的表演欲,甚至克制自己的喜欢。 36 | 37 | 少年时候,喜欢一个人恨不能把她变成自己身体的一部分,一颦一笑都牵动自己的心,唯恐无法将自己的爱意表达出来。 38 | 那时候好年轻,有那么多时间和精力去肆意地燃烧和挥洒,相信有天真不变的感情。 39 | 所以尽管前文都在批判那时候的矫情,可我真心怀念那些过去的时光。可是再也回不去了。 40 | 41 | 每天早上匆匆行走在全是雾霾的北京,个个脚下生风,走向一座座大楼,面对你总觉得脑子有点欠缺的老板和过早步入更年期的女上司,然后做一堆无用的方案,混着那点微薄的工资。 42 | 说到底,没那个时间和精力再去玩那些矫情的把戏。 43 | 这个时候的喜欢,更应该是一种相互的支持和陪伴以及包容。 44 | 45 | 年少时候我们之所以如焰火一样释放燃烧自己的感情,除了那时候我们年轻有精力闲的蛋疼以外,也是我们无法找到自身的价值所在,想把自身价值的实现体现在另一个人的身上,去影响他、改变他。 46 | 而事实上,谁也无法承担起另一个人的价值寄托,只有做一个独立、有价值的人,才能真正学会去爱另一个人。 47 | 也千万不要尝试改变另一个人,这注定是徒劳的。 48 | 做自己就好,爱情的真谛在于相互的吸引、志趣相投的同行,而不是追逐和依附。 49 | 50 | ::: details 展开全部 51 | 生活中有很多女孩子总是在爱情中受到伤害,她们无论如何都想不明白,为什么那个当初对她百依百顺、宠着爱着的男人为什么在突然一天就转身离去,没有丝毫的留恋,无论她们如何挽留都无法挽回这段逝去的感情。 52 | 53 | 我认识的一个女孩子给我讲述了她跟她前任的故事。 54 | 在最初是她前男友追的她,而她当时并不喜欢这个看上去有些木讷呆板的男孩,果断拒绝了这个男孩。然而这个男孩子并没有放弃,一直默默地追求她,在每个节日都送上温暖的祝福和贴心的礼物,只要她有需要,总是第一时间出现在她的面前。 55 | 渐渐地女孩子被这个男孩的温柔和贴心所打动,对他也不再是强烈的排斥,偶尔两人也会在周末一起逛街吃饭看电影,然而也仅限于此,女孩并没有想着把这层关系更进一步。 56 | 可是随着时间的推移女孩子最终还是沦陷在了男孩的温柔相待中,半年后,他们正式在一起了。 57 | 如果故事在这里结束,那该是美好而值得让人祝福的。 58 | 然而真正在一起仅仅三个月的时间,两个人便分开了,从此陌路,老死不相往来。 59 | 分手的原因是,女孩觉得在一起以后男孩没有以前还在追求阶段时候的对她那样用心了,而男孩则无法再忍受女孩对他过分的索求和依赖。两人矛盾越来越大,最后只能选择分开。 60 | 61 | 我告诉这个女孩子,在这段感情之中,她和她前男友都犯了错误。 62 | 刚开始女孩子并不喜欢这个男孩,却贪恋他对她的那一点点好,并没有完全拒绝男孩,而那个男孩在这样的情况下,如果要舍弃,恐怕有些不甘心,觉得还有一线希望,而选择继续追求,每天挖空心思去讨好女孩子,也把自己搞的疲惫不堪。 63 | 时间长了,男孩投入了大量的精力和感情,更加难以自拔,而女孩却是被男孩一点点占据内心,天平开始渐渐倾向了男孩的那一边。 64 | 65 | 矛盾在他们还未真正在一起的时候就已经埋了下来,直到真正在一起以后才彻底爆发出来。 66 | 在一起以后,男孩觉得终于松了一口气,觉得美人到手,终于不用每天再装着端着捧着了,而女孩子则是觉得终于名正言顺成为了他的女朋友,可以让他更加宠着爱着哄着了。 67 | 结果便是在一起以后两个人都发现对方不是在自己想要的样子,这段感情没有他们想象的那么美好。 68 | 69 | 如果他们都能明白花前月下只是一时的激情,平淡相待才是生活的常态,也许他们能走的更远一些。 70 | 如果男孩子在一开始便懂得克制一些,以自己的真实一面示人,也许也便不会把自己搞的那么累。 71 | 如果女孩能明白在爱情之中没有谁对谁的付出是理所当然的,自己应该是独立的,不必依附谁,不必过分的索取,也许她不会对这段感情那么失落。 72 | 73 | 我见过太多的女孩子,在恋爱中跟自己的男朋友在做家务这样的问题上谈女权,讲究男女平等,而在类似房租水电这样的花销之中又去讲传统,觉得这是男生天经地义该承担的义务。 74 | 75 | 虽说感情是一场你情我愿,只要当事双方觉得没问题那别人也不好说什么,但倘若一个女孩子在感情中想要真正拥有更多的自由、实现更多的自我价值,拥有更多实现自我意志的空间,那么一定要做到自我的独立。无论是精神上还是经济上,都要把自己当做一个独立的个体,自己的价值靠自己去实现,不做任何人的附庸,同时也不被任何人所操纵和限制。 76 | 77 | 只有做自己,明白自己的价值所在,才能在感情之中让自己处在主动的位置,更加理性、克制、从容地去面对两个人的关系,才能收获更长久的感情。 78 | ::: 79 | 80 | --- 81 | 82 | ::: callout 83 | 💬 作为一个「一直不理解为什么需要恋爱,觉得很多人只不过在做恋爱 cosplay」的人,倒没有从这些文字获得什么新的道理。但是这篇文章的叙述,文笔,直到最后的感悟,让人深深共鸣。 84 | ::: 85 | -------------------------------------------------------------------------------- /docs/reading/papers/2011-kinectfusion1.md: -------------------------------------------------------------------------------- 1 | # KinectFusion: Real-Time Dense Surface Mapping and Tracking 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/reading/papers/2015-dynamicfusion.md: -------------------------------------------------------------------------------- 1 | # DynamicFusion: Reconstruction and Tracking of Non-rigid Scenes in Real-Time 2 | 3 | 4 | 5 | reconstruct and track dynamic non-rigid scenes in real-time using a single depth camera 6 | 7 | Contributions: 8 | 9 | 1. an approach for non-rigid transformation (volumetric warping) and fusion for a dynamically moving scene 10 | 2. efficiency, real-time 11 | 12 | Overview 13 | 14 | TODO 15 | 16 | Methods 17 | 18 | Dense Non-rigid Warp Field 19 | per point 6D transformation 20 | 21 | dual-quaternion blending DQB 22 | 23 | - $\mathcal{W} \colon \mathbf{S} \rightarrow \mathbf{SE}(3)$, warp function, per point 6D transformation(原文的符号不太符合 convention,$\mapsto$ 用于显式地描述映射函数如 $f \colon x \mapsto x^2$) 24 | -------------------------------------------------------------------------------- /docs/reading/papers/20231121-sugar.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # SuGaR: Surface-Aligned Gaussian Splatting for Efficient 3D Mesh Reconstruction and High-Quality Mesh Rendering 6 | 7 | 8 | 9 | precise and extremely fast mesh extraction from 3D Gaussian Splatting 10 | 11 | ### Contributions 12 | 13 | - a **regularization term** that encourages the gaussians to align well with the surface of the scene 14 | - a method that exploits this alignment to **extract a mesh** from the Gaussians using Poisson reconstruction, which is fast, scalable, and preserves details, in contrast to the Marching Cubes algorithm usually applied to extract meshes from Neural SDFs 15 | - an optional refinement strategy that binds gaussians to the surface of the mesh, and **jointly optimizes** these Gaussians and the mesh through Gaussian splatting rendering 16 | 17 | ### Intro 18 | 19 | the gaussians are unstructured 20 | 21 | Gaussian Splatting performs densification in order to capture details of the scene with highfidelity... This results in a density function that is close to zero almost everywhere(?), and the Marching Cubes algorithm(?) fails to extract proper level sets(?) of such a sparse density function even with a fine voxel grid 22 | 23 | Instead, Poisson reconstruction algorithm, scalable 24 | 25 | ### Related works 26 | 27 | light fields(?) Their work emphasized the importance of efficiently traversing volumetric data to produce realistic images(?) 28 | Traditional mesh-based IBR methods 29 | Volumetric IBR methods - NeRF 30 | Hybrid IBR methods 31 | Point-based IBR methods 32 | 33 | ### Methods 34 | 35 | 1. **regularization term** 36 | 37 | the ideal SDF $f$ is expected to be 38 | 39 | - well spread (the density of any position can be well approximated by only considering the closest gaussian) 40 | - flat (one of scaling factors close to 0) 41 | - opaque (alpha = 1) 42 | 43 | computing a slightly different loss relying on an SDF rather than on density further increases the alignment of gaussians with the surface of the scene 44 | the zero-crossings(?) of the Signed Distance Function 45 | 46 | We also add a regularization term to encourage the normals of SDF $f$ (ideal) and the normals of SDF $\bar{f}$ (estimated under current gaussians) to also be similar 47 | 48 | 2. **mesh extraction** 49 | 50 | 3. **refinement** 51 | 52 | instantiate a set of new thin 3D gaussians from each mesh triangle. The gaussians have only 2 learnable scaling factors and only 1 learnable 2D rotation 53 | 54 | ### Results 55 | 56 | slightly(?) worse than vanilla 3DGS and Mip-NeRF360 57 | -------------------------------------------------------------------------------- /docs/reading/papers/20231122-compact-3dgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # Compact 3D Gaussian Representation for Radiance Field 6 | 7 | 8 | 9 | two key objectives: 10 | 11 | - reducing the number of Gaussian points without sacrificing performance 12 | - a learnable mask strategy 13 | 14 | - compressing Gaussian attributes, such as view-dependent color and covariance 15 | - a grid-based neural field rather than per Gaussian SH 16 | - learn codebooks to compactly represent the geometric attributes of Gaussian by vector quantization 17 | 18 | 10x reduced storage and enhanced rendering speed 19 | 20 | ### Contributions 21 | 22 | - a novel volume-based masking strategy that identifies and removes non-essential Gaussians that have minimal impact on overall performance 23 | - compress view-dependent color 24 | - hash-based grid representation (Instant NGP) 25 | - compress geometry 26 | - store codebook index as the majority of Gaussians exhibit similar geometry (scale, rotation) 27 | 28 | ### Methods 29 | 30 | 1. **a learnable masking strategy** 31 | - introduce an additional mask parameter $m$ for each Gaussian 32 | - create a binary mask $M \in \{0, 1\}$ based on a masking threshold, and multiply it to both Gaussian scale and opacity 33 | - backpropagate gradients with *straight-through estimator*[^1] 34 | 35 | 2. **compressing colors and geometry** 36 | - ... 37 | 38 | [^1]: 39 | -------------------------------------------------------------------------------- /docs/reading/papers/20231122-depth-reg-3dgs-few-shot.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # Depth-Regularized Optimization for 3D Gaussian Splatting in Few-Shot Images 6 | 7 | optimize Gaussian splatting with a limited number of images while avoiding overfitting 8 | 9 | ### Contributions 10 | 11 | - depth-guided Gaussian Splatting optimization 12 | - early stop if the depth-guided loss starts to rise 13 | - regularize the depth map with a smoothness term 14 | 15 | ### Methods 16 | 17 | - **depth prior**: obtain the depth map using a pre-trained monocular depth estimation model (scale ambiguity) and aligning the scale and offset using sparse COLMAP feature points 18 | - monocular depth estimation: ZoeDepth trained on a indoor dataset NYU Depth v2 and a urban dataset KITTI 19 | - **depth loss**: depth prior vs. GS depth 20 | - **smoothness**: ensuring that neighbor 3D points have similar depths, except for edges found by the Canny edge detector 21 | - Unsupervised monocular depth estimation with left-right consistency (CVPR 2017) 22 | 23 | Modifications for the few-shot learning setting: 24 | 25 | - set SH to 1, preventing overfitting 26 | - early stop 27 | - remove the "reset opacity" operation, which may lead to irreversible optimization outcomes 28 | 29 | ### Results 30 | 31 | tested on NeRF-LLFF 32 | -------------------------------------------------------------------------------- /docs/reading/papers/20231130-sparsegs.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # SparseGS: Real-Time 360° Sparse View Synthesis using Gaussian Splatting 6 | 7 | We find that using naive depth priors is not sufficient and integrate depth priors with generative and explicit constraints to reduce background collapse, remove floaters, and enhance consistency from unseen viewpoints 8 | 9 | direct floater pruning 10 | 11 | diffusion models to provide supervision in regions with little coverage from training views 12 | 13 | apply depth constraints similar to prior work 14 | 15 | ## Related Work 16 | 17 | 1. constraints on the variantion between views 18 | 2. depth priors to novel views 19 | 20 | ## Methods 21 | 22 | - alpha-blended depth vs. mode-selected depth. The former is a weighted sum of Gaussians' depth, while the latter is most opaque Gaussian's depth 23 | - **depth loss** monocular estimation model predicts relative depth. Instead of estimating scale and shift to align, use Pearson correlation 24 | - between monocular depth and alpha-blended depth 25 | - **SDS loss**(?) 26 | - Dreamfusion: Text-to-3d using 2d diffusion 27 | - **floater pruning** when alpha-blended depth and mode-selected depth disagree. (pruning is done manually, case by case) 28 | -------------------------------------------------------------------------------- /docs/reading/papers/20231201-fsgs.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # FSGS: Real-Time Few-shot View Synthesis using Gaussian Splatting 6 | 7 | 8 | 9 | - Challenge 1: from sparse initialized points to dense coverage 10 | - Proximity-guided Gaussian Unpooling, it grows new Gaussians by measuring the proximity of existing Gaussians with their neighbors 11 | - Challenge 2: geometry 12 | - Depth 13 | 14 | Some sparse view NeRF methods (Section 2.2) 15 | 16 | ### Methods 17 | 18 | - Gaussian unpooling 19 | - calculate the (Euclidean) distance between each Gaussian (say $g$) and its nearest $k$ neighbors ($k=3$ in paper) 20 | - take the average distance as $g$'s _proximity_ (will be updated after any densification or pruning) 21 | - if the proximity of $g$ exceeds a threshold, "grow" new Gaussians between $g$ and its $k$ neighbors 22 | - (some heuristic rules to initialize the new Gaussians' scales, colors, opacities) 23 | - Depth guidance 24 | - pre-trained Dense Prediction Transformer (DPT) 25 | - a relative loss, Pearson correlation, on 2D (estimated and rendered) depth maps 26 | 27 | -------------------------------------------------------------------------------- /docs/reading/papers/20231206-hifi4g.md: -------------------------------------------------------------------------------- 1 | --- 2 | keywords: gaussian splatting 3 | --- 4 | 5 | # HiFi4G: High-Fidelity Human Performance Rendering via Compact Gaussian Splatting 6 | 7 | 3D Gaussian + non-rigid tracking 8 | 9 | - **Dynamic scene modeling** 10 | 11 | dual-graph mechanism to obtain motion priors 12 | - a coarse deformation graph for effective initialization 13 | - a fine-grained Gaussian graph to enforce subsequent constraints 14 | 15 | spatial-temporal regularizers to effectively balance the non-rigid prior and Gaussian updating 16 | 17 | - **Compression** scheme with residual compensation, ~25x compression rate, with less than 2MB of storage per frame 18 | 19 | ## Related Work 20 | 21 | **Dynamic** 22 | 23 | - NeRF-family 24 | - a few 3DGS recent work 25 | - Dynamic GS 26 | - [69, 72] implicit deformation network 27 | 28 | **Compression** 29 | 30 | - "A series of works are proposed for early point cloud compression with Octree [53, 63], Wavelet [41]. These are formalized into MPEG-PCC [54] standards by the Moving Picture Experts Group (MPEG), which are categorized into video-based (VPCC) and geometry-based (GPCC)." 31 | - learning-based methods, e.g., tensor/scene decomposition, tri-planes and multi-planes 32 | 33 | ## Methods 34 | 35 | **Coarse deformation graph** 36 | 37 | - Non-rigid tracking 38 | - DynamicFusion, DoubleFusion 39 | - Key-frame segementing (segmenting the data sequence into multiple key volumes) 40 | - Fusion4d: Real-time performance capture of challenging scenes ([link](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/11/a114-dou.pdf)) 41 | - Flyfusion: Realtime dynamic scene reconstruction using a flying depth camera (Lan Xu, Yebin Liu) 42 | 43 | **Fine-grained gaussian graph** 44 | 45 | - initialize Gaussians from the NeuS2 mesh 46 | - increase the sampling density in the hand and face regions to significantly improve visual quality 47 | - **key-volume update strategy** 48 | - prune incorrect Gaussians from the previous keyframe and densify new ones at the current keyframe(?) 49 | - then restrict the number of Gaussians within the current segement 50 | - Afterward, we establish a fine-grained Gaussian graph(?) 51 | 52 | **4D Gaussians Optimization** 53 | 54 | - not use the Gaussians' densification and pruning within the segment 55 | - categorize attributes into two groups 56 | - appearance-aware parameters: scaling, opacity, SH 57 | - motion-aware parameters: position, rotation 58 | - problem: temporal jitter 59 | - previous work: decoupling the deformation field from canonical 3D Gaussians (a fixed set of Gaussians across dynamic sequences) 60 | - -> substantially diminishes view-dependent effects and sacrifices rendering quality 61 | - this paper: introduce temporal and smooth regularization to delicately balance the dual graph prior and the updating of Gaussian attributes 62 | - temporal regularization: ensuring similar _appearance-aware parameters_ between adjacent frames 63 | - smooth regularization: _motion-aware parameters_, locally as-rigid-as-possible deformations 64 | - adaptive weight (on Gaussians) taking into account the displacement of positions between adjacent frames 65 | 66 | **Compression** 67 | 68 | - **residual compensation** 69 | - retain keyframe attributes and calculate residuals for non-keyframes 70 | - for appearance attributes: just use residual 71 | - for motion attributes: related to embedded deformation 72 | - **quantization** attribute values 73 | - **entropy encoding** Ranged Arithmetic Numerical System (RANS) 74 | 75 | ## Implementation Details 76 | 77 | - BackgroundMattingV2 (prior to RVM) 78 | - body, hands, face sampling ratio ~ 8:1:1 (~OpenPose) 79 | - quantize appearance attributes and fix -> fine-tune motion attributes -> quantize motion 80 | - different quantization levels depending on key/non-key frames, appearance/motion parameters 81 | 82 | ## Experiments 83 | 84 | 81 Z-CAM, 4k 30fps 85 | -------------------------------------------------------------------------------- /docs/reading/reward-and-half-life.md: -------------------------------------------------------------------------------- 1 | # 收益值与半衰期 2 | 3 | ::: tip Source 4 | 你有没有相见恨晚的知识想推荐给年轻人?- 采铜的回答 - 知乎(注:原作者已退出知乎) 5 | ::: 6 | 7 | 这个问题我必须答,因为我想为这里的年轻人介绍一种「可实现的成功学」。希望这个我自创的理论,可以改变很多人的一生。 8 | 9 | 当我们评价一个事情值不值得去做、应该花多少精力去做的时候,应该抛弃单一的视角,而是分从两个不同的维度来看,一是该事件将给我带来的收益大小(认知、情感、物质、身体方面的收益皆可计入),即「收益值」;二是该收益随时间衰减的速度,我称为「收益半衰期」,半衰期长的事件,对我们的影响会持续地较久较长。 10 | 11 | 这两个维度正交以后就形成了一个四象限图。我们生活、学习和工作中的所有事情都可以放进这个图里面。这里我举几个例子: 12 | 13 | - **高收益值、长半衰期事件**:找到自己的真爱、学会一种有效的思维方法、完成一次印象深刻的旅行、与大牛进行一场意味深长的谈话; 14 | - **高收益值、短半衰期事件**:买一件时髦的衣服、玩一下午手游、吃一顿大餐、看AV撸管; 15 | - **低收益值、长半衰期事件**:练一小时书法、背诵一首诗、背牢十个单词、看一本经典小说、读懂哲学著作的一个章节、多重复一次技能练习、认真地回复一封友人的邮件; 16 | - **低收益值、短半衰期事件**:挑起或参与一次网络掐架、漫无目的地网上闲逛刷微博、使用微信陌陌知乎等进行成功率很低的勾搭。 17 | 18 | 如果我们反躬自省一下,可能会发现,我们平时做得最多的、最喜欢做的,是「高收益值、短半衰期事件」,其次是「低收益值、短半衰期事件」,而另两类长半衰期事件,我们或者做得很少、或者做得很不情愿、或者不具备做的条件。 19 | 20 | 这个现象,就导致了一种结果,就是我们不自觉地陷入了一种「短半衰期的沙坑」之中。在沙坑里,我们总是一次次地把沙子抓起来,刚获得一点快感,沙子就已从指尖划下,然后重新来过。即便这个过程重复得再多次,我们还是得到相同的结果。每一天都是崭新的一天,但每一天都在重复昨天的故事。 21 | 22 | 但是长半衰期的事件就不一样,它的效益可以累积和叠加。即便每一次事件的可见效益微乎其微,但是只要它的半衰期足够长,这个效益就可以传递下去,成为未来成功的一块小小的基石。比如背单词,背一个单词,尽管可能过几天就淡忘,但是当你重新背这个单词的时候,第一次行动留下的底子还是在那里,它可以降低你再次记诵的难度。但是假使你在玩神庙逃亡这个游戏,一个连续奋战几十分钟的战果可能在一次疏忽中就前功尽弃、灰飞烟灭,虽也许会留下一个高分纪录,但是这个数字,其实是没有意义的。 23 | 24 | 再举一个例子,中午去食堂吃饭,不免要排队等上五到十分钟,这时大多数人会拿出手机刷微博打发时间,但是如果这个时候你拿出的不是手机,而是一本诗集,读上一首诗,又会如何呢?也许你会被旁人当成异类、呆子、文青,但是没关系,也许那首诗的美,已经种在你的心里,并在某个时刻开始生根发芽。 25 | 26 | 我们知道乔布斯有一个著名的「人生三故事」的演讲,2005 年在斯坦福大学。其中一个故事讲的是他在读大学期间练习书法,这个经历锻炼了他的审美品味,从而使得他在后来的苹果产品中特别注重产品的美感,所以这件事情为其传奇式的成功埋下了重要的伏笔。练书法这个事情的收益,对于我们普通人,放在当时和今天来看,都不那么高了,但是这个事情对人生的影响却可以沉淀下来,在某个时空机缘的当口爆发惊人的力量。 27 | 28 | 所谓成功的人生,就是这样把无数个或大或小的收益累加起来的结果。 29 | 30 | 看到这里,有些人可能会联想到时间管理中的「时间四象限法」,又称「艾森豪威尔法则」。该理论将事件从重要性和紧急程度两维度进行分类,分成重要紧急、重要不紧急、不重要紧急和不重要不紧急四类,并特别指出人们常常忙于去做不重要紧急的事,却忽略了重要不紧急的事情。我承认这个观点非常精彩,但是现实中,人们却很难履行这个法则并从中收益,因为我们现代人常常陷入了「两个无能」之中,一是「选择无能」、二是「执行无能」: 31 | - 「选择无能」就是我们很难判断两个事情哪个更重要,比如两本书看哪一本更有价值我不知道,比如两个证书去考哪一个更有前途我不知道。于是就成了布吕丹的驴子,在犹豫不决中寸步不行,直至饿死。 32 | - 「执行无能」就是我明知道这个事情很重要,就是不去做。其实对广大拖延症患者来说,一个事情看上去越重要,内心的恐惧感就越大,就越容易拖,最后一事无成。 33 | 34 | 所以,与其死守「艾森豪威尔法则」而不入,不如放下,拥抱简单、易做的「采铜法则」: 35 | 36 | **尽量少做或不做「短收益半衰期」的事情**。 37 | 38 | 除了字面意思外,这个法则暗含两层含义: 39 | - 收益值的高低无关紧要,只要不是「短半衰期」的事情,只要这个收益可以被累加,你就尽管去做,这个可以破除「选择无能」; 40 | - 你不用去做那些宏伟高大的事情。即便是去做那些不重要不紧急的事情比如你现在抽一分钟出来练几个字都可以,这就赚到了,就这样开始,没错!这可以破「执行无能」。 41 | 42 | 的确,读完这篇文章,你可能还是有点迷惑,你仍旧不知道你该干什么,以及到底干什么才能成功,但是你已经可以告诉自己——从现在这一刻开始——你可以不干什么了。每个人拥有的时间都是相同的,一旦你消灭了那些不该干的事,余下的时间,不管你做了什么,都会为你增添力量,积累动能,你就会一步步地、头也不回地走向成功。 -------------------------------------------------------------------------------- /docs/reading/uncocoro.md: -------------------------------------------------------------------------------- 1 | # 大便书 (uncocoro) 2 | 3 | 4 | 5 | 6 | 7 | 从吃东西,消化,到变成便便排出体外,一般来说需要 **10~12 小时** 8 | 9 | ## 「大便工厂」 10 | 11 | TODO 消化系统图 12 | 13 | | 消化器官 | 功能 | 14 | | -------- | ------------------------ | 15 | | 胃 | 分解食物 | 16 | | 十二指肠 | 溶解胃无法分解的**脂肪** | 17 | | 胆 | 为便便涂上黄色 | 18 | | 胰腺 | 19 | | 小肠 | 吸收营养 | 20 | | 大肠 | 吸收水分制成便便 | 21 | | 直肠 | 塑形 | 22 | -------------------------------------------------------------------------------- /docs/reading/what-you-want.md: -------------------------------------------------------------------------------- 1 | # 你不知道找的是什么,就永远也找不到(转载) 2 | 3 | ::: tip Source 4 | [李松蔚 2017-03-11](https://mp.weixin.qq.com/s/Ykt7wqX6WOih42_IW8ymTg) 5 | ::: 6 | 7 | 做心理咨询的时候,有一道看起来很繁琐的程序,叫确认目标。 8 | 就是不断地跟来访者澄清: 9 | 10 | > 「你希望通过咨询达到什么效果?」 11 | 12 | 这个问题,乍一听很容易回答。 13 | 14 | > 变得成功,变得幸福,变得积极乐观…… 15 | 16 | 但这个问题并不是这么简单。 17 | 18 | 内在的改变,往往要藉由外在的行为呈现。 19 | 希望变得成功的人,很多并不知道「成功」长什么样子。他们的想象也许是:银行卡上的余额达到了 X 位数,就算是成功。——但自己要变成一个怎样的人,银行卡上的余额才能达到 X 位数呢?问到这个,想法就很模糊。 20 | 所以光想着「成功」,并不算是有了方向。 21 | 还要做一点更具体的想象才行。 22 | 23 | 我们最常用的手段,叫做「==奇迹提问==」: 24 | 25 | > 「假如奇迹发生,晚上有一个精灵来过,给你偷偷注射了一大针努力/成功/幸福/积极乐观,那么第二天早上你睁开眼,**会发现自己变了吗?**」 26 | 27 | 这个问题,比它看上去的要难很多。 28 | 一般人并没有直觉性的答案,需要想一想。想出来之后,目标就会清晰一些: 29 | 30 | > 「**你通过哪些表现,发现自己变了?**」 31 | 32 | 甚至再具体一点: 33 | 34 | > 「你会在第几分钟察觉出自己的变化?」 35 | 36 | 他也许就会想到很多具体的,改变的画面: 37 | 38 | > 可以毫无困难地下床。 39 | > 早饭想吃好一点。 40 | > 可以很专注地思考今天的工作。 41 | > 想好好跟爱人说几句话。 42 | > 直接开始做事,不用玩两个小时手机。 43 | > 阅读英文书的速度变得很快。 44 | 45 | 等等等等。 46 | 47 | 我们当然不是真的去呼唤奇迹。 48 | 路还是要自己去走, 49 | 只是借着这种思考,稍微明确一点方向。 50 | 有时候,把这个方向定下来,对一个人就有很大的意义。 51 | 52 | 我们总是把「改变」挂在嘴边, 53 | 但那是一个很空泛的,遥不可及的概念。 54 | 一个概念,我们并不知道它具体长什么样子。 55 | 我们在生活当中也就不可能发现它。 56 | 就像你找一个东西,可是你都没想过这个东西的颜色、大小、材质。 57 | 你觉得「我看到它我就会知道它」, 58 | 但有可能,它从你眼皮底下溜过了好几次, 59 | 你看到了,但根本没有注意, 60 | 你完全没想过那**可能就是你要的东西**。 61 | 62 | 所以,你要试试吗? 63 | 回答这个问题—— 64 | 假如奇迹发生,你一夜之间变得离你的目标接近了一点,那么明天一早你睁开眼,你会发现自己变了吗?从哪里发现的? -------------------------------------------------------------------------------- /docs/software/README.md: -------------------------------------------------------------------------------- 1 | # Software and Tools -------------------------------------------------------------------------------- /docs/software/docker.md: -------------------------------------------------------------------------------- 1 | # Docker 2 | 3 | `docker run` 相当于 `docker create` 加 `docker start` 4 | 5 | ```bash 6 | ## docker run [OPTIONS] IMAGE [COMMAND] [ARGS...] 7 | ## e.g. 8 | docker run --name your_container_name \ 9 | -it \ ## --interactive (open STDIN) and --tty (allocate a pseudo-TTY) 10 | -p 80:80 \ ## --publish (map host's port 80 to container's port 80) 11 | -p 2233:22 \ ## also exposes the container's SSH port 22 12 | --gpus all \ ## access to GPUs 13 | --mount src=~/shared,target=/shared,type=bind \ ## shared folder 14 | ubuntu ## image name 15 | # /bin/bash ## entrypoint of the container [^1] 16 | 17 | ## press CTRL-p, CTRL-q to detach from the container and leave it running 18 | 19 | docker ps -a ## show all containers (by default show only running containers) 20 | 21 | docker stop container_name 22 | docker start container_name 23 | docker attach container_name ## attach your terminal's STDIN etc. to the running container 24 | ## This can appear as if the attach command is hung. Just press any key to continue. 25 | 26 | ## create a new image from a container 27 | docker commit container_id \ ## as shown by "docker ps" 28 | yzhang/testimage:version1 ## [REPOSITORY[:TAG]] 29 | docker images ## list images 30 | 31 | docker rm container_name 32 | ``` 33 | 34 | [Docker CLI reference](https://docs.docker.com/engine/reference/run/) 35 | 36 | 配置 SSH 用于远程连接,以基于 Ubuntu 16.04 的镜像为例 37 | 38 | ```bash 39 | ## By default you are root user in the container 40 | passwd ## set password 41 | 42 | apt update 43 | apt install vim ssh 44 | 45 | vim /etc/ssh/sshd_config 46 | ## set PermitRootLogin to yes 47 | 48 | service ssh start 49 | service ssh status 50 | 51 | ## start ssh service upon the container start 52 | # systemctl enable ssh ## this will not work [^1] 53 | vim ~/.bashrc 54 | ## add "servive ssh start &> /dev/null" 55 | ## as the default entrypoint of the container is /bin/bash 56 | 57 | ## [1]: https://medium.com/swlh/docker-and-systemd-381dfd7e4628 58 | ``` 59 | 60 | ```bash 61 | ## ssh to the container from another device 62 | ssh -p 2233 root@host ## depending on your port mapping, e.g. `docker run -p 2233:22` 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/software/imgs/vimcheatsheet.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/software/imgs/vimcheatsheet.gif -------------------------------------------------------------------------------- /docs/software/powershell.md: -------------------------------------------------------------------------------- 1 | # PowerShell 2 | 3 | ## PowerShell "Alias" 4 | 5 | PowerShell 只能给 cmdlet 设置 alias,如果想要像 Linux 上的 alias 一样代替一个语句,可以使用函数,比如 6 | 7 | ```powershell 8 | function jl { jupyter notebook list } 9 | 10 | function js { 11 | Param( 12 | [parameter(Position=0)] 13 | [Int] 14 | $port = 8888 15 | ) 16 | 17 | jupyter notebook stop $port 18 | } 19 | ``` 20 | 21 | 然后把这个加到用户 profile 就可以了(在 PS 里输入 `$profile` 查看路径,一般是 `%userprofile%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1`) 22 | 23 | 为了允许 `.ps1` 文件执行,需要以管理员权限打开 PS 然后执行 24 | 25 | ```powershell 26 | Set-ExecutionPolicy RemoteSigned 27 | ``` 28 | 29 | 30 | 31 | 32 | ## 自动补全 33 | 34 | 要想获得类似 `zsh-autosuggestions` 的使用体验,可以在上述 profile 文件中加入 35 | 36 | ```powershell 37 | ## 按 Ctrl + RightArrow 只采纳当前候选提示的一个单词 38 | Set-PSReadLineKeyHandler -Chord Ctrl+RightArrow -Function ForwardWord 39 | 40 | ## 使用 Tab 键时列出可以补全的项 41 | Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete 42 | 43 | ## 上下键查找与当前输入匹配的历史命令 44 | Set-PSReadlineKeyHandler -Chord UpArrow -Function HistorySearchBackward 45 | Set-PSReadlineKeyHandler -Chord DownArrow -Function HistorySearchForward 46 | Set-PSReadLineOption -HistorySearchCursorMovesToEnd 47 | 48 | ## 颜色 49 | Set-PSReadLineOption -Colors @{ InlinePrediction = "$([char]0x1b)[97;2m"} 50 | ``` 51 | -------------------------------------------------------------------------------- /docs/software/ubuntu.md: -------------------------------------------------------------------------------- 1 | # Ubuntu 2 | 3 | ## WeChat/QQ 4 | 5 | 6 | 7 | ## GNOME Extension 8 | 9 | https://github.com/mjakeman/extension-manager (`sudo apt install gnome-shell-extension-manager`) 安装打开,在最上方启用用户插件 10 | 11 | - https://github.com/home-sweet-gnome/dash-to-panel 12 | - https://github.com/prateekmedia/netspeedsimplified 13 | 14 | ## GNOME 图片和视频查看器 15 | 16 | ### Eye of GNOME 17 | 18 | https://flathub.org/apps/details/org.gnome.eog 19 | 20 | or https://snapcraft.io/eog `snap install eog` 21 | 22 | `sudo apt install eog` 可能产生问题,如果看到 23 | 24 | ``` 25 | You are about to do something potentially harmful. 26 | To continue type in the phrase 'Yes, do as I say!' 27 | ``` 28 | 29 | 就不要继续了,换用 flatpak/snap 30 | 31 | snap 安装的软件无法在 nfs/sshfs 挂载的路径下使用,如果没有其它来源就只能从源码安装了 32 | 33 | ### **MPV** 34 | 35 | `sudo apt install mpv` 36 | 37 | press q to quit 38 | 39 | ## CUDA 40 | 41 | install cuda toolkit 42 | 43 | 旧版本下载 CUDA Toolkit Archive 44 | 45 | 环境变量 46 | 47 | ```shell 48 | export CUDA_HOME=/usr/local/cuda 49 | export PATH=$PATH:$CUDA_HOME/bin 50 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 51 | ``` 52 | 53 | cudnn-local 包 54 | cuDNN 55 | 包可以直接从这里找 56 | 57 | ## 安装字体 58 | 59 | > There are various locations in GNU/Linux in which fonts can be kept. These locations are defined in `/etc/fonts/fonts.conf`; standard ones include `/usr/share/fonts`, `/usr/local/share/fonts`, and `~/.fonts`. 60 | 61 | 62 | 63 | ## 挂载硬盘分区 64 | 65 | 可以使用 GUI 操作,详细信息可以查看 `/etc/fstab` 文件,重启 66 | 67 | ## 快捷方式 68 | 69 | 可以在用户应用目录直接创建一个快捷方式 `vi ~/.local/share/applications/myapp.desktop`(系统应用则是 `/usr/share/applications/`,需要 sudo 权限) 70 | 71 | ``` 72 | [Desktop Entry] 73 | Name=MyApp 74 | Type=Application 75 | Exec=/path/to/your/executable 76 | Comment=This is my application 77 | Icon=/path/to/your/icon.png 78 | Terminal=false 79 | Categories=Utility;Application; 80 | ``` 81 | 82 | 注意路径中不能使用 `~` 来表示用户主目录(`~` 是 shell 中的快捷方式),实测也不能使用环境变量 `$HOME`,建议写绝对路径 83 | 84 | 然后使用 `update-desktop-database ~/.local/share/applications/` 更新菜单缓存 85 | 86 | 或者先在任意位置编辑好 `.desktop` 文件,然后使用 `desktop-file-install --dir=~/.local/share/applications/ myapp.desktop` 将其安装到用户目录。其好处是会帮助验证文件格式的正确性 87 | 88 | ## Unorganized 89 | 90 | **nautilus** 91 | 92 | - remove default folders from nautilus: 93 | - remove "Recent" tab: `gsettings set org.gnome.desktop.privacy remember-recent-files false` 94 | 95 | **Move window among monitors**: shift+super+arrow key 96 | 97 | ## 屏幕亮度 98 | 99 | 对于既有核显又有独显的电脑,在连接和断开外接显示器的时候屏幕亮度可能无法正确设置 100 | 101 | 屏幕亮度以文件形式存储于 `/sys/default/backlight/` 目录下,多显卡时则会有多个子文件夹,比如 102 | 103 | ``` 104 | amdgpu_bl0 nvidia_0 105 | ``` 106 | 107 | 每个文件夹内有 `brightness`,`max_brightness` 等文件,修改 `brightness` 文件中的数值即可改变屏幕亮度 108 | 109 | [Display brightness goes way up on suspend — Ask Ubuntu](https://askubuntu.com/a/1313453/1577456) 110 | -------------------------------------------------------------------------------- /docs/software/vim.md: -------------------------------------------------------------------------------- 1 | # Vim 2 | 3 | ::: callout 4 | Just for simple editing, otherwise why not use VS Code ;) 5 | ::: 6 | 7 | Press . to repeat last change,给多行加 / 去注释的时候很实用 8 | 9 | --- 10 | 11 | ## Moving cursor 12 | 13 | | Key | Operation | 14 | | ----------------------------------------- | ------------------------------------------------------------ | 15 | | gg | go to start of the **file** | 16 | | G | go to end of the file | 17 | | 0/Home | go to first char in the **line** | 18 | | ^ | go to first non-blank char in the line | 19 | | $/End | go to last char in the line (just like in RegExp) | 20 | | Ctrl+f/d | next page/half **page** | 21 | | Ctrl+b/u | previous page/half page | 22 | | w | next **word** (dw delete current word) | 23 | | b | previous word | 24 | | f{char} | jump to next `{char}` (on this line) | 25 | 26 | ; repeat last f (or F/t/T) operation 27 | 28 | ## Copy and paste 29 | 30 | | Key | Operation | 31 | | ------------------------------ | ------------------------------------------------------- | 32 | | yy | copy the line (mnemonic: **y**ank) | 33 | | dd | **d**elete the line (behaves like a cut operation) | 34 | | p | **p**aste after the current line | 35 | | P | **p**aste before the current line | 36 | | dt{char} | delete up **t**o this `{char}` (excluding) on this line | 37 | 38 | yj copy 2 lines, y2k copy 3 lines (which includes 2 lines above) 39 | df{char} ~ (including) 40 | 41 | ## Replace/Overtype 42 | 43 | | Key | Operation | 44 | | ------------- | ------------------------------------------------------------------ | 45 | | r | replace current char (in-place) | 46 | | cw | replace current word (delete current word and enter *insert* mode) | 47 | | R | enter *replace* mode | 48 | 49 | x delete current char 50 | 51 | ## Search 52 | 53 | | Key | Operation | 54 | | ------------------------- | ----------------------------------------------------------------------------------------------------------- | 55 | | / | enter *search* mode, type your search string, press Enter to confirm or ESC to cancel | 56 | | n/N | go to next/previous occurrence (similar to F3/Shift+F3 in most IDEs) | 57 | 58 | Type `:noh` to turn off highlighting until the next search 59 | 60 | ## More 61 | 62 | [Vim online documentation](https://vimhelp.org/) 63 | 64 | --- 65 | 66 |
67 | Vim Cheatsheet 68 |
Vscode Vim Academy
69 |
70 | -------------------------------------------------------------------------------- /docs/software/windows/autohotkey.md: -------------------------------------------------------------------------------- 1 | # AutoHotkey 2 | 3 | ## Hotkeys 和 Hotstrings 4 | 5 | ``` 6 | ;;; Hotkeys 脚本结构 ;;; 7 | 8 | ^j:: ; 快捷键写在 `::` 之前 9 | Send, Hello ; 要执行的命令 10 | return ; 结束命令 11 | 12 | ;;; Hotstrings ;;; 13 | 14 | ::ftw::Free the whales ; 输入 "ftw" 就会自动展开为 "Free the whales" 15 | ``` 16 | 17 | `.ahk` 脚本编译成 `.exe` 文件之后就不依赖 AutoHotkey 了 18 | 19 | ## 实例 20 | 21 | ### 自动填写表单 22 | 23 | ``` 24 | #IfWinActive ahk_class YourWinClass ; [^1] 25 | !f:: 26 | ; 切换英文输入法 [^2][^3] 27 | ControlGetFocus, control, A 28 | PostMessage, 0x50, 0, 0x4090409, %control%, A 29 | SendRaw ******** ; Username 30 | Send {Tab} 31 | SendRaw ******** ; Password 32 | Send {Tab 2} 33 | Send {Space} 34 | Send +{Tab} 35 | return 36 | ; #IfWinActive ; Endif if needed 37 | 38 | ; [^1]: 可以用附带的 Window Spy 程序查看各个窗口的 WindowClass 值 39 | ; [^2]: https://www.autohotkey.com/docs/commands/PostMessage.htm#ExSwitchKeybLang 40 | ; [^3]: https://github.com/larionov/ahk-multiple-language-switcher/ 41 | ``` 42 | 43 | ![fill-form](./imgs/fill-form.gif) 44 | -------------------------------------------------------------------------------- /docs/software/windows/context-menu.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 自定义右键菜单 3 | --- 4 | 5 | # 自定义右键菜单 (Custom Context Menu) 6 | 7 | 最常用的右键菜单(资源管理器某个文件夹空白处右键)在注册表中的位置 8 | 9 | ``` 10 | HKEY_CLASSES_ROOT\Directory\Background\shell\ 11 | ``` 12 | 13 | 格式例如 14 | 15 | ``` 16 | HKEY_CLASSES_ROOT\Directory\Background\shell\ 17 | └── VSCode 18 | │ (Default): Open with Code 19 | │ Icon: [path/to/vscode] 20 | └── command 21 | (Default): "[path/to/vscode]" "%V" 22 | ``` 23 | 24 | 其他可能出现的位置 25 | 26 | ``` 27 | HKEY_CLASSES_ROOT\*\shell\ 28 | HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\ 29 | 30 | HKEY_CLASSES_ROOT\Folder\shell\ 31 | HKEY_CLASSES_ROOT\Directory\shell\ 32 | HKEY_CLASSES_ROOT\AllFilesystemObjects\shell\ 33 | ; And corresponding `shellex` items 34 | 35 | HKEY_CURRENT_USER\SOFTWARE\Classes\directory\background\shell\ 36 | ``` 37 | 38 | `shell` 可以理解为静态的菜单项,`shellex` (shell extension) 则可以提供动态的功能。两者可以分别使用下面的工具查看 39 | 40 | - [ShellMenuView](https://www.nirsoft.net/utils/shell_menu_view.html) 41 | - [ShellExView](https://www.nirsoft.net/utils/shexview.html) 42 | 除了 context menu 之外,ShellExView 还可以查看 preview handler(用于资源管理器预览面板) 43 | -------------------------------------------------------------------------------- /docs/software/windows/general.md: -------------------------------------------------------------------------------- 1 | # 一般问题 2 | 3 | ## U 盘被占用,无法弹出 (Problem Ejecting USB Device) 4 | 5 | 在 PowerShell 中执行下述命令查看正在运行的程序 6 | 7 | ```powershell 8 | Get-EventLog -LogName System -after (Get-Date).AddHours(-1) | Where-Object {$_.EventID -eq 225} | Sort-Object TimeGenerated | Format-Table -Wrap 9 | ``` 10 | 11 | 12 | 13 | ## 文件(夹)被占用,无法删除、重命名等 14 | 15 | 使用 [Process Explorer](https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer),Ctrl + Shift + F ("Find Handle or DLL"),搜索文件名字即可 16 | -------------------------------------------------------------------------------- /docs/software/windows/imgs/fill-form.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzhang-gh/notes/cf01ca1dce72620d32756e9b7a7952b9f861f386/docs/software/windows/imgs/fill-form.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notes", 3 | "version": "0.0.1", 4 | "description": "Notes", 5 | "authors": "Yu Zhang", 6 | "repository": "https://github.com/yzhang-gh/notes", 7 | "scripts": { 8 | "dev": "vuepress dev docs", 9 | "devnoc": "vuepress dev docs --no-cache", 10 | "build": "vuepress build docs" 11 | }, 12 | "license": "CC-BY-NC-SA-4.0", 13 | "devDependencies": { 14 | "@neilsustc/markdown-it-katex": "^1.0.0", 15 | "@vuepress/plugin-back-to-top": "^1.9.7", 16 | "@vuepress/plugin-google-analytics": "^1.9.7", 17 | "@vuepress/plugin-medium-zoom": "^1.9.7", 18 | "katex": "^0.16.4", 19 | "markdown-it-attrs": "^4.0.0", 20 | "markdown-it-footnote": "^3.0.3", 21 | "markdown-it-mark": "^2.0.0", 22 | "vuepress": "^1.9.7", 23 | "vuepress-plugin-container": "^2.1.5", 24 | "vuepress-plugin-shiki": "^0.14.1", 25 | "vuepress-theme-book": "^0.0.9" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /syntaxes/plaintextc.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "information_for_contributors": [ 3 | "Plain text with comment (#), tailered from python.tmLanguage.json" 4 | ], 5 | "version": "0", 6 | "name": "plaintextc", 7 | "scopeName": "source.plaintextc", 8 | "patterns": [ 9 | { 10 | "include": "#comment" 11 | } 12 | ], 13 | "repository": { 14 | "codetags": { 15 | "match": "(?:\\b(NOTE|XXX|HACK|FIXME|BUG|TODO)\\b)", 16 | "captures": { 17 | "1": { 18 | "name": "keyword.codetag.notation.python" 19 | } 20 | } 21 | }, 22 | "comment": { 23 | "name": "comment.line.number-sign.python", 24 | "begin": "(\\#)", 25 | "beginCaptures": { 26 | "1": { 27 | "name": "punctuation.definition.comment.python" 28 | } 29 | }, 30 | "end": "($)", 31 | "patterns": [ 32 | { 33 | "include": "#codetags" 34 | } 35 | ] 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tools/post-process.js: -------------------------------------------------------------------------------- 1 | /** 2 | * It turns out that this script doesn't work. 3 | * (There is always a space (text-node) between and 4 | * even there is no line space in the source code at all) 5 | * 6 | * Use `display: inline-block` instead 7 | * https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace 8 | */ 9 | 10 | const fs = require("fs"); 11 | const glob = require("glob") 12 | 13 | const pat = /<\/svg> \(opens new window\)<\/span>/g 14 | 15 | glob("docs/.vuepress/dist/**/*.html", (err, files) => { 16 | if (err) { 17 | console.error(err); 18 | return; 19 | } 20 | 21 | files.forEach(file => { 22 | fs.readFile(file, (err, data) => { 23 | if (err) { 24 | console.error(err); 25 | } 26 | 27 | content = data.toString(); 28 | 29 | if (pat.test(content)) { 30 | const processed = content.replace(pat, ''); 31 | fs.writeFile(file, processed, (_err) => {}); 32 | } 33 | }); 34 | }); 35 | }); 36 | -------------------------------------------------------------------------------- /tools/pre-process.js: -------------------------------------------------------------------------------- 1 | const fs = require("fs") 2 | 3 | const shikiPluginStr = `const shiki = require('shiki') 4 | 5 | let hl 6 | 7 | module.exports = (options, ctx) => { 8 | return { 9 | async ready() { 10 | hl = await shiki.getHighlighter({ 11 | theme: options.theme ? options.theme : 'nord', 12 | langs: options.langs ? options.langs : [] 13 | }) 14 | 15 | // load additional languages 16 | if (options.additionalLangs) { 17 | for (langRegist of options.additionalLangs) { 18 | await hl.loadLanguage(langRegist) 19 | } 20 | } 21 | }, 22 | 23 | chainMarkdown(config) { 24 | config.options.highlight((code, lang) => { 25 | if (!lang) { 26 | return \`
\${escapeHtml(code)}
\` 27 | } 28 | return hl.codeToHtml(code, { lang }) 29 | }) 30 | } 31 | } 32 | } 33 | 34 | const htmlEscapes = { 35 | '&': '&', 36 | '<': '<', 37 | '>': '>', 38 | '"': '"', 39 | "'": ''' 40 | } 41 | 42 | function escapeHtml(html) { 43 | return html.replace(/[&<>"']/g, chr => htmlEscapes[chr]) 44 | } 45 | ` 46 | 47 | file = "node_modules/vuepress-plugin-shiki/index.js" 48 | fs.writeFile(file, shikiPluginStr, (_err) => {}) 49 | --------------------------------------------------------------------------------