<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>RyanStarFox&#39;s Blog</title>
  <icon>https://ryanstarfox.github.io/metadata/avatar.png</icon>
  <subtitle>分享生活、想法与技术</subtitle>
  <link href="https://ryanstarfox.github.io/atom.xml" rel="self"/>
  
  <link href="https://ryanstarfox.github.io/"/>
  <updated>2026-07-04T16:33:00.000Z</updated>
  <id>https://ryanstarfox.github.io/</id>
  
  <author>
    <name>RyanStarFox</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>对抗推荐，做回自己</title>
    <link href="https://ryanstarfox.github.io/2026/07/05/2026/20260705%20AntiRecommend/"/>
    <id>https://ryanstarfox.github.io/2026/07/05/2026/20260705%20AntiRecommend/</id>
    <published>2026-07-04T16:33:00.000Z</published>
    <updated>2026-07-04T16:33:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>对抗推荐，做回自己——反视频推荐脚本「AntiRecommend」</h1><p><img src="https://github.com/RyanStarFox/AntiRecommend/blob/main/media/logo_text.png?raw=true" alt="AntiRecommend"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我一直很警惕自己沉迷于某一样东西不能自拔，感觉失去了对于自己的掌控感。</p><p>现在其实最容易让人沉迷的就是短视频了，但是我反而不沉迷短视频，一是一开始就保持距离；二是大多短视频都很俗，在声音和画面上都太满了，实在无法忍受。短视频从未成为我沉迷的原因。</p><p>长视频反而更让我沉迷。长视频本身就具有迷惑性，它看上去显得更加让人静下心来，也更有用，能获得知识。但是实际上刷的时候开两倍速，无止境地选择下一个推荐的视频——这个逻辑和短视频是一样的。</p><p>之前也一直用别的方法限制自己的视频时长。最开始是关闭移动端主页的个性化推荐，随后是删去移动端，只使用桌面端，再之后是桌面端把主页重定向到搜索页。这隐藏了很多数据流，这样以来我几乎只看我关注的博主的视频了——但是还有最后的漏洞：播放器右侧、视频播放临近结束和结束后的推荐与自动连播。</p><p>于是乎用vibe coding了<a href="https://github.com/RyanStarFox/AntiRecommend">AntiRecommend</a>，用于隐藏youtube和bilibili所有的推荐视频，顺便隐藏了一些广告。好用！推荐用！</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;对抗推荐，做回自己——反视频推荐脚本「AntiRecommend」&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;https://github.com/RyanStarFox/AntiRecommend/blob/main/media/logo_text.png?raw=true&quot;</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
  </entry>
  
  <entry>
    <title>樱花frp自动签到</title>
    <link href="https://ryanstarfox.github.io/2026/02/06/2026/20260206%20%E6%A8%B1%E8%8A%B1frp%E8%87%AA%E5%8A%A8%E7%AD%BE%E5%88%B0/"/>
    <id>https://ryanstarfox.github.io/2026/02/06/2026/20260206%20%E6%A8%B1%E8%8A%B1frp%E8%87%AA%E5%8A%A8%E7%AD%BE%E5%88%B0/</id>
    <published>2026-02-06T10:43:00.000Z</published>
    <updated>2026-02-06T10:43:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>樱花frp自动签到</h1><p>之前习一直惯使用frp的内网穿透服务，但是因为不想签到，在网上找了一个库<a href="https://github.com/dutou520/SakuraFRP_Auto_AI_check">SakuraFRP_Auto_AI_check</a>用于实现自动签到</p><p>近日樱花frp从九宫格选图片验证码改为了滑块验证码，因此在原基础上添加了兼容滑块验证码的功能。</p><p>滑块验证码的破解分为两部分：</p><ul><li>找到合适的位置</li><li>模拟人类动作</li></ul><p>对于第一点，本来想直接使用视觉模型，但是视觉模型无法精确到像素，也无法模拟人眼实时查看移动的位置是否与预期的位置相符，因此放弃。转而使用库<a href="https://github.com/chenwei-zhao/captcha-recognizer">captcha-recognizer</a>，成功✅</p><p>对于第二点，本来也想直接vibe-coding一个，但是效果不尽如人意，captcha一直显示“验证码被怪兽吃掉了&quot;（笑，，，转而使用库<a href="https://github.com/asweigart/pyautogui">pyautogui</a>，成功✅</p><p>所以还是不要盲信vibe-coding，完善的第三方库+vibe-coding才是正解！</p><p>最终的成果：<a href="https://github.com/RyanStarFox/SakuraFRP_Auto_AI_check">SakuraFRP_Auto_AI_check</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;樱花frp自动签到&lt;/h1&gt;
&lt;p&gt;之前习一直惯使用frp的内网穿透服务，但是因为不想签到，在网上找了一个库&lt;a href=&quot;https://github.com/dutou520/SakuraFRP_Auto_AI_check&quot;&gt;SakuraFRP_Auto_AI_ch</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
  </entry>
  
  <entry>
    <title>机器学习</title>
    <link href="https://ryanstarfox.github.io/2026/01/13/2026/20260113%20%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/"/>
    <id>https://ryanstarfox.github.io/2026/01/13/2026/20260113%20%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/</id>
    <published>2026-01-13T04:37:00.000Z</published>
    <updated>2026-01-13T04:37:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>机器学习</h1><h2 id="1-聚类"><a class="header-anchor" href="#1-聚类">¶</a>1 聚类</h2><h3 id="1-1-K-means"><a class="header-anchor" href="#1-1-K-means">¶</a>1.1 K-means</h3><h4 id="流程"><a class="header-anchor" href="#流程">¶</a>流程</h4><ol><li>初始化$\mu_1,\mu_2,\cdots,\mu_k$</li><li>把每个数据点分配给最近的$\mu_i$</li><li>把$\mu_i$更新为所分配的点的均值</li><li>重复2，3直至迭代停止</li></ol><h4 id="收敛性"><a class="header-anchor" href="#收敛性">¶</a>收敛性</h4><ol><li>每一步目标函数$J=\sum\limits_{i=1}^n\sum\limits_{k=1}^Kr_{ik}||x_i-\mu_k||^2$都会减小，且J有下界</li><li>但是J非凸（因为$r_{ik}$），往往收敛到局部最小值</li></ol><h4 id="问题"><a class="header-anchor" href="#问题">¶</a>问题</h4><ul><li>不能软分类</li><li>K值手动指定</li><li>初始值敏感（对极端值敏感）</li><li>使用欧几里得距离，高维失效</li><li>计算开销大</li></ul><h3 id="1-2-Hierarchical-Clustering"><a class="header-anchor" href="#1-2-Hierarchical-Clustering">¶</a>1.2 Hierarchical Clustering</h3><ol><li>每个点作为一个类</li><li>距离最近的两个类合并</li><li>直至只剩下一个类为止</li></ol><p>复杂度高</p><p>距离计算的方法：</p><ul><li>最小值</li><li>最大值</li><li>均值</li></ul><h3 id="1-3-Adaptive-Learning"><a class="header-anchor" href="#1-3-Adaptive-Learning">¶</a>1.3 Adaptive Learning</h3><p>可以随时增加新的数据点</p><h4 id="Competitve-Learning"><a class="header-anchor" href="#Competitve-Learning">¶</a>Competitve Learning</h4><blockquote><p>老师fx比喻为资本主义</p></blockquote><p>类似于分步的K-means</p><ol><li>定义若干类</li><li>对于每个新点，加入离它最近的类，并更新类的坐标（使用衰减的学习率）</li><li>不断重复</li></ol><p>但是这样的话，很有可能有一部分类别一直吃不到数据点，导致“饿死”</p><p>lr=1/n，n为当前簇样本数的话，就是online k-means</p><h4 id="Frequency-Sensitive-Competitive-Learning-FSCR"><a class="header-anchor" href="#Frequency-Sensitive-Competitive-Learning-FSCR">¶</a>Frequency Sensitive Competitive Learning (FSCR)</h4><blockquote><p>老师fx比喻为吃大锅饭</p></blockquote><p>惩罚frequent winners，在比较距离的时候，加入惩罚系数$\alpha$</p><p>$\varepsilon_t(\theta_j)=\alpha_j||x_t-m_j||^2$</p><p>其中$\alpha_j=\dfrac{u_j}{\sum u_i}$</p><p>但是如果初始类别太多了，可能会出问题</p><h4 id="Rival-penalized-competitive-learning-RPCL"><a class="header-anchor" href="#Rival-penalized-competitive-learning-RPCL">¶</a>Rival penalized competitive learning (RPCL)</h4><blockquote><p>老师fx比喻为吃中国特色社会主义</p></blockquote><p>对于一个新点</p><ul><li>最近的类将被向新点拉进</li><li>第二近的类将被向新点拉远</li></ul><p>还能顺便解决K数值的解决方式</p><h3 id="1-4-概率"><a class="header-anchor" href="#1-4-概率">¶</a>1.4 概率</h3><p>频率学派vs贝叶斯学派：</p><p>前者例如GMM；后者代入GMM的例子，会认为实际上$\theta$也只是符合某一个分布而已</p><p>前者MLE（极大似然估计），后者全贝叶斯学习，中间地带MAP（最大后验估计）</p><p>贝叶斯学派是有方法组织滑坡的，例如假定最高层的分布是均匀分布，或者限制分布的层数</p><h4 id="Gaussian-Mixture-Models-GMM"><a class="header-anchor" href="#Gaussian-Mixture-Models-GMM">¶</a>Gaussian Mixture Models (GMM)</h4><p>类似于K-Means，不过K-Means是硬的，这个是软的</p><p>相当于是使用很多高维高斯分布的叠加来表示样本点的分布</p><p>$\mathcal N(x|\mu_k,\Sigma_k)=p(x \mid \mu_k, \Sigma_k) = \frac{1}{\sqrt{(2\pi)^d |\Sigma_k|}} \exp\Big(-\frac{1}{2}(x-\mu_k)^T \Sigma_k^{-1} (x-\mu_k)\Big)$</p><p>如果使用欧氏距离，$\Sigma_k$就取$I$；如果使用马氏距离，$\Sigma_k$就使用协方差矩阵</p><p>$L(\theta)=\ln p(\mathbf x|\theta) = \sum\limits_{n=1}^N\ln p(x_n|\theta)=\sum\limits_{n=1}^N\ln \sum\limits_{k=1}^K \pi_k\mathcal N(x_n|\mu_k,\Sigma_k)=\sum\limits_{n=1}^N\ln \sum\limits_{k=1}^K \gamma_{nk}\dfrac{\pi_k\mathcal N(x_n|\mu_k,\Sigma_k)}{\gamma_{nk}}\geq\sum\limits_{n=1}^N\sum\limits_{k=1}^K\gamma_{nk}\ln  \dfrac{\pi_k\mathcal N(x_n|\mu_k,\Sigma_k)}{\gamma_{nk}}=Q(\theta),\text{iff }\dfrac{\pi_k\mathcal N(x_n|\mu_k,\Sigma_k)}{\gamma_{nk}}=\text{Const}$</p><h4 id="EM算法训练GMM"><a class="header-anchor" href="#EM算法训练GMM">¶</a>EM算法训练GMM</h4><h5 id="Step-0：初始化"><a class="header-anchor" href="#Step-0：初始化">¶</a>Step 0：初始化</h5><ul><li>选择簇数 $K$</li><li>随机初始化：<ul><li>均值 $\mu_k$</li><li>协方差矩阵 $\Sigma_k$</li><li>混合系数 $\pi_k$（先验概率）</li></ul></li></ul><h5 id="Step-1：E-步（Expectation）"><a class="header-anchor" href="#Step-1：E-步（Expectation）">¶</a>Step 1：E 步（Expectation）</h5><ul><li>对每个数据点 $x_n$ 计算其属于每个簇的概率（责任度）：<br>$\gamma_{nk} = P(z_n = k \mid x_n) = \frac{\pi_k , \mathcal{N}(x_n \mid \mu_k, \Sigma_k)}{\sum_{j=1}^{K} \pi_j , \mathcal{N}(x_n \mid \mu_j, \Sigma_j)}$</li><li>这里：<ul><li>$z_n$ = 数据点 $x_n$ 的簇标签（隐藏变量）</li><li>$\gamma_{nk}$ 是软分配（soft assignment）</li></ul></li></ul><h5 id="Step-2：M-步（Maximization）"><a class="header-anchor" href="#Step-2：M-步（Maximization）">¶</a>Step 2：M 步（Maximization）</h5><ul><li>根据责任度 $\gamma_{nk}$ 更新参数，使似然最大：</li></ul><ol><li>更新均值：<br>$\mu_k = \frac{\sum_{n=1}^{N} \gamma_{nk} x_n}{\sum_{n=1}^{N} \gamma_{nk}}$</li><li>更新协方差：<br>$\Sigma_k = \frac{\sum_{n=1}^{N} \gamma_{nk} (x_n - \mu_k)(x_n - \mu_k)^T}{\sum_{n=1}^{N} \gamma_{nk}}$</li><li>更新混合系数：<br>$\pi_k = \frac{\sum_{n=1}^{N} \gamma_{nk}}{N}$</li></ol><h5 id="Step-3：迭代"><a class="header-anchor" href="#Step-3：迭代">¶</a>Step 3：迭代</h5><ul><li>重复 <strong>E 步 → M 步</strong>，直到：<ul><li>对数似然收敛，或者</li><li>参数变化很小</li></ul></li></ul><h5 id="Step-4：簇分配（可选）"><a class="header-anchor" href="#Step-4：簇分配（可选）">¶</a>Step 4：簇分配（可选）</h5><ul><li>每个点属于簇 $k^<em>$：<br>$k^</em> = \arg\max_k \gamma_{nk}$</li><li>或者你可以直接使用概率做软分类。</li></ul><h5 id="注"><a class="header-anchor" href="#注">¶</a>注</h5><p>在每一步迭代中：</p><p>$$<br>L(\theta_{new}) \ge Q(\theta_{new}, \theta_{old}) \ge Q(\theta_{old}, \theta_{old}) = L(\theta_{old})<br>$$</p><ul><li>第一个$\geq$：Q函数是L函数的下限</li><li>第二个$\geq$：M步</li><li>第三个$=$：E步，Q函数等于L函数取等条件</li></ul><p>EM的算法的目标函数用了KL散度</p><ul><li>调整z的概率分布，使得q分布和真实后验分布的KL散度为0</li><li>最小化去掉KL散度之后的另一部分</li></ul><p>使用求导更新$\mu$,$\Sigma$</p><p>使用拉格朗日乘子法更新$\pi$（有约束和为0求极值）</p><h4 id="其它"><a class="header-anchor" href="#其它">¶</a>其它</h4><ul><li>只能收敛到局部最优值</li><li>退化到K-means<ul><li>$\gamma_{nk}$ 只取0或者1</li><li>$\pi_k$均分，均取$\dfrac1k$</li><li>$\Sigma = I$</li></ul></li></ul><h3 id="1-5-选择合适的K"><a class="header-anchor" href="#1-5-选择合适的K">¶</a>1.5 选择合适的K</h3><p>核心逻辑：</p><p>平衡最小化loss和模型复杂度</p><h4 id="AIC-BIC"><a class="header-anchor" href="#AIC-BIC">¶</a>AIC &amp; BIC</h4><p>$J = L + D$</p><p>其中$L$是最大似然，$D$是模型复杂度</p><p>AIC中，$D = - d_k$，$J = \ln P(X_N|\hat \Theta_K)-d_k$</p><p>BIC中，$D = -\dfrac12d_k\ln N$， $J = \ln P(X_N|\hat \Theta_K)-\dfrac12d_k\ln N$</p><p>其中$d_k$为模型中参数数量</p><h4 id="VBEM"><a class="header-anchor" href="#VBEM">¶</a>VBEM</h4><p>变分贝叶斯EM（VBEM）引入<strong>贝叶斯思想 + 变分推断</strong>：</p><ul><li>不再求参数的点估计；</li><li>而是求一个近似后验分布 $q(Z, \theta) \approx p(Z, \theta \mid X)$。</li></ul><p>目标变成最小化KL散度：</p><p>$\min_{q(Z,\theta)} D_{KL}(q(Z,\theta) | p(Z,\theta \mid X))$</p><p>因为贝叶斯有前验概率，所以说不重要的簇的前验概率会越来越趋于0，因此可以拟合出K的具体数值</p><h2 id="2-Linear-Models-PCA-FA-ICA"><a class="header-anchor" href="#2-Linear-Models-PCA-FA-ICA">¶</a>2 Linear Models: PCA, FA, ICA</h2><h3 id="2-1-Mathmetical-Backgrounds"><a class="header-anchor" href="#2-1-Mathmetical-Backgrounds">¶</a>2.1 Mathmetical Backgrounds</h3><p>矩阵的内积/Frobenius范数：$\langle A, B \rangle = \mathrm{trace}(A^\top B) = \sum_{i=1}^m \sum_{j=1}^n A_{ij} B_{ij} $</p><p>$l_p$范数：$||x||_p=(|x_1|^p+\cdots+|x_n|^p)^{\frac 1p}$</p><p>P-quadratic norms：对于正定矩阵P，$||x||_P=(x^\top Px)^\frac12=||P^\frac12x||_2$</p><h3 id="2-2-主成分分析PCA"><a class="header-anchor" href="#2-2-主成分分析PCA">¶</a>2.2 主成分分析PCA</h3><h4 id="2-2-1-特征值分解-EVD"><a class="header-anchor" href="#2-2-1-特征值分解-EVD">¶</a>2.2.1 特征值分解 EVD</h4><p>预备知识：特征值分解（EVD）：对于方阵$A$，$A=Q\Lambda Q^{-1}$</p><p>$Av_i=\lambda_i v_i$</p><p>令$Q = \begin{bmatrix}v_1\v_2\\vdots\v_n\end{bmatrix},\Lambda = \begin{bmatrix}\lambda_1\&amp;\lambda_2\&amp;&amp;\ddots\&amp;&amp;&amp;\lambda_n\end{bmatrix}$</p><p>$\therefore AQ=\Lambda Q=Q\Lambda$</p><p>$\therefore A = Q\Lambda Q^{-1}$</p><h4 id="2-2-2-奇异值分解-SVD"><a class="header-anchor" href="#2-2-2-奇异值分解-SVD">¶</a>2.2.2 奇异值分解 SVD</h4><p>以此为基础推导奇异值分解（SVD）对于矩阵$A$，$A=U\Sigma V^\top$，也是旋转-缩放-旋转的逻辑</p><p>$A^\top Av_i=\lambda_i v_i$</p><p>计算模长：$||Av_i||^2=(Av_i)^\top(Av_i)=v_i^\top A^\top Av_i=v_i^\top \lambda_i v_i=\lambda_i v_i^\top v_i=\lambda_i$</p><p>$\sigma_i=\sqrt{\lambda_i}$，$u_i=\dfrac{Av_i}{\sigma_i}$</p><p>易证$u_i$互相垂直</p><p>$\therefore A\begin{bmatrix}v_1&amp;v_2&amp;\cdots&amp;v_n\end{bmatrix}=\begin{bmatrix}u_1&amp;u_2&amp;\cdots u_n\end{bmatrix}\begin{bmatrix}\sigma_1\&amp;\sigma_2\&amp;&amp;\ddots\&amp;&amp;&amp;\sigma_n\end{bmatrix}$</p><p>$\therefore AV=U\Sigma$</p><p>$\therefore A = U\Sigma V^{-1}=U\Sigma V^\top$</p><h4 id="2-2-3-Hebbian-Learning"><a class="header-anchor" href="#2-2-3-Hebbian-Learning">¶</a>2.2.3 Hebbian Learning</h4><p>Hebbian Learning</p><p>如果神经元 $i$ 的输入 $x_i$ 和神经元 $j$ 的输出 $y_j$ 经常同时处于高激活状态，那么它们之间的连接权重 $w_{ij}$ 就会增强。</p><p>输入为 $\mathbf{x}$，输出为 $y = \mathbf{w}^T\mathbf{x}$，则：</p><p>$\Delta \mathbf{w} = \eta y \mathbf{x} = \eta (\mathbf{w}^T\mathbf{x})\mathbf{x}$</p><p>但不稳定，权重会无限增大。</p><p>使用 Oja's Rule增加了一个归一化项（惩罚项）</p><p>$\Delta \mathbf{w} = \eta (y \mathbf{x} - y^2 \mathbf{w})$</p><p>实际上是$\mathbf w_\text{temp}=\mathbf w+\eta y \mathbf x$，$\mathbf w_\text{new}=\dfrac{\mathbf w_\text{temp}}{||w_\text{temp}||}\underbrace{\approx}_{泰勒展开} \mathbf w+\eta(y\mathbf x-y^2\mathbf x)$</p><h3 id="2-3-FA"><a class="header-anchor" href="#2-3-FA">¶</a>2.3 FA</h3><p>$𝒙 = Ay + 𝝁 + 𝒆_t$</p><p><strong>x</strong>: 观测到的数据向量（高维）。</p><p><strong>y</strong>: 潜在因子向量，$p(y)=G(y∣0,I)$。</p><p><strong>A</strong>: 因子载荷矩阵 (Factor Loading Matrix)，类似于线性回归中的系数，描述了因子 y 如何影响观测变量 x。</p><p><strong>μ</strong>: 观测数据的均值向量。</p><p><strong>e</strong>: 唯一性误差向量（或噪声），$p(e)=G(e∣0,\Psi)$。</p><p>e与y独立</p><p>FA有旋转不确定性</p><p>可以使用EM算法</p><h3 id="2-4-Model-selection-for-PCA-FA"><a class="header-anchor" href="#2-4-Model-selection-for-PCA-FA">¶</a>2.4 Model selection for PCA/FA</h3><h4 id="2-4-1-Dimensionality-Reduction"><a class="header-anchor" href="#2-4-1-Dimensionality-Reduction">¶</a>2.4.1 Dimensionality Reduction</h4><p>使用矩阵$W$把$X$投影到$Y$上，其中$X = U\Lambda U^\top$，$U=(W_{n\times m},V)_{n\times n}$</p><p>其保有的信息量$1-\dfrac{\dfrac1N\sum\limits_{t=1}^N||x_t-\hat x_t||}{\dfrac1N\sum\limits_{t=1}^N||x_t||} = \dfrac{\sum\limits_{i=1}^m \lambda_i}{\sum\limits_{i=1}^n \lambda_i}$</p><h3 id="2-4-2-确定合适的特征数"><a class="header-anchor" href="#2-4-2-确定合适的特征数">¶</a>2.4.2 确定合适的特征数</h3><p>也可以使用AIL/BIL/VBEM</p><h3 id="2-5-ICA"><a class="header-anchor" href="#2-5-ICA">¶</a>2.5 ICA</h3><p>独立与相关不等价，但是在高斯分布中，两者等价</p><p>Natural measure of statistical dependence:</p><p>$I(x;y)=\sum\limits_y\sum\limits_x p(x,y)\log\left(\dfrac{p(x,y)}{p(x)p(y)}\right)$</p><p>$I(x;y)=\int\limits_y\int\limits_x p(x,y)\log\left(\dfrac{p(x,y)}{p(x)p(y)}\right)\text d x\text d y$</p><p>ICA只能分离非高斯的独立成分</p><p>ICA的缺陷：无法恢复原有的幅度和顺序</p><p>无法恢复幅度：$x=As=\sum\limits_{i=1}^n as_i=\sum\limits_{i=1}^n (a \lambda_i^{-1})\cdot(\lambda_i s_i)$</p><p>无法恢复顺序：对于置换矩阵P，$x=As=(AP^{-1})\cdot(Ps)$</p><h4 id="2-5-1-度量非高斯性"><a class="header-anchor" href="#2-5-1-度量非高斯性">¶</a>2.5.1 度量非高斯性</h4><h5 id="峰度：Kurtosis-or-the-fourth-order-cumulant"><a class="header-anchor" href="#峰度：Kurtosis-or-the-fourth-order-cumulant">¶</a>峰度：Kurtosis or the fourth order cumulant</h5><p>$\text{kurt}(y)=E[y^4]-3E[y^2]^2$</p><p>&lt;0则subgaussian</p><p>&gt;0则super-gaussian</p><p>但是对异常值非常敏感</p><h5 id="负熵——理论上最完美的度量"><a class="header-anchor" href="#负熵——理论上最完美的度量">¶</a>负熵——理论上最完美的度量</h5><p>在方差相同的情况下，高斯变量拥有最大的熵</p><p>负熵定义为$J(y)=H(y_\text{gauss})-H(y)$</p><p>越大越高斯</p><p>计算非常困难</p><h5 id="互信息"><a class="header-anchor" href="#互信息">¶</a>互信息</h5><p>$I(y_1,\cdots,y_n)=\sum\limits_i^n H(y_i)-H(y)=C-\sum\limits_i^n J(y_i)$</p><p>实际上是$p(y_1,\cdots,y_n)$和$p(y_1)\cdots p(y_n)$之间的KL散度</p><h5 id="FastICA"><a class="header-anchor" href="#FastICA">¶</a>FastICA</h5><p>杀死了游戏</p><h3 id="2-6-Noisy-ICA-IFA"><a class="header-anchor" href="#2-6-Noisy-ICA-IFA">¶</a>2.6 Noisy ICA/IFA</h3><p>也是通过GMM，把分类看作是多个高斯分布的组合</p><p>和GMM的区别在于，GMM的隐状态只有一层（属于哪一个高斯分布）</p><p>$\gamma_1$,$\gamma_2$ 等等时通过ICA分离获得的独立成分（用向量表示，也就是混合向量）</p><p>但是我们有了这个独立成分的向量表示之后，实际上依旧没有把原来的数据分离成不同的组</p><p>因此我们使用GMM</p><p>对于每一个独立成分，把它变成若干个高斯分布之和</p><p>但是Noisy ICA的隐状态有两层（数据属于哪一个GMM，GMM属于哪一个$y_i$，都是软分布）</p><p>GMM是$x=y$，没有系数$\Lambda$，没有误差$e$</p><p>ICA中$x=\Lambda y+e$，有系数$\Lambda$保证属于不同信号的数据，乘了一个不同的系数,，同时还增加了误差项fghgg</p><hr><p>老师有一个很好的板书</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">flowchart LR</span><br><span class="line">data--&gt;|&quot;p(y|x)&quot;|y</span><br><span class="line">y--&gt;|Ay+e|data</span><br><span class="line"></span><br></pre></td></tr></table></figure><ul><li>y~Gaussian→PCA/FA, x~G</li><li>y~Non-G→ICA/NFA, x~GMM</li><li>Nonlinear f(y)→VAE, x~Non-G</li></ul><p>Tradeoff:</p><ul><li>model<ul><li>powerful</li><li>flexible</li><li>complex</li></ul></li><li>computation<ul><li>easy</li><li>simple</li></ul></li></ul><h2 id="3-监督学习"><a class="header-anchor" href="#3-监督学习">¶</a>3 监督学习</h2><h3 id="3-1-线性回归"><a class="header-anchor" href="#3-1-线性回归">¶</a>3.1 线性回归</h3><p>最小化均方误差$\min\limits |x-\hat x|^2$</p><h3 id="3-2-Logisitic回归"><a class="header-anchor" href="#3-2-Logisitic回归">¶</a>3.2 Logisitic回归</h3><p>就是sigmoid</p><p>$p(x)=P(Y=1|x)=\dfrac{e^{\beta_0+\beta_1X}}{1+e^{\beta_0+\beta_1X}}=\dfrac{1}{1+e^{-(\beta_0+\beta_1X)}}$</p><p>改进为多变量：</p><p>$p(X)=P(Y=1|X)=\dfrac{e^{\beta_0+\beta_1X_1+\beta_2X_2+\cdots\beta_pX_p}}{1+e^{\beta_0+\beta_1X_1+\beta_2X_2+\cdots\beta_pX_p}}=\dfrac{1}{1+e^{-(\beta_0+\beta_1X_1+\beta_2X_2+\cdots\beta_pX_p)}}$</p><p>改进为多分类</p><p>$P(Y=k|X)=\dfrac{e^{\beta_{0k}+\beta_{1k}X_1+\beta_{2k}X_2+\cdots\beta_{pk}X_p}}{1+\sum\limits_{i=1}^ne^{\beta_{0i}+\beta_{1i}X_1+\beta_{2i}X_2+\cdots\beta_{pi}X_p}}$</p><p>为了防止过拟合，需要加入正则项，即参数的平方，所以$J=\dfrac 1{2m}\left[\sum\limits_{i=1}^m(\hat y-y)^2+\lambda\sum\limits_{j=1}^n\theta_j^2 \right]$\</p><p>正则化可以使用各种范数</p><ul><li>LASSO：L1范数，比较严格</li><li>Ridge：L2范数，比较温和（事实上，从贝叶斯的视角，L2正则化就是在相信数据和相信先验常识之间平衡）</li><li>Elastic：两者混合，介于两者中间</li></ul><h3 id="3-3-神经网络-Neural-Network-NN"><a class="header-anchor" href="#3-3-神经网络-Neural-Network-NN">¶</a>3.3 神经网络/Neural Network/NN</h3><p>梯度下降算法</p><p>每一层都是线性函数+Activation（非线性）函数（tanh，sigmoid，ReLU等）</p><p>也需要正则化</p><h3 id="3-4-深度神经网络-Deep-Neural-Networks-DNN"><a class="header-anchor" href="#3-4-深度神经网络-Deep-Neural-Networks-DNN">¶</a>3.4 深度神经网络/Deep Neural Networks/DNN</h3><h4 id="3-4-1-CNN"><a class="header-anchor" href="#3-4-1-CNN">¶</a>3.4.1 CNN</h4><p>加入了卷积层和池化层</p><p>还有一些技巧——正则化、BatchNorm、Dropout</p><h4 id="3-4-2-ResNet"><a class="header-anchor" href="#3-4-2-ResNet">¶</a>3.4.2 ResNet</h4><p>增加了一些旁路跳过一些块</p><h4 id="3-4-3-DenseNet"><a class="header-anchor" href="#3-4-3-DenseNet">¶</a>3.4.3 DenseNet</h4><p>每两个块之间都有旁路连接</p><p>ResNet的超级升级</p><h4 id="3-4-4-RNN-Recurrent-NN"><a class="header-anchor" href="#3-4-4-RNN-Recurrent-NN">¶</a>3.4.4 RNN/Recurrent NN</h4><p>上一个输出的token作为下一个输入的token</p><h4 id="3-4-5-Transformer"><a class="header-anchor" href="#3-4-5-Transformer">¶</a>3.4.5 Transformer</h4><p>ATTENTION IS ALL YOU NEED！</p><p>伟大，无需多言</p><p>自己去看论文吧</p><p>大概就是</p><p>Query、Key、Value</p><h4 id="3-4-6-GNN-Graph-NN"><a class="header-anchor" href="#3-4-6-GNN-Graph-NN">¶</a>3.4.6 GNN/Graph NN</h4><p>按顺序遍历所有节点，先聚合节点的邻居节点，再与节点自己的数据聚合</p><p>使用时接一个classifer，梯度回传是按照GNN的规则回传若干轮（轮数决定感受野）</p><h4 id="3-4-7-GCN"><a class="header-anchor" href="#3-4-7-GCN">¶</a>3.4.7 GCN</h4><p>GNN基础上小改进：把聚合自己节点看作有一个自环；聚合的时候要归一化</p><h4 id="3-4-8-支持向量机-SVM"><a class="header-anchor" href="#3-4-8-支持向量机-SVM">¶</a>3.4.8 支持向量机/SVM</h4><p>逻辑是把所有的数据投影到一个超空间上，然后用一个超平面将超空间分成两类，使得所有样本到超平面的最小几何间隔最大化</p><h5 id="实现"><a class="header-anchor" href="#实现">¶</a>实现</h5><h6 id="第一步：模型定义与几何间隔"><a class="header-anchor" href="#第一步：模型定义与几何间隔">¶</a>第一步：模型定义与几何间隔</h6><p>假定数据是$D={(x_1,y_1),(x_2,y_2),\cdots,(x_n,y_n)}$，$x_i\in\mathbb R^d,y_i\in{-1,1}$</p><p>线性超平面为$w^\top x+b=0$，其中$w$是法向量，$b$是截距</p><p>$x_i$到超平面的集合距离为$\gamma_i$为</p><p>$\gamma_i=\dfrac{|w^\top x_i+b|}{||w||}=\dfrac{y_i(w^\top x_i+b)}{||w||}$</p><h6 id="第二步：目标函数拟定"><a class="header-anchor" href="#第二步：目标函数拟定">¶</a>第二步：目标函数拟定</h6><p>目标函数是$\max\limits_{w,b}\min\limits_{i}\dfrac{y_i(w^\top x_i+b)}{||w||}$</p><p>等比例缩放$w$和$b$不改变超平面，为了计算方便，令距离最近的点满足$y_i(w^\top x_i+b)=1$</p><p>此时目标函数是$\max_\limits{w,b}\dfrac1{||w||}$，即$\min\limits_{w,b}\dfrac12||w||^2$，s.t. $1-y_i(w^\top x_i+b)\leq 0$</p><h6 id="第三步：拉格朗日对偶化"><a class="header-anchor" href="#第三步：拉格朗日对偶化">¶</a>第三步：拉格朗日对偶化</h6><p>引入拉格朗日乘子$\alpha_i\geq0$</p><p>$L(w,b,\alpha)=\dfrac12||w||^2+\sum\limits_{i=1}^n\alpha_i[1-y_i(w^\top x_i+b)]$</p><p>求极小值：</p><ol><li>$\dfrac{\partial L}{\partial w}=w-\sum\limits_{i=1}^n\alpha_iy_ix_i=0\Rightarrow w = \sum\limits_{i=1}^n\alpha_iy_ix_i$</li><li>$\dfrac{\partial L}{\partial b}=-\sum\limits_{i=1}^n \alpha_iy_i=0\Rightarrow \sum\limits_{i=1}^n \alpha_iy_i=0$</li></ol><p>代入得到对偶问题：</p><p>$\max\limits_\alpha\sum\limits_{i=1}^n \alpha_i-\dfrac12\sum\limits_{i=1}^n\sum\limits_{j=1}^n\alpha_i\alpha_jy_iy_j(x_i^\top x_j)$，s.t.$\sum\limits_{i=1}^n \alpha_iy_i=0$，$\alpha_i\geq 0$</p><h6 id="第四步：KKT-条件与支持向量"><a class="header-anchor" href="#第四步：KKT-条件与支持向量">¶</a>第四步：KKT 条件与支持向量</h6><p>通过数值优化算法计算出$\alpha^*$</p><p>代入，算$w^*$</p><p>对于所有$a_s&gt;0$，应满足$y_s(w^\top x_s+b)=1$，算出$b^*$，理论上算出来都相等的，但是由于浮点误差，一般取均值</p><h5 id="升级"><a class="header-anchor" href="#升级">¶</a>升级</h5><h6 id="实现软约束"><a class="header-anchor" href="#实现软约束">¶</a>实现软约束</h6><p>新的约束条件：$y_i(w^\top x_i+b)\geq 1-\xi_i$</p><p>新的loss function：$\min\limits_{w,b}\dfrac12||w||^2+C\sum\limits_{i=1}^N\xi_i$</p><h6 id="核函数"><a class="header-anchor" href="#核函数">¶</a>核函数</h6><p>$L(\alpha)=\max\limits_\alpha\sum\limits_{i=1}^n \alpha_i-\dfrac12\sum\limits_{i=1}^n\sum\limits_{j=1}^n\alpha_i\alpha_jy_iy_j(x_i^\top x_j)$，这里把$(x_i^\top x_j)$换成$\mathbf K(x_i,x_j)$即可</p><p>一般有多项式核、RBF核（高斯核）</p><p>核函数的要求：Mercer‘s Condition，即需要是一个合法的内积，也就是要具有非负性、正定性、非负性</p><h3 id="3-5-Deep-Generative-Models"><a class="header-anchor" href="#3-5-Deep-Generative-Models">¶</a>3.5 Deep Generative Models</h3><h4 id="VAE-变分AutoEncoder"><a class="header-anchor" href="#VAE-变分AutoEncoder">¶</a>VAE/变分AutoEncoder</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">flowchart LR</span><br><span class="line">A[&quot;数据&quot;]--&gt;|encoder|B[&quot;隐变量&quot;]--&gt;|decoder|C[&quot;数据&quot;]</span><br></pre></td></tr></table></figure><p>实际上和FA非常像，$X=f(z;\theta)+\epsilon$</p><p>f使用了一个复杂的模型（decoder），数学上计算z太复杂，因此使用模型快速计算（encoder）</p><p>流程：</p><ol><li><strong>群体编码 (Encoder)</strong>：将猫、狗、鸟等不同数据输入同一编码器。模型不再赋予每张图孤立的坐标，而是将它们映射为隐空间中各具特征的<strong>高斯分布区</strong>（由各自的 μ 和 σ 定义）。</li><li><strong>随机采样 (Sampling)</strong>：在训练时，从这些分布中抽取出隐变量 z。通过<strong>重参数化</strong>，确保猫的 z 落在“猫区”，鸟的 z 落在“鸟区”。</li><li><strong>协同解码 (Decoder)</strong>：同一个解码器学习如何根据 z 所在的区域，“翻译”出对应的物种。</li><li><strong>双重约束 (Loss)</strong>：<ul><li><strong>重构项</strong>：让模型分清物种特征（猫还原成猫，不能变狗）。</li><li><strong>KL 散度项</strong>：像引力一样把猫、狗、鸟的分布全部拉向原点，迫使它们<strong>紧凑排列</strong>。</li></ul></li></ol><p><strong>最终效果</strong>：在同一个隐空间内，猫、狗、鸟形成了既相互独立（方便区分）又彼此邻接（连续可过渡）的<strong>聚类结构</strong>，使得模型只需在原点附近采样，就能生成各种具备物种特征的新样本。</p><p>解释“重参数化”，因为随机采样不能回传梯度，所以改为$z=\mu+\sigma\odot\epsilon$，其中$\epsilon\sim N(0,I)$，是噪声，不参与反向传播</p><p>升级：CVAE，把隐变量z和tag一起输入给decoder，方便人为控制输出（输出的种类，输出的方向等等）</p><h4 id="GAN"><a class="header-anchor" href="#GAN">¶</a>GAN</h4><p>核心思想：左右互搏</p><p>训练一个生成器和判别器，螺旋进步上升</p><h4 id="Diffusion"><a class="header-anchor" href="#Diffusion">¶</a>Diffusion</h4><p>先通过不断加噪将图像彻底“毁灭”为随机像素，再训练模型学习如何一步步逆转这个过程，从纯噪声中“还原”出富有结构的数据。</p><h4 id="对比"><a class="header-anchor" href="#对比">¶</a>对比</h4><table><thead><tr><th><strong>模型</strong></th><th><strong>核心逻辑（一句话比喻）</strong></th><th><strong>最大的优点</strong></th><th><strong>最大的缺点</strong></th></tr></thead><tbody><tr><td><strong>VAE</strong></td><td><strong>压缩包</strong>：把照片压得很小，再解压回来。</td><td>听话、稳定、不崩盘。</td><td>画质模糊，像隔了层雾。</td></tr><tr><td><strong>GAN</strong></td><td><strong>造假币</strong>：造假者和警察打架，打着打着造假技术就神了。</td><td>画质最清晰、速度快。</td><td>脾气臭，极难训练，容易钻牛角尖。</td></tr><tr><td><strong>Diffusion</strong></td><td><strong>变魔术</strong>：把照片磨成灰，再练习把灰尘变回照片。</td><td>画质最美，最有创意。</td><td>慢，得一步步变，很费时间。</td></tr></tbody></table><p>变分下界：最大化概率，用对数似然实现</p><h2 id="4-因果性"><a class="header-anchor" href="#4-因果性">¶</a>4 因果性</h2><h3 id="4-1-表示方法"><a class="header-anchor" href="#4-1-表示方法">¶</a>4.1 表示方法</h3><h4 id="4-1-1-Structural-Causal-Model-SCM"><a class="header-anchor" href="#4-1-1-Structural-Causal-Model-SCM">¶</a>4.1.1 Structural Causal Model/SCM</h4><p>Treatment = {0,1}两种可能性</p><p>Outcomes: Y~1~,Y~0~</p><p>要计算Individual causal effect (ICE) = Y~1~-Y~0~</p><p>但是一般性实验组和对照组，都只能计算Y~1~和Y~0~中的一个</p><p>解决方法：随机试验、使用倾向性得分来降维、逆概率加权</p><h4 id="4-1-2-Structural-Equation-Models-SEM"><a class="header-anchor" href="#4-1-2-Structural-Equation-Models-SEM">¶</a>4.1.2 Structural Equation Models/SEM</h4><p>多元回归分析和因子分析的“合体”</p><h4 id="4-1-3-Directed-Acyclic-Graph-DAG"><a class="header-anchor" href="#4-1-3-Directed-Acyclic-Graph-DAG">¶</a>4.1.3 Directed Acyclic Graph/DAG</h4><p>使用有向无环图来表示因果</p><h4 id="4-1-4-Functional-Causal-Model-FCM"><a class="header-anchor" href="#4-1-4-Functional-Causal-Model-FCM">¶</a>4.1.4 Functional Causal Model/FCM</h4><p>把p(y|x)变成了p(y|do(x))</p><h3 id="4-2-发现因果算法"><a class="header-anchor" href="#4-2-发现因果算法">¶</a>4.2 发现因果算法</h3><h4 id="4-2-1-PC算法"><a class="header-anchor" href="#4-2-1-PC算法">¶</a>4.2.1 PC算法</h4><ol><li><strong>初始化：</strong> 开始时，算法假设所有变量之间都有关联，画出一个<strong>全连接的无向图</strong>（Skeleton）。</li><li><strong>骨架修剪（基于独立性检验）：</strong> 算法会逐一检查每一对变量。如果在给定某些变量集合 S 的情况下，发现 X 和 Y 是独立的（即满足 <strong>d-separation</strong>），那么就<strong>删掉</strong> X 和 Y 之间的连线。<ul><li>它先检查 0 阶独立（无条件独立），再检查 1 阶（给定 1 个变量时独立），以此类推，直到无法再删除边。</li></ul></li><li><strong>确定方向：</strong> 剩下的连线是“确定有因果关系”的骨架，算法随后利用逻辑规则（如 <strong>v-structure</strong> 识别）来确定箭头的指向。</li></ol><p>一般输出的是一个等价类图（马尔可夫等价类），而不是DAG，不是所有的都能判断方向</p><h4 id="4-2-2-LiNGAM"><a class="header-anchor" href="#4-2-2-LiNGAM">¶</a>4.2.2 LiNGAM</h4><p>LiNGAM 模型之所以能比传统 SEM 识别出更多的方向，是因为它引入了更强的假设：</p><ol><li><strong>线性（Linear）：</strong> 变量之间的关系是线性的，即 Xi=∑βijXj+ei。</li><li><strong>非高斯（Non-Gaussian）：</strong> 干扰项（误差项） e 必须服从<strong>非高斯分布</strong>（例如均匀分布、拉普拉斯分布等）。这是该模型最关键的创新点。</li><li><strong>无环（Acyclic）：</strong> 因果结构图中不存在环路（即它是一个 DAG）。</li></ol><h3 id="4-3-量化因果强弱算法"><a class="header-anchor" href="#4-3-量化因果强弱算法">¶</a>4.3 量化因果强弱算法</h3><h4 id="4-2-2-do-calculus"><a class="header-anchor" href="#4-2-2-do-calculus">¶</a>4.2.2 do-calculus</h4><p>do-演算由三条基础规则组成。在推导过程中，我们会对因果图进行微小的“手术”：</p><ul><li><strong>规则 1：观察的插入/删除（针对无关信息）</strong> 如果在图中，Z 对 Y 的信息流被阻断了，那么在给定 X 的情况下，Z 对于预测 Y 是没用的。<ul><li><strong>数学表示：</strong> P(y∣do(x),z,w)=P(y∣do(x),w)</li></ul></li><li><strong>规则 2：行动与观察的交换（针对后门路径）</strong> 如果你已经控制（Condition on）了足够的变量 Z，使得 X 到 Y 之间没有混杂因素的影响，那么“强制干预 X”的效果就等同于“观察到 X”。这就是所谓的<strong>后门准则</strong>。<ul><li><strong>数学表示：</strong> P(y∣do(x),do(z),w)=P(y∣x,do(z),w)</li></ul></li><li><strong>规则 3：行动的插入/删除（针对无因果关系）</strong> 如果从 X 到 Y 根本没有因果路径，那么强制改变 X 对 Y的分布完全没有影响。<ul><li><strong>数学表示：</strong> P(y∣do(x),w)=P(y∣w)</li></ul></li></ul><h2 id="Appendix"><a class="header-anchor" href="#Appendix">¶</a>Appendix</h2><h3 id="基础元素导数"><a class="header-anchor" href="#基础元素导数">¶</a>基础元素导数</h3><table><thead><tr><th style="text-align:center"><strong>表达式 (导数形式)</strong></th><th><strong>结果</strong></th></tr></thead><tbody><tr><td style="text-align:center">$[\dfrac{\partial \mathbf{x}}{\partial y}]_i$ (向量对标量)</td><td>$\dfrac{\partial x_i}{\partial y}$</td></tr><tr><td style="text-align:center">$[\dfrac{\partial x}{\partial \mathbf{y}}]_i$ (标量对向量)</td><td>$\dfrac{\partial x}{\partial y_i}$</td></tr><tr><td style="text-align:center">$[\dfrac{\partial \mathbf{x}}{\partial \mathbf{y}}]_{ij}$ (向量对向量 - Jacobian)</td><td>$\dfrac{\partial x_i}{\partial y_j}$</td></tr></tbody></table><h3 id="向量线性形式求导"><a class="header-anchor" href="#向量线性形式求导">¶</a>向量线性形式求导</h3><p>| <strong>表达式 (导数形式)</strong>                                        | <strong>结果</strong>                                                     |<br>| :------------------------------------------------------------: |: ------------------------------------------------------------: |<br>| $\dfrac{\partial (\mathbf{a}^\top \mathbf{x})}{\partial \mathbf{x}} = \dfrac{\partial (\mathbf{x}^\top \mathbf{a})}{\partial \mathbf{x}}$ | $\mathbf{a}$                                                 |<br>| $\dfrac{\partial (\mathbf{x}^\top \mathbf{x})}{\partial \mathbf{x}}$ | $2\mathbf{x}$                                                |</p><h3 id="矩阵双线性形式求导"><a class="header-anchor" href="#矩阵双线性形式求导">¶</a>矩阵双线性形式求导</h3><table><thead><tr><th style="text-align:center"><strong>表达式 (导数形式)</strong></th><th><strong>结果</strong></th></tr></thead><tbody><tr><td style="text-align:center">$\dfrac{\partial (\mathbf{a}^\top \mathbf{X} \mathbf{b})}{\partial \mathbf{X}}$</td><td>$\mathbf{a} \mathbf{b}^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial (\mathbf{a}^\top \mathbf{X}^\top \mathbf{b})}{\partial \mathbf{X}}$</td><td>$\mathbf{b} \mathbf{a}^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial (\mathbf{a}^\top \mathbf{X} \mathbf{a})}{\partial \mathbf{X}} = \dfrac{\partial (\mathbf{a}^\top \mathbf{X}^\top \mathbf{a})}{\partial \mathbf{X}}$</td><td>$\mathbf{a} \mathbf{a}^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial \mathbf a^\top \mathbf X \mathbf a}{\partial \mathbf a}=\dfrac{\partial \mathbf a^\top \mathbf X^\top \mathbf a}{\partial \mathbf a}$</td><td>$\mathbf X+\mathbf  X^\top a$</td></tr></tbody></table><h3 id="迹函数求导"><a class="header-anchor" href="#迹函数求导">¶</a>迹函数求导</h3><table><thead><tr><th style="text-align:center"><strong>表达式 (导数形式)</strong></th><th><strong>结果</strong></th></tr></thead><tbody><tr><td style="text-align:center">$\dfrac{\partial \mathrm{Tr}(\mathbf{A}\mathbf{X}\mathbf{B})}{\partial \mathbf{X}}$</td><td>$\mathbf{A}^\top \mathbf{B}^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial \mathrm{Tr}(\mathbf{X}\mathbf{X}^\top)}{\partial \mathbf{X}}$</td><td>$2\mathbf{X}$</td></tr><tr><td style="text-align:center">$\dfrac{\partial \mathrm{Tr}(\mathbf{A} (\mathbf{X} \circ \mathbf{Y}))}{\partial \mathbf{X}}$</td><td>$\mathbf{A}^\top \circ \mathbf{Y}$</td></tr><tr><td style="text-align:center">$\dfrac{\partial\mathrm {tr}(\mathbf X^{-1}\mathbf A)}{\partial \mathbf X}$</td><td>$-(\mathbf X^{-1}\mathbf A\mathbf X^{-1})^\top$</td></tr></tbody></table><h3 id="行列矩阵求导"><a class="header-anchor" href="#行列矩阵求导">¶</a>行列矩阵求导</h3><table><thead><tr><th style="text-align:center"><strong>表达式 (导数形式)</strong></th><th><strong>结果</strong></th></tr></thead><tbody><tr><td style="text-align:center">$\dfrac{\partial \det(\mathbf{X})}{\partial \mathbf{X}}$</td><td>$\det(\mathbf{X})(\mathbf{X}^{-1})^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial \ln(\det(\mathbf{X}))}{\partial \mathbf{X}}$</td><td>$(\mathbf{X}^{-1})^\top$</td></tr><tr><td style="text-align:center">$\dfrac{\partial \mathbf{Y}^{-1}}{\partial x}$ (矩阵逆对标量)</td><td>$-\mathbf{Y}^{-1} \dfrac{\partial \mathbf{Y}}{\partial x} \mathbf{Y}^{-1}$</td></tr><tr><td style="text-align:center">$\partial \mathbf X^{-1}$</td><td>$-\mathbf X^{-1}\partial \mathbf X\mathbf X^{-1}$</td></tr></tbody></table><h3 id="其它公式"><a class="header-anchor" href="#其它公式">¶</a>其它公式</h3><ol><li>马氏距离：$D_M(x)=\sqrt{(x-\mu)^TS^{-1}(x-\mu)}$</li><li>协方差矩阵：$S=\dfrac1{N-1}\sum\limits_{i=1}^N(x_i-\bar x)(x_i-\bar x)^T$</li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;机器学习&lt;/h1&gt;
&lt;h2 id=&quot;1-聚类&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-聚类&quot;&gt;¶&lt;/a&gt;1 聚类&lt;/h2&gt;
&lt;h3 id=&quot;1-1-K-means&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-1-K-</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>计算理论</title>
    <link href="https://ryanstarfox.github.io/2026/01/09/2026/20260109%20%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA/"/>
    <id>https://ryanstarfox.github.io/2026/01/09/2026/20260109%20%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA/</id>
    <published>2026-01-09T03:08:00.000Z</published>
    <updated>2026-01-09T03:08:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>计算理论</h1><h2 id="1-Finite-Automata-and-Regular-Languages"><a class="header-anchor" href="#1-Finite-Automata-and-Regular-Languages">¶</a>1 Finite Automata and Regular Languages</h2><table><thead><tr><th style="text-align:center">Machine</th><th style="text-align:center">Semantics</th><th style="text-align:center">Syntax</th></tr></thead><tbody><tr><td style="text-align:center">DFA</td><td style="text-align:center">Regular</td><td style="text-align:center">Regular Grammer</td></tr><tr><td style="text-align:center">NFA</td><td style="text-align:center">Regular</td><td style="text-align:center">Regular Grammer</td></tr></tbody></table><h3 id="1-1-Deterministic-Finite-Automata-DFA"><a class="header-anchor" href="#1-1-Deterministic-Finite-Automata-DFA">¶</a>1.1 Deterministic Finite Automata (DFA)</h3><p>定义：五元组$(Q,\Sigma,\delta,q_0,F)$</p><ol><li>(Q) is a finite set called the <strong>states</strong></li><li>(\Sigma) is a finite set called the <strong>alphabet</strong></li><li>(\delta: Q \times \Sigma \to Q) is the <strong>transition function</strong></li><li>(q_0 \in Q) is the <strong>start state</strong></li><li>(F \subseteq Q) is the set of <strong>accept states</strong></li></ol><p>注意其中第三条，(Q)中任意一个元素，都要和$\Sigma$中任意一个元素有这样一个函数</p><h3 id="1-2-Nondeterministic-Finite-Automata-NFA"><a class="header-anchor" href="#1-2-Nondeterministic-Finite-Automata-NFA">¶</a>1.2 Nondeterministic Finite Automata (NFA)</h3><p>也是五元组$(Q,\Sigma,\delta,q_0,F)$，第三条不太一样</p><ol><li>(Q) is a finite set called the <strong>states</strong>,</li><li>(\Sigma) is a finite set called the <strong>alphabet</strong>,</li><li>(\delta: Q \times \Sigma_\epsilon \to \mathcal{P}(Q)) is the <strong>transition function</strong>, where  (\Sigma_\epsilon = \Sigma \cup {\epsilon}),</li><li>(q_0 \in Q) is the <strong>start state</strong>,</li><li>(F \subseteq Q) is the set of <strong>accept states</strong>.</li></ol><h3 id="1-3-DFA-NFA"><a class="header-anchor" href="#1-3-DFA-NFA">¶</a>1.3 DFA &amp; NFA</h3><p>任意一个NFA都存在和它等价的DFA</p><p>使用NFA节点的集合作为DFA的节点即可</p><p>$(Q,\Sigma,\delta,q_0,F)\to(P(Q),\Sigma,\delta',E(q_0),F')$</p><ol><li><p>$Q\to P(Q)$取幂集</p></li><li><p>$\delta\to\delta':\delta'(R,a)=\bigcup{E(q)|q\in Q\wedge(\exists r\in R)(q\in \delta(r,a))}$</p></li><li><p>$q_0\to E(q_0)$</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">initially set E(q) = &#123;q&#125;;</span><br><span class="line">    repeat</span><br><span class="line">        E′(q) = E(q)</span><br><span class="line">        ∀x∈E(q),if ∃y∈δ(x,ϵ) ∧y̸∈E(q),E(q) = E(q) ∪&#123;y&#125;</span><br><span class="line">    until E(q) = E′(q)</span><br><span class="line">return E(q)</span><br></pre></td></tr></table></figure></li><li><p>$F'={R\in Q'|R\cap F\ne\varnothing}$</p></li></ol><h3 id="1-4-Regular"><a class="header-anchor" href="#1-4-Regular">¶</a>1.4 Regular</h3><p>A language is called regular if some finite automata recognizes it.</p><p>具有封闭性的运算：</p><ul><li><strong>Union</strong>：$A\cup B={x|x\in A\vee x\in B}$</li><li><strong>Concatenation</strong>: $A\circ B={xy|x\in A\wedge y\in B}$</li><li><strong>Kleene Star</strong>: $A^*={x_1x_2\cdots x_k|k\geq 0 \wedge x_i\in A}$</li><li><strong>Complement</strong>: $\bar A={x|x\notin A}$</li></ul><p>注意：</p><p>$(01)^<em>\epsilon=(01)^</em>$</p><p>$(01)^*\varnothing=\varnothing$</p><p>** $\varnothing^\ast={\epsilon}$**</p><h3 id="1-5-Pumping-Lemma"><a class="header-anchor" href="#1-5-Pumping-Lemma">¶</a>1.5 Pumping Lemma</h3><p>证明不是正则语言：pumping lemma<br>对每个无限正规语言 $L$，存在一个常数 $p \ge 1$（pumping length），使得<br>对任意字符串 $s \in L$ 且 $|s| \ge p$，可以写成：$s = xyz$，满足：</p><ol><li>$|xy| \le p $（前 p 个字符内包含 x 和 y）</li><li>$|y| \ge 1$ （y 至少非空）</li><li>对所有 $i \ge 0$，$xy^i z \in L$</li></ol><p>证明是正则语言：构造一个DFA或者NFA</p><p>满足pumping lemma是正则语言的必要不充分条件</p><p>pumping lemma的证明使用抽屉原理</p><p>它只是必要条件，但不充分。满足Pumping Lemma但不是正则语言的反例：</p><ol><li>$L={a^nb^nc^n}\cup{a^ib^jc^k|i,j,k不全相等}$</li><li>$L={a^ib^jc^j|i\geq1,j\geq0}\cup{b^ic^j|i,j\geq0}$</li><li>$L={a^ib^jc^k|i=0\or j=k}$</li></ol><h3 id="1-6-三个问题"><a class="header-anchor" href="#1-6-三个问题">¶</a>1.6 三个问题</h3><h4 id="Q1-Acceptance-w-in-L-A-？"><a class="header-anchor" href="#Q1-Acceptance-w-in-L-A-？">¶</a>Q1: Acceptance: $w\in L(A)$？</h4><p>可以解决，走一遍就可以了</p><h4 id="Q2-Emptiness-L-A-varnothing"><a class="header-anchor" href="#Q2-Emptiness-L-A-varnothing">¶</a>Q2: Emptiness: $L(A)=\varnothing$?</h4><p>可以解决，看看所有可能的路径能不能走通就行</p><h4 id="Q3-Equality-L-A-L-B"><a class="header-anchor" href="#Q3-Equality-L-A-L-B">¶</a>Q3: Equality: $L(A)=L(B)$?</h4><p>可以解决</p><p>$\Leftrightarrow L(A)\oplus L(B)=\varnothing$</p><h2 id="2-Context-Free-Languages"><a class="header-anchor" href="#2-Context-Free-Languages">¶</a>2 Context Free Languages</h2><h3 id="2-1-Definition"><a class="header-anchor" href="#2-1-Definition">¶</a>2.1 Definition</h3><p>定义：四元组$(V,\Sigma,R,S)$</p><ol><li>$V$ is a finite set called the variables,</li><li>$\Sigma$ is a finite set, disjoint from V, called the terminals,</li><li>$R$ is a finite set of rules, with each rule being a variable and a string of variables and terminals,</li><li>$S\in V$ is the start variable.</li></ol><h3 id="2-2模糊性"><a class="header-anchor" href="#2-2模糊性">¶</a>2.2模糊性</h3><ol><li>规定优先级：Leftmost Derivation，先展开左边的</li></ol><p>但是依旧不能解决模糊性，之后的称为真正的模糊性</p><p>事实上：</p><ol><li>不存在去除一个CFG的Ambiguity的算法</li><li>不存在一个判断任何CFG是否Ambiguous的算法</li></ol><h3 id="2-3-Chomsy范式"><a class="header-anchor" href="#2-3-Chomsy范式">¶</a>2.3 Chomsy范式</h3><p>定义：</p><ol><li>只允许$A\to BC$或者$A\to a$，其中$a$是终结符，$B，C$是非起始变量的变量</li><li>允许$S\to\epsilon$，其中$S$为起始符</li></ol><p>定理：</p><ol><li>所有CFG都可以用Chomsy范式解释</li><li>$\forall G\in\text{CFG},w\in L(G),w\ne\epsilon$ can be derived from the start state in exactly $2|w|-1$ steps</li></ol><h3 id="2-4-Pushdown-Automata-PDA"><a class="header-anchor" href="#2-4-Pushdown-Automata-PDA">¶</a>2.4 Pushdown Automata (PDA)</h3><p>CFG对应的机器是 Pushdown automata</p><p>定义是六元组$(Q,\Sigma,\Gamma,\delta,q_0,F)$</p><ol><li>$Q$ is a finite set of states,</li><li>$\Sigma$ is a finite set of input alphabet,</li><li>$\Gamma$ is a finite set of stack alphabet,</li><li>$\delta$: $Q×\Sigma_ϵ ×\Gamma_ϵ →\mathcal P(Q×\Gamma_ϵ)$ is the transition function,</li><li>$q_0 ∈Q$ is the start state,</li><li>$F ⊆Q$ is the set of accept states.</li></ol><p>其实就是压栈弹栈的过程</p><p>需要有一个起始符，先压入栈，表示栈底</p><h3 id="2-5-CFG等价于PDA"><a class="header-anchor" href="#2-5-CFG等价于PDA">¶</a>2.5 CFG等价于PDA</h3><ul><li><p>已知CFG，构造PDA：画出状态转移图即可</p></li><li><p>已知PDA，构造CFG：</p><ul><li><p>简化PDA</p><ul><li>只有一个接受状态</li><li>接受状态后栈空</li><li>每次转换仅仅压栈一次或者弹栈一次</li></ul></li><li><p>分类构造CFG</p><p>Give $(Q, Σ, Γ, δ, q_0, q_{accept})$. We construct CFL $G$.<br>with variables set ${A_{pq} | p, q ∈ Q}$, start variable $A_{q_0,q_{accept}}$. The rules are as followings:</p><ol><li>For each $p, q, r, s ∈ Q$, $u ∈ \Gamma$, and $a, b ∈ \Sigma_ε$, if<br>$(r, u) ∈ δ(p, a, ε)$ and $(q, ε) ∈ δ(s, b, u)$, put the rule<br>$A_{pq} → a A_{rs} b$ in $G$.</li><li>For each $p, q, r ∈ Q$, put the rule $A_{pq} → A_{pr} A_{rq}$ in $G$.</li><li>Finally, for each $p ∈ Q$, put the rule $A_{pp} → ε$ in $G$</li></ol></li></ul></li></ul><h3 id="2-6-性质"><a class="header-anchor" href="#2-6-性质">¶</a>2.6 性质</h3><ol><li><p>对Union封闭</p><p>$N_1\cup N_2=(V_1\cup V_2\cup{S},\Sigma_1\cup\Sigma_2,R_1\cup R_2\cup{S\to S_1,S\to S_2},S)$</p></li><li><p>对Concat封闭</p><p>$N_1 N_2=(V_1\cup V_2\cup{S},\Sigma_1\cup\Sigma_2,R_1\cup R_2\cup{S\to S_1S_2},S)$</p></li><li><p>对Kleen Star封闭</p><p>$N_1^*=(V_1\cup{S},\Sigma_1,R_1\cup{S\to \epsilon,S\to SS_1},S)$</p></li><li><p>CFL与RL的交集是CFL</p></li><li><p>CFL与CFL的交集不一定是CFL</p></li><li><p>对补集也不封闭</p></li></ol><h3 id="2-7-Pumping-Lemma"><a class="header-anchor" href="#2-7-Pumping-Lemma">¶</a>2.7 Pumping Lemma</h3><p>类似于RL的pumping lemma，用于证明不是CFL</p><p>对每个无限 CFL $L$，存在一个常数 $p \ge 1$（称为“pumping length”），使得</p><p>对任意长度 $≥ p$ 的字符串 $s \in L$，都可以写成：$s = uvwxy$，并满足：</p><ol><li>$|vwx| \le p $（“中间区段不长”）</li><li>$|vx| \ge 1$ （“v 和 x 至少有一个非空”）</li><li>对所有$i \ge 0$，$uv^i w x^i y \in L$（重复 $v$ 和 $x$ 字符串$i$ 次，生成的串仍在 $L$ 中）</li></ol><p>证明使用抽屉原理</p><p>同样具有反例：</p><p>$L={a^ib^jc^kd^l|a=0\or j=k=l}$</p><h3 id="2-8-三个问题"><a class="header-anchor" href="#2-8-三个问题">¶</a>2.8 三个问题</h3><h4 id="Q1-Acceptance-w-in-L-A-？-2"><a class="header-anchor" href="#Q1-Acceptance-w-in-L-A-？-2">¶</a>Q1: Acceptance: $w\in L(A)$？</h4><p>可以解决，转换为Chomsky范式，就必然能够在有限步内识别完</p><h4 id="Q2-Emptiness-L-A-varnothing-2"><a class="header-anchor" href="#Q2-Emptiness-L-A-varnothing-2">¶</a>Q2: Emptiness: $L(A)=\varnothing$?</h4><p>可以解决，不断扩增所有“可生成变量”</p><h4 id="Q3-Equality-L-A-L-B-2"><a class="header-anchor" href="#Q3-Equality-L-A-L-B-2">¶</a>Q3: Equality: $L(A)=L(B)$?</h4><p>不可以解决</p><h3 id="2-9-DPDA-DCFL"><a class="header-anchor" href="#2-9-DPDA-DCFL">¶</a>2.9 DPDA &amp; DCFL</h3><p>就是确定PDA和确定CFL</p><p>类似DCFL和CFL关系类似于DFA和NFA</p><p>但是DCFL和CFL是不等价的</p><p>DCFL对补集是封闭的</p><p>不具有模糊性</p><p>能写成LR(k)文法（使用DK-test检测）</p><h2 id="3-Turing-Machine"><a class="header-anchor" href="#3-Turing-Machine">¶</a>3 Turing Machine</h2><h3 id="3-1-Definition"><a class="header-anchor" href="#3-1-Definition">¶</a>3.1 Definition</h3><p>7元组,$(Q,\Sigma,\Gamma,\delta,q_0,q_\text{accept},q_\text{reject})$, where $Q,\Sigma,\Gamma$ are all finite and</p><ol><li>$Q$ is a set of states,</li><li>$\Sigma$ is the input alphabet not containing the blank symbol $\sqcup$,</li><li>$\Gamma$ is the tape alphabet, where $\sqcup∈\Gamma$ and $\Sigma \subseteq\Gamma$,</li><li>$\delta: Q×\Gamma →Q×\Gamma ×{L,R}$is the transition function, (L, R means to move left/right after current step)</li><li>$q_0 \in Q$ is the start state,</li><li>$q_\text{accept} \in Q$ is the accept state, and</li><li>$q_\text{reject}\in Q$ is the reject state, where $q_\text{reject}\ne q_\text{accept}$.</li></ol><p>有三种终止状态</p><ol><li>accept</li><li>reject</li><li>Non-halting</li></ol><h3 id="3-2-Variants-of-Turing-Machine"><a class="header-anchor" href="#3-2-Variants-of-Turing-Machine">¶</a>3.2 Variants of Turing Machine</h3><h4 id="Multitape-Turing-Machines"><a class="header-anchor" href="#Multitape-Turing-Machines">¶</a>Multitape Turing Machines</h4><p>$δ: Q×\Gamma^k →Q×\Gamma^k ×{L,R,S}^k$</p><p>多带图灵机与单带图灵机等价</p><h4 id="Non-deterministic-Turing-Machine"><a class="header-anchor" href="#Non-deterministic-Turing-Machine">¶</a>Non-deterministic Turing Machine</h4><p>$\delta:Q\times \Gamma\to\mathcal P(Q\times \Gamma\times{L,R})$</p><p>与确定图灵机等价</p><ul><li>确定图灵机相当于宽度优先遍历非确定图灵机的树</li><li>不能深度优先遍历是因为会有死循环的情况</li></ul><h4 id="Enumerator"><a class="header-anchor" href="#Enumerator">¶</a>Enumerator</h4><p>打印出自己所有可接受结果的机器</p><p>也与图灵机等价</p><h2 id="4-Decidability"><a class="header-anchor" href="#4-Decidability">¶</a>4 Decidability</h2><p>整理</p><ul><li>Decidable:<ul><li>$A_\text{DFA}={\langle B,w\rangle|B\text{ is a DFA that accepts input string }w}$</li><li>$A_\text{NFA}={\langle B,w\rangle|B\text{ is an NFA that accepts input string }w}$</li><li>$A_\text{REX}={\langle R,w\rangle|R\text{ is a regular expression that generates }w}$</li><li>$E_\text{DFA}={\langle A\rangle|A\text{ is a DFA and }L(A)=\varnothing}$</li><li>$EQ_\text{DFA}={\langle A,B\rangle|A\text{ and }B\text{ are DFAs and }L(A)=L(B)}$</li><li>$A_\text{CFG}={\langle G,w\rangle|G \text{ is a CFG that generates }w}$</li><li>$E_\text{CFG}={\langle G\rangle|G\text{ is a CFG and  }L(G)=\varnothing}$</li><li>$A_\text{LBA}={\langle M,w\rangle|M\text{ is an LBA that accepts }w}$</li></ul></li><li>Recognizable<ul><li>$A_\text{TM}={\langle M,w\rangle|M\text{ is a TM and }M\text{ accepts } m}$</li><li>$HALT_\text{TM}={\langle M,w\rangle|M \text{ is a TM and }M\text{ halts on input } w}$</li></ul></li><li>co-Recognizable<ul><li>$E_\text{TM}={\langle M\rangle|M\text{ is a TM and }L(M)=\varnothing}$</li><li>$EQ_\text{CFG}={\langle G,H\rangle|G \text{ and } H\text{ are CFGs and }L(G)=L(H)}$</li></ul></li><li>not Recognizable and co-Recognizable<ul><li>$EQ_\text{TM}={\langle A,B\rangle|A\text{ and }B\text{ are TMs and }L(A)=L(B)}$</li><li>$REGULAR_\text{TM}={\langle M\rangle|M\text{ is a TM and }L(M)\text{ is a regular language}}$</li><li>$E_\text{LBA}={\langle M\rangle|M\text{ is an LBA and }L(M)=\varnothing}$</li><li>$ALL_\text{CFG}$</li></ul></li></ul><p>$\text{Decidabe}=\text{Recognizable}\cap \text{co-Recognizable}$</p><p>？→ $\exists$ → $\forall$</p><p>连续的 $\exists$ / $\forall$多个视作一个 $\exists$ / $\forall$</p><p>$\forall$越多，复杂性越大</p><p>$A_\text{TM} = {⟨M,w⟩|M\text{ is a TM and }M\text{ accepts }w}$是undecidable但是recognizable的</p><p>${\overline{A_\text{TM}}} = {⟨M,w⟩|M\text{ is a TM and }M\text{ rejects }w}$是unrecognizable的，称为co-turing recognizable</p><p>对于1的证明，可以通过构造$D$，$D(\langle M\rangle)=\begin{cases}\text{accept if }M\text{ does not accept }\langle M\rangle,\\text{reject if }M\text{ accepts }\langle M\rangle,\end{cases}$</p><p>那么$D\langle D\rangle$就是一个悖论</p><p>对于2的证明，讨论一下$L$和$\bar L$在$A_\text{TM}$和$\overline{ A_\text{TM}}$接受的情况即可</p><h2 id="5-Reducibility"><a class="header-anchor" href="#5-Reducibility">¶</a>5 Reducibility</h2><p>用规约了证明问题</p><h3 id="Undecidable-Problems-for-Language-Theory"><a class="header-anchor" href="#Undecidable-Problems-for-Language-Theory">¶</a>Undecidable Problems for Language Theory</h3><h4 id="HALT-text-TM"><a class="header-anchor" href="#HALT-text-TM">¶</a>$HALT_\text{TM}$</h4><p>$HALT_\text{TM} = {\langle M,w\rangle|M\text{ is a TM and } M\text{halts on input } w}$ is undecidable</p><p>将其直接归约为$A_\text{TM}$即可</p><h4 id="E-text-TM"><a class="header-anchor" href="#E-text-TM">¶</a>$E_\text{TM}$</h4><p>$E_{TM}={\langle M\rangle|M\text{ is a TM and }L(M)=\varnothing }$ is undecidable</p><p>构造一个$A'<em>\text{TM}$，参数为$A</em>\text{TM}(M,w)$，输入为$x$</p><p>在$A_\text{TM}(M,w)$接受时接受，拒绝时拒绝</p><p>所以输出与$x$无关，可接受的是全集或者空集</p><p>因为$A_\text{TM}$是undecidable的，所以$E_\text{TM}$也是undecidable的</p><h4 id="Regular-text-TM"><a class="header-anchor" href="#Regular-text-TM">¶</a>$Regular_\text{TM}$</h4><p>$Regular_\text{TM}={\langle M\rangle|M\text{ is a TM and } L(M)\in RL}$ is undecidable</p><p>构造一个$S_{m,w}(x)$</p><p>如果$x=0^n1^n$ accept</p><p>如果$x\ne 0^n1^n$ return $A_\text{TM}(M,w)$</p><p>$\therefore L(S)=\begin{cases}\Sigma^* &amp; \langle M,w\rangle\in A_\text{TM}\{0^n1^n}&amp;\langle M,w\rangle\notin A_\text{TM}\end{cases}$</p><p>$\therefore \langle M,w\rangle\in A_\text{TM}\Leftrightarrow S\in Regular_\text{TM}$</p><p>所以是undecidable的</p><h4 id="EQ-text-TM"><a class="header-anchor" href="#EQ-text-TM">¶</a>$EQ_\text{TM}$</h4><p>$EQ_\text{TM} = {\langle M_1,M_2\rangle|M_1\text{ and }M_2\text{ are TMs and } L(M_1)=L(M_2)}$</p><p>取特例，令$M_2$为空，归约到$E_\text{TM}$即可</p><h3 id="Reductions-via-computation-histories"><a class="header-anchor" href="#Reductions-via-computation-histories">¶</a>Reductions via computation histories</h3><p>定义计算历史$C_1,\cdots, C_l$根据最后一个状态是accept还是reject定义它是接受/拒绝的计算历史</p><p>Linear Bounded Automata: 一个图灵机，但是指针只能在输入的范围上移动</p><p>$A_\text{LBA}$ is decidable</p><p>虽然LBA本身有无限的状态，但是给定输入之后，LBA的状态就是有限的，所以它是decidable的</p><h4 id="E-text-LBA"><a class="header-anchor" href="#E-text-LBA">¶</a>$E_\text{LBA}$</h4><p>$E_{LBA}$ is undecidable，也通过$A_\text{TM}$来归约</p><p>构造$B_{m,w}$，s.t. $\langle M,w\rangle\in A_\text{TM}\Leftrightarrow L(B_{m,w})\ne \varnothing$</p><p>定义$B_{m,w}(x) = B_\text{accept} \iff x \text{ is an accepting hostory of }M\text{ on }w$</p><p>直观来看，就是因为LBA无法在有限的空间里模拟$A_\text{TM}$，所以直接把$A_\text{TM}$的计算过程展开作为$B_\text{TM}$的输入，这样就可以放得下了</p><h4 id="ALL-text-CFG"><a class="header-anchor" href="#ALL-text-CFG">¶</a>$ALL_\text{CFG}$</h4><p>$ALL_\text{CFG} = {\langle G\rangle|G \text{ is an CFG and }L(G)=\Sigma^*}$  is undecidable</p><p>$ALL_\text{CFG}\text{ is undecidable}\iff \overline{ALL_\text{CFG}} \text{ is undecidable}$</p><p>下证$A_\text{TM}\leq \overline{ALL_\text{CFG}}$</p><p><strong>接受计算历史 H 的格式：</strong> H=#C1#C2#…#Cℓ#。</p><p>G 需要生成所有不符合 H 特征的字符串。这些字符串不符合 H 的原因分为三类：</p><ol><li>无效开始 C1： 字符串不以 M 在 w 上的起始配置 C1 开头。</li><li>无效结束 Cℓ： 字符串不以 M 的接受配置结束。</li><li>非法转移 Ci\⊢Ci+1： 字符串中至少有一对**相邻配置 Ci#Ci+1 不满足 M 的转移规则。</li></ol><p>G 识别的语言 L(G) 是识别这三类错误的语言的并集。前两类容易用 CFG 实现，第三类是关键。</p><p>通过构造一个合适的PDA来实现这一点，但是堆栈会有问题</p><p>让奇数位C~i~保持正序编码，偶数位保持逆序编码</p><h3 id="Mapping-Reducibility"><a class="header-anchor" href="#Mapping-Reducibility">¶</a>Mapping Reducibility</h3><p>函数的定义：$\Sigma^<em>\to\Sigma^</em>$，对于图灵机$M$，对于每一个输入$w$，终止时tape上的是$f(w)$</p><p>定义mapping reducibility $A\leq_m B$: $\exists$ a computable function $f,\forall w\in\Sigma^*,w\in A\iff f(w)\in B$</p><p>$A\leq_m B\iff\bar A\leq_m\bar B$:</p><ol><li>$B$ decidable $\to$ $A$ decidable</li><li>$A$ undecidable $\to$ $B$ undecidable</li><li>$B$ turing-recognizable $\to$ $A$ turing-recognizable</li><li>$A$ not turing-recognizable $\to$ $B$ not turing-recognizable</li></ol><p><strong>强大武器：Rice Theroem</strong></p><p>任何关于图灵机所识别语言的非平凡性质，都是不可判定的。</p><p>两个核心前提：</p><ul><li><strong>是关于语言的性质（Property of Language）</strong>： 该性质只取决于图灵机接受哪些字符串，即如果 L(M1)=L(M2)，那么它们必须同时具备或不具备该性质。</li><li><strong>它是非平凡的（Non-trivial）</strong>： 这个性质既不是“永远成立”的，也不是“永远不成立”的。</li></ul><p>证明思路：</p><ul><li><p>定义</p><ul><li>我现在有一个性质语言的性质$p$，满足$P_\text{TM}(x)={x|x是一个满足p的语言}$，设$Q\in P_\text{TM}$，$\varnothing\notin P_\text{TM}$（如果属于则证明其补语言是undecidable的），$Q$对应的图灵机是$M_q$</li><li>如果$P_\text{TM}$是decidable的，设它的判断器为$R$</li></ul></li><li><p>现在开始把$P_\text{TM}$规约到$A_\text{TM}$：</p><ul><li><p>要测试$A(M,w)$的 时候，构造辅助TM $M_w$ ，$M_w(x)$定义为:</p><p>运行$M(w)$，</p><ol><li>如果接受，则运行$M_q(x)$，$M_q$接受则$M_w$接受，$M_q$不接受则$M_w$不接受</li><li>如果不接受或者循环，则$M_w$不接受</li></ol></li></ul></li><li><p>这样以来可以通过$R$构造$A_\text{TM}$的判别器$S$</p><ul><li>如果$R(M_w)$接受，则$M_w$接受</li><li>如果$R(M_w)$不接受，则$M_w$不接受</li></ul></li></ul><h2 id="6-Godel-Encoding"><a class="header-anchor" href="#6-Godel-Encoding">¶</a>6 Godel Encoding</h2><p>构造一个程序到自然数的单射</p><h2 id="7-Time-Complexity"><a class="header-anchor" href="#7-Time-Complexity">¶</a>7 Time Complexity</h2><p>图灵机$o(n\log n)$ 内能识别的，是正则语言</p><p>多带图灵机$O(t(n))$能做的，单带图灵机$O(t(n^2))$也能做的</p><p>非确定图灵机$O(t(n))$能做的，确定图灵机$2^{O(t(n))}$也能做的</p><h3 id="P-问题"><a class="header-anchor" href="#P-问题">¶</a>P 问题</h3><p>P问题是在确定单带图灵机上，多项式时间内可以decidable的问题</p><p>文本的编码：必须与文本长度的对数成正比（因此拒绝1进制）</p><ul><li>$PATH = {\langle G,s,t\rangle|G\text{ is a directed graph that has a directed path from }s\text{ and }t}$</li><li>$RELPRIME={\langle x,y\rangle|x\text{ and }y\text{ are relatively prime}}$</li><li>CFL</li></ul><h3 id="NP-问题"><a class="header-anchor" href="#NP-问题">¶</a>NP 问题</h3><p>NP问题是多项式时间可接受的</p><p>NP问题是在不确定单带图灵机上，多项式时间内可以decidable的问题/在确定单带图灵机上，多项式时间内可以verify的问题</p><ul><li>$HAMPATH={\langle G,s,t\rangle|G\text{ is a directed graph with a hamilton path from }s\text{ to }t}$</li></ul><h3 id="NPC问题"><a class="header-anchor" href="#NPC问题">¶</a>NPC问题</h3><ul><li>SAT</li><li>3SAT</li><li>CLIQUE</li><li>Vertex Cover</li></ul><h3 id="归约"><a class="header-anchor" href="#归约">¶</a>归约</h3><p>A归约到B = A≤B = A难度小于等于B</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">graph TD</span><br><span class="line">    %% 1. 结构定义</span><br><span class="line">    SAT[SAT] --&gt; 3SAT[3SAT]</span><br><span class="line">    3SAT--&gt;SUBSET-SUM[SUBSET-SUM]</span><br><span class="line">  </span><br><span class="line">    %% 左侧分支：子图/覆盖类</span><br><span class="line">    3SAT --&gt; CLIQUE[CLIQUE]</span><br><span class="line">    3SAT --&gt; VC[Vertex Cover]</span><br><span class="line">    CLIQUE &lt;--&gt; VC</span><br><span class="line"></span><br><span class="line">    %% 右侧分支：路径类</span><br><span class="line">    3SAT --&gt; DHAMP[Directed HAMPATH]</span><br><span class="line">    DHAMP --&gt; HAMP[Undirected HAMPATH]</span><br><span class="line">    HAMP --&gt; TSP[TSP]</span><br><span class="line"></span><br><span class="line">    %% 2. 样式定义</span><br><span class="line">    classDef logic fill:#e3f2fd,stroke:#1565c0,stroke-width:2px;</span><br><span class="line">    classDef graphNode fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px;</span><br><span class="line">    classDef pathNode fill:#fff3e0,stroke:#ef6c00,stroke-width:2px;</span><br><span class="line"></span><br><span class="line">    %% 3. 应用样式</span><br><span class="line">    class SAT,3SAT logic;</span><br><span class="line">    class CLIQUE,VC graphNode;</span><br><span class="line">    class DHAMP,HAMP,TSP pathNode;</span><br></pre></td></tr></table></figure><h2 id="8-Space-Complexity"><a class="header-anchor" href="#8-Space-Complexity">¶</a>8 Space Complexity</h2><p>定义：</p><p>Space(N)：在DTM上的空间复杂度</p><p>NSpace(N): 在NTM上的空间复杂度</p><p>考虑的都是decider而不是verifyer</p><p>在空间复杂度上，PSPACE=NPSPACE</p><p>事实上NPSPACE(f(n))$\subseteq$SPACE(f^2^(n))</p><p>P $\subseteq$ PSPACE</p><p>NP $\subseteq$ NPSPACE $=$ PSPACE $\subseteq$ EXPTIME</p><p>NPSPACE=co-NPSPACE</p><p>PSPACE上的归约依旧是多项式时间内的归约</p><p>PSPACE-complete: TQBF</p><p>LSPACE：输入带（只读）是线性的，但是工作带（读写）是$O(\log n)$</p><p>NL$\subseteq$P，L=co-NL，但是不清楚L与NL是否相等（倾向于不等）</p><p>PATH$\in$NLC</p><p>NL-Complete的reducible，是log-space reducibility，而不是polynomial time reducible</p><p>规约的过程中，A的输出，B的输入，可能是多项式空间的——解决方法，每次只读取一个字符，要读下一个字符就重新算一遍</p><h2 id="9-Intractability"><a class="header-anchor" href="#9-Intractability">¶</a>9 Intractability</h2><h3 id="Hierarchy-Theorems"><a class="header-anchor" href="#Hierarchy-Theorems">¶</a>Hierarchy Theorems</h3><h4 id="Space-constructible"><a class="header-anchor" href="#Space-constructible">¶</a>Space constructible</h4><p>判断一个算法是否是$O(f(n))$的，计算算法复杂度的算法的复杂度本身，也必须是$O(f(n))$的</p><p>如果$f(n)$是$o(n)$的，就使用工作带只读带的逻辑（类似LSPACE）</p><h4 id="Space-hierarchy-theorem"><a class="header-anchor" href="#Space-hierarchy-theorem">¶</a>Space hierarchy theorem</h4><p>对于任何<strong>空间可构造函数</strong> $f(n)$，一定存在一个语言（即一个问题）A，它：</p><ul><li>可以用 $O(f(n))$ 的空间解决。</li><li><strong>不可能</strong>用 $o(f(n))$ 的空间解决（即增长速度严格慢于 $f(n)$ 的空间都不行）。</li></ul><p>同理，也有时间层次定理</p><h3 id="Relativization"><a class="header-anchor" href="#Relativization">¶</a>Relativization</h3><p>假设有神谕oracle，能够在$O(1)$下解决某一类问题时，各类不同问题的复杂性</p><h3 id="Circuit"><a class="header-anchor" href="#Circuit">¶</a>Circuit</h3><p>电路复杂性</p><p>时间复杂度$O(t(n))$，电路复杂性$O(t^2(n))$</p><h2 id="附录"><a class="header-anchor" href="#附录">¶</a>附录</h2><table><thead><tr><th><strong>关系式</strong></th><th><strong>状态</strong></th><th><strong>相关定理/依据</strong></th></tr></thead><tbody><tr><td>$P \stackrel{?}{=} NP$</td><td><strong>广泛认为 $\neq$</strong></td><td>尚未证明</td></tr><tr><td>$NP \stackrel{?}{=} coNP$</td><td><strong>广泛认为 $\neq$</strong></td><td>尚未证明（若$P=NP$ 则成立）</td></tr><tr><td>$P = coP$</td><td><strong>确定相等</strong></td><td>$P$ 对补运算封闭</td></tr><tr><td>$L \stackrel{?}{=} NL$</td><td><strong>广泛认为 $\neq$</strong></td><td>尚未证明</td></tr><tr><td>$NL = coNL$</td><td><strong>确定相等</strong></td><td><strong>Immerman–Szelepcsényi 定理</strong></td></tr><tr><td>$PSPACE = NPSPACE$</td><td><strong>确定相等</strong></td><td><strong>Savitch 定理</strong></td></tr><tr><td>$PSPACE=coPSPACE$</td><td><strong>确定相等</strong></td><td></td></tr><tr><td>$NPSPACE = coNPSPACE$</td><td><strong>确定相等</strong></td><td>同$NL=coNL$ 的原理</td></tr></tbody></table>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;计算理论&lt;/h1&gt;
&lt;h2 id=&quot;1-Finite-Automata-and-Regular-Languages&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-Finite-Automata-and-Regular-Languages&quot;&gt;¶&lt;/a</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>毛泽东思想和中国特色社会主义理论体系概论</title>
    <link href="https://ryanstarfox.github.io/2026/01/05/2026/20260105%20%E6%AF%9B%E6%A6%82/"/>
    <id>https://ryanstarfox.github.io/2026/01/05/2026/20260105%20%E6%AF%9B%E6%A6%82/</id>
    <published>2026-01-05T12:46:00.000Z</published>
    <updated>2026-01-05T12:46:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>毛泽东思想和中国特色社会主义理论体系概论</h1><h2 id="0-导论"><a class="header-anchor" href="#0-导论">¶</a>0 导论</h2><h3 id="0-1-马克思主义中国化时代化的提出"><a class="header-anchor" href="#0-1-马克思主义中国化时代化的提出">¶</a>0.1 马克思主义中国化时代化的提出</h3><p><strong>1938 毛泽东 六中全会 《论新阶段》的报告  标志</strong>**『“马克思主义的中国化”』**提出</p><p><strong>1945 刘少奇 七大 《关于修改党章的报告》 进一步阐述理论，指出</strong>**『毛泽东思想』<strong>是</strong>『“中国化的马克思主义”』**</p><h3 id="0-2-马克思主义中国化时代化的内涵"><a class="header-anchor" href="#0-2-马克思主义中国化时代化的内涵">¶</a>0.2 马克思主义中国化时代化的内涵</h3><p><strong>定义为：</strong></p><ul><li><strong>立足</strong><ul><li><strong>中国国情</strong></li><li><strong>时代特点</strong></li></ul></li><li><strong>坚持</strong>**『马克思主义基本原理』**<ul><li><strong>同</strong>**『中国具体实际』**相结合</li><li><strong>同</strong>**『中华优秀传统文化』**相结合</li></ul></li></ul><h3 id="0-3-马克思主义中国化时代化的历史进程"><a class="header-anchor" href="#0-3-马克思主义中国化时代化的历史进程">¶</a>0.3 马克思主义中国化时代化的历史进程</h3><p>**新民主主义时期，****『毛泽东思想』**是第一次历史性飞跃</p><p><strong>『改革开放』<strong>和</strong>『社会主义现代化建设』<strong>新时期，形成</strong>『中国特色社会主义理论体系』</strong>，实现了新的飞跃</p><p><strong>十八大以来，创立了</strong>**『习近平新时代中国特色社会主义思想』**，实现了新的飞跃</p><p><strong>（都是</strong>**『马克思主义中国化时代化』**的飞跃）</p><h3 id="0-4-马克思主义中国化时代化理论成果及其关系"><a class="header-anchor" href="#0-4-马克思主义中国化时代化理论成果及其关系">¶</a>0.4 马克思主义中国化时代化理论成果及其关系</h3><p><strong>马克思主义中国化时代化理论成果是：一脉相承、与时俱进的关系</strong></p><ul><li><strong>『毛泽东思想』</strong>：蕴含的**『马克思主义』<strong>的立场、观点、方法，为</strong>『中国特色社会主义理论体系』**提供了基本遵循</li><li><strong>『中国特色社会主义理论体系』<strong>在新的历史条件下进一步丰富和发展了</strong>『毛泽东思想』</strong></li></ul><h2 id="1-『毛泽东思想』-及其历史地位"><a class="header-anchor" href="#1-『毛泽东思想』-及其历史地位">¶</a>1 **『毛泽东思想』**及其历史地位</h2><h3 id="1-1-『毛泽东思想』-形成和发展-1-1-2-『毛泽东思想』-形成发展的过程"><a class="header-anchor" href="#1-1-『毛泽东思想』-形成和发展-1-1-2-『毛泽东思想』-形成发展的过程">¶</a>1.1 **『毛泽东思想』**形成和发展/1.1.2 **『毛泽东思想』**形成发展的过程</h3><ul><li>**『毛泽东思想』**的形成<ul><li><strong>大革命时期 毛泽东 《中国社会各阶级的分析》《湖南农民运动考察报告》等</strong><ul><li><strong>这些关于</strong>**『新民主主义革命基本思想』<strong>的提出，标志着</strong>『毛泽东思想』**开始萌芽</li></ul></li><li><strong>《红色政权为什么能够存在？》《井冈山的斗争》《星星之火，可以燎原》《反对本本主义》</strong><ul><li>**提出并阐释：**<em>农村包围城市</em>、<em>武装夺取政权</em> 的思想</li><li><strong>对红军和农村革命根据地的建立、巩固、发展 发挥根本性的</strong><em>指导</em>作用</li><li><strong>标志着</strong>**『毛泽东思想』**的<em>初步</em>形成</li></ul></li></ul></li><li>**『毛泽东思想』**的成熟<ul><li><strong>《实践论》《矛盾论》：分析</strong>*”左“、右错误思想的根源*</li><li><strong>《〈共产党人〉发刊词》《中国革命和中国共产党》《新民主主义论》《改造我们的学习》《论联合政府》</strong><ul><li>**阐释革命对象、动力、领导力量、性质、前途，**<em>提出总路线</em></li><li><strong>标志着</strong>**『毛泽东思想』**多方面展开→趋于<em>成熟</em></li></ul></li></ul></li><li>**『毛泽东思想』**的继续发展<ul><li>**明确提出把 **<strong>『马克思列宁主义基本原理』</strong> 同 **『中国具体实际 』**进行 “第二次结合，找出在中国怎样建设社会主义的道路”的任务</li><li><strong>开辟适合</strong>**『中国国情的社会主义建设道路』**进行了艰辛<em>探索</em></li></ul></li></ul><h3 id="1-2-『毛泽东思想』-的主要内容和活的灵魂-1-2-2-『毛泽东思想』-活的灵魂"><a class="header-anchor" href="#1-2-『毛泽东思想』-的主要内容和活的灵魂-1-2-2-『毛泽东思想』-活的灵魂">¶</a>1.2 **『毛泽东思想』**的主要内容和活的灵魂/1.2.2 **『毛泽东思想』**活的灵魂</h3><p><strong>实事求是、群众路线、独立自主</strong></p><h4 id="实事求是"><a class="header-anchor" href="#实事求是">¶</a>实事求是</h4><ul><li>**『毛泽东思想』**的基本点和精髓</li><li><strong>要：</strong><ol><li><strong>深入了解事物的</strong><em>本来面貌</em>，把握事物内在必然联系，按照客观规律办事</li><li><strong>清醒认识和正确把握我国</strong><em>基本国情</em></li><li><strong>不断推进</strong><em>实践基础上的最优解</em></li></ol></li></ul><h4 id="群众路线"><a class="header-anchor" href="#群众路线">¶</a>群众路线</h4><ul><li>**是：**<em>一切为了群众，一切依靠群众，从群众中来，到群众中去</em>，把党的正确主张变为群众的自觉行动</li><li><strong>要：</strong><ol><li><strong>坚持</strong>**『人民是推动历史发展』**的根本力量</li><li><strong>坚持</strong>**『全心全意为人民服务』**的根本宗旨</li><li><strong>保持</strong>**『党同人民群众的血肉联系』**</li></ol></li></ul><h4 id="独立自主"><a class="header-anchor" href="#独立自主">¶</a>独立自主</h4><ul><li><strong>是：</strong><ul><li><strong>坚持</strong><em>独立思考</em>，走自己的路</li><li><strong>坚定不移地</strong><em>维护民族独立、捍卫国家主权</em>，把立足点放在依靠自己力量的基础上，同时积极<em>争取外援</em>，开展国际经济文化交流，<em>学习外国</em>一切对我们有益的先进事物</li></ul></li></ul><p><strong>坚持</strong>**『独立自主原则』**，是毛泽东针对党内存在的“左”倾教条主义倾向，从中国革命遭受挫折的教训中提出的正确思想主张</p><ul><li><strong>要：</strong><ul><li><strong>坚持中国的事情必须由中国人民</strong><em>自己作主张、自己来处理</em></li><li><strong>坚持</strong><em>独立自主</em>的和平外交政策，坚定不移地走和平发展道路</li></ul></li></ul><h3 id="1-3-『毛泽东思想』-的历史地位"><a class="header-anchor" href="#1-3-『毛泽东思想』-的历史地位">¶</a>1.3 **『毛泽东思想』**的历史地位</h3><ul><li><strong>马克思主义中国化时代化的</strong><em>第一个重大理论成果</em></li><li><strong>中国革命和建设的</strong><em>科学指南</em></li><li><strong>中国共产党和中国人民宝贵的</strong><em>精神财富</em></li></ul><h2 id="2-新民主主义革命理论"><a class="header-anchor" href="#2-新民主主义革命理论">¶</a>2 新民主主义革命理论</h2><h3 id="2-1-新民主主义革命理论形成的依据"><a class="header-anchor" href="#2-1-新民主主义革命理论形成的依据">¶</a>2.1 新民主主义革命理论形成的依据</h3><h4 id="2-1-1-近代中国国情和中国革命的时代特征"><a class="header-anchor" href="#2-1-1-近代中国国情和中国革命的时代特征">¶</a>2.1.1 近代中国国情和中国革命的时代特征</h4><ul><li><strong>近代中国最基本的国情：逐步成为</strong>**『半殖民半封建社会』**</li><li><strong>占支配地位的主要社会矛盾</strong><ul><li><em>帝国主义和中华民族</em>的矛盾</li><li><em>封建主义和人民大众</em>的矛盾（最主要）</li></ul></li></ul><h4 id="2-1-2-近代中国革命的时代特征"><a class="header-anchor" href="#2-1-2-近代中国革命的时代特征">¶</a>2.1.2 近代中国革命的时代特征</h4><p><strong>近代中国的性质和主要矛盾→决定了中国革命仍然是</strong>**『资产阶级民主革命』**</p><h3 id="2-2-新民主主义革命的总路线和基本纲领"><a class="header-anchor" href="#2-2-新民主主义革命的总路线和基本纲领">¶</a>2.2 新民主主义革命的总路线和基本纲领</h3><h4 id="2-2-1-新民主主义革命的总路线"><a class="header-anchor" href="#2-2-1-新民主主义革命的总路线">¶</a>2.2.1 新民主主义革命的总路线</h4><p><strong>1939 毛泽东 《中国革命和中国共产党》 提出</strong>**『“新民主主义的革命”』**的科学概念</p><p><strong>1948 毛泽东 《在晋绥干部会议上的讲话》 完整总结概括</strong>**『新民主主义革命总路线』**的内容：</p><ul><li><strong>无产阶级领导的</strong></li><li><strong>人民大众的</strong></li><li><strong>反对帝国主义、封建主义和官僚资本主义</strong></li></ul><p><strong>的革命</strong></p><p><strong>新民主主义革命</strong></p><ul><li><p><strong>对象</strong></p><ul><li><strong>帝国主义</strong></li><li><strong>封建主义</strong></li><li><strong>官僚资本主义</strong></li></ul></li><li><p><strong>动力（工农小民）</strong></p><ul><li><strong>无产阶级</strong></li><li><strong>农民阶级</strong></li><li><strong>城市小资产阶级</strong></li><li><strong>民族资产阶级</strong></li></ul></li><li><p><strong>领导力量（中国革命的中心问题、新民主主义革命理论的核心问题）</strong></p><ul><li><strong>区分新旧两种不同范畴的</strong>**『民主主义革命』<strong>的根本标志：革命领导权掌握在</strong>『无产阶级』<strong>还是</strong>『资产阶级』**手中</li><li><strong>中国无产阶级</strong><ul><li><strong>一般无产阶级的基本优点</strong><ul><li><strong>与</strong><em>先进生产方式</em>相联系</li><li><em>没有私人占有的生产资料</em></li><li><strong>富于</strong><em>组织纪律性</em></li></ul></li><li><strong>自身的特点和优点</strong><ul><li><em>革命性</em>：从诞生之日起，就身受外国资本主义、本国封建主义势力和资产阶级的三重压迫，这些压迫的严酷性和残酷性，是世界各民族中少见的</li><li><em>集中性</em>：集中分布在少数大城市和大企业，有利于组织和团结，有利于革命思想的传播和强大革命力量的形成</li><li><em>同盟性</em>：成员中大部分出身于破产农民，和农民有着天然的联系，便于和农民结成亲密的联盟，共同团结战斗</li></ul></li></ul></li></ul><h4 id="2-2-2-新民主主义的基本纲领"><a class="header-anchor" href="#2-2-2-新民主主义的基本纲领">¶</a>2.2.2 新民主主义的基本纲领</h4></li></ul><p><strong>1945 七大 《论联合政府》 形成新民主主义基本纲领</strong></p><ul><li><strong>政治纲领</strong><ul><li><em>推翻</em>**『帝国主义』<strong>和</strong>『封建主义』**的<em>统治</em></li><li><em>建立</em>一个**『无产阶级』<strong>领导的、以</strong>『工农联盟』<strong>为基础的、</strong>『各革命阶级联合专政』**的<em>新民主主义共和国</em></li></ul></li><li><strong>经济纲领</strong><ul><li><em>没收</em>**『封建地主阶级』**的土地归<em>农民</em>所有</li><li><em>没收</em>**『官僚资产阶级』<strong>的垄断资本归</strong>『新民主主义』**的<em>国家</em>所有</li><li><em>保护</em>**『民族工商业』**</li></ul></li><li><strong>文化纲领</strong><ul><li>**『无产阶级』<strong>领导的人民大众的</strong>『反帝反封建』**的文化</li><li><strong>即：民族的、科学的、大众的文化</strong></li></ul></li></ul><h3 id="2-3-新民主主义革命的道路和基本经验"><a class="header-anchor" href="#2-3-新民主主义革命的道路和基本经验">¶</a>2.3 新民主主义革命的道路和基本经验</h3><h4 id="2-3-1-新民主主义革命的道路"><a class="header-anchor" href="#2-3-1-新民主主义革命的道路">¶</a>2.3.1 新民主主义革命的道路</h4><p>**1938.11 六届六中全会 确立 “经过了长期武装斗争，**<em>先占乡村，后取城市，最后夺取全国胜利</em>”的革命道路</p><p>**新民主主义革命的三大法宝：**<em>统一战线</em>、<em>武装斗争</em>、<em>党的建设</em>（毛泽东 《〈共产党人〉发刊词》）</p><ul><li>**统一战线：****『无产阶级政党策略思想』**的重要内容</li><li><strong>武装斗争：中国革命的特点和优点之一</strong></li><li><strong>党的建设：不断加强：</strong><ul><li><em>思想建设</em>（首位）</li><li><strong>组织建设</strong></li><li><strong>作风建设</strong></li></ul></li></ul><h2 id="3-社会主义改造理论"><a class="header-anchor" href="#3-社会主义改造理论">¶</a>3 社会主义改造理论</h2><h3 id="3-1-从新民主主义到社会主义的转变"><a class="header-anchor" href="#3-1-从新民主主义到社会主义的转变">¶</a>3.1 从新民主主义到社会主义的转变</h3><ul><li><strong>新民主主义（1949-1956）</strong><ul><li><p><strong>五种经济成分</strong></p><ul><li>**『社会主义性质』**的国营经济（主要）</li><li>**『半社会主义性质』**的合作社经济（向『社会主义集体经济』过渡的形式）</li><li><strong>农民和手工业者的个体经济（主要）</strong></li><li>**『私人资本主义』**经济（主要）</li><li><strong>『国家资本主义经济』</strong>（**『私人资本主义经济』<strong>向</strong>『社会主义国营经济』**过渡的形式）</li></ul></li><li><p><strong>三种基本力量之间的矛盾（农民和手工业者不代表一种发展方向）</strong></p><ul><li>**『社会主义』<strong>和</strong>『资本主义』**两条道路</li><li>**『工人阶级』<strong>和</strong>『资产阶级』**两个阶级（随着土地改革完成，成为主要矛盾）（1952-1956）</li></ul><p><strong>的矛盾</strong></p></li></ul></li></ul><p><strong>1953.6&amp;12 毛泽东 建国到</strong>**『社会主义改造』**基本完成，存在过渡时期。总任务是<em>一化三改造</em></p><ul><li><strong>国家的</strong>**『社会主义工业化』**</li><li><strong>国家对</strong>**『农业、手工业、资本主义工商业』<strong>的</strong>『社会主义改造』**</li></ul><p><strong>过渡时期总路线的现实依据</strong></p><ul><li><strong>1949-1952的努力，已有相对强大和迅速发展的</strong>**『社会主义国营经济』**</li><li><em>土改</em>完成后，为发展生产、抵御自然灾害，广大农民具有<em>走互助合作道路的要求</em></li><li><em>国际形势</em>有利于中国向**『社会主义』**<em>过渡</em></li></ul><h3 id="3-2-社会主义改造道路和历史经验"><a class="header-anchor" href="#3-2-社会主义改造道路和历史经验">¶</a>3.2 社会主义改造道路和历史经验</h3><p><strong>『农业、手工业』<strong>的</strong>『社会主义改造道路』</strong></p><ol><li><em>积极引导</em>农民组织起来，走<em>互助合作</em>道路</li><li><strong>遵循自愿互利、典型示范和国家帮助的原则，以互助合作的优越性</strong><em>吸引</em>农民走互助合作道路</li><li><strong>正确</strong><em>分析</em>农村的阶级和阶层情况，制定正确的<em>阶级政策</em></li><li><strong>坚持积极领导、稳步前进的方针，采取</strong><em>循序渐进</em>的步骤</li></ol><p><strong>『资本主义工商业』<strong>的</strong>『社会主义改造』</strong></p><ul><li><strong>用和平赎买的方法改造</strong>**『资本主义工商业』**</li><li><strong>采取从低级到高级的</strong>**『国家资本主义』**的过渡形式<ul><li><p>**例如初级形式中，**<em>四马分肥</em>：企业利润按照</p><ul><li><strong>国家所得税</strong></li><li><strong>企业公积金</strong></li><li><strong>工人福利费</strong></li><li><strong>资方红利</strong></li></ul><p><strong>分配</strong></p></li></ul></li><li><strong>把</strong>**『资本主义工商业者』<strong>改造成</strong>『自食其力的社会主义劳动者』**</li></ul><p>**『社会主义改造』**的历史经验</p><ol><li><strong>坚持</strong>**『社会主义工业化建设』<strong>和</strong>『社会主义改造』**同时并举</li><li><strong>采取</strong><em>积极引导</em>、<em>逐步过渡</em>的方式</li><li><strong>用</strong><em>和平</em>方法进行改造</li></ol><h3 id="3-3-社会主义基本制度在中国的确立"><a class="header-anchor" href="#3-3-社会主义基本制度在中国的确立">¶</a>3.3 社会主义基本制度在中国的确立</h3><p><strong>1956年，我国对</strong>**『农业、手工业和资本主义工商业』**的社会主义改造基本完成</p><p><strong>『资本主义私有制』<strong>基本上转变为</strong>『国家所有即全民所有的公有制』</strong></p><p><strong>标志着中国历史上长达数千年的</strong>**『阶级剥削制度』<strong>的结束和</strong>『社会主义基本制度』**的确立</p><p><strong>确立</strong>**『社会主义基本制度』**的意义：</p><ul><li><strong>是中国历史上</strong><em>最深刻最伟大</em>的社会变革</li><li><strong>为当代中国一切发展进步</strong><em>奠定</em>了制度<em>基础</em></li><li><strong>为</strong>**『中国特色社会主义制度』**的创新和发展提供了<em>重要前提</em></li></ul><h2 id="4-社会主义建设道路初步探索的理论成果"><a class="header-anchor" href="#4-社会主义建设道路初步探索的理论成果">¶</a>4 社会主义建设道路初步探索的理论成果</h2><h3 id="4-1-初步探索的重要理论成果"><a class="header-anchor" href="#4-1-初步探索的重要理论成果">¶</a>4.1 初步探索的重要理论成果</h3><h4 id="4-1-1-调动一切积极因素为社会主义事业服务"><a class="header-anchor" href="#4-1-1-调动一切积极因素为社会主义事业服务">¶</a>4.1.1 调动一切积极因素为社会主义事业服务</h4><p><strong>需要把</strong>**『马克思列宁主义基本原理』<strong>同中国具体实际进行“第二次结合”，努力找到</strong>『适合中国特点的社会主义建设道路』**</p><p><strong>《论十大关系》良好开端，确定基本方针：努力把党内党外、国内国外的一切积极的因素，直接的、间接的积极因素，全部调动起来，为社会主义建设服务</strong></p><ul><li><strong>必须坚持</strong>**『中国共产党』**的<em>领导</em></li><li><strong>必须发展</strong>**『社会主义民主政治』**</li></ul><h4 id="正确认识和处理社会矛盾的思想"><a class="header-anchor" href="#正确认识和处理社会矛盾的思想">¶</a>正确认识和处理社会矛盾的思想</h4><p><strong>两类社会矛盾</strong></p><ul><li>**敌我矛盾——**<em>专政</em>方法处理</li><li>**人民内部矛盾——**<em>民主</em>方法处理<ul><li><em>政治思想</em>领域：<em>团结-批评-团结</em>方针</li><li><em>物质利益、分配</em>：<em>统筹兼顾</em>国家、集体、个人<em>三方利益</em></li><li><em>人民与政府机关</em>：坚持**『民主集中制』**，加强对群众的<em>思想教育</em></li></ul></li></ul><h4 id="走中国工业化道路的思想"><a class="header-anchor" href="#走中国工业化道路的思想">¶</a>走中国工业化道路的思想</h4><p><strong>建立合理规章制度和严格的责任制，实行</strong>**『民主管理』**</p><ul><li><strong>两参</strong><em>一改三结合</em><ul><li><strong>干部参加劳动</strong></li><li><strong>工人参加管理</strong></li><li><strong>改革不合理的规章制度</strong></li><li><strong>工人群众、领导干部、技术人员三结合</strong></li></ul></li></ul><h4 id="其它理论成果"><a class="header-anchor" href="#其它理论成果">¶</a>其它理论成果</h4><p>**毛泽东 社会发展阶段的思想：两个阶段：**<em>不发达</em>的社会主义、<em>发达</em>的社会主义</p><p><strong>周恩来 建设</strong>*“四个现代化”<em>：“把我国建设为一个具有现代</em>农<em>业、现代</em>工<em>业、现代</em>国防<em>和现代</em>科学技术*的社会主义强国”</p><h3 id="4-2-初步探索的意义和经验教训"><a class="header-anchor" href="#4-2-初步探索的意义和经验教训">¶</a>4.2 初步探索的意义和经验教训</h3><p><strong>意义</strong></p><ul><li><strong>巩固和发展了我国的</strong>**『社会主义制度』**</li><li><strong>为开创</strong>**『中国特色社会主义』**提供了宝贵经验、理论准备、物质基础</li><li><strong>丰富了</strong>**『科学社会主义』**的理论和实践</li></ul><p><strong>经验教训</strong></p><ul><li><strong>必须把</strong>**『马克思主义』<strong>与</strong>『中国实际』**相结合</li><li><strong>必须正确认识</strong>**『社会主义社会』<strong>的</strong>『主要矛盾』<strong>和</strong>『基本任务』**</li><li><strong>必须从实际出发进行</strong>**『社会主义建设』**，建设规模和速度要与国力相适应，不能急于求成</li><li><strong>必须发展</strong>**『社会主义民主』<strong>，健全</strong>『社会主义法制』**</li><li><strong>必须坚持党的</strong>**『民主集中制』<strong>和</strong>『集体领导制度』**，加强政党建设</li><li><strong>必须坚持对外开放，借鉴和吸收</strong>**『人类文明成果』<strong>建设</strong>『社会主义』**，不能关起门来搞建设</li></ul><h2 id="5-中国特色社会主义理论体系的形成发展"><a class="header-anchor" href="#5-中国特色社会主义理论体系的形成发展">¶</a>5 中国特色社会主义理论体系的形成发展</h2><p><strong>emmmmmm没有划重点</strong></p><h2 id="6-邓小平理论"><a class="header-anchor" href="#6-邓小平理论">¶</a>6 邓小平理论</h2><h3 id="6-1-邓小平理论首要的基本的理论问题和精髓"><a class="header-anchor" href="#6-1-邓小平理论首要的基本的理论问题和精髓">¶</a>6.1 邓小平理论首要的基本的理论问题和精髓</h3><p><strong>首要的基本的理论问题：在中国这样一个经济文化比较落后的国家</strong></p><ul><li><strong>建设什么样的</strong>**『社会主义』**</li><li><strong>怎样建设</strong>**『社会主义』**</li></ul><p>**1992 邓小平 南方讲话指出：“****『社会主义』**的本质，是</p><ul><li><em>解放</em>生产力</li><li><em>发展</em>生产力</li><li><strong>消灭</strong><em>剥削</em></li><li><strong>消除</strong><em>两极分化</em></li></ul><p><strong>最终达到</strong><em>共同富裕</em>”</p><p><strong>其意义：</strong></p><ul><li><strong>突出地</strong><em>强调</em>**『解放和发展生产力』<strong>在</strong>『社会主义社会』<strong>发展中的<em>重要地位</em>，<em>纠正</em>了过去关于发展生产力的一些<em>错误</em>观念，反映了</strong>『中国社会主义』<strong>整个历史阶段尤其是初级阶段，特别需要<em>注重生产力发展</em>的迫切要求，并明确了</strong>『社会主义基本制度』**建立后还要通过<em>改革进一步解放生产力</em></li><li>**突出强调“<em><em><em>消灭剥削，消除两极分化，最终达到共同富裕</em>”，从</em>生产关系</em>和<em>发展目标角度</em>认识和把握社会主义本质</li></ul><p><strong>邓小平理论精髓：</strong></p><ul><li><strong>解放思想</strong></li><li><strong>实事求是</strong></li></ul><h3 id="6-2-邓小平理论的主要内容"><a class="header-anchor" href="#6-2-邓小平理论的主要内容">¶</a>6.2 邓小平理论的主要内容</h3><h4 id="6-2-1-社会主义初级阶段理论和党的基本路线"><a class="header-anchor" href="#6-2-1-社会主义初级阶段理论和党的基本路线">¶</a>6.2.1 社会主义初级阶段理论和党的基本路线</h4><p><strong>十三大 社会主义初级阶段的科学内涵</strong></p><ul><li><strong>阐明了“****『社会主义初级阶段』</strong>”两层含义：<ul><li><strong>我国已经是</strong>**『社会主义』<strong>，我们必须坚持而不能离开</strong>『社会主义』**</li><li><strong>我国的</strong>**『社会主义社会』**还处在初级阶段</li></ul></li><li><strong>强调了</strong>**『社会主义初级阶段』**的长期性</li><li><strong>阐述了</strong>**『社会主义初级阶段』**的基本特征</li></ul><p><strong>基本路线：领导和团结全国各族人民，以经济建设为中心，坚持****四项基本原则</strong>，坚持改革开放，自力更生，艰苦创业，为把我国建设成为富强、民生、文明的**『社会主义现代化国家』**而奋斗</p><p><strong>四项基本原则：</strong></p><ul><li><strong>在思想上坚持</strong>**『社会主义』**道路</li><li><strong>坚持</strong>**『无产阶级专政』<strong>（后表述为</strong>『人民民主专政』**）</li><li><strong>坚持</strong>**『共产党的领导』**</li><li><strong>坚持</strong>**『马列主义』<strong>、</strong>『毛泽东思想』**</li></ul><h4 id="6-2-2-社会主义根本任务和发展战略理论"><a class="header-anchor" href="#6-2-2-社会主义根本任务和发展战略理论">¶</a>6.2.2 社会主义根本任务和发展战略理论</h4><p><strong>社会主义根本任务：发展</strong><em>生产力</em></p><p>**党和国家的工作重点：**<em>经济</em>建设</p><p><strong>三步走发展战略：</strong></p><ol><li><strong>到1990年，实现国民生产总值比1980年翻一番，解决人民的</strong><em>温饱</em>问题</li><li><strong>到20世纪末，使国民生产总值再增长一倍，人民生活达到</strong><em>小康</em>水平</li><li><strong>到21世纪中叶，人均国民生产总值达到</strong><em>中等发达国家水平</em>，人民生活比较富裕，基本实现现代化。然后在这个基础上继续前进</li></ol><h4 id="6-2-3-社会主义改革开放和社会主义市场经济理论"><a class="header-anchor" href="#6-2-3-社会主义改革开放和社会主义市场经济理论">¶</a>6.2.3 社会主义改革开放和社会主义市场经济理论</h4><p>**『社会主义改革开放』**理论</p><ul><li><strong>改革是</strong><ul><li><strong>一场深刻的</strong><em>社会变革</em></li><li><strong>中国的</strong><em>第二次革命</em></li><li><strong>实现中国</strong><em>现代化的必由之路</em></li></ul></li><li><strong>判断改革和各方面得失，要看“三个有利于”</strong><ul><li><strong>是否有利于发展</strong>**『社会主义社会』**的<em>生产力</em></li><li><strong>是否有利于增强</strong>**『社会主义国家』**的<em>综合国力</em></li><li><strong>是否有利于</strong><em>提高人民生活水平</em></li></ul></li></ul><p>**『社会主义市场经济理论』**内涵：</p><ol><li><strong>『计划经济』<strong>和</strong>『市场经济』<strong>不是<em>划分社会制度</em>的标志，</strong>『计划经济』<strong>不等于</strong>『社会主义』</strong>，<strong>『市场经济』<strong>也不等于</strong>『资本主义』</strong></li><li><strong>计划和市场都是</strong><em>经济手段</em>，对经济活动的调节各有优劣，社会主义实行**『市场经济』**是要把两者<em>优势结合</em>起来</li><li>**『市场经济』**作为<em>资源配置手段</em>本身不具有<em>制度属性</em>，可以和不同的社会制度结合，从而表现出不同的性质</li></ol><h4 id="6-2-6-中国特色社会主义外交和国际战略"><a class="header-anchor" href="#6-2-6-中国特色社会主义外交和国际战略">¶</a>6.2.6 中国特色社会主义外交和国际战略</h4><p><strong>1987 党的十三大确认了 和平与发展是当今世界的两大主题</strong></p><h3 id="6-3-邓小平理论的历史地位"><a class="header-anchor" href="#6-3-邓小平理论的历史地位">¶</a>6.3 邓小平理论的历史地位</h3><ul><li><strong>『马克思列宁主义』</strong>、**『毛泽东思想』**的继承与发展</li><li>**『中国特色社会主义理论体系』**的开篇之作</li><li>**『改革开放』<strong>和</strong>『社会主义现代化建设』**的科学指南</li></ul><h2 id="7-“三个代表”重要思想"><a class="header-anchor" href="#7-“三个代表”重要思想">¶</a>7 “三个代表”重要思想</h2><h3 id="7-1-“三个代表”重要思想的核心观点"><a class="header-anchor" href="#7-1-“三个代表”重要思想的核心观点">¶</a>7.1 “三个代表”重要思想的核心观点</h3><ol><li><strong>始终代表中国先进</strong><em>生产力的发展要求</em>，就是党的<em>理论、路线、纲领</em></li><li><strong>始终代表中国先进</strong><em>文化的前进方向</em></li><li><strong>始终代表中国最广大</strong><em>人民的根本利益</em></li></ol><h3 id="7-2-“三个代表”重要思想的主要内容"><a class="header-anchor" href="#7-2-“三个代表”重要思想的主要内容">¶</a>7.2 “三个代表”重要思想的主要内容</h3><ol><li><em>发展</em>是党执政兴国的第一要务</li><li><strong>建立</strong>**『社会主义市场经济体制』**<br><strong>在建立什么样的经济体制问题上，江泽民 根据 ****『邓小平南方谈话精神』</strong>，明确提出使用**『“社会主义市场经济体制”』****『<br>**党的十四大 正式把 <em><em><strong>『建立社会主义市场经济体制』</strong> 确立为我国</em>经济体制改革</em>的目标</li><li><strong>实施“引进来”和“走出去”相结合的</strong><em>对外开放战略</em>：对外开放是一项长期的基本国策</li></ol><h3 id="7-3-“三个代表”重要思想的历史地位"><a class="header-anchor" href="#7-3-“三个代表”重要思想的历史地位">¶</a>7.3 “三个代表”重要思想的历史地位</h3><ul><li>**『中国特色社会主义理论体系』**的丰富发展</li><li><strong>加强和改进党的建设、推进</strong>**『中国特色社会主义事业』**的强大理论武器</li></ul><h2 id="8-科学发展观"><a class="header-anchor" href="#8-科学发展观">¶</a>8 科学发展观</h2><h3 id="8-1-科学发展观的科学内涵"><a class="header-anchor" href="#8-1-科学发展观的科学内涵">¶</a>8.1 科学发展观的科学内涵</h3><ol><li><strong>第一要义：****『推动经济社会发展』</strong>，必须<ul><li><strong>加快转变</strong><em>经济发展</em>方式</li><li><strong>推动</strong><em>科学技术</em>的跨越式发展</li><li><strong>培养高素质创新型</strong><em>人才</em></li><li><strong>善于抓住和用好</strong><em>机遇</em></li></ul></li><li><strong>核心立场：****『以人为本』</strong>，要坚持发展<ul><li><strong>为了人民，始终把最广大</strong><em>人民的根本利益</em>放在第一位</li><li><strong>依靠人民，从人民群众的</strong><em>伟大创造中汲取智慧和力量</em></li><li><strong>发展成果由人民共享，着力提高</strong><em>人民物质文化生活水平</em></li><li><strong>最终是为了实现</strong><em>人的全面发展</em></li></ul></li><li><strong>基本要求：全民协调可持续</strong></li><li><strong>根本方法：统筹兼顾</strong></li></ol><h3 id="8-2-科学发展观的主要内容"><a class="header-anchor" href="#8-2-科学发展观的主要内容">¶</a>8.2 科学发展观的主要内容</h3><ul><li><strong>加快转变经济发展方式</strong><ul><li><strong>以</strong><em>科学发展</em>为主题</li><li><strong>加快转变</strong><em>经济发展</em>方式为主题</li></ul></li><li>**加快城乡发展一体体制，**<em>新四化</em><ul><li><strong>工业化</strong></li><li><strong>信息化</strong></li><li><strong>城镇化</strong></li><li><strong>农业现代化</strong></li></ul></li><li><strong>发展</strong>**『社会民主政治』**<ul><li><strong>本质：人民当家做主</strong></li></ul></li><li><strong>构建</strong>**『社会主义和谐社会』**<ul><li><strong>胡锦涛</strong>**『社会和谐』<strong>是</strong>『中国特色社会主义』**的本质属性</li></ul></li><li><strong>全面提高党的建设</strong><em>科学化</em>水平<ul><li><p><strong>新形势下，党面临</strong></p><ul><li><strong>执政</strong></li><li><strong>改革开放</strong></li><li><strong>市场经济</strong></li><li><strong>外部环境 危机</strong></li></ul><p><strong>是</strong></p><ul><li><strong>长期</strong></li><li><strong>复杂</strong></li><li><strong>严峻 的</strong></li></ul><p><strong>有</strong></p><ul><li><strong>精神懈怠</strong></li><li><strong>能力不足</strong></li><li><strong>脱离群众</strong></li><li><strong>消极腐败 危机</strong></li></ul></li></ul></li></ul><h3 id="8-3-科学发展观的历史地位"><a class="header-anchor" href="#8-3-科学发展观的历史地位">¶</a>8.3 科学发展观的历史地位</h3><ul><li>**『中国特色社会主义理论体系』**在新世纪新阶段的接续发展</li><li><strong>全面建设小康社会、加速推进社会主义现代化的根本指针</strong></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;毛泽东思想和中国特色社会主义理论体系概论&lt;/h1&gt;
&lt;h2 id=&quot;0-导论&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#0-导论&quot;&gt;¶&lt;/a&gt;0 导论&lt;/h2&gt;
&lt;h3 id=&quot;0-1-马克思主义中国化时代化的提出&quot;&gt;&lt;a class=&quot;heade</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>密码学整理</title>
    <link href="https://ryanstarfox.github.io/2026/01/05/2026/20260105%20%E5%AF%86%E7%A0%81%E5%AD%A6/"/>
    <id>https://ryanstarfox.github.io/2026/01/05/2026/20260105%20%E5%AF%86%E7%A0%81%E5%AD%A6/</id>
    <published>2026-01-05T03:08:00.000Z</published>
    <updated>2026-01-05T03:08:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>密码学</h1><p><img src="/images/2026/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.png" alt="密码学思维导图"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="古典密码"><a class="header-anchor" href="#古典密码">¶</a>古典密码</h2><h3 id="代换"><a class="header-anchor" href="#代换">¶</a>代换</h3><ul><li><p>移位密码（Caesar密码是k=3的特殊情况）</p><p>密钥空间仅25个元素</p></li><li><p>单表代换密码</p><p>密钥空间26!种，足够大</p><p>但是可以通过统计学解密</p><ul><li><p>仿射密码：单表代换密码的一种</p><p>$e(x)=ax+b(mod 26),a,b\in Z_{26}$</p></li></ul></li><li><p>多表代换密码，一次加密多个字符，掩盖统计频率</p><ul><li>Playfair密码：两个字母→两个字母<ul><li>先排成5*5矩阵</li><li>一组中的两字母同行，则每个字母用该行的后一字母替代；</li><li>一组中的两字母同列，则每个字母用该列的后一字母替代；</li><li>非同行同列字母替代，用对角的两个字母替代</li></ul></li><li>Hill密码：m个连续字母用m个密文字母代替，乘以密钥矩阵</li><li>Vigenere Cipher：<ul><li>密钥确定字母表的顺序，第i个字母表示使用第i个字母表</li><li>依次使用字母表，周期使用密钥</li></ul></li><li>OTP（One Time Pad）：绝对安全<ul><li>密钥长度与明文一样长</li><li>密文可拓展（可以被修改）</li></ul></li></ul></li></ul><h3 id="置换"><a class="header-anchor" href="#置换">¶</a>置换</h3><ul><li>栅栏加密：横着写竖着读</li><li>换位技术：明文写为矩阵块，但是列顺序打乱</li></ul><h3 id="乘积密码"><a class="header-anchor" href="#乘积密码">¶</a>乘积密码</h3><p>密码的复合</p><h2 id="对称式密码"><a class="header-anchor" href="#对称式密码">¶</a>对称式密码</h2><h3 id="Feistel-密码"><a class="header-anchor" href="#Feistel-密码">¶</a>Feistel 密码</h3><p>每一轮加密：</p><p>$E_k(L,R) = \left(R,L\oplus F(R,K)\right)$</p><p>$E_k^{-1}(L,R) = \left(R\oplus F(L,K),L\right)$</p><p>加密和解密是一样的，只不过密钥倒序</p><h3 id="DES"><a class="header-anchor" href="#DES">¶</a>DES</h3><p>DES密码使用了Feistel架构，其轮函数F和密钥构造如下：</p><h4 id="轮函数"><a class="header-anchor" href="#轮函数">¶</a>轮函数</h4><p>$F(L,K)= = P( S( E(L) \oplus K ) )$</p><p>其中$S$是一个固定公开是代换，$P$是一个固定公开的置换</p><h4 id="密钥构造"><a class="header-anchor" href="#密钥构造">¶</a>密钥构造</h4><h3 id="3重DES"><a class="header-anchor" href="#3重DES">¶</a>3重DES</h3><p>2DES可以用2^56^攻破（Merkle-Hellman攻击），因此使用3DES，需要2^112^攻破</p><p>3DES一般性使用$E_{k_1}\circ D_{k_2}\circ E_{k_1}$</p><p>当$k_1=k_2$时，退化为DES</p><h4 id="Merkle-Hellman攻击："><a class="header-anchor" href="#Merkle-Hellman攻击：">¶</a>Merkle-Hellman攻击：</h4><h5 id="1-准备阶段（离线预计算）"><a class="header-anchor" href="#1-准备阶段（离线预计算）">¶</a>1. 准备阶段（离线预计算）</h5><p>你说得对，这步不需要知道真实的密钥。</p><ul><li>攻击者设定中间值 A=0。</li><li>对于 DES 所有可能的密钥 k（共 256 个），计算什么样的明文 P 经过加密能得到 0。</li><li><strong>结果：</strong> 得到一张表，里面存了 256 组 (Pi,K1,i)，满足 EK1,i(Pi)=0。</li></ul><h5 id="2-采样阶段（获取数据）"><a class="header-anchor" href="#2-采样阶段（获取数据）">¶</a>2. 采样阶段（获取数据）</h5><ul><li>这就是课件里说的“代价：256 数量级的选择明文”。</li><li>攻击者获取 256 组真实的明文密文对 (P,C)。</li><li><strong>逻辑：</strong> 根据概率，这 256 组里，<strong>极大概率</strong>有一个明文 P∗，它在<strong>真实密钥</strong> K1 的作用下，产生的中间值 A刚好就是 0。</li></ul><h5 id="3-破解阶段（在线匹配）"><a class="header-anchor" href="#3-破解阶段（在线匹配）">¶</a>3. 破解阶段（在线匹配）</h5><p>这是你提到的“做一个 2DES”的部分，但重点在于<strong>匹配</strong>：</p><ol><li><strong>从密文端反推：</strong> 既然我们假设 A=0 了，那么剩下的两层加密（K2,K3）就变成了一个 <strong>2DES</strong> 过程：C=EK3(DK2(0))。<ul><li><em>注：这里课件为了简化，可能假设了 K2=K3 或者某种两重加密结构，计算量级约在 256 到 2112之间。</em></li></ul></li><li><strong>寻找匹配：</strong> 当你通过密文端算出一组可能的 (K2,K3) 后，你手头已经有了那个“让 A=0”的特定明文 P∗。</li><li><strong>最终锁定：</strong> 你去第一步那张大表里，查这个 P∗ 对应的 K1 是谁</li></ol><h3 id="更多发展"><a class="header-anchor" href="#更多发展">¶</a>更多发展</h3><p>IDEA、AES、SM4</p><h2 id="常用密码算法"><a class="header-anchor" href="#常用密码算法">¶</a>常用密码算法</h2><h3 id="密码本模式（ECB模式）"><a class="header-anchor" href="#密码本模式（ECB模式）">¶</a>密码本模式（ECB模式）</h3><p>用相同密钥对各个明文组分别加密，一次处理</p><p>𝑛位明文每个𝑛位明文对应唯一密文</p><p>容易被攻击，因为相同𝑛位明文对应相同𝑛位密文</p><h3 id="密码分组链接模式-（CBC模式）"><a class="header-anchor" href="#密码分组链接模式-（CBC模式）">¶</a>密码分组链接模式 （CBC模式）</h3><p>将消息分为很多块，并通过加密进行链接。已加密</p><p>的密文分组与当前的明文分组链接在一起。</p><p>需要使用初始向量IV</p><p>加密时：</p><p>$C_{i}=E_k(P_{i}\oplus C_{i-1}),C_{-1}=\text{IV}$</p><p>解密时:</p><p>$P_{i}= D_K(C_{i}) \oplus C_{i-1},C_{-1}=\text{IV}$</p><ul><li><strong>优点</strong><ul><li>每个密文分组均依据于之前的全部分组</li><li>对任意一个分组的改动都会影响后继的所有密文分组</li><li>需要初始向量（IV必须随机选择）</li></ul></li><li><strong>缺点</strong><ul><li>如果攻击者获得了IV，可以通过预先改变IV中的某些位，使得接收者的明文中部分位被取反</li><li>$P_1[i] = \text{IV}[i] ⊕ E_k^{-1}(C_1[i])$</li><li><strong>解决方法</strong>：在发送消息前<strong>用ECB来保护IV</strong></li><li>会受到选择密文攻击</li></ul></li></ul><h3 id="密码反馈模式（CFB）"><a class="header-anchor" href="#密码反馈模式（CFB）">¶</a>密码反馈模式（CFB）</h3><p>类似CBC</p><p>加密：</p><p>$C_i= P_i \oplus E_K(C_{i-1}), C_{-1}=\text{IV}$</p><p>解密：</p><p>$P_i=C_i \oplus E_K(C_{i-1}),C_{-1}=\text{IV}$</p><h3 id="输出反馈模式（OFB）"><a class="header-anchor" href="#输出反馈模式（OFB）">¶</a>输出反馈模式（OFB）</h3><p>加密：</p><p>$C_i= P_i \oplus O_i$</p><p>$O_i=E_K(O_{i-1}),O_0=\text{IV}$</p><p>解密：</p><p>$P_i= C_i \oplus O_i$</p><p>$O_i=E_K(O_{i-1}),O_0=\text{IV}$</p><p><strong>优点</strong></p><ul><li>传输过程中，比特差错不会扩散</li><li>可以预计算分组，流加密时不需停顿</li></ul><p><strong>缺点</strong></p><ul><li>对抗消息流篡改攻击的能力弱于CFB：若对密文取反，则解密后的明文也取反，可以看作是一次一密的变形（Vernam密码），所以绝对不能重复使用相同的密钥序列和IV</li><li>发送方和接收方必须同步</li></ul><h3 id="计数器模式（CTR）"><a class="header-anchor" href="#计数器模式（CTR）">¶</a>计数器模式（CTR）</h3><p>类似OFB</p><p>对每个明文，必须使用不同的分组密钥和计算器值（类似OTP，绝不重用）</p><p>可以并行处理</p><p>$C_i= P_i \oplus O_i$</p><p>$O_i = E_K(\text{Counter++})$</p><p><strong>优点</strong></p><ul><li>高效<ul><li>可以并行处理多块明文密文</li><li>可以预计算</li><li>Good for bursty high speed links</li></ul></li><li>随机访问：密文的第i个分组可以随机访问，不需知道前面i-1个密文组（比较：CBC）</li><li>可证安全：是CPA安全的<ul><li>前提：使用了真正的随机数生成器生成counter的起始值，并且绝不重用</li></ul></li></ul><p><strong>缺点</strong></p><ul><li>密钥、计数器值绝不能重用</li></ul><h3 id="随机数"><a class="header-anchor" href="#随机数">¶</a>随机数</h3><h4 id="随机性测试"><a class="header-anchor" href="#随机性测试">¶</a>随机性测试</h4><ul><li>测试特征<ul><li>均匀性：0或1出现的概率和量大致相等</li><li>可伸缩性：测试可以用于子序列</li><li>一致性：测试针对所有的初始值</li></ul></li><li>NIST SP800-22给出了15种测试方法<ul><li>频率测试（最基本）：0/1个数与真随机序列的期望大致相等</li><li>Maurer通用统计测试：测试是否可以大幅压缩数据且不损失信息</li></ul></li><li>不可预测程度<ul><li>前向不可预测性：不知道种子，无法依据已有bit预测下一bit</li><li>后向不可预测性：从序列无法推出种子值</li></ul></li></ul><h4 id="伪随机数生成器："><a class="header-anchor" href="#伪随机数生成器：">¶</a>伪随机数生成器：</h4><ul><li>形式化定义：</li><li>指任意多项式时间算法，都不能以不可忽略的概率区分𝐺(𝑠)所产生的序列 vs. 等长的真随机序列。</li><li>证明：如果攻击者不能区分 PRG 输出和真随机序列，那么他也就不能区分用 PRG 加密的密文与 OTP 加密的密文。</li></ul><h2 id="对称保密技术"><a class="header-anchor" href="#对称保密技术">¶</a>对称保密技术</h2><p>定理：完善保密系统中，明文空间的尺寸</p><p>$|M|$一定小于等于密钥空间的尺寸$|K|$ ，即$|𝐾| ≥ |𝑀|$</p><p>完善保密，但是不实用</p><p>新的安全的定义</p><ul><li>严格的安全定义（现代密码学的第一准则）：攻击者能力及攻击者成功：安全模型</li><li>合理的假设（现代密码学的第二准则）：往往是数学难题</li><li>严格的安全证明（现代密码学的第三准则）：严密的推理过程</li></ul><p>一些定义</p><ul><li>有效的算法：多项式时间可以执行的算法</li><li>可忽略的量：对任意多项式$p$，都存在$N$，使得对所有$n &gt; N$，都有$f(n)&lt;\dfrac1{p(n)}$<ul><li>对于加法和乘法封闭</li></ul></li></ul><p>计算安全: 没有多项式时间的攻击者能以不可忽略的概率实现攻击</p><p>IND-CPA vs IND CCA：前者只能获得挑战密文的解密结果，后者可以获得除挑战密文外，任意密文结果</p><h2 id="散列函数（Hash函数）"><a class="header-anchor" href="#散列函数（Hash函数）">¶</a>散列函数（Hash函数）</h2><p>$h = H(M)$, $M$是变长的消息,$h$是定长的散列值.</p><ul><li><strong>单向性</strong>：对任意给定的码$h$, 寻求$x$使得$H(x)=h$在计算上是不可行的;</li><li><strong>弱抗碰撞性</strong>：任意给定消息x, 寻求不等于x的y, 使得H(y)= H(x)在计算上不可行</li><li><strong>强抗碰撞性</strong>：寻求对任何的(x,y)对使得H(x)=H(y)在计算上不可行</li></ul><h3 id="Merkle-Damgard结构"><a class="header-anchor" href="#Merkle-Damgard结构">¶</a>Merkle Damgard结构</h3><p>实际上就和CBC模式比较像，只是使用的f函数不一样，使得该密码不可逆</p><p>长度拓展攻击：知道HASH(message)的情况下，也可以推算出HASH(Message||Append)的值</p><p>生日攻击：对输出长度为m的Hash函数，值$2^{\frac m2}$决定了该Hash函数抗穷举攻击的能力，因为超过这个值就有一半的概率能找到两个碰撞</p><h3 id="MD5"><a class="header-anchor" href="#MD5">¶</a>MD5</h3><ul><li><p><strong>步骤</strong>1：添加填充位(一个1 和若干个0)</p><p>在消息的最后添加适当的填充位使得数据位的长度满足</p><p>$$<br>\text {length}\equiv  448 (\mod 512)<br>$$</p></li><li><p><strong>步骤</strong>2：添加长度</p></li><li><p>原始消息长度（二进制位的个数），用64位表示。如果长度超过2^64^位，则仅取最低64位，即mod 2^64^。</p><p>到此为止，我们已经得到$L$个512位的数据块：$Y_0,Y_1,\cdots,Y_{L-1}$。其长度为$L\times 512$ bits。令$N=L\times16$，令$M[0\cdots N-1]$表示以字为单位的消息表示。</p></li><li><p><strong>步骤</strong>3：初始化MD缓冲区</p><p>一个128位MD缓冲区用以保存中间和最终散列函数的结果。它可以表示为4个32位的寄存器(A,B,C,D)。寄存器初始化为以下的16进制值。使用低端格式存储。</p></li><li><p><strong>步骤</strong>4：处理消息块（Compress函数）</p><figure class="highlight text"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">A_old = A</span><br><span class="line">B_old = B</span><br><span class="line">C_old = C</span><br><span class="line">D_old = D</span><br><span class="line"></span><br><span class="line">A_prime = B_old + ROL(A_old + F(B_old, C_old, D_old) + M[k] + T[i], s)</span><br><span class="line"></span><br><span class="line">A = D_old</span><br><span class="line">B = A_prime</span><br><span class="line">C = B_old</span><br><span class="line">D = C_old</span><br></pre></td></tr></table></figure><p>其中T[i] 是 MD5 里预先定义的一组 <strong>64 个常数</strong>，由正弦函数生成</p><p>ROL是左移，s是左移的位数，预先固定</p><p>F在第一轮中使用，二三四轮分别使用HGI函数，每轮有16步</p><p>$F(B,C,D) = (B \land C) \lor (\neg B \land D)$</p><p>$G(B,C,D) = (B \land D) \lor (C \land \neg D)$</p><p>$H(B,C,D) = B \oplus C \oplus D$</p><p>$I(B,C,D) = C \oplus (B \lor \neg D)$</p></li><li><p><strong>步骤</strong>5：重复步骤4，直至结束。</p><p>$\text{Compress}(H_{i-1},H_i)$，其中$H_0={A,B,C,D}$</p></li></ul><p>注：步骤四中还要打乱顺序</p><ul><li>每轮中X[0…15]恰好被使用一次</li><li>轮1 保持初始顺序</li><li>轮2 $\rho_2(i) \equiv (1+5i) (mod 16)$</li><li>轮3 $\rho_3(i) \equiv (5+3i) (mod 16)$</li><li>轮4 $\rho_4(i) \equiv 7i (mod 16)$</li></ul><h3 id="SHA-1"><a class="header-anchor" href="#SHA-1">¶</a>SHA-1</h3><p>从64拓展到了80（分组数变成5组，4轮）</p><p>X[0…15]变成了消息扩展（16→80）</p><h3 id="SHA-3"><a class="header-anchor" href="#SHA-3">¶</a>SHA-3</h3><p>Keccak算法，有sponge函数</p><h2 id="消息认证码-MAC"><a class="header-anchor" href="#消息认证码-MAC">¶</a>消息认证码(MAC)</h2><ul><li>类似加密函数，但是不可逆</li><li>提供认证性（信息是全的），不提供数字签名（谁发的信息）</li></ul><h3 id="DAC"><a class="header-anchor" href="#DAC">¶</a>DAC</h3><ul><li>DES MAC （CBC-MAC)，只输出CBC最后那一个数据块</li></ul><h3 id="CMAC"><a class="header-anchor" href="#CMAC">¶</a>CMAC</h3><ul><li><p>消息认证：M||C~k~(M)</p></li><li><p>消息加密、认证：E~k2~(M||C~k1~(M))或者E~k2~(M)||C~k1~(E~k2~(M))</p></li><li><p>主密钥 K：用户提供的原始密钥（如 AES-128 密钥）。</p><p>子密钥 K1：由 K 派生，用于处理完整分组的最后一组。</p><p>子密钥 K2：由 K 派生，用于处理不完整分组的最后一组</p></li></ul><p>使用AES+CBC模式</p><h3 id="HMAC"><a class="header-anchor" href="#HMAC">¶</a>HMAC</h3><p>简单来说：Hash(密钥 + Hash(密钥 + 消息))</p><p>实际上：</p><p>$$<br>\text{HMAC}_K(M) = \text{Hash}[(K^+ \oplus \text{opad}) \Vert \text{Hash}[(K^+ \oplus \text{ipad}) \Vert M]]<br>$$</p><h3 id="认证加密方式"><a class="header-anchor" href="#认证加密方式">¶</a>认证加密方式</h3><ul><li>HtE/Hash then Encrypt/E~k~(M||H(M))</li><li>MtE/Mac then Encrypt/E~k~(M||MAC(M))</li><li>E&amp;M/Encrypt and Mac/E~k~(M)||MAC(M)</li><li>EtM/Encrypt then Mac/E~k~(M)||MAC(E~k~(M))</li></ul><h3 id="认证加密模式"><a class="header-anchor" href="#认证加密模式">¶</a>认证加密模式</h3><p>CCM：$\text{Result} = \underbrace{\text{CTR}<em>K(M)}</em>{\text{密文 } C} \parallel \underbrace{(\text{MAC}<em>K(M) \oplus S_0)}</em>{\text{加密后的标签 } T'}$，其中$S_0=E_K(\text{Nonce} \parallel\text{Counter}_0)$</p><p>GCM模式</p><h2 id="公钥密码算法"><a class="header-anchor" href="#公钥密码算法">¶</a>公钥密码算法</h2><h3 id="数论"><a class="header-anchor" href="#数论">¶</a>数论</h3><h4 id="素数"><a class="header-anchor" href="#素数">¶</a>素数</h4><ol><li>素数个数无限</li><li>$\pi(x)$代表不大于$x$的素数个数，有<ol><li>$\lim\limits_{x\to\infty}\dfrac{\pi(x)}x=0$</li><li>$\lim\limits_{x\to\infty}\dfrac{\pi(x)}{\frac x{\log x}} = 1$</li></ol></li><li>双生素数有无限多对</li></ol><h4 id="同余与整除"><a class="header-anchor" href="#同余与整除">¶</a>同余与整除</h4><ol><li><p>寻找最大公约数：辗转相除法；也可以用来找到取模意义下的逆元，此时称为拓展欧几里得算法</p></li><li><p>整数唯一因子分解</p></li><li><p>等价类和剩余系</p><p>将整数集合$Z$分成$m$个等价类：$[0],[1],\cdots,[m-1]$</p><ul><li>模$m$的<strong>完全剩余系</strong>：$a_i\in[i]\to{a_0,a_1,\cdots,a_{m-1}}$</li><li>模$m$的<strong>非负最小完全剩余系</strong>（$Z_m$）：${0,1,\cdots,m-1}$</li><li>模$m$的<strong>简化剩余系</strong>：去掉模$m$的完全剩余系中，与$m$不互素的那些数，剩下的部分</li></ul></li><li><p>欧拉定理</p><p>若$(a,n)=1$，则$a^{\phi(n)}\equiv 1(\mod n)$</p><p>特别地，若$n=pq$，$p$，$q$为素数时，有$a^{\phi(pq)+1}\equiv a^{(p-1)(q-1)+1}\equiv a(\mod n)$，即使$(n,a)\ne1$，等式仍成立</p></li><li><p>费马小定理</p><p>$p$是素数，$a$是正整数，$p\nmid a$，则有$a^{p-1}\equiv 1(\mod p)$</p></li><li><p>素性测试：返回否定结论一定正确，放回肯定概率出错概率极低，执行多次之后返回肯定结论出错概率大大降低</p><p>常用Miller-Rabin概率算法</p></li><li><p>中国剩余定理</p></li></ol><h4 id="次数和原根"><a class="header-anchor" href="#次数和原根">¶</a>次数和原根</h4><ul><li>次数<ul><li>$(a,m)=1$，使得$a$的幂模$m$同余循环的最小周期$k$，称为$a$模$m$的次数</li><li>$k\mid\Phi(m)$，但是$k=\Phi(m)$不一定成立</li></ul></li><li>原根<ul><li>若$a$模$m$的次数为$\Phi(m)$，则称$a$是模$m$的一个原根</li><li>$m$有原根的充要条件是$m$形如$2,4,2^np^l,p^l$，且原根个数有$\Phi(\Phi(m))个$</li></ul></li></ul><h4 id="离散对数问题"><a class="header-anchor" href="#离散对数问题">¶</a>离散对数问题</h4><p>$y\equiv g^x(\mod m)$，则$x=\log_gy(\mod m)$</p><p>由x,g,m计算y容易，但是由y,g,m计算x非常困难</p><h4 id="一些抽象代数"><a class="header-anchor" href="#一些抽象代数">¶</a>一些抽象代数</h4><ul><li><p>群：封闭性、结合律、单位元、逆元</p><ul><li>交换群：群+交换律</li><li>有限群：群+元素个数有限</li><li>循环群：所有元素可以通过生成元自乘得到</li></ul></li><li><p>环 (Ring)：集合 R 定义了加法 (+) 和乘法 (×)：</p><ol><li>(R, $+$) 必须是一个交换群（单位元是 0）。</li><li>(R, $\times$) 满足结合律（不要求有单位元，也不要求可交换）。</li><li>分配律：a(b+c)=ab+ac</li></ol><ul><li><p>交换环：满足乘法交换律 (ab=ba)</p></li><li><p>含单位元环：存在乘法单位元（通常记为 1）。</p></li><li><p>整环 (Integral Domain)：</p><ul><li>是一个交换环。</li><li>有乘法单位元 1。</li><li>无零因子：即若 ab=0，则必有 a=0 或 b=0。</li></ul></li></ul></li><li><p>域：整环+每个元素都有乘法逆元</p><ul><li>有限域：集合内个数有限</li></ul></li></ul><p>$$<br>\text{群} \xrightarrow{\text{+乘法,分配律}} \text{环} \xrightarrow{\text{+交换,单位元}} \text{交换环} \xrightarrow{\text{+无零因子}} \text{整环} \xrightarrow{\text{+非零元有逆}} \text{域}<br>$$</p><h3 id="公钥系统定义及RSA"><a class="header-anchor" href="#公钥系统定义及RSA">¶</a>公钥系统定义及RSA</h3><p>仅利用对称加密，在无可信第三方，双方互不信任时，实现双方密钥交换——Merkle Puzzle</p><p>但是通信效率低</p><p>之后需要非对称算法——公钥算法</p><p>需要找到一个单向函数——找到了离散对数</p><h4 id="非对称算法"><a class="header-anchor" href="#非对称算法">¶</a>非对称算法</h4><ol><li><p>MH scheme背包问题：本质上是子集元素和——被攻破</p></li><li><p>RSA算法——大模型取模，基于整数分解</p><ol><li>选素数：随机选择两个不同的大素数 p 和 q。</li><li>算模数：计算 n=p×q。这个 n 的长度（如 2048 位）决定了加密强度。</li><li>计算欧拉函数：计算 ϕ(n)=(p−1)(q−1)。ϕ(n) 表示不超过 n 且与 n 互素的正整数个数。</li><li>选公钥指数 e：选择一个整数 e，满足 1&lt;e&lt;ϕ(n) 且 gcd(ϕ(n),e)=1（即 e 与 ϕ(n) 互素）。</li><li>算私钥指数 d：计算 d 使得 d≡e^−1^(modϕ(n))。这一步通常利用图片中提到的扩展欧几里得算法来求解逆元。</li></ol><p>结果：</p><ul><li>公开参数：大模数 n 和公钥 e。</li><li>秘密参数：大素数 p,q 和私钥 d。</li></ul><p>加解密：</p><ul><li>加密：$C\equiv M^e\mod n$</li><li>解密：$M\equiv C^d\mod n$</li></ul><p>攻击：</p><ul><li>p,q太接近</li><li>共模攻击：使用相同的n</li><li>小e攻击</li><li>计时攻击</li></ul></li><li><p>Diffie-Hellman密钥协商，基于离散对数</p><p>就是直接把自己的密钥，用对方的公钥加密发送给对方</p><p>容易被中间人攻击</p></li><li><p>ElGamel加密算法</p><p>系统参数 $p,g$</p><p>Alice选择私钥$x_A\in F_p^*$，计算公钥$y_A\equiv g^{X_A}\mod p$</p><p>Bob发送消息给Alice，密文$C=(C_1,C_2)$，随机选择$k\in F_p^*$</p><p>$C_1 \equiv g^k\mod p$$C_2\equiv y_A^k\cdot M$</p><p>Alice解密过程：$M=\dfrac{C_2}{C_1^{x_A}}$</p><ul><li>不抗CPA/CCA攻击（实际使用的是抗的）</li></ul></li></ol><h4 id="公钥加密安全模型"><a class="header-anchor" href="#公钥加密安全模型">¶</a>公钥加密安全模型</h4><h5 id="Chosen-Plaintext-Attack-CPA-安全模型"><a class="header-anchor" href="#Chosen-Plaintext-Attack-CPA-安全模型">¶</a>Chosen Plaintext Attack (CPA)安全模型</h5><ol><li>C发公钥$p_k$给A</li><li>A发$m_0,m_1$给C</li><li>C随机加密$m_0,m_1$之后，发给A，让A破解出私钥</li></ol><h5 id="Chosen-Ciphertext-Attack-CCA-安全模型"><a class="header-anchor" href="#Chosen-Ciphertext-Attack-CCA-安全模型">¶</a>Chosen Ciphertext Attack (CCA)安全模型</h5><ol><li>A访问$Dec_{sk}()$</li><li>C发公钥$p_k$给A</li><li>A发$m_0,m_1$给C</li><li>C随机加密$m_0,m_1$之后，发给A，</li><li>A访问$Dec_{sk}()$，让A破解出私钥</li></ol><p>增加了一个Decoder，可以随时获取密文对应的明文结果</p><h3 id="椭圆曲线"><a class="header-anchor" href="#椭圆曲线">¶</a>椭圆曲线</h3><p>$E_p(a,b)(x,y):y^2=x^3+ax+b$且$4a^3+27b^2\ne 0$外加无穷远点</p><p>可以证明$E(x, y)$结合所定义的加法构成一个“加群”</p><p>$P,Q$两点的连线$L$，$L$与$E$相交于点$R’$，$P+Q$定义为 $R = -R’$。其几何意义为:</p><ul><li>如果$x_1≠ x_2$， $P+Q=R$：是$P$和$Q$连线$L$与$E$的交点关于$x$轴的对称点</li><li>如果$x_1=x_2$， $y_1=-y_2$ ，$P+Q=O$：即无穷远点</li><li>如果$x_1= x_2$，$y_1= y_2$ ，$P+Q=2P$：是过$P$的$E$的切线与$E$的交点关于$x$轴的对称点</li></ul><p>它是一个可循环Abel群，因此可以定义离散对数问题，且是困难的，所以可以用于加密</p><p>同样可以有DH，ElGamal（只不过是定义在加法群而不是乘法群上面）</p><p>加法的具体算法：$x_3=\lambda^2-x_1-x_2;y_3=\lambda(x_1-x_3)-y_1$</p><h4 id="SM2"><a class="header-anchor" href="#SM2">¶</a>SM2</h4><p>规定符号：</p><ul><li>KDF(input): 代表用输入(input)计算出一个给定长度的随机数</li><li>H(input): 代表用输入(input)计算出哈希(hash)函数值</li><li>所有指数运算都在椭圆曲线群上进行</li></ul><p>计算方式：</p><ul><li>密钥生成<ul><li>选择私钥$x$，计算公钥$g^x$</li></ul></li><li>加密算法<ul><li>选择随机数$k$，计算$C_1=g^k$</li><li>计算$C_2= \text{KDF}((g^x)^k)\oplus M$</li><li>计算$C_3= \text H(C_2,M)$</li><li>密文$C=C1 ||C2||C3$</li></ul></li><li>解密算法<ul><li>计算$M=C_2\oplus \text{KDF}((C_1)^x)$</li><li>验证$C_3= \text H(C_2,M)$是否成立</li><li>若成立，输出$M$为解密结果</li><li>否则报错并退出</li></ul></li></ul><h2 id="数字签名"><a class="header-anchor" href="#数字签名">¶</a>数字签名</h2><h3 id="分类"><a class="header-anchor" href="#分类">¶</a>分类</h3><h4 id="直接数字签名"><a class="header-anchor" href="#直接数字签名">¶</a>直接数字签名</h4><h4 id="间接数字签名"><a class="header-anchor" href="#间接数字签名">¶</a>间接数字签名</h4><p>对哈希函数签名</p><h3 id="RSA签名方案"><a class="header-anchor" href="#RSA签名方案">¶</a>RSA签名方案</h3><p>PKCSA1:先哈希，再签名</p><p>要有填充，防止选择密文攻击</p><h3 id="DSS签名方案"><a class="header-anchor" href="#DSS签名方案">¶</a>DSS签名方案</h3><h3 id="ECC签名方案"><a class="header-anchor" href="#ECC签名方案">¶</a>ECC签名方案</h3><p>ECDSA：椭圆曲线上的DSA签名</p><h3 id="怎么管理公钥"><a class="header-anchor" href="#怎么管理公钥">¶</a>怎么管理公钥</h3><h4 id="最简单的"><a class="header-anchor" href="#最简单的">¶</a>最简单的</h4><p>容易被中间人攻击</p><h4 id="公开可访问目录"><a class="header-anchor" href="#公开可访问目录">¶</a>公开可访问目录</h4><p>一旦攻击者获得目录管理员私钥，则可伪造任意通信方</p><h4 id="公钥授权"><a class="header-anchor" href="#公钥授权">¶</a>公钥授权</h4><p>管理员容易被DDOS攻击</p><h4 id="公钥证书"><a class="header-anchor" href="#公钥证书">¶</a>公钥证书</h4><p>类似信用卡，有一定的有效期</p><h2 id="身份认证协议"><a class="header-anchor" href="#身份认证协议">¶</a>身份认证协议</h2><h3 id="口令认证"><a class="header-anchor" href="#口令认证">¶</a>口令认证</h3><p>相当于输密码</p><ul><li>在线字典攻击：穷举所有可能口令（从常用密码开始）</li><li>离线字典攻击：获取所有H(p~w~)，枚举p~w~</li><li>带预处理的离线字典攻击：提前计算所有可能口令对应的Hash值</li></ul><p>增加破解难度：</p><ul><li>加公开盐</li><li>加秘密盐</li><li>使用慢Hash函数</li><li>使用高存储代价的Hash函数</li></ul><h2 id="Kerberos"><a class="header-anchor" href="#Kerberos">¶</a>Kerberos</h2><p>引入认证服务器、票据服务器，前者只给用户访问票据服务器的票据，后者只给用户访问其它应用的票据</p><h2 id="X-509认证"><a class="header-anchor" href="#X-509认证">¶</a>X.509认证</h2><p>数字身份证</p><p>链状签发/信任</p><p>自签名证书——危险</p><p>撤销证书</p><ul><li>证书撤销列表</li><li>在线证书状况协议（OCSP）：可以给OCSP服务器验证是否valid</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;密码学&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/images/2026/%E5%AF%86%E7%A0%81%E5%AD%A6%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE.png&quot; alt=&quot;密码学思维导图&quot;  data-tag=&#39;post-im</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>《悲惨世界》 Repo</title>
    <link href="https://ryanstarfox.github.io/2025/12/08/2025/20251208%20%E6%82%B2%E6%83%A8%E4%B8%96%E7%95%8C/"/>
    <id>https://ryanstarfox.github.io/2025/12/08/2025/20251208%20%E6%82%B2%E6%83%A8%E4%B8%96%E7%95%8C/</id>
    <published>2025-12-07T18:14:00.000Z</published>
    <updated>2025-12-07T18:14:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>《悲惨世界》 Repo</h1><p>从初中历史课第一次听到10周年版的《悲惨世界》序曲开始，就一直喜欢这部音乐剧作品。高中毕业后，有幸曾在23年上海文化广场看过法语版《悲惨世界》，后来又在24年上影节的院线看了电影版，25年的上影节则在院线看了10周年版的录像，今天终于有幸在上海大剧院观看40周年版的《悲惨世界》音乐会。</p><p><img src="/images/2025/IMG_2597.jpg" alt="IMG_2597"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我自己的喜好，对于视频部分，必然是电影版最佳——毕竟有很多大制作特效，但是电影版的唱功肉耳可听不如音乐会版，真的很希望未来某一天AI能在把10周年的音频无违和地嫁接到电影版上。对于声音，我还是最喜欢10周年版本的——25周年整体的速度过快，少了庄重；法语版少了几首歌，剧情显得有点不那么连贯了。因此我最熟悉的也是10周年版的，下面的对比绝大多数也都是和10周年版本对比。</p><p>和之前一样，我也希望在观看演出前，先重听一遍10周年的专辑——但是很不巧，我这周只带了AirPods Pro回家，没法使用大馒头4听——本来多层次的音乐都被压扁了，低音的信息也丧失了，非常难受。24年上影节电影节版之前我重看了一遍原著，但是这次来不及重看一遍原著了——看了这么多遍，我想我应该也还记得大多数细节。</p><p>我这次斥巨资购置了座位非常好的票，坐在5V排正中。实际上第1，2排正中没有排座位，那里有一个延伸至台下的小T台，所以观看的时候可以离演员非常近，甚至有时恍惚间可以同时听到演员自己发出和经过麦克风收声发出的声音。序幕中冉阿让撕碎黄身份证的时候，站在T台往前扔，甚至前面两排的观众还可以捡到。有很多情绪化的表演，包括冉阿让重生、冉阿让归罪、沙威自杀、德纳第夫妇亮相，演员都会走到T台处与前排观众有眼神互动，真的能让人更加沉浸于音乐剧本身，更共情于各个角色。</p><p><img src="/images/2025/a43e170a1254c78dca3e0533612bd82d.jpg" alt="a43e170a1254c78dca3e0533612bd82d"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我本来一直担心40周年版的演出会继承25周年版的速度过快的问题，但最终的节奏蛮符合我自己的胃口的。印象里23年的法大悲是提前录制的伴奏，这次则是现场演出，音质油好了不少。40周年的演出增添了不少的桥段（相对于10周年）。感觉开头冉阿让独白的编曲改了，变得更有层次，也与冉阿让的独白更加对应了，当然也可能是现场版音质更好。在伽弗洛什出场的时候，还增加了伽弗洛什对爱潘妮的介绍，随后沙威也重新登场介绍自己在巴黎的角色。之后还增加了德纳第夫妇在路上认出冉阿让，引来沙威，沙威驱散众人。最后婚礼前，增加了冉阿让向马吕斯介绍自己背景、德纳第夫妇阴差阳错告诉马吕斯自己是被冉阿让所救的桥段。整体上还感觉德纳第夫妇的片段变长、变多了，时不时跳出来逗逗观众，贱贱地活跃活跃气氛。演出中一些性相关的桥段的呈现比之前看的更加露骨，真的很让人担心会被删减掉，好在没有。</p><p>我对于演员和演员的唱功实际上没那么敏感，我听上去总的来说还是非常不错的，最重要的冉阿让和沙威都没有让我失望。有点可惜沙威的长发并非像10周年一样是在台上自己散开来的，而是在放冉阿让走之前台下就散开来了。我还是很想看沙威“香消玉损”自己散开长发的场面的。几位热血青年在第一幕并没有穿上他们最标志性的服装，我一开始还以为这次的服装换掉了——尤其是安灼拉标志性的红金服装，但是在第二幕就换上最熟悉的那几身衣服。这次的芳汀是一位黑人演员——其实一开始有点出戏，因为原著中的芳汀是金发美女。我觉得芳汀比较慢热，没有马上进入状态，前几句的换气非常明显，有点影响体验，但是还好最终调整过来了。芳汀是黑人，那珂赛特的演员岂不是也得是黑人——还真是。比较脸盲，开始还以为是一人分饰两角，直至最后一幕两人同时上场才意识到是两个人。这次的爱潘妮和小柯赛特竟然是华人？小柯赛特超级可爱！这一版的德纳第夫妇比较出彩，更“油”、更要面子爱显摆、更“贱”：到T台问观众讨掌声、让沙威在捉到冉阿让的时候别忘了是自己举报的、最后婚礼中用中文对观众说的“你好”、“谢谢”，忍俊不禁。</p><p><img src="/images/2025/6100E632-D257-4573-814A-AB702B891E25_1_102_o.jpeg" alt="6100E632-D257-4573-814A-AB702B891E25_1_102_o"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>大悲的舞美也真的豪华——提几个印象比较深的点：舞台上面真的吊了一个“街垒”，在第一幕中街垒是升上去的，下面是灯，第二幕中降下来了。使用闪烁的白色灯光代表子弹，也用这种形式细细演绎了ABC之友社之死。在爱潘妮送信和沙威自杀时降下来的幽幽的路灯——真的让人感到是在阴暗的巴黎街头。以及最后的那两排蓝白红的条状灯——真的让人激情澎湃。还有最后Finale中，能明显感觉到死去的人的声音有一个“更远”的幽灵音效。但我觉得也有两点不如法大悲：法大悲在卞福汝主角出场时，用白光在舞台上方投影出了一个巨大的白色十字架，强调了他真的就是一个善良的“上帝”的化身。法大悲中多次拿出来法国国旗，尤其是在Finale中ABC之友挥舞几面法国国旗，真的让人激情澎湃——不过让一群英国人在中国挥舞法国国旗可能也有点奇怪吧。</p><p><img src="/images/2025/8c373028193662fbb68af4095d5b933c.jpg" alt="8c373028193662fbb68af4095d5b933c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>其实本来很期待有一个大Encore的——10周年的多国冉阿让、多语言《Do you hear the people sing》和25周年的历代演员都非常不错，但想必也是首演场的专属。谁想到这一次竟然一个Encore都没有，23年的法大悲都有encore，虽然不是《Do you hear the people sing》。略失望，但无妨。最好的大悲永远是现场的大悲——期待50周年巡演，我想我应当是还会再买票的。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;《悲惨世界》 Repo&lt;/h1&gt;
&lt;p&gt;从初中历史课第一次听到10周年版的《悲惨世界》序曲开始，就一直喜欢这部音乐剧作品。高中毕业后，有幸曾在23年上海文化广场看过法语版《悲惨世界》，后来又在24年上影节的院线看了电影版，25年的上影节则在院线看了10周年版的录像，今天终</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>东京旅程</title>
    <link href="https://ryanstarfox.github.io/2025/11/26/2025/20251126%20%E4%B8%9C%E4%BA%AC%E6%97%85%E8%A1%8C/"/>
    <id>https://ryanstarfox.github.io/2025/11/26/2025/20251126%20%E4%B8%9C%E4%BA%AC%E6%97%85%E8%A1%8C/</id>
    <published>2025-11-25T17:07:00.000Z</published>
    <updated>2025-12-28T17:48:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>东京旅程</h1><h2 id="印象"><a class="header-anchor" href="#印象">¶</a>印象</h2><p>暑假快结束的时候，我意识到我整个8月都没有出去，心里闷得慌，从那时，我就开始谋划这次在学期中的旅行。对我来说，旅行的一大意义在于“陌生感”。我出生在上海，因此很难在城市中找到陌生感——很不巧，自然景观往往交通不便，对于一个学生的中短期旅途非常麻烦。因此我将目光投到国外，希望从异域中找到陌生感——最终我选择了东京作为旅行的目的地：尽管我曾两度前往日本关西地区旅游，但却从未去过日本首都、亚洲第一城市东京，此番正好弥补如此憾事。</p><p>印象中，东京是一座让人迷乱的城市——夜色中的霓虹灯、匆忙汹涌的人潮、闪烁如星光LED灯带。或许有点类似上海的疏远，但是却又有种类似于香港的江湖气。怀揣着对异域的印象与期待，我于21日上午9时，踏入了飞往东京的飞机。</p><h2 id="旅程流水账"><a class="header-anchor" href="#旅程流水账">¶</a>旅程流水账</h2><p>中午降落在成田机场，与朋友在机场的吉野家吃了在日本的第一顿正餐，随后便赶往酒店。一切收拾好之后，竟然4点多已近日落——成日在室内学习工作，竟然已经忘了冬天的黄昏有多早。我们爬上酒店的楼顶，在那里可以看到黄昏中的东京塔。东京塔仍未亮灯，旁边高楼镜子一般的外立面将黄昏的阳光反射过来，也不刺眼。东京塔微微亮灯之后，我们下楼前往东京塔下兜了一圈——我们没有上东京塔，一方面觉得东京塔本质上和东方明珠没什么区别，另一方面上了塔就看不到塔了——或许有点本末倒置。</p><p>晚间我们前往上野公园和阿美横丁。朋友没吃过鸟贵族，就去吃了一顿鸟贵族。本来是想去上野公园看红叶和黄叶的，但是晚间所有的叶子都被灯光染成温暖的黄色了。圣诞活动已经开始了，有些树上的LED灯带已经全部点亮了，仿佛奏响了80年代的迪斯科一样。</p><p>第二日前往浅草与晴空塔。晴空塔和东京塔本质上也差不多，所以我们也没上去。倒是在浅草寺和旁边的商店街逛了很久，给国内的友人带了一些御守作为伴手礼。去浅草寺求了签。朋友抽到了凶签，系在了寺里。我有些忐忑，但最终抽出来是吉签，将签纸带回了家。在浅草商店街吃了日语老师推荐的*烧肉王（焼肉きんぐ）*非常美味的烤肉自助，虽然小贵，但是吃了很多，当成两顿饭吃了。晚上去皇居外苑兜了一圈——依旧是被灯光染黄的黄叶，所幸是银杏叶，被染黄也不显违和。皇居外围有一些公园是可以进去的，但是里面是不能进的。其实给我的感受只是一个更大、护城河还没干、没有天守阁、仍在使用的日本传统城池。</p><p><img src="https://file+.vscode-resource.vscode-cdn.net/images/2025/tokyo.jpeg" alt="富士山" title="富士山"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>第三日，就是最让人期待的富士山了。之前为了图快，我们购置了从新宿到河口湖的特急巴士票。但是措手不及的堵车，让我们花了两个半小时才到达河口湖。风景确实秀美，东京郊区的山都是午夜六色的，多い素晴らしい紅葉ですね！我们运气很好——早上起来的时候是阴天，不过在开过来的半路，太阳露出了一个角，到了傍晚终于完全放晴，像个贪睡的大学生一样。中午看着被云层笼罩的富士山，以为山上没有雪，但是放晴之后看清楚了，原来富士山上已经有一些雪了。我带了一个胶片相机，36张照片，几乎全是在富士山这里拍掉的。晚上回东京市里又是三个半小时，本想去日语老师推荐的另一家餐馆<em>登亭</em>去吃鳗鱼饭，但是因为堵车，错过了<em>登亭</em>的营业时间。本想转战24h的一兰拉面，但是发现一兰拉面在深夜的11点仍然是一座难求，只好作罢，最后在买了个鲷鱼烧，又去全家买了点热的，凑合一顿——没想到全家的鸡排与肉包味道竟然比国内的好吃这么多，吃得反倒远超预期，相当满足。</p><p>最后一日本想去吉卜力博物馆的，但在前一夜得知那里需要至少提前4天预约，只好作罢。我和朋友由于飞机班次不同，也想去不同的地方的缘故，打算分开游玩。我去了离酒店很近的两个日式庭院——旧滨离宫庭院和旧芝离宫恩赐庭园。又去了趟芝公园看了看白天的东京塔。两个日式庭院很安静，游人不多，看着远处的高楼大厦，耳边竟然没有喧嚣，只有清寥的鸟鸣，心也跟着安静下来。第一反应是，为什么国内的公园打理得不如这些庭院，后来想起来实际上家旁边的秋霞圃、汇龙潭其实也是类似的城市幽处——我应该也多去去这些地方。</p><p>本想最后一顿中饭去吃前一天没来得及吃的登亭或者一兰拉面，但一看时间，只好草草赶到成田机场，在成田机场吃了中饭。走上飞机，回望这个小假期，又坚定地走回了平常的生活。成田机场给航空公司准备的飞机餐非常好吃，也是最后的小惊喜了。生活照旧，一切如故。</p><h2 id="胶囊酒店"><a class="header-anchor" href="#胶囊酒店">¶</a>胶囊酒店</h2><p>本来打算一个人去旅游的，订完机酒之后，朋友才打算和我一起去，因此我们虽然是两个人一起去，但是住的还是胶囊酒店——这对solo trip是最划算的。第一次了解胶囊酒店，是在up主庄子的视频里。胶囊酒店是日本的特色的住宿模式，虽然本质上就是宿舍间，但通过一些视频了解到胶囊酒店还是打理得不错。此外，会有很多solo trip的外国人住在胶囊酒店，可以和来自世界各地的旅客交流，像是世界青旅一样。因此想试一试。</p><p><img src="/images/20256d48daf2cd8090b1cc3c2b983514e11fd1c79b51_2_750x1000.jpeg" alt="胶囊酒店" title="胶囊酒店"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我选择的胶囊酒店是一家连锁店9h nine hours。我选择了港区滨松店，因为那家店的楼顶可以看到东京塔。Check in的时候，店员给了毛巾拖鞋，耳塞可以自取。得知我们是第一次来住宿之后，店员给了我们中文版的须知，之后我们就上楼了。</p><p>酒店一共有10楼，男女从电梯开始，就是分开的。男生可去的楼层是2，4，5，7，8，10。</p><ul><li>2楼是行李室和公共浴室、水槽。还有4个卫生间。公共浴室和水槽非常充足，我住了几天从来没有碰到过排队的情况。浴室也很大，干湿分离，有充足的空间放置衣物。行李室中，每个人有一个小格子。可以把自己的箱子放在小格子下面的空位里，放不下的话可以寄存前台。格子有点小，放自己的包和衣物有点不方便。</li><li>4，5，7，8层是卧室，我住在4楼的一个上铺406。铺位的小格子其实挺大的，人可以坐直，灯光可调亮暗，也可以拉上床帘，美中不足的是没什么可以放置随身物件的地方，插座也只有一个，最好需要自备拖线板。铺位的隔音其实不是很好，能听到隔壁床的鼾声——这就有免费提供的耳塞的用武之地了。铺位的东西每天早上是要清空的，清洁工会来打扫，第二天晚上可以在床上找到新的睡衣和毛巾。睡衣对我来说有点小，我从来没有穿过，最后全部还给了前台。卧室楼层有一个小阳台。卫生间的隔间外还有一个独立的门，那扇门的开关不会发出任何声音，非常安静。住客基本上也都非常文明，整个卧室楼层是非常安静的。唯一我感到略微不文明的是，几乎每天早上都会被一个闹钟闹醒——有且仅有一个，而且还几次那个闹钟响了好久，估计是没有把主任闹醒。大多数人都是开震动闹钟的。</li><li>10层是lounge，有插座、桌椅。这里一直有很多人，但是位置是充足的，总能找到空位。这里大家也都挺安静的，像是在咖啡店里一样，或许是不太熟的缘故吧。10楼有一个楼梯可以通往天台，远眺东京塔——但是视角没有预想的好。天台的座位是金属的，有点冷，人不多，因此在天台上反而更容易开启一段对话。</li></ul><p>checkout的时候，直接把房卡放在前台就行。但这个酒店在退房后不能寄存行李——虽然实际上也没有人管，但是作为一个高素质的中国人，我还是把行李寄到了车站——几乎每个车站都能寄行李。</p><h2 id="遇到的人"><a class="header-anchor" href="#遇到的人">¶</a>遇到的人</h2><p>日本是个国际化的城市，我住的酒店又是类似青旅的胶囊酒店，所以我确实非常期待与来自世界各地的人交流。得益于我朋友的外向，确实也和很多人聊上了。</p><p>第一位聊上是第一晚回酒店的地铁上。我朋友在做冥想练习，不经意间与对面的女士对上了眼，那位日本女士又看到免税袋里的chikawa，我们便聊了起来。这一段聊天，我们没有聊什么深刻的内容，我们尝试用自己蹩脚的日语交流，磕磕绊绊，但也能互相听得懂。那位女士祝我们旅途顺利，但事实上也因为我们的这段聊天，让我们不小心坐过了站。</p><p>这一晚我和朋友还上了天台看东京塔，在那里和一个沙特阿拉伯年轻人攀谈了起来。那位年轻人本科毕业就工作了，现在他在放他的年假。他的年假有20天，他全部拿来到日本旅游了。我们很惊讶他有20天的年假，他主张中国应该也有。但事实上，最后查下来，中国人工作2-10年，10-20年，20年以上分别只有5，10，15天的法定年假。我们聊到了学业，我说我可能还要去博士。他说他认为工作的经验比在学校里读书重要，因此他早早地出来工作了。其实对这个观点我比较认同，因为我也感受到在学校里学习的效率其实是非常低的，但是我向他解释，在中国如果没有硕士或者博士的学历，是很难找到一份好工作的，因此即使我认同他的观点，我也不得不读完博士再去工作。</p><p>第一天晚上，我朋友发现自己手机的sim卡出了些问题，需要重复取出再装入sim卡。可惜很不巧，他的取卡针弄丢了。我建议他去楼下的docomo问一问。第二天一早我们就去docomo了。说来好笑，docomo的营业厅里写着巨大的“不出售游客版sim卡”。本来想排队，但是又来了一位店员。我们问他能不能送或者买一个取卡针，他一开始拒绝了。但是当我们告诉他我朋友的手机有点问题，需要时不时拿出取卡针的时候，他犹豫了一下，从那一串取卡针中拿了一个取卡针送给了我们。“Give you.&quot;他为我们破了例。</p><p>第二天晚上在天台上又碰到了沙特小哥，但是没多聊。和一个英国人聊了很多。这位英国人看上去三十来岁，是一个汽修工。他说他来东京，飞了14个小时。老牌发达国家还是富有啊，连汽修工都可以在距自己国家14小时飞机的地方旅游2个礼拜。这不是他第一次来东京，他很喜欢东京，甚至有定居的想法，可惜语言不是他的强项，学不会日语。和他聊了很多。他认为不论政府如何，百姓总归都是好的——包括英国百姓、日本百姓、中国百姓。他觉得日本发展的很快，他去年来住的也是这个酒店，那是旁边的大楼还没开始造，现在已经快造好了——我们笑笑，说其实中国基建的速度更夸张，只不过中国建筑的设计确实也不如日本。他是汽修工，于是我们也和他聊了很多汽车相关的。他提到了奇瑞想要进军英国，虽然在中国人心目中，奇瑞是低端车，但是他说奇瑞在英国想冲击高端。他为沃尔沃工作（现在沃尔沃被奇瑞收购了），他说同样的配置，奇瑞比沃尔沃便宜很多，他对此有点感兴趣。我们也聊到了电动车到底环不环保——有种说法，西方不发展电车是因为电本身的生产也不环保。这位英国人认为电车是环保的——至少不排尾气。</p><p>第三天我们去了富士山。在富士山拍照的时候，我们遇到了另一波中国游客。我们互相为对方拍拍立得。我和朋友还被错认称同性情侣。在一个红叶很漂亮的机位，基本日本老奶奶和日本阿姨经过，主动提出可以给我和朋友拍合照。她们的英语不太流利，我们的日语也非常蹩脚，就只能打着手势又夹着日语和英语交流。但看得出她们非常和善友好，也非常欢迎我们来旅游——即使中日政府之间交恶，老百姓之间还是友好亲善的。临走时，朋友在沙滩边和一个法国人聊上了天。这是这位法国人的毕业旅行，他独自在日本待了近一个月。他周一离开，和我们一样，要先飞到上海，再转机回国。那天晚上我和朋友回去，路上堵车，最终流落到新桥找晚饭吃。看到新桥的一兰拉面也在半夜大排长龙，我和朋友愣住了。这时一位中国女性听到我们用中文交流，在和我们搭讪，说一兰拉面现在反而是饭店。于是我们开始在大众点评上搜索别的饭店。这时候她问我们喝酒嘛？我说不不不，只是来找晚饭吃。我这才突然意识到，原来她和她旁边的朋友，实际上是站街女。估计她也是有些尴尬，告诉我们“那里吃的多”，于是我们就分别了。她认识挺好的，只不过以这种方式认识实在有些尴尬。</p><p>最后一天，倒是没在日本遇见什么印象深刻的人，只记得在登机口的日本官员会用中文说：“谢谢。”下了飞机之后，在浦东机场照机连线的入口——指引真的是做得非常差。一位上海老太太也在找，于是我们搭话起来，后面也一起坐机连线聊天。她看上去就是那种老知识分子，举止穿着非常优雅。她的儿子移民德国，这次是在浦东机场送孙子去德国。和她聊起中日，她主张：“出过国，见过外面的人，都不会觉得这是什么事儿。”我深以为然。忘记和她聊了什么了，但印象里她的举止、她的观点，都让我感到我也想成为这样的人。</p><h2 id="感受"><a class="header-anchor" href="#感受">¶</a>感受</h2><p>去东京前，我一直对于东京是“亚洲第一大城市”感到不服气。总觉得上海、香港、新加坡都能扳扳手腕，但是去了之后才真的服气了。东京的楼宇不高，但是市区的面积非常广。东京没有淡季，即使我在11月去，新宿街头依旧游人如织。东京的国际化也是上海香港甚至是新加坡不能及的——真的能看到全家的店员有黑人有白人。上海与东京还是有很大差距的。道阻且长！</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;东京旅程&lt;/h1&gt;
&lt;h2 id=&quot;印象&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#印象&quot;&gt;¶&lt;/a&gt;印象&lt;/h2&gt;
&lt;p&gt;暑假快结束的时候，我意识到我整个8月都没有出去，心里闷得慌，从那时，我就开始谋划这次在学期中的旅行。对我来说，旅行的一大意义</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="旅行/Travel" scheme="https://ryanstarfox.github.io/tags/%E6%97%85%E8%A1%8C-Travel/"/>
    
  </entry>
  
  <entry>
    <title>Chrome的新晋挑战者——ChatGPT Atlas浏览器小试牛刀</title>
    <link href="https://ryanstarfox.github.io/2025/10/30/2025/20251030%20ChatGPT%20Atlas/"/>
    <id>https://ryanstarfox.github.io/2025/10/30/2025/20251030%20ChatGPT%20Atlas/</id>
    <published>2025-10-30T07:00:00.000Z</published>
    <updated>2025-10-30T07:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>Chrome的新晋挑战者——ChatGPT Atlas浏览器小试牛刀</h1><h2 id="引"><a class="header-anchor" href="#引">¶</a>引</h2><p>2025.10.22，ChatGPT Atlas横空出世。目前仅支持Mac端客户端。恰好我自己就是Mac，因此在今天小小地尝试了一下。</p><p>对我来说，我先入为主地认为我不会把主力换成Atlas，因为迁移浏览器的成本非常高。但是如果Atlas有比传统浏览器更加显著的优势，我认为我还是非常乐于更换的，但是简单使用下来，发现由于响应速度和使用习惯的原因，我还是会继续使用传统的浏览器。</p><p><img src="/images/2025/Atlas_Blog_OpenGraph_Image.png" alt="Atlas_Blog_OpenGraph_Image"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="ChatGPT-Atlas"><a class="header-anchor" href="#ChatGPT-Atlas">¶</a>ChatGPT Atlas</h2><p>传统浏览器使用的是搜索引擎，按下搜索键之后会立即出结果。但是Atlas默认是AI生成总结，要等AI先思考，再一个一个地吐Token。就我自己的经验来看，现代人都是非常没有耐心的。1s生成的搜索结果页，我们可能就往下划一下，看看有没有什么需要的，还有一些阅读和等待的耐心。但是看到一串还没讲完的话，好比好视频不能两倍速，大家很可能就切屏分心做别的事情了。</p><p><img src="/images/2025/image-20251030143417012.png" alt="image-20251030143417012"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>在检索资料方面，搜索引擎的精确性和真实性依然强于AI。我既然都使用浏览器了，说明我还是希望对于检索拥有更高的自主权——如果仅仅是需要获得大概的信息，我直接使用AI就是了。其实对于AI和搜索引擎的平衡，我认为谷歌“AI”概括+网页展示的模式和UI比Atlas做得更好，我也更加习惯**。**</p><p><img src="/images/2025/image-20251030144249841.png" alt="image-20251030144249841"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>使用习惯上，Atlas和传统浏览器也有所区别，我是一个喜欢在搜索栏使用“搜索引擎名+搜索内容”中指定搜索引擎搜索的人，例如我已经习惯了在搜索栏中使用“豆瓣+电影名”来直接在豆瓣中搜索电影。但是目前为止，好像Atlas还没有这个功能，而是总是默认使用AI。</p><p>事实上，我注意到，其实对于最基础的搜索功能而言，无非是OpenAI自己做了一个“搜索引擎”，但它是不开放的，把搜索结果页的链接拷贝到别的浏览器，是无法被识别的。这一点上感到OpenAI做得不够“open”，这个阻碍虽然确保了用户在自己手里，但是也让别的用户投奔Atlas变得困难。</p><p><img src="/images/2025/image-20251030143511913.png" alt="image-20251030143511913"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>Atlas的搜索结果现在和谷歌很像，我不清楚Atlas有没有使用AI功能筛选出了那些更有用、更相关的网页——我认为这个筛选才是AI的优势所在，省去了人工筛选的经历。不仅如此，这样以来AI搜索结果的倾向性也比搜索引擎更难操控，或许还降低了bias？谷歌的搜索算法会有一些攻击混淆方式，对于ChatGPT的搜索结果，会不会也有一些攻击方式呢？期待一下发展。</p><p><img src="/images/2025/image-20251030144821172.png" alt="image-20251030144821172"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>但必须承认，浏览器不止搜索引擎，它能够识别网页具体内容并帮助用户作出响应，这一点可以极高地提高工作效率。网页内容的通用性，又让所有的网页App可以因此获得很强的功能。已经可以想见到AI写文档、AI写email、AI画思维导图、AI写作业等等潜在的功能了。这一点可喜可贺。但是我的疑问是，这不相当于就是一个浏览器插件嘛？还是说Atlas中AI对浏览器的掌控更加底层，因此能做更多的事情？</p><p>关于Atlas能不能撼动Chrome，我认为还很悬，因为目前它的表现在我看来不尽如人意，况且目前Atlas仍旧在使用Chromium核心。</p><h2 id="我构想的AI浏览器"><a class="header-anchor" href="#我构想的AI浏览器">¶</a>我构想的AI浏览器</h2><p>就我自己构想，我认为我心中理想的AI浏览器是这样的：浏览器本身能够随时引用搜索结果、浏览历史作为上下文，就好比Cursor一样，除此之外，各项功能和传统浏览器没有区别。（这么一来Edge+Copilot其实有点接近？）浏览器可以自定义搜索引擎。</p><p>因此也要构想一个理想的AI搜索引擎：首先，对于搜索的文本，AI应当自动判断我的意图，决定回答AI对话还是网页搜索结果，两者也可以手动切换。对于后者，我还是认为谷歌目前AI梗概+网页是比较理想的response。但同时搜索引擎的搜索结果让AI根据默认或者自定义的Prompt，筛选真正语意相关的网页。</p><hr><p>期待一下AI浏览器的发展。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;Chrome的新晋挑战者——ChatGPT Atlas浏览器小试牛刀&lt;/h1&gt;
&lt;h2 id=&quot;引&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#引&quot;&gt;¶&lt;/a&gt;引&lt;/h2&gt;
&lt;p&gt;2025.10.22，ChatGPT Atlas横空出世。目前仅支持M</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>银杏的凋零</title>
    <link href="https://ryanstarfox.github.io/2025/10/02/2025/20251002%20%E9%93%B6%E6%9D%8F/"/>
    <id>https://ryanstarfox.github.io/2025/10/02/2025/20251002%20%E9%93%B6%E6%9D%8F/</id>
    <published>2025-10-01T17:36:00.000Z</published>
    <updated>2025-10-01T17:36:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1><strong>银杏的凋零</strong></h1><p>今天是2025年10月1日，今晚我与母亲住到了jt，想住几天。其实原本我是想一个人住两天的，不过恰逢外公外婆去崇明旅游，我和母亲便一起住了过来。来之前，去了一趟旁边新开的盒马超市，拎着大包小包，分了两次才将所有的东西都搬上楼。搬完之后，我下意识地向阳台走去——实际上，不来璟庭，我根本不会记起来这一棵银杏树的，但是每次来了，我总想去看一下它，确认它还在。</p><p>2014年，我在曲阳路学而思学习奥数。学而思的对面，我们停车的地方，有一排银杏树。银杏树的果子掉下来，落在地上，生出了根，却没扎进土里——想来也不过是垃圾桶或是除草机的命运。我与父亲把小苗带了回来，栽进土里——一晃已经十一年了。照理说，十一年的树，也应当不小了，不过想必是因为种在盆里憋屈，它也只有人的手指那么粗。曾经还一直开玩笑“等买了大‘别野’，有了大院子，就把它栽在土里”，没想到“别野”影子也没有，树却先枯死了。</p><p>近几年，到了冬天，它的叶子是照常落光，但春天则越长越少——想必是衰败的前兆吧。搬离璟庭之后，这里无人打理，只有每几周母亲来浇点水。我记得我曾经说过想给它换个盆，松松土，但也在细碎的生活之中，遗忘搁置了此事。去年冬天，银杏落下了最后的叶子，今年春天却没有长出叶子，而我竟然直到今年初秋才知道。</p><p>银杏死了，光秃秃地立着，旁边散落几片去年冬天落下的树叶。阳台上的仙人掌无人照料，却也郁郁葱葱，像是一片沙漠。沙漠曾经也是绿洲，也是海洋，但现在只有仙人掌和沙子。</p><p>该走的走了，该去的去了，该变的变了。人最怕变化，求平淡安稳，但实际上却又被命运洪流推去陌生的未来。熟悉的当下，总是渐渐变得陌生——陌生本身不让人难过，甚至让人兴奋，但熟悉与陌生的对比，总让人生出物是人非之感。我最怕失去，甚至为此不愿意拥有，这样的我面对这些变化，也只能用过记忆来对抗世事的消亡，用文字来对抗记忆的消亡。</p><p>苏子曰：“盖将自其变者而观之，则天地曾不能以一瞬；自其不变者而观之，则物与我皆无尽也。”可我觉得“变”的悲哀不在于“恒定”之“短暂”，而在于“我”仍为“我”。回望之后，还是需要转过头，往前走。</p><p>再回首，恍然如梦。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;&lt;strong&gt;银杏的凋零&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;今天是2025年10月1日，今晚我与母亲住到了jt，想住几天。其实原本我是想一个人住两天的，不过恰逢外公外婆去崇明旅游，我和母亲便一起住了过来。来之前，去了一趟旁边新开的盒马超市，拎着大包小包，分了两次才将所有</summary>
      
    
    
    
    <category term="感悟/Thougts" scheme="https://ryanstarfox.github.io/categories/%E6%84%9F%E6%82%9F-Thougts/"/>
    
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
    <category term="家庭/Family" scheme="https://ryanstarfox.github.io/tags/%E5%AE%B6%E5%BA%AD-Family/"/>
    
  </entry>
  
  <entry>
    <title>不燃的代价</title>
    <link href="https://ryanstarfox.github.io/2025/09/13/2025/20250913%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/"/>
    <id>https://ryanstarfox.github.io/2025/09/13/2025/20250913%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/</id>
    <published>2025-09-12T16:19:00.000Z</published>
    <updated>2025-09-12T16:19:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>不燃的代价</h1><p>过年了！过年了！</p><p><img src="/images/2025/hq720.jpg" alt="2025 Apple秋季新品发布会｜iPhone 17 全系、Apple Watch S11、AirPods Pro 3 全面汇总"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>2025.9，加州来电如约而至。我认为这一次基础款有大升级，pro款有点争议，对中国大陆的影响比较大。总的来说，和之前rumor中提到的差不多。</p><blockquote><p>Design is not just what it looks like and feels like. Design is how it works.<br>—— Steve Jobs</p></blockquote><p>今年开头的视频和几年前的《了不起的设计》有点像，喜欢。我认为设计中最重要的是设计语言的一致性，我本人也非常重视这一点。但是Apple真的是把一致性做到了登峰造极——连AirPods的俯视图都能和灵动岛拼起来，令人佩服。</p><p><img src="/images/2025/7f25929e-cc00-464b-9020-287728f4cb9c.png" alt="7f25929e-cc00-464b-9020-287728f4cb9c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><hr><h2 id="AirPods-Pro-3"><a class="header-anchor" href="#AirPods-Pro-3">¶</a>AirPods Pro 3</h2><p>AirPods Pro是现在Apple依旧在市场上保持压倒性优势的一个品类，也是我比较喜欢的一个品类，我认为升级还算稳健，只是前代机型太强，不知能否激起大家的换机欲望。</p><p><img src="/images/2025/69db52278c7fea81d25a849a76dfac26.png" alt="69db52278c7fea81d25a849a76dfac26"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="降噪"><a class="header-anchor" href="#降噪">¶</a>降噪</h3><p>比AirPods Pro 2强2倍！</p><p>当初 AirPods Pro 2 的时候，我还在为 AirPods Pro 1 的降噪效果震撼，无法想象再好两倍会到什么程度。</p><p>现在我同样对于再好两倍会到什么程度。</p><p>“世界上最好的降噪耳机”，没有限定词！</p><p><img src="/images/2025/image-20250911230932463.png" alt="image-20250911230932463"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="健康功能"><a class="header-anchor" href="#健康功能">¶</a>健康功能</h3><p>可以检测效率了，rumor说是因为在 AirPods Pro 上增加了一个特殊的摄像头。</p><p>我认为是有道理的，确实很多人会在跑步的时候戴耳机，如果能够顺便记录运动数据，确实是不错的功能。</p><p>但是这样一来，它的定位就和Apple watch撞车了。不过回归原教旨主义了——iPhone会杀死iPod，但是苹果依然发售了iPhone</p><h3 id="环大陆功能"><a class="header-anchor" href="#环大陆功能">¶</a>环大陆功能</h3><p>去年喜提环大陆功能：助听器功能。因为在中国健康相关的证明比较困难。我不熟悉证件方面的政策，不好评价。但平心而论，我认为 AirPods Pro 会是一个性价比很高的助听器——性能、续航、智能化。事实上，我自己就常常把AirPods当成智能义耳。开关降噪就是控制开闭，它还能播报一些信息，像是听力版的 HUD （抬头显示）。</p><p>今年又喜提环大陆功能：实时翻译。我认为非常强且实用的，干掉了很多专门的实时翻译硬件（没有考证，但是印象里价格上都算便宜）。我本来以为它算是 Apple “翻译 app ”的子功能，但实际上似乎属于 Apple Intelligence 的子功能，因此国区没有本功能。期待该功能在各家耳机上实现，让世界的交流越来越顺畅。</p><p><img src="/images/2025/image-20250911232210634.png" alt="image-20250911232210634"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="其它"><a class="header-anchor" href="#其它">¶</a>其它</h3><p>这次的外观小改，史诗级！但是大多数人看不出外观的改动吧？</p><p>续航由6小时改为8小时。可是我认为这其实用处不大，因为我认为对于大多数人来说，被迫摘下 AirPods Pro 的原因不是因为电量不够了，而是耳朵开始难受了。</p><hr><h2 id="Apple-Watch"><a class="header-anchor" href="#Apple-Watch">¶</a>Apple Watch</h2><p>感觉 Apple Watch 系列没什么大的升级，因为看完之后回想，我竟然想不出几个新功能。</p><p>小结：</p><ul><li>对于所有机型：支持 5G ，续航增加</li><li>对于 SE ：全天候显示</li></ul><p>我认为原本对于Apple Watch SE 而言，其最大的问题就是没有全天候显示而失去了作为一款普通手表的便捷。但当现在补上了这块短板，我认为它将比数字版又更大的受众—— Apple Watch 本身也没什么用，所以性能差一些、黑边厚一些、外设差一些，问题不是很大。但是另一个问题是：Apple Watch 在我看来本身只是一个非常便宜的奢侈品，所以这样一来数字版的定位很尴尬——既没有SE的性价比，又没有 Ultra 的价格与外观。</p><p>还有件有趣的事情：Apple 官方的参数上，Apple Watch 终于不是祖传的反向虚标：数字版18h，Ultra 36h，但实际上续航每年一直有提升。这次终于标成了24h和42h。</p><hr><h2 id="iPhone"><a class="header-anchor" href="#iPhone">¶</a>iPhone</h2><h3 id="对全系"><a class="header-anchor" href="#对全系">¶</a>对全系</h3><p>几年前推出的备受好评的超瓷晶面板升级了第二代。高中的时候看Leo的 iPhone 13 因为用了超瓷晶面板，所以不贴膜，手机屏幕的磨损情况也还行。但是当我和他都升级至 iPhone 15 Pro 之后，我们觉得防磨损刮削能力反而变差了，有点奇怪。希望超瓷晶面板二代能够干掉贴膜。</p><p>前置摄像头传感器变成方形的了，是好事，但也就这样。</p><h3 id="iPhone-17"><a class="header-anchor" href="#iPhone-17">¶</a>iPhone 17</h3><p><img src="/images/2025/image-20250912233939669.png" alt="image-20250912233939669"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>ProMotion！ProMotion！ProMotion！</p><p>高刷终于下放到了 iPhone 标准版。</p><p>记得最开始的rumor说是 iPhone 16 会上高刷，后来变成了17会上，后来又变成17不会上，因为是“Pro” Motion，然后还有人说120Hz变成90Hz，砍掉 AOD （熄屏显示）。但是最终终于是和Pro同款的ProMotion：1-120Hz，支持AOD。</p><p>但是这件事情不该夸。</p><p>忘记在哪个地方听到的观点，对于苹果来说，60Hz屏幕生产线未必比120Hz屏幕生产线便宜，因为现在市面上很少有手机还在继续使用60Hz的屏幕。但是苹果依旧使用60Hz的屏幕，只是为了确保标准版与Pro版有区分度而已——实际上是苹果的傲慢。包括iPad标准版的60Hz非全贴合屏幕也是一个道理。这让我想到了几年前的一种说法——安卓机长板非常长，短板也非常短；苹果机更加水桶——现在60Hz的屏幕在这几年竟然成了水桶上的一块非常短的短板。</p><p>目前而言，认为 iPhone 17 将会是钉子户，但也等等评测吧。</p><h3 id="iPhone-Air"><a class="header-anchor" href="#iPhone-Air">¶</a>iPhone Air</h3><p>认为这是一个不会大卖，有其明显缺陷的机型，但它对于苹果和中国大陆都有较大意义。</p><p><img src="/images/2025/image-20250912235325359.png" alt="image-20250912235325359"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="苹果的试水"><a class="header-anchor" href="#苹果的试水">¶</a>苹果的试水</h4><h5 id="薄"><a class="header-anchor" href="#薄">¶</a>薄</h5><p>变得那么薄自然而然就想到这实际上是半个iPhone Fold。我认为苹果确实是在为折叠屏做准备，但是我保持我一贯的态度：折叠屏对于大多数人没有用，因为比例问题以及缺少一支笔——所以尽管不欣赏华为，但是不得不说认为华为Mate XTs是有道理的——三折叠让展平的比例变正常了，也配上了手写笔。</p><h5 id="自研基带"><a class="header-anchor" href="#自研基带">¶</a>自研基带</h5><p>iPhone 16e上使用了自研的C1基带，维持性能的同时提升了能耗[^1] 。时隔半年，苹果端出来了自研基带C1X和Wi-Fi蓝牙芯片N1，却只在Air机型上使用。我认为这带有一定的实验性质，可能是为了未来自研基带甚至是将基带集成进SoC（集成CPU）铺路，一如Apple Watch Ultra上橙色的钛合金按钮为 iPhone 15 Pro 的钛合金中框铺路。</p><h4 id="对大陆的影响——eSIM"><a class="header-anchor" href="#对大陆的影响——eSIM">¶</a>对大陆的影响——eSIM</h4><blockquote><p>还是西药好使。</p></blockquote><p>2015年，三星手表搭载 eSIM；</p><p>2017年 Apple Watch 跟进；</p><p>2018年，iPhone 和 iPad 跟进；</p><p>2022年，美版iPhone只搭载eSIM；</p><p>2023年，中国三大运营商暂停eSIM。</p><p>平心而论，中国的eSIM是在推进的，但是速度落后于大多数发达国家，2023年甚至开了倒车，在安卓手表端全面暂停。eSIM在中国的进度，一直听到的说法是为了反诈——但是实际上eSIM本身的安全性比实体SIM卡更高，因为更换SIM卡更容易留下痕迹们，同时也可以保留实名认证。说三大运营商在试水，研究eSIM在中国国情下如何落实，如何避免法律的空子，我是认的，但是依旧认为速度太慢——同样的水，为什么发达国家领先了这么多——纵然有国情的不同，同样在最重要的终端——手机上搭载eSIM，美国的2018和中国的2025，可相差了7年。</p><p>结果还是苹果这条鲶鱼，逼着运营商推进eSIM。</p><p>今日，联通的一个白皮书在网上流传，有很多流言蜚语，我自己找到资料，其中与eSIM相关的一段如下：</p><img src="/images/2025/image-20250912224801944.png" alt="image-20250912224801944" style="zoom:25%;"   data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'/><p>网上又了很多的解读，但是我认为这份文件实际上写得非常模糊。什么叫做“双向机卡锁定、跨境写卡禁用”？在iPhone Air发布之后，反而是苹果官网给出了更明确的信息[^2]，总结一下：</p><ol><li>外版iPhone用不了国内运营商的eSIM<ul><li>老外来中国用不了eSIM怎么办？旅游流量包？</li><li>留学生在外国购置了eSIM手机，回国之后怎么使用？</li><li>海外版纯eSIM手机在中国的市场会变小吗？期待一下华强北大神了</li><li>不要说现在还有实体SIM，所以不用担心这些问题，很可能几年内就会全面普及eSIM的</li></ul></li><li>可以激活境外的eSIM，前提是自己的位置在国外<ul><li>这点我认为没毛病，可以接受</li><li>注意是“激活”，相当于可以先在中国买外国eSIM，把信息写入手机，但是等到落地国外再激活，合理！</li></ul></li><li>eSIM要去线下营业厅办理<ul><li>认为是脱裤子放屁。纯线上办理就是eSIM巨大优势之一。线上也可以实名，不会有安全问题</li><li>事实上，之前阴谋论说eSIM在中国不普及就是动了运营商的蛋糕，因为纯线上太透明了</li></ul></li></ol><h4 id="其它-2"><a class="header-anchor" href="#其它-2">¶</a>其它</h4><p>背板的材料也从陶瓷升级为了超瓷晶面板，同样对于背部的抗磨损刮削也有了较大的提升。但是我认为现在的防摔能力依然不能让我放心地不带壳使用。</p><p>真的对续航很担心，6.5英寸的更大尺寸塞下更大电池，官方专门为Air设计磁吸充电宝，感觉都像是打的补丁。</p><img src="/images/2025/image-20250912234102123.png" alt="image-20250912234102123" style="zoom:25%;"   data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'/><p>本以为Air会是17 Air，代替的是 Plus 和 Mini 的位置，因此应当是与标准版相同的芯片。但是看到A19Pro芯片和7999的起售价，才意识到这其实是Pro的定位。</p><h3 id="iPhone-17-Pro-Pro-Max"><a class="header-anchor" href="#iPhone-17-Pro-Pro-Max">¶</a>iPhone 17 Pro / Pro Max</h3><p>这也是一个很难评的机型啊，设计理念真的好安卓——从宣传海报上的“Pro”字体开始。</p><p><img src="/images/2025/image-20250912235414414.png" alt="image-20250912235414414"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="摄影"><a class="header-anchor" href="#摄影">¶</a>摄影</h4><p>首先，对我而言，我最馋的是13-200mm的变焦。苹果把1200万像素的5倍长焦镜头升级到了4800万像素的4倍长焦镜头，可以裁剪为1200万像素的8倍镜头。13-200mm的变焦是真的爽啊！</p><p>我的相机是黑卡7，24-200mm。当时我坚定地选择卡片机而不是微单的原因是，微单我可能根本不会带出去。当时我坚定地选择了卡片机而不是手机的主要原因是光学大变焦。但是我现在发现：</p><ol><li>两者对于光圈的调节都相当有限；</li><li>黑卡7或许调色空间更大，但是我不会经常调色；</li><li>iPhone的HDR更加方便，效果更好；</li><li>iPhone有更好、更方便的夜景拍照。</li></ol><p>这下让我真的开始认同，卡片机该被淘汰了。</p><p>（至于为什么安卓手机有大变焦的时候，我没有这种感叹，主要是因为我是苹果用户吧——提升到自己头上的时候感触才最大。）</p><p>（但是卡片机真的优雅）</p><p>（期待Sony A7C3，但是全画幅机的大变焦太笨重，纠结）</p><p>（或许应该去配大光圈定焦，但是自己也没那么专业，也就自娱自乐玩玩）</p><p>但是！</p><p>但是为了获得更好的影像性能，deco（摄像头那块的凸起部分）竟然变成这个形状，致敬母公司Xiaomi 11 Ultra!</p><p>丑，太丑了……没想到rumor是真的……</p><h3 id="散热"><a class="header-anchor" href="#散热">¶</a>散热</h3><p>本次发布会的题眼，加上了均热板，很好！</p><p><img src="/images/2025/image-20250912235453852.png" alt="image-20250912235453852"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>为了散热换回了铝合金一体机身，我可以接受，对于不锈钢和钛没有执念。</p><p>但是一体机身与背面的2代超瓷晶面板的拼接，实在是太丑——也是为了散热和Magsafe做的妥协。</p><p>相信有人站Magsafe，希望回到“中框”而不是一体机身的模式。</p><p>也有人站均热板，认为没什么人用Magsafe，希望删掉超瓷晶面板，全部换成铝金属。</p><p>你站哪队？</p><h2 id="其它-3"><a class="header-anchor" href="#其它-3">¶</a>其它</h2><p>这一次没有发布iPad和Mac，所以认为今年10月应该也会有发布会</p><p>这一次的发布会录制没有全在 Apple Park，而是在各个 Apple Store （我猜是加州和纽约的？没认出来）。期待下次在世界各地的 Apple Store 录制</p><p>Craig竟然没出席TT，期待10月发布会他介绍iPad</p><p>[^1]: <a href="https://www.bilibili.com/video/BV1ERPEeXEtR">iPhone 16e深度评测：苹果C1自研通信模块省电吗？信号如何？</a></p><p>[^2]: <a href="https://support.apple.com/zh-cn/123879">在中国大陆将 eSIM 与 iPhone 搭配使用</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;不燃的代价&lt;/h1&gt;
&lt;p&gt;过年了！过年了！&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/2025/hq720.jpg&quot; alt=&quot;2025 Apple秋季新品发布会｜iPhone 17 全系、Apple Watch S11、AirPods Pro 3 全面汇总&quot; </summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>优化算法总结</title>
    <link href="https://ryanstarfox.github.io/2025/08/28/2025/20250828%20%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/"/>
    <id>https://ryanstarfox.github.io/2025/08/28/2025/20250828%20%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95/</id>
    <published>2025-08-28T10:17:00.000Z</published>
    <updated>2025-08-28T10:17:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>优化算法总结</h1><p>认为优化算法可以分为三部分：</p><ol><li>批量部分</li><li>更新部分</li><li>调整学习率部分</li></ol><h2 id="1-批量部分"><a class="header-anchor" href="#1-批量部分">¶</a>1 批量部分</h2><p><img src="/images/2025/%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95_%E6%89%B9%E9%87%8F%E5%B1%82%E9%9D%A2.drawio.svg" alt="优化算法_批量层面.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><strong>GD</strong>: 最初的算法为梯度下降（GD），对所有样本损失的平均作反向更新</p><p>$\mathbf g_t=\dfrac1{|I|}\sum\limits_{i\in I}\nabla\mathcal l_i(x_{t-1})$</p><h2 id="2-更新部分"><a class="header-anchor" href="#2-更新部分">¶</a>2 更新部分</h2><p><img src="/images/2025/%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95_%E6%9B%B4%E6%96%B0%E5%B1%82%E9%9D%A2.drawio.svg" alt="优化算法_更新层面.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>主要调整步进的方式，方法之间的关系与更迭的逻辑如图，具体算法见下：</p><p><strong>Momentum：</strong></p><p>$\mathbf v_t=\beta\mathbf v_{t-1}+\mathbf g_t$<br>$\mathbf w_t = \mathbf w_{t-1}-\eta\mathbf v_t$</p><p><strong>AdaGrad:</strong></p><p>$\mathbf s_t=\mathbf s_{t-1}+\mathbf g_t^2$<br>$\mathbf w_t=\mathbf w_{t-1}-\dfrac\eta{\sqrt{\mathbf s_t+\epsilon}}\cdot \mathbf g_t$</p><p><strong>RMSProp:</strong></p><p>$\mathbf s_t=\gamma\mathbf s_{t-1}+(1-\gamma)\mathbf g_t^2$<br>$\mathbf w_t=\mathbf w_{t-1}-\dfrac\eta{\sqrt{\mathbf s_t+\epsilon}}\cdot \mathbf g_t$</p><p><strong>Adadelta:</strong></p><p>$\mathbf s_t=\gamma\mathbf s_{t-1}+(1-\gamma)\mathbf g_t^2$<br>$\mathbf w_t=\mathbf w_{t-1}-\mathbf g'<em>t$<br>$\mathbf g'<em>t=\dfrac{\sqrt{\Delta\mathbf x</em>{t-1+}\epsilon}}{\sqrt{\mathbf s_t+\epsilon}}\cdot \mathbf g_t$<br>$\Delta \mathbf x</em>{t}=\lambda\Delta\mathbf x_{t-1}+(1-\lambda)\mathbf g'^{2}_{t}$</p><p><strong>Adam:</strong></p><p>估算动量和二阶矩：<br>$\mathbf v_t=\beta_1\mathbf v_{t-1}+(1-\beta_1)\mathbf g_t$<br>$\mathbf s_t=\beta_2\mathbf s_{t-1}+(1-\beta_2)\mathbf g_t^2$</p><p>无偏化处理:<br>$\hat{\mathbf{v}}_t = \dfrac{\mathbf v_t}{1-\beta_1^t}$<br>$\hat{\mathbf{s}}_t = \dfrac{\mathbf s_t}{1-\beta_2^t}$<br>更新：<br>$\mathbf g'_t=\dfrac{\eta\mathbf {\hat{\mathbf v}_t}}{\sqrt{\hat{\mathbf s}<em>t}+\epsilon}$<br>$\mathbf x_t = \mathbf x</em>{t-1}-\mathbf g'_t$</p><h2 id="3-学习率部分"><a class="header-anchor" href="#3-学习率部分">¶</a>3 学习率部分</h2><p><img src="/images/2025/%E4%BC%98%E5%8C%96%E7%AE%97%E6%B3%95_%E5%AD%A6%E4%B9%A0%E7%8E%87%E6%96%B9%E9%9D%A2.drawio.svg" alt="优化算法_学习率方面.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>最简单的是固定学习率</p><ul><li><p>随迭代轮数减少学习率</p><ul><li><p>单因子调度器：$\eta_{t+1}=\eta_t\cdot\alpha$</p><p>为了防止衰减过度，一般使用：$\eta_{t+1}=\max(\eta_{\min},\eta_t\cdot \alpha)$</p></li><li><p>多因子调度器：$s={5,10,20},t\in s时，\eta_{t+1}=\eta_t\cdot\alpha$</p></li><li><p>余弦调度器：$\eta_t=\eta_T+\dfrac{\eta_0-\eta_T}2(1+\cos(\pi t/T))$，$t&gt;T$后不更新</p></li></ul></li><li><p>增加预热期</p><ul><li>线性增加</li></ul></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;优化算法总结&lt;/h1&gt;
&lt;p&gt;认为优化算法可以分为三部分：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;批量部分&lt;/li&gt;
&lt;li&gt;更新部分&lt;/li&gt;
&lt;li&gt;调整学习率部分&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;1-批量部分&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=</summary>
      
    
    
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
  </entry>
  
  <entry>
    <title>Bert笔记</title>
    <link href="https://ryanstarfox.github.io/2025/08/27/2025/20250827%20Bert%E7%AC%94%E8%AE%B0/"/>
    <id>https://ryanstarfox.github.io/2025/08/27/2025/20250827%20Bert%E7%AC%94%E8%AE%B0/</id>
    <published>2025-08-27T08:12:00.000Z</published>
    <updated>2025-08-27T08:12:00.000Z</updated>
    
    <content type="html"><![CDATA[<p>最近看了Bert的论文，理解了Bert的基本逻辑，画了一张逻辑图</p><p><img src="/images/2025/Bert.drawio.svg" alt="Bert"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;最近看了Bert的论文，理解了Bert的基本逻辑，画了一张逻辑图&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/2025/Bert.drawio.svg&quot; alt=&quot;Bert&quot;  data-tag=&#39;post-image&#39; onload=&#39;this.onload=nul</summary>
      
    
    
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
  </entry>
  
  <entry>
    <title>CNN发展总结</title>
    <link href="https://ryanstarfox.github.io/2025/08/18/2025/20250819%20CNN%E5%8F%91%E5%B1%95%E6%80%BB%E7%BB%93/"/>
    <id>https://ryanstarfox.github.io/2025/08/18/2025/20250819%20CNN%E5%8F%91%E5%B1%95%E6%80%BB%E7%BB%93/</id>
    <published>2025-08-17T18:19:05.000Z</published>
    <updated>2025-08-17T18:19:05.000Z</updated>
    
    <content type="html"><![CDATA[<h1>CNN发展总结</h1><p>正在学习李沐老师的d2l课程，梳理一下提到的几个标志性的CNN的逻辑以及发展的逻辑。</p><h2 id="1-LeNet"><a class="header-anchor" href="#1-LeNet">¶</a>1 LeNet</h2><p>LeNet是最早的卷积神经网络，引入了卷积层、池化层等等。其架构如下：</p><p><img src="/images/2025/LeNet.drawio.svg" alt="LeNet.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>那时的汇聚层、激活函数还是AvergePool和Sigmoid/Tanh，并非后来实践表明表现更好的ReLU和MaxPooling。</p><p><img src="/images/2025/AlexNet.drawio.svg" alt="AlexNet.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="2-AlexNet"><a class="header-anchor" href="#2-AlexNet">¶</a>2 AlexNet</h2><p>与LeNet思路类似，在imageNet比赛中取得了不错的成绩，证明了更深更大的模型可以有非常好的效果</p><ol><li>更深的模型层数</li><li>卷积通道数目巨大，卷积窗口更大</li><li>激活函数从Sigmoid/Tanh改成ReLU</li><li>通过Dropout全连接层控制模型复杂度</li><li>使用大量增强数据：翻转、裁切、变色</li></ol><p>其架构如下：</p><h2 id="3-使用块的网络（VGG）"><a class="header-anchor" href="#3-使用块的网络（VGG）">¶</a>3 使用块的网络（VGG）</h2><p>在AlexNet的实现中，我们可以意识到两件事：</p><ol><li>更深更大的神经网络确实可以有更好的效果</li><li>有很多层的组合（例如卷积层+池化层）反复出现</li></ol><p>因此为了方便构建模块化地构建更大的网络，我们可以将一系列“层”定义一个“块”，以“块”为基本单位之一构建网络。</p><p><img src="/images/2025/VGG.drawio.svg" alt="VGG.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="4-网络中的网络（NiN）"><a class="header-anchor" href="#4-网络中的网络（NiN）">¶</a>4 网络中的网络（NiN）</h2><p>VGG把神经网络的规模做得非常巨大，但是此时又暴露出了内存/显存占用巨大的问题——尤其是卷积层之后的第一个全连接层，因输入输出的维度都巨大，参数的数量也巨大。</p><p>为了改善存储占用的问题，NiN网络中使用了使用NiN块与GAP层。</p><ul><li>NiN块中使用了1$\times$1的卷积层，相当于通道维度的全连接层，不仅可以减少参数量，而且可以减少过拟合</li><li>Global Average Pooling （GAP）层被用来代替全连接层，减少了存储的参数的数量</li></ul><p><img src="/images/2025/NiN.drawio.svg" alt="NiN.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="4-含并⾏连结的⽹络（GoogLeNet）"><a class="header-anchor" href="#4-含并⾏连结的⽹络（GoogLeNet）">¶</a>4 含并⾏连结的⽹络（GoogLeNet）</h2><p>有了NiN之后，我们有了控制网络总参数量的工具。由此，我们可以构建更深、更复杂的网络。</p><p>GoogLeNet的想法很自然：</p><ul><li>在我们构建了足够强大的线形网络之后，我们也可以构建一些并行的有分支的网络</li><li>在纠结要用哪一种卷积参数的时候，我们可以选择全都要</li></ul><p>GoogLeNet也借鉴了NiN网络：</p><ul><li>使用了1$\times$1的卷积网络降维通道</li><li>使用GAP层，代替全连接层</li><li>在深度的维度上拼接，实现了并行输出的整合</li></ul><p>首先定义了一个Inception块</p><p><img src="/images/2025/Inception.drawio.svg" alt="Inception.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>其中白底的仅仅是用于调整深度，深紫底的才是实际提取特征的层。</p><p>由此可以构建出GoogLeNet</p><p>#<img src="/images/2025/GoogLeNet.drawio.svg" alt="GoogLeNet.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="5-残差网络（ResNet）"><a class="header-anchor" href="#5-残差网络（ResNet）">¶</a>5 残差网络（ResNet）</h2><ul><li>超深神经网络存在两大挑战：<ol><li>参数量庞大，计算和存储开销大。</li><li>深度增加导致梯度消失/梯度爆炸，训练困难。</li></ol></li></ul><p>前者在前面的模型中已经解决，后者ResNet可以解决。</p><p>ResNet的核心思想如下：</p><ol><li>更复杂的网络应包含原有的更简单网络，保证性能至少不劣于浅层网络。</li><li>引入残差函数 $F(x) = f(x) - x$，将学习目标改写为：$f(x) = F(x) + x$</li></ol><p>残差函数的作用主要想概括为以下两点：</p><ol><li><p>保证“性能不劣于浅层网络”</p><ul><li>当 $F(x) = 0$ 时，网络输出即退化为恒等映射 $y = x$</li><li>网络可以在恒等映射附近开始学习，使训练更容易</li><li>如果$F(x)$对于结果不好，那$F(x)$拿不到梯度，还是在0附近</li></ul></li><li><p>梯度传递优势</p><ul><li>前向传播时，恒等映射提供了直接捷径</li><li>反向传播时，梯度可以沿 $+x$ 这条捷径无衰减地传回，缓解梯度消失问题</li></ul></li></ol><p>ResNet最大的挑战是：相加的时候捷径的形状不同。</p><ol><li><p>通道数量不同</p><p>通过增加$1\times1$卷积层来控制通道数</p></li><li><p>维度不同</p><p>通过卷积核为1，有stride的卷积层来控制维度</p></li></ol><p>ResNet基本结构的图示如下：</p><p><img src="/images/2025/ResNet.drawio.svg" alt="ResNet.drawio"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="6-稠密连接网络（DenseNet）"><a class="header-anchor" href="#6-稠密连接网络（DenseNet）">¶</a>6 稠密连接网络（DenseNet）</h2><p>DenseNet 继承了ResNet的思想，将其进一步发展。</p><p>如果说ResNet是泰勒展开的一阶近似，那DenseNet就是高阶近似。DenseNet讲更多的过往的层传到现在的结果。</p><p>DenseNet主要由两种块构成：</p><ul><li><p>稠密块</p><p>大量旁路，为了将这么多结果整合在一起，DenseNet像GoogLeNet一样，在通道维度把结果拼接起来。</p></li><li><p>过渡块</p><p>经过稠密块后通道数巨大，因此使用$1\times1$卷积层减小通道数，使用平均汇聚层减小维数。</p></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;CNN发展总结&lt;/h1&gt;
&lt;p&gt;正在学习李沐老师的d2l课程，梳理一下提到的几个标志性的CNN的逻辑以及发展的逻辑。&lt;/p&gt;
&lt;h2 id=&quot;1-LeNet&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-LeNet&quot;&gt;¶&lt;/a&gt;1 LeNet&lt;/h</summary>
      
    
    
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="学习笔记/Notes" scheme="https://ryanstarfox.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0-Notes/"/>
    
  </entry>
  
  <entry>
    <title>影评：《南京照相馆》</title>
    <link href="https://ryanstarfox.github.io/2025/08/03/2025/20250803%20%E5%8D%97%E4%BA%AC%E7%85%A7%E7%9B%B8%E9%A6%86/"/>
    <id>https://ryanstarfox.github.io/2025/08/03/2025/20250803%20%E5%8D%97%E4%BA%AC%E7%85%A7%E7%9B%B8%E9%A6%86/</id>
    <published>2025-08-02T18:19:05.000Z</published>
    <updated>2025-08-02T18:19:05.000Z</updated>
    
    <content type="html"><![CDATA[<h1>按下快门，扣下扳机</h1><p>第一次发现按下快门和扣下扳机这么像。打开机身，打开枪膛；放入胶片，塞进子弹；按下快门，扣下扳机：前者定格世界，后者定格生命——都是永恒，不过前者创造，后者湮灭。</p><p>影片的开头就用这一段蒙太奇展示了两者的相似性，伊藤秀夫拍下杀人的照片，日军新兵杀人。伊藤秀夫眼中似乎有同情与震撼，甚至还“救”了阿昌——他叫阿昌“朋友”，给阿昌报名表通行证，看似同情中国的动摇者、庇护中国人的善人——影片开头似乎在用尽方法欺骗说服观众：伊藤秀夫是好人。伪善的伏笔暗藏其中：梦想是继承参加甲午战争的爷爷攻入中国、通行证上面的“有效期两日”。或许他有过人性中朴素的对恶行的排斥与对自己所做的动摇，我不认为他毫无人性，但军国主义将他洗脑让他罔顾人性的忠告，他从未正视人性与自己所做所为的矛盾，陷入阿伦特所说的“无思”的状态。</p><p>照相馆是一个很巧妙的切入点，在这个特殊的时候，照片的媒介必须通过照相馆才能刊出，主角一行也由此看到了真实的、血淋淋的南京。但更加令人触目的是，照片里的不是一群陌生人，而是一群街坊邻居。昨日身边活生生的人，成了今日照片里惨死的人，让人感到倒吸凉气但又愤怒——老金说：“我们不能当汉奸。”于是这一行人里，没有一个汉奸， 林毓秀和小孩活了下来，传出了照片；老金妻女死得意外，且因死亡毫无意义，更加令人扼腕愤怒；老金与阿昌用自己的方式，物理、精神上都算是出了口恶气；宋存义用自己的生命换来了其他人的活命，用南京城墙砸死了日本人。只有汉奸死得像狗一样。</p><p>《鬼子来了》中，日本军队在影片开头给小孩糖，在最后杀光了小孩。伊藤秀夫一开始给了阿昌生存——连给生存的权利竟然都能算是恩赐了，甚至或许真的对于阿昌产生了一种近似友谊的情感。但是在长官的催促下，在他自己的军国主义思想下，他拒绝了人性，并且要用杀死阿昌来彻底斩断自己的人性。可怜老金至死也不知道自己的妻女已经死了。伊藤秀夫最后冲进照相馆的时候依然在撒谎：“我当你是朋友。”无牵挂无生路的阿昌说实话：“我们不是朋友。”一句“中日亲善”贯穿始终。</p><p>一般来说，我不爱看主旋律抗战片——反而是被一些手撕鬼子的无端滑稽和强行升华的价值观消磨掉了忍耐力。好的电影想要传达它的情感与价值不需要直白地喊出来，而是让观众自己滑向那种情感，自己解读自己的价值。南京照相馆最后的煽情使用了大量蒙太奇——照片本身就是很好的蒙太奇的桥梁。老金换进伊藤秀夫胶卷的南京市民日常胶卷和南京市民被杀的镜头不断切换，普通生活的美好以这样一种方式在观众眼前被撕碎。日常胶卷掺杂在屠杀胶卷里，伊藤秀夫看后暴怒——<strong>被撕碎的美好用这样一种方式完成了自杀式的反击</strong>，杀死了伊藤秀夫。伊藤秀夫曾说：“支那人的照片不重要。”支那人的照片杀死了他，他自己的照片杀死了日本军官。</p><p>《辛德勒的名单》中，德国军官曾试图枪杀犹太人，扣下扳机之后几次发现枪坏了，最终不杀了，最终他也类似地像个玩具一样被杀死。同样是报应，胜利后，还是在南京，曾经草菅人命的日本军官在同一个地方被枪毙，同样是快门和扳机，这次照片和子弹成功相遇了。</p><p>片尾曲，昔日的南京照片放到今日同样的地方，如今国泰民安，不见昔日日寇，只见车水马龙，感慨万分。</p><p>也在想，这部电影有可能出海嘛？电影本身质量不低，《辛德勒的名单》、《拯救大兵瑞恩》甚至《壮志凌云》都能够在国际上享有自己的话语权，那《南京照相馆》有可能嘛？</p><p>看完电影，骑车回家，下大暴雨了，淋了一身湿——也好久没有淋过雨了。上海在下雨，南京也在下雨吧。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;按下快门，扣下扳机&lt;/h1&gt;
&lt;p&gt;第一次发现按下快门和扣下扳机这么像。打开机身，打开枪膛；放入胶片，塞进子弹；按下快门，扣下扳机：前者定格世界，后者定格生命——都是永恒，不过前者创造，后者湮灭。&lt;/p&gt;
&lt;p&gt;影片的开头就用这一段蒙太奇展示了两者的相似性，伊藤秀夫拍下杀</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
  </entry>
  
  <entry>
    <title>在新国立做的梦</title>
    <link href="https://ryanstarfox.github.io/2025/07/28/2025/20250718%20%E6%96%B0%E5%8A%A0%E5%9D%A1/"/>
    <id>https://ryanstarfox.github.io/2025/07/28/2025/20250718%20%E6%96%B0%E5%8A%A0%E5%9D%A1/</id>
    <published>2025-07-28T13:30:00.000Z</published>
    <updated>2025-07-28T13:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>在新国立做的梦</h1><p>6/28晚上，我抵达新加坡国立大学，开始近一个月的暑期项目。现在我坐在uTown，不知道应该做什么。项目在今天下午完成了最后的展示，只要明天轮流坐在摊位前介绍就行了。展示之后，我不知道去哪里，想了想，还是来了uTown，一方面自己不习惯一直待在寝室里；另一方面其实是想吃潮州猪脚锅，吃一些猪肉。</p><p>我仍旧坐在Education Resources Center的那个靠近且面对大草坪的位置，但是今天却不知道该做些什么。天气还是很好，很多毕业生穿着学士服在拍毕业照，草地上几只小狗在玩闹，我旁边的一只哈士奇被大爷牵着也在朝那里看——这只哈士奇每天都来。我非常喜欢这里的云，这里的云是立体的，饱满的，竟让我感觉和西藏的云有点像，甚至同样都很低。云飘得很快，天渐渐暗下来，云变成橙色和黄色的了。我去Fine Food吃我心心念念的猪脚锅了。</p><p><img src="/images/2025/IMG_0616.jpeg" alt="IMG_0616"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我突然间意识到，这可能是我最后一次来uTown了，也可能是最后一次在uTown看夕阳了。我不知所措，是因为已经意识到这段旅程即将结束，我无法暂停时间，因而只想郑重地点上一个句点——这也让我猛然感到，应该写点东西了。</p><p><img src="/images/2025/IMG_0111.JPG" alt="IMG_0111"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>这是7年前的照片了</p><p>新加坡，我第一次来这里是7年之前。那个时候疫情尚未来临，父母还未离婚，经济仍然向好。那段旅程让我不敢忘记，因此我开始写日记，从2018年8月1日，也就是第一天从上海出发抵达新加坡的那一天开始。当时正好赶上了新加坡国庆，看到各种奇怪的飞机飞来飞去，回去的时候在樟宜机场一开始不愿四处逛，临走前又发现来不及去看看仙人掌馆。鸭子船、花穹、云雾岭、夜间动物园……我现在还能记起的似乎也只有这些毫无意义但是充满情感的碎片了——日记就是让我更加放心地遗忘吧。</p><p><img src="/images/2025/55FA7549-F5A0-4CCA-9A73-EE9EA89ED88D_1_105_c.jpeg" alt="55FA7549-F5A0-4CCA-9A73-EE9EA89ED88D_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>这次出发前，还在做歌手大赛的那段时间，我就经常梦见自己来到新国立——梦中的新国立有一个类似上中的校门，门口就是地铁站和酒吧——我很向往，但是我不敢抱太高的期望，我担心仍是和一群没什么想法的理工男打交道。</p><p>新加坡的气候很好，几乎只有上午下过雨——那时候我还在睡觉，下午也没那么热，晚上开空调会冷——难怪这里有很多挂着大吊扇的开放空间。我十分羡慕新加坡的一点在于新加坡是能够在大楼里面种树的——花园城市名副其实。这里实际上碰到华人面孔都可以说中文——即使用蹩脚的Chinglish问，回答也很有可能是中文。新加坡真的很宜居，很想以后时不时来这里旅居。</p><p>在这里也趁空闲时间看了一些电影，包括飞机上看的《天堂电影院》、周末看的《卧虎藏龙》、《勇敢的心》、《低俗小说》、回家候机时看的《国产凌凌漆》，还看完了《混沌武士》。回想起来《混沌武士》中的三人和nus项目的小组很像——莫名甚至是非常虚的原因聚在一起，在晴朗的日子走了许多路，在皆大欢喜的结局后各自成长分别。闲时间做的最重要的事把《地频线》的决赛录像的录音提取了出来，做成了专辑自己听。于我，新加坡也有了《地频线》的影子。</p><p><img src="/images/2025/IMG_0874.jpeg" alt="IMG_0874"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我们的课程最终是需要分成小组来做project的模式。我们组基本上是大佬带飞的状态。最开始的时候，我称他们为组员，但是到了最后，我觉得可以称为朋友了——比我预想的好很多，他们目之所及不止眼前的电脑，而是有着对于世界的个人理解。我们一起做project，一起吃饭，一起去市区，一起看电影，一起庆祝一位的生日，甚至一起做了一件疯狂的事——新加坡骑行一圈60公里——骑到东海岸的路不太好骑，常常被红灯阻挠，但是一到东海岸就变得非常顺畅舒适——海边的音乐、椰子树的剪影、海滩黄昏与混杂着咸味和烧烤味的海风让我想起我小时候去普吉岛，也是热带的海滩的日落，海边的果树挂满了青色的芒果。樟宜机场来来往往的飞机从我们头顶飞过，时不时飞过一些为了国庆训练的军机。与其中一位有摩擦，但同样也碰到了只去相投的朋友。感觉在这里我彻底改去了对于电院全是没有想法的nerd的固有印象——其实还是有很多人闪烁着思想的光芒，他们不仅着眼于眼前的技术，也看见技术背后的目的。他们的技术观和世界观、人生观相互支撑，也已经到达相当深入的鲜有人涉足的地方了。其间，我意识到一个有趣的现象：其实有几位我甚至会把他们投射到一些故人上去——气质很像，样貌很像，但是又确确实实不是同一个人。</p><p><img src="/images/2025/IMG_0693.jpeg" alt="IMG_0693"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>当然，我也故地重游。我到新加坡的第二天就去了滨海湾。一切如故，但人变了，世界也变了。让我想起《星际牛仔》里Faye见到夕阳下的鱼尾狮，向着家的方向跑去，但是只见断壁颓垣和那一首《Call me Call me》。云雾林和花穹也还是和原来差不多。云雾岭最近好像在和侏罗纪公园合作，可能是为最近的电影做宣发吧。我小时候在花穹的照片作为个人照，在很多地方使用过——荣誉册、精选PPT，我在同样的位置又拍了一张，但是现在那里全都是玫瑰而不是以前的黄橙色的花儿。曾经的我淹没在花丛中，但是现在花丛却是在脚边。到圣淘沙的时候正好夕阳西下，为了看夕阳，并没有去小时去过的亚洲最南端——不知道现在那里是不是还是那些栈道。我往西走，踩着柔软的沙子，看着紫红色的天水交接之处和停泊在岸边的货轮。</p><p><img src="/images/2025/IMG_0593.jpeg" alt="IMG_0593"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>算是认真、郑重的画了个句号吧。天色已经完全暗下来，uTown优雅的灯光亮起来了。不知以后是否还有缘再来NUS，至于新加坡，想必以后常会再来吧？</p><p><img src="/images/2025/IMG_0881.jpeg" alt="IMG_0881"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;在新国立做的梦&lt;/h1&gt;
&lt;p&gt;6/28晚上，我抵达新加坡国立大学，开始近一个月的暑期项目。现在我坐在uTown，不知道应该做什么。项目在今天下午完成了最后的展示，只要明天轮流坐在摊位前介绍就行了。展示之后，我不知道去哪里，想了想，还是来了uTown，一方面自己不习惯一直</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="旅行/Travel" scheme="https://ryanstarfox.github.io/tags/%E6%97%85%E8%A1%8C-Travel/"/>
    
  </entry>
  
  <entry>
    <title>计算机系统结构整理</title>
    <link href="https://ryanstarfox.github.io/2025/06/20/2025/20250620%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E7%BB%93%E6%9E%84/"/>
    <id>https://ryanstarfox.github.io/2025/06/20/2025/20250620%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%B3%BB%E7%BB%9F%E7%BB%93%E6%9E%84/</id>
    <published>2025-06-20T02:17:00.000Z</published>
    <updated>2025-06-20T02:17:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="1-Fundamentals-of-Computer-Science"><a class="header-anchor" href="#1-Fundamentals-of-Computer-Science">¶</a>1 Fundamentals of Computer Science</h2><h3 id="1-1-Introduction"><a class="header-anchor" href="#1-1-Introduction">¶</a>1.1 Introduction</h3><p>How to make computers faster?</p><ul><li>increase clock rate</li><li>increase logic density</li></ul><h3 id="1-2-Classes-of-Computers"><a class="header-anchor" href="#1-2-Classes-of-Computers">¶</a>1.2 Classes of Computers</h3><p>Computer categories:</p><ul><li>Personal Mobile Device<ul><li>Wireless</li><li>Energy efficiency important<ul><li>battery</li><li>no fan</li></ul></li><li>Flash memory instead of disks<ul><li>enery efficiency</li><li>size limit</li></ul></li><li>Responsiveness/real-time performance<ul><li>hard real-time</li><li>soft real-time</li></ul></li></ul></li><li>Desktop Computing<ul><li>price</li><li>performance<ul><li>compute</li><li>graphic</li></ul></li></ul></li><li>Servers<ul><li>availability</li><li>scalability</li><li>energy</li></ul></li><li>Clusters/Warehouse Scale Computers<ul><li>expensive</li><li>software as a service (SaaS)</li></ul></li><li>Embedded Computers<ul><li>Application-specific</li><li>can be 8-, 16-, 32-bit</li></ul></li></ul><p>2 kinds of parallelism:</p><ul><li><p>data-level parallelism (DLP) &gt; thread-level parallelism (TLP)</p><ul><li>Instruction-Level parallelism (eg. pipelining)</li><li>Vector architecture / Graphic Processor Units</li><li>Multi-core (TLP)</li><li>Clusters (Request-level parallelism $\in$ TSP)</li></ul></li></ul><p>Flynn's Taxonmy</p><table><thead><tr><th style="text-align:center"></th><th style="text-align:center">Single Data Stream</th><th style="text-align:center">Multiple Data Stream</th></tr></thead><tbody><tr><td style="text-align:center">Single Intruction Stream</td><td style="text-align:center">SISD<br />Simplest</td><td style="text-align:center">SIMD<br />Vector Architectures / GPU</td></tr><tr><td style="text-align:center">Multiple Intructin Stream</td><td style="text-align:center">MISD<br />No Commercial Implementation</td><td style="text-align:center">MIMD<br />Tightly/Loosely-coupled MIMD</td></tr></tbody></table><h3 id="1-3-Defining-Computer-Architecture"><a class="header-anchor" href="#1-3-Defining-Computer-Architecture">¶</a>1.3 Defining Computer Architecture</h3><ul><li>ISA: Instruction Set Architecture</li><li>Addressing Modes</li><li>Microarchitecture</li></ul><h3 id="1-4-Trends-in-Technology"><a class="header-anchor" href="#1-4-Trends-in-Technology">¶</a>1.4 Trends in Technology</h3><p>5 critical implememtation techs</p><ul><li>Integrated circuit logic technology</li><li>Semiconductor DRAM</li><li>Semiconductor Flash</li><li>Magnetic disk tecknology</li><li>Network technology</li></ul><p>ENIAC(decimal, vacuum tubes)-&gt;transisters-&gt;Microelectronics</p><p>Two Metrics: Bandwidth &amp; Latency (former outpaces latter)</p><h3 id="1-5-Trends-in-Power-and-Energy-in-ICs"><a class="header-anchor" href="#1-5-Trends-in-Power-and-Energy-in-ICs">¶</a>1.5 Trends in Power and Energy in ICs</h3><p>contradiction between power and energy: get power in, get power and heat out</p><ul><li><p>Thermal design power (TDP)</p></li><li><p>Clock rate</p></li><li><p>Dynamic power/energy (trans from 0 to 1)--voltage is key</p><p>to reduce:</p><ul><li>Turn off clock of inactive modules</li><li>Dynamic voltage-frequency</li><li>Low power state for DRAM and disks</li><li>Turn off a few cores</li></ul></li><li><p>Static power: leakage current flows</p></li></ul><h3 id="1-6-Trends-in-Cost"><a class="header-anchor" href="#1-6-Trends-in-Cost">¶</a>1.6 Trends in Cost</h3><p>IC Cost = (Die Cost + Testing Cost + Packaging Cost)/Finaltest yield</p><p>Die Cost = Wafer cost / (Die per Wafer $\times$ Die Yield)</p><h3 id="1-7-Dependability"><a class="header-anchor" href="#1-7-Dependability">¶</a>1.7 Dependability</h3><p>MTTF (mean time to failure)</p><p>MTTR (mean time to repair)</p><p>MTBF (mean time between failures = MTTF+MTTR)</p><p>Satisfy Poisson Distribution</p><p>If serial, total <strong>MTTF = ($\sum$ MTTF$_i^{-1}$)$^{-1}$</strong></p><h3 id="1-8-Measuring-Performance"><a class="header-anchor" href="#1-8-Measuring-Performance">¶</a>1.8 Measuring Performance</h3><p>Benchmark Suit: A collection of benchmark programs</p><p>SPEC: Standard Performance Evaluation Corporation</p><h3 id="1-9-Quantitative-Principles"><a class="header-anchor" href="#1-9-Quantitative-Principles">¶</a>1.9 Quantitative Principles</h3><ul><li><p>Take advantage of parallelism</p><ul><li>Data level parallelism and task level parallelism</li><li>Pipelining, set-associative caches</li><li>Multicore, multiprocessor, vector</li></ul></li><li><p>Principle of locality</p><ul><li>reuse recently used data and instructions</li><li>Temporal locality and spatial locality</li></ul></li><li><p>Focus on common use</p></li></ul><p><strong>Amdahl's Law:</strong></p><ul><li>$Execution\ time_{new} = Execution\ time_{old} × (1 - Fraction_{enhanced}) + \dfrac{Fraction_{enhanced}}{ Speedup_{enhanced}}$</li><li>$Speedup_{overall}= \dfrac{Execution\ time_{old}}  {Execution\ time_{new}} = \dfrac1 { ((1 - Fraction_{enhanced}) + \dfrac{Fraction_{enhanced}}{ Speedup_{enhanced}}}$</li></ul><p>Three factors for processor improvement:</p><ul><li>Clock Cycle</li><li>Cycles per Instruction (CPI)</li><li>Instruction Count (IC)</li></ul><p>CPU clock cycles = $\sum$IC~i~$\times$CPI~i~</p><p>CPU time = ($\sum$IC~i~$\times$CPI~i~)$\times$Clock cycle time</p><h2 id="2-ISA"><a class="header-anchor" href="#2-ISA">¶</a>2 ISA</h2><h3 id="MIPS-RISC"><a class="header-anchor" href="#MIPS-RISC">¶</a>MIPS (RISC)</h3><table><thead><tr><th style="text-align:center">op</th><th style="text-align:center">rs</th><th style="text-align:center">rt</th><th style="text-align:center">rd</th><th style="text-align:center">shamt</th><th style="text-align:center">funct</th></tr></thead></table><table><thead><tr><th style="text-align:center">name</th><th style="text-align:center">length(bits)</th><th style="text-align:center">function</th></tr></thead><tbody><tr><td style="text-align:center">op</td><td style="text-align:center">6</td><td style="text-align:center">opcode that specifies the operation</td></tr><tr><td style="text-align:center">rs</td><td style="text-align:center">5</td><td style="text-align:center">register file address of the first source operand</td></tr><tr><td style="text-align:center">rt</td><td style="text-align:center">5</td><td style="text-align:center">register file address of the second source operand</td></tr><tr><td style="text-align:center">rd</td><td style="text-align:center">5</td><td style="text-align:center">register file address of the result’s destination</td></tr><tr><td style="text-align:center">shamt</td><td style="text-align:center">5</td><td style="text-align:center">shift amount (for shift instructions)</td></tr><tr><td style="text-align:center">funct</td><td style="text-align:center">6</td><td style="text-align:center">function code augmenting the opcode</td></tr></tbody></table><p>3 instruction formats:</p><p>R format</p><table><thead><tr><th style="text-align:center">op(6)</th><th style="text-align:center">rs (5)</th><th style="text-align:center">rt (5)</th><th style="text-align:center">rd (5)</th><th style="text-align:center">shamt (5)</th><th style="text-align:center">funct (6)</th></tr></thead></table><p>I format</p><table><thead><tr><th style="text-align:center">op (6)</th><th style="text-align:center">rs (5)</th><th style="text-align:center">rt (5)</th><th style="text-align:center">immediate (16)</th></tr></thead></table><p>J format</p><table><thead><tr><th style="text-align:center">op (5)</th><th style="text-align:center">jump target (27)</th></tr></thead></table><table><thead><tr><th style="text-align:center">Name</th><th style="text-align:center">Register Number</th><th style="text-align:center">Usage</th></tr></thead><tbody><tr><td style="text-align:center">$zero</td><td style="text-align:center">0</td><td style="text-align:center">constant 0 (hardware)</td></tr><tr><td style="text-align:center">$at</td><td style="text-align:center">1</td><td style="text-align:center">reserved for assembler</td></tr><tr><td style="text-align:center">$v0 - $v1</td><td style="text-align:center">2-3</td><td style="text-align:center">returned values</td></tr><tr><td style="text-align:center">$a0 - $a3</td><td style="text-align:center">4-7</td><td style="text-align:center">arguments</td></tr><tr><td style="text-align:center">$t0 - $t7</td><td style="text-align:center">8-15</td><td style="text-align:center">temporaries</td></tr><tr><td style="text-align:center">$s0 - $s7</td><td style="text-align:center">16-23</td><td style="text-align:center">saved values</td></tr><tr><td style="text-align:center">$t8 - $t9</td><td style="text-align:center">24-25</td><td style="text-align:center">temporaries</td></tr><tr><td style="text-align:center">$k0-$k1</td><td style="text-align:center">26-28</td><td style="text-align:center">reserved for OS kernel</td></tr><tr><td style="text-align:center">$gp</td><td style="text-align:center">28</td><td style="text-align:center">global pointer</td></tr><tr><td style="text-align:center">$sp</td><td style="text-align:center">29</td><td style="text-align:center">stack pointer</td></tr><tr><td style="text-align:center">$fp</td><td style="text-align:center">30</td><td style="text-align:center">frame pointer</td></tr><tr><td style="text-align:center">$ra</td><td style="text-align:center">31</td><td style="text-align:center">return addr (hardware)</td></tr></tbody></table><p>Big endian (MIPS) （高位字节在低地址）vs little endian (8086)（高位字节在高地址）</p><p>Big and little endian are for the position of byte in a word</p><p>The order of the bits in a byte is fixed, regardless of big or small endian</p><p>some examples of MIPS commands</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">add $s3, $t0, $t1//$s3=$t0+$t1</span><br><span class="line">lw $t0, 1($s3)//$(s3+1)=$t0</span><br><span class="line">beq $t0, $t1, label//if $t0==$t1, execute label</span><br><span class="line">bne $t0, $t1, label//if $t0!=$t1, execute label</span><br><span class="line">slti $t0, $t1, immediate//if t1 &lt; immediate, t0=1</span><br><span class="line">sltiu $t0, $t1, $t2//if unsigned t1 &lt; unsigned t2, t0=1</span><br></pre></td></tr></table></figure><p>if jump is to far, assembler will insert an unconditional jump</p><h3 id="RISC-V"><a class="header-anchor" href="#RISC-V">¶</a>RISC-V</h3><p>Open, simple, extendable</p><h2 id="3-Single-cycle-Processor"><a class="header-anchor" href="#3-Single-cycle-Processor">¶</a>3 Single-cycle Processor</h2><p>4 stages:</p><ul><li>IF (instruction fetch)<ul><li>PC+=4 in each cycle</li><li>for branch<ul><li>A PC Ext (signed) to add immediate to PC</li><li>A zero flag to determine whether to add immediate to PC</li></ul></li><li>for I-type: replace lower 28 bits of PC with the lower 26 bits of the fetched instruction shifted left by 2 bits</li></ul></li><li>Decode<ul><li>for R-type<ul><li>Generate a RegWr signal for Registers</li><li>Generate a ALUctr signal for Registers</li></ul></li><li>for I-type<ul><li>calculation, like ori<ul><li>Expand immediate from 16 bits to 32 bits (unsigned/zero extension)</li><li>need a multiplexer, because in R-type write to Rd but in I-type write to Rt</li></ul></li><li>memory access, like lw &amp; sw<ul><li>Expand immediate from 16 bits to 32 bits (signed extension)</li></ul></li></ul></li><li>for J-type<ul><li>shift lower 26 bits of the fetched instruction by 2 bits (*4)</li></ul></li></ul></li><li>Execute</li><li>Memory</li><li>(Reister write) only lw</li></ul><p>Two Layers of Decoding: Main Control &amp; ALU Control</p><p>op $\Rightarrow$ other control signals</p><p>ALUop, func $\Rightarrow$ ALUctr</p><h2 id="4-Multi-cycle-Processor"><a class="header-anchor" href="#4-Multi-cycle-Processor">¶</a>4 Multi-cycle Processor</h2><p>硬件中添加5个编译器不能读取的寄存器</p><ul><li>A，B：读出的AB地址的数据</li><li>ALUout：临时存储ALUout的数据</li><li>IR (Instruction Register)：存储指令，有写控制信号——不是每个周期都会写</li><li>MDR （Memory Data Register)：存储内存的数据</li></ul><table><thead><tr><th style="text-align:center">Phase</th><th style="text-align:center">Instr Fetch</th><th style="text-align:center">Decode</th><th style="text-align:center">Execute</th><th style="text-align:center">Memory Access</th><th style="text-align:center">Write-back</th></tr></thead><tbody><tr><td style="text-align:center"><strong>R-type</strong></td><td style="text-align:center">IR = Memory[PC];<code>&lt;br&gt;</code>PC = PC + 4;</td><td style="text-align:center">A = Reg[IR[25-21]];<code>&lt;br&gt;</code>B = Reg[IR[20-16]];<code>&lt;br&gt;</code>ALUOut = PC + (sign-extend(IR[15-0]) &lt;&lt; 2);</td><td style="text-align:center">ALUOut = A op B;</td><td style="text-align:center">Reg[IR[15-11]] = ALUOut;</td><td style="text-align:center">—</td></tr><tr><td style="text-align:center"><strong>Mem Ref</strong></td><td style="text-align:center">IR = Memory[PC];<code>&lt;br&gt;</code>PC = PC + 4;</td><td style="text-align:center">A = Reg[IR[25-21]];<code>&lt;br&gt;</code>B = Reg[IR[20-16]];<code>&lt;br&gt;</code>ALUOut = PC + (sign-extend(IR[15-0]) &lt;&lt; 2);</td><td style="text-align:center">ALUOut = A + sign-extend(IR[15-0]);</td><td style="text-align:center">MDR = Memory[ALUOut];<code>&lt;br&gt;</code>or Memory[ALUOut] = B;</td><td style="text-align:center">Reg[IR[20-16]] = MDR;</td></tr><tr><td style="text-align:center"><strong>Branch</strong></td><td style="text-align:center">IR = Memory[PC];<code>&lt;br&gt;</code>PC = PC + 4;</td><td style="text-align:center">A = Reg[IR[25-21]];<code>&lt;br&gt;</code>B = Reg[IR[20-16]];<code>&lt;br&gt;</code>ALUOut = PC + (sign-extend(IR[15-0]) &lt;&lt; 2);</td><td style="text-align:center">if (A == B)<code>&lt;br&gt;</code>PC = ALUOut;</td><td style="text-align:center">—</td><td style="text-align:center">—</td></tr><tr><td style="text-align:center"><strong>Jump</strong></td><td style="text-align:center">IR = Memory[PC];<code>&lt;br&gt;</code>PC = PC + 4;</td><td style="text-align:center">A = Reg[IR[25-21]];<code>&lt;br&gt;</code>B = Reg[IR[20-16]];<code>&lt;br&gt;</code>ALUOut = PC + (sign-extend(IR[15-0]) &lt;&lt; 2);</td><td style="text-align:center">PC = PC[31-28]|| (IR[25-0] &lt;&lt; 2);</td><td style="text-align:center">—</td><td style="text-align:center">—</td></tr></tbody></table><ul><li>在IF就执行PC=PC+4是为了利用空闲的ALU</li><li>在Decode阶段是为所有可能做好准备。读取A，B是为了准备对A，B地址的数据进行操作；计算Branch Destination并存入ALUout是为可能的branch指令做准备。Decode阶段还会准备好Execute阶段对应的控制信号。</li><li>Execute阶段：<ul><li>R：计算正确的计算结果</li><li>LW/SW：正确的地址覆盖掉ALUout（而不是之前算出来的Branch Destination)</li><li>Branch：比较A和B输出一个zero control signal，用于控制PCwrite；ALUout准备传输给PC</li><li>J：Jump Destination给PC</li></ul></li><li>Memory Access阶段：<ul><li>R：ALUout的值写入R[Rd]</li><li>SW：把B存入M[ALUout]，其中B是第二个阶段被更新，第三个阶段被同样的数据覆盖（因为IR没变），第四个阶段被用到</li><li>LW：把M[ALUout]存入MDR</li></ul></li><li>Writeback阶段：<ul><li>LW：MDR写入Reg[IR[20-16]]</li></ul></li></ul><p>控制信号：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">flowchart TD</span><br><span class="line">    Start([Start]) --&gt; IF[&lt;b&gt;1 InstrFetch&lt;/b&gt;&lt;br/&gt;IorD=0&lt;br/&gt;MemRead;IRWrite&lt;br/&gt;ALUSrcA=0&lt;br/&gt;ALUSrcB=1&lt;br/&gt;PCSource, ALUOp=00&lt;br/&gt;PCWrite]</span><br><span class="line">IF --&gt;Decode[&lt;b&gt;2 Decode&lt;/b&gt;&lt;br/&gt;ALUSrcA=0&lt;br/&gt;ALUSrcB=11&lt;br/&gt;ALUOp=00&lt;br/&gt;PCWriteCond=0]</span><br><span class="line"></span><br><span class="line">    Decode --&gt;|Op = lw or sw| ExecMem[&lt;b&gt;3 Execute lw/sw&lt;/b&gt;&lt;br/&gt;ALUSrcA=1&lt;br/&gt;ALUSrcB=10&lt;br/&gt;ALUOp=00&lt;br/&gt;PCWriteCond=0]</span><br><span class="line">    Decode --&gt;|Op = R-type| ExecR[&lt;b&gt;3 Execute R-type&lt;/b&gt;&lt;br/&gt;ALUSrcA=1&lt;br/&gt;ALUSrcB=00&lt;br/&gt;ALUOp=10&lt;br/&gt;PCWriteCond=0]</span><br><span class="line">    Decode --&gt;|Op = beq| ExecBeq[&lt;b&gt;3 Execute beq&lt;/b&gt;&lt;br/&gt;ALUSrcA=1&lt;br/&gt;ALUSrcB=00&lt;br/&gt;ALUOp=01&lt;br/&gt;PCSource=01]</span><br><span class="line">    Decode --&gt;|Op = j| Jump[&lt;b&gt;3 Jump&lt;/b&gt;&lt;br/&gt;PCSource=10&lt;br/&gt;PCWrite]</span><br><span class="line">  </span><br><span class="line">    ExecMem --&gt;|Op = lw| MemRead[&lt;b&gt;4 Memory Access lw&lt;/b&gt;&lt;br/&gt;MemRead&lt;br/&gt;IorD=1&lt;br/&gt;PCWriteCond=0]</span><br><span class="line">    ExecMem --&gt;|Op = sw| MemWrite[&lt;b&gt;4 Memory Access sw&lt;/b&gt;&lt;br/&gt;MemWrite&lt;br/&gt;IorD=1&lt;br/&gt;PCWriteCond=0]</span><br><span class="line">  </span><br><span class="line">    MemRead --&gt; WB[&lt;b&gt;5 Write Back lw&lt;/b&gt;&lt;br/&gt;RegWrite=1&lt;br/&gt;MemtoReg=1]</span><br><span class="line">    MemWrite --&gt; End((End))</span><br><span class="line">    WB --&gt; End</span><br><span class="line">  </span><br><span class="line">    ExecR --&gt; WriteR[&lt;b&gt;4 Memory Access R-type&lt;/b&gt;&lt;br/&gt;RegDst=1&lt;br/&gt;RegWrite=1&lt;br/&gt;MemtoReg=0&lt;br/&gt;PCWriteCond=0]</span><br><span class="line">    WriteR --&gt; End</span><br><span class="line">  </span><br><span class="line">    ExecBeq --&gt; End</span><br><span class="line">    Jump --&gt; End</span><br><span class="line">    End--&gt;Start</span><br></pre></td></tr></table></figure><p>CPI: Cycle per Instruction</p><h2 id="5-Pipelining"><a class="header-anchor" href="#5-Pipelining">¶</a>5 Pipelining</h2><h3 id="5-1-Introduction-to-Pipelining"><a class="header-anchor" href="#5-1-Introduction-to-Pipelining">¶</a>5.1 Introduction to Pipelining</h3><p>Multiple instructions are being executed simultaneously</p><h3 id="5-2-How-Pipelining-is-Implemented"><a class="header-anchor" href="#5-2-How-Pipelining-is-Implemented">¶</a>5.2 How Pipelining is Implemented</h3><p>在Single-cycle processor的基础上修改，分为5个阶段：IF, ID, EX, MEM, WB</p><p>在每两个阶段中间，加入超大Register，存储数据和ID阶段产生的Control Signal</p><p>Branch是在MEM阶段解决的</p><h3 id="5-3-Pipeline-hazards"><a class="header-anchor" href="#5-3-Pipeline-hazards">¶</a>5.3 Pipeline hazards</h3><ul><li><p>Structure hazard：不同指令在统一时间周期内需要访问同一个硬件资源</p><p>解决方法：</p><ul><li>给多个端口访问内存</li><li>Instruction Memory和Data Memory分离</li></ul></li><li><p>Data hazard：前一个指令还没完成对于Data的修改，后一个指令就已经读取了数据，ID阶段就需要检查</p><p>解决方法：</p><ul><li>Code Scheduling：不改变执行结果的情况下，让两条Data hazards的指令隔得远一点</li><li>Forwarding/Bypassing：通过硬件，不待数据存回内存，就直接给到下一条指令，但是即便如此，lw后一个需要读寄存器的指令依旧会有Data hazard</li><li>Stalling：给一条空指令（Bubble）</li></ul></li><li><p>Control hazard：Branch影响了Instruction流</p><p>解决方法：</p><ul><li>把branch提前到ID之后，减少Bubble从2个变为1个</li><li>延迟分支和延迟槽：再增加一个无论都会执行的分支，包含两个延迟槽，填充原来两个bubble的位置</li><li>分支预测：预测（猜）下一个进入哪一个分支<ul><li>静态：总是跳转/不跳转</li><li>动态：<ul><li>1位预测器：根据上一次的结果</li><li>2位预测器：00，01，10，11，跳转加1，不跳转减1，只有到00和11的时候，才会改变跳不跳转的状态</li><li>全局/局部历史预测</li></ul></li><li>prediction correct就继续运行，错误则原来的预测直接flush掉，称为bubble，立即执行正确的</li></ul></li></ul></li></ul><h3 id="5-4-Exceptions"><a class="header-anchor" href="#5-4-Exceptions">¶</a>5.4 Exceptions</h3><p>Also-called Interrupt/Fault</p><p>situations where the normal execution order of instruction is changed, CPU may abort instructions in the pipeline</p><p>The most difficult exceptions have 2 properties:</p><ul><li>occur within instructions</li><li>restartable</li></ul><p>to save pipeline state:</p><ul><li>Force a trap instruction into the pipeline on the next IF</li><li>turn off all writes for all the instructions in the pipeline</li><li>After the exception-handling routine in the OS receives control, it immediately saves the PC of the faulting instruction</li></ul><p>two kinds of exceptions</p><ul><li>precise exceptions: 编译器知道哪条异常，它之前的执行完，后面的重新执行</li><li>imprecise exceptions：编译器不知道哪条异常</li></ul><table><thead><tr><th style="text-align:center">Pipeline stage</th><th style="text-align:center">Problem exceptions occurring</th></tr></thead><tbody><tr><td style="text-align:center">IF</td><td style="text-align:center">Page fault on instruction fetch; misaligned memory access; memory protection violation</td></tr><tr><td style="text-align:center">ID</td><td style="text-align:center">Undefined or illegal opcode</td></tr><tr><td style="text-align:center">EX</td><td style="text-align:center">Arithmetic exception</td></tr><tr><td style="text-align:center">MEM</td><td style="text-align:center">Page fault on data fetch; misaligned memory access; memory protection violation</td></tr><tr><td style="text-align:center">WB</td><td style="text-align:center">None</td></tr></tbody></table><h3 id="5-5-Handling-Multicycle-Operations"><a class="header-anchor" href="#5-5-Handling-Multicycle-Operations">¶</a>5.5 Handling Multicycle Operations</h3><p>深pipeline</p><h2 id="6-Instruction-level-Parallelism"><a class="header-anchor" href="#6-Instruction-level-Parallelism">¶</a>6 Instruction-level Parallelism</h2><h3 id="6-1-Concepts-and-Challenges"><a class="header-anchor" href="#6-1-Concepts-and-Challenges">¶</a>6.1 Concepts and Challenges</h3><p>trying to minimize CPI</p><p>3 kinds of dependences:</p><ul><li><p>Data Dependences</p><p>指令的结果被另一条指令使用</p><ul><li>True Dependence: 一条指令产生的结果被后续指令使用</li><li>Anti-Dependence: 一条指令读取一个寄存器，而后续指令写入该寄存器</li><li>Output Dependence: 多条指令写入同一个寄存器</li></ul></li><li><p>Name Dependences</p><p>两条指令使用相同的寄存器或内存位置，但它们之间并没有真正的数据依赖，可以用寄存器重命名消除</p></li><li><p>Control Dependences</p><p>指令的执行依赖于控制流（如分支指令）的结果</p></li></ul><p>Data hazards:</p><ul><li>Read after write RAW</li><li>Write after write WAW</li><li>Write after read WAR</li></ul><h3 id="6-2-Basic-Compiler-Techniques"><a class="header-anchor" href="#6-2-Basic-Compiler-Techniques">¶</a>6.2 Basic Compiler Techniques</h3><ol><li><p>Pipelining Stalls</p></li><li><p>Pipelining Scheduling</p></li><li><p>Loop Unrolling</p><p>减少跳转，让一个loop里面执行4个loop的内容</p><p>需要计算好余数</p></li></ol><h3 id="6-3-Reducing-Branch-Costs-with-Advanced-Branch-Prediction"><a class="header-anchor" href="#6-3-Reducing-Branch-Costs-with-Advanced-Branch-Prediction">¶</a>6.3 Reducing Branch Costs with Advanced Branch Prediction</h3><p>Control Speculation——if mis-speculated:</p><ul><li>Recovery Mechanism</li><li>Squash instructions on the incorrect path</li></ul><p>Branch Prediction: Dynamic &amp; Static: 见5.3Control hazards部分</p><h3 id="6-4-Overcoming-Data-Hazards-with-Dynamic-Scheduling"><a class="header-anchor" href="#6-4-Overcoming-Data-Hazards-with-Dynamic-Scheduling">¶</a>6.4 Overcoming Data Hazards with Dynamic Scheduling</h3><p>The ID stage is divided into two parts</p><ul><li>checking for any structural hazard</li><li>waiting for the absence of a data hazard</li></ul><p>为了进一步提高运行效率，重排指令执行顺序，减少data hazards，可以按序发射，乱序执行(in-order issue, out-of-order execution)</p><ol><li><p>list all WAR and WAW hazards</p></li><li><p>dynamic scheduling</p><ul><li><p>Advantages:</p><ul><li>Compiler doesn't need to have knowledge of microarchitecture</li><li>Handle cases where dependencies are still unknown</li></ul></li><li><p>Disadvantages:</p><ul><li>More complex hardware</li><li>Complicates execptions</li></ul></li></ul></li></ol><h2 id="7-Memory-Hierarchy-Design"><a class="header-anchor" href="#7-Memory-Hierarchy-Design">¶</a>7 Memory Hierarchy Design</h2><h3 id="7-1-Cache-Organization"><a class="header-anchor" href="#7-1-Cache-Organization">¶</a>7.1 Cache Organization</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">flowchart TD</span><br><span class="line">Regfile---ITLB</span><br><span class="line">Regfile---DTLB</span><br><span class="line">ITLB---InstrCache</span><br><span class="line">DTLB---DataCache</span><br><span class="line">InstrCache---SRAM[&quot;Second Level Cache (SRAM)&quot;]</span><br><span class="line">DataCache---SRAM</span><br><span class="line">SRAM---DRAM[&quot;Main Memory (DRAM)&quot;]</span><br><span class="line">DRAM---Disk[&quot;Secondary Memory (Disk)&quot;]</span><br></pre></td></tr></table></figure><p>Principle of Locality: Programs tend to reuse data and instructions near those they have used recently, or those were recently referenced themselves.</p><ul><li>Temporal locality: Recently referenced items are likely to be referenced in the near future.</li><li>Spatial locality: Items with nearby addresses tend to be referenced close together in time.</li></ul><p>一个block的结构：</p><table border="1" cellspacing="0" cellpadding="6" style="border-collapse: collapse; text-align: center;">  <tr>    <th colspan="2">Block address</th>    <th rowspan="2">Block<br>offset</th>  </tr>  <tr>    <td>Tag</td>    <td>Index</td>  </tr></table>对于一个Four-Way Set Associative Cache，先通过Index定位到一个包含4个Block的组，再通过tag来找到（或者找不到）正确的block，然后再通过Block Offset找到正确的byte<p>Bits per row = Data Bits (Block Size in bits) +Tag Bits+Valid Bit</p><p>Cache大小的计算：如果一个32位block是22位tag，8位index，2位block offset，又是一个4-way cache，则：</p><ul><li>set的数量：2^8</li><li>每个set中block的数量：4=2^2</li><li>每个block中Byte的数量：2^2</li></ul><p>所以总大小：2^8^$\times$2^2^$\times$2^2^B=2^12^B=4KB</p><p>如果出现Miss的情况，需要替换掉一个block，LRU/FIFO/Random</p><p>Write strategy：</p><ul><li>write through：每次都写进cache和memory</li><li>write back：每次写进cache，只有在替换block的时候写进memory</li></ul><p>Handling</p><ul><li>Cache Hits<ul><li>Read hits: Just read it !</li><li>Write hits<ul><li>require the cache and memory to be consistent<ul><li>write through</li><li>slow</li><li>can use a write buffer or stall when write buffer is full</li></ul></li><li>allow cache and memory to be inconsistent<ul><li>write back</li><li>need dirty bit to tell whether or not required to write back to memory</li><li>can use a write buffer when writing back</li></ul></li></ul></li></ul></li><li>Cache Misses<ul><li>Read Misses: block size增加，miss penalty也增加；miss一个word要从memory获得一整个block<ul><li>一收到block中的word，不等block完全上传完就执行</li><li>需要的word先传，再传block剩下的部分</li><li>非阻塞式cache：处理器在cache在处理先前miss的时候还可以继续获取cache中的内容</li></ul></li><li>Write Misses: 先把block加载到cache，再写</li></ul></li></ul><p><strong>CPU Time = (CPU Execution Clock Cycles + Memory Stall Clock Cycles) $\times$ Cycle Time</strong></p><p>因此cache行为对CPU time影响很大</p><h3 id="7-2-Virtual-Memory"><a class="header-anchor" href="#7-2-Virtual-Memory">¶</a>7.2 Virtual Memory</h3><p>Virtual page number + page offset -&gt; physical page number + page offset</p><p>因为实际上是在page table里面的physical page里查找哪一个page number和请求的(virtual) page number一致，所以很费时间（查找）</p><p>使用TLB来解决这个问题（这一部分仅仅是用来找数据所在的地址，不找数据本身，找数据本身见7.1）</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">flowchart TD</span><br><span class="line">VPN[Virtual Page #]--&gt;|TLB hit|TLB[TLB]</span><br><span class="line">VPN--&gt;|TLB miss|PTR[&quot;Page Table&lt;br&gt;(Stored in physical memory)&quot;]</span><br><span class="line">TLB--&gt;Data[&quot;Data&lt;br&gt;in cache, memory or storage&quot;]</span><br><span class="line">PTR--&gt;Data</span><br><span class="line">VPN--&gt;|TLB miss and page fault|Data</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>TLB, Page Table查到的地址对应的数据可能存在cache，memory，storage里面</p><table><thead><tr><th>TLB</th><th>Page Table</th><th>Cache</th><th>Possible? Under what circumstances?</th></tr></thead><tbody><tr><td>Hit</td><td>Hit</td><td>Hit</td><td>Yes – what we want!</td></tr><tr><td>Hit</td><td>Hit</td><td>Miss</td><td>Yes – although the page table is not checked if the TLB hits</td></tr><tr><td>Miss</td><td>Hit</td><td>Hit</td><td>Yes – TLB miss, PA in page table</td></tr><tr><td>Miss</td><td>Hit</td><td>Miss</td><td>Yes – TLB miss, PA in page table, but data not in cache</td></tr><tr><td>Miss</td><td>Miss</td><td>Miss</td><td>Yes – page fault</td></tr><tr><td>Hit</td><td>Miss</td><td>Miss/ Hit</td><td>Impossible – TLB translation not possible if page is not present in memory</td></tr><tr><td>Miss</td><td>Miss</td><td>Hit</td><td>Impossible – data not allowed in cache if page is not in memory</td></tr></tbody></table><h3 id="7-3-Six-Basic-Cache-Optimizations"><a class="header-anchor" href="#7-3-Six-Basic-Cache-Optimizations">¶</a>7.3 Six Basic Cache Optimizations</h3><p>Average Memory Access Time = Hit Time + Miss Rate $\times$ Miss Penalty</p><ol><li><p>Reducing the miss rate</p><p>Larger block size, larger cache size, higher associativity</p></li><li><p>Reducing the miss penalty</p><p>Multilevel caches, giving reads priority over writes</p></li><li><p>Reducing the time to hit in the cache</p><p>Avoiding address translation when indexing the cache</p></li></ol><p>Three Categories of Misses</p><ul><li><p>Compulsory</p><p>The very first access to a block cannot be in the cache</p></li><li><p>Capacity</p><p>If the cache cannot contain all the blocks needed during execution of a program, capacity misses occur</p></li><li><p>Conflict</p><p>In case of set associative and direct mapped, conflict misses occur. Different blocks mapped onto the same place</p></li></ul><p>Six Basic Cache Optimizations</p><table><thead><tr><th>方法 \ 影响</th><th>Compulsory Miss</th><th>Capacity Miss</th><th>Conflict Miss</th><th>Hit Time</th><th>Power Consumption</th><th>Miss Penalty</th></tr></thead><tbody><tr><td><strong>Larger block size</strong></td><td>⬇️</td><td>⬆️</td><td>⬆️</td><td>—</td><td>—</td><td>⬆️</td></tr><tr><td><strong>Larger total cache capacity</strong></td><td>—</td><td>⬇️</td><td>—</td><td>⬆️</td><td>⬆️</td><td>—</td></tr><tr><td><strong>Higher associativity</strong></td><td>—</td><td>—</td><td>⬇️</td><td>⬆️</td><td>⬆️</td><td>—</td></tr><tr><td><strong>Higher number of cache levels</strong></td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>⬇️ (access time)</td></tr><tr><td><strong>Giving priority to read misses over writes</strong></td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>⬇️</td></tr><tr><td><strong>Avoiding address translation in cache indexing</strong></td><td>—</td><td>—</td><td>—</td><td>⬇️</td><td>—</td><td>—</td></tr></tbody></table><ul><li><p>Higher associativity</p><p>more potential place to store data, thus reducing conflict misses</p></li><li><p>Giving priority to read misses over writes</p><p>Usually has a write buffer, so write can wait</p></li><li><p>Avoid address translations</p><p>让cache直接使用虚拟地址访问，省去翻译的步骤，但是也有问题：</p><ul><li>不同正在运行的进程的虚拟地址相互干扰</li><li>进程切换的时候，需要flush cache</li><li>不同的虚拟地址可能映射到同一个物理地址（alias/synonym），写数据的时候可能导致数据不同步</li></ul><p>因此，折中一下，使用VIPT：Virtually Indexed, Physically Tagged</p><p>要求：一页只能映射到一个Cache Set</p><p>例如一个4-way的cache</p><ol><li>利用虚拟地址的低位部分（页内偏移），它包含了 cache 的 set index 和 block offset，所以可以立刻查 cache 的某一个set，把里面所有4个block的tag 提取出来</li><li>用VPN查找到了PPN，获得了物理地址的tag</li><li>对比两个tag，判断是否命中，命中就返回，未命中就Cache Miss，进一步访问memory</li></ol><p>Limits: Cache Size = page size $\times$ associativity</p><table border="1" cellspacing="0" cellpadding="6" style="border-collapse: collapse; text-align: center;">    <tr>      <th>Virtual Page Number</th>      <th colspan="2">Page offset</th>    </tr>    <tr>      <td>Tag (Physical Page Number)</td>      <td>Index</td>      <td>Block offset</td>    </tr>  </table></li></ul><p><strong>cache size = number of sets $\times$ associativity (number of block in a set) $\times$ block size = 2^index^ ^bits^$\times$ N $\times$ 2^byte^ ^offset^ ^bits^</strong></p><p><strong>minimum page size = cache size $\div$ associativity = number of sets$\times$ block size = 2^index^ ^bits^ $\times$ 2^byte^ ^offset^ ^bits^</strong></p><h3 id="7-4-Ten-Advanced-Optimizations-of-Cache-Performance"><a class="header-anchor" href="#7-4-Ten-Advanced-Optimizations-of-Cache-Performance">¶</a>7.4 Ten Advanced Optimizations of Cache Performance</h3><ol><li><p>Small and simple first level caches</p></li><li><p>Way Prediction</p></li><li><p>Pipelining Cache</p></li><li><p>Nonblocking Caches (allow hits before previous misses complete)</p></li><li><p>Multibanked Caches (support simultaneous access)</p></li><li><p>Critical Word First, Early Restart</p><ul><li>critical word first: 先去请求关键字给CPU</li><li>early restart: 按顺序请求，一到关键字就不等读完立即给CPU</li></ul></li><li><p>Merging Write buffer: 如果要写入的字已经在write buffer里面了，直接更新write buffer</p></li><li><p>Compiler Optimizations: 例如矩阵的读取，从左右上下变为上下左右</p></li><li><p>Hardware Prefetching: utilizing memory bandwidth that otherwise would be unused</p></li><li><p>Compiler Prefetching: Insert prefetch instructions before data is needed (register/cache)</p></li></ol><h3 id="7-5-Memory-Technology-and-Optimizations"><a class="header-anchor" href="#7-5-Memory-Technology-and-Optimizations">¶</a>7.5 Memory Technology and Optimizations</h3><p>performance merits: Latency &amp; Bandwidth</p><p>SRAM (mainly for cache) complex, costly</p><p>DRAM (mainly for memory) simple, cheaper than SRAM</p><p>Flash Memory: type of EEPROM</p><p>new trends: NVM(Non-Volatile Memory)</p><h2 id="8-Data-Level-Parallelism"><a class="header-anchor" href="#8-Data-Level-Parallelism">¶</a>8 Data-Level Parallelism</h2><h3 id="8-1-Introduction"><a class="header-anchor" href="#8-1-Introduction">¶</a>8.1 Introduction</h3><p>见1.2最后Flynn’s Classification</p><p>SISD，MISD(x)，SIMD，MIMD</p><p>SIMD advantages:</p><ul><li>exploit data-level parallelism</li><li>more energy efficient</li><li>more comfortable for programmers</li></ul><h3 id="8-2-Vector-Architecture"><a class="header-anchor" href="#8-2-Vector-Architecture">¶</a>8.2 Vector Architecture</h3><p>basic idea:</p><ul><li>Read sets of data elements into “vector registers”</li><li>Operate on those registers</li><li>Disperse the results back into memory</li></ul><p>Architecture: VMIPS</p><ul><li>vector registers<ul><li>containing 64 elements, each elements have 64 bits</li><li>16 read ports and 8 write ports (read/write an element at a time)</li></ul></li><li>Vector functional units<ul><li>Fully pipelined</li><li>Data and control hazards are detected</li></ul></li><li>Vector load-store unit<ul><li>Fully pipeline</li><li>One word per clock cycle after initial latency</li></ul></li><li>Scalar registers<ul><li>32 general-purpose registers</li><li>32 floating-point registers</li></ul></li></ul><p>for vector arithmetic execution</p><ul><li>use deeper pipeline</li><li>simplify control pf deep pipeline because elements in vector are independent and thus no hazards</li></ul><p>Execution time of a sequence of vector operations</p><p>depends on three factors:</p><ul><li>Length of operand vectors</li><li>Structural hazards</li><li>Data dependencies</li></ul><p>Use Vector Length Register (VLR) to control</p><p>the length of any vector operation, including a</p><p>vector load and store</p><p>Vector Mask Registers：选择哪些bit参与运算</p><p>most vector processors use memory banks to allow multiple independent accesses</p><h3 id="8-3-SIMD-Instruction-Set-Extension"><a class="header-anchor" href="#8-3-SIMD-Instruction-Set-Extension">¶</a>8.3 SIMD Instruction Set Extension</h3><p>折中一下，Vector Architecture又贵又难造</p><p>用SIMD指令在普通结构的机器上达到近似Vector Machine 的效果</p><p>很多指令加上类似“.4D”，表示一次处理4个double类型的数据</p><h3 id="8-4-GPU-Graphic-Processing-Unit"><a class="header-anchor" href="#8-4-GPU-Graphic-Processing-Unit">¶</a>8.4 GPU (Graphic Processing Unit)</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">flowchart TD</span><br><span class="line">VG[Vertex Generation]--&gt;VP[Vertex Processing]</span><br><span class="line">VP--&gt;PG[Primitive Generation]</span><br><span class="line">PG--&gt;PP[Primitive Processing]</span><br><span class="line">PP--&gt;FG[Fragment Generation]</span><br><span class="line">FG--&gt;FP[Fragment Processing]</span><br><span class="line">FP--&gt;PO[Pixel Operations]</span><br></pre></td></tr></table></figure><p>CUDA （Compute Unified Device Architecture）<br>highly parallel</p><figure class="highlight txt"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">          Grid</span><br><span class="line">┌─────────────────────────────┐</span><br><span class="line">│    Block 0      Block 1     │ ← 一整个 Grid 中有多个 Block</span><br><span class="line">│  ┌──────────┐  ┌──────────┐ │</span><br><span class="line">│  │ Thread x │  │ Thread x │ │ ← 每个 Block 有多个 Thread</span><br><span class="line">│  │ Thread y │  │ Thread y │ │</span><br><span class="line">│  └──────────┘  └──────────┘ │</span><br><span class="line">└─────────────────────────────┘</span><br></pre></td></tr></table></figure><p>1个函数就是1个kernel，对应1个grid，grid之下有多个block，block之中有多个thread</p><p>block之间数据不共享，thread之间数据共享</p><p>block是调度单位，thread是运算单位，一般性一个block内最多1024个thread</p><p>例如：</p><p>一个函数，要把8192位数据取反，实际上这个函数就是一个kernel，对应到了一个grid，grid里可以分成8个block，每一个SM拿一个block去运行，每个SM（Streaming Multiprocessor）内部则是1024个线程同时运行</p><table><thead><tr><th style="text-align:center">Memory Type</th><th style="text-align:center">R/W</th><th style="text-align:center">Work for</th><th style="text-align:center">Location</th><th style="text-align:center">Speed</th></tr></thead><tbody><tr><td style="text-align:center"><strong>Registers</strong></td><td style="text-align:center">RW</td><td style="text-align:center">per thread</td><td style="text-align:center">GPU registers</td><td style="text-align:center">🚀 Fastest</td></tr><tr><td style="text-align:center"><strong>Local Memory</strong></td><td style="text-align:center">RW</td><td style="text-align:center">per thread</td><td style="text-align:center">Global memory</td><td style="text-align:center">🐢 Slow <code>&lt;br&gt;</code>(stored in global memory)</td></tr><tr><td style="text-align:center"><strong>Shared Memory</strong></td><td style="text-align:center">RW</td><td style="text-align:center">per block</td><td style="text-align:center">On-chip (SM)</td><td style="text-align:center">⚡ Fast``(low latency, manually managed)</td></tr><tr><td style="text-align:center"><strong>Global Memory</strong></td><td style="text-align:center">RW</td><td style="text-align:center">per grid</td><td style="text-align:center">Off-chip on GPU DRAM</td><td style="text-align:center">🐌 Slowest``(high latency)</td></tr><tr><td style="text-align:center"><strong>Constant Memory</strong></td><td style="text-align:center">R</td><td style="text-align:center">per grid</td><td style="text-align:center">Off-chip on GPU DRAM`` (with read cache)</td><td style="text-align:center">⚡ Fast for broadcast``(cached)</td></tr><tr><td style="text-align:center"><strong>Texture Memory</strong></td><td style="text-align:center">R</td><td style="text-align:center">per grid</td><td style="text-align:center">Off-chip on GPU DRAM``(with texture cache)</td><td style="text-align:center">⚡ Fast``optimized for spatial access</td></tr></tbody></table><p>这里的R指的是对于kernel来说R，可以通过CPU通过CUDA-API写入</p><p>每个kernel支持1，2，3维，可以选择启用几个维度</p><p>warp: SM指挥warp，一个warp一次可以执行32个线程。warp之内的线程是并行的，warp之间的运作类似round robin</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;1-Fundamentals-of-Computer-Science&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-Fundamentals-of-Computer-Science&quot;&gt;¶&lt;/a&gt;1 Fundamentals of Compu</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>计算机科学中的数学基础整理</title>
    <link href="https://ryanstarfox.github.io/2025/06/17/2025/20250617%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%E4%B8%AD%E7%9A%84%E6%95%B0%E5%AD%A6%E5%9F%BA%E7%A1%80/"/>
    <id>https://ryanstarfox.github.io/2025/06/17/2025/20250617%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%A7%91%E5%AD%A6%E4%B8%AD%E7%9A%84%E6%95%B0%E5%AD%A6%E5%9F%BA%E7%A1%80/</id>
    <published>2025-06-17T05:42:00.000Z</published>
    <updated>2025-06-20T05:42:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="1-Set-and-ordering"><a class="header-anchor" href="#1-Set-and-ordering">¶</a>1 Set and ordering</h2><h3 id="1-1-Sets-relations-and-functions"><a class="header-anchor" href="#1-1-Sets-relations-and-functions">¶</a>1.1 Sets, relations and functions</h3><ul><li>计算：$A\cup B, A\cap B,A-B,\bar A, A\oplus B$<ul><li>“-”例子：${1,3,5}-{1,2,3}={5}$</li><li>“$\oplus$”对称差：类似于异或，$A\oplus B=(A-B)\cup(B-A)$，$A\oplus B\oplus C = \sum(A-B-C)+A\cap B\cap C$</li></ul></li><li>幂集 Power Set $P(S)={s|s\subseteq S}$</li><li>笛卡尔积 Cartesian Product: $A\times B={&lt;x,y&gt;|x\in A\wedge y\in B}$，是有序对！</li><li>关系是有序对的集合，有三种可能的性质<ul><li>反身性 Reflexive，if $(\forall a\in x)(aRa) $</li><li>对称性 Symmetric，if$( \forall a,b\in x)(aRb\rightarrow bRa)$</li><li>传递性 Transitive，if $(\forall a,b,c\in x)[(aRb\wedge bRa)\rightarrow aRc]$</li></ul></li><li>划分 Partition：$\pi$的一个划分是一个集合的集合$A$，$A$中的集合两两没有共同元素，$\pi$中所有元素可以在$A$的元素中找到</li><li>等价类 Equivalence class<ul><li>等价关系：满足自反性、对称性、传递性</li><li>商集$A/R$把$A$根据关系$R$分类（事实上，R必须是等价关系）</li><li>等价类就是关于某一个等价关系$R$做商集运算</li><li>例：模6同余的等价关系</li></ul></li><li>函数 Function<ul><li>单射 injective: $x\ne y\rightarrow F(x)\ne F(y)$</li><li>满射 surjective: $ran\ F=B$</li><li>一一映射/双射 bijective function: 单射且满射</li></ul></li></ul><h3 id="1-2-Paradox-Cardinality"><a class="header-anchor" href="#1-2-Paradox-Cardinality">¶</a>1.2 Paradox &amp; Cardinality</h3><ul><li><p>理发师悖论$\rightarrow$罗素提出没有一个包含所有集合的集合</p></li><li><p>集合大小相等（等势）：集合之间存在一一映射关系</p><ul><li><p>$\omega\times\omega\approx\omega$，$\omega$为最小的无限序数（自然数集）</p></li><li><p>$\omega\approx \mathbb Q$</p></li><li><p>$(0,1)\approx \R=(n,m)=(0,1]=[0,1)=[0,1]$</p><ul><li><p>proof for [0,1]=[0,1):</p><p>$f(x)=\begin{cases}x&amp;0\leq x&lt;1\wedge x\ne\dfrac1{2^n}\\dfrac1{2^{n+1}}&amp;x=\dfrac1{2^n}\end{cases}$</p></li></ul></li><li><p>没有集合和自己的幂集等势</p></li></ul></li><li><p>无限集合大小的比较</p><ul><li>$A\preccurlyeq B\iff A与B的一个子集等势$</li><li>$A\preccurlyeq B\wedge B\preccurlyeq A\Rightarrow A\approx B$</li><li>$2^{\alef_0}\leq\alef_0\cdot2^{\alef_0}\leq2^{\alef_0}\cdot2^{\alef_0}=2^{\alef_0}\ \therefore2^{\alef_0}\approx\alef_0\cdot2^{\alef_0}$</li></ul></li><li><p>可数集：有限或者与自然数集等势</p><ul><li>可数集的子集、并集、笛卡尔积都是可数集</li></ul></li></ul><h3 id="1-3-Orderings-序"><a class="header-anchor" href="#1-3-Orderings-序">¶</a>1.3 Orderings 序</h3><ul><li><p>偏序：偏序集</p><p>$$<br>(S,R)<br>$$</p><p>: $R$是集合$S$上的偏序关系</p></li><li><p>线性序：任意两个元素均可作比较</p></li><li><p>立即前元：直接的更小的元素，$x$是$y$的直接前元，$x\triangleleft y$</p><ul><li>$x\prec y$</li><li>$\neg(\exists z\in S)(x\prec z\prec y)$</li></ul></li><li><p>极大元、极小元、最大元、最小元</p></li><li><p>有限偏序必含极小（大）元</p></li><li><p>线性扩充定理：对有限偏序集$（S,\preccurlyeq)$，存在线性序集$(S,\preccurlyeq')满足x\preccurlyeq y\to x\preccurlyeq'y$</p><p>一般地，线性扩充不唯一（类似对于哈斯图作拓扑排序）</p></li></ul><h3 id="1-4-Wide-or-Tall-Mirsky-s-theorem-and-Dilworth-s-theorem"><a class="header-anchor" href="#1-4-Wide-or-Tall-Mirsky-s-theorem-and-Dilworth-s-theorem">¶</a>1.4 Wide or Tall - Mirsky's theorem and Dilworth's theorem</h3><ul><li><p>链（可比较元素的集合，高）：$\forall x,y\in A, x\preccurlyeq y或者y\preccurlyeq x$，特别地，$\omega(P)=max{|A|:A是P上的链}$</p></li><li><p>反链（不可比较元素的集合，宽）：$\forall x\ne y\in A,x\cancel\preccurlyeq y$,也称独立集，特别地，$\alpha(P)=max{|A|:A是P上的反链（独立集）}$</p></li><li><p>Mirsky's theorem定理：最长链长度=最小反链划分数</p><p>推论：$对于P=(S,\preccurlyeq),\alpha(P)\cdot\omega(P)\geq |S|$</p><p>应用：</p><p>Erdös-Szekeres引理：任意含有$n^2+1$个元素的实数序列$（x_1,\cdots,x_{n^2+1})z$中都含有一个长度为$n+1$的单调子序列</p></li><li><p>Dilworth定理：最长反链长度=最小链划分<br>$P为有限集，min{m:\exists\ chains C_1,C_2,\cdots,\ C_m\ with P = \bigcup\limits_{i=1}^m C_i}=max{|A|:A\ is\ an\ anti-chain}$</p></li></ul><h2 id="2-Combinatorics"><a class="header-anchor" href="#2-Combinatorics">¶</a>2 Combinatorics</h2><h3 id="2-1-Combinatorial-Counting"><a class="header-anchor" href="#2-1-Combinatorial-Counting">¶</a>2.1 Combinatorial Counting</h3><table><thead><tr><th style="text-align:center"><strong>balls per bin</strong></th><th style="text-align:center"><strong>unrestricted</strong></th><th style="text-align:center"><strong>≤1</strong></th><th style="text-align:center"><strong>≥1</strong></th></tr></thead><tbody><tr><td style="text-align:center">$n$ distinct balls <code>&lt;br&gt;</code>$m$ distinct bins</td><td style="text-align:center">$m^n$</td><td style="text-align:center">$(m)_n$</td><td style="text-align:center">$m!{\begin{smallmatrix}n\m\end{smallmatrix}}$</td></tr><tr><td style="text-align:center">$n$ identical balls``$m$ distinct bins</td><td style="text-align:center">$\binom{n+m-1}{m-1}$</td><td style="text-align:center">$\binom mn$</td><td style="text-align:center">$\binom{n-1}{m-1}$</td></tr><tr><td style="text-align:center">$n$ distinct balls``$m$ identical bin</td><td style="text-align:center">$\sum\limits_{k=1}^m {\begin{smallmatrix}n\k\end{smallmatrix}}$</td><td style="text-align:center">$\begin{cases} 1 &amp; n\leq m\0&amp;n&gt;m\end{cases}$</td><td style="text-align:center">${\begin{smallmatrix}n\m\end{smallmatrix}}$</td></tr><tr><td style="text-align:center">$n$ identicql balls``$m$ identical bins</td><td style="text-align:center">$\sum\limits_{k=1}^mp_k(n)$</td><td style="text-align:center">$\begin{cases} 1 &amp; n\leq m\0&amp;n&gt;m\end{cases}$</td><td style="text-align:center">$p_m(n)$</td></tr></tbody></table><ul><li><p>$(m)_n=\dfrac{m!}{(m-n)!}$</p></li><li><p>$\binom nk=\dfrac{n!}{k!\cdot(n-k)!}$</p></li><li><p>$\binom{n-1}{k-1}+\binom{n-1}k=\binom nk$</p><ul><li>$\sum\limits_{k=0}^n\binom km=\binom{n+1}{m+1}$</li><li>$\sum\limits_{k=0}^n\binom{m+k-1}k=\binom{n+m}n$</li><li>$\sum\limits_{i=0}^n\binom ni^2=\sum\limits_{i=0}^n\binom ni\binom n{n-i}=\binom{2n}n$</li><li>$\binom{m+n}r=\sum\limits_{k=0}^r\binom mk\binom n{r-k}$</li><li>$\binom{n_1+\cdots+n_p}m=\sum\limits_{k_1+\cdots+k_p}\prod\limits_{i=1}^p\binom{n_i}{k_i}$</li></ul></li><li><p>Binomial theorem:</p><p>$(1+x)^n=\sum\limits_{k=0}^n\binom nkx^k$</p><p>$if\ \left |x\right |&gt;\left | y\right |,\ (x+y)^r=\sum\limits_{k=0}^\infty\binom rk x^{r-k}y^k$</p></li><li><p>second Stirling Numbers</p><ul><li>The number of ways to partition a set of $n$ things into $k$ nonempty subsets</li><li>${\begin{smallmatrix}n\k\end{smallmatrix}}=k{\begin{smallmatrix}n-1\k\end{smallmatrix}}+{\begin{smallmatrix}n-1\k-1\end{smallmatrix}}$，specifically, ${\begin{smallmatrix}n\2\end{smallmatrix}}=2^{n-1}-1$</li></ul></li><li><p>Stirling cycle numbers (first Stirling Numbers)</p><ul><li>The number of ways to partition a set of $n$ things into $k$ nonempty cycles</li><li>$[\begin{smallmatrix}n\k\end{smallmatrix}]\geq {\begin{smallmatrix}n\k\end{smallmatrix}}$</li><li>$[\begin{smallmatrix}n\1\end{smallmatrix}]=(n-1)!$</li><li>$\sum\limits_{k=0}^n[\begin{smallmatrix}n\k\end{smallmatrix}]=n!$</li><li>$[\begin{smallmatrix}n\k\end{smallmatrix}]=(n-1)\cdot[\begin{smallmatrix}n-1\k\end{smallmatrix}]+[\begin{smallmatrix}n-1\k-1\end{smallmatrix}]$</li></ul></li><li><p>Partition of a number</p><ul><li>number of partition the positive integer $n$ into $k$ parts</li><li>$P_k(n)=P_{k-1}(n-1)+P_k(n-k)$</li><li>$\sum\limits_{k=1}^m P_k(n)=P_m(n+m)$</li></ul></li></ul><h3 id="2-2-Inclusion-exclusion-principle-and-its-application"><a class="header-anchor" href="#2-2-Inclusion-exclusion-principle-and-its-application">¶</a>2.2 Inclusion-exclusion principle and its application</h3><p>$$\left|\bigcup\limits_{i=1}^nA_i\right|=\sum\limits_{k=1}^n(-1)^{k-1}\sum\limits_{I\in C({1,2,\cdots,n},k)}\left |\bigcap\limits_{i\in I}A_i\right|$$</p><p>$$=\sum\limits_{\emptyset\neq I\subseteq{1,2,\cdots,n}}(-1)^{\left | I \right |-1}\left|\bigcap\limits_{i\in I}A_i\right|$$</p><p>错排公式：没有一个在原来的位置上<br>$D(n)=n!-\left | A_1\cup\cdots\cup A_n\right |=n!\left (\sum\limits_{k=0}^n \dfrac {(-1)^k}{k!}\right )$</p><p>欧拉函数：不超过$n$且与$n$互素的自然数的个数</p><p>$\varphi(n)=n\prod\limits_{p_i为n的质因数}\left(1-\dfrac 1p_i\right)$</p><h3 id="2-3-Generating-function"><a class="header-anchor" href="#2-3-Generating-function">¶</a>2.3 Generating function</h3><p>Catalan Number</p><p>$C_n=\dfrac1{n+1}\binom{2n}n$</p><h3 id="2-4-Recurrence-relations"><a class="header-anchor" href="#2-4-Recurrence-relations">¶</a>2.4 Recurrence relations</h3><p>注意首项要带入验算</p><h3 id="2-5-Polya-s-Theory-of-Counting"><a class="header-anchor" href="#2-5-Polya-s-Theory-of-Counting">¶</a>2.5 Polya's Theory of Counting</h3><ol><li><strong>Orbits:</strong> $if\ x\in X\ then\ O_x={y\in X:\exists g \in G \ such\ that\ g*x=y}$</li><li>**Stabilizer: **$S_x={g:g*x=x}$</li><li>**Lemma1: **$The\ orbits\ partition\ X$</li><li>**Lemma2: **$x\in X\ then\left|O_x\right|\left|S_x\right |=\left | G\right|$</li><li><strong>Theorem 1:</strong> $\nu_{X,G}=\dfrac1{\left |G\right |}\sum\limits_{x\in X}\left| S_x\right |,\nu_{X,G}\ denote\ number\ of\ orbits$</li><li><strong>Theorem 2:</strong> $\nu_{X,G}=\dfrac1{\left |G\right |}\sum\limits_{g\in G}\left| Fix\left( g\right )\right |,\ for\ g\in G\ let\ Fix(g)={x\in X:g*x=x}$</li></ol><p>本质上：两种数法</p><ol><li>固定颜色的排列，看看它的permutation有几种</li><li>固定operator，看看不变的颜色（stablizer）有几种</li></ol><h3 id="2-6-估值"><a class="header-anchor" href="#2-6-估值">¶</a>2.6 估值</h3><ol><li><p>调和级数估值：$\dfrac12\lfloor\log_2n\rfloor&lt;\sum\limits_{i=1}^n\dfrac1i=H_n&lt;\log_2n+1,\ \therefore H_n=\Theta(\ln n)$</p></li><li><p>阶乘估值（大小为$n$的集合$X$，其上的置换一共有$n!$个）</p><ol><li>极值点估值：$2^n&lt;\left(\dfrac n2\right)^\dfrac n2&lt;\prod\limits_{i=n/2}^n\dfrac n2=n!&lt;n^n$</li><li>高斯估值（均值不等式）:$n^{\frac n2}=\prod\limits_{i=1}^n\sqrt n\leq\prod\limits_{i=1}^n\sqrt{i(n+1-i)}=\left (\sqrt{\prod\limits_{i=1}^n i(n+1-i)}=\sqrt{n!\cdot n!}=n!\right )\leq\prod\limits_{i=1}^n\dfrac{n+1}2=\left(\dfrac{n+1}2\right)^n$</li><li>进一步优化，使用$1+x≤e^x$与归纳，得到$e\left(\dfrac ne\right)^n\leq n\leq en\left(\dfrac ne\right)^n$</li></ol><p>事实上，Stirling公式：$\lim\limits_{n\to \infty}\dfrac{\sqrt{2\pi n}(\frac ne)^n}{n!}=1$</p></li><li><p>二项式系数估值：$\left (\dfrac nk\right)^k\leq\binom nk\leq\sum\limits_{i=0}^k\binom ni\leq(\dfrac{en}k)^k$，右边的证明利用二项式定理+赋值$x=\dfrac kn$</p></li></ol><h2 id="3-Graph-theory-图论"><a class="header-anchor" href="#3-Graph-theory-图论">¶</a>3 Graph theory 图论</h2><h3 id="3-1-Basic-notions-and-hand-shaking-lemma"><a class="header-anchor" href="#3-1-Basic-notions-and-hand-shaking-lemma">¶</a>3.1 Basic notions and hand shaking lemma</h3><ol><li><p>图的最小度$\delta(G)$，最大度$\Delta G$</p></li><li><p>子图：边集和点集都是子集</p><ol><li>导出子图（induced subgraph）：子图中的点集在原图中的边，都是子图的边</li><li>生成子图 （spanning subgraph）：子图和原图的点集相等</li></ol></li><li><p>特殊图</p><ol><li>路径图（Path P~n~)：$V={0,1,\cdots,n}$</li></ol><p>$E={(i-1,i):i=1,2,\cdots,n}$<br>2. 环（Circle C~n~）：$V={0,1,\cdots,n}$</p><p>$E={(i,i+1):i=1,2,\cdots,n-1}\cup{(1,n)}$<br>3. 二分图（Bipartite graph B~n,m~）：$V={u_1,\cdots,u_n}\cup{v_1,\cdots,v_m}$</p><p>$E\subseteq{(u_i,v_j):i=1,2,\cdots,n;\ j=1,2,\cdots,m}$</p><p>其中$\subseteq$取等号时，为完全二分图（Complete Bipartite graph K~n,m~）<br>4. 完全图：（Complete graph K~n~）<br>5. r-正则图（r-regular graph）：所有顶点度数都是常值r的图<br>6. 简单图（Simple Graph）：没有自环（Loop）、重边（Multiedge）<br>7. $\begin{cases}路径(Path)：不允许环，各顶点和边各出现一次\游走(Walk)：允许环，顶点和边可以重复\end{cases}$<br>8. 连通图：任两点存在路径<br>9. 极大连通子图：子图；连通图；极大<br>10. 树；无环连通图</p></li><li><p>握手定理：$\sum\limits_{v\in V}deg_G(v)=2\left | E\right|$奇点有偶数个</p></li></ol><h3 id="3-2-Graph-isomorphism-and-graph-score"><a class="header-anchor" href="#3-2-Graph-isomorphism-and-graph-score">¶</a>3.2 Graph isomorphism and graph score</h3><ol><li><p>有$n$个顶点且不同构的图有$x$个，则$\dfrac{2^\binom n2}{n!}\leq x\leq2^\binom n2$，所以$x=2^{\Theta(\frac{n^2}2)}$</p></li><li><p>Graph score: the degree sequence of  G</p><p>Isomorphic graphs $\Rightarrow$ The same scores</p><p>The same scores $\nRightarrow$ Isomorphic graphs</p></li><li><p>Score Theroem：去掉度数最高的点，前最高点数的点度数减一，可以画图性不变</p><p>$D=(d_1,d_2,\cdots,d_n)，d_1\leq d_2\leq\cdots\leq d_n$</p><p>$d'=\begin{cases}d_i&amp;i&lt;n-d_n\d_i-1&amp;i\geq n-d_n\end{cases}$</p><p>$D与D'可画图性一致$</p></li></ol><h3 id="3-3-Applications-of-handshake-lemma-Parity-argument"><a class="header-anchor" href="#3-3-Applications-of-handshake-lemma-Parity-argument">¶</a>3.3 Applications of handshake lemma: Parity argument</h3><ol><li>Sperner's Lemma：对任意𝑛维单形体(𝑛-simplex)进行分割并用𝑛 + 1种颜色去着色，则任何合适的单形体分割着色方案下，都必有一个包含所有不同颜色的单元。</li><li>对于3-正则图，包含图上任意边$e$的哈密顿回路必有偶数条</li></ol><h3 id="3-5-Isomorphism-of-trees"><a class="header-anchor" href="#3-5-Isomorphism-of-trees">¶</a>3.5 Isomorphism of trees</h3><ol><li><p>叶子：度数为1的顶点</p></li><li><p>树生长定义：对于图$G$的叶子节点$v$，图$G$是树$\Leftrightarrow$图$G-v$是树</p></li><li><p>树的等价刻画：</p><ol><li>图$G$是树。</li><li>路径唯一：对任意两点 $ u, v \in V$，存在从$u$到$v$的唯一路径。</li><li>最小连通图：$G$是连通图，且去掉任意一条边后都成为非连通图。</li><li>最大无环图：$G$不含环，但增加任何一条边所得到的图$G + e $（其中$e \in \binom{V}{2} \setminus E $）中含有一个环。</li><li>Euler 方程：$ G $ 是连通图，且 $ |V| = |E| + 1 $。</li></ol></li><li><p>证明顶点数为$n$的不同构树有$n^{n-2}$</p><ol><li><p>Score硬算，化简得到</p></li><li><p>骨骼标本与V上的函数图一一对应，每棵树对应n~2~个骨骼标本$\dfrac {n^n}{n^2}=n^{n-2}$</p></li><li><p>Prüfer code（逐个记录目前编号最小的叶子的祖先节点）与树一一对应$n^{n-2}$</p></li><li><p>Determinants：G的拉普拉斯矩阵：$a_{ij}=\begin{cases}-1&amp;{i,j}\in E(G)\deg_G(i)&amp;i=j\0&amp;otherwise\end{cases}$</p><p>$T(G)=T(G-e)+T(G:e)=\det Q_{11}'+\det Q_{11}''=\det Q_{11}$</p></li></ol></li></ol><h3 id="3-4-The-number-of-spanning-trees"><a class="header-anchor" href="#3-4-The-number-of-spanning-trees">¶</a>3.4 The number of spanning trees</h3><ol><li><p>树同构</p><ol><li>有根树同构$\cong'$，编码（非根叶节点01，每个个节点的编码都是0+所有子树编码+1）后字典序排序即可</li><li>无根树同构$\cong$<ol><li>一些概念<ol><li>两点距离：最短路径长度$dis_G(u,v)$</li><li>一点偏心率：该点与其他点最大距离$ex_G(v)$</li><li>中心：偏心率最小的顶点集合$C(G)$，对于树而言，该集合大小为1或者2</li></ol></li><li>解法<ol><li>找到中心</li><li>中心集合大小为1，其为根，转化为有根树</li><li>中心集合大小为2，去掉中心两点的连线，转化为两棵有根树</li></ol></li></ol></li></ol></li></ol><h2 id="4-概率论-The-probabilistic-method"><a class="header-anchor" href="#4-概率论-The-probabilistic-method">¶</a>4 概率论 The probabilistic method</h2><h3 id="4-1-Probability-a-quick-review"><a class="header-anchor" href="#4-1-Probability-a-quick-review">¶</a>4.1 Probability: a quick review</h3><ol><li><p>$P(E|F)=\dfrac{P(E\cap F)}{P(F)}$，若独立，则$P(E|F)=P(E)$</p></li><li><p>全概率公式 Law of total probability: $P(B)=\sum P(B|E_i)P(E_i)$</p></li><li><p>条件独立 Conditionally Independent: $P(A\cap B|C)=P(A|C)\cdot P(B|C)$</p></li><li><p>贝叶斯定理 Bayes Rules: $P(B|A)=\dfrac{P(AB)}{P(A)}=\dfrac{P(A|B)P(B)}{P(A)}$</p></li><li><p>$E(X)+E(Y)=E(X+Y)$</p><p>$D(X)(Var(X))=E((X-E[X])^2)=E[X^2]-E[X]^2$</p><table><thead><tr><th>分布</th><th>分布律或概率密度</th><th>期望</th><th>方差</th></tr></thead><tbody><tr><td>0-1分布$B(1,p)$</td><td>$P(X=k)=p^k(1-p)^{1-k},\quad k=0,1,\quad 0&lt;p&lt;1$</td><td>$p$</td><td>$p(1−p)$</td></tr><tr><td>二项分布$B(n,p)$</td><td>$P(X=k)=C_{n}^{k}p^{k}(1-p)^{n-k},\quad k=0,1,2,...,n,\quad 0&lt;p&lt;1 $</td><td>$np$</td><td>$np(1−p)$</td></tr><tr><td>泊松分布$P(\lambda)$</td><td>$P(X=k)=\frac{\lambda ^{k}}{k!}e^{-λ},\quad \quad k=0,1,2,...,\quad λ&gt;0$</td><td>$\lambda$</td><td>$\lambda$</td></tr><tr><td>几何分布$G(p)$</td><td>$P(X=k)=p(1-p)^{k-1}, k=1, 2, \cdots, 0&lt;p&lt;1$</td><td>$\frac{1}{p}$</td><td>$\frac{1-p}{p^{2}}$</td></tr><tr><td>指数分布$E(\lambda)$</td><td>$f(x)=\left {\begin{matrix} \lambda e^{-\lambda x}, &amp;x&gt;0\ 0, \end{matrix} \right.$其他</td><td>$\frac{1}{\lambda}$</td><td>$\frac{1}{\lambda^{2}}$</td></tr><tr><td>正态分布$N(\mu, \sigma^{2})$</td><td>$f(x, y)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}, -\infty &lt;x&lt;+\infty, -\infty &lt;\mu &lt;+\infty, \sigma &gt;0$</td><td>$\mu$</td><td>$\sigma^{2}$</td></tr></tbody></table></li><li><p>概率的估算</p><ol><li>Markov's Inequality: $X$ is a random variable that assumes only non-negtive values, $P(X\geq a)\leq\dfrac{E[X]}a$</li><li>Chebyshev's Inequality: $P(\left|X-E[X]\right|\geq a)\leq\dfrac{Var[X]}{a^2}$</li><li>变形：$P(X\geq a)=P_{min}(e^{tX}\geq e^{ta})\leq \min\limits_{t&gt;0}\dfrac{E(e^{tX})}{e^{t\cdot a}}$</li><li>Union bound：并集不等式</li></ol></li></ol><h3 id="4-2-Probabilistic-method"><a class="header-anchor" href="#4-2-Probabilistic-method">¶</a>4.2 Probabilistic method</h3><ol><li><p>Ramsey number</p><p>if $\binom nk2^{-\binom nk+1}&lt;1$, then it is possible to color the edges of $K_n$ with two colors so that it has no single-colored $K_k$ subgraphs</p></li><li><p>Any system consisting of fewer than $2^{k-1}$ sets of size k admits a 2-coloring</p></li><li><p>Theorem. Let $G$ be a graph with an even number, $2n$, of vertices and with $m &gt; 0$ edges. Then the set $V = V(G)$ can be divided into two disjoint $n$-element subsets $A$ and $B$ in such a way that more than $\frac{m}{2}$ edges go between $A$ and $B$.</p><p>To find the solution, sampling and testing is efficient.</p></li><li><p>Theorem  [Lovasz Local Lemma]:<br>Let</p><p>$$<br>E_1, E_2, \cdots, En<br>$$</p><p>be a set of events, and assume that the following holds:</p><ol><li><p>For all</p><p>$$<br>i$$,<br>$$</p><p>Pr(E_i) \le p$$;</p></li><li><p>The degree of the dependency graph given by</p><p>$$<br>E_1, E_2, \cdots, E_n<br>$$</p><p>is bounded by $d$；</p></li><li><p>$$<br>4dp \le 1$$.<br>$$</p></li></ol><p>Then</p><p>$$<br>Pr\left(\bigcap_{i=1}^n \overline{Ei}\right) &gt; 0<br>$$</p><p>.</p></li></ol><h2 id="5-Random-Graphs"><a class="header-anchor" href="#5-Random-Graphs">¶</a>5 Random Graphs</h2><ol><li><p>$G(n,p)$ model：$\left|V\right|=n,P({u,v}\in E)=p$</p><p>存在k-独立集的概率最大为$P(\alpha(G)\geq k)\leq\binom nk(1-p)^\binom nk$</p><p>存在k-团集的概率最大为$P(\omega(G)\geq k)\leq\binom nkp^\binom nk$</p></li><li><p>对于任何一个increasing property的概率$P$，$n\to\infty$时，$P\to0$或者$P\to1$</p><p>具体趋于可能收到$p$影响，边界点称为threshold</p></li><li><p>可以用马尔科夫不等式/切比雪夫不等式来推导</p></li></ol><h2 id="6-Introduction-to-data-science"><a class="header-anchor" href="#6-Introduction-to-data-science">¶</a>6 Introduction to data science</h2><h3 id="6-1-High-dimensional-space"><a class="header-anchor" href="#6-1-High-dimensional-space">¶</a>6.1 High-dimensional space</h3><ol><li>任意两个高维向量是近似正交的</li><li>单位立方体的顶点在单位球外</li><li>几乎所有的点都在赤道（不论哪个点为北极点）</li><li>体积随着维度增加而趋于0</li><li>变长为2的立方体内撒点，几乎全在内接球外面</li><li>高维高斯分布：体积最多的地方不在零点，在一个半径为$\sqrt d$的环上</li><li>找最近的两个向量-&gt;矩阵降维-&gt;用球状高斯分布生成k个向量，再把原来的向量投影上去，距离相对关系大概率是不变的</li></ol><h3 id="6-2-Best-fit-subspaces-and-Singular-Value-Decomposition"><a class="header-anchor" href="#6-2-Best-fit-subspaces-and-Singular-Value-Decomposition">¶</a>6.2 Best-fit subspaces and Singular Value Decomposition</h3><h4 id="6-2-1-SVD-特征值压缩"><a class="header-anchor" href="#6-2-1-SVD-特征值压缩">¶</a>6.2.1 SVD 特征值压缩</h4><p>方阵 EVD：通过特征值和特征矩阵，把原矩阵变成$\mathbf{S}=U\boldsymbol\Lambda U^{-1}$，</p><p>普通矩阵 SVD：$A=\underbrace{U}<em>{m\times m}\underbrace{\Sigma}</em>{m\times n} \underbrace{V^T}_{n\times n}$</p><p>$U$的列是$AA^T$的特征向量，$V$的列是$A^TA$的特征向量，$\Sigma$对角是特征值，其余为0</p><p>为了压缩矩阵，可以把最小的特征值置零</p><h4 id="6-2-2-投影压缩"><a class="header-anchor" href="#6-2-2-投影压缩">¶</a>6.2.2 投影压缩</h4><p>和线形回归类似，目标是让原数据和新数据的协方差尽可能小，但是实现上可以用SVD</p><ol><li>中心化数据：将每个特征减去其均值，使数据均值为零</li><li>计算协方差矩阵</li><li>特征值分解</li><li>选择主成分</li><li>投影数据</li></ol><h3 id="6-3-Introduction-to-Markov-Chain-Monte-Carlo"><a class="header-anchor" href="#6-3-Introduction-to-Markov-Chain-Monte-Carlo">¶</a>6.3 Introduction to Markov Chain Monte Carlo</h3><ul><li><p>Persistent state (recurrence): If the state ever be reached, the random process will return to it with probability 1.</p></li><li><p>Markov Chain Monte Carlo: $E(f)=\sum\limits_xf(x)\cdot p(x)$</p></li><li><p>Metropolis-Hastings Algorithm: 构造指定stationary distribution的Markov Chain</p><p>$\begin{cases}p_{ij}=\dfrac 1r\min\left (1,\dfrac {p_j}{p_i}\right )\p_{ii}=1-\sum\limits_{i\ne j}p_{ij}\end{cases}$</p></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;1-Set-and-ordering&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-Set-and-ordering&quot;&gt;¶&lt;/a&gt;1 Set and ordering&lt;/h2&gt;
&lt;h3 id=&quot;1-1-Sets-relations-and-</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>影评：《姊妹之歌》</title>
    <link href="https://ryanstarfox.github.io/2025/06/15/2025/20250615%20%E5%A7%8A%E5%A6%B9%E4%B9%8B%E6%AD%8C/"/>
    <id>https://ryanstarfox.github.io/2025/06/15/2025/20250615%20%E5%A7%8A%E5%A6%B9%E4%B9%8B%E6%AD%8C/</id>
    <published>2025-06-15T08:16:05.000Z</published>
    <updated>2025-06-15T08:16:05.000Z</updated>
    
    <content type="html"><![CDATA[<p>#SIFF2025 长宁百丽宫影城</p><p>这部电影给我的感觉是：有真实的复杂性：其对于桎梏的描述有两重性。</p><p>电影中对于桎梏的展示是非常具有层次性：由宏观到微观，由背景到具体的事情：</p><p>最开始展现出来的Nasreen的家庭，无疑是美满的——与丈夫、孩子非常幸福地生活。伊朗这个国家看上去和世俗国家也别无二异：唱歌的母亲，看球的父子，拿着xbox手柄的儿子，iPhone，google。</p><p>第一层桎梏是国家、社会带来的，在电影开头就提到：女性不能在公开场合唱歌。警车在旁边时感受到的不是安全，而是警觉：停止唱歌，戴上头纱，小心摄像机。纹身师说：“我给xxx（那个女歌手，忘记名字了）纹过身，她戴着头巾唱歌，谷歌上都查不到她的脸，女性在国内唱歌有限制。”摄影师应：“女性在国内有很多限制。”纹身师问：“纹这个真的值得这么痛嘛？”Nasreen在手指上纹上了women。</p><p>第二层桎梏是丈夫：开始时的幸福，后面才知道这只不过是一个不具体的表象，一旦到具体的生活，这就是一段不幸福的婚姻。太经典了：晚归的丈夫、不爱的丈夫、自私的丈夫。甚至其实两人一开始在一起都是因为家庭内部的催婚压力，甚至抚养小孩对于丈夫的付出小于儿子的付出。</p><p>第三层桎梏是原生家庭：母亲一直支持Nasreen，Nasreen也一直认为父亲在的话会支持自己唱歌，会保护自己免于丈夫的冷暴力。但是母亲还是传统的，父亲的支持最终还是父权赋予的权利，而不是个人独立带来的力量，当初Nasreen结婚都是半处于家庭给到的压力。</p><p>但是这部电影的对于整个事件的刻画是具体的，不是一昧地否定。母亲最终也还是尊重女儿离婚的意愿，并且为了帮女儿承担压力而陪同女儿一起去离婚，原生家庭是桎梏，但也是支撑。和前夫也算是离婚离得干净，获得抚养权、抚养费，Nasreen在法律的支持下也获得了应有的保障。</p><p>离婚之后Nasreen走出家门，不为家庭所累（当然也是因为母亲的支持和子女的成长），找到了一份支持自己的职业（伊朗的女性生存状况，至少没有差到一个女人养不活自己，完全依附于一个男人）。其实这在某种程度上，回答了“娜拉出走之后，然后呢”的问题。</p><p>影片的结尾还是秉有对未来的希望：伊朗知名女歌手牵头，希望改变伊朗对于女性的偏见与歧视。Nasreen的母亲生日，许下了伊朗和平的宏大愿望。儿子Hamid说，乌龟会把头抬出水面呼吸——下一代会好吗？Hamid支持母亲唱歌，未来的伊朗，会支持女性平等的地位吗？</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;#SIFF2025 长宁百丽宫影城&lt;/p&gt;
&lt;p&gt;这部电影给我的感觉是：有真实的复杂性：其对于桎梏的描述有两重性。&lt;/p&gt;
&lt;p&gt;电影中对于桎梏的展示是非常具有层次性：由宏观到微观，由背景到具体的事情：&lt;/p&gt;
&lt;p&gt;最开始展现出来的Nasreen的家庭，无疑是美满的——与</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
  </entry>
  
  <entry>
    <title>2025 WWDC 小谈</title>
    <link href="https://ryanstarfox.github.io/2025/06/13/2025/20250622%20WWDC2025/"/>
    <id>https://ryanstarfox.github.io/2025/06/13/2025/20250622%20WWDC2025/</id>
    <published>2025-06-13T07:15:00.000Z</published>
    <updated>2025-06-13T07:15:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>2025 WWDC 小谈</h1><p><img src="/images/2025/f882568ce4_wwdc-2025-apple.webp" alt="f882568ce4_wwdc-2025-apple"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><blockquote><p>说来好笑，正是因为复习量子物理到深夜，我才得以观看2025WWDC的直播。这是我第一次看WWDC的直播，第二次看苹果发布会的直播（上一次是“scary fast”)。对于这次WWDC，我觉得还算是满意吧，虽然没怎么回答我想问的问题，但是至少还算是给了一份答卷。</p></blockquote><h2 id="Apple-Intelligence——失望与期望"><a class="header-anchor" href="#Apple-Intelligence——失望与期望">¶</a>Apple Intelligence——失望与期望</h2><p>2024年的苹果发布会，画了一张巨大的大饼——<strong>Apple Intelligence</strong>。这是苹果近年来唯一的一次食言，起了个大早，赶了个晚集。去年刚发布的时候，这看上去又是“Only Apple can do”，提出了既能保护用户隐私又能帮助用户的人工智能的结构概念，都以为是又一次苹果为一片混沌的新领域证明正确的发展和应用的方向，但结果却是一场惨痛的滑铁卢，甚至让苹果背上“虚假宣传”的骂名。</p><p><img src="/images/2025/Apple_Intelligence_top_banner_157c9e61-a3b4-405c-a873-a472ee9deb84.jpg.webp" alt="Apple_Intelligence_top_banner_157c9e61-a3b4-405c-a873-a472ee9deb84.jpg"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>目前为止，我听到的消息来自<a href="https://www.bilibili.com/video/BV1VYjnzuEkg">林亦LYi</a>，认为他讲得还是较为详细有理。简言之苹果机器学习的高管<a href="https://www.apple.com.cn/leadership/john-giannandrea/">John Giannandrea</a>面对ChatGPT的横空出世不作为，没有跟上AI发展的浪潮，但又做足了面子工程，画了很多饼，目前机器学习相关团队被重组给了帅气迷人幽默的<a href="https://www.apple.com.cn/leadership/craig-federighi/">Craig Federighi</a>（主管软件工程）和<a href="">Mike Rockwell</a>（Vision Pro总负责）。这两人由于John的不作为积怨已久，且专业能力管理能力均较强，我本以为今年可能就已经会有很大的改观，但是事实上并没有这么快。希望WWDC2026上苹果给出一份满意的答卷！</p><p><img src="/images/2025/111.jpg" alt="battle of Apple Intelligence"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>Apple Intelligence落后了吗？落后了！但是，我认同，现在也没有落后很多。因为其他厂商对于AI功能加入系统的方式仍然是一片混沌，并没有找到一种深刻影响工作效率的方法。而且仍然有许多亟待解决的<strong>伦理问题</strong>——例如荣耀MagicOS的“一句话点外卖”功能，是基于AI对于屏幕内容的识别，一方面这是对于隐私的侵犯；另一方面误操作的成本谁来负担，这都是目前没有伦理共识。所以，其实在这个时候各个厂商都有点踟蹰不前，因为有点没有前进的空间。但是苹果提出要端侧模型和云端模型并重，提出了一个合理的结构，规避了这个伦理问题，所以其实苹果是由前进空间，只是在科技方面有点落后了。诚然如此，但是苹果其实依然没有为伦理的讨论做出贡献，苹果只是规避了这个问题，纳入旧伦理的体系中去解决这个问题。</p><p>我比较感兴趣的Apple intelligence的理念反而是在WatchOS的部分提到的，里面提到一个关键词**“主动性”**，我认为这其实一针见血地指出了AI应用发展的一个重要方向。希望不要沦落到概念先行，从未落地的田地。</p><h2 id="Liquid-Glass——松了一口气"><a class="header-anchor" href="#Liquid-Glass——松了一口气">¶</a>Liquid Glass——松了一口气</h2><p><strong>UI更新</strong>是本次发布会又一次比较重要的内容。本来听过太多rumor，见过太多丑丑的渲染图，祈祷过无数次不会改不要乱改，不要为了改而改。最终给出的答卷还算满意。最终听到的消息是要统一为Vision Pro的视觉语言，之后就被曲解为圆形图标——我为此担心了很久，直至被这个来自<a href="https://www.bilibili.com/video/BV1B1jYzUERX/">谐门东西</a>的视频说服。简言之，圆形图标只有Vision Pro和Apple Watch的“无限平面”的设计语言才会出现，且为蜂窝状排列，不仅如此，Vision pro里的iPad兼容app还需要通过图标的方圆来区分。因此不可能改为圆形图标，一切只是以讹传讹。</p><p><img src="/images/2025/maxresdefault.jpg" alt="maxresdefault"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>最终的设计，我认为还是维持了苹果的审美的——甚至加入了透明app图标，这多像是概念版的iOS啊！（但是其实我不喜透明图标，因为丧失了<strong>颜色对于视觉的传达</strong>。）新的UI最被人诟病的是<strong>可读性</strong>的问题——透明让底层的内容影响了顶层内容的阅读。这个问题在这个<a href="https://www.bilibili.com/video/BV1noMczkEMP/">四位up主对谈</a>的视频里讨论过。新UI的实现分为四层——Lense层（基础的材质）、Diffusion层（让透视光线变柔和）、高光层（控制透明度）、 文字与UI。为了改善可读性，苹果官方的文档都指出可以调整Diffusion层与高光层。事实上，在视频播放器界面，暂停按钮（纯SVG图标）和+10s、-10s按钮（混合了文字的图标）已经做了可读性的区别。但是在控制中心，苹果对于可读性的控制就非常差——明明通过调整参数就可以解决。不知道是不是为了小小引起热度，还是纯粹是beta版系统不够完善。我看到的小道消息是，控制中心就是还没有做完。</p><p><img src="/images/2025/%E6%88%AA%E5%B1%8F%202025-06-13%2001.02.56.png" alt="截屏 2025-06-13 01.02.56"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>（感觉对第三方未适配app的支持还不错）</p><p>这个UI的另外一个争议是<strong>对性能和续航的损耗</strong>。WWDC引出新UI的方式都是说“随着算力的提高”，而且这种材质和效果势必会增加性能与续航的压力。我看到的小道消息，说是并没有用到光追，但是也确实非常吃性能和能耗。就我自己而言，我本来想为了体验iPad版的Journal（事实上也并未上线），把我的A15 iPad mini 6升级至了Developer Beta，结果系统卡顿到了一个完全不可用的状态。我现在手持的还是续航尿崩的苹果小火龙——iPhone 15 pro，在极客湾续航排行榜中垫底，已经开始担心续航了。</p><h2 id="iPadOS——史诗级提升"><a class="header-anchor" href="#iPadOS——史诗级提升">¶</a>iPadOS——史诗级提升</h2><p><img src="/images/2025/image-20250613021244187.png" alt="image-20250613021244187"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>iPadOS<strong>红绿灯</strong>冒出来的那一刻，我就震惊了。</p><p>我认为桌面操作系统和移动端操作系统的根本区别有两个</p><ul><li><strong>手动杀后台vs自动杀后台</strong></li><li><strong>以文件为中心vs以应用为中心</strong></li></ul><p>其实这次iPadOS确实在这两个方向发力。</p><p>对于前者，iPadOS允许了应用保持在后台，但是它的逻辑其实是折中的：对于桌面操作系统来说，默认不自动杀后台；对于移动操作系统，默认自动杀后台；而对于这次的iPadOS，默认自动杀后台，但是程序可以调取API，申请自己不被杀掉的权限。这这种操作逻辑足够简单，保持了移动端方面管理窗口的优势；又足够精细，保持了桌面端管理进程的优势。期待实际使用的效果。</p><p>对于后者，传统来说，桌面操作系统的应用可以对所有的文件都可以方便地获得相关权限，移动操作系统的应用只能获取该应用下文件的相关权限，想要获得全局的权限就相对麻烦。新的iPadOS维持了这一点不变，但是改变了其表现形式——桌面系统的表现也是以文件为中心的，其桌面上是文件；移动操作系统是以应用为中心的，其桌面上是应用。但是新的iPadOS允许将文件固定到Docker栏上，这已经部分地把文件和应用放到同一个等级上了（虽然安卓早已可以）。没有实际体验过，不知道这种程度的对于文件的地位的提升是否足够生产力的发展。</p><p>所以，<strong>你的下一台电脑，是否还需要是一台电脑吗？</strong></p><p><img src="/images/2025/images-2.jpeg" alt="images-2"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>iPadOS更新至此，生产力的瓶颈就不是系统了，而是应用了，之前被系统困太久的厂商可以发力了，做出一些更加像样的iPad端桌面级App了。</p><p>但是，随之我们又有了另外一个问题，<strong>那Mac呢？</strong></p><p>上文所提的<a href="">四位up对谈</a>视频中有人提出，Mac和iPad只是占据各自舒适的生态位，我对此不完全赞同。我对于它的最直觉的感受是，iPad采用更加接近Mac的逻辑反而使得Mac的逻辑更容易被大家接受，反而会促进大家对于Mac的接受。而iPad本身承担的是“触屏电脑”的地位——Mac从来不做触控屏，是因为那个角度触控很别扭，但是触控放到iPad形态的桌面端设备，反而就合理起来，不论是硬件形态还是系统上。</p><p>可喜可贺，可喜可贺！不知道二手的iPad pro会不会涨价。这下12.9英寸和13英寸的iPad，M系列芯片的Mac，全部都更加合理了。</p><p><img src="/images/2025/image-20250613021059582.png" alt="image-20250613021059582"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="3D照片——新的护城河？"><a class="header-anchor" href="#3D照片——新的护城河？">¶</a>3D照片——新的护城河？</h2><p>之前up主<a href="https://www.bilibili.com/video/BV1V14y1R7Rk/?spm_id_from=333.1387.collection.video_card.click">两颗皮蛋</a>制作过系列节目【<a href="">苹果护城河</a>】，其中就有一期讲的是HDR，深以为然。</p><p>我认为，苹果在影像方面的护城河，历来有三：</p><p>其一为<strong>实况</strong>：前些年不受到广泛支持，从各个app对其适配，推动安卓也对其适配，其中经过近10年；</p><p>其二为<strong>HDR</strong>：苹果的HDR管理真的最完善最简单，而安卓与Windows的HDR管理总是相当麻烦。现在印象里安卓已经做得不错了，对安卓不构成护城河了，但是Windows的HDR管理依旧一言难尽，HDR与SDR的区分做得很差（不过近年来不怎么用Windows尤其是高端Windows了，也只是印象，欢迎反驳）；</p><p>其三为<strong>视频</strong>：iPhone的视频能力就是一直都一骑绝尘：尤其是稳定的4k60Hz和防抖性能更是，还有一些电影效果之类的有意思的功能，至今应当仍为护城河（也是印象里，欢迎举反例）。</p><p>而今年增加了<strong>照片3D化</strong>的功能，我认为很有可能是新的护城河。我更新了beta版的iPadOS之后的体验还是相对来说满意的，虽然达不到Vision Pro的效果，虽然只有富有层次感/主体在照片中心/使用广角拍摄的效果较好，但是依然让我很激动，感觉照片真的比以前更加鲜活了。上文所提的<a href="">四位Up对谈</a>中提出，这不是简单的双眼视察，而是运用了近1，2年兴起的<strong>高斯泼溅</strong>技术，迅速地将其应用到了新系统，确实让人印象深刻。</p><h2 id="一些笑点"><a class="header-anchor" href="#一些笑点">¶</a>一些笑点</h2><h3 id="伟大的Apple-Music支持了歌词翻译和读音！！"><a class="header-anchor" href="#伟大的Apple-Music支持了歌词翻译和读音！！">¶</a>伟大的Apple Music支持了歌词翻译和读音！！</h3><p><img src="/images/2025/image-20250613022531348.png" alt="image-20250613022531348"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="什么聊天工具现在才支持换背景"><a class="header-anchor" href="#什么聊天工具现在才支持换背景">¶</a>什么聊天工具现在才支持换背景</h3><p><img src="/images/2025/ios26-imessagre.jpg" alt="ios26-imessagre"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="向飞书学习——多彩文件夹-emoji"><a class="header-anchor" href="#向飞书学习——多彩文件夹-emoji">¶</a>向飞书学习——多彩文件夹+emoji</h3><p><img src="/images/2025/image-20250613022818070.png" alt="image-20250613022818070"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="Duolingo"><a class="header-anchor" href="#Duolingo">¶</a>Duolingo</h3><p><img src="/images/2025/IMG_5323.png" alt="IMG_5323"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="让我吃惊的几幕"><a class="header-anchor" href="#让我吃惊的几幕">¶</a>让我吃惊的几幕</h2><h3 id="全是国产车"><a class="header-anchor" href="#全是国产车">¶</a>全是国产车</h3><p><img src="/images/2025/image-20250613022834244.png" alt="image-20250613022834244"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="insta360有出息了"><a class="header-anchor" href="#insta360有出息了">¶</a>insta360有出息了</h3><p><img src="/images/2025/image-20250613023023211.png" alt="image-20250613023023211"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h1>以上</h1><blockquote><p>参考：</p><ol><li>林亦LYi 苹果AI怎么就鸽了？ <a href="https://www.bilibili.com/video/BV1VYjnzuEkg/">https://www.bilibili.com/video/BV1VYjnzuEkg/</a></li><li>谐门东西 ⭕️iOS 19图标变圆？别扯了…… <a href="https://www.bilibili.com/video/BV1B1jYzUERX/">https://www.bilibili.com/video/BV1B1jYzUERX/</a></li><li>Apple Apple管理层 <a href="https://www.apple.com.cn/leadership/">https://www.apple.com.cn/leadership/</a></li><li>爱否科技FView、极客湾Geekerwan、ZEALER官方频道、电丸科技AK【WWDC25 特别节目】Apple 新系统们怎么样？且听四位科技 UP 锐评 <a href="https://www.bilibili.com/video/BV1noMczkEMP/">https://www.bilibili.com/video/BV1noMczkEMP/</a></li><li>两颗皮蛋 [护城河]苹果，重新定义HDR <a href="https://www.bilibili.com/video/BV1V14y1R7Rk">https://www.bilibili.com/video/BV1V14y1R7Rk</a></li><li>Apple WWDC25 Keynote <a href="https://podcasts.apple.com/us/podcast/apple-events-video/id275834665">https://podcasts.apple.com/us/podcast/apple-events-video/id275834665</a></li></ol><p>感谢以下朋友与我交换信息、探讨WWDC2025：</p><ul><li>Apple fans群聊</li><li>JWST</li><li>Stephen Chen</li></ul></blockquote>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;2025 WWDC 小谈&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/images/2025/f882568ce4_wwdc-2025-apple.webp&quot; alt=&quot;f882568ce4_wwdc-2025-apple&quot;  data-tag=&#39;post-image&#39; onl</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>量子物理整理</title>
    <link href="https://ryanstarfox.github.io/2025/06/11/2025/20250611%20%E9%87%8F%E5%AD%90%E7%89%A9%E7%90%86/"/>
    <id>https://ryanstarfox.github.io/2025/06/11/2025/20250611%20%E9%87%8F%E5%AD%90%E7%89%A9%E7%90%86/</id>
    <published>2025-06-10T17:49:00.000Z</published>
    <updated>2025-06-10T17:49:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>第一章 量子物理基础</h1><h2 id="1-1-光量子、玻尔原子"><a class="header-anchor" href="#1-1-光量子、玻尔原子">¶</a>1.1 光量子、玻尔原子</h2><h3 id="1-1-1-黑体辐射与普朗克的量子假设"><a class="header-anchor" href="#1-1-1-黑体辐射与普朗克的量子假设">¶</a>1.1.1 黑体辐射与普朗克的量子假设</h3><h4 id="基尔霍夫辐射定律"><a class="header-anchor" href="#基尔霍夫辐射定律">¶</a>基尔霍夫辐射定律</h4><p>单色辐出度$M(\lambda,T)=\dfrac{dE_\lambda}{d\lambda}(w/m^3)$：单位时间物体表面单位面积内发射的波长在$\lambda$附近单位波长间隔内的辐射能</p><p>总辐出度$M(T)=\int_0^{+\infty}M(\lambda,T)d\lambda$</p><p>物体向周围发射辐射能的同时，也吸收周围物体的辐射能。辐射从外界入射到不透明物体时，一部分吸收，一部分反射（一部分透射）</p><p>单色吸收比$\alpha(\lambda,T)$在波长为$\lambda\sim\lambda+d\lambda$范围内的吸收比</p><p>任何温度下吸收比=1称为（绝对）黑体</p><p>$\dfrac{M_1(\lambda,T)}{\alpha_1(\lambda,T)}=\dfrac{M_2(\lambda,T)}{\alpha_2(\lambda,T)}=\cdots=M_0(\lambda,T),M_0(\lambda,T)是黑体单色辐出度$</p><p>带小孔孔腔视为绝对黑体的模型</p><p>黑体辐射基本规律：</p><ol><li>斯特藩-玻尔兹曼定律：==$M_0(T)=\sigma T^4$==，总辐出度$M_0(T)$</li><li>维恩位移定律：==$\lambda_mT=b$==，单色辐出度的峰值波长$\lambda_m$</li></ol><h4 id="普朗克能量子假说"><a class="header-anchor" href="#普朗克能量子假说">¶</a>普朗克能量子假说</h4><p>普朗克公式：==$M_0(\lambda,T)=2\pi hc^2\lambda^{-5}\dfrac1{e^{hc/k_BT\lambda}-1}$==</p><ul><li><p>波长短/温度低的近似：</p><p>维恩公式：$M_0(\lambda,T)=2\pi hc^2\lambda^{-5}e^{-hc/k_BT\lambda}$</p></li><li><p>波长高/温度高的近似：</p><p>瑞利-金斯公式：$M_0(\lambda,T)=2\pi k_Bc\lambda^{-4}T$</p></li></ul><p>普朗克假定：$谐振子能量值只取某个最小能量的整数倍\epsilon = h\nu$</p><h3 id="1-1-2-光的波粒二象性"><a class="header-anchor" href="#1-1-2-光的波粒二象性">¶</a>1.1.2 光的波粒二象性</h3><ol><li><p>光电效应</p><ol><li><p>电势差足够大时，光电流饱和，饱和电流大小与入射光强成正比</p></li><li><p>遏制电压$U_0$，$U=-U_0$，光电流为0。光电子从表面逸出最大初速度$v_m$满足：$\dfrac12mv_m^2=eU_0$。最大初动能于入射光强度无关</p></li><li><p>红限频率</p><p>遏制电势差与入射光频率有线性关系，斜率与金属种类无关</p></li><li><p>弛豫时间</p><p>几乎瞬时</p></li></ol></li><li><p>爱因斯坦光电效应方程</p><ol><li>光强：$nh\nu$</li><li>遏制电压：$\dfrac12mv^2=h\nu-A=eU_c,\ A:逸出功$</li><li>红限频率：$v_0=\dfrac Ah$</li></ol></li><li><p>康普顿散射</p><p>==$\Delta\lambda=\lambda-\lambda_0=\dfrac h{m_ec}(1-\cos\theta)$==</p></li></ol><h3 id="1-1-3-玻尔原子理论"><a class="header-anchor" href="#1-1-3-玻尔原子理论">¶</a>1.1.3 玻尔原子理论</h3><p>氢原子光谱来自电子跃迁，因此不是连续谱</p><p>里德伯公式：$\tilde{\nu}=\dfrac1\lambda=R_H(\dfrac1{m^2}-\dfrac1{n^2})$, $R_H=1.0967758\times10^7 m^{-1}$，单位是$1/m$</p><p>玻尔假设：</p><ol><li>定态条件：电子绕核圆周运动，不辐射能量，处于稳定状态称为<strong>定态</strong>，相应的能量称为<strong>能级</strong></li><li>频率条件：跃迁能量$h\nu=E_n-E_m$</li><li>角动量量子化条件：==$mv_nr_n=n\hbar=n\dfrac h{2\pi}$;$\dfrac {e^2}{4\pi\varepsilon_0 r^2}=m\dfrac{v^2}r$==</li></ol><p>==$E_1=-13.6eV$==单位是eV</p><h2 id="1-2-物质波"><a class="header-anchor" href="#1-2-物质波">¶</a>1.2 物质波</h2><h3 id="1-2-1-物质波"><a class="header-anchor" href="#1-2-1-物质波">¶</a>1.2.1 物质波</h3><p>实物粒子具有波动性</p><p>$E=h\nu=\hbar\omega$</p><p>$\vec p=\dfrac h\lambda\vec n=\hbar k\vec n$</p><h2 id="1-3-1-4-波函数和态叠加原理-薛定谔方程"><a class="header-anchor" href="#1-3-1-4-波函数和态叠加原理-薛定谔方程">¶</a>1.3&amp;1.4 波函数和态叠加原理&amp;薛定谔方程</h2><h3 id="1-4-1-波函数"><a class="header-anchor" href="#1-4-1-波函数">¶</a>1.4.1 波函数</h3><p>波函数用平面波描述：</p><ol><li>==自由粒子：$\Psi(x,t)=Ae^{i(kx-\omega t)}=Ae^{\frac i\hbar(px-Et)}$==</li><li>势场中的粒子：$\Phi(\vec r,t)$</li></ol><p>纹间距$\Delta\propto\lambda,\lambda=\dfrac h{mv}$</p><p>性质：单值、有限（全空间中模长积分为0）、连续</p><p>$\int_{-\infty}^{\infty} x^n e^{-\alpha x^2} dx = 0 \quad \text{（n 为奇数）}$</p><p>$\int_{-\infty}^{\infty} x^{2k} e^{-\alpha x^2} dx = \frac{(2k - 1)!!}{(2\alpha)^k} \sqrt{\frac{\pi}{\alpha}}$</p><p>==特别一些，$\int_{-\infty}^\infty x^{2k}e^{-x^2}dx=(2k-1)!!\sqrt{\pi}$==</p><p>==再特别一些，$\int_{-\infty}^\infty e^{-x^2}dx=\sqrt{\pi}$==</p><h3 id="1-4-2波函数的应用"><a class="header-anchor" href="#1-4-2波函数的应用">¶</a>1.4.2波函数的应用</h3><ol><li>电子绕核转动形成环形驻波：$2\pi r=n\lambda;\lambda=\dfrac h{mv}\Rightarrow L=mvr=n\hbar$</li><li>一维无限深势阱驻波：$L=n\dfrac \lambda 2\Rightarrow p = \dfrac h\lambda=n\dfrac h{2L};E_n=\dfrac{p^2}{2m}=n^2\dfrac{h^2}{8mL^2}$</li></ol><h3 id="1-4-3波函数的统计解释"><a class="header-anchor" href="#1-4-3波函数的统计解释">¶</a>1.4.3波函数的统计解释</h3><ol><li><p>亮度：德布罗意波强度的大小$\left |\Psi\right |^2=\Psi\Psi^*=\begin{cases}极大值，&amp;亮条纹\0，极小值，&amp;暗条纹\end{cases}$</p><p>亮度的物理意义为概率密度</p></li><li><p>波函数满足条件</p><ol><li><p>单值，任何地方不可能有多个波函数（概率密度）</p></li><li><p>有限：$\int\limits_\Omega\left | \Psi(\vec r,t)\right |^2dV=1（\Omega为全空间）$</p><p>（但不排除有些孤立奇点趋于无穷</p></li><li><p>连续：二阶导存在</p></li></ol></li></ol><h3 id="1-3-1-薛定谔方程"><a class="header-anchor" href="#1-3-1-薛定谔方程">¶</a>1.3.1 薛定谔方程</h3><ol><li><p>自由粒子的薛定谔方程</p><p>==$i\hbar \dfrac{\partial}{\partial t}\Psi(x,t)=-\dfrac{\hbar^2}{2m}\dfrac{\partial}{\partial x^2}\Psi(x,t)$==</p><ol><li><p>推广到势场$U(x,t)$</p><p>==$i\hbar \dfrac{\partial}{\partial t}\Psi(x,t)=\left[-\dfrac{\hbar^2}{2m}\dfrac{\partial}{\partial x^2}+U(x,t)\right]\Psi(x,t)$==</p></li><li><p>推广到三维情况</p><p>$\nabla^2=\dfrac{\partial^2}{\partial x^2}+\dfrac{\partial^2}{\partial y^2}+\dfrac{\partial^2}{\partial z^2}$</p><p>==$\hat H=-\dfrac{\hbar^2}{2m}\nabla^2+U(\vec r,t)$==</p><p>$i\hbar\dfrac{\partial}{\partial t}\Psi(\vec r,t)=\hat H\Psi(\vec r, t)$</p></li></ol></li><li><p>定态薛定谔方程(粒子在空间中出现的概率是稳定不变的)</p><p>若$\dfrac{\partial\hat H}{\partial t}=0$或者$U$与时间无关，则薛定谔方程可以分离变量</p><ol><li><p>分离变量</p><ol><li>==$i\hbar\dfrac{dT(t)}{dt}=ET(t)$==</li><li>==$\hat H\Phi(\vec r)=E\Phi(\vec r)$==</li></ol></li><li><p>振动因子</p><p>分离变量方程1的解为$T(t)=Ce^{-\frac ihEt}$</p></li><li><p>定态薛定谔方程（能量本征方程）就是方程2</p><p>==$\left(-\dfrac{\hbar^2}{2m}\nabla^2+U(\vec r)\right)\Phi(\vec r)=E\Phi(\vec r)$==</p><p>通解：$\Psi(x,t)=\sum\limits_{n=1}^{\infty}c_ne^{-\frac{iE_nt}\hbar}\Phi_n(x)$</p></li></ol><p>定态：能量取特定值的状态，薛定谔方程的特解</p><p>==判断是否是定态：$\left | \Psi(x,t)\right |^2=\Psi(x,t)^*\cdot\Psi(x,t)$是否与$t$相关，不相关则定态==</p></li></ol><h3 id="1-3-2-不确定度关系"><a class="header-anchor" href="#1-3-2-不确定度关系">¶</a>1.3.2 不确定度关系</h3><p>$\Delta x\cdot\Delta p_x\geq\dfrac{\hbar}2$</p><p>$\Delta y\cdot\Delta p_y\geq\dfrac{\hbar}2$</p><p>$\Delta z\cdot\Delta p_z\geq\dfrac{\hbar}2$</p><p>$\Delta E\cdot \Delta t\geq \dfrac \hbar 2$</p><h3 id="1-3-3-几率流密度矢量"><a class="header-anchor" href="#1-3-3-几率流密度矢量">¶</a>1.3.3 几率流密度矢量</h3><p>==$i\hbar(\Psi^<em>\Psi)=\dfrac{\hbar^2}{2m}\nabla\cdot[\Psi\nabla\Psi^</em>-\Psi^*\nabla\Psi]$==</p><p>几率密度：$\rho=\Psi^*\Psi$</p><p>几率流密度矢量：==$\vec J=\dfrac{i\hbar}{2m}[\Psi\nabla\Psi^<em>-\Psi^</em>\nabla\Psi]$==</p><p>几率守恒方程：</p><pre><code>微分形式：$\dfrac \partial&#123;\partial t&#125;\rho+\nabla\cdot\vec J=0$积分形式：$\frac&#123;d&#125;&#123;dt&#125;\int_\tau\rho(\vec r,t)d\tau=-\oint_S \vec J\cdot d\vec S$</code></pre><p>左边：闭区域$\tau$内找到粒子的总几率（或粒子数）在单位时间内的增量</p><p>右边：单位时间内通过$\tau$的封闭表面 $S$流入（面积分前面的负号）$\tau$内的几率（或粒子数）</p><h3 id="1-3-3-叠加态"><a class="header-anchor" href="#1-3-3-叠加态">¶</a>1.3.3 叠加态</h3><ol><li><p>若$\Psi_1,\Psi_2,\cdots,\Psi_n$是粒子的可能状态，则粒子也可处在它们的线性叠加态$\Psi=\sum\limits_{i=1}^nc_i\Psi_i$</p></li><li><p>处于$\Psi态时，部分地处于每种态，处于\Psi_k态的几率是\left|c_k\right|^2$，且$\sum\limits_{k=1}^n\left|c_k\right|^2=1$</p><p>条件：</p><ol><li>$\Psi_1,\cdots,\Psi_n$正交归一</li><li>$\Psi$满足归一化条件$\int\Psi^*\Psi_ldx=\delta_{kl}=\begin{cases}1&amp;k=l\0&amp;k\neq l\end{cases}$</li></ol></li></ol><h3 id="1-4-4-无限深阱势中的粒子"><a class="header-anchor" href="#1-4-4-无限深阱势中的粒子">¶</a>1.4.4 无限深阱势中的粒子</h3><p>==$\Phi(x)=\begin{cases}\sqrt{\dfrac{2}{a}}\sin\dfrac{n\pi}ax &amp;0&lt;x&lt;a&amp;阱内\0&amp;x\leq0,x\geq a&amp;阱外\end{cases}$==</p><p>性质：</p><ol><li>正交性：$\int\limits_{-\infty}^{+\infty}\Phi^*<em>m(x)\Phi_n(x)dx=\delta</em>{mn}=\begin{cases}1&amp;m=n\0&amp;m\ne n\end{cases}$</li><li>通过初始状态确定每一个本征波函数的系数</li><li>基态是$E_1$，第n激发态是$E_{n+1}$，==$E_n=\dfrac{n^2\pi^2\hbar^2}{2ma^2}$==</li><li>边界条件：函数连续且一阶导连续</li></ol><h2 id="1-5-物理量与算符"><a class="header-anchor" href="#1-5-物理量与算符">¶</a>1.5 物理量与算符</h2><ol><li><p>位置算符：$\hat x\rightleftharpoons x$</p></li><li><p>动量算符：$\hat p \rightleftharpoons -i\hbar\nabla$</p></li><li><p>总能量算符：$\hat H\rightleftharpoons-\dfrac{\hbar^2}{2m}\nabla^2+U(\vec r)$</p></li><li><p>设算符为$\hat A$，则以下物理量的==平均值为$\int_{-\infty}^\infty \Psi^*\hat A\Psi dx$==</p><table><thead><tr><th>物理量</th><th>坐标空间表示（$x$ 表象）</th><th>动量空间表示（$p$ 表象）</th><th>说明</th></tr></thead><tbody><tr><td>位置算符$\hat{x}$</td><td>$\hat{x} = x$</td><td>$\hat{x} = i\hbar \frac{d}{dp}$</td><td>乘法/导数互为傅里叶对</td></tr><tr><td>动量算符$\hat{p}$</td><td>==$\hat{p} = -i\hbar \frac{d}{dx}$==</td><td>$\hat{p} = p$</td><td></td></tr><tr><td>动能算符$\hat{T}$</td><td>==$\hat{T} = -\frac{\hbar^2}{2m} \frac{d^2}{dx^2}$==</td><td>$\hat{T} = \frac{p^2}{2m}$</td><td></td></tr><tr><td>势能算符$\hat{U}(x)$</td><td>==$\hat{U}(x) = U(x)$==</td><td>$\hat{U}(x) = U(i\hbar \frac{d}{dp})$</td><td>非平移不变势变成微分算符</td></tr><tr><td>哈密顿量$\hat{H}$</td><td>==$\hat{H} = -\frac{\hbar^2}{2m} \nabla^2 + U(x)$==</td><td>$\hat{H} = \frac{p^2}{2m} + U(i\hbar \frac{d}{dp})$</td><td>总能量</td></tr><tr><td>力矩$\hat{L}_z$</td><td>$\hat{L}_z = -i\hbar \left( x \frac{\partial}{\partial y} - y \frac{\partial}{\partial x} \right)$</td><td>$\hat{L}_z = -i\hbar \left( p_x \frac{\partial}{\partial p_y} - p_y \frac{\partial}{\partial p_x} \right)$</td><td>平面角动量（z分量）</td></tr><tr><td>总角动量$\hat{\vec{L}}$</td><td>$\hat{\vec{L}} = -i\hbar \vec{r} \times \nabla$</td><td>$\hat{\vec{L}} = -i\hbar \vec{p} \times \nabla_p$</td><td>三维角动量向量</td></tr><tr><td>角动量平方$\hat{L}^2$</td><td>$\hat{L}^2 = -\hbar^2 \left( \frac{1}{\sin \theta} \frac{\partial}{\partial \theta} \left( \sin \theta \frac{\partial}{\partial \theta} \right) + \frac{1}{\sin^2 \theta} \frac{\partial^2}{\partial \phi^2} \right)$</td><td>同左（在$p$ 空间极坐标中结构相同）</td><td>球坐标形式，常见于中心势问题</td></tr><tr><td>$\hat{L}_x$</td><td>$-i\hbar (y \dfrac \partial{\partial z} - z \dfrac{\partial}{\partial y})$</td><td>同形式</td><td>角动量 x 分量</td></tr><tr><td>$\hat{L}_y$</td><td>$-i\hbar (z \dfrac\partial{\partial x} - x \dfrac\partial{\partial z})$</td><td>同形式</td><td>角动量 y 分量</td></tr><tr><td>$\hat{L}_z$</td><td>$-i\hbar (x \dfrac\partial{\partial y} - y \dfrac\partial{\partial x})$</td><td>同形式</td><td>角动量 z 分量</td></tr><tr><td>自旋$\hat{S}_x$</td><td>$\hat{S}_x = \frac{\hbar}{2} \begin{pmatrix} 0 &amp; 1 \ 1 &amp; 0 \end{pmatrix}$</td><td>同左</td><td>Pauli 矩阵$\sigma_x$</td></tr><tr><td>自旋$\hat{S}_y$</td><td>$\hat{S}_y = \frac{\hbar}{2} \begin{pmatrix} 0 &amp; -i \ i &amp; 0 \end{pmatrix}$</td><td>同左</td><td>Pauli 矩阵$\sigma_y$</td></tr><tr><td>自旋$\hat{S}_z$</td><td>$\hat{S}_z = \frac{\hbar}{2} \begin{pmatrix} 1 &amp; 0 \ 0 &amp; -1 \end{pmatrix}$</td><td>同左</td><td>Pauli 矩阵$\sigma_z$</td></tr><tr><td>粒子数算符$\hat{N}$</td><td>$\hat{N} = \hat{a}^\dagger \hat{a}$</td><td>同左</td><td>通常用于谐振子/量子场理论</td></tr></tbody></table></li><li><p>算符的运算规则</p><ol><li><p>线性算符</p></li><li><p>算符之和：$(\hat A+\hat B)\psi=\hat A\psi+\hat B\psi$</p></li><li><p>算符之积：$(\hat A\hat B)\phi=\hat A(\hat B\phi)$</p></li><li><p>$\left[\hat A\hat B-\hat B\hat A\right ]=\hat A\hat B-\hat B\hat A为方程\hat A和\hat B的对易式，若为0，则两者对易$</p></li><li><p>算符的本征方程（类似矩阵的特征值）$\hat A\varphi=\lambda\phi$</p></li><li><p>算符的复共轭：所有复量换成共轭复量</p></li><li><p>厄密算符（厄密算符的共轭转置等于本身）</p><p>若两个任意的波函数$\psi$和$\varphi$，满足$\int\psi^<em>\hat F\varphi d\tau=\int(\hat F\psi)^</em>\varphi d\tau,d\tau\equiv dxdydz$</p><p>常见厄密算符：位置算符、动量算符、能量算符</p><p>量子力学中的力学量算符都是厄密的</p></li></ol></li><li><p>厄密算符</p><ol><li><p>实数性：本征值为实数</p></li><li><p>正交性：任意两个本征函数总是正交的</p><p>函数的正交：$\int\psi^*_1(\vec r)\psi_2(\vec r)d\tau=0$</p></li><li><p>完备性：</p></li><li><p>即对任一模平方可积函数$\psi$，可表示为$\psi(\vec r)=\sum\limits_nc_n\psi_n(\vec r)$，这也可称为广义傅立展开</p></li></ol></li></ol><h2 id="1-6-力学的测量值-测量与量子态的坍缩"><a class="header-anchor" href="#1-6-力学的测量值-测量与量子态的坍缩">¶</a>1.6 力学的测量值 测量与量子态的坍缩</h2><ol><li>粒子处于本征态$\psi _n$时，测量值是确定的，为本征值$\lambda_n$</li><li>如果体系 $\psi(\vec{r})=\sum\limits_n c_n \psi_{n}(\vec{r})$ 不处于 F 的本征态，它的力学量的测量值不是确定的：测量值可能为任意一个本征态 $\psi_{n}$ 对应的本征值 $\lambda_{n}(n=1,2,...)$，对应的概率分布为 $|c_n|^2$。<br>$c_{n}=\int \psi_{n}^{*}(\vec{r}) \psi(\vec{r}) d\tau$<br>$c_{n}$ 代表了两个态的“相似程度”→ 测量坍缩到本征态 $\psi_{n}$ 的概率</li><li>第一次测量之后，量子态会坍缩为一个$\psi_n$，第二次测量时，体系的态就是$\psi_n$了</li><li>物理量的偏差为方均根偏差，即$\Delta x = &lt;x^2&gt;-<x>^2$</li></ol><h2 id="1-7-不同力学量能同时确定的条件"><a class="header-anchor" href="#1-7-不同力学量能同时确定的条件">¶</a>1.7 不同力学量能同时确定的条件</h2><p>==两个力学量能同时确定（即具有共同本征态）的充分必要条件是它们的算符对易。==</p><p>角动量算符互相不对易</p><p>角动量平方算符与其分量对应</p><p>角动量算符与坐标算符对应</p><p>==角动量算符本征值：$l=0,1,2,\cdots,m=l,l-1,\cdots,-l+1,-l$，对应的本征函数（波函数）是$\Psi_m(\varphi)=\dfrac1{\sqrt{2\pi}}e^{im\varphi}$==</p><p>球谐函数$Y_{lm}$是$\hat L^2$和$\hat L_z$共同的本征函数</p><p>$\hat L^2 Y_{lm}(\theta,\varphi)=l(l+1)\hbar^2Y_{lm}(\theta,\varphi)$</p><p>$\hat L_zY_{lm}(\theta,\varphi)=m\hbar Y_{lm}(\theta,\varphi)$</p><p>角动量大小：==$\sqrt{l(l+1)}\hbar$==</p><p>$l=0,1,\cdots,n-1;m=-l,-l+1,\cdots,l-1,l$</p><p>谐振子能量是量子化的==$E_n=(n+\dfrac12)\hbar\omega$==</p><p>波函数$\Psi_n(x)=\left(\dfrac{\alpha}{2^n\sqrt\pi n!}\right)^{1/2}H_n(\alpha x)e^{-\dfrac12\alpha^2x^2},\alpha=\sqrt{\dfrac{m\omega}{\hbar}}$</p><p>$H_n(\xi)=(-1)^ne^{\xi}\dfrac{d^n}{d\xi^n}(e^{-\xi^2})$</p><p>$H_0(\xi)=1,H_1(\xi)=2\xi,H_2(\xi)=4\xi^2-2,H_3(\xi)=8\xi^3-12\xi$</p><p>n偶：偶宇称，n奇：奇宇称</p><table><thead><tr><th>参数</th><th>取值范围</th><th>描述</th><th>公式</th></tr></thead><tbody><tr><td>主量子数 (n)</td><td>$n = 1, 2, 3, ...$</td><td>能量大小</td><td>$E_n = -13.6 \dfrac1{ n^2} eV$</td></tr><tr><td>轨道角量子数 (l)</td><td>$l = 0, 1, 2, ..., (n-1)$</td><td>角动量的大小</td><td>$L = \sqrt{l(l+1)} ħ$</td></tr><tr><td>轨道磁量子数 (ml)</td><td>$m_l = 0, ±1, ±2, ..., ±l$</td><td>L 的 z 分量</td><td>$L_z = m_l ħ$</td></tr><tr><td>自旋磁量子数 (ms)</td><td>$m_s = ±1/2$</td><td>S 的 z 分量</td><td>$S_z = m_s ħ=\pm\dfrac12\hbar$</td></tr></tbody></table><h2 id="第二章"><a class="header-anchor" href="#第二章">¶</a>第二章</h2><h2 id="2-1-有限深势阱"><a class="header-anchor" href="#2-1-有限深势阱">¶</a>2.1 有限深势阱</h2><h2 id="2-2-方势垒"><a class="header-anchor" href="#2-2-方势垒">¶</a>2.2 方势垒</h2><p>$\begin{cases}\varPsi_1=Ae^{ikx}+A'e^{-ikx}&amp;k&lt;0\\varPsi_2=Be^{k'x}+B'e^{-k'x}&amp;0&lt;x&lt;a\\varPsi_3=Ce^{ikx}&amp;x&gt;a\end{cases}$</p><p>反射系数：$R=\dfrac{\left |A'\right |^2}{\left | A \right |^2}$</p><p>透射系数：$T=\dfrac{\left |C\right |^2}{\left | A \right |^2}$</p><p>R+T=1</p><h2 id="2-3-氢原子"><a class="header-anchor" href="#2-3-氢原子">¶</a>2.3 氢原子</h2><p>类氢原子：$E_n=-\dfrac{m_eZ^2e^4}{2(4\pi\epsilon_0)^2\hbar^2n^2}$</p><p>$\varPsi(r,\theta,\varphi)=R_{nl}(\theta,\varphi)Y_{lm}(\theta,\varphi)$，前者径向，后者角向（球谐函数）</p><h2 id="2-4-双态系统"><a class="header-anchor" href="#2-4-双态系统">¶</a>2.4 双态系统</h2><p>态空间是二维的，于是哈密顿算符变成哈密顿矩阵，薛定谔方程的矩阵形式变为：</p><p>$i\hbar\dfrac{\partial}{\partial t}\begin{pmatrix}C_1\C_2\end{pmatrix}=\begin{pmatrix}H_{11}&amp;H_{12}\H_{21}&amp;H_{22}\end{pmatrix}\begin{pmatrix}C_1\C_2\end{pmatrix}$</p><p>取基矢，使$\hat H$为本征态，则有</p><p>$\begin{pmatrix}H_{11}&amp;H_{12}\H_{21}&amp;H_{22}\end{pmatrix}=\begin{pmatrix}E_I&amp;0\0&amp;E_{II}\end{pmatrix}$，进一步得到$i\hbar\dfrac{\partial}{\partial t}\begin{pmatrix}C_I\C_{II}\end{pmatrix}=\begin{pmatrix}E_I&amp;0\0&amp;E_{II}\end{pmatrix}\begin{pmatrix}C_I\C_{II}\end{pmatrix}$</p><h1>常用互易关系</h1><p>$[\hat{A} \hat{B}, \hat{C}] = \hat{A} [\hat{B}, \hat{C}] + [\hat{A}, \hat{C}] \hat{B}$</p><p>==$[\hat x,\hat y]=0$==</p><p>==$[\hat p_x,\hat p_y]=0$==</p><p>==$[\hat x,\hat p_x]=i\hbar$==</p><p>==$[\hat x,\hat L_y]=i\hbar z$==</p><p>==$[\hat x,\hat L_z]=-i\hbar y$==</p><p>==$[x,\hat p_y]=[x,\hat p_z]=0$==</p><p>$\left[\hat{L_x},\hat{L_y}\right]=i\hbar\hat{L_z}$</p><p>$\left[\hat{L}^2,\hat{L_x}\right]=0$</p><p>$[\hat H,\hat L_z]=0$</p><p>$[\hat H,\hat p]=0$</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;第一章 量子物理基础&lt;/h1&gt;
&lt;h2 id=&quot;1-1-光量子、玻尔原子&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#1-1-光量子、玻尔原子&quot;&gt;¶&lt;/a&gt;1.1 光量子、玻尔原子&lt;/h2&gt;
&lt;h3 id=&quot;1-1-1-黑体辐射与普朗克的量子假设&quot;&gt;</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>马克思主义基本原理</title>
    <link href="https://ryanstarfox.github.io/2025/06/08/2025/202506%20%E9%A9%AC%E5%85%8B%E6%80%9D%E4%B8%BB%E4%B9%89%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86%E5%A4%8D%E4%B9%A0%E6%8F%90%E7%BA%B2/"/>
    <id>https://ryanstarfox.github.io/2025/06/08/2025/202506%20%E9%A9%AC%E5%85%8B%E6%80%9D%E4%B8%BB%E4%B9%89%E5%9F%BA%E6%9C%AC%E5%8E%9F%E7%90%86%E5%A4%8D%E4%B9%A0%E6%8F%90%E7%BA%B2/</id>
    <published>2025-06-07T16:00:00.000Z</published>
    <updated>2025-06-07T16:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>马克思主义基本原理</h1><h2 id="0-导论"><a class="header-anchor" href="#0-导论">¶</a>0 导论</h2><h3 id="0-1-什么是马克思主义"><a class="header-anchor" href="#0-1-什么是马克思主义">¶</a>0.1 什么是马克思主义?</h3><p>马克思主义的三个基本组成部分：马克思主义哲学、马克思主义政治经济学、科学社会主义</p><p>学习把马克思主义基本原理：</p><ul><li>基本立场：马克思主义观察、分析和解决问题的根本立足点和出发点，以无产阶级的解放和全人类的解放为己任，以人的自由而全面发展为美好目标，以人民为中心，坚持一切为了人民，一切依靠人民，全心全意为人民谋幸福</li><li>基本观点：<ul><li>关于自然、社会和人类思维发展一般规律的科学认识</li><li>对资本主义社会和社会主义社会发展规律的科学认识</li><li>对人类思想成果和社会实践经验的科学总结</li></ul></li><li>基本方法：是建立在<strong>辩证唯物主义</strong>和<strong>历史唯物主义</strong>世界观和方法论基础上，指导我们正确认识世界和改造世界的思想方法和工作方法</li></ul><h3 id="0-2-马克思主义的创立和发展"><a class="header-anchor" href="#0-2-马克思主义的创立和发展">¶</a>0.2 马克思主义的创立和发展</h3><p>马克思主义的社会根源、阶级基础和思想根源：</p><ul><li><p>社会根源：</p><ul><li>社会两极分化，工人极端困苦</li><li>周期性经济危机频繁爆发</li></ul></li><li><p>阶级基础：工人运动的兴起，标志着现代无产阶级作为独立的政治力量登上了历史舞台。</p><ul><li>法国里昂工人起义</li><li>英国宪章运动</li><li>德国西里西亚织工起义</li></ul></li><li><p>思想根源：</p><ul><li>直接的理论来源：德国古典哲学、英国古典政治经济学、英法空想社会主义</li><li>自然科学前提：19 世纪的三大科学发现，即细胞学说、能量守恒与转化定律、生物进化论</li></ul></li></ul><h2 id="著作："><a class="header-anchor" href="#著作：">¶</a>著作：</h2><ul><li>马恩合写《德意志意识形态》，首次系统阐述了历史唯物主义的基本观点，实现了历史观上的伟大变革。</li><li>《共产党宣言》发表，标志着马克思主义的公开问世。</li><li>《资本论》系统阐述了剩余价值学说。<strong>唯物史观</strong>和<strong>剩余价值学说</strong>是马克思一生的两个伟大发现。</li><li>1876-1878，恩格斯写出了《反杜林论》，全面阐述了马克思主义理论体系。</li></ul><p>马克思主义创新发展的基本路径：</p><ul><li>本土化和时代化是马克思主义创新发展的基本路径。<ul><li>本土化：马克思主义基本原理与各国国情相结合，并在各国落地生根、开花结果的过程；</li><li>时代化：马克思主义基本原理与时代特征相结合，回答新的时代问题，始终把握时代、引领时代的过程。</li></ul></li></ul><p>马克思主义中国化成果：</p><ul><li>毛泽东思想、邓小平理论、“三个代表”重要思想、科学发展观、习近平新时代中国特色社会主义思想。</li></ul><h3 id="0-3-马克思主义的基本特征"><a class="header-anchor" href="#0-3-马克思主义的基本特征">¶</a>0.3 马克思主义的基本特征</h3><p>马克思主义的基本特征：鲜明的科学性、人民性、实践性、发展性（科学性与革命性的统一），这些是马克思主义的本质、使命、理论形象。</p><ul><li>科学的理论：马克思主义是对自然、社会和人类思维发展本质和规律的正确反映。它是在<strong>社会实践</strong>和<strong>科学发展</strong>的基础上产生的，并在自身发展过程中不断总结实践经验，吸取自然科学和社会科学发展的最新成就。</li><li>人民的理论：<strong>人民性</strong>是马克思主义的<strong>本质属性</strong>，人民至上是马克思主义的政治立场。</li><li>实践的理论：马克思主义是从实践中来、到实践中去、在实践中接受检验，并随实践而不断发展的学说。</li><li>发展的理论：马克思主义是不断发展的开放的学说，具有与时俱进的理论品质。马克思主义是时代的产物，并随着时代、实践和科学的发展而不断发展。</li></ul><h2 id="1世界的物质性及发展规律"><a class="header-anchor" href="#1世界的物质性及发展规律">¶</a>1世界的物质性及发展规律</h2><h3 id="1-1-世界的多样性与物质统一性"><a class="header-anchor" href="#1-1-世界的多样性与物质统一性">¶</a>1.1 世界的多样性与物质统一性</h3><h4 id="1-1-1-物质及其存在方式"><a class="header-anchor" href="#1-1-1-物质及其存在方式">¶</a>1.1.1 物质及其存在方式</h4><p>全部哲学的基本问题： 存在和思维的关系问题（物质和意识的关系问题）</p><p>哲学基本问题主要包括两方面内容：</p><ul><li>谁为本原（何者为第一性）——唯心主义&amp;唯物主义</li><li>是否具有同一性的问题（思维能否正确地反映存在、人能否认识或彻底认识世界的问题）——可知论&amp;不可知论</li></ul><p>唯物主义哲学的理论基石：物质范畴</p><p>哲学中，物质的定义：</p><ul><li>物质是不依赖于人类的意识而存在，并能为人类的意识所反映的客观实在。</li></ul><p>马克思主义的物质观：<strong>客观实在性</strong>是物质的唯一特性。</p><ol><li>坚持唯物主义一元论</li><li>坚持能动的反映论和可知论</li><li>唯物论和辩证法的统一</li><li>唯物主义自然观与历史观的统一。</li></ol><p>物质的根本属性：</p><ul><li><p>物质的根本属性是运动。</p></li><li><p>运动绝对，静止相对（空间相对位置、事物根本属性的相对静止）</p></li><li><p>基本存在属性：时间（一维性）和空间（三维性）</p><p>两者不可分割，证明了两者客观性。</p></li><li><p>物质、运动、时间、空间具有内在的统一性，要求我们想问题要看具体时间地点条件</p></li></ul><p>物质世界的二重化</p><ul><li>世界分化为自然界与人类社会</li><li>世界分化为客观世界和主观世界</li><li>人的实践活动是分化和统一的关键</li></ul><h4 id="1-1-2-物质与意识的辩证关系"><a class="header-anchor" href="#1-1-2-物质与意识的辩证关系">¶</a>1.1.2 物质与意识的辩证关系</h4><ul><li><p>物质决定意识</p><ul><li>意识<ul><li>人脑的机能和属性</li><li>客观世界的主观映象</li><li>客观内容和主观形式的统一</li><li>物质对意识的决定作用表现在意识的起源和本质上</li></ul></li></ul></li><li><p>意识对物质具有反作用</p><ul><li>目的性、计划性</li><li>创造性</li><li>指导实践改造客观世界的作用</li><li>调控人的行为和生理活动的作用</li></ul></li><li><p>主观能动性和客观规律性的统一</p><ul><li><p>尊重客观规律是正确发挥主观能动性的前提</p></li><li><p>只有充分发挥主观能动性，才能正确认识和利用客观规律</p><ul><li>前提：从实际出发</li><li>根本途径：实践</li><li>依赖于物质条件和物质手段</li></ul></li><li><p>坚持遵循客观规律与发挥主观能动性相统一，要求充分发扬历史主动精神</p></li></ul></li><li><p>意识与人工智能</p><ul><li>人类意识是知情意的统一体，而人工智能只是对人类的理性智能的模拟和扩展</li><li>社会性是人的意识所固有的本质属性，而人工智能不可能真正具备人类的社会属性</li><li>人类的自然语言是思维的物质外壳和意识的现实形式，而人工智能难以完全具备理解自然语言真实意义的能力</li><li>人工智能能够获得人类意识中可以化约为数字信号的内容，但人脑中总有许多东西是无法被化约的</li></ul></li></ul><p>规律：</p><ul><li>规律是事物变化发展过程中本身所固有的内在的、本质的、必然的联系</li></ul><h4 id="1-1-3世界的物质统一性"><a class="header-anchor" href="#1-1-3世界的物质统一性">¶</a>1.1.3世界的物质统一性</h4><p>世界的统一性在于它的物质性，世界统一于物质。这是辩证唯物主义最基本、最核心的观点，是马克思主义的基石</p><ul><li>自然界是物质的。</li><li>人类社会本质上是生产实践基础上形成的物质体系。</li><li>人的意识统一于物质。</li></ul><h3 id="⭐️1-2-事物的普遍联系和变化发展"><a class="header-anchor" href="#⭐️1-2-事物的普遍联系和变化发展">¶</a>⭐️1.2 事物的普遍联系和变化发展</h3><h4 id="1-2-1-联系和发展的普遍性"><a class="header-anchor" href="#1-2-1-联系和发展的普遍性">¶</a>1.2.1 联系和发展的普遍性</h4><p>联系和发展的观点是唯物辩证法的总观点，集中体现了唯物辩证法的总特征。</p><p>事物的普遍联系：</p><ul><li><p>客观性 ，坚持联系的客观性，就是在联系的观点上坚持了唯物论</p></li><li><p>普遍性 （三重含义）</p><ul><li>事物内部不同部分和要素之间相互联系（内在结构性）</li><li>任何事物不能孤立存在，都同其他事物处于一定的联系之中</li><li>整个世界是相互联系的统一整体</li></ul></li><li><p>多样性</p><ul><li>直接联系与间接联系</li><li>内部联系与外部联系</li><li>本质联系与非本质联系</li><li>必然联系与偶然联系</li></ul></li><li><p>条件性</p><ul><li>支持或制约作用</li><li>条件可以改变</li><li>改变和创造条件不是任意的</li></ul></li></ul><p>事物的变化发展：</p><ul><li><p>实质：新事物的产生和旧事物的灭亡</p><ul><li>判断新旧，不在于形式与出现时间先后</li><li>新事物是指合乎历史前进方向、具有远大前途的东西</li><li>旧事物是指丧失历史必然性、日趋灭亡的东西。</li></ul></li><li><p>在新陈代谢的发展中，新事物不可战胜的</p><ul><li>新事物与环境：有新的要素、结构和功能，它适应已经变化了的环境和条件</li><li>新事物与旧事物：新事物是在旧事物的“母体”中孕育成熟的，否定了旧事物中消极腐朽的东西，又保留了旧事物中合理的、适应新条件的因素，并添加了旧事物所不能容纳的新内容。</li><li><strong>社会历史领域</strong>：根本上符合人民群众的利益和要求，能够得到人民群众的拥护，因而必然战胜旧事物。</li></ul></li></ul><h4 id="1-2-2-对立统一规律是事物发展的根本规律"><a class="header-anchor" href="#1-2-2-对立统一规律是事物发展的根本规律">¶</a>1.2.2 对立统一规律是事物发展的根本规律</h4><ul><li>对立统一规律是唯物辩证法的实质和核心。</li><li>对立统一规律揭示了事物普遍联系的根本内容和变化发展的内在动力，从根本上回答了事物为什么会发展的问题。</li></ul><p>事物变化发展的一般规律</p><ul><li>对立统一规律 （根本规律）（内在动力）</li><li>量变质变规律（状态、过程和趋势）</li><li>否定之否定规律（状态、过程和趋势）</li></ul><p>矛盾是反映事物内部、之间对立统一关系</p><ul><li><p>基本属性：对立（斗争性）和统一（同一性），两者相互依存、相互转化</p></li><li><p>同一性作用</p><ul><li>是事物存在和发展的前提</li><li>使矛盾双方相互吸取有利于自身的因素，在相互作用中各自得到发展</li><li>同一性规定着事物转化的可能和发展的趋势</li></ul></li><li><p>矛盾的斗争性在事物发展中的作用表现在：</p><ul><li>矛盾双方的斗争促进矛盾双方力量的变化，造成双方力量发展的不平衡，为对立面的转化、事物的质变创造条件</li><li>矛盾双方的斗争是一种矛盾统一体向另一种矛盾统一体过渡的决定性力量。</li></ul></li><li><p>矛盾的同一性和斗争性相互联结、相辅相成</p><ul><li><p>没有斗争性就没有同一性，没有同一性也没有斗争性</p></li><li><p>斗争性寓于同一性之中，同一性通过斗争性来体现。</p></li><li><p>矛盾的同一性是有条件的、相对的，矛盾的斗争性是无条件的、绝对的</p></li><li><p>矛盾的同一性和斗争性相结合，构成了事物的矛盾运动，推动着事物的变化发展</p><p>要善于把二者结合起来</p></li></ul></li></ul><h5 id="⭐️1-2-2-2-矛盾的普遍性和特殊性及其相互关系"><a class="header-anchor" href="#⭐️1-2-2-2-矛盾的普遍性和特殊性及其相互关系">¶</a>⭐️1.2.2.2 矛盾的普遍性和特殊性及其相互关系</h5><p>矛盾的普遍性：矛盾存在于一切事物的一切发展过程中</p><p>矛盾的特殊性：每个事物、阶段各有其特点；决定了事物的不同性质。</p><p>事物的性质是由主要矛盾的主要方面所决定的：</p><ul><li>主要矛盾&amp;次要矛盾</li><li>在每一对矛盾中，主要方面&amp;次要方面。</li></ul><p>要坚持“两点论”和“重点论”的统一：</p><ul><li><p>“两点论”</p><ul><li>不仅要看到矛盾双方的对立，而且要看到矛盾双方的统一；</li><li>不仅要看到矛盾体系中存在主要矛盾、矛盾的主要方面， 而且要看到次要矛盾、矛盾的次要方面。</li></ul></li><li><p>“重点论”是指要着重把握主要矛盾、矛盾的主要方面，并以此作为解决问题的出发点。</p></li><li><p>“两点论”和 “重点论”的统一要求我们，看问题既要全面地看，又要看主流、大势、发展趋势</p></li></ul><p>矛盾的普遍性与特殊性的辩证统一关系：矛盾的普遍性和特殊性是辩证统一、相互联系、不可分割的：p47</p><ul><li>矛盾的共性是无条件的、绝对的，矛盾的个性是有条件的、相对的。</li><li>普遍性寓于特殊性之中</li><li>特殊性包含普遍性</li><li>普遍性和特殊性在一定条件下相互转化（对于范围的视角的变化）</li></ul><h5 id="1-2-2-3-量变质变规律和否定之否定规律"><a class="header-anchor" href="#1-2-2-3-量变质变规律和否定之否定规律">¶</a>1.2.2.3 量变质变规律和否定之否定规律</h5><h6 id="量变质变的辩证关系"><a class="header-anchor" href="#量变质变的辩证关系">¶</a>量变质变的辩证关系</h6><ol><li>量变是质变的必要准备：质变以量变积累为前提</li><li>质变是量变的必然结果，并为新的量变开辟道路：量变积累达到一定程度，突破界限时，必然引起质变</li><li>量变和质变相互渗透</li></ol><ul><li>量变过程包含着部分质变/阶段性质变。</li><li>质变过程包含着量的扩张或收缩</li></ul><p>事物的发展表现为：由量变到质变，在新质的基础上又开始新的量变，再到新的质变，如此循环往复，不断前进。</p><p>量变质变规律体现了事物发展的<strong>渐进性</strong>和<strong>飞跃性</strong>的统一。</p><p>量变质变规律的方法论意义：重视量的积累；抓住时机，促成质变</p><h6 id="否定之否定规律"><a class="header-anchor" href="#否定之否定规律">¶</a>否定之否定规律</h6><p>事物的发展：通过其内在矛盾运动以自我否定的方式而实现的</p><p>否定之否定规律：揭示事物自己发展自己的完整过程及本质。</p><p>唯物辩证法的否定观（否定的深刻内涵）</p><ul><li>事物内部存在肯定因素（维持现存事物存在）和否定因素（促使现存事物灭亡）</li><li>是自我否定、自我发展，是事物内部矛盾运动的结果，非外力强加</li><li>是发展的环节、通过且仅通过否定，旧事物向新事物转变</li><li>联系的环节： 新旧事物是通过否定环节联系起来的。</li><li>辩证否定的实质是“扬弃”，即新事物对旧事物既批判又继承，既克服其消极因素又保留其积极因素</li></ul><p>事物的辩证否定经过三个阶段：肯定一否定一否定之否定</p><ol><li>事物发展的周期性：一个新的、更高层次的肯定阶段，然后又开始新的否定之否定的螺旋上升过程。</li><li>前进性（每一次否定都是质变）和曲折性（前进性是趋势，但是并非一帆风顺）的统一</li><li>扬弃： 克服其消极的、过时的因素，保留和发扬其积极的、合理的因素，并增添新的内容</li></ol><h5 id="1-2-2-4-联系和发展的基本环节"><a class="header-anchor" href="#1-2-2-4-联系和发展的基本环节">¶</a>1.2.2.4 联系和发展的基本环节</h5><p>内容与形式、本质与现象、原因与结果、必然与偶然、现实与可能</p><h2 id="2-实践与认识及其发展规律"><a class="header-anchor" href="#2-实践与认识及其发展规律">¶</a>2 实践与认识及其发展规律</h2><h3 id="2-1-实践与认识"><a class="header-anchor" href="#2-1-实践与认识">¶</a>2.1 实践与认识</h3><h4 id="2-1-1-科学实践观（不断丰富发展的）"><a class="header-anchor" href="#2-1-1-科学实践观（不断丰富发展的）">¶</a>2.1.1 科学实践观（不断丰富发展的）</h4><p>意义：</p><ul><li>克服旧唯物主义缺陷，为辩证唯物主义奠定理论基础</li><li>揭示了实践对认识的决定作用，为能动的、革命的反映论的创立奠定了科学的理论基础</li><li>第一次揭示了社会生活的实践本质</li><li>为人们能动地认识世界和改造世界提供了基本的思想方法和工作方法</li></ul><h4 id="2-1-2-实践的本质与基本结构"><a class="header-anchor" href="#2-1-2-实践的本质与基本结构">¶</a>2.1.2 实践的本质与基本结构</h4><h5 id="2-1-2-1-实践的本质"><a class="header-anchor" href="#2-1-2-1-实践的本质">¶</a>2.1.2.1 实践的本质</h5><p>实践：人类能动地改造世界的社会性的物质活动</p><p>特征：<strong>客观实在性、自觉能动性和社会历史性</strong></p><h5 id="2-1-2-2-实践的基本结构"><a class="header-anchor" href="#2-1-2-2-实践的基本结构">¶</a>2.1.2.2 实践的基本结构</h5><p>三项基本要素：实践的主体、客体和中介</p><p>实践的主体、客体关系：<strong>实践关系（根本）、认识关系和价值关系</strong></p><p>实践基本结构发展，表现为主体客体化和客体主体化的双向运动</p><p>主体客体化：简单来说就是主体基于主观意识对于客体的改造与创造</p><p>客体主体化：简单来说就是主体使用客体，将其内化为一种发展主体的工具</p><p>两者都既有物质层面，又有精神层面</p><h5 id="2-1-2-3-实践形式的多样性"><a class="header-anchor" href="#2-1-2-3-实践形式的多样性">¶</a>2.1.2.3 实践形式的多样性</h5><ul><li>物质生产实践</li><li>社会政治实践</li><li>科学文化实践</li><li>（产生新的实践形式：虚拟实践）</li></ul><h5 id="2-1-2-4-实践对认识的决定作用"><a class="header-anchor" href="#2-1-2-4-实践对认识的决定作用">¶</a>2.1.2.4 实践对认识的决定作用</h5><p>实践是认识的基础，有决定作用</p><ol><li>实践是认识的来源（与世界相互作用形成感性认识，大脑加工形成理性认识；直接（主要）、间接经验）</li><li>实践是认识发展的动力（根本动力、提供必要条件、实践本身也会增加认识）</li><li>实践是认识的目的</li><li>实践是检验认识真理性的唯一标准</li></ol><ul><li>认识具有真理性与否只有在实践中才能得到验证。</li><li>实践标准的确定性 （唯一标准） 与不确定性 （历史发展性） 是辩证统一的。</li></ul><h4 id="2-1-3-认识的本质与过程"><a class="header-anchor" href="#2-1-3-认识的本质与过程">¶</a>2.1.3 认识的本质与过程</h4><h5 id="2-1-3-1-认识的本质"><a class="header-anchor" href="#2-1-3-1-认识的本质">¶</a>2.1.3.1 认识的本质</h5><p>辩证唯物主义认识论（反映论）：认识的本质是主体在实践基础上对客体的能动反映。这种能动反映具有两个基本特征：</p><ul><li>反映性：人类认识的基本规定性，指认识必须以客观事物为原型，在思维中再现其状态、属性和本质</li><li>能动的创造性：一种在思维中进行的能动、创造性的活动，人需要透过现象把握本质，用辩证思维方法在观念中加工和改造对象</li></ul><p>两者辩证统一、不可分割的。它们不是同一本质的两个方面：</p><ul><li>创造离不开反映：创造过程是在对多个方面进行反映的基础上实现的。</li><li>反映也离不开创造：反映是在创造过程中实现的。</li></ul><p>两种错误的倾向及其危害：</p><ul><li>只坚持反映性而忽视创造性，会重蹈旧唯物主义直观反映论的覆辙。</li><li>只坚持创造性而脱离反映的前提，会使创造变成主观随意，从而滑向唯心主义和不可知论。</li></ul><h5 id="2-1-3-2-从实践到认识"><a class="header-anchor" href="#2-1-3-2-从实践到认识">¶</a>2.1.3.2 从实践到认识</h5><p>认识的过程：认识到实践，实践再到认识</p><p>实践与认识的两次飞跃：</p><ul><li>实践与认识的辨证运动，是一个由感性认识到理性认识，又由理性认识到实践的飞跃。</li></ul><p>感性认识和理性认识的辩证关系：</p><ul><li>感性认识（直接，包括感觉（各个感觉）-&gt;知觉（整体反应）-&gt;表象（对过去感觉、直觉的回忆））</li><li>理性认识（概念-&gt;判断-&gt;推理）</li><li>理性认识依赖于感性认识（认识论的唯物论）</li><li>感性认识有待于发展和深化为理性认识</li><li>感性认识和理性认识相互渗透、相互包含</li><li>感性认识到理性认识条件：实践-&gt;思考</li><li>认识过程中有非理性因素</li></ul><h5 id="2-1-3-3-从认识到实践"><a class="header-anchor" href="#2-1-3-3-从认识到实践">¶</a>2.1.3.3 从认识到实践</h5><p>从认识回到实践的必要性和重要性：</p><ol><li>认识世界的目的是改造世界：</li><li>认识的真理性只有在实践中才能得到检验和发展：</li></ol><h4 id="2-1-4-实践与认识的辨证运动及其规律"><a class="header-anchor" href="#2-1-4-实践与认识的辨证运动及其规律">¶</a>2.1.4 实践与认识的辨证运动及其规律</h4><ul><li><p>说实践与认识“完成了”，是针对具体事物的认识而言的</p><p>实现预期目的，使预想的思想、理论或计划在实践中大体变为事实，部分甚至全部调整</p></li><li><p>说它“又没有完成”，是针对实践和认识运动的持续发展而言的</p><ul><li>人类的实践是不断向前推移和发展的，因此人们的认识也必须随之发展</li><li>客观现实世界的运动变化永不完结，因此人们在实践中对真理的认识也永远没有完结</li></ul></li></ul><h3 id="2-2-真理与价值"><a class="header-anchor" href="#2-2-真理与价值">¶</a>2.2 真理与价值</h3><h4 id="2-2-1-真理的客观性、绝对性和相对性"><a class="header-anchor" href="#2-2-1-真理的客观性、绝对性和相对性">¶</a>2.2.1 真理的客观性、绝对性和相对性</h4><p>真理的定义： 标志主观与客观相符合的哲学范畴，是对客观事物及其规律的正确反映。</p><p>真理的客观性： 真理的内容是对客观事物及其规律的正确反映（决定真理（内容而非形式）的一元性）</p><p>真理的绝对性和相对性：</p><ul><li><p>真理的绝对性 ：主客观统一的确定性、发展的无限性</p></li><li><p>真理的相对性：在一定条件下对客观事物及其本质和发展规律的正确认识总是有限度的、不完善的</p><ul><li>客观世界的整体来看，任何真理都只是对客观世界的某一阶段、某一部分的正确认识，有待扩展</li><li>就特定事物而言，任何真理都只是对客观对象一定方面、一定层次和一定程度的正确认识，任何真理都只能是主观对客观事物近似正确即相对正确的反映</li></ul></li><li><p>真理的绝对性和相对性的辩证统一</p><ul><li>两重性：两者相互包含</li><li>发展上：人类的认识是一个无限的过程，永远在从相对真理走向、接近绝对真理。</li></ul></li><li><p>真理与谬误的对立统一</p><ul><li>在确定的对象和范围内，两者相互对立</li><li>在一定范围内才有绝对的意义，超出之后就相对了</li></ul></li></ul><h4 id="2-2-2-真理的检验标准"><a class="header-anchor" href="#2-2-2-真理的检验标准">¶</a>2.2.2 真理的检验标准</h4><h5 id="2-2-2-2实践是检验真理的唯一标准"><a class="header-anchor" href="#2-2-2-2实践是检验真理的唯一标准">¶</a>2.2.2.2实践是检验真理的唯一标准</h5><p>实践之所以能够作为检验真理的唯一标准，是由真理的本性和实践的特点决定的。</p><ul><li>本性：真理是人们对客观事物及其发展规律的正确反映，其本性在于主观和客观相符合。</li><li>实践：实践具有<strong>直接现实性</strong>。实践的直接现实性是它的客观实在性的具体表现。</li></ul><h5 id="2-2-2-3-实践标准的确定性与不确定性"><a class="header-anchor" href="#2-2-2-3-实践标准的确定性与不确定性">¶</a>2.2.2.3 实践标准的确定性与不确定性</h5><p>确定性：绝对性，是指实践作为检验真理标准的唯一性、归根到底性、最终性</p><p>不确定性：相对性，实践作为检验真理标准的条件性</p><ul><li>实践受到<strong>主客观</strong>制约</li><li>实践收到<strong>历史条件</strong>限制</li></ul><h4 id="2-2-3-真理与价值的辩证统一"><a class="header-anchor" href="#2-2-3-真理与价值的辩证统一">¶</a>2.2.3 真理与价值的辩证统一</h4><h5 id="2-2-3-1-价值"><a class="header-anchor" href="#2-2-3-1-价值">¶</a>2.2.3.1 价值</h5><p>主体性、客观性、多维性和社会历史性</p><ul><li><p>价值的主体性：直接与主体相联系，始终以主体为中心</p><ul><li>价值关系的形成依赖于主体的存在</li><li>价值关系的形成依赖于主体的创造，使客体潜在的价值转化为现实的价值</li></ul></li><li><p>价值的客观性：一定条件下客体对于主体的意义不依赖于主体的主观意识而存在</p><ul><li>主体的存在和需要是客观的，而不是抽象的</li><li>客体的存在、属性及作用是客观的</li></ul></li><li><p>价值的多维性：同一客体相对于主体的不同需要会产生不同的价值</p></li><li><p>价值的社会历史性：主体和客体的不断变化决定了价值的历史性</p></li></ul><h5 id="2-2-3-3-价值评价及其特点"><a class="header-anchor" href="#2-2-3-3-价值评价及其特点">¶</a>2.2.3.3 价值评价及其特点</h5><p>价值评价是对客观价值关系的主观反映</p><ul><li>评价以主客体之间的价值关系为认识对象</li><li>评价结果与评价主体直接相关</li><li>评价结果的正确与否依赖于对客体状况和主体需要的认识</li><li>评价结果有正确与错误之分，价值评价也有科学与非科学之别</li></ul><h5 id="2-2-3-5真理与价值在实践中的辩证统一"><a class="header-anchor" href="#2-2-3-5真理与价值在实践中的辩证统一">¶</a>2.2.3.5真理与价值在实践中的辩证统一</h5><p>人们的实践活动总是受着真理尺度和价值尺度的制约</p><p>辩证关系：</p><ul><li>价值尺度必须以真理为前提，脱离了真理尺度，价值尺度就偏离了合理的、正确的轨道</li><li>人类自身需要的内在尺度，推动着人们不断发现新的真理，脱离了价值尺度，真理就缺失了主体意义</li></ul><p>实践的具体性和历史性-&gt;真理尺度与价值尺度的统一也是具体的、历史的</p><p>两者是否达成统一，用实践验证</p><h3 id="2-3-认识世界和改造世界"><a class="header-anchor" href="#2-3-认识世界和改造世界">¶</a>2.3 认识世界和改造世界</h3><h4 id="2-3-1-认识世界的根本目的在于改造世界"><a class="header-anchor" href="#2-3-1-认识世界的根本目的在于改造世界">¶</a>2.3.1 认识世界的根本目的在于改造世界</h4><h5 id="2-3-1-1-认识世界和改造世界有辩证关系"><a class="header-anchor" href="#2-3-1-1-认识世界和改造世界有辩证关系">¶</a>2.3.1.1 认识世界和改造世界有辩证关系</h5><p>认识世界有助于改造世界</p><p>人们只有在改造世界的实践中才能不断地深化、拓展对世界的正确认识</p><h5 id="2-3-1-2-改造客观世界和改造主观世界及其辩证关系"><a class="header-anchor" href="#2-3-1-2-改造客观世界和改造主观世界及其辩证关系">¶</a>2.3.1.2 改造客观世界和改造主观世界及其辩证关系</h5><p>只有在改造客观世界的实践中，才能深入改造主观世界</p><p>只有认真改造主观世界，才能更好地改造客观世界</p><h5 id="2-3-1-3-认识世界和改造世界的过程是从必然走向自由的过程"><a class="header-anchor" href="#2-3-1-3-认识世界和改造世界的过程是从必然走向自由的过程">¶</a>2.3.1.3 认识世界和改造世界的过程是从必然走向自由的过程</h5><p>自由的条件：</p><ol><li>认识条件：对客观事物（的发展）的正确认识</li><li>实践条件：能够将获得的规律性认识运用于指导实践，实现改造世界的目的</li></ol><h2 id="3-人类社会及其发展规律"><a class="header-anchor" href="#3-人类社会及其发展规律">¶</a>3 人类社会及其发展规律</h2><h3 id="3-1-人类社会的存在与发展"><a class="header-anchor" href="#3-1-人类社会的存在与发展">¶</a>3.1 人类社会的存在与发展</h3><h4 id="3-1-1-社会存在与社会意识"><a class="header-anchor" href="#3-1-1-社会存在与社会意识">¶</a>3.1.1 社会存在与社会意识</h4><p>社会存在：社会物质生活条件，是社会生活的物质方面</p><ul><li>自然地理环境</li><li>人口因素</li><li>物质生产方式<ul><li>是人类社会赖以存在和发展的基础，是人类其他一切活动的首要前提。</li><li>决定社会的结构、性质和面貌</li><li>决定整个社会历史的变化发展，决定社会形态从低级向高级的更替和发展。</li></ul></li></ul><p>社会意识：社会存在的反映，是社会生活的精神方面</p><ul><li>意识形态（政治法律思想、道德、艺术、宗教、哲学等）</li><li>非意识形态（自然科学和语言学、形式逻辑）</li></ul><p>社会存在与社会意识的辩证关系：</p><ul><li><p>社会存在决定社会意识</p><ul><li>社会存在是社会意识内容的客观来源，社会意识是社会物质生活过程及其条件的主观反映</li><li>社会意识是人们进行社会物质交往的产物。</li><li>社会意识是具体的、历史的。</li></ul></li><li><p>社会意识是社会存在的反映，并反作用于社会存在 （社会意识具有相对独立性）：</p><ul><li>社会意识与社会存在发展具有不完全同步性和不平衡性</li><li>社会意识内部各种形式之间存在相互影响且各自具有历史继承性</li><li>社会意识对社会存在具有能动的反作用，这是社会意识相对独立性的突出表现。</li></ul></li></ul><h4 id="3-1-2-社会基本矛盾及其运动规律"><a class="header-anchor" href="#3-1-2-社会基本矛盾及其运动规律">¶</a>3.1.2 社会基本矛盾及其运动规律</h4><h5 id="3-1-2-1-生产力与生产关系的矛盾运动及其规律"><a class="header-anchor" href="#3-1-2-1-生产力与生产关系的矛盾运动及其规律">¶</a>3.1.2.1 生产力与生产关系的矛盾运动及其规律</h5><p>生产力： 生产实践中所需的物质力量，客观现实性、社会历史性</p><ul><li>基本要素包括：劳动资料、劳动对象、劳动者</li><li>劳动者是生产力中最重要、最活跃、起决定性作用的因素。</li><li>在生产过程中，劳动者使用劳动资料，作用于劳动对象，从而生产出物质产品。劳动资料和劳动对象合称为 “生产资料”。</li></ul><p>科学技术是生产力中的重要因素：</p><ul><li>引起劳动资料、劳动对象和劳动者素质的深刻变革和巨大进步</li><li>提高管理效率</li><li>提高劳动生产率</li><li><strong>科学技术是第一生产力</strong></li></ul><p>生产关系：生产关系是人们在物质生产过程中形成的不以人的意志为转移的经济关系，其中<strong>生产资料所有制</strong>关系最基本，目前公有制和私有制并存</p><p>生产力与生产关系的相互关系是</p><ul><li><p>生产力决定生产关系。</p><ul><li>生产力状况决定生产关系的性质</li><li>生产力的发展决定生产关系的变化。生产关系是生产力发展需要的产物，只有当它为生产力提供足够的发展空间时才能够存在。</li></ul></li><li><p>生产关系对生产力具有能动的反作用</p><ul><li>当生产关系适合生产力发展的客观要求时，对生产力的发展起推动作用</li><li>当生产关系不适合生产力发展的客观要求时，就会阻碍生产力的发展。</li></ul></li></ul><h5 id="3-1-2-2-经济基础与上层建筑的矛盾运动及其规律"><a class="header-anchor" href="#3-1-2-2-经济基础与上层建筑的矛盾运动及其规律">¶</a>3.1.2.2 经济基础与上层建筑的矛盾运动及其规律</h5><p>经济基础：</p><ul><li>经济基础是指由社会一定发展阶段的生产力所决定的生产关系的总和。</li><li>决定一个社会性质的是其中<strong>占支配地位的生产关系</strong>。</li></ul><p>上层建筑：</p><ul><li>上层建筑是建立在一定经济基础之上的意识形态以及与之相适应的制度、组织和设施</li><li><strong>政治上层建筑</strong>居于主导地位</li></ul><p>国家政权：用暴力把社会冲突保持在秩序范围内</p><ul><li>在整个上层建筑中，<strong>政治上层建筑</strong>居于主导地位，<strong>国家政权</strong>是政治上层建筑的核心</li><li>国体：社会各阶级在国家中的地位</li><li>政体：统治阶级用何形式组织自己的政权</li></ul><p>经济基础与上层建筑的辩证统一关系：</p><ul><li><p>经济基础决定上层建筑。</p><ul><li>决定其产生（怎样的上层建筑）</li><li>决定其性质（为谁服务）</li><li>决定其变更</li></ul></li><li><p>上层建筑对经济基础具有反作用。</p><ul><li>上层建筑积极地服务于经济基础。</li><li>促进作用：当上层建筑适合经济基础状况时，促进经济基础的巩固和发展</li><li>阻碍作用：当上层建筑不适合经济基础状况时，阻碍新的、先进的经济基础的形成和发展。</li></ul></li><li><p>再次，经济基础与上层建筑的相互作用构成二者的矛盾运动</p><ul><li>上层建筑的不完善部分、没有反映经济基础要求的部分同经济基础发生矛盾</li><li>现在占统治地位的经济基础同旧上层建筑的残余、未来上层建筑的萌芽之间的矛盾，新旧上层建筑之间、新旧经济基础之间的矛盾</li><li>社会形态上升时，上层建筑适应经济基础，下降时则为对抗</li></ul></li><li><p>最后，经济基础和上层建筑之间的内在联系构成了上层建筑“一定要适合”经济基础状况的规律</p><ul><li>经济基础状况决定上层建筑的发展方向，决定上层建筑相应的调整或变革；</li><li>上层建筑的反作用也必须取决于和服从于经济基础的性质和客观要求</li></ul></li></ul><h4 id="3-1-3-交往"><a class="header-anchor" href="#3-1-3-交往">¶</a>3.1.3 交往</h4><p>作用：</p><ol><li>促进生产力的发展</li><li>促进社会关系的进步</li><li>促进文化的发展与传播</li><li>促进人的全面发展</li></ol><h4 id="3-1-4-社会进步与社会形态更替"><a class="header-anchor" href="#3-1-4-社会进步与社会形态更替">¶</a>3.1.4 社会进步与社会形态更替</h4><p>社会形态从低级到高级的发展、同一社会形态内部的发展，社会进步促进人的发展、推动人类解放</p><p>社会形态更替的统一性和多样性：</p><ul><li>统一性：原始社会、奴隶社会、封建社会、资本主义社会和共产主义社会依次更替</li><li>多样性：可能跨越，可能不典型，可能迅速缓慢，可能曲折</li></ul><p>社会形态更替的必然性与选择性：</p><ul><li><p>必然性</p><ul><li>社会形态依次更替客观</li><li>生产力与生产关系矛盾运动的规律性，从根本上规定了社会形态更替的必然性</li></ul></li><li><p>选择性</p><ul><li>必然性造成了社会发展的基本趋势，为选择性提供空间</li><li>主观能动性与客观规律性相统一的过程</li><li>人们的历史选择性归根结底是人民群众的选择性</li></ul></li></ul><h3 id="3-2-社会发展的动力"><a class="header-anchor" href="#3-2-社会发展的动力">¶</a>3.2 社会发展的动力</h3><h4 id="3-2-1-社会基本矛盾是历史发展的根本动力"><a class="header-anchor" href="#3-2-1-社会基本矛盾是历史发展的根本动力">¶</a>3.2.1 社会基本矛盾是历史发展的根本动力</h4><p>社会基本矛盾：</p><ul><li><strong>生产力与生产关系之间的矛盾</strong>（根本）</li><li>经济基础与上层建筑之间的矛盾（体现）</li></ul><p>作用体现在：</p><ol><li>生产力是社会基本矛盾运动中最基本的动力因素<ul><li>生产力是社会存在和发展的物质基础</li><li>生产力决定生产关系的性质</li><li>生产力是社会进步的根本内容</li></ul></li><li>社会基本矛盾特别是生产力和生产关系的矛盾，决定着社会中其他矛盾的存在和发展<ul><li>生产力和生产关系的矛盾决定经济基础和上层建筑的矛盾的产生和发展</li><li>经济基础和上层建筑的矛盾也会影响和制约生产力和生产关系的矛盾</li></ul></li><li>社会基本矛盾具有不同的表现形式和解决方式<ul><li>社会形态改变：革命</li><li>统一社会形态的发展：改革</li></ul></li></ol><p>社会主要矛盾：不同于基本矛盾，会不断向下变化，是基本矛盾的体现</p><ul><li>社会主要矛盾双方的内容发生一定变化</li><li>矛盾的地位发生变化</li></ul><h4 id="3-2-2-阶级斗争、社会革命在社会发展中的作用"><a class="header-anchor" href="#3-2-2-阶级斗争、社会革命在社会发展中的作用">¶</a>3.2.2 阶级斗争、社会革命在社会发展中的作用</h4><ul><li>阶级斗争是社会基本矛盾在阶级社会中的表现</li><li>社会革命是社会基本矛盾所引起的广泛而深刻的社会变革的统称</li></ul><p>阶级斗争</p><ul><li>是阶级社会发展的直接动力</li><li>根源于阶级之间物质利益的根本对立，根源于社会经济关系的冲突</li><li>作用表现在社会形态的更替</li><li>受到一定社会历史条件的制约</li></ul><p>社会革命</p><ul><li>根源于社会基本矛盾的尖锐化，需要客观和主观条件</li><li>实现社会形态更替的重要手段和决定性环节</li></ul><p>改革</p><ul><li>为了解决社会基本矛盾而对生产关系和上层建筑进行的深刻的改变和革新</li><li>社会制度的自我调整和完善</li><li>量变和部分质变</li></ul><h4 id="3-2-3-科学技术在社会发展中的作用"><a class="header-anchor" href="#3-2-3-科学技术在社会发展中的作用">¶</a>3.2.3 科学技术在社会发展中的作用</h4><p>科技革命是推动经济和社会发展的强大杠杆</p><ul><li><p>对生产方式产生了深刻影响。</p><ul><li>改变了社会生产力的构成要素（使劳动力结构向着智能化趋势发展）</li><li>改变了人们的劳动形式（由机械自动化走向智能自动化、由局部自动化走向大系统管理和控制自动化的根本性变革）</li><li>改变了社会经济结构，特别是导致产业结构发生变革。（第三产业人数比例增长）</li></ul></li><li><p>对生活方式产生了巨大影响</p></li><li><p>促进了思维方式的变革</p></li></ul><h4 id="3-2-3-文化在社会发展中的作用"><a class="header-anchor" href="#3-2-3-文化在社会发展中的作用">¶</a>3.2.3 文化在社会发展中的作用</h4><p>文化是推动社会发展的重要力量，为社会发展提供：思想指引、精神动力、凝聚力量</p><h3 id="3-3-人民群众在历史发展中的作用"><a class="header-anchor" href="#3-3-人民群众在历史发展中的作用">¶</a>3.3 人民群众在历史发展中的作用</h3><h4 id="3-3-1-人民群众是历史的创造者"><a class="header-anchor" href="#3-3-1-人民群众是历史的创造者">¶</a>3.3.1 人民群众是历史的创造者</h4><p>唯物史观与唯心史观的对立，在历史创造者问题上表现为群众史观（唯物史观）与英雄史观（唯心史观）的对立。</p><p>群众史观并不否认英雄在历史上的重要作用。ta们顺应了历史发展的规律，反映人民群众的愿望和要求，加速历史的进程，无法改变其根本方向</p><p>唯物史观：</p><ul><li>立足于现实的人及其本质来把握历史的创造者</li><li>立足于整体的社会历史过程来探究谁是历史的创造者</li><li>唯物史观从社会历史发展的必然性入手来考察和说明谁是历史的创造者</li><li>唯物史观从人与历史关系的不同层次上考察谁是历史的创造者</li></ul><p>人民群众在创造历史过程中的决定作用：</p><ul><li>人民群众是社会历史的主体，是历史的创造者。</li><li>人民群众是社会物质财富的创造者（物质生产是基础，群众是生产者）</li><li>人民群众是社会精神财富的创造者（虽然常常由杰出的知识分子和艺术家集中体现，但其最终源泉依然是人民群众的社会实践。）</li><li>人民群众是社会变革的决定力量（阶级斗争的主力、社会革命的根本动力）</li></ul><h2 id="4-资本主义的本质及规律"><a class="header-anchor" href="#4-资本主义的本质及规律">¶</a>4 资本主义的本质及规律</h2><h3 id="4-1-商品经济和价值规律"><a class="header-anchor" href="#4-1-商品经济和价值规律">¶</a>4.1 商品经济和价值规律</h3><h4 id="4-1-1-商品经济的形成和发展"><a class="header-anchor" href="#4-1-1-商品经济的形成和发展">¶</a>4.1.1 商品经济的形成和发展</h4><p>自然经济：产的目的是直接满足生产者个人或经济单位的需要</p><ul><li>原始社会、奴隶社会、封建社会，因为生产力水平很低，社会分工极不发达</li></ul><p>商品经济：以交换为目的而进行生产的经济形式</p><ul><li>产生的历史条件：<ul><li>存在社会分工（前提）</li><li>生产资料和劳动产品属于不同的所有者（决定性）</li></ul></li></ul><p>商品的二因素：</p><ul><li>二因素：</li><li>使用价值（自然属性，客观、具体、商品价值的物质承载）</li><li>价值（社会属性，人脑力和体力的耗费，是由社会必要的劳动时间而非劳动者实际的劳动时间决定的）</li></ul><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">flowchart TD</span><br><span class="line">    A[一个物品存在]:::green --&gt; B&#123;是否有用&#125;:::green</span><br><span class="line">    B --&gt;|是| C&#123;是否人类劳动的产物&#125;:::green</span><br><span class="line">    B --&gt;|否| D[无用物]:::green</span><br><span class="line">    C --&gt;|是| E&#123;是否为了交换而生产&#125;:::green</span><br><span class="line">    C --&gt;|否| F[自然物（如空气）&lt;br&gt;有使用价值，无价值]:::green</span><br><span class="line">    E --&gt;|是| G[商品&lt;br&gt;有使用价值、价值]:::green</span><br><span class="line">    E --&gt;|否| H[自用品&lt;br&gt;有使用价值，无价值]:::green</span><br><span class="line"></span><br><span class="line">    classDef green fill:#e6ffe6,stroke:#2db300,color:#006600,text-align:center</span><br><span class="line">    class A,B,C,D,E,F,G,H green</span><br></pre></td></tr></table></figure><p>商品的使用价值和价值之间是对立统一的关系：</p><ul><li><p>对立性：</p><ul><li>商品的使用价值和价值是相互排斥的，生产者关心价值而不是使用价值，将使用价值让渡给购买者，才能取得价值</li></ul></li><li><p>统一性：</p><ul><li>作为商品，必须同时具有使用价值和价值两个因素</li><li>使用价值是价值的物质承担者，价值寓于使用价值之中</li></ul></li></ul><p>商品是劳动产品，生产商品的劳动具有二重性</p><ul><li>具体劳动：创造商品的使用价值（例如种地）</li><li>抽象劳动：形成商品的价值（例如劳动了5小时）</li></ul><p>劳动的二重性决定了商品的二因素：任何劳动，既是特殊的具体劳动，又是一般的抽象劳动</p><p>具体劳动和抽象劳动也是对立统一的关系：</p><ul><li>两者不独立存在，在时间上和空间上统一的两个方面</li><li>两者反映劳动的不同属性，前者自然属性，后者社会属性。</li></ul><p>商品价值量的决定</p><ul><li>第一层面：核心尺度是“社会必要劳动时间”，而非“个别劳动时间”</li><li>第二层面：价值量与“劳动生产率”成反比</li><li>第三层面：价值量以“简单劳动”为尺度，复杂劳动可换算（自发计算，而非主动计算，产生数倍于简单劳动的价值）</li></ul><h4 id="4-1-2-价值规律及其作用"><a class="header-anchor" href="#4-1-2-价值规律及其作用">¶</a>4.1.2 价值规律及其作用</h4><p>价值规律在市场配置资源过程中的作用表现在：</p><ul><li>自发地调节生产资料和劳动力在社会各生产部门之间的比例</li><li>自发地刺激社会生产力的发展</li><li>自发地调节社会收入的分配</li></ul><p>消极后果：</p><ul><li>社会资源浪费</li><li>阻碍技术进步</li><li>收入两极分化</li></ul><p>以私有制为基础的商品经济的基本矛盾：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">flowchart LR</span><br><span class="line">A[商品&lt;br&gt;使用价值与价值的矛盾]--&gt;|根源于|B[私人劳动与社会劳动的矛盾]</span><br><span class="line">C[生产商品&lt;br&gt;具体劳动和抽象劳动的矛盾]--&gt;|根源于|B</span><br><span class="line">B--&gt;|构成|D[商品经济的基本矛盾]</span><br><span class="line">classDef green fill:#e6ffe6,stroke:#2db300,color:#006600,text-align:center</span><br><span class="line">    class A,B,C,D,E,F,G,H green</span><br></pre></td></tr></table></figure><ul><li>理解：在私有制商品经济中，每个人的劳动表面上是为自己干的、独立的私人劳动，但本质上又是互相联系、 为社会生产的社会劳动。这两者之间存在着深刻的矛盾。这个矛盾需要通过市场交换来临时解决，但又因为解决得不彻底而不断引发新的矛盾，从而推动着整个商品经济的运行、发展乃至危机</li></ul><p>私人劳动和社会劳动的矛盾构成私有制基础上商品经济的基本矛盾</p><ul><li>决定着商品经济的本质及发展过程</li><li>是<strong>商品经济其他一切矛盾的基础</strong></li><li>决定着商品生产者的命运</li></ul><h3 id="4-2-资本主义经济制度"><a class="header-anchor" href="#4-2-资本主义经济制度">¶</a>4.2 资本主义经济制度</h3><h4 id="4-2-2-劳动力成为商品与货币转化为资本"><a class="header-anchor" href="#4-2-2-劳动力成为商品与货币转化为资本">¶</a>4.2.2 劳动力成为商品与货币转化为资本</h4><p>G代表货币，W代表商品</p><p>代表货币的货币：W-G-W</p><p>代表资本的货币：G-W-G'</p><p>劳动力：人的劳动能力，人的脑力和体力的总和，其成为商品的基本条件：</p><ul><li>劳动者在法律上是自由人，能够把自己的劳动力当作自己的商品来支配；</li><li>劳动者没有任何生产资料，没有生活资料来源，因而不得不依靠出卖劳动力为生。</li></ul><p>劳动力的价值：（生产、发展、维持和延续劳动力所必需的生活必需品的价值决定的）</p><ul><li>维持劳动者本人生存所必需的生活资料的价值；</li><li>维持劳动者家属的生存所必需的生活资料的价值;</li><li>劳动者接受教育和训练所支出的费用。</li><li>（通俗地讲，就是工人的“饭钱、房租、衣食住行、养家糊口”等费用的总和。）</li></ul><p>劳动力商品的特点：</p><ul><li>使用价值是价值的源泉，创造新的大于劳动力本身价值价值，而且这个新的价值比劳动力本身的价值更大。（因此产生了剩余价值）</li><li>因此：货币所有者购买到劳动力以后，在消费过程中，不仅能够收回他在购买这种特殊商品时支付的价值，还能得到一个增殖的价值即剩余价值。（为什么资本能够盈利）</li></ul><p>资本是能够带来剩余价值的价值。剩余价值是由雇佣工人的剩余劳动创造的。</p><h4 id="4-2-3-生产剩余价值是资本主义生产方式的绝对规律"><a class="header-anchor" href="#4-2-3-生产剩余价值是资本主义生产方式的绝对规律">¶</a>4.2.3 生产剩余价值是资本主义生产方式的绝对规律</h4><p>资本主义生产过程具有二重性，为以下两者的统一：</p><ul><li>生产物质资料的劳动过程；</li><li>生产剩余价值的过程</li></ul><p>雇佣工人的劳动分为两部分：</p><ul><li>必要劳动，用于再生产劳动力的价值</li><li>剩余劳动，用于无偿地为资本家生产剩余价值。</li></ul><p>不变资本与可变资本： p211</p><ul><li><p>不变资本是以生产资料形态存在的资本</p><p>生产资料的价值通过工人的具体劳动被转移到新产品中，其转移的价值量不会大于它原有的价值量。（只转移，不增值）</p></li><li><p>可变资本是用来购买劳动力的那部分资本</p><p>可变资本的价值在生产过程中不是被转移到新产品中去，而是由工人的劳动再生产出来。</p></li></ul><p>要确定资本家对工人的剥削程度，就应该用剩余价值和雇佣劳动者的可变资本相比，而不应该把它去同全部资本相比</p><h5 id="4-2-3-2-剩余价值生产的两种方法"><a class="header-anchor" href="#4-2-3-2-剩余价值生产的两种方法">¶</a>4.2.3.2 剩余价值生产的两种方法</h5><p>绝对剩余价值生产：劳动时间不变，延长工作日长度/提高劳动强度</p><p>相对剩余价值生产：指在工作日长度不变的条件下，通过缩短必要劳动时间而相对延长剩余劳动时间所生产的剩余价值（提高社会劳动生产率）</p><h5 id="4-2-3-3-资本积累"><a class="header-anchor" href="#4-2-3-3-资本积累">¶</a>4.2.3.3 资本积累</h5><ul><li><p>资本积累：剩余价值的资本化</p></li><li><p>资本积累的源泉是剩余价值</p></li><li><p>资本积累规模的大小取决于</p><ul><li>资本家对工人的剥削程度</li><li>劳动生产率的高低</li><li>所用资本和所费资本之间的差额</li><li>资本家预付资本的大小。</li></ul></li><li><p>导致财富占有两极分化、失业现象</p></li></ul><h4 id="4-2-4-资本主义的基本矛盾与经济危机"><a class="header-anchor" href="#4-2-4-资本主义的基本矛盾与经济危机">¶</a>4.2.4 资本主义的基本矛盾与经济危机</h4><p>资本主义基本矛盾：p225</p><ul><li><p>生产社会化和生产资料资本主义私人占有之间的矛盾，是资本主义的基本矛盾。</p></li><li><p>在现实中主要表现为两大具体矛盾：</p><ul><li>单个企业内部生产的有组织性和整个社会生产的无政府状态之间的矛盾。</li><li>资本主义生产无限扩大的趋势与劳动人民有支付能力的需求相对缩小之间的矛盾。</li></ul></li></ul><p>资本主义经济危机： p226</p><ul><li><p>本质特征：（相对）生产过剩</p><p>这种过剩是相对过剩，即相对于劳动人民有支付能力的需求，而不是相对于劳动人民的实际需要</p></li></ul><h2 id="5-资本主义的发展及其趋势"><a class="header-anchor" href="#5-资本主义的发展及其趋势">¶</a>5 资本主义的发展及其趋势</h2><h3 id="5-1-垄断资本主义的形成与发展"><a class="header-anchor" href="#5-1-垄断资本主义的形成与发展">¶</a>5.1 垄断资本主义的形成与发展</h3><p>垄断原因：</p><ol><li>当生产集中发展到相当高的程度，极少数企业就会联合起来，操纵和控制本部门的生产和销售，实行垄断，以获得高额利润</li><li>企业规模巨大，形成对竞争的限制，也会产生垄断</li><li>激烈的竞争给竞争各方带来的损失越来越严重，为了避免两败俱伤，企业之间会达成妥协，联合起来，实行垄断</li></ol><p>垄断与竞争关系：在自由竞争中形成的，是作为自由竞争的对立面产生的。但是，垄断并不能消除竞争，反而使竞争变得更加复杂和激烈：</p><ol><li>垄断没有消除产生竞争的经济条件</li><li>垄断必须通过竞争来维持</li><li>任何垄断组织都不可能把包罗万象的社会生产全部包下来，使竞争更加激烈</li></ol><p>垄断价格既不能增加也不能减少整个社会所生产的价值总量，它只是对商品价值和剩余价值作了有利于垄断资本的再分配。</p><p>国家垄断资本主义：国家垄断资本主义是国家政权和私人垄断资本融合在一起的垄断资本主义。</p><ul><li>国家所有并直接经营企业</li><li>国家与私人共有、合营企业</li><li>国家通过多种形式参与私人垄断资本的再生产过程</li><li>宏观调节</li><li>微观规制</li></ul><p>经济全球化的表现：生产全球化（国际分工）、贸易全球化、金融全球化</p><p>经济全球化的动因：</p><ul><li>科学技术的进步和生产力的发展为经济全球化提供了坚实的物质基础和根本的推动力。（特别是信息革命）</li><li>跨国公司的发展为经济全球化提供了适宜的企业组织形式。（利用各地的优势组织生产）</li><li>各国经济体制的变革和国际经济组织的发展是经济全球化的体制与组织保障。</li></ul><h3 id="5-3资本主义的历史地位"><a class="header-anchor" href="#5-3资本主义的历史地位">¶</a>5.3资本主义的历史地位</h3><h4 id="5-3-1-历史地位"><a class="header-anchor" href="#5-3-1-历史地位">¶</a>5.3.1 历史地位</h4><p>与封建社会相比，资本主义显示了巨大的历史进步性</p><ol><li>资本主义将科学技术转变为强大的生产力</li><li>资本追求剩余价值的内在动力和竞争的外在压力推动了社会生产力的迅速发展</li><li>资本主义的意识形态和政治制度动了社会生产力的迅速发展，促进了社会进步</li></ol><p>局限性</p><ol><li>资本主义的基本矛盾阻碍社会生产力的发展</li><li>财富占有两极分化，引发经济危机</li><li>资产阶级支配和控制资本主义经济和政治的发展和运行，不断激化社会矛盾和冲突</li></ol><h4 id="5-3-2被替代的历史必然性"><a class="header-anchor" href="#5-3-2被替代的历史必然性">¶</a>5.3.2被替代的历史必然性</h4><ol><li>资本主义基本矛盾随发展不断显现</li><li>资本积累推动资本主义基本矛盾不断激化并最终否定资本主义自身</li><li>国家垄断资本主义是资本社会化的更高形式，将成为社会主义的前奏</li><li>资本主义社会存在着资产阶级和无产阶级两大阶级之间的矛盾和斗争</li></ol><h2 id="6-社会主义的发展及其规律"><a class="header-anchor" href="#6-社会主义的发展及其规律">¶</a>6 社会主义的发展及其规律</h2><h3 id="6-1-社会主义五百年的历史进程"><a class="header-anchor" href="#6-1-社会主义五百年的历史进程">¶</a>6.1 社会主义五百年的历史进程</h3><h3 id="6-1-1社会主义从空想到科学"><a class="header-anchor" href="#6-1-1社会主义从空想到科学">¶</a>6.1.1社会主义从空想到科学</h3><p>空想社会主义发展阶段：</p><ul><li>16-17世纪的早期空想社会主义</li><li>18世纪的空想平均共产主义</li><li>19世纪初期批判的空想社会主义</li></ul><p>开山之作：1516 年托马斯·莫尔所的《乌托邦》</p><p>空想社会主义理论的意义：</p><ol><li>对资本主义旧制度的辛辣批判，包含重要见解</li><li>反映了早期无产阶级迫切要求改造现存社会、建立理想的新社会的愿望</li><li>空想社会主义“提供了启发工人觉悟的极为宝责的祠料”，但是不具备科学的和实践的品格。</li></ol><p>空想社会主义的局限性：</p><ol><li>没有指出社会发展的真正出路。没有阐明资本主义雇佣制的本质</li><li>没有发现资本主义发展规律</li><li>没有找到成为新社会的创造者的社会力量</li></ol><p>科学社会主义：<strong>唯物史观</strong>和<strong>剩余价值学说</strong></p><p>科学社会主义&gt;空想社会主义</p><ul><li>科学理论</li><li>经济根源</li><li>揭示资本主义基本矛盾</li><li>依靠人民作为埋葬力量</li><li>提供路径指引、实现方式</li></ul><h3 id="6-3-在实践中探索社会主义的发展规律"><a class="header-anchor" href="#6-3-在实践中探索社会主义的发展规律">¶</a>6.3 在实践中探索社会主义的发展规律</h3><p>社会主义建设过程的长期性</p><ol><li>生产力发展状况的制约</li><li>经济基础和上层建筑发展状况的制约。</li><li>国际环境的严峻挑战</li><li>马克思主义执政党对社会主义发展道路的探索和对社会主义建设规律的认识，需要一个长期的过程。</li></ol><h2 id="7-共产主义崇高理想及其最终实现"><a class="header-anchor" href="#7-共产主义崇高理想及其最终实现">¶</a>7 共产主义崇高理想及其最终实现</h2><h3 id="7-1-展望未来共产主义新社会"><a class="header-anchor" href="#7-1-展望未来共产主义新社会">¶</a>7.1 展望未来共产主义新社会</h3><ol><li><p>预见未来社会的方法论原则</p><ol><li>在揭示人类社会发展一般规律的基础上指明社会发展的方向</li><li>在剖析资本主义社会旧世界中阐发未来新世界的特点</li><li>在社会主义社会发展中不断深化对未来共产主义社会的认识</li><li>立足于揭示未来社会的一般特征，而不作详尽的细节描绘</li></ol></li><li><p>共产主义社会的基本特征</p><ol><li>物质财富极大丰富，消费资料按需分配</li><li>社会关系高度和谐，人们精神境界极大提高<ol><li>阶级将会消亡</li><li>国家将会消亡（政府不会）</li><li>战争将不复存在。</li><li>由于社会生产力的巨大发展，工业与农业、城市与乡村、脑力劳动与体力劳动的差别即“三大差别”必将归于消失。</li><li>不仅社会是和谐的，而且社会与自然之间也将达成和谐。</li><li>人们的精神境界将得到极大提高。</li></ol></li><li>实现每个人自由而全面的发展，人类从必然王国向自由王国的飞跃</li></ol></li></ol><p>实现人的自由而全面的发展，是马克思主义追求的根本价值目标也是共产主义社会的根本特征。</p><ol><li>旧式分工的消除为人的自由而全面的发展创造条件</li><li>自由时间的延长为人的自由而全面的发展提供了广阔的前景</li><li>劳动不再是单纯的谋生手段，而成为“生活的第一需要”</li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;马克思主义基本原理&lt;/h1&gt;
&lt;h2 id=&quot;0-导论&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#0-导论&quot;&gt;¶&lt;/a&gt;0 导论&lt;/h2&gt;
&lt;h3 id=&quot;0-1-什么是马克思主义&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>算法与复杂性整理</title>
    <link href="https://ryanstarfox.github.io/2025/06/08/2025/20250608%20%E7%AE%97%E6%B3%95%E4%B8%8E%E5%A4%8D%E6%9D%82%E6%80%A7/"/>
    <id>https://ryanstarfox.github.io/2025/06/08/2025/20250608%20%E7%AE%97%E6%B3%95%E4%B8%8E%E5%A4%8D%E6%9D%82%E6%80%A7/</id>
    <published>2025-06-07T16:00:00.000Z</published>
    <updated>2025-06-07T16:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>01 引论</h1><p>N/A</p><h1>02 数学归纳法</h1><ol><li>欧拉公式</li><li>找到循环不变量</li></ol><h1>03 算法分析</h1><h2 id="符号"><a class="header-anchor" href="#符号">¶</a>符号</h2><p>符号$O$：$f(n)=O(g(n))$，复杂性$f(n)\leq g(n)$，$\exists c,N, \forall n\geq N,g(n)\leq cf(n)\Rightarrow g(n)=O(f(n))$</p><p>符号$\Omega$：$f(n)=\Omega(g(n))$，复杂性$f(n)\geq g(n)$，$g(n)=O(f(n))\Rightarrow f(n)=\Omega(g(n))$</p><p>符号$\Theta$：$f(n)=\Theta(g(n))$，复杂性$f(n)=g(n)$，$f(n)=O(g(n))\wedge g(n)=O(f(n))\Rightarrow f(n)=\Theta(g(n))$</p><p>符号$o$：$f(n)=o(g(n))$，复杂性$f(n)&lt; g(n)$，$\forall c,\exists N&gt;0,s.t\ \forall n \geq N,f(n)\leq cg(n)\Rightarrow f(n)=o(g(n))$</p><h2 id="常用式子"><a class="header-anchor" href="#常用式子">¶</a>常用式子</h2><p>$\sum\limits_{i=1}^n \lfloor\log i\rfloor=(n+1)\lfloor(\log n)\rfloor-2^{\lfloor\log n\rfloor+1}+2=\Theta(n\log n)$</p><p>$e=\lim\limits_{n\to\infty}(1+\dfrac 1n)^n=1+\dfrac 1{1!}+\dfrac1{2!}+\dfrac1{3!}+\cdots$</p><p>$\log{(n!)}=\Theta(n\log n)$</p><p>$\sum\limits_{j=1}^n \dfrac 1j=\ln n+\gamma+O(\dfrac1n),\gamma\approx0.577215$</p><p>$\sum\limits_{j=1}^n jc^j=\Theta(nc^n)$</p><h2 id="递推式"><a class="header-anchor" href="#递推式">¶</a>递推式</h2><h3 id="线性齐次递推式"><a class="header-anchor" href="#线性齐次递推式">¶</a>线性齐次递推式</h3><p>特征方程</p><h3 id="分治问题"><a class="header-anchor" href="#分治问题">¶</a>分治问题</h3><p>假设$a$个子问题，每个问题的规模是原始问题的$1/b$，组合各子问题的运行时间是$cn^k$，即</p><p>$T(n)=aT(n/b)+cn^k$</p><p>$T(n)=\begin{cases}O(n^{\log_ba})&amp;a&gt;b^k\O(n^k\log n)&amp;a=b^k\O(n^k)&amp;a&lt;b^k\end{cases}$</p><h3 id="Master-Theorem"><a class="header-anchor" href="#Master-Theorem">¶</a>Master Theorem</h3><p>$T(n)=aT(n/c)+f(n)$</p><ol><li>if $f(n)=O(n^{\log_ca-\epsilon})$ for some $\epsilon&gt;0$, then $T(n)=\Theta(n^{\log_ca})$</li><li>if $f(n) = \Theta( n^{\log_ca} \cdot (\log n)^k ) $ for some$ k&gt;=0$, then $T(n) = \Theta(n^{\log_ca} \cdot (\log n)^k )$</li><li>If $f(n)=W(n^{\log_ca+\epsilon}) $ for some $e&gt;0$  and if $a\cdot f(n/c)\leq kf(n) $ for some constant $ k&lt;1$ and all sufficiently large $n$, then $T(n)=\Theta(f(n))$</li></ol><p>注：以上三种情况不是完整覆盖所有情况</p><h3 id="涉及全部历史的递推关系"><a class="header-anchor" href="#涉及全部历史的递推关系">¶</a>涉及全部历史的递推关系</h3><p>历史消除法</p><h1>05 基于归纳的算法设计</h1><ol><li><p>多项式求值</p><p>$p_n(x)=xp_{n-1}(x)+a_0$</p></li><li><p>寻找每个点的度都大于k的最大导出子图</p><p>只要度数小于k的点都删掉，更新度数，无所谓删除顺序</p></li><li><p>寻找一对一映射的子集</p><p>删掉没有被映射的点</p></li><li><p>社会名流问题</p><p>不要从人的角度，从问题的角度。一个问题至少可以确定一个人不是社会名流，最后剩下的那一个人再验证一下是不是社会名流。</p></li><li><p>轮廓问题</p><p>分治法</p></li><li><p>寻找最大连续子序列</p><p>归纳假设：已知如何找到规模小于n的最大子序列，以及作为后缀的最大子序列。</p></li><li><p>背包问题</p><p>动态规划</p></li></ol><h1>06 序列和集合的算法</h1><h2 id="二分搜索"><a class="header-anchor" href="#二分搜索">¶</a>二分搜索</h2><ol><li><p>基础二分搜索 O(log n)</p></li><li><p>循环序列的二分搜索</p><p>找到循环递增序列的最小元素</p><p>若考虑$x_p,x_q$，若$x_p&lt;x_q$，则最小元素就不可能在$x_p,x_q$之间</p></li><li><p>二分搜索$a_i=i$</p><p>考察$a_{\frac n2}$的值，考虑在前面还是在后面找</p></li><li><p>重叠子序列问题</p><p>若有上界，则二分搜索</p><p>若无上界，则对i加倍直至找到合适的范围</p></li><li><p>方程求解</p><p>连续性，不断减少解存在的范围</p></li><li><p>内插搜索 O(log log n)，但未必比二分搜索高效</p></li></ol><h2 id="排序"><a class="header-anchor" href="#排序">¶</a>排序</h2><table><thead><tr><th style="text-align:center">排序算法</th><th style="text-align:center">最差</th><th style="text-align:center">平均</th></tr></thead><tbody><tr><td style="text-align:center">插入排序^1^</td><td style="text-align:center">$O(n^2)$</td><td style="text-align:center">$O(n^2)$</td></tr><tr><td style="text-align:center">选择排序</td><td style="text-align:center">$O(n^2)$</td><td style="text-align:center">$O(n^2)$</td></tr><tr><td style="text-align:center">归并排序^2^</td><td style="text-align:center">$O(n\log n)$</td><td style="text-align:center">$O(n\log n)$</td></tr><tr><td style="text-align:center">快速排序</td><td style="text-align:center">$O(n^2)$</td><td style="text-align:center">$O(n\log n)$</td></tr><tr><td style="text-align:center">堆排序</td><td style="text-align:center">$O(n\log n)$</td><td style="text-align:center">$O(n\log n)$</td></tr><tr><td style="text-align:center">计数排序^3^</td><td style="text-align:center">$O(n+k)$</td><td style="text-align:center">$O(n+k)$</td></tr><tr><td style="text-align:center">桶排序^4^</td><td style="text-align:center">$O(m+n)$</td><td style="text-align:center">$O(m+n)$</td></tr><tr><td style="text-align:center">基数排序^5^</td><td style="text-align:center">$O(nk)$</td><td style="text-align:center">$O(nk)$</td></tr></tbody></table><p>备注：</p><ol><li>插入部分可用二分搜索，那一部分复杂度可以降为$O(n\log n)$</li><li>缺点：不是原地排序，复制所有的数很花时间</li><li>非比较排序，k为不同数字的种类数</li><li>非比较排序，m为桶数</li><li>非比较排序，k为待排序的数字的位数</li></ol><h2 id="序列的秩"><a class="header-anchor" href="#序列的秩">¶</a>序列的秩</h2><ol><li><p>查找最大/最小数</p><p>可以通过分治法降低计算量，但无法减少计算量的数量级$O(n)$</p></li><li><p>第k小的数</p><p>使用类似快速排序的方法，平均$O(n)$，最坏$O(n\log n)$</p></li></ol><h2 id="数据压缩"><a class="header-anchor" href="#数据压缩">¶</a>数据压缩</h2><ol><li>哈夫曼编码</li></ol><h2 id="字符串匹配"><a class="header-anchor" href="#字符串匹配">¶</a>字符串匹配</h2><ol><li><p>KMP算法</p><p>对于查找的序列要构建next数组</p></li><li><p>BM算法</p><ol><li><p>坏字符规则</p><p>移动的位数=模式串出错的位置-坏字符在模式串中最后出现的位置</p><p>要用一个表bc存储模式串中的字符和下标</p></li><li><p>好后缀规则</p><p>类似KMP，前后颠倒，也可以预先计算</p></li></ol><p>执行两条规则中较大的那一个移动</p></li></ol><h3 id="序列比较"><a class="header-anchor" href="#序列比较">¶</a>序列比较</h3><h3 id="查找众数"><a class="header-anchor" href="#查找众数">¶</a>查找众数</h3><p>此处众数指的是：出现次数超过一半</p><ol><li><p>蛮力查找</p></li><li><p>排序算法</p></li><li><p>找到中位数之后再验证</p></li><li><p>高级算法</p><table><thead><tr><th><strong>i</strong></th><th><strong>X[i]</strong></th><th><strong>C（候选人）</strong></th><th><strong>M（计数器）</strong></th><th><strong>操作说明</strong></th></tr></thead><tbody><tr><td>2</td><td>2</td><td>2</td><td>1 → 2</td><td>X[i] == C，M++</td></tr><tr><td>3</td><td>1</td><td>2</td><td>2 → 1</td><td>X[i] ≠ C，M–</td></tr><tr><td>4</td><td>1</td><td>2</td><td>1 → 0</td><td>X[i] ≠ C，M–</td></tr><tr><td>5</td><td>1</td><td>1</td><td>0 → 1</td><td>M 为 0，换候选人为 X[i]=1，M=1</td></tr><tr><td>6</td><td>2</td><td>1</td><td>1 → 0</td><td>X[i] ≠ C，M–</td></tr><tr><td>7</td><td>2</td><td>2</td><td>0 → 1</td><td>M 为 0，换候选人为 X[i]=2，M=1</td></tr></tbody></table><p>找到候选人之后验证</p></li><li><p>频繁元素</p><p>找到出现最频繁的t个元素</p><p>只有近似算法：规定k个计数器</p><ol><li>有对应的计数器，则相应的计数器加1</li><li>没有相应的计数器，并且已有的计数器数量小于k，则为该数据分配一个新的计数器，其值设为1。</li><li>没有相应的计数器，并且已经有了k个计数器，则将所有的计数器数值减1，并删除值为0的计数器，新数据也被丢弃。</li></ol></li><li><p>最长递增序列</p><ol><li>动态规划</li><li>维护一个tail数组（BIS）</li></ol></li></ol><h1>07 图算法</h1><h2 id="DFS"><a class="header-anchor" href="#DFS">¶</a>DFS</h2><p>DFS中的四种边：</p><ol><li>树边，第一次访问新节点，加入DFS树的边</li><li>后退边，访问到了一个没有访问结束，仍在递归中的祖先节点</li><li>前向边，访问到了一个已经访问结束的子孙节点</li><li>交叉边，访问到了一个已经访问结束，但是既非祖先也非子孙的节点</li></ol><p>有向图有有向闭链$\Leftrightarrow$G有一个后退边</p><h2 id="拓扑排序"><a class="header-anchor" href="#拓扑排序">¶</a>拓扑排序</h2><p>找到入度为0的点，标为已访问，并更新邻接表</p><h2 id="单源最短路径"><a class="header-anchor" href="#单源最短路径">¶</a>单源最短路径</h2><p>非循环有向图中，从v出发到达G中其他各顶点的最短路径</p><h3 id="使用拓扑排序（只有能拓扑排序的图能用这个方式）"><a class="header-anchor" href="#使用拓扑排序（只有能拓扑排序的图能用这个方式）">¶</a>使用拓扑排序（只有能拓扑排序的图能用这个方式）</h3><p>设v的标记是k，则标记小于k的不用考虑，都没有路径；大于k的用归纳法，$min(l_i)+1\ for\ i\ in\ curr.parents$</p><h3 id="一般做法：Djikstra算法"><a class="header-anchor" href="#一般做法：Djikstra算法">¶</a>一般做法：Djikstra算法</h3><p>要用一个Priority Queue来决定下一个顶点更新哪一个</p><h3 id="全部最短路径：Floyd算法"><a class="header-anchor" href="#全部最短路径：Floyd算法">¶</a>全部最短路径：Floyd算法</h3><p>边权可以是负值，但是不能有负权回路</p><p>使用三重循环</p><p>初始化把有连线的两顶点的距离设为连线的长度，没有的设为+inf</p><p>检查每一个顶点能不能作为另外两个顶点的中间节点，如果可以，更新最短路径</p><p>可以检测负环（如果运行两次之后有变化，则有负环）</p><h3 id="传递闭包：Floyd-Warshell算法"><a class="header-anchor" href="#传递闭包：Floyd-Warshell算法">¶</a>传递闭包：Floyd-Warshell算法</h3><h2 id="最小代价生成树"><a class="header-anchor" href="#最小代价生成树">¶</a>最小代价生成树</h2><p>Kruscal/Prim算法</p><p>前者边拓展+并查集，后者点拓展+贪心法</p><h2 id="划分双联通分支：Tarjan法"><a class="header-anchor" href="#划分双联通分支：Tarjan法">¶</a>划分双联通分支：Tarjan法</h2><p>关节点（割点）：删除后可以分离图的节点</p><p>双联通分支是没有关节点的分支，一个顶点可以在不同双联通分支内，但是一条边不行</p><p>寻找所有的割点：</p><p>使用一次DFS，更新时间戳和low值</p><h2 id="划分强连通分支：Tarjan法"><a class="header-anchor" href="#划分强连通分支：Tarjan法">¶</a>划分强连通分支：Tarjan法</h2><p>也可以用划分双联通分支类似的方法，判据有dfn的≥变成了==</p><h2 id="匹配"><a class="header-anchor" href="#匹配">¶</a>匹配</h2><p>匹配是边的一个集合，任意两条边没有公共的顶点</p><ul><li>完美匹配：所有顶点都有匹配的匹配。</li><li>最大匹配：具有最大边数的匹配。</li><li>极大匹配：不可能再增加边数的匹配。</li></ul><p>极大匹配未必是最大匹配。</p><ol><li>非常稠密图中的完美匹配</li><li>偶图匹配</li></ol><p>两者都是要通过交换来实现</p><h2 id="在非常稠密的图中寻找哈密顿回路"><a class="header-anchor" href="#在非常稠密的图中寻找哈密顿回路">¶</a>在非常稠密的图中寻找哈密顿回路</h2><p>任意两个顶点的度数只和≥n</p><h1>08 几何算法</h1><h2 id="判断点是否在多边形内部"><a class="header-anchor" href="#判断点是否在多边形内部">¶</a>判断点是否在多边形内部</h2><p>外部任意一点到此点连线与多边形又奇数个交点</p><p>有特殊情况</p><h2 id="构造简单多边形"><a class="header-anchor" href="#构造简单多边形">¶</a>构造简单多边形</h2><ol><li>考察包含所有点的大圆C，从圆形开始旋转扫描（有特例）</li><li>从x坐标最大，y坐标最小的点开始扫描（也有特例）</li></ol><h2 id="求凸包"><a class="header-anchor" href="#求凸包">¶</a>求凸包</h2><h3 id="直接方法：延拓-递推-O-n-2"><a class="header-anchor" href="#直接方法：延拓-递推-O-n-2">¶</a>直接方法：延拓+递推 O(n^2^)</h3><p>知道&lt;n个点的凸包怎么求，然后尝试寻找包含第n个点的凸包</p><p>改进：加入新的点时，删去旧凸包内的点，把新点与旧凸包上的点连起来寻找支撑线，进而找到两个点与新点连起来，行程新的凸包</p><h3 id="Gift-Wrapping-O-n-2"><a class="header-anchor" href="#Gift-Wrapping-O-n-2">¶</a>Gift Wrapping O(n^2^)</h3><p>从极端点开始找支撑线，不是从小到大构造凸包，而是直接找到凸包的一部分</p><h3 id="Graham扫描算法-O-n-log-n"><a class="header-anchor" href="#Graham扫描算法-O-n-log-n">¶</a>Graham扫描算法 O(n log n)</h3><p>与gift wrapping有点像，但是并非直接找凸包的一部分，先固定x轴上的极端点$p_1$，然后计算$p_ip_1$与x轴的夹角，从小到大排序，然后再一个个加入凸包</p><h2 id="最近点对"><a class="header-anchor" href="#最近点对">¶</a>最近点对</h2><h3 id="直接法-O-n-2"><a class="header-anchor" href="#直接法-O-n-2">¶</a>直接法 O(n^2^)</h3><p>直接计算两点之间的距离，然后求最小值</p><h3 id="分治法-O-n-log-2-n-O-n-log-n"><a class="header-anchor" href="#分治法-O-n-log-2-n-O-n-log-n">¶</a>分治法 O(n log^2^ n)-&gt;O(n log n)</h3><p>如果只有两个点，可以直接取它们之间的距离</p><p>否则分为2组，分别取最小，并求交叉项的最小</p><p>交叉项也只要取部分的条带（宽度为2倍最小值）</p><p>如果在每次归并的时候也保留y坐标的大小关系，则可以降低为$O(n\log n)$</p><h2 id="找交点"><a class="header-anchor" href="#找交点">¶</a>找交点</h2><h3 id="水平线段和垂直线段的交点"><a class="header-anchor" href="#水平线段和垂直线段的交点">¶</a>水平线段和垂直线段的交点</h3><p>直接法$O(mn)$</p><p>扫描线技术$O((m+n)log(m+n)+R)$</p><h3 id="线段交点"><a class="header-anchor" href="#线段交点">¶</a>线段交点</h3><p>扫描线技术$O((2n+m)log(2n+m))$</p><p>扫描状态集合是动态几何，描述当前扫描线状态，在以下情况会发生改变：</p><ol><li>遇到新的线段</li><li>现有线段结束</li><li>两段线段交点</li></ol><h2 id="美术馆问题"><a class="header-anchor" href="#美术馆问题">¶</a>美术馆问题</h2><h2 id="多边形三角划分问题"><a class="header-anchor" href="#多边形三角划分问题">¶</a>多边形三角划分问题</h2><h3 id="若为单调多边形"><a class="header-anchor" href="#若为单调多边形">¶</a>若为单调多边形</h3><p>扫描线算法三角划分</p><h3 id="若为一般多边形"><a class="header-anchor" href="#若为一般多边形">¶</a>若为一般多边形</h3><p>添加对角线除去转向点</p><p>对于split，merge和start有不同的处理方式</p><h2 id="相交半平面问题"><a class="header-anchor" href="#相交半平面问题">¶</a>相交半平面问题</h2><p>分治法$O(n\log n)$</p><h2 id="两个凸多边形的交点"><a class="header-anchor" href="#两个凸多边形的交点">¶</a>两个凸多边形的交点</h2><p>扫描线算法，扫描线只需记得4条边$O(n)$</p><h2 id="Voronoi图"><a class="header-anchor" href="#Voronoi图">¶</a>Voronoi图</h2><p>使用Fortune算法，一种扫描线算法。既规定了扫描线，又规定了海岸线（一系列抛物线，在海岸线之上不会再变了）</p><ol><li><p>基点事件</p><p>扫描线经过一个基点时会产生一个基点事件</p><p>插入一根新的抛物线</p></li><li><p>左右两根抛物线相遇，中间那一根抛物线消失，形成新的Voronoi顶点</p></li></ol><h1>09 代数和数值算法</h1><h2 id="误差来源"><a class="header-anchor" href="#误差来源">¶</a>误差来源</h2><ol><li>截断误差：泰勒展开截去部分</li><li>大数吃小数：2^100^+1-2^100^=0</li><li>稳定性：递推算法误差不断积累</li></ol><h2 id="求幂运算"><a class="header-anchor" href="#求幂运算">¶</a>求幂运算</h2><ol><li>直接归纳法：$n^k=nn^{k-1},O(k)$</li><li>二分归纳法：$n^k=(n^{\frac k2})^2,O(\log k)$</li></ol><h2 id="求最大公约数"><a class="header-anchor" href="#求最大公约数">¶</a>求最大公约数</h2><p>辗转相除法</p><p>最大公倍数可由最大公约数得到</p><h2 id="多项式乘法"><a class="header-anchor" href="#多项式乘法">¶</a>多项式乘法</h2><p>分治法，同时可以把4优化为3，因为B+C=E-A-D</p><h2 id="正整数乘法"><a class="header-anchor" href="#正整数乘法">¶</a>正整数乘法</h2><p>n位数，$O(n^2)$</p><p>采用类似多项式乘法的分治法</p><h2 id="矩阵乘法"><a class="header-anchor" href="#矩阵乘法">¶</a>矩阵乘法</h2><p>也是类似前面的分治法$O(n^3)$，也可以用stassen算法作类似前面的优化$O(n^2.81)$</p><h2 id="布尔矩阵乘法"><a class="header-anchor" href="#布尔矩阵乘法">¶</a>布尔矩阵乘法</h2><p>不能用strassen算法优化，因为布尔运算没有定义减法</p><h3 id="法一"><a class="header-anchor" href="#法一">¶</a>法一</h3><p>预先构建所有可能的k维布尔内积，然后查表$O(n^3/\log n)$</p><h3 id="法二"><a class="header-anchor" href="#法二">¶</a>法二</h3><p>分解为A的列和B的行的乘积之和+查表$O(n^3/\log n)$</p><h3 id="法三"><a class="header-anchor" href="#法三">¶</a>法三</h3><p>n维向量加法表，然后分组$O(n^3/\log^2 n)$</p><h2 id="矩阵链相乘"><a class="header-anchor" href="#矩阵链相乘">¶</a>矩阵链相乘</h2><p>线性规划</p><p>一个m*n和一个n*k的矩阵相乘默认时间复杂度为$O(m<em>n</em>k)$</p><h2 id="多项式乘法2"><a class="header-anchor" href="#多项式乘法2">¶</a>多项式乘法2</h2><p>用函数上的点来表示多项式函数，先正向傅立叶变换，再逆向傅立叶变换</p><h3 id="正向傅立叶变换"><a class="header-anchor" href="#正向傅立叶变换">¶</a>正向傅立叶变换</h3><p>取的点中有相反数关系，减少一半计算量，然后再归纳计算（要引入复数）</p><h3 id="逆向傅立叶变换"><a class="header-anchor" href="#逆向傅立叶变换">¶</a>逆向傅立叶变换</h3><p>求矩阵的逆，为$[V(\omega)]^{-1}=\dfrac 1n V(\dfrac 1\omega)$</p><h1>非线性方法求解</h1><h2 id="二分法"><a class="header-anchor" href="#二分法">¶</a>二分法</h2><p>缺点是不能保证x的精度，可能y相差很少但是x相差很多</p><h2 id="迭代法求根"><a class="header-anchor" href="#迭代法求根">¶</a>迭代法求根</h2><p>就是董说的蛛网法，问题是能不能收敛</p><h2 id="牛顿法"><a class="header-anchor" href="#牛顿法">¶</a>牛顿法</h2><p>根据切线求下一个，性能依赖于x的选取</p><h1>11 计算机不是万能的</h1><h2 id="课内的NPC问题"><a class="header-anchor" href="#课内的NPC问题">¶</a>课内的NPC问题</h2><ul><li><p>顶点覆盖问题</p><p>设G=(V,E)是一个无向图，G的顶点覆盖是一个顶点集合，满足G中所有的边都至少和该</p><p>集合中的一个顶点相关联。</p><p>问题：给定无向图G=(V,E)和一个整数k，判定G是否有包含k个顶点的顶点覆盖。</p></li><li><p>支配集问题</p><p>设G=(V,E) 是一个无向图，如果顶点集合D 满足，G 中的所有顶点要么在D 中要么与D</p><p>中至少一个顶点相邻，则称D为支配集。</p><p>问题：给定无向图G=(V,E)和整数k，判定G中是否有一个包含≤k个顶点的支配集。</p></li><li><p>3SAT问题</p><p>3SAT问题是一般SAT问题的简化，3SAT的实例是指每个子句中恰好含有3个变量的布尔</p><p>表达式。</p><p>问题：给定以CNF 形式出现并且每个子句恰好含有3 个变量的布尔表达式，判定其是否可满足。</p></li><li><p>团问题</p><p>给定无向图G=(V,E)，G中的一个团C是G的一个子图，满足C中的任何两个顶点均相</p><p>邻，换句话说，团即完全子图。</p><p>问题：给定无向图G=(V,E)和整数k，判定G是否包含一个大小≥k的团。</p></li><li><p>3着色问题</p><p>设G=(V,E)是无向图，G的有效着色是指对所有顶点的颜色指派，使得每个顶点被指派一</p><p>种颜色并且相邻顶点不被指派成相同颜色。</p><p>问题：给定无向图G=(V,E)，判定G是否可以被3种颜色着色。</p></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;01 引论&lt;/h1&gt;
&lt;p&gt;N/A&lt;/p&gt;
&lt;h1&gt;02 数学归纳法&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;欧拉公式&lt;/li&gt;
&lt;li&gt;找到循环不变量&lt;/li&gt;
&lt;/ol&gt;
&lt;h1&gt;03 算法分析&lt;/h1&gt;
&lt;h2 id=&quot;符号&quot;&gt;&lt;a class=&quot;header-anchor&quot; </summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>地频线——或许是我最疯狂的事吧</title>
    <link href="https://ryanstarfox.github.io/2025/05/06/2025/20250506%20%E5%9C%B0%E9%A2%91%E7%BA%BF/"/>
    <id>https://ryanstarfox.github.io/2025/05/06/2025/20250506%20%E5%9C%B0%E9%A2%91%E7%BA%BF/</id>
    <published>2025-05-05T17:43:00.000Z</published>
    <updated>2025-05-05T17:43:00.000Z</updated>
    
    <content type="html"><![CDATA[<blockquote><p>这段文字写于地频线结束之后一天的傍晚，我坐在包玉刚图书馆3楼的沙发上。这对我来说更像是一个寻常的傍晚。于我而言，地频线是一段叛逆，因此在一切尘埃落定之后，显得竟然如此不真实。昨晚4点，已闻啼鸟，我回寝室，最后一次把阿姨叫醒开门，最后一次说“对不起，活动结束了，这是最后一次晚归了。”我一个人坐在自己的位置上，把除了文件传输助手的71个置顶逐一取消，翻找了好久自己以前的头像。想到bhy说“你敢想象嘛，第二天，菁菁堂会一点痕迹也没有。”天蒙蒙亮了，恍惚中我觉得或许此刻只是因为被抛起的失重惊醒，翻个身又该睡了。</p></blockquote><p>昨晚刚刚从大连飞回来，这是上交大第28届歌手大赛——地频线结束之后的第一次旅行，与导演组一道。觉得对于这一段经历，还需要写一点什么。</p><p>去年12月，自从成为歌手大赛的大岛之后，我就已经开始期待被抛起来的一刻了——只是希望尘埃落定。那时的我，急躁、不知所措。我始终认为自己做不了一个领导者——我做不了乔布斯，我只能做沃兹尼亚克，即使如今也依旧深信如此。但因种种原因我最终被推到了这个位置。我一直都战战兢兢：我参与这个活动只是因为自己的体验主义，只是在尝试偏离自己原本生活方式，可是我不敢告诉别人我的想法，我认为它很自私，怎么能把把大家投入这么多精力的一件事情仅仅视作自己对“陌生体验感”的追求。我害怕我做不好：导演组的各位都专于自己负责的部分，我害怕自己不学无术，因此无所事事，爱莫能助，我怎能成为名义上的“大岛”？</p><p>说来奇怪，复赛结束之后，我反而比决赛结束之后更有一种释然的感觉。决赛之前的我，反而有种高三之感——同样日夜与一群人为了一个共同目标做事；同样发着疯，笑点很低，苦中作乐；同样希望尽快尘埃落定，又不愿结束。待到决赛中与结束之后，甚至在决赛现场彩排的那个周末，我更深刻的感受反而是不真实感：为了地频线，暂时地放下了很多的东西：浅层的是自己的学业与日程，更深层的是自己的生活方式、处事的习惯——尤其是我的思维，人在过度疲劳之时，是真的会不想动一点脑子、不想听一点声音、不想见一点东西、不想和一个人交流的，此时只盼一片白茫茫而又虚无的清净。活动结束之后便一头扎入真实的学业之海——直至一周的备考和随后的期中考试之后，当天又与导演组一道前去机场，奔向大连的更加真实的海。</p><p>在地频线中，获得了很多的关系——这是除了陌生的体验感之外，我最想从地频线中得到的东西。但它也同样自私，我不敢告诉别人，即使它听上去又是如此正当。但结束之后，我可以纵情享受这些关系，这些联结了：我们导演组很早就相约大连，终于在五一实现——一直叫嚷着想吃大连的海鲜，真正吃到口中，那种实在感竟然有些奇怪。通过地频线，也与许多工作人员和歌手相熟识，其中不乏一些留学生——我很享受与来自孟加拉国的92%e人Mon聊天，通过他的眼睛，我看到了不一样的，但是同样有趣的世界。</p><p>地频线是与我寻常生活的巨大的偏离，日后怕是不会再有吧？彩色的记忆变得黑白，对此的思绪也逐渐混沌，但这段故事从时间之筛中留下，已在心中扎根。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;blockquote&gt;
&lt;p&gt;这段文字写于地频线结束之后一天的傍晚，我坐在包玉刚图书馆3楼的沙发上。这对我来说更像是一个寻常的傍晚。于我而言，地频线是一段叛逆，因此在一切尘埃落定之后，显得竟然如此不真实。昨晚4点，已闻啼鸟，我回寝室，最后一次把阿姨叫醒开门，最后一次说“对不起，</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="校园/School" scheme="https://ryanstarfox.github.io/tags/%E6%A0%A1%E5%9B%AD-School/"/>
    
    <category term="大学/University" scheme="https://ryanstarfox.github.io/tags/%E5%A4%A7%E5%AD%A6-University/"/>
    
  </entry>
  
  <entry>
    <title>集合论整理</title>
    <link href="https://ryanstarfox.github.io/2025/01/15/2025/20250115%20%E9%9B%86%E5%90%88%E8%AE%BA/"/>
    <id>https://ryanstarfox.github.io/2025/01/15/2025/20250115%20%E9%9B%86%E5%90%88%E8%AE%BA/</id>
    <published>2025-01-15T03:34:00.000Z</published>
    <updated>2025-01-15T03:34:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>集合论</h1><h2 id="第九章-集合"><a class="header-anchor" href="#第九章-集合">¶</a>第九章 集合</h2><h3 id="9-1-集合的概念和表示方法"><a class="header-anchor" href="#9-1-集合的概念和表示方法">¶</a>9.1 集合的概念和表示方法</h3><p>$a\in A, a\notin A$</p><h3 id="9-2-集合间的关系和特殊集合"><a class="header-anchor" href="#9-2-集合间的关系和特殊集合">¶</a>9.2 集合间的关系和特殊集合</h3><p>$=, \subset,\subseteq,\supset,\supseteq$</p><ol><li><p>$A=B\Leftrightarrow A\subseteq B\wedge B\subseteq A$</p></li><li><p>$A\subseteq A$</p><p>$(A\subseteq B \wedge B\subseteq C)\Rightarrow A\subseteq C$</p></li><li><p>$A\subset B：A是B的真子集$</p><p>$B\subset A：B是A的真超集合$</p></li></ol><h3 id="9-3-集合的基本运算"><a class="header-anchor" href="#9-3-集合的基本运算">¶</a>9.3 集合的基本运算</h3><ol><li>$对称差：A\oplus B=(A-B)\cup(B-A)$</li><li>$广义并、广义交：规定\cup \emptyset = \emptyset, \cap \emptyset 无意义$</li><li>$幂集：P(A)={x|x\subseteq A}$</li><li>$笛卡尔积：A\times B={&lt;x,y&gt;|x\in A\wedge y\in B}(需要明确&lt;x_1,x_2,x_3&gt;=&lt;&lt;x_1,x_2&gt;x_3&gt;,&lt;x_1,x_2,x_3&gt;\ne &lt;x_1,&lt;x_2,x_3&gt;&gt;)$</li></ol><h3 id="9-5-集合运算的性质与证明"><a class="header-anchor" href="#9-5-集合运算的性质与证明">¶</a>9.5 集合运算的性质与证明</h3><ol><li><p>$A\subseteq B\Leftrightarrow P(A)\subseteq P(B)$</p><p>$P(A)\in P(B)\Leftrightarrow A\in B$</p></li><li><p>$P(A)\cap P(B)=P(A\cap B)$</p><p>$P(A)\cup P(B)\subseteq P(A\cup B)$</p><p>$P(A-B)\subseteq (P(A)-P(B))\cup{\emptyset}$</p><p>$传递集合：A的任意元素的元素是A的元素$</p><p>$A是传递集合\Rightarrow P(A)是传递集合$</p></li><li><p>$A\subseteq B\Rightarrow \cup A\subseteq \cup B$</p><p>$A\subseteq B\Rightarrow \cap B \subseteq \cap A$</p><p>$\cup(A\cup B)=(\cup A)\cup(\cup B)$</p><p>$\cap(A\cup B)=(\cap A)\cap(\cap B)$</p><p>$\cup(P(A))=A$</p></li></ol><h3 id="9-6-有限集合的基数"><a class="header-anchor" href="#9-6-有限集合的基数">¶</a>9.6 有限集合的基数</h3><ol><li>记作#(A)=n, |A|=n, card(A)=n</li></ol><h2 id="第十章-关系"><a class="header-anchor" href="#第十章-关系">¶</a>第十章 关系</h2><h3 id="10-1-二元关系"><a class="header-anchor" href="#10-1-二元关系">¶</a>10.1 二元关系</h3><p>二元关系是有序对的集合</p><p>对于A到B得一个关系R，可以定义：</p><ol><li>$定义域dom(R)={x|(\exists y)(&lt;x,y&gt;\in R)}$</li><li>$值域ran(R)={y|(\exists x)(&lt;x,y&gt;\in R)}$</li><li>$域fld(R)=dom(R)\cup ran(R)$</li></ol><h3 id="10-2-关系矩阵和关系图"><a class="header-anchor" href="#10-2-关系矩阵和关系图">¶</a>10.2 关系矩阵和关系图</h3><ol><li>关系矩阵：$&lt;x_i,y_j&gt;\in R\Rightarrow r_{ij}=1，其余为0$</li><li>关系图：有关系则连线（有向图）</li></ol><h3 id="10-3-关系的逆、合成、限制和象"><a class="header-anchor" href="#10-3-关系的逆、合成、限制和象">¶</a>10.3 关系的逆、合成、限制和象</h3><p>逆：$R^{-1}={&lt;x,y&gt;|&lt;y,x&gt;\in R}$</p><p>合成：</p><p>$S\circ R={&lt;x,y&gt;|(\exists z)(&lt;x,z&gt;\in R\wedge&lt;z,y&gt;\in S)}$（满足结合律不满足交换律）</p><p>限制：$R\upharpoonright A={&lt;x,y&gt;|&lt;x,y&gt;\in R\wedge x\in A}$</p><p>象：$R[A]={y|(\exists x)(x\in A\wedge&lt;x,y&gt;\in R}$</p><p>$关系矩阵：M(S\circ R)=M(R)\cdot M(S)$</p><h3 id="10-4-关系的性质"><a class="header-anchor" href="#10-4-关系的性质">¶</a>10.4 关系的性质</h3><ol><li><p>$R在A上是自反的\Leftrightarrow (\forall x)(x\in A\to xRx)$</p><p>$R在A上是非自反的\Leftrightarrow(\forall x)(x\in A\to x\not{R}x)$</p></li><li><p>$对称：\forall x,y\in A，若xRy\to yRx$</p><p>$反对称：(xRy\wedge yRx)\to (x=y)$</p></li><li><p>$传递：\forall x,y,z\in A,(xRy\wedge yRx)\to xRz$</p></li></ol><h3 id="10-5-关系的闭包"><a class="header-anchor" href="#10-5-关系的闭包">¶</a>10.5 关系的闭包</h3><ol><li><p>$设A是有限集合，R是A上的关系，若存在自然数s和t,s&lt;t,使得R^s=R^t，则$</p><ol><li>$R^{s+k}=R^{t+k}$</li><li>$R^{s+kp+i}=R^{s+i}，k和i为自然数，p=t-s$</li><li>$B={R^0,R^1,\cdots,R^{t-1}}，则\forall q\in N^*,R^q\in B$</li></ol></li><li><p>$闭包:若非空集合A上的关系R，在A上有另一个关系R'满足：$</p><ol><li>$R'是自反/对称/传递的$</li><li>$R\subseteq R'$</li><li>$对A上任何自反/对称/传递的关系R'',R\subseteq R''\to R'\subseteq R''$</li></ol><p>$则称关系R'为R的自反/对称/传递闭包，记作r(R)/s(R)/t(R)$</p><p>传递闭包求法：Warshall算法</p></li></ol><h3 id="10-6-等价关系和划分"><a class="header-anchor" href="#10-6-等价关系和划分">¶</a>10.6 等价关系和划分</h3><ol><li>$等价关系：自反、对称、传递$</li><li>$由等价关系R诱导出来的A的划分记作\pi_R$</li><li>$诱导出划分\pi的等价关系记为R_{\pi}$</li></ol><h3 id="10-7-相容关系与覆盖"><a class="header-anchor" href="#10-7-相容关系与覆盖">¶</a>10.7 相容关系与覆盖</h3><ol><li>$相容关系：自反、对称$</li><li>$最大相容类：非空子集上的关系R，一个相容类不是任何相容类的真子集，记作C_R$</li><li>$最大相容类的集合是A的一个覆盖，称为A的完全覆盖，记作C_R(A),C_R(A)唯一$</li></ol><h3 id="10-8-偏序关系"><a class="header-anchor" href="#10-8-偏序关系">¶</a>10.8 偏序关系</h3><ol><li>$偏序关系自反、反对称、传递$</li><li>$拟序关系非自反、传递（能推出反对称）$</li><li>$偏序关系（弱偏序关系、半序关系）可以取等，拟序关系（强偏序关系）不能取等$</li><li>$哈斯图$</li><li>$若任意两个均可比，则为全序关系$</li><li>$良序集在全序集的基础上还要有最小值$</li></ol><h2 id="第十一章-函数"><a class="header-anchor" href="#第十一章-函数">¶</a>第十一章 函数</h2><h3 id="11-1-函数和选择公理"><a class="header-anchor" href="#11-1-函数和选择公理">¶</a>11.1 函数和选择公理</h3><p>函数：单值性</p><p>象——x对应的y的集合</p><p>完全原象——y对应的x的集合</p><p>dom(f)定义域</p><p>ran(f)值域</p><p>单射、满射、双射</p><h3 id="11-2-函数的合成与逆"><a class="header-anchor" href="#11-2-函数的合成与逆">¶</a>11.2 函数的合成与逆</h3><p>函数的逆不一定是函数</p><p>$f:A\to B,g:B\to A,若g\circ f=I_A,则称g为f的左逆，同理右逆$</p><p>存在左逆，当且仅当f单射</p><p>存在右逆，当且仅当f满射</p><p>两者均存在，当且仅当f双射，此时左逆等于右逆</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;集合论&lt;/h1&gt;
&lt;h2 id=&quot;第九章-集合&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#第九章-集合&quot;&gt;¶&lt;/a&gt;第九章 集合&lt;/h2&gt;
&lt;h3 id=&quot;9-1-集合的概念和表示方法&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>概率统计整理</title>
    <link href="https://ryanstarfox.github.io/2025/01/08/2025/20250108%20%E6%A6%82%E7%8E%87%E7%BB%9F%E8%AE%A1/"/>
    <id>https://ryanstarfox.github.io/2025/01/08/2025/20250108%20%E6%A6%82%E7%8E%87%E7%BB%9F%E8%AE%A1/</id>
    <published>2025-01-08T02:09:00.000Z</published>
    <updated>2025-01-08T02:09:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>概率统计整理</h1><h2 id="第一章-随机事件和概率"><a class="header-anchor" href="#第一章-随机事件和概率">¶</a>第一章 随机事件和概率</h2><h3 id="1-1-随机事件及其运算"><a class="header-anchor" href="#1-1-随机事件及其运算">¶</a>1.1 随机事件及其运算</h3><ol><li>区分概念：样本点、样本空间</li><li>运算规律：<ol><li>$交换律：A\cup B=B\cup A,AB=BA$</li><li>$结合律：(A\cup B)\cup C=A\cup(B\cup C),(AB)C=A(BC)$</li><li>$分配律：A\cup(BC)=(A\cup B)(A\cup C),A(B\cup C)=(AB)\cup (AC)$</li><li>$对偶律(De Morgan)：\overline{A\cup B}=\bar A\bar B,\overline{AB}=\bar A\cup\bar B$</li></ol></li></ol><h3 id="1-2-随机事件的概率"><a class="header-anchor" href="#1-2-随机事件的概率">¶</a>1.2 随机事件的概率</h3><ol><li>概率三公理：<ol><li>$\forall A, P(A)\geq0$</li><li>$对于必然事件\Omega, P(\Omega)=1$</li><li>$对于两两互不相容的事件A_1,A_2,\cdots,A_n,\cdots,即A_iA_j=\empty,i\neq j,i,i=1,2,\cdots,有P(\bigcup\limits_{i=1}^{+\infty})=\sum\limits_{i=1}^{+\infty}P(A_i)$</li></ol></li><li>概率性质：<ol><li>$P(\empty)=0$</li><li>$设A_1,A_2,\cdots,A_n满足A_iA_j=\empty,i\neq j,i,j=1,2,\cdots,n,则有P(\bigcup\limits_{i=1}^nA_i)=\sum\limits_{i=1}^nP(A_i)$</li><li>$P(\bar A)=1-P(A)$</li><li>$A\subset B\Rightarrow P(B-A)=P(B)-P(A),P(B)\geq P(A)$</li><li>$P(A\cup B)=P(A)+P(B)-P(AB)$</li></ol></li></ol><h3 id="1-3-条件概率"><a class="header-anchor" href="#1-3-条件概率">¶</a>1.3 条件概率</h3><ol><li>$P(B|A)=\dfrac{P(AB)}{P(A)}$</li><li>$若B_1, B_2,\cdots,B_n为样本空间\Omega的一个划分，且P(B_i)&gt;0(i = 1,2,\cdots,n)则对任一事件A，有P(A)=\sum\limits_{i=1}^nP(B_i)P(A|B_i)$</li><li>$Bayes公式：若B_1, B_2,\cdots,B_n为样本空间\Omega的一个划分，且P(B_i)&gt;0(i = 1,2,\cdots,n)则对任一事件A，有P(B_i|A)=\dfrac{P(AB_i)}{P(A)}=\dfrac{P(B_i)P(A|B_i)}{\sum\limits_{i=1}^nP(B_i)P(A|B_i)}$</li></ol><h3 id="1-4-随机事件的独立性"><a class="header-anchor" href="#1-4-随机事件的独立性">¶</a>1.4 随机事件的独立性</h3><ol><li><p>$P(AB)=P(A)P(B)则A，B独立$</p></li><li><p>$P(A_1A_2)=P(A_1)P(A_2)---(1)$</p><p>$P(A_2A_3)=P(A_2)P(A_3)---(2)$</p><p>$P(A_3A_1)=P(A_3)P(A_1)---(3)$</p><p>$P(A_2A_2A_3)=P(A_1)P(A_2)P(A_3)---(4)$</p><p>$(1)(2)(3)成立则A_1,A_2,A_3两两独立，(1)(2)(3)(4)都成立则A_1,A_2,A_3相互独立$</p></li></ol><h2 id="第二章-随机变量及其分布"><a class="header-anchor" href="#第二章-随机变量及其分布">¶</a>第二章 随机变量及其分布</h2><h3 id="2-1-随机变量及其分布函数"><a class="header-anchor" href="#2-1-随机变量及其分布函数">¶</a>2.1 随机变量及其分布函数</h3><ol><li>$概率分布函数F(x)=P(X\leq x)$</li></ol><h3 id="2-2-离散随机变量及其分布律"><a class="header-anchor" href="#2-2-离散随机变量及其分布律">¶</a>2.2 离散随机变量及其分布律</h3><p>$P(X=x_k)=p_k,k=1,2\cdots称为X的分布律，有性质：$</p><ol><li>$p_k\geq0,k=1,2,\cdots,$</li><li>$\sum\limits p_k=1$</li></ol><h4 id="1-0-1-分布"><a class="header-anchor" href="#1-0-1-分布">¶</a>1. 0-1 分布</h4><table><thead><tr><th style="text-align:center">X</th><th style="text-align:center">1</th><th style="text-align:center">0</th></tr></thead><tbody><tr><td style="text-align:center">P</td><td style="text-align:center">p</td><td style="text-align:center">1-p</td></tr></tbody></table><p>$P(X=k)=p^k(1-p)^{1-k},k=0,1$</p><h4 id="2-二项分布-X-B-n-p"><a class="header-anchor" href="#2-二项分布-X-B-n-p">¶</a>2. 二项分布 X~B(n,p)</h4><ol><li>可独立重复进行n次</li><li>每次实验结果只有两个</li></ol><p>称n重Bernoulli试验，Bernoulli概型</p><p>$P(X=k)=C_n^kp^k(1-p)^{n-k},k=0,1,\cdots,n$</p><h4 id="3-泊松分布-X-P-λ"><a class="header-anchor" href="#3-泊松分布-X-P-λ">¶</a>3. 泊松分布 X~P(λ)</h4><p>$Poisson定理：\lim\limits_{n\to\infty}np_n=\lambda&gt;0，则\lim\limits_{n\to\infty}C_n^kp_n^k(1-p_n)^{n-k}=e^{-\lambda}\dfrac{\lambda^k}{k!}$</p><p>$P(X=k)=e^{-\lambda}\dfrac{\lambda^k}{k!}$</p><h3 id="2-3-连续型随机变量及其概率密度"><a class="header-anchor" href="#2-3-连续型随机变量及其概率密度">¶</a>2.3 连续型随机变量及其概率密度</h3><p>$概率分布函数F(x)-=\int\limits_{-\infty}^xf(t)dt,-\infty&lt;x&lt;\infty,其中f(x)是概率密度函数$</p><p>$性质$</p><ol><li>$f(x)\geq0$</li><li>$\int\limits_{-\infty}^\infty f(x)dx=F(+\infty)=1$</li><li>$f(x)=F'(x)$</li><li>$P(x_0&lt;X\leq x_0+\Delta x)\approx f(x_0)\Delta x$</li><li>$P(x=a)=0$</li></ol><h4 id="1-均匀分布-X～U-a-b"><a class="header-anchor" href="#1-均匀分布-X～U-a-b">¶</a>1. 均匀分布 X～U(a,b)</h4><p>$f(x)=\begin{cases}\dfrac{1}{b-a},&amp;a&lt;x&lt;b\0,&amp;其他\end{cases}$</p><p>$F(x)=\begin{cases}0,&amp;x&lt;a,\\dfrac{x-a}{b-a},&amp;a\leq x&lt;b,\1,&amp;x\geq b.\end{cases}$</p><h4 id="2-指数分布-X-E-λ"><a class="header-anchor" href="#2-指数分布-X-E-λ">¶</a>2. 指数分布 X~E(λ)</h4><p>$f(x)=\begin{cases}\lambda e^{-\lambda x},&amp;x&gt;0,\0,&amp;x\leq 0,\end{cases}$</p><p>$F(x)=\begin{cases}1-e^{-\lambda x},&amp;x&gt;0,\0,&amp;x\leq0\end{cases}$</p><h4 id="3-正态分布-X～N-mu-sigma-2"><a class="header-anchor" href="#3-正态分布-X～N-mu-sigma-2">¶</a>3. 正态分布 X～N(<strong>$\mu,\sigma^2$</strong>)</h4><p>$\phi(x)=\dfrac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}},-\infty&lt;x&lt;+\infty$</p><p>$\Phi(x)=\dfrac{1}{\sqrt{2\pi}}\int\limits_{-\infty}^xe^{-\frac{t^2}2}dt,-\infty&lt;x&lt;+\infty$</p><p>$\phi(x)=\dfrac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}，-\infty&lt;x&lt;+\infty$</p><p>$\Phi(x)=\dfrac 1{\sqrt{2\pi}}\int\limits_{-\infty}^{x}e^{-\frac{(x-\mu)^2}{2\sigma^2}},-\infty&lt;x\infty$</p><h4 id="2-4-随机变量函数的分布"><a class="header-anchor" href="#2-4-随机变量函数的分布">¶</a>2.4 随机变量函数的分布</h4><p>$已知X的概率密度函数为f_X(x)，设y=g(x),Y=g(X)的分布函数为f_X(g^{-1}(y))\cdot|\dfrac{dx}{dy}|$</p><h2 id="第三章-多维随机变量及其分布"><a class="header-anchor" href="#第三章-多维随机变量及其分布">¶</a>第三章 多维随机变量及其分布</h2><h3 id="3-1-二维随机变量及其分布"><a class="header-anchor" href="#3-1-二维随机变量及其分布">¶</a>3.1 二维随机变量及其分布</h3><ol><li><p>$F(x,y)=P({X\leq x}\cap{Y\leq y})=P(X\leq x,Y\leq y)$</p></li><li><p>性质：</p><ol><li>$0\leq F(x,y)\leq 1,F(-\infty,y) = 0,F(x,-\infty) = 0,F(-\infty,-\infty)=0,F(+\infty,+\infty)=1$</li><li>$以x或y为主元，都是单调不减函数$</li><li>$以x或y为主元，都是右连续函数$</li><li>$\forall a&lt;b,c&lt;d,F(b,d)-F(a,d)-F(b,c)+F(a,c)=P(a&lt;x\leq  b,c&lt;Y\leq d)\geq 0$</li></ol></li><li><p>$边缘分布函数F_X(x)=F(x,+\infty),F_Y(y)=F(+\infty,y)$</p></li></ol><h4 id="二维离散型随机变量"><a class="header-anchor" href="#二维离散型随机变量">¶</a>二维离散型随机变量</h4><p>性质：</p><ol><li>$p_{ij}\geq 0$</li><li>$\sum\limits_i\sum\limits_j p_{ij}=1$</li></ol><h4 id="二维连续型随机变量"><a class="header-anchor" href="#二维连续型随机变量">¶</a>二维连续型随机变量</h4><p>性质：</p><ol><li>$f(x,y)\geq 0$</li><li>$\int\limits_{-\infty}^{\infty}\int\limits_{-\infty}^{\infty}f(x,y)dxdy=1$</li><li>$P((X,Y)\in D)=\iint\limits_D f(x,y)dxdy = 1$</li><li>$在f(x,y)的连续点处，有\dfrac{\partial^2F(x,y)}{\partial x\partial y}=f(x,y)$</li></ol><h5 id="二维均匀分布"><a class="header-anchor" href="#二维均匀分布">¶</a>二维均匀分布</h5><p>$f(x,y)=\begin{cases}\dfrac{1}{G的面积}，&amp;(x,y)\in G\0,&amp;其他\end{cases}$</p><h5 id="二维正态分布-X-Y-sim-N-mu-1-sigma-1-2-mu-2-sigma-2-2-rho"><a class="header-anchor" href="#二维正态分布-X-Y-sim-N-mu-1-sigma-1-2-mu-2-sigma-2-2-rho">¶</a>二维正态分布 $(X,Y)\sim N(\mu_1,\sigma_1^2;\mu_2,\sigma_2^2;\rho)$</h5><p>$f(x,y)=\dfrac1{2\pi\sigma_1\sigma_2\sqrt{1-\rho^2}}exp\bigg{-\dfrac1{2(1-p^2)}\Big [\dfrac{(x-\mu_1)^2}{\sigma_1^2}-2\rho\dfrac{(x-\mu_1)(y-\mu_2)}{\sigma_1\sigma_2}+\dfrac{(y-\mu_2)^2}{\sigma_2^2}\Big]\bigg}$</p><h3 id="3-2-二维随机变量的条件分布"><a class="header-anchor" href="#3-2-二维随机变量的条件分布">¶</a>3.2 二维随机变量的条件分布</h3><ol><li><p>$P(X=x_i|Y=y_j)=\dfrac{P(X=x_i,Y=y_j)}{P(Y=y_j)}=\dfrac{p_{ij}}{P_{\cdot j}}$</p></li><li><p>$P(X=x_i)=\sum\limits_j P(Y=y_j)P(X=x_i|Y=y_j)$</p></li><li><p>$f_{X|Y}(x|y)=\dfrac{f(x,y)}{f_Y(y)}$</p><p>$F_{X|Y}(x|y)=\int\limits_{-\infty}^x\dfrac{f(u,y)}{f_Y(y)}du$</p></li></ol><h3 id="3-3-随机变量的独立性"><a class="header-anchor" href="#3-3-随机变量的独立性">¶</a>3.3 随机变量的独立性</h3><ol><li>$X与Y相互独立\Leftrightarrow F(x,y)=F_X(x)F_y(y);f_X(x)f_Y(y)$</li><li>$设(X,Y)为二维离散型随机变量，联合分布律为P(X=x_i,Y=y_j)=p_{ij},则X，Y相互独立的充要条件为：P(X=x_i,Y=y_j)=P(X=x_i)P(Y=y_j),若连续型，则f(x,y)=f_X(x)f_Y(y)$</li></ol><h2 id="第四章-随机变量的数字特征"><a class="header-anchor" href="#第四章-随机变量的数字特征">¶</a>第四章 随机变量的数字特征</h2><h3 id="4-1-数学期望"><a class="header-anchor" href="#4-1-数学期望">¶</a>4.1 数学期望</h3><ol><li><p>$离散：E(X)=\sum\limits_{k=1}^{+\infty}x_kp_k$</p><p>$连续：E(x)=\int_{-\infty}^{+\infty}xf(x)$</p></li><li><p>$数学期望的性质$</p><ol><li>$数学期望存在\Leftrightarrow E|X|&lt;+\infty$</li><li>$X\leq Y,则E(X)\leq E(Y)$</li><li>$E(C)=0$</li><li>$E(CX)=CE(X)$</li><li>$E(X+Y)=E(X)+E(Y)$</li><li>$若X，Y独立，则E(XY)=E(X)\cdot E(Y)$</li></ol></li></ol><h3 id="4-2-方差"><a class="header-anchor" href="#4-2-方差">¶</a>4.2 方差</h3><ol><li><p>$D(X)=E{[X-E(X)]^2}=E(X^2)-[E(X)]^2$</p></li><li><p>$方差的性质：$</p><ol><li>$方差存在\Leftrightarrow E(X^2)&lt;+\infty$</li><li>$C为常数\Rightarrow D(C)=0$</li><li>$C为常数，则D(CX)=C^2D(X)$</li><li>$X和Y独立且方差都存在，则D(X+Y)=D(X)+D(Y)$</li><li>$D(X)\leq E[(X-C)^2]$</li><li>$D(X)=0\Leftrightarrow \exists C,s.t.P(X=C)=1, C=E(X)$</li></ol></li></ol><h3 id="4-3-重要随机变量的数学期望和方差"><a class="header-anchor" href="#4-3-重要随机变量的数学期望和方差">¶</a>4.3 重要随机变量的数学期望和方差</h3><table><thead><tr><th>分布</th><th>分布律或概率密度</th><th>期望</th><th>方差</th></tr></thead><tbody><tr><td>0-1分布$B(1,p)$</td><td>$P(X=k)=p^k(1-p)^{1-k},\quad k=0,1,\quad 0&lt;p&lt;1$</td><td>$p$</td><td>$p(1−p)$</td></tr><tr><td>二项分布$B(n,p)$</td><td>$P(X=k)=C_{n}^{k}p^{k}(1-p)^{n-k},\quad k=0,1,2,...,n,\quad 0&lt;p&lt;1 $</td><td>$np$</td><td>$np(1−p)$</td></tr><tr><td>泊松分布$P(\lambda)$</td><td>$P(X=k)=\frac{\lambda ^{k}}{k!}e^{-λ},\quad \quad k=0,1,2,...,\quad λ&gt;0$</td><td>$\lambda$</td><td>$\lambda$</td></tr><tr><td>几何分布$G(p)$</td><td>$P(X=k)=p(1-p)^{k-1}, k=1, 2, \cdots, 0&lt;p&lt;1$</td><td>$\frac{1}{p}$</td><td>$\frac{1-p}{p^{2}}$</td></tr><tr><td>超几何分布$H(n,M,N)$</td><td></td><td></td><td></td></tr></tbody></table><p>$$<br>P(X=k)=\frac{C_{M}^{k}C_{N-M}^{n-k}}{C_{N}^{m}},<br>$$</p><p>max$|0, n-N+M|\le k\le min|n, M                                               | $                     | $n\frac{M}{N}$          |<br>| 负二项分布 (Pascal 分布)       | $P(X=k)=C_{k-1}^{r-1}p^{r}(1-p)^{k-r}, k=r, r+1, \cdots, 0&lt;p&lt;1$                                                                 | $\frac{r}{p}$       | $\frac{r(1-p)}{p^{2}}$  |<br>| 均匀分布$U(a,b)$             | $f(x)=\left {\begin{matrix} \frac{1}{b-a}, &amp;a&lt;x&lt;b\ 0, &amp;其他\end{matrix} \right.$                                              | $\frac{a+b}{2}$     | $\frac{(b-a)^{2}}{12}$  |<br>| 指数分布$E(\lambda)$         | $f(x)=\left {\begin{matrix} \lambda e^{-\lambda x}, &amp;x&gt;0\ 0, \end{matrix} \right.$其他                                        | $\frac{1}{\lambda}$ | $\frac{1}{\lambda^{2}}$ |<br>| 正态分布$N(\mu, \sigma^{2})$ | $f(x, y)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}}, -\infty &lt;x&lt;+\infty, -\infty &lt;\mu &lt;+\infty, \sigma &gt;0$ | $\mu$               | $\sigma^{2}$            |</p><h3 id="4-4-协方差和相关系数"><a class="header-anchor" href="#4-4-协方差和相关系数">¶</a>4.4 协方差和相关系数</h3><ol><li>$cov(X,Y)=E(XY)-E(<br>X)E(Y)$</li><li>$\rho_{XY}=\dfrac{cov(X,Y)}{\sqrt{D(X)}\sqrt{D(Y)}}$</li><li>$D(X\pm Y)=D(X)+D(Y)\pm2cov(X,Y)$</li><li>$协方差的性质：$<ol><li>$cov(X,Y)=cov(Y,X)$</li><li>$cov(aX,bY)=abcov(X,Y)$</li><li>$cov(X+Y,Z)=cov(X,Z)+cov(Y,Z)$</li><li>$|cov(X,Y)|=\sqrt{D(X)}\sqrt{D(Y)}$</li></ol></li><li>$相关系数的性质$<ol><li>$|\rho_{XY}|\leq 1$</li></ol></li><li>$不相关的命题等价：$<ol><li>$X和Y不相关$</li><li>$\rho_{XY}=0$</li><li>$cov(X,Y)=0$</li><li>$E(XY)=E(X)E(Y)$</li><li>$D(X\pm Y)=D(X)+D(Y)$</li><li>$D(X+Y)=D(X-Y)$</li></ol></li></ol><h3 id="4-5-随机变量的高阶矩"><a class="header-anchor" href="#4-5-随机变量的高阶矩">¶</a>4.5 随机变量的高阶矩</h3><p>$k阶原点矩：E(|X|^k)$</p><p>$k阶中心矩：E{[X-E(X)]^k}$</p><p>$k+l阶混合原点矩：E(|X|^k|Y|^l)$</p><p>$k+l阶混合中心矩：E{[X-E(X)]^k[Y-E(Y)]^l}$</p><h2 id="第五章-大数定律和中心极限定理"><a class="header-anchor" href="#第五章-大数定律和中心极限定理">¶</a>第五章 大数定律和中心极限定理</h2><h3 id="5-1-预备知识"><a class="header-anchor" href="#5-1-预备知识">¶</a>5.1 预备知识</h3><ol><li>$Chebyshev不等式：P(|X-\mu|\geq \epsilon)\leq \dfrac{\sigma^2}{\epsilon^2},P(|X-\mu|&lt;\epsilon)&gt;1-\dfrac{\sigma^2}{\epsilon^2}$</li></ol><h3 id="5-2-大数定律"><a class="header-anchor" href="#5-2-大数定律">¶</a>5.2 大数定律</h3><ol><li>$Bernoulli大数定律：\lim\limits_{n\to+\infty}P(|\dfrac{n_A}n-p|\geq\epsilon)=0,\lim\limits_{n\to+\infty}P(|\dfrac{n_A}n-p|&lt;\epsilon)=1$</li><li>$Chebyshev大数定律：\lim\limits_{n\to+\infty}P(|\dfrac1n\sum\limits_{k=1}^n X_k-\dfrac1n\sum\limits_{k=1}^n\mu_k|&lt;\epsilon)=1$</li><li>$Khintchine大数定律：\lim\limits_{n\to\infty}P(|\dfrac1n\sum\limits_{k=1}^nX_k-\mu|\geq\epsilon)=0,\lim\limits_{n\to\infty}P(|\dfrac1n\sum\limits_{k=1}^nX_k-\mu|&lt;\epsilon)=1$</li></ol><h3 id="5-3-中心极限定理"><a class="header-anchor" href="#5-3-中心极限定理">¶</a>5.3 中心极限定理</h3><ol><li>$独立同分布的中心极限定理：设X_1,X_2,\cdots,X_n,\cdots为独立同分布的随机变量序列，\forall x,\lim\limits_{n\to\infty}P(\dfrac{\sum\limits_{k=1}^nX_k-n\mu}{\sqrt n\sigma}\leq x)=\Phi(x)$</li><li>$De moivre-Laplace中心极限定理：设随机变量Y_n\sim B(n,p),n\to\infty, Y_n\sim N(np, np(1-p))$</li></ol><h2 id="第六章-数理统计的预备知识"><a class="header-anchor" href="#第六章-数理统计的预备知识">¶</a>第六章 数理统计的预备知识</h2><h3 id="6-1-数理统计的基本概念"><a class="header-anchor" href="#6-1-数理统计的基本概念">¶</a>6.1 数理统计的基本概念</h3><ol><li>$\bar X=\dfrac1n \sum\limits_{i=1}^n X_i$</li><li>$S^2=\dfrac1{n-1}\sum\limits_{i=1}^n(X_i-\bar X)^2$</li><li>$M_k=\dfrac1n\sum\limits_{i=1}^n X_i^k(k=1,2,\cdots)$</li><li>$(CM)<em>k=\dfrac 1n\sum\limits</em>{i=1}^n(X_i-\bar X)^k(k=1,2,\cdots)$</li></ol><h3 id="6-2-几个常用统计量的分布"><a class="header-anchor" href="#6-2-几个常用统计量的分布">¶</a>6.2 几个常用统计量的分布</h3><ol><li><p>$正态分布 X\sim N(\mu,\sigma^2)$</p></li><li><p>$\chi^2分布：$</p><p>$\chi^2=\sum\limits_{i=1}^n X_i^2\sim\chi^2(n)$</p><p>$E(\chi^2)=n,D(\chi^2)=2n$</p><p>$若两者独立，则X_1+X_2\sim \chi^2(n_1+n_2)$</p><p>$n很大时,近似符合正态分布N(n,2n)$</p></li><li><p>$t分布：$</p><p>$X\sim N(0,1),Y\sim \chi^2(n),T=\dfrac{X}{\sqrt{Y/n}}\sim t(n)$</p><p>$n充分大(&gt;45)时，近似服从标准正态分布$</p><p>$t_{1-\alpha}(n)=-t_\alpha(n)$</p></li><li><p>$F分布：$</p><p>$U\sim\chi^2(m),V\sim\chi^2(n)，且U,V独立，F=\dfrac{U/m}{V/n}～F(m,n)$</p><p>$F\sim F(m,n)\Rightarrow \dfrac1F\sim F(n,m)$</p><p>$F_{1-\alpha}(m,n)=\dfrac1{F_\alpha(n,m)}$</p></li></ol><h3 id="6-3-正态分布的抽样分布"><a class="header-anchor" href="#6-3-正态分布的抽样分布">¶</a>6.3 正态分布的抽样分布</h3><ol><li>单个正态总体的抽样分布<ol><li>$\bar X\sim N(\mu,\dfrac{\sigma^2}{n})$</li><li>$\dfrac{(n-1)S^2}{\sigma^2}=\sum\limits_{i=1}^n{\dfrac{X_i-\bar X}{\sigma}}\sim\chi^2(n-1)$</li><li>$\bar X与\dfrac{(n-1)S^2}{\sigma^2}独立$</li><li>$\cfrac{\bar X-\mu}{S/\sqrt n}\sim t(n-1)$</li></ol></li><li>两个正态总体的抽样分布<ol><li>$\dfrac{S_1^2/\sigma_1^2}{S_2^2/\sigma_2^2}\sim F(n-1,m-1)$</li><li>$\sigma_1=\sigma_2=\sigma时,\dfrac{(\bar X-\bar Y)-(\mu_1-\mu_2)}{\sqrt{\dfrac1n+\dfrac1m}\sqrt{\dfrac{(n-1)S_1^2+(m-1)S_2^2}{n+m-2}}}$</li></ol></li></ol><h2 id="第七章-参数估计"><a class="header-anchor" href="#第七章-参数估计">¶</a>第七章 参数估计</h2><h3 id="7-1-点估计"><a class="header-anchor" href="#7-1-点估计">¶</a>7.1 点估计</h3><ol><li>频率替代法</li><li>矩估计法</li><li>最大似然估计法</li></ol><h3 id="7-2-估计量的评价标准"><a class="header-anchor" href="#7-2-估计量的评价标准">¶</a>7.2 估计量的评价标准</h3><ol><li>无偏性——估计值的期望是实际值</li><li>有效性<ol><li>有效性的比较看方差大小，方差小的更有效</li><li>$若D(\hat\theta)&lt;D(\theta)且无偏,则有效$</li></ol></li><li>一致性<ol><li>$\lim\limits_{n\to+\infty} D(\hat\theta_n)=0$</li></ol></li></ol><h3 id="7-3-区间估计"><a class="header-anchor" href="#7-3-区间估计">¶</a>7.3 区间估计</h3><ol><li>要选定枢轴量</li></ol><h2 id="第八章-假设检验"><a class="header-anchor" href="#第八章-假设检验">¶</a>第八章 假设检验</h2><p>确定检验统计量、拒绝域</p><h3 id="8-1-单个正态总体均值的假设检验"><a class="header-anchor" href="#8-1-单个正态总体均值的假设检验">¶</a>8.1 单个正态总体均值的假设检验</h3><ol><li><p>方差已知</p><p>$U=\dfrac{\bar X-\mu_0}{\sigma/\sqrt n}\sim N(0,1)$</p></li><li><p>方差未知</p><p>$T=\dfrac{\bar X-\mu_0}{S/\sqrt{n}}\sim t(n-1)$</p></li></ol><h3 id="8-2-单个正态总体方差的假设检验"><a class="header-anchor" href="#8-2-单个正态总体方差的假设检验">¶</a>8.2 单个正态总体方差的假设检验</h3><ol><li><p>均值已知</p><p>$\chi^2=\dfrac{\sum\limits_{i=1}^n(X_i-\mu)^2}{\sigma_0^2}\sim\chi^2(n)$</p></li><li><p>均值未知</p><p>$\chi^2=\dfrac{(n-1)S^2}{\sigma_0^2}\sim\chi^2(n-1)$</p></li></ol><h3 id="8-3-两个正态总体参数均值差的假设检验"><a class="header-anchor" href="#8-3-两个正态总体参数均值差的假设检验">¶</a>8.3 两个正态总体参数均值差的假设检验</h3><ol><li><p>方差$\sigma_1^2,\sigma_2^2已知$</p><p>$\bar X-\bar Y\sim N(\delta,\dfrac{\sigma_1^2}n+\dfrac{\sigma_2^2}m)$</p></li><li><p>方差$\sigma_1^2=\sigma_2^2=\sigma^2$未知</p><p>$T=\dfrac{\bar X-\bar Y-\delta}{S_W\sqrt{\dfrac1n+\dfrac1m}}\sim t(n+m-2)$</p></li><li><p>方差$\sigma_1^2,\sigma_2^2$未知，但样本容量相等</p><p>$\dfrac{\bar Z-\delta}{S_Z/\sqrt n}\sim t(n-1)$</p></li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;概率统计整理&lt;/h1&gt;
&lt;h2 id=&quot;第一章-随机事件和概率&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#第一章-随机事件和概率&quot;&gt;¶&lt;/a&gt;第一章 随机事件和概率&lt;/h2&gt;
&lt;h3 id=&quot;1-1-随机事件及其运算&quot;&gt;&lt;a class=&quot;head</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>C++ 常用库</title>
    <link href="https://ryanstarfox.github.io/2025/01/07/2025/20250107%20C++%E5%B8%B8%E7%94%A8%E5%BA%93/"/>
    <id>https://ryanstarfox.github.io/2025/01/07/2025/20250107%20C++%E5%B8%B8%E7%94%A8%E5%BA%93/</id>
    <published>2025-01-07T06:47:00.000Z</published>
    <updated>2025-01-07T06:47:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="C-常用库"><a class="header-anchor" href="#C-常用库">¶</a>C++ 常用库</h2><h3 id="iostream"><a class="header-anchor" href="#iostream">¶</a>iostream</h3><ol><li><p>控制精度</p><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cout &lt;&lt; <span class="built_in">setprecision</span>(<span class="number">3</span>) &lt;&lt; <span class="number">3.1415926</span></span><br></pre></td></tr></table></figure></li><li><p>小数模式：<code>fixed</code></p></li><li><p>科学技术法：<code>scientific</code></p></li></ol><h3 id="fstream"><a class="header-anchor" href="#fstream">¶</a>fstream</h3><ol><li><p>逐行读取文件内容</p><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;fstream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;string&gt;</span></span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    <span class="function">std::ifstream <span class="title">file</span><span class="params">(<span class="string">&quot;example.txt&quot;</span>)</span></span>;  <span class="comment">// 打开文件</span></span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (!file) &#123;  <span class="comment">// 检查文件是否成功打开</span></span><br><span class="line">        std::cerr &lt;&lt; <span class="string">&quot;Unable to open the file!&quot;</span> &lt;&lt; std::endl;</span><br><span class="line">        <span class="keyword">return</span> <span class="number">1</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    std::string line;</span><br><span class="line">    <span class="comment">// 逐行读取文件内容</span></span><br><span class="line">    <span class="keyword">while</span> (std::<span class="built_in">getline</span>(file, line)) &#123;</span><br><span class="line">        std::cout &lt;&lt; line &lt;&lt; std::endl;  <span class="comment">// 输出每一行</span></span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    file.<span class="built_in">close</span>();  <span class="comment">// 关闭文件</span></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li><li><p>写入文件</p><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">std::ofstream <span class="title">file</span><span class="params">(<span class="string">&quot;output.txt&quot;</span>)</span></span>;</span><br><span class="line">file &lt;&lt; <span class="string">&quot;Hello, World!&quot;</span> &lt;&lt; std::endl;</span><br></pre></td></tr></table></figure></li></ol><h3 id="sstream"><a class="header-anchor" href="#sstream">¶</a>sstream</h3><ol><li><p>isstream</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta"># <span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta"># <span class="keyword">include</span> <span class="string">&lt;sstream&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span></span>&#123;</span><br><span class="line">    <span class="function">std::istringstream <span class="title">iss</span><span class="params">(<span class="string">&quot;42 3.14 hello&quot;</span>)</span></span>;</span><br><span class="line">    <span class="type">int</span> i;</span><br><span class="line">    <span class="type">double</span> d;</span><br><span class="line">    std::string str;</span><br><span class="line">    iss &gt;&gt; i &gt;&gt; d &gt;&gt; str;</span><br><span class="line">    std::cout &lt;&lt; i &lt;&lt; <span class="string">&quot;, &quot;</span> &lt;&lt; d &lt;&lt; <span class="string">&quot;, &quot;</span> &lt;&lt; str &lt;&lt; std::endl;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li><li><p>osstream</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">std::ostringstream oss;</span><br><span class="line">oss &lt;&lt; <span class="number">42</span> &lt;&lt; <span class="string">&quot; &quot;</span> &lt;&lt; <span class="number">3.14</span> &lt;&lt; <span class="string">&quot; &quot;</span> &lt;&lt; <span class="string">&quot;hello&quot;</span>;</span><br><span class="line">std::string result = oss.<span class="built_in">str</span>();  <span class="comment">// 获取输出结果字符串</span></span><br><span class="line">std::cout &lt;&lt; result &lt;&lt; std::endl;  <span class="comment">// 输出 &quot;42 3.14 hello&quot;</span></span><br></pre></td></tr></table></figure></li><li><p>stringstream配合getline处理输入：</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">stringstream <span class="title">ss</span><span class="params">(input1)</span></span>;</span><br><span class="line">string segment;</span><br><span class="line"></span><br><span class="line"><span class="keyword">while</span>(<span class="built_in">getline</span>(ss, segment,<span class="string">&#x27; &#x27;</span>))&#123;</span><br><span class="line">    <span class="function">stringstream <span class="title">NodeStream</span><span class="params">(segment)</span></span>;</span><br><span class="line">    string node, distance;</span><br><span class="line">    <span class="built_in">getline</span>(NodeStream, node, <span class="string">&#x27;:&#x27;</span>);</span><br><span class="line">    <span class="built_in">getline</span>(NodeStream, distance, <span class="string">&#x27;:&#x27;</span>);</span><br><span class="line">    graph[node].distance = <span class="built_in">stoi</span>(distance);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">ss = <span class="built_in">stringstream</span>(input2);</span><br><span class="line"><span class="keyword">while</span> (<span class="built_in">getline</span>(ss, segment, <span class="string">&#x27; &#x27;</span>)) &#123;</span><br><span class="line">    <span class="comment">// 分割每个连接描述，例如 &quot;S:A&quot;</span></span><br><span class="line">    <span class="function">stringstream <span class="title">edgeStream</span><span class="params">(segment)</span></span>;</span><br><span class="line"></span><br><span class="line">    <span class="built_in">getline</span>(edgeStream, from, <span class="string">&#x27;:&#x27;</span>);</span><br><span class="line">    <span class="built_in">getline</span>(edgeStream, to, <span class="string">&#x27;:&#x27;</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure></li></ol><h3 id="vector"><a class="header-anchor" href="#vector">¶</a>vector</h3><h4 id="构造函数和析构函数"><a class="header-anchor" href="#构造函数和析构函数">¶</a>构造函数和析构函数</h4><ul><li><code>vector(size_type n, const value_type&amp; val)</code>：构造一个包含n个元素的vector，每个元素都初始化为val。</li><li><code>vector(const vector&amp; x)</code>：复制构造函数，创建一个与x相同的vector。</li></ul><h4 id="容量相关函数"><a class="header-anchor" href="#容量相关函数">¶</a>容量相关函数</h4><ul><li><code>size()</code>：返回vector中元素的个数。</li><li><code>empty()</code>：检查vector是否为空，如果为空则返回true。</li></ul><h4 id="元素访问函数"><a class="header-anchor" href="#元素访问函数">¶</a>元素访问函数</h4><ul><li><code>operator[]</code>：返回指定位置元素的引用。</li><li><code>at(size_type n)</code>：返回指定位置元素的引用，同时进行边界检查。</li><li><code>front()</code>：返回vector中第一个元素的引用。</li><li><code>back()</code>：返回vector中最后一个元素的引用。</li></ul><h4 id="修改器函数"><a class="header-anchor" href="#修改器函数">¶</a>修改器函数</h4><ul><li><code>assign(size_type n, const value_type&amp; val)</code>：将vector中的元素替换为n个val。</li><li><code>push_back(const value_type&amp; val)</code>：在vector的末尾添加一个元素val。</li><li><code>pop_back()</code>：删除vector末尾的元素。</li><li><code>insert(iterator position, const value_type&amp; val)</code>：在position位置插入一个元素val。</li><li><code>erase(iterator position)</code>：删除position位置处的元素。</li><li><code>erase(iterator first, iterator last)</code>：删除[first, last)区间内的元素。</li><li><code>clear()</code>：清空vector中的所有元素。</li></ul><h4 id="迭代器函数"><a class="header-anchor" href="#迭代器函数">¶</a>迭代器函数</h4><ul><li><p><code>begin()</code>：返回指向vector中第一个元素的迭代器。</p></li><li><p><code>end()</code>：返回指向vector中最后一个元素之后位置的迭代器。</p></li><li><p><code>rbegin()</code>：返回指向vector中最后一个元素的逆向迭代器。</p></li><li><p><code>rend()</code>：返回指向vector中第一个元素之前位置的逆向迭代器。</p></li><li><p><code>vector::iterator</code>&amp;<code>vector::reverse_iterator</code></p></li><li><p>迭代器可以用类似这样的语法：</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> (<span class="keyword">auto</span> i:v)&#123; cout &lt;&lt; i &lt;&lt; <span class="string">&quot; &quot;</span>;&#125;</span><br></pre></td></tr></table></figure><p>或者</p><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> (<span class="keyword">auto</span> i = v.<span class="built_in">begin</span>(); i!=v.end; i++)&#123;cout &lt;&lt; *i &lt;&lt; <span class="string">&quot; &quot;</span>&#125;</span><br></pre></td></tr></table></figure></li></ul><h4 id="队列操作"><a class="header-anchor" href="#队列操作">¶</a>队列操作</h4><ul><li><code>emplace(iterator position, const value_type&amp; val)</code>：在vector的指定位置直接构造元素（是插入）。</li><li><code>emplace_back(val)</code>：在vector的末尾直接构造元素。</li></ul><h3 id="其他操作"><a class="header-anchor" href="#其他操作">¶</a>其他操作</h3><ul><li><code>swap(vector&lt;T&gt;&amp; other)</code>：交换两个 <code>vector</code>的内容。</li><li><code>assign(size_type n, const T&amp; val)</code>：将 <code>vector</code>中的元素替换为 <code>n</code>个 <code>val</code>。</li><li><code>assign(iterator first, iterator last)</code>：将 <code>vector</code>中的元素替换为指定范围的元素。</li></ul><h3 id="pair"><a class="header-anchor" href="#pair">¶</a>pair</h3><h4 id="构造函数"><a class="header-anchor" href="#构造函数">¶</a>构造函数</h4><ul><li><code>pair(const first_type&amp; a, const second_type&amp; b)</code>：创建一个pair，其first成员初始化为a，second成员初始化为b。</li></ul><h3 id="成员访问"><a class="header-anchor" href="#成员访问">¶</a>成员访问</h3><ul><li><code>first</code>：返回pair的第一个成员的引用。</li><li><code>second</code>：返回pair的第二个成员的引用。</li></ul><h3 id="成员函数"><a class="header-anchor" href="#成员函数">¶</a>成员函数</h3><ul><li><code>swap(pair&amp; p)</code>：交换两个pair的成员。</li></ul><h3 id="非成员函数"><a class="header-anchor" href="#非成员函数">¶</a>非成员函数</h3><ul><li><code>make_pair(T1 a, T2 b)</code>：创建一个pair对象，其first成员用a初始化，second成员用b初始化。</li><li><code>pair</code>的比较规则：先比较pair.first，再比较pair.second</li></ul><h3 id="deque"><a class="header-anchor" href="#deque">¶</a>deque</h3><p>同 <code>vector</code></p><h3 id="stack"><a class="header-anchor" href="#stack">¶</a>stack</h3><h4 id="构造函数-2"><a class="header-anchor" href="#构造函数-2">¶</a>构造函数</h4><ul><li><code>stack&lt;T&gt; stk;</code>：创建一个空的 <code>stack</code>，元素类型为 <code>T</code>。</li><li><code>stack&lt;T&gt; stk(c);</code>：使用容器 <code>c</code> 的副本作为 <code>stack</code> 的底层容器来创建 <code>stack</code>。</li><li><code>stack&lt;T, Container&lt;T&gt;&gt; stk;</code>：创建一个 <code>stack</code>，元素类型为 <code>T</code>，底层容器为 <code>Container</code>。</li></ul><h4 id="容量操作"><a class="header-anchor" href="#容量操作">¶</a>容量操作</h4><ul><li><code>empty()</code>：检查 <code>stack</code> 是否为空。</li><li><code>size()</code>：返回 <code>stack</code> 中元素的数量。</li></ul><h4 id="元素访问"><a class="header-anchor" href="#元素访问">¶</a>元素访问</h4><ul><li><code>top()</code>：返回栈顶元素的引用。如果栈为空，则行为未定义。</li></ul><h4 id="修改器"><a class="header-anchor" href="#修改器">¶</a>修改器</h4><ul><li><code>push(const T&amp; val)</code>：将元素 <code>val</code> 压入栈顶。</li><li><code>pop()</code>：移除栈顶元素。如果栈为空，则行为未定义。</li><li><code>emplace(args...)</code>：在栈顶构造元素，使用 <code>args</code> 作为构造函数的参数。</li><li><code>swap(stack&lt;T&gt;&amp; other)</code>：交换两个 <code>stack</code> 的内容。</li></ul><h3 id="queue"><a class="header-anchor" href="#queue">¶</a>queue</h3><p>同 <code>stack</code>，元素访问变成 <code>front()</code>和 <code>back()</code></p><h3 id="priority-queue"><a class="header-anchor" href="#priority-queue">¶</a>priority_queue</h3><p>同 <code>queue</code></p><h3 id="set"><a class="header-anchor" href="#set">¶</a>set</h3><h4 id="创建-set"><a class="header-anchor" href="#创建-set">¶</a>创建 <code>set</code></h4><ul><li><code>set&lt;T&gt; s;</code>：创建一个空的 <code>set</code>，元素类型为 <code>T</code>，默认使用 <code>operator&lt;</code> 作为比较函数。</li><li><code>set&lt;T, Compare&gt; s;</code>：创建一个 <code>set</code>，元素类型为 <code>T</code>，比较函数为 <code>Compare</code>。</li><li>可以直接用 <code>&#123;&#125;</code>来初始化</li></ul><h4 id="容量操作-2"><a class="header-anchor" href="#容量操作-2">¶</a>容量操作</h4><ul><li><code>empty()</code>：检查 <code>set</code> 是否为空。</li><li><code>size()</code>：返回 <code>set</code> 中元素的数量。</li></ul><h4 id="元素访问-2"><a class="header-anchor" href="#元素访问-2">¶</a>元素访问</h4><ul><li><code>find(const T&amp; val)</code>：返回一个指向 <code>set</code> 中值为 <code>val</code> 的元素的迭代器，如果找不到，则返回 <code>end()</code>。</li><li><code>count(const T&amp; val)</code>：返回 <code>set</code> 中值为 <code>val</code> 的元素的数量，由于 <code>set</code> 中元素唯一，因此结果只能是 0 或 1。</li></ul><h4 id="修改器-2"><a class="header-anchor" href="#修改器-2">¶</a>修改器</h4><ul><li><code>insert(const T&amp; val)</code>：将 <code>val</code> 插入到 <code>set</code> 中，如果 <code>val</code> 已经存在，则 <code>set</code> 不变。</li><li><code>erase(iterator position)</code>：从 <code>set</code> 中删除迭代器 <code>position</code> 指向的元素。</li><li><code>erase(const T&amp; val)</code>：从 <code>set</code> 中删除所有值为 <code>val</code> 的元素。</li><li><code>clear()</code>：删除 <code>set</code> 中所有的元素。</li><li><code>emplace(args...)</code>：在 <code>set</code> 中构造元素，使用 <code>args</code> 作为构造函数的参数。</li><li><code>emplace_hint(const_iterator position, args...)</code>：在 <code>set</code> 中构造元素，使用 <code>args</code> 作为构造函数的参数，并尽量在 <code>position</code> 之前插入。</li></ul><h3 id="map"><a class="header-anchor" href="#map">¶</a>map</h3><h4 id="创建-map"><a class="header-anchor" href="#创建-map">¶</a>创建 <code>map</code></h4><ul><li><code>map&lt;Key, T&gt; m;</code>：创建一个空的 <code>map</code>，键类型为 <code>Key</code>，值类型为 <code>T</code>，默认使用 <code>operator&lt;</code> 作为比较函数。</li><li><code>map&lt;Key, T, Compare&gt; m;</code>：创建一个 <code>map</code>，键类型为 <code>Key</code>，值类型为 <code>T</code>，比较函数为 <code>Compare</code>。</li></ul><h4 id="容量操作-3"><a class="header-anchor" href="#容量操作-3">¶</a>容量操作</h4><ul><li><code>empty()</code>：检查 <code>map</code> 是否为空。</li><li><code>size()</code>：返回 <code>map</code> 中键值对的数量。</li></ul><h4 id="元素访问-3"><a class="header-anchor" href="#元素访问-3">¶</a>元素访问</h4><ul><li><code>operator[]</code>：允许通过键直接访问对应的值，如果键不存在，则自动创建一个键值对，其值为值类型的默认构造值。</li><li><code>at(const Key&amp; key)</code>：返回键 <code>key</code> 对应的值，如果键不存在，则抛出 <code>std::out_of_range</code> 异常。</li></ul><h4 id="查找元素"><a class="header-anchor" href="#查找元素">¶</a>查找元素</h4><ul><li><code>find(const Key&amp; key)</code>：返回一个指向键 <code>key</code> 对应的键值对的迭代器，如果找不到，则返回 <code>end()</code>。</li><li><code>count(const Key&amp; key)</code>：返回 <code>map</code> 中键 <code>key</code> 的数量，由于键是唯一的，结果只能是 0 或 1。</li></ul><h4 id="修改器-3"><a class="header-anchor" href="#修改器-3">¶</a>修改器</h4><ul><li><code>insert(const value_type&amp; val)</code>：插入一个键值对。</li><li><code>erase(iterator position)</code>：删除迭代器 <code>position</code> 指向的键值对。</li><li><code>erase(const Key&amp; key)</code>：删除键 <code>key</code> 对应的键值对。</li><li><code>clear()</code>：删除 <code>map</code> 中所有的键值对。</li><li><code>emplace(args...)</code>：在 <code>map</code> 中构造键值对，使用 <code>args</code> 作为构造函数的参数。</li></ul><h3 id="string"><a class="header-anchor" href="#string">¶</a>string</h3><h4 id="字符串长度和容量"><a class="header-anchor" href="#字符串长度和容量">¶</a>字符串长度和容量</h4><ul><li><code>size()</code>：返回字符串中的字符数。</li></ul><h4 id="字符串修改"><a class="header-anchor" href="#字符串修改">¶</a>字符串修改</h4><ul><li><code>clear()</code>：清空字符串。</li><li><code>insert(size_t pos, const string&amp; str)</code>：在位置 <code>pos</code> 插入字符串 <code>str</code>。</li><li><code>erase(size_t pos, size_t len)</code>：删除从位置 <code>pos</code> 开始的 <code>len</code> 个字符。</li><li><code>replace(size_t pos, size_t len, const string&amp; str)</code>：将位置 <code>pos</code> 开始的 <code>len</code> 个字符替换为字符串 <code>str</code>。</li><li><code>push_back(char c)</code>：在字符串末尾添加字符 <code>c</code>。</li><li><code>pop_back()</code>：删除字符串末尾的字符。</li></ul><h4 id="字符串查询"><a class="header-anchor" href="#字符串查询">¶</a>字符串查询</h4><ul><li><code>find(const string&amp; str, size_t pos=0)</code>：从位置 <code>pos</code> 开始查找子字符串 <code>str</code>，返回找到的位置，如果没有找到则返回 <code>string::npos</code>。</li><li><code>rfind(const string&amp; str, size_t pos=npos)</code>：从位置 <code>pos</code> 开始向左查找子字符串 <code>str</code>，返回找到的位置，如果没有找到则返回 <code>string::npos</code>。</li><li><code>find_first_of(const string&amp; str, size_t pos=0)</code>：从位置 <code>pos</code> 开始查找任意一个属于 <code>str</code> 的字符，返回找到的位置，如果没有找到则返回 <code>string::npos</code>。</li></ul><h4 id="字符串的子串"><a class="header-anchor" href="#字符串的子串">¶</a>字符串的子串</h4><ul><li><code>substr(size_t pos, size_t len)</code>：返回从位置 <code>pos</code> 开始的 <code>len</code> 个字符的子字符串。</li></ul><h4 id="字符串的连接"><a class="header-anchor" href="#字符串的连接">¶</a>字符串的连接</h4><ul><li><code>operator+(const string&amp; str)</code>：返回两个字符串连接后的新字符串。</li><li><code>append(const string&amp; str)</code>：将字符串 <code>str</code> 添加到当前字符串的末尾。</li></ul><h4 id="字符串与数字之间的转换"><a class="header-anchor" href="#字符串与数字之间的转换">¶</a>字符串与数字之间的转换</h4><ul><li><code>to_string</code></li><li><code>stoi</code></li><li><code>stod</code></li></ul><h3 id="algorithm"><a class="header-anchor" href="#algorithm">¶</a>algorithm</h3><h4 id="sort"><a class="header-anchor" href="#sort">¶</a>sort</h4><ol><li>sort</li></ol><ul><li><pre><code class="language-cpp">std::sort(arr, arr + n); // 对数组 arr 中的前 n 个元素排序std::sort(v.begin(), v.end()); // 对 vector v 中的元素排序<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">2. stable_sort</span><br><span class="line"></span><br><span class="line">- ```cpp</span><br><span class="line">  std::stable_sort(v.begin(), v.end()); // 稳定排序</span><br></pre></td></tr></table></figure></code></pre></li></ul><ol start="3"><li>Partial_sort</li></ol><ul><li><pre><code class="language-cpp">std::partial_sort(arr, arr + n, arr + m); // 排序前 n 个元素<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">#### find</span><br><span class="line"></span><br><span class="line">1. find</span><br><span class="line"></span><br><span class="line">- ```cpp</span><br><span class="line">  auto it = std::find(v.begin(), v.end(), value);</span><br><span class="line">  if (it != v.end()) &#123;</span><br><span class="line">      // 找到了元素</span><br><span class="line">  &#125;</span><br></pre></td></tr></table></figure></code></pre></li></ul><ol start="2"><li>Find_if</li></ol><ul><li><pre><code class="language-cpp">auto it = std::find_if(v.begin(), v.end(), [](int x) &#123; return x &gt; 10; &#125;);<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">3. Lower_bound</span><br><span class="line"></span><br><span class="line">- ```cpp</span><br><span class="line">  auto it = std::lower_bound(v.begin(), v.end(), value);</span><br></pre></td></tr></table></figure>类似也有upper_bound</code></pre></li></ul><h4 id="permutation"><a class="header-anchor" href="#permutation">¶</a>permutation</h4><ol><li><pre><code class="language-cpp">next_permutation(v.begin, v.end)<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">2. ```cpp</span><br><span class="line">   prev_permutation(v.begin, v.end)</span><br></pre></td></tr></table></figure></code></pre></li></ol><h4 id="reverse"><a class="header-anchor" href="#reverse">¶</a>reverse</h4><h4 id="copy"><a class="header-anchor" href="#copy">¶</a>copy</h4><h4 id="rotate"><a class="header-anchor" href="#rotate">¶</a>rotate</h4><h3 id="运算符重载"><a class="header-anchor" href="#运算符重载">¶</a>运算符重载</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"></span><br><span class="line"><span class="keyword">class</span> <span class="title class_">Complex</span> &#123;</span><br><span class="line"><span class="keyword">public</span>:</span><br><span class="line">    <span class="type">double</span> real, imag;</span><br><span class="line"></span><br><span class="line">    <span class="built_in">Complex</span>(<span class="type">double</span> r = <span class="number">0</span>, <span class="type">double</span> i = <span class="number">0</span>) : <span class="built_in">real</span>(r), <span class="built_in">imag</span>(i) &#123;&#125;</span><br><span class="line"></span><br><span class="line">    Complex <span class="keyword">operator</span>+(<span class="type">const</span> Complex&amp; other) &#123;</span><br><span class="line">        <span class="keyword">return</span> <span class="built_in">Complex</span>(real + other.real, imag + other.imag);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="type">void</span> <span class="title">display</span><span class="params">()</span> <span class="type">const</span> </span>&#123;</span><br><span class="line">        cout &lt;&lt; real &lt;&lt; <span class="string">&quot; + &quot;</span> &lt;&lt; imag &lt;&lt; <span class="string">&quot;i&quot;</span> &lt;&lt; endl;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    <span class="function">Complex <span class="title">c1</span><span class="params">(<span class="number">1.0</span>, <span class="number">2.0</span>)</span>, <span class="title">c2</span><span class="params">(<span class="number">3.0</span>, <span class="number">4.0</span>)</span></span>;</span><br><span class="line">    Complex c3 = c1 + c2;</span><br><span class="line">    c<span class="number">3.</span><span class="built_in">display</span>();  <span class="comment">// 输出: 4.0 + 6.0i</span></span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="捕捉异常"><a class="header-anchor" href="#捕捉异常">¶</a>捕捉异常</h3><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">vector&lt;<span class="type">int</span>&gt; a = &#123;<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>,<span class="number">5</span>&#125;;</span><br><span class="line"><span class="keyword">try</span>&#123;</span><br><span class="line">    cout &lt;&lt; a.<span class="built_in">at</span>(<span class="number">6</span>);</span><br><span class="line">&#125;</span><br><span class="line"><span class="built_in">catch</span> (<span class="type">const</span> out_of_range e)&#123;</span><br><span class="line">cerr &lt;&lt; <span class="string">&quot;a: &quot;</span> &lt;&lt; e.<span class="built_in">what</span>() &lt;&lt; endl;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;C-常用库&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#C-常用库&quot;&gt;¶&lt;/a&gt;C++ 常用库&lt;/h2&gt;
&lt;h3 id=&quot;iostream&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#iostream&quot;&gt;¶&lt;/a&gt;ios</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>骑车-2</title>
    <link href="https://ryanstarfox.github.io/2024/12/26/2024/20241226%20%E9%AA%91%E8%BD%A6/"/>
    <id>https://ryanstarfox.github.io/2024/12/26/2024/20241226%20%E9%AA%91%E8%BD%A6/</id>
    <published>2024-12-26T07:00:00.000Z</published>
    <updated>2024-12-26T07:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<p>昨日回寝吃了外卖晚饭，再回图书馆时竟突然决定不骑车，而是走去图书馆。</p><p>想起我在年初写过一篇文章，认为骑车恰到好处，不可再过，可我此时竟然也觉得骑车太累了，我想走去图书馆，我认为走路是一种休息。我一直喜欢走路，我是那种走路很快的人，但是以这个速度走路，对我来说是“慢悠悠”的，是我舒适的节奏。我摘下了耳机——我平时通勤总会带着耳机听点随便什么声音——音乐也好，播客也好，为了将我的注意力用一些东西填满，为了让自己沉浸到一种被营造出来的情绪中去，但此时我却想放任自己的灵魂掉入纯白的虚空。人的思维终究不是纯粹的虚空，总是会有一些浅浅的颜色越开越深，在薄暮之时，人就是会油然而生“夕阳无限好”之叹。我在汹涌的情绪之海中随波逐流，漂到一些莫名的岛屿，我不知道为什么涌上心头的是它们，我想离开它们，离开那些我害怕的未来、我遗憾的过去，但我越挣扎，就越向无底深渊靠近。可笑的是，我又享受这种强烈的感受，好似被这种煎熬赋予了人性一样。</p><p>骑车不好，骑车还是要占用太多的注意力。我还是需要时不时让大脑空转起来的，但是哪儿来的时间给这种无谓的宣泄呢。</p><p>圣诞（的后一天）快乐。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;昨日回寝吃了外卖晚饭，再回图书馆时竟突然决定不骑车，而是走去图书馆。&lt;/p&gt;
&lt;p&gt;想起我在年初写过一篇文章，认为骑车恰到好处，不可再过，可我此时竟然也觉得骑车太累了，我想走去图书馆，我认为走路是一种休息。我一直喜欢走路，我是那种走路很快的人，但是以这个速度走路，对我来说是</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="旅行/Travel" scheme="https://ryanstarfox.github.io/tags/%E6%97%85%E8%A1%8C-Travel/"/>
    
  </entry>
  
  <entry>
    <title>数理逻辑整理</title>
    <link href="https://ryanstarfox.github.io/2024/12/09/2024/20241209%20%E6%95%B0%E7%90%86%E9%80%BB%E8%BE%91/"/>
    <id>https://ryanstarfox.github.io/2024/12/09/2024/20241209%20%E6%95%B0%E7%90%86%E9%80%BB%E8%BE%91/</id>
    <published>2024-12-09T02:27:00.000Z</published>
    <updated>2024-12-09T02:27:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>数理逻辑</h1><h2 id="第一章-命题逻辑的基本概念"><a class="header-anchor" href="#第一章-命题逻辑的基本概念">¶</a>第一章 命题逻辑的基本概念</h2><ol><li>命题是一个陈述句，不能是悖论，有固定的真假值（只是这个值可以未知）</li><li>$P\to Q= \neg P\vee Q$</li><li>$P \leftrightarrow Q=(P\to Q)\wedge(Q\to P)$</li><li>合式公式<ol><li>简单命题是合式公式</li><li>如果$A$是合式公式，那么$\neg A$也是合式公式</li><li>如果$A,B$是合式公式，那么$(A\vee B),(A\wedge B),(A\to B),(A\leftrightarrow B)也是合式公式$</li><li>当且仅当使用有限次(1),(2),(3)所组成的符号串是合式公式</li></ol></li><li>重言式=永真式，矛盾式=永假式</li></ol><h2 id="第二章-命题逻辑的等值与推理运算"><a class="header-anchor" href="#第二章-命题逻辑的等值与推理运算">¶</a>第二章 命题逻辑的等值与推理运算</h2><ol><li><p>$A$与$B$真值表相同，则$A=B$或者$A\Leftrightarrow B$</p></li><li><p>运算规律：</p><ol><li><p>双重否定律</p><p>$\neg\neg P=P$</p></li><li><p>结合律</p><p>$(P\wedge Q)\wedge R=P\wedge(Q\wedge R)$</p><p>$(P\vee Q)\vee R=P\wedge(Q\vee R)$</p><p>$(P\leftrightarrow Q)\leftrightarrow R=P\leftrightarrow(Q\leftrightarrow R)$</p><p>$(P\to Q)\to R\neq P\to(Q\to R)$</p></li><li><p>交换律</p><p>$P\wedge Q=Q\wedge P$</p><p>$P\vee Q=Q\vee P$</p><p>$P\leftrightarrow Q=Q\leftrightarrow P$</p><p>$P\to Q\neq Q\to P$</p></li><li><p>分配律</p><p>$P\wedge(Q\vee R)=(P\wedge Q)\vee(P\wedge R)$</p><p>$P\vee(Q\wedge R)=(P\vee Q)\wedge(P\vee R)$</p><p>$P\leftrightarrow (Q\leftrightarrow R)\neq (P\leftrightarrow Q)\leftrightarrow (P\leftrightarrow Q)$</p><p>$P\to(Q\to R)=(P\to Q)\to(P\to R)$</p></li><li><p>恒等律</p><p>$P\wedge P=P$</p><p>$P\vee P=P$</p><p>$P\leftrightarrow P=T$</p><p>$P\to P=T$</p></li><li><p>吸收率</p><p>$P\vee(P\wedge Q)=P$</p><p>$P\wedge(P\vee Q)=P$</p></li><li><p>摩根律</p><p>$\neg (P\vee Q)=\neg P\wedge\neg Q$</p><p>$\neg (P\wedge Q)=\neg P\vee\neg Q$</p><p>$\neg(P\leftrightarrow Q)=\neg P\leftrightarrow Q=P\leftrightarrow\neg Q=(\neg P\wedge Q)\vee(P\wedge\neq Q)$</p><p>$\neg(P\to Q)=P\wedge\neg Q$</p></li><li><p>同一律</p><p>$P\vee F=P$</p><p>$P\wedge T=P$</p><p>$T\leftrightarrow P=P$</p><p>$T\to P=P$</p><p>$P\to F=\neg P$</p><p>$P\leftrightarrow F=\neg P$</p></li><li><p>零律</p><p>$P\wedge F=F$</p><p>$P\vee T=T$</p><p>$P\to T=T$</p><p>$F\to P=T$</p></li><li><p>补余律</p><p>$P\wedge\neg P=F$</p><p>$P\vee\neg P=T$</p><p>$P\to\neg P=\neg P$</p><p>$\neg P\to P=P$</p><p>$P\leftrightarrow\neg P=F$</p></li></ol></li><li><p>常用：</p><ol><li>$P\to Q= \neg P\vee Q$</li><li>$P\to Q=\neg Q\to\neg P$</li><li>$P\to(Q\to R)=(P\wedge Q)\to R$</li><li>$P\leftrightarrow Q=(P\wedge Q)\vee(\neg P\wedge\neg Q)$</li><li>$P\leftrightarrow Q=(P\vee\neg Q)\wedge(\neg P\vee Q)$</li><li>$P\leftrightarrow Q=(P\to Q)\vee (Q\to P)$</li><li>$P\to(Q\to R)=Q\to(P\to R)$</li><li>$(P\to R)\wedge(Q\to R)=(P\vee Q)\to R$</li></ol></li><li><p>永真式、永假式、可满足式</p></li><li><p>$\bar\vee异或，\uparrow与非，\downarrow或非$</p></li><li><p>连接词的完备集：${\neg,\wedge,\vee},{\neg,\vee},{\neg,\wedge},{\neg,\to},{\uparrow},{\downarrow}$</p></li><li><p>对偶式：将$A$中的$\vee,\wedge,T,F$换成$\wedge,\vee,F,T$，记作$A^*$</p></li><li><p>若$A=A(P_1,P_2,\cdots,P_n)，$则令$A^-=A(\neg P_1,\neg P_2,\cdots,\neg P_n)$</p></li><li><p>$\neg (A^<em>)=(\neg A)^</em>,\neg(A^-)=(\neg A)^-$</p><p>$(A^<em>)^</em>=A,(A^-)^-=A$</p><p>$\neg A = A^{*-}$</p><p>$A=B \Leftrightarrow A^<em>=B^</em>$</p><p>$A\to B与B^*\to A^*同永真$</p><p>$A与A^-同永真性，\neg A与A^*同永真性$</p></li><li><p>析取范式形如$A_1\vee A_2\vee\cdots\vee A_n$</p></li></ol><p>合取范式形如$A_1\wedge A_2\wedge\cdots\wedge A_n$</p><p>任一命题都有与之等值的合取范式和析取范式</p><p>求范式的步骤：</p><ol><li><p>消去$\to, \leftrightarrow$</p></li><li><p>使用摩根律和双重否定律，把否定词移到命题变项上</p></li><li><p>重复使用分配律</p></li><li><p>仅由极小项构成的析取式为主析取范式，极小项用$m_i$表示</p><p>仅由极大项构成的合取式为主合取范式，极大项用$M_i$表示</p></li><li><p>前提真结论必真的推理形式为正确的推理形式</p></li><li><p>$(A\Rightarrow B)\Leftrightarrow(A\to B)$</p><p>$(A\Rightarrow B)\Leftrightarrow (A\wedge \neg B)$</p></li></ol><h2 id="第三章-命题逻辑的公理化"><a class="header-anchor" href="#第三章-命题逻辑的公理化">¶</a>第三章 命题逻辑的公理化</h2><ol><li><p>公理系统：</p><ul><li>初始符号：公理系统允许出现的全体符号的集合</li><li>形成规则：定义了合法序列</li><li>公理：最基本的重言式</li><li>变形规则</li><li>定理：所有的重言式和它们的证明</li></ul></li><li><p>命题逻辑的公理系统</p><ul><li>初始符号：<ul><li>$A,B,C\cdots表示命题$</li><li>$\wedge,\vee,\neg表示连接词$</li><li>$( )圆括号$</li><li>$\vdash加在公式之前，表示其是永真式$</li></ul></li><li>形成规则：<ul><li>$符号\pi是合式公式，\pi取值为A,B,\cdots$</li><li>$若A，B是合式公式，则(A\vee B)是合式公式$</li><li>$若A是合式公式，则\neg A是合式公式$</li><li>$只有符合(1),(2),(3)的符号序列才是合式公式$</li></ul></li><li>定义：<ul><li>$(A\to B)定义为(\neg A\vee B)$</li><li>$(A\wedge B)定义为\neg(\neg A\vee\neg B)$</li><li>$(A\leftrightarrow B)定义为((A\to B)\wedge(B\to A))$</li></ul></li><li>公理：<ul><li>$\vdash((P\vee P)\to P)$</li><li>$\vdash(P\to(P\vee Q))$</li><li>$\vdash ((P\vee Q)\to(Q\vee P))$</li><li>$\vdash((Q\to R)\to((P\vee Q)\to(P\vee R)))$</li></ul></li><li>推理规则<ul><li>$代入原则$</li><li>$分离原则：\vdash A,\vdash A\to B\Rightarrow\vdash B$</li><li>$置换规则$</li></ul></li></ul></li><li><p>若所有成立的定理都可由系统推导出来，则称其为完备系统</p></li><li><p>推理方法：</p><p>$\gamma\to\alpha\wedge \beta \Rightarrow (\gamma\to\alpha) \wedge(\gamma\to\beta)$</p><p>$\gamma\to\alpha\vee \beta\Rightarrow\gamma\wedge \neg\alpha\to\beta$</p><p>$\alpha\wedge\beta\to\gamma\Rightarrow\alpha\to(\beta\to\gamma)$</p><p>$\alpha\vee\beta\to\gamma\Rightarrow(\alpha\to\gamma)\wedge(\beta\to\gamma)$</p></li></ol><h2 id="第四章-谓词逻辑的基本概念"><a class="header-anchor" href="#第四章-谓词逻辑的基本概念">¶</a>第四章 谓词逻辑的基本概念</h2><ol><li><p>受量词约束-&gt;约束变元；</p><p>不受量词约束-&gt;自由变元</p></li><li><p>严格来说，x要在有限域内，$\forall x$和$\exists x$才能称为合式公式</p></li></ol><h2 id="第五章-谓词逻辑的等值和推理演算"><a class="header-anchor" href="#第五章-谓词逻辑的等值和推理演算">¶</a>第五章 谓词逻辑的等值和推理演算</h2><ol><li><p>等值式</p><p>$\neg (\forall x)P(x)=(\exists x)\neg P(x)$</p><p>$\neg (\exists x)P(X)=(\forall x)\neg P(x)$</p><p>$(\forall x)(P(x)\to q)=(\exists x)P(x)\to q$</p><p>$(\exists x)(P(x)\to q)=(\forall x)P(x)\to q$</p><p>$(\forall x)(p\to Q(x))=p\to(\forall x)Q(x)$</p><p>$(\exists x)(p\to Q(x))=p\to(\exists x)Q(x)$</p><p>$(\forall x)(P(x)\wedge Q(x))=(\forall x)P(x)\wedge (\forall x)Q(x)$</p><p>$(\exists x)(P(x)\vee Q(X))=(\exists x)P(x)\vee(\exists x)Q(x)$</p><p>$(\forall x)(\forall y)(P(x)\vee Q(y))=(\forall x)P(x)\vee(\forall x)Q(x)$</p><p>$(\exists x)(\exists y)(P(x)\wedge Q(y))=(\exists x)P(x)\wedge(\exists x)Q(x)$</p></li><li><p>范式</p><ol><li><p>前束范式</p><p>$A=(Q_1x_1)\cdots(Q_nx_n)M(x_1,\cdots,x_n)$</p><p>$Q_i为量词，M称作公式A的母式（基式），M中不再有量词$</p></li><li><p>Skolem标准形</p><p>$(\exists x_1)\cdots(\exists x_i)(\forall x_{i+1})\cdots(\forall x_n)M(x_1,\cdots,x_n)$</p></li></ol></li><li><p>基本的推理公式</p><ol><li>$(\forall x) P(x)\vee(\forall x)Q(x)\Rightarrow (\forall x)(P(x)\vee Q(x))$</li><li>$(\exists x)(P(x)\wedge Q(x))\Rightarrow (\exists x)P(x)\wedge (\exists x)Q(x)$</li><li>$(\forall x)(P(x)\to Q(x))\Rightarrow(\forall x)P(x)\to(\forall x)Q(x)$</li><li>$(\forall x)(P(x)\to Q(x))\Rightarrow(\exists x)P(x)\to(\exists x)Q(x)$</li><li>$(\forall x)(P(x)\leftrightarrow Q(x))\Rightarrow(\forall x)P(x)\leftrightarrow(\forall x)Q(x)$</li><li>$(\forall x)(P(x)\leftrightarrow Q(x))\Rightarrow(\exists x)P(x)\leftrightarrow(\exists x)Q(x)$</li><li>$(\forall x)(P(x)\to Q(x))\wedge(\forall x)(Q(x)\to R(X))\Rightarrow(\forall x)(P(x)\to R(X))$</li><li>$(\forall x)(P(X)\to Q(X))\wedge P(a)\Rightarrow Q(a)$</li><li>$(\forall x)(\forall y)P(x,y)\Rightarrow (\exists x)(\forall y)P(x,y)$</li><li>$(\exists x)(\forall y)P(x,y)\Rightarrow(\forall y)(\exists x)P(x,y)$</li></ol></li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;数理逻辑&lt;/h1&gt;
&lt;h2 id=&quot;第一章-命题逻辑的基本概念&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#第一章-命题逻辑的基本概念&quot;&gt;¶&lt;/a&gt;第一章 命题逻辑的基本概念&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;命题是一个陈述句，不能是悖论，有固定的真假值（</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    <category term="理论/Theory" scheme="https://ryanstarfox.github.io/tags/%E7%90%86%E8%AE%BA-Theory/"/>
    
  </entry>
  
  <entry>
    <title>图论整理</title>
    <link href="https://ryanstarfox.github.io/2024/12/01/2024/20241201%20%E5%9B%BE%E8%AE%BA/"/>
    <id>https://ryanstarfox.github.io/2024/12/01/2024/20241201%20%E5%9B%BE%E8%AE%BA/</id>
    <published>2024-12-01T13:34:00.000Z</published>
    <updated>2024-12-01T13:34:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>图论整理</h1><h2 id="第一章-基本概念"><a class="header-anchor" href="#第一章-基本概念">¶</a>第一章 基本概念</h2><h3 id="1-1-图的概念"><a class="header-anchor" href="#1-1-图的概念">¶</a>1.1 图的概念</h3><ol><li><p>$(V(G),E(G))$称为图，$V(G)$是非空集合，称为顶点集，$E(G)$是$V(G)$诸顶点之间边的集合。常用$G=(V,E)$表示图</p></li><li><p>只讨论有限图，$|V|=n$称为图的阶，$|E|=m$</p></li><li><p>一些概念：</p><ol><li><p>$e_k=(v_i,v_j)$</p><ol><li>称$v_i与v_j是相邻顶点；e_k分别与v_i,v_j关联$</li><li>称$v_i是e_k的始点，v_j是e_k的终点，v_i是v_j的直接前趋，v_j是v_i的直接后继$</li></ol></li><li><p><strong>邻接边</strong>：有一个共同顶点的两条边</p></li><li><p><strong>有向图</strong>：全部由有向边构成的图</p><p>**无向图：**全部由无向边构成的图</p><p>**混合图：**既有有向边又有无向边构成的图</p></li><li><p>**自环：**只与一个顶点关联的边</p></li><li><p>**多重边：**同一对顶点之间存在多条边</p><p>**多重图：**含有重边的图</p></li><li><p>**孤立点：**没有与任何边关联的顶点</p></li><li><p>**度$d(v)$：**与顶点关联的边的数目</p><p>**入读：**入边条数</p><p>**出度：**出边条数</p><p>**奇点：**度为奇数的点</p><p>**偶点：**度为偶数的点</p></li><li><p>**简单图：**不存在自环的无向图</p></li></ol></li><li><p>$\sum\limits_{v\in{V(G)}}d(v)=2m$</p></li><li><p>G中奇数的顶点必为偶数个</p></li><li><p>G中出度之和=入度之和</p></li><li><p>K~n~的变数是$\cfrac12n(n-1)$</p></li><li><p>非空简单图G中一定存在度相同的顶点</p></li><li><p><strong>n阶完全图：K~n~</strong></p></li><li><p><strong>完全二分图：K~m,n~</strong></p></li><li><p>**平凡图：**n=1的图</p></li><li><p>**空图/零图：**m=0的图</p></li><li><p>**（k度）正则图：**所有顶点度数均相等（为k）的图</p></li><li><p><strong>阶为k的(k-1)-正则图：k-完全图</strong></p></li><li><p>**正权图：**权为正实数的赋权图</p></li><li><p><strong>子图：</strong>$V'\in V,E'\in E$</p><p><strong>支撑子图/生成子图：</strong>$V'=V,E'\in E$</p><p><strong>导出子图：</strong>$V'\in V,E'_V = E_V$</p></li><li><p><strong>邻点集：</strong>$\Gamma(v)$</p><p><strong>直接后继集/外邻集：</strong>$\Gamma^+(v)$</p><p><strong>直接前趋集/内邻集：</strong>$\Gamma^-(v)$</p></li></ol><h3 id="1-2-图的代数表示"><a class="header-anchor" href="#1-2-图的代数表示">¶</a>1.2 图的代数表示</h3><ol><li><strong>邻接矩阵</strong><ul><li>对称矩阵</li><li>可以表示自环</li><li>无法表示重边</li></ul></li><li><strong>权矩阵</strong><ul><li>邻接矩阵基础上加入权值信息</li></ul></li><li><strong>关联矩阵</strong><ul><li>n x m的矩阵</li><li>$b_{ij}=\begin{cases}1,&amp;e_j=(v_i,v_k)\in E\-1,&amp;e_j=(v_k,v_i)\in E\0,&amp;其他\end{cases}$</li><li>无法表示自环</li><li>可以表示重边</li></ul></li><li><strong>边列表</strong><ul><li>边列表是对关联矩阵的列进行压缩的结果</li><li>两个m维向量$\vec A$和$\vec B$，前者存放起点，后者存放终点</li><li>可选的$\vec Z$，存放权值</li><li>可以表示自环</li><li>可以表示重边</li></ul></li><li><strong>正向表</strong><ul><li>对邻接矩阵的行进行压缩的结果，把每个顶点的直接后趋集中在一起存放<ul><li>n+1维向量$\vec A$，m维向量$\vec B$</li><li>$d^+(v_i)=A(i+1)-A(i)$</li><li>$B(A(i))$到$B(A(i+1)-1)中的任一个值，都是v_i的直接后继$</li></ul></li><li>可选的$\vec Z$，存放权值</li><li>可以表示自环</li><li>可以表示重边</li></ul></li><li><strong>逆向表</strong><ul><li>与正向表类似，把每个顶点的直接前趋放在一张表里存放</li></ul></li><li><strong>邻接表</strong><ul><li>每一个表顶点|a|b|c|，a存放点编号，b存放边的数值，c存放下一表顶点的地址指针</li><li>可以存放权值</li><li>可以表示自环</li><li>可以表示重边</li></ul></li></ol><h2 id="第二章-道路和回路"><a class="header-anchor" href="#第二章-道路和回路">¶</a>第二章 道路和回路</h2><h3 id="2-1-图的连通性"><a class="header-anchor" href="#2-1-图的连通性">¶</a>2.1 图的连通性</h3><ol><li><p>有向图中：</p><p>有向道路、有向回路：字面意思</p><p>无重边：<strong>简单有向道路/简单有向回路</strong></p><p>无重边、无重顶点：<strong>初级有向道路/初级有向回路</strong>，简称<strong>路</strong>和<strong>回路</strong></p></li><li><p>无向图中：</p><p>道路/链、回路/圈：字面意思</p><p>无重边：<strong>简单道路/简单回路</strong></p><p>无重边、无重顶点：<strong>初级道路/初级回路</strong></p></li></ol><p>**弦：**圈中不相邻顶点的边</p><p>**连通图：**G的任意两点之间都存在道路H不是G任何连通子图的真子图</p><p>**树：**不含回路的连通图</p><p>**割边/割点：**移去后使得原有图不再连通的边/顶点</p><p>**块：**G中极大的没有割点的连通子图</p><p>割点相关等价命题：</p><ol><li>v是G的一个割点</li><li>存在与v不同的点u,w，使得任何一条u到w的道路P~uw~经过v</li><li>V-v可以划分为两个顶点集U，W，任意$u\in U,w\in W$，u在每一条道路P~uw~上</li></ol><p>割边相关等价命题：</p><ol><li>e是G的一条割边</li><li>e不属于G的任何回路</li><li>存在G得顶点u，w，e属于u和w的任何一条道路P~uw~</li><li>G-e可以划分为两个顶点集U和W，使得对任何顶点$u\in U,w\in W$，在G中的道路P~uw~都经过e</li></ol><p>图G移去若干顶点后分为两个连通子图或者剩下一个孤立的点，这些点的集合称为点断集/断集A</p><p>$\mathcal K(G)=\min\limits_{A\in\emptyset}{|A|}$为断量</p><p>同理边断集B，边断量$\lambda(G)$</p><p>若$\mathcal K(G)\geq k$称G为k连通图，同理k边连通图</p><p>$\mathcal K(G)\leq \lambda(G)\leq \delta(G),\delta(G)是顶点的最小度$</p><h3 id="2-3-欧拉道路与回路"><a class="header-anchor" href="#2-3-欧拉道路与回路">¶</a>2.3 欧拉道路与回路</h3><p>**欧拉回路/道路：**经过所有边的简单回路/道路</p><p>**欧拉图：**存在欧拉回路</p><p>**半欧拉图：**存在欧拉道路而不存在欧拉回路</p><p>$存在欧拉回路\Leftrightarrow 各顶点的度为偶数/出度入读相等$</p><p>$存在欧拉道路\Leftrightarrow 只有两个度为奇数的点$</p><h3 id="2-4-哈密顿道路与回路"><a class="header-anchor" href="#2-4-哈密顿道路与回路">¶</a>2.4 哈密顿道路与回路</h3><p>**哈密顿回路/道路：**无向图的一条过全部顶点的初级回路</p><p>**哈密顿图：**含有H回路的无向连通图</p><p>**半哈密顿图：**含有H道路而不含H回路的无向连通图</p><p>一些充分定理：</p><ol><li><p>$\forall v_i,v_j，恒有d(v_i)+d(v_j)\geq n-1，则G中存在哈密顿道路$</p></li><li><p>$\forall v_i,v_j，恒有d(v_i)+d(v_j)\geq n，则G中存在哈密顿回路$</p></li><li><p>$若简单图每个顶点的度均大于等于\cfrac n2，则G有H回路$</p></li><li><p>$设G是简单图，v_i,v_j是不相邻顶点，且满足d(v_i)+d(v_j)\geq n，则G存在H回路的充要条件是G+(v_i,v_j)有H回路$</p></li><li><p>$先定义闭合图:若d(v_i)+d(v_j)\geq n，令G'=G+(v_i,v_j)，重复，直到不存在这样的顶点对为止，得到的即为闭合图，记作C(G)$</p><p>$简单图G存在哈密顿回路的充要条件是其闭合图存在哈密顿回路$</p></li><li><p>$若C(G)是完全图，则G有H回路$</p></li></ol><h3 id="2-6-最短路径：Dijkstra算法"><a class="header-anchor" href="#2-6-最短路径：Dijkstra算法">¶</a>2.6 最短路径：Dijkstra算法</h3><h3 id="2-7-关键路径：AOE"><a class="header-anchor" href="#2-7-关键路径：AOE">¶</a>2.7 关键路径：AOE</h3><h3 id="2-8-中国邮路"><a class="header-anchor" href="#2-8-中国邮路">¶</a>2.8 中国邮路</h3><p>先找到奇点，选择最小的几条路径，加上使这些奇点变偶，然后欧拉回路</p><h2 id="第三章-树"><a class="header-anchor" href="#第三章-树">¶</a>第三章 树</h2><h3 id="3-1-树的相关定义"><a class="header-anchor" href="#3-1-树的相关定义">¶</a>3.1 树的相关定义</h3><p>不含任何回路的连通图称为树（T），T中的边称为树枝，度为1的顶点称为树叶</p><p>若T是G的支撑子图，且又是一棵树，则T使G的支撑树/生成树，又称G的树</p><h3 id="3-5-Huffman树"><a class="header-anchor" href="#3-5-Huffman树">¶</a>3.5 Huffman树</h3><p>小在左，大在右，0在左，1在右</p><h3 id="3-6-最短树"><a class="header-anchor" href="#3-6-最短树">¶</a>3.6 最短树</h3><ol><li>Kruskal算法：不断加入最短边，如成环则换次短边</li><li>Prim算法：选到已选区域最近的点</li></ol><h2 id="第四章-平面图与图图的着色"><a class="header-anchor" href="#第四章-平面图与图图的着色">¶</a>第四章 平面图与图图的着色</h2><h3 id="4-1-平面图"><a class="header-anchor" href="#4-1-平面图">¶</a>4.1 平面图</h3><p>平面图：能放在一个平面上，任何两条边都不相交，称G<strong>可嵌入平面</strong>，G是<strong>可平面图</strong>，其中一个嵌入称为<strong>平面图</strong></p><p>G同构于平面图P，称P是G的一个<strong>平面嵌入</strong></p><p>面/域：不含任何顶点和边的区域，其中诸边称为边界</p><p>欧拉公式：对于平面连通图，$d=m-n+2$</p><p>若G有k个连通支，则$n-m+d = k+1$</p><p>对于一般平面图G，恒有$n-m+d\geq 2$</p><p>若平面连通图G没有割边，且每个域的边界数至少t，则$m\leq\cfrac{t(n-2)}{t-2}$</p><h3 id="4-2-极大平面图"><a class="header-anchor" href="#4-2-极大平面图">¶</a>4.2 极大平面图</h3><p>极大平面图：</p><ol><li>连通</li><li>不存在割边</li><li>每个域边界数为3</li><li>3d=2m, m=3n-6, d=2n-4</li></ol><p>简单平面图满足$m\leq 3n-6,d\leq 2n-4$</p><p>简单平面图G中存在度小于6的顶点</p><h3 id="4-3-非平面图"><a class="header-anchor" href="#4-3-非平面图">¶</a>4.3 非平面图</h3><ol><li>K~5~是非平面图，也称K^(1)^</li><li>K~3,3~是非平面图，也称K^(2)^</li><li>K^(1)^和K^(2)^图上任意加一些度为2的顶点之后得到的图称为K^(1)^型图和K^(2)^型图，统称为K型图</li><li>G是可平面图的充要条件是G不存在K型子图</li></ol><h3 id="4-4-对偶图"><a class="header-anchor" href="#4-4-对偶图">¶</a>4.4 对偶图</h3><ol><li>域-&gt;顶点，共边-&gt;相邻，求对呕吐的过程称为D过程（draw）</li><li>性质<ol><li>若G是平面图，则G一定有唯一对偶图G^*^</li><li>G^*^是连通图</li><li>若G是平面连通图，则（G^<em>^)^</em>^=G</li><li>m=m^<em>^, n=d^</em>^, d=n^*^</li><li>若C是平面图G得一个初级回路，S^<em>^是G^</em>^中与C的各边e~i~对应的e~i~^<em>^的集合，那么S^</em>^是G^*^的一个割集</li><li>G有对偶图等价于G为平面图</li></ol></li><li>每一个平面图都是5-可着色的</li><li>如果平面图G有哈密顿回路，则四色猜想成立</li><li>若任何一个3-正则平面图的域4-可着色，则任何平面图的域4-可着色</li></ol><h3 id="4-5-色数与色数多项式"><a class="header-anchor" href="#4-5-色数与色数多项式">¶</a>4.5 色数与色数多项式</h3><p>不断分割即可</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;图论整理&lt;/h1&gt;
&lt;h2 id=&quot;第一章-基本概念&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#第一章-基本概念&quot;&gt;¶&lt;/a&gt;第一章 基本概念&lt;/h2&gt;
&lt;h3 id=&quot;1-1-图的概念&quot;&gt;&lt;a class=&quot;header-anchor&quot; href</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    <category term="理论/Theory" scheme="https://ryanstarfox.github.io/tags/%E7%90%86%E8%AE%BA-Theory/"/>
    
  </entry>
  
  <entry>
    <title>计算机组成整理</title>
    <link href="https://ryanstarfox.github.io/2024/11/09/2024/20241109%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90/"/>
    <id>https://ryanstarfox.github.io/2024/11/09/2024/20241109%20%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90/</id>
    <published>2024-11-09T05:35:00.000Z</published>
    <updated>2024-11-09T05:35:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>Computer Organization</h1><h2 id="Lecture-01-Introduction-to-Computer-Organization"><a class="header-anchor" href="#Lecture-01-Introduction-to-Computer-Organization">¶</a>Lecture 01: Introduction to Computer Organization</h2><ol><li><p>Von Neumann Architecture</p><ul><li>I/O device</li><li>Central Processing Unit (Control Unit &amp; Arithmetic/Logic Unit)</li><li>Memory Unit</li></ul><p>In Von Neumann (Princeton) architecture, data memory and program memory are stored together, while in Harward architecture, they are stored separately</p><p>three key concepts of VN architecture</p><ul><li>instructions and data stored in a single read-write memory</li><li>Contents of memory are addressable by location, without regard to the type of data</li><li>execution occurs in a sequential fashion</li></ul></li><li><p>CPU</p><ul><li><p>Core: including ALU, CU, register</p></li><li><p>Clock: 1-5GHz</p></li><li><p>Instruction Set Architecture/ISA 指令集(eg. x86, ARM, PowerPC, MIPS, RISCV)</p></li><li><p>ALU:</p><ul><li>Arithmetic functions：$+, -, \times, \div$</li><li>Logic：$\or, \and, \neg$</li><li>Two inputs, one control signal, results calculation can be temporarily stored in one of the registers</li></ul><p><img src="./.Photo.asset/image-20240929210712246.png" alt="image-20240929210712246"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>CU</p><ul><li>works under instructions</li><li>CU contains<ul><li>an instructor decoder (which decodes instructions and generates control signals)</li><li>a program counter (which points to the address of the next instruction to be executed)</li></ul></li></ul><p><img src="./.Photo.asset/image-20240929211937065.png" alt="image-20240929211937065"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>instruction set</p><ul><li>CISC (Complex Instruction Set Computers)<ul><li>Variable instruction length (1 words- n words)</li><li>variable execution time of different format instructions</li><li>more instrucction formats</li><li>upwardly compatible (new instruction set contains earlier generation's instructions)</li><li>Eg. X86</li></ul></li><li>RISC (Reduced Instruction Set Computers)<ul><li>Fixed size (1 word)</li><li>Fixed time for all instructions</li><li>Easy to pipeline the RISC instructions (fast)</li><li>Fewer formats</li><li>eg. PowerPC, MIPS, ARM, PIC's MCU</li></ul></li></ul></li></ul></li><li><p>Memory</p><ul><li>单位换算：<ul><li>Bit(b): 0 or 1</li><li>Byte(B): 8 bits</li><li>Nibble: 0.5 B</li><li>Word: depends on the computer, the number of bits a CPU can process at one time<ul><li>depends on the width of the CPU's registers' and data bus's band width</li></ul></li><li>Double Word</li><li>K, M, G, T, P,</li></ul></li></ul></li><li><p>Bus</p><ul><li><p>System bus: connects major computer components</p></li><li><p>Arbitration:</p><ul><li>Distribution: each module has access to logic controlling and collaboration<ul><li>protocols: CSMA/CD</li></ul></li><li>Centralized: bus controller responsible for allocating time on a bus<ul><li>Master activates a bus</li><li>Slave passively waits for a command</li></ul></li></ul></li><li><p>Type:</p><ul><li>dedicated（专用总线）</li><li>Multiplexed（复用总线）</li></ul></li><li><p>Timing</p><ul><li>Synchronous: global clock</li><li>Asynchronous: devices have their own clocks</li></ul></li><li><p>Structure：</p><ul><li><p>Single-bus structure</p><ul><li><p>pro: simple</p></li><li><p>Con: poor performance</p><p><img src="./.Photo.asset/image-20240930131524453.png" alt="image-20240930131524453"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ul></li><li><p>CPU-Central Dual-Bus Structure</p><ul><li>Pro: efficient in terms of data transfer</li><li>Con: info between memory and I/O devices has to go through CPU-&gt;Poor CPU</li></ul><p><img src="./.Photo.asset/image-20240930131852788.png" alt="image-20240930131852788"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>Memory-Central Dual-Bus structure</p><ul><li>Both high CPU performance and data transfer throught</li></ul><p><img src="./.Photo.asset/image-20240930132359826.png" alt="image-20240930132359826"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>Type:</p><ul><li><p>Data Bus</p><ul><li>moving data</li><li>bidirectional: both read and write</li><li>width: as wide as CPU's register, determines how much data the processor can read in  cycle, which in turn determines a word of this computer</li></ul></li><li><p>Address Bus</p><ul><li>Designate the source or destination of the data</li><li>unidirectional: CPU-&gt;memory/I/O device</li><li>Width of the address bus: n, determines the max size of memory</li></ul></li><li><p>Control Bus</p><ul><li>control modules and use of data bus and address buses</li><li>2 sets of unidirectional control signals<ul><li>Command signal: CPU0-&gt;memory (I/O device)</li><li>State signal: Memory (I/O device)-&gt;CPU</li></ul></li></ul></li><li><p>I/O</p><ul><li><p>Memory-mapped I/O</p><ul><li>memory and I/O share 1 single address space</li><li>Status and data registers of I/O modules are treated as memory locations</li><li>same machine instructions to access both</li></ul><p><img src="./.Photo.asset/image-20240930142323633.png" alt="image-20240930142323633"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>Isolated I/O</p><ul><li>Two separate address space for memory and I/O modules</li><li>Using different seets of accessing indtructions</li></ul><p><img src="./.Photo.asset/image-20240930142340730.png" alt="image-20240930142340730"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ul></li></ul></li></ul></li></ul></li></ol><h2 id="Lecture-02-Digital-logic"><a class="header-anchor" href="#Lecture-02-Digital-logic">¶</a>Lecture 02: Digital logic</h2><ol><li><p>Transistor:</p><ul><li>N-type MOS transistor：<ul><li>positive voltage: switch closed, gate = 1</li><li>zero voltage: switch open, gate = 0</li></ul></li><li>P-type MOS transistor:<ul><li>positive voltage: switch open, gate = 0</li><li>zero voltage: switch closed, gate = 1</li></ul></li></ul></li><li><p>Digital symbols: classified by voltage range</p><p><img src="./.Photo.asset/image-20240930143310181.png" alt="image-20240930143310181"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>CMOS circuit: use both n-type and p-type MOS transistors</p><p>Not:</p><p><img src="./.Photo.asset/image-20240930143533014.png" alt="image-20240930143533014"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>Nor:</p><p><img src="./.Photo.asset/image-20240930143555206.png" alt="image-20240930143555206"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>or就是nor加了一个inverter</p><p>nand：</p><p><img src="./.Photo.asset/image-20240930143650890.png" alt="image-20240930143650890"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>Combintional circuit: give same output for a series of inputs</p><p>Sequential circuit: store info/ state machine</p></li><li><p>R-S latch</p><p><img src="./.Photo.asset/image-20240930145125704.png" alt="image-20240930145125704"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><table><thead><tr><th style="text-align:center">R-S latch</th><th style="text-align:center">R=0</th><th style="text-align:center">R=1</th></tr></thead><tbody><tr><td style="text-align:center">S=0</td><td style="text-align:center">Illegal</td><td style="text-align:center">set to 1</td></tr><tr><td style="text-align:center">S=1</td><td style="text-align:center">set to 0</td><td style="text-align:center">Hold</td></tr></tbody></table></li><li><p>gated D-latch</p><img src="./.Photo.asset/image-20240930145226236.png" alt="image-20240930145226236" style="zoom:50%;"   data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'/><p>WE = 1, Latch set to value of D</p><p>WE = 0, hold</p></li><li><p>Register: a collection of D-latches with common we</p><p><img src="./.Photo.asset/image-20240930145414665.png" alt="image-20240930145414665"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>to represent multi-bit values use brackets</p><p>eg. A=0101001101010101</p><p>A[14:9] = 101001, A[2:0] = 101</p></li><li><p>memory structure:</p><p><img src="./.Photo.asset/image-20240930145750775.png" alt="image-20240930145750775"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20240930145817623.png" alt=""  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ol><h2 id="Lecture-03-IO-and-memoryMemory-taxonomy-characterisitc"><a class="header-anchor" href="#Lecture-03-IO-and-memoryMemory-taxonomy-characterisitc">¶</a>Lecture 03: IO and memoryMemory taxonomy &amp; characterisitc</h2><h3 id="memory-taxomony-characteristic"><a class="header-anchor" href="#memory-taxomony-characteristic">¶</a>memory taxomony &amp; characteristic</h3><ol><li><p>Memory taxonomy &amp; characterisitc</p><ul><li>Physical types of memory: Semiconductor (RAM &amp; ROM)</li><li>Magnetic (Disk &amp; Tape)</li><li>Optical (CD &amp; DVD)</li></ul></li><li><p>Location:</p><ul><li>CPU: register</li><li>Internal: cache, main memory</li><li>External: Disk, tape, DVD</li></ul><p>the internal unit of transfer is usually a word (restricted by data bus width)</p><p>the external unit of transfer is a block (to keep the CPU busy)</p></li><li><p>Access methods:</p><ul><li>sequential:<ul><li>tape</li><li>read through order</li><li>access time depending on location and previous location</li></ul></li><li>Direct:<ul><li>disk</li><li>Individual block has unique address</li><li>access is by jumping to vicnity and sequential search</li><li>access time depending on location and previous location</li></ul></li><li>Random:<ul><li>RAM, ROM</li><li>Individual address identify locations exactly</li><li>Access time is independent of location or previous access</li></ul></li><li>Associative<ul><li>cache</li><li>Data located based on a portion of its contents</li><li>Access time is independent of location or previous access</li></ul></li></ul></li><li><p>Performance:</p><ul><li>Access time: time between presenting address and get valid data</li><li>Memory cycle time: access time + recovery time</li><li>Transfer rate (GT/s): data moved rate</li><li>Transfer bandwidth (GB/s): Transfer rate * Transfer Unit size</li></ul></li><li><p>Semiconductor Memory</p><ol><li>volatile vs non-volatile<ul><li>RAM is volatile, loses data when power off</li><li>ROM is non-volatile, stores data when power off</li></ul></li><li>Static vs Dynamic<ul><li>SRAM is static, holds power as long as power applied</li><li>DRAM is dynamic, loses data unless periodically refreshed</li></ul></li></ol></li><li><p>SRAM</p><ol><li><p>Flip-flop (bits stores as on/off gates)</p><p><img src="./.Photo.asset/image-20241008092435128.png" alt="image-20241008092435128"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>comlex, large, expensive, fast</p></li><li><p>no refresh needed when power on, no charges to leak</p></li><li><p>Register, cache</p></li></ol></li><li><p>DRAM</p><ol><li>bits stored as charge in capacitors</li><li>charges leak, refresh needed</li><li>Simple, small, cheap, slow</li><li>main memory</li></ol></li></ol><h3 id="Memory-hierarchy"><a class="header-anchor" href="#Memory-hierarchy">¶</a>Memory hierarchy</h3><p>Register -&gt; L1 Cache -&gt; L2 cache -&gt; Main memory -&gt; Disk cache -&gt; Disk -&gt; Optical -&gt; Tape</p><h3 id="RAM-organization"><a class="header-anchor" href="#RAM-organization">¶</a>RAM organization</h3><ol><li><p>memory interface with CPU</p><ul><li><p>address bus carries memory addresses</p></li><li><p>data bus carries actual data</p></li><li><p>Control bus carries signal</p><p>内存传指令给CU，CU传指令去存储器找数据，找到数据给ALU，ALU把结果存进内存</p></li></ul></li><li><p>Memory chip</p><ul><li><p>N x n memory chip</p><ul><li>n = chip word width (not CPU word)</li><li>N number of n-bit words</li></ul></li><li><p>Chip I/O</p><ul><li>Data input: $D_{n-1}-D_0$</li><li>Address: $A_{m-1}-A_0$</li><li>Control:<ul><li>WE = write enable (assert low)<ul><li>WE = 1: read;</li><li>WE = 0: write;</li></ul></li><li>EN block enable (assert low)</li></ul></li></ul><p><img src="./.Photo.asset/image-20241008100354419.png" alt="image-20241008100354419"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><ul><li>in physical view</li></ul><p><img src="./.Photo.asset/image-20241008100806188.png" alt="image-20241008100806188"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>CPU: $N_{CPU}\times n_{CPU}$</p><p>Memory: $N_{mem}\times n_{mem}$</p><p>Word extension: $N_{CPU}&gt;N_{mem}$</p><p>Bit extension: $n_{CPU}&gt;n_{mem}$</p></li></ul></li></ol><h3 id="ROM"><a class="header-anchor" href="#ROM">¶</a>ROM</h3><p>Permanent storage, nonvolatile</p><p>application:</p><p>library subroutines, bios, function tables</p><p>Types:</p><ul><li>Written during manufacture</li><li>programmable (once)<ul><li>PROM</li><li>need special equipment to program</li></ul></li><li>Read mostly<ul><li>Erasable programmable (EPROM)</li><li>ELectrically erasable (EEPROM)</li><li>Flash memory</li></ul></li></ul><h3 id="Input-Output-problems"><a class="header-anchor" href="#Input-Output-problems">¶</a>Input/Output problems</h3><ol><li><p>I/O Steps</p><ul><li>CPU checks I/O module for device status</li><li>I/O device retuerns status</li><li>if ready, CPU request data transfer by a command to I/O module</li><li>I/O gets a unit of data from device</li><li>I/O transfrer data to CPU</li><li>output</li></ul></li><li><p>Programmed I/O</p><ul><li><p>CPU executes a program directly giving control of I/O</p><ul><li>Sense device status</li><li>r/w commands to I/O</li><li>transfer data</li></ul></li><li><p>CPU wait for I/O to complete operation</p></li><li><p>Typical details:</p><ol><li>CPU requests I/O operation</li><li>I/O perform operation</li><li>I/O sets status bits</li><li>CPU checks status bits periodically</li><li>I/O not inform CPU</li><li>I/O not interrupt CPU</li><li>CPU wait/ come back later</li></ol></li><li><p>I/O commands includes:</p><ul><li><p>CPU issues address</p><ul><li><p>identifies module, like memory access</p></li><li><p>two types:</p><ol><li><p>Memory mapped I/O:</p><ol><li>device and memory share address place</li><li>I/O are treated like memory</li><li>no special comand</li></ol></li><li><p>Isolated I/O</p><ol><li>Separated address spaces</li><li>Need I/O or memory select line</li><li>Special commands for I/O</li></ol></li></ol></li></ul></li><li><p>CPU issues command</p><ul><li>Control: tell module what to do</li><li>Test: check status</li><li>R/W</li></ul></li></ul></li></ul></li></ol><p>to conclude: simple, but waste CPU time is CPU is fast.</p><h3 id="Interrupted-Driven-I-O"><a class="header-anchor" href="#Interrupted-Driven-I-O">¶</a>Interrupted Driven I/O</h3><ol><li><p>Typical details:</p><ul><li><p>CPU requests I/O operaiton</p></li><li><p>I/O module performs operation while CPU does other work</p></li><li><p>I/O module informs CPU when someting comes up by interrupting CPU</p></li><li><p>CPU deals with this event</p></li><li><p>Protocol perspective:</p><p><img src="./.Photo.asset/image-20241009113715452.png" alt="image-20241009113715452"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p>CPU perspective:</p><ul><li>issue read command</li><li>do other work</li><li>check for interrupt at the end of each cycle</li><li>If interrupted:<ul><li>save context (register)</li><li>process interrupt<ul><li>fetch data &amp; store</li></ul></li><li>recover from saved context</li></ul></li></ul></li><li><p>some probs</p><ul><li><p>Identify interrupting module</p><ol><li><p>Connect a dedicated line for each module (limits the number of devices)</p></li><li><p>software poll</p><ul><li>common Interrupt Request</li><li>get an interrupt -&gt; CPU ask each module in turn</li><li>Clear interrupt request status</li></ul></li><li><p>daisy chain or hardware poll</p><ul><li>share common interrupt request line</li><li>Interrupt acknowledge signal is sent down a chain</li></ul></li><li><p>bus master</p></li></ol><p>module have to claim the bus before raising interrupt</p><p>Eg. PCI &amp; SCSI</p><ol start="5"><li><p>Interrupt controller</p><p>8259</p></li></ol></li><li><p>locating handler programs</p><ul><li>Using a general handler program<ul><li>CPU enters it each time interrupted</li><li>look for module responsible and get address</li></ul></li><li>Using interrupt vectors<ul><li>handler program can be stored anywhere in the memory</li><li>pointer used to link handlker program</li><li>address of pointer fixed and known to the CPU</li><li>such pointers are interrupt vectors</li></ul></li></ul></li><li><p>Dealing with multiple interrupts</p><ul><li>set different priority for interrupts</li><li>Nesting of interrupts (high-priority interrupts can interrupt low-priority interrupts)</li></ul></li></ul></li></ul></li></ol><h3 id="Direct-memory-access"><a class="header-anchor" href="#Direct-memory-access">¶</a>Direct memory access</h3><p>not need CPU involved</p><p>Additional module (hardware) on bus</p><p>DMA controller takes over from CPU for I/O</p><ul><li><p>operation</p><ol><li>CPU tell DMA controller: r/w, device address, data address, data amount</li><li>CPU continues other work</li><li>DMA controller deals with transfer</li><li>DMA controller sends interrupt when finished</li></ol><p>since DMA will take control of bus for a cycle, it will slow down the CPU not as much as CPU dong transfer</p><p>some configurations:</p><p><img src="./.Photo.asset/image-20241010120533029.png" alt="image-20241010120533029"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241010120619723.png" alt="image-20241010120619723"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241010120554645.png" alt="image-20241010120554645"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ul><h2 id="Lecture04-80X86-Microprocessor"><a class="header-anchor" href="#Lecture04-80X86-Microprocessor">¶</a>Lecture04: 80X86 Microprocessor</h2><h3 id="internal-organization-of-8086"><a class="header-anchor" href="#internal-organization-of-8086">¶</a>internal organization of 8086</h3><p>16-bit microprocessor, 20-bit address data bus (1MB memory),</p><ul><li><p>Two sections :</p><ul><li><p>Bus interface unit (BIU): access memory and peripherals</p></li><li><p>Execution unit (EU):</p><p>execute instructions previously fetched</p></li></ul></li><li><p>internal structure:</p><p><img src="./.Photo.asset/image-20241010210153160.png" alt="image-20241010210153160"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ul><h4 id="Bus-Interface-Unit"><a class="header-anchor" href="#Bus-Interface-Unit">¶</a>Bus Interface Unit</h4><ul><li><p>take in charge of data transfer between CPU and memory and I/O devices</p><p>including:</p><ul><li>instruciton fetch</li><li>instruction queueing</li><li>operand fetch and storage</li><li>Address relocation</li><li>bus control</li></ul></li><li><p>consists of:</p><ul><li>4 16-bit segment registers (段寄存器): CS, DS, ES, SS</li><li>1 16-bit instruction pointer: IP</li><li>1 20-bit address adder: eg. CS*16+IP</li><li>1 6-byte instruction queue</li></ul></li><li><p>when EU executing, BIU will fetch the nect one or several instructions from the memory and put in the queue</p></li></ul><h4 id="Execution-Unit"><a class="header-anchor" href="#Execution-Unit">¶</a>Execution Unit</h4><ul><li>take in charge of instruction execution</li><li>Consists of:<ul><li>4 16-bit general registers:<ul><li>Accumulator (AX)</li><li>Base (BX)</li><li>Count (CX)</li><li>Data (DX)</li></ul></li><li>2 16-bit pointer registers:<ul><li>Stack pointer (SP)</li><li>Base pointer (BP)</li></ul></li><li>2 16-bit index registers:<ul><li>Source Index (SI)</li><li>Destination Index (DI)</li></ul></li><li>1 16-bit flag register (9 of 16 bits are used)</li><li>ALU</li></ul></li></ul><h4 id="Registers"><a class="header-anchor" href="#Registers">¶</a>Registers</h4><p>On-chip storage: super fast but expensive</p><p>Temp storage</p><table><thead><tr><th>category</th><th>bits</th><th>register name</th></tr></thead><tbody><tr><td>general</td><td>16</td><td>AX, BX, CX, DX</td></tr><tr><td></td><td>8</td><td>AH, AL, BH, BL, CH, CL, DH, DL</td></tr><tr><td>pointer</td><td>16</td><td>SP (stack pointer), BP (base pointer)</td></tr><tr><td>Index</td><td>16</td><td>SI (source index), DI (destination index)</td></tr><tr><td>Segment</td><td>16</td><td>CS (code segment), DS (data segment), SS (stack segment), ES (extra segment)</td></tr><tr><td>Instruction</td><td>16</td><td>IP (instruciton pointer)</td></tr><tr><td>Flag</td><td>16</td><td>FR (flag register)</td></tr></tbody></table><p>Note: general registers can be accessed as 1️⃣full 16 bits (AX) 2️⃣high byte only (AH) or low byte only (AL)</p><h4 id="Pipeling-in-8086"><a class="header-anchor" href="#Pipeling-in-8086">¶</a>Pipeling in 8086</h4><ul><li>BIU fetches and stores instructions once queue has &gt; 2 empty bytes</li><li>EU consumes instructions pre-fetched and stored in the queue</li><li>to increase effiency of CPU</li><li>works during sequential instruction execution</li></ul><p><img src="./.Photo.asset/image-20241013131307719.png" alt="image-20241013131307719"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Flag-register"><a class="header-anchor" href="#Flag-register">¶</a>Flag register</h4><table><thead><tr><th style="text-align:center">15</th><th style="text-align:center">14</th><th style="text-align:center">13</th><th style="text-align:center">12</th><th style="text-align:center">11</th><th>10</th><th>9</th><th>8</th><th>7</th><th>6</th><th>5</th><th>4</th><th>3</th><th>2</th><th>1</th><th>0</th></tr></thead><tbody><tr><td style="text-align:center">R</td><td style="text-align:center">R</td><td style="text-align:center">R</td><td style="text-align:center">R</td><td style="text-align:center">OF</td><td>DF</td><td>IF</td><td>TF</td><td>SF</td><td>ZF</td><td>U</td><td>AF</td><td>U</td><td>PF</td><td>U</td><td>CF</td></tr></tbody></table><p>R = reserved, U = undefined</p><h5 id="Conditional-flags"><a class="header-anchor" href="#Conditional-flags">¶</a>Conditional flags:</h5><ol><li>CF (carry flag): set whenever carry out (D7 or D15); detect errors in unsigned arithmetic operations</li><li>PF (parity flag): if the low byte has even 1s, then set</li><li>AF (auxiliary carry flag): set if there's a carry from d3 to d4, used in BCD related arithmetic</li><li>ZF (zero flag): set when result is 0</li><li>SF (sign flag): copied from the sign bit after op</li><li>OF: set when result of a signed number operation overflows; detect errors in signed arithmetic operations</li></ol><h5 id="Control-flags"><a class="header-anchor" href="#Control-flags">¶</a>Control flags:</h5><ol><li>DF (direction flag): indicate direction of string operations (from low to high or high to low)</li><li>IF (interrupt flag): set/cleared to enable/disable external maskable interrupt requests</li><li>TF (trap flag): set to allow the program to run single-step, useful for debugging</li></ol><h3 id="Chip-interface-of-8086"><a class="header-anchor" href="#Chip-interface-of-8086">¶</a>Chip interface of 8086</h3><p><img src="./.Photo.asset/image-20241013135448042.png" alt="image-20241013135448042"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="control-signals"><a class="header-anchor" href="#control-signals">¶</a>control signals</h3><ul><li><p>$MN/\overline{MX}$</p><ul><li><p>Minimum mode: $MN/\overline{MX}=1$</p><ul><li>single CPU</li><li>control signals from the CPU</li></ul></li><li><p>Maximun mode: $MN/\overline{MX}=0$</p><ul><li>multiple CPUs<ul><li>8288 control chip supports</li></ul></li></ul></li></ul></li><li><p>$\overline{RD}$: Output, CPU is reading from memory or I/O</p></li><li><p>$\overline{WR}$: Outpit, CPU is writing to memory or I/O</p></li><li><p>$M/\overline{IO}$: output, CPU is accessing memory (high level) or IO (low level)</p></li><li><p>$READY$: input, memory/IO is ready for data transfer</p></li><li><p>$\overline{DEN}$: output, used to enable data transceivers</p></li><li><p>$DT/\overline{R}$: output, used to inform the data transceivers the direction of data transfer (send: high; receive: low)</p></li><li><p>$\overline{BHE}$: output, $\overline{BHE}=0$, AD8~15 are used, 1, not used</p></li><li><p>$ALE$: outputm latch enable signal of the address latch</p></li><li><p>$HOLD$: input signal, hold the bus request</p></li><li><p>$HLDA$: output signal, hold request acknowledge</p></li><li><p>$INTR$: input, interrupt request from 8259 interrupt controller, maskable by clearing the IF in the flag register</p></li><li><p>$INTA$: output, interrupt ack</p></li><li><p>$NMI$: input, non-maskable interrupt, CPU is interrupted after finishing the current instruction; cannot be masked by software</p></li><li><p>$RESET$: input signal, reset the CPU</p><ul><li><p>IP, DS, SS, ES and the instruction queue are cleared</p></li><li><p>CS = FFFFH, IP = 0000H</p></li><li><p>the address of the first address of the first instruction that the CPU will execute after reset is FFFF0H (CSx16+IP)</p><p><img src="./.Photo.asset/image-20241013143304364-8801189-8801189.png" alt="image-20241013143304364"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241013143339246.png" alt="image-20241013143339246"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241013143500778.png" alt="image-20241013143500778"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>bus cycle for data transfers: at least 4 clock cycles</p></li></ul></li></ul><h3 id="8086-Programming"><a class="header-anchor" href="#8086-Programming">¶</a>8086 Programming</h3><ul><li>typical program consists of at least 3 segments<ul><li>code segment: contain instructions</li><li>data segment: store info</li><li>stack segment: store info temporarily</li></ul></li></ul><h4 id="logical-and-physical-address"><a class="header-anchor" href="#logical-and-physical-address">¶</a>logical and physical address</h4><ul><li>physical address:<ul><li>the 20-bit actual address put on the address bus</li><li>1 MB (00000H to FFFFFH)</li><li>actual physical location in memory</li></ul></li><li>Logical address:<ul><li>a segment value and an offset address</li></ul></li><li>Convert: PA = LA.segment_value</li><li>*16 + LA.offset address (wrap around if overflows)</li><li>1 physical address can be derived from different logical addresses, but one logical address only represents 1 physical address</li><li>2 segments can overlap, as a result,<ul><li>dynamic behavior of segment and offset concept</li><li>desirable in some circumstances</li></ul></li><li>code segment: 8086 fetches instructions from the code segment<ul><li>logical address of an instruction:  <strong>CS:IP</strong></li><li>Physical address generated to retrieve this instruction from memory</li></ul></li><li>Data segment: information to be processed is stored in the data segment<ul><li>Logical address of a piece of data: <strong>DS:offset</strong><ul><li>offset registers for data segement: <strong>BX, SI</strong> and <strong>DI</strong></li></ul></li></ul></li><li>Data representation in memory<ul><li>Memory: a consecutive block of bytes</li><li>if data is larger than a byte<ul><li>little endian: the low byte of the data goes to the low memory location</li><li>big endian: the high byte of the data goes to the low mwmory location</li></ul></li></ul></li><li>Stack segment:<ul><li>temporarily store information</li><li>address: <strong>SS:SP</strong> (sometimes with <strong>BP</strong>)</li><li>Registers except segment and SP insude the CPU can be stored in the stack and brought back into the CPU from the stack using push and pop</li><li><strong>grow downward</strong> from upper addresses to lower addresses in the memory,<ul><li>to protect other programs from destruction</li><li>ensure code section and stack section would not write over each other</li></ul></li></ul></li><li>Extra segment<ul><li>extra data segment essential for string operations<ul><li>logical address: ES:offset</li><li>offset registers: <strong>BX, SI, DI</strong></li></ul></li></ul></li></ul><table><thead><tr><th>segment register</th><th>CS</th><th>DS</th><th>ES</th><th>SS</th></tr></thead><tbody><tr><td>offset register(s)</td><td>IP</td><td>SI, DI, BX</td><td>SI, DI, BX</td><td>SP, BP</td></tr></tbody></table><ul><li>BIOS Function (Basic input-output system)<ul><li>test all devices, report errors</li><li>Load DOS from disk into RAM</li><li>Hand over control of PS to DOS</li></ul></li></ul><h3 id="Addressing-mode-in-8086"><a class="header-anchor" href="#Addressing-mode-in-8086">¶</a>Addressing mode in 8086</h3><p>take MOV as example</p><h4 id="Register-Addressing-Mode"><a class="header-anchor" href="#Register-Addressing-Mode">¶</a>Register Addressing Mode</h4><ul><li>Data are held within registers</li><li>Eg. MOV BX,DX copy the contents of DX into BX</li><li>data can be moved among all registers except CS(cannot be set) and IP(cannot be accessed by MOV)</li></ul><h4 id="Immediate-Addressing-Mode"><a class="header-anchor" href="#Immediate-Addressing-Mode">¶</a>Immediate Addressing Mode</h4><ul><li>Source operand is a constant</li><li>embedded in instructions</li><li>no need to access memory</li></ul><h4 id="Direct-Aaddressing-Mode"><a class="header-anchor" href="#Direct-Aaddressing-Mode">¶</a>Direct Aaddressing Mode</h4><ul><li>Data is stored in memory and the address is given in instructions<ul><li>Segement address in the data segment <strong>(DS)</strong> by default</li><li>Need to access memory to gain the data</li><li>Eg MOV DL,[2400]; MOV[3518],AL</li></ul></li></ul><h4 id="Register-Indirect-Addressing-Mode"><a class="header-anchor" href="#Register-Indirect-Addressing-Mode">¶</a>Register Indirect Addressing Mode</h4><ul><li>data is stored in memory and address is held by a register<ul><li>Segment address in the data segment <strong>(DS)</strong> by default</li><li>Registers for this purpose are <strong>SI</strong>, <strong>DI</strong> and <strong>BX</strong></li><li>need to access memory to gain the data</li><li>Eg. MOV AL,[BX]</li></ul></li></ul><h4 id="Based-relative-addressing-mode"><a class="header-anchor" href="#Based-relative-addressing-mode">¶</a>Based relative addressing mode</h4><ul><li>data is stored in memory, address can be calculated with base registers <strong>BX</strong> and <strong>BP</strong> as well as a displacement value<ul><li>default segment is <strong>DS</strong> for <strong>BX</strong>, <strong>SS</strong> for <strong>BP</strong></li><li>need to access memory to gain the data</li><li>Eg. MOV CX,[BX]+10</li></ul></li></ul><h4 id="Indexed-Relative-Addressing-Mode"><a class="header-anchor" href="#Indexed-Relative-Addressing-Mode">¶</a>Indexed Relative Addressing Mode</h4><p>Data is stored in memory and the address can be calculated with index registers <strong>DI</strong> and <strong>SI</strong> as<br>well as a displacement value</p><ul><li>The default segment is <strong>DS</strong></li><li>Need to access memory to gain the data<br>E.g. MOV DX,[SI]+5</li></ul><h4 id="Based-Indexed-Relative-Addressing-Mode"><a class="header-anchor" href="#Based-Indexed-Relative-Addressing-Mode">¶</a>Based-Indexed Relative Addressing Mode</h4><p>Combines based and indexed addressing modes, one base register and one index register are<br>used</p><ul><li>The default segment is (DS) for <strong>BX</strong>, <strong>SS</strong> for <strong>BP</strong></li><li>Need to access memory to gain the data</li><li>E.g MOV CL,[BX][DI]+8</li></ul><p>80x86 allows the program to override the default segment registers</p><h2 id="Lecture-05-Assembly-Language-Programming"><a class="header-anchor" href="#Lecture-05-Assembly-Language-Programming">¶</a>Lecture 05: Assembly Language Programming</h2><h3 id="Assembly-Language-Programs"><a class="header-anchor" href="#Assembly-Language-Programs">¶</a>Assembly Language Programs</h3><ul><li>a series of statements</li><li>consist of multiple segments</li></ul><h3 id="form-of-an-statement"><a class="header-anchor" href="#form-of-an-statement">¶</a>form of an statement</h3><p>[label:] mnemonic [operands] [;comment]</p><ul><li>Label: each label unique; letters, digits, ?.@_$; first character not digit, less than 31 characters</li><li>&quot;:&quot; is needed if itis an instruction otherwise ommited</li><li>&quot;;&quot; leads a comment, the assembler omits anything on this line following a semicolon</li></ul><h3 id="shell-of-a-real-program"><a class="header-anchor" href="#shell-of-a-real-program">¶</a>shell of a real program</h3><p>full segment definition (old fashion)</p><p>Simplified segment definition</p><h3 id="Model-definition"><a class="header-anchor" href="#Model-definition">¶</a>Model definition</h3><p>SMALL; MEDIUM; COMPACT; LARGE; HUGE; TINY</p><h3 id="Simplified-Segment-Definition"><a class="header-anchor" href="#Simplified-Segment-Definition">¶</a>Simplified Segment Definition</h3><p>Only 3 segments can be defined: <strong>.Code</strong>; <strong>.DATA</strong>, <strong>.STACK</strong></p><p>Label PROC[FAR|NEAR]</p><p>Label ENDP</p><p>entrance should be FAR, ending should be ENDP</p><h3 id="Full-Segment-Definition"><a class="header-anchor" href="#Full-Segment-Definition">¶</a>Full Segment Definition</h3><p>label SEGMENT</p><p>label ENDS</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">DaSeg1 segment</span><br><span class="line">str1 db &#x27;Hello World! $&#x27;</span><br><span class="line">DaSeg1 ends</span><br></pre></td></tr></table></figure><h3 id="Control-Transfer-Instructions"><a class="header-anchor" href="#Control-Transfer-Instructions">¶</a>Control Transfer Instructions</h3><ul><li>Range<ul><li>short, intrasegment,<ul><li>IP changed: 1 byte -128-127</li></ul></li><li>Near, intrasegment,<ul><li>IP changed: 2 bytes -32768-327667</li></ul></li><li>Far, intersegment<ul><li>CS and IP changed</li><li>control is transferred outside the current code segment</li></ul></li></ul></li><li>Jumps</li><li>CALL statement</li></ul><h3 id="Conditional-Jumps"><a class="header-anchor" href="#Conditional-Jumps">¶</a>Conditional Jumps</h3><p>jump according to the value of the flag register</p><p>short jumps (some commands)</p><h3 id="Unconditional-jumps"><a class="header-anchor" href="#Unconditional-jumps">¶</a>Unconditional jumps</h3><p>JMP [SHORT|NEAR|FAR PTR] label</p><p>near by default</p><h2 id="subroutine-call-statement"><a class="header-anchor" href="#subroutine-call-statement">¶</a>subroutine &amp; call statement</h2><ul><li>range:<ul><li>NEAR: procedure defined within the same code segment with the caller</li><li>FAR: procedure defined outside the current code segment of the caller</li></ul></li><li>PROC &amp; ENDP are used to define a subroutine</li><li>CALL is used to call a subroutine<ul><li>RET is used to call a subroutine</li></ul></li></ul><h3 id="Data-Types-Definition"><a class="header-anchor" href="#Data-Types-Definition">¶</a>Data Types &amp; Definition</h3><ul><li>CPU can process 8-bit and 16-bit ops</li><li>Directives:<ul><li><strong>ORG</strong>: indicaate the beginning of the offset address</li></ul></li><li>Define variables:<ul><li><strong>DB</strong>: allocate byte-size chunks</li><li><strong>DW</strong>, <strong>DD</strong>, <strong>DQ</strong></li></ul></li><li><strong>EQU</strong>: define a constant eg. NUM <strong>EQU</strong> 234</li><li><strong>DUP</strong>: duplicate a given number of characters eg. x DB 6 DUP(23H)|y DW 3 DUP (0FF10H)</li><li>to get the segment value of a variable: <strong>SEG</strong></li><li>to get the offset address of a variable: <strong>OFFSET</strong> directive or <strong>LEA</strong> instruction</li></ul><h3 id="Arithmetic-instructions"><a class="header-anchor" href="#Arithmetic-instructions">¶</a>Arithmetic instructions</h3><ul><li><p><strong>ADD</strong> dest src; dest = dest + src</p><ul><li>Dest is a register</li><li>Src can be register or immediate</li><li>no mem-to-mem operations in 80x86</li><li>Change ZF, SF, AF, CF, OF, PF</li></ul></li><li><p><strong>ADC</strong> dest, src; dest = dest + src + <strong>CF</strong></p><ul><li>For multi-bit numbers</li><li>If there's a carry from last addtion, add 1 to the result</li></ul></li><li><p><strong>INC</strong> dest; dest = dest + 1</p><ul><li>dest can be register or memory</li><li>dest cannot be immediate</li><li>change ZF, SF, AF, OF, PF</li><li><em><strong>does not change CF</strong></em></li></ul></li><li><p><strong>DEC</strong> dest; dest = dest - 1</p><ul><li>dest can be a register or memory</li><li>dest cannot be an immediate</li><li>change ZF, SF, AF, OF, PF</li><li><strong>does not change CF</strong></li></ul></li><li><p><strong>LOOP</strong> xxxx</p><p>等价于</p><p><strong>DEC CX</strong></p><p><strong>JNZ xxxx</strong></p></li><li><p><strong>SUB</strong> dest, src; dest = dest - src</p><ul><li>Dest can be a register or in memory</li><li>Src can be a register, in memory or an immediate</li><li>No mem-to-mem operations in 80X86</li><li>Change ZF, SF, AF, CF, OF, PF</li></ul></li><li><p><strong>SBB</strong> dest, src ;dest = dest - src – CF</p><ul><li>For multi-byte numbers</li><li>If there is a borrow from last subtraction, subtracts 1<br>from the result</li></ul></li><li><p><strong>MUL</strong> operand</p><ul><li><p>byte X byte:</p><ul><li>One implicit operand is AL, the other is the operand,</li><li>result is stored in AX</li></ul></li><li><p>word X word:</p><ul><li>One implicit operand is AX, the other is the operand,</li><li>result is stored in DX &amp; AX</li></ul></li><li><p>word X byte:</p><ul><li>AL hold the byte, AH = 0, the word is the operand,</li><li>result is stored in DX &amp; AX;</li></ul></li></ul></li><li><p><strong>DIV</strong> denominator</p><ul><li>Denominator cannot be zero</li><li>Quotient cannot be too large for the assigned register<ul><li>byte / byte:<ul><li>Numerator in AL,</li><li>clear AH;</li><li>quotient is in AL,</li><li>remainder in AH</li></ul></li><li>word / word:<ul><li>Numerator in AX,</li><li>clear DX ;</li><li>quotient is in AX,</li><li>remainder in DX</li></ul></li><li>word / byte:<ul><li>Numerator in AX;</li><li>quotient is in AL (max 0FFH),</li><li>remainder in AH</li></ul></li><li>double-word / word:<ul><li>Numerator in DX,AX;</li><li>quotient is in AX (max 0FFFFH),</li><li>remainder in DX</li><li>Denominator can be in a register or in memory</li></ul></li></ul></li></ul></li></ul><h3 id="Logic-Instructions"><a class="header-anchor" href="#Logic-Instructions">¶</a>Logic Instructions</h3><ul><li><p><strong>AND</strong> dest, src; <strong>OR</strong> dest, src; <strong>XOR</strong> dest, src</p><ul><li>Bit-wise logic</li><li>dest can be a register or in memory; src can be a register, in memory, or immediate</li><li>Update SF, ZF, PF; AF is undetermined</li><li>Clear CF and OF (set CF and OF to zero)</li></ul></li><li><p><strong>NOT</strong> operand</p><ul><li>Bit-wise logic</li><li>Operand can be a register or in memory</li><li><strong>Does not change the flag register</strong></li></ul></li><li><p><strong>SHR</strong> dest, times</p><ul><li>dest can be a register or in memory</li><li>0-&gt;MSB-&gt;…-&gt;LSB-&gt;CF</li><li>Times = 1:<ul><li>SHR xx, 1</li></ul></li><li>Times &gt;1:<ul><li>MOV CL, times</li><li>SHR xx, CL</li></ul></li></ul></li><li><p><strong>SHL</strong> dest, times</p><ul><li>All the same except in reverse direction</li></ul></li><li><p><strong>ROR</strong> dest, times</p><ul><li>dest can be a register, in memory</li><li>Times = 1:</li><li><strong>ROR xx, 1</strong></li><li>Times &gt;1:</li><li><strong>MOV CL,</strong> <strong>times</strong></li><li><strong>ROR xx, CL</strong></li></ul><p><strong>ROL</strong> similar</p><p>eg. AX = 1011 0011 0101 1100</p><p>ROC AX, 2</p><p>AX = 0010 1100 1101 0111</p></li><li><p><strong>RCR</strong> dest, times</p><ul><li>dest can be a register, in memory</li><li>Times = 1:</li><li><strong>RCR xx, 1</strong></li><li>Times &gt;1:</li><li><strong>MOV CL,</strong> <strong>times</strong></li><li><strong>RCR xx, CL</strong></li></ul><p><strong>RCL</strong> similar</p><p>eg. AX = 1011 0011 0101 1100, CF = 0</p><p>RCR AX, 2 = 0010 1100 1101 0111 CF = 0</p></li><li><p><strong>CMP</strong>  dest, src</p><ul><li>unsigned numbers<table><thead><tr><th>compare operands</th><th style="text-align:center">CF</th><th style="text-align:center">ZF</th></tr></thead><tbody><tr><td>d &gt; s</td><td style="text-align:center">0</td><td style="text-align:center">0</td></tr><tr><td>d = s</td><td style="text-align:center">0</td><td style="text-align:center">1</td></tr><tr><td>d &lt; s</td><td style="text-align:center">1</td><td style="text-align:center">0</td></tr></tbody></table></li><li>signed numbers<table><thead><tr><th style="text-align:center">compared operands</th><th style="text-align:center">situ</th></tr></thead><tbody><tr><td style="text-align:center">d &gt; s</td><td style="text-align:center">OF == SF &amp;&amp; ZF == 0</td></tr><tr><td style="text-align:center">d = s</td><td style="text-align:center">ZF == 1</td></tr><tr><td style="text-align:center">d &lt; s</td><td style="text-align:center">OF != SF</td></tr></tbody></table></li></ul></li></ul><h2 id="Lecture-06-Memory-Address-Decoding"><a class="header-anchor" href="#Lecture-06-Memory-Address-Decoding">¶</a>Lecture 06: Memory Address Decoding</h2><h3 id="Address-decoding"><a class="header-anchor" href="#Address-decoding">¶</a>Address decoding</h3><ul><li>absolute address decoding<ul><li>all address lines are decoded</li></ul></li><li>linear select decoding<ul><li>Only selected lines are decoded</li><li>cheap</li><li>support alias: same memoryunit with multiple addresses</li></ul></li></ul><p>Use a 74LS138 chip (3-&gt;8 decoder)</p><p><img src="./.Photo.asset/image-20241029170656535.png" alt="image-20241029170656535"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="Data-integrity"><a class="header-anchor" href="#Data-integrity">¶</a>Data integrity</h3><ol><li>Checksum byte<ol><li>Add all bytes together and drop all carries</li><li>take 2's complement</li><li>store it with the data</li><li>check integrity by adding data and checksum together (0 means integrate)</li></ol></li><li>parity bit<ol><li>even parity: total number of 1 is even</li><li>odd parity: total number of 1 is odd</li><li>in 8086, use odd parity</li></ol></li></ol><h3 id="Memory-Organization-in-8086"><a class="header-anchor" href="#Memory-Organization-in-8086">¶</a>Memory Organization in 8086</h3><table><thead><tr><th>$\overline{BHE}$</th><th>$A_0$</th><th></th><th></th></tr></thead><tbody><tr><td>0</td><td>0</td><td>Even word</td><td>D~0~-D~15~</td></tr><tr><td>0</td><td>1</td><td>Odd byte</td><td>D~8~-D~15~</td></tr><tr><td>1</td><td>0</td><td>Even byte</td><td>D~0~-D~7~</td></tr><tr><td>1</td><td>1</td><td>None</td><td></td></tr></tbody></table><h3 id="I-O-in-x86-family"><a class="header-anchor" href="#I-O-in-x86-family">¶</a>I/O in x86 family</h3><ul><li>X86 has an I/O space in addition to memory space</li><li>use special I/O instructions accessing I/O devices at ports</li><li>Memory contain machine codes/data, I/O ports only contain data</li><li>also referred to as peripheral I/O or isolated I/O</li></ul><p>I/O instructions</p><ul><li>Direct I/O instructions: port# range from 00h to 0ffh, 256 ports<ul><li>INAL,port#</li><li>OUTAL,port#</li></ul></li><li>Indirect I/O instructions: port# range from 0000h to offffh, 65536 ports<ul><li>MOVDX,port#</li><li>INAL,DX</li><li>MOVDX,port#</li><li>OUTDX,AL</li></ul></li></ul><h2 id="Lecture-07-8255-PPI-Chip"><a class="header-anchor" href="#Lecture-07-8255-PPI-Chip">¶</a>Lecture 07: 8255 PPI Chip</h2><h3 id="Internal-Structure-and-Pins"><a class="header-anchor" href="#Internal-Structure-and-Pins">¶</a>Internal Structure and Pins</h3><ul><li><p>3 data ports: A, B and C</p><ul><li>port A: PA~0~-PA~7~, can be programmed all as input/output</li><li>port B: PB~0~-PB~7~, similar to port A</li><li>port C: PC~0~-PC~7~, can be splitted into 2 separate parts PCL&amp;PCU, can be programmed individually</li></ul></li><li><p>Control register <strong>CR</strong>: used to setup the chip</p></li><li><p>Group A: PA&amp;PCU</p><p>Group B:PB&amp;PCL</p></li><li><p>logic：</p></li></ul><table><thead><tr><th style="text-align:left">~CS</th><th style="text-align:left">A₁</th><th style="text-align:left">A₀</th><th style="text-align:left">~RD</th><th style="text-align:left">~WR</th><th style="text-align:left">Function</th></tr></thead><tbody><tr><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">PA-&gt;Data bus</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">PB-&gt;Data bus</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">PC-&gt;Data bus</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">Data bus-&gt;PA</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">Data bus-&gt;PB</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">Data bus-&gt;PC</td></tr><tr><td style="text-align:left">0</td><td style="text-align:left">1</td><td style="text-align:left">1</td><td style="text-align:left">1</td><td style="text-align:left">0</td><td style="text-align:left">Data bus-&gt;CR</td></tr><tr><td style="text-align:left">1</td><td style="text-align:left">×</td><td style="text-align:left">×</td><td style="text-align:left">1</td><td style="text-align:left">1</td><td style="text-align:left">D₀~D₇ in float</td></tr></tbody></table><ul><li><p>Control Register</p><ul><li><p>8-bit internal register</p></li><li><p>selected when A~1~=A~0~=1</p></li><li><p>the first bit select mode</p><p>if 1: Input/output modes, if 0 BSR mode</p></li><li><p><img src="./.Photo.asset/image-20241030141737882.png" alt="image-20241030141737882"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li><li><p><img src="./.Photo.asset/image-20241030141838221.png" alt=""  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p></li></ul></li></ul><h3 id="Mode-0"><a class="header-anchor" href="#Mode-0">¶</a>Mode 0</h3><ul><li>simple i/o</li><li>no handshake needed</li><li>any port can be programed independently</li><li>CPU directly r/w a port</li><li>input not latched, output latched</li></ul><h3 id="Mode-1"><a class="header-anchor" href="#Mode-1">¶</a>Mode 1</h3><ul><li>PA &amp; PB used as i/o ports</li><li>PC~3~~PC~5~ used as handshake llines for PA</li><li>PC~0~~PC~2~used as handshake lines for PB</li><li>both input and output data are latched</li><li>PC~6~ &amp; PC~7~ used as separate I/O lines for any purpose</li><li>handshake signals:<ul><li>~STB: strobe input signal</li><li>IBF: Input buffer full output signal</li><li>~OBF: output buffer full output signal</li><li>~ACK: acknowledge input signal</li><li>INTR: interrupt request signal</li></ul></li><li>Control register</li></ul><p><img src="./.Photo.asset/image-20241031150704256.png" alt="image-20241031150704256"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241031151026044.png" alt="image-20241031151026044"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="Mode-2-Bidirectional-Bus"><a class="header-anchor" href="#Mode-2-Bidirectional-Bus">¶</a>Mode 2 (Bidirectional Bus)</h3><ul><li>For bidirectional handshake input/output</li><li>Only can be used as both input and output port</li><li>PCU used as handshake lines for PA</li><li>both input and output data are latched</li><li>PC~0~~PC~2~ can be used as separate I/O lines / handshake lines for PB</li></ul><h2 id="Lecture-08-8253-4-Timer"><a class="header-anchor" href="#Lecture-08-8253-4-Timer">¶</a>Lecture 08: 8253/4 Timer</h2><h3 id="Internal-Structure-pins"><a class="header-anchor" href="#Internal-Structure-pins">¶</a>Internal Structure &amp; pins</h3><ul><li>Data bus buffer</li><li>~CS: tied to a decoded address</li><li>~RD,~WR<ul><li>in isolated I/O: ~IOR, ~IOW</li><li>Memory-mapped I/O: ~MEMR, MEMW</li></ul></li><li>A~1~, A~0~</li></ul><table><thead><tr><th style="text-align:center">A1</th><th style="text-align:center">A0</th><th>Selection</th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td>Counter 0</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td>Counter 1</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">0</td><td>Counter 2</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">1</td><td>Control word Register</td></tr></tbody></table><table><thead><tr><th style="text-align:center">/CS</th><th style="text-align:center">/RD</th><th style="text-align:center">/WR</th><th style="text-align:center">A1A0</th><th style="text-align:left">FUNCTION</th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">00</td><td style="text-align:left">Write counter0 (to CR0)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">01</td><td style="text-align:left">Write counter1 (to CR1)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">10</td><td style="text-align:left">Write counter2 (to CR2)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">11</td><td style="text-align:left">Write control port</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">00</td><td style="text-align:left">Read counter0 (from OL0)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">01</td><td style="text-align:left">Read counter1 (from OL1)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">10</td><td style="text-align:left">Read counter2 (from OL2)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">11</td><td style="text-align:left">Read control port (for 8254)</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">X</td><td style="text-align:center">X</td><td style="text-align:center">XX</td><td style="text-align:left">Not available</td></tr></tbody></table><h3 id="control-word-register"><a class="header-anchor" href="#control-word-register">¶</a>control word register</h3><ul><li>selected when A~1~=1, A~0~=1</li><li>Used to specify counter, mode r/w</li></ul><table><thead><tr><th style="text-align:center">D7</th><th style="text-align:center">D6</th><th style="text-align:center">D5</th><th style="text-align:center">D4</th><th style="text-align:center">D3</th><th style="text-align:center">D2</th><th style="text-align:left">D1</th><th style="text-align:left">D0</th></tr></thead><tbody><tr><td style="text-align:center">SC1</td><td style="text-align:center">SC0</td><td style="text-align:center">RW1</td><td style="text-align:center">RW0</td><td style="text-align:center">M2</td><td style="text-align:center">M1</td><td style="text-align:left">M0</td><td style="text-align:left">BCD</td></tr></tbody></table><table><thead><tr><th style="text-align:center">SC₁</th><th style="text-align:center">SC₀</th><th>SC - Select counter</th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td>Select counter 0</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td>Select counter 1</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">0</td><td>Select counter 2</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">1</td><td>Illegal for 8253<code>&lt;br&gt;</code>Read-Back command for 8254 (See Read operations)</td></tr></tbody></table><table><thead><tr><th style="text-align:center">RW₁</th><th style="text-align:center">RW₀</th><th>RW - Read / Write</th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td>Counter latch command (See Read operations)</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">1</td><td>Read / Write least significant byte only</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">0</td><td>Read / Write most significant byte only</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">1</td><td>Read / write least significant byte first, then most significant byte</td></tr></tbody></table><table><thead><tr><th style="text-align:center">M₂</th><th style="text-align:center">M₁</th><th style="text-align:center">M₀</th><th style="text-align:center">Mode</th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">Mode 0</td></tr><tr><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">Mode 1</td></tr><tr><td style="text-align:center">X</td><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">Mode 2</td></tr><tr><td style="text-align:center">X</td><td style="text-align:center">1</td><td style="text-align:center">1</td><td style="text-align:center">Mode 3</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">0</td><td style="text-align:center">Mode 4</td></tr><tr><td style="text-align:center">1</td><td style="text-align:center">0</td><td style="text-align:center">1</td><td style="text-align:center">Mode 5</td></tr></tbody></table><table><thead><tr><th style="text-align:center">BCD:</th><th style="text-align:left"></th></tr></thead><tbody><tr><td style="text-align:center">0</td><td style="text-align:left">Binary counter 16-bits</td></tr><tr><td style="text-align:center">1</td><td style="text-align:left">Binary coded decimal(BCD) Counter(4 Decades)</td></tr></tbody></table><h3 id="Counters"><a class="header-anchor" href="#Counters">¶</a>Counters:</h3><ul><li>Each consists a single, 16-bit, presettable, down counter</li><li>can operate in binary/BCD</li><li>Input, gate and output are configured by selection of modes</li><li>read from counter not disturb processing count</li></ul><h3 id="W-R-Operations"><a class="header-anchor" href="#W-R-Operations">¶</a>W/R Operations</h3><ul><li>write:<ul><li>Write a control word into control register</li><li>Load the low-order byte of a count in the counter register</li><li>Load the high-order byte of a count in the counter register</li></ul></li><li>read<ul><li><strong>Simple Read</strong>: two I/O read operations, first one for low-order<br>byte and last one for the high order byte</li><li><strong>Counter Latch Command</strong>: one I/O write operation used to<br>write a control word to the control register to latch a count in<br>the output latch, then two I/O read operations are used to read<br>the latched count as in Simple Read.</li><li><strong>Read-Back Command</strong>: for 8254 only</li></ul></li></ul><h3 id="Modes"><a class="header-anchor" href="#Modes">¶</a>Modes</h3><p>Software trigger<br>No repeat<br>Mode 0: Interrupt on terminal count<br>Mode 4: Software triggered strobe<br>Repeat<br>Mode 2: Rate generator<br>Mode 3: Square wave rate generator<br>Hardware trigger<br>No repeat (but retriggerable)<br>Mode 1: Hardware retriggerable one-shot<br>Mode 5: Hardware triggered strobe</p><h4 id="Mode-0：Interrupt-on-Terminal-Count"><a class="header-anchor" href="#Mode-0：Interrupt-on-Terminal-Count">¶</a>Mode 0：Interrupt on Terminal Count</h4><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">graph TD</span><br><span class="line">A[CPU writes count into CR]--&gt;B[Count is conveyed to the CE]</span><br><span class="line">B--&gt;C[Counting down]</span><br><span class="line">C--&gt;D[Output signal when reaches 0]</span><br></pre></td></tr></table></figure><ul><li><p>Gate disable:</p><ul><li>Gate = 1 enables counting</li><li>Gate = 0 disables counting</li></ul></li><li><p>New count</p><ul><li>If a new count is written to the counter, it will be loaded on the next CLK pulse and counting will continue from the new count</li><li>In case of two byte count:<ul><li>Writing the first byte disables the current counting</li><li>Writing the second byte loads the new count on the next CLK pulse and<br>counting will continue from the new count</li></ul></li></ul></li></ul><p><img src="./.Photo.asset/image-20241108141834173.png" alt="image-20241108141834173"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Mode-1：Hardware-Retriggerable-One-shot"><a class="header-anchor" href="#Mode-1：Hardware-Retriggerable-One-shot">¶</a>Mode 1：Hardware Retriggerable One-shot</h4><ul><li>Normal Operation:<ul><li>The output will be initially high after the mode set operation;</li><li>The output will go low on the CLK pulse following the rising(0-to-1) edge of the gate input;</li><li>The output will go high on the terminal count and remain high until the next rising edge of the gate input.</li><li>Output: one-shot of N clock pulses on every trigger</li><li>does not automatically repeat</li></ul></li></ul><p><img src="./.Photo.asset/image-20241108141856567.png" alt="image-20241108141856567"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Mode-2-Rate-Generator"><a class="header-anchor" href="#Mode-2-Rate-Generator">¶</a>Mode 2: Rate Generator</h4><ul><li>Normal Operation:<ul><li>The output will be initially high;</li><li>The output will go low for one clock pulse before the terminal count;</li><li>The output then goes high, the counter reloads the initial count and the process is repeated</li><li>Output: periodical signal with a period of N-1 clock<br>pulses high and 1 clock pulse low</li></ul></li></ul><p><img src="./.Photo.asset/image-20241108141912391.png" alt=""  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Mode-3-Square-Wave-Rate-Generator"><a class="header-anchor" href="#Mode-3-Square-Wave-Rate-Generator">¶</a>Mode 3: Square Wave Rate Generator</h4><ul><li>Normal Operation:<ul><li>The output will be initially high;</li><li>For even count, counter is decremented by 2 on the falling edge of each clock pulse; when reaches terminal count, the state of the output is changed and the counter is reloaded with the full count and the whole process is repeated</li><li>For odd count, the first clock pulse decrements the count by 1. Subsequent clockpulses decrement the clock by 2. After timeout, the output goes low and the full count is reloaded. The first clock pulse (following the reload) decrements the count by 3 and subsequent clock pulse decrement the count by two. Then the whole process is repeated</li></ul></li></ul><p><img src="./.Photo.asset/image-20241108150720630.png" alt="image-20241108150720630"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="./.Photo.asset/image-20241108150731058.png" alt="image-20241108150731058"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>if gate goes low while output is low, output is set high immediately.</p><p><img src="./.Photo.asset/image-20241108151338821.png" alt="image-20241108151338821"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><ul><li>New count:<ul><li>The current counting sequence does not affect when the new count is written.</li><li>If a trigger is received after writing a new count but before the end of the current half-cycle of the square wave, the counter will be loaded with the new count on the next CLK pulse and counting will continue from the new count.</li><li>Otherwise, the new count will be loaded at end of the current half-cycle.</li></ul></li></ul><h4 id="Mode-4-Software-Triggered-Strobe"><a class="header-anchor" href="#Mode-4-Software-Triggered-Strobe">¶</a>Mode 4: Software Triggered Strobe</h4><ul><li>Normal Operation:<ul><li>The output will be initially high;</li><li>The output will go low for one CLK pulse after the terminal count</li></ul></li><li>Gate disable:<ul><li>If Gate is one, the counting is enabled; otherwise, it is disabled</li></ul></li><li>New count:<ul><li>If a new count is written during counting, it will be loaded on the next CLK pulse and counting will continue from the new count. If the count is two byte then:<ul><li>Writing the first byte has no effect on counting</li><li>Writing the second byte allows the new count to be loaded on the next CLK pulse</li></ul></li></ul></li></ul><p><img src="./.Photo.asset/image-20241108152016534.png" alt="image-20241108152016534"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Mode-5-Hardware-Triggered-Strobe"><a class="header-anchor" href="#Mode-5-Hardware-Triggered-Strobe">¶</a>Mode 5: Hardware Triggered Strobe</h4><ul><li><p>Normal Operation:</p><ul><li>The output will be initially high;</li><li>The counting is triggered by the rising edge of the Gate</li><li>The output will go low for one CLK pulse after the terminal count</li></ul></li><li><p>Retrotriggering:</p><ul><li>If the triggering occurs during the counting, the initial count is loaded on the next CLK pulse and the counting will be continued until the terminal count is reached</li></ul></li><li><p>New count:</p><ul><li>the current counting sequence will not be affected. If the trigger occurs after the new count but before the terminal count, the counter will be loaded with the new count on the next CLK pulse and counting will continue from there</li></ul></li></ul><p><img src="./.Photo.asset/image-20241108152305720.png" alt="image-20241108152305720"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="Lecture-9-Interrupts-8259"><a class="header-anchor" href="#Lecture-9-Interrupts-8259">¶</a>Lecture 9: Interrupts &amp;8259</h2><ul><li>256 interrupt types in total: INT 00 ~ INT 0FFh</li><li>Type* 4 = PA of interrupt vector (first 1KB store interrupt vectors, called Interrupt Vector Table (IVT))</li><li>Interrupt vector points the entrance address of the corresponding interrupt service routine (ISR)</li></ul><p><img src="./.%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90.photoasset/image-20241108153421166.png" alt="image-20241108153421166"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h4 id="Categories："><a class="header-anchor" href="#Categories：">¶</a>Categories：</h4><ul><li>Hardware (external) interrupts<ul><li>Maskable (from INTR)</li><li>Non-maskable (from NMI)</li></ul></li><li>Software (internal) interrupts<ul><li>Using the INT instruction</li><li>Predefined conditional (exception) interrupts</li></ul></li></ul><h3 id="Hardware-Interrupts"><a class="header-anchor" href="#Hardware-Interrupts">¶</a>Hardware Interrupts</h3><ul><li>Maskable interrupt<ul><li>Trigger: INTR pin, input-signal, high active</li><li>TYPE: No predefined type</li><li>IF = 1, enable; IF = 0, disable<ul><li>STI sets IF, CLI clears IF</li></ul></li><li>Reasons:<ul><li>Interrupt requests of external I/O devices</li></ul></li><li>Procedure<ul><li>CPU responds to INTR interrupt requests<ul><li>External I/O devices send interrupt requests to CPU</li><li>CPU will check INTR pin on the last cycle of an instruction: if the INTR is high and IF = 1, CPU responds to the interrupt request</li><li>CPU sends two negative pluses on the ~INTA pin to<br>the I/O device<br>After receiving the second ~INTA, I/O device sends<br>the interrupt type N on the data bus</li></ul></li><li>CPU executes the ISR of INT N<ul><li>CPU reads the N from data bus</li><li>Push the FR in stack</li><li>Clear IF and TF</li><li>Push the CS and IP of the next instruction in stack</li><li>Load the ISR entrance address and moves to the ISR</li><li>At the end of the ISR, IRET will pop IP, CS and FR in turn, CPU returns to previous program and proceeds</li></ul></li></ul></li></ul></li><li>Software Interrupts<ul><li>INT xx instruction<ul><li>An ISR is called upon instruction such as “INT xx”<ul><li>E.g., int 21h ; Dos service</li></ul></li><li>CPU always responds and goes execute the corresponding ISR<ul><li>Not affected by the IF</li></ul></li><li>You can “CALL” any ISR by using the INT instruction</li></ul></li><li>Predefined conditional interrupts<ul><li>“INT 00” (divide error): dividing a number by zero, or quotient is too large</li><li>“INT 01” (single step):If TF = 1, CPU will generates an INT 1 interrupt after executing each instruction for debugging</li><li>“INT 03” (breakpoint): When CPU hits the breakpoint set in the program, CPU generates INT 3 interrupt for debugging</li><li>“INT 04” (signed number overflow): INTO instruction; Check the OF after an arithmetic instruction</li><li>&quot;INT 02&quot;: NMI</li></ul></li><li>Procedure：<ul><li>For NMI<ul><li>CPU checks NMI, generates INT 02 interrupt automatically regardless of IF and executes to the ISR</li></ul></li><li>For software (internal) interrupts<ul><li>CPU generates INT N interrupt automatically and executes to the corresponding ISR</li></ul></li></ul></li></ul></li><li>256 Interrupts<ul><li>0-4 dedicated</li><li>5-31 reserved for system use</li><li>32-255 reserved for users</li></ul></li><li>Interrupt Priority<ul><li>INT &gt; NMI &gt; INTR</li></ul></li><li>Priority of INTR Interrupts<ul><li>Software polling</li><li>Hardware checking</li><li>Vectored interrupt controller: eg. 8259(Programmed Interrupt Controller aka PIC)<ul><li>Manage interrupt requests</li><li>flexible peripheral controller chip<ul><li>deal with 64 interrupt inputs</li><li>can be masked</li><li>various priority schemes can be programmed</li></ul></li><li>orginally available as a separate IC, later in motherboards chipset, and in modern processors built in</li></ul></li></ul></li><li>Higher priority interrupts can interrupt lower interrupts</li></ul><h2 id="Lecture-10-BIOS-and-DOS-Programming"><a class="header-anchor" href="#Lecture-10-BIOS-and-DOS-Programming">¶</a>Lecture 10: BIOS and DOS Programming</h2><h3 id="BIOS-INT-10H-Programming"><a class="header-anchor" href="#BIOS-INT-10H-Programming">¶</a>BIOS INT 10H Programming</h3><ul><li><p>INT 10H subroutines are burned into the ROM BIOS (in 80x86-based IBM PCs)</p></li><li><p>Used to communicate with the computer’s screen video</p><ul><li>E.g., changing the color of characters or background color, cleaning the screen, changing the location of the cursor, drawing lines on the screen</li><li>By setting AH with different values, you can “call”<br>those functions</li></ul></li><li><p>Scrolling the windows</p><table><thead><tr><th style="text-align:center">Registers</th><th style="text-align:center">UP/DOWN</th></tr></thead><tbody><tr><td style="text-align:center">AH</td><td style="text-align:center">06h/07h</td></tr><tr><td style="text-align:center">AL</td><td style="text-align:center">number of lines to scroll</td></tr><tr><td style="text-align:center">BH</td><td style="text-align:center">display attribute</td></tr><tr><td style="text-align:center">CH</td><td style="text-align:center">y coordinate of top left</td></tr><tr><td style="text-align:center">CL</td><td style="text-align:center">x coodinate of top left</td></tr><tr><td style="text-align:center">DH</td><td style="text-align:center">y coodinate of lower right</td></tr><tr><td style="text-align:center">DL</td><td style="text-align:center">y coodinate of lower right</td></tr></tbody></table><p>if AL == 0, the entire windows is blank</p></li><li><p>Set cursor position: AH = 02h</p><table><thead><tr><th style="text-align:center">Registers</th><th style="text-align:center">Functions</th></tr></thead><tbody><tr><td style="text-align:center">BH</td><td style="text-align:center">page number</td></tr><tr><td style="text-align:center">DH</td><td style="text-align:center">row</td></tr><tr><td style="text-align:center">DL</td><td style="text-align:center">column</td></tr></tbody></table></li><li><p>Set Video Mode: AH = 00h</p><ul><li>In text mode, the screen is viewed as a matrix of rows and columns of characters<ul><li>E.g., AL = 03h: VGA 80x25 chars, 16 colors</li></ul></li><li>In graphics mode, the screen is viewed as a matrix of horizontal and vertical pixels<ul><li>Each pixel can have different color</li><li>The size of video memory decides the number of pixels and colors</li><li>E.g., AL = 13H: VGA 320x200 pixels, 256 colors</li></ul></li></ul></li></ul><h3 id="DOS-Interrupt-21H"><a class="header-anchor" href="#DOS-Interrupt-21H">¶</a>DOS Interrupt 21H</h3><ul><li><p>Provided by MS-DOS</p><ul><li>Based on BIOS-ROM</li><li>After the DOS is loaded into the memory, you can invoke INT 21H to perform some extremely useful functions</li><li>E.g., input from keyboard, display results on screen</li><li>By setting AH with different values, you can invoke<br>those functions</li></ul></li><li><p>AH = 09H: Output String on Screen</p><ul><li>Can be used to send a set of ASCII data to the<br>monitor</li><li>DX is set to the offset address of the ASCII string to be displayed (DS is assumed to be the data segment)</li><li>All characters will be displayed until it encounters the dollar sign &quot;$&quot;</li></ul></li><li><p>AH =  4CH: Exit to DOS</p><ul><li><p>AH = 4CH</p></li><li><p>AL = 00H</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">MOV AX,4C00H</span><br><span class="line">INT 21H</span><br></pre></td></tr></table></figure></li></ul></li></ul><h2 id="Lecture-11-Serial-Data-Communication-8251"><a class="header-anchor" href="#Lecture-11-Serial-Data-Communication-8251">¶</a>Lecture 11: Serial Data Communication &amp; 8251</h2><ul><li>Data transmission: transfer of data from point to point</li><li>Communication channel: the medium used to<br>convey information (copper wires, optical fibbers, wireless communication channels)</li></ul><h3 id="Two-ways-parallel-Serial"><a class="header-anchor" href="#Two-ways-parallel-Serial">¶</a>Two ways: parallel &amp; Serial</h3><ul><li><p>Parallel data transfers:</p><ul><li>Each bit uses a separate line (wire)</li><li>Often 8 or more lines are used</li><li>Control signals in addition</li><li>Fast &amp; expensive &amp; for short-distance communication</li></ul></li><li><p>Serial data transfers:</p><ul><li>One single data line</li><li>Bits are sent over the line one by one</li><li>No dedicated lines for control signals</li><li>Cheap &amp; slow &amp; for long-distance communication</li></ul></li></ul><h3 id="Serial-Communication"><a class="header-anchor" href="#Serial-Communication">¶</a>Serial Communication</h3><h4 id="Data-Transfer-Rate"><a class="header-anchor" href="#Data-Transfer-Rate">¶</a>Data Transfer Rate</h4><ul><li>Symbol rate, a misnomer is baud rate<ul><li>The number of distinct symbol or pulse changes (signaling events) made to the transmission medium per second in a digitally modulated signal or a line code, quantified using the baud unit</li><li>Each symbol can represent one (binary encoded signal) or several bits of data</li></ul></li><li>Bit rate<ul><li>the number of bits that are conveyed or processed per unit of time, quantified using the bits per second (bit/s or bps) unit</li></ul></li></ul><h4 id="Synchronization-Methods"><a class="header-anchor" href="#Synchronization-Methods">¶</a>Synchronization Methods</h4><ul><li><p>Asynchronous serial communication:</p><ul><li><p>Transfer one byte at a time</p></li><li><p>The starting of each byte is asynchronous, and therefore each byte needs synchronization between the sender and the receiver using start bit.</p></li><li><p>eg. 1 start bit, each character 8 bits, a parity bit, 2 stop bits. 100 characters/second</p><p>Baud rate: 100*(1+8+1+2) = 1200bps</p></li></ul></li><li><p>Synchronous serial communication:</p><ul><li>Transfer a block of data at a time</li><li>The sender and the receiver are synchronized at the beginning of data transfer using synch characters.<ol><li>Character-Oriented Synchronous Transmission</li><li>Bit-Oriented Synchronous Transmission</li></ol></li></ul></li></ul><h3 id="Communication-Modes"><a class="header-anchor" href="#Communication-Modes">¶</a>Communication Modes</h3><ul><li>Simplex:<ul><li>Only one way</li><li>E.g., printer</li></ul></li><li>Half-duplex:<ul><li>Data is transmitted one way at a time</li><li>E.g., walky-talky</li></ul></li><li>Full-duplex<ul><li>Data can go both ways at the same time</li><li>E.g., telephone</li></ul></li></ul><h3 id="Error-Detection"><a class="header-anchor" href="#Error-Detection">¶</a>Error Detection</h3><ul><li>Parity bit<ul><li>Used in asynchronous serial communication</li><li>Put an extra parity bit at the end of each character<ul><li>Even-parity: the data and the parity bit has an even number of 1s; odd-parity</li></ul></li></ul></li><li>CRC Calculation<ul><li>vk-bit data, n-bit CRC:</li></ul></li></ul><h2 id="END"><a class="header-anchor" href="#END">¶</a>END</h2>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;Computer Organization&lt;/h1&gt;
&lt;h2 id=&quot;Lecture-01-Introduction-to-Computer-Organization&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#Lecture-01-Introduc</summary>
      
    
    
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/categories/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="知识整理/Knowledge" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E8%AF%86%E6%95%B4%E7%90%86-Knowledge/"/>
    
  </entry>
  
  <entry>
    <title>暑期旅途</title>
    <link href="https://ryanstarfox.github.io/2024/09/17/2024/20240916%20%E6%9A%91%E5%81%87%E6%97%85%E6%B8%B8%E5%B0%8F%E7%BB%93/"/>
    <id>https://ryanstarfox.github.io/2024/09/17/2024/20240916%20%E6%9A%91%E5%81%87%E6%97%85%E6%B8%B8%E5%B0%8F%E7%BB%93/</id>
    <published>2024-09-17T04:21:00.000Z</published>
    <updated>2024-09-17T04:21:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>暑期旅途</h1><p>2023年的暑假，自六月中旬开始，至八月中下旬的军训，我一度以为这可能是我最长的假期，也是旅游最多的假期了：我于7月与友人前去西藏，看了银河横跨星空、路过赛马比赛、赏了冰川遇了藏羚羊；于7月底去了日本，在福冈拜访了林爷爷，泡了日本温泉，喜欢上了京都这座城市，和奈良小鹿贴贴，并且在归国的飞机上发了烧；于8月重游南京，重访明孝陵，在夫子庙人挤人，又顺路去了扬州游览瘦西湖，并且在旅途中就发烧了。充实又开心，我知道，这将是我此生难忘的一个夏天。</p><p><img src="/images/2024/%E6%88%AA%E5%B1%8F2024-09-16%2023.35.43.png" alt="截屏2024-09-16 23.35.43"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>谁知第二年——也就是今年的暑假，我因无小学期，放了足足3个月的假，从6月中到9月中，于是我竟然比去年旅游的次数还要多——这一年暑假也将是此生难忘吧？</p><h2 id="北京"><a class="header-anchor" href="#北京">¶</a>==北京==</h2><p>6月前去北京。上海是一座气候舒适但是没什么文化底蕴的城市，北京是一座文化底蕴深厚但是不怎么舒适的城市——感觉这是大多数北京的同学对于北京的看法。兴许是时间的缘故吧，我并未体会到北京的不舒适，仅有的几天停留中，也还没来得及吃厌北京火锅和北京烤鸭。</p><p><img src="/images/2024/IMG_5941.jpeg" alt="IMG_5941"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我是有点嫉妒北京的文化底蕴的，总觉得随便一个地方都能和历史上的某一个事件联系起来，这种与过去连接的感觉非常奇妙。虽然如果从小住在北京，或是在北京住了足够长的时间，应该会对这种感觉越来越不屑吧？</p><p>在北京拜访了几位友人，并且长谈。许久不见，总有说不完的话。与y聊天的那一夜的酒喝到近23:00，地铁停运，在这座陌生的城市里骑了一个钟头共享单车才到旅馆——清北的位置真的是偏远啊！那天晚上还路过了友校：</p><p><img src="/images/2024/IMG_6090.jpeg" alt="IMG_6090"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>虽然本不想安排得非常累，但是没想到最后还是有些特种兵。最累的一天反而不是去长城的那一天——那一天早起，8点到八达岭长城的时候已经人满为患。有人抄近路乘缆车到离好汉坡只有一楼之遥的北7楼（没记错的话），我是从北一楼一路爬到了好汉坡，又一路爬到了没什么人的最最末尾北十二楼，在那里与一位大叔分别为对方合影留念，最后在北十一楼下长城。最累的是游览颐和园、圆明园和清北的那一天。颐和、圆明二园本就很大，最后也没有完全兜玩，只是确保那些必看的都去一一参观过。随后去清，不料清在自招活动之类的，未能如愿进校，前去北，leo带我兜了一圈，随后与leo前去王府井参观Apple store和它对面的Huawei store（这就是无可救药的果粉）。那一天走了3万余步，最累。</p><p>庆丰包子味道一般，但是看上去很有帝王之气。</p><p><img src="/images/2024/IMG_6132.jpeg" alt="IMG_6132"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="崇明"><a class="header-anchor" href="#崇明">¶</a>==崇明==</h2><p>去崇明也是临时起意，起因是身为护士的母亲难得地有了连续两天的休息，就决定前去从未去过但是不远的崇明岛。</p><p>一路开车过去的，经过上海长江大桥（可惜上海市长不是江大桥了），我妈有感而发：“这座桥值得50元路费。”</p><p>崇明两天主要就逛逛各种森林公园，吃吃便宜又美味的农家乐。农家乐的饭菜真的比商场预制菜好吃一百万倍！（是不是商场里除了烤肉和火锅都是预制菜。。。）海边有很多螃蟹。</p><p>看到东滩可以夜公园，想起来之前读到过上海最适合观星的地方是崇明，想以后带着望远镜来看星星。东滩好像是一个扬子鳄保护基地之类的，可惜没见到扬子鳄。</p><p>回家的时候意外地发现嘉定的电视塔和电线杆很日本，在车上胡乱拍了一张。</p><p><img src="/images/2024/_DSC1385.JPG" alt="_DSC1385"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="嵊泗"><a class="header-anchor" href="#嵊泗">¶</a>==嵊泗==</h2><p>去嵊泗也是临时起意，原因也是身为护士的母亲难得地有了连续两天的休息。一路开车过去，经过东海大桥，我妈有感而发：“这座桥值100元路费。”</p><p>到了沈家湾码头，一路乘船去嵊泗，船蛮稳的，不晕。穿上在放奥运会。</p><p>嵊泗是一座美丽的小岛，爱上了，加入旅居城市清单了。海边真的很美，好想永远住在海边啊！</p><p><img src="/images/2024/IMG_6592.jpeg" alt="IMG_6592"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>在这里租不到山地自行车，所以只能租电瓶车环岛骑行，非常舒适，只是我还是更喜欢自行车一些。</p><p>第二天早起看日出，结果没看到，有山挡着，太阳不是从海里出来的，而是从山后出来的。</p><p><img src=".7/.Photo.asset/IMG_6636.jpeg" alt="IMG_6636"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>海边好多小螃蟹和海蟑螂。</p><h2 id="长沙张家界"><a class="header-anchor" href="#长沙张家界">¶</a>==长沙张家界==</h2><p>与Leo一起去的，住在五一广场，也就是市中心，离Apple Store很近，两个无可救药的果粉在长沙Apple store体验vision pro（这已经是我第三次体验vision pro了）。</p><p>马王堆汉墓和湖南博物馆都要提前预约，我们临行前才想起，马王堆汉墓去不成了，湖南博物馆在携程上找了一个导游带我们讲解参观，导游水平很高，感觉性格很受。在湖南博物馆看到了辛追夫人，这么看来也不用去马王堆汉墓了。</p><p>在长沙呆了两天后，去了张家界。</p><p>张家界全是土菜馆，所以我也吃得很开心——美味无比！我爱土菜馆！我爱农家乐！量大管饱又美味！建议交大开满中国各地的农家乐。</p><p>张家界很奇妙，或许是阿凡达拍摄地的缘故吧，所以感觉外国人比例甚至可能超过了上海市中心，甚至是可以和交大这样的大学相当。<img src="/images/2024/_DSC1986.JPG" alt="_DSC1986"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>山真的是一重一重的。</p><p>不过我对于张家界的感知也并没有觉得景色非常美，感觉壮观归壮观，但是不过尔尔。不过值得一提的是那里的接驳车系统——原始但是有效！那里的接驳车系统如下：接驳车按照规定的路线行驶，和司机说好你要去哪里，他沿着路线放你下去之后你去找工作人员，工作人员会告诉你接下来乘坐哪一班接驳车并且告知那个司机自己的目的地。这个看上去有点原始的系统竟然出奇地高效！repect respect</p><p>我和Leo一直有一个感知：SHSer的走路速度一直比普通人快一些，尤其是对于普通人正常的速度，我们会觉得很难受，有点高不成低不就，再快一点慢一点都会舒服得多。这一点在张家界那里得到了印证：游客中心说要30分钟的路程，我们竟然只走了15分钟，对此颇为惊讶。在金鞭溪那里的时候，由于是平地，我们记了个时，发现2.58km的走路配速竟然是12'11''，还有两段7km的记录，竟然配速也是15'多，真是擅长走路的两个人。<img src="/images/2024/fitness1.jpg" alt="fitness1"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>btw，金鞭溪好多🐒。</p><p><img src="/images/2024/_DSC1960.JPG" alt="_DSC1960"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>这只猢狲看上去在深思</p><p>在机场回上海候机的时候遇到两个同去上海的人，他们像是科技控股相关公司的员工，与他们相谈甚欢，我和Leo正好专业对口，又是果粉。对方提到想投资安克，正在做调研，安克正是主流苹果配件厂商之一。</p><h2 id="日本"><a class="header-anchor" href="#日本">¶</a>==日本==</h2><p>重访日本，此次主要目的是带外公外婆出过玩玩——外婆还接到了太外婆的任务，买点酥心糖吃吃：太外婆记得小时候吃到的东洋糖非常甜，想吃吃看。酥心糖是没有买到，但是买了很多软糖硬糖和糕点。买的大福本还担心她咬不动，结果竟然一下子吃了8个，吃得晚饭都吃不下。</p><p>此次依次拜访了名古屋-京都-奈良-大阪。填补了一些去年的遗憾吧。</p><p>名古屋去年未去过，但感觉大名鼎鼎，去看了看名古屋城。</p><p><img src="/images/2024/IMG_7237.jpeg" alt="IMG_7237"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>京都去年的遗憾很多，一一填补：在伏见稻荷大社重买了去年弄丢的狐狸玩具、进去了去年过了参拜时间而没能参观的国宝金阁寺、参观了去年根本没时间去的二条城。我发现我对京都已经开始有点熟悉了，有一夜家人都累了在酒店休息，我独自出去逛，凭我的记忆走到了去年住的酒店。在鸭川旁边坐了很久。京都也是一个以后有机会一定要来旅居的城市！加入旅居列表！</p><p><img src="/images/2024/IMG_7449.jpg" alt="IMG_7449"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>奈良重访小鹿，它们比去年凶一些，可能是秋天发情期的缘故吧？今年进了春日大社——去年在春日大社门口遇见了P同学，长谈之后竟然过了参观时间。</p><p>在大阪的第一天我又一次经过了打烊的黑门市场，但是在最后回国的那一天上午，我终于见到了开门的黑门市场！A5和牛美味。三度经过了去年吃的一家烧肉，可惜此次没机会吃，下次再去。</p><p>在日本的几天，我的外公外婆其实不是很吃得惯日本的饭菜，甚至我妈也没有很吃得惯——本以为日本与中国足够近，应该菜品也足够相近的。到头来，我的外公外婆最满意的是两顿弥生轩的日式快餐和一顿一兰拉面。</p><p>此次出行也有一些插曲，四人各犯了一次错：</p><p>我：把Apple pencil落在京都的酒店，连夜从奈良赶回京都，再回奈良几乎是乘到了JR的末班车。</p><p><img src="/images/2024/IMG_7289.jpeg" alt="IMG_7289"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>母亲：约定好在A地点等我，我送疲倦的外公外婆回酒店后回到A点，竟然不见踪影，电话也打不通，此时还暴雨骤降，我只好狼狈地去罗森躲雨。后来知道她只是去逛免税店了，免税店太吵接不到电话。</p><p>外婆：上面我送外公外婆回酒店的原因不仅仅是因为他们疲倦，还因外婆的手机落在了酒店。</p><p>外公：在机场跟着我们走结果自己走散了，还好距离不远，找到了。</p><p>总之还是较为顺利，没出什么大岔子。</p><p>以及此次去日本在京都遇到了T同学，去年也在奈良遇到了P同学，真是他乡遇故知啊！</p><h2 id="其他的一些碎碎念"><a class="header-anchor" href="#其他的一些碎碎念">¶</a>==其他的一些碎碎念==</h2><p>其实主要想讲讲日记。</p><p>我是从2018年8月1日开始写日记的，之所以这个日期记得这么清楚，是因为这是我去新加坡马来西亚旅游出发的日子。我为什么要记日记呢？其实是害怕遗忘——我太珍视自己的记忆了——记了日记，我就可以更放心地遗忘了。（其实拍照也是一个道理啊！）</p><p>一直以来，我写日记是传统的纸笔写日记的。上了大学之后，写日记是为数不多还需要用到笔的场景，我也因此格外珍惜用纸笔写日记的机会。可是在旅途中，把日记带出去又厚重又不安全，正巧iOS17发布了手记app，我便在旅途中体验体验，在此分享一下自己的感受：</p><p>电子日记最令人顾虑的是数据，不过目前绝大多数日记平台都支持导出日记/打印日记了，这是我敢用电子日记的大前提！电子日记的最大优点是记录多媒体：手记app每次都会推荐放在日记里的图片、定位等多媒体，我很喜欢。不仅如此，还有一个记录心情功能，这个功能是我最心水的，我几乎想以后不用纸笔记日记了。</p><p><img src="/images/2024/emotion.jpg" alt="emotion"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>但是它也有痛点：没有iPad版，也就意味着它不能手写，我认为这就失去了日记的感觉——其实用Apple pencil写日记已经让我感到勉为其难了，但是手记只能在手机上打字，因此我放弃了这个计划。</p><p>但是我有计划将手记app和纸质日记的优点相结合：</p><p>在旅途中，我会选择手记app，不用带出日记本，安全又方便。而且旅途中会有大量照片、定位，正合适手记app。</p><p>平时，我会记录纸质日记，但我打算参考手记app的记录心情功能，给自己做一些小便签小贴纸记录每天的心情。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;暑期旅途&lt;/h1&gt;
&lt;p&gt;2023年的暑假，自六月中旬开始，至八月中下旬的军训，我一度以为这可能是我最长的假期，也是旅游最多的假期了：我于7月与友人前去西藏，看了银河横跨星空、路过赛马比赛、赏了冰川遇了藏羚羊；于7月底去了日本，在福冈拜访了林爷爷，泡了日本温泉，喜欢上了京</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="旅行/Travel" scheme="https://ryanstarfox.github.io/tags/%E6%97%85%E8%A1%8C-Travel/"/>
    
  </entry>
  
  <entry>
    <title>没抢到果子首发的经历</title>
    <link href="https://ryanstarfox.github.io/2024/09/15/2024/20240915%20%E6%B2%A1%E6%8A%A2%E5%88%B0%E9%A6%96%E5%8F%91/"/>
    <id>https://ryanstarfox.github.io/2024/09/15/2024/20240915%20%E6%B2%A1%E6%8A%A2%E5%88%B0%E9%A6%96%E5%8F%91/</id>
    <published>2024-09-15T13:31:00.000Z</published>
    <updated>2024-09-15T13:31:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>没抢到果子首发的经历</h1><p>好笑，时隔一年整，没抢到首发</p><p>今年吸取了去年的教训，决定抢贵一点的机型，因为愿意加钱买首发的富哥富姐想必也会无脑冲超级顶配吧？所以我和Bill都筹集了资金，决定一人购置两台iPhone 16 pro max 1t机型</p><p>但是事情出现了转机：发布会之后，9/13日之前，我先前去闲鱼进行一些市场调研，发现挂出来的基本上都是256g的机型，也就是iPhone 16 pro max的最低配，令人感到疑惑。可能性有二：</p><ol><li>没有人买1t版本，大家都买256g，所以大家都挂256g</li><li>没有人有1t的货，所以说1t非常抢手</li></ol><p>最终我和Bill决定，我购置一台256g，一台1t，Bill购置两台512，平摊风险</p><p>我特地在抢之前熟悉了一下流程。去年是在Apple store直接购买的。今年由于原账号转了美区，美区支付方式没有微信支付宝和储蓄卡，只有信用卡，而我没有信用卡，因此只得作罢。在淘宝Apple Store官方、京东Apple自营店、微信小程序Apple store中。最终选择了微信小程序Apple store，因其与Apple store体验最相似。</p><p>13日20时，准时开抢！</p><p><img src="/images/2024/image-20240915202059320-6402860-6402864-6402866.png" alt="image-20240915202059320"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>情况如图，Hertz最为fx，竟然进去了不买，只是去逛逛，像是除夕夜去南京路轧闹猛</p><p>随后我出状况了，我之前把钱集中到了我的上海银行卡里面，结果发现有限额，而且限额只有5000，我连转都转不出去。最后还是我妈的协助下购置的两台。虽然20:06就登上了，本应07就付款，结果硬生生一台10分一台15分付的款。</p><p>与此同时Bill亦出状况了，他给我打电话，我不接。后来发现又是钱的问题，又是颜色的问题，好像也拖得较晚，但比我略早一些。</p><p>买是买上了，有没有首发呢？</p><p>去年Leo也是碰到银行卡限额的问题，群里东拼西凑借满了钱，记得是拖到20分上下才付款，结果还是首发，所以应该能抢到吧？</p><p>第二天早上起来一看：预计送货日期10/14-18，心凉了半截</p><p><img src="/images/2024/%E6%88%AA%E5%B1%8F2024-09-15%2020.31.51-6403523.png" alt="截屏2024-09-15 20.31.51"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>于是乎，直接退货，现在已经是这样了，，</p><p>与Bill交流发现他亦未抢到首发，他最后不知怎么抢了3台，看上去都是第二批</p><p><img src="/images/2024/image-20240915203506721-6403711.png" alt="image-20240915203506721"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="/images/2024/image-20240915203549756.png" alt="image-20240915203549756"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我帮他挂了闲鱼，看看能不能赚到钱吧。。。</p><p>Bill补充分析：</p><p><img src="/images/2024/0.png" alt="img"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>真是奇怪没想到最热门的是白色，经典咏流传啊！新颜色不过尔尔。</p><p>综上所述，银行卡限额真的是罪大恶极！！</p><p>我气急败坏，于昨日前去上海银行解决此问题，打算将日限额提至每日50k，月限额保持每月100k</p><p>昨日先前去观看电影《里斯本丸号沉没》，随后就驱自行车前往上海银行嘉定总行</p><p>到号之后又等待许久，才得知这张银行卡既没有工资进出，有没有贷款进出，所以5000的限额已经算是很大了。我疑惑、惊讶，感觉银行、款项大、5000元人民币两两都有关系，可三个放在一起就有些好笑。</p><p>银行职员为我提出了两条解决方法：</p><ol><li>转入另一张无限额的银行卡。可是我的别的银行卡都各有各的用处，不想混在一起搞不清楚，作罢</li><li>办一张信用卡，bingo！</li></ol><p>我一直都想办一张信用卡，因为对于国际支付方便一些，正好趁此机会顺水推舟办一张</p><p>网上查找后，发现可以学生零额度申请而且支持国际支付的推荐去上海银行，于是穿过马路前往中国银行嘉定总行</p><p>微信扫了一个码，按照指示输入相关信息后，眼看临门一脚，发现界面加载不出</p><p>在浏览器中打开、在中国银行app内均不行</p><p>遂作罢，估计中秋系统升级，过两天再尝试</p><p>唉此次抢iPhone 16 Pro Max计划出师不利、诸事不顺、功败垂成</p><p><img src="/images/2024/hero_static__f5zgxhmj6geq_large_2x.jpg" alt="hero_static__f5zgxhmj6geq_large_2x"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;没抢到果子首发的经历&lt;/h1&gt;
&lt;p&gt;好笑，时隔一年整，没抢到首发&lt;/p&gt;
&lt;p&gt;今年吸取了去年的教训，决定抢贵一点的机型，因为愿意加钱买首发的富哥富姐想必也会无脑冲超级顶配吧？所以我和Bill都筹集了资金，决定一人购置两台iPhone 16 pro max 1t机型&lt;/</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>高光时刻--还可以吧</title>
    <link href="https://ryanstarfox.github.io/2024/09/10/2024/20240910%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/"/>
    <id>https://ryanstarfox.github.io/2024/09/10/2024/20240910%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/</id>
    <published>2024-09-10T08:34:00.000Z</published>
    <updated>2024-09-10T08:34:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>高光时刻--还可以吧</h1><p>新年快乐🎉🎉<img src="/images/2024/hero_static__f5zgxhmj6geq_large_2x.jpg" alt="hero_static__f5zgxhmj6geq_large_2x"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>这是我第一次在假期里的苹果发布会，说来好笑，交大竟至今仍未开学</p><p>我的直观感受此次发布会无甚惊喜，基本都是常规更新，也有几款产品更新得很烂，真的毫无诚意</p><h2 id="iPhone-系列"><a class="header-anchor" href="#iPhone-系列">¶</a>iPhone 系列</h2><p>首先，iPhone16这个外观和颜色真的丑啊！！</p><p><img src="/images/2024/iPhone16.png" alt="iPhone16"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我其实很早之前就看到iPhone16的爆料渲染图了，看到这个设计的时候真的觉得是丑啊。我可以理解为了支持空间视频的功能，两个摄像头不能对角线放置，要水平/竖直放置，但是这个摄像头模块让人感到非常不协调：为什么要把闪光灯单独拉到摄像模块之外呢？如果用iPhone X那样的设计或者用iPhone 12那样的设计，我还是可以理解的，但是为了标新立异弄成这样，真的是可可又悲悲。不过不要低估苹果的畜牧业，我看了这个设计看了半年，竟然已被驯化，觉得这个外观还可以了，真的是果粉可悲的自适应。</p><p>其次，这个颜色真的有点奇怪。黑白是常规的颜色，另外三款颜色我认为不比去年（15系列的颜色真的是太好看了！），也是有点标新立异。其实我认为最大的问题在于摄像模块的颜色比周围深，色差较大，给人奇怪的感觉。三款彩色中，我认为绿色最佳，蓝色平平，粉色好丑。Hertz认为配色像垃圾桶，过于廉价。他这么一说真的回不来了。</p><p><img src="/images/2024/%E5%9E%83%E5%9C%BE%E6%A1%B6.png" alt="垃圾桶"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>比较令我惊讶的是iPhone16竟然也给了摄影键，本在惊叹刀钝了，没想到刀法依旧——压感功能是Pro exclusive的。</p><p>16Pro让人有点期待，毕竟A18Pro是第二代3纳米芯片，应该能解决去年A17Pro的发热问题，这才是满血3纳米！不过比较好笑，官方介绍里的对比默认对比的竟然是12Pro，一下让人觉得哑然失笑。</p><p><img src="/images/2024/%E6%88%AA%E5%B1%8F2024-09-10%2015.58.45.png" alt="截屏2024-09-10 15.58.45"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>别的都是常规升级吧？我有一点没弄清楚，这次全系都有“融合式摄像头”，在标准版能承担广角和长焦的工作，有人看懂是什么意思嘛？还是说仅仅是另一个噱头？感觉标准版的长焦还是需要依靠裁切+算法。</p><h2 id="Apple-watch-系列"><a class="header-anchor" href="#Apple-watch-系列">¶</a>Apple watch 系列</h2><p>watch ultra只是多了新配色，无聊，不表。</p><p><img src="/images/2024/%E6%88%AA%E5%B1%8F2024-09-10%2016.01.17.png" alt="截屏2024-09-10 16.01.17"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>watch x可以聊聊：官方给出的最大卖点是薄，不过私以为对于手表来说其实厚度的感知没有那么大，续航才是对于使用体验更重要的部分。目前的续航，正常用可以一天有点宽裕，但是如果旅游、记录大量运动，那么连一天的续航都没有，我在旅途中都是开低电量模式的，这会牺牲常亮显示、运动监测等功能。诚然，这一代升级了快充，但是谁会出门带一根watch的线呢？虽然第三方有小巧的充电头，但是那种又只能超级慢充，也不舒服。所以我认为走偏了——包括上半年的iPad pro我也觉得是类似的问题，不过那个变薄还比watch x变薄更有道理一些，上述的一些缺点并没有，而且变薄变轻的确舒适。</p><p>不过leo主张，现在的watch是比正常的watch厚一些，变薄是有道理的，体验确实会更好，不过让人觉得不如ultra 1。</p><p>比较牛的是熄屏显示可以1Hz刷新率了，所以说可以显示秒针了。以及亮面铝金属外壳看上去好看一些了，我一开始还以为是不锈钢。</p><p>另一件好笑的是：官方声称watch x边框变薄了，我认为我和绝大多数用户都想看到其相对于789的模具变薄了多少，结果官网只有和3456se对比，真是此地无银三百两。</p><p><img src="/images/2024/%E6%88%AA%E5%B1%8F2024-09-10%2015.59.30.png" alt="截屏2024-09-10 15.59.30"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="AirPods系列"><a class="header-anchor" href="#AirPods系列">¶</a>AirPods系列</h2><p>先说说好笑的AirPods Max，所有的升级只有新配色和type-C，芯片没换性能无提升——这不是和AirPods pro 2（type- C）一样，悄咪咪上架就行了嘛？我不要新颜色，能不能给我AirPods Max2</p><p><img src="/images/2024/AirPods4.png" alt="AirPods4"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'>AirPods 4我认为不错，降噪效果能有AirPods pro一代的效果（还是从AirPods Max的介绍里推断出来的）、无线充电（普通+手表充电器）、力度感应器（就是不知道能不能调整音量，要是可以的话就完美了，不过以苹果的尿性估计是没有的）。总之就是最强半入耳！感觉是在音质和舒适性上找到了平衡点（不喜欢骨传导/耳夹式，音质差&amp;漏音)。</p><p><img src="/images/2024/apm%E5%92%8Capapp%E5%AF%B9%E6%AF%94.png" alt="apm和apapp对比"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h2 id="综上所述"><a class="header-anchor" href="#综上所述">¶</a>综上所述</h2><p>觉得还可以吧，中规中矩，不拉胯，但因为没什么有意思的。今年吸取了去年的经验，决定倒买倒卖iPhone 16 Pro Max 沙漠色 1Tb款，成本13999，最多亏0元，不知道能赚多少。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;高光时刻--还可以吧&lt;/h1&gt;
&lt;p&gt;新年快乐🎉🎉&lt;img src=&quot;/images/2024/hero_static__f5zgxhmj6geq_large_2x.jpg&quot; alt=&quot;hero_static__f5zgxhmj6geq_large_2x&quot;  data</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>影评：《姥姥的外孙》</title>
    <link href="https://ryanstarfox.github.io/2024/08/31/2024/20240831%20%E5%A7%A5%E5%A7%A5%E7%9A%84%E5%A4%96%E5%AD%99/"/>
    <id>https://ryanstarfox.github.io/2024/08/31/2024/20240831%20%E5%A7%A5%E5%A7%A5%E7%9A%84%E5%A4%96%E5%AD%99/</id>
    <published>2024-08-31T15:48:19.000Z</published>
    <updated>2024-08-31T15:48:19.000Z</updated>
    
    <content type="html"><![CDATA[<h1>永恒的难题</h1><p>今天去看了姥姥的外孙</p><p>这是一部铺垫得很慢的电影。电影前半段我几乎以为是一部喜剧片，没想到这竟然只是糖衣，前后的呼应竟更让人唏嘘不已。</p><p>印象最深刻的镜头是几组火车的镜头。安乘着火车和大舅一家陪同外婆去烧香祈福，又一同乘回来；铁轨穿过繁忙但不繁华、热闹但不喧闹、市井但不低俗的郊区小镇；尤其是最后得知外婆为自己存款时，安愣住了，向后的火车的喧嚣遮盖了他杂乱的思绪，他恍惚看见小时外婆“轻易”的约定，向后的火车声音却变得平静，安回到此时此刻。铁轨上的天空，树梢之间，有彩虹。</p><p>从最后一次化疗后的剧情，真正让人落泪不止。</p><p>老人需要什么？老人需要陪伴。老人害怕什么？老人害怕孤独。老人爱自己的孩子，老人恨自己的孩子。老人又变回了孩子。安用手机给外婆看弱智美颜特效，安陪外婆打牌，安安慰深夜痛哭的外婆，安给临终的外婆唱安眠曲。</p><p>这个时代太快，让人不愿承认但又不得不承认，代沟就是在越来越大，后辈和长辈的话题真的越来越少，无非是新闻、饭菜、小时故事。诚然可悲，但又无可奈何。但是我依旧想多与长辈沟通，我想认识更加立体的自己的长辈，ta们作为一个真实的人，而不是相对于自己的一个身份。</p><p>我也很害怕我会变心。小孩子的心思很简单：我要孝顺，我希望所有人都好，就像电影中的彩虹说：“我长大要当医生为姥姥治病。”但是现实的种种风尘斑驳了赤字之心。大舅最后才想起来，自己夜不能寐的原因。我是独生子女家庭，相比大家庭子女之间地位的矛盾，独生子女家庭的矛盾更在于放不下孩子、也需要孩子的父母，和想为自己往前飞却又希望回头带着父母一起往前的瞻前顾后。父母曾经是一切——但是所有孩子都会背叛父母，父母不是一切；所有的父母也不得不接受这份背叛，让孩子向前飞。</p><p>长辈、后辈、友谊、利益、事业、爱情，我们迷失在其中，我们忘了一些誓言，但是总有人记得，但或许没人理得清这些关系吧？对这些关系做任何的比较或许都是一种痛苦。安不要再问外婆最爱的人是谁了，安对外婆说自己最爱的人是外婆。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;永恒的难题&lt;/h1&gt;
&lt;p&gt;今天去看了姥姥的外孙&lt;/p&gt;
&lt;p&gt;这是一部铺垫得很慢的电影。电影前半段我几乎以为是一部喜剧片，没想到这竟然只是糖衣，前后的呼应竟更让人唏嘘不已。&lt;/p&gt;
&lt;p&gt;印象最深刻的镜头是几组火车的镜头。安乘着火车和大舅一家陪同外婆去烧香祈福，又一同乘</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
  </entry>
  
  <entry>
    <title>fxlego大典v1.0</title>
    <link href="https://ryanstarfox.github.io/2024/08/11/2024/20240811%20%E4%B8%8A%E4%B8%AD%E8%85%94%E8%AF%8D%E5%85%B8v1.1/"/>
    <id>https://ryanstarfox.github.io/2024/08/11/2024/20240811%20%E4%B8%8A%E4%B8%AD%E8%85%94%E8%AF%8D%E5%85%B8v1.1/</id>
    <published>2024-08-11T04:00:00.000Z</published>
    <updated>2024-08-11T04:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>前言</h1><h2 id="v1-0"><a class="header-anchor" href="#v1-0">¶</a>v1.0</h2><p>写这一份上中腔词典的原因是一时兴起。其实很难说我这里所说的“上中腔”的具体定义是什么。说是上中腔，但又主要是大师班的同学常用，但别的班也有一批同学会用。说是大师班的同学常用，但又主要是大师班的男生在用，女生们也会用其中的一些表述，但不多。为了简单起见，还是称其为上中腔好了。写这份东西写主要是图一乐，回顾一下以前的一些已经成为典故的趣事，不可当真。用上中腔的表述来说，这份东西其实非常🌭，ydfx。编写这份东西的时候，毛哥和Nababa同学给我提供了很多帮助，他们是我的第一批读者，帮助我扩充了一些词条，也回忆了有意思的故事，其中Nababa同学还帮我写了一些我不是很熟悉的词条。感谢zjh同学，在发布前夕又补充了大量词条。也感谢myj，sty同学，从他们那里我也了解到更多的一些我不熟悉的词条和它们的词源典故。以下的词条的例句来源于我与同学的聊天记录，感谢这些聊天记录！这些必然包含着我的片面性与局限性，欢迎扩充更多词条以及修订词条！</p><h2 id="v1-1"><a class="header-anchor" href="#v1-1">¶</a>v1.1</h2><p>修订、增补了一些词条。由于微信显示不出\dagger，\ddagger和\star符号，在微信公众号中改成了粗体、斜体和下划线。也欢迎下载原文档查看。感谢Nababa同学和try同学的批评指正以及提供的资料。<br>关于到底什么是“上中腔”，try同学认为这是九班腔，又因高三重分班后在大师班内广泛传播，随后又平行班也沾染了一些这种腔调。认为有一定道理，不知大家怎么看。感觉这确实很难定义，但确实有这么个东西。它可以是上中腔、九班腔甚至只是我身边的人的口癖。感觉这份东西还是非常主观啊！嗨不过也是写这好玩儿而已。只是一份🌭词典罢了<br>估计也就到1.1就差不多了吧。如果这份东西还能再写一个1.2就真的🌭又fx了。</p><p>$\dagger$表示已经过时或者不常用的词条，$\ddagger$表示含义、出处有较强侮辱性的词条，$\star$表示常用词条</p><h1>拼音缩写对照表</h1><table><thead><tr><th style="text-align:center">缩写</th><th style="text-align:center">中文</th><th style="text-align:center">变体</th></tr></thead><tbody><tr><td style="text-align:center">buc</td><td style="text-align:center">不错</td><td style="text-align:center">bc（不错）</td></tr><tr><td style="text-align:center">bd</td><td style="text-align:center">不懂</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">bzd</td><td style="text-align:center">不知道</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">ee</td><td style="text-align:center">呃呃</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">fx</td><td style="text-align:center">发笑</td><td style="text-align:center">fxfx（发笑发笑）<br />ydfx（有点发笑）</td></tr><tr><td style="text-align:center">hb</td><td style="text-align:center">好吧</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">hd</td><td style="text-align:center">好的</td><td style="text-align:center">hod（吼的（好的的变体））</td></tr><tr><td style="text-align:center">hyys</td><td style="text-align:center">很有意思</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">ii</td><td style="text-align:center">哎哎</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">jwyj</td><td style="text-align:center">经我研究</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">juj</td><td style="text-align:center">拒绝</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">kb</td><td style="text-align:center">可悲</td><td style="text-align:center">kbkb（可悲可悲）<br />ydkb（有点可悲）</td></tr><tr><td style="text-align:center">kknd</td><td style="text-align:center">看看你的</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">kyd</td><td style="text-align:center">可以的</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">kyx</td><td style="text-align:center">看一下</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">nsw</td><td style="text-align:center">脑死亡</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">nk</td><td style="text-align:center">脑控/南京</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">nkr</td><td style="text-align:center">脑控人</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">oo</td><td style="text-align:center">哦哦</td><td style="text-align:center">oO</td></tr><tr><td style="text-align:center">mxd</td><td style="text-align:center">没想到</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">qnjs</td><td style="text-align:center">请你介绍</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">sd</td><td style="text-align:center">是的</td><td style="text-align:center">bsd（不是的）</td></tr><tr><td style="text-align:center">szyd</td><td style="text-align:center">是这样的</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">tina</td><td style="text-align:center">天哪</td><td style="text-align:center">tn（天哪）</td></tr><tr><td style="text-align:center">ylrc</td><td style="text-align:center">原来如此</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">xm</td><td style="text-align:center">羡慕</td><td style="text-align:center"></td></tr><tr><td style="text-align:center">zssm</td><td style="text-align:center">这是什么</td><td style="text-align:center"></td></tr></tbody></table><h1>2. 假文言</h1><h2 id="人称代词-母"><a class="header-anchor" href="#人称代词-母">¶</a>人称代词+母</h2><ul><li>【释义】xx的母亲</li><li>【变体】你母，我母</li><li>【例句】好吧，你母今年贵庚？</li></ul><h2 id="表示程度的词-佳-star"><a class="header-anchor" href="#表示程度的词-佳-star">¶</a>表示程度的词+佳$^\star$</h2><ul><li>【释义】表示对事物的评判，一般不用好、坏，而是用“佳”</li><li>【变体】不佳、极佳、最佳、较佳</li><li>【例句】哎呀，外面天气确不佳。</li></ul><h2 id="何处"><a class="header-anchor" href="#何处">¶</a>何处</h2><ul><li>【释义】在哪里</li><li>【例句】届时具体何处会面，可再研。</li></ul><h2 id="亦-star"><a class="header-anchor" href="#亦-star">¶</a>亦$^\star$</h2><ul><li>【释义】也</li><li>【例句】但他们亦用苹果。</li></ul><h2 id="可-不可-star"><a class="header-anchor" href="#可-不可-star">¶</a>可/不可$^\star$</h2><ul><li>【释义】可以</li><li>【例句】kb，如果有体育，则不可。</li></ul><h1>3. 大词小用</h1><h2 id="部署-star"><a class="header-anchor" href="#部署-star">¶</a>部署$^\star$</h2><ul><li>【释义】筹划，准备，实施</li><li>【例句】哦，明早你起床后部署一下收款。</li><li>【例句】且室友今天还在部署去日本玩的机票。</li></ul><h2 id="会面-star"><a class="header-anchor" href="#会面-star">¶</a>会面$^\star$</h2><ul><li>【释义】见面，碰头</li><li>【例句】届时具体何处会面，可再研。</li></ul><h2 id="昏聩"><a class="header-anchor" href="#昏聩">¶</a>昏聩</h2><ul><li>【释义】昏了头，做出一些荒谬或者愚蠢的事情</li><li>【例句】早上淑芬很昏聩。</li></ul><h2 id="拒绝-star"><a class="header-anchor" href="#拒绝-star">¶</a>拒绝$^\star$</h2><ul><li>【释义】语气词，表示拒绝，但是语气不正式，有点委婉地表示拒绝，常与微信[抱拳]表情包连用</li><li>【例句】拒绝到国权路。</li></ul><h2 id="令人心寒"><a class="header-anchor" href="#令人心寒">¶</a>令人心寒</h2><ul><li>【释义】让人感到寒心，夸张化表述</li></ul><h2 id="视奸"><a class="header-anchor" href="#视奸">¶</a>视奸</h2><ul><li>【释义】偷偷监视</li><li>【词源】双枪小帅对于董行为的描述（经常偷偷在后门监视同学们自修上课是否认真）</li><li>【例句】被你视奸。</li></ul><h2 id="通过-star"><a class="header-anchor" href="#通过-star">¶</a>通过$^\star$</h2><ul><li>【释义】表示赞同</li><li>【近义词】支持</li><li>【例句】可以可以，通过，接受了。</li></ul><h2 id="污名化"><a class="header-anchor" href="#污名化">¶</a>污名化</h2><ul><li>【释义】表示不承认对方对自己的批评，常与拒绝、禁止连用，有时也用于承认自己的批评不妥当</li><li>【词源】中国外交部常用语</li><li>【例句】hd你说的对，污名化一次。</li></ul><h2 id="研究-star"><a class="header-anchor" href="#研究-star">¶</a>研究$^\star$</h2><ul><li>【释义】了解一下</li><li>【变体】研究一下，经我研究</li><li>【例句】所以研究你有无入坑想法。</li></ul><h2 id="支持-star"><a class="header-anchor" href="#支持-star">¶</a>支持$^\star$</h2><ul><li>【释义】表示赞同</li><li>【近义词】通过</li><li>【例句】狠狠支持了。</li></ul><h1>4. 数学相关</h1><h2 id="笛卡尔的茅厕-dagger"><a class="header-anchor" href="#笛卡尔的茅厕-dagger">¶</a>笛卡尔的茅厕$^\dagger$</h2><ul><li>【释义】解析几何</li><li>【词源】笛卡尔为解析几何的创立者。在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</li></ul><h2 id="号角已经吹响-dagger"><a class="header-anchor" href="#号角已经吹响-dagger">¶</a>号角已经吹响$^\dagger$</h2><ul><li>【释义】开始</li><li>【词源】同来源于”大司马杯“号召：“大司马杯的号角已经吹响”。</li></ul><h2 id="数学是思维的体操-dagger"><a class="header-anchor" href="#数学是思维的体操-dagger">¶</a>数学是思维的体操$^\dagger$</h2><ul><li>【释义】数学可以锻炼人的思维，正如体操可以锻炼人的身体</li><li>【词源】来源于公众号“数学是思维的体操”。该公众号管理者是平几吧成员，曾请郭fj同学帮忙做平面几何题。后此公众号的名号经郭fj而在⑨班传播，因名字魔性遂成梗。<br>后面由于音近，有呕人变“体操”为“蕊尻”，更加发笑。</li><li>【变体】数学是思维的蕊尻</li></ul><h2 id="无头苍蝇-dagger"><a class="header-anchor" href="#无头苍蝇-dagger">¶</a>无头苍蝇$^\dagger$</h2><ul><li>【释义】做出无脑行为的人</li><li>【词源】同来源于在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</li></ul><h1>5. 模仿老师</h1><h2 id="像像我和你讲-说"><a class="header-anchor" href="#像像我和你讲-说">¶</a>像像我和你讲/说</h2><ul><li>【释义】发语词，用开玩笑语气表示通知或者规劝对方</li><li>【词源】吴jy老师说话有时有些口吃，她本身口头禅是“像我和你讲”，但应口吃就成了“像像我和你讲”</li></ul><h2 id="you-cross-the-line-dagger"><a class="header-anchor" href="#you-cross-the-line-dagger">¶</a>you cross the line$^\dagger$</h2><ul><li>【释义】你越界了</li><li>【词源】李p老师布置的一张flyer，一组使用高超PS技巧P出来了杰哥帮助同学买东西、解决住宿问题，最终被发现后被批越界</li></ul><h2 id="whip-dagger"><a class="header-anchor" href="#whip-dagger">¶</a>whip$^\dagger$</h2><ul><li>【释义】鞭打</li><li>【词源】李p老师为了解释whip这个词的意思，在教室里展示whip 小f同学</li></ul><h1>6. 其他</h1><h2 id="be-star"><a class="header-anchor" href="#be-star">¶</a>be$^\star$</h2><ul><li>【释义】上海话中的“be”发音的语气词，常与weisa连用，也可写作“beh”</li><li>【词源】高一时，钟zj同学在周日晚自修补先修课作业，在教室大喊一声：“be，什么是线性有关？”</li></ul><h2 id="dismiss-star"><a class="header-anchor" href="#dismiss-star">¶</a>dismiss$^\star$</h2><ul><li>【释义】拒绝，抛弃，绝交，用于开玩笑语气</li><li>【例句】她已经被我dismiss</li></ul><h2 id="保守估计98分-dagger"><a class="header-anchor" href="#保守估计98分-dagger">¶</a>保守估计98分$^\dagger$</h2><ul><li>【释义】表示自己在虚张声势</li><li>【词源】rui同学在某场历史考试结束之后大喊大叫：“保守估计98分”。</li><li>【变体】保守估计</li><li>【例句】今天保守估计基金能挣500</li></ul><h2 id="刺痛"><a class="header-anchor" href="#刺痛">¶</a>刺痛</h2><ul><li>【释义】表示一些事情使心情受到负面影响</li><li>【例句】比如说提起我的高数失败，就是一种刺痛。</li></ul><h2 id="“董”相关-dagger"><a class="header-anchor" href="#“董”相关-dagger">¶</a>“董”相关$^\dagger$</h2><ul><li>【释义】董jq老师衍生出来的一系列词语，例如“不董装董”、“董装不董”</li><li>【词源】高一时董jq老师神出鬼没。有时有人进班级或在后门窥视，让人疑心是董老师，因此称其“不董装董”，自此衍生出来一系列词语</li></ul><h2 id="胡椒-dagger"><a class="header-anchor" href="#胡椒-dagger">¶</a>胡椒$^\dagger$</h2><ul><li>【释义】匿名的显得很牛的人</li><li>【词源】春考之后，英语大佬曹yw同学在英语群里以胡椒的匿名id问老师能不能不做英语作业了。</li></ul><h2 id="基里巴斯-dagger"><a class="header-anchor" href="#基里巴斯-dagger">¶</a>基里巴斯$^\dagger$</h2><ul><li>【释义】时空错乱，倒时差</li><li>【词源】Cosmo同学在数学考前复习语文，语文考前复习数学，时空错乱，像是生活在横跨日界线的基里巴斯一样</li></ul><h2 id="看看你的-star"><a class="header-anchor" href="#看看你的-star">¶</a>看看你的$^\star$</h2><ul><li>【释义】看看对方的情况</li><li>【例句】[发送了一张图片，是一个量表]看看你的！</li></ul><h2 id="口区-dagger"><a class="header-anchor" href="#口区-dagger">¶</a>口区$^\dagger$</h2><ul><li>【释义】表示恶心</li><li>【词源】“呕”这个字拆开来，来源于孙m同学，rui同学最爱用，后来风靡开来了</li><li>【变体】呕（先有的“口区”，再有的“呕”）</li></ul><h2 id="蓝奶酪-dagger-ddagger"><a class="header-anchor" href="#蓝奶酪-dagger-ddagger">¶</a>蓝奶酪${^\dagger} {^\ddagger}$</h2><ul><li>【释义】味道恶臭的物品。</li><li>【词源】来自高二地理课张yt发现所坐座位有恶臭，经沈ty研究恶臭来源为龚zr的自制酸奶，故用同为恶臭奶制品的蓝奶酪代指。</li></ul><h2 id="某巨-dagger"><a class="header-anchor" href="#某巨-dagger">¶</a>某巨$^\dagger$</h2><ul><li>【释义】对厉害的人的尊称</li><li>【例词】郭巨</li></ul><h2 id="谬误"><a class="header-anchor" href="#谬误">¶</a>谬误</h2><ul><li>【释义】表示用轻松的语气对某人的批评，常与完全连用</li><li>【例句】我又发现了一些小谬误。</li></ul><h2 id="你好-star"><a class="header-anchor" href="#你好-star">¶</a>你好$^\star$</h2><ul><li>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与“同学”、“请”连用</li><li>【例句】你好，请飞来北京看。</li></ul><h2 id="脑控"><a class="header-anchor" href="#脑控">¶</a>脑控</h2><ul><li>【释义】嘲讽对方做了一些比较荒谬的事情</li><li>【词源】原出处已散逸，或许来源于廖凯原的《轩辕反熵运行体系》，或许来源于网上关于脑控的发笑阴谋论</li></ul><h2 id="脑死亡-star"><a class="header-anchor" href="#脑死亡-star">¶</a>脑死亡$^\star$</h2><ul><li>【释义】做了一些荒谬或者略微有点愚蠢、没有逻辑的事情，可以形容自己或者别人，贬义。常与热狗连用。</li><li>【词源】来源于《破道计划》（郭xj著）“所有人眼前一黑，全部倒下，他们的大脑承载了本不该承载的东西，全部陷入了脑死亡。”</li><li>【变体】nsw、脑死亡一次、nsw吧、脑死、眼前一黑，陷入脑死亡</li><li>【例句】我今天早上11:15起床已经nsw！</li></ul><h2 id="Odeur-dagger"><a class="header-anchor" href="#Odeur-dagger">¶</a>Odeur$^\dagger$</h2><ul><li>【释义】匿名者</li><li>【词源】网课期间，沈ty同学以Odeur的化名出没于各个腾讯会议会议室</li></ul><h2 id="然而"><a class="header-anchor" href="#然而">¶</a>然而</h2><ul><li>【释义】表示转折</li><li>【例句】然而：我可悲。</li></ul><h2 id="热狗-star"><a class="header-anchor" href="#热狗-star">¶</a>热狗$^\star$</h2><ul><li>【释义】表示做事不太聪明又有点可爱发笑，可作为名词、形容词、副词、语气词使用</li><li>【词源】高一义卖高sm同学提议可以卖热狗，后虽热狗因卫生原因被否，但是高sm同学读“热狗”的口音流传了下来</li><li>【变体】热狗人，🌭，🌭吧，小热狗以及众多表情包的形式</li><li>【例句】这也是为什么有小热狗喜欢iPad mini。</li></ul><h2 id="请-star"><a class="header-anchor" href="#请-star">¶</a>请$^\star$</h2><ul><li>【释义】发语词，表示接下来说的内容将以一种戏剧化或者夸张化的语气，有时用来表达比较轻松语气的请教，常与同学、你好连用</li><li>【例句】请你加速！</li></ul><h2 id="事实上"><a class="header-anchor" href="#事实上">¶</a>事实上</h2><ul><li>【释义】in fact，也不知为何常被拿来发语，语言非常欧化呐</li><li>【例句】事实上我后天早上说不定也要从交大出发。</li></ul><h2 id="同学-star"><a class="header-anchor" href="#同学-star">¶</a>同学$^\star$</h2><ul><li>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与请、你好连用、注意</li><li>【例句】同学，你有些发笑。</li></ul><h2 id="tsosnymud-dagger"><a class="header-anchor" href="#tsosnymud-dagger">¶</a>tsosnymud$^\dagger$</h2><ul><li>【释义】“操死你妈的”用外国人口音读出来</li><li>【词源】来源于章jh同学对“操你妈的”进行加强，并且用更顺口的语气说出来。</li></ul><h2 id="完全"><a class="header-anchor" href="#完全">¶</a>完全</h2><ul><li>【释义】表示夸张化的否定</li><li>【例句】完全错误！</li></ul><h2 id="显然-star"><a class="header-anchor" href="#显然-star">¶</a>显然$^\star$</h2><ul><li>【释义】表示夸张化的语气</li><li>【例句】我显然追求最佳显示效果。</li></ul><h2 id="一次-star"><a class="header-anchor" href="#一次-star">¶</a>一次$^\star$</h2><ul><li>【释义】用于自嘲，常与发笑、热狗连用</li><li>【例句】🌭一次</li></ul><h2 id="智慧"><a class="header-anchor" href="#智慧">¶</a>智慧</h2><ul><li>【释义】常用于自夸，其否定形式常常表示轻松语气的批评</li><li>【例句】我是智慧的。</li><li>【例句】大不智慧！</li></ul><h2 id="中情局-dagger"><a class="header-anchor" href="#中情局-dagger">¶</a>中情局$^\dagger$</h2><ul><li>【释义】偷看英语默写答案</li><li>【词源】高一时钟zj同学作为英语课代表，是及时雨中的普罗米修斯，他从老师或者隔壁同学那里盗来答案，史称中情局。</li></ul><h2 id="注意-star"><a class="header-anchor" href="#注意-star">¶</a>注意$^\star$</h2><ul><li>【释义】表示提醒对方说错话或者做事荒谬，常与“智力”连用</li><li>【例句】注意！到虹桥只需1h5min。</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;前言&lt;/h1&gt;
&lt;h2 id=&quot;v1-0&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#v1-0&quot;&gt;¶&lt;/a&gt;v1.0&lt;/h2&gt;
&lt;p&gt;写这一份上中腔词典的原因是一时兴起。其实很难说我这里所说的“上中腔”的具体定义是什么。说是上中腔，但又主要是大师班的</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="校园/School" scheme="https://ryanstarfox.github.io/tags/%E6%A0%A1%E5%9B%AD-School/"/>
    
    <category term="高中/High School" scheme="https://ryanstarfox.github.io/tags/%E9%AB%98%E4%B8%AD-High-School/"/>
    
  </entry>
  
  <entry>
    <title>fxlego大典v1.0</title>
    <link href="https://ryanstarfox.github.io/2024/07/28/2024/20240728%20%E4%B8%8A%E4%B8%AD%E8%85%94%E8%AF%8D%E5%85%B8v1.0/"/>
    <id>https://ryanstarfox.github.io/2024/07/28/2024/20240728%20%E4%B8%8A%E4%B8%AD%E8%85%94%E8%AF%8D%E5%85%B8v1.0/</id>
    <published>2024-07-28T08:19:00.000Z</published>
    <updated>2024-07-28T08:19:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>fxlego大典v1.0</h1><p><strong>写这一份上中腔词典的原因是一时兴起。其实很难说我这里所说的“上中腔”的具体定义是什么。说是上中腔，但又主要是大师班的同学常用，但别的班也有一批同学会用。说是大师班的同学常用，但又主要是大师班的男生在用，女生们也会用其中的一些表述，但不多。为了简单起见，还是称其为上中腔好了。写这份东西写主要是图一乐，回顾一下以前的一些已经成为典故的趣事，不可当真。用上中腔的表述来说，这份东西其实非常🌭，ydfx。编写这份东西的时候，毛哥和Nababa同学给我提供了很多帮助，他们是我的第一批读者，帮助我扩充了一些词条，也回忆了有意思的故事，其中Nababa同学还帮我写了一些我不是很熟悉的词条。感谢zjh同学，在发布前夕又补充了大量词条。也感谢myj，sty同学，从他们那里我也了解到更多的一些我不熟悉的词条和它们的词源典故。以下的词条的例句来源于我与同学的聊天记录，感谢这些聊天记录！这些必然包含着我的片面性与局限性，欢迎扩充更多词条以及修订词条！</strong></p><p><strong>\dagger</strong>表示已经过时或者不常用的词条，<strong>\ddagger</strong>表示含义、出处有较强侮辱性的词条，<strong>\star</strong>表示常用词条</p><h1>拼音缩写对照表</h1><table><thead><tr><th><strong>缩写</strong></th><th><strong>中文</strong></th><th><strong>变体</strong></th></tr></thead><tbody><tr><td><strong>buc</strong></td><td><strong>不错</strong></td><td><strong>bc（不错）</strong></td></tr><tr><td><strong>bd</strong></td><td><strong>不懂</strong></td><td></td></tr><tr><td><strong>bzd</strong></td><td><strong>不知道</strong></td><td></td></tr><tr><td><strong>ee</strong></td><td><strong>呃呃</strong></td><td></td></tr><tr><td><strong>fx</strong></td><td><strong>发笑</strong></td><td><strong>fxfx（发笑发笑）</strong> <strong>ydfx（有点发笑）</strong></td></tr><tr><td><strong>hb</strong></td><td><strong>好吧</strong></td><td></td></tr><tr><td><strong>hd</strong></td><td><strong>好的</strong></td><td><strong>hod（吼的（好的的变体））</strong></td></tr><tr><td><strong>hyys</strong></td><td><strong>很有意思</strong></td><td></td></tr><tr><td><strong>ii</strong></td><td><strong>哎哎</strong></td><td></td></tr><tr><td><strong>jwyj</strong></td><td><strong>经我研究</strong></td><td></td></tr><tr><td><strong>juj</strong></td><td><strong>拒绝</strong></td><td></td></tr><tr><td><strong>kb</strong></td><td><strong>可悲</strong></td><td><strong>kbkb（可悲可悲）</strong> <strong>ydkb（有点可悲）</strong></td></tr><tr><td><strong>kknd</strong></td><td><strong>看看你的</strong></td><td></td></tr><tr><td><strong>kyd</strong></td><td><strong>可以的</strong></td><td></td></tr><tr><td><strong>kyx</strong></td><td><strong>看一下</strong></td><td></td></tr><tr><td><strong>nsw</strong></td><td><strong>脑死亡</strong></td><td></td></tr><tr><td><strong>nk</strong></td><td><strong>脑控/南京</strong></td><td></td></tr><tr><td><strong>nkr</strong></td><td><strong>脑控人</strong></td><td></td></tr><tr><td><strong>mxd</strong></td><td><strong>没想到</strong></td><td></td></tr><tr><td><strong>qnjs</strong></td><td><strong>请你介绍</strong></td><td></td></tr><tr><td><strong>sd</strong></td><td><strong>是的</strong></td><td><strong>bsd（不是的）</strong></td></tr><tr><td><strong>szyd</strong></td><td><strong>是这样的</strong></td><td></td></tr><tr><td><strong>tina</strong></td><td><strong>天哪</strong></td><td><strong>tn（天哪）</strong></td></tr><tr><td><strong>ylrc</strong></td><td><strong>原来如此</strong></td><td></td></tr><tr><td><strong>xm</strong></td><td><strong>羡慕</strong></td><td></td></tr><tr><td><strong>zssm</strong></td><td><strong>这是什么</strong></td><td></td></tr></tbody></table><h1>2. 假文言</h1><h2 id="人称代词-母"><a class="header-anchor" href="#人称代词-母">¶</a>人称代词+母</h2><ul><li><strong>【释义】xx的母亲</strong></li><li><strong>【变体】你母，我母</strong></li><li><strong>【例句】好吧，你母今年贵庚？</strong></li></ul><h2 id="表示程度的词-佳-star"><a class="header-anchor" href="#表示程度的词-佳-star">¶</a>表示程度的词+佳**^\star**</h2><ul><li><strong>【释义】表示对事物的评判，一般不用好、坏，而是用“佳”</strong></li><li><strong>【变体】不佳、极佳、最佳、较佳</strong></li><li><strong>【例句】哎呀，外面天气确不佳。</strong></li></ul><h2 id="何处"><a class="header-anchor" href="#何处">¶</a>何处</h2><ul><li><strong>【释义】在哪里</strong></li><li><strong>【例句】届时具体何处会面，可再研。</strong></li></ul><h2 id="亦-star"><a class="header-anchor" href="#亦-star">¶</a>亦**^\star**</h2><ul><li><strong>【释义】也</strong></li><li><strong>【例句】但他们亦用苹果。</strong></li></ul><h2 id="可-不可-star"><a class="header-anchor" href="#可-不可-star">¶</a>可/不可**^\star**</h2><ul><li><strong>【释义】可以</strong></li><li><strong>【例句】kb，如果有体育，则不可。</strong></li></ul><h1>3. 大词小用</h1><h2 id="部署"><a class="header-anchor" href="#部署">¶</a>部署</h2><ul><li><strong>【释义】筹划，准备，实施</strong></li><li><strong>【例句】哦，明早你起床后部署一下收款。</strong></li><li><strong>【例句】且室友今天还在部署去日本玩的机票。</strong></li></ul><h2 id="会面-star"><a class="header-anchor" href="#会面-star">¶</a>会面**^\star**</h2><ul><li><strong>【释义】见面，碰头</strong></li><li><strong>【例句】届时具体何处会面，可再研。</strong></li></ul><h2 id="昏聩"><a class="header-anchor" href="#昏聩">¶</a>昏聩</h2><ul><li><strong>【释义】昏了头，做出一些荒谬或者愚蠢的事情</strong></li><li><strong>【例句】早上淑芬很昏聩。</strong></li></ul><h2 id="拒绝-star"><a class="header-anchor" href="#拒绝-star">¶</a>拒绝**^\star**</h2><ul><li><strong>【释义】语气词，表示拒绝，但是语气不正式，有点委婉地表示拒绝，常与微信[抱拳]表情包连用</strong></li><li><strong>【例句】拒绝到国权路。</strong></li></ul><h2 id="通过-star"><a class="header-anchor" href="#通过-star">¶</a>通过**^\star**</h2><ul><li><strong>【释义】表示赞同</strong></li><li><strong>【近义词】支持</strong></li><li><strong>【例句】可以可以，通过，接受了。</strong></li></ul><h2 id="污名化"><a class="header-anchor" href="#污名化">¶</a>污名化</h2><ul><li><strong>【释义】表示不承认对方对自己的批评，常与拒绝、禁止连用，有时也用于承认自己的批评不妥当</strong></li><li><strong>【词源】中国外交部常用语</strong></li><li><strong>【例句】hd你说的对，污名化一次。</strong></li></ul><h2 id="研究-star"><a class="header-anchor" href="#研究-star">¶</a>研究**^\star**</h2><ul><li><strong>【释义】了解一下</strong></li><li><strong>【变体】研究一下，经我研究</strong></li><li><strong>【例句】所以研究你有无入坑想法。</strong></li></ul><h2 id="支持-star"><a class="header-anchor" href="#支持-star">¶</a>支持**^\star**</h2><ul><li><strong>【释义】表示赞同</strong></li><li><strong>【近义词】通过</strong></li><li><strong>【例句】狠狠支持了。</strong></li></ul><h2 id="4-数学相关"><a class="header-anchor" href="#4-数学相关">¶</a>4. 数学相关</h2><h2 id="笛卡尔的茅厕-dagger"><a class="header-anchor" href="#笛卡尔的茅厕-dagger">¶</a>笛卡尔的茅厕**^\dagger**</h2><ul><li><strong>【释义】解析几何</strong></li><li><strong>【词源】笛卡尔为解析几何的创立者。在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</strong></li></ul><h2 id="号角已经吹响-dagger"><a class="header-anchor" href="#号角已经吹响-dagger">¶</a>号角已经吹响**^\dagger**</h2><ul><li><strong>【释义】开始</strong></li><li><strong>【词源】同来源于”大司马杯“号召：“大司马杯的号角已经吹响”。</strong></li></ul><h2 id="无头苍蝇-dagger"><a class="header-anchor" href="#无头苍蝇-dagger">¶</a>无头苍蝇**^\dagger**</h2><ul><li><strong>【释义】做出无脑行为的人</strong></li><li><strong>【词源】同来源于在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</strong></li></ul><h1>5. 模仿老师</h1><h2 id="像像我和你讲-说"><a class="header-anchor" href="#像像我和你讲-说">¶</a>像像我和你讲/说</h2><ul><li><strong>【释义】发语词，用开玩笑语气表示通知或者规劝对方</strong></li><li><strong>【词源】吴jy老师说话有时有些口吃，她本身口头禅是“像我和你讲”，但应口吃就成了“像像我和你讲”</strong></li></ul><h2 id="you-cross-the-line-dagger"><a class="header-anchor" href="#you-cross-the-line-dagger">¶</a>you cross the line**^\dagger**</h2><ul><li><strong>【释义】你越界了</strong></li><li><strong>【词源】李p老师布置的一张flyer，一组使用高超PS技巧P出来了杰哥帮助同学买东西、解决住宿问题，最终被发现后被批越界</strong></li></ul><h2 id="whip-dagger"><a class="header-anchor" href="#whip-dagger">¶</a>whip**^\dagger**</h2><ul><li><strong>【释义】鞭打</strong></li><li><strong>【词源】李p老师为了解释whip这个词的意思，在教室里展示whip 小f同学</strong></li></ul><h1>6. 其他</h1><h2 id="be-star"><a class="header-anchor" href="#be-star">¶</a>be**^\star**</h2><ul><li><strong>【释义】上海话中的“be”发音的语气词，常与weisa连用，也可写作“beh”</strong></li><li><strong>【词源】高一时，钟zj同学在周日晚自修补先修课作业，在教室大喊一声：“be，什么是线性有关？”</strong></li></ul><h2 id="保守估计98分-dagger"><a class="header-anchor" href="#保守估计98分-dagger">¶</a>保守估计98分**^\dagger**</h2><ul><li><strong>【释义】表示自己在虚张声势</strong></li><li><strong>【词源】rui同学在某场物理考试结束之后大喊大叫：“保守估计98分”。</strong></li></ul><h2 id="刺痛"><a class="header-anchor" href="#刺痛">¶</a>刺痛</h2><ul><li><strong>【释义】表示一些事情使心情受到负面影响</strong></li><li><strong>【例句】比如说提起我的高数失败，就是一种刺痛。</strong></li></ul><h2 id="tsosnymud-dagger"><a class="header-anchor" href="#tsosnymud-dagger">¶</a>tsosnymud**^\dagger**</h2><ul><li><strong>【释义】“操死你妈的”用外国人口音读出来</strong></li><li><strong>【词源】来源于章jh同学对“操你妈的”进行加强，并且用更顺口的语气说出来。</strong></li></ul><h2 id="“董”相关-dagger"><a class="header-anchor" href="#“董”相关-dagger">¶</a>“董”相关**^\dagger**</h2><ul><li><strong>【释义】董jq老师衍生出来的一系列词语，例如“不董装董”、“董装不董”</strong></li><li><strong>【词源】高一时董jq老师神出鬼没。有时有人进班级或在后门窥视，让人疑心是董老师，因此称其“不董装董”，自此衍生出来一系列词语</strong></li></ul><h2 id="胡椒-dagger"><a class="header-anchor" href="#胡椒-dagger">¶</a>胡椒**^\dagger**</h2><ul><li><strong>【释义】匿名的显得很牛的人</strong></li><li><strong>【词源】春考之后，英语大佬曹yw同学在英语群里以胡椒的匿名id问老师能不能不做英语作业了。</strong></li></ul><h2 id="基里巴斯-dagger"><a class="header-anchor" href="#基里巴斯-dagger">¶</a>基里巴斯**^\dagger**</h2><ul><li><strong>【释义】时空错乱，倒时差</strong></li><li><strong>【词源】Cosmo同学在数学考前复习语文，语文考前复习数学，时空错乱，像是生活在横跨日界线的基里巴斯一样</strong></li></ul><h2 id="看看你的-star"><a class="header-anchor" href="#看看你的-star">¶</a>看看你的**^\star**</h2><ul><li><strong>【释义】看看对方的情况</strong></li><li><strong>【例句】[发送了一张图片，是一个量表]看看你的！</strong></li></ul><h2 id="口区-dagger"><a class="header-anchor" href="#口区-dagger">¶</a>口区**^\dagger**</h2><ul><li><strong>【释义】表示恶心</strong></li><li><strong>【词源】“呕”这个字拆开来，来源于孙m同学，rui同学最爱用，后来风靡开来了</strong></li><li><strong>【变体】呕（先有的“口区”，再有的“呕”）</strong></li></ul><h2 id="蓝奶酪"><a class="header-anchor" href="#蓝奶酪">¶</a>蓝奶酪****</h2><ul><li><strong>【释义】味道恶臭的物品。</strong></li><li><strong>【词源】来自高二地理课张yt发现所坐座位有恶臭，经沈ty研究恶臭来源为龚zr的自制酸奶，故用同为恶臭奶制品的蓝奶酪代指。</strong></li></ul><h2 id="某巨-dagger"><a class="header-anchor" href="#某巨-dagger">¶</a>某巨**^\dagger**</h2><ul><li><strong>【释义】对厉害的人的尊称</strong></li><li><strong>【例词】郭巨</strong></li></ul><h2 id="谬误"><a class="header-anchor" href="#谬误">¶</a>谬误</h2><ul><li><strong>【释义】表示用轻松的语气对某人的批评，常与完全连用</strong></li><li><strong>【例句】我又发现了一些小谬误。</strong></li></ul><h2 id="你好"><a class="header-anchor" href="#你好">¶</a>你好</h2><ul><li><strong>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与“同学”、“请”连用</strong></li><li><strong>【例句】你好，请飞来北京看。</strong></li></ul><h2 id="脑控"><a class="header-anchor" href="#脑控">¶</a>脑控</h2><ul><li><strong>【释义】嘲讽对方做了一些比较荒谬的事情</strong></li><li><strong>【词源】原出处已散逸，或许来源于廖凯原的《轩辕反熵运行体系》，或许来源于网上关于脑控的发笑阴谋论</strong></li></ul><h2 id="脑死亡-star"><a class="header-anchor" href="#脑死亡-star">¶</a>脑死亡**^\star**</h2><ul><li><strong>【释义】做了一些荒谬或者略微有点愚蠢、没有逻辑的事情，可以形容自己或者别人，贬义。常与热狗连用。</strong></li><li><strong>【词源】来源于《破道计划》（郭xj著）“所有人眼前一黑，全部倒下，他们的大脑承载了本不该承载的东西，全部陷入了脑死亡。”</strong></li><li><strong>【变体】nsw、脑死亡一次、nsw吧、脑死、眼前一黑，陷入脑死亡</strong></li><li><strong>【例句】我今天早上11:15起床已经nsw！</strong></li></ul><h2 id="Odeur-dagger"><a class="header-anchor" href="#Odeur-dagger">¶</a>Odeur**^\dagger**</h2><ul><li><strong>【释义】匿名者</strong></li><li><strong>【词源】网课期间，沈ty同学以Odeur的化名出没于各个腾讯会议会议室</strong></li></ul><h2 id="然而"><a class="header-anchor" href="#然而">¶</a>然而</h2><ul><li><strong>【释义】表示转折</strong></li><li><strong>【例句】然而：我可悲。</strong></li></ul><h2 id="热狗-star"><a class="header-anchor" href="#热狗-star">¶</a>热狗**^\star**</h2><ul><li><strong>【释义】表示做事不太聪明又有点可爱发笑，可作为名词、形容词、副词、语气词使用</strong></li><li><strong>【词源】高一义卖高sm同学提议可以卖热狗，后虽热狗因卫生原因被否，但是高sm同学读“热狗”的口音流传了下来</strong></li><li><strong>【变体】热狗人，🌭，🌭吧，小热狗以及众多表情包的形式</strong></li><li><strong>【例句】这也是为什么有小热狗喜欢iPad mini。</strong></li></ul><h2 id="请"><a class="header-anchor" href="#请">¶</a>请</h2><ul><li><strong>【释义】发语词，表示接下来说的内容将以一种戏剧化或者夸张化的语气，有时用来表达比较轻松语气的请教，常与同学、你好连用</strong></li><li><strong>【例句】请你加速！</strong></li></ul><h2 id="事实上"><a class="header-anchor" href="#事实上">¶</a>事实上</h2><ul><li><strong>【释义】in fact，也不知为何常被拿来发语，语言非常欧化呐</strong></li><li><strong>【例句】事实上我后天早上说不定也要从交大出发。</strong></li></ul><h2 id="同学"><a class="header-anchor" href="#同学">¶</a>同学</h2><ul><li><strong>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与请、你好连用、注意</strong></li><li><strong>【例句】同学，你有些发笑。</strong></li></ul><h2 id="完全"><a class="header-anchor" href="#完全">¶</a>完全</h2><ul><li><strong>【释义】表示夸张化的否定</strong></li><li><strong>【例句】完全错误！</strong></li></ul><h2 id="显然"><a class="header-anchor" href="#显然">¶</a>显然</h2><ul><li><strong>【释义】表示夸张化的语气</strong></li><li><strong>【例句】我显然追求最佳显示效果。</strong></li></ul><h2 id="一次"><a class="header-anchor" href="#一次">¶</a>一次</h2><ul><li><strong>【释义】用于自嘲，常与发笑、热狗连用</strong></li><li><strong>【例句】🌭一次</strong></li></ul><h2 id="智慧"><a class="header-anchor" href="#智慧">¶</a>智慧</h2><ul><li><strong>【释义】常用于自夸，其否定形式常常表示轻松语气的批评</strong></li><li><strong>【例句】我是智慧的。</strong></li><li><strong>【例句】大不智慧！</strong></li></ul><p><strong>## <strong>中情局</strong>^\dagger</strong></p><ul><li><strong>【释义】偷看英语默写答案</strong></li><li><strong>【词源】高一时钟zj同学作为英语课代表，是及时雨中的普罗米修斯，他从老师或者隔壁同学那里盗来答案，史称中情局。</strong></li></ul><h2 id="注意-star"><a class="header-anchor" href="#注意-star">¶</a>注意**^\star**</h2><ul><li><strong>【释义】表示提醒对方说错话或者做事荒谬，常与“智力”连用</strong></li><li><strong>【例句】注意！到虹桥只需1h5min。</strong></li></ul><p><strong>写这一份上中腔词典的原因是一时兴起。其实很难说我这里所说的“上中腔”的具体定义是什么。说是上中腔，但又主要是大师班的同学常用，但别的班也有一批同学会用。说是大师班的同学常用，但又主要是大师班的男生在用，女生们也会用其中的一些表述，但不多。为了简单起见，还是称其为上中腔好了。写这份东西写主要是图一乐，回顾一下以前的一些已经成为典故的趣事，不可当真。用上中腔的表述来说，这份东西其实非常🌭，ydfx。编写这份东西的时候，毛哥和Nababa同学给我提供了很多帮助，他们是我的第一批读者，帮助我扩充了一些词条，也回忆了有意思的故事，其中Nababa同学还帮我写了一些我不是很熟悉的词条。感谢zjh同学，在发布前夕又补充了大量词条。也感谢myj，sty同学，从他们那里我也了解到更多的一些我不熟悉的词条和它们的词源典故。以下的词条的例句来源于我与同学的聊天记录，感谢这些聊天记录！这些必然包含着我的片面性与局限性，欢迎扩充更多词条以及修订词条！</strong></p><p><strong>\dagger</strong>表示已经过时或者不常用的词条，<strong>\ddagger</strong>表示含义、出处有较强侮辱性的词条，<strong>\star</strong>表示常用词条</p><h1>拼音缩写对照表</h1><table><thead><tr><th><strong>缩写</strong></th><th><strong>中文</strong></th><th><strong>变体</strong></th></tr></thead><tbody><tr><td><strong>buc</strong></td><td><strong>不错</strong></td><td><strong>bc（不错）</strong></td></tr><tr><td><strong>bd</strong></td><td><strong>不懂</strong></td><td></td></tr><tr><td><strong>bzd</strong></td><td><strong>不知道</strong></td><td></td></tr><tr><td><strong>ee</strong></td><td><strong>呃呃</strong></td><td></td></tr><tr><td><strong>fx</strong></td><td><strong>发笑</strong></td><td><strong>fxfx（发笑发笑）</strong> <strong>ydfx（有点发笑）</strong></td></tr><tr><td><strong>hb</strong></td><td><strong>好吧</strong></td><td></td></tr><tr><td><strong>hd</strong></td><td><strong>好的</strong></td><td><strong>hod（吼的（好的的变体））</strong></td></tr><tr><td><strong>hyys</strong></td><td><strong>很有意思</strong></td><td></td></tr><tr><td><strong>ii</strong></td><td><strong>哎哎</strong></td><td></td></tr><tr><td><strong>jwyj</strong></td><td><strong>经我研究</strong></td><td></td></tr><tr><td><strong>juj</strong></td><td><strong>拒绝</strong></td><td></td></tr><tr><td><strong>kb</strong></td><td><strong>可悲</strong></td><td><strong>kbkb（可悲可悲）</strong> <strong>ydkb（有点可悲）</strong></td></tr><tr><td><strong>kknd</strong></td><td><strong>看看你的</strong></td><td></td></tr><tr><td><strong>kyd</strong></td><td><strong>可以的</strong></td><td></td></tr><tr><td><strong>kyx</strong></td><td><strong>看一下</strong></td><td></td></tr><tr><td><strong>nsw</strong></td><td><strong>脑死亡</strong></td><td></td></tr><tr><td><strong>nk</strong></td><td><strong>脑控/南京</strong></td><td></td></tr><tr><td><strong>nkr</strong></td><td><strong>脑控人</strong></td><td></td></tr><tr><td><strong>mxd</strong></td><td><strong>没想到</strong></td><td></td></tr><tr><td><strong>qnjs</strong></td><td><strong>请你介绍</strong></td><td></td></tr><tr><td><strong>sd</strong></td><td><strong>是的</strong></td><td><strong>bsd（不是的）</strong></td></tr><tr><td><strong>szyd</strong></td><td><strong>是这样的</strong></td><td></td></tr><tr><td><strong>tina</strong></td><td><strong>天哪</strong></td><td><strong>tn（天哪）</strong></td></tr><tr><td><strong>ylrc</strong></td><td><strong>原来如此</strong></td><td></td></tr><tr><td><strong>xm</strong></td><td><strong>羡慕</strong></td><td></td></tr><tr><td><strong>zssm</strong></td><td><strong>这是什么</strong></td><td></td></tr></tbody></table><h1>2. 假文言</h1><h2 id="人称代词-母-2"><a class="header-anchor" href="#人称代词-母-2">¶</a>人称代词+母</h2><ul><li><strong>【释义】xx的母亲</strong></li><li><strong>【变体】你母，我母</strong></li><li><strong>【例句】好吧，你母今年贵庚？</strong></li></ul><h2 id="表示程度的词-佳-star-2"><a class="header-anchor" href="#表示程度的词-佳-star-2">¶</a>表示程度的词+佳**^\star**</h2><ul><li><strong>【释义】表示对事物的评判，一般不用好、坏，而是用“佳”</strong></li><li><strong>【变体】不佳、极佳、最佳、较佳</strong></li><li><strong>【例句】哎呀，外面天气确不佳。</strong></li></ul><h2 id="何处-2"><a class="header-anchor" href="#何处-2">¶</a>何处</h2><ul><li><strong>【释义】在哪里</strong></li><li><strong>【例句】届时具体何处会面，可再研。</strong></li></ul><h2 id="亦-star-2"><a class="header-anchor" href="#亦-star-2">¶</a>亦**^\star**</h2><ul><li><strong>【释义】也</strong></li><li><strong>【例句】但他们亦用苹果。</strong></li></ul><h2 id="可-不可-star-2"><a class="header-anchor" href="#可-不可-star-2">¶</a>可/不可**^\star**</h2><ul><li><strong>【释义】可以</strong></li><li><strong>【例句】kb，如果有体育，则不可。</strong></li></ul><h1>3. 大词小用</h1><h2 id="部署-2"><a class="header-anchor" href="#部署-2">¶</a>部署</h2><ul><li><strong>【释义】筹划，准备，实施</strong></li><li><strong>【例句】哦，明早你起床后部署一下收款。</strong></li><li><strong>【例句】且室友今天还在部署去日本玩的机票。</strong></li></ul><h2 id="会面-star-2"><a class="header-anchor" href="#会面-star-2">¶</a>会面**^\star**</h2><ul><li><strong>【释义】见面，碰头</strong></li><li><strong>【例句】届时具体何处会面，可再研。</strong></li></ul><h2 id="昏聩-2"><a class="header-anchor" href="#昏聩-2">¶</a>昏聩</h2><ul><li><strong>【释义】昏了头，做出一些荒谬或者愚蠢的事情</strong></li><li><strong>【例句】早上淑芬很昏聩。</strong></li></ul><h2 id="拒绝-star-2"><a class="header-anchor" href="#拒绝-star-2">¶</a>拒绝**^\star**</h2><ul><li><strong>【释义】语气词，表示拒绝，但是语气不正式，有点委婉地表示拒绝，常与微信[抱拳]表情包连用</strong></li><li><strong>【例句】拒绝到国权路。</strong></li></ul><h2 id="通过-star-2"><a class="header-anchor" href="#通过-star-2">¶</a>通过**^\star**</h2><ul><li><strong>【释义】表示赞同</strong></li><li><strong>【近义词】支持</strong></li><li><strong>【例句】可以可以，通过，接受了。</strong></li></ul><h2 id="污名化-2"><a class="header-anchor" href="#污名化-2">¶</a>污名化</h2><ul><li><strong>【释义】表示不承认对方对自己的批评，常与拒绝、禁止连用，有时也用于承认自己的批评不妥当</strong></li><li><strong>【词源】中国外交部常用语</strong></li><li><strong>【例句】hd你说的对，污名化一次。</strong></li></ul><h2 id="研究-star-2"><a class="header-anchor" href="#研究-star-2">¶</a>研究**^\star**</h2><ul><li><strong>【释义】了解一下</strong></li><li><strong>【变体】研究一下，经我研究</strong></li><li><strong>【例句】所以研究你有无入坑想法。</strong></li></ul><h2 id="支持-star-2"><a class="header-anchor" href="#支持-star-2">¶</a>支持**^\star**</h2><ul><li><strong>【释义】表示赞同</strong></li><li><strong>【近义词】通过</strong></li><li><strong>【例句】狠狠支持了。</strong></li></ul><h2 id="4-数学相关-2"><a class="header-anchor" href="#4-数学相关-2">¶</a>4. 数学相关</h2><h2 id="笛卡尔的茅厕-dagger-2"><a class="header-anchor" href="#笛卡尔的茅厕-dagger-2">¶</a>笛卡尔的茅厕**^\dagger**</h2><ul><li><strong>【释义】解析几何</strong></li><li><strong>【词源】笛卡尔为解析几何的创立者。在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</strong></li></ul><h2 id="号角已经吹响-dagger-2"><a class="header-anchor" href="#号角已经吹响-dagger-2">¶</a>号角已经吹响**^\dagger**</h2><ul><li><strong>【释义】开始</strong></li><li><strong>【词源】同来源于”大司马杯“号召：“大司马杯的号角已经吹响”。</strong></li></ul><h2 id="无头苍蝇-dagger-2"><a class="header-anchor" href="#无头苍蝇-dagger-2">¶</a>无头苍蝇**^\dagger**</h2><ul><li><strong>【释义】做出无脑行为的人</strong></li><li><strong>【词源】同来源于在郭fj同学的纯几何杯赛”大司马杯“号召中，提到：“笛卡尔的茅厕吸引了许多无头苍蝇”。</strong></li></ul><h1>5. 模仿老师</h1><h2 id="像像我和你讲-说-2"><a class="header-anchor" href="#像像我和你讲-说-2">¶</a>像像我和你讲/说</h2><ul><li><strong>【释义】发语词，用开玩笑语气表示通知或者规劝对方</strong></li><li><strong>【词源】吴jy老师说话有时有些口吃，她本身口头禅是“像我和你讲”，但应口吃就成了“像像我和你讲”</strong></li></ul><h2 id="you-cross-the-line-dagger-2"><a class="header-anchor" href="#you-cross-the-line-dagger-2">¶</a>you cross the line**^\dagger**</h2><ul><li><strong>【释义】你越界了</strong></li><li><strong>【词源】李p老师布置的一张flyer，一组使用高超PS技巧P出来了杰哥帮助同学买东西、解决住宿问题，最终被发现后被批越界</strong></li></ul><h2 id="whip-dagger-2"><a class="header-anchor" href="#whip-dagger-2">¶</a>whip**^\dagger**</h2><ul><li><strong>【释义】鞭打</strong></li><li><strong>【词源】李p老师为了解释whip这个词的意思，在教室里展示whip 小f同学</strong></li></ul><h1>6. 其他</h1><h2 id="be-star-2"><a class="header-anchor" href="#be-star-2">¶</a>be**^\star**</h2><ul><li><strong>【释义】上海话中的“be”发音的语气词，常与weisa连用，也可写作“beh”</strong></li><li><strong>【词源】高一时，钟zj同学在周日晚自修补先修课作业，在教室大喊一声：“be，什么是线性有关？”</strong></li></ul><h2 id="保守估计98分-dagger-2"><a class="header-anchor" href="#保守估计98分-dagger-2">¶</a>保守估计98分**^\dagger**</h2><ul><li><strong>【释义】表示自己在虚张声势</strong></li><li><strong>【词源】rui同学在某场物理考试结束之后大喊大叫：“保守估计98分”。</strong></li></ul><h2 id="刺痛-2"><a class="header-anchor" href="#刺痛-2">¶</a>刺痛</h2><ul><li><strong>【释义】表示一些事情使心情受到负面影响</strong></li><li><strong>【例句】比如说提起我的高数失败，就是一种刺痛。</strong></li></ul><h2 id="tsosnymud-dagger-2"><a class="header-anchor" href="#tsosnymud-dagger-2">¶</a>tsosnymud**^\dagger**</h2><ul><li><strong>【释义】“操死你妈的”用外国人口音读出来</strong></li><li><strong>【词源】来源于章jh同学对“操你妈的”进行加强，并且用更顺口的语气说出来。</strong></li></ul><h2 id="“董”相关-dagger-2"><a class="header-anchor" href="#“董”相关-dagger-2">¶</a>“董”相关**^\dagger**</h2><ul><li><strong>【释义】董jq老师衍生出来的一系列词语，例如“不董装董”、“董装不董”</strong></li><li><strong>【词源】高一时董jq老师神出鬼没。有时有人进班级或在后门窥视，让人疑心是董老师，因此称其“不董装董”，自此衍生出来一系列词语</strong></li></ul><h2 id="胡椒-dagger-2"><a class="header-anchor" href="#胡椒-dagger-2">¶</a>胡椒**^\dagger**</h2><ul><li><strong>【释义】匿名的显得很牛的人</strong></li><li><strong>【词源】春考之后，英语大佬曹yw同学在英语群里以胡椒的匿名id问老师能不能不做英语作业了。</strong></li></ul><h2 id="基里巴斯-dagger-2"><a class="header-anchor" href="#基里巴斯-dagger-2">¶</a>基里巴斯**^\dagger**</h2><ul><li><strong>【释义】时空错乱，倒时差</strong></li><li><strong>【词源】Cosmo同学在数学考前复习语文，语文考前复习数学，时空错乱，像是生活在横跨日界线的基里巴斯一样</strong></li></ul><h2 id="看看你的-star-2"><a class="header-anchor" href="#看看你的-star-2">¶</a>看看你的**^\star**</h2><ul><li><strong>【释义】看看对方的情况</strong></li><li><strong>【例句】[发送了一张图片，是一个量表]看看你的！</strong></li></ul><h2 id="口区-dagger-2"><a class="header-anchor" href="#口区-dagger-2">¶</a>口区**^\dagger**</h2><ul><li><strong>【释义】表示恶心</strong></li><li><strong>【词源】“呕”这个字拆开来，来源于孙m同学，rui同学最爱用，后来风靡开来了</strong></li><li><strong>【变体】呕（先有的“口区”，再有的“呕”）</strong></li></ul><h2 id="蓝奶酪-2"><a class="header-anchor" href="#蓝奶酪-2">¶</a>蓝奶酪****</h2><ul><li><strong>【释义】味道恶臭的物品。</strong></li><li><strong>【词源】来自高二地理课张yt发现所坐座位有恶臭，经沈ty研究恶臭来源为龚zr的自制酸奶，故用同为恶臭奶制品的蓝奶酪代指。</strong></li></ul><h2 id="某巨-dagger-2"><a class="header-anchor" href="#某巨-dagger-2">¶</a>某巨**^\dagger**</h2><ul><li><strong>【释义】对厉害的人的尊称</strong></li><li><strong>【例词】郭巨</strong></li></ul><h2 id="谬误-2"><a class="header-anchor" href="#谬误-2">¶</a>谬误</h2><ul><li><strong>【释义】表示用轻松的语气对某人的批评，常与完全连用</strong></li><li><strong>【例句】我又发现了一些小谬误。</strong></li></ul><h2 id="你好-2"><a class="header-anchor" href="#你好-2">¶</a>你好</h2><ul><li><strong>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与“同学”、“请”连用</strong></li><li><strong>【例句】你好，请飞来北京看。</strong></li></ul><h2 id="脑控-2"><a class="header-anchor" href="#脑控-2">¶</a>脑控</h2><ul><li><strong>【释义】嘲讽对方做了一些比较荒谬的事情</strong></li><li><strong>【词源】原出处已散逸，或许来源于廖凯原的《轩辕反熵运行体系》，或许来源于网上关于脑控的发笑阴谋论</strong></li></ul><h2 id="脑死亡-star-2"><a class="header-anchor" href="#脑死亡-star-2">¶</a>脑死亡**^\star**</h2><ul><li><strong>【释义】做了一些荒谬或者略微有点愚蠢、没有逻辑的事情，可以形容自己或者别人，贬义。常与热狗连用。</strong></li><li><strong>【词源】来源于《破道计划》（郭xj著）“所有人眼前一黑，全部倒下，他们的大脑承载了本不该承载的东西，全部陷入了脑死亡。”</strong></li><li><strong>【变体】nsw、脑死亡一次、nsw吧、脑死、眼前一黑，陷入脑死亡</strong></li><li><strong>【例句】我今天早上11:15起床已经nsw！</strong></li></ul><h2 id="Odeur-dagger-2"><a class="header-anchor" href="#Odeur-dagger-2">¶</a>Odeur**^\dagger**</h2><ul><li><strong>【释义】匿名者</strong></li><li><strong>【词源】网课期间，沈ty同学以Odeur的化名出没于各个腾讯会议会议室</strong></li></ul><h2 id="然而-2"><a class="header-anchor" href="#然而-2">¶</a>然而</h2><ul><li><strong>【释义】表示转折</strong></li><li><strong>【例句】然而：我可悲。</strong></li></ul><h2 id="热狗-star-2"><a class="header-anchor" href="#热狗-star-2">¶</a>热狗**^\star**</h2><ul><li><strong>【释义】表示做事不太聪明又有点可爱发笑，可作为名词、形容词、副词、语气词使用</strong></li><li><strong>【词源】高一义卖高sm同学提议可以卖热狗，后虽热狗因卫生原因被否，但是高sm同学读“热狗”的口音流传了下来</strong></li><li><strong>【变体】热狗人，🌭，🌭吧，小热狗以及众多表情包的形式</strong></li><li><strong>【例句】这也是为什么有小热狗喜欢iPad mini。</strong></li></ul><h2 id="请-2"><a class="header-anchor" href="#请-2">¶</a>请</h2><ul><li><strong>【释义】发语词，表示接下来说的内容将以一种戏剧化或者夸张化的语气，有时用来表达比较轻松语气的请教，常与同学、你好连用</strong></li><li><strong>【例句】请你加速！</strong></li></ul><h2 id="事实上-2"><a class="header-anchor" href="#事实上-2">¶</a>事实上</h2><ul><li><strong>【释义】in fact，也不知为何常被拿来发语，语言非常欧化呐</strong></li><li><strong>【例句】事实上我后天早上说不定也要从交大出发。</strong></li></ul><h2 id="同学-2"><a class="header-anchor" href="#同学-2">¶</a>同学</h2><ul><li><strong>【释义】表示接下来说的内容将以一种戏剧化或者夸张化的语气，常与请、你好连用、注意</strong></li><li><strong>【例句】同学，你有些发笑。</strong></li></ul><h2 id="完全-2"><a class="header-anchor" href="#完全-2">¶</a>完全</h2><ul><li><strong>【释义】表示夸张化的否定</strong></li><li><strong>【例句】完全错误！</strong></li></ul><h2 id="显然-2"><a class="header-anchor" href="#显然-2">¶</a>显然</h2><ul><li><strong>【释义】表示夸张化的语气</strong></li><li><strong>【例句】我显然追求最佳显示效果。</strong></li></ul><h2 id="一次-2"><a class="header-anchor" href="#一次-2">¶</a>一次</h2><ul><li><strong>【释义】用于自嘲，常与发笑、热狗连用</strong></li><li><strong>【例句】🌭一次</strong></li></ul><h2 id="智慧-2"><a class="header-anchor" href="#智慧-2">¶</a>智慧</h2><ul><li><strong>【释义】常用于自夸，其否定形式常常表示轻松语气的批评</strong></li><li><strong>【例句】我是智慧的。</strong></li><li><strong>【例句】大不智慧！</strong></li></ul><p><strong>## <strong>中情局</strong>^\dagger</strong></p><ul><li><strong>【释义】偷看英语默写答案</strong></li><li><strong>【词源】高一时钟zj同学作为英语课代表，是及时雨中的普罗米修斯，他从老师或者隔壁同学那里盗来答案，史称中情局。</strong></li></ul><h2 id="注意-star-2"><a class="header-anchor" href="#注意-star-2">¶</a>注意**^\star**</h2><ul><li><strong>【释义】表示提醒对方说错话或者做事荒谬，常与“智力”连用</strong></li><li><strong>【例句】注意！到虹桥只需1h5min。</strong></li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;fxlego大典v1.0&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;写这一份上中腔词典的原因是一时兴起。其实很难说我这里所说的“上中腔”的具体定义是什么。说是上中腔，但又主要是大师班的同学常用，但别的班也有一批同学会用。说是大师班的同学常用，但又主要是大师班的男生在用，女生们也会用</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="校园/School" scheme="https://ryanstarfox.github.io/tags/%E6%A0%A1%E5%9B%AD-School/"/>
    
    <category term="高中/High School" scheme="https://ryanstarfox.github.io/tags/%E9%AB%98%E4%B8%AD-High-School/"/>
    
  </entry>
  
  <entry>
    <title>9 3/4车站和驯龙高手</title>
    <link href="https://ryanstarfox.github.io/2024/06/06/2024/20240606%20Vision%20Pro/"/>
    <id>https://ryanstarfox.github.io/2024/06/06/2024/20240606%20Vision%20Pro/</id>
    <published>2024-06-06T04:58:00.000Z</published>
    <updated>2024-06-06T04:58:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>9 3/4车站和驯龙高手</h1><p>今天由于一些机缘巧合，在交大玉兰苑二楼体验到了Vision Pro，随便写一点感受，</p><p><img src="/images/2024/VP-1.webp" alt="img"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>戴上Vision Pro的其实有点麻烦的，有点笨重，我用的是单环的绑带，要束得比较紧。耳朵也一下子不知道是要盖在绑带下面还是不要盖在绑带下面。鼻子下面是会有一点点漏光的，没有那么贴合，佩戴的过程中，那块贴面的磁吸零件也经常松动（可能因为那块贴面的零件并不是量身定做的吧？）带上Vision Pro，我的第一感觉是与带着眼镜的观感无异。再定睛一看，会感觉有点“花”，怀疑是被各种人戴了之后摄像头上有点油渍没有擦掉吧（这其实和普通的眼镜也是一个道理）。再仔细体验，觉得确实暗部会比实际的亮度更低一些，细节不太清楚，有点糊作一团（这也可能是我加入的镜片和我实际的度数不太一致的缘故）。但是即使有这么多问题，戴上去的感觉还是震撼的，身临其境的感觉会让你忘记以上的缺点。甚至之前被诟病的“视角小”的问题我觉得也没有那么严重，因为本来视线的边缘就是模糊的，问题不是很大。让我感到有点吃力的是Vision Pro的重量。这次因为是体验，所以没有用双环的绑带，脖子感觉快要断掉了。我的面部确实也压得有点难受。而且眼睛离屏幕这么近，又要用视线来控制焦点，眼睛也是有点累的。</p><p>但是不得不说，VisionOS已经打磨得比较好了。记得《乔布斯传》中有一位苹果高管对于iPad的描述。ta在那里使用iPad，旁边一个素不相识的小孩看到了也很感兴趣，ta于是把iPad借给了那个小孩，那个小孩拿到iPad，不需要任何的使用手册，就很轻易地上手了iPad。我认为Vision Pro也是类似的体验，ta的交互中能够找到来自iPhone的Home键、手势操作的影子，用户完全不会有面对一个界面不知所措的感觉。符合直觉的设计是好设计。</p><p>体验了几个App。一个是看那个机械零件。那位引导我的店员说其实可以走进这个零件看内部构造，但是我不敢，我觉得会一头撞进去。真的有一种9 3/4车站的感觉。那个零件是可以用手拆开的，让我感到惊讶的是甚至可以用手来将它翻转。认为这个手部识别应该会比较难，这确实是比较让我惊喜的一点。也体验了那个知名的与恐龙面对面的App。恐龙走出屏幕的时候，我真的很害怕，竟然一下子蹲了下来。我小心翼翼地想像驯龙高手里面的Hiccup用手去摸龙的额头，但是它咬了我一下，我害怕得把手缩了回去。太真了。还体验了iMAX看电影，看了几段试看片段。哇那个真的是太爽了，真的想在电影院一样。但是我试图像宣传片里的一样把银幕放到湖的上面，我自己好坐在湖边看，但是来不及研究出应该怎么操作。不过我还是体验了几个环境的场景。看了雪山、沙漠、湖边、月球。真的非常震撼。最后体验的app是淘宝。没想到国内厂商已经这么快就适配了Vision Pro。打开淘宝，说实话也都是几个我比较熟悉的商品：大疆mini 4，索尼A7C2等等（怀疑被算法了，这不是我一直念叨想要的嘛）点进去，是可以把立体的商品拿出来看的。感觉这个真的会重塑线上购物的体验。</p><p><img src="/images/2024/VP-2.webp" alt="img"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>感谢trt告知了我这个活动，真的很难得。这应该是那一个幻想中的美好未来的一部分吧？不知这个产业以后会变成什么样。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;9 3/4车站和驯龙高手&lt;/h1&gt;
&lt;p&gt;今天由于一些机缘巧合，在交大玉兰苑二楼体验到了Vision Pro，随便写一点感受，&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/2024/VP-1.webp&quot; alt=&quot;img&quot;  data-tag=&#39;post-image</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>Ars Longa, Vita brevis</title>
    <link href="https://ryanstarfox.github.io/2024/06/05/2024/20240604%20%E5%9D%82%E6%9C%AC%E9%BE%99%E4%B8%80/"/>
    <id>https://ryanstarfox.github.io/2024/06/05/2024/20240604%20%E5%9D%82%E6%9C%AC%E9%BE%99%E4%B8%80/</id>
    <published>2024-06-05T07:00:00.000Z</published>
    <updated>2023-11-02T07:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>Ars Longa, Vita brevis</h1><p><img src="/images/2024/ryuichi-0.tiff" alt="ryuichi-0"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>现在已经很晚了，刚刚和一位朋友打了电话煲了电话粥，所以现在事实上已经是6月5日1:00多了，即使如此，我还是觉得有必要趁我的感受没有消失前写下我看完《坂本龙一：杰作》之后的感受。</p><p>我是什么时候知道坂本龙一的呢？高三的时候，我做作业喜欢听钢琴曲。我的钢琴曲都选自Apple music每周更新的钢琴休憩小站的歌单，其中就有坂本龙一的《OPUS》和《energy flow》。OPUS是我在这个歌单中挑出来单曲循环过的音乐之一，我能听出它的非同寻常。“坂本龙一”这个日本名字就进入了我的记忆。又是“龙”，又是“一”的，听上去就是一个大师嘛。我后来才知道，他确实是一位大师。</p><p>后来，我发现坂本龙一确实久负盛名。在一些视频中，我了解到了他的名作《Merry Christmas, Mr. Lawrence》。我很庆幸我对于美是有敏锐的感受的，我看一个介绍他的视频中的很多音乐中，给我留下最深印象的就是《Merry Christmas， Mr Lawrence》。但是我真正了解他反而是在他去世前不久。2021，2022年的时候，我在B站上找过大量有关于他的视频进行了解，看了纪录片《坂本龙一：终曲》，我发现他不是那种老态龙钟的保守的音乐大师，而是颇为先锋。不仅在年轻的时候，他在YMO他做过很多尝试，甚至到他步入中老年之后，也试着去创新，去写出《async》这样的先锋作品，这让我对他既是愈发感兴趣，又是愈发敬佩。我也尝试去听他的音乐，有些先锋音乐、实验音乐不适合作为常听的娱乐性的或者说仅仅是让我专注下来的bgm，只适合作为一种新奇的体验，但从中我能够感到坂本龙一对于音乐本质的独到理解与不断的探索。</p><p>只是我开始了解他没多久，他就离世了。</p><p>《坂本龙一：杰作》是他留给我们最后的礼物。</p><p><img src="/images/2024/ryuichi-1.jpeg" alt="ryuichi-1"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>在5/31，我发现《坂本龙一：杰作》上院线了。我认为我一定要去看，而且我也认为我应该一个人去看。我谁都没有约。</p><p>是6月4日20:00-21:43的票。我很担心自己能不能看完的，因为担心自己没有这个耐心，但是随着乐音渐强，我代入了这种情绪化的氛围，我就知道自己一定能听下去，我本来以为或许自己会包场，因为感觉这种形式能接受的人很少吧？但是实际上没有包场，全场一共9位观众。坐在我前面的我能看到的4位观众中，1位看微信看得睡着了，1位在看微信，2位在刷短视频。手机的屏幕很亮很刺眼，我尽量压低身子，希望他们的座位挡住屏幕的光。不知道他们有没有享受这一段旅程。电影院运作的噪音很大，这对于这样一场音乐会而言是很严重的影响，但无妨。</p><p>前几周刚好连续看了坂本龙一的两本自传《我还能看到几次满月升起》和《音乐即自由》，同时我也不是什么专业的音乐人，所以我看这部作品的时候，我在想的是，坂本龙一在演奏时会想什么呢？镜头一直给坂本龙一的脸特写，我可以看到他最细微的表情，我尽力地去揣度他的想法。</p><p>《BB（Bernardo Bertoilucci）》是他这次演奏会的第二首音乐。我第一次知道，原来BB指的是Bernardo Bertoilucci。贝托鲁奇是坂本龙一敬爱的前辈，为他的电影配乐，尽管有许多起伏与碰撞，但能为自己心目中的大师的作品配乐，坂本龙一想必是非常幸福的。而看到两位大师合作，那种惺惺相惜，是如此让人动容。整个音乐会有两首音乐都是贝托鲁奇的电影配乐。一首是《The Last Emperor》，一首是《The Sheltering Sky》。《The Last Emperor》是坂本龙一是贝托鲁奇的第一次合作，而《The Sheltering Sky》的合作或许是对于坂本龙一影响最大的一次。事实上“我还能看到几次满月升起”就摘自《遮蔽的天空》，这句话坂本龙一直到晚年也一直在回味，甚至喃喃自语。已经30年了。</p><p>我也是第一次知道“Andata”的中文是的“离去”。我对于《Andata》的旋律相对而言较为熟悉，但知道了它的含义之后，又对它的那种空落感的认识更加具象化。这次是纯钢琴演奏，因此没有原曲中应该是电子合成音的那一部分。但却是觉得那部分电子合成音或许更有那种空落之感。坂本龙一青年时自杀的女友离去了、他未曾见到最后一面的父亲离去了、带他进入电影配乐的大岛渚离去了、他心目中的大师贝托鲁奇离去了、他的挚友大卫·鲍伊离去了、YMO的高桥幸宏也先他一步离去了，现在他自己也要离去了。</p><p>再下一首让我印象深刻的音乐就是《Aubade2020》（《晨曲2020》）。我认为这或许是坂本龙一的《朝花夕拾》？这或许是整场音乐会最轻快的的旋律了，其中的欢乐莫不是他幼时特殊幼儿园中学钢琴的经历，莫不是他第一次作出《小白兔之歌》的感受？这种快乐是轻快的。我认为这其实与后面一首《Ichimei-Small happiness》（《一命：渺小的幸福》）相对照。这首音乐不快乐，有种物哀之感，但很幸福，应该是他此刻的感受吧？鲜花在谢的时候是幸福的，红叶在飘落的时候是幸福的，最终土地上还会长出新的苗来。</p><p>《Tong Poo》(《东风》)是坂本龙一年轻时的名作，我想他这应该是在回想YMO时期，那段他探索民族音乐的时期吧？在YMO的经历，让坂本龙一走向了国际化。最后因为与细野晴臣和高桥幸宏观念不合最终解散。解散之后YMO有两次重聚，一次是商业性的，几个人还处于矛盾的状态，不太愉快，但是第二次是自发的，年岁的增长让三位也更加平和包容，时隔多年为YMO画上了一个完美的句号。</p><p>《20180219（w/prepared piano》（《预制钢琴》）前，坂本龙一手动改装琴弦，赋予了钢琴特殊的音色。这种音色让我回想起坂本龙一在福岛海啸之后去拜访福岛，找到的那架破烂钢琴的音色，或许也正是从中获得灵感吧？wrepared指的应当也是wreck- prepared吧？感觉这种改装钢琴的手法非常实验性，但是做出来的效果却出人意料的动听和谐。</p><p>倒数第二首诗另外一首电影配乐《Merry Christmas, Mr Lawrence》。这首音乐在他的音乐生涯中也有这举足轻重的地位。他因为这首音乐，去了奥斯卡现场，见到了贝托鲁奇，才有了后面的电影配乐的那一半故事。但是坂本龙一对于这首音乐的态度很矛盾，也是到了晚年才释怀。他起先一直不愿意谈这首音乐，因为厌倦这首音乐成为他的公众形象（其实这也有点叛逆），但他去听别人的音乐会，理解了听不到自己想听的音乐的难受，因此开始不忌讳在自己的音乐会上面演奏这首音乐，也算是最终和解吧。我事先没见过演奏单，也一直在想坂本龙一是否会把这首音乐放进他留下来的最后的礼物呢？我一直等，听到了《The Last Emperor》中《Where is Armo》的开头差点以为是《Merry Christmas, Mr Lawrence》。我听到最后都已经觉得，或许这最后一次他想为了自己演奏，不弹这首了吧，没想到这一首音乐的旋律最终还是浮现了出来，他想必是彻底和解了，他最后一次为世界弹了一遍《圣诞快乐，劳伦斯先生》。他会不会想起大卫·鲍伊，想起在奥斯卡遇到贝托鲁奇，想起北野武油腻但纯真的脸。这是他唯一一首微笑着演奏的音乐。</p><p><img src="/images/2024/ryuichi-2.png" alt="ryuichi-2"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>最后一首音乐是《OPUS》，这是我第一次知道坂本龙一这个名字的媒介，却也是坂本龙一的落幕。我事先是知道这首音乐</p><p>是最后一首音乐，但是没想到是以一种如此伤感的形式：弹着弹着，脚步声响起，琴声依旧，琴键上的手消失了，琴键却兀自地弹着。字幕提醒着我们“斯人已逝，乐音不止”。</p><p><img src="/images/2024/ryuichi-3.png" alt="ryuichi-3"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>全片的最后一幕是Ars Longa, Vita brevis（艺术千秋，人生朝露），这句话也在他的《你还能看到多少次满月升起》里出现过，这是坂本龙一的墓志铭，恰如其分。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;Ars Longa, Vita brevis&lt;/h1&gt;
&lt;p&gt;&lt;img src=&quot;/images/2024/ryuichi-0.tiff&quot; alt=&quot;ryuichi-0&quot;  data-tag=&#39;post-image&#39; onload=&#39;this.onload=null;th</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="感悟/Thoughts" scheme="https://ryanstarfox.github.io/tags/%E6%84%9F%E6%82%9F-Thoughts/"/>
    
  </entry>
  
  <entry>
    <title>Ride, ride through the day</title>
    <link href="https://ryanstarfox.github.io/2024/01/16/2024/20240115%20%E9%AA%91%E8%BD%A6/"/>
    <id>https://ryanstarfox.github.io/2024/01/16/2024/20240115%20%E9%AA%91%E8%BD%A6/</id>
    <published>2024-01-15T22:00:00.000Z</published>
    <updated>2024-01-15T22:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>Ride, ride through the day</h1><p>我能接受的最快的还算能享受的速度是自行车的速度。</p><p>在读大学以前，我很少骑车。出行无非三种方式：步行、乘父母的车、乘公交。乘公交的时光是漫长的，总需要一样东西来分散注意力，打磨时光。对我而言，那常常是手中的Kindle和耳朵里的AirPods。公交车是颠簸的，有一股怪味，窗缝和座位底下总感觉很脏，车门打开时候嘎吱嘎吱的。地铁稍微稳一点，但是隆隆的运行声让我总要带上降噪耳机，即使我不想听音乐。在公交上，我能感受到阅读和欣赏音乐的快乐，但是我不享受这段单调、重复、死板的旅程。</p><p>乘父母的车比乘公交舒服一些。至少有一整面的窗户是留给我的，我可以看看路边的景色。可这景色往往是单调的——在这个车速限制的观察的宏观尺度上、在城市里，我看到的几乎只有千篇一律的楼和不断重复的路灯、路牌、和路上的标线。对我而言，享受的纯粹的车程可能只有那种空旷、笔直、怪石环绕的无人公路或是溪边的人小路。感觉山石和水流是少数不多在宏观的尺度之下还能欣赏的东西了。平时乘车唯一的享受之处在于与家人的聊天，但这也不属于旅途的享受的范畴了。</p><p>但是每次步行就很享受。步行足够慢，慢到我可以看清路途中的一切细节；步行足够随意，我想停便停、想快便快、想慢便慢；步行足够放松，我可以肆意挥霍自己的注意力；步行足够真实，我可以去触碰大地，听落叶的声音，嗅即将下雨的味道。步行是生活；步行是探索；步行是欣赏；步行是作诗。</p><p>高中毕业之后，第一个新的交通体验是亲自开车。我的母亲很惊讶我没有像刻板印象中的男孩一样喜欢车这类所谓“阳刚”的东西。我没有很喜欢开车的感觉。我认为开车的感觉甚至比乘车还糟糕。除了不能好好看看身边的景，甚至注意力都被分开了——“看”就几乎只够实现最功利的目的了。</p><p>第二个新的交通体验是自行车。我上大学前自行车骑得不多，高中毕业后用从自己成功从SHS骑共享单车骑40km回家的经历换来了一辆入门的山地车giant-atx720。大学这一个学期，我骑的里程可能比我人生的前18年加起来都要多。我很享受骑行。骑行其实和步行很像——过了两三天后也还记得很多那段路的细节。在闵行骑车时每次都是绿灯，出了闵行就一直等红灯。过了一座桥后远远看到一座寺庙的大雄宝殿，在地图上查看发现是法华禅寺。非机动车道上奔波的除了疾驶的外卖小哥还有从工具箱里掉了一只扳手出来的维修工人。电瓶车的侧面伸出一个毛茸茸的头和一条兴奋地晃着的小尾巴，在等红绿灯时，那只小狗跳下了车，车上的老爷爷和隔壁车的老奶奶告诉它还没到，回去，它就回去了。看到嘉定新城一片风景秀丽的河边步道，旁边是红色的黄色的树，那是在嘉定城市规划馆旁边。馆对面还有一家养乐多工厂，以前我的太外婆经常送给我养乐多，一板一板的。骑着骑着，耳机里随机到了Queen的《Bicycle Race》。在骑过苏州河的时候，那个地方离虹桥很近，看到了4，5架飞的很低的飞机，就直直地在头顶掠过，连航空公司的名字都能看到。有幸拍下了几张照片，再往前骑一点是一帮在等着看飞机降落的年轻人。</p><p><img src="https://s2.loli.net/2024/01/16/Imwr2g7NSOHP3bc.jpg" alt=""  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>很喜欢这张</p><p><img src="https://s2.loli.net/2024/01/16/7eBCAGfIDEhPoFS.jpg" alt="4D9F189E-268A-4145-B2AC-D232CA7BE78F_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>《中国东方航空》</p><p>但是我最近意识到骑行的享受较步行已经有所下降了。我是在一天晚上意识到这件事的。那天晚上图书馆闭馆，和一个偶然遇到的高中同学一起回去。她没找到共享单车，所以我们一同走回去。在教超旁边，我看到一颗树，那棵树很粗，看上去年龄比旁边的行道树大了不少。一般而言，人感知到一件事往往能够快速唤醒一个人沉睡的回忆的。对我而言，最灵敏的是嗅觉，但是嗅觉稍纵即逝，往往我还没有想起那一段回忆就消逝了，空留感受的余音和美丽的遗憾。但是视觉是真切的，那棵粗得不一般的树让我立刻想到了小学上学路上和祖父一同依据树干粗细“钦定”的树老大、老二、老三和老四。我骑行的时候从未注意过这棵树。</p><p>步行、骑行。对于很多人来说，通勤是种折磨。是啊，谁愿意一大早起来挤在狭小的车厢内呢？步行作为通勤的方式可能在现在已经不太实际了，但是骑行还是可以作为一种折中的办法吧？我不愿意每一段路程都要想办法消磨时间，我还是希望多几段可以享受的旅程的。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;Ride, ride through the day&lt;/h1&gt;
&lt;p&gt;我能接受的最快的还算能享受的速度是自行车的速度。&lt;/p&gt;
&lt;p&gt;在读大学以前，我很少骑车。出行无非三种方式：步行、乘父母的车、乘公交。乘公交的时光是漫长的，总需要一样东西来分散注意力，打磨时光。对我而言</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="感悟/Thoughts" scheme="https://ryanstarfox.github.io/tags/%E6%84%9F%E6%82%9F-Thoughts/"/>
    
  </entry>
  
  <entry>
    <title>法大悲 repo</title>
    <link href="https://ryanstarfox.github.io/2023/12/18/2023/20231218%20Les%20Miserables/"/>
    <id>https://ryanstarfox.github.io/2023/12/18/2023/20231218%20Les%20Miserables/</id>
    <published>2023-12-18T02:00:00.000Z</published>
    <updated>2023-12-18T02:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<p><strong># 法大悲 repo</strong></p><p>有幸抢到了法大悲的票</p><p><img src="https://s2.loli.net/2023/12/18/UWxcoTA1ajbFOCR.jpg" alt="IMG_4199"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>于是在12月15日的交大金课工程学导论课下课后翘了晚上18:30的数学分析习题课前去上海文化广场观看</p><p>乘地铁紫竹高新区--&gt;上海南站--&gt;陕西南路</p><p>坐一号线的时候还有一个地铁迷兴奋地跑过来拍照，说这部地铁是上海一号线第一辆列车</p><p>感觉很好运</p><p>因为好久没有听音乐剧了，打算在路上重听一下10周年版的大悲，然后发现自己的耳朵进化了，已经听得出AirPods 2无法承受这种宏大的交响乐了，在地铁上后悔没有把大馒头4带出来。</p><p>在上海南站换乘的时候听到《The Confrontation》已经听得头皮发麻了，非常期待！！</p><p>从陕西南路出来发现是环贸iapm，高考后莫名其妙对这里非常熟，打卡圣诞Apple store</p><p>晚饭在一家深井陈记烤鹅吃了雪菜牛肉饭，一直很喜欢吃这道菜，很鲜。</p><p>没有给饭拍照（哎这次就是没想到应当多拍点照片）因为外面打光很好，想给自己拍张照</p><p><img src="https://s2.loli.net/2023/12/18/K64xzwLN8lhuoPs.jpg" alt="IMG_4149"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>发现反光不够好</p><p>走到上海文化广场，路边的旗，，</p><p><img src="https://s2.loli.net/2023/12/18/YanyOVHXALDiuCt.jpg" alt="IMG_4147"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>进去了，人很多，见到一个女孩子拿着徕卡相机（不是镜头，是镜头+相机），感觉她很富有</p><p>看到上海电视台也在有那里采访，趁没有人偷偷拍了一张大海报（的一<strong>部分</strong></p><p><img src="https://s2.loli.net/2023/12/18/t6qTKCLmgUDzX7l.jpg" alt="IMG_4156"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>买了一些纪念品：纪念册和CD</p><p><img src="https://s2.loli.net/2023/12/18/biS1KTlWwFpZvsJ.jpg" alt="IMG_4158"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>可以给大家看看纪念册里面，很精美！sukisuki</p><p><img src="https://s2.loli.net/2023/12/18/5ATNofDdberYPLU.jpg" alt="IMG_4202"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="https://s2.loli.net/2023/12/18/Yrtw9ycmFziBTso.jpg" alt="IMG_4200"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="https://s2.loli.net/2023/12/18/QAWdPORnVxUMluG.jpg" alt="IMG_4201"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>在进场的时候还偶遇xys小姐，小小震撼，，和她大眼瞪小眼</p><p>记得第一次看10周年的时候还有点无聊，因为确实10周年仅仅是一个音乐会，表演的部分不是很多，自己还没有定力只听音乐不做别的事情，眼睛没事情做。这一次看现场还是完全不懂的法语，隐隐约约有点担心自己会不会感觉无聊，，</p><p>但其实当《Prologue》的旋律一开始的时候，我就知道不可能会感到无聊，现场的声音和耳机里的声音是不好比的，每一个音符使灵魂震颤，'Pitié,pitié'一开口，我一下子很恍惚，真的不敢相信自己能在现场听到</p><p>我全程都很亢奋，尤其是《The Confrontation》、《Do you hear the people sing》、《One day more》</p><p>《Master of the house》很欢乐，《Beggars at the feast》大家真的在拍手</p><p>小珂赛特和伽弗洛什都很可爱，，喜欢《橱窗里的娃娃》，甜甜的小女孩谁不爱</p><p>冉阿让说“你命令我不要死，我会努力尝试”的时候真的热烈盈眶</p><p>不过也有一些缺点，忘记哪一段高潮的时候设备爆音了，一下子出戏了</p><p>第二幕的时候很多地方不该拍手，但是观众在乱拍手，导致几首歌之间的衔接被打断了</p><p>不过总体来说，真的远胜录像版本，毕竟大悲所有的版本里面，现场版是最好的！</p><p>录了两段encore：</p><p>唱了两遍《finale》，唱第二遍的时候感觉演员是想台下的观众一起唱吧，可惜大家实在是不会说法语</p><p>其实有点可惜没有唱《Do you hear the people sing》，不知道是不是政治原因，感觉那个更适合大合唱</p><p>落幕！</p><p><img src="https://s2.loli.net/2023/12/18/94YXLOwyPoBaiUK.jpg" alt="IMG_4164"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="https://s2.loli.net/2023/12/18/h7AMOUcflVsbiRu.jpg" alt="IMG_4169"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>像梦一样的晚上</p><p>回来路上真的很上头，想重看10周年25周年电影和书了，于是在地铁上就下载了电子书，关掉《麦田里的守望者》，开始看《悲惨世界》</p><p>在地铁上还是只能拿AirPods pro 2听大悲，很难受，一回到寝室就使用大馒头听。大馒头4确实很牛！头戴式耳机的声场优势在这种交响乐上真的体现得淋漓尽致。</p><p>ww还想再看</p><p>哎可惜这次没拍什么照片，还没有养成随时随地用影像记录生活的好习惯</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;&lt;strong&gt;# 法大悲 repo&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;有幸抢到了法大悲的票&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://s2.loli.net/2023/12/18/UWxcoTA1ajbFOCR.jpg&quot; alt=&quot;IMG_4199&quot;  data-t</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>看星星</title>
    <link href="https://ryanstarfox.github.io/2023/11/02/2023/20231101%20%E7%9C%8B%E6%98%9F%E6%98%9F/"/>
    <id>https://ryanstarfox.github.io/2023/11/02/2023/20231101%20%E7%9C%8B%E6%98%9F%E6%98%9F/</id>
    <published>2023-11-01T16:12:00.000Z</published>
    <updated>2023-11-01T16:12:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>看星星</h1><p>很巧，很多很喜欢的作品都是星际题材：星际争霸、星球大战、星际牛仔……无数的星星各有各的神秘与朦胧，对于我而言，星星对我的吸引不仅仅在于对未知的好奇，更因其因人类认知的永远无法企及全部星星的崇高与悲壮。</p><p>我是什么时候开始看星星的呢？应当是高一学期初那几个夜晚。当时和Bill臭味相投，已经忘了是什么契机，发现上中竟然能看到很多星星，于是乎每天晚上晚自修结束一起去上中操场，躺在软软的草地上面，一颗一颗地认星星，最后爬起来的时候发现屁股和背全都湿掉了。当时就和他聊，说多少年后，这一段一起看星星的时光可能会模糊朦胧，可能会分不清楚究竟是梦还是真实，但绝对不敢把这段时光忘掉，因为这一段时光太珍贵了。从2020年10月的天空开始几个月的天空当时都十分熟悉。火星、木星、土星、牛郎、织女、天津一、天津四、毕宿五、五车二、五车三、天狼、北落师门、还有整个参宿。这些只在书上看到的名字突然在现实世界有了一个实体。这就好比我抬起头，第一次发现那崇高的未知世界的大门竟然有一道缝，缝里洒出来一束光，我进不去那个世界，却可以沐浴在光芒之中。</p><p>后来大操场翻修了，在高中期间再也没开，我和Bill也停止了看星星。很久不看星星，对于星空也陌生了。高三那年的中秋节，我和我的母亲半夜出去散步，想找一个好地方赏月，无奈到处都是灯光，钠灯的晕影无情地遮盖了月之皎洁。后来不知是谁想出对策，可以去楼顶赏月。我们到了楼顶，地平线附近依旧是橙色的，但天空暗了很多，不仅月景更加干净，星星也看到的更多了。那是木星、土星。我惊讶地发现自己依约能够识别出一些星星，使用手机软件对这天空一看，大多都是熟悉的名字。那一瞬间，感到星星是重逢故友。但人之渺小有何德何能与星星为友？能与星星连接，与自然连接，与崇高连接，心中反而怯怯的、空空的。</p><p>之前听过一个理论：怯魅的过程实际上是斩断了人与世界的连接感。就好比告诉小孩圣诞老人不存在，礼物是父母偷偷送的，小孩依旧收到礼物，但是心里总会空落落的。（应该是《刘擎》里的观点？）我发现我或许就在用与星星的连接去填补内心的空落，我在尝试与更大的世界产生联系，让自己的心与宇宙交融。</p><p>暑假里去了西藏，在高原上，我们两次出去看星空。我第一次用肉眼看到了银河，看到了更多的星星。那一瞬间的崇高感至今时时浮现，感觉那是我和世界联系得最紧密的时刻。</p><p>一起来看星星吧！</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;看星星&lt;/h1&gt;
&lt;p&gt;很巧，很多很喜欢的作品都是星际题材：星际争霸、星球大战、星际牛仔……无数的星星各有各的神秘与朦胧，对于我而言，星星对我的吸引不仅仅在于对未知的好奇，更因其因人类认知的永远无法企及全部星星的崇高与悲壮。&lt;/p&gt;
&lt;p&gt;我是什么时候开始看星星的呢？应当</summary>
      
    
    
    
    <category term="感悟/Thoughts" scheme="https://ryanstarfox.github.io/categories/%E6%84%9F%E6%82%9F-Thoughts/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>怀念高中</title>
    <link href="https://ryanstarfox.github.io/2023/10/18/2023/20231017%20%E6%80%80%E5%BF%B5%E9%AB%98%E4%B8%AD/"/>
    <id>https://ryanstarfox.github.io/2023/10/18/2023/20231017%20%E6%80%80%E5%BF%B5%E9%AB%98%E4%B8%AD/</id>
    <published>2023-10-18T05:14:00.000Z</published>
    <updated>2023-10-18T05:14:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>怀念高中</h1><p>今天看到朋友圈里很多团委后两届小朋友发的部门合照，一下子很感慨，也很怀念SHS。</p><p>说来好笑，高三的时候大家都口口声声说盼望高三毕业，但是读大学读了一个月出头，朋友圈不知为何却刮起了“想回高三”的风潮。想回高三，这又未尝不是一种斯德哥尔摩呢？高三很苦，但是苦中作乐显得尤其的珍贵。我永远怀念那几个逃课的夜晚，在中兴楼的万圣节之夜，在四楼楼梯间和一楼门厅外柱子后面怯生生地长（发）聊（疯），团代会后在教工之家喝着免费的热可可和热巧克力狂欢（发疯*2）。感觉高三给我的感觉就是大家都是集中精力在冲高考，别的方面已经毫无顾忌了：食堂不好吃就天天出去吃，天天在教室里“热狗”“小丑”地嘴炮。可以肆意地发泄自己的不满情绪而不会有人介意。</p><p>高三的印记也有一些留到了大学。对我而言，最重要的印记是音乐。高三听了很多作业钢琴曲和睡眠钢琴曲，而我现在还保留着学习时听钢琴曲的习惯。听到那些熟悉的旋律，恍惚间似乎真的回到了那些大家都很累，有时集中精神有时在“自我放松”的晚自修。又一件说来好笑的事，我尝尝可以把在追的《星球大战》系列与高三联系起来，因为高三后期意外地发现星战的几首main theme虽然有些吵，但是能够帮助我集中注意力。打开Apple Music给我的推歌，本来想听点新的流行音乐的，结果全都是新的钢琴曲。感慨。有时候，记忆浮现需要一个契机，对我来说，其实最好的契机反而是嗅觉和听觉，没有视觉那样直白，但更加扣人心弦。</p><p>现在常常回SHS，几乎是每周回一次，去看望czy小姐，和她一起吃顿饭。每次回去我都有一种错觉，总觉得我是在和高三的自己重逢，就像电影里那种转头看见年轻的自己的镜头一样。我很感谢czy小姐在我高三时给我的陪伴，让我的高三生活不至于那样两点一线，给我带来了更多活力。现在，我想陪czy小姐一起度过她的高三，我说实话也并不确定这样经常去看她会不会影响她的学习，但我真的很希望她好，不仅仅是学业上，希望她在高三不要那样苦，依旧开心可爱，也希望我们最终能走到一起。</p><p>怀念SHS的日子</p><p>Po一些照片吧</p><p><img src="https://s2.loli.net/2023/10/17/7abDZFXKY8PRnxp.jpg" alt="CE7D702E-6FAE-40E4-814C-58D2598BE450_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>万圣节之夜</p><p><img src="https://s2.loli.net/2023/10/17/XPKcpVJRUizQEjt.png" alt="image-20231017234955996"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>拍部门合照时摊出来的一片，中间的是女儿送的抽象生日礼物</p><p><img src="https://s2.loli.net/2023/10/17/znJKaUdGs6vlerk.jpg" alt="6864D126-21CC-4B4D-9DF8-3697C22944B4_4_5005_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>艺术节大合唱被哪个学长拍到的，唱的很投入，撕心裂肺。不论歌有多烂，作为高三大合唱的歌，总会有点感情的</p><p><img src="https://s2.loli.net/2023/10/17/AL3Jkv2BehrRjfE.jpg" alt="9A64FD15-9560-4A9D-8D06-E90E80DEDA8F_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>再po一次Bill美照</p><p><img src="https://s2.loli.net/2023/10/17/fkdyGCH4QK7E5DW.jpg" alt="66271ABE-8053-49F0-A23B-8EB88DF8E8E8"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>Apple fans和胡老师和两个史蒂夫的合照</p><p><img src="https://s2.loli.net/2023/10/18/4tv3YI8c5Gro62B.jpg" alt="13B87670-4215-480E-A993-F1BB91BA230E_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="https://s2.loli.net/2023/10/18/QvLBFfrutYMdzcx.jpg" alt="BBB6F067-012B-483F-BFED-FC1BEE25E2A9_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>给董老师的最好的礼物！！</p><p>不敢发和czy小姐的照片🥹</p><p>哎看到朋友圈那么多合照，突然情绪化，想今晚就写点东西出来，虽然文笔很烂，，，，但是真的怀念怀念</p><p>主要还是照片比较有趣</p><p>最后一张：</p><p>我拍的最好的龙门楼</p><p><img src="https://s2.loli.net/2023/10/18/MWcZg8S6sRq7XKy.jpg" alt="790F8EC7-E544-4DAE-9F8A-29CD6CE4A08F_1_105_c"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>祝下一届高三牲“要去到你心中向往的地方”😁</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;怀念高中&lt;/h1&gt;
&lt;p&gt;今天看到朋友圈里很多团委后两届小朋友发的部门合照，一下子很感慨，也很怀念SHS。&lt;/p&gt;
&lt;p&gt;说来好笑，高三的时候大家都口口声声说盼望高三毕业，但是读大学读了一个月出头，朋友圈不知为何却刮起了“想回高三”的风潮。想回高三，这又未尝不是一种斯德哥</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
    <category term="校园/School" scheme="https://ryanstarfox.github.io/tags/%E6%A0%A1%E5%9B%AD-School/"/>
    
    <category term="高中/High School" scheme="https://ryanstarfox.github.io/tags/%E9%AB%98%E4%B8%AD-High-School/"/>
    
  </entry>
  
  <entry>
    <title>抢果子首发的经历</title>
    <link href="https://ryanstarfox.github.io/2023/09/16/2023/20230915%20%E6%8A%A2%E9%A6%96%E5%8F%91/"/>
    <id>https://ryanstarfox.github.io/2023/09/16/2023/20230915%20%E6%8A%A2%E9%A6%96%E5%8F%91/</id>
    <published>2023-09-16T15:08:00.000Z</published>
    <updated>2023-09-16T15:08:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>抢果子首发的经历</h1><p><strong>2023.9.15，晚上8时整，惊心动魄的抢首发环节</strong></p><p><strong>国区参赛选手：Leo, Bill, Ryan</strong></p><p><strong>港区参赛选手：Hertz</strong></p><p><strong>先介绍一下背景：</strong></p><p><strong>Leo: 最富的富哥，竟然是从iPhone13换成iPhone15 pro (2021-&gt;2023)</strong></p><p><strong>Ryan: iPhone X换成iPhone 15 pro （2018-&gt;2023)</strong></p><p><strong>Hertz: 最为重量级，iPhone 6s换成iPhone15 pro（2017-&gt;2023)</strong></p><p><strong>Bill: 最有商业头脑，帮我和Leo抢iPhone pro，多出来的挂闲鱼卖掉</strong></p><p><strong>19:48，Hertz早已蓄势待发，迫不及待，库克告诉他：“我们也同样急不及待（要骗钱）。”</strong></p><p><img src="https://s2.loli.net/2023/09/16/FGhq9B3HwzPuQKi.png" alt="image-20230916222844091"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><strong>我安抚Hertz：</strong></p><p><img src="https://s2.loli.net/2023/09/16/PjZOcrxGoILqUaH.png" alt="image-20230916222937603"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>19:57分，我俩开始倒计时：</p><p><img src="https://s2.loli.net/2023/09/16/IUWmhtsLG4YFHRB.png" alt=""  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>倒计时十分🌭️，我们俩不约而同地在10s停下了</p><p>然后是沉默的20s</p><p><img src="https://s2.loli.net/2023/09/16/sdBSzhmCqDvpliF.png" alt="image-20230916223123663"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>20s啊！多少操场人已经排在我们前面了！</p><p>万念俱灰时，库克安抚我们：</p><p><img src="https://s2.loli.net/2023/09/15/ct46uSBFTw2mIfR.png" alt="A435A892-2D7A-4AAC-B797-3D6288EEE0AA"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>真是贴心呢，能不能现在就好</p><p>22:03：</p><p>![image-20230916223332902](file:///Users/wangshaoyan/Library/Application%20Support/typora-user-images/image-20230916223332902.png?lastModify=1753785655)</p><p>but</p><p><img src="https://s2.loli.net/2023/09/16/tKLpuAyIg9d67NW.png" alt="image-20230916223349847"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>哎哎，更加绝望。Apple store堪比选课平台</p><p>突然，</p><p><img src="https://s2.loli.net/2023/09/16/ZSvsuexr4nibozR.png" alt="image-20230916223707444"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p><img src="https://s2.loli.net/2023/09/16/OJpTSeDIy2dluwn.png" alt="image-20230916223754350"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>除了Leo，大成功</p><p>Leo很🌭️，，我接了电话，Leo告诉我他有钱花不出去</p><p>他的银行卡有限额</p><p>完蛋</p><p>于是他来向别人乞讨</p><p>很🤡</p><p><img src="https://s2.loli.net/2023/09/16/A7rlDMzciQLsnJw.png" alt="image-20230916224058374"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>最后也成功的</p><p><img src="https://s2.loli.net/2023/09/16/OFT6Qr4DVP5Ck7R.png" alt="image-20230916223959529"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>我们都获得订单，但是预计送货时间迟迟不来</p><p>Hertz 第一个获得预计到达时间：9/22 第一批！！他第一个上岸</p><p>可是别人杳无音讯</p><p><img src="https://s2.loli.net/2023/09/16/AUmbtM3T8xp6OLP.png" alt="image-20230916224211676"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>在半夜，我写昨天那篇稿子的时候：</p><p><img src="https://s2.loli.net/2023/09/16/qZg6vBWl3bfQYu8.png" alt="image-20230916224308342"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>耳机里突然“叮”一声</p><p>“我抢到了！”吓了那我正在打原神的室友一跳</p><p>战果：四个人抢了5台iPhone，全部成功！全部9/22首发！</p><p>其中一台iPhone15 pro max，三台iPhone 15 pro， 全部8+256</p><p>Leo：</p><p><img src="https://s2.loli.net/2023/09/16/KF8f6UyYJteOPal.png" alt="image-20230916224649573"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>由于Bill把抢到的两台iPhone 15 pro寄给我倒卖，我将收到3台iPhone 15 pro倒卖，先成为交大苹果经销商</p><p>以及：</p><p><img src="https://s2.loli.net/2023/09/16/YAP9eKRCxSBkMWp.png" alt="image-20230916224823227"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>如果能靠闲鱼倒卖赚到钱，那明年再抢</p><p><img src="https://s2.loli.net/2023/09/16/6KsIa2g94kGXFCP.png" alt="image-20230916225008002"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>完//</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;抢果子首发的经历&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;2023.9.15，晚上8时整，惊心动魄的抢首发环节&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;国区参赛选手：Leo, Bill, Ryan&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;港区参赛选手：Hertz&lt;</summary>
      
    
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/categories/%E7%94%9F%E6%B4%BB-Life/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>好奇心上头</title>
    <link href="https://ryanstarfox.github.io/2023/09/16/2023/20230914%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/"/>
    <id>https://ryanstarfox.github.io/2023/09/16/2023/20230914%20%E8%8B%B9%E6%9E%9C%E5%8F%91%E5%B8%83%E4%BC%9A/</id>
    <published>2023-09-15T16:03:00.000Z</published>
    <updated>2023-09-15T16:03:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>好奇心上头</h1><p>2023.9.13北京时间凌晨1点，加州来电如约而至，随便聊聊这次发布会：</p><h3 id="iPhone-15-15-plus"><a class="header-anchor" href="#iPhone-15-15-plus">¶</a>iPhone 15 &amp;15 plus</h3><p><img src="https://s2.loli.net/2023/09/15/Awr6Jsh9VqQDlPu.png" alt="1571694791583_.pic_hd"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>iPhone有些无聊，15和15plus又是14pro se 和14 pro max se，如果买15系列真的不如买14pro系列。但是厨子刀法精准，14pro没有type c，15有type c，这就又要斟酌斟酌了。不过有一说一，这次标准版的颜色真的很好看！！有当年iPhone 5C的感觉了。</p><p><img src="https://s2.loli.net/2023/09/15/JBFCliTgkxyec5M.png" alt="1551694791161_.pic_hd"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="iPhone-pro-pro-max"><a class="header-anchor" href="#iPhone-pro-pro-max">¶</a>iPhone pro &amp; pro max</h3><p><img src="https://s2.loli.net/2023/09/15/yI8xB6iLbngtcDu.png" alt="1591694791752_.pic_hd"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>pro系列换了A17 pro芯片。首先这个命名很有意思，以前的A系列芯片都不会带“pro&quot;后缀，但是这次的名字叫做“A17 pro”，那么A17芯片放在哪里呢？现在用A系列芯片的产品也就只有iPhone全系列、iPad数字系列和iPad mini系列。iPhone 16大概率会使用iPhone 15pro的芯片，iPhone16pro也会有新的A18 pro芯片，而最新的芯片是不太可能下方给iPad数字版的，结合一下发布时间，A17大概率会给iPad mini7？（这次发布会也没有iPad和Mac新品，应当意味着还会有10月发布会。）</p><p>A17pro系列用了3nm的制程，照理说是性能更好，也更节能，但是，按照苹果发布会的说法，CPU只有10%的提升，GPU只有20%的提升，但是NPU（神经网络处理器）有100%的提升，说明苹果非常重视AI的性能了。</p><p>此外，苹果还是是否重视游戏性能的提升，开始支持硬件级光追了，甚至还有自己的dlss了（但忘记叫什么名字了）。生化危机这种3A大作都能跑了！星穹铁道和原神都被请来了。期待更多3A级游戏登陆iOS平台。<img src="https://s2.loli.net/2023/09/15/5PSL4zDBHcIxGfg.jpg" alt="未标题-1"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><p>（iPhone 15 pro❎Apple switch ✅）</p><p>USB3的type-c口以及摄像支持直接存入硬盘补全了iPhone视频的最后短板。</p><p>Action button和5倍长焦都算是小更新吧，，而且大多数用户又不会去折腾这些的。</p><p><img src="/images/2023/1561694791187_.pic_hd.jpg" alt="1561694791187_.pic_hd"  data-tag='post-image' onload='this.onload=null;this.style.opacity=1;' loading="lazy" onerror='this.onerror=null;this.src="/img/404.jpg"'></p><h3 id="Watch"><a class="header-anchor" href="#Watch">¶</a>Watch</h3><p>续航没提升=没什么升级</p><p>有一个超宽频技术，没什么用的</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;好奇心上头&lt;/h1&gt;
&lt;p&gt;2023.9.13北京时间凌晨1点，加州来电如约而至，随便聊聊这次发布会：&lt;/p&gt;
&lt;h3 id=&quot;iPhone-15-15-plus&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#iPhone-15-15-plus&quot;&gt;¶&lt;</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="Apple" scheme="https://ryanstarfox.github.io/tags/Apple/"/>
    
    <category term="微信/Wechat" scheme="https://ryanstarfox.github.io/tags/%E5%BE%AE%E4%BF%A1-Wechat/"/>
    
  </entry>
  
  <entry>
    <title>影评：《流浪地球2》</title>
    <link href="https://ryanstarfox.github.io/2023/01/22/2023/20230122%20%E6%B5%81%E6%B5%AA%E5%9C%B0%E7%90%83/"/>
    <id>https://ryanstarfox.github.io/2023/01/22/2023/20230122%20%E6%B5%81%E6%B5%AA%E5%9C%B0%E7%90%83/</id>
    <published>2023-01-22T09:27:07.000Z</published>
    <updated>2023-01-22T09:27:07.000Z</updated>
    
    <content type="html"><![CDATA[<h1>是好的</h1><p>流浪地球2确实比1好很多，首当其冲，感情戏不尴尬，不刻意，不在规训，非常真实，尤其是图桓宇在14年之后重新见到丫丫的那种激动的神态，刘德华真的演得太好了，很令人动容。还有最后老航天人牺牲自己用机械引线引爆核弹，也是非常让人敬畏的。而且这部电影的最大危机不像1那样来的莫名其妙（片尾也解释了1的危机的来源，也算是填坑？），剧情更加完整、连续。</p><p>科幻特效方面，依旧保持了1的水准。各种车辆、飞船都很有机械感，也有设计的连续性。尤其是片首太空电梯的部分，这或许是大银幕上首次展现太空电梯？还有方舟号空间站坠毁的镜头，真的太震撼了！唯有两个特效我不太满意；月球引爆核弹时核弹的动画缺少细节，看上去不像是核弹，只是一个个白色的光球膨胀开来而已。或许没有氧气环境下的核武爆炸是这样的？求科普。另外，月球爆炸那段，总感觉一开始给的远视核弹爆炸的画面没做好。虽然核弹爆炸的范围确实就这么小，但是它的连锁反应是巨大的，应当同一个镜头继续刻画月球爆炸的场景。可是实际上，月球爆炸的镜头被拉近了，导致月球坍塌的画面似乎有些小气。</p><p>缺点也是有的。我尤其不喜欢一个个过场中“xx事件，倒计时xx时间”。它把对于电影的沉浸感完全破坏掉了，就像是在提醒我：这不是真的，你是在电影院里！而且，它像官方剧透一样，我还在想接下来会发生什么呢，它就告诉我了，这不就没有悬疑感了吗？</p><p>这部电影让我失望的一点在于它没有把上传智能的伦理问题探讨。上传智能的伦理问题应该是很有讨论空间的，而且也确实是一个电影的主线之一。关于上传智能是否是人？上传的人和物理的人之间的关系？上传智能被复制了怎么办？似乎电影并没有深入地讨论下去。而且既然上传智能已经几乎成功了，只是缺一个合适地运行环境（550C/550W），为什么不把没能进入地下城地人变成上传智能？这些没有肉体的上传智能和地下城居民地矛盾？这其实可以挖得挺深的。</p><p>我觉得电影的色彩也没有做好。不知是否是我去的影院的问题，总感觉对比度好低，亮度也略微有些低，像没有开启HDR一样，总让人感觉不是很舒服</p><p>总之，片子是好片子，值得去巨幕厅一看，没有失掉1的水准。有提升空间，但总体还是不错的。</p><p>可惜片尾不如1的震撼。1的片尾流浪地球在书页中间飞太美了！感觉可以超过漫威的片头。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;是好的&lt;/h1&gt;
&lt;p&gt;流浪地球2确实比1好很多，首当其冲，感情戏不尴尬，不刻意，不在规训，非常真实，尤其是图桓宇在14年之后重新见到丫丫的那种激动的神态，刘德华真的演得太好了，很令人动容。还有最后老航天人牺牲自己用机械引线引爆核弹，也是非常让人敬畏的。而且这部电影的最大</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
  </entry>
  
  <entry>
    <title>影评：《隐入尘烟》</title>
    <link href="https://ryanstarfox.github.io/2022/09/02/2022/20220902%20%E9%9A%90%E5%85%A5%E5%B0%98%E7%83%9F/"/>
    <id>https://ryanstarfox.github.io/2022/09/02/2022/20220902%20%E9%9A%90%E5%85%A5%E5%B0%98%E7%83%9F/</id>
    <published>2022-09-02T15:31:58.000Z</published>
    <updated>2022-09-02T15:31:58.000Z</updated>
    
    <content type="html"><![CDATA[<h1>没有感情，只有善意</h1><p>今天终于赶上档期的尾巴去院线看了这部电影。确实是好电影，不过我估计电影能过审是因为演员表后有一句“马有铁在政府和热心村民份帮助下，住了新房子，过上了新生活。”</p><p>怎么说呢，看完电影心情复杂。这部电影我感到没有亲情，没有爱情，邻里情有一点点，只有那种最朴素的善良，让人心动，又让人心碎。</p><h2 id="关于爱情"><a class="header-anchor" href="#关于爱情">¶</a>关于爱情</h2><p>马有铁和曹贵英之间有爱情吗？我认为自始至终都是没有的。两个农村弃儿的婚姻来源于包办，他们努力生活，挣扎中萌生的不是爱情，而是依赖感和亲情。他们两个人的角色换成兄妹换成朋友完全是不违和的，唯一不同的在于婚姻的责任与郑重——这从那始终不变的“喜喜”上可以看出来。</p><p>他们见面时是冷淡、害怕的，甚至连结婚照上都是满脸的不高兴。突破口在于有铁给侄子拉家具后回来，贵英送开水。在贵英制作孵小鸡的灯，他们发现灯光变成星星点点的时候，情感汹涌而出。在破房子里竟然也有些浪漫。（感动哭了）两个人在雨中抢救泥土砖的时候两人彻底同心意了（又哭了，原谅我多情）。他们终于有了归属感。</p><p>手上印花的图案，草编的驴…这些就是前后呼应的刀了……</p><h2 id="关于亲情"><a class="header-anchor" href="#关于亲情">¶</a>关于亲情</h2><p>三哥有爱过四弟吗？没有。四弟只是一个工具人，甚至就像是那一头驴子。从电影中看不出四弟对于三哥的看法，但是却可以看到他对于父母、大哥、二哥的尊重。可是我其实很怀疑三哥对于四弟的态度真是反映了他们还在世时对四弟的态度，多么可悲啊。</p><p>亲情被彻底解构成了“钱”，可笑的是，这种对于亲情的亵渎遮遮掩掩后仍然显得虚情假意。是已经烂到根里了吗？连装都装不出了？</p><h2 id="关于献血"><a class="header-anchor" href="#关于献血">¶</a>关于献血</h2><p>这不就是一个“吃人肉”的明显的隐喻吗？唯一的缺点就是那个富人的儿子太脸谱化，不过这是一个可以接受的缺点。不表。</p><p>关于马有铁其人</p><p>他就是一个极度善良、对于自己伤害迟钝（或许是隐忍？），对于别人伤害敏感的人。他体谅驴，照顾燕子，还钱爽气。但估计这样的人只会被归结为老实人、憨人和傻子吧？可是，到底是疯子疯了，还是别人全疯了呢？</p><p>他最后卖掉了所有东西，放走了相依为命的驴，似乎已是看穿一切，超然物外。我更喜欢到这里就戛然而止：马有铁放走了驴，在无垠的沙漠上走着，消失了。</p><h2 id="关于运镜"><a class="header-anchor" href="#关于运镜">¶</a>关于运镜</h2><p>几个印象很深的镜头（不专业）</p><p>马有铁在前面用驴犁田，后面的邻居用拖拉机</p><p>驴车挡了汽车的路</p><p>背景音乐里不时的燕子叫声</p><p>新房落成，下半是黄色土房，上半竹月色的天</p><p>孵化小鸡灯泡的星光</p><p>暴雨中两人互相扶不起来，一起又哭又笑</p><p>关于暗示与比喻</p><p>我注意到的有两个</p><p>曹贵英不小心挖出了麦苗，马有铁说就丢掉吧，当肥料，这是它的命，就像人一样，曹贵英又把它种了下去</p><p>马有铁和曹贵英蹭电视，再放食人鱼。我觉得是在比喻亲人、有钱人家和部分邻居</p><hr><p>很欣慰看到这样的电影能上线。其实现在我们中国好的剧本不少的，但演得好的真的太少了。到处都是歌颂太平，没人去揭露问题。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;没有感情，只有善意&lt;/h1&gt;
&lt;p&gt;今天终于赶上档期的尾巴去院线看了这部电影。确实是好电影，不过我估计电影能过审是因为演员表后有一句“马有铁在政府和热心村民份帮助下，住了新房子，过上了新生活。”&lt;/p&gt;
&lt;p&gt;怎么说呢，看完电影心情复杂。这部电影我感到没有亲情，没有爱情，</summary>
      
    
    
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/categories/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="豆瓣/Douban" scheme="https://ryanstarfox.github.io/tags/%E8%B1%86%E7%93%A3-Douban/"/>
    
  </entry>
  
  <entry>
    <title>漫谈电子书</title>
    <link href="https://ryanstarfox.github.io/2022/05/09/2022/20220509%20%E7%94%B5%E5%AD%90%E4%B9%A6/"/>
    <id>https://ryanstarfox.github.io/2022/05/09/2022/20220509%20%E7%94%B5%E5%AD%90%E4%B9%A6/</id>
    <published>2022-05-09T04:08:00.000Z</published>
    <updated>2025-06-03T10:18:00.000Z</updated>
    
    <content type="html"><![CDATA[<h1>漫谈电子书</h1><p>第一篇知乎长文，聊聊我以前折腾过的电子书。</p><p>本人kindle voyage重度用户</p><h2 id="格式"><a class="header-anchor" href="#格式">¶</a>格式</h2><p>之前我有朋友问我电子书这么多格式有什么区别，我以前的瞎折腾结果和理解如下：</p><ol start="0"><li><p>pdf、docx、txt不是好格式！！！</p></li><li><p>Epub：其为市面上最通用的格式，有广泛支持，但kindle不支持。（亚马逊嫌弃Epub更新太慢，自己过于先进，因此自己创造自由格式）</p></li><li><p>azw3：亚马逊格式，把任何格式的书传到kindle云端，再从kindle下载，这本书的格式就会被自动转换为了azw3。在kindle上可以更换自己喜欢的字体，但不支持直接上传kindle云端，只能用USB拷到kindle里。</p></li><li><p>Mobi：分为两类</p><ul><li>旧版的kf-7，支持上传kindle云端，兼容性更好，但不支持使用自己的字体。网上大多数.mobi文件都是kf-7，据说可以通过calibre把kf-7转换为kf-8，亲测无用，我的方法是先转换为epub，再用kindle官方的kindle previewer转换为kf-8。</li><li>新版kf-8，支持上传kindle云端。支持使用自己的字体。是的，为了好看的字体，我愿意折腾。“自己的字体”指的是我自己拷到电脑的个性化字体，而不是自带的。自带的字体无论什么格式都可以自由转换。（azw3似乎也算一种kf8）</li></ul></li><li><p>Kfx：这个网上应该基本找不到吧？这是亚马逊官方的kindle previewer的内部格式，没啥用，比其他格式用kindle previewer打开更快一些。</p></li><li><p>fb2：似乎是俄罗斯的一种格式？没有用过，不通用。</p></li></ol><p>如果你有kindle，追求最佳的阅读体验——直接买kindle商店里的电子书。</p><p>如果你有kindle，追求最佳阅读体验，但是不想付钱——下载最大的epub格式电子书(可能包含更多图像)，再通过kindle previewer转换为kf-8 mobi。(有时，下载的epub不符合规范协议，无法转换，那么就换几个epub多试试。）</p><p>如果你没有kindle，kf8不是很有必要，几个格式都可。</p><p>apple自带的图书，据说对epub的规范性要求很高，可能需要试很多epub</p><p>有的epub是pdf直接转换来的，格式不规范显得凌乱（有很多奇怪的换行以及突然出现的数字（页码？）），要留个心眼。</p><h2 id="资源"><a class="header-anchor" href="#资源">¶</a>资源</h2><p>至于哪里找到电子书？（按我自己常用度排名）</p><p><a href="https://zh.singlelogin.app/?from=fr1lib.org">Z-Library</a></p><p><a href="519.best">519资源网</a></p><p><a href="sobooks.cc">sobooks</a></p><p><a href="jiumodiary.com">鸠摩搜索</a></p><p>公众号：吾为书狂、周读书社、心慕流霞、力哥的英语小站</p><p><a href="http://www.gutenberg.org/">Project Gutenberg</a></p><p>强推zlibrary！不过有时会出现一些小问题，解决方法见这篇文章(<a href="https://pangniao.net/Z-Library-meiyouzhaodaokeyongdeyuming.html?replyTo=234">https://pangniao.net/Z-Library-meiyouzhaodaokeyongdeyuming.html?replyTo=234</a>)</p><p>这里给的是zlibrary的登陆窗，因为这个网址是固定的，而主网站网址一直在变</p><p>以及电子书咨询站<a href="https://bookfere.com">书伴</a>，里面有各类咨询、图书与字典资源、刷机教程、购买指南</p><hr><h2 id="更新："><a class="header-anchor" href="#更新：">¶</a>更新：</h2><p>kindle离开中国了，我不离不弃，但是我实在等不下去了，高考之后买了文石leaf2，就无所谓格式了，基本上都能下载到epub<br>kindle真的让我意难平了，尤其是现在：其实我需要的只是一台有实体键和type c的kindle，但是到现在也没有过——我本来期待的是换上type c的Kindle Oasis，结果亚马逊端上来了Kindle Scribe和Kindle ColorSoft<br>文石的体验很好，虽然确实有色偏的问题，但是小问题</p><p>我的kindle voyage: 2015-2023<br>我的boox leaf 2: 2023-？</p><p>换设备了再更新吧</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h1&gt;漫谈电子书&lt;/h1&gt;
&lt;p&gt;第一篇知乎长文，聊聊我以前折腾过的电子书。&lt;/p&gt;
&lt;p&gt;本人kindle voyage重度用户&lt;/p&gt;
&lt;h2 id=&quot;格式&quot;&gt;&lt;a class=&quot;header-anchor&quot; href=&quot;#格式&quot;&gt;¶&lt;/a&gt;格式&lt;/h2&gt;
&lt;p&gt;之前我有朋</summary>
      
    
    
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/categories/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    
    <category term="生活/Life" scheme="https://ryanstarfox.github.io/tags/%E7%94%9F%E6%B4%BB-Life/"/>
    
    <category term="技术/Tech" scheme="https://ryanstarfox.github.io/tags/%E6%8A%80%E6%9C%AF-Tech/"/>
    
    <category term="书影音/Books and Movies" scheme="https://ryanstarfox.github.io/tags/%E4%B9%A6%E5%BD%B1%E9%9F%B3-Books-and-Movies/"/>
    
    <category term="知乎/Zhihu" scheme="https://ryanstarfox.github.io/tags/%E7%9F%A5%E4%B9%8E-Zhihu/"/>
    
  </entry>
  
</feed>
