<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tommy&#039;s Blog</title>
	<atom:link href="http://blogs.gaixie.org/tommy/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blogs.gaixie.org/tommy</link>
	<description>life, family, technology... whatever.</description>
	<lastBuildDate>Tue, 03 Aug 2010 07:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>在处理 JavaBean 时，boolean 和 Boolean 的不同</title>
		<link>http://blogs.gaixie.org/tommy/?p=65</link>
		<comments>http://blogs.gaixie.org/tommy/?p=65#comments</comments>
		<pubDate>Tue, 03 Aug 2010 07:03:54 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=65</guid>
		<description><![CDATA[昨天在写一个 JavaBean 相关的程序时，发现不能正常的通过 getReadMethod().invoke(...) 读取 一个 Boolean 的属性值，最后总算找到了原因，真相总是如此简单! 首先这个属性在Bean中的定义如下： ...... private boolean married = false; private Boolean hasChildren; &#160; ...... &#160; public void setMarried&#40;boolean married&#41; &#123; this.married = married; &#125; public boolean isMarried&#40;&#41; &#123; return married; &#125; &#160; public void setHasChildren&#40;Boolean hasChildren&#41; &#123; this.hasChildren = hasChildren; &#125; public Boolean isHasChildren&#40;&#41; &#123; return hasChildren; &#125; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>昨天在写一个 <code>JavaBean</code> 相关的程序时，发现不能正常的通过 <code>getReadMethod().invoke(...)</code> 读取 一个 Boolean 的属性值，最后总算找到了原因，真相总是如此简单!<br />
首先这个属性在Bean中的定义如下：</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">......
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> married <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Boolean</span> hasChildren<span style="color: #339933;">;</span>
&nbsp;
......
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setMarried<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> married<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">married</span> <span style="color: #339933;">=</span> married<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> isMarried<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> married<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setHasChildren<span style="color: #009900;">&#40;</span><span style="color: #003399;">Boolean</span> hasChildren<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">hasChildren</span> <span style="color: #339933;">=</span> hasChildren<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Boolean</span> isHasChildren<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> hasChildren<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
......</pre></div></div>

<p>我通过下面的方式进行值的读取这两个属性</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">......
&nbsp;
<span style="color: #003399;">PropertyDescriptor</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> pds <span style="color: #339933;">=</span> 
    <span style="color: #003399;">Introspector</span>.<span style="color: #006633;">getBeanInfo</span><span style="color: #009900;">&#40;</span> o.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getPropertyDescriptors</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> pdi <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> pdi <span style="color: #339933;">&lt;</span> pds.<span style="color: #006633;">length</span><span style="color: #339933;">;</span> pdi <span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">Class</span> type <span style="color: #339933;">=</span> pds<span style="color: #009900;">&#91;</span>pdi<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getPropertyType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399;">String</span> name <span style="color: #339933;">=</span> pds<span style="color: #009900;">&#91;</span>pdi<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399;">Object</span> value <span style="color: #339933;">=</span> pds<span style="color: #009900;">&#91;</span>pdi<span style="color: #009900;">&#93;</span>.<span style="color: #006633;">getReadMethod</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">invoke</span><span style="color: #009900;">&#40;</span> o <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
......</pre></div></div>

<p>第一个属性能正常读出，第二个总是会报空指针错误，如果把 <code>isHasChildren()</code> 改为</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">Boolean</span> getHasChildren<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">return</span> hasChildren<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>则没问题，注意我的另一个属性用的也是<code>isMarried()</code> ，可以正常读取.<br />
最后发先，如果是 boolean ，<code>isMarried()</code> 或者是 <code>getMarried()</code> 都没问题，如果是Boolean ，则只能使用 <code>getHasChildren()</code>。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=65</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>将Extjs放入Maven中心库</title>
		<link>http://blogs.gaixie.org/tommy/?p=57</link>
		<comments>http://blogs.gaixie.org/tommy/?p=57#comments</comments>
		<pubDate>Thu, 29 Jul 2010 16:51:43 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[extjs]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[sonatype]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=57</guid>
		<description><![CDATA[总算比较完美的解决了extjs在maven下的依赖问题，过程如下： 首先将extjs作为一个单独的maven项目，通过maven-assembly-plugin插件做成一个zip包。 然后通过sonatype同步的maven中心库，这步最复杂 + 首先要向sonatype申请，主要是说明一下你的项目，例如它的描述，项目主页，代码库的位置等。 + 如果批准，你就可以通过maven-deploy-plugin插件将的包deploy到sonatype的一个零时库。 + 进入零时库后，你要通过一个管理界面将包放到sonatype的正式库，这步需要检验你的包是否规范，什么license, gpg签名，scm等信息一样都不能少。 + 如果进入sonatype的正式库，再向sonatype提出申请，要求激活与maven中心库的同步。 + 如果激活，过几个小时，就能看到你的包了。看看我的！ 以后有新版本，就不用再申请，只要保证你的包格式规范就行了。 全部过程最多也就2天时间，如果没有时差，估计更快。 大家以后再也不用在自己的代码库中保存extjs那一大堆文件了，直接通过maven导入extjs，如果有新版本的需要，请email给我。 ... &#60;dependency&#62; &#60;groupId&#62;org.gaixie.extjs-wrapped&#60;/groupId&#62; &#60;artifactId&#62;extjs-wrapped&#60;/artifactId&#62; &#60;version&#62;3.2.1&#60;/version&#62; &#60;type&#62;zip&#60;/type&#62; &#60;/dependency&#62; ... 然后通过 maven-war-plugin 插件的 overlay 把它解压到你的web项目目录中，配一下jetty，就可以很方便的调试了。可以参考我写的pom。 我是参考这几篇文章操作的： [1] http://www.jroller.com/holy/entry/releasing_a_project_to_maven [1] https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide]]></description>
			<content:encoded><![CDATA[<p>总算比较完美的解决了<code>extjs</code>在maven下的依赖问题，过程如下：</p>
<ul>
<li>首先将extjs作为一个单独的maven项目，通过<code>maven-assembly-plugin</code>插件做成一个zip包。</li>
<li>然后通过<code>sonatype</code>同步的maven中心库，这步最复杂<br />
+ 首先要向sonatype申请，主要是说明一下你的项目，例如它的描述，项目主页，代码库的位置等。<br />
+ 如果批准，你就可以通过<code>maven-deploy-plugin</code>插件将的包deploy到sonatype的一个零时库。<br />
+ 进入零时库后，你要通过一个管理界面将包放到sonatype的正式库，这步需要检验你的包是否规范，什么license, gpg签名，scm等信息一样都不能少。<br />
+ 如果进入sonatype的正式库，再向sonatype提出申请，要求激活与maven中心库的同步。<br />
+ 如果激活，过几个小时，就能看到你的包了。<a href="http://repo2.maven.org/maven2/org/gaixie/extjs-wrapped/">看看我的！</a></li>
<li>以后有新版本，就不用再申请，只要保证你的包格式规范就行了。</li>
<li>全部过程最多也就2天时间，如果没有时差，估计更快。</li>
</ul>
<p>大家以后再也不用在自己的代码库中保存extjs那一大堆文件了，直接通过maven导入extjs，如果有新版本的需要，请email给我。</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    ...
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.gaixie.extjs-wrapped<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>extjs-wrapped<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3.2.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>zip<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    ...</pre></div></div>

<p>然后通过 <code>maven-war-plugin</code> 插件的 <code>overlay</code> 把它解压到你的web项目目录中，配一下jetty，就可以很方便的调试了。可以参考<a href="http://repo.or.cz/w/jibu.git/blame/0cd2867fa259a058bfb9c4e4c921283bc29d5c37:/jibu-web/jibu-core-extjs/pom.xml">我写的pom。</a></p>
<p>我是参考这几篇文章操作的：<br />
[1] <a href="http://www.jroller.com/holy/entry/releasing_a_project_to_maven">http://www.jroller.com/holy/entry/releasing_a_project_to_maven</a><br />
[1] <a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=57</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PostgreSQL 与 Slony-I 的安装配置</title>
		<link>http://blogs.gaixie.org/tommy/?p=55</link>
		<comments>http://blogs.gaixie.org/tommy/?p=55#comments</comments>
		<pubDate>Thu, 22 Apr 2010 03:31:16 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[slony]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=55</guid>
		<description><![CDATA[公司主要使用的是 PostgreSQL 数据库，最近人员变动，我需要尽快掌握数据库实时备份的相关知识，一旦 master 数据库服务器出现故障，可以迅速的切换到 slave 数据库。本文档的测试环境，如下表： Master 192.168.0.194 Slave 192.168.0.199 操作系统 Fedora 12 Ubuntu 9.10 PostgreSQL 8.4.3 8.4.2 SlonyI 1.2.20 1.2.20 文档结构主要分为下面几个部分： 安装相关的软件包 配置 master 和 slave 数据库 SlonyI 的同步测试 数据库切换 Schema 改动 常见问题 参考文档 安装相关的软件包 ~~~~~~~~~~~~~ + Fedora sudo yum install postgresql-server PostgreSQL 装好后会自动创建一个名为 postgres 的数据库管理员用户，此用户没有密码，可用 root su 过去。 $ su -l postgres [...]]]></description>
			<content:encoded><![CDATA[<p>公司主要使用的是 PostgreSQL 数据库，最近人员变动，我需要尽快掌握数据库实时备份的相关知识，一旦 master 数据库服务器出现故障，可以迅速的切换到 slave 数据库。本文档的测试环境，如下表：</p>
<table>
<tr>
<td></td>
<th>Master 192.168.0.194</th>
<th>Slave 192.168.0.199</th>
</tr>
<tr>
<th>操作系统</th>
<td>Fedora 12</td>
<td>Ubuntu 9.10</td>
</tr>
<tr>
<th>PostgreSQL</th>
<td>8.4.3</td>
<td>8.4.2</td>
</tr>
<tr>
<th>SlonyI</th>
<td>1.2.20</td>
<td>1.2.20</td>
</tr>
</table>
<p>文档结构主要分为下面几个部分：</p>
<ul>
<li>安装相关的软件包</li>
<li>配置 master 和 slave 数据库</li>
<li>SlonyI 的同步测试</li>
<li>数据库切换</li>
<li>Schema 改动</li>
<li>常见问题</li>
<li>参考文档</li>
</ul>
<p><strong>安装相关的软件包</strong><br />
~~~~~~~~~~~~~<br />
<strong>+ Fedora</strong></p>
<pre>sudo yum install postgresql-server</pre>
<p>PostgreSQL 装好后会自动创建一个名为 postgres 的数据库管理员用户，此用户没有密码，可用 root su 过去。</p>
<pre>$ su -l postgres
$ initdb</pre>
<p>用root启动postgresql</p>
<pre>
$ sudo service postgresql start
$ sudo yum install pgadmin3</pre>
<p>修改postgresql.conf，是外部client可以通过tcp访问</p>
<pre>$ vi /var/lib/pgsql/data/postgresql.conf</pre>
<p>在 #listen_addresses = &#8216;localhost&#8217; 前面增加一行</p>
<pre>listen_addresses = '*'</pre>
<p>使同一网段的所有用户可以无须密码验证的使用 pgadmin 进行连接，修改 pg_hba.conf 文件</p>
<pre>$ vi /var/lib/pgsql/data/pg_hba.conf</pre>
<p>在文件最后增加一行</p>
<pre>host    all         all         192.168.0.1/24        trust</pre>
<p>注：上面的配置只是为了方便测试，生产环境不能这样配置，需要重启数据库</p>
<p>fedora默认的防火墙策略是拦截5432端口请求，修改iptables，让外部主机可以访问postgresql端口</p>
<pre>$ sudo vi /etc/sysconfig/iptables</pre>
<p>在 -A INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 22 -j ACCEPT 的下一行增加</p>
<pre>-A INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT</pre>
<p>重启防火墙</p>
<pre>$ sudo service iptables restart</pre>
<p>slony编译需要 pg_config，所以需要安装 postgresql-devel 包，否则在 ./configure 会提示未找到 pg_config</p>
<pre>$ sudo yum install postgresql-devel</pre>
<p>pg_config 可以输出 postgresql 的安装路经</p>
<pre>checking for pg_config... /usr/bin/pg_config
pg_config says pg_bindir is /usr/bin/
pg_config says pg_libdir is /usr/lib/
pg_config says pg_includedir is /usr/include/
pg_config says pg_pkglibdir is /usr/lib/pgsql/
pg_config says pg_includeserverdir is /usr/include/pgsql/server/
checking for correct version of PostgreSQL... 8.4
pg_config says pg_sharedir is /usr/share/pgsql/</pre>
<p>安装 bison 和 flex，否则 gmake all 时会报 Missing yacc parser.y parser.c 之类的错</p>
<pre>$ sudo yum install bison flex</pre>
<p>下载 slony 源码及文档，并用root安装</p>
<pre>$ wget http://www.slony.info/downloads/1.2/source/slony1-1.2.20-docs.tar.bz2
$ wget http://www.slony.info/downloads/1.2/source/slony1-1.2.20.tar.bz2
$ su
$ tar -vxjf slony1-1.2.20.tar.bz2
$ ./configure
$ gmake all
$ gmake install</pre>
<p><strong>+ Ubuntu</strong><br />
需要安装的软件包和 fedora 类似，具体的包名可能有点差别，openssh-server 开启 ssh 服务，方便远程控制。</p>
<pre>$ sudo aptitude update
$ sudo aptitude install openssh-server
$ sudo aptitude install postgresql
$ sudo aptitude install pgadmin3</pre>
<p>装完后默认已经执行了 initdb，由于ubuntu 没有 root 用户，所以 sudo -i 到postgres</p>
<pre>$ sudo -i -u postgres</pre>
<p>这里可能有字符集的问题，见常见问题部分。<br />
和 fedora 一样，修改 postgresql.conf，是外部 client 可以通过 tcp 访问</p>
<pre>$ vi /etc/postgresql/8.4/main/postgresql.conf</pre>
<p>在 #listen_addresses = &#8216;localhost&#8217; 前面增加一行</p>
<pre>listen_addresses = '*'</pre>
<p>同样需要修改 pg_hba.conf 文件</p>
<pre>$ sudo vi /etc/postgresql/8.4/main/pg_hba.conf</pre>
<p>在文件最后增加一行</p>
<pre>host    all         all         192.168.0.1/24        trust</pre>
<p>重启postgresql</p>
<pre>$ sudo -i -u postgres /etc/init.d/postgresql-8.4 restart</pre>
<p>参考前面 fedora下的 slony 配置，安装下面几个包</p>
<pre>$ sudo aptitude install postgresql-server-dev-8.4
$ sudo aptitude install bison flex</pre>
<p>pg_config的输出如下：</p>
<pre>checking for pg_config... /usr/bin/pg_config
pg_config says pg_bindir is /usr/lib/postgresql/8.4/bin/
pg_config says pg_libdir is /usr/lib/
pg_config says pg_includedir is /usr/include/postgresql/
pg_config says pg_pkglibdir is /usr/lib/postgresql/8.4/lib/
pg_config says pg_includeserverdir is /usr/include/postgresql/8.4/server/
checking for correct version of PostgreSQL... 8.4
pg_config says pg_sharedir is /usr/share/postgresql/8.4/</pre>
<p>slony的安装和 fedora 一样，注意ubuntu 中用make，不是 gmake</p>
<pre>$ wget http://www.slony.info/downloads/1.2/source/slony1-1.2.20.tar.bz2
$ sudo tar -vxjf slony1-1.2.20.tar.bz2
$ cd slony1-1.2.20
$ sudo ./configure
$ sudo make all
$ sudo make install</pre>
<p>默认slony被安装至 <code>/usr/lib/postgresql/8.4/bin/</code> 目录下。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=55</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 12 下配置Huawei EC1260 3G无线网卡</title>
		<link>http://blogs.gaixie.org/tommy/?p=51</link>
		<comments>http://blogs.gaixie.org/tommy/?p=51#comments</comments>
		<pubDate>Mon, 05 Apr 2010 13:31:30 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=51</guid>
		<description><![CDATA[Huawei EC1260 是一款中国电信的3G无线网卡，在Ubuntu 9.10上无须任何配置就可以运行，在Fedora 12上，却始终无法正常工作。试了很多方法，最后总算找到了解决方案。 kernel version: 2.6.32.9-70 usb_modeswitch version: 1.0.5 安装配置usb_modeswitch ~~~~~~~~~~~~~~~~~~~~~ 初次插入EC1260时，系统能自动识别Usb设备。 $ lsusb ... ID 12d1:1446 Huawei Technologies Co., Ltd.... 表示此usb 设备的 vendor = 0x12d1 , product = 0&#215;1446，但0&#215;1446这个设备并不是modem，而是zeroCD，它是一个存贮设备，里面有一些厂商提供的驱动(可以认为此模式下EC1260就是一个优盘)。所以，要把EC1260中第二个设备驱起来(也就是关键的3G Modem)，就需要安装一个usb_modeswitch的软件包，它的作用是切换网卡的工作模式，例如从zeroCD切换到modem。 $ sudo yum install usb_modeswitch 编辑usb_modeswitch的配置文件 $ sudo vi /etc/usb_modeswitch.conf 找找有没有 EC1260的配置项，有的话就打开注释，没有就添加下面内容 ######################################################## # Huawei EC1260 # DefaultVendor= 0x12d1 DefaultProduct= 0x1446 MessageEndPoint= [...]]]></description>
			<content:encoded><![CDATA[<p>Huawei EC1260 是一款中国电信的3G无线网卡，在Ubuntu 9.10上无须任何配置就可以运行，在Fedora 12上，却始终无法正常工作。试了很多方法，最后总算找到了解决方案。</p>
<pre>
kernel version: 2.6.32.9-70
usb_modeswitch version: 1.0.5</pre>
<p><strong>安装配置usb_modeswitch</strong><br />
~~~~~~~~~~~~~~~~~~~~~<br />
初次插入EC1260时，系统能自动识别Usb设备。</p>
<pre>$ lsusb
... ID 12d1:1446 Huawei Technologies Co., Ltd....</pre>
<p>表示此usb 设备的 vendor = 0x12d1 , product = 0&#215;1446，但0&#215;1446这个设备并不是modem，而是zeroCD，它是一个存贮设备，里面有一些厂商提供的驱动(可以认为此模式下EC1260就是一个优盘)。所以，要把EC1260中第二个设备驱起来(也就是关键的3G Modem)，就需要安装一个usb_modeswitch的软件包，它的作用是切换网卡的工作模式，例如从zeroCD切换到modem。</p>
<pre>$ sudo yum install usb_modeswitch</pre>
<p>编辑usb_modeswitch的配置文件</p>
<pre>$ sudo vi /etc/usb_modeswitch.conf</pre>
<p>找找有没有 EC1260的配置项，有的话就打开注释，没有就添加下面内容</p>
<pre>
########################################################
# Huawei EC1260
#

DefaultVendor= 0x12d1
DefaultProduct= 0x1446

MessageEndPoint= "0x01"
MessageContent="55534243123456780000000000000011060000000000000000000000000000"
</pre>
<p><strong>配置udev</strong><br />
~~~~~~~~<br />
新增一个udev配置文件，保证热拔插usb设备，也能将modem驱动起来</p>
<pre>$ sudo vi /etc/udev/rules.d/45-huaiwei-3g.rules</pre>
<p>只需在文件中添加下面内容</p>
<pre>ACTION=="add", SUBSYSTEM=="usb", SYSFS{idProduct}=="1446", SYSFS{idVendor}=="12d1",
RUN+="/lib/udev/modem-modeswitch --vendor 0x12d1 --product 0x1446 --type option-zerocd"</pre>
<p>重启电脑后，再次lsusb，会发现product已经变为 0&#215;1001，也就是我们要使用的无线modem，可以去network manager连接了。</p>
<p><strong>参考文档</strong><br />
~~~~~~~~<br />
[1] <a href="http://swiss.ubuntuforums.org/showthread.php?t=1246293">http://swiss.ubuntuforums.org/showthread.php?t=1246293</a><br />
[2] <a href="http://www.linuxquestions.org/questions/slackware-14/3g-modem-794337/">http://www.linuxquestions.org/questions/slackware-14/3g-modem-794337/</a><br />
[3] <a href="http://forums.fedoraforum.org/showthread.php?t=207393">http://forums.fedoraforum.org/showthread.php?t=207393</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=51</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Fedora 12上安装配置WordPress</title>
		<link>http://blogs.gaixie.org/tommy/?p=48</link>
		<comments>http://blogs.gaixie.org/tommy/?p=48#comments</comments>
		<pubDate>Thu, 04 Mar 2010 06:27:14 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=48</guid>
		<description><![CDATA[WordPress安装很简单，网上相关文档也很多，写此文档的目的是下次在Fedora上配置WordPress时，可以不用动脑子的 Ctrl+c, Ctrl+v。 安装Apache, MySQL, PHP ~~~~~~~~~~~~~~~~~~~~~ 如果在安装Fedora 12的时候选择了安装Web Server，那么Apache 和PHP引擎都会被默认安装。 执行下面命令进行MySQL安装时，会安装一个依赖包：perl-DBD-MySQL $ sudo yum install mysql mysql-server 设置boot时运行级别2,3,5启动mysqld，运行级别的说明见 /etc/inittab 注释，如果要关闭，把on改为off $ sudo chkconfig --levels 235 mysqld on 先手动把mysql启动起来 $ sudo /etc/init.d/mysqld start 为MySQL的root设置密码 $ sudo mysqladmin -u root password "xxxx" 安装WordPress ~~~~~~~~~~~~ 下载相应的版本：http://wordpress.org/download/release-archive/ 。 Fedora的Apache默认的DocumentRoot是/var/www/html，所以WordPress应该安装到此目录下，然后通过http://localhost/tommy来访问 $ wget http://wordpress.org/wordpress-2.8.6.tar.gz $ tar xzvf wordpress-2.8.6.tar.gz $ sudo [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress安装很简单，网上相关文档也很多，写此文档的目的是下次在Fedora上配置WordPress时，可以不用动脑子的<code> Ctrl+c, Ctrl+v</code>。</p>
<p><strong>安装Apache, MySQL, PHP</strong><br />
~~~~~~~~~~~~~~~~~~~~~<br />
如果在安装Fedora 12的时候选择了安装Web Server，那么Apache 和PHP引擎都会被默认安装。<br />
执行下面命令进行MySQL安装时，会安装一个依赖包：<code>perl-DBD-MySQL</code></p>
<pre>$ sudo yum install mysql mysql-server</pre>
<p>设置boot时运行级别2,3,5启动mysqld，运行级别的说明见 <code>/etc/inittab</code> 注释，如果要关闭，把on改为off</p>
<pre>$ sudo chkconfig --levels 235 mysqld on</pre>
<p>先手动把mysql启动起来</p>
<pre>$ sudo /etc/init.d/mysqld start </pre>
<p>为MySQL的root设置密码</p>
<pre>$ sudo mysqladmin -u root password "xxxx"  </pre>
<p><strong>安装WordPress</strong><br />
~~~~~~~~~~~~<br />
下载相应的版本：http://wordpress.org/download/release-archive/ 。<br />
Fedora的Apache默认的DocumentRoot是/var/www/html，所以WordPress应该安装到此目录下，然后通过<a href="http://localhost/tommy">http://localhost/tommy</a>来访问</p>
<pre>$ wget http://wordpress.org/wordpress-2.8.6.tar.gz
$ tar xzvf wordpress-2.8.6.tar.gz
$ sudo mv wordpress /var/www/html/tommy </pre>
<p>设置WordPress使用的MySQL库。<br />
增加一个tommy用户，并被授予操作wpdb库的所有权限，localhost限定tommy只能从本机连接库，WordPress文档中提示要flush privileges，实际上如果使用grant命令，就不需要flush。</p>
<pre>% mysql -u root -p
password: *****
mysql> create database wpdb;
mysql> grant all on wpdb.* to 'tommy'@'localhost' identified by '****';
mysql> exit    </pre>
<p>按照 wordpress安装包中的 <code>readme.html</code>，编辑 <code>wp-config</code> 文件，设置数据库名，用户及密码。</p>
<pre>$ cp /var/www/html/tommy/wp-config-sample.php /var/www/html/tommy/wp-config.php
$ vi /var/www/html/tommy/wp-config.php</pre>
<p>用浏览器打开 <code>/var/www/html/tommy/wp-admin/install.php</code> 文件，进行最后的配置。<br />
安装完成后，用自动生成的帐号登录，记得修改密码。</p>
<p><strong>WordPress数据恢复</strong><br />
~~~~~~~~~~~~~~~<br />
将备份出的WordPress数据恢复到新建的库 wpdb中</p>
<pre>$ mysql -u tommy -p'****' wpdb&lt;backup/wpdb.sql</pre>
<p>恢复theme，直接复制到 <code>/var/www/html/tommy/wp-content/themes</code>，我的theme保存在googlecode上，见<br />
<a href="http://blogs.gaixie.org/tommy/?p=5">Install mercurial 1.3.1 on debian lenny</a></p>
<pre>$ cd /var/www/html/tommy/wp-content/themes
$ hg clone https://bito.googlecode.com/hg/ bito</pre>
<p><strong>参考文档</strong><br />
~~~~~~~<br />
[1] <a href="http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-fedora-12-lamp">http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-fedora-12-lamp</a><br />
[2] <a href="http://dev.mysql.com/doc/refman/5.1/zh/installing.html#default-privileges">http://dev.mysql.com/doc/refman/5.1/zh/installing.html#default-privileges</a><br />
[3] <a href="http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client">http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client</a><br />
[4] <a href="http://dev.mysql.com/doc/refman/5.1/en/adding-users.html">http://dev.mysql.com/doc/refman/5.1/en/adding-users.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=48</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse默认的Java编译器</title>
		<link>http://blogs.gaixie.org/tommy/?p=46</link>
		<comments>http://blogs.gaixie.org/tommy/?p=46#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:45:36 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ecj]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=46</guid>
		<description><![CDATA[开发编译器门槛很高，Java 的编译器数的上的也就下面几种： 1. javac : 不用介绍了，也是最常见的。 2. GCJ (Compiler for Java) : GNU 项目比较常用，绝大多数 Linux 发行版的默认 Java 编译器。 3. ECJ (Eclipse Compiler for Java) : 大名鼎鼎的 eclipse 内置的编译器。 如果你不想在 eclipse 中使用 ECJ，想使用 javac 或者是 GCJ，就需要使用 Ant，在build.xml中指定编译器，全局替换掉 eclipse 默认的 ECJ 好像比较困难。关于这个问题的讨论见： http://dev.eclipse.org/newslists/news.eclipse.tools/msg17370.html 正是因为有了 ECJ ，所以即使你只安装了 JRE，也可以在 eclipse 中进行编译，它基本上算是为 eclipse 量身定做，所以效率不错。 网上没找到有关它们性能权威的分析，只有几个不太权威的测试： http://blog.mikiobraun.de/2008/08/benchmarking-javac-vs-ecj-on-array.html http://www.jroller.com/andyl/entry/sun_javac_vs_eclipse_ecj 对我来说，上面任何一种编译器都是值得尊敬的杰作，足够满足我日常的开发需要。]]></description>
			<content:encoded><![CDATA[<p>开发编译器门槛很高，Java 的编译器数的上的也就下面几种：<br />
<code>1. javac</code> : 不用介绍了，也是最常见的。<br />
<code>2. GCJ (Compiler for Java) </code>: GNU 项目比较常用，绝大多数 Linux 发行版的默认 Java 编译器。<br />
<code>3. ECJ (Eclipse Compiler for Java)</code> : 大名鼎鼎的 eclipse 内置的编译器。</p>
<p>如果你不想在 eclipse 中使用 ECJ，想使用 javac 或者是 GCJ，就需要使用 Ant，在<code>build.xml</code>中指定编译器，全局替换掉 eclipse 默认的 ECJ 好像比较困难。关于这个问题的讨论见：<br />
<a href="http://dev.eclipse.org/newslists/news.eclipse.tools/msg17370.html">http://dev.eclipse.org/newslists/news.eclipse.tools/msg17370.html</a></p>
<p>正是因为有了 ECJ ，所以即使你只安装了 JRE，也可以在 eclipse 中进行编译，它基本上算是为 eclipse 量身定做，所以效率不错。</p>
<p>网上没找到有关它们性能权威的分析，只有几个不太权威的测试：<br />
<a href="http://blog.mikiobraun.de/2008/08/benchmarking-javac-vs-ecj-on-array.html">http://blog.mikiobraun.de/2008/08/benchmarking-javac-vs-ecj-on-array.html</a><br />
<a href="http://www.jroller.com/andyl/entry/sun_javac_vs_eclipse_ecj">http://www.jroller.com/andyl/entry/sun_javac_vs_eclipse_ecj</a></p>
<p>对我来说，上面任何一种编译器都是值得尊敬的杰作，足够满足我日常的开发需要。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=46</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding Java Virtual Machine(JVM) memory usage</title>
		<link>http://blogs.gaixie.org/tommy/?p=43</link>
		<comments>http://blogs.gaixie.org/tommy/?p=43#comments</comments>
		<pubDate>Sun, 03 Jan 2010 16:13:41 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[jvm]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=43</guid>
		<description><![CDATA[Concept ~~~~~~~~~~~ 最近写程序需要了解一些JVM内存使用的知识，网上搜了一大圈，真是说什么的都有，还是老老实实在JVM规范和SUN的论坛找答案吧。JVM使用的内存分为： Stack Memory (栈内存) : 虚拟机的每一个线程都有一个私有的栈，当一个方法被调用时，下面内容被作为一个Frame (帧)被创建并且被压入栈中： + 局部变量：包括基本数据类型，对象的引用和返回值地址。 + 一个自己的操作栈：帧内局部变量进行运算时使用，也用于传递方法的参数和接受方法的返回值。 + 一个当前方法所在类的Runtime constant pool (常量池)的引用。 方法调用完成时，帧出栈，并销毁，无论方法是正常结束还是有未捕获的异常。 Heap Memory(堆内存) : 虚拟机的堆内存保存的是对象，类变量以及实例变量，它被所有线程共享，常说的垃圾回收就是对堆内存的回收。 +-----------------------+ &#124; &#160; &#160;Stack Memory &#160; &#160; &#160; &#124; ----------> 线程私有 +-----------------------+ &#124; &#160; &#160; &#160; &#160; ^ &#160; &#160; &#160; &#160; &#160; &#160; &#124; -------+ +---------&#124;-------------+ &#160; &#160; &#160; &#160;&#124; &#124; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Concept</strong><br />
~~~~~~~~~~~<br />
最近写程序需要了解一些JVM内存使用的知识，网上搜了一大圈，真是说什么的都有，还是老老实实在<a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html">JVM规范</a>和<a href="http://forums.sun.com/forum.jspa?forumID=32&#038;start=0">SUN的论坛</a>找答案吧。JVM使用的内存分为：</p>
<ul>
<li><a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#1732">Stack Memory (栈内存) </a> : 虚拟机的每一个线程都有一个私有的栈，当一个方法被调用时，下面内容被作为一个<a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#17257">Frame (帧)</a>被创建并且被压入栈中：<br />
+ 局部变量：包括基本数据类型，对象的引用和返回值地址。<br />
+ 一个自己的操作栈：帧内局部变量进行运算时使用，也用于传递方法的参数和接受方法的返回值。<br />
+ 一个当前方法所在类的<a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#22972">Runtime constant pool (常量池)</a>的引用。<br />
方法调用完成时，帧出栈，并销毁，无论方法是正常结束还是有未捕获的异常。</li>
<li><a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html#6654">Heap Memory(堆内存)</a> : 虚拟机的堆内存保存的是对象，类变量以及实例变量，它被所有线程共享，常说的垃圾回收就是对堆内存的回收。</li>
</ul>
<pre>
+-----------------------+
| &nbsp; &nbsp;Stack Memory &nbsp; &nbsp; &nbsp; | ----------> 线程私有
+-----------------------+
| &nbsp; &nbsp; &nbsp; &nbsp; ^ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | -------+
+---------|-------------+ &nbsp; &nbsp; &nbsp; &nbsp;|
| &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp;|
+----Heap Memory--------+ &nbsp; &nbsp; &nbsp; &nbsp;|
| &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp;|--> 线程共享
+---------|-------------+ &nbsp; &nbsp; &nbsp; &nbsp;|
| &nbsp; &nbsp; &nbsp; &nbsp; v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp;|
+-----------------------+ &nbsp; &nbsp; &nbsp; &nbsp;|
| &nbsp; &nbsp;Method Area &nbsp; &nbsp; &nbsp; &nbsp;| -------+
+-----------------------+
</pre>
<p>当JVM加载一个class时 ，将该类的一些信息保存到<code>Method Area</code>，包括<code>Runtime constant pool</code> ，方法数据，方法和构造器代码，域等。<code>Runtime constant pool </code>则包括类名，父类名，静态变量等。<br />
Method Area在逻辑上属于Heap。不过它垃圾回收与Heap可能不同，取决于JVM的实现。<br />
当通过<code>new Class()</code>方式创建一个实例时,JVM在<code>Method Area</code>寻址到该类的基本信息, 同时进行相关实例的初始化(包括实例变量)，存贮在<code>Heap</code>中。</p>
<p><strong>Example</strong><br />
~~~~~~~~~~~<br />
栈内存比堆内存小，但是效率高，所以更珍贵。下面的例子可以证明这一点，如何合理的配置和使用这两个内存，让应用的效率更高，是一个大命题，只能在实践中慢慢摸索。</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> x<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// 取stack运算的时间差（纳秒）</span>
    <span style="color: #000066; font-weight: bold;">long</span> start <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">nanoTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    stackAccess<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">long</span> end <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">nanoTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> start<span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;stackAccess:&quot;</span> <span style="color: #339933;">+</span> end<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// 取heap运算的时间差（纳秒）</span>
    start <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">nanoTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    heapAccess<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    end <span style="color: #339933;">=</span> <span style="color: #003399;">System</span>.<span style="color: #006633;">nanoTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> start<span style="color: #339933;">;</span>
    <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;heapAccess:&quot;</span> <span style="color: #339933;">+</span> end<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> stackAccess<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// 减少堆寻址的次数，提高效率</span>
    x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// x 是一个实例变量，存贮在堆中</span>
    <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> x<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// j 是一个局部变量，存贮在栈中</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        j <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    x <span style="color: #339933;">=</span> j<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> heapAccess<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// 每次循环x都去堆中寻址，降低效率</span>
    x <span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        x <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>静态变量是否会被垃圾回收？<br />
这是一个网上讨论异常激烈的问题，我是这样理解的：<br />
类的静态变量（类变量）存贮在Method Area(具体点说在<code>Runtime Constant Pool</code>)中，如果把它置为null，那么它所引用的对象会被GC。类变量自身不会被回收，除非类被卸载，也就是说：即使这个类的所有的实例都被回收，该类变量仍然存在，即使它引用一个空的对象。</p>
<p>什么时候使用静态变量？<br />
不用我多说（各种教程都有介绍），如果不想用静态变量，也可以尝试单态或者线程同步来实现对象共享，例如:</p>
<pre>Logger logger = LoggerFactory.getLogger(ClassA.class);</pre>
<p>在这种情况下，可以不用将logger置为static类型了。</p>
<p>由于水平有限，感觉JVM规范太抽象，对于具体实现介绍的不够详细，希望理解的没大问题。</p>
<p><strong>Reference</strong><br />
~~~~~~~~~~~<br />
[1] <a href="http://java.sun.com/docs/books/jvms/second_edition/html/Overview.doc.html">The Structure of the Java Virtual Machine</a><br />
[2] <a href="http://forums.sun.com/forum.jspa?forumID=32&#038;start=0">Sun Forums >  Desktop >  Runtime Environment</a><br />
[3] <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Picture-Mode.html#Picture-Mode">Picture-Mode</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=43</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Input chinese characters with emacs and scim</title>
		<link>http://blogs.gaixie.org/tommy/?p=41</link>
		<comments>http://blogs.gaixie.org/tommy/?p=41#comments</comments>
		<pubDate>Tue, 22 Dec 2009 15:23:05 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=41</guid>
		<description><![CDATA[不知是那儿配置有问题，在emacs下使用scim输入中文有时会出现乱码，下面是我摸索出来的规律： 环境：debian lenny , en_US.UTF-8 + 默认创建一份新文档(UTF-8)，能正常调出scim，但输入后显式为乱码。 + 如果文档本来就是UTF-8格式，并且包含汉字，则scim输入正常。 + 如果在.emacs中增加 (set-language-environment 'Chinese-GB)，则可以正常输入中文并显示，但是保存的文档格式为GBK，在其他编辑工具(如gedit)中打开会有乱码(默认是UTF-8，需要指定为GBK格式)。 + 如果在 .emacs 配置中加一行中文注释，如：;; 中文， 也能正常输入并显示，并且文件格式也是UTF-8。 + 如果用emacs中的内置输入法(setq default-input-method 'chinese-py-punct)， 一旦用 C+\ 激活了中文输入(甚至不用输入任何汉字)，紧接着 Ctrl+Space 调出scim，也可以正常输入。]]></description>
			<content:encoded><![CDATA[<p>不知是那儿配置有问题，在emacs下使用scim输入中文有时会出现乱码，下面是我摸索出来的规律：<br />
环境：debian lenny , en_US.UTF-8</p>
<p>+ 默认创建一份新文档(UTF-8)，能正常调出scim，但输入后显式为乱码。</p>
<p>+ 如果文档本来就是UTF-8格式，并且包含汉字，则scim输入正常。</p>
<p>+ 如果在<code>.emacs</code>中增加<code> (set-language-environment 'Chinese-GB)</code>，则可以正常输入中文并显示，但是保存的文档格式为<code>GBK</code>，在其他编辑工具(如gedit)中打开会有乱码(默认是UTF-8，需要指定为GBK格式)。</p>
<p>+ 如果在 <code>.emacs</code> 配置中加一行中文注释，如：<code>;; 中文</code>， 也能正常输入并显示，并且文件格式也是<code>UTF-8</code>。</p>
<p>+ 如果用emacs中的内置输入法<code>(setq default-input-method 'chinese-py-punct)</code>， 一旦用 <code>C+\</code> 激活了中文输入(甚至不用输入任何汉字)，紧接着 <code>Ctrl+Space</code> 调出scim，也可以正常输入。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install pptp-linux 1.7.2 on debian lenny</title>
		<link>http://blogs.gaixie.org/tommy/?p=31</link>
		<comments>http://blogs.gaixie.org/tommy/?p=31#comments</comments>
		<pubDate>Sun, 15 Nov 2009 15:35:17 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=31</guid>
		<description><![CDATA[同事给了我一个新的VPN帐号，windows能正常连接公司的VPN Server，可在linux中报下面错误： CHAP authentication failed: Authentication failed. CHAP authentication failed 查了半天，pptp-linux官方文档中的一句话点醒梦中人： if the passwords contain any special characters, quote them. 因为新帐号的密码含有特殊字符，只要将密码用双引号括起来就OK了。pptp-linux是个很好用的工具，感觉比Cisco官方的client（公司用的是Cisco设备）还要稳定。下面说说如何安装和配置pptp-linux： 安装 sudo aptitude install pptp-linux PPTP options $ sudo vi /etc/ppp/options.pptp options.pptp记录多个vpn连接的公用配置项，下面是我的配置： # Lock the port lock # Authentication # We don't need the tunnel server to authenticate itself noauth # We won't do [...]]]></description>
			<content:encoded><![CDATA[<p>同事给了我一个新的VPN帐号，windows能正常连接公司的VPN Server，可在linux中报下面错误：</p>
<pre>
CHAP authentication failed: Authentication failed.
CHAP authentication failed
</pre>
<p>查了半天，<a href="http://pptpclient.sourceforge.net/howto-debian.phtml">pptp-linux官方文档</a>中的一句话点醒梦中人：</p>
<blockquote><p>if the passwords contain any special characters, quote them. </p></blockquote>
<p>因为新帐号的密码含有特殊字符，只要将密码用双引号括起来就OK了。pptp-linux是个很好用的工具，感觉比Cisco官方的client（公司用的是Cisco设备）还要稳定。下面说说如何安装和配置pptp-linux：<span id="more-31"></span></p>
<p><strong>安装</strong></p>
<pre>sudo aptitude install pptp-linux</pre>
<p><strong>PPTP options</strong></p>
<pre>$ sudo vi /etc/ppp/options.pptp</pre>
<p>options.pptp记录多个vpn连接的公用配置项，下面是我的配置：</p>
<pre>
# Lock the port
lock

# Authentication
# We don't need the tunnel server to authenticate itself
noauth

# We won't do PAP, EAP, CHAP, or MSCHAP, but we will accept MSCHAP-V2
# (you may need to remove these refusals if the server is not using MPPE)
refuse-pap
refuse-eap
#refuse-chap
refuse-mschap

# Compression
# Turn off compression protocols we know won't be used
nobsdcomp
nodeflate

# Encryption
# (There have been multiple versions of PPP with encryption support,
# choose with of the following sections you will use.  Note that MPPE
# requires the use of MSCHAP-V2 during authentication)

# http://ppp.samba.org/ the PPP project version of PPP by Paul Mackarras
# ppp-2.4.2 or later with MPPE only, kernel module ppp_mppe.o
# {{{
# Require MPPE 128-bit encryption
#require-mppe-128
# }}}

# http://polbox.com/h/hs001/ fork from PPP project by Jan Dubiec
# ppp-2.4.2 or later with MPPE and MPPC, kernel module ppp_mppe_mppc.o
# {{{
# Require MPPE 128-bit encryption
#mppe required,stateless
# }}}
</pre>
<p>因为我们使用<a href="http://blog.csdn.net/networkcrazy/archive/2007/09/21/1794898.aspx">CHAP</a>进行身份认证，所以注释掉<code>refuse-chap</code>，同时还注释掉<code>require-mppe-128</code>，不用MPPE的支持。</p>
<p><strong>配置一个VPN连接</strong><br />
如果用CHAP进行认证，那么：</p>
<pre>$ sudo vi /etc/ppp/chap-secrets</pre>
<p>添加你的vpn帐户信息，没有的话问系统管理员要：</p>
<pre>
# Secrets for authentication using CHAP
# client	server	secret			IP addresses
username PPTP "password" *</pre>
<p>在<code>/etc/ppp/peers/</code>目录下，为指定vpn连接建立一个配置文件：</p>
<pre>$ sudo vi /etc/ppp/peers/gaixie</pre>
<p>内容如下：</p>
<pre>
pty "pptp vpn.server.ip --nolaunchpppd"
name username
remotename PPTP
file /etc/ppp/options.pptp
ipparam gaixie
</pre>
<p>把<code> vpn.server.ip</code>替换为你要连接的VPN Server的IP地址。</p>
<p><strong>配置路由</strong><br />
在<code>/etc/ppp/ip-up.d</code>新增一个<code>shell</code>文件：</p>
<pre>$ sudo vi /etc/ppp/ip-up.d/gaixie</pre>
<p>内容如下：</p>
<pre>
#!/bin/bash
NET="10.0.0.0/8" # set me
IFACE="ppp0" # set me
#IFACE=$1
route add -net ${NET} dev ${IFACE}
</pre>
<p>注意：如果使用无线网卡进行连接，无线网卡拨号后会先占用ppp0，应该将上面的ppp0改为ppp1。<br />
为此文件加上执行权限：</p>
<pre>$ sudo chmod +x /etc/ppp/ip-up.d/gaixie </pre>
<p>10.0.0.0/8 为<a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR表示法</a>，vpn连接时，会通过<code>/etc/ppp/ip-up</code>执行上面的脚本，从而加入正确的路由信息。</p>
<p><strong>测试连接</strong><br />
启动vpn连接</p>
<pre>$ sudo pon gaixie</pre>
<p>debug模式启动</p>
<pre>$ sudo pon gaixie debug dump logfd 2 nodetach </pre>
<p>断开vpn连接</p>
<pre>$ sudo poff gaixie  </pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=31</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Configuring Fetchmail, Exim4 and Mutt</title>
		<link>http://blogs.gaixie.org/tommy/?p=25</link>
		<comments>http://blogs.gaixie.org/tommy/?p=25#comments</comments>
		<pubDate>Wed, 11 Nov 2009 18:07:25 +0000</pubDate>
		<dc:creator>Tommy Wang</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[exim4]]></category>
		<category><![CDATA[fetchmail]]></category>
		<category><![CDATA[mutt]]></category>
		<category><![CDATA[procmail]]></category>

		<guid isPermaLink="false">http://blogs.gaixie.org/tommy/?p=25</guid>
		<description><![CDATA[MailConcept ~~~~~~~~~~~~~ 配置Mutt比想象的要复杂，因为在此之前我基本上对邮件服务是一窍不通，所以还是先了解邮件的基本原理，它主要包括下面几个部分： MTA (Mail Transfer Agent): 邮件传输代理，主要负责将邮件转发到目的服务器的MTA，MTA之间的通讯采用SMTP (Simple Mail Transfer Protocol)协议。流行的软件有： + http://www.sendmail.org + http://www.exim.org + http://www.postfix.org MDA (Mail Delivery Agent): 邮件投递代理，当邮件到达目的主机，不用再继续转发的时候，MTA会将邮件交给MDA，由它来投递到相应用户。本文用到的http://www.procmail.org/就是一款流行的MDA。 MRA (Mail Retrieval Agent): 邮件获取代理，负责以POP或者IMAP协议将远程邮件服务器的邮件取到本机。fetchmail就是一款典型的MRA。 MUA (Mail User Agent) 邮件用户代理，也就是经常使用的邮件客户端，主要功能是让用户管理和读取存贮在用户目录上的邮件。包括对邮件内容的加密和解密。典型的MUA有Mutt, Outlook, Foxmail, kmail, evolution等。 Mutt于其他客户端不同的是，它没有内置smtp的访问，也就是说它不能直接发送邮件，官方对此的解释是 &#8220;one task per tool&#8221; 符合Unix哲学。不过Mutt内置了一些MRA的基本功能，为什么这么做，可以参考：http://wiki.mutt.org/?MailConcept。本文仍然使用一个独立的MRA。 下图会有助于你理解上面的概念： +----------------------------------+ &#124;domain A &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>MailConcept</strong><br />
~~~~~~~~~~~~~<br />
配置<a href="http://www.mutt.org/">Mutt</a>比想象的要复杂，因为在此之前我基本上对邮件服务是一窍不通，所以还是先了解邮件的基本原理，它主要包括下面几个部分：</p>
<ul>
<li><code>MTA (Mail Transfer Agent)</code>: 邮件传输代理，主要负责将邮件转发到目的服务器的MTA，MTA之间的通讯采用<code>SMTP (Simple Mail Transfer Protocol)</code>协议。流行的软件有：<br />
   + <a href="http://www.sendmail.org">http://www.sendmail.org</a><br />
   + <a href="http://www.exim.org">http://www.exim.org</a><br />
   + <a href="http://www.postfix.org">http://www.postfix.org</a></li>
<li><code>MDA (Mail Delivery Agent)</code>: 邮件投递代理，当邮件到达目的主机，不用再继续转发的时候，MTA会将邮件交给MDA，由它来投递到相应用户。本文用到的<a href="http://www.procmail.org/">http://www.procmail.org/</a>就是一款流行的MDA。</li>
<li><code>MRA (Mail Retrieval Agent)</code>: 邮件获取代理，负责以POP或者IMAP协议将远程邮件服务器的邮件取到本机。<a href="http://fetchmail.berlios.de/">fetchmail</a>就是一款典型的MRA。</li>
<li><code>MUA (Mail User Agent)</code> 邮件用户代理，也就是经常使用的邮件客户端，主要功能是让用户管理和读取存贮在用户目录上的邮件。包括对邮件内容的加密和解密。典型的MUA有Mutt, Outlook, Foxmail, kmail, evolution等。<br />
Mutt于其他客户端不同的是，它没有内置smtp的访问，也就是说它不能直接发送邮件，官方对此的解释是 &#8220;one task per tool&#8221; 符合Unix哲学。不过Mutt内置了一些MRA的基本功能，为什么这么做，可以参考：<a href="http://wiki.mutt.org/?MailConcept">http://wiki.mutt.org/?MailConcept</a>。本文仍然使用一个独立的MRA。</li>
</ul>
<p>下图会有助于你理解上面的概念：</p>
<pre>
+----------------------------------+
|domain A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|
|MUA (mutt) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|
|tommy send two mails(bob@A,bito@B)|
+----------------------------------+
&nbsp; &nbsp; &nbsp; |
&nbsp; &nbsp; &nbsp; |
&nbsp; &nbsp; &nbsp; v
+----------+ bito@B &nbsp;+----------+ bito@B &nbsp;+----------+
|domain A &nbsp;|non-local|domain B &nbsp;| local &nbsp; |domain B &nbsp;|
| &nbsp; MTA &nbsp; &nbsp;|--------&gt;| &nbsp; MTA &nbsp; &nbsp;|--------&gt;| &nbsp; MDA &nbsp; &nbsp;|
| &nbsp;Check &nbsp; | &nbsp;SMTP &nbsp; | &nbsp;Check &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|
+----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+
&nbsp; &nbsp; &nbsp; |bob@A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|
&nbsp; &nbsp; &nbsp; |local &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|deliver
&nbsp; &nbsp; &nbsp; v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v
+----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+
|domain A &nbsp;| bito@B &nbsp;|domain A &nbsp;| bito@B &nbsp;|domain B &nbsp;|
| &nbsp; MDA &nbsp; &nbsp;|&lt;--------| &nbsp; MRA &nbsp; &nbsp;|&lt;--------|bito's &nbsp; &nbsp;|
| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| POP/IMAP|mail box &nbsp;|
+----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+ &nbsp; &nbsp; &nbsp; &nbsp; +----------+
&nbsp; &nbsp; &nbsp; |deliver(bob is bito)
&nbsp; &nbsp; &nbsp; |bob@A,bito@B
&nbsp; &nbsp; &nbsp; v
+----------+ &nbsp; &nbsp; &nbsp; &nbsp; +-------------------------------+
|domain A &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; |domain A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |
|bob's &nbsp; &nbsp; |--------&gt;|MUA (mutt) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |
|mail box &nbsp;| &nbsp; &nbsp; &nbsp; &nbsp; |bob get two mails(bob@A,bito@B)|
+----------+ &nbsp; &nbsp; &nbsp; &nbsp; +-------------------------------+
</pre>
<p><span id="more-25"></span><br />
<strong>Exim4</strong><br />
~~~~~~~<br />
Debian lenny已经内置了Exim4，所以执行通过下面命令进行配置：</p>
<pre>$ dpkg-reconfigure exim4-config</pre>
<p>如何配置可以参考<a href="http://wiki.debian.org/GmailAndExim4">http://wiki.debian.org/GmailAndExim4</a>，完成后查看<br />
/etc/exim4/update-exim4.conf.conf的内容为：</p>
<pre>
dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'</pre>
<p>修改passwd.client文件，添加gmail帐户</p>
<pre>
gmail-smtp.l.google.com:yourname@gmail.com:yourpassword
*.google.com:yourname@gmail.com:yourpassword
smtp.gmail.com:yourname@gmail.com:yourpassword
</pre>
<p><strong>Fetchmail</strong><br />
~~~~~~~~~~~<br />
安装fetchmail:</p>
<pre>$ sudo aptitude install fetchmail</pre>
<p>在用户根目录下建立fetchmail的配置文件：</p>
<pre>$ vi ~/.fetchmailrc</pre>
<p>添加下面内容，使fetchmail以imap协议连接gmail，并获得邮件。</p>
<pre>set postmaster tommy
set bouncemail
poll imap.gmail.com with proto IMAP
user 'yourname' there with password 'yourpassord' is 'tommy' here
mda "/usr/bin/procmail -d %T"
keep
ssl
sslcertck
sslcertpath /etc/ssl/certs</pre>
<p>这里面有明文密码，所以上权限，安全一点：</p>
<pre>$ chmod 600 .fetchmailrc</pre>
<p>这时候实际上已经可以从gmail server上获取邮件了。试一下：</p>
<pre>$ fetchmail -v</pre>
<p>如果有新邮件，会在 /var/spool/mail/tommy下，将fetchmail加到crontab中，这里让它每4个小时取一下新邮件：</p>
<pre># m h  dom mon dow   command
0 */4 * * * /usr/bin/fetchmail --silent --syslog</pre>
<p><strong>Procmail</strong><br />
~~~~~~~~~~<br />
procmail是debian默认已经装好了，这里只需要配置它，依然先建立一个配置文件：</p>
<pre>$ vi ~/.procmailrc</pre>
<p>并加入下面内容：</p>
<pre>PATH=/bin:/usr/bin:/usr/local/bin
MAILDIR=$HOME/mail</pre>
<p>因为没有设置默认的投递路径，所以procmail会将tommy的邮件投递到/var/mail/tommy下。</p>
<p><strong>Mutt</strong><br />
~~~~~~<br />
mutt也是debian默认装好的，也只需配置它，继续建配置文件：</p>
<pre>#======================================================#
# Folders
set folder="$HOME/mail"      # Local mailboxes stored here
set record="+sent"           # Where to store sent messages
set mbox="+mbox"
set postponed="+postponed"   # Where to store draft messages
set mbox_type=mbox           # Mailbox type
set move=no                  # Don't move mail from spool</pre>
<p>有了上面这几句，mutt就可以读取你用fetchmail取得的邮件了。</p>
<p><strong>Reference</strong><br />
~~~~~~~~~~~<br />
[1] <a href="http://wiki.debian.org/GmailAndExim4">http://wiki.debian.org/GmailAndExim4</a><br />
[2] <a href="http://www.cs.ru.nl/~tews/user-smarthost.html">http://www.cs.ru.nl/~tews/user-smarthost.html</a><br />
[3] <a href="http://www.andrews-corner.org/mutt.html">Using Mutt with Gmail</a><br />
[4] <a href="http://www.howtoforge.com/debian_etch_fetchmail">Retrieving Emails From Remote Servers With fetchmail (Debian Etch)</a><br />
[5] <a href="http://www.gentoo.org/doc/zh_cn/guide-to-mutt.xml">Mutt电子邮件快速入门指南</a><br />
[6] <a href="http://wiki.mutt.org/index.cgi?MuttGuide"> http://wiki.mutt.org/index.cgi?MuttGuide</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gaixie.org/tommy/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
