<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[蘋果蟲害防衛監察本部]]></title><description><![CDATA[為什麼你要放棄治療？]]></description><link>https://appleprince.com/</link><image><url>http://appleprince.com/favicon.png</url><title>蘋果蟲害防衛監察本部</title><link>https://appleprince.com/</link></image><generator>Ghost 3.15</generator><lastBuildDate>Fri, 19 Jun 2026 09:17:10 GMT</lastBuildDate><atom:link href="https://appleprince.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Ubuntu 安裝虛擬化環境]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>安裝虛擬化軟體工具</p>
<pre><code>$ sudo apt install qemu-kvm libvirt-bin virt-manager bridge-utils
</code></pre>
<p>啟動 libvirtd</p>
<pre><code>$ sudo systemctl start libvirtd.service
$ sudo systemctl enable libvirtd.service
</code></pre>
<p>執行 virt-manager</p>
<!--kg-card-end: markdown-->]]></description><link>https://appleprince.com/ubuntu-an-zhuang-xu-ni-hua-huan-jing/</link><guid isPermaLink="false">5b0251f1941de0000194c71b</guid><category><![CDATA[ubuntu]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Mon, 21 May 2018 05:10:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>安裝虛擬化軟體工具</p>
<pre><code>$ sudo apt install qemu-kvm libvirt-bin virt-manager bridge-utils
</code></pre>
<p>啟動 libvirtd</p>
<pre><code>$ sudo systemctl start libvirtd.service
$ sudo systemctl enable libvirtd.service
</code></pre>
<p>執行 virt-manager</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Ubuntu 安裝 nvidia 顯示驅動程式]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>加入 graphics-drivers repo</p>
<pre><code>$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
</code></pre>
<p>安裝對應驅動程式，例如</p>
<pre><code>$ sudo apt install nvidia-390
</code></pre>
<!--kg-card-end: markdown-->]]></description><link>https://appleprince.com/ubuntu-an-zhuang/</link><guid isPermaLink="false">5b0253ad941de0000194c71c</guid><category><![CDATA[ubuntu]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Mon, 21 May 2018 05:08:44 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>加入 graphics-drivers repo</p>
<pre><code>$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt-get update
</code></pre>
<p>安裝對應驅動程式，例如</p>
<pre><code>$ sudo apt install nvidia-390
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[CentOS 7 安裝虛擬化環境]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>安裝虛擬化軟體工具</p>
<pre><code>$ sudo yum groupinstall &quot;Virtualization Client&quot;
</code></pre>
<p>啟動 libvirtd</p>
<pre><code>$ sudo systemctl start libvirtd.service
$ sudo systemctl enable libvirtd.service
</code></pre>
<p>執行 virt-manager</p>
<!--kg-card-end: markdown-->]]></description><link>https://appleprince.com/centos-7-an-zhuang-xu-ni-hua-huan-jing/</link><guid isPermaLink="false">59f5d4cc492704000128510a</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Wed, 12 Jul 2017 08:36:15 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>安裝虛擬化軟體工具</p>
<pre><code>$ sudo yum groupinstall &quot;Virtualization Client&quot;
</code></pre>
<p>啟動 libvirtd</p>
<pre><code>$ sudo systemctl start libvirtd.service
$ sudo systemctl enable libvirtd.service
</code></pre>
<p>執行 virt-manager</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Cheatsheet for a new CentOS 7 on Raspberry Pi]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Create a sudo user</p>
<pre><code># adduser &lt;user&gt;
# passwd &lt;user&gt;
# usermod -aG wheel &lt;user&gt;
</code></pre>
<p>Disable DHCP and use static IP address (requires reboot)</p>
<pre><code>$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=&quot;static&quot;
IPADDR=&quot;&lt;ip&gt;&quot;
PREFIX=&quot;24&quot;
GATEWAY=&quot;&lt;</code></pre>]]></description><link>https://appleprince.com/cheatsheet-for-a-new-centos-7-on-raspberry-pi/</link><guid isPermaLink="false">59f5d4cc4927040001285108</guid><category><![CDATA[centos]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Fri, 10 Mar 2017 06:13:27 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>Create a sudo user</p>
<pre><code># adduser &lt;user&gt;
# passwd &lt;user&gt;
# usermod -aG wheel &lt;user&gt;
</code></pre>
<p>Disable DHCP and use static IP address (requires reboot)</p>
<pre><code>$ sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=&quot;static&quot;
IPADDR=&quot;&lt;ip&gt;&quot;
PREFIX=&quot;24&quot;
GATEWAY=&quot;&lt;gateway&gt;&quot;
DNS1=&quot;8.8.8.8&quot;
DNS2=&quot;8.8.4.4&quot;
</code></pre>
<p>Enable proxy (requires reboot)</p>
<pre><code>$ sudo vi /etc/yum.conf
[main]
proxy=http://&lt;ip&gt;:&lt;port&gt;

$ sudo vi /etc/environment
http_proxy=http://&lt;ip&gt;:&lt;port&gt;
https_proxy=http://&lt;ip&gt;:&lt;port&gt;
ftp_proxy=http://&lt;ip&gt;:&lt;port&gt;
</code></pre>
<p>Enable NTP</p>
<pre><code>$ sudo yum install chrony
$ sudo systemctl start chronyd.service
$ sudo systemctl enable chronyd.service
</code></pre>
<p>Enable EPEL repo</p>
<pre><code>$ sudo cat &gt; /etc/yum.repos.d/epel.repo &lt;&lt; EOF
[epel]
name=Epel rebuild for armhfp
baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
enabled=1
gpgcheck=0

EOF
</code></pre>
<p>Install WiFi firmware (requires reboot)</p>
<pre><code>$ curl -O https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/master/brcm80211/brcm/brcmfmac43430-sdio.bin
$ sudo mv brcmfmac43430-sdio.bin /lib/firmware/brcm
$ sudo chown root.root brcmfmac43430-sdio.bin
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[64 位元 Qt Creator 加入 32 位元 Qt Toolchain]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>取得 32 位元 Qt Toolchain</p>
<pre><code>建立 32 位元虛擬機，安裝 32 位元作業系統與 Qt 開發環境
sudo tar cvfz qt-5.5.1-gcc.tar.gz /opt/Qt5.5.1/5.5
複製建立的壓縮檔至本機，關閉虛擬機
</code></pre>
<p>安裝 32 位元 glibc-devel 與 libstdc++-devel</p>
<pre><code>sudo yum install glibc-devel.i686 libstdc++-devel.i686 zlib-devel.i686
</code></pre>
<p>解壓縮 32 位元 Qt</p>]]></description><link>https://appleprince.com/64-wei-yuan-qt-creator-zeng-jia-32-wei-yuan-qt-toolchain/</link><guid isPermaLink="false">59f5d4cc4927040001285106</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Tue, 20 Sep 2016 01:35:04 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>取得 32 位元 Qt Toolchain</p>
<pre><code>建立 32 位元虛擬機，安裝 32 位元作業系統與 Qt 開發環境
sudo tar cvfz qt-5.5.1-gcc.tar.gz /opt/Qt5.5.1/5.5
複製建立的壓縮檔至本機，關閉虛擬機
</code></pre>
<p>安裝 32 位元 glibc-devel 與 libstdc++-devel</p>
<pre><code>sudo yum install glibc-devel.i686 libstdc++-devel.i686 zlib-devel.i686
</code></pre>
<p>解壓縮 32 位元 Qt Toolchain</p>
<pre><code>tar xvfz qt-5.5.1-gcc.tar.gz /opt/Qt5.5.1/5.5
</code></pre>
<p>於 Qt Creator 新增 32 位元 Qt Toolchain</p>
<pre><code>Tools -&gt; Options... -&gt; Qt Versions
點選 Add... 按鈕，選擇 /opt/Qt5.5.1/5.5/gcc/bin/qmake
Version name 取個喜歡的名子，例如 Qt 5.5.1 GCC 32 bit
按 Apply

Tools -&gt; Options... -&gt; Kits
選擇預設的 64 位元 Kits，按 Clone
Name 取個喜歡的名子，例如 Desktop Qt 5.5.1 GCC 32bit
Compiler 選擇 GCC (x86 32bit in /usr/bin)
Qt version 選擇 Qt 5.5.1 GCC 32 bit (或你剛剛取的 Version name)
按 OK
</code></pre>
<p>重建專案設定</p>
<pre><code>關閉專案，刪除專案的 .pro.user 檔
重新開啟專案，Qt Creator 詢問建置目標時同時勾選 Desktop Qt 5.5.1 GCC 32bit 與 64bit
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[CentOS 建立 rpmbuild 環境]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>== 務必使用一般帳號執行 rpmbuild ，以 root 執行有可能毀損系統 ==</p>
<p><strong>安裝 rpmbuild</strong></p>
<pre><code>$ sudo yum install rpm-build
$ sudo yum install redhat-rpm-config
</code></pre>
<p>產生 rpmbuild 使用的目錄及檔案</p>
<pre><code>$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' &gt; ~/.rpmmacros
</code></pre>
<p><strong>準備必要檔案</strong></p>
<p>建置需要專案原始程式碼以及建置 spec 文件，或者使用已包裝好內含原始碼及 spec 的 SRPM 包。</p>
<p>可先嘗試以 yumdownloader 自 yum repo 下載 SRPM</p>]]></description><link>https://appleprince.com/centos-jian-li-rpmbuild-huan-jing/</link><guid isPermaLink="false">59f5d4cc4927040001285105</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Fri, 20 May 2016 08:45:07 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>== 務必使用一般帳號執行 rpmbuild ，以 root 執行有可能毀損系統 ==</p>
<p><strong>安裝 rpmbuild</strong></p>
<pre><code>$ sudo yum install rpm-build
$ sudo yum install redhat-rpm-config
</code></pre>
<p>產生 rpmbuild 使用的目錄及檔案</p>
<pre><code>$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' &gt; ~/.rpmmacros
</code></pre>
<p><strong>準備必要檔案</strong></p>
<p>建置需要專案原始程式碼以及建置 spec 文件，或者使用已包裝好內含原始碼及 spec 的 SRPM 包。</p>
<p>可先嘗試以 yumdownloader 自 yum repo 下載 SRPM 包</p>
<pre><code>$ yumdownloader --source &lt;package&gt;
</code></pre>
<p>若無法取得 SRPM ，則須下載專案原始程式碼置於 <code>~/rpmbuild/SOURCES</code>，並自行編寫 spec 文件置於 <code>~/rpmbuild/SPECS</code>。</p>
<p><strong>安裝建置用相依套件</strong></p>
<p>可使用 yum-builddep 安裝建置需要的相依套件</p>
<pre><code>$ sudo yum-builddep &lt;srpm&gt;
$ sudo yum-builddep &lt;specfile&gt;
</code></pre>
<p>如果要在 x86_64 環境安裝 i686 的相依套件，則建議使用</p>
<pre><code>$ sudo yum-builddep --target=i686 -x *.x86_64 &lt;srpm&gt;
$ sudo yum-builddep --target=i686 -x *.x86_64 &lt;specfile&gt;
</code></pre>
<p>以避免部份 spec 文件未在相依套件名稱後端加上 %{?_isa}</p>
<p><strong>建置 RPM</strong></p>
<p>使用 SRPM 包時</p>
<pre><code>$ rpmbuild --rebuild &lt;srpm&gt;
</code></pre>
<p>使用專案原始檔及 spec 文件時</p>
<pre><code>$ rpmbuild -bb &lt;specfile&gt;
</code></pre>
<p>若建置過程中沒有編譯錯誤，可以在 <code>~/rpmbuild/RPMS</code> 目錄下看到建置完成的 rpm 檔案。</p>
<p>在 x86_64 環境建置 i686 rpm 時</p>
<pre><code>$ rpmbuild --target=i686 -rebuild &lt;srpm&gt;
$ rpmbuild --target=i686 -bb &lt;specfile&gt;
</code></pre>
<p>spec 檔案通常也需要對應 i686 做必要的修正</p>
<p><strong>安裝、查詢與移除 RPM</strong></p>
<pre><code>安裝
$ sudo rpm -ivh &lt;package&gt;.rpm
安裝到指定的位置
$ sudo rpm --prefix=&lt;path&gt; -ivh &lt;package&gt;.rpm
移除
$ sudo rpm -e &lt;package&gt;
查詢已安裝套件
$ sudo rpm -qa '&lt;package&gt;' (package 可包含 wildcard)
使用 yum 並同時安裝相依套件
$ sudo yum --nogpgcheck localinstall &lt;package&gt;
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[MSVC 2013 編譯 OpenSSL]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>解壓縮 openssl</p>
<p>打開 VS2013 x86 或 x64 Native Tools Command Prompt，切換至 openssl 目錄</p>
<p>x86 環境設定</p>
<pre><code>perl Configure VC-WIN32 no-asm --prefix=c:/openssl_build
ms\do_ms
</code></pre>
<p>x64 環境設定</p>
<pre><code>perl Configure VC-WIN64A no-asm --prefix=c:/openssl_build
ms\do_win64a
</code></pre>
<p>編譯動態函式庫 (預設 /MD，需要 /MDd 先修改 ntdll.mak)</p>
<pre><code>nmake -f</code></pre>]]></description><link>https://appleprince.com/msvc-2013-bian-yi-openssl/</link><guid isPermaLink="false">59f5d4cc4927040001285104</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Fri, 20 May 2016 08:21:48 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>解壓縮 openssl</p>
<p>打開 VS2013 x86 或 x64 Native Tools Command Prompt，切換至 openssl 目錄</p>
<p>x86 環境設定</p>
<pre><code>perl Configure VC-WIN32 no-asm --prefix=c:/openssl_build
ms\do_ms
</code></pre>
<p>x64 環境設定</p>
<pre><code>perl Configure VC-WIN64A no-asm --prefix=c:/openssl_build
ms\do_win64a
</code></pre>
<p>編譯動態函式庫 (預設 /MD，需要 /MDd 先修改 ntdll.mak)</p>
<pre><code>nmake -f ms\ntdll.mak
</code></pre>
<p>編譯靜態函式庫 (預設 /MT，需要 /MTd、/MD、/MDd先修改 nt.mak)</p>
<pre><code>nmake -f ms\nt.mak
</code></pre>
<p>安裝</p>
<pre><code>nmake -f ms\ntdll.mak install
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[列出 QObject 的成員函數]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>把要知道成員函數列表的物件放在 targetObject 的位置，執行：</p>
<pre><code>QObject* targetObject;
const QMetaObject* mo = targetObject-&gt;metaObject();
for(int i=0; i&lt;mo-&gt;methodCount(); ++i) {
    QMetaMethod mm = mo-&gt;method(i);

    QString typeText;
    switch (mm.methodType()) {
    case QMetaMethod::Method:
        typeText = &quot;method&quot;;
        break;
    case QMetaMethod::Signal:
        typeText = &quot;signal&quot;;
        break;
    case</code></pre>]]></description><link>https://appleprince.com/lie-chu-qobject-de-cheng-yuan-han-shu/</link><guid isPermaLink="false">59f5d4cc4927040001285102</guid><category><![CDATA[coding]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Fri, 25 Dec 2015 01:01:14 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>把要知道成員函數列表的物件放在 targetObject 的位置，執行：</p>
<pre><code>QObject* targetObject;
const QMetaObject* mo = targetObject-&gt;metaObject();
for(int i=0; i&lt;mo-&gt;methodCount(); ++i) {
    QMetaMethod mm = mo-&gt;method(i);

    QString typeText;
    switch (mm.methodType()) {
    case QMetaMethod::Method:
        typeText = &quot;method&quot;;
        break;
    case QMetaMethod::Signal:
        typeText = &quot;signal&quot;;
        break;
    case QMetaMethod::Slot:
        typeText = &quot;slot&quot;;
        break;
    case QMetaMethod::Constructor:
        typeText = &quot;constructor&quot;;
        break;
    default:
        typeText = &quot;&quot;;
    }

    QString accessText;
    switch (mm.access()) {
    case QMetaMethod::Private:
        typeText = &quot;private&quot;;
        break;
    case QMetaMethod::Protected:
        typeText = &quot;protected&quot;;
        break;
    case QMetaMethod::Public:
        typeText = &quot;public&quot;;
        break;
    default:
        typeText = &quot;&quot;;
    }

    qDebug() &lt;&lt; accessText &lt;&lt; typeText &lt;&lt; mm.methodSignature();
}
</code></pre>
<p>執行後會印出 targetObject 全部的成員函數。例如將 targetObject 設為一個 QObject 物件，可得到：</p>
<pre><code>&quot;&quot; &quot;public&quot; &quot;destroyed(QObject*)&quot;
&quot;&quot; &quot;public&quot; &quot;destroyed()&quot;
&quot;&quot; &quot;public&quot; &quot;objectNameChanged(QString)&quot;
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[MSVC 2010 編譯 SQLite]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>解壓縮 SQLite 原始碼。</p>
<p>打開 Visual Studio Command Prompt，切換工作目錄到解壓縮目錄。</p>
<p>Static library (Release):</p>
<pre><code>cl -O2 -MD -c sqlite3.c
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<p>Static library (Debug):</p>
<pre><code>cl -O2 -Z7 -MDd -c sqlite3.c
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<p>Dynamic linking library (Release):</p>
<pre><code>cl -O2 -MD sqlite3.c -link</code></pre>]]></description><link>https://appleprince.com/msvc-2010-bian-yi-sqlite/</link><guid isPermaLink="false">59f5d4cc4927040001285101</guid><category><![CDATA[coding]]></category><category><![CDATA[cpp]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Thu, 13 Aug 2015 07:49:20 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>解壓縮 SQLite 原始碼。</p>
<p>打開 Visual Studio Command Prompt，切換工作目錄到解壓縮目錄。</p>
<p>Static library (Release):</p>
<pre><code>cl -O2 -MD -c sqlite3.c
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<p>Static library (Debug):</p>
<pre><code>cl -O2 -Z7 -MDd -c sqlite3.c
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<p>Dynamic linking library (Release):</p>
<pre><code>cl -O2 -MD sqlite3.c -link -dll -out:sqlite3.dll
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<p>Dynamic linking library (Debug):</p>
<pre><code>cl -O2 -Z7 -MDd sqlite3.c -link -dll -out:sqlite3.dll
lib sqlite3.obj -out:sqlite3.lib
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Android 獲得網路連線狀態]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>網路連線狀態改變時接收通知</p>
<pre>
BroadcastReceiver mReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if(ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
            boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
            NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
            boolean mobileNetwork = (networkInfo.getType()==ConnectivityManager.TYPE_MOBILE);
        }
    }
}

IntentFilter filter</pre>]]></description><link>https://appleprince.com/android-huo-de-wang-lu-lian-xian-zhuang-tai/</link><guid isPermaLink="false">59f5d4cc4927040001285100</guid><category><![CDATA[coding]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Sun, 12 Jun 2011 23:44:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>網路連線狀態改變時接收通知</p>
<pre>
BroadcastReceiver mReceiver = new BroadcastReceiver() {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if(ConnectivityManager.CONNECTIVITY_ACTION.equals(action)) {
            boolean noConnectivity = intent.getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);
            NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
            boolean mobileNetwork = (networkInfo.getType()==ConnectivityManager.TYPE_MOBILE);
        }
    }
}

IntentFilter filter = new IntentFilter();
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
context.registerReceiver(mReceiver, filter);
</pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[自動啟動晶片卡 Windows 服務]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>如果讀卡機的狀況是：</p>
<pre><code>剛安裝完驅動程式時，讀卡機可以用
重新開機後，讀卡機插上電腦時抓的到，但是不能用
解除安裝驅動程式重新安裝又能用
</code></pre>
<p>那大概就是晶片卡讀卡機安裝驅動程式時，沒有把 Windows 智慧卡服務一起設定為自動啟動。所以電腦重新開機後，讀卡機看起來正常，但是插入卡片後卻因為缺少智慧卡服務而沒有反應。</p>
<p>這時候就要到：</p>
<pre><code>控制台 → 系統管理工具 → 服務 → Smart Card 服務
</code></pre>
<p>看看它的「啟動類型」是否為「自動」，不是的話就把服務設定為自動啟動就可以了。</p>
<!--kg-card-end: markdown-->]]></description><link>https://appleprince.com/zi-dong-qi-dong-jing-pian-qia-windows-fu-wu/</link><guid isPermaLink="false">59f5d4cc49270400012850ff</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Wed, 16 Dec 2009 08:22:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>如果讀卡機的狀況是：</p>
<pre><code>剛安裝完驅動程式時，讀卡機可以用
重新開機後，讀卡機插上電腦時抓的到，但是不能用
解除安裝驅動程式重新安裝又能用
</code></pre>
<p>那大概就是晶片卡讀卡機安裝驅動程式時，沒有把 Windows 智慧卡服務一起設定為自動啟動。所以電腦重新開機後，讀卡機看起來正常，但是插入卡片後卻因為缺少智慧卡服務而沒有反應。</p>
<p>這時候就要到：</p>
<pre><code>控制台 → 系統管理工具 → 服務 → Smart Card 服務
</code></pre>
<p>看看它的「啟動類型」是否為「自動」，不是的話就把服務設定為自動啟動就可以了。</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[製作僅有 NotifyIcon 的應用程式]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>如果程式不需要視窗，只要一個 NotifyIcon 出現在 System Tray 內，利用滑鼠右鍵選單做一些簡單的設定的話，首先：</p>
<pre><code>開啟一個新的專案，選擇 Windows Application
</code></pre>
<p>NotifyIcon 要放在一個 Container 物件內，通常這個物件是 Form。但是因為我們不想要有一個 Form ，所以要自行用一個 Container 把 NotifyIcon 放進去：</p>
<pre>
class NotifyIconUI
{
    private System.ComponentModel.Container container1;
    private System.Windows.Forms.NotifyIcon notifyIcon1;

    public NotifyIconUI()
    {
        container1 = new System.ComponentModel.Container();
        notifyIcon1 = new System.Windows.</pre>]]></description><link>https://appleprince.com/zhi-zuo-jin-you-notifyicon-de-ying-yong-cheng-shi/</link><guid isPermaLink="false">59f5d4cc49270400012850fe</guid><category><![CDATA[coding]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Sun, 30 Aug 2009 03:31:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>如果程式不需要視窗，只要一個 NotifyIcon 出現在 System Tray 內，利用滑鼠右鍵選單做一些簡單的設定的話，首先：</p>
<pre><code>開啟一個新的專案，選擇 Windows Application
</code></pre>
<p>NotifyIcon 要放在一個 Container 物件內，通常這個物件是 Form。但是因為我們不想要有一個 Form ，所以要自行用一個 Container 把 NotifyIcon 放進去：</p>
<pre>
class NotifyIconUI
{
    private System.ComponentModel.Container container1;
    private System.Windows.Forms.NotifyIcon notifyIcon1;

    public NotifyIconUI()
    {
        container1 = new System.ComponentModel.Container();
        notifyIcon1 = new System.Windows.Forms.NotifyIcon(container1);
        notifyIcon1.Icon = new System.Drawing.Icon("myicon.ico");
        notifyIcon1.Visible = true;
    }
}
</pre>
<p>接著修改 Program.cs ，把原本啟動時產生 Form 這一行</p>
<pre>
Application.Run(new Form1());
</pre>
<p>改成啟動時產生剛剛寫的 NotifyIconUI</p>
<pre>
NotifyIconUI ui = new NotifyIconUI();
Application.Run();
</pre>
<p>這樣就完成了。</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[離線安裝 .Net Framework 3.5 SP1]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>微軟的 .Net Framework 3.5 w/SP1 full package 雖然已經說是離線版了，但安裝包內並不包含語言套件，導致在中文環境下安裝是仍然會連線下載中文語言套件，很不方便。最好是把語言套件也一起下載，就可以進行離線安裝了。</p>
<p>下載</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&amp;FamilyID=d0e5dea7-ac26-4ad7-b68c-fe5076bba986">Microsoft .NET Framework 3.5 Service pack 1 (Full Package)</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&amp;FamilyID=8489ed13-b831-4855-96f7-dd35e4c02a20">Microsoft .NET Framework 3.5 SP1 語言套件</a></li>
</ul>
<p>安裝</p>
<p>使用命令列指令安裝 .Net Framework 3.5 Full Package 並指定安裝語系為英文，就能夠避免安裝程式連線下載語言套件。</p>
<pre><code>dotnetfx35.exe /lang:eng
</code></pre>
<p>安裝完後再繼續裝語言套件就完成囉。</p>
<pre><code>dotnetfx35langpack_x86zh-cht.</code></pre>]]></description><link>https://appleprince.com/li-xian-an-zhuang-net-framework-3-5-sp1/</link><guid isPermaLink="false">59f5d4cc49270400012850fd</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Wed, 26 Aug 2009 01:50:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p>微軟的 .Net Framework 3.5 w/SP1 full package 雖然已經說是離線版了，但安裝包內並不包含語言套件，導致在中文環境下安裝是仍然會連線下載中文語言套件，很不方便。最好是把語言套件也一起下載，就可以進行離線安裝了。</p>
<p>下載</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&amp;FamilyID=d0e5dea7-ac26-4ad7-b68c-fe5076bba986">Microsoft .NET Framework 3.5 Service pack 1 (Full Package)</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=zh-tw&amp;FamilyID=8489ed13-b831-4855-96f7-dd35e4c02a20">Microsoft .NET Framework 3.5 SP1 語言套件</a></li>
</ul>
<p>安裝</p>
<p>使用命令列指令安裝 .Net Framework 3.5 Full Package 並指定安裝語系為英文，就能夠避免安裝程式連線下載語言套件。</p>
<pre><code>dotnetfx35.exe /lang:eng
</code></pre>
<p>安裝完後再繼續裝語言套件就完成囉。</p>
<pre><code>dotnetfx35langpack_x86zh-cht.exe
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[ASUS U80V Device Drivers for Windows XP]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p><strong>Important Notice</strong></p>
<p><strong>Use at your own risk! Information provided here are published &quot;AS IS&quot; without any warranty/guarantee of any kind.</strong></p>
<p>ASUS U80V comes without any XP driver &amp; utility support from ASUSTek. Only Vista 32 and 64 software can be found on the official U80V support page.</p>]]></description><link>https://appleprince.com/asus-u80v-device-drivers-for-windows-xp/</link><guid isPermaLink="false">59f5d4cc49270400012850fc</guid><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Tue, 25 Aug 2009 12:29:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><p><strong>Important Notice</strong></p>
<p><strong>Use at your own risk! Information provided here are published &quot;AS IS&quot; without any warranty/guarantee of any kind.</strong></p>
<p>ASUS U80V comes without any XP driver &amp; utility support from ASUSTek. Only Vista 32 and 64 software can be found on the official U80V support page. XP drivers and utilities are collected here for convenience. Some utilities developed by ASUSTek are for Vista only, and are replaced by outdated XP versions.</p>
<h2 id="installation">Installation</h2>
<ul>
<li>Windows XP with Service Pack 3 is required. Slipstreaming SP3 into XP installation for a cleaner installation.</li>
<li>SATA driver should be <a href="http://www.digitgeek.com/how-to-slipstream-sata-drivers-into-xp-cd">integrated into your XP installation </a>. If not integrated, BIOS SATA setting must be switched to compatiable mode before installation. SATA driver for U80V can be <a href="http://downloadmirror.intel.com/17883/eng/f6flpy3289.zip">downloaded</a> from Intel.</li>
<li>Switch on the wireless switch to install WiFi and bluetooth drivers.</li>
<li>Some drivers/utilities MUST be installed before others, read notices in each category for details.</li>
<li>All drivers and utilities are provided by manufacturers, only links to softwares are provided here.</li>
</ul>
<p>Chipset (Intel PM45)</p>
<table>
<tr>
<td width="60%">Intel® 4 Series Chipset Device Software
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/INFUpdate/XP/INFupdate_XP_081219.zip">9.0.0.1011</a>
</td><td>ASUSTek
</td><td>2008/07/16
</td></tr></table>
<p>Display (ATI HD 4570)</p>
<table>
<tr>
<td width="60%">Device Driver & Catalyst Control Center
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/VGA/ATI/VGA_ATI_XP_090731.zip">8.610.0.0</a>
</td><td>ASUSTek
</td><td>2009/04/09
</td></tr></table>
<p>Audio (Realtek)</p>
<table>
<tr>
<td width="60%">HD Audio Device Driver
</td><td><a href="http://www.realtek.com.tw/downloads/RedirectFTPSite.aspx?SiteID=1&DownTypeID=3&DownID=11&PFid=24&Conn=3">5.10.0.5919</a>
</td><td>Realtek
</td><td>2009/08/18
</td></tr><tr>
<td>ATI HDMI Audio Device Driver
</td><td><a href="http://www.realtek.com.tw/downloads/RedirectFTPSite.aspx?SiteID=1&DownTypeID=3&DownID=600&PFid=24&Conn=3">5.10.0.5880</a>
</td><td>Realtek
</td><td>2009/06/24
</td></tr></table>
<p>Network (Atheros AR8131)</p>
<table>
<tr>
<td width="60%">Atheros AR81Family Windows Driver
</td><td><a href="http://partner.atheros.com/Download.aspx?id=100">1.0.0.23</a>
</td><td>Atheros
</td><td>2009/07/27
</td></tr></table>
<p>Power Management<br>
<em>ATKDrv Device Driver MUST be installed before other ATK utilities.</em></p>
<table>
<tr>
<td width="60%">ATKDrv Device Driver
</td><td><a href="http://dlsvr.asus.com/pub/ASUS/nb/Drivers/ATKDrv/ATKDrv_VT32_090420.zip">1043.2.31.102</a>
</td><td>ASUSTek
</td><td>2009/04/20
</td></tr><tr>
<td>ATK Hotkey Utility
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/ATK_Hotkey/ATKHotkey_XP_090813.zip">1.0.0051</a>
</td><td>ASUSTek
</td><td>2009/07/29
</td></tr><tr>
<td>ATK Generic Function Utility
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/AGFS/AGFNEX_VT_32_64_090119.zip">1.00.0008</a>
</td><td>ASUSTek
</td><td>2009/01/19
</td></tr><tr>
<td>ATKOSD2 Utility
</td><td><a href="http://dlsvr.asus.com/pub/ASUS/nb/Apps/ATKOSD2/ATKOSD2_Vista_090729.zip">7.0.0005</a>
</td><td>ASUSTek
</td><td>2009/07/29
</td></tr><tr>
<td>ATK Media Utility
</td><td><a http: appleprince.com asus-u80v-device-drivers-for-windows-xp https: href>2.0.0005</a>
</td><td>ASUSTek
</td><td>2009/05/05
</td></tr></table>
<p>Wireless (Intel WiFi Link 5100 AGN &amp; Broadcom BT-253)<br>
<em>ASUS Wireless Switch Utility MUST be installed before WiFi and bluetooth drivers.</em></p>
<table>
<tr>
<td width="60%">ASUS Wireless Switch Utility (Wireless Console 3)
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/Wireless_Console/Wireless_Console_3_Vista_090814.zip">3.0.10</a>
</td><td>ASUSTek
</td><td>2009/08/14
</td></tr><tr>
<td>Intel® PRO/Wireless and WiFi Link Driver
</td><td><a href="http://downloadmirror.intel.com/17751/eng/ICS_Dx32.zip">12.4.3.9</a>
</td><td>Intel
</td><td>2009/06/25
</td></tr><tr>
<td>Intel® PROSet/Wireless WiFi Connection Utility
</td><td><a href="http://downloadmirror.intel.com/17755/eng/ICS_x32.zip">12.4.3.0</a>
</td><td>Intel
</td><td>2009/06/25
</td></tr><tr>
<td>AW-BT253 Bluetooth Driver
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/Bluetooth/Bluetooth_AW-BT253_XP_090325.zip">5.5.0.3200</a>
</td><td>ASUSTek
</td><td>2008/04/14
</td><td></td></tr></table>
<p>Misc Devices</p>
<table>
<tr>
<td width="60%">Suyin Camera Driver
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/CMOS_Camera/Camera_Suyin_V6585322014_XP.zip">6.5853.22.14</a>
</td><td>ASUSTek
</td><td>2009/07/21
</td></tr><tr>
<td>Alcor Card Reader Driver
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/Cardreader/Card_Reader_Alcor_XP_090707.zip">1.1.17</a>
</td><td>ASUSTek
</td><td>2009/07/07
</td></tr><tr>
<td>Elantech Touchpad Driver
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Drivers/Touchpad/Touchpad_Elantech_V7057_VT32.zip">7.0.5.7</a>
</td><td>ASUSTek
</td><td>2009/08/18
</td></tr><tr>
<td>KB Filter Driver
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/KB_filter/KB_FILTER_VT32_090217.zip">1.0.0.1</a>
</td><td>ASUSTek
</td><td>2009/02/17
</td></tr></table>
<p>ASUS Utilities (optional)</p>
<table>
<tr>
<td width="60%">Power4 Gear Hybrid Utility
</td><td colspan="3">NOT AVAILABLE (Vista only)
</td></tr><tr>
<td>Power4 Gear Utility
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/P4G/P4G_XP_090318.zip">1.0.0019</a>
</td><td>ASUSTek
</td><td>2009/03/18
</td></tr><tr>
<td>U80V Splendid Utility
</td><td><a href="http://dlsvr.asus.com/pub/ASUS/nb/Apps/Splendid/Splendid_K40AB_XP_090817.zip">1.02.0027</a>
</td><td>ASUSTek
</td><td>2009/08/17
</td></tr><tr>
<td>FancyStart Utility
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/FancyStart/FancyStart_V106_Vista.zip">1.0.6</a>
</td><td>ASUSTek
</td><td>2009/08/19
</td></tr><tr>
<td>Life Frame 3 Utility
</td><td colspan="3">NOT AVAILABLE (Vista only)
</td></tr><tr>
<td>Life Frame 2 Utility
</td><td><a href="http://dlcdnet.asus.com/pub/ASUS/nb/Apps/LifeFrame2/LifeFrame2_XP_090305.zip">2.0.24</a>
</td><td>ASUSTek
</td><td>2009/05/05
</td></tr><tr>
<td>ExpresssGate Utility
</td><td><a href="http://dlsvr01.asus.com/pub/ASUS/nb/Apps/ExpressGate/ExpressGate_V121314.zip">1.2.13.14</a>
</td><td>ASUSTek
</td><td>2009/08/18
</td></tr></table>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[C# 取得命令列參數]]></title><description><![CDATA[<!--kg-card-begin: markdown--><pre><code>string[] args = Environment.GetCommandLineArgs();

foreach(string arg in args) {
    // do something
}
</code></pre>
<!--kg-card-end: markdown-->]]></description><link>https://appleprince.com/c-qu-de-ming-ling-lie-can-shu/</link><guid isPermaLink="false">59f5d4cc49270400012850fb</guid><category><![CDATA[coding]]></category><dc:creator><![CDATA[Defence Minister]]></dc:creator><pubDate>Fri, 29 Aug 2008 06:59:00 GMT</pubDate><content:encoded><![CDATA[<!--kg-card-begin: markdown--><pre><code>string[] args = Environment.GetCommandLineArgs();

foreach(string arg in args) {
    // do something
}
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>