<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1335223439738232182</id><updated>2020-02-29T16:17:47.770+08:00</updated><category term="php"/><category term="android"/><category term="Java"/><category term="MySQL"/><category term="BuildConfig"/><category term="CentOS"/><category term="Collection"/><category term="EditText"/><category term="FFmpeg"/><category term="Map"/><category term="Ngram"/><category term="PackageInfo"/><category term="QR code"/><category term="Serializable"/><category term="activity"/><category term="apache"/><category term="appserv"/><category term="composer"/><category term="facebook"/><category term="fontscale"/><category term="fragment"/><category term="header"/><category term="http"/><category term="imeOptions"/><category term="infowindow"/><category term="intent"/><category term="ionic"/><category term="jQuery"/><category term="javascript"/><category term="json"/><category term="laravel"/><category term="onCreateOptionsMenu"/><category term="phpize"/><category term="simpleXML"/><category term="sql"/><category term="webview"/><title type='text'>資訊手札</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>41</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-7046914943134031661</id><published>2017-06-19T11:57:00.001+08:00</published><updated>2017-06-19T12:01:05.357+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><title type='text'>Ubuntu上的MySQL出現Can&#39;t create/write to file</title><summary type="text">最近遇到一個問題如下：

/usr/sbin/mysqld: Can&#39;t create/write to file &#39;/mysqltmp/ibXc3yTC&#39; (Errcode: 13)
170619  3:32:30  InnoDB: Error: unable to create temporary file; errno: 13
170619  3:32:30 [ERROR] Plugin &#39;InnoDB&#39; init function returned error.
170619  3:32:30 [ERROR] Plugin &#39;InnoDB&#39; registration as a STORAGE ENGINE failed.
170619  3:32:30 [ERROR] Unknown/unsupported storage engine: InnoDB
170619  3:32:</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/7046914943134031661/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2017/06/ubuntumysqlcant-createwrite-to-file.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7046914943134031661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7046914943134031661'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2017/06/ubuntumysqlcant-createwrite-to-file.html' title='Ubuntu上的MySQL出現Can&#39;t create/write to file'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3618411319015553005</id><published>2016-05-25T17:57:00.001+08:00</published><updated>2016-05-25T17:58:04.912+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>AndroidManifest的小技巧</title><summary type="text">當在設定推播時，在 AndroidManifest.xml 上需要指定不同application id時該怎麼辦呢？（可能會有xxx.yyy.com.debug與xxx.yyy.com兩個版本）
有個簡單的小技巧可以實現這件事情。
&lt;!-- HTML generated using hilite.me --&gt;

&lt;permission android:name=&quot;${applicationId}.permission.C2D_MESSAGE&quot;
        android:protectionLevel=&quot;signature&quot; /&gt;
&lt;uses-permission android:name=&quot;${applicationId}.permission.C2D_MESSAGE&quot; /&gt;



參考資料：Using build types in Gradle to run same app </summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3618411319015553005/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/05/androidmanifest.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3618411319015553005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3618411319015553005'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/05/androidmanifest.html' title='AndroidManifest的小技巧'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-2812758191145629946</id><published>2016-04-20T22:36:00.000+08:00</published><updated>2016-10-11T11:10:33.918+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><title type='text'>Android 6.0 權限問題</title><summary type="text">因為總總原因，直到現在才重視這個問題



首先根據 官方文件所述：

在Android 6.0 (API level 23) 之後分成兩種權限


一般權限（Normal permissions）
危險權限（Dangerous permissions）


列出危險權限的列表



Permission GroupPermissions
CALENDAR
READ_CALENDAR


WRITE_CALENDAR


CAMERA
CAMERA


CONTACTS
READ_CONTACTS
WRITE_CONTACTS
GET_ACCOUNTS


LOCATION
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION


MICROPHONE
RECORD_AUDIO


PHONE
READ_PHONE_STATE
CALL_PHONE
</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/2812758191145629946/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/04/android-60.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/2812758191145629946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/2812758191145629946'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/04/android-60.html' title='Android 6.0 權限問題'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-7313984155527572055</id><published>2016-04-16T15:34:00.003+08:00</published><updated>2016-04-16T15:35:45.839+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Android 檢查GPS</title><summary type="text">首先要記得有取得GPS的權限

&lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;



才能檢查GPS有無開啟的狀態

public boolean isGPSEnables () {
    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}



純粹紀錄一下檢查GPS有無開啟的程式碼~
</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/7313984155527572055/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/04/android-gps.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7313984155527572055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7313984155527572055'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/04/android-gps.html' title='Android 檢查GPS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-8797689226023638112</id><published>2016-03-24T20:40:00.002+08:00</published><updated>2016-03-24T20:40:20.059+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java Semaphore 用途</title><summary type="text">老實說，這是第一次接觸到 Semaphore
之前也從來沒使用過，但當使用到他的時候才發現
在多執行緒時的控制，如果想要在某個情況下一次只執行一個執行緒（其實就是想做Lock動作）
Semaphore 可以省下許多事情啊！以下列出簡單的範例code
&lt;!-- HTML generated using hilite.me --&gt;

protected Semaphore isLock = new Semaphore(1); // 限制同時只有1個在執行
...
new Thread(new Runnable() {
    @Override
    public void run() {
        try {
            for (int i = 0 ; i &lt; 5 ; i++) {
                isLock.acquire(); // 會先印出</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/8797689226023638112/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/03/java-semaphore.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8797689226023638112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8797689226023638112'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/03/java-semaphore.html' title='Java Semaphore 用途'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-7701420416508919700</id><published>2016-03-23T22:44:00.001+08:00</published><updated>2016-04-21T10:55:41.430+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="QR code"/><title type='text'>Android 呼叫 zxing QR code scanner</title><summary type="text">今天弄個簡單的範例是關於執行QR code掃描的部分
這個方法是直接呼叫 Barcode scanner 的方法

首先在 build.gradle 的 dependencies 加上 compile &#39;com.google.zxing:android-integration:3.2.1&#39;

dependencies {
    ...
    compile &#39;com.google.zxing:android-integration:3.2.1&#39;
}




呼叫的方式則是在 Activity or Fragment 中加入執行的程式
&lt;!-- HTML generated using hilite.me --&gt;

IntentIntegrator scanner = new IntentIntegrator(mActivity);
scanner.initiateScan();


</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/7701420416508919700/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/03/android-zxing-qr-code-scanner.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7701420416508919700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/7701420416508919700'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2016/03/android-zxing-qr-code-scanner.html' title='Android 呼叫 zxing QR code scanner'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-1213339308396310252</id><published>2015-06-05T20:26:00.003+08:00</published><updated>2016-04-21T10:56:04.355+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="facebook"/><title type='text'>Android開啟Facebook App</title><summary type="text">如果手機裡已經安裝了Facebook，為什麼還要開啟瀏覽器重新輸入帳密呢？
直接用Facebook操作不是比較方便呢？
--以上是前言--XD

所以為了方便已經安裝Facebook使用者，所以App裡開啟粉絲專頁時，應該會有兩種方式
範例如下：

&lt;!-- HTML generated using hilite.me --&gt;

...
    public static void openFacebookPage(Context context, String id) {
        Intent intent = null;
        try {
            context.getPackageManager().getPackageInfo(&quot;com.facebook.katana&quot;, 0);
            String uri = &quot;fb://</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/1213339308396310252/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/06/androidfacebook-app.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/1213339308396310252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/1213339308396310252'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/06/androidfacebook-app.html' title='Android開啟Facebook App'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-162665525894131942</id><published>2015-05-14T00:38:00.001+08:00</published><updated>2015-05-14T00:40:14.144+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="webview"/><title type='text'>Android webview 平板瀏覽手機頁面</title><summary type="text">在使用平板瀏覽網頁時，卻發現顯示一般的網頁資訊，偏偏想要的結果是瀏覽手機版網頁。
所以這時候就得設定 User Agent（這個前提是網頁切換方式是判斷User Agent）

參考設定的內容如下


...
WebView webView = (WebView) findViewById(R.id.web);
...
webView.getSettings().setUserAgentString(&quot;Mozilla/5.0 (Linux; Android 4.4.4; en-us; Nexus 4 Build/JOP40D) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2307.2 Mobile Safari/537.36&quot;);
...



目前用平板瀏覽，確實是手機版網頁，不過這前提是網頁偵測方式是用User Agent判斷</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/162665525894131942/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/05/android-webview.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/162665525894131942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/162665525894131942'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/05/android-webview.html' title='Android webview 平板瀏覽手機頁面'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-8381688048011491538</id><published>2015-05-02T13:11:00.001+08:00</published><updated>2015-05-02T13:11:26.463+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="fontscale"/><title type='text'>Android 系統字體大小辨識</title><summary type="text">如果使用者想要調整字體大小，那要如何取得調整的比例呢？
（如何調整大小：設定〉無障礙設定〉字體(或是大字體，每間廠商會有些許不同)）

會了確保字體被放大時，版面不影響，這時候需要做相對應的調整
取得使用者目前的字體比例如下
&lt;!-- HTML generated using hilite.me --&gt;

float scale = getResources().getConfiguration().fontScale



這時候再依照需求去調整，一般預設大小值會等於 1
其他值就得視各家廠商了~</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/8381688048011491538/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/05/android.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8381688048011491538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8381688048011491538'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/05/android.html' title='Android 系統字體大小辨識'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-948618612181115139</id><published>2015-04-01T18:42:00.003+08:00</published><updated>2015-04-01T18:42:49.347+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activity"/><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="intent"/><title type='text'>Android startActivity跟startActivityForResult</title><summary type="text">當想要切換Activity時，可以用兩個方式，startActivity與startActivityForResult
而這兩個又有什麼分別呢？
假設目前執行是A activity，startActivity就是單純傳資料給B activity並啟動，而startActivityForResult則是多了一件事情，就是當B activity結束時，可以回傳狀態給A activity。

簡單的範例startActivity：AActivity

...
String test = &quot;TEST&quot;;
Intent intent = new Intent(context, BActivity.class);
intent.putExtra(BActivity.TEST_PARAM, test);
startActivity(intent);
...



簡單的範例</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/948618612181115139/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/04/android-startactivitystartactivityforre.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/948618612181115139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/948618612181115139'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/04/android-startactivitystartactivityforre.html' title='Android startActivity跟startActivityForResult'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-1963045893696743692</id><published>2015-03-19T13:45:00.002+08:00</published><updated>2015-03-19T14:02:29.818+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="EditText"/><category scheme="http://www.blogger.com/atom/ns#" term="imeOptions"/><title type='text'>EditText android:imeOptions 用法</title><summary type="text">在XML標籤裡，使用android:imeOptions的用處是什麼呢？

&lt;!-- HTML generated using hilite.me --&gt;

&lt;...&gt;

&lt;EditText
        android:id=&quot;@+id/name&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;wrap_content&quot;
        android:padding=&quot;8dp&quot;
        android:gravity=&quot;top&quot;
        android:hint=&quot;@string/name&quot;
        android:inputType=&quot;text&quot;
        android:imeOptions=&quot;actionNext&quot;
        </summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/1963045893696743692/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/edittext-androidimeoptions.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/1963045893696743692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/1963045893696743692'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/edittext-androidimeoptions.html' title='EditText android:imeOptions 用法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-824256965934946743</id><published>2015-03-16T14:52:00.002+08:00</published><updated>2015-03-16T14:52:53.237+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="laravel"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>在 Laravel 印出所有執行的 SQL 語句</title><summary type="text">在 routes.php 加入以下程式，就可顯示執行的SQL語句

&lt;!-- HTML generated using hilite.me --&gt;

&lt;?php
...

Event::listen(&#39;illuminate.query&#39;, function($query)
{
    var_dump($query);
});

...
?&gt;



參考來源：http://laravel-tricks.com/tricks/display-all-sql-executed-in-eloquent</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/824256965934946743/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/laravel-sql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/824256965934946743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/824256965934946743'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/laravel-sql.html' title='在 Laravel 印出所有執行的 SQL 語句'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-6368295474386658951</id><published>2015-03-12T19:19:00.000+08:00</published><updated>2015-03-12T19:20:16.230+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="fragment"/><category scheme="http://www.blogger.com/atom/ns#" term="onCreateOptionsMenu"/><title type='text'>Android 如何在 Fragment 執行 onCreateOptionsMenu</title><summary type="text">Activity執行 Fragment預設並不會執行onCreateOptionsMenu，因此為了讓每個Fragment都有不同的OptionsMenu時，就得要執行setHasOptionsMenu(true);

簡易範例如下

&lt;!-- HTML generated using hilite.me --&gt;

...

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setHasOptionsMenu(true);
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, </summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/6368295474386658951/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android-fragment-oncreateoptionsmenu.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6368295474386658951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6368295474386658951'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android-fragment-oncreateoptionsmenu.html' title='Android 如何在 Fragment 執行 onCreateOptionsMenu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-8915761632092051364</id><published>2015-03-04T11:35:00.001+08:00</published><updated>2015-03-04T11:35:52.102+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="infowindow"/><title type='text'>Android 自訂 Google Map Info Window</title><summary type="text">參照 Google Maps Android API v2 文件

以下是一個簡單的範例程式
&lt;!-- HTML generated using hilite.me --&gt;

import ...

public class MyMapFragment extends SupportMapFragment {

    public static MyMapFragment newInstance() {
        return new MyMapFragment();
    }

    public MyMapFragment() {

    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/8915761632092051364/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android-google-map-info-window.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8915761632092051364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/8915761632092051364'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android-google-map-info-window.html' title='Android 自訂 Google Map Info Window'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-5201786359836205695</id><published>2015-03-03T12:49:00.002+08:00</published><updated>2015-03-03T12:54:12.914+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="BuildConfig"/><category scheme="http://www.blogger.com/atom/ns#" term="PackageInfo"/><title type='text'>Android 取得版本資訊</title><summary type="text">使用 PackageInfo 取得版本資訊
&lt;!-- HTML generated using hilite.me --&gt;

PackageInfo pInfo = null;
try {
    pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
} catch (Exception ex) {

}

int versionCode = pInfo.versionCode;
String versionName = pInfo.versionName;



如果有掛載 Gradle plugin 或是 使用 Android Studio 0.7.0 以上，就可以用 BuildConfig 取得版本資訊
&lt;!-- HTML generated using hilite.me --&gt;

int </summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/5201786359836205695/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/5201786359836205695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/5201786359836205695'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2015/03/android.html' title='Android 取得版本資訊'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-566696851481466219</id><published>2014-12-24T22:09:00.002+08:00</published><updated>2014-12-24T22:09:30.920+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="ionic"/><title type='text'>在Mac上使用Ionic進行Android開發</title><summary type="text">首先要安裝Ionic

npm install -g cordova ionic 
註 npm：是Node Package Manager
註 cordova：是PhoneGap，在1.4版本以後都改名為cordova

接著安裝Android SDK（不過本人偷懶，直接安裝Android Studio）

安裝完後，就在個人資料夾更新 ~/.bash_profile 檔案

export ANDROID_HOME=/Applications/Android\ Studio.app/sdk
ANDROID_TOOLS=$ANDROID_HOME/tools/:$ANDROID_HOME/platform-tools
export PATH=$ANDROID_TOOLS:$PATH

接著安裝 Apache Ant

brew install ant
好了，環境完成接下來就來產生專案

</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/566696851481466219/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2014/12/macionicandroid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/566696851481466219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/566696851481466219'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2014/12/macionicandroid.html' title='在Mac上使用Ionic進行Android開發'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3624567964348568715</id><published>2014-07-07T21:55:00.002+08:00</published><updated>2014-07-07T21:56:22.983+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="json"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>判斷是不是json格式 - PHP</title><summary type="text">
&lt;!-- HTML generated using hilite.me --&gt;

&lt;?php

/**
 * Check the string is json
 * 
 * @param string $str
 * @return bool
 * @throws Exception if the string is not json
 */
function isJson($str) {
    json_decode($str);

    $code = json_last_error();
    switch ($code) {
        case JSON_ERROR_NONE:
            return true;
        case JSON_ERROR_DEPTH:
            throw new Exception(&quot;</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3624567964348568715/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2014/07/json.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3624567964348568715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3624567964348568715'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2014/07/json.html' title='判斷是不是json格式 - PHP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-6806353955903966467</id><published>2013-12-19T22:10:00.001+08:00</published><updated>2013-12-19T22:24:01.353+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="phpize"/><title type='text'>使用phpize</title><summary type="text">什麼是phpize？phpize是用來加入php擴充模組。

如果想在已經編譯好的php加入擴充模組，則可以使用phpize。

以下以安裝phpredis為範例


# 先進入到phpredis資料夾
cd phpredis
# 會發現資料夾裡有個*.m4, 在執行phpize時必須要有的檔案
phpize

# 會出現以下資訊
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525

# 執行此資料夾的configure，是用來產生編譯時需要的Makefile檔案
./configure

# 接著就開始編譯並安裝
make
make install



安裝後要記得在php.ini上加入</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/6806353955903966467/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/12/phpize.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6806353955903966467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6806353955903966467'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/12/phpize.html' title='使用phpize'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3972427246342138977</id><published>2013-12-11T23:49:00.002+08:00</published><updated>2013-12-11T23:49:40.947+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="composer"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>安裝composer</title><summary type="text">Composer，其實就是作曲家（咦?!那跟php有什麼關係...。），請忽略剛剛（消音－嗶）
Composer其實是個依賴管理的工具，簡言之就是，說明目前這個專案需要用到哪些套件或函式庫。所以設定需要的套件或函式庫後，執行composer會產生一個目錄（例如vendor）存放你在設定上的那些套件。

設定範例，產生一個composer.json加入zendframework

{
    &quot;require&quot;: {
        &quot;zendframework/zendframework&quot;: &quot;2.2.*&quot;
    }
}



那麼要如何安裝呢？首先當然得先有composer，所以我們先去下載composer

在Linux底下

curl -sS https://getcomposer.org/installer | php



這樣就可以在當前目錄下取得composer.phar</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3972427246342138977/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/12/composer.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3972427246342138977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3972427246342138977'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/12/composer.html' title='安裝composer'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3138100526305996160</id><published>2013-05-28T21:17:00.002+08:00</published><updated>2013-05-28T21:17:37.619+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>面試前的筆試-實作題-費氏數列</title><summary type="text">費氏數列，是F1 = F2 = 1, Fn = Fn-1+Fn-2,給以下兩個範例，請實做出程式。

func(1) = 1

func(3) = 1 2 3 5 8



&lt;?php
echo func(1);
echo func(3);

function f($x){
    if($x == 1 || $x == 2)  return 1;
    return f($x-1)+f($x-2);
}

function func($x){
    $ans = &#39;&#39;;
    $len = $x*2-1;
    for($i = 1 ; $i&lt;=$len ; $i++)
        $ans .= f($i+1) . &#39; &#39;;
    return  $ans;
}
?&gt;





今天應該是太緊張了...，看到這題我無法理解為什麼func(3) = 1 2 3 5 8，但</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3138100526305996160/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/05/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3138100526305996160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3138100526305996160'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/05/blog-post.html' title='面試前的筆試-實作題-費氏數列'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-103859897239032975</id><published>2013-05-14T13:56:00.002+08:00</published><updated>2013-05-14T13:59:41.021+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><title type='text'>MySQL INSERT or UPDATE</title><summary type="text">有些時候在記錄資料時，總是會需要判斷資料有無存在，在進行資料寫入，或是更新資料。
所以至少都得先進行SELECT再去判斷資料有無存在，不存在就INSERT，存在就進行UPDATE，之前從沒找過有沒有更簡單的方法進行。
這次無意間找資料時，才看到INSERT ... ON DUPLICATE KEY UPDATE ...。

舉個簡單的範例，現在有個TABLE A如下



SQL範例如下

INSERT INTO `A`(`item_id`, `item_count`, `count_date`) 
VALUES (&#39;SwefcskoWdsl&#39;, 1, &#39;2013-05-14&#39;) 
ON DUPLICATE KEY UPDATE `item_count` = `item_count` + 1;



這段SQL就會依照當item_id與count_date資料不存在，則會新增；否則就會在</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/103859897239032975/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/05/mysql-insert-or-update.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/103859897239032975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/103859897239032975'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/05/mysql-insert-or-update.html' title='MySQL INSERT or UPDATE'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-pGzPRbOqmQA/UZHQdWkn1qI/AAAAAAAADC8/1DswzbkYz9I/s72-c/table.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3532650458701648116</id><published>2013-02-22T20:56:00.001+08:00</published><updated>2013-02-23T09:16:03.266+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="apache"/><category scheme="http://www.blogger.com/atom/ns#" term="header"/><category scheme="http://www.blogger.com/atom/ns#" term="http"/><title type='text'>Apache Http Header</title><summary type="text">安裝了Apache後，總是要注意安全設定，而每次重灌後，總是容易忘東忘西...，所以就把一些基礎的筆記紀錄一下。

這次要設定的是標頭（Header）資訊，為了不讓別人知道自己伺服器資訊，至少要把Header中與伺服器相關的資訊關閉或是不顯示詳細資訊。

要如何知道自己傳送出去的Header呢？
以下用php簡單寫了一個範例程式

&lt;?php
//要測試的網址
$url = &#39;www.google.com&#39;;
$timeout = 5;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3532650458701648116/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/02/apache-http-header.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3532650458701648116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3532650458701648116'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/02/apache-http-header.html' title='Apache Http Header'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-3097783205346287587</id><published>2013-01-02T20:05:00.002+08:00</published><updated>2013-01-02T20:06:56.670+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CentOS"/><category scheme="http://www.blogger.com/atom/ns#" term="FFmpeg"/><title type='text'>[FFmpeg] CentOS安裝FFmpeg</title><summary type="text">在使用之前FFmpeg之前，要先進行安裝。


yum install ffmpeg ffmpeg-devel



因為Server是用CentOS，所以預設套件並不存在，而有個快速的方法就是新增Dag套件庫，在 /etc/yum.repos.d/ 新增 dag.repo 檔案，此檔案內容如下


[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1



設定完後，在執行一次安裝，卻發現沒有GPG公開金鑰，這時還要進行安裝RPMforage套件庫。


rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/3097783205346287587/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/01/ffmpeg-centosffmpeg.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3097783205346287587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/3097783205346287587'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2013/01/ffmpeg-centosffmpeg.html' title='[FFmpeg] CentOS安裝FFmpeg'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-633688526839326529</id><published>2012-11-01T12:47:00.003+08:00</published><updated>2012-11-01T12:47:50.730+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jQuery"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>使用jQuery的Plugin管理cookie</title><summary type="text">為了能在javascript上管理cookie，因此採用了jQuery的Plugin：jQuery.Cookie

如何使用呢？

上面的連結是連到github，可以看到有個README.md檔案，裡面有說明如何使用。
以下是範例內容


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
//Create session cookie:
$.cookie(&#39;the_cookie&#39;, &#39;the_value&#39;);

//Create expiring cookie, 7 days from then:
$.cookie(&#39;the_cookie&#39;, &#39;the_value&#39;, { expires: 7 });

//Create expiring cookie, valid across entire site:
$.cookie(&#39;</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/633688526839326529/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2012/11/jqueryplugincookie.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/633688526839326529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/633688526839326529'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2012/11/jqueryplugincookie.html' title='使用jQuery的Plugin管理cookie'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1335223439738232182.post-6136969152283568953</id><published>2012-10-25T22:12:00.001+08:00</published><updated>2012-10-25T22:12:16.801+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="simpleXML"/><title type='text'>使用SimpleXML讀取XML資料 - PHP</title><summary type="text">SimpleXML是在php 5.0之後就是核心組成，所以是不需要額外安裝的。
（所以使用SimpleXML記得要檢查php版本喔！）

做個簡單的小範例，使用臺灣郵局 - 3+2碼郵遞區號XML檔部分資料


1
2
3
4
5
6
7
8
9
&lt;NewDataSet&gt;
  &lt;Zip32&gt;
    &lt;Zip5&gt;10042&lt;/Zip5&gt;
    &lt;City&gt;台北市&lt;/City&gt;
    &lt;Area&gt;中正區&lt;/Area&gt;
    &lt;Road&gt;秀山街&lt;/Road&gt;
    &lt;Scope&gt;全&lt;/Scope&gt;
  &lt;/Zip32&gt;
&lt;/NewDataSet&gt;





這時如果我們只想建立一個陣列，就是City-&gt;Area陣列，也就可以取得[&#39;台北市&#39;][0] = [&#39;中正區&#39;]
以下是範例程式碼


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
&lt;?php</summary><link rel='replies' type='application/atom+xml' href='http://chuehnoneinfonote.blogspot.com/feeds/6136969152283568953/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2012/10/simplexmlxml-php.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6136969152283568953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1335223439738232182/posts/default/6136969152283568953'/><link rel='alternate' type='text/html' href='http://chuehnoneinfonote.blogspot.com/2012/10/simplexmlxml-php.html' title='使用SimpleXML讀取XML資料 - PHP'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/04008716766441290289</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>