-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
178 lines (87 loc) · 37 KB
/
atom.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Wander's Blog</title>
<subtitle>基于个人实际经验,做真正有价值的技术分享。</subtitle>
<link href="https://www.rustpub.com/atom.xml" rel="self"/>
<link href="https://www.rustpub.com/"/>
<updated>2023-03-01T03:53:24.432Z</updated>
<id>https://www.rustpub.com/</id>
<author>
<name>[email protected]</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>Go to Rust - String</title>
<link href="https://www.rustpub.com/2021/09/30/go-to-rust-string/"/>
<id>https://www.rustpub.com/2021/09/30/go-to-rust-string/</id>
<published>2021-09-30T03:33:31.000Z</published>
<updated>2023-03-01T03:53:24.432Z</updated>
<content type="html"><![CDATA[<h1 id="通过golang和rust代码对比快速学习rust(2)-字符串"><a href="#通过golang和rust代码对比快速学习rust(2)-字符串" class="headerlink" title="通过golang和rust代码对比快速学习rust(2)- 字符串"></a>通过golang和rust代码对比快速学习rust(2)- 字符串</h1><h2 id="1-字符串类型定义"><a href="#1-字符串类型定义" class="headerlink" title="1. 字符串类型定义"></a>1. 字符串类型定义</h2><ul><li><p>Golang 中只有一个 string类型,对应字符串。</p><blockquote><p>string是所有8位字节的字符串的集合,通常但不一定代表UTF-8编码的文本。一个字符串可以是空的,但不能是零。字符串类型的值是不可改变的。</p></blockquote></li><li><p>Rust 中有三个类型 str ,&str ,String 来对应处理字符串。</p><blockquote><p>str类型,也被称为 “字符串切片”,是最原始的字符串类型。它通常以其借用的形式出现,即&str。它也是字符串字面的类型,&’static str。字符串切片总是有效的UTF-8。<br>&str类型是两个主要的字符串类型之一,另一个是String。与其对应的String不同,它的内容是借用的。<br>String类型是一个UTF-8编码的、可增长的字符串。<br>String类型是最常见的字符串类型,它对字符串的内容有所有权。它与它的借来的对应物,即原始的str,有着密切的关系。</p></blockquote></li></ul><h2 id="2-个人理解"><a href="#2-个人理解" class="headerlink" title="2. 个人理解"></a>2. 个人理解</h2><blockquote><p>Golang中字符串只用stirng处理,实际存储的是byte数组。type byte = uint8,也就是uint8数组不可变。要对字符串做遍历直接就可以用索引。如果要变更长度,需要使用strings包的Split,Join等函数修改并返回一个新的字符串。</p></blockquote><blockquote><p>Rust中字符串是str,实际存储的是u8数组不可变,以&str获取u8数组的切片来访问,遍历。要对字符串做增长修改操作,需要转换成String处理。</p></blockquote><blockquote><p>Golang中对字符串的拆分,组合字符串,通过包strings处理。Rust中通过把字符串转成String实际是pub struct String { vec: Vec<u8>,}结构,是一个处理字符串的对象,它附带了很多处理字符串的方法函数。但是它不是字符串。Rust的String对象等价于Go中的包strings。</p></blockquote><blockquote><p>(作为一个Golang开发者学习Rust,非常容易把Rust的String 等价于 Golang中的string 这是个错误。)</p></blockquote><h2 id="3-我的困惑"><a href="#3-我的困惑" class="headerlink" title="3. 我的困惑:"></a>3. 我的困惑:</h2><p>Rust中对String的说明太让人难以理解了:</p><p>原文:</p><blockquote><p>A UTF-8–encoded, growable string.</p></blockquote><blockquote><p>The String type is the most common string type that has ownership over the contents of the string. It has a close relationship with its borrowed counterpart, the primitive str.</p></blockquote><p>建议应该改成</p><blockquote><p>An object that performs growth processing on UTF-8 encoded strings.</p></blockquote><blockquote><p>The String object is the most common set of string growth processing methods, and it has ownership over the content of the string. It has a close relationship with its borrowed counterpart, the original str. It can do splitting, combining, and growing of strings to return a new string.</p></blockquote><h2 id="4-比较代码"><a href="#4-比较代码" class="headerlink" title="4. 比较代码"></a>4. 比较代码</h2><p>通过代码比较更容易理解Golang和Rust对字符串处理的差异。代码如下:</p><h3 id="Golang-代码"><a href="#Golang-代码" class="headerlink" title="Golang 代码"></a>Golang 代码</h3><figure class="highlight go"><table><tr><td class="code"><pre><span class="line"><span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> (</span><br><span class="line"><span class="string">"fmt"</span></span><br><span class="line"><span class="string">"strings"</span></span><br><span class="line">)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> {</span><br><span class="line"><span class="keyword">var</span> s <span class="type">string</span> = <span class="string">"Hello, 世界"</span></span><br><span class="line">fmt.Println(s)</span><br><span class="line">fmt.Printf(<span class="string">"%v\n"</span>, s)</span><br><span class="line">fmt.Println(<span class="string">"len:"</span>, <span class="built_in">len</span>(s))</span><br><span class="line"></span><br><span class="line">fmt.Println(strings.Split(s, <span class="string">""</span>))</span><br><span class="line"><span class="keyword">for</span> _, v := <span class="keyword">range</span> strings.Split(s, <span class="string">""</span>) {</span><br><span class="line"></span><br><span class="line">fmt.Println(<span class="string">"char:"</span>, v)</span><br><span class="line">}</span><br><span class="line">fmt.Println([]<span class="type">byte</span>(s))</span><br><span class="line"><span class="keyword">for</span> _, v := <span class="keyword">range</span> s {</span><br><span class="line"></span><br><span class="line">fmt.Println(<span class="string">"byte:"</span>, v)</span><br><span class="line"></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> c = <span class="string">'a'</span></span><br><span class="line">fmt.Println(<span class="string">"c:"</span>, c)</span><br><span class="line"></span><br><span class="line"><span class="comment">// 字符串连接</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> s2 <span class="type">string</span> = s + <span class="string">"!"</span></span><br><span class="line"></span><br><span class="line">fmt.Println(<span class="string">"连接后的字符串:"</span>, s2)</span><br><span class="line"><span class="comment">// utf8 字符串字面亮赋值</span></span><br><span class="line"><span class="keyword">var</span> hello <span class="type">string</span> = <span class="string">"Hello, world!🚢"</span></span><br><span class="line">fmt.Println(hello)</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure><p>output:</p><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">Hello, 世界</span><br><span class="line">Hello, 世界</span><br><span class="line">len: 13</span><br><span class="line">[H e l l o , 世 界]</span><br><span class="line">char: H</span><br><span class="line">char: e</span><br><span class="line">char: l</span><br><span class="line">char: l</span><br><span class="line">char: o</span><br><span class="line">char: ,</span><br><span class="line">char: </span><br><span class="line">char: 世</span><br><span class="line">char: 界</span><br><span class="line">[72 101 108 108 111 44 32 228 184 150 231 149 140]</span><br><span class="line">byte: 72</span><br><span class="line">byte: 101</span><br><span class="line">byte: 108</span><br><span class="line">byte: 108</span><br><span class="line">byte: 111</span><br><span class="line">byte: 44</span><br><span class="line">byte: 32</span><br><span class="line">byte: 19990</span><br><span class="line">byte: 30028</span><br><span class="line">c: 97</span><br><span class="line">连接后的字符串: Hello, 世界!</span><br><span class="line">Hello, world!🚢</span><br></pre></td></tr></table></figure><h3 id="Rust-代码"><a href="#Rust-代码" class="headerlink" title="Rust 代码"></a>Rust 代码</h3><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">fn main() {</span><br><span class="line"> let s: &str = "Hello, 世界";</span><br><span class="line"> println!("{}", s);</span><br><span class="line"> println!("{:?}", s);</span><br><span class="line"> println!("len:{}", s.len());</span><br><span class="line"></span><br><span class="line"> println!("{:?}",s.chars());</span><br><span class="line"> for v in s.chars() {</span><br><span class="line"> println!("char:{}", v);</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> println!("{:?}",s.bytes());</span><br><span class="line"> for v in s.bytes() {</span><br><span class="line"> println!("byte:{}", v);</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> let c = 'a';</span><br><span class="line"></span><br><span class="line"> println!("c:{}", c);</span><br><span class="line"> // 字符串连接</span><br><span class="line"> let s1: String = s.to_owned() + "!";</span><br><span class="line"> let s2: &str = s1.as_str();</span><br><span class="line"> println!("连接后的字符串:{}", s2);</span><br><span class="line"> // utf8字面量绑定</span><br><span class="line"> let hello: &'static str = "Hello, world!🚢";</span><br><span class="line"> println!("{}", hello);</span><br><span class="line">}</span><br><span class="line"></span><br></pre></td></tr></table></figure><p>output:</p><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">Hello, 世界</span><br><span class="line">"Hello, 世界"</span><br><span class="line">len:13</span><br><span class="line">Chars(['H', 'e', 'l', 'l', 'o', ',', ' ', '世', '界'])</span><br><span class="line">char:H</span><br><span class="line">char:e</span><br><span class="line">char:l</span><br><span class="line">char:l</span><br><span class="line">char:o</span><br><span class="line">char:,</span><br><span class="line">char: </span><br><span class="line">char:世</span><br><span class="line">char:界</span><br><span class="line">Bytes(Copied { it: Iter([72, 101, 108, 108, 111, 44, 32, 228, 184, 150, 231, 149, 140]) })</span><br><span class="line">byte:72</span><br><span class="line">byte:101</span><br><span class="line">byte:108</span><br><span class="line">byte:108</span><br><span class="line">byte:111</span><br><span class="line">byte:44</span><br><span class="line">byte:32</span><br><span class="line">byte:228</span><br><span class="line">byte:184</span><br><span class="line">byte:150</span><br><span class="line">byte:231</span><br><span class="line">byte:149</span><br><span class="line">byte:140</span><br><span class="line">c:a</span><br><span class="line">连接后的字符串:Hello, 世界!</span><br><span class="line">Hello, world!🚢</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="通过golang和rust代码对比快速学习rust(2)-字符串"><a href="#通过golang和rust代码对比快速学习rust(2)-字符串" class="headerlink" title="通过golang和rust代码对比快速学习rust(2)</summary>
<category term="rust" scheme="https://www.rustpub.com/tags/rust/"/>
</entry>
<entry>
<title>Why Learning English - Study Notes</title>
<link href="https://www.rustpub.com/2021/09/11/why-learning-english-study-note/"/>
<id>https://www.rustpub.com/2021/09/11/why-learning-english-study-note/</id>
<published>2021-09-11T15:53:30.000Z</published>
<updated>2023-03-01T03:53:24.431Z</updated>
<content type="html"><![CDATA[<h1 id="The-meaning-of-learning-English"><a href="#The-meaning-of-learning-English" class="headerlink" title="The meaning of learning English"></a>The meaning of learning English</h1><p>I learned that languages is more than syllables and rhymes.</p><p><em>我得知,语言不仅仅是音节和韵律。</em></p><hr><p>It is a tool for communication.</p><p><em>它是一种沟通的工具。</em></p><hr><p>It connects people,bridges different cultures and brings heart and minds closer.</p><p><em>它将人们联系在一起,为不同的文化架起桥梁,拉近了心灵和思想的距离。</em></p><hr><p>As Chinese, we speak English to make our voice heard, loud and clear,</p><p><em>作为中国人,我们说英语是为了让人们听到我们的声音,响亮而清晰,</em></p><p>to make our narratives more compelling, more convincing, and more appling.</p><p><em>使我们的叙述更引人注目,更有说服力,更有吸引力。</em></p><h1 id="Key-words"><a href="#Key-words" class="headerlink" title="Key words"></a>Key words</h1><table><thead><tr><th align="left">词汇</th><th align="left">中文</th><th align="left">读音</th></tr></thead><tbody><tr><td align="left">language</td><td align="left">语言</td><td align="left">[ˈlæŋɡwɪdʒ]</td></tr><tr><td align="left">syllables</td><td align="left">音节</td><td align="left">[ˈsɪləbəlz]</td></tr><tr><td align="left">rhymes</td><td align="left">韵律</td><td align="left">[raɪmz]</td></tr><tr><td align="left">communication</td><td align="left">沟通</td><td align="left">[kəˌmjuːnɪˈkeɪʃn]</td></tr><tr><td align="left">connects</td><td align="left">联合</td><td align="left">[kəˈnekts]</td></tr><tr><td align="left">narratives</td><td align="left">叙述</td><td align="left">[ˈnærətɪvz]</td></tr><tr><td align="left">compelling</td><td align="left">引人注目的</td><td align="left">[kəmˈpelɪŋ]</td></tr><tr><td align="left">convincing</td><td align="left">有说服力的</td><td align="left">[kənˈvɪnsɪŋ]</td></tr><tr><td align="left">appealing</td><td align="left">有吸引力的</td><td align="left">[əˈpiːlɪŋ]</td></tr></tbody></table>]]></content>
<summary type="html"><h1 id="The-meaning-of-learning-English"><a href="#The-meaning-of-learning-English" class="headerlink" title="The meaning of learning Englis</summary>
<category term="English" scheme="https://www.rustpub.com/tags/English/"/>
</entry>
<entry>
<title>Accept Youself - Study Notes</title>
<link href="https://www.rustpub.com/2021/09/11/accept-youself-study-notes/"/>
<id>https://www.rustpub.com/2021/09/11/accept-youself-study-notes/</id>
<published>2021-09-11T02:13:52.000Z</published>
<updated>2023-03-01T03:53:24.431Z</updated>
<content type="html"><![CDATA[<h1 id="Accept-youself"><a href="#Accept-youself" class="headerlink" title="Accept youself"></a>Accept youself</h1><p>And you know, my message has always been to accept youself.</p><p><em>你知道,我一直想表达的就是“接受自己”。</em></p><hr><p>No matter what,to love youself,to embrace your flaws.</p><p><em>无论如何,请深爱自己,接受自己的缺点,拥抱不完美。</em></p><hr><p>I think flaws are the things that make us special.</p><p><em>我认为,正是这些不完美造就了特别的我们,让我们与众不同。</em></p><hr><p>The cracks within us are the beautiful parts that need to have light shed on them.</p><p><em>我们内心的裂缝是美丽的地方,有裂缝,阳光才照得进来,才会光芒四射。</em></p><hr><p>Otherwise,they’re just left.</p><p><em>不然,你就会迷失自己。</em></p><h1 id="Key-words"><a href="#Key-words" class="headerlink" title="Key words"></a>Key words</h1><table><thead><tr><th align="left">词汇</th><th align="left">中文</th><th align="left">读音</th></tr></thead><tbody><tr><td align="left">message</td><td align="left">信息</td><td align="left">[ˈmesɪdʒ]</td></tr><tr><td align="left">accept</td><td align="left">接受</td><td align="left">[əkˈsept]</td></tr><tr><td align="left">no matter what</td><td align="left">无论如何</td><td align="left"></td></tr><tr><td align="left">embrace</td><td align="left">拥抱</td><td align="left">[ɪmˈbreɪs]</td></tr><tr><td align="left">flaws</td><td align="left">缺陷</td><td align="left">[flɔz]</td></tr><tr><td align="left">special</td><td align="left">特别的</td><td align="left">[ˈspeʃl]</td></tr><tr><td align="left">cracks</td><td align="left">裂缝</td><td align="left">[kræks]</td></tr><tr><td align="left">within</td><td align="left">在…之内</td><td align="left">[wɪˈðɪn]</td></tr><tr><td align="left">beautiful parts</td><td align="left">美丽的地方</td><td align="left"></td></tr><tr><td align="left">otherwise</td><td align="left">不然</td><td align="left">[ˈʌðərwaɪz]</td></tr><tr><td align="left">left</td><td align="left">离开</td><td align="left">[left]</td></tr></tbody></table>]]></content>
<summary type="html"><h1 id="Accept-youself"><a href="#Accept-youself" class="headerlink" title="Accept youself"></a>Accept youself</h1><p>And you know, my messa</summary>
<category term="English" scheme="https://www.rustpub.com/tags/English/"/>
</entry>
<entry>
<title>Golang to Rust -01 fmt.Printf</title>
<link href="https://www.rustpub.com/2021/08/19/golang-to-rust-01-fmt-printf/"/>
<id>https://www.rustpub.com/2021/08/19/golang-to-rust-01-fmt-printf/</id>
<published>2021-08-19T03:12:18.000Z</published>
<updated>2023-03-01T03:53:24.431Z</updated>
<content type="html"><![CDATA[<h1 id="通过golang和rust代码对比快速学习rust-1"><a href="#通过golang和rust代码对比快速学习rust-1" class="headerlink" title="通过golang和rust代码对比快速学习rust (1)"></a>通过golang和rust代码对比快速学习rust (1)</h1><h2 id="1-fmt-Println"><a href="#1-fmt-Println" class="headerlink" title="1. fmt.Println"></a>1. fmt.Println</h2><h3 id="Golang代码"><a href="#Golang代码" class="headerlink" title="Golang代码"></a>Golang代码</h3><figure class="highlight go"><table><tr><td class="code"><pre><span class="line"><span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> <span class="string">"fmt"</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> {</span><br><span class="line">fmt.Println(<span class="string">"Hello, 世界!"</span>)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h3 id="Rust代码"><a href="#Rust代码" class="headerlink" title="Rust代码"></a>Rust代码</h3><figure class="highlight rust"><table><tr><td class="code"><pre><span class="line"><span class="keyword">fn</span> <span class="title function_">main</span>() {</span><br><span class="line"> <span class="built_in">println!</span>(<span class="string">"Hello, 世界!"</span>);</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h2 id="2-fmt-Printf"><a href="#2-fmt-Printf" class="headerlink" title="2. fmt.Printf"></a>2. fmt.Printf</h2><h3 id="Golang代码-1"><a href="#Golang代码-1" class="headerlink" title="Golang代码"></a>Golang代码</h3><figure class="highlight go"><table><tr><td class="code"><pre><span class="line"><span class="keyword">package</span> main</span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> <span class="string">"fmt"</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">func</span> <span class="title">main</span><span class="params">()</span></span> {</span><br><span class="line"> <span class="keyword">var</span> s = <span class="string">"世界"</span></span><br><span class="line"> <span class="keyword">var</span> sum = <span class="number">10</span></span><br><span class="line"> fmt.Printf(<span class="string">"Hello, %s!"</span>,s)</span><br><span class="line"> fmt.Printf(<span class="string">"3 +7 = %d"</span>,sum)</span><br><span class="line">}</span><br></pre></td></tr></table></figure><h3 id="Rust代码-1"><a href="#Rust代码-1" class="headerlink" title="Rust代码"></a>Rust代码</h3><figure class="highlight rust"><table><tr><td class="code"><pre><span class="line"><span class="keyword">fn</span> <span class="title function_">main</span>() {</span><br><span class="line"> <span class="keyword">let</span> <span class="variable">s</span> = <span class="string">"世界"</span></span><br><span class="line"> <span class="keyword">let</span> <span class="variable">sum</span> = <span class="number">10</span></span><br><span class="line"> <span class="built_in">println!</span>(<span class="string">"Hello, {}!"</span>, s);</span><br><span class="line"> <span class="built_in">println!</span>(<span class="string">"3 + 7 = {}"</span>, sum);</span><br><span class="line">}</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="通过golang和rust代码对比快速学习rust-1"><a href="#通过golang和rust代码对比快速学习rust-1" class="headerlink" title="通过golang和rust代码对比快速学习rust (1)"></a>通过g</summary>
<category term="rust" scheme="https://www.rustpub.com/tags/rust/"/>
</entry>
<entry>
<title>Hexo 主题目录无法加入Git跟踪?</title>
<link href="https://www.rustpub.com/2021/08/05/hexo-zhu-ti-mu-lu-bu-neng-gen-zong/"/>
<id>https://www.rustpub.com/2021/08/05/hexo-zhu-ti-mu-lu-bu-neng-gen-zong/</id>
<published>2021-08-05T07:43:47.000Z</published>
<updated>2023-03-01T03:53:24.432Z</updated>
<content type="html"><![CDATA[<h3 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h3><p>hexo 主题目录无法加入git跟踪,没法提交到代码仓库中保存怎么处理? </p><p>因为主题目录有些是git clone到 hexo的theme目录下的,我下载了<br>maupassant 主题,目录如下发现,在git 无法跟踪themes/maupassant</p><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">tree -L 2 themes/</span><br><span class="line">themes/</span><br><span class="line">└── maupassant</span><br><span class="line"> ├── LICENSE</span><br><span class="line"> ├── README.md</span><br><span class="line"> ├── _config.yml</span><br><span class="line"> ├── languages</span><br><span class="line"> ├── layout</span><br><span class="line"> ├── package.json</span><br><span class="line"> └── source</span><br></pre></td></tr></table></figure><h3 id="我的处理方法"><a href="#我的处理方法" class="headerlink" title="我的处理方法"></a>我的处理方法</h3><h4 id="1-删除主题目录下的git数据"><a href="#1-删除主题目录下的git数据" class="headerlink" title="1. 删除主题目录下的git数据"></a>1. 删除主题目录下的git数据</h4><p>因为主题maupassant下载后,跟整个hexo网站仓库统一管理。<br>通常主题的文件还需要做一些自定义修改,所以需要删除主题目录下的.git数据。</p><p><code>rm -rf themes/maupassant/.git</code></p><h4 id="2-清除hexo网站仓库中的git缓存"><a href="#2-清除hexo网站仓库中的git缓存" class="headerlink" title="2. 清除hexo网站仓库中的git缓存"></a>2. 清除hexo网站仓库中的git缓存</h4><p>在网站仓库把themes/maupassant git缓存强制清除。</p><p><code>git rm -r -f --cached themes/maupassant</code></p><p>经过上面的处理应该就可以跟踪themes/maupassant下的所有文件。</p>]]></content>
<summary type="html"><h3 id="问题描述"><a href="#问题描述" class="headerlink" title="问题描述"></a>问题描述</h3><p>hexo 主题目录无法加入git跟踪,没法提交到代码仓库中保存怎么处理? </p>
<p>因为主题目录有些是git clon</summary>
<category term="hexo" scheme="https://www.rustpub.com/tags/hexo/"/>
<category term="git" scheme="https://www.rustpub.com/tags/git/"/>
</entry>
<entry>
<title>分享一个Golang开发使用的vim配置</title>
<link href="https://www.rustpub.com/2021/08/05/go-ide-vim/"/>
<id>https://www.rustpub.com/2021/08/05/go-ide-vim/</id>
<published>2021-08-05T06:40:35.000Z</published>
<updated>2023-03-01T03:53:24.431Z</updated>
<content type="html"><![CDATA[<p>分享一个golang开发使用的vim配置<br>my vim conf for golang IDE</p><h2 id="requirements"><a href="#requirements" class="headerlink" title="requirements"></a>requirements</h2><p> vim 8.0 +python3 +lua</p><p> iTerm2 (Support true color) </p><pre><code>brew install macvim</code></pre><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"> vim --version</span><br><span class="line">VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 01 2021 08:32:44)</span><br><span class="line">macOS version - x86_64</span><br><span class="line">包含补丁: 1-2681</span><br><span class="line">编译者 Homebrew</span><br><span class="line">巨型版本 带 MacVim 图形界面。 可使用(+)与不可使用(-)的功能:</span><br><span class="line">+acl +file_in_path -mouse_sysmouse -tag_old_static</span><br><span class="line">+arabic +find_in_path +mouse_urxvt -tag_any_white</span><br><span class="line">+autocmd +float +mouse_xterm +tcl</span><br><span class="line">+autochdir +folding +multi_byte +termguicolors</span><br><span class="line">-autoservername -footer +multi_lang +terminal</span><br><span class="line">+balloon_eval +fork() -mzscheme +terminfo</span><br><span class="line">+balloon_eval_term +fullscreen +netbeans_intg +termresponse</span><br><span class="line">+browse +gettext +num64 +textobjects</span><br><span class="line">++builtin_terms -hangul_input +odbeditor +textprop</span><br><span class="line">+byte_offset +iconv +packages +timers</span><br><span class="line">+channel +insert_expand +path_extra +title</span><br><span class="line">+cindent +ipv6 +perl +toolbar</span><br><span class="line">+clientserver +job +persistent_undo +transparency</span><br><span class="line">+clipboard +jumplist +popupwin +user_commands</span><br><span class="line">+cmdline_compl +keymap +postscript +vartabs</span><br><span class="line">+cmdline_hist +lambda +printer +vertsplit</span><br><span class="line">+cmdline_info +langmap +profile +virtualedit</span><br><span class="line">+comments +libcall -python +visual</span><br><span class="line">+conceal +linebreak +python3 +visualextra</span><br><span class="line">+cryptv +lispindent +quickfix +viminfo</span><br><span class="line">+cscope +listcmds +reltime +vreplace</span><br><span class="line">+cursorbind +localmap +rightleft +wildignore</span><br><span class="line">+cursorshape +lua +ruby +wildmenu</span><br><span class="line">+dialog_con_gui +menu +scrollbind +windows</span><br><span class="line">+diff +mksession +signs +writebackup</span><br><span class="line">+digraphs +modify_fname +smartindent -X11</span><br><span class="line">+dnd +mouse -sound -xfontset</span><br><span class="line">-ebcdic +mouseshape +spell +xim</span><br><span class="line">+emacs_tags +mouse_dec +startuptime -xpm</span><br><span class="line">+eval -mouse_gpm +statusline -xsmp</span><br><span class="line">+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard</span><br><span class="line">+extra_search +mouse_netterm +syntax -xterm_save</span><br><span class="line">-farsi +mouse_sgr +tag_binary </span><br></pre></td></tr></table></figure><p>Plugin Manager</p><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">curl -fLo ~/.vim/autoload/plug.vim --create-dirs \</span><br><span class="line"> https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim</span><br><span class="line"></span><br></pre></td></tr></table></figure><h2 id="install"><a href="#install" class="headerlink" title="install"></a>install</h2><pre><code>git clone https://github.com/wandercn/go-ide-vim.conf.git ./vim_conf && mv ./vim_conf/.vimrc $HOME/.vimrcvim +PlugInstall</code></pre><h2 id="screen"><a href="#screen" class="headerlink" title="screen"></a>screen</h2><p><img src="/go-vim.gif"></p>]]></content>
<summary type="html"><p>分享一个golang开发使用的vim配置<br>my vim conf for golang IDE</p>
<h2 id="requirements"><a href="#requirements" class="headerlink" title="requiremen</summary>
<category term="vim" scheme="https://www.rustpub.com/tags/vim/"/>
</entry>
<entry>
<title>Hobuild 一个Golang热编译工具</title>
<link href="https://www.rustpub.com/2021/07/21/hotbuild/"/>
<id>https://www.rustpub.com/2021/07/21/hotbuild/</id>
<published>2021-07-21T07:41:40.000Z</published>
<updated>2023-03-01T03:53:24.432Z</updated>
<content type="html"><![CDATA[<h1 id="hobuild"><a href="#hobuild" class="headerlink" title="hobuild"></a>hobuild</h1><p>A cross platform hot compilation tool</p><p>By monitoring the modification of the project directory file, the recompilation and running are automatically triggered. Running directory and monitoring change directory can be different. Monitor the file modification in all recursive subdirectories under the project path.</p><p> <img src="/logo.png"></p><h1 id="Install"><a href="#Install" class="headerlink" title="Install"></a>Install</h1><pre><code>go get -u github.com/wandercn/hotbuild@latest </code></pre><h1 id="Initialize"><a href="#Initialize" class="headerlink" title="Initialize"></a>Initialize</h1><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">wander$ cd $your_project_dir/</span><br><span class="line">wander$ hotbuild initconf</span><br><span class="line">2021/07/28 11:10:03 create config file: .hotbuild.toml</span><br></pre></td></tr></table></figure><h1 id="Run"><a href="#Run" class="headerlink" title="Run"></a>Run</h1><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">wander$ cd $your_project_dir/</span><br><span class="line">wander$ hotbuild run</span><br><span class="line"> _ _ ___ _____ ____ _ _ ___ _ ____</span><br><span class="line">| | | |/ _ \_ _| | __ )| | | |_ _| | | _ \</span><br><span class="line">| |_| | | | || | | _ \| | | || || | | | | |</span><br><span class="line">| _ | |_| || | | |_) | |_| || || |___| |_| |</span><br><span class="line">|_| |_|\___/ |_| |____/ \___/|___|_____|____/ v1.0.5, built with Go 1.16.5</span><br><span class="line"></span><br><span class="line">.............................. ( Start rebuilding ) .................................</span><br><span class="line">.............................. [ Build successfully ] ...............................</span><br><span class="line">.............................. { Start running } ....................................</span><br><span class="line">2021/07/06 09:56:26.913 [I] [asm_amd64.s:1371] http server Running on http://0.0.0.0:8080</span><br><span class="line">2021/07/06 09:56:26.913 [I] [asm_amd64.s:1371] Admin server Running on :8088</span><br></pre></td></tr></table></figure><h1 id="Custom-configuration"><a href="#Custom-configuration" class="headerlink" title="Custom configuration"></a>Custom configuration</h1><p>Auto create default configuration file in $your_project_dir/.hotbuild.toml,you can modify the configuration yourself.</p><figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">wander$ cd $your_project_dir/</span><br><span class="line">wander$ cat .hotbuild.toml</span><br><span class="line">buildcmd = "go build -o ./tmp_bin"</span><br><span class="line">excludedir = [".git", "tmp", "docs", "vendor"]</span><br><span class="line">projectdir = "/Users/apple/workspace/src/example.com/"</span><br><span class="line">runcmd = "./tmp_bin"</span><br><span class="line"></span><br></pre></td></tr></table></figure><table><thead><tr><th align="left"></th><th align="left">en</th><th align="left">zh-cn</th></tr></thead><tbody><tr><td align="left">buildcmd</td><td align="left">Compile command</td><td align="left">编译命令</td></tr><tr><td align="left">excludedir</td><td align="left">Exclude tracked folders</td><td align="left">排除跟踪的文件夹</td></tr><tr><td align="left">projectdir</td><td align="left">Project directory to track</td><td align="left">需要跟踪的项目目录</td></tr><tr><td align="left">runcmd</td><td align="left">Run command</td><td align="left">运行命令</td></tr></tbody></table><h1 id="FAQ"><a href="#FAQ" class="headerlink" title="FAQ"></a>FAQ</h1><ol><li>the “Too many open files” error of MacOSX</li></ol> <figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line"># maxfiles is 256 too small.</span><br><span class="line"></span><br><span class="line">wander$ launchctl limit</span><br><span class="line">cpu unlimited unlimited</span><br><span class="line">filesize unlimited unlimited</span><br><span class="line">data unlimited unlimited</span><br><span class="line">stack 8388608 67104768</span><br><span class="line">core 0 unlimited</span><br><span class="line">rss unlimited unlimited</span><br><span class="line">memlock unlimited unlimited</span><br><span class="line">maxproc 2784 4176</span><br><span class="line">maxfiles 256 10240</span><br><span class="line"></span><br><span class="line"># change maxfiles to 4096.</span><br><span class="line"></span><br><span class="line">wander$ sudo launchctl limit maxfiles 4096 unlimited</span><br><span class="line">wander$ launchctl limit</span><br><span class="line">cpu unlimited unlimited</span><br><span class="line">filesize unlimited unlimited</span><br><span class="line">data unlimited unlimited</span><br><span class="line">stack 8388608 67104768</span><br><span class="line">core 0 unlimited</span><br><span class="line">rss unlimited unlimited</span><br><span class="line">memlock unlimited unlimited</span><br><span class="line">maxproc 2784 4176</span><br><span class="line">maxfiles 4096 10240</span><br><span class="line"></span><br></pre></td></tr></table></figure>]]></content>
<summary type="html"><h1 id="hobuild"><a href="#hobuild" class="headerlink" title="hobuild"></a>hobuild</h1><p>A cross platform hot compilation tool</p>
<p>By mo</summary>
<category term="go" scheme="https://www.rustpub.com/tags/go/"/>
</entry>
</feed>