<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>戴蒙斯的网络日志</title>
  <icon>http://www.codepapper.com/icon.png</icon>
  <subtitle>代码 · 思考 · 笔记</subtitle>
  <link href="http://www.codepapper.com/atom.xml" rel="self"/>
  
  <link href="http://www.codepapper.com/"/>
  <updated>2026-04-15T12:15:00.000Z</updated>
  <id>http://www.codepapper.com/</id>
  
  <author>
    <name>戴蒙斯</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>如何理解递归——假设子问题已解决</title>
    <link href="http://www.codepapper.com/posts/recursion-thinking/"/>
    <id>http://www.codepapper.com/posts/recursion-thinking/</id>
    <published>2026-04-15T12:15:00.000Z</published>
    <updated>2026-04-15T12:15:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="完成递归的两个关键"><a href="#完成递归的两个关键" class="headerlink" title="完成递归的两个关键"></a>完成递归的两个关键</h2><ol><li><strong>抽象成递推公式</strong></li><li><strong>找到终止条件</strong></li></ol><h2 id="快速理解递归"><a href="#快速理解递归" class="headerlink" title="快速理解递归"></a>快速理解递归</h2><p>如果一个问题 A 可以分解为若干个子问题 B、C、D，你可以<strong>假设子问题 B、C、D 已经解决</strong>，在此基础上思考如何解决问题 A。</p><p>你只需要思考问题 A 与子问题 B、C、D <strong>两层之间的关系</strong>，不需要一层一层往下思考子问题与子子问题之间的关系。屏蔽掉递归细节，理解起来就简单多了。</p><h2 id="关键心态"><a href="#关键心态" class="headerlink" title="关键心态"></a>关键心态</h2><blockquote><p>不用想一层层的调用关系，不要试图用人脑去分解递归的每个步骤。</p></blockquote><p>人脑没办法想清楚整个”递”和”归”的过程。计算机擅长做重复的事情，递归正合它的胃口。而人脑更喜欢平铺直叙的思维方式——我们总想把递归平铺展开，脑子里一直循环，一层一层往下调再一层一层返回，试图搞清楚计算机每一步如何执行，这样就很容易被绕进去。</p><p><strong>把信任交给计算机，把直觉留给自己。</strong></p>]]></content>
    
    
    <summary type="html">理解递归的关键在于假设子问题已解决，不要试图在脑中展开调用栈</summary>
    
    
    
    <category term="算法" scheme="http://www.codepapper.com/categories/%E7%AE%97%E6%B3%95/"/>
    
    
    <category term="算法" scheme="http://www.codepapper.com/tags/%E7%AE%97%E6%B3%95/"/>
    
    <category term="递归" scheme="http://www.codepapper.com/tags/%E9%80%92%E5%BD%92/"/>
    
    <category term="编程思维" scheme="http://www.codepapper.com/tags/%E7%BC%96%E7%A8%8B%E6%80%9D%E7%BB%B4/"/>
    
  </entry>
  
  <entry>
    <title>Hexo + GitHub Pages 搭建博客全流程</title>
    <link href="http://www.codepapper.com/posts/hexo-github-pages-setup/"/>
    <id>http://www.codepapper.com/posts/hexo-github-pages-setup/</id>
    <published>2025-07-22T00:30:00.000Z</published>
    <updated>2026-04-15T12:15:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="1-Hexo-安装与初始化"><a href="#1-Hexo-安装与初始化" class="headerlink" title="1. Hexo 安装与初始化"></a>1. Hexo 安装与初始化</h2><figure class="highlight bash"><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><code class="hljs bash">npm install -g hexo-cli<br>hexo init my-blog<br><span class="hljs-built_in">cd</span> my-blog<br>npm install<br>hexo server    <span class="hljs-comment"># 本地预览 http://localhost:4000</span><br></code></pre></td></tr></table></figure><h2 id="2-部署到-GitHub-Pages"><a href="#2-部署到-GitHub-Pages" class="headerlink" title="2. 部署到 GitHub Pages"></a>2. 部署到 GitHub Pages</h2><p>在 GitHub 创建 <code>用户名.github.io</code> 仓库，然后安装部署插件：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">npm install hexo-deployer-git --save<br></code></pre></td></tr></table></figure><p>修改 <code>_config.yml</code> 末尾：</p><figure class="highlight yaml"><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><code class="hljs yaml"><span class="hljs-attr">deploy:</span><br>  <span class="hljs-attr">type:</span> <span class="hljs-string">git</span><br>  <span class="hljs-attr">repo:</span> <span class="hljs-string">https://github.com/yourusername/yourusername.github.io.git</span><br>  <span class="hljs-attr">branch:</span> <span class="hljs-string">master</span><br></code></pre></td></tr></table></figure><p>部署命令：</p><figure class="highlight bash"><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><code class="hljs bash">hexo clean<br>hexo generate<br>hexo deploy<br><span class="hljs-comment"># 简写：hexo g -d</span><br></code></pre></td></tr></table></figure><h2 id="3-绑定自定义域名"><a href="#3-绑定自定义域名" class="headerlink" title="3. 绑定自定义域名"></a>3. 绑定自定义域名</h2><ol><li>购买域名（推荐 <code>.com</code>、<code>.net</code> 等老牌顶级域名，权重较高）</li><li>在 DNS 服务商处添加解析记录，指向 GitHub Pages 的 IP</li><li>在 <code>source/</code> 目录下创建 <code>CNAME</code> 文件，写入你的域名</li><li>在 GitHub 仓库 Settings → Pages → Custom domain 中填写域名</li></ol><h2 id="常用命令速查"><a href="#常用命令速查" class="headerlink" title="常用命令速查"></a>常用命令速查</h2><table><thead><tr><th>命令</th><th>作用</th></tr></thead><tbody><tr><td><code>hexo clean</code></td><td>清除缓存（public 文件夹）</td></tr><tr><td><code>hexo g</code></td><td>生成静态网页</td></tr><tr><td><code>hexo d</code></td><td>部署到 GitHub</td></tr><tr><td><code>hexo g -d</code></td><td>生成并部署</td></tr><tr><td><code>hexo s</code></td><td>本地预览</td></tr><tr><td><code>hexo new &quot;标题&quot;</code></td><td>新建文章</td></tr></tbody></table>]]></content>
    
    
    <summary type="html">从零搭建 Hexo 博客、部署到 GitHub Pages、绑定自定义域名的完整步骤</summary>
    
    
    
    <category term="工具" scheme="http://www.codepapper.com/categories/%E5%B7%A5%E5%85%B7/"/>
    
    
    <category term="Hexo" scheme="http://www.codepapper.com/tags/Hexo/"/>
    
    <category term="GitHub Pages" scheme="http://www.codepapper.com/tags/GitHub-Pages/"/>
    
    <category term="博客" scheme="http://www.codepapper.com/tags/%E5%8D%9A%E5%AE%A2/"/>
    
    <category term="域名" scheme="http://www.codepapper.com/tags/%E5%9F%9F%E5%90%8D/"/>
    
  </entry>
  
</feed>
