<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>东哥哥9527</title>
  
  <subtitle>欢迎来我的博客</subtitle>
  <link href="https://cdd9527.cn/atom.xml" rel="self"/>
  
  <link href="https://cdd9527.cn/"/>
  <updated>2026-04-11T01:55:14.941Z</updated>
  <id>https://cdd9527.cn/</id>
  
  <author>
    <name>东哥哥9527</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>使用VPS搭建梯子，3x-ui使用教程</title>
    <link href="https://cdd9527.cn/posts/3x-ui/"/>
    <id>https://cdd9527.cn/posts/3x-ui/</id>
    <published>2026-04-11T04:00:00.000Z</published>
    <updated>2026-04-11T01:55:14.941Z</updated>
    
    <content type="html"><![CDATA[<h1 id="1、创建容器"><a href="#1、创建容器" class="headerlink" title="1、创建容器"></a>1、创建容器</h1><p>docker run -d -p 2053:2053 -p 2053:2053&#x2F;udp --restart&#x3D;always --name 3xui_app -v $PWD&#x2F;3x-ui-app:&#x2F;etc&#x2F;3x-ui --net&#x3D;host ghcr.io&#x2F;mhsanaei&#x2F;3x-ui:latest</p><h1 id="2、添加入站"><a href="#2、添加入站" class="headerlink" title="2、添加入站"></a>2、添加入站</h1><p><img src="https://cdn.jsdelivr.net/gh/ChadDongDongChen/blog-img@main/20260411095428923.png"></p>]]></content>
    
    
    <summary type="html">使用VPS搭建梯子，3x-ui使用教程</summary>
    
    
    
    <category term="工具" scheme="https://cdd9527.cn/categories/%E5%B7%A5%E5%85%B7/"/>
    
    
    <category term="3X-UI" scheme="https://cdd9527.cn/tags/3X-UI/"/>
    
    <category term="梯子" scheme="https://cdd9527.cn/tags/%E6%A2%AF%E5%AD%90/"/>
    
  </entry>
  
  <entry>
    <title>使用GitHub和PicGo搭建个人图床</title>
    <link href="https://cdd9527.cn/posts/10023-github-picgo-image-host/"/>
    <id>https://cdd9527.cn/posts/10023-github-picgo-image-host/</id>
    <published>2026-03-26T04:00:00.000Z</published>
    <updated>2026-03-26T05:56:04.104Z</updated>
    
    <content type="html"><![CDATA[<h1 id="使用GitHub和PicGo搭建个人图床"><a href="#使用GitHub和PicGo搭建个人图床" class="headerlink" title="使用GitHub和PicGo搭建个人图床"></a>使用GitHub和PicGo搭建个人图床</h1><p>在撰写技术博客或文档时，图片管理是一个常见且重要的问题。将图片直接放在本地会导致文档迁移困难，而使用第三方图床服务又可能面临稳定性和隐私问题。本文将介绍如何利用GitHub的免费存储空间和PicGo工具搭建个人专属图床，实现高效、稳定的图片管理。</p><h2 id="什么是图床？"><a href="#什么是图床？" class="headerlink" title="什么是图床？"></a>什么是图床？</h2><p>图床（Image Hosting）是指专门用于存储图片的网络服务器。通过图床，我们可以将图片上传到云端，并在文档中通过URL引用这些图片。这样不仅减少了本地存储压力，也使得文档可以在任何地方被正确渲染。</p><h2 id="为什么选择GitHub-PicGo？"><a href="#为什么选择GitHub-PicGo？" class="headerlink" title="为什么选择GitHub + PicGo？"></a>为什么选择GitHub + PicGo？</h2><h3 id="GitHub的优势"><a href="#GitHub的优势" class="headerlink" title="GitHub的优势"></a>GitHub的优势</h3><ol><li><strong>免费存储</strong>：GitHub为每个仓库提供1GB的存储空间，对于个人博客完全足够</li><li><strong>版本控制</strong>：可以方便地管理图片的历史版本</li><li><strong>可靠性高</strong>：GitHub作为全球最大的代码托管平台，稳定性有保障</li><li><strong>支持CDN加速</strong>：可以通过jsDelivr等CDN服务加速图片访问</li></ol><h3 id="PicGo的优势"><a href="#PicGo的优势" class="headerlink" title="PicGo的优势"></a>PicGo的优势</h3><ol><li><strong>跨平台支持</strong>：支持Windows、macOS、Linux系统</li><li><strong>简单易用</strong>：图形化界面操作，配置简单</li><li><strong>多平台支持</strong>：除了GitHub，还支持七牛云、阿里云、腾讯云等多种图床</li><li><strong>快捷上传</strong>：支持拖拽上传、剪贴板上传等多种方式</li></ol><h2 id="搭建步骤"><a href="#搭建步骤" class="headerlink" title="搭建步骤"></a>搭建步骤</h2><h3 id="1-创建GitHub仓库"><a href="#1-创建GitHub仓库" class="headerlink" title="1. 创建GitHub仓库"></a>1. 创建GitHub仓库</h3><p>首先，我们需要在GitHub上创建一个专门用于存储图片的仓库：</p><ol><li>登录GitHub，点击右上角的&quot;+&quot;号，选择&quot;New repository&quot;</li><li>填写仓库名称，如&quot;blog-images&quot;</li><li>添加描述（可选）</li><li>选择&quot;Public&quot;（公开仓库，这样才能通过CDN访问）</li><li>勾选&quot;Initialize this repository with a README&quot;（可选）</li><li>点击&quot;Create repository&quot;</li></ol><h3 id="2-生成访问令牌（Token）"><a href="#2-生成访问令牌（Token）" class="headerlink" title="2. 生成访问令牌（Token）"></a>2. 生成访问令牌（Token）</h3><p>为了安全地上传图片，我们需要创建一个GitHub访问令牌：</p><ol><li>点击GitHub右上角的头像，选择&quot;Settings&quot;</li><li>在左侧菜单中找到&quot;Developer settings&quot;</li><li>选择&quot;Personal access tokens&quot; → &quot;Tokens (classic)&quot;</li><li>点击&quot;Generate new token&quot; → &quot;Generate new token (classic)&quot;</li><li>设置令牌描述，如&quot;PicGo图床&quot;</li><li>勾选权限：至少需要勾选&quot;repo&quot;（完全控制仓库）</li><li>点击&quot;Generate token&quot;</li><li><strong>重要</strong>：复制生成的令牌并妥善保存，离开页面后将无法再次查看</li></ol><h3 id="3-安装和配置PicGo"><a href="#3-安装和配置PicGo" class="headerlink" title="3. 安装和配置PicGo"></a>3. 安装和配置PicGo</h3><h4 id="安装PicGo"><a href="#安装PicGo" class="headerlink" title="安装PicGo"></a>安装PicGo</h4><ul><li>访问PicGo官网（<a href="https://molunerfinn.com/PicGo/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%AF%B9%E5%BA%94%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%AE%89%E8%A3%85%E5%8C%85">https://molunerfinn.com/PicGo/）下载对应系统的安装包</a></li><li>按照提示完成安装</li></ul><h4 id="配置GitHub图床"><a href="#配置GitHub图床" class="headerlink" title="配置GitHub图床"></a>配置GitHub图床</h4><ol><li>打开PicGo，在左侧选择&quot;图床设置&quot; → &quot;GitHub图床&quot;</li><li>填写配置信息：<ul><li>仓库名：<code>用户名/仓库名</code>（如：ChadDongDongChen&#x2F;blog-images）</li><li>分支：<code>main</code>（默认分支）</li><li>Token：粘贴之前生成的GitHub Token</li><li>存储路径：<code>img/</code>（可选，用于分类管理图片）</li><li>自定义域名：<code>https://cdn.jsdelivr.net/gh/用户名/仓库名@分支</code></li></ul></li><li>点击&quot;确定&quot;保存配置</li><li>点击&quot;设为默认图床&quot;</li></ol><h3 id="4-测试上传功能"><a href="#4-测试上传功能" class="headerlink" title="4. 测试上传功能"></a>4. 测试上传功能</h3><ol><li>在PicGo的&quot;上传区&quot;拖拽一张图片或点击&quot;选择文件&quot;</li><li>上传成功后，图片URL会自动复制到剪贴板</li><li>可以点击&quot;相册&quot;查看所有已上传的图片</li></ol><h3 id="5-配置Typora实现自动上传"><a href="#5-配置Typora实现自动上传" class="headerlink" title="5. 配置Typora实现自动上传"></a>5. 配置Typora实现自动上传</h3><p>如果你使用Typora编写Markdown文档，可以配置其自动上传图片到图床：</p><ol><li>打开Typora，进入&quot;文件&quot; → &quot;偏好设置&quot;</li><li>选择&quot;图像&quot;选项卡</li><li>在&quot;上传服务&quot;中选择&quot;PicGo(app)&quot;</li><li>点击&quot;验证图片上传选项&quot;测试配置是否成功</li><li>之后在Typora中粘贴图片时，会自动上传到图床并替换为线上地址</li></ol><h2 id="使用jsDelivr进行CDN加速"><a href="#使用jsDelivr进行CDN加速" class="headerlink" title="使用jsDelivr进行CDN加速"></a>使用jsDelivr进行CDN加速</h2><p>虽然GitHub本身可以访问图片，但速度可能较慢。我们可以使用jsDelivr进行CDN加速：</p><ol><li><p>图片的原始GitHub地址格式为：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://raw.githubusercontent.com/用户名/仓库名/分支/图片路径</span><br></pre></td></tr></table></figure></li><li><p>转换为jsDelivr地址：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://cdn.jsdelivr.net/gh/用户名/仓库名@分支/图片路径</span><br></pre></td></tr></table></figure></li><li><p>在PicGo的&quot;自定义域名&quot;中设置jsDelivr地址后，上传的图片会自动使用CDN加速</p></li></ol><h2 id="最佳实践和注意事项"><a href="#最佳实践和注意事项" class="headerlink" title="最佳实践和注意事项"></a>最佳实践和注意事项</h2><h3 id="1-图片命名规范"><a href="#1-图片命名规范" class="headerlink" title="1. 图片命名规范"></a>1. 图片命名规范</h3><ul><li>使用有意义的英文文件名，避免中文和特殊字符</li><li>可以按日期分类：<code>20260326/ubuntu-installation-01.png</code></li><li>保持文件名简洁明了</li></ul><h3 id="2-隐私和安全"><a href="#2-隐私和安全" class="headerlink" title="2. 隐私和安全"></a>2. 隐私和安全</h3><ul><li>不要上传包含敏感信息的图片</li><li>定期检查GitHub Token的权限，避免过度授权</li><li>如果更换Token，记得更新PicGo配置</li></ul><h3 id="3-备份策略"><a href="#3-备份策略" class="headerlink" title="3. 备份策略"></a>3. 备份策略</h3><ul><li>虽然GitHub很稳定，但仍建议定期备份重要图片</li><li>可以使用Git命令本地克隆仓库进行备份</li></ul><h3 id="4-性能优化"><a href="#4-性能优化" class="headerlink" title="4. 性能优化"></a>4. 性能优化</h3><ul><li>对于博客中的图片，适当压缩后再上传</li><li>可以使用TinyPNG等工具压缩图片</li><li>建议图片大小控制在500KB以内</li></ul><h2 id="常见问题解决"><a href="#常见问题解决" class="headerlink" title="常见问题解决"></a>常见问题解决</h2><h3 id="1-上传失败"><a href="#1-上传失败" class="headerlink" title="1. 上传失败"></a>1. 上传失败</h3><ul><li>检查Token是否过期或权限不足</li><li>确认仓库名格式是否正确</li><li>检查网络连接</li></ul><h3 id="2-图片无法访问"><a href="#2-图片无法访问" class="headerlink" title="2. 图片无法访问"></a>2. 图片无法访问</h3><ul><li>确认仓库是否为公开（Public）状态</li><li>检查图片路径是否正确</li><li>确认CDN是否生效</li></ul><h3 id="3-Typora上传失败"><a href="#3-Typora上传失败" class="headerlink" title="3. Typora上传失败"></a>3. Typora上传失败</h3><ul><li>确认PicGo正在运行</li><li>检查Typora配置是否正确</li><li>尝试重启Typora和PicGo</li></ul><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>使用GitHub和PicGo搭建个人图床是一个简单、免费且可靠的解决方案。通过这种方式，我们可以：</p><ol><li>统一管理所有文档中的图片</li><li>实现Markdown编辑器中的自动上传</li><li>通过CDN加速提升图片加载速度</li><li>利用GitHub的版本控制功能管理图片历史</li></ol><p>无论是技术博客、项目文档还是个人笔记，一个稳定的图床都能极大地提升写作体验和文档的可维护性。希望本教程能帮助你顺利搭建自己的图床系统！</p>]]></content>
    
    
    <summary type="html">本教程详细介绍如何使用GitHub和PicGo搭建个人图床，实现Markdown文档中的图片自动上传和管理，并通过jsDelivr进行CDN加速提升访问速度。</summary>
    
    
    
    <category term="工具" scheme="https://cdd9527.cn/categories/%E5%B7%A5%E5%85%B7/"/>
    
    
    <category term="Markdown" scheme="https://cdd9527.cn/tags/Markdown/"/>
    
    <category term="GitHub" scheme="https://cdd9527.cn/tags/GitHub/"/>
    
    <category term="PicGo" scheme="https://cdd9527.cn/tags/PicGo/"/>
    
    <category term="图床" scheme="https://cdd9527.cn/tags/%E5%9B%BE%E5%BA%8A/"/>
    
    <category term="博客" scheme="https://cdd9527.cn/tags/%E5%8D%9A%E5%AE%A2/"/>
    
    <category term="工具" scheme="https://cdd9527.cn/tags/%E5%B7%A5%E5%85%B7/"/>
    
  </entry>
  
  <entry>
    <title>Nginx + Certbot 自动HTTPS证书与反向代理完整教程</title>
    <link href="https://cdd9527.cn/posts/10022-nginx-https-certbot/"/>
    <id>https://cdd9527.cn/posts/10022-nginx-https-certbot/</id>
    <published>2026-03-26T00:30:00.000Z</published>
    <updated>2026-03-26T05:55:03.056Z</updated>
    
    <content type="html"><![CDATA[<hr><h1 id="Nginx-Certbot-自动HTTPS证书与反向代理完整教程"><a href="#Nginx-Certbot-自动HTTPS证书与反向代理完整教程" class="headerlink" title="Nginx + Certbot 自动HTTPS证书与反向代理完整教程"></a>Nginx + Certbot 自动HTTPS证书与反向代理完整教程</h1><p>本文将手把手教你如何为域名（如 <code>artalk.cdd9527.cn</code>）配置 HTTPS，并通过 Nginx 实现反向代理，同时支持证书自动续期。</p><hr><h2 id="一、准备条件"><a href="#一、准备条件" class="headerlink" title="一、准备条件"></a>一、准备条件</h2><p>在开始之前，请确保满足以下条件：</p><ul><li><p>已拥有域名（如 <code>artalk.cdd9527.cn</code>）</p></li><li><p>域名已解析到服务器 IP</p></li><li><p>服务器已安装 Nginx</p></li><li><p>已开放端口：</p><ul><li>80（HTTP）</li><li>443（HTTPS）</li></ul></li></ul><hr><h2 id="二、安装-Certbot"><a href="#二、安装-Certbot" class="headerlink" title="二、安装 Certbot"></a>二、安装 Certbot</h2><h3 id="Ubuntu-Debian"><a href="#Ubuntu-Debian" class="headerlink" title="Ubuntu &#x2F; Debian"></a>Ubuntu &#x2F; Debian</h3><figure class="highlight bash"><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">apt update</span><br><span class="line">apt install certbot python3-certbot-nginx -y</span><br></pre></td></tr></table></figure><hr><h2 id="三、申请-HTTPS-证书"><a href="#三、申请-HTTPS-证书" class="headerlink" title="三、申请 HTTPS 证书"></a>三、申请 HTTPS 证书</h2><p>执行以下命令：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">certbot --nginx -d artalk.cdd9527.cn</span><br></pre></td></tr></table></figure><h3 id="过程中会提示："><a href="#过程中会提示：" class="headerlink" title="过程中会提示："></a>过程中会提示：</h3><h4 id="1-输入邮箱"><a href="#1-输入邮箱" class="headerlink" title="1. 输入邮箱"></a>1. 输入邮箱</h4><p>用于证书续期提醒</p><h4 id="2-是否同意协议"><a href="#2-是否同意协议" class="headerlink" title="2. 是否同意协议"></a>2. 是否同意协议</h4><p>输入：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Y</span><br></pre></td></tr></table></figure><h4 id="3-是否接收邮件"><a href="#3-是否接收邮件" class="headerlink" title="3. 是否接收邮件"></a>3. 是否接收邮件</h4><p>建议：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">N</span><br></pre></td></tr></table></figure><hr><h2 id="四、成功标志"><a href="#四、成功标志" class="headerlink" title="四、成功标志"></a>四、成功标志</h2><p>如果看到：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Congratulations! Your certificate and chain have been saved</span><br></pre></td></tr></table></figure><p>说明证书申请成功 ✅</p><hr><h2 id="五、Nginx-标准配置（推荐）"><a href="#五、Nginx-标准配置（推荐）" class="headerlink" title="五、Nginx 标准配置（推荐）"></a>五、Nginx 标准配置（推荐）</h2><h3 id="1️⃣-HTTP-自动跳转-HTTPS"><a href="#1️⃣-HTTP-自动跳转-HTTPS" class="headerlink" title="1️⃣ HTTP 自动跳转 HTTPS"></a>1️⃣ HTTP 自动跳转 HTTPS</h3><figure class="highlight nginx"><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"><span class="section">server</span> &#123;</span><br><span class="line">    <span class="attribute">listen</span> <span class="number">80</span>;</span><br><span class="line">    <span class="attribute">server_name</span> artalk.cdd9527.cn;</span><br><span class="line"></span><br><span class="line">    <span class="attribute">return</span> <span class="number">301</span> https://<span class="variable">$host</span><span class="variable">$request_uri</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><hr><h3 id="2️⃣-HTTPS-反向代理"><a href="#2️⃣-HTTPS-反向代理" class="headerlink" title="2️⃣ HTTPS + 反向代理"></a>2️⃣ HTTPS + 反向代理</h3><figure class="highlight nginx"><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></pre></td><td class="code"><pre><span class="line"><span class="section">server</span> &#123;</span><br><span class="line">    <span class="attribute">listen</span> <span class="number">443</span> ssl;</span><br><span class="line">    <span class="attribute">server_name</span> artalk.cdd9527.cn;</span><br><span class="line"></span><br><span class="line">    <span class="attribute">ssl_certificate</span> /etc/letsencrypt/live/artalk.cdd9527.cn/fullchain.pem;</span><br><span class="line">    <span class="attribute">ssl_certificate_key</span> /etc/letsencrypt/live/artalk.cdd9527.cn/privkey.pem;</span><br><span class="line"></span><br><span class="line">    <span class="attribute">ssl_protocols</span> TLSv1.<span class="number">2</span> TLSv1.<span class="number">3</span>;</span><br><span class="line">    <span class="attribute">ssl_ciphers</span> HIGH:!aNULL:!MD5;</span><br><span class="line"></span><br><span class="line">    <span class="section">location</span> / &#123;</span><br><span class="line">        <span class="attribute">proxy_pass</span> http://127.0.0.1:5006;</span><br><span class="line"></span><br><span class="line">        <span class="attribute">proxy_set_header</span> Host <span class="variable">$host</span>;</span><br><span class="line">        <span class="attribute">proxy_set_header</span> X-Real-IP <span class="variable">$remote_addr</span>;</span><br><span class="line">        <span class="attribute">proxy_set_header</span> X-Forwarded-For <span class="variable">$proxy_add_x_forwarded_for</span>;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><hr><h2 id="六、访问效果"><a href="#六、访问效果" class="headerlink" title="六、访问效果"></a>六、访问效果</h2><p>现在访问：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://artalk.cdd9527.cn</span><br></pre></td></tr></table></figure><p>实际访问路径：</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">用户 → Nginx(443) → 本地服务(5006)</span><br></pre></td></tr></table></figure><p>👉 不再暴露端口，更安全</p><hr><h2 id="七、自动续期"><a href="#七、自动续期" class="headerlink" title="七、自动续期"></a>七、自动续期</h2><p>Certbot 会自动添加定时任务</p><h3 id="手动测试："><a href="#手动测试：" class="headerlink" title="手动测试："></a>手动测试：</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">certbot renew --dry-run</span><br></pre></td></tr></table></figure><hr><h2 id="八、常见问题"><a href="#八、常见问题" class="headerlink" title="八、常见问题"></a>八、常见问题</h2><h3 id="1️⃣-提示-nginx-插件不存在"><a href="#1️⃣-提示-nginx-插件不存在" class="headerlink" title="1️⃣ 提示 nginx 插件不存在"></a>1️⃣ 提示 nginx 插件不存在</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">The requested nginx plugin does not appear to be installed</span><br></pre></td></tr></table></figure><p>解决：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">apt install python3-certbot-nginx -y</span><br></pre></td></tr></table></figure><hr><h3 id="2️⃣-验证失败（80端口问题）"><a href="#2️⃣-验证失败（80端口问题）" class="headerlink" title="2️⃣ 验证失败（80端口问题）"></a>2️⃣ 验证失败（80端口问题）</h3><p>原因：</p><ul><li>80端口未开放</li><li>被防火墙拦截</li></ul><p>解决：</p><figure class="highlight bash"><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">ufw allow 80</span><br><span class="line">ufw allow 443</span><br></pre></td></tr></table></figure><hr><h3 id="3️⃣-域名解析错误"><a href="#3️⃣-域名解析错误" class="headerlink" title="3️⃣ 域名解析错误"></a>3️⃣ 域名解析错误</h3><p>检查：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ping artalk.cdd9527.cn</span><br></pre></td></tr></table></figure><hr><h3 id="4️⃣-Nginx-配置错误"><a href="#4️⃣-Nginx-配置错误" class="headerlink" title="4️⃣ Nginx 配置错误"></a>4️⃣ Nginx 配置错误</h3><p>检查：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">nginx -t</span><br></pre></td></tr></table></figure><hr><h2 id="九、进阶建议"><a href="#九、进阶建议" class="headerlink" title="九、进阶建议"></a>九、进阶建议</h2><h3 id="推荐优化："><a href="#推荐优化：" class="headerlink" title="推荐优化："></a>推荐优化：</h3><ul><li>不暴露业务端口（如 5006）</li><li>所有服务统一走 Nginx</li><li>多域名统一管理</li></ul><hr><h2 id="十、总结"><a href="#十、总结" class="headerlink" title="十、总结"></a>十、总结</h2><p>完整流程如下：</p><ol><li>安装 Certbot</li><li>申请证书</li><li>配置 Nginx</li><li>开启 HTTPS</li><li>自动续期</li></ol><p>👉 核心原则：</p><ul><li>80端口：用于跳转 + 验证</li><li>443端口：用于正式服务</li></ul><hr><h2 id="延伸阅读"><a href="#延伸阅读" class="headerlink" title="延伸阅读"></a>延伸阅读</h2><ul><li><a href="https://letsencrypt.org/">https://letsencrypt.org/</a></li><li><a href="https://nginx.org/">https://nginx.org/</a></li></ul><hr>]]></content>
    
    
    <summary type="html">本教程详细介绍如何使用 Certbot 自动申请 HTTPS 证书，并结合 Nginx 实现反向代理与自动续期，适用于生产环境部署。</summary>
    
    
    
    <category term="运维" scheme="https://cdd9527.cn/categories/%E8%BF%90%E7%BB%B4/"/>
    
    
    <category term="Linux" scheme="https://cdd9527.cn/tags/Linux/"/>
    
    <category term="Nginx" scheme="https://cdd9527.cn/tags/Nginx/"/>
    
    <category term="HTTPS" scheme="https://cdd9527.cn/tags/HTTPS/"/>
    
    <category term="Certbot" scheme="https://cdd9527.cn/tags/Certbot/"/>
    
    <category term="反向代理" scheme="https://cdd9527.cn/tags/%E5%8F%8D%E5%90%91%E4%BB%A3%E7%90%86/"/>
    
  </entry>
  
  <entry>
    <title>Ubuntu Linux 安装完整教程</title>
    <link href="https://cdd9527.cn/posts/10021-ubuntu-installation/"/>
    <id>https://cdd9527.cn/posts/10021-ubuntu-installation/</id>
    <published>2026-03-25T06:30:00.000Z</published>
    <updated>2026-03-26T05:54:11.921Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Ubuntu-Linux-安装完整教程"><a href="#Ubuntu-Linux-安装完整教程" class="headerlink" title="Ubuntu Linux 安装完整教程"></a>Ubuntu Linux 安装完整教程</h1><p>Ubuntu 是目前最流行的 Linux 发行版之一，以其友好的用户界面、强大的社区支持和稳定的系统性能而闻名。本教程将详细介绍 Ubuntu 的安装过程，无论是作为主系统、双系统还是在虚拟机中运行。</p><h2 id="系统要求"><a href="#系统要求" class="headerlink" title="系统要求"></a>系统要求</h2><p>在开始安装之前，请确保你的计算机满足以下最低要求：</p><ul><li><strong>处理器</strong>：2 GHz 双核处理器或更高</li><li><strong>内存</strong>：4 GB RAM（推荐 8 GB 或以上）</li><li><strong>硬盘空间</strong>：25 GB 可用空间（推荐 50 GB 或以上）</li><li><strong>显示器</strong>：1024×768 分辨率</li><li><strong>启动介质</strong>：U盘（至少 4 GB）或 DVD</li></ul><span id="more"></span>where<h2 id="第一步：下载-Ubuntu-镜像"><a href="#第一步：下载-Ubuntu-镜像" class="headerlink" title="第一步：下载 Ubuntu 镜像"></a>第一步：下载 Ubuntu 镜像</h2><ol><li>访问 <a href="https://ubuntu.com/download">Ubuntu 官网</a></li><li>选择适合的版本：<ul><li><strong>LTS 版本</strong>（长期支持版）：适合生产环境和普通用户，支持周期长达 5 年</li><li><strong>最新版本</strong>：包含最新的特性和软件，支持周期较短</li></ul></li><li>点击下载按钮，获取 ISO 镜像文件（约 2-4 GB）</li></ol><h2 id="第二步：制作启动-U-盘"><a href="#第二步：制作启动-U-盘" class="headerlink" title="第二步：制作启动 U 盘"></a>第二步：制作启动 U 盘</h2><h3 id="Windows-用户使用-Rufus"><a href="#Windows-用户使用-Rufus" class="headerlink" title="Windows 用户使用 Rufus"></a>Windows 用户使用 Rufus</h3><ol><li>下载并安装 <a href="https://rufus.ie/">Rufus</a></li><li>插入 U 盘（注意：制作过程会格式化 U 盘，请备份重要数据）</li><li>打开 Rufus，选择：<ul><li>设备：你的 U 盘</li><li>引导类型选择：选择下载的 Ubuntu ISO 文件</li><li>分区类型：根据你的计算机选择 MBR（传统 BIOS）或 GPT（UEFI）</li></ul></li><li>点击“开始”，等待制作完成</li></ol><h3 id="macOS-用户使用-Etcher"><a href="#macOS-用户使用-Etcher" class="headerlink" title="macOS 用户使用 Etcher"></a>macOS 用户使用 Etcher</h3><ol><li>下载并安装 <a href="https://www.balena.io/etcher/">Etcher</a></li><li>插入 U 盘</li><li>打开 Etcher，选择 ISO 文件，选择 U 盘，点击“Flash!”</li><li>等待制作完成</li></ol><h2 id="第三步：启动安装程序"><a href="#第三步：启动安装程序" class="headerlink" title="第三步：启动安装程序"></a>第三步：启动安装程序</h2><ol><li>重启计算机，进入 BIOS&#x2F;UEFI 设置（通常是按 F2、F10、F12 或 Delete 键）</li><li>设置 U 盘为第一启动项</li><li>保存设置并重启</li></ol><h2 id="第四步：安装-Ubuntu"><a href="#第四步：安装-Ubuntu" class="headerlink" title="第四步：安装 Ubuntu"></a>第四步：安装 Ubuntu</h2><h3 id="1-选择安装语言"><a href="#1-选择安装语言" class="headerlink" title="1. 选择安装语言"></a>1. 选择安装语言</h3><p>启动后选择“Try Ubuntu”测试或“Install Ubuntu”直接安装</p><h3 id="2-选择键盘布局"><a href="#2-选择键盘布局" class="headerlink" title="2. 选择键盘布局"></a>2. 选择键盘布局</h3><p>默认选择“Chinese”即可</p><h3 id="3-连接网络（可选）"><a href="#3-连接网络（可选）" class="headerlink" title="3. 连接网络（可选）"></a>3. 连接网络（可选）</h3><p>建议连接网络以下载更新和第三方软件</p><h3 id="4-选择安装类型"><a href="#4-选择安装类型" class="headerlink" title="4. 选择安装类型"></a>4. 选择安装类型</h3><ul><li><strong>正常安装</strong>：包含办公软件、媒体播放器等常用软件</li><li><strong>最小安装</strong>：仅包含基本系统，适合自定义安装</li><li><strong>其他选项</strong>：<ul><li><strong>安装第三方软件</strong>：显卡驱动、媒体编码器等</li><li><strong>下载更新</strong>：在安装过程中下载最新更新</li></ul></li></ul><h3 id="5-分区设置（重要！）"><a href="#5-分区设置（重要！）" class="headerlink" title="5. 分区设置（重要！）"></a>5. 分区设置（重要！）</h3><h4 id="方案一：清除整个磁盘安装（单系统）"><a href="#方案一：清除整个磁盘安装（单系统）" class="headerlink" title="方案一：清除整个磁盘安装（单系统）"></a>方案一：清除整个磁盘安装（单系统）</h4><ul><li>选择“清除整个磁盘并安装 Ubuntu”</li><li>系统会自动创建所需分区</li></ul><h4 id="方案二：双系统安装"><a href="#方案二：双系统安装" class="headerlink" title="方案二：双系统安装"></a>方案二：双系统安装</h4><ul><li>选择“其他选项”手动分区</li><li>推荐分区方案：<ul><li><strong>&#x2F;（根分区）</strong>：30-50 GB，EXT4 格式</li><li><strong>swap（交换分区）</strong>：内存大小的 1-2 倍（如果内存 ≥ 8 GB 可不设）</li><li><strong>&#x2F;home（家目录）</strong>：剩余空间，EXT4 格式（存储个人文件）</li></ul></li></ul><h4 id="分区示例："><a href="#分区示例：" class="headerlink" title="分区示例："></a>分区示例：</h4><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></pre></td><td class="code"><pre><span class="line">/dev/sda1  EFI系统分区  512 MB  FAT32</span><br><span class="line">/dev/sda2  /（根分区）  40 GB   EXT4</span><br><span class="line">/dev/sda3  /home       剩余空间 EXT4</span><br></pre></td></tr></table></figure><h3 id="6-设置时区"><a href="#6-设置时区" class="headerlink" title="6. 设置时区"></a>6. 设置时区</h3><p>在地图上点击上海或选择“Asia&#x2F;Shanghai”</p><h3 id="7-创建用户账户"><a href="#7-创建用户账户" class="headerlink" title="7. 创建用户账户"></a>7. 创建用户账户</h3><ul><li>输入你的姓名</li><li>计算机名（会自动生成）</li><li>用户名（用于登录）</li><li>设置密码（建议设置强密码）</li></ul><h3 id="8-开始安装"><a href="#8-开始安装" class="headerlink" title="8. 开始安装"></a>8. 开始安装</h3><p>点击“安装”，等待安装完成（通常需要 20-40 分钟）</p><h2 id="第五步：安装后配置"><a href="#第五步：安装后配置" class="headerlink" title="第五步：安装后配置"></a>第五步：安装后配置</h2><h3 id="1-更新系统"><a href="#1-更新系统" class="headerlink" title="1. 更新系统"></a>1. 更新系统</h3><p>安装完成后，首先更新系统：</p><figure class="highlight bash"><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="built_in">sudo</span> apt update</span><br><span class="line"><span class="built_in">sudo</span> apt upgrade</span><br></pre></td></tr></table></figure><h3 id="2-安装中文输入法"><a href="#2-安装中文输入法" class="headerlink" title="2. 安装中文输入法"></a>2. 安装中文输入法</h3><figure class="highlight bash"><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="built_in">sudo</span> apt install ibus-pinyin</span><br><span class="line"><span class="comment"># 或安装搜狗输入法</span></span><br></pre></td></tr></table></figure><h3 id="3-安装常用软件"><a href="#3-安装常用软件" class="headerlink" title="3. 安装常用软件"></a>3. 安装常用软件</h3><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><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"><span class="comment"># 浏览器</span></span><br><span class="line"><span class="built_in">sudo</span> apt install firefox chromium-browser</span><br><span class="line"></span><br><span class="line"><span class="comment"># 办公软件</span></span><br><span class="line"><span class="built_in">sudo</span> apt install libreoffice</span><br><span class="line"></span><br><span class="line"><span class="comment"># 媒体播放器</span></span><br><span class="line"><span class="built_in">sudo</span> apt install vlc</span><br><span class="line"></span><br><span class="line"><span class="comment"># 开发工具</span></span><br><span class="line"><span class="built_in">sudo</span> apt install git vim build-essential</span><br></pre></td></tr></table></figure><h3 id="4-安装显卡驱动（如有需要）"><a href="#4-安装显卡驱动（如有需要）" class="headerlink" title="4. 安装显卡驱动（如有需要）"></a>4. 安装显卡驱动（如有需要）</h3><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><span class="line"><span class="comment"># 检查可用驱动</span></span><br><span class="line">ubuntu-drivers devices</span><br><span class="line"></span><br><span class="line"><span class="comment"># 安装推荐驱动</span></span><br><span class="line"><span class="built_in">sudo</span> ubuntu-drivers autoinstall</span><br></pre></td></tr></table></figure><h3 id="5-美化桌面（可选）"><a href="#5-美化桌面（可选）" class="headerlink" title="5. 美化桌面（可选）"></a>5. 美化桌面（可选）</h3><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><span class="line"><span class="comment"># 安装 GNOME 优化工具</span></span><br><span class="line"><span class="built_in">sudo</span> apt install gnome-tweaks</span><br><span class="line"></span><br><span class="line"><span class="comment"># 安装扩展管理器</span></span><br><span class="line"><span class="built_in">sudo</span> apt install chrome-gnome-shell</span><br></pre></td></tr></table></figure><h2 id="常见问题解答"><a href="#常见问题解答" class="headerlink" title="常见问题解答"></a>常见问题解答</h2><h3 id="Q-安装过程中卡住怎么办？"><a href="#Q-安装过程中卡住怎么办？" class="headerlink" title="Q: 安装过程中卡住怎么办？"></a>Q: 安装过程中卡住怎么办？</h3><p>A: 尝试以下方法：</p><ol><li>断开网络连接安装</li><li>选择“安全图形模式”</li><li>检查 ISO 文件完整性</li></ol><h3 id="Q-如何修复启动引导？"><a href="#Q-如何修复启动引导？" class="headerlink" title="Q: 如何修复启动引导？"></a>Q: 如何修复启动引导？</h3><p>A: 使用 Ubuntu 安装 U 盘启动，选择“试用 Ubuntu”，然后：</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><span class="line"><span class="built_in">sudo</span> add-apt-repository ppa:yannubuntu/boot-repair</span><br><span class="line"><span class="built_in">sudo</span> apt update</span><br><span class="line"><span class="built_in">sudo</span> apt install boot-repair</span><br><span class="line">boot-repair</span><br></pre></td></tr></table></figure><h3 id="Q-双系统时间错误怎么办？"><a href="#Q-双系统时间错误怎么办？" class="headerlink" title="Q: 双系统时间错误怎么办？"></a>Q: 双系统时间错误怎么办？</h3><p>A: 在 Ubuntu 中执行：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">timedatectl set-local-rtc 1</span><br></pre></td></tr></table></figure><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>Ubuntu 安装过程相对简单，但分区步骤需要谨慎操作。建议新手选择“清除整个磁盘安装”，而有经验的用户可以选择手动分区以更好地管理磁盘空间。</p><p>安装完成后，Ubuntu 提供了一个稳定、安全且免费的操作系统环境，无论是日常使用还是开发工作都能胜任。</p><h2 id="延伸阅读"><a href="#延伸阅读" class="headerlink" title="延伸阅读"></a>延伸阅读</h2><ul><li><a href="https://help.ubuntu.com/">Ubuntu 官方文档</a></li><li><a href="https://forum.ubuntu.org.cn/">Ubuntu 中文论坛</a></li><li><a href="https://linux.cn/">Linux 中国开源社区</a></li></ul><p>希望本教程能帮助你顺利安装 Ubuntu！如果在安装过程中遇到问题，欢迎在评论区留言讨论。</p>]]></content>
    
    
    <summary type="html">本教程详细介绍如何安装 Ubuntu Linux 操作系统，包括系统要求、下载镜像、制作启动U盘、安装步骤以及安装后配置。</summary>
    
    
    
    <category term="Linux" scheme="https://cdd9527.cn/categories/Linux/"/>
    
    
    <category term="Linux" scheme="https://cdd9527.cn/tags/Linux/"/>
    
    <category term="Ubuntu" scheme="https://cdd9527.cn/tags/Ubuntu/"/>
    
    <category term="安装教程" scheme="https://cdd9527.cn/tags/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/"/>
    
    <category term="操作系统" scheme="https://cdd9527.cn/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/"/>
    
  </entry>
  
  <entry>
    <title>Jetbrains系列产品2019.2最新激活方法(包含IDEA)</title>
    <link href="https://cdd9527.cn/posts/10020-idea/"/>
    <id>https://cdd9527.cn/posts/10020-idea/</id>
    <published>2019-10-22T01:43:21.000Z</published>
    <updated>2026-03-26T06:17:39.405Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://image.cdd9527.cn/20191022157170869176142.png" alt="20191022157170869176142.png"></p><p>9月份突然所有以前激活的都失效了，哥来分享最新的破解方法,该攻略可以激活Jetbrains系列所有产品。最新进展，只能激活2019.3以下版本</p><span id="more"></span><h2 id="所需下载文件"><a href="#所需下载文件" class="headerlink" title="所需下载文件"></a>所需下载文件</h2><p>链接: <a href="https://pan.baidu.com/s/1CFb3A5_17ntThXfodqhesg&shfl=shareset">https://pan.baidu.com/s/1CFb3A5_17ntThXfodqhesg&amp;shfl=shareset</a><br>提取码: gsc1</p><h2 id="使用方法"><a href="#使用方法" class="headerlink" title="使用方法"></a>使用方法</h2><ul><li><p>下载jar以后随意放到一个文件夹中，复制该文件的绝对路径；</p></li><li><p>启动你的IDE，如果上来就需要注册，选择：试用（Evaluate for free）进入IDE。第一次安装，没有项目的话，新建一个空项目。</p></li><li><p>点击你要注册的IDE菜单：”Configure” 或 “Help” -&gt; “Edit Custom VM Options …”，如果提示是否要创建文件，请点”Yes”。</p></li><li><p>末行添加：-javaagent:&#x2F;Users&#x2F;chendong&#x2F;jetbrains-agent.jar（注意：不要用中文路径）</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><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#mac</span></span><br><span class="line">-javaagent:/Users/chendong/jetbrains-agent.jar</span><br><span class="line"><span class="comment">#linux</span></span><br><span class="line">-javaagent:/home/chendong/jetbrains-agent.jar</span><br><span class="line"><span class="comment">#windows</span></span><br><span class="line">-javaagent:C:\Users\chendong\jetbrains-agent.jar</span><br></pre></td></tr></table></figure></li><li><p>重启IDE;</p></li><li><p>点击IDE菜单 “Help” -&gt; “Register…” 或 “Configure” -&gt; “Manage License…”;</p></li><li><p>选择License server方式，地址填入：<a href="http://jetbrains-license-server/">http://jetbrains-license-server</a> （应该会自动填上）;<br>或者点击按钮：”Discover Server”来自动填充地址;</p></li><li><p>点击激活按钮，激活成功;</p></li></ul><h2 id="声明"><a href="#声明" class="headerlink" title="声明"></a>声明</h2><p>本攻略只做学习研究之用，不得用于商业用途！</p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;&lt;img src=&quot;http://image.cdd9527.cn/20191022157170869176142.png&quot; alt=&quot;20191022157170869176142.png&quot;&gt;&lt;/p&gt;
&lt;p&gt;9月份突然所有以前激活的都失效了，哥来分享最新的破解方法,该攻略可以激活Jetbrains系列所有产品。最新进展，只能激活2019.3以下版本&lt;/p&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="idea" scheme="https://cdd9527.cn/tags/idea/"/>
    
  </entry>
  
  <entry>
    <title>Spring Boot中的缓存支持</title>
    <link href="https://cdd9527.cn/posts/10019-springbootcache/"/>
    <id>https://cdd9527.cn/posts/10019-springbootcache/</id>
    <published>2019-09-29T03:23:51.000Z</published>
    <updated>2026-03-26T06:17:39.418Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://image.cdd9527.cn/20190929156972721778897.png" alt="20190929156972721778897.png"></p><p><a href="https://juejin.im/post/5c8481d95188257a323f52b5">Java缓存浅析</a></p><p>随着时间的积累，应用的使用用户不断增加，数据规模也越来越大，往往数据库查询操作会成为影响用户使用体验的瓶颈，此时使用缓存往往是解决这一问题非常好的手段之一。Spring 3开始提供了强大的基于注解的缓存支持，可以通过注解配置方式低侵入的给原有Spring应用增加缓存功能，提高数据访问性能。</p><p>在Spring Boot中对于缓存的支持，提供了一系列的自动化配置，使我们可以非常方便的使用缓存。下面我们通过一个简单的例子来展示，我们是如何给一个既有应用增加缓存功能的。</p><span id="more"></span><h1 id="快速入门"><a href="#快速入门" class="headerlink" title="快速入门"></a>快速入门</h1><p>首先，下载样例工程chapter3-2-2。本例通过spring-data-jpa实现了对User用户表的一些操作，若没有这个基础，可以先阅读《使用Spring-data-jpa简化数据访问层》一文对数据访问有所基础。</p><h1 id="准备工作"><a href="#准备工作" class="headerlink" title="准备工作"></a>准备工作</h1><p>为了更好的理解缓存，我们先对该工程做一些简单的改造。</p><p>application.properties文件中新增spring.jpa.properties.hibernate.show_sql&#x3D;true，开启hibernate对sql语句的打印</p><p>修改单元测试ApplicationTests，初始化插入User表一条用户名为AAA，年龄为10的数据。并通过findByName函数完成两次查询。</p><figure class="highlight java"><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><br><span class="line"><span class="meta">@RunWith(SpringJUnit4ClassRunner.class)</span></span><br><span class="line"><span class="meta">@SpringApplicationConfiguration(Application.class)</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">ApplicationTests</span> &#123;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Autowired</span></span><br><span class="line"><span class="keyword">private</span> UserRepository userRepository;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Before</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">before</span><span class="params">()</span> &#123;</span><br><span class="line">userRepository.save(<span class="keyword">new</span> <span class="title class_">User</span>(<span class="string">&quot;AAA&quot;</span>, <span class="number">10</span>));</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="meta">@Test</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">test</span><span class="params">()</span> <span class="keyword">throws</span> Exception &#123;</span><br><span class="line"><span class="type">User</span> <span class="variable">u1</span> <span class="operator">=</span> userRepository.findByName(<span class="string">&quot;AAA&quot;</span>);</span><br><span class="line">System.out.println(<span class="string">&quot;第一次查询：&quot;</span> + u1.getAge());</span><br><span class="line"></span><br><span class="line"><span class="type">User</span> <span class="variable">u2</span> <span class="operator">=</span> userRepository.findByName(<span class="string">&quot;AAA&quot;</span>);</span><br><span class="line">System.out.println(<span class="string">&quot;第二次查询：&quot;</span> + u2.getAge());</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure><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></pre></td><td class="code"><pre><span class="line">Hibernate: insert into user (age, name) values (?, ?)</span><br><span class="line">Hibernate: select user0_.id as id1_0_, user0_.age as age2_0_, user0_.name as name3_0_ from user user0_ where user0_.name=?</span><br><span class="line">第一次查询：10</span><br><span class="line">Hibernate: select user0_.id as id1_0_, user0_.age as age2_0_, user0_.name as name3_0_ from user user0_ where user0_.name=?</span><br><span class="line">第二次查询：10</span><br></pre></td></tr></table></figure><p>在测试用例执行前，插入了一条User记录。然后每次findByName调用时，都执行了一句select语句来查询用户名为AAA的记录。</p><h1 id="引入缓存"><a href="#引入缓存" class="headerlink" title="引入缓存"></a>引入缓存</h1><p>在pom.xml中引入cache依赖，添加如下内容：</p><figure class="highlight xml"><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"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-cache<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br></pre></td></tr></table></figure><p>在Spring Boot主类中增加@EnableCaching注解开启缓存功能，如下：</p><figure class="highlight java"><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"><span class="meta">@SpringBootApplication</span></span><br><span class="line"><span class="meta">@EnableCaching</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Application</span> &#123;</span><br><span class="line"></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">(String[] args)</span> &#123;</span><br><span class="line">SpringApplication.run(Application.class, args);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>在数据访问接口中，增加缓存配置注解，如：</p><figure class="highlight java"><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"><span class="meta">@CacheConfig(cacheNames = &quot;users&quot;)</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">interface</span> <span class="title class_">UserRepository</span> <span class="keyword">extends</span> <span class="title class_">JpaRepository</span>&lt;User, Long&gt; &#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Cacheable</span></span><br><span class="line">    User <span class="title function_">findByName</span><span class="params">(String name)</span>;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><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">Hibernate: insert into user (age, name) values (?, ?)</span><br><span class="line">Hibernate: select user0_.id as id1_0_, user0_.age as age2_0_, user0_.name as name3_0_ from user user0_ where user0_.name=?</span><br><span class="line">第一次查询：10</span><br><span class="line">第二次查询：10</span><br></pre></td></tr></table></figure><p>到这里，我们可以看到，在调用第二次findByName函数时，没有再执行select语句，也就直接减少了一次数据库的读取操作。</p><p><a href="http://blog.didispace.com/springbootcache1/">原文ehcache的使用</a></p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;&lt;img src=&quot;http://image.cdd9527.cn/20190929156972721778897.png&quot; alt=&quot;20190929156972721778897.png&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://juejin.im/post/5c8481d95188257a323f52b5&quot;&gt;Java缓存浅析&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;随着时间的积累，应用的使用用户不断增加，数据规模也越来越大，往往数据库查询操作会成为影响用户使用体验的瓶颈，此时使用缓存往往是解决这一问题非常好的手段之一。Spring 3开始提供了强大的基于注解的缓存支持，可以通过注解配置方式低侵入的给原有Spring应用增加缓存功能，提高数据访问性能。&lt;/p&gt;
&lt;p&gt;在Spring Boot中对于缓存的支持，提供了一系列的自动化配置，使我们可以非常方便的使用缓存。下面我们通过一个简单的例子来展示，我们是如何给一个既有应用增加缓存功能的。&lt;/p&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="springboot" scheme="https://cdd9527.cn/tags/springboot/"/>
    
    <category term="cache" scheme="https://cdd9527.cn/tags/cache/"/>
    
  </entry>
  
  <entry>
    <title>购买二手房注意事项</title>
    <link href="https://cdd9527.cn/posts/10018-ershoufang/"/>
    <id>https://cdd9527.cn/posts/10018-ershoufang/</id>
    <published>2019-06-16T09:22:03.000Z</published>
    <updated>2026-03-26T06:17:39.477Z</updated>
    
    <content type="html"><![CDATA[<p>分享一下。手机最好长按图片保存起来放大看。如果电脑的话右键图片，然后选择在新的页面打开链接。</p><span id="more"></span><p><img src="http://image.cdd9527.cn/20190616156067628895605.png" alt="20190616156067628895605.png"></p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;分享一下。手机最好长按图片保存起来放大看。如果电脑的话右键图片，然后选择在新的页面打开链接。&lt;/p&gt;</summary>
    
    
    
    <category term="生活" scheme="https://cdd9527.cn/categories/%E7%94%9F%E6%B4%BB/"/>
    
    
    <category term="二手房" scheme="https://cdd9527.cn/tags/%E4%BA%8C%E6%89%8B%E6%88%BF/"/>
    
  </entry>
  
  <entry>
    <title>数据结构笔记</title>
    <link href="https://cdd9527.cn/posts/10017-dataStructure/"/>
    <id>https://cdd9527.cn/posts/10017-dataStructure/</id>
    <published>2019-04-11T09:59:07.000Z</published>
    <updated>2026-03-26T06:17:39.413Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://image.cdd9527.cn/20190412155505554092398.png" alt="20190412155505554092398.png"></p><blockquote><p>好久没有温习数据结构了，今天来整理整理。</p></blockquote><span id="more"></span><h2 id="堆栈（stack）"><a href="#堆栈（stack）" class="headerlink" title="堆栈（stack）"></a>堆栈（stack）</h2><p>堆栈（英语：stack）又称为栈或堆叠，是计算机科学中的一种抽象数据类型，只允许在有序的线性数据集合的一端（称为堆栈顶端，英语：top）进行加入数据（英语：push）和移除数据（英语：pop）的运算。因而按照后进先出（LIFO, Last In First Out）的原理运作。</p><p>常与有序的线性数据集合队列相提并论。</p><p>堆栈常用一维数组或链表来实现。</p><p><img src="http://image.cdd9527.cn/20190411155497516974025.png" alt="20190411155497516974025.png"></p><h3 id="软件堆栈"><a href="#软件堆栈" class="headerlink" title="软件堆栈"></a>软件堆栈</h3><p>堆栈可以用数组和链表两种方式实现，一般为一个堆栈预先分配一个大小固定且较合适的空间并非难事，所以较流行的做法是Stack结构下含一个数组。如果空间实在紧张，也可用链表实现，且去掉表头</p><p>堆栈有时候也常用来指代<code>堆栈段</code>。<br>堆栈段（stack segment）通常是指采用堆栈方式工作的一段内存区域。当程序被执行时，程序可能会将其执行的状态加入栈的顶部；当程序结束时，它必须把栈顶的状态数据弹出（pop）。</p><h3 id="硬件堆栈"><a href="#硬件堆栈" class="headerlink" title="硬件堆栈"></a>硬件堆栈</h3><p>架构层次上的堆栈通常被用以申请和访问内存。</p><h2 id="队列（queue）"><a href="#队列（queue）" class="headerlink" title="队列（queue）"></a>队列（queue）</h2><p>队列，又称为伫列（queue），是先进先出（FIFO, First-In-First-Out）的线性表。在具体应用中通常用链表或者数组来实现。队列只允许在后端（称为rear）进行插入操作，在前端（称为front）进行删除操作。</p><p>队列的操作方式和堆栈类似，唯一的区别在于队列只允许新数据在后端进行添加。<br><img src="http://image.cdd9527.cn/2019041115549770099188.png" alt="2019041115549770099188.png"></p><h3 id="单链队列"><a href="#单链队列" class="headerlink" title="单链队列"></a>单链队列</h3><p>单链队列使用链表作为基本数据结构，所以不存在伪溢出的问题，队列长度也没有限制。但插入和读取的时间代价较高</p><h3 id="循环队列"><a href="#循环队列" class="headerlink" title="循环队列"></a>循环队列</h3><p>循环队列可以更简单防止伪溢出的发生，但队列大小是固定的。</p><h2 id="链表（link）"><a href="#链表（link）" class="headerlink" title="链表（link）"></a>链表（link）</h2><p>链表是一种数据结构，和数组同级。比如，Java 中我们使用的 ArrayList，其实现原理是数组。而<br>LinkedList 的实现原理就是链表了。链表在进行循环遍历时效率不高，但是插入和删除时优势明显。</p><p><img src="http://image.cdd9527.cn/20190412155505588166695.png" alt="20190412155505588166695.png"></p><h3 id="单向链表"><a href="#单向链表" class="headerlink" title="单向链表"></a>单向链表</h3><p>链表中最简单的一种是单向链表，它包含两个域，一个信息域和一个指针域。这个链接指向列表中的下一个节点，而最后一个节点则指向一个空值。<br><img src="http://image.cdd9527.cn/20190412155505656985771.png" alt="20190412155505656985771.png"><br>一个单向链表的节点被分成两个部分。第一个部分保存或者显示关于节点的信息，第二个部分存储下一个节点的地址。单向链表只可向一个方向遍历。</p><p>链表最基本的结构是在每个节点保存数据和到下一个节点的地址，在最后一个节点保存一个特殊的结束标记，另外在一个固定的位置保存指向第一个节点的指针，有的时候也会同时储存指向最后一个节点的指针。一般查找一个节点的时候需要从第一个节点开始每次访问下一个节点，一直访问到需要的位置。但是也可以提前把一个节点的位置另外保存起来，然后直接访问。当然如果只是访问数据就没必要了，不如在链表上储存指向实际数据的指针。这样一般是为了访问链表中的下一个或者前一个（需要储存反向的指针，见下面的双向链表）节点。</p><h3 id="双向链表"><a href="#双向链表" class="headerlink" title="双向链表"></a>双向链表</h3><p>每个节点有两个连接：一个指向前一个节点，（当此“连接”为第一个“连接”时，指向空值或者空列表）；而另一个指向下一个节点，（当此“连接”为最后一个“连接”时，指向空值或者空列表）<br><img src="http://image.cdd9527.cn/20190412155505679974905.png" alt="20190412155505679974905.png"><br><strong>双向链表</strong>也叫<strong>双链表</strong>。双向链表中不仅有指向后一个节点的指针，还有指向前一个节点的指针。这样可以从任何一个节点访问前一个节点，当然也可以访问后一个节点，以至整个链表。一般是在需要大批量的另外储存数据在链表中的位置的时候用。双向链表也可以配合下面的其他链表的扩展使用。</p><h3 id="循环链表"><a href="#循环链表" class="headerlink" title="循环链表"></a>循环链表</h3><p>在一个 循环链表中, 首节点和末节点被连接在一起。这种方式在单向和双向链表中皆可实现。要转换一个循环链表，你开始于任意一个节点然后沿着列表的任一方向直到返回开始的节点。再来看另一种方法，循环链表可以被视为“无头无尾”。这种列表很利于节约数据存储缓存， 假定你在一个列表中有一个对象并且希望所有其他对象迭代在一个非特殊的排列下。</p><p>指向整个列表的指针可以被称作访问指针。<br><img src="http://image.cdd9527.cn/20190412155505730643443.png" alt="20190412155505730643443.png"><br>循环链表中第一个节点之前就是最后一个节点，反之亦然。循环链表的无边界使得在这样的链表上设计算法会比普通链表更加容易。对于新加入的节点应该是在第一个节点之前还是最后一个节点之后可以根据实际要求灵活处理，区别不大(详见下面实例代码)。当然，如果只会在最后插入数据（或者只会在之前），处理也是很容易的。</p><p>另外有一种模拟的循环链表，就是在访问到最后一个节点之后的时候，手工的跳转到第一个节点。访问到第一个节点之前的时候也一样。这样也可以实现循环链表的功能，在直接用循环链表比较麻烦或者可能会出现问题的时候可以用。</p><h3 id="常见用途"><a href="#常见用途" class="headerlink" title="常见用途"></a>常见用途</h3><p>常用于组织删除、检索较少，而添加、遍历较多的数据。 如果与上述情形相反，应采用其他数据结构或者与其他数据结构组合使用。</p><h2 id="数组-Array"><a href="#数组-Array" class="headerlink" title="数组 (Array)"></a>数组 (Array)</h2><p>数组（英语：Array），是由相同类型的元素（element）的集合所组成的数据结构，分配一块连续的内存来存储。利用元素的索引（index）可以计算出该元素对应的存储地址。</p><h3 id="一维数组"><a href="#一维数组" class="headerlink" title="一维数组"></a>一维数组</h3><p>一维（或单维）数组是一种线性数组，其中元素的访问是以行或列索引的单一下标表示。</p><figure class="highlight java"><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></pre></td><td class="code"><pre><span class="line"><span class="comment">//JAVA数组的两种创建方式</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">(String[] args)</span>&#123;</span><br><span class="line">    <span class="type">int</span>[] arry1 = &#123;<span class="number">1</span>,<span class="number">2</span>,<span class="number">3</span>&#125;;</span><br><span class="line">    <span class="type">int</span>[] arry2 = <span class="keyword">new</span> <span class="title class_">int</span>[<span class="number">3</span>];</span><br><span class="line">    arry2[<span class="number">0</span>] = <span class="number">1</span>;</span><br><span class="line">    arry2[<span class="number">1</span>] = <span class="number">2</span>;</span><br><span class="line">    arry2[<span class="number">2</span>] = <span class="number">3</span>;</span><br><span class="line">    <span class="keyword">for</span> (<span class="type">int</span> i : arry1) &#123;</span><br><span class="line">        System.out.println(i);</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">for</span> (<span class="type">int</span> i : arry2) &#123;</span><br><span class="line">        System.out.println(i);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="多维数组"><a href="#多维数组" class="headerlink" title="多维数组"></a>多维数组</h3><p>多维数组就是数组中嵌套数组，我们在多维数组之中采用一系列有序的整数来标注，如在[ 3,1,5 ] 。<code>这种整数列表之中整数的个数始终相同</code>，且被称为数组的“维度”。关于每个数组维度的边界称为“维”。<code>维度为k的数组通常被称为k维</code>。</p><p>如下所示：<br> {<br> {0,0,0,1,0,0,0},<br> {0,0,1,0,1,0,0},<br> {0,1,0,0,0,1,0},<br> {1,0,0,0,0,0,1},<br> {0,1,0,0,0,1,0},<br> {0,0,1,0,1,0,0},<br> {0,0,0,1,0,0,0}<br> }</p><h3 id="数组特点"><a href="#数组特点" class="headerlink" title="数组特点"></a>数组特点</h3><p>因为数组在存储数据时是按顺序存储的，存储数据的内存也是连续的，所以他的特点就是寻址读取数据比较容易，插入和删除比较困难。<br>简单解释一下为什么，在读取数据时，只需要告诉数组要从哪个位置（索引）取数据就可以了，数组会直接把你想要的位置的数据取出来给你。插入和删除比较困难是因为这些存储数据的内存是连续的，要插入和删除就需要变更整个数组中的数据的位置。举个例子：一个数组中编号0-&gt;1-&gt;2-&gt;3-&gt;4这五个内存地址中都存了数组的数据，但现在你需要往4中插入一个数据，那就代表着从4开始，后面的所有内存中的数据都要往后移一个位置。这可是很耗时的。</p><p><img src="http://image.cdd9527.cn/20190423155598767763310.png" alt="20190423155598767763310.png"></p><h3 id="程序设计"><a href="#程序设计" class="headerlink" title="程序设计"></a>程序设计</h3><p>数组设计之初是在形式上依赖内存分配而成的，所以必须在使用前预先请求空间。这使得数组有以下特性：</p><ol><li>请求空间以后大小固定，不能再改变（数据溢出问题）；</li><li>在内存中有空间连续性的表现，中间不会存在其他程序需要调用的数据，为此数组的专用内存空间；</li><li>在旧式编程语言中（如有中阶语言之称的C），程序不会对数组的操作做下界判断，也就有潜在的越界操作的风险（比如会把数据写在运行中程序需要调用的核心部分的内存上）。</li></ol><h2 id="树（tree）"><a href="#树（tree）" class="headerlink" title="树（tree）"></a>树（tree）</h2><p><img src="http://image.cdd9527.cn/20190423155598863865385.png" alt="20190423155598863865385.png"><br>在计算机科学中，树（英语：tree）是一种抽象数据类型（ADT）或是实现这种抽象数据类型的数据结构，用来模拟具有树状结构性质的数据集合。<code>它是由n（n&gt;0）个有限节点组成一个具有层次关系的集合</code>。把它叫做“树”是因为它看起来像一棵倒挂的树，也就是说它是根朝上，而叶朝下的。</p><h3 id="特点"><a href="#特点" class="headerlink" title="特点"></a>特点</h3><ul><li>每个节点都只有有限个子节点或无子节点；</li><li>没有父节点的节点称为根节点；</li><li>每一个非根节点有且只有一个父节点；</li><li>除了根节点外，每个子节点可以分为多个不相交的子树；</li><li>树里面没有环路(cycle)</li></ul><h3 id="无序树"><a href="#无序树" class="headerlink" title="无序树"></a>无序树</h3><p>树中任意节点的子节点之间没有顺序关系，这种树称为无序树，也称为自由树；</p><h3 id="有序树"><a href="#有序树" class="headerlink" title="有序树"></a>有序树</h3><p>树中任意节点的子节点之间有顺序关系，这种树称为有序树；</p><h4 id="二叉树"><a href="#二叉树" class="headerlink" title="二叉树"></a>二叉树</h4><p>每个节点最多含有两个子树的树称为二叉树；</p><h5 id="完全二叉树"><a href="#完全二叉树" class="headerlink" title="完全二叉树"></a>完全二叉树</h5><p><img src="http://image.cdd9527.cn/20190505155704196961130.png" alt="20190505155704196961130.png"><br>在一棵二叉树中，除最后一层外，若其余层都是满的，并且最后一层或者是满的，或者是在右边缺少连续若干节点，则此二叉树为完全二叉树（Complete Binary Tree）。</p><h6 id="满二叉树"><a href="#满二叉树" class="headerlink" title="满二叉树"></a>满二叉树</h6><p><img src="http://image.cdd9527.cn/20190505155704198798481.png" alt="20190505155704198798481.png"><br>这种树的特点是每一层上的节点数都是最大节点数。</p><h6 id="将n叉树转换为二叉树"><a href="#将n叉树转换为二叉树" class="headerlink" title="将n叉树转换为二叉树"></a>将n叉树转换为二叉树</h6><p>二叉树当且仅当根节点没有右子结点时可转换为n叉树。</p><p>例如，在左边的树中，A有6个子结点{B,C,D,E,F,G}。它能被转换成右边的二叉树。<br><img src="http://image.cdd9527.cn/2019050515570431592083.png" alt="2019050515570431592083.png"></p><p><strong>将一棵树转换为二叉树的方法：</strong></p><ol><li>在兄弟之间加一连线；</li><li>对每个结点，除了其左孩子外，去除其与其余孩子之间的联系；</li><li>以树的根结点为轴心，将整树顺时针转45度。</li></ol><h5 id="平衡二叉树（AVL树）"><a href="#平衡二叉树（AVL树）" class="headerlink" title="平衡二叉树（AVL树）"></a>平衡二叉树（AVL树）</h5><p>平衡二叉搜索树（英语：Balanced Binary Tree）是一种结构平衡的二叉搜索树，即叶节点高度差的绝对值不超过1，并且左右两个子树都是一棵平衡二叉树。它能在O( {\displaystyle \log n} \log n)内完成插入、查找和删除操作，最早被发明的平衡二叉搜索树为<a href="https://zh.wikipedia.org/wiki/AVL%E6%A0%91">AVL树</a>。</p><h6 id="常见的平衡二叉搜索树"><a href="#常见的平衡二叉搜索树" class="headerlink" title="常见的平衡二叉搜索树"></a>常见的平衡二叉搜索树</h6><ul><li><a href="https://zh.wikipedia.org/wiki/AVL%E6%A0%91">AVL树</a></li><li><a href="https://zh.wikipedia.org/wiki/%E7%B4%85%E9%BB%91%E6%A8%B9">红黑树</a></li><li><a href="https://zh.wikipedia.org/wiki/Treap">Treap</a></li><li><a href="https://zh.wikipedia.org/w/index.php?title=%E8%8A%82%E7%82%B9%E5%A4%A7%E5%B0%8F%E5%B9%B3%E8%A1%A1%E6%A0%91&action=edit&redlink=1">节点大小平衡树</a></li></ul><h5 id="排序二叉树-二叉查找树（英语：Binary-Search-Tree"><a href="#排序二叉树-二叉查找树（英语：Binary-Search-Tree" class="headerlink" title="排序二叉树(二叉查找树（英语：Binary Search Tree))"></a>排序二叉树(二叉查找树（英语：Binary Search Tree))</h5><p><img src="http://image.cdd9527.cn/20190505155704553664072.png" alt="20190505155704553664072.png"><br><a href="https://baike.baidu.com/item/%E4%BA%8C%E5%8F%89%E6%8E%92%E5%BA%8F%E6%A0%91/10905079?fromtitle=%E4%BA%8C%E5%8F%89%E6%9F%A5%E6%89%BE%E6%A0%91&fromid=7077965">二叉查找树（英语：Binary Search Tree）</a>，也称为二叉搜索树、有序二叉树（ordered binary tree）或排序二叉树（sorted binary tree），是指一棵空树或者具有下列性质的二叉树：</p><ol><li>若任意节点的左子树不空，则左子树上所有节点的值均小于它的根节点的值；</li><li>若任意节点的右子树不空，则右子树上所有节点的值均大于它的根节点的值；</li><li>任意节点的左、右子树也分别为二叉查找树；</li><li>没有键值相等的节点。</li></ol><h4 id="霍夫曼树"><a href="#霍夫曼树" class="headerlink" title="霍夫曼树"></a>霍夫曼树</h4><p>带权路径最短的二叉树称为哈夫曼树或最优二叉树；</p><h4 id="B树"><a href="#B树" class="headerlink" title="B树"></a>B树</h4><p>带权路径最短的二叉树称为哈夫曼树或最优二叉树；</p><h2 id="图（Graph）"><a href="#图（Graph）" class="headerlink" title="图（Graph）"></a>图（Graph）</h2><p><img src="http://image.cdd9527.cn/20190505155704655183365.png" alt="20190505155704655183365.png"><br>图（Graph）用于表示物件与物件之间的关系，是图论的基本研究对象。一张图由一些小圆点（称为顶点或结点）和连结这些圆点的直线或曲线（称为边）组成。<br><a href="https://www.jianshu.com/p/bce71b2bdbc8">稍微通俗易懂一点的阐述</a></p><h3 id="定义"><a href="#定义" class="headerlink" title="定义"></a>定义</h3><h4 id="二元组定义"><a href="#二元组定义" class="headerlink" title="二元组定义"></a>二元组定义</h4><p>一张图 {\displaystyle G} G 是一个二元组 {\displaystyle (V,E)} (V,E)，其中 {\displaystyle V} V称为顶点集， {\displaystyle E} E称为边集。它们亦可写成 {\displaystyle V(G)} V(G)和 {\displaystyle E(G)} E(G)。 {\displaystyle E} E的元素是一个二元组数对，用 {\displaystyle (x,y)} (x,y)表示，其中 {\displaystyle x,y\in V} x,y \in V。</p><h4 id="三元组定义"><a href="#三元组定义" class="headerlink" title="三元组定义"></a>三元组定义</h4><p>一张图 {\displaystyle G} G 是一个三元组 {\displaystyle (V,E,I)} (V,E,I)，其中 {\displaystyle V} V称为顶集（Vertices set）， {\displaystyle E} E称为边集（Edges set）， {\displaystyle E} E与 {\displaystyle V} V不相交； {\displaystyle I} I称为关联函数， {\displaystyle I} I将 {\displaystyle E} E中的每一个元素映射到 {\displaystyle V\times V} V\times V。如果 {\displaystyle I(e)&#x3D;(u,v)(e\in E,u,v\in V)} I(e)&#x3D;(u,v) (e\in E, u,v \in V)那么称边 {\displaystyle e} e连接顶点 {\displaystyle u,v} u,v，而 {\displaystyle u,v} u,v则称作 {\displaystyle e} e的端点， {\displaystyle u,v} u,v此时关于 {\displaystyle e} e相邻。同时，若两条边 {\displaystyle i,j} i,j有一个公共顶点 {\displaystyle u} u，则称 {\displaystyle i,j} i,j关于 {\displaystyle u} u相邻。</p><h3 id="分类"><a href="#分类" class="headerlink" title="分类"></a>分类</h3><h4 id="有向图和无向图"><a href="#有向图和无向图" class="headerlink" title="有向图和无向图"></a>有向图和无向图</h4><p>如果给图的每条边规定一个方向，那么得到的图称为<code>有向图</code>，其边也称为<code>有向边</code>。在有向图中，与一个节点相关联的边有出边和入边之分，而与一个有向边关联的两个点也有始点和终点之分。相反，边没有方向的图称为<code>无向图</code>。</p><h4 id="简单图"><a href="#简单图" class="headerlink" title="简单图"></a>简单图</h4><ul><li>没有两条边，它们所关联的两个点都相同（在有向图中，没有两条边的起点终点都分别相同）；</li><li>每条边所关联的是两个不同的顶点<br>满足这两个条件则称为简单图（Simple graph）。</li></ul><h3 id="多重图"><a href="#多重图" class="headerlink" title="多重图"></a>多重图</h3><p>若允许两结点间的边数多于一条，又允许顶点通过同一条边和自己关联，则为多重图的概念。它只能用“三元组的定义”。</p><h2 id="散列表（Hash-table）"><a href="#散列表（Hash-table）" class="headerlink" title="散列表（Hash table）"></a>散列表（Hash table）</h2><p>散列表（Hash table，也叫哈希表），是根据键（Key）而直接访问在内存存储位置的数据结构。也就是说，它通过计算一个关于键值的函数，将所需查询的数据映射到表中一个位置来访问记录，这加快了查找速度。这个映射函数称做散列函数，存放记录的数组称做散列表。</p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;&lt;img src=&quot;http://image.cdd9527.cn/20190412155505554092398.png&quot; alt=&quot;20190412155505554092398.png&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;好久没有温习数据结构了，今天来整理整理。&lt;/p&gt;
&lt;/blockquote&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="java" scheme="https://cdd9527.cn/tags/java/"/>
    
    <category term="数据结构" scheme="https://cdd9527.cn/tags/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/"/>
    
  </entry>
  
  <entry>
    <title>博客主动推送到搜索引擎</title>
    <link href="https://cdd9527.cn/posts/10016-blogpush/"/>
    <id>https://cdd9527.cn/posts/10016-blogpush/</id>
    <published>2019-03-29T06:33:05.000Z</published>
    <updated>2026-03-26T06:17:39.548Z</updated>
    
    <content type="html"><![CDATA[<h1 id="百度主动推送"><a href="#百度主动推送" class="headerlink" title="百度主动推送"></a>百度主动推送</h1><ol><li><p>安装hexo-baidu-url-submit插件</p> <figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo<span class="literal">-baidu-url-submit</span> <span class="literal">--save</span></span><br></pre></td></tr></table></figure></li><li><p>站点配置文件中添加baidu-url-submit的配置项</p> <span id="more"></span> <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><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#设置百度主动推送</span></span><br><span class="line"><span class="attr">baidu_url_submit:</span></span><br><span class="line">  <span class="attr">count:</span> <span class="number">200</span>  <span class="comment">#比如200，代表提交最新的200个链接</span></span><br><span class="line">  <span class="attr">host:</span> <span class="string">www.cdd9527.cn</span> <span class="comment"># 在百度站长平台中注册的域名，这个改为你自己的域名</span></span><br><span class="line">  <span class="attr">token:</span> <span class="string">MrXfdwxcxem6qABX</span> <span class="comment"># 请注意这是您的秘钥， 所以请不要把博客源代码发布在公众仓库里!</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">baidu_urls.txt</span> <span class="comment"># 文本文档的地址， 新链接会保存在此文本文档里，这个默认</span></span><br></pre></td></tr></table></figure><ul><li>百度token获取地址：<br> <a href="http://www.sousuoyinqingtijiao.com/baidu/tijiao/">http://www.sousuoyinqingtijiao.com/baidu/tijiao/</a></li></ul></li><li><p>在站点配置文件中加入新的deploy配置项</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><span class="line"><span class="attr">deploy:</span></span><br><span class="line"><span class="bullet">-</span> <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">https://gitee.com/dong0719/blog.git</span></span><br><span class="line"><span class="bullet">-</span> <span class="attr">type:</span> <span class="string">baidu_url_submitter</span></span><br></pre></td></tr></table></figure></li><li><p>卸载</p> <figure class="highlight powershell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm uninstall hexo<span class="literal">-baidu-url-submit</span></span><br></pre></td></tr></table></figure></li></ol><h1 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h1><p>其他都有教程<br><a href="http://www.sousuoyinqingtijiao.com/">http://www.sousuoyinqingtijiao.com/</a></p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;百度主动推送&quot;&gt;&lt;a href=&quot;#百度主动推送&quot; class=&quot;headerlink&quot; title=&quot;百度主动推送&quot;&gt;&lt;/a&gt;百度主动推送&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;&lt;p&gt;安装hexo-baidu-url-submit插件&lt;/p&gt;
 &lt;figure class=&quot;highlight powershell&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;npm install hexo&lt;span class=&quot;literal&quot;&gt;-baidu-url-submit&lt;/span&gt; &lt;span class=&quot;literal&quot;&gt;--save&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;站点配置文件中添加baidu-url-submit的配置项&lt;/p&gt;</summary>
    
    
    
    <category term="hexo" scheme="https://cdd9527.cn/categories/hexo/"/>
    
    
    <category term="hexo" scheme="https://cdd9527.cn/tags/hexo/"/>
    
    <category term="博客主动推送" scheme="https://cdd9527.cn/tags/%E5%8D%9A%E5%AE%A2%E4%B8%BB%E5%8A%A8%E6%8E%A8%E9%80%81/"/>
    
  </entry>
  
  <entry>
    <title>spring笔记</title>
    <link href="https://cdd9527.cn/posts/10013-spring/"/>
    <id>https://cdd9527.cn/posts/10013-spring/</id>
    <published>2019-03-27T08:11:20.000Z</published>
    <updated>2026-03-26T06:17:39.488Z</updated>
    
    <content type="html"><![CDATA[<h1 id="介绍spring框架"><a href="#介绍spring框架" class="headerlink" title="介绍spring框架"></a>介绍spring框架</h1><p>Spring 框架是一个Java平台，它为开发Java应用程序提供全面的基础架构支持。Spring负责基础架构，因此您可以专注于应用程序的开发。</p><p>Spring可以让您从“plain old Java objects”（POJO）中构建应用程序和通过非侵入性的POJO实现企业应用服务。此功能适用于Java SE的编程模型，全部的或部分的适应Java EE模型。</p><p>中文文档API:<a href="https://lfvepclr.gitbooks.io/spring-framework-5-doc-cn/content/2/2-2.html">https://lfvepclr.gitbooks.io/spring-framework-5-doc-cn/content/2/2-2.html</a></p><span id="more"></span><h1 id="spring特点"><a href="#spring特点" class="headerlink" title="spring特点"></a>spring特点</h1><ol><li>轻量级</li><li>控制反转<ul><li><p>依赖注入和控制反转</p><p>Spring框架控制反转（IOC）组件通过提供一系列的标准化的方法把完全不同的组件组合成一个能够使用的应用程序来解决这个问题。Spring框架把形式化的设计模式编写为优秀的对象，你可以容易的集成到自己的应用程序中。许多组织和机构使用Spring框架，以这种方式(使用Spring的模式对象)来设计健壮的，可维护的应用程序。</p><p>通俗易懂的一个回答:<a href="https://www.zhihu.com/question/32108444">https://www.zhihu.com/question/32108444</a>.</p></li></ul></li><li>面向切面</li><li>容器</li><li>框架集合<br><img src="http://image.cdd9527.cn/20190505155703276180877.png" alt="20190505155703276180877.png"></li></ol><h1 id="spring核心组件"><a href="#spring核心组件" class="headerlink" title="spring核心组件"></a>spring核心组件</h1><p><img src="http://image.cdd9527.cn/20190505155703278433827.png" alt="20190505155703278433827.png"></p><h1 id="spring常用模块"><a href="#spring常用模块" class="headerlink" title="spring常用模块"></a>spring常用模块</h1><p><img src="http://image.cdd9527.cn/20190505155703280559469.png" alt="20190505155703280559469.png"></p><h1 id="常用注解"><a href="#常用注解" class="headerlink" title="常用注解"></a>常用注解</h1><p><img src="http://image.cdd9527.cn/20190505155703283036262.png" alt="20190505155703283036262.png"></p><p>未完待续。。:smile:</p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;介绍spring框架&quot;&gt;&lt;a href=&quot;#介绍spring框架&quot; class=&quot;headerlink&quot; title=&quot;介绍spring框架&quot;&gt;&lt;/a&gt;介绍spring框架&lt;/h1&gt;&lt;p&gt;Spring 框架是一个Java平台，它为开发Java应用程序提供全面的基础架构支持。Spring负责基础架构，因此您可以专注于应用程序的开发。&lt;/p&gt;
&lt;p&gt;Spring可以让您从“plain old Java objects”（POJO）中构建应用程序和通过非侵入性的POJO实现企业应用服务。此功能适用于Java SE的编程模型，全部的或部分的适应Java EE模型。&lt;/p&gt;
&lt;p&gt;中文文档API:&lt;a href=&quot;https://lfvepclr.gitbooks.io/spring-framework-5-doc-cn/content/2/2-2.html&quot;&gt;https://lfvepclr.gitbooks.io/spring-framework-5-doc-cn/content/2/2-2.html&lt;/a&gt;&lt;/p&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="java" scheme="https://cdd9527.cn/tags/java/"/>
    
    <category term="spring" scheme="https://cdd9527.cn/tags/spring/"/>
    
  </entry>
  
  <entry>
    <title>mac破解百度云盘限速</title>
    <link href="https://cdd9527.cn/posts/10014-baiducloud/"/>
    <id>https://cdd9527.cn/posts/10014-baiducloud/</id>
    <published>2019-03-27T08:05:54.000Z</published>
    <updated>2026-03-26T06:17:39.482Z</updated>
    
    <content type="html"><![CDATA[<p>现在市场上网盘就百度一家独大了，为了赚钱限制下载速度，一个1G的文件下载速度几十KB每秒，如果不开会员，可能要下一天，要是着急的话简直想砸电脑，简直不能忍，此时贴心的百度会给你推荐，请付费升级到会员，畅享高速，最终只能开个会员了。对于我这种月光族的人来说，能省就省吧。进入正题！！</p><h1 id="两个工具"><a href="#两个工具" class="headerlink" title="两个工具"></a>两个工具</h1><p>一、Chrome插件:网盘助手</p><p><code>链接:</code> <a href="https://pan.baidu.com/s/1mreRqTlTzwjmiEd9o1m83A">https://pan.baidu.com/s/1mreRqTlTzwjmiEd9o1m83A</a> <code>提取码:</code> pckp</p><p>下载后直接将文件夹拖进去<br>最终在谷歌插件列表中出现一个这样的图标</p><span id="more"></span><p>二、开源软件: Aria2GUI</p><p><code>链接:</code> <a href="https://github.com/yangshun1029/aria2gui">https://github.com/yangshun1029/aria2gui</a></p><p>解压后直接拖到应用里面运行即可</p><p>接下来你重启浏览器，进入下载页面时会多出一个“导出下载”按钮。选第一个就ok了，打完收工！</p><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;现在市场上网盘就百度一家独大了，为了赚钱限制下载速度，一个1G的文件下载速度几十KB每秒，如果不开会员，可能要下一天，要是着急的话简直想砸电脑，简直不能忍，此时贴心的百度会给你推荐，请付费升级到会员，畅享高速，最终只能开个会员了。对于我这种月光族的人来说，能省就省吧。进入正题！！&lt;/p&gt;
&lt;h1 id=&quot;两个工具&quot;&gt;&lt;a href=&quot;#两个工具&quot; class=&quot;headerlink&quot; title=&quot;两个工具&quot;&gt;&lt;/a&gt;两个工具&lt;/h1&gt;&lt;p&gt;一、Chrome插件:网盘助手&lt;/p&gt;
&lt;p&gt;&lt;code&gt;链接:&lt;/code&gt; &lt;a href=&quot;https://pan.baidu.com/s/1mreRqTlTzwjmiEd9o1m83A&quot;&gt;https://pan.baidu.com/s/1mreRqTlTzwjmiEd9o1m83A&lt;/a&gt; &lt;code&gt;提取码:&lt;/code&gt; pckp&lt;/p&gt;
&lt;p&gt;下载后直接将文件夹拖进去&lt;br&gt;最终在谷歌插件列表中出现一个这样的图标&lt;/p&gt;</summary>
    
    
    
    <category term="mac" scheme="https://cdd9527.cn/categories/mac/"/>
    
    
    <category term="mac" scheme="https://cdd9527.cn/tags/mac/"/>
    
    <category term="百度云破解" scheme="https://cdd9527.cn/tags/%E7%99%BE%E5%BA%A6%E4%BA%91%E7%A0%B4%E8%A7%A3/"/>
    
  </entry>
  
  <entry>
    <title>Guava——Joiner</title>
    <link href="https://cdd9527.cn/posts/10015-joiner/"/>
    <id>https://cdd9527.cn/posts/10015-joiner/</id>
    <published>2019-03-27T07:43:35.000Z</published>
    <updated>2026-03-26T06:17:39.429Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Joiner"><a href="#Joiner" class="headerlink" title="Joiner"></a>Joiner</h1><p>字符串拼接对象</p><h1 id="on方法"><a href="#on方法" class="headerlink" title="on方法"></a>on方法</h1><ul><li><p>on 以空格为分隔符</p></li><li><p>join内是拼接的对象:<code>迭代器对象</code>、<code>数组</code>、<code>可变参数</code>等</p></li></ul><figure class="highlight java"><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="comment">//例子</span></span><br><span class="line">Joiner.on(<span class="string">&quot; &quot;</span>).join(<span class="string">&quot;四川省&quot;</span>,<span class="string">&quot;成都市&quot;</span>,<span class="string">&quot;金牛区&quot;</span>).toString();</span><br><span class="line"></span><br><span class="line"><span class="comment">//result</span></span><br><span class="line">四川省 成都市 金牛区</span><br><span class="line"></span><br><span class="line"><span class="comment">//动态拼接</span></span><br><span class="line"><span class="type">StringBuffer</span> <span class="variable">result</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">StringBuffer</span>(<span class="string">&quot;result: &quot;</span>);</span><br><span class="line">        Joiner.on(<span class="string">&quot; &quot;</span>).appendTo(result,<span class="number">7</span>,<span class="number">8</span>);</span><br><span class="line"><span class="comment">//result</span></span><br><span class="line"><span class="number">7</span> <span class="number">8</span></span><br><span class="line"></span><br><span class="line"><span class="comment">//直接忽略Null</span></span><br><span class="line">Joiner.on(<span class="string">&quot; &quot;</span>).skipNulls().join(<span class="string">&quot;四川省&quot;</span>,<span class="string">&quot;成都市&quot;</span>,<span class="string">&quot;金牛区&quot;</span>,<span class="literal">null</span>).toString()</span><br><span class="line"><span class="comment">//找出Null，并用其他值代替</span></span><br><span class="line">Joiner.on(<span class="string">&quot; &quot;</span>).useForNull(<span class="string">&quot;未填写&quot;</span>).join(<span class="string">&quot;四川省&quot;</span>,<span class="string">&quot;成都市&quot;</span>,<span class="string">&quot;金牛区&quot;</span>,<span class="literal">null</span>).toString()</span><br><span class="line"><span class="comment">//result</span></span><br><span class="line">四川省 成都市 金牛区 </span><br><span class="line">四川省 成都市 金牛区 未填写</span><br><span class="line"></span><br></pre></td></tr></table></figure><span id="more"></span><h1 id="Joiner-MapJoiner"><a href="#Joiner-MapJoiner" class="headerlink" title="Joiner.MapJoiner"></a>Joiner.MapJoiner</h1><ul><li>MapJoiner 是 Joiner 的内部静态类，用于帮助将 Map 对象拼接成字符串。</li></ul><figure class="highlight java"><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></pre></td><td class="code"><pre><span class="line"><span class="comment">//例子1</span></span><br><span class="line">Joiner.on(<span class="string">&quot; &quot;</span>).withKeyValueSeparator(<span class="string">&quot;=&quot;</span>).join(ImmutableMap.of(<span class="string">&quot;收件人&quot;</span>,<span class="string">&quot;Nimo&quot;</span>,<span class="string">&quot;联系方式&quot;</span>,<span class="string">&quot;123&quot;</span>,<span class="string">&quot;收件地址&quot;</span>,<span class="string">&quot;浙江省杭州市滨江区XXXX&quot;</span>));</span><br><span class="line"><span class="comment">//result</span></span><br><span class="line">收件人=Nimo 联系方式=<span class="number">123</span> 收件地址=浙江省杭州市滨江区XXXX</span><br><span class="line"></span><br><span class="line"><span class="comment">//例子2</span></span><br><span class="line">Map&lt;String, String&gt; testMap = Maps.newLinkedHashMap();</span><br><span class="line">testMap.put(<span class="string">&quot;Washington D.C&quot;</span>, <span class="string">&quot;Redskins&quot;</span>);</span><br><span class="line">testMap.put(<span class="string">&quot;New York City&quot;</span>, <span class="string">&quot;Giants&quot;</span>);</span><br><span class="line">testMap.put(<span class="string">&quot;Philadelphia&quot;</span>, <span class="string">&quot;Eagles&quot;</span>);</span><br><span class="line">testMap.put(<span class="string">&quot;Dallas&quot;</span>, <span class="string">&quot;Cowboys&quot;</span>);</span><br><span class="line"><span class="type">String</span> <span class="variable">returnedString</span> <span class="operator">=</span> Joiner.on(<span class="string">&quot;#&quot;</span>).withKeyValueSeparator(<span class="string">&quot;=&quot;</span>).join(testMap);</span><br><span class="line">System.out.println(returnedString);</span><br><span class="line"><span class="comment">//result</span></span><br><span class="line">Washington D.C=Redskins#New York City=Giants#Philadelphia=Eagles#Dallas=Cowboys</span><br></pre></td></tr></table></figure><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;Joiner&quot;&gt;&lt;a href=&quot;#Joiner&quot; class=&quot;headerlink&quot; title=&quot;Joiner&quot;&gt;&lt;/a&gt;Joiner&lt;/h1&gt;&lt;p&gt;字符串拼接对象&lt;/p&gt;
&lt;h1 id=&quot;on方法&quot;&gt;&lt;a href=&quot;#on方法&quot; class=&quot;headerlink&quot; title=&quot;on方法&quot;&gt;&lt;/a&gt;on方法&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;&lt;p&gt;on 以空格为分隔符&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;join内是拼接的对象:&lt;code&gt;迭代器对象&lt;/code&gt;、&lt;code&gt;数组&lt;/code&gt;、&lt;code&gt;可变参数&lt;/code&gt;等&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;highlight java&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;5&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;6&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;7&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;8&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;9&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;10&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;11&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;12&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;13&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;14&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;15&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;16&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;17&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;18&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;19&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;20&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//例子&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;Joiner.on(&lt;span class=&quot;string&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;).join(&lt;span class=&quot;string&quot;&gt;&amp;quot;四川省&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;成都市&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;金牛区&amp;quot;&lt;/span&gt;).toString();&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//result&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;四川省 成都市 金牛区&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//动态拼接&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;type&quot;&gt;StringBuffer&lt;/span&gt; &lt;span class=&quot;variable&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;title class_&quot;&gt;StringBuffer&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&amp;quot;result: &amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;        Joiner.on(&lt;span class=&quot;string&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;).appendTo(result,&lt;span class=&quot;number&quot;&gt;7&lt;/span&gt;,&lt;span class=&quot;number&quot;&gt;8&lt;/span&gt;);&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//result&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;number&quot;&gt;7&lt;/span&gt; &lt;span class=&quot;number&quot;&gt;8&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//直接忽略Null&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;Joiner.on(&lt;span class=&quot;string&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;).skipNulls().join(&lt;span class=&quot;string&quot;&gt;&amp;quot;四川省&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;成都市&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;金牛区&amp;quot;&lt;/span&gt;,&lt;span class=&quot;literal&quot;&gt;null&lt;/span&gt;).toString()&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//找出Null，并用其他值代替&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;Joiner.on(&lt;span class=&quot;string&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;).useForNull(&lt;span class=&quot;string&quot;&gt;&amp;quot;未填写&amp;quot;&lt;/span&gt;).join(&lt;span class=&quot;string&quot;&gt;&amp;quot;四川省&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;成都市&amp;quot;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&amp;quot;金牛区&amp;quot;&lt;/span&gt;,&lt;span class=&quot;literal&quot;&gt;null&lt;/span&gt;).toString()&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//result&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;四川省 成都市 金牛区 &lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;四川省 成都市 金牛区 未填写&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="java8" scheme="https://cdd9527.cn/tags/java8/"/>
    
    <category term="Joiner" scheme="https://cdd9527.cn/tags/Joiner/"/>
    
  </entry>
  
  <entry>
    <title>JVM学习</title>
    <link href="https://cdd9527.cn/posts/10011-jvm/"/>
    <id>https://cdd9527.cn/posts/10011-jvm/</id>
    <published>2018-11-08T08:36:44.000Z</published>
    <updated>2026-03-26T06:17:39.543Z</updated>
    
    <content type="html"><![CDATA[<p><img src="http://image.cdd9527.cn/20190415155529762441100.png" alt="20190415155529762441100.png"><br>#JVM简介<br>我们都知道 Java 源文件，通过编译器，能够生产相应的.Class 文件，也就是字节码文件， 而字节码文件又通过 Java 虚拟机中的解释器，编译成特定机器上的机器码 。</p><p>大概顺序是: Java 源文件—-&gt;编译器—-&gt;字节码文件—-&gt;JVM—-&gt;机器码</p><p>每一种平台的解释器是不同的，但是实现的虚拟机是相同的，这也就是 Java 为什么能够 跨平台的原因了 ，当一个程序从开始运行，这时虚拟机就开始实例化了，多个程序启动就会 存在多个虚拟机实例。程序退出或者关闭，则虚拟机实例消亡，<strong>多个虚拟机实例之间数据不能共享</strong>。<br><img src="http://image.cdd9527.cn/20190415155529814332449.png" alt="20190415155529814332449.png"></p><p>Hotspot JVM 后台运行的系统线程主要有下面几个:</p><ul><li>虚拟机线程 (VM thread)<BR><br>这个线程等待 JVM 到达安全点操作出现。这些操作必须要在独立的线程里执行，因为当 堆修改无法进行时，线程都需要 JVM 位于安全点。这些操作的类型有:stop-the- world 垃圾回收、线程栈 dump、线程暂停、线程偏向锁(biased locking)解除。</li><li>周期性任务线程<BR><br>这线程负责定时器事件(也就是中断)，用来调度周期性操作的执行。</li><li>GC 线程<BR><br>这些线程支持 JVM 中不同的垃圾回收活动。</li><li>编译器线程<BR><br>这些线程在运行时将字节码动态编译成本地平台相关的机器码。</li><li>信号分发线程<BR><br>这个线程接收发送到 JVM 的信号并调用适当的 JVM 方法处理。</li></ul><h1 id="线程"><a href="#线程" class="headerlink" title="线程"></a>线程</h1><p>这里所说的线程指程序执行过程中的一个线程实体。JVM 允许一个应用并发执行多个线程。<br>Hotspot JVM 中的 Java 线程与原生操作系统线程有直接的映射关系。<code>当线程本地存储、缓 冲区分配、同步对象、栈、程序计数器等准备好以后，就会创建一个操作系统原生线程。 Java 线程结束，原生线程随之被回收。操作系统负责调度所有线程，并把它们分配到任何可 用的 CPU 上。当原生线程初始化完毕，就会调用 Java 线程的 run() 方法。当线程结束时，会释放原生线程和 Java 线程的所有资源。</code></p><blockquote><p>所谓虚拟机，就足一台虚拟的机器。它是一款软件，用来执行一系列虚拟计算机指令，大体上虚拟机可以分为系统虚拟机和程序虚拟机，大名鼎鼎的Visual Box、VMare就A4于系统虚拟机，他们完全是对物理计算机的仿真，提供个可运行完整操作系统的软件f台•程序虚拟机典犁代表就是Java虚拟机，它专f〗为执行单个U•算机程序iW设汁，在java虚拟机中执行的指令我们成为java字节码指令•无论是系统虚拟机还是程序虚拟机，在上面运行的软件都被限制子虚拟机提供的资源中.Java发展至今，出现过很多虚拟机,最初Sun使用的一款叫Classic的Java虚拟机，到现在引用最广泛的是HotSpot虚拟机，除了Sun意外，还有BEA的JRockit, 目前JRockit和<br>  Hotspot都被Oracle收入旗下，大有整合的趋势.</p></blockquote><h2 id="类加载子系统"><a href="#类加载子系统" class="headerlink" title="类加载子系统"></a>类加载子系统</h2><p>负责从文件系统或者网络中加载Class信息，加载的信息存放在一块称之为方法区的内存空间。</p><h2 id="方法区"><a href="#方法区" class="headerlink" title="方法区"></a>方法区</h2><p>就是存放类信息、常量信息、常量池信息、包括字符串字面量和数字常量等。</p><h2 id="堆"><a href="#堆" class="headerlink" title="堆"></a>堆</h2><p>在java虚拟机启动的时候建立java堆，它是java程序最主要的内存工作区域，几乎所有的对象实例都存放到java堆中，堆空间是所有线程共享的。</p><h2 id="直接内存"><a href="#直接内存" class="headerlink" title="直接内存"></a>直接内存</h2><p>java的NIO库允许java程序使用直接内存，从而提高性能，通常直接内存速度会优于java堆。读写频繁的场合可能会考虑使用。</p><h2 id="栈"><a href="#栈" class="headerlink" title="栈"></a>栈</h2><p>每个虚拟机线程都有一个私有的栈，一个线程的java栈在线程创建的时候被创建，java栈中保存着局部变量、方法参数、同时java的方法调用、返回值等。</p><h2 id="本地方法栈"><a href="#本地方法栈" class="headerlink" title="本地方法栈"></a>本地方法栈</h2><p>本地方法栈和java栈非常类似，最大不同为本地方法栈用于本地方法调用。java虚拟机允许java直接调用本地方法（通常使用C编写）</p><h2 id="垃圾收集系统"><a href="#垃圾收集系统" class="headerlink" title="垃圾收集系统"></a>垃圾收集系统</h2><p>垃圾收集系统是java的核心，也是必不可少的，java有一套自己进行垃圾清理的机制，开发人员无需手动清理。</p><h2 id="PC寄存器"><a href="#PC寄存器" class="headerlink" title="PC寄存器"></a>PC寄存器</h2><p>PC(Program Counter)寄存器也是每个线程私有的空间，java虚拟机会为每个线程创建PC寄存器，在任意时刻，一个java线程总是在执行一个方法，这个方法被称为当前方法，如果当前方法不是本地方法，PC寄存器就会执行当前正在被执行的指令，如果是本地方法，则PC寄存器值为undefined，寄存器存放入当前执行环节指针、程序计数器、操作栈指针、计算的变量指针等信息。</p><h2 id="执行引擎组件"><a href="#执行引擎组件" class="headerlink" title="执行引擎组件"></a>执行引擎组件</h2><p>虚拟机最核心的组件就是执行引擎了，它负责执行虚拟机的字节码。一般会先进行编译成机器码后执行</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;&lt;img src=&quot;http://image.cdd9527.cn/20190415155529762441100.png&quot; alt=&quot;20190415155529762441100.png&quot;&gt;&lt;br&gt;#JVM简介&lt;br&gt;我们都知道 Java 源文件，通过编译器，能够生产相</summary>
      
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="java" scheme="https://cdd9527.cn/tags/java/"/>
    
    <category term="jvm" scheme="https://cdd9527.cn/tags/jvm/"/>
    
  </entry>
  
  <entry>
    <title>日志体系</title>
    <link href="https://cdd9527.cn/posts/10012-log/"/>
    <id>https://cdd9527.cn/posts/10012-log/</id>
    <published>2018-11-08T08:36:44.000Z</published>
    <updated>2026-03-26T06:17:39.532Z</updated>
    
    <content type="html"><![CDATA[<h1 id="日志种类"><a href="#日志种类" class="headerlink" title="日志种类"></a>日志种类</h1><ol><li>log4j</li><li>log4j2</li><li>jcl(底层调用的是log4j)</li><li>slf4j</li><li>logback</li><li>jul(jdk自带的)</li><li>simplelog</li></ol><span id="more"></span><p>未完待续！</p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;日志种类&quot;&gt;&lt;a href=&quot;#日志种类&quot; class=&quot;headerlink&quot; title=&quot;日志种类&quot;&gt;&lt;/a&gt;日志种类&lt;/h1&gt;&lt;ol&gt;
&lt;li&gt;log4j&lt;/li&gt;
&lt;li&gt;log4j2&lt;/li&gt;
&lt;li&gt;jcl(底层调用的是log4j)&lt;/li&gt;
&lt;li&gt;slf4j&lt;/li&gt;
&lt;li&gt;logback&lt;/li&gt;
&lt;li&gt;jul(jdk自带的)&lt;/li&gt;
&lt;li&gt;simplelog&lt;/li&gt;
&lt;/ol&gt;</summary>
    
    
    
    <category term="java" scheme="https://cdd9527.cn/categories/java/"/>
    
    
    <category term="java" scheme="https://cdd9527.cn/tags/java/"/>
    
    <category term="日志" scheme="https://cdd9527.cn/tags/%E6%97%A5%E5%BF%97/"/>
    
  </entry>
  
  <entry>
    <title>和吕:高山茶籽油</title>
    <link href="https://cdd9527.cn/posts/10010-chayou/"/>
    <id>https://cdd9527.cn/posts/10010-chayou/</id>
    <published>2018-10-23T03:58:22.000Z</published>
    <updated>2026-03-26T06:17:39.537Z</updated>
    
    <content type="html"><![CDATA[<h1 id="和吕村介绍"><a href="#和吕村介绍" class="headerlink" title="和吕村介绍"></a>和吕村介绍</h1><p>和吕村地处罗霄山脉中段地带，崇山俊岭，与井岗山山脉相连，最高山峰海拔1344米,略高于1300米的南岳衡山。属茶陵县与井岗山市交接处，从山顶向四周眺望，众山尽收眼底，云山雾绕，风景秀丽，不亚于南岳衡山；</p><span id="more"></span><ul><li>石峰仙<br><img src="http://image.cdd9527.cn/20190505155703233727149.png" alt="20190505155703233727149.png"></li><li>云海<br><img src="http://image.cdd9527.cn/20190505155703236912957.png" alt="20190505155703236912957.png"></li></ul><p><img src="http://image.cdd9527.cn/20190505155703247283145.png" alt="20190505155703247283145.png"></p><h1 id="茶油功效"><a href="#茶油功效" class="headerlink" title="茶油功效"></a>茶油功效</h1><p>野山茶油又名油茶籽油、山茶油，是纯天然高级木本食用油。油茶树生长在亚热带南岭湿润气候区，整个生长过程无需化肥、农药等辅助手段。山茶果生长期从开花到成熟，历经秋、冬、春、夏、四季之雨露，尽吸天然养份、日月精华，营养价值极高。是《中国食物结构改革与发展规划纲要》中大力提倡推广的食用植物油，也是国际粮农组织首推的卫生保健植物食用油。</p><ul><li>保护皮肤</li><li>减肥功效</li><li>去除妊娠纹</li><li>防眼角皱纹</li><li>美白护肤</li><li>治疗暗疮</li><li>保持女性的体态美</li><li>补充维生素</li></ul><p>详情可以看百度介绍<a href="https://baike.baidu.com/item/%E6%B2%B9%E8%8C%B6%E7%B1%BD%E6%B2%B9/3328212">油茶籽油</a></p><h1 id="茶油种植地实拍图"><a href="#茶油种植地实拍图" class="headerlink" title="茶油种植地实拍图"></a>茶油种植地实拍图</h1><p><img src="http://image.cdd9527.cn/20190505155703250793561.png" alt="20190505155703250793561.png"><br><img src="http://image.cdd9527.cn/20190505155703255818370.png" alt="20190505155703255818370.png"><br><img src="http://image.cdd9527.cn/20190505155703258516630.png" alt="20190505155703258516630.png"><br><img src="http://image.cdd9527.cn/20190505155703260710936.png" alt="20190505155703260710936.png"><br><img src="http://image.cdd9527.cn/20190505155703266998458.png" alt="20190505155703266998458.png"></p><p>感谢观看！产地直销，没有中间商赚差价，需要的可以留下联系方式或者长按二维码联系。:smile::smile::smile:</p><p><img src="http://image.cdd9527.cn/20190505155703270389935.png" alt="20190505155703270389935.png"></p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;和吕村介绍&quot;&gt;&lt;a href=&quot;#和吕村介绍&quot; class=&quot;headerlink&quot; title=&quot;和吕村介绍&quot;&gt;&lt;/a&gt;和吕村介绍&lt;/h1&gt;&lt;p&gt;和吕村地处罗霄山脉中段地带，崇山俊岭，与井岗山山脉相连，最高山峰海拔1344米,略高于1300米的南岳衡山。属茶陵县与井岗山市交接处，从山顶向四周眺望，众山尽收眼底，云山雾绕，风景秀丽，不亚于南岳衡山；&lt;/p&gt;</summary>
    
    
    
    <category term="生活" scheme="https://cdd9527.cn/categories/%E7%94%9F%E6%B4%BB/"/>
    
    
    <category term="和吕" scheme="https://cdd9527.cn/tags/%E5%92%8C%E5%90%95/"/>
    
    <category term="茶籽油" scheme="https://cdd9527.cn/tags/%E8%8C%B6%E7%B1%BD%E6%B2%B9/"/>
    
  </entry>
  
  <entry>
    <title>Centos安装msql并可以远程连接</title>
    <link href="https://cdd9527.cn/posts/10009-mysql/"/>
    <id>https://cdd9527.cn/posts/10009-mysql/</id>
    <published>2018-08-27T03:58:22.000Z</published>
    <updated>2026-03-26T06:17:39.423Z</updated>
    
    <content type="html"><![CDATA[<p>在CentOS中默认安装有MariaDB，这个是MySQL的分支，但为了需要，还是要在系统中安装MySQL，而且安装完成之后可以直接覆盖掉MariaDB。</p><h1 id="安装mysql"><a href="#安装mysql" class="headerlink" title="安装mysql"></a>安装mysql</h1><p>（由于yum源上没有mysql-server。所以必须去官网下载，这里 我们用wget命令，直接获取）</p><pre><code>wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm</code></pre><span id="more"></span><h1 id="安装mysql的依赖包"><a href="#安装mysql的依赖包" class="headerlink" title="安装mysql的依赖包"></a>安装mysql的依赖包</h1><pre><code>yum -y install mysql57-community-release-el7-10.noarch.rpm</code></pre><h1 id="安装mysql数据库"><a href="#安装mysql数据库" class="headerlink" title="安装mysql数据库"></a>安装mysql数据库</h1><pre><code>yum -y install mysql-community-server</code></pre><h1 id="完成安装，重启mysql"><a href="#完成安装，重启mysql" class="headerlink" title="完成安装，重启mysql"></a>完成安装，重启mysql</h1><pre><code>systemctl restart mysqld </code></pre><p>此时MySQL已经开始正常运行，不过要想进入MySQL还得先找出此时root用户的密码，通过如下命令可以在日志文件中找出密码：</p><pre><code>grep &quot;password&quot; /var/log/mysqld.log</code></pre><h1 id="复制粘贴上边的密码进入数据库"><a href="#复制粘贴上边的密码进入数据库" class="headerlink" title="复制粘贴上边的密码进入数据库"></a>复制粘贴上边的密码进入数据库</h1><pre><code>mysql -uroot -p</code></pre><p>输入初始密码，此时不能做任何事情，因为MySQL默认必须修改密码之后才能操作数据库修改密码命令：<br>    ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;123&#39;;</p><h1 id="解决报错"><a href="#解决报错" class="headerlink" title="解决报错"></a>解决报错</h1><p>以上报错是说新设置的密码过于简单，解决方式：<br>&#x2F;&#x2F;首先按照默认密码格式复杂度更改 </p><h1 id="查看MySQL完整的初始密码规则"><a href="#查看MySQL完整的初始密码规则" class="headerlink" title="查看MySQL完整的初始密码规则"></a>查看MySQL完整的初始密码规则</h1><p>查看MySQL完整的初始密码规则，查看的前提是必须先用ALTER USER命令更改过密码</p><pre><code>SHOW VARIABLES LIKE &#39;validate_password%&#39;;</code></pre><h1 id="修改MySQL默认策略和密码长度"><a href="#修改MySQL默认策略和密码长度" class="headerlink" title="修改MySQL默认策略和密码长度"></a>修改MySQL默认策略和密码长度</h1><p>因为当前的密码太复杂不方便后期做实验，所以使用命令修改密码策略两种方式：</p><pre><code>set global validate_password_policy=0;set global validate_password_policy=LOW;</code></pre><p>注：密码策略分四种<br>1、OFF（关闭） 2、LOW（低） 3、MEDIUM（中） 4、STRONG（强）</p><p>修改密码长度</p><p>上边改完策略之后我们在改长度<br>    SET GLOBAL validate_password_length&#x3D;4;</p><h1 id="查看密码规则"><a href="#查看密码规则" class="headerlink" title="查看密码规则"></a>查看密码规则</h1><p>都改完之后查看密码规则</p><pre><code>SHOW VARIABLES LIKE &#39;validate_password%&#39;;</code></pre><p>接下来就可以将刚才的复杂密码改为简单的四位的密码了；</p><h1 id="卸载安装源自动更新"><a href="#卸载安装源自动更新" class="headerlink" title="卸载安装源自动更新"></a>卸载安装源自动更新</h1><p>此时还有一个问题，就是因为安装了Yum Repository，以后每次yum操作都会自动更新，因为当前数据库已安装完成，所以把这个卸载掉：</p><pre><code>yum remove mysql57-community-release.noarch</code></pre><h1 id="初始化数据库"><a href="#初始化数据库" class="headerlink" title="初始化数据库"></a>初始化数据库</h1><pre><code>mysql_secure_installation</code></pre><p>注：执行完初始化命令后需要输入数据库root用户密码，然后默认如上截图一路回车即可。（以上截图问题也可根据自己实际情况进行选择）</p><h1 id="开启MySQL远程访问权限-允许远程连接"><a href="#开启MySQL远程访问权限-允许远程连接" class="headerlink" title="开启MySQL远程访问权限 允许远程连接"></a>开启MySQL远程访问权限 允许远程连接</h1><h2 id="登陆mysql数据库"><a href="#登陆mysql数据库" class="headerlink" title="登陆mysql数据库"></a>登陆mysql数据库</h2><pre><code>mysql -u root -p</code></pre><h2 id="查看user表"><a href="#查看user表" class="headerlink" title="查看user表"></a>查看user表</h2><pre><code>use mysqlselect host,user,password from user;</code></pre><p>可以看到在user表中已创建的root用户。host字段表示登录的主机，其值可以用IP，也可用主机名，有时想用本地IP登录，那么可以将以上的Host值改为自己的Ip即可。</p><h2 id="实现远程连接-授权法"><a href="#实现远程连接-授权法" class="headerlink" title="实现远程连接(授权法)"></a>实现远程连接(授权法)</h2><p>将host字段的值改为%就表示在任何客户端机器上能以root用户登录到mysql服务器，建议在开发时设为%。将权限改为ALL PRIVILEGES</p><pre><code>grant all privileges  on *.* to root@&#39;%&#39; identified by &quot;你的密码&quot;;flush privileges;select host,user,password from user;</code></pre><h2 id="实现远程连接（改表法）"><a href="#实现远程连接（改表法）" class="headerlink" title="实现远程连接（改表法）"></a>实现远程连接（改表法）</h2><pre><code>update user set host = ’%’ where user = ’root’;</code></pre><h1 id="Linux下彻底卸载mysql详解"><a href="#Linux下彻底卸载mysql详解" class="headerlink" title="Linux下彻底卸载mysql详解"></a>Linux下彻底卸载mysql详解</h1><p>使用以下命令查看当前安装mysql情况，查找以前是否装有mysql</p><pre><code>rpm -qa|grep -i mysql </code></pre><h2 id="停止mysql"><a href="#停止mysql" class="headerlink" title="停止mysql"></a>停止mysql</h2><pre><code>systemctl stop mysqld </code></pre><h2 id="删除"><a href="#删除" class="headerlink" title="删除"></a>删除</h2><pre><code>rpm -ev MySQL-client-5.5.25a-1.rhel5 </code></pre><p>如果提示依赖包错误，则使用以下命令尝试</p><pre><code>rpm -ev MySQL-client-5.5.25a-1.rhel5 --nodeps </code></pre><p>如果提示错误：error: %preun(xxxxxx) scriptlet failed, exit status 1</p><pre><code>rpm -e --noscripts MySQL-client-5.5.25a-1.rhel5 </code></pre><h2 id="查找之前老版本mysql的目录、并且删除老版本mysql的文件和库"><a href="#查找之前老版本mysql的目录、并且删除老版本mysql的文件和库" class="headerlink" title="查找之前老版本mysql的目录、并且删除老版本mysql的文件和库"></a>查找之前老版本mysql的目录、并且删除老版本mysql的文件和库</h2><pre><code>find / -name mysqlrm -rf /var/lib/mysql</code></pre><p>注意：卸载后&#x2F;etc&#x2F;my.cnf不会删除，需要进行手工删除</p><pre><code>rm -rf /etc/my.cnf </code></pre><h2 id="再次查找机器是否安装mysql"><a href="#再次查找机器是否安装mysql" class="headerlink" title="再次查找机器是否安装mysql"></a>再次查找机器是否安装mysql</h2><pre><code>rpm -qa|grep -i mysql </code></pre><p>end :smile:</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;在CentOS中默认安装有MariaDB，这个是MySQL的分支，但为了需要，还是要在系统中安装MySQL，而且安装完成之后可以直接覆盖掉MariaDB。&lt;/p&gt;
&lt;h1 id=&quot;安装mysql&quot;&gt;&lt;a href=&quot;#安装mysql&quot; class=&quot;headerlink&quot; title=&quot;安装mysql&quot;&gt;&lt;/a&gt;安装mysql&lt;/h1&gt;&lt;p&gt;（由于yum源上没有mysql-server。所以必须去官网下载，这里 我们用wget命令，直接获取）&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
&lt;/code&gt;&lt;/pre&gt;</summary>
    
    
    
    <category term="mysql" scheme="https://cdd9527.cn/categories/mysql/"/>
    
    
    <category term="linux" scheme="https://cdd9527.cn/tags/linux/"/>
    
    <category term="mysql" scheme="https://cdd9527.cn/tags/mysql/"/>
    
  </entry>
  
  <entry>
    <title>湖南茶陵可可农家:家的味道</title>
    <link href="https://cdd9527.cn/posts/10008-keke/"/>
    <id>https://cdd9527.cn/posts/10008-keke/</id>
    <published>2018-08-21T08:33:37.000Z</published>
    <updated>2026-03-26T06:14:59.717Z</updated>
    
    <content type="html"><![CDATA[<p>作为标准的吃货一枚</p><p>对美食那是从来都不愿错过的</p><p>在咱们茶陵</p><p>就有很多好吃的农家手工小吃</p><p>下面就大家去看一看</p><p>不知道是否有你也爱吃的</p><span id="more"></span><p>先来一波家乡的美照图，所有的农产品都来自这个山清水秀的地方!</p><p><img src="http://image.cdd9527.cn/20190505155703143013164.png" alt="20190505155703143013164.png"></p><p><img src="http://image.cdd9527.cn/20190505155703150772623.png" alt="20190505155703150772623.png"></p><p><img src="http://image.cdd9527.cn/20190505155703154072533.png" alt="20190505155703154072533.png"></p><p><img src="http://image.cdd9527.cn/20190505155703156948342.png" alt="20190505155703156948342.png"></p><p>正题来了,我觉得好吃的都列在下面了。</p><h2 id="No-1-香辣河鱼"><a href="#No-1-香辣河鱼" class="headerlink" title="No.1 香辣河鱼"></a>No.1 香辣河鱼</h2><p><img src="http://image.cdd9527.cn/20190505155703159643466.png" alt="20190505155703159643466.png"><br><img src="http://image.cdd9527.cn/20190505155703162135149.png" alt="20190505155703162135149.png"></p><h2 id="No-2-香辣河虾"><a href="#No-2-香辣河虾" class="headerlink" title="No.2 香辣河虾"></a>No.2 香辣河虾</h2><p><img src="http://image.cdd9527.cn/20190505155703165499639.png" alt="20190505155703165499639.png"><br><img src="http://image.cdd9527.cn/20190505155703170135150.png" alt="20190505155703170135150.png"></p><h2 id="No-3-香辣泥鳅"><a href="#No-3-香辣泥鳅" class="headerlink" title="No.3 香辣泥鳅"></a>No.3 香辣泥鳅</h2><p><img src="http://image.cdd9527.cn/20190505155703173538477.png" alt="20190505155703173538477.png"><br><img src="http://image.cdd9527.cn/20190505155703176250744.png" alt="20190505155703176250744.png"></p><h2 id="No-4-盐辣椒"><a href="#No-4-盐辣椒" class="headerlink" title="No.4 盐辣椒"></a>No.4 盐辣椒</h2><p><img src="http://image.cdd9527.cn/20190505155703179217263.png" alt="20190505155703179217263.png"><br><img src="http://image.cdd9527.cn/20190505155703181836525.png" alt="20190505155703181836525.png"></p><h2 id="No-5-豆豉鱼块"><a href="#No-5-豆豉鱼块" class="headerlink" title="No.5 豆豉鱼块"></a>No.5 豆豉鱼块</h2><p><img src="http://image.cdd9527.cn/20190505155703185642687.png" alt="20190505155703185642687.png"><br><img src="http://image.cdd9527.cn/20190505155703188355359.png" alt="20190505155703188355359.png"></p><h2 id="No-6-茶油霉豆腐"><a href="#No-6-茶油霉豆腐" class="headerlink" title="No.6 茶油霉豆腐"></a>No.6 茶油霉豆腐</h2><p><img src="http://image.cdd9527.cn/20190505155703191616853.png" alt="20190505155703191616853.png"><br><img src="http://image.cdd9527.cn/20190505155703194152357.png" alt="20190505155703194152357.png"></p><h2 id="No-7-手工米粉"><a href="#No-7-手工米粉" class="headerlink" title="No.7 手工米粉"></a>No.7 手工米粉</h2><p><img src="http://image.cdd9527.cn/20190505155703198062047.png" alt="20190505155703198062047.png"><br><img src="http://image.cdd9527.cn/20190505155703200736577.png" alt="20190505155703200736577.png"></p><h2 id="No-8-香辣萝卜条"><a href="#No-8-香辣萝卜条" class="headerlink" title="No.8 香辣萝卜条"></a>No.8 香辣萝卜条</h2><p><img src="http://image.cdd9527.cn/2019050515570320626213.png" alt="2019050515570320626213.png"><br><img src="http://image.cdd9527.cn/20190505155703208373528.png" alt="20190505155703208373528.png"></p><p>看了后是不是一直在吞口水，哈哈~</p><p>以上全都是手工制作</p><p>来看看制作的花絮吧</p><h2 id="制作花絮"><a href="#制作花絮" class="headerlink" title="制作花絮"></a>制作花絮</h2><ul><li><p>炸泥鳅<br><img src="http://image.cdd9527.cn/20190505155703211080763.png" alt="20190505155703211080763.png"></p></li><li><p>刚打捞回来的小河鱼<br><img src="http://image.cdd9527.cn/20190505155703213271052.png" alt="20190505155703213271052.png"></p></li><li><p>做米粉<br><img src="http://image.cdd9527.cn/20190505155703217737803.png" alt="20190505155703217737803.png"></p></li><li><p>捞河鱼<br><img src="http://image.cdd9527.cn/20190505155703219912162.png" alt="20190505155703219912162.png"><br><img src="http://image.cdd9527.cn/20190505155703221747752.png" alt="20190505155703221747752.png"></p></li></ul><p>想吃的话，赶紧找我或者下面这个人吧</p><p><img src="http://image.cdd9527.cn/20190505155703224435376.png" alt="20190505155703224435376.png"></p>]]></content>
    
    
    <summary type="html">&lt;p&gt;作为标准的吃货一枚&lt;/p&gt;
&lt;p&gt;对美食那是从来都不愿错过的&lt;/p&gt;
&lt;p&gt;在咱们茶陵&lt;/p&gt;
&lt;p&gt;就有很多好吃的农家手工小吃&lt;/p&gt;
&lt;p&gt;下面就大家去看一看&lt;/p&gt;
&lt;p&gt;不知道是否有你也爱吃的&lt;/p&gt;</summary>
    
    
    
    <category term="生活" scheme="https://cdd9527.cn/categories/%E7%94%9F%E6%B4%BB/"/>
    
    
    <category term="可可农家" scheme="https://cdd9527.cn/tags/%E5%8F%AF%E5%8F%AF%E5%86%9C%E5%AE%B6/"/>
    
  </entry>
  
  <entry>
    <title>Git实战</title>
    <link href="https://cdd9527.cn/posts/10006-git/"/>
    <id>https://cdd9527.cn/posts/10006-git/</id>
    <published>2018-08-20T01:51:46.000Z</published>
    <updated>2026-03-26T06:14:24.996Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Git保存用户名密码"><a href="#Git保存用户名密码" class="headerlink" title="Git保存用户名密码"></a>Git保存用户名密码</h2><p>走过路过不要错过，江南皮革厂倒闭啦！有点跑题了...</p><p>在linux上使用git，每次操作都需要输入账号密码，您是不是觉得特别烦恼？不用怕。</p><p>1.clone下来项目后用<code>ls -a</code>语句查询看有没有隐藏文件夹，如下</p><p><img src="http://image.cdd9527.cn/20190505155703129129835.png" alt="20190505155703129129835.png"></p><span id="more"></span><p>2.输入<code>vim .git/config</code>添加这两行<br>    [credential]<br>        helper &#x3D; store<br>效果如下<br><img src="http://image.cdd9527.cn/20190505155703133396333.png" alt="20190505155703133396333.png"></p><p>3.再去<code>git pull</code>等操作时只要第一次输入正确账号密码，后面就会一直记住密码啦！</p><h2 id="Git常用命令总结"><a href="#Git常用命令总结" class="headerlink" title="Git常用命令总结"></a>Git常用命令总结</h2><p>部分内容转自: <a href="https://blog.csdn.net/tomatozaitian/article/details/73515849">https://blog.csdn.net/tomatozaitian/article/details/73515849</a></p><h3 id="安装及配置："><a href="#安装及配置：" class="headerlink" title="安装及配置："></a>安装及配置：</h3><p>Ubuntu下安装：</p><pre><code>sudo apt-get install git</code></pre><p>配置用户名：</p><pre><code>git config --global user.name &quot;你的名字&quot;</code></pre><p>配置e-mail：</p><pre><code>git config --global user.email &quot;你的邮箱@xx.com&quot;</code></pre><h3 id="与添加有关的："><a href="#与添加有关的：" class="headerlink" title="与添加有关的："></a>与添加有关的：</h3><p>将当前目录变为仓库：</p><pre><code>git init</code></pre><p>将文件添加到暂存区：</p><pre><code>git add 文件名 [可选：另一个文件名]</code></pre><p>将暂存区提交到仓库：</p><pre><code>git commit –m &quot;描述&quot;</code></pre><h3 id="与查询有关的："><a href="#与查询有关的：" class="headerlink" title="与查询有关的："></a>与查询有关的：</h3><p>查询仓库状态：</p><pre><code>git status</code></pre><p>比较文件差异（请在git add之前使用）：</p><pre><code>git diff 文件名</code></pre><p>查看仓库历史记录(详细)：</p><pre><code>git log</code></pre><p>查看仓库历史记录(单行)：</p><pre><code>git log --pretty=online 或 git log --online</code></pre><p>查看所有版本的commit ID：</p><pre><code>git reflog</code></pre><h3 id="与撤销有关的："><a href="#与撤销有关的：" class="headerlink" title="与撤销有关的："></a>与撤销有关的：</h3><p>撤销工作区的修改：</p><pre><code>git checkout -- 文件名</code></pre><p>撤销暂存区的修改：</p><pre><code>git reset HEAD 文件名</code></pre><p>回退到历史版本：</p><pre><code>git reset --hard 该版本ID</code></pre><p>回退到上个版本：</p><pre><code>git reset --hard HEAD^//上上版本是HEAD^^，也可用HEAD~2表示，以此类推</code></pre><h3 id="与标签有关的："><a href="#与标签有关的：" class="headerlink" title="与标签有关的："></a>与标签有关的：</h3><p>为当前版本打标签：</p><pre><code>git tag 标签名</code></pre><p>为历史版本打标签：</p><pre><code>git tag 标签名 该版本ID</code></pre><p>指定标签说明：</p><pre><code>git tag –a 标签名 –m &quot;标签说明&quot; [可选：版本ID]</code></pre><p>查看所有标签：</p><pre><code>git tag</code></pre><p>查看某一标签：</p><pre><code>git show 标签名</code></pre><p>删除某一标签：</p><pre><code>git tag –d 标签名</code></pre><h3 id="与分支有关"><a href="#与分支有关" class="headerlink" title="与分支有关"></a>与分支有关</h3><p>创建分支</p><pre><code>git branch dev</code></pre><p>切换分支</p><pre><code>git checkout dev</code></pre><p>创建分支并切换分支</p><pre><code>git checkout -b dev</code></pre><p>删除分支</p><pre><code>git branch -d dev</code></pre><p>在分支上提交新的版本</p><pre><code>git commit -a -m &#39;dev1&#39;</code></pre><p>合并分支</p><pre><code>git merge dev</code></pre><p>分支的合并后显示log</p><pre><code>git log --oneline --graph --decorate</code></pre><p>在分支开发的过程中遇到其他问题需要切换其他分支<br>保留写好的内容在切换到主干<br>保留内容</p><pre><code>git stash </code></pre><p>在次切换分之后需要应用一下保留的内容</p><pre><code>git stash apply</code></pre><p>丢掉保存的内容</p><pre><code>git stash drop</code></pre><p>使用并丢掉</p><pre><code>git stash pop</code></pre><p>-有的时候开发需要合并指定的内容，而不是合并所有的提交，所以我们需要挑选最好的，自己生产版本</p><p>合并分支把树杈掰到主干上</p><pre><code>git rebase</code></pre><p>添加远程的仓库</p><pre><code>push -u //-u参数 upstreamgit push origin master -u   //获取最新代码git remote add origin 仓库的地址</code></pre><p>查看远程仓库</p><pre><code>git remote -v</code></pre><p>删除远程仓库</p><pre><code>git remote rm origin</code></pre><h3 id="其它记录"><a href="#其它记录" class="headerlink" title="其它记录"></a>其它记录</h3><p>一般配置</p><pre><code>git --version   //查看git的版本信息git config --global user.name   //获取当前登录的用户git config --global user.email  //获取当前登录用户的邮箱</code></pre><p>登录git</p><pre><code>/* 如果刚没有获取到用户配置，则只能拉取代码，不能修改  要是使用git，你要告诉git是谁在使用*/git config --global user.name &#39;userName&#39;    //设置git账户，userName为你的git账号，git config --global user.email &#39;email&#39;</code></pre><p>创建一个文件夹</p><pre><code>mkdir nodejs    //创建文件夹nodejscd nodejs       //切换到nodejs目录下</code></pre><p>初始化git仓库</p><pre><code>git init //在nodejs文件夹下初始化一个仓库，此时文件里会到一个.git的隐藏文件夹</code></pre><p>创建忽略文件</p><pre><code>touch .gitignore    //不需要服务器端提交的内容可以写到忽略文件里    /*        .git        .idea    */</code></pre><p>查看目录</p><pre><code>ls -al</code></pre><p>创建文件并写入内容</p><pre><code>//如果文件不存在则会创建文件echo &quot;hello git&quot;&gt; index.html       //将&#39;hello git&#39; 写入到index.html中//单个&gt;箭头表示写入， &gt;&gt;表示追加</code></pre><p>查看文件内容</p><pre><code>cat index.html</code></pre><p>增加到暂存区中</p><pre><code>git add index.htmlgit add -A      //全部添加到缓存区</code></pre><p>增加到版本库中</p><pre><code>git commit -m &#39;备注信息&#39;</code></pre><p>查看版本</p><pre><code>git log --oneline</code></pre><h3 id="比较差异"><a href="#比较差异" class="headerlink" title="比较差异"></a>比较差异</h3><p>比较的是暂存区和工作区的差异</p><pre><code>git diff </code></pre><p>比较的是暂存区和历史区的差异</p><pre><code>git diff --cached</code></pre><p>比较的是历史区和工作区的差异（修改）</p><pre><code>git diff master</code></pre><p>撤回内容<br>(如果修改了工作区的文件后发现改错了，可以用暂存区或者版本库里的文件替换掉工作区的文件)<br>用暂存区中的内容或者版本库中的内容覆盖掉工作区</p><pre><code>git checkout index.html</code></pre><p>取消增加到暂存区的内容（添加时）</p><pre><code>git reset HEAD index.html</code></pre><p>&#x2F;&#x2F;显示目录的状体 有没有添加或者修改文件</p><pre><code>git status</code></pre><p>删除本地文件</p><pre><code>rm fileName</code></pre><p>删除暂存区<br>保证当前工作区中没有index.html</p><pre><code>git rm index.html --cached使用--cached 表示只删除缓存区中的内容</code></pre><p>回滚版本<br>回滚最近的一个版本 git log</p><pre><code>git reset --hard HEAD/commit_id</code></pre><p>回滚到未来</p><pre><code>git reflog</code></pre>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;Git保存用户名密码&quot;&gt;&lt;a href=&quot;#Git保存用户名密码&quot; class=&quot;headerlink&quot; title=&quot;Git保存用户名密码&quot;&gt;&lt;/a&gt;Git保存用户名密码&lt;/h2&gt;&lt;p&gt;走过路过不要错过，江南皮革厂倒闭啦！有点跑题了...&lt;/p&gt;
&lt;p&gt;在linux上使用git，每次操作都需要输入账号密码，您是不是觉得特别烦恼？不用怕。&lt;/p&gt;
&lt;p&gt;1.clone下来项目后用&lt;code&gt;ls -a&lt;/code&gt;语句查询看有没有隐藏文件夹，如下&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;http://image.cdd9527.cn/20190505155703129129835.png&quot; alt=&quot;20190505155703129129835.png&quot;&gt;&lt;/p&gt;</summary>
    
    
    
    <category term="git" scheme="https://cdd9527.cn/categories/git/"/>
    
    
    <category term="centeros" scheme="https://cdd9527.cn/tags/centeros/"/>
    
    <category term="git" scheme="https://cdd9527.cn/tags/git/"/>
    
  </entry>
  
  <entry>
    <title>超级实用的谷歌插件</title>
    <link href="https://cdd9527.cn/posts/10007-google/"/>
    <id>https://cdd9527.cn/posts/10007-google/</id>
    <published>2018-08-01T06:47:32.000Z</published>
    <updated>2026-03-26T06:14:42.229Z</updated>
    
    <content type="html"><![CDATA[<h2 id="自己定义的排行榜"><a href="#自己定义的排行榜" class="headerlink" title="自己定义的排行榜"></a>自己定义的排行榜</h2><ol><li>AdBlock 当之无愧的NO.1能拦截所有的广告，包括播放器的广告</li><li>Tampermonkey 捣蛋的猴子？？我一般用来破解百度云盘下载限速用的，里面有各种各样的脚本。</li><li>新浪微博图床 免费的图片服务器</li><li>Proxy SwitchyOmega 一个自动代理的工具</li></ol><span id="more"></span><p>目前用的最多的就这四个，以后还有好东西再更新。:smile:</p>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;自己定义的排行榜&quot;&gt;&lt;a href=&quot;#自己定义的排行榜&quot; class=&quot;headerlink&quot; title=&quot;自己定义的排行榜&quot;&gt;&lt;/a&gt;自己定义的排行榜&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;AdBlock 当之无愧的NO.1能拦截所有的广告，包括播放器的广告&lt;/li&gt;
&lt;li&gt;Tampermonkey 捣蛋的猴子？？我一般用来破解百度云盘下载限速用的，里面有各种各样的脚本。&lt;/li&gt;
&lt;li&gt;新浪微博图床 免费的图片服务器&lt;/li&gt;
&lt;li&gt;Proxy SwitchyOmega 一个自动代理的工具&lt;/li&gt;
&lt;/ol&gt;</summary>
    
    
    
    
    <category term="google" scheme="https://cdd9527.cn/tags/google/"/>
    
  </entry>
  
  <entry>
    <title>使用mongodb</title>
    <link href="https://cdd9527.cn/posts/10005-mongodb/"/>
    <id>https://cdd9527.cn/posts/10005-mongodb/</id>
    <published>2018-07-30T09:11:07.000Z</published>
    <updated>2026-03-26T06:14:07.506Z</updated>
    
    <content type="html"><![CDATA[<h2 id="SpringBoot集成mongodb"><a href="#SpringBoot集成mongodb" class="headerlink" title="SpringBoot集成mongodb"></a>SpringBoot集成mongodb</h2><ul><li>添加maven依赖</li></ul><figure class="highlight xml"><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"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-data-mongodb<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br></pre></td></tr></table></figure><span id="more"></span><ul><li>连接配置<br>下列配置包含集群与非集群，具体含义可以自行百度。</li></ul><figure class="highlight properties"><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"><span class="attr">spring</span>:<span class="string"></span></span><br><span class="line">    <span class="attr">profiles</span>: <span class="string">jiaowu</span></span><br><span class="line">    <span class="attr">data</span>:<span class="string"></span></span><br><span class="line">        <span class="attr">mongodb</span>:<span class="string"></span></span><br><span class="line">            <span class="attr">uri</span>: <span class="string">mongodb://jiaoxueUser:fieXeiCh4Uqu@dds-uf6177cc6dec7d741.mongodb.rds.aliyuncs.com:3717,dds-uf6177cc6dec7d742.mongodb.rds.aliyuncs.com:3717/jiaoxue?authSource=jiaoxue;replicaSet=mgset-5439253</span></span><br><span class="line"><span class="comment">            #uri: mongodb://jiaoxueUser:fieXeiCh4Uqu@dds-uf6177cc6dec7d741.mongodb.rds.aliyuncs.com:3717/jiaoxue?authSource=jiaoxue</span></span><br></pre></td></tr></table></figure><ul><li>现在可以美滋滋的使用MongoTemplate了</li></ul><h2 id="mongoDb使用mongoexport导出"><a href="#mongoDb使用mongoexport导出" class="headerlink" title="mongoDb使用mongoexport导出"></a>mongoDb使用mongoexport导出</h2><p><b>mongoexport关键参数介绍</b></p><ul><li>-h,--host ：代表远程连接的数据库地址，默认连接本地Mongo数据库；</li><li>--port：代表远程连接的数据库的端口，默认连接的远程端口27017；</li><li>-u,--username：代表连接远程数据库的账号，如果设置数据库的认证，需要指定用户账号；</li><li>-p,--password：代表连接数据库的账号对应的密码；</li><li>-d,--db：代表连接的数据库；</li><li>-c,--collection：代表连接数据库中的集合；</li><li>-f, --fields：代表集合中的字段，可以根据设置选择导出的字段；</li><li>--type：代表导出输出的文件类型，包括csv和json文件；</li><li>-o, --out：代表导出的文件名；</li><li>-q, --query：代表查询条件；</li><li>--skip：跳过指定数量的数据；</li><li>--limit：读取指定数量的数据记录；</li><li>--sort：对数据进行排序，可以通过参数指定排序的字段，并使用 1 和 -1 来指定排序的方式，其中 1 为升序排列，而-1是用于降序排列,如sort({KEY:1})。</li></ul><h2 id="windows安装mongodb"><a href="#windows安装mongodb" class="headerlink" title="windows安装mongodb"></a>windows安装mongodb</h2><p>有linux的真不推荐在windows上装mongodb，因为太多坑了。linux安装我就不说了，直接上windows的安装步骤吧。</p><h3 id="下载安装"><a href="#下载安装" class="headerlink" title="下载安装"></a>下载安装</h3><p>第一坑来了，只要安装3.4以上的版本,就会一直卡住安装不了,所以还是乖乖的安装<code>mongodb3.4</code>以下的吧，点击这里<a href="http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-v3.4-latest-signed.msi?_ga=2.7045623.410933966.1512521590-461885398.1512521590">下载</a></p><h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><p>然后配置又是问题<br>参考<a href="http://www.cnblogs.com/lsc183/archive/2012/08/16/mongodb.html">http://www.cnblogs.com/lsc183/archive/2012/08/16/mongodb.html</a> 才配好。</p><p>1 添加安装路径到path环境变量：  C:\Program Files\MongoDB\Server\3.4\bin</p><p>2 创建两个文件夹 D:\mongodb\data  D:\mongodb\data\logs</p><p>3 创建服务（开机自启动） win+R cmd启动控制台<br>   cd C:\Program Files\MongoDB\Server\3.4\bin<br>   mongod.exe --dbpath&#x3D;D:\mongodb\data --logpath&#x3D;D:\mongodb\logs\mongodb.log --install</p><p>4 启动服务 net start mongodb</p><p>5 在浏览器 输入 <a href="http://localhost:27017/">http://localhost:27017/</a></p><p>看见<br>It looks like you are trying to access MongoDB over HTTP on the native driver port.</p><p>表示成功 </p><h2 id="MongoDb聚合"><a href="#MongoDb聚合" class="headerlink" title="MongoDb聚合"></a>MongoDb聚合</h2><p>去这个网站学习下语法:<a href="http://www.runoob.com/mongodb/mongodb-aggregate.html">http://www.runoob.com/mongodb/mongodb-aggregate.html</a></p><h2 id="MongoDb实战"><a href="#MongoDb实战" class="headerlink" title="MongoDb实战"></a>MongoDb实战</h2><p>记录一些遇到坑的解决方案。</p><h3 id="添加时区"><a href="#添加时区" class="headerlink" title="添加时区"></a>添加时区</h3><p>由于mongodb的问题,通过程序传进来的日期会有时区问题，所以需要在程序中处理时区问题。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sdf.setCalendar(new GregorianCalendar(new SimpleTimeZone(0, &quot;GMT&quot;)));</span><br></pre></td></tr></table></figure><h3 id="通过某些条件将B属性转换到A属性"><a href="#通过某些条件将B属性转换到A属性" class="headerlink" title="通过某些条件将B属性转换到A属性"></a>通过某些条件将B属性转换到A属性</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><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><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br></pre></td><td class="code"><pre><span class="line">db.getCollection(&#x27;questionInfo&#x27;).find(&#123;</span><br><span class="line">&quot;$and&quot;: [&#123;</span><br><span class="line">&quot;question.isenabled&quot;: true</span><br><span class="line">&#125;,</span><br><span class="line">&#123;</span><br><span class="line">&quot;question.virtual&quot;: 0</span><br><span class="line">&#125;,</span><br><span class="line">&#123;</span><br><span class="line">&quot;content.questionid&quot;: &#123;</span><br><span class="line">&quot;$exists&quot;: true</span><br><span class="line">&#125;</span><br><span class="line">&#125;,</span><br><span class="line">&#123;</span><br><span class="line">&quot;question.score&quot;: &#123;</span><br><span class="line">&quot;$gt&quot;: 0</span><br><span class="line">&#125;</span><br><span class="line">&#125;,</span><br><span class="line">&#123;</span><br><span class="line">&quot;evaluations.questionId&quot;: &#123;</span><br><span class="line">&quot;$exists&quot;: true</span><br><span class="line">&#125;</span><br><span class="line">&#125;,</span><br><span class="line">&#123;</span><br><span class="line">&quot;question.audituser&quot;: &#123;</span><br><span class="line">&quot;$exists&quot;: true</span><br><span class="line">&#125;</span><br><span class="line">&#125;</span><br><span class="line">]</span><br><span class="line">&#125;).forEach(function(u) &#123;</span><br><span class="line">    if(u.question.addLabelDate == null)&#123;</span><br><span class="line">        var date = u.question.updateDate;</span><br><span class="line">        if(date != null)&#123;</span><br><span class="line">            db.getCollection(&#x27;questionInfo&#x27;).update(&#123;&quot;_id&quot;:u._id&#125;,&#123;$set:&#123;&quot;question.addLabelDate&quot;: date&#125;&#125;)</span><br><span class="line">        &#125;else&#123;</span><br><span class="line">            db.getCollection(&#x27;questionInfo&#x27;).update(&#123;&quot;_id&quot;:u._id&#125;,&#123;$set:&#123;&quot;question.addLabelDate&quot;: u.question.createTime&#125;&#125;)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure>]]></content>
    
    
    <summary type="html">&lt;h2 id=&quot;SpringBoot集成mongodb&quot;&gt;&lt;a href=&quot;#SpringBoot集成mongodb&quot; class=&quot;headerlink&quot; title=&quot;SpringBoot集成mongodb&quot;&gt;&lt;/a&gt;SpringBoot集成mongodb&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;添加maven依赖&lt;/li&gt;
&lt;/ul&gt;
&lt;figure class=&quot;highlight xml&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;1&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;2&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;3&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;4&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;span class=&quot;name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;span class=&quot;name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;org.springframework.boot&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;span class=&quot;name&quot;&gt;groupId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;    &lt;span class=&quot;tag&quot;&gt;&amp;lt;&lt;span class=&quot;name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;spring-boot-starter-data-mongodb&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;span class=&quot;name&quot;&gt;artifactId&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span class=&quot;line&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;lt;/&lt;span class=&quot;name&quot;&gt;dependency&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/figure&gt;</summary>
    
    
    
    <category term="mongodb" scheme="https://cdd9527.cn/categories/mongodb/"/>
    
    
    <category term="mongodb" scheme="https://cdd9527.cn/tags/mongodb/"/>
    
    <category term="springboot" scheme="https://cdd9527.cn/tags/springboot/"/>
    
  </entry>
  
  <entry>
    <title>Markdown Style test</title>
    <link href="https://cdd9527.cn/posts/89757140/"/>
    <id>https://cdd9527.cn/posts/89757140/</id>
    <published>2018-07-24T15:31:06.000Z</published>
    <updated>2026-03-26T02:42:59.163Z</updated>
    
    <content type="html"><![CDATA[<p>This post is originated from <a href="https://gist.github.com/apackeer/4159268">here</a> and is used for testing markdown style. This post contains nearly every markdown usage. Make sure all the markdown elements below show up correctly.</p><span id="more"></span><hr><h2 id="Headers"><a href="#Headers" class="headerlink" title="Headers"></a>Headers</h2><figure class="highlight markdown"><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></pre></td><td class="code"><pre><span class="line"><span class="section"># H1</span></span><br><span class="line"><span class="section">## H2</span></span><br><span class="line"><span class="section">### H3</span></span><br><span class="line"><span class="section">#### H4</span></span><br><span class="line"><span class="section">##### H5</span></span><br><span class="line"><span class="section">###### H6</span></span><br><span class="line"></span><br><span class="line">Alternatively, for H1 and H2, an underline-ish style:</span><br><span class="line"></span><br><span class="line"><span class="section">Alt-H1</span></span><br><span class="line"><span class="section">======</span></span><br><span class="line"></span><br><span class="line"><span class="section">Alt-H2</span></span><br><span class="line"><span class="section">------</span></span><br></pre></td></tr></table></figure><h1 id="H1"><a href="#H1" class="headerlink" title="H1"></a>H1</h1><h2 id="H2"><a href="#H2" class="headerlink" title="H2"></a>H2</h2><h3 id="H3"><a href="#H3" class="headerlink" title="H3"></a>H3</h3><h4 id="H4"><a href="#H4" class="headerlink" title="H4"></a>H4</h4><h5 id="H5"><a href="#H5" class="headerlink" title="H5"></a>H5</h5><h6 id="H6"><a href="#H6" class="headerlink" title="H6"></a>H6</h6><p>Alternatively, for H1 and H2, an underline-ish style:</p><h1 id="Alt-H1"><a href="#Alt-H1" class="headerlink" title="Alt-H1"></a>Alt-H1</h1><h2 id="Alt-H2"><a href="#Alt-H2" class="headerlink" title="Alt-H2"></a>Alt-H2</h2><h2 id="Emphasis"><a href="#Emphasis" class="headerlink" title="Emphasis"></a>Emphasis</h2><figure class="highlight markdown"><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">Emphasis, aka italics, with <span class="emphasis">*asterisks*</span> or <span class="emphasis">_underscores_</span>.</span><br><span class="line"></span><br><span class="line">Strong emphasis, aka bold, with <span class="strong">**asterisks**</span> or <span class="strong">__underscores__</span>.</span><br><span class="line"></span><br><span class="line">Combined emphasis with <span class="strong">**asterisks and <span class="emphasis">_underscores_</span>**</span>.</span><br><span class="line"></span><br><span class="line">Strikethrough uses two tildes. ~~Scratch this.~~</span><br></pre></td></tr></table></figure><p>Emphasis, aka italics, with <em>asterisks</em> or <em>underscores</em>.</p><p>Strong emphasis, aka bold, with <strong>asterisks</strong> or <strong>underscores</strong>.</p><p>Combined emphasis with <strong>asterisks and <em>underscores</em></strong>.</p><p>Strikethrough uses two tildes. <del>Scratch this.</del></p><h2 id="Lists"><a href="#Lists" class="headerlink" title="Lists"></a>Lists</h2><figure class="highlight markdown"><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"><span class="bullet">1.</span> First ordered list item</span><br><span class="line"><span class="bullet">2.</span> Another item</span><br><span class="line"><span class="bullet">  *</span> Unordered sub-list.</span><br><span class="line"><span class="bullet">1.</span> Actual numbers don&#x27;t matter, just that it&#x27;s a number</span><br><span class="line"><span class="bullet">  1.</span> Ordered sub-list</span><br><span class="line"><span class="bullet">4.</span> And another item.</span><br><span class="line"></span><br><span class="line">   You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we&#x27;ll use three here to also align the raw Markdown).</span><br><span class="line"></span><br><span class="line">   To have a line break without a paragraph, you will need to use two trailing spaces.  </span><br><span class="line">   Note that this line is separate, but within the same paragraph.  </span><br><span class="line">   (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)</span><br><span class="line"></span><br><span class="line"><span class="bullet">*</span> Unordered list can use asterisks</span><br><span class="line"><span class="bullet">-</span> Or minuses</span><br><span class="line"><span class="bullet">+</span> Or pluses</span><br><span class="line"><span class="bullet">-</span> Paragraph In unordered list</span><br><span class="line"></span><br><span class="line">  For example like this.</span><br><span class="line"></span><br><span class="line">Common Paragraph with some text.</span><br><span class="line">And more text.</span><br></pre></td></tr></table></figure><ol><li>First ordered list item</li><li>Another item</li></ol><ul><li>Unordered sub-list.</li></ul><ol><li><p>Actual numbers don&#39;t matter, just that it&#39;s a number</p></li><li><p>Ordered sub-list</p></li><li><p>And another item.</p><p>You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we&#39;ll use three here to also align the raw Markdown).</p><p>To have a line break without a paragraph, you will need to use two trailing spaces.<br>Note that this line is separate, but within the same paragraph.<br>(This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)</p></li></ol><ul><li>Unordered list can use asterisks</li></ul><ul><li>Or minuses</li></ul><ul><li>Or pluses</li></ul><ul><li><p>Paragraph In unordered list</p><p>For example like this.</p></li></ul><p>Common Paragraph with some text.<br>And more text.</p><h2 id="Inline-HTML"><a href="#Inline-HTML" class="headerlink" title="Inline HTML"></a>Inline HTML</h2><figure class="highlight markdown"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">p</span>&gt;</span></span>To reboot your computer, press <span class="language-xml"><span class="tag">&lt;<span class="name">kbd</span>&gt;</span></span>ctrl<span class="language-xml"><span class="tag">&lt;/<span class="name">kbd</span>&gt;</span></span>+<span class="language-xml"><span class="tag">&lt;<span class="name">kbd</span>&gt;</span></span>alt<span class="language-xml"><span class="tag">&lt;/<span class="name">kbd</span>&gt;</span></span>+<span class="language-xml"><span class="tag">&lt;<span class="name">kbd</span>&gt;</span></span>del<span class="language-xml"><span class="tag">&lt;/<span class="name">kbd</span>&gt;</span></span>.<span class="language-xml"><span class="tag">&lt;/<span class="name">p</span>&gt;</span></span></span><br></pre></td></tr></table></figure><p>To reboot your computer, press <kbd>ctrl</kbd>+<kbd>alt</kbd>+<kbd>del</kbd>.</p><figure class="highlight markdown"><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"><span class="language-xml"><span class="tag">&lt;<span class="name">dl</span>&gt;</span></span></span><br><span class="line"><span class="code">    &lt;dt&gt;Definition list&lt;/dt&gt;</span></span><br><span class="line"><span class="code">    &lt;dd&gt;Is something people use sometimes.&lt;/dd&gt;</span></span><br><span class="line"><span class="code"></span></span><br><span class="line"><span class="code">    &lt;dt&gt;Markdown in HTML&lt;/dt&gt;</span></span><br><span class="line"><span class="code">    &lt;dd&gt;Does *not* work **very** well. Use HTML &lt;em&gt;tags&lt;/em&gt;.&lt;/dd&gt;</span></span><br><span class="line"><span class="code">&lt;/dl&gt;</span></span><br></pre></td></tr></table></figure><dl>    <dt>Definition list</dt>    <dd>Is something people use sometimes.</dd><pre><code>&lt;dt&gt;Markdown in HTML&lt;/dt&gt;&lt;dd&gt;Does *not* work **very** well. Use HTML &lt;em&gt;tags&lt;/em&gt;.&lt;/dd&gt;</code></pre></dl><h2 id="Links"><a href="#Links" class="headerlink" title="Links"></a>Links</h2><figure class="highlight markdown"><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></pre></td><td class="code"><pre><span class="line">[<span class="string">I&#x27;m an inline-style link</span>](<span class="link">https://www.google.com</span>)</span><br><span class="line"></span><br><span class="line">[<span class="string">I&#x27;m an inline-style link with title</span>](<span class="link">https://www.google.com &quot;Google&#x27;s Homepage&quot;</span>)</span><br><span class="line"></span><br><span class="line">[<span class="string">I&#x27;m a reference-style link</span>][<span class="symbol">Arbitrary case-insensitive reference text</span>]</span><br><span class="line"></span><br><span class="line">[<span class="string">I&#x27;m a relative reference to a repository file</span>](<span class="link">../blob/master/LICENSE</span>)</span><br><span class="line"></span><br><span class="line">[<span class="string">You can use numbers for reference-style link definitions</span>][<span class="symbol">1</span>]</span><br><span class="line"></span><br><span class="line">Or leave it empty and use the [link text itself]</span><br><span class="line"></span><br><span class="line">Some text to show that the reference links can follow later.</span><br><span class="line"></span><br><span class="line">[<span class="symbol">arbitrary case-insensitive reference text</span>]: <span class="link">https://hexo.io</span></span><br><span class="line">[<span class="symbol">1</span>]: <span class="link">https://hexo.io/docs/</span></span><br><span class="line">[<span class="symbol">link text itself</span>]: <span class="link">https://hexo.io/api/</span></span><br></pre></td></tr></table></figure><p><a href="https://www.google.com/">I&#39;m an inline-style link</a></p><p><a href="https://www.google.com/" title="Google&#39;s Homepage">I&#39;m an inline-style link with title</a></p><p><a href="https://hexo.io/">I&#39;m a reference-style link</a></p><p><a href="../blob/master/LICENSE">I&#39;m a relative reference to a repository file</a></p><p><a href="https://hexo.io/docs/">You can use numbers for reference-style link definitions</a></p><p>Or leave it empty and use the <a href="https://hexo.io/api/">link text itself</a></p><p>Some text to show that the reference links can follow later.</p><h2 id="Images"><a href="#Images" class="headerlink" title="Images"></a>Images</h2><figure class="highlight markdown"><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">hover to see the title text:</span><br><span class="line"></span><br><span class="line">Inline-style:</span><br><span class="line"></span><br><span class="line">![<span class="string">alt text</span>](<span class="link">https://hexo.io/icon/favicon-196x196.png &quot;Logo Title Text 1&quot;</span>)</span><br><span class="line"></span><br><span class="line">Reference-style:</span><br><span class="line">![<span class="string">alt text</span>][<span class="symbol">logo</span>]</span><br><span class="line"></span><br><span class="line">[<span class="symbol">logo</span>]: <span class="link">https://hexo.io/icon/favicon-196x196.png &quot;Logo Title Text 2&quot;</span></span><br></pre></td></tr></table></figure><p>hover to see the title text:</p><p>Inline-style:</p><p><img src="https://hexo.io/icon/favicon-196x196.png" alt="alt text" title="Logo Title Text 1"></p><p>Reference-style:<br><img src="https://hexo.io/icon/favicon-196x196.png" alt="alt text" title="Logo Title Text 2"></p><h2 id="Code-and-Syntax-Highlighting"><a href="#Code-and-Syntax-Highlighting" class="headerlink" title="Code and Syntax Highlighting"></a>Code and Syntax Highlighting</h2><p>Inline <code>code</code> has <code>back-ticks around</code> it.</p><figure class="highlight javascript"><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="keyword">var</span> s = <span class="string">&quot;JavaScript syntax highlighting&quot;</span>;</span><br><span class="line"><span class="title function_">alert</span>(s);</span><br></pre></td></tr></table></figure><figure class="highlight python"><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">s = <span class="string">&quot;Python syntax highlighting&quot;</span></span><br><span class="line"><span class="built_in">print</span> s</span><br></pre></td></tr></table></figure><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">No language indicated, so no syntax highlighting.</span><br><span class="line">But let&#x27;s throw in a &lt;b&gt;tag&lt;/b&gt;.</span><br></pre></td></tr></table></figure><h2 id="Tables"><a href="#Tables" class="headerlink" title="Tables"></a>Tables</h2><figure class="highlight markdown"><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">|                |ASCII                          |HTML                         |</span><br><span class="line">|----------------|-------------------------------|-----------------------------|</span><br><span class="line">|Single backticks|<span class="code">`&#x27;Isn&#x27;t this fun?&#x27;`</span>            |&#x27;Isn&#x27;t this fun?&#x27;            |</span><br><span class="line">|Quotes          |<span class="code">`&quot;Isn&#x27;t this fun?&quot;`</span>            |&quot;Isn&#x27;t this fun?&quot;            |</span><br><span class="line">|Dashes          |<span class="code">`-- is en-dash, --- is em-dash`</span>|-- is en-dash, --- is em-dash|</span><br></pre></td></tr></table></figure><table><thead><tr><th></th><th>ASCII</th><th>HTML</th></tr></thead><tbody><tr><td>Single backticks</td><td><code>&#39;Isn&#39;t this fun?&#39;</code></td><td>&#39;Isn&#39;t this fun?&#39;</td></tr><tr><td>Quotes</td><td><code>&quot;Isn&#39;t this fun?&quot;</code></td><td>&quot;Isn&#39;t this fun?&quot;</td></tr><tr><td>Dashes</td><td><code>-- is en-dash, --- is em-dash</code></td><td>-- is en-dash, --- is em-dash</td></tr></tbody></table><p>Colons can be used to align columns.</p><figure class="highlight markdown"><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">| Tables        | Are           | Cool  |</span><br><span class="line">| ------------- |:-------------:| -----:|</span><br><span class="line">| col 3 is      | right-aligned |  |</span><br><span class="line">| col 2 is      | centered      |    |</span><br><span class="line">| zebra stripes | are neat      |   </span><br></pre></td></tr></table></figure><table><thead><tr><th>Tables</th><th align="center">Are</th><th align="right">Cool</th></tr></thead><tbody><tr><td>col 3 is</td><td align="center">right-aligned</td><td align="right"></td></tr><tr><td>col 2 is</td><td align="center">centered</td><td align="right"></td></tr><tr><td>zebra stripes</td><td align="center">are neat</td><td align="right"></td></tr></tbody></table><p>The outer pipes (|) are optional, and you don&#39;t need to make the raw Markdown line up prettily. You can also use inline Markdown.</p><figure class="highlight markdown"><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">Markdown | Less | Pretty</span><br><span class="line">--- | --- | ---</span><br><span class="line"><span class="emphasis">*Still*</span> | <span class="code">`renders`</span> | <span class="strong">**nicely**</span></span><br><span class="line">1 | 2 | 3</span><br></pre></td></tr></table></figure><table><thead><tr><th>Markdown</th><th>Less</th><th>Pretty</th></tr></thead><tbody><tr><td><em>Still</em></td><td><code>renders</code></td><td><strong>nicely</strong></td></tr><tr><td>1</td><td>2</td><td>3</td></tr></tbody></table><blockquote><p>You can find more information about <strong>LaTeX</strong> mathematical expressions <a href="https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference">here</a>.</p></blockquote><h2 id="Blockquotes"><a href="#Blockquotes" class="headerlink" title="Blockquotes"></a>Blockquotes</h2><blockquote><p>Blockquotes are very handy in email to emulate reply text.<br>This line is part of the same quote.</p></blockquote><p>Quote break.</p><blockquote><p>This is a very long line that will still be quoted properly when it wraps. Oh boy let&#39;s keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can <em>put</em> <strong>Markdown</strong> into a blockquote.</p></blockquote><h2 id="Horizontal-Rule"><a href="#Horizontal-Rule" class="headerlink" title="Horizontal Rule"></a>Horizontal Rule</h2><p>Three or more...</p><figure class="highlight markdown"><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">---</span><br><span class="line"></span><br><span class="line">Hyphens</span><br><span class="line"></span><br><span class="line"><span class="strong">***</span></span><br><span class="line"><span class="strong"></span></span><br><span class="line"><span class="strong">Asterisks</span></span><br><span class="line"><span class="strong"></span></span><br><span class="line"><span class="strong">___</span></span><br><span class="line"><span class="strong"></span></span><br><span class="line"><span class="strong">Underscores</span></span><br></pre></td></tr></table></figure><hr><p>Hyphens</p><hr><p>Asterisks</p><hr><p>Underscores</p><h2 id="Line-Breaks"><a href="#Line-Breaks" class="headerlink" title="Line Breaks"></a>Line Breaks</h2><figure class="highlight markdown"><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">Here&#x27;s a line for us to start with.</span><br><span class="line"></span><br><span class="line">This line is separated from the one above by two newlines, so it will be a <span class="emphasis">*separate paragraph*</span>.</span><br><span class="line"></span><br><span class="line">This line is also a separate paragraph, but...</span><br><span class="line">This line is only separated by a single newline, so it&#x27;s a separate line in the <span class="emphasis">*same paragraph*</span>.</span><br></pre></td></tr></table></figure><p>Here&#39;s a line for us to start with.</p><p>This line is separated from the one above by two newlines, so it will be a <em>separate paragraph</em>.</p><p>This line is also a separate paragraph, but...<br>This line is only separated by a single newline, so it&#39;s a separate line in the <em>same paragraph</em>.</p><hr><figure class="highlight markdown"><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">This is a regular paragraph.</span><br><span class="line"></span><br><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">table</span>&gt;</span></span></span><br><span class="line"><span class="code">    &lt;tr&gt;</span></span><br><span class="line"><span class="code">        &lt;td&gt;Foo&lt;/td&gt;</span></span><br><span class="line"><span class="code">    &lt;/tr&gt;</span></span><br><span class="line"><span class="code">&lt;/table&gt;</span></span><br><span class="line"><span class="code"></span></span><br><span class="line">This is another regular paragraph.</span><br></pre></td></tr></table></figure><p>This is a regular paragraph.</p><table>    <tr>        <td>Foo</td>    </tr></table><p>This is another regular paragraph.</p><h2 id="Youtube-videos"><a href="#Youtube-videos" class="headerlink" title="Youtube videos"></a>Youtube videos</h2><figure class="highlight markdown"><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"><span class="language-xml"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;https://www.youtube.com/watch?feature=player_embedded&amp;v=ARted4RniaU</span></span></span></span><br><span class="line"><span class="string"><span class="tag"><span class="language-xml">&quot;</span> <span class="attr">target</span>=<span class="string">&quot;_blank&quot;</span>&gt;</span></span><span class="language-xml"><span class="tag">&lt;<span class="name">img</span> <span class="attr">src</span>=<span class="string">&quot;https://img.youtube.com/vi/ARted4RniaU/0.jpg&quot;</span></span></span></span><br><span class="line"><span class="tag"><span class="language-xml"><span class="attr">alt</span>=<span class="string">&quot;IMAGE ALT TEXT HERE&quot;</span> <span class="attr">width</span>=<span class="string">&quot;240&quot;</span> <span class="attr">height</span>=<span class="string">&quot;180&quot;</span> <span class="attr">border</span>=<span class="string">&quot;10&quot;</span> /&gt;</span></span><span class="language-xml"><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span></span><br><span class="line"></span><br><span class="line">Pure markdown version:</span><br><span class="line"></span><br><span class="line">[<span class="string">![IMAGE ALT TEXT HERE</span>](<span class="link">https://img.youtube.com/vi/ARted4RniaU/0.jpg</span>)](<span class="link">https://www.youtube.com/watch?v=ARted4RniaU</span>)</span><br></pre></td></tr></table></figure><p><a href="https://www.youtube.com/watch?feature=player_embedded&v=ARted4RniaU" target="_blank"><img src="https://img.youtube.com/vi/ARted4RniaU/0.jpg"alt="IMAGE ALT TEXT HERE" width="240" height="180" border="10" /></a></p><p>Pure markdown version:</p><p><a href="https://www.youtube.com/watch?v=ARted4RniaU"><img src="https://img.youtube.com/vi/ARted4RniaU/0.jpg" alt="IMAGE ALT TEXT HERE"></a></p>]]></content>
    
    
    <summary type="html">&lt;p&gt;This post is originated from &lt;a href=&quot;https://gist.github.com/apackeer/4159268&quot;&gt;here&lt;/a&gt; and is used for testing markdown style. This post contains nearly every markdown usage. Make sure all the markdown elements below show up correctly.&lt;/p&gt;</summary>
    
    
    
    <category term="Markdown" scheme="https://cdd9527.cn/categories/Markdown/"/>
    
    
    <category term="highlight" scheme="https://cdd9527.cn/tags/highlight/"/>
    
    <category term="Bar" scheme="https://cdd9527.cn/tags/Bar/"/>
    
  </entry>
  
  <entry>
    <title>推荐一部好看的动画片</title>
    <link href="https://cdd9527.cn/posts/10003-movie/"/>
    <id>https://cdd9527.cn/posts/10003-movie/</id>
    <published>2018-06-29T05:36:14.000Z</published>
    <updated>2026-03-26T07:26:05.394Z</updated>
    
    <content type="html"><![CDATA[<h1 id="开局一张图-movie-camera"><a href="#开局一张图-movie-camera" class="headerlink" title="开局一张图 :movie_camera:"></a>开局一张图 :movie_camera:</h1><span id="more"></span><p><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1530265627560&di=8315a7dd3876079366991ee720c18c11&imgtype=0&src=http://img.mp.itc.cn/upload/20161202/aa37f535f08f4dd0b2eb4e269a0676d4_th.jpeg" alt="图片名称"></p><h1 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h1><p>在远离大都会的小山村，住着巫女世家出身的高中女孩宫水三叶（上白石萌音 配音）。校园和家庭的原因本就让她充满烦恼，而近一段时间发生的奇怪事件，又让三叶摸不清头脑。不知从何时起，三叶在梦中就会变成一个住在东京的高中男孩。那里有陌生的同学和朋友，有亲切的前辈和繁华的街道，一切都是如此诱人而真实。另一方面，住在东京的高中男孩立花泷（神木隆之介 配音）则总在梦里来到陌生的小山村，以女孩子的身份过着全新的生活。许是受那颗神秘彗星的影响，立花和三叶在梦中交换了身份。他们以他者的角度体验着对方的人生，这期间有愤怒、有欢笑也有暖心。只是两人并不知道，身份交换的背后隐藏着重大而锥心的秘密…</p><h1 id="视频"><a href="#视频" class="headerlink" title="视频"></a>视频</h1><iframe height=440 width="100%" src='http://player.youku.com/embed/XMjk4NzA1OTMzNg==' frameborder=0 allowfullscreen></iframe>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;开局一张图-movie-camera&quot;&gt;&lt;a href=&quot;#开局一张图-movie-camera&quot; class=&quot;headerlink&quot; title=&quot;开局一张图 :movie_camera:&quot;&gt;&lt;/a&gt;开局一张图 :movie_camera:&lt;/h1&gt;</summary>
    
    
    
    <category term="电影" scheme="https://cdd9527.cn/categories/%E7%94%B5%E5%BD%B1/"/>
    
    
    <category term="东哥推荐" scheme="https://cdd9527.cn/tags/%E4%B8%9C%E5%93%A5%E6%8E%A8%E8%8D%90/"/>
    
  </entry>
  
  <entry>
    <title>Markdown 编辑器语法指南</title>
    <link href="https://cdd9527.cn/posts/10002-Markdown/"/>
    <id>https://cdd9527.cn/posts/10002-Markdown/</id>
    <published>2018-06-28T03:45:29.000Z</published>
    <updated>2026-03-26T06:12:06.433Z</updated>
    
    <content type="html"><![CDATA[<h1 id="基本技巧"><a href="#基本技巧" class="headerlink" title="基本技巧"></a>基本技巧</h1><h3 id="代码"><a href="#代码" class="headerlink" title="代码"></a>代码</h3><p>如果你只想高亮语句中的某个函数名或关键字，可以使用 <code>function_name()</code> 实现</p><span id="more"></span><p>通常编辑器根据代码片段适配合适的高亮方法，但你也可以用 &#96;&#96;&#96; 包裹一段代码，并指定一种语言</p><figure class="highlight javascript"><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">$(<span class="variable language_">document</span>).<span class="title function_">ready</span>(<span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">    <span class="title function_">alert</span>(<span class="string">&#x27;hello world&#x27;</span>);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><p>支持的语言：<code>1c, abnf, accesslog, actionscript, ada, apache, applescript, arduino, armasm, asciidoc, aspectj, autohotkey, autoit, avrasm, awk, axapta, bash, basic, bnf, brainfuck, cal, capnproto, ceylon, clean, clojure, clojure-repl, cmake, coffeescript, coq, cos, cpp, crmsh, crystal, cs, csp, css, d, dart, delphi, diff, django, dns, dockerfile, dos, dsconfig, dts, dust, ebnf, elixir, elm, erb, erlang, erlang-repl, excel, fix, flix, fortran, fsharp, gams, gauss, gcode, gherkin, glsl, go, golo, gradle, groovy, haml, handlebars, haskell, haxe, hsp, htmlbars, http, hy, inform7, ini, irpf90, java, javascript, json, julia, kotlin, lasso, ldif, leaf, less, lisp, livecodeserver, livescript, llvm, lsl, lua, makefile, markdown, mathematica, matlab, maxima, mel, mercury, mipsasm, mizar, mojolicious, monkey, moonscript, n1ql, nginx, nimrod, nix, nsis, objectivec, ocaml, openscad, oxygene, parser3, perl, pf, php, pony, powershell, processing, profile, prolog, protobuf, puppet, purebasic, python, q, qml, r, rib, roboconf, rsl, ruby, ruleslanguage, rust, scala, scheme, scilab, scss, smali, smalltalk, sml, sqf, sql, stan, stata, step21, stylus, subunit, swift, taggerscript, tap, tcl, tex, thrift, tp, twig, typescript, vala, vbnet, vbscript, vbscript-html, verilog, vhdl, vim, x86asm, xl, xml, xquery, yaml, zephir</code></p><p>也可以使用 4 空格缩进，再贴上代码，实现相同的的效果</p><pre><code>def g(x):    yield from range(x, 0, -1)yield from range(x)</code></pre><p>如你不需要代码高亮，可以用下面的方法禁用：</p><pre><code><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"></span><br></pre></td></tr></table></figure></code></pre><h2 id="标题"><a href="#标题" class="headerlink" title="标题"></a>标题</h2><p>文章内容较多时，可以用标题分段：</p><pre><code>标题1======标题2-----## 大标题 ##### 小标题 ###</code></pre><h2 id="粗斜体"><a href="#粗斜体" class="headerlink" title="粗斜体"></a>粗斜体</h2><pre><code>*斜体文本*    _斜体文本_**粗体文本**    __粗体文本__***粗斜体文本***    ___粗斜体文本___</code></pre><h2 id="链接"><a href="#链接" class="headerlink" title="链接"></a>链接</h2><p>常用链接方法</p><pre><code>文字链接 [链接名称](http://链接网址)网址链接 &lt;http://链接网址&gt;</code></pre><p>高级链接技巧</p><pre><code>这个链接用 1 作为网址变量 [Google][1].这个链接用 yahoo 作为网址变量 [Yahoo!][yahoo].然后在文档的结尾为变量赋值（网址）[1]: http://www.google.com/[yahoo]: http://www.yahoo.com/</code></pre><p><a href="https://segmentfault.com/markdown#articleHeader15">https://segmentfault.com/markdown#articleHeader15</a></p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;基本技巧&quot;&gt;&lt;a href=&quot;#基本技巧&quot; class=&quot;headerlink&quot; title=&quot;基本技巧&quot;&gt;&lt;/a&gt;基本技巧&lt;/h1&gt;&lt;h3 id=&quot;代码&quot;&gt;&lt;a href=&quot;#代码&quot; class=&quot;headerlink&quot; title=&quot;代码&quot;&gt;&lt;/a&gt;代码&lt;/h3&gt;&lt;p&gt;如果你只想高亮语句中的某个函数名或关键字，可以使用 &lt;code&gt;function_name()&lt;/code&gt; 实现&lt;/p&gt;</summary>
    
    
    
    
    <category term=".md" scheme="https://cdd9527.cn/tags/md/"/>
    
    <category term="Markdown" scheme="https://cdd9527.cn/tags/Markdown/"/>
    
  </entry>
  
  <entry>
    <title>hexo整合emoji</title>
    <link href="https://cdd9527.cn/posts/10004-emoji/"/>
    <id>https://cdd9527.cn/posts/10004-emoji/</id>
    <published>2018-06-28T03:45:29.000Z</published>
    <updated>2026-03-26T06:12:56.027Z</updated>
    
    <content type="html"><![CDATA[<p>想不想让你的博客支持这样的表情？</p><p>:smile:<br>:smiley:<br>:smirk:<br>:worried:<br>:expressionless:</p><span id="more"></span><pre><code>:smile::smiley::smirk::worried::expressionless:</code></pre><p>这样</p><p>:weary:<br>:sweat_smile:<br>:disappointed_relieved:<br>:sob:<br>:joy:</p><pre><code>:weary::sweat_smile::disappointed_relieved::sob::joy:</code></pre><p>还有这样</p><p>:scream:<br>:angry:<br>:triumph:<br>:sunglasses:<br>:smiling_imp:</p><pre><code>:scream::angry::triumph::sunglasses::smiling_imp:</code></pre><p><strong>敲黑板！看这里！！</strong></p><p>一共两种方式</p><h2 id="第一种（改动markdown渲染模板）"><a href="#第一种（改动markdown渲染模板）" class="headerlink" title="第一种（改动markdown渲染模板）"></a>第一种（改动markdown渲染模板）</h2><p>这种方式有问题，改了之后会对渲染文章的时候文章标题点击无效。</p><h3 id="安装markdown-it"><a href="#安装markdown-it" class="headerlink" title="安装markdown-it"></a>安装markdown-it</h3><p>把原来的hexo渲染换成基于markdown-it的渲染。</p><figure class="highlight vim"><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">npm un hexo-renderer-marked --save</span><br><span class="line"></span><br><span class="line">npm i hexo-renderer-markdown-it --save</span><br><span class="line"></span><br><span class="line">npm install markdown-it-emoji --save</span><br></pre></td></tr></table></figure><h3 id="配置hexo的-config-yml文件"><a href="#配置hexo的-config-yml文件" class="headerlink" title="配置hexo的_config.yml文件"></a>配置hexo的_config.yml文件</h3><p>在hexo的配置文件下添加markdown-it配置代码：</p><pre><code>markdown:  render:    html: true    xhtmlOut: false    breaks: true    linkify: true    typographer: true    quotes: &#39;“”‘’&#39;  plugins:    - markdown-it-abbr    - markdown-it-footnote    - markdown-it-ins    - markdown-it-sub    - markdown-it-sup    - markdown-it-emoji  #用emoji插件  anchors:    level: 2    collisionSuffix: &#39;v&#39;    permalink: true    permalinkClass: header-anchor    permalinkSymbol: ¶</code></pre><h2 id="第二种"><a href="#第二种" class="headerlink" title="第二种"></a>第二种</h2><p>在 Hexo 中默认的 markdown 渲染器是 hexo-renderer-marked ，这个渲染器是不支持 emoji 表情的。</p><h3 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-filter-github-emojis --save</span><br></pre></td></tr></table></figure><h3 id="配置"><a href="#配置" class="headerlink" title="配置"></a>配置</h3><p>在主题中添加配置</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><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">githubEmojis:</span></span><br><span class="line">  <span class="attr">enable:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">className:</span> <span class="string">github-emoji</span></span><br><span class="line">  <span class="attr">unicode:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">styles:</span></span><br><span class="line">  <span class="attr">localEmojis:</span></span><br></pre></td></tr></table></figure><p>finish !!!</p>]]></content>
    
    
    <summary type="html">&lt;p&gt;想不想让你的博客支持这样的表情？&lt;/p&gt;
&lt;p&gt;:smile:&lt;br&gt;:smiley:&lt;br&gt;:smirk:&lt;br&gt;:worried:&lt;br&gt;:expressionless:&lt;/p&gt;</summary>
    
    
    
    <category term="hexo" scheme="https://cdd9527.cn/categories/hexo/"/>
    
    
    <category term="emoji" scheme="https://cdd9527.cn/tags/emoji/"/>
    
    <category term="hexo" scheme="https://cdd9527.cn/tags/hexo/"/>
    
  </entry>
  
  <entry>
    <title>建站第一篇文章</title>
    <link href="https://cdd9527.cn/posts/10001-hello-world/"/>
    <id>https://cdd9527.cn/posts/10001-hello-world/</id>
    <published>2018-06-28T03:20:20.000Z</published>
    <updated>2025-05-10T01:38:39.908Z</updated>
    
    <content type="html"><![CDATA[<h1 id="建站的准备"><a href="#建站的准备" class="headerlink" title="建站的准备"></a>建站的准备</h1><h2 id="hexo搭建"><a href="#hexo搭建" class="headerlink" title="hexo搭建"></a>hexo搭建</h2><h3 id="安装Git-Bash"><a href="#安装Git-Bash" class="headerlink" title="安装Git Bash"></a>安装Git Bash</h3><span id="more"></span><p><a href="https://gitforwindows.org/">下载地址</a></p><h3 id="安装NodeJs"><a href="#安装NodeJs" class="headerlink" title="安装NodeJs"></a>安装NodeJs</h3><p>Hexo是基于nodeJS环境的静态博客，里面的npm工具很有用啊，所以还是老老实实把这玩意儿装了吧。<br><a href="https://nodejs.org/en/">下载地址</a></p><h3 id="安装hexo"><a href="#安装hexo" class="headerlink" title="安装hexo"></a>安装hexo</h3><p>找个文件夹用来放博客，右键打开Git bash here<br>输入命令</p><pre><code>npm install -g hexo-clihexo i blog //init的缩写 blog是项目名cd blog //切换到站点根目录hexo g //generetor的缩写hexo s //server的缩写</code></pre><p>打开浏览器输入localhost:4000查看，默认的比较丑。需要更换主题的可以去这里找<a href="https://hexo.io/themes/">https://hexo.io/themes/</a>（ps:需要github账号才能下载使用）</p><p>我喜欢的主题地址：</p><p><a href="https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak">https://github.com/LouisBarranqueiro/hexo-theme-tranquilpeak</a></p>]]></content>
    
    
    <summary type="html">&lt;h1 id=&quot;建站的准备&quot;&gt;&lt;a href=&quot;#建站的准备&quot; class=&quot;headerlink&quot; title=&quot;建站的准备&quot;&gt;&lt;/a&gt;建站的准备&lt;/h1&gt;&lt;h2 id=&quot;hexo搭建&quot;&gt;&lt;a href=&quot;#hexo搭建&quot; class=&quot;headerlink&quot; title=&quot;hexo搭建&quot;&gt;&lt;/a&gt;hexo搭建&lt;/h2&gt;&lt;h3 id=&quot;安装Git-Bash&quot;&gt;&lt;a href=&quot;#安装Git-Bash&quot; class=&quot;headerlink&quot; title=&quot;安装Git Bash&quot;&gt;&lt;/a&gt;安装Git Bash&lt;/h3&gt;</summary>
    
    
    
    <category term="更新日誌" scheme="https://cdd9527.cn/categories/%E6%9B%B4%E6%96%B0%E6%97%A5%E8%AA%8C/"/>
    
    
    <category term="教程" scheme="https://cdd9527.cn/tags/%E6%95%99%E7%A8%8B/"/>
    
    <category term="Hexo" scheme="https://cdd9527.cn/tags/Hexo/"/>
    
    <category term="更新日誌" scheme="https://cdd9527.cn/tags/%E6%9B%B4%E6%96%B0%E6%97%A5%E8%AA%8C/"/>
    
    <category term="butterfly" scheme="https://cdd9527.cn/tags/butterfly/"/>
    
  </entry>
  
</feed>
