1
0
DavidZhang73.github.io/inspur-internship/index.html

642 lines
31 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN" class="loading">
<head>
<!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>浪潮实习 - Blog</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="google" content="notranslate" />
<meta name="keywords" content="Developer, Python, C++, JavaScript, Java,">
<meta name="description" content="DavidZ&#39;s Blog,
原创发表于 DavidZ Blog遵循 CC 4.0 BY-NC-SA 版权协议,转载请附上原文出处链接及本声明。
¶前言
到了期末都说要找个实习的工作,我也跟个风😂。
我是主要是在实习僧上,">
<meta name="author" content="DavidZ">
<link rel="alternative" href="atom.xml" title="Blog" type="application/atom+xml">
<link rel="icon" href="/img/favicon.png">
<link rel="stylesheet" href="//at.alicdn.com/t/font_1429596_nzgqgvnmkjb.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/animate.css@3.7.2/animate.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/css/share.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/codemirror@5.48.4/lib/codemirror.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/codemirror@5.48.4/theme/dracula.css">
<link rel="stylesheet" href="/css/obsidian.css">
<link rel="stylesheet" href="/css/ball-atom.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
<meta name="generator" content="Hexo 4.2.1"><!-- hexo-inject:begin --><!-- hexo-inject:end --></head>
<body class="loading">
<!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="loader">
<div class="la-ball-atom la-2x">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</div>
<span id="config-title" style="display:none">Blog</span>
<div id="loader"></div>
<div id="single">
<div class="scrollbar gradient-bg-rev"></div>
<div id="top" style="display: block;">
<div class="bar" style="width: 0;"></div>
<div class="navigation animated fadeIn fast delay-1s">
<img id="home-icon" class="icon-home" src="/img/favicon.png" alt="" data-url="https://blog.davidz.cn">
<div id="play-icon" title="Play/Pause" class="iconfont icon-play"></div>
<h3 class="subtitle">浪潮实习</h3>
<div class="social">
<!-- <div class="like-icon">-->
<!-- <a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
<!-- </div>-->
<div>
<div class="share">
<a href="javascript:;" class="iconfont icon-share1"></a>
<div class="share-component-cc" data-disabled="facebook,douban,linkedin,diandian,tencent,google"></div>
</div>
</div>
</div>
</div>
</div>
<div class="section">
<div class=article-header-wrapper>
<div class="article-header">
<div class="article-cover animated fadeIn" style="
animation-delay: 600ms;
animation-duration: 1.2s;
background-image:
radial-gradient(ellipse closest-side, rgba(0, 0, 0, 0.65), #100e17),
url(https://davidz-blog.oss-cn-beijing.aliyuncs.com/img/langchao-1599636307.jpg) ">
</div>
<div class="else">
<p class="animated fadeInDown">
<a href="/categories/Internship"><b>
</b>INTERNSHIP<b></b></a>
一月 27, 2020
</p>
<h3 class="post-title animated fadeInDown"><a href="/inspur-internship/" title="浪潮实习" class="">浪潮实习</a>
</h3>
<p class="post-count animated fadeInDown">
<span>
<b class="iconfont icon-text2"></b> <i>文章字数</i>
8.8k
</span>
<span>
<b class="iconfont icon-timer__s"></b> <i>阅读约需</i>
8 mins.
</span>
<span id="busuanzi_container_page_pv">
<b class="iconfont icon-read"></b> <i>阅读次数</i>
<span id="busuanzi_value_page_pv">0</span>
</span>
</p>
<ul class="animated fadeInDown post-tags-list" itemprop="keywords"><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Cpp/" rel="tag">Cpp</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Linux/" rel="tag">Linux</a></li><li class="animated fadeInDown post-tags-list-item"><a class="animated fadeInDown post-tags-list-link" href="/tags/Windows/" rel="tag">Windows</a></li></ul>
</div>
</div>
</div>
<div class="screen-gradient-after">
<div class="screen-gradient-content">
<div class="screen-gradient-content-inside">
<div class="bold-underline-links screen-gradient-sponsor">
<p>
<span class="animated fadeIn delay-1s"></span>
</p>
</div>
</div>
</div>
</div>
<div class="article">
<div class='main'>
<div class="content markdown animated fadeIn">
<blockquote>
<p>原创发表于 <a href="https://blog.davidz.cn">DavidZ Blog</a>,遵循 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode" target="_blank" rel="noopener">CC 4.0 BY-NC-SA</a> 版权协议,转载请附上原文出处链接及本声明。</p>
</blockquote>
<h2 id="前言"><a class="header-anchor" href="#前言"></a>前言</h2>
<p>到了期末都说要找个实习的工作,我也跟个风😂。</p>
<p>我是主要是在<a href="https://www.shixiseng.com/" target="_blank" rel="noopener">实习僧</a>上找的(就当免费做个广告吧),我住在美丽的泉城济南,<s>这个地方好就好在</s>,咳咳咳,我大概填了填简历,可能是没啥亮点,投了三四家都不要我😢。</p>
<p>我分析原因大概有以下几条:</p>
<ol>
<li>我最喜欢最熟练的语言是 Python但是现在国内的环境Python 很少作为 Web 的后端,主要是用在机器学习(大数据分析,量化交易之类的)方面。济南大多数都是 Java 和 Cpp 岗。</li>
<li>我个人没有参加过 acm 之类的比赛,除了几个项目没法有效证明我的能力。</li>
<li>我这个寒假只能干 2 个月,<s>其实最终只干了一个半月</s></li>
<li>我是个大三的学生。可能培养了对于公司来说也没啥意义吧。</li>
</ol>
<p>最后还是十分感谢秦老师❤️,不但收了我到浪潮实习,还在实习过程中给了我很多帮助和指导。</p>
<p>下面列一列我学习了解的项目工具之类的。</p>
<h2 id="CppMicroServices"><a class="header-anchor" href="#CppMicroServices"></a><a href="https://github.com/CppMicroServices/CppMicroServices" target="_blank" rel="noopener">CppMicroServices</a></h2>
<p>我们主要做了一个插件管理器,是基于 CppMicroServices 的二次开发。这是一个 Cpp 的微服务框架,主要实现了 Bundle 的全生命周期管理,注册,启动,停止,状态管理等。</p>
<h2 id="CLion"><a class="header-anchor" href="#CLion"></a><a href="https://www.jetbrains.com/clion" target="_blank" rel="noopener">CLion</a></h2>
<p>大爱 Jetbrains 全家桶,我实习的第一件事大概就是给组里所有人安利了 CLion 吧。与宇宙第一 IDE Visual Studio 相比最突出的优点有</p>
<ol>
<li>精美的全功能编辑器。不是我吐槽VS 的编辑器为了向下兼容现在甚至已经落后 VSCode 了,这还是曾经的宇宙第一 IDE 嘛。举一个简单的例子,连字功能连个开关都找不到,重启 VS 没成功,重启电脑就成功了?再加上没有拼写检查?没有自动注释补全?没有缺陷提示?你可能觉得没什么,但是这些都是 CLion 的自带功能啊。</li>
<li>丰富完善的插件生态。虽然感觉比不上 VSCode但是相对于 VS😄。</li>
<li>CMake 项目的原生支持。VS 虽然也有,但是感觉应该还处在开发状态。</li>
<li>SVN &amp; Git 的原生支持。</li>
<li>远程开发功能。因为我们要求项目有跨平台能力所以需要在多个平台切换。VS 虽然也有这个功能,但是也是感觉在开发状态,相比 CLion 少了很多配置的灵活性。</li>
<li>丰富的主题。VS 硬伤。</li>
</ol>
<p>综上所述,对于 Cpp 的 CMake 跨平台项目,还是推荐使用 CLion 作为 IDE。</p>
<p>我猜测 Visual Studio 是宇宙第一 IDE 应该说的是对于 C# 项目吧。</p>
<h2 id="CMake"><a class="header-anchor" href="#CMake"></a><a href="www.cmake.org">CMake</a></h2>
<p>以前的 C/Cpp 项目对我来说就是个谜解决方案、项目傻傻分不清楚Visual Studio 写单文件程序,解算法题还是很溜的,但是两个文件以上就很晕。</p>
<p>傻瓜式的配置的优点和确定都是非常显著的,好用是好用,用好是真的难。</p>
<p>CMake 作为这几年流行的跨平台构建工具,实现了配置式构建,终于让我理解了大学里 Linux 老师讲的程序编译链接都是些啥。</p>
<p>下面我简单写一写 CMake 的入门知识。</p>
<h3 id="常见编译器"><a class="header-anchor" href="#常见编译器"></a>常见编译器</h3>
<table>
<thead>
<tr>
<th style="text-align:center">Platform</th>
<th style="text-align:center">Windows</th>
<th style="text-align:center">Linux</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">GNU(open source)</td>
<td style="text-align:center">MinGW, MinGW-w64</td>
<td style="text-align:center">GCC(GNU Compiler Collection)</td>
</tr>
<tr>
<td style="text-align:center">Other</td>
<td style="text-align:center">Clang(Apple), MSVC(Microsoft), ICC(Intel) etc.</td>
<td style="text-align:center">Clang(Apple), ICC(Intel) etc.</td>
</tr>
</tbody>
</table>
<p>上面这些编译器都可以作为 CMake 的编译器。</p>
<p>这里主要还是推荐 GCC毕竟老牌经过这么多年的洗礼了。</p>
<p>其次的话推荐 CLang这些年对于新特性特别是 C++20支持的不错。</p>
<p>再次就是如果真的需要 Windows 原生底层支持,那就只能使用 MSVC 啦。</p>
<h3 id="常见构建工具"><a class="header-anchor" href="#常见构建工具"></a>常见构建工具</h3>
<table>
<thead>
<tr>
<th style="text-align:center">Platform</th>
<th style="text-align:center">Windows</th>
<th style="text-align:center">Linux</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">GNU(open source)</td>
<td style="text-align:center">MinGW-make(Makefile)</td>
<td style="text-align:center">make(Makefile)</td>
</tr>
<tr>
<td style="text-align:center">Other</td>
<td style="text-align:center">nmake(Makefile), MSBuild(.vcxproj), ninja(.ninja), qmake etc.</td>
<td style="text-align:center">ninja(.ninja), qmake etc.</td>
</tr>
<tr>
<td style="text-align:center">Solution</td>
<td style="text-align:center">Visual Studio(.sln), QT(.project)</td>
<td style="text-align:center">XCode, QT(.project)</td>
</tr>
</tbody>
</table>
<p>以上所有都可以作为 CMake 的 Generator。</p>
<p>IDE 可以识别 CMake 根据 CMakeLists.txt 生成的 CMakeCache.txt从中获得项目构成编译连接选项等从而替代解决方案。</p>
<p>我们在项目中使用的情况是,在 Linux 下使用 make在 Windows 下使用 nmake。</p>
<h3 id="CMake-常用指令"><a class="header-anchor" href="#CMake-常用指令"></a>CMake 常用指令</h3>
<pre><code class="language-shell">Generate a Project Buildsystem
cmake [&lt;options&gt;] &lt;path-to-source&gt;
cmake [&lt;options&gt;] &lt;path-to-existing-build&gt;
cmake [&lt;options&gt;] -S &lt;path-to-source&gt; -B &lt;path-to-build&gt;
Build a Project
cmake --build &lt;dir&gt; [&lt;options&gt;] [-- &lt;build-tool-options&gt;]
Install a Project
cmake --install &lt;dir&gt; [&lt;options&gt;]
Open a Project
cmake --open &lt;dir&gt;
Run a Script
cmake [{-D &lt;var&gt;=&lt;value&gt;}...] -P &lt;cmake-script-file&gt;
Run a Command-Line Tool
cmake -E &lt;command&gt; [&lt;options&gt;]
Run the Find-Package Tool
cmake --find-package [&lt;options&gt;]
View Help
cmake --help[-&lt;topic&gt;]
</code></pre>
<p>这些其实用不太到,构建别人的项目只使用简单的<code>cmake ..</code>就好啦。</p>
<p>其他常用的 CLion 都有相应的图形化设置。</p>
<h3 id="Makefile"><a class="header-anchor" href="#Makefile"></a>Makefile</h3>
<pre><code class="language-makefile">&lt;TargetName&gt;:
gcc &lt;arg1&gt; &lt;arg2&gt; ... &lt;file&gt;
g++ &lt;arg1&gt; &lt;arg2&gt; ... &lt;file&gt;
gcc &lt;arg1&gt; &lt;arg2&gt; ... &lt;file&gt;
</code></pre>
<p>这个是传统的 makefile事实上对于大型项目已经很少有人这么写了详细参考<a href="https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html" target="_blank" rel="noopener">Autotools</a></p>
<h3 id="CMakeLists-txt"><a class="header-anchor" href="#CMakeLists-txt"></a>CMakeLists.txt</h3>
<pre><code class="language-cmake">cmake_minimum_required(VERSION 3.16)
project(Demo)
set(CMAKE_CXX_STANDARD 14)
find_package(Poco REQUIRED COMPONENTS Foundation)
include_directories(include)
add_executable(Demo src/main.cpp)
set(BUILD_SHARED_LIBS true)
add_library(Cal src/cal.cpp include/cal.h)
message(STATUS ${Poco_LIBRARIES})
target_link_libraries(Demo ${Poco_LIBRARIES} Cal)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/)
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib/)
</code></pre>
<p>这个是一个简单的 Demo链接外部的 Poco 库,还编译生成了一个动态库和一个可执行文件,然后指定了输出目录。</p>
<p>整体难度中等,主要原因是<a href="https://cmake.org/" target="_blank" rel="noopener">官网文档</a>有一点看不懂😢。</p>
<h2 id="Vcpkg"><a class="header-anchor" href="#Vcpkg"></a><a href="https://github.com/microsoft/vcpkg" target="_blank" rel="noopener">Vcpkg</a></h2>
<p>这个是微软开发的,类似于 Python 的 pipNodejs 的 npm总而言之就是个依赖包管理器。主要适用于解决开发依赖问题。</p>
<p>比如安装一个 poco原来你需要下载源码-&gt;编译源码-&gt;把文件放进项目-&gt;修改编译链接选项,然后才能用,现在你只需要</p>
<pre><code class="language-shell">vcpkg install poco
</code></pre>
<p>然后在 CMakeLists.txt 里面添加</p>
<pre><code class="language-cmake">find_package(Poco REQUIRED COMPONENTS Foundation)
</code></pre>
<p>然后再连接上 Target 就好啦。</p>
<p>Vcpkg 甚至还允许你使用</p>
<pre><code class="language-shell">vcpkg install poco:x64-windows
</code></pre>
<p>直接安装 64 位的 Poco 库。</p>
<p>至于搜索和卸载都大同小异。</p>
<p><strong>但是</strong>,它有一个致命问题是,不支持版本管理,每个库都是由一个文件指定的,而不是像 pipnpm 之类的,有个在线仓库,所以,你 vcpkg 的版本直接决定了依赖的版本。</p>
<p>vcpkg 安装依赖都是下载后现编译安装的,不过这个应该是 C/Cpp 项目不可避免的,我也没找到 Windows 下更好的依赖包管理器。</p>
<h2 id="Poco"><a class="header-anchor" href="#Poco"></a><a href="https://github.com/pocoproject/poco" target="_blank" rel="noopener">Poco</a></h2>
<p>这个类似于野生 C++标准类库<a href="https://www.boost.org" target="_blank" rel="noopener">Boost</a>,但是官网说很轻量,使用感觉也确实是这样。但是用起来总感觉有一些问题,我也提了 issue作者也没回我可能太忙了吧。</p>
<p>基本上能够让 Cpp 在使用上达到 Java 的水平吧,但是肯定还是有一定的差距的,跟我熟悉的 Python 更是相差甚远,毕竟不是标准库,也情有可原吧。</p>
<p>用了一段时间之后,感觉这个库的实现还是很标准的,看了一些源代码,也很规范,以后再有 Cpp 的项目可以着重考虑一下了。</p>
<h2 id="Linux"><a class="header-anchor" href="#Linux"></a>Linux</h2>
<p>因为跨平台,在项目开发过程中大量使用了 Linux 上 shellsystemctldocker 这些工具以及 CFEngine Zabbix 这些运维的东西,感觉又喜欢上了 Linux 和命令行,熟悉了之后真是很方便。</p>
<p>同时因为是 C/Cpp 项目,我们编译了很多开源项目,算是终于知道了 Linux 根目录下面每个目录都是干啥的。</p>
<p>Linux 下的包管理器比如 aptyum 用起来也很爽。所以我也看了看 Windows 下面的包管理器,发现了 Scoop 这个神器,在另外一篇<a href="https://blog.davidz.cn/beauty-is-productivity-windows-terminal">博文</a>里介绍了它。</p>
<h2 id="MSYS2"><a class="header-anchor" href="#MSYS2"></a><a href="https://github.com/msys2/msys2" target="_blank" rel="noopener">MSYS2</a></h2>
<p>因为快离职的时候,新的需求要交叉编译 CFEngine虽然到离职也没搞成功但是让我发现了 MSYS2 这个交叉编译神器。</p>
<blockquote>
<p>MinGW 是在 Windows 平台的<a href="https://www.gnu.org/software/gcc" target="_blank" rel="noopener">GCC</a>,而 CygWin 和 MSYS2 均是在 MinGW 基础上的<a href="https://www.gnu.org/software/libc/manual/html_node/POSIX.html" target="_blank" rel="noopener">POSIX</a>子操作系统(概念类似于微软 WSL<br>
<a href="https://www.cnblogs.com/Netsharp/p/11073142.html" target="_blank" rel="noopener">CygWin、Msys、MinGW、Msys2 的区别与联系</a></p>
</blockquote>
<p>选择 MSYS2 而不是 MinGW 也不是 CygWin 的主要原因也是因为 MSYS2 的包管理器 pacman。</p>
<p>交叉编译也是个大坑,巨坑无比,反正我也没研究明白,七八个可执行文件就编译出来一个。</p>
<h2 id="感谢"><a class="header-anchor" href="#感谢"></a>感谢</h2>
<p>感谢所有在实习中帮助过我的老师,同事们❤️。</p>
<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
<audio id="audio" loop="1" preload="auto" controls="controls"
data-autoplay="false">
<source type="audio/mpeg" src="https://davidz-blog.oss-cn-beijing.aliyuncs.com/music/戴荃 - 青山白云.mp3">
</audio>
<div class="post-nav">
<hr>
<div class="post-nav-item">上一篇:<a href="/beauty-is-productivity-windows-terminal/" rel="prev"
title="颜值是第一生产力 - Windows Terminal">颜值是第一生产力 - Windows Terminal
</a></div>
<div class="post-nav-item">下一篇:<a href="/anu-comp2310-assignment1/" rel="next"
title="ANU COMP2310(2019) Assignment 1">ANU COMP2310(2019) Assignment 1</a></div>
</div>
<div id='gitalk-container' class="comment link"
data-ae='true'
data-ci='489076c5dd3f5ba13f67'
data-cs='d6e3b245787b0b74d0dbe2639ef87f452a401194'
data-r='blog.davidz.cn'
data-o='DavidZhang73'
data-a='DavidZhang73'
data-d=''
data-p='https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token'
>留言</div>
</div>
<div class="sidebar">
<div class="box animated fadeInRight">
<div class="subbox">
<img src="https://davidz-blog.oss-cn-beijing.aliyuncs.com/img/2019-1599483796.jpg" height=300 width=300></img>
<p>DavidZ</p>
<span>凡事都要留几分</span>
<dl>
</dl>
</div>
<ul>
<li><a href="/">15 <p>文章</p></a></li>
<li><a href="/categories">8 <p>分类</p></a></li>
<li><a href="/tags">15 <p>标签</p></a></li>
</ul>
</div>
<div class="box sticky animated fadeInRight faster">
<div id="toc" class="subbox">
<h4>目录</h4>
<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#前言"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CppMicroServices"><span class="toc-number">2.</span> <span class="toc-text">CppMicroServices</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CLion"><span class="toc-number">3.</span> <span class="toc-text">CLion</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#CMake"><span class="toc-number">4.</span> <span class="toc-text">CMake</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#常见编译器"><span class="toc-number">4.1.</span> <span class="toc-text">常见编译器</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#常见构建工具"><span class="toc-number">4.2.</span> <span class="toc-text">常见构建工具</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#CMake-常用指令"><span class="toc-number">4.3.</span> <span class="toc-text">CMake 常用指令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Makefile"><span class="toc-number">4.4.</span> <span class="toc-text">Makefile</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#CMakeLists-txt"><span class="toc-number">4.5.</span> <span class="toc-text">CMakeLists.txt</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vcpkg"><span class="toc-number">5.</span> <span class="toc-text">Vcpkg</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Poco"><span class="toc-number">6.</span> <span class="toc-text">Poco</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Linux"><span class="toc-number">7.</span> <span class="toc-text">Linux</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#MSYS2"><span class="toc-number">8.</span> <span class="toc-text">MSYS2</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#感谢"><span class="toc-number">9.</span> <span class="toc-text">感谢</span></a></li></ol>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="back-to-top" class="animated fadeIn faster">
<div class="flow"></div>
<span class="percentage animated fadeIn faster">0%</span>
<span class="iconfont icon-top02 animated fadeIn faster"></span>
</div><!-- hexo-inject:begin --><!-- hexo-inject:end -->
</body>
<footer>
<p class="copyright" id="copyright">
&copy; 2022
<span class="gradient-text">
DavidZ
</span>.
Powered by <a href="http://hexo.io/" title="Hexo" target="_blank" rel="noopener">Hexo</a>
Theme
<span class="gradient-text">
<a href="https://github.com/TriDiamond/hexo-theme-obsidian" title="Obsidian" target="_blank" rel="noopener">Obsidian</a>
</span>
<small><a href="https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md" title="v1.4.7" target="_blank" rel="noopener">v1.4.7</a></small>
</br>
鲁ICP备
<span class="gradient-text">
<a href="https://beian.miit.gov.cn/" title="19008089号-1" target="_blank" rel="noopener">19008089号-1</a>
</span>
</p>
</footer>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script>
MathJax.Hub.Config({
"HTML-CSS": {
preferredFont: "TeX",
availableFonts: ["STIX", "TeX"],
linebreaks: {
automatic: true
},
EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
},
tex2jax: {
inlineMath: [
["$", "$"],
["\\(", "\\)"]
],
processEscapes: true,
ignoreClass: "tex2jax_ignore|dno",
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
},
TeX: {
noUndefined: {
attributes: {
mathcolor: "red",
mathbackground: "#FFEEEE",
mathsize: "90%"
}
},
Macros: {
href: "{}"
}
},
messageStyle: "none"
});
</script>
<script>
function initialMathJax() {
MathJax.Hub.Queue(function () {
var all = MathJax.Hub.getAllJax(),
i;
// console.log(all);
for (i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
}
function reprocessMathJax() {
if (typeof MathJax !== 'undefined') {
MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
}
}
</script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.min.css">
<script src="//cdn.jsdelivr.net/npm/gitalk@1.6.2/dist/gitalk.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
<script src="/js/plugin.js"></script>
<script src="/js/obsidian.js"></script>
<script src="/js/jquery.truncate.js"></script>
<script src="/js/search.js"></script>
<script src="//cdn.jsdelivr.net/npm/typed.js@2.0.10/lib/typed.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/blueimp-md5@2.12.0/js/md5.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/social-share.js@1.0.16/dist/js/social-share.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5.45.0/lib/codemirror.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/javascript/javascript.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/css/css.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/xml/xml.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/htmlmixed/htmlmixed.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/clike/clike.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/php/php.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/shell/shell.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/python/python.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/cmake/cmake.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/powershell/powershell.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/codemirror@5.45.0/mode/yaml/yaml.min.js"></script>
<script src="/js/busuanzi.min.js"></script>
<script>
$(document).ready(function () {
if ($('span[id^="busuanzi_"]').length) {
initialBusuanzi();
}
});
</script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css">
<script src="//cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="//cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>
<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe.
It's a separate element as animating opacity is faster than rgba(). -->
<div class="pswp__bg"></div>
<!-- Slides wrapper with overflow:hidden. -->
<div class="pswp__scroll-wrap">
<!-- Container that holds slides.
PhotoSwipe keeps only 3 of them in the DOM to save memory.
Don't modify these 3 pswp__item elements, data is added later on. -->
<div class="pswp__container">
<div class="pswp__item"></div>
<div class="pswp__item"></div>
<div class="pswp__item"></div>
</div>
<!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
<div class="pswp__ui pswp__ui--hidden">
<div class="pswp__top-bar">
<!-- Controls are self-explanatory. Order can be changed. -->
<div class="pswp__counter"></div>
<button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
<button class="pswp__button pswp__button--share" title="Share"></button>
<button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
<button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
<!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
<!-- element will get class pswp__preloader--active when preloader is running -->
<div class="pswp__preloader">
<div class="pswp__preloader__icn">
<div class="pswp__preloader__cut">
<div class="pswp__preloader__donut"></div>
</div>
</div>
</div>
</div>
<div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
<div class="pswp__share-tooltip"></div>
</div>
<button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
</button>
<button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
</button>
<div class="pswp__caption">
<div class="pswp__caption__center"></div>
</div>
</div>
</div>
</div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="//www.googletagmanager.com/gtag/js?id=UA-157733505-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-157733505-1');
</script>
<script>
function initialTyped() {
var typedTextEl = $('.typed-text');
if (typedTextEl && typedTextEl.length > 0) {
var typed = new Typed('.typed-text', {
strings: ['凡事都要留几分', '颜值是第一生产力'],
typeSpeed: 90,
loop: true,
loopCount: Infinity,
backSpeed: 20,
});
}
}
if ($('.article-header') && $('.article-header').length) {
$(document).ready(function () {
initialTyped();
});
}
</script>
<!-- 例:百度统计 --> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?your_code"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</html>