-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatom.xml
More file actions
408 lines (347 loc) · 52.1 KB
/
atom.xml
File metadata and controls
408 lines (347 loc) · 52.1 KB
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Joe's blog]]></title>
<subtitle><![CDATA[A pseudo coder!]]></subtitle>
<link href="/atom.xml" rel="self"/>
<link href="http://neverjoe.com/"/>
<updated>2015-09-22T06:24:30.029Z</updated>
<id>http://neverjoe.com/</id>
<author>
<name><![CDATA[Joe]]></name>
<email><![CDATA[tq0317@gmail.com]]></email>
</author>
<generator uri="http://zespia.tw/hexo/">Hexo</generator>
<entry>
<title><![CDATA[impala-sql入门]]></title>
<link href="http://neverjoe.com/2015/09/12/impala-sql%E5%85%A5%E9%97%A8/"/>
<id>http://neverjoe.com/2015/09/12/impala-sql入门/</id>
<published>2015-09-12T01:51:28.000Z</published>
<updated>2015-09-13T12:27:53.000Z</updated>
<content type="html"><![CDATA[<h2 id="引子">引子</h2>
<p>对比下Unix commands:<br></p>
<ul>
<li>CREATE DATABASE = mkdir</li>
<li>CREATE TABLE = mkdir</li>
<li>CREATE … PARTITIONED BY = mkdir -p</li>
<li>CREATE EXTERNAL TABLE … location = ln -s</li>
<li>LOAD DATA INPATH = mv</li>
<li>ATER TABLE … ADD PARTITION = mkdir</li>
<li>USE DATABASE = cd</li>
<li>SELECT = grep, find, sed, awk, cut, perl, python…</li>
<li>INSERT = cp, tee, dd, grep, find, sed, awk, perl, python…</li>
<li>DROP DATABASE = rmdir</li>
<li>DROP TABLE = rm -r</li>
<li>SELECT COUNT(*) = wc -l, grep -c</li>
</ul>
<h2 id="实例">实例</h2>
<h3 id="从本地上传文件到HDFS">从本地上传文件到HDFS</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line"><span class="xml"></span><span class="variable">$cd</span><span class="xml"> </span><span class="variable">${IMPALA_HOME}</span><span class="xml"></span></div><div class="line"><span class="variable">$mkdir</span><span class="xml"> tests_tq && cd tests_tq</span></div><div class="line"><span class="variable">$cat</span><span class="xml"> > csv.txt</span></div><div class="line"><span class="number">1</span><span class="xml">,red,apple,</span><span class="number">4</span><span class="xml"></span></div><div class="line"><span class="number">2</span><span class="xml">,orange,orange,</span><span class="number">3</span><span class="xml"></span></div><div class="line"><span class="number">3</span><span class="xml">,yellow,banana,</span><span class="number">3</span><span class="xml"></span></div><div class="line"><span class="number">4</span><span class="xml">,green,apple,</span><span class="number">4</span><span class="xml"></span></div><div class="line"><span class="keyword">^D</span><span class="xml"></span></div><div class="line"><span class="variable">$cat</span><span class="xml"> > more_csv.txt</span></div><div class="line"><span class="number">5</span><span class="xml">,blue,bubblegum,</span><span class="number">0.5</span><span class="xml"></span></div><div class="line"><span class="number">6</span><span class="xml">,indigo,balcjberry,</span><span class="number">0.2</span><span class="xml"></span></div><div class="line"><span class="keyword">^D</span><span class="xml"></span></div><div class="line"><span class="variable">$hadoop</span><span class="xml"> fs -mkdir /test-warehouse/tests_tq</span></div><div class="line"><span class="variable">$hadoop</span><span class="xml"> fs -put *.txt /test-warehouse/tests_tq</span></div></pre></td></tr></table></figure>
<h3 id="创建表格与导入数据">创建表格与导入数据</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$impala</span>-shell</div><div class="line">>create database food_colors;</div><div class="line">>use food_colors;</div><div class="line">>create table food_data</div><div class="line">>(</div><div class="line">>id <span class="keyword">int</span>, <span class="keyword">color</span> <span class="keyword">string</span>, food <span class="keyword">string</span>, weight <span class="keyword">float</span></div><div class="line">>)</div><div class="line">>row <span class="keyword">format</span> delimited fields terminated by ‘,’;</div><div class="line"><span class="variable">$load</span> data inpath ‘/test-warehouse/tests_tq’ into table food_data;</div><div class="line">><span class="keyword">select</span> food,<span class="keyword">color</span> as “possible Color” from food_data where food = ‘apple’;</div></pre></td></tr></table></figure>
<p>在create database后,impala会在相应的目录下生成database.db目录。<br><br>use database && create table后,impala会在相应database.db下生成表目录。<br><br>导入数据时,impala会把hdfs上的指定文件或者目录下所有文件移动到相应的表目录下,交由impala管理。<br><br>在建表时若使用external关键字,则数据原文件还是在location原地。<br><br>即建外表不需要导入数据,只需要在建表时指定路径关联即可。<br></p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$impala</span>-shell</div><div class="line">>create table xxx (xxxx)</div><div class="line">>location ‘/test-warehouse/tests_tq’;</div></pre></td></tr></table></figure>
<h2 id="常规操作">常规操作</h2>
<ul>
<li>CREATE (EXTERNAL) TABLE (LIKE, AS) (LOCATION)</li>
<li>SELECT</li>
<li>INSERT OVERWRITE (VALUES)</li>
<li>INSERT INTO (VALUES)</li>
<li>JOIN ON (USING)</li>
<li>AGGREGATION && GROUP BY</li>
<li>ORDER BY</li>
<li>PARTITIONED BY</li>
<li>limit 等</li>
</ul>
<h2 id="其他">其他</h2>
<p>一般impala-shell报错invalidata metadata时,则在操作impala支持不友好的数据类型,impala只能做查询操作,无法向其中写入数据。<br><br>而此时,需要使用hive进行相关操作,这样metadata变化,impala无法识别<br><br>如下操作,即可解决问题。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$impala</span>-shell</div><div class="line">><span class="keyword">refresh</span> table_name;</div></pre></td></tr></table></figure>
]]></content>
<summary type="html">
<![CDATA[<h2 id="引子">引子</h2>
<p>对比下Unix commands:<br></p>
<ul>
<li>CREATE DATABASE = mkdir</li>
<li>CREATE TABLE = mkdir</li>
<li>CREATE … PARTITIONE]]>
</summary>
<category term="impala" scheme="http://neverjoe.com/tags/impala/"/>
<category term="SQL-on-Hadoop" scheme="http://neverjoe.com/categories/SQL-on-Hadoop/"/>
</entry>
<entry>
<title><![CDATA[impala源码安装笔记]]></title>
<link href="http://neverjoe.com/2015/09/08/impala%E6%BA%90%E7%A0%81%E5%AE%89%E8%A3%85%E7%AC%94%E8%AE%B0/"/>
<id>http://neverjoe.com/2015/09/08/impala源码安装笔记/</id>
<published>2015-09-08T02:30:29.000Z</published>
<updated>2015-09-13T01:44:07.000Z</updated>
<content type="html"><![CDATA[<p>本文是采用git clone源码,部署单机cluster impala集群。目的是debug和围观impala源码,部署生产环境的请绕行。<br></p>
<h2 id="环境">环境</h2>
<ul>
<li><strong>ubuntu14.04.1</strong> 64bit, 16G Memory, Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz, 1TB disk</li>
<li>gcc/g++ 4.8.2</li>
</ul>
<h2 id="准备相关依赖">准备相关依赖</h2>
<h3 id="java">java</h3>
<p>安装java最新版即可。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">sudo <span class="built_in">add</span>-apt-repository <span class="keyword">pp</span><span class="variable">a:webupd8team</span>/java -<span class="keyword">y</span></div><div class="line">sudo apt-<span class="built_in">get</span> <span class="keyword">update</span> -<span class="keyword">y</span></div><div class="line"></div><div class="line"># Will have <span class="keyword">to</span> agree <span class="keyword">to</span> License</div><div class="line">sudo apt-<span class="built_in">get</span> install oracle-jdk7-installer -<span class="keyword">y</span></div></pre></td></tr></table></figure>
<h3 id="postgresql_&&_boost">postgresql && boost</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">sudo apt-<span class="built_in">get</span> install git build-essential cmake bison flex pkg-config libsasl2-dev autoconf automake libtool maven subversion doxygen libbz2-dev zlib1g-dev <span class="keyword">python</span>-pip <span class="keyword">python</span>-setuptools <span class="keyword">python</span>-dev libssl-dev libboost-<span class="keyword">all</span>-dev postgresql liblzo2-dev lzop -<span class="keyword">y</span></div><div class="line">sudo pip install allpairs pytest pytest-xdist paramiko texttable prettytable sqlparse psutil==<span class="number">0.7</span>.<span class="number">1</span> pywebhdfs gitpython jenkinsapi</div></pre></td></tr></table></figure>
<h4 id="配置postgresql">配置postgresql</h4>
<h5 id="postgresql认证">postgresql认证</h5>
<p>编辑 /etc/postgresql/*/main/pg_hba.conf 文件。由于源码中默认user为hiveuser,包括metastore在内的user均为hiveuser,password均为‘password’。<br><br>而’whoami’不是hiveuser则无法通过postgresql的验证,需要修改上述文件。<br></p>
<ul>
<li>修改前:<br># TYPE DATABASE USER ADDRESS METHOD<br>local all all peer</li>
<li>修改后:<br># TYPE DATABASE USER ADDRESS METHOD<br>local all all peer map=myHiveMap</li>
</ul>
<p>其中需要在/etc/postgresql/*/main/pg_ident.conf<br><br>文件最后加入一行 <br><br> myHivemap your’whoami’ hiveuser<br><br>重启postgresql<br></p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">sudo</span> service postgresql restart</div></pre></td></tr></table></figure>
<h5 id="postgresql中为metastore建立用户">postgresql中为metastore建立用户</h5>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">sudo -u postgres psql postgres</div><div class="line">postgres=# <span class="operator"><span class="keyword">CREATE</span> ROLE hiveuser LOGIN <span class="keyword">PASSWORD</span> ‘<span class="keyword">password</span>’;</span></div><div class="line">postgres=# <span class="operator"><span class="keyword">ALTER</span> ROLE hiveuser <span class="keyword">WITH</span> CREATEDB;</span></div></pre></td></tr></table></figure>
<h4 id="boost库配置">boost库配置</h4>
<p>ubuntu中自带boost库,而impala需要用到相关扩展库。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> /usr/lib/x86_64-linux-gnu</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_filesystem.so libboost_filesystem-mt.so</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_filesystem.a libboost_filesystem-mt.a</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_system.so libboost_system-mt.so</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_system.a libboost_system-mt.a</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_regex.so libboost_regex-mt.so</div><div class="line"><span class="built_in">sudo</span> ln <span class="operator">-s</span> libboost_regex.a libboost_regex-mt.a</div></pre></td></tr></table></figure>
<h3 id="llvm">llvm</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">wget <span class="symbol">http:</span>/<span class="regexp">/llvm.org/releases</span><span class="regexp">/3.3/llvm</span>-<span class="number">3.3</span>.src.tar.gz</div><div class="line">tar xvf llvm-<span class="number">3.3</span>.src.tar.gz</div><div class="line">cd llvm-<span class="number">3.3</span>.src/tools/</div><div class="line">svn co <span class="symbol">http:</span>/<span class="regexp">/llvm.org/svn</span><span class="regexp">/llvm-project/cfe</span><span class="regexp">/tags/</span><span class="constant">RELEASE_33</span>/final/ clang</div><div class="line">cd ../projects/</div><div class="line">svn co <span class="symbol">http:</span>/<span class="regexp">/llvm.org/svn</span><span class="regexp">/llvm-project/compiler</span>-rt/tags/<span class="constant">RELEASE_33</span>/final compiler-rt</div><div class="line">cd ..</div><div class="line">./configure --with-pic</div><div class="line">make -j4 <span class="constant">REQUIRES_RTTI</span>=<span class="number">1</span></div><div class="line">sudo make install</div></pre></td></tr></table></figure>
<h3 id="Maven_3">Maven 3</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">wget <span class="symbol">http:</span>/<span class="regexp">/www.interior-dsgn.com/apache</span><span class="regexp">/maven/maven</span>-<span class="number">3</span>/<span class="number">3.0</span>.<span class="number">5</span>/binaries/apache-maven-<span class="number">3.0</span>.<span class="number">5</span>-bin.tar.gz</div><div class="line">tar xvf apache-maven-<span class="number">3.0</span>.<span class="number">5</span>-bin.tar.gz && sudo mv apache-maven-<span class="number">3.0</span>.<span class="number">5</span> /usr/local</div></pre></td></tr></table></figure>
<h3 id="bashrc">bashrc</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">export</span> JAVA_HOME=/usr/lib/jvm/java-<span class="number">7</span>-oracle</div><div class="line"><span class="keyword">export</span> IMPALA_HOME=<path to Impala></div><div class="line"><span class="keyword">export</span> BOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu</div><div class="line"><span class="keyword">export</span> LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu</div><div class="line"><span class="keyword">export</span> LC_ALL=”en_US.UTF-<span class="number">8</span>”</div><div class="line"><span class="keyword">export</span> M2_HOME=/usr/local/apache-maven-<span class="number">3.0</span>.<span class="number">5</span></div><div class="line"><span class="keyword">export</span> M2=<span class="variable">$M2_HOME</span>/bin</div><div class="line"><span class="keyword">export</span> PATH=<span class="variable">$M2</span>:<span class="variable">$PATH</span></div></pre></td></tr></table></figure>
<h3 id="hdfs_domain_sockets">hdfs domain sockets</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">sudo mkdir <span class="regexp">/var/</span>lib<span class="regexp">/hadoop-hdfs/</span></div><div class="line">sudo chown <user> <span class="regexp">/var/</span>lib<span class="regexp">/hadoop-hdfs/</span><<span class="regexp">/user></span></div></pre></td></tr></table></figure>
<h3 id="ssh_password-less_for_HBase">ssh password-less for HBase</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line"><span class="input"><span class="prompt">ssh-keygen -t dsa</span></span></div><div class="line"># Do not type in any passkey. Just press enter.</div><div class="line">cat ~/.ssh/id_dsa.pub >> ~<span class="regexp">/.ssh/authorized</span>_keys</div></pre></td></tr></table></figure>
<hr>
<p>以上完成了源码安装的准备事项。<br></p>
<h2 id="源码编译">源码编译</h2>
<h3 id="下载源码">下载源码</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">git clone http<span class="variable">s:</span>//github.<span class="keyword">com</span>/cloudera/Impala.git</div></pre></td></tr></table></figure>
<h3 id="检查编译环境变量">检查编译环境变量</h3>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> <span class="variable">${IMPALA_HOME}</span></div><div class="line"><span class="built_in">source</span> bin/impala-config.sh</div></pre></td></tr></table></figure>
<h3 id="格式化HIVE_Metastore_&&_HDFS_">格式化HIVE Metastore && HDFS </h3>
<p>第一次编译的时,需要清除编译环境和格式化Metastore和HDFS namenode.</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">${IMPALA_HOME}</span>/buildall.sh -noclean -skiptests -build_shared_libs -<span class="keyword">format</span></div></pre></td></tr></table></figure>
<h3 id="编译">编译</h3>
<h4 id="整体编译">整体编译</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">${IMPALA_HOME}</span>/buildall.sh -skiptests -build_shared_libs</div></pre></td></tr></table></figure>
<h4 id="单独编译backend">单独编译backend</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$.</span>{<span class="constant">IMPALA_HOME</span>}/bin/make_debug.sh [-notests] -build_shared_libs</div></pre></td></tr></table></figure>
<h4 id="单独编译frontend">单独编译frontend</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="built_in">cd</span> <span class="variable">${IMPALA_HOME}</span>/fe && mvn clean package dependency:copy-dependencies -DskipTests=<span class="literal">true</span></div></pre></td></tr></table></figure>
<h3 id="测试伪分布集群">测试伪分布集群</h3>
<h4 id="启动impala的相关支持">启动impala的相关支持</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="constant">${IMPALA_HOME}</span>/testdata/bin/run-<span class="literal">all</span>.sh</div></pre></td></tr></table></figure>
<p>相关日志在${IMPALA_HOME}/cluster_logs/中。</p>
<h4 id="启动impala">启动impala</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="variable">${IMPALA_HOME}</span>/bin/start-impala-<span class="keyword">cluster</span>.py</div></pre></td></tr></table></figure>
<h4 id="测试impala">测试impala</h4>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="variable">$cd</span> <span class="variable">${IMPALA_HOME}</span></div><div class="line"><span class="variable">$impala</span>-shell.sh -q”SELECT version()”</div></pre></td></tr></table></figure>
<p>如下显示,则一切正常。<br><br> Starting Impala Shell without Kerberos authentication<br> Connected to localhost:21000<br> Server version: impalad version 2.2.0-INTERNAL DEBUG (build 47c90e004aecb928a37b926080098d30b96b4330)<br> Query: select version()<br> +———————————————————————————————————————————-+<br> | version() |<br> +———————————————————————————————————————————-+<br> | impalad version 2.2.0-INTERNAL DEBUG (build 47c90e004aecb928a37b926080098d30b96b4330) |<br> | Built on Sun, Mar 22 15:22:57 PDT 2015 |<br> +———————————————————————————————————————————-+<br> Fetched 1 row(s) in 0.05s<br></p>
<p>最后可以在localhost:25000查看伪分布式集群信息。</p>
]]></content>
<summary type="html">
<![CDATA[<p>本文是采用git clone源码,部署单机cluster impala集群。目的是debug和围观impala源码,部署生产环境的请绕行。<br></p>
<h2 id="环境">环境</h2>
<ul>
<li><strong>ubuntu14.04.1</strong>]]>
</summary>
<category term="impala" scheme="http://neverjoe.com/tags/impala/"/>
<category term="SQL-on-Hadoop" scheme="http://neverjoe.com/categories/SQL-on-Hadoop/"/>
</entry>
<entry>
<title><![CDATA[棋盘覆盖问题]]></title>
<link href="http://neverjoe.com/2014/10/18/%E6%A3%8B%E7%9B%98%E8%A6%86%E7%9B%96%E9%97%AE%E9%A2%98/"/>
<id>http://neverjoe.com/2014/10/18/棋盘覆盖问题/</id>
<published>2014-10-18T08:33:51.000Z</published>
<updated>2014-10-22T15:17:32.000Z</updated>
<content type="html"><![CDATA[<p>最近交了算法课的一次作业,涉及到了棋盘覆盖问题.<br><br>一个非常经典的分治算法题目,值得回顾与总结!<br><br>具体题目可以直接百度到,下面说明一下我的解题过程.<br><br>由于老师让用分治解题,就直接套用分治的思想,将大棋盘划分为小棋盘,棋盘大小是2^k*2^k.不假思索,二分一下得到如下图的四个子棋盘<br><br><img src="http://neverjoe.qiniudn.com/chesscover1.jpg/neverjoe" alt="二分棋盘" title="二分棋盘"><br><br>划分后,于是问题来了!之前我们用分治解排序问题时,划分继续排序即可,不用处理,情形还是一致.但棋盘覆盖问题,在这点上不同了.<br>由于全盘上只有一个特殊方格不可以被覆盖,在划分后四个子棋盘中,必然出现有三个子棋盘没有特殊方格,从而不能将问题递归处理!<br><br>处理办法显然只有一个,那就是将这三个子棋盘中的一个方格覆盖掉,而且三个子棋盘中一共覆盖的三个方格恰好组成一个L型骨牌,这样问题就迎刃而解了.同时,递归处理后,普通方格可以在这个过程中都被覆盖掉.而满足覆盖分别来自三个子棋盘的三个方格并构成L型骨牌的方法很容易想到,只要L型骨牌的位置在四个子棋盘交汇处即可!<br>总结一下:</p>
<ol>
<li>将棋盘等分为四个子棋盘</li>
<li>判定各个子棋盘是否存在特殊方格.是,则直接继续递归.否,则将子棋盘中覆盖掉一个方格.这样没有特殊方格的三个子棋盘均被覆盖掉一个普通方格,并组成L型骨牌</li>
<li>对四个子棋盘继续划分,递归,直到子棋盘大小为1x1</li>
</ol>
<p>L型骨牌覆盖棋盘的示意图如下:<br><br>其中红色方格为特殊方格,黑色部分为L型骨牌填充后的情形<br><br><img src="http://neverjoe.qiniudn.com/chesscover2.jpg/neverjoe" alt=""><br></p>
<p>具体实现时,需要给出一个初始的原点方格位置,这样便于判定方位!如下图,约定棋盘的左上角方格位置为(br,bc)即(0,0).特殊方格的位置为(sr,sc).<br><br><img src="http://neverjoe.qiniudn.com/chesscover3.jpg/neverjoe" alt=""><br><br>下面是c++代码实现:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div></pre></td><td class="code"><pre><div class="line">#include<iostream></div><div class="line">using <span class="keyword">namespace</span> std;</div><div class="line"><span class="keyword">int</span> L=<span class="number">0</span>;<span class="comment">//全局数据</span></div><div class="line">const <span class="keyword">int</span> MAX=<span class="number">64</span>;<span class="comment">//默认最大棋盘</span></div><div class="line"><span class="keyword">int</span> chess_board[MAX][MAX]={};</div><div class="line"></div><div class="line"><span class="keyword">int</span> main()</div><div class="line">{</div><div class="line"> void chesscover(<span class="keyword">int</span> ,<span class="keyword">int</span> ,<span class="keyword">int</span> ,<span class="keyword">int</span> ,<span class="keyword">int</span>);</div><div class="line"> cout<<<span class="string">"please input the size of your chess board"</span><<endl;</div><div class="line"> <span class="keyword">int</span> SIZE;</div><div class="line"> cin>>SIZE;</div><div class="line"> <span class="keyword">int</span> BC=<span class="number">0</span>;</div><div class="line"> <span class="keyword">int</span> BR=<span class="number">0</span>;</div><div class="line"> cout<<<span class="string">"(0,0) stands for the grid of top left coner in your chess board"</span><<endl;</div><div class="line"> cout<<<span class="string">"please input the special grid of your chess board"</span><<endl;</div><div class="line"> <span class="keyword">int</span> SR;</div><div class="line"> <span class="keyword">int</span> SC;</div><div class="line"> cin>>SR;</div><div class="line"> cin>>SC;</div><div class="line"> chesscover(BR,BR,SR,SC,SIZE);</div><div class="line"> <span class="keyword">for</span>(<span class="keyword">int</span> i=<span class="number">0</span>;i<SIZE;i++)</div><div class="line"> <span class="keyword">for</span>(<span class="keyword">int</span> j=<span class="number">0</span>;j<SIZE;j++)</div><div class="line"> {</div><div class="line"> cout<<<span class="string">" "</span><<chess_board[i][j];</div><div class="line"> <span class="keyword">if</span>(j==SIZE-<span class="number">1</span>)</div><div class="line"> cout<<endl;</div><div class="line"> }</div><div class="line">}</div><div class="line"><span class="comment">//row行</span></div><div class="line"><span class="comment">//col列</span></div><div class="line"><span class="comment">//(br,bc)初始化为(0,0),棋盘左上角方格</span></div><div class="line"><span class="comment">//给出的(sr,sc)特殊方格</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">//由上面两个方格确定棋盘的相对方位</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">//L,第L个L型骨牌</span></div><div class="line">void chesscover(<span class="keyword">int</span> br,<span class="keyword">int</span> bc,<span class="keyword">int</span> sr,<span class="keyword">int</span> sc,<span class="keyword">int</span> <span class="keyword">size</span>)</div><div class="line">{</div><div class="line"> <span class="keyword">if</span>(<span class="keyword">size</span>==<span class="number">1</span>)</div><div class="line"> <span class="keyword">return</span>;</div><div class="line"> <span class="keyword">int</span> tmp=++L;<span class="comment">//每次进入三个else,一个if</span></div><div class="line"> <span class="keyword">size</span>/=<span class="number">2</span>;</div><div class="line"> <span class="comment">//特殊方格在左上子棋盘</span></div><div class="line"> <span class="keyword">if</span>(sr<<span class="keyword">size</span>+br&&sc<<span class="keyword">size</span>+bc)</div><div class="line"> chesscover(br,bc,sr,sc,<span class="keyword">size</span>);</div><div class="line"> <span class="keyword">else</span></div><div class="line"> {</div><div class="line"> <span class="comment">//覆盖左上子棋盘右下角的一个方格,继续递归处理该子棋盘</span></div><div class="line"> chess_board[<span class="keyword">size</span>+br-<span class="number">1</span>][<span class="keyword">size</span>+bc-<span class="number">1</span>]=tmp;</div><div class="line"> chesscover(br,bc,<span class="keyword">size</span>+br-<span class="number">1</span>,<span class="keyword">size</span>+bc-<span class="number">1</span>,<span class="keyword">size</span>);</div><div class="line"> }</div><div class="line"> <span class="comment">//特殊方格在左下子棋盘</span></div><div class="line"> <span class="keyword">if</span>(sr>=<span class="keyword">size</span>+br&&sc<<span class="keyword">size</span>+bc)</div><div class="line"> chesscover(br+<span class="keyword">size</span>,bc,sr,sc,<span class="keyword">size</span>);</div><div class="line"> <span class="keyword">else</span></div><div class="line"> {</div><div class="line"> <span class="comment">//覆盖左下子棋盘右上角的一个方格,继续递归处理该子棋盘</span></div><div class="line"> chess_board[<span class="keyword">size</span>+br][<span class="keyword">size</span>+bc-<span class="number">1</span>]=tmp;</div><div class="line"> chesscover(br+<span class="keyword">size</span>,bc,<span class="keyword">size</span>+br,<span class="keyword">size</span>+bc-<span class="number">1</span>,<span class="keyword">size</span>);</div><div class="line"> }</div><div class="line"> <span class="comment">//特殊方格在右上子棋盘</span></div><div class="line"> <span class="keyword">if</span>(sr<<span class="keyword">size</span>+br&&sc>=<span class="keyword">size</span>+bc)</div><div class="line"> chesscover(br,bc+<span class="keyword">size</span>,sr,sc,<span class="keyword">size</span>);</div><div class="line"> <span class="keyword">else</span></div><div class="line"> {</div><div class="line"> <span class="comment">//覆盖右上子棋盘左下角的一个方格,继续递归处理该子棋盘</span></div><div class="line"> chess_board[<span class="keyword">size</span>+br-<span class="number">1</span>][<span class="keyword">size</span>+bc]=tmp;</div><div class="line"> chesscover(br,bc+<span class="keyword">size</span>,<span class="keyword">size</span>+br-<span class="number">1</span>,<span class="keyword">size</span>+bc,<span class="keyword">size</span>);</div><div class="line"> }</div><div class="line"> <span class="comment">//特殊方格在右下子棋盘</span></div><div class="line"> <span class="keyword">if</span>(sr>=<span class="keyword">size</span>+br&&sc>=<span class="keyword">size</span>+bc)</div><div class="line"> chesscover(br+<span class="keyword">size</span>,bc+<span class="keyword">size</span>,sr,sc,<span class="keyword">size</span>);</div><div class="line"> <span class="keyword">else</span></div><div class="line"> {</div><div class="line"> <span class="comment">//覆盖右下子棋盘左上角的一个方格,继续递归处理该子棋盘</span></div><div class="line"> chess_board[<span class="keyword">size</span>+br][<span class="keyword">size</span>+bc]=tmp;</div><div class="line"> chesscover(<span class="keyword">size</span>+br,<span class="keyword">size</span>+bc,<span class="keyword">size</span>+br,<span class="keyword">size</span>+bc,<span class="keyword">size</span>);</div><div class="line"> }</div><div class="line">}</div></pre></td></tr></table></figure>
]]></content>
<summary type="html">
<![CDATA[<p>最近交了算法课的一次作业,涉及到了棋盘覆盖问题.<br><br>一个非常经典的分治算法题目,值得回顾与总结!<br><br>具体题目可以直接百度到,下面说明一下我的解题过程.<br><br>由于老师让用分治解题,就直接套用分治的思想,将大棋盘划分为小棋盘,棋盘大小是2^k*]]>
</summary>
<category term="算法与数据结构" scheme="http://neverjoe.com/tags/%E7%AE%97%E6%B3%95%E4%B8%8E%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/"/>
<category term="学习笔记" scheme="http://neverjoe.com/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title><![CDATA[使用七牛做图床]]></title>
<link href="http://neverjoe.com/2014/10/17/%E4%BD%BF%E7%94%A8%E4%B8%83%E7%89%9B%E5%81%9A%E5%9B%BE%E5%BA%8A/"/>
<id>http://neverjoe.com/2014/10/17/使用七牛做图床/</id>
<published>2014-10-17T04:02:49.000Z</published>
<updated>2014-10-17T09:44:17.000Z</updated>
<content type="html"><![CDATA[<p>准备写自主博客了,第三方imgbed看来是必备的.有了图床还是可以带来很多好处的,比如节省空间,便于编辑与管理,<br>加快网页访问速度等等<br><br>图床可以自己架设,前提是有主机有空间,国内外都行,不过考虑国内访问速度,在天朝弄个主机肯定会快的…<br>目前蓬勃发展云服务解决了很多问题,某些云服务商提供了图床服务,比如阿里云的oss,前面六个月免费,壕公司值得信赖!<br>最近火起来的<a href="https://portal.qiniu.com/signup?code=3lewblh9ozbrm" target="_blank" rel="external">七牛</a>也是相当不错的,免费用户还是有一些流量的.<br><br>进入七牛官网<a href="https://portal.qiniu.com/signup?code=3lewblh9ozbrm" target="_blank" rel="external">点我!</a> 注册激活后为体验用户,免费流量有限制,上传身份验证<br>(不得不说,对我来说这是一个梗.)后变为标准用户,就可以享受全部的免费流量了,10G对于小站来说还是不错的!在七牛建立一个公有空间后,上传图片即可支持外链!而且七牛还提供了一些其他非常好的服务,例如可以使用七牛的镜像存储对源站资源(文件/图片等)进行存储,可以对静态博客进行加速!<br>同时,七牛的数据处理功能,还可以处理图片,例如加水印,防盗链等等,说缺点的话.就是如果想绑定自己的域名需要备案,对于在狗爹上买域名的还是绕行吧,这么好的功能不能用,心塞阿!<br><br>配个七牛的内容管理界面,外链地址在右下角...<br><img src="http://neverjoe.qiniudn.com/qiniu.png" alt="使用七牛图床" title="使用七牛做图床"><br><br>最后总结一下:<br><br><a href="https://portal.qiniu.com/signup?code=3lewblh9ozbrm" target="_blank" rel="external">七牛</a>,不仅仅可以图床!</p>
]]></content>
<summary type="html">
<![CDATA[<p>准备写自主博客了,第三方imgbed看来是必备的.有了图床还是可以带来很多好处的,比如节省空间,便于编辑与管理,<br>加快网页访问速度等等<br><br>图床可以自己架设,前提是有主机有空间,国内外都行,不过考虑国内访问速度,在天朝弄个主机肯定会快的…<br>目前蓬勃发展]]>
</summary>
<category term="Hexo" scheme="http://neverjoe.com/tags/Hexo/"/>
<category term="学习笔记" scheme="http://neverjoe.com/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title><![CDATA[github学生套件获取digitalocean vps优惠]]></title>
<link href="http://neverjoe.com/2014/10/14/%E5%88%A9%E7%94%A8github%E5%AD%A6%E7%94%9F%E5%A5%97%E4%BB%B6%E8%8E%B7%E5%8F%96digitalocean-vps%E4%BC%98%E6%83%A0/"/>
<id>http://neverjoe.com/2014/10/14/利用github学生套件获取digitalocean-vps优惠/</id>
<published>2014-10-13T16:01:22.000Z</published>
<updated>2014-11-19T08:25:37.000Z</updated>
<content type="html"><![CDATA[<p>最近github放出了对学生的大量优惠政策,下面就教大家怎么利用手上的edu邮箱获取do的100美元优惠码.</p>
<ol>
<li>有github账号的可以直接添加一个edu邮箱,没有的就用edu邮箱注册一个github账号.<a href="https://github.com/join" target="_blank" rel="external">注册猛戳这里</a></li>
<li>邮箱认证完毕有,<a href="https://education.github.com/pack" target="_blank" rel="external">继续猛戳这里</a>,点击get your pack,然后yes,接着进入信息填写界面,<br>选择你的edu邮箱申请student pack,简要填写后,就可以欢乐地提交申请了.github会通知你一个周内处理你的申请.</li>
<li>此时已经不用苦等,回到<a href="https://education.github.com/pack" target="_blank" rel="external">https://education.github.com/pack</a>, 猛击Get your pack,在下面的offers里面找到do,do的100优惠码到手一半了 </li>
<li>申请do的账号<a href="https://cloud.digitalocean.com/registrations/new" target="_blank" rel="external">猛戳!!!</a></li>
<li>申请验证完后,找到prom code处输入你的github提供的prom code.100美元到你的账号里面了!</li>
<li>do需要使用信用卡或者paypal,存入5美元激活账号!建议使用paypal,下面会说明原因.<br></li>
</ol>
<p>tips:</p>
<ol>
<li>在github student pack申请界面不要手贱进入requst a discount界面并提交申请!不然你的mac地址被锁定,github会默认你不是学生,直到你的请求被处理,<br>你的申请student pack界面一直会跳转到requst a discount界面!</li>
<li>github student pack有了或者添加了edu邮箱再申请,不要尝试上传照片等方法!</li>
<li>do会根据你信用卡绑定的do账号判别你是否有欺诈行为,被判定欺诈后果删do号!</li>
<li>一个do账号只能使用一次github student pack优惠码,lz亲身测…</li>
</ol>
]]></content>
<summary type="html">
<![CDATA[<p>最近github放出了对学生的大量优惠政策,下面就教大家怎么利用手上的edu邮箱获取do的100美元优惠码.</p>
<ol>
<li>有github账号的可以直接添加一个edu邮箱,没有的就用edu邮箱注册一个github账号.<a href="https://githu]]>
</summary>
<category term="vps" scheme="http://neverjoe.com/tags/vps/"/>
<category term="学习笔记" scheme="http://neverjoe.com/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title><![CDATA[github+gitcafe+hexo搭建博客笔记]]></title>
<link href="http://neverjoe.com/2014/10/09/github-gitcafe-hexo%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2%E7%AC%94%E8%AE%B0/"/>
<id>http://neverjoe.com/2014/10/09/github-gitcafe-hexo搭建博客笔记/</id>
<published>2014-10-09T12:27:16.000Z</published>
<updated>2015-09-08T02:28:42.000Z</updated>
<content type="html"><![CDATA[<h2 id="github与gitcafe_rsa公钥">github与gitcafe rsa公钥</h2>
<p>按照<a href="https://help.github.com/articles/generating-ssh-keys/" target="_blank" rel="external">官方的文档</a>,生成rsa公钥,可以同时给github与gitcafe(需要账号信息一致)使用.<br><br>使用git提交时可能会出现Error: Permission denied (publickey)错误,但使用’’’ssh -vT git@github.com’’’时可能是因为生成ssh rsa时没有使用sudo,而使用git时若使用sudo了,则调用/root/下的rsa公钥.<br>解决方案:使用sudo生成rsa公钥!详解可以参考<a href="https://help.github.com/articles/error-permission-denied-publickey/" target="_blank" rel="external">官网文档</a><br></p>
<h2 id="github与gitcafe_pages使用">github与gitcafe pages使用</h2>
<p>把博客部署到github与gitcafe上这样就免去了购置vps的费用!<br><br>github与gitcafe部署上略有差别</p>
<ol>
<li>github上建立一个yourid.github.com的repo,而gitcafe为yourid.</li>
<li>branch没有现在,而gitcafe上必须为gitcafe-pages</li>
<li>gitcafe自定义域名的方式绑定域名,而github需要一个CNAME文件.同时gitcafe还支持多域名绑定.<br></li>
</ol>
<p>下面是gitcafe部署方法:<br></p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">cd yourid/pages</div><div class="line">git init</div><div class="line">git <span class="keyword">add</span> .</div><div class="line">git remote <span class="keyword">add</span> origin git@gitcafe.com:yourid/yourid.git</div><div class="line">git checkout -b gitcafe-pages</div><div class="line">git <span class="keyword">push</span> origin gitcafe-pages</div></pre></td></tr></table></figure>
<h2 id="Hexo_使用">Hexo 使用</h2>
<ol>
<li>多次渲染生成静态博客时,使用</li>
</ol>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="title">hexo</span> clean</div></pre></td></tr></table></figure>
<ol>
<li>出现提交问题时,使用</li>
</ol>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="title">rm</span> -rf .deploy/</div></pre></td></tr></table></figure>
<ol>
<li>使用复合命令</li>
</ol>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line"><span class="comment">hexo</span> <span class="comment">g</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">d</span></div><div class="line"><span class="comment">hexo</span> <span class="comment">s</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">g</span></div></pre></td></tr></table></figure>
<h2 id="域名及dns">域名及dns</h2>
<p>域名:</p>
<ol>
<li>上<a href="www.godaddy.com">godaddy</a>买域名</li>
<li>在狗爹上只是买了域名服务,想加速国内访问,还得弄个国内的dns服务.我用的<a href="https://yunjiasu.baidu.com" target="_blank" rel="external">百度云加速</a> </li>
<li>让搜索引擎发现你的博客-<a href="http://zhanzhang.baidu.com/sitesubmit/index" target="_blank" rel="external">baidu网址提交</a>,<a href="https://www.google.com/webmasters/tools/submit-url?pli=1" target="_blank" rel="external">google网址提交</a></li>
<li>图床,必须使用<a href="https://portal.qiniu.com/signup?code=3lewblh9ozbrm" target="_blank" rel="external">七牛</a>.免费10G</li>
</ol>
<p>dns设置建议:</p>
<ol>
<li>默认设置为gitcafe</li>
<li>国外设置为github</li>
<li>添加一些单独的运营商线路加速访问.</li>
</ol>
]]></content>
<summary type="html">
<![CDATA[<h2 id="github与gitcafe_rsa公钥">github与gitcafe rsa公钥</h2>
<p>按照<a href="https://help.github.com/articles/generating-ssh-keys/" target="_blank"]]>
</summary>
<category term="Hexo" scheme="http://neverjoe.com/tags/Hexo/"/>
<category term="学习笔记" scheme="http://neverjoe.com/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
<entry>
<title><![CDATA[my-markdown-syntax]]></title>
<link href="http://neverjoe.com/2014/10/01/my-markdown-syntax/"/>
<id>http://neverjoe.com/2014/10/01/my-markdown-syntax/</id>
<published>2014-09-30T19:17:29.000Z</published>
<updated>2015-03-10T18:40:34.000Z</updated>
<content type="html"><![CDATA[<h2 id="二级标题">二级标题</h2>
<p>最多支持6级标题!由#数量决定<br></p>
<h2 id="段落与换行">段落与换行</h2>
<p>一个空格以上加一个换行符就换行了哦!<br>你看我又换行了!<br>hello kitty!<br><br>使用html< br/>标签实现换行</p>
<h2 id="文本强调">文本强调</h2>
<p><em>斜体字</em>由下划线_或者*完成<br><br><strong>粗体字</strong><br><br><strong>粗体字</strong><br><br><strong><em>粗斜体</em></strong><br></p>
<h2 id="list_列表">list 列表</h2>
<ul>
<li>这是一个无序列表,+,-,*均支持!<br></li>
</ul>
<ul>
<li>使用-</li>
</ul>
<ul>
<li>使用+<br></li>
</ul>
<ol>
<li>这是一个有序列表</li>
<li>neverjoe.com </li>
</ol>
<ul>
<li>使用+or -实现有序列表的增加</li>
</ul>
<ul>
<li>-同样可以增加<br></li>
</ul>
<p>不同列表之间需要换行后再空一行(再enter下)实现!<br><br>有时在文章开头需要用反斜杠转义屏蔽列表的出现如下:<br><br>2013.年度目标是...</p>
<h2 id="link_链接">link 链接</h2>
<h3 id="网站">网站</h3>
<p>内联方式:<br><br>使用一个[链接注释]与一个(<a href="http://example.com/" target="_blank" rel="external">http://example.com/</a>) 连在一起可以做出一个链接!<br>This is a <a href="https://github.com/neverjoe/" target="_blank" rel="external">fork me</a>.<br><a href="http://gitcafe.com/neverjoe/" target="_blank" rel="external">fork me</a>.<br><a href="http://neverjoe.com" target="_blank" rel="external">http://neverjoe.com</a> 默认识别为链接!<br><br>引用方式:<br><br>I want to go <a href="http://www.google.com/" title="google" target="_blank" rel="external">google</a> and <a href="http://www.baidu.com/" title="baidu" target="_blank" rel="external">baidu</a> to search something!</p>
<h3 id="邮箱">邮箱</h3>
<p><a href="mailto:tq0317@gmail.com">tq0317@gmail.com</a></p>
<h3 id="图片">图片</h3>
<p>内联方式:<br><br><img src="http://www.laboiteverte.fr/wp-content/uploads/2011/04/grille-point-croix-couture-geek-film-04.jpg" alt="图1" title="geekstyle"><br>引用方式:<br><br><img src="http://www.laboiteverte.fr/wp-content/uploads/2011/04/grille-point-croix-couture-geek-film-04.jpg" alt="图2" title="geekstyle"></p>
<p><img src="http://neverjoe.qiniudn.com/img1.png" alt="图3" title="qiniu"></p>
<h2 id="代码高亮">代码高亮</h2>
<p>使用缩进可以自动转换为代码块!下面是c++代码:</p>
<pre><code><span class="preprocessor">#<span class="keyword">include</span><iostream></span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="built_in">std</span>;
<span class="keyword">int</span> main()
{
<span class="built_in">cout</span><<<span class="string">"hello world!"</span><<endl;
}
</code></pre><p>单独输入某些行代码时使用```</p>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">$ <span class="built_in">sudo</span> hexo s</div><div class="line">$ <span class="built_in">sudo</span> hexo g</div><div class="line">$ <span class="built_in">sudo</span> hexo d</div></pre></td></tr></table></figure>
<hr>
<p>使用2个以上的* or -连续或者分开的可以完成水平分割!</p>
<hr>
<h2 id="反斜杠转义\">反斜杠转义\</h2>
<p>Markdown 可以利用反斜杠来插入一些在语法中有其它意义的符号,例如:如果你想要用星号加在文字旁边的方式来做出强调效果,<br>你可以在星号的前面加上反斜杠:<br><br>\<em>literal asterisks\</em><br><br>Markdown 支持以下这些符号前面加上反斜杠来帮助插入普通的符号:<br><br>\反斜杠 `反引号 *星号 _下划线 {}花括号 []方括号 ()括弧 #井字号 +加号 -减号 .英文句 !感叹号</p>
<h2 id="脚注">脚注</h2>
<p>hello<a href="hi">^hello</a></p>
<h2 id="MathJax">MathJax</h2>
<p>You can render <em>LaTeX</em> mathematical expressions using <strong>MathJax</strong>, as on <a href="http://www.google.com/" title="google" target="_blank" rel="external">math.stackexchange.com</a>:</p>
<p>The <em>Gamma function</em> satisfying $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$ is via the Euler integral</p>
<p>$$<br>\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.<br>$$</p>
<blockquote>
<p><strong>Tip:</strong> To make sure mathematical expressions are rendered properly on your website, include <strong>MathJax</strong> into your template:</p>
</blockquote>
<figure class="highlight"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="tag"><<span class="title">script</span> <span class="attribute">type</span>=<span class="value">"text/javascript"</span> <span class="attribute">src</span>=<span class="value">"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"</span>></span><span class="javascript"></span><span class="tag"></<span class="title">script</span>></span></div></pre></td></tr></table></figure>
<blockquote>
<p><strong>Note:</strong> You can find more information about <strong>LaTeX</strong> mathematical expressions <a href="http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference" target="_blank" rel="external">here</a>.</p>
</blockquote>
]]></content>
<summary type="html">
<![CDATA[<h2 id="二级标题">二级标题</h2>
<p>最多支持6级标题!由#数量决定<br></p>
<h2 id="段落与换行">段落与换行</h2>
<p>一个空格以上加一个换行符就换行了哦!<br>你看我又换行了!<br>hello kitty!<br><br>使用html]]>
</summary>
<category term="markdown" scheme="http://neverjoe.com/tags/markdown/"/>
<category term="学习笔记" scheme="http://neverjoe.com/categories/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/"/>
</entry>
</feed>