forked from godweiyang/hexo-theme-sungod
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.xml
107 lines (51 loc) · 20.3 KB
/
search.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>New start</title>
<link href="/2020/12/25/new-start/"/>
<url>/2020/12/25/new-start/</url>
<content type="html"><![CDATA[<h1 id="新的开始"><a href="#新的开始" class="headerlink" title="新的开始"></a>新的开始</h1><p>大概从今天开始会以较高的频率更新该个人博客网站,涵盖的范围包括以下内容:</p><ol><li>机器学习</li><li>数据结构与算法</li><li>脑机接口</li><li>其他计算机领域的学习</li><li>思考人生,随便说说的随笔</li></ol>]]></content>
<categories>
<category> 随笔 </category>
</categories>
<tags>
<tag> 随笔 </tag>
</tags>
</entry>
<entry>
<title>Vue study-1</title>
<link href="/2019/12/26/vue-study-1/"/>
<url>/2019/12/26/vue-study-1/</url>
<content type="html"><![CDATA[<h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>本次文章讲述对于vue的基础使用。Vue.js是一个用于创建用户界面的开源JavaScript框架,也是一个创建单页应用的Web应用框架。<a href="https://cn.vuejs.org/index.html" target="_blank" rel="noopener">网站链接</a></p><p>一些比较友好的扩展系列,比如Vuex和Vuetify等等,都能极大的提高Vue编程的效率。</p><h2 id="Api"><a href="#Api" class="headerlink" title="Api"></a>Api</h2><p>一个前端几乎必然会涉及到的是连接一个后台服务器。最简单的方法是</p><h3 id="Step-1"><a href="#Step-1" class="headerlink" title="Step 1"></a>Step 1</h3><p>在全局建立一个api.js。内容大致如下:</p><pre class="line-numbers language-js"><code class="language-js"><span class="token keyword">import</span> axios <span class="token keyword">from</span> <span class="token string">'axios'</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span> <span class="token keyword">return</span> axios<span class="token punctuation">.</span><span class="token function">create</span><span class="token punctuation">(</span><span class="token punctuation">{</span> baseURL<span class="token punctuation">:</span> <span class="token string">'xxxx/Everitoken/'</span> <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">}</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre><p>其中baseURL为服务器提供的链接基址。比如基址为xxxx/Everitoken/。而在后续调用中只用填写相应服务的部分地址即可</p><h3 id="Step-2"><a href="#Step-2" class="headerlink" title="Step 2"></a>Step 2</h3><p>在需要与服务器进行相关操作的界面xxx.vue的<code><script></script></code>中间导入</p><p><code>import api from '../../../config/Api.js'</code>.导入后便可以在当前文件下使用<code>api()</code>的方式进行调用。</p><p>调用示例:</p><pre class="line-numbers language-vue"><code class="language-vue">login(){ let consignee = { "phone":this.userRegistry.username, "code": this.userRegistry.pwd } api().post(`Account/login`,consignee) .then(response => { // alert(response.data.msg) if (response.data.code === 0) { this.$store.commit('updateInfo',{phone:consignee.phone}) this.$router.push('/user') } else { alert('认证失败') } })}<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre><p>调用分为几个步骤:</p><ul><li>建立数据</li><li>建立连接</li><li>回应处理</li></ul><h4 id="建立数据"><a href="#建立数据" class="headerlink" title="建立数据"></a>建立数据</h4><p>将数据单独命名有利于代码的规范化。</p><h4 id="建立连接"><a href="#建立连接" class="headerlink" title="建立连接"></a>建立连接</h4><p>此处采用的是post方法,参数为<code>(地址,数据)</code> 。登陆见面的接口地址为xxxx/Everitoken/Account/login.由于前面基址的设置,此处只用填入Account/login即可。</p><h4 id="回应处理"><a href="#回应处理" class="headerlink" title="回应处理"></a>回应处理</h4><p>与数据后台的交互大多发生在这个阶段。</p><p>一般当检测到<code>response.data.code</code>为0时,即后台接收了本次访问请求,返回的数据包含在<code>response.data</code>里,将相应的属性与本网页的相关属性进行绑定即可。</p><h2 id="登录"><a href="#登录" class="headerlink" title="登录"></a>登录</h2><p>想起之前用本地的文件流作为后台时的艰难时光,采用文件读入的方法对用户名和密码进行验证,效率实在太低了QAQ</p><p>登录一般也分为几个步骤:</p><ul><li>建立输入框,属性绑定</li></ul><p>即在输入框中的v-model与属性进行绑定即可</p><ul><li>事件函数的书写</li></ul><p>实例见前面Api处的login函数</p><h2 id="全局配置"><a href="#全局配置" class="headerlink" title="全局配置"></a>全局配置</h2><p>不同的网页之间需要数据的关联,这个时候需要对数据的一些存储。</p><p>一个总体的结构(这五个文件均在store文件夹下)</p><p><code>index.js</code></p><p><code>actions.js</code><br><code>getters.js</code><br><code>mutations.js</code><br><code>mutation-types.js</code></p><p>这里只讲述一个简单的前段会用到的。<code>mutations.js</code>和<code>mutation-types.js</code></p><p><code>index.js</code>是全局部分的对外接口,该文件中需要对上述的几个文件进行导入。</p><pre class="line-numbers language-js"><code class="language-js"><span class="token keyword">import</span> Vue <span class="token keyword">from</span> <span class="token string">'vue'</span><span class="token keyword">import</span> Vuex <span class="token keyword">from</span> <span class="token string">'vuex'</span><span class="token keyword">import</span> mutations <span class="token keyword">from</span> <span class="token string">'./mutations'</span><span class="token keyword">import</span> actions <span class="token keyword">from</span> <span class="token string">'./actions'</span><span class="token keyword">import</span> getters <span class="token keyword">from</span> <span class="token string">'./getters'</span>Vue<span class="token punctuation">.</span><span class="token function">use</span><span class="token punctuation">(</span>Vuex<span class="token punctuation">)</span><span class="token keyword">const</span> state <span class="token operator">=</span> <span class="token punctuation">{</span> login<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span> <span class="token comment" spellcheck="true">// 登录的状态</span> username<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span> <span class="token comment" spellcheck="true">//用户名</span> money<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span> <span class="token comment" spellcheck="true">//余额</span> pwd<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//密码</span> identity<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//身份证号</span> realname<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//真实姓名</span> location<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//地址</span> phone<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//手机号用于查询用户信息</span> year<span class="token punctuation">:</span><span class="token keyword">null</span><span class="token punctuation">,</span><span class="token comment" spellcheck="true">//驾龄</span><span class="token punctuation">}</span><span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token keyword">new</span> <span class="token class-name">Vuex<span class="token punctuation">.</span>Store</span><span class="token punctuation">(</span><span class="token punctuation">{</span> state<span class="token punctuation">,</span> actions<span class="token punctuation">,</span> getters<span class="token punctuation">,</span> mutations<span class="token punctuation">}</span><span class="token punctuation">)</span><span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre><p>进行了一些变量的定义后,那么如何对其进行调用呢?需要在项目的总配置文件<code>main.js</code>中导入index.js所在的文件夹,比如这里在store文件夹下,因为<code>import store from ./store/</code>,并在<code>new Vue()的成分中加入store</code>,此后在所有的项目文件中,均可以利用this.$store.state.xxx进行xxx变量的调用。</p><p>mutations.js是用来存储一些函数的。那么是哪些函数呢?</p><p>需要注意的是,通过上述的方法可以对变量进行调用,但不能进行更改,即该方法的属性是只读的(理解为这样既可)。一些更新的函数既可在此处进行定义。函数的调用及属性更改需要进行如下操作:</p><p>在需要使用的Vue文件的<code><script></script></code>中加入<code>import {mapMutations} from 'vuex'</code>,意思是说采用了Mutations中的函数,名字不可替换。在methods中导入<code>...mapMutations(['updateInfo'])</code>,即进行相关函数的导入。变量的更改通过<code>this.$store.commit('updateInfo',{phone:consignee.phone})</code>进行操作,变量为<code>(函数操作,数据集合)</code></p><h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>此处为简化的一个项目结构的文件<a href="./sample.rar">代码下载</a></p>]]></content>
<categories>
<category> Web front end </category>
</categories>
<tags>
<tag> Vue从入门到入土 </tag>
</tags>
</entry>
<entry>
<title>package management</title>
<link href="/2019/11/26/package-management/"/>
<url>/2019/11/26/package-management/</url>
<content type="html"><![CDATA[<h1 id="Package-Management"><a href="#Package-Management" class="headerlink" title="Package Management"></a>Package Management</h1><h2 id="Description"><a href="#Description" class="headerlink" title="Description"></a>Description</h2><p><code>Environment : ubuntu 18 or ubuntu 16</code></p><h2 id="Delete"><a href="#Delete" class="headerlink" title="Delete"></a>Delete</h2><p><code>sudo apt remove -y libreoffice-common unity-webapps-common thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot gnome-mines cheese transmission-common gnome-orca webbrowser-app gnome-sudoku landscape-client-ui-install onboard deja-dup</code></p><h2 id="ADD"><a href="#ADD" class="headerlink" title="ADD"></a>ADD</h2><ul><li>install some essentials</li></ul><p>you can install this essential pacakges by</p><p><code>sudo apt install -y vim make wget curl cmake unrar</code> </p><ul><li>addtional installation</li></ul><p>WPS</p><p><code>sudo apt install wps-office</code></p><h1 id="Cuda"><a href="#Cuda" class="headerlink" title="Cuda"></a>Cuda</h1><h2 id="Step-1"><a href="#Step-1" class="headerlink" title="Step 1"></a>Step 1</h2><p>go to the official website to get the xxxx.run</p><h2 id="Step-2"><a href="#Step-2" class="headerlink" title="Step 2"></a>Step 2</h2><p>run the file by</p><p><code>sudo sh xxx.run</code></p><h2 id="Step-3"><a href="#Step-3" class="headerlink" title="Step 3"></a>Step 3</h2><p>gedit the environment variable</p><p><code>sudo gedit /etc/profile</code></p><p>add the following things</p><p><code>export CUDA_HOME=/usr/local/cuda-9.0</code></p><p><code>export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}</code></p><p><code>export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}</code></p><blockquote><p>Notice: </p><p>This setteing is default and the cuda version is 9.0.</p><p>If you install it in a different path or install a different version,just gedit the path with you like</p><p>Recommend:</p><p>ubuntu 16.04 + cuda 9.0</p><p>ubuntu 18.04 + cuda 10.0</p></blockquote><p>renew</p><p><code>source /etc/profile</code></p><h2 id="Step-4"><a href="#Step-4" class="headerlink" title="Step 4"></a>Step 4</h2><p>if you successfully install it,you can see the version output by</p><p><code>nvcc -V</code></p><h2 id="Step-5-Additonal"><a href="#Step-5-Additonal" class="headerlink" title="Step 5 (Additonal)"></a>Step 5 (Additonal)</h2><p>you can test the samples if you like</p><p><code>cd /usr/local/cuda-9.0/samples/1_Utilities/deviceQuery</code></p><blockquote><p>This command is mainly depend on the path you install the samples</p><p>I just test one thing here</p><p>If you want to see all the results </p><ul><li>cd /usr/local/cuda-9.0/samples</li><li>sudo make -j8</li></ul></blockquote><p>compile</p><p><code>sudo make</code></p><p>run</p><p><code>./deviceQuery</code></p><h1 id="Cudnn"><a href="#Cudnn" class="headerlink" title="Cudnn"></a>Cudnn</h1><h2 id="Step-1-1"><a href="#Step-1-1" class="headerlink" title="Step 1"></a>Step 1</h2><p>go to the official website to get the file and unrar it</p><h2 id="Step-2-1"><a href="#Step-2-1" class="headerlink" title="Step 2"></a>Step 2</h2><p>copy and move the file</p><p><code>sudo cp include/cudnn.h /usr/local/cuda/include/</code><br><code>sudo cp lib64/* /usr/local/cuda/lib64/</code><br><code>cd /usr/local/cuda/lib64</code><br><code>sudo ln -sf libcudnn.so.7.2.1 libcudnn.so.7</code><br><code>sudo ln -sf libcudnn.so.7 libcudnn.so</code><br><code>sudo ldconfig -v</code></p><h1 id="Opencv"><a href="#Opencv" class="headerlink" title="Opencv"></a>Opencv</h1><h2 id="Step-1-2"><a href="#Step-1-2" class="headerlink" title="Step 1"></a>Step 1</h2><p>install the dependency pacakges</p><p><code>sudo apt install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler</code></p><p><code>sudo apt-get install --no-install-recommends libboost-all-dev -ysudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev -ysudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev -ysudo apt-get install git cmake build-essential -y</code></p><h2 id="Step-2-2"><a href="#Step-2-2" class="headerlink" title="Step 2"></a>Step 2</h2><p>gedit the environment variable</p><p><code>sudo gedit ~/.bashrc</code></p><blockquote><p>if you use the bash then gedit the .bashrc</p><p>else if you use the zsh then gedit the .zshrc</p></blockquote><p>add the things followed</p><p><code>export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH</code></p><p><code>export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH</code></p><h2 id="Step-3-1"><a href="#Step-3-1" class="headerlink" title="Step 3"></a>Step 3</h2><p>go to the official website to install the package</p><p><a href="https://opencv.org/releases.html" target="_blank" rel="noopener">https://opencv.org/releases.html</a></p><p>move to the file you unrar </p><ul><li>the present path should lnclude many folders and files</li></ul><p><code>mkdir build</code></p><p><code>cd build</code></p><p><code>cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..</code></p><p><code>make -j8</code></p><p><code>sudo make install</code></p><p>check the version</p><p><code>pkg-config --modversion opencv</code></p><blockquote><p>Notice:</p><p>version : </p><ul><li><p>ubuntu16 + opencv3.4.2 </p><ul><li>around this version</li></ul></li><li><p>ubuntu18 + opencv3.4.7 </p><ul><li>around the newest can be fine</li></ul></li></ul><p>otherwise</p><p>you will meet some troublesome errors which is terrible</p><p>And you can also install opencv4.1.x</p><p>but in someways it will be lack of some files and you should add it manually </p></blockquote><h1 id="End"><a href="#End" class="headerlink" title="End"></a>End</h1><p>I write it for those who has some fundamental knowledges</p><p>So i don’t indicate the fundamental operations too much</p><p>Next time!</p><blockquote><p>Three O’cat is still a game</p></blockquote>]]></content>
<categories>
<category> Os </category>
</categories>
<tags>
<tag> Ubuntu从入门到入土 </tag>
</tags>
</entry>
<entry>
<title>Repair boot</title>
<link href="/2019/11/25/repair-boot/"/>
<url>/2019/11/25/repair-boot/</url>
<content type="html"><![CDATA[<p>作为一名合格的编程人员,应该拥有一台安装有双系统的电脑(windows && linux),今天来讲讲怎么瞎搞才不会把两个系统弄瘫痪。这里我选择了windows10 + ubuntu18.04.</p><h1 id="删除系统"><a href="#删除系统" class="headerlink" title="删除系统"></a>删除系统</h1><p>当你不再爱linux了,并且你想尽快的让它从你眼中消失。只需下面几步</p><h2 id="step-1"><a href="#step-1" class="headerlink" title="step 1"></a>step 1</h2><p>进入windows,右击我的电脑,打开管理,进入磁盘管理</p><h2 id="step-2"><a href="#step-2" class="headerlink" title="step 2"></a>step 2</h2><p>选中你linux系统所在的盘块,右键删除卷(这里会提示这不是windows的xxxx),然后重复2直到你把linux占的空间全删除了</p><h2 id="step-3"><a href="#step-3" class="headerlink" title="step 3"></a>step 3</h2><p>如果你此时重启了,那么恭喜你,电脑将不能正常启动(切忌)。</p><p><code>win+R</code>进入运行,输入<code>cmd</code>进入终端。<code>diskpart</code>进入磁盘管理,</p><p><code>select disk 0</code>选中系统盘(如果不知道哪个数字代表系统盘用<code>list disk</code>查看)</p><p><code>select partition 0</code>选中系统分区(不知道哪个分区代表系统分区用<code>list partition</code>查看)</p><p><code>assign letter = x</code>分配一个临时的盘符(x可以是任何不与你现有盘符重复的字母,这里直接用x)</p><p>动用鼠标用管理员身份打开记事本(按下<code>win</code>,键盘输入<code>记事本</code>,右键以管理员身份打开)</p><p>点击打开文件,找到刚才的x盘,然后进入,点击UEFI文件夹,发现下面有ubuntu文件夹,右键删除该文件夹</p><p>至此,你已经成功完成了ubuntu系统的删除QWQ</p><p>(才不会说我懒得配图就没有图呢QAQ)</p>]]></content>
<categories>
<category> Os </category>
</categories>
<tags>
<tag> Ubuntu从入门到入土 </tag>
</tags>
</entry>
</search>