-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
795 lines (403 loc) · 27.2 KB
/
index.html
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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Patricklog</title>
<meta name="author" content="kk1fff">
<meta name="description" content="參與了幾個計畫,看一些 mailing list 裡面的作法,覺得版本控制真是一個非常有趣的事情。據說有些公司,仍然在沒有版本控制的世界裡。我很幸運,經歷過的公司都有,讓我學到很多。 版本控制的目的當然就是讓大家可以一起分享一份 source code,可以讓大家同時改自己想改的部份,可以讓 …">
<!-- http://t.co/dKP3o1e -->
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="http://blog.patrickz.net">
<link href="/favicon.png" rel="icon">
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<script src="/javascripts/modernizr-2.0.js"></script>
<script src="/javascripts/ender.js"></script>
<script src="/javascripts/octopress.js" type="text/javascript"></script>
<link href="/atom.xml" rel="alternate" title="Patricklog" type="application/atom+xml">
<!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1554201-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body >
<header role="banner"><hgroup>
<h1><a href="/">Patricklog</a></h1>
<h2>Hi, I am Patrick.</h2>
</hgroup>
</header>
<nav role="navigation"><ul class="subscription" data-subscription="rss">
<li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
</ul>
<form action="http://google.com/search" method="get">
<fieldset role="search">
<input type="hidden" name="q" value="site:blog.patrickz.net" />
<input class="search" type="text" name="q" results="0" placeholder="Search"/>
</fieldset>
</form>
<ul class="main-navigation">
<li><a href="/">Blog</a></li>
<li><a href="/blog/archives">Archives</a></li>
</ul>
</nav>
<div id="main">
<div id="content">
<div class="blog-index">
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/11/25/ban-ben-kong-zhi-yu-xie-zuo/">版本控制系統和協作模式</a></h1>
<p class="meta">
<time datetime="2012-11-25T13:21:00+08:00" pubdate data-updated="true">Nov 25<span>th</span>, 2012</time>
| <a href="/blog/2012/11/25/ban-ben-kong-zhi-yu-xie-zuo/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p><img src="http://i1162.photobucket.com/albums/q535/kk1fff/87A25E555FEB71672012-11-254E0B5348103724.png" title="'gitk 是 git 的 GUI front-end'" ></p>
<p>參與了幾個計畫,看一些 mailing list 裡面的作法,覺得版本控制真是一個非常有趣的事情。據說有些公司,仍然在沒有版本控制的世界裡。我很幸運,經歷過的公司都有,讓我學到很多。</p>
<p>版本控制的目的當然就是讓大家可以一起分享一份 source code,可以讓大家同時改自己想改的部份,可以讓 release 和 develop 的人從某一個時間點開始分開不同的路徑,release 可以專心讓
release 版本變得穩定。也可以在 release 完成後把他們並回主幹。順道一題,媒體常常會在某
W 開頭的作業系統出了以後,就說下一版的已經在開發,我想大家都知道這根本就是廢話,main trunk
本來就是一直走下去的。</p>
<p>廢話不多說。我遇到的第一套工具(自己唸書時用的 SVN 不算),叫做 perforce。Perforce 是一套商業版的版本控制系統。他是所謂集中式的版本控制。而且公司內部的管理邏輯算是簡單。也就是說,你改了一下,就 check-in 了。我在第一次上 code 的時候就把 main trunk 弄 build fail(汗),主要是因為我犯了個明顯的錯誤,但因為缺法 review 的過程,所以沒有人發現。</p>
<p>此外,基於版本管理系統的運作都相當的複雜,通常,除了一個好的客戶端工具(包括 GUI 和指令介面),還需要一些好的 Guide。Open source 的版本控制系統在網路上已經有很多,而 perforce 不是。因此少了社群高手對 perforce 的講解和推廣,獲取資訊的來源少了很多。甚至有人只把 perforce
當成是 ftp 抓 code 來用,基於又慢又不熟悉的環境,我一點也不驚訝。</p>
</div>
<footer>
<a rel="full-article" href="/blog/2012/11/25/ban-ben-kong-zhi-yu-xie-zuo/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/10/14/ji-lu-yi-xia-tmux/">紀錄一下 Tmux</a></h1>
<p class="meta">
<time datetime="2012-10-14T00:02:00+08:00" pubdate data-updated="true">Oct 14<span>th</span>, 2012</time>
| <a href="/blog/2012/10/14/ji-lu-yi-xia-tmux/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>最近真是用 Tmux 用上癮了,好棒的東西!以前很少用 screen,也不是說 screen 不好,但對於
screen 分割視窗的方法不是很熟悉。另外,screen 使用 ctrl+a 來下指令,和 emacs 的指令衝突,我不是很喜歡改預設設定,除非我真的無法習慣又非用不可。就因此,我選了 tmux。</p>
<p>在 Mac 上安裝 tmux 和 ubuntu 上面一樣簡單。</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='sh'><span class='line'>brew install tmux <span class="c"># Mac</span>
</span><span class='line'>sudo apt-get install tmux <span class="c"># Ubuntu</span>
</span></code></pre></td></tr></table></div></figure>
</div>
<footer>
<a rel="full-article" href="/blog/2012/10/14/ji-lu-yi-xia-tmux/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/07/12/c-plus-plus-regular-expression/">C++ Regular Expression</a></h1>
<p class="meta">
<time datetime="2012-07-12T17:54:00+08:00" pubdate data-updated="true">Jul 12<span>th</span>, 2012</time>
| <a href="/blog/2012/07/12/c-plus-plus-regular-expression/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>用過 Python 以後,就會深深愛上 Python 那強大的 Regex parsing 能力。回過頭來,對於 C++ parsing 的功能,我還停留在 scanf 和 >> 這兩個基本到到不行的功能,聽說 C++11 有加入了 Regular Expression 的功能。就順便來研究一下,希望 C++ 能夠有足以和 Perl 或 Python 那個家族的 Parsing 能力。</p>
<p>原本希望用 clang 3.1 來編譯,但是遇到</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='cpp'><span class='line'><span class="cp">#include <regex></span>
</span></code></pre></td></tr></table></div></figure>
<p>就掛了,顯然 based library 還沒 Ready。改用 g++-4.7 就過了,可是,一切沒那麼容易,我不管建立任何 Regular expression 都會被丟出例外,連 wikipedia 上面的範例都噴射,最後只好放棄。考慮到 C++11 的 regex 是來自 boost,乾脆直接拿 boost 來用。</p>
</div>
<footer>
<a rel="full-article" href="/blog/2012/07/12/c-plus-plus-regular-expression/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/06/03/zai-mac-shang-mian-build-gcc-4-dot-7/">在 Mac 上面 Build GCC 4.7</a></h1>
<p class="meta">
<time datetime="2012-06-03T02:02:00+08:00" pubdate data-updated="true">Jun 3<span>rd</span>, 2012</time>
| <a href="/blog/2012/06/03/zai-mac-shang-mian-build-gcc-4-dot-7/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>Homebrew 和 Macports 不相容,所以只能選一個。不過 Homebrew 追 gcc 的版本似乎是很慢。也因此,想要體驗 C++ 11 只有靠自己。還好,build GCC 的指令並不難,但是卻有一些小小的眉角。</p>
<h3>下載檔案</h3>
<p>依據 GCC 的網頁,安裝 GCC 除了需要下載 GCC Source Code 以外,還需要下載 GMP、MPFR
和 MPC 三個套件。這些東西除了 MPC 以外,其他都可以在高速電腦中心的 FTP 下載到。</p>
<p>下載 GCC 原始碼</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>wget ftp://ftp.twaren.net/Unix/GNU/gnu/gcc/gcc-4.7.0/gcc-4.7.0.tar.bz2
</span><span class='line'>tar jxf gcc-4.7.0.tar.bz2
</span><span class='line'>mv gcc-4.7.0 gcc
</span></code></pre></td></tr></table></div></figure>
<p>下載附加套件,然後把這些套件放進 GCC 原始碼資料夾下,並且把資料夾的版號去掉,這樣 GCC
就可以搜尋到這些套件,不需要在 configure 下面設定</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nb">cd </span>gcc
</span><span class='line'>wget ftp://ftp.twaren.net/Unix/GNU/gnu/gmp/gmp-5.0.5.tar.bz2
</span><span class='line'>tar jxf gmp-5.0.5.tar.bz2
</span><span class='line'>mv gmp-5.0.5 gmp
</span><span class='line'>wget ftp://ftp.twaren.net/Unix/GNU/gnu/mpfr/mpfr-3.1.0.tar.bz2
</span><span class='line'>tar mpfr-3.1.0.tar.bz2
</span><span class='line'>mv mpfr-3.1.0 mpfr
</span><span class='line'>wget http://www.multiprecision.org/mpc/download/mpc-0.9.tar.gz
</span><span class='line'>tar zxf mpc-0.9.tar.gz
</span><span class='line'>mv mpc-0.9 mpc
</span></code></pre></td></tr></table></div></figure>
</div>
<footer>
<a rel="full-article" href="/blog/2012/06/03/zai-mac-shang-mian-build-gcc-4-dot-7/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/26/qian-fa-tls-ping-zheng/">簽發 TLS 憑證</a></h1>
<p class="meta">
<time datetime="2012-05-26T04:39:00+08:00" pubdate data-updated="true">May 26<span>th</span>, 2012</time>
| <a href="/blog/2012/05/26/qian-fa-tls-ping-zheng/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>使用 SSL 真的是個痛苦的過程,最麻煩的部份莫過於憑證。SSL 除了保障資料不被竊聽以外,還會保障
Server 沒有被調包。為了作這件事情,瀏覽器透過一系列的方法去確定這個 Server 真的就是字面上打的那個 Server。</p>
<p>瀏覽器如何檢查呢?首先,瀏覽器內建有許多根憑證,這些根憑證憑證商自己簽發給自己的憑證,他的保證來自於使用者對於瀏覽器廠商的信任,所以我們假設這些憑證都是可被相信的,會一直強調信任是因為這些根憑證是之後驗證其他憑證的基礎,所以我們如果不相信他,那其他的驗證也別說了。當我們嘗試連線到一個網站時,瀏覽器會對這個網站作 SSL Handshake,建立 session layer
的連線。這個連線位於 TCP 和 HTTP 之間,可以把他當作是一個安全的可信賴連線。在 SSL
Handshark 的時候,瀏覽器會從 Server 下載 Server 憑證和 Server 的 CA 憑證。這兩個憑證用來建立所謂的 trust chain。</p>
</div>
<footer>
<a rel="full-article" href="/blog/2012/05/26/qian-fa-tls-ping-zheng/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/21/c-he-c-plus-plus-de-callback/">C 和 C++ 的 Callback</a></h1>
<p class="meta">
<time datetime="2012-05-21T11:58:00+08:00" pubdate data-updated="true">May 21<span>st</span>, 2012</time>
| <a href="/blog/2012/05/21/c-he-c-plus-plus-de-callback/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><h3>C 的 Callback</h3>
<p>Callback 把函數當成指標,在 C 裡面是這樣用</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
</pre></td><td class='code'><pre><code class='c'><span class='line'><span class="cp">#include <stdio.h></span>
</span><span class='line'>
</span><span class='line'><span class="kt">int</span> <span class="nf">compute</span><span class="p">(</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">,</span> <span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">op</span><span class="p">)(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">))</span> <span class="p">{</span>
</span><span class='line'> <span class="k">return</span> <span class="p">(</span><span class="o">*</span><span class="n">op</span><span class="p">)(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">);</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="kt">int</span> <span class="nf">add</span><span class="p">(</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'> <span class="k">return</span> <span class="n">a</span><span class="o">+</span><span class="n">b</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="kt">int</span> <span class="nf">sub</span><span class="p">(</span><span class="kt">int</span> <span class="n">a</span><span class="p">,</span> <span class="kt">int</span> <span class="n">b</span><span class="p">)</span> <span class="p">{</span>
</span><span class='line'> <span class="k">return</span> <span class="n">a</span><span class="o">-</span><span class="n">b</span><span class="p">;</span>
</span><span class='line'><span class="p">}</span>
</span><span class='line'>
</span><span class='line'><span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class='line'> <span class="n">fprintf</span><span class="p">(</span><span class="n">stdout</span><span class="p">,</span> <span class="s">"add: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">compute</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">&</span><span class="n">add</span><span class="p">));</span>
</span><span class='line'> <span class="n">fprintf</span><span class="p">(</span><span class="n">stdout</span><span class="p">,</span> <span class="s">"sub: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">compute</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="o">&</span><span class="n">sub</span><span class="p">));</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>
<p>宣告時包含函數雛型,用 * 來宣告</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='c'><span class='line'><span class="kt">int</span> <span class="p">(</span><span class="o">*</span><span class="n">op</span><span class="p">)</span> <span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">int</span><span class="p">)</span>
</span></code></pre></td></tr></table></div></figure>
</div>
<footer>
<a rel="full-article" href="/blog/2012/05/21/c-he-c-plus-plus-de-callback/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/20/hello-world-to-b2g/">Hello World to B2G</a></h1>
<p class="meta">
<time datetime="2012-05-20T00:25:00+08:00" pubdate data-updated="true">May 20<span>th</span>, 2012</time>
| <a href="/blog/2012/05/20/hello-world-to-b2g/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p><img class="center" src="http://i1162.photobucket.com/albums/q535/kk1fff/b2g_lock.png"></p>
<p>今天趁 JSDC 一股熱忱,決定來練習一個 B2G App。</p>
<h3>Hello Gaia</h3>
<p>建立 B2G App 首先要當然是要替檔案建立資料夾,我直接建立在 Gaia/apps 底下,開一個 hello 資料夾,再來建立的是 mainfest.json,依據 <a href="https://developer.mozilla.org/en/Apps/Manifest">App manifest</a>
網頁上的描述,這個檔案至少有 name 和 description 要寫,類似這樣</p>
<figure class='code'><figcaption><span>manifest.json </span></figcaption>
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="p">{</span>
</span><span class='line'> <span class="s2">"name"</span> <span class="o">:</span> <span class="s2">"hello world"</span><span class="p">,</span>
</span><span class='line'> <span class="s2">"version"</span> <span class="o">:</span> <span class="s2">"0.0.1"</span><span class="p">,</span>
</span><span class='line'> <span class="s2">"description"</span> <span class="o">:</span> <span class="s2">"this is hello"</span>
</span><span class='line'><span class="p">}</span>
</span></code></pre></td></tr></table></div></figure>
</div>
<footer>
<a rel="full-article" href="/blog/2012/05/20/hello-world-to-b2g/">Read on →</a>
</footer>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/18/lai-ji-lu-%5B%3F%5D-xia-zen-mo-yong-octopress-hao-liao/">來紀錄一下怎麼用 Octopress 好了</a></h1>
<p class="meta">
<time datetime="2012-05-18T01:25:00+08:00" pubdate data-updated="true">May 18<span>th</span>, 2012</time>
| <a href="/blog/2012/05/18/lai-ji-lu-%5B%3F%5D-xia-zen-mo-yong-octopress-hao-liao/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>新增一篇文章</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nv">$ </span>bundle <span class="nb">exec </span>rake new_post<span class="o">[</span><span class="s1">'文章的標題'</span><span class="o">]</span>
</span></code></pre></td></tr></table></div></figure>
<p>在本機預覽</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nv">$ </span>bundle <span class="nb">exec </span>rake preview
</span></code></pre></td></tr></table></div></figure>
<p>發佈出去</p>
<figure class='code'> <div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="nv">$ </span>bundle <span class="nb">exec </span>rake generate
</span><span class='line'><span class="nv">$ </span>bundle <span class="nb">exec </span>rake deploy
</span></code></pre></td></tr></table></div></figure>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/18/blog-jia-hao-yi-hou/">Blog 架好以後</a></h1>
<p class="meta">
<time datetime="2012-05-18T01:15:00+08:00" pubdate data-updated="true">May 18<span>th</span>, 2012</time>
| <a href="/blog/2012/05/18/blog-jia-hao-yi-hou/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>也不知道要寫什麼 XD
架的這麼辛苦耶</p>
</div>
</article>
<article>
<header>
<h1 class="entry-title"><a href="/blog/2012/05/13/xin-blog-kai-zhang/">新 Blog 開張</a></h1>
<p class="meta">
<time datetime="2012-05-13T00:48:00+08:00" pubdate data-updated="true">May 13<span>th</span>, 2012</time>
| <a href="/blog/2012/05/13/xin-blog-kai-zhang/#disqus_thread">Comments</a>
</p>
</header>
<div class="entry-content"><p>這次選用 Octopress 當作 Blog backend,真是經歷波折啊,全然不同的體驗。Octopress 不像以前用 blogspot,有漂亮的 UI 來設定網頁。他是用 markdown 撰寫,用 Ruby 去整理所有的樣板,在產生出靜態網頁,發布到網站。網站可以用 github page 來 host,搭配私有域名,可以真的弄出一個「很有個人味道」的 blog。</p>
<p>只是為了要設定樣板,也真是折騰。尤其我不會 scss,幾乎沒辦法做事,上網去爬了一堆文,才找到方法在我的標題列上面放上背景。不過看到了精美的程式碼區塊,也覺得這應該還算是值得啦 XD。</p>
<p>接下來還要弄 Google adsense 和 Google Analytics,就慢慢來。希望這個 Blog 可以使用順利。</p>
</div>
</article>
<div class="pagination">
<a href="/blog/archives">Blog Archives</a>
</div>
</div>
<aside class="sidebar">
<section>
<h1>Patrick Wang</h1>
<img src="/images/patrick.jpg">
<ul>
<li>習慣用 kk1fff 當 ID。寫軟體的,熟悉的語言是 C++ 和 Javascript,喜歡用鍵盤操作電腦,用的電腦一定要有
UNIX Console,所以我有 Mac 和 Linux,但沒有 Windows。興趣跟一般軟體人一樣:做有趣的東西。偶爾喜歡拿單眼假裝很厲害的拍拍照。當
Blog 需要貼照片的時候卻連一張大頭貼都找不到。</li>
<li><a href="http://www.facebook.com/p1234">我的 Facebook</a></li>
<li><a href="http://about.me/kk1fff">我的 About.me</a></li>
</ul>
</section>
<section>
<h1>Recent Posts</h1>
<ul id="recent_posts">
<li class="post">
<a href="/blog/2012/11/25/ban-ben-kong-zhi-yu-xie-zuo/">版本控制系統和協作模式</a>
</li>
<li class="post">
<a href="/blog/2012/10/14/ji-lu-yi-xia-tmux/">紀錄一下 tmux</a>
</li>
<li class="post">
<a href="/blog/2012/07/12/c-plus-plus-regular-expression/">C++ Regular Expression</a>
</li>
<li class="post">
<a href="/blog/2012/06/03/zai-mac-shang-mian-build-gcc-4-dot-7/">在 Mac 上面 Build GCC 4.7</a>
</li>
<li class="post">
<a href="/blog/2012/05/26/qian-fa-tls-ping-zheng/">簽發 TLS 憑證</a>
</li>
</ul>
</section>
<section>
<h1>Links</h1>
<ul>
<li><a href="http://0xf8c3b00k.github.com/0xf8c3b00k/">0xf8c3b00k</a></li>
</ul>
</section>
<section>
<h1>Support</h1>
<script type="text/javascript"><!--
google_ad_client = "ca-pub-2590423290671103";
/* blog in patrickz */
google_ad_slot = "1263177702";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</section>
</aside>
</div>
</div>
<footer role="contentinfo"><p>
Copyright © 2012 - kk1fff -
<span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
</p>
</footer>
<script type="text/javascript">
var disqus_shortname = 'patricklog';
var disqus_script = 'count.js';
(function () {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}());
</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#appId=212934732101925&xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>