<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
  <channel>
    <title>jimlaren</title>
    <description>个人观点，仅供参考，如有雷同，纯属巧合。</description>
    <link>http://jimlaren.javaeye.com</link>
    <language>UTF-8</language>
    <copyright>Copyright 2003-2008, JavaEye.com</copyright>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <generator>JavaEye - 做最棒的软件开发交流社区</generator>
      <item>
        <title>运行多个firefox portable实例</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/182388" style="color:red;">http://jimlaren.javaeye.com/blog/182388</a>&nbsp;
          发表时间: 2008年04月13日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>1、拷贝Other\FirefoxPortableSource\FirefoxPortable.ini到根目录，跟firefoxportable.exe同一个目录</p>
<p>2、修改AllowMultipleInstances=true</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/182388#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Sun, 13 Apr 2008 22:03:35 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/182388</link>
        <guid>http://jimlaren.javaeye.com/blog/182388</guid>
      </item>
      <item>
        <title>c3p0错误</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/137103" style="color:red;">http://jimlaren.javaeye.com/blog/137103</a>&nbsp;
          发表时间: 2007年10月31日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>把max_statements设置为0。 <br />
c3p0在同时关闭statement和connection的时候，或者关闭他们之间的时间很短的时候，有时候connection并没有被关闭，因为有些preparedstatement还在被cached住。这是c3p0的作者自己说的。 <br />
<a href="http://forum.hibernate.org/viewtopic.php?t=947246&amp;highlight=apparent+deadlock+c3p0" target="blank">http://forum.hibernate.org/viewtopic.php?t=947246&amp;highlight=apparent+deadlock+c3p0</a></p>
<p>C3P0增加以下配置信息:</p>
<div class="dp-highlighter">
<div class="bar">&nbsp;</div>
<ol class="dp-j">
    <li class="alt"><span><span class="comment">//set&nbsp;to&nbsp;'SELECT&nbsp;1'&nbsp;&nbsp;&nbsp; </span><span>&nbsp;&nbsp;</span></span> </li>
    <li class=""><span>preferredTestQuery&nbsp;=&nbsp;'SELECT&nbsp;</span><span class="number">1</span><span>'&nbsp; &nbsp;&nbsp;</span> </li>
    <li class="alt"><span>&nbsp;</span><span class="comment">//set&nbsp;to&nbsp;something&nbsp;much&nbsp;less&nbsp;than&nbsp;wait_timeout,&nbsp;prevents&nbsp;connections&nbsp;from&nbsp;going&nbsp;stale </span><span>&nbsp;&nbsp;</span> </li>
    <li class=""><span>idleConnectionTestPeriod&nbsp;=&nbsp;</span><span class="number">18000</span><span>&nbsp;&nbsp; &nbsp;&nbsp;</span> </li>
    <li class="alt"><span></span><span class="comment">//set&nbsp;to&nbsp;something&nbsp;slightly&nbsp;less&nbsp;than&nbsp;wait_timeout,&nbsp;preventing&nbsp;'stale'&nbsp;connections&nbsp;from&nbsp;being&nbsp;handed&nbsp;out </span><span>&nbsp;&nbsp;</span> </li>
    <li class=""><span>maxIdleTime&nbsp;=&nbsp;</span><span class="number">25000</span><span>&nbsp; &nbsp;&nbsp;</span> </li>
    <li class="alt"><span></span><span class="comment">//if&nbsp;you&nbsp;can&nbsp;take&nbsp;the&nbsp;performance&nbsp;'hit',&nbsp;set&nbsp;to&nbsp;&quot;true&quot; </span><span>&nbsp;&nbsp;</span> </li>
    <li class=""><span>testConnectionOnCheckout&nbsp;=&nbsp;</span><span class="keyword">true</span><span>&nbsp;&nbsp;&nbsp;&nbsp;</span> </li>
</ol>
</div>
<p>&nbsp;</p>
<p>A <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span> pool with the settings you have should recover from a database reset, but that doesn't mean you will never see an Exception. Stale Connections from the old database session will still be broken, and if those Connections have already been checked out, or if they are in the pool and not tested on checkout, the application will see the broken Connection, in the form of an Exception. <br />
<br />
You can use <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span> to minimize the likelihood that your application will see a stale Connection on database shutdown/restart. The most reliable means of preventing this is to set hibernate.<span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.validate to true (in a hibernate application -- all other <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span> apps should use the <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>-native property <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.testConnectionOnCheckout). If you set this property to true, <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span> will test Connections prior to checkout, and your app will never see a stale Connection on database restart unless the Connection had already been checked out when the database went down. <br />
<br />
Another less reliable, but potentially less expensive, strategy is to set <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.testConnectionsOnCheckin and hibernate.<span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.idle_test_period (<span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>-native <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.idleConnectionTestPeriod) to a low value, in which case all connection tests are asynchronous and you are guanteed that no Connection will be checked out that hasn't been tested in the last idle_test_period seconds. Thus, your app will only see broken Connections from the pool if Connections are checked out during a short window of time. <br />
<br />
In either case, I recommend setting &quot;<span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.preferredTestQuery&quot; or &quot;<span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>.automaticTestTable&quot; in your <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span> properties file, as <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>'s default Connection test is often slow. <br />
<br />
See &quot;Configuring Connection Testing&quot; in <span style="COLOR: rgb(255,0,0)"><strong>c3p0</strong></span>'s docs for more information. </p>
<p>&nbsp;</p>
<p>在使用c3p0作为连接池时，其中的一些配置参数需要修改。主要是maxIdleTime和idleConnectionTestPeriod。 MySQL默认是8小时（28800秒）后自动关闭已打开的连接，所以c3p0要在8小时内关闭不使用的连接，上面的2参数要小于28800秒。附上在 hibernate中配置c3p0的关键字。</p>
<div>c3p0-native property name hibernate configuration key
<table>
    <tbody>
        <tr>
        </tr>
        <tr>
            <td>c3p0.acquireIncrement</td>
            <td>hibernate.c3p0.acquire_increment</td>
        </tr>
        <tr>
            <td>c3p0.idleConnectionTestPeriod</td>
            <td>hibernate.c3p0.idle_test_period</td>
        </tr>
        <tr>
            <td>c3p0.initialPoolSize</td>
            <td><span>not available -- uses minimum size</span></td>
        </tr>
        <tr>
            <td>c3p0.maxIdleTime</td>
            <td>hibernate.c3p0.timeout</td>
        </tr>
        <tr>
            <td>c3p0.maxPoolSize</td>
            <td>hibernate.c3p0.max_size</td>
        </tr>
        <tr>
            <td>c3p0.maxStatements</td>
            <td>hibernate.c3p0.max_statements</td>
        </tr>
        <tr>
            <td>c3p0.minPoolSize</td>
            <td>hibernate.c3p0.min_size</td>
        </tr>
    </tbody>
</table>
</div>
<p>&nbsp;</p>
<p class="diaryFoot">&nbsp;</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/137103#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 31 Oct 2007 20:56:05 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/137103</link>
        <guid>http://jimlaren.javaeye.com/blog/137103</guid>
      </item>
      <item>
        <title>vim</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/64460" style="color:red;">http://jimlaren.javaeye.com/blog/64460</a>&nbsp;
          发表时间: 2007年03月21日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText"><span class="docEmphBold">When you need to edit a configuration  file from the command line in a pinch, use these tips for the ins and  (especially) outs of vim.</span> </p>
<p class="docText"><a name="ID-ID-d3203e0-942348"></a><a name="ID-ID-d3206e0-942346"></a>If one thing is for sure about Linux, it's that it  has no shortage of text editors. This reflects the largely text-based nature of  Linux, from the command line, to the source code, to the configuration files  that programs refer to. When you are in a desktop environment, you can use one  of many graphical tools to edit text files; however, in an emergency situation,  or when logged into a machine remotely, you may need to fall back on a  command-line <a name="ID-ID-d3209e0-941662"></a>text editor. Under Ubuntu, the  default text editor is <em><a name="ID-ID-d3212e0-941663"></a>vim</em>, and this  hack provides you with the basic information you need to make changes to  configuration files using <em>vim</em>.</p>
<p class="docText">The <em><a name="ID-ID-d3216e0-941664"></a><a name="ID-ID-d3219e0-942489"></a>vi</em> editor has a rather mixed reputation. Some  people love how quickly you can edit files with it, and others hate its steep  learning curve. The <em>vim</em> editor (short for &quot;Vi IMproved&quot;) takes <em>vi</em>  and adds not only a number of powerful improvements, but also a number of  user-friendly changes such as a complete, integrated help environment. Ubuntu  includes <em>vim</em> by default, and even if you run <em>vi</em>, you are actually  running <em>vim</em> in a <em>vi</em>-like emulation mode.</p>
<p class="docText">So, to edit a file, run <em>vim</em> on the command line followed  by the filename as an argument. For instance, to edit the filesystem table  (<em>/etc/fstab</em>), type:</p>
<pre>$ <strong>sudo vim /etc/fstab</strong><br />         </pre>
<br />
<p class="docText">Unlike most other editors you may be used to, <em><a name="ID-ID-d3222e0-941674"></a>vim</em> operates via a number of <em>modes</em>.  Different keys perform different functions depending on which mode you are in.  (This can be rather confusing the first time you use <em>vim</em>, since you will  start typing only to see all sorts of strange and undesirable behavior.) For  starters, there are two main modes you will be operating in: Normal mode (for  navigating the file) and Insert mode (for editing text).</p>
<a name="ID-d3178e557-NavigateThroughtheFile639840"></a>
<h4 class="docSection2Title" id="title-IDAOJIWH">Navigate Through the File</h4>
<p class="docText"><a name="ID-ID-d3225e0-941675"></a>Normal mode is the main mode  you default to when you start <em>vim</em>. In this mode, you use a number of  different keys to move through the file. <a href="#ID-50863:TableLabel:Table8-1" class="docLink">Table 8-1</a> lists some of the main  navigation keys and their functions.</p>
<a name="ID-50863:TableLabel:Table8-1"></a>
<p>
<table cellspacing="0" rules="all" border="1" height="357" cellpadding="4" width="686">
    <caption>
    <h5 class="docTableTitle">Table VIM Normal Mode keybindings</h5>
    </caption> <colgroup span="2"></colgroup>
    <thead>
        <tr>
            <th scope="col" class="thead">Navigation key</th>
            <th scope="col" class="thead">nction</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="docTableCell">h, j, k, l</td>
            <td class="docTableCell">Move left, up, down, or right, respectively. The arrow  keys will also move the cursor. </td>
        </tr>
        <tr>
            <td class="docTableCell">w, b</td>
            <td class="docTableCell">Move forward or backword one word at a time,  respectively. Useful when you want to skip through a file quickly. </td>
        </tr>
        <tr>
            <td class="docTableCell">^, $</td>
            <td class="docTableCell">Move to the beginning or the end of the current line,  respectively. </td>
        </tr>
        <tr>
            <td class="docTableCell">gg, G</td>
            <td class="docTableCell">Move to the beginning or the end of the file,  respectively. </td>
        </tr>
        <tr>
            <td class="docTableCell"><tt>:</tt> <tt><em>number</em></tt> </td>
            <td class="docTableCell">Move to the specified line number in the file. </td>
        </tr>
        <tr>
            <td class="docTableCell"><tt>/</tt> <tt><em>keyword</em></tt> </td>
            <td class="docTableCell">Search for the specified keyword; hit n to move to the  next keyword. </td>
        </tr>
    </tbody>
</table>
</p>
<br />
<a name="ID-d3178e1143-EditaLine639851"></a>
<h4 class="docSection2Title" id="title-IDASMIWH">Edit a Line</h4>
<p class="docText"><a name="ID-ID-d3228e0-941677"></a>Once you have moved to where  you wish to edit, you have a number of different options to edit a line. If you  simply need to delete some text, the x key will delete the character under the  current cursor. To add or change text, you will need to switch to Insert mode.  Once in Insert mode, <span class="docEmphasis">vim</span> behaves a lot like other  text editors; when you type a particular key, it will appear in the file. There  are a number of ways to get into Insert mode, depending on where you want to  start editing, but the simplest is to hit i, which will let you edit at the  current position of the cursor.</p>
<p class="docText">Once in Insert mode, you can make any changes you need to a  particular file. You can hit the Backspace or Delete key to delete characters  and can still use the arrow keys to move around in the file. Once you are  finished, hit the Esc key to exit Insert mode.</p>
<a name="ID-d3178e1199-CopyandPaste639857"></a>
<h4 class="docSection2Title" id="title-IDAHNIWH">Copy and Paste</h4>
<p class="docText"><a name="ID-ID-d3231e0-941678"></a>Sometimes when editing a file  it is useful to copy and paste one line or a section of a line to another line.  There are a number of ways to do so, some faster than others, but for new  <em>vim</em> users, one of the easiest ways is through <em>vim</em>'s Visual mode.  To select a portion of text, type Esc until you are in Normal mode, move to the  beginning of the text you want to copy, and then hit the v key to switch to  Visual mode. Now move the cursor as normal, and you will notice that characters  will be selected as it moves. When you have selected all of the characters you  want, hit the y key to copy (or yank) the text. Then move to where you want to  paste it and hit p.</p>
<p>
<table cellspacing="0" border="0" align="center" bgcolor="black" cellpadding="1" width="90%">
    <tbody>
        <tr>
            <td>
            <table cellspacing="0" border="0" bgcolor="white" cellpadding="6" width="100%">
                <tbody>
                    <tr>
                        <td valign="top" width="60"><img src="images/pushpin.jpg" height="51" alt="" width="52" /></td>
                        <td valign="top">
                        <p class="docText">If you know you want to copy full lines at a time, enter Visual  mode with capital V instead of v. Now move up or down to select a number of  lines and type y to copy and then p to paste your  lines.</p>
                        </td>
                    </tr>
                </tbody>
            </table>
            </td>
        </tr>
    </tbody>
</table>
</p>
<br />
<a name="ID-d3178e1265-Undo639865"></a>
<h4 class="docSection2Title" id="title-IDACOIWH">Undo</h4>
<p class="docText"><a name="ID-ID-d3234e0-941679"></a>Once nice feature that  <em>vim</em> has that <em>vi</em> doesn't is unlimited undos. If you make a mistake  and want to undo it, hit Esc until you are in Normal mode, and then simply type  the u key to step back through each edit. If you find you need to redo a change,  type Ctrl-R.</p>
<a name="ID-d3178e1310-SaveandExit639869"></a>
<h4 class="docSection2Title" id="title-IDAXOIWH">Save and Exit</h4>
<p class="docText"><a name="ID-ID-d3237e0-941680"></a>After you have made your  changes and are ready to save, you need to switch to Command mode. Command mode  lets you run special <em>vim</em> commands, including the commands you need to  save changes and exit. To save (or write) your changes, type <tt>:w</tt> and  press Enter. When you are ready to quit, type <tt>:q</tt> and press Enter. You  can also combine these two commands into a single command, and type <tt>:wq</tt>  and press Enter.</p>
<a name="ID-d3178e1366-SearchandReplace639873"></a>
<h4 class="docSection2Title" id="title-IDAQPIWH">Search and Replace</h4>
<p class="docText"><a name="ID-ID-d3240e0-941681"></a>A common need when editing  files is to substitute one word for another throughout the file. To do so in  <em>vim</em>, type:</p>
<pre>:s/<tt><em>word</em></tt>/<tt><em>replacement</em></tt>/g</pre>
<br />
<p class="docText">to change all instances of the word on a particular line. To  change all instances of the word within a file, type:</p>
<pre>:%s/<tt><em>word</em></tt>/<tt><em>replacement</em></tt>/g</pre>
<br />
<p class="docText">If you want to give confirmation before making each change, add  a <tt>c</tt> to the end of the command:</p>
<pre>:%s/<tt><em>word</em></tt>/<tt><em>replacement</em></tt>/gc</pre>
<br />
<p class="docText">and <em>vim</em> will ask you before it makes any changes.</p>
<p class="docText">One particularly handy use of the search-and-replace feature  when editing configuration files is for commenting or uncommenting multiple  lines in the file. To do so, enter Visual mode, select each line you want to  comment, and then type:</p>
<pre>:s/^/#/</pre>
<br />
<p class="docText">to comment the lines out with the <tt>#</tt> character. Replace  <tt>#</tt> with whatever character that file uses for comments. If you instead  want to uncomment a number of lines, select them in Visual mode and then  type:</p>
<pre>:s/^#//</pre>
<br />
<p class="docText">or replace <tt>#</tt> with the character your file uses for  comments.</p>
<a name="ID-d3178e1558-Help639899"></a>
<h4 class="docSection2Title" id="title-IDAZBJWH">Help</h4>
<p class="docText"><a name="ID-ID-d3243e0-941682"></a>If you find you are lost, or  you just want some help with <em>vim</em>'s options, type:</p>
<pre>:help</pre>
<br />
<p class="docText">to enter <em>vim</em>'s help screen. You can also follow  <tt>:help</tt> with a particular keyword, so if you want to find out what the w  key does, for instance, type:</p>
<pre>:help w</pre>
<br />
<a name="ID-d3178e1636-WheretoLearnMore639909"></a>
<h4 class="docSection2Title" id="title-IDAXCJWH">Where to Learn More</h4>
<p class="docText"><a name="ID-ID-d3246e0-941683"></a>This hack is by no means an  exhaustive tutorial on how to use <em>vim</em>. <em>vim</em> has a number of  advanced and powerful features that, once learned, allow you to make rapid  changes to files. If you want to know more about <em>vim</em>'s features and how  to use them, type:</p>
<pre>$ <strong>vimtutor</strong><br />            </pre>
<br />
<p class="docText">at the command line to try <em>vim</em>'s built-in interactive  tutorial program.<a name="ID-ID-d3249e0-942342"></a> <a name="ID-ID-d3252e0-942340"></a><a name="ID-ID-d3255e0-941670"></a><a name="ID-ID-d3259e0-941684"></a></p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/64460#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 21 Mar 2007 22:22:00 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/64460</link>
        <guid>http://jimlaren.javaeye.com/blog/64460</guid>
      </item>
      <item>
        <title>[转载]VIM中常用的替换模式总结</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/64462" style="color:red;">http://jimlaren.javaeye.com/blog/64462</a>&nbsp;
          发表时间: 2007年03月21日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p>1，简单替换表达式</p>
<p>替换命令可以在全文中用一个单词替换另一个单词：</p>
<p>:%s/four/4/g</p>
<p> </p>
<p>&ldquo;%&rdquo; 范围前缀表示在所有行中执行替换。最后的 &ldquo;g&rdquo; 标记表示替换行中的所有匹配点。如果仅仅对当前行进行操作，那么只要去掉%即可</p>
<p>  如果你有一个象 &ldquo;thirtyfour&rdquo; 这样的单词，上面的命令会出错。这种情况下，这个单词会被替换成&rdquo;thirty4&Prime;。要解决这个问题，用 &ldquo;\&lt;&rdquo; 来指定匹配单词开头：</p>
<p>       :%s/\<four></four></p>
<p>显然，这样在处理 &ldquo;fourty&rdquo; 的时候还是会出错。用 &ldquo;\&gt;&rdquo; 来解决这个问题：</p>
<p>       :%s/\</p>
<p>如果你在编码，你可能只想替换注释中的 &ldquo;four&rdquo;，而保留代码中的。由于这很难指定，可以在替换命令中加一个 &ldquo;c&rdquo; 标记，这样，Vim 会在每次替换前提示你：</p>
<p>       :%s/\</p>
<p>2，删除多余的空格</p>
<p>要删除这些每行后面多余的空格，可以执行如下命令：</p>
<p>       :%s/\s\+$//</p>
<p>命令前面指明范围是 &ldquo;%&rdquo;，所以这会作用于整个文件。&rdquo;substitute&rdquo; 命令的匹配模式是</p>
<p>&ldquo;\s\+$&rdquo;。这表示行末（$）前的一个或者多个（\+）空格（\s）。替换命令的 &ldquo;to&rdquo; 部分是空的：&rdquo;//&rdquo;。这样就会删除那些匹配的空白字符。</p>
<p>3，匹配重复性模式</p>
<p>星号项 &ldquo;*&rdquo; 规定在它前面的项可以重复任意次。因此:</p>
<p>       /a*</p>
<p>匹配 &ldquo;a&rdquo;，&rdquo;aa&rdquo;，&rdquo;aaa&rdquo;，等等。但也匹配 &ldquo;&rdquo; (空字串)，因为零次也包含在内。星号 &ldquo;*&rdquo; 仅仅应用于那个紧邻在它前面的项。因此 &ldquo;ab*&rdquo; 匹配 &ldquo;a&rdquo;，&rdquo;ab&rdquo;，&rdquo;abb&rdquo;,&rdquo;abbb&rdquo;，等等。如要多次重复整个字符串，那么该字符串必须被组成一个项。组成一项的方法就是在它前面加 &ldquo;\(&rdquo;，后面加 &ldquo;\)&rdquo;。因此这个命令:</p>
<p>       /\(ab\)*</p>
<p>匹配: &ldquo;ab&rdquo;，&rdquo;abab&rdquo;，&rdquo;ababab&rdquo;，等等。而且也匹配 &ldquo;&rdquo;。</p>
<p>要避免匹配空字串，使用 &ldquo;\+&rdquo;。这表示前面一项可以被匹配一次或多次。</p>
<p>       /ab\+</p>
<p>匹配 &ldquo;ab&rdquo;，&rdquo;abb&rdquo;，&rdquo;abbb&rdquo;，等等。它不匹配 后面没有跟随 &ldquo;b&rdquo; 的 &ldquo;a&rdquo;。</p>
<p>要匹配一个可选项，用 &ldquo;\=&rdquo;。 例如:</p>
<p>       /folders\=</p>
<p>匹配 &ldquo;folder&rdquo; 和 &ldquo;folders&rdquo;。</p>
<p>4，指定重复次数</p>
<p>要匹配某一项的特定次数重复，使用 &ldquo;\{n,m}&rdquo; 这样的形式。其中 &ldquo;n&rdquo; 和 &ldquo;m&rdquo; 都是数字。在它前面的那个项将被重复 &ldquo;n&rdquo; 到 &ldquo;m&rdquo; 次 (|inclusive| 包含 &ldquo;n&rdquo; 和 &ldquo;m&rdquo;)。例如:</p>
<p>       /ab\{3,5}</p>
<p>匹配 &ldquo;abbb&rdquo;，&rdquo;abbbb&rdquo; 以及 &ldquo;abbbbb&rdquo;。</p>
<p>  当 &ldquo;n&rdquo; 省略时，被默认为零。当 &ldquo;m&rdquo; 省略时，被默认为无限大。当 &ldquo;,m&rdquo; 省略时，就表示重复正好 &ldquo;n&rdquo; 次。例如:</p>
<p>       模式          匹配次数 </p>
<p>       \{,4}           0，1，2，3 或 4</p>
<p>       \{3,}           3，4，5，等等</p>
<p>       \{0,1}          0 或 1，同 \=</p>
<p>       \{0,}           0 或 更多，同 *</p>
<p>       \{1,}           1 或 更多，同 \+</p>
<p>       \{3}            3</p>
<p>5，多选一匹配</p>
<p>在一个查找模式中，&rdquo;或&rdquo; 运算符是 &ldquo;\|&rdquo;。例如:</p>
<p>       /foo\|bar</p>
<p>这个命令匹配了 &ldquo;foo&rdquo; 或 &ldquo;bar&rdquo;。更多的抉择可以连在后面:</p>
<p>       /one\|two\|three</p>
<p>匹配 &ldquo;one&rdquo;，&rdquo;two&rdquo; 或 &ldquo;three&rdquo;。</p>
<p>  如要匹配其多次重复，那么整个抉择结构须置于 &ldquo;\(&rdquo; 和 &ldquo;\)&rdquo; 之间:</p>
<p>       /\(foo\|bar\)\+</p>
<p>这个命令匹配 &ldquo;foo&rdquo;，&rdquo;foobar&rdquo;，&rdquo;foofoo&rdquo;，&rdquo;barfoobar&rdquo;，等等。</p>
<p>  再举个例子:</p>
<p>       /end\(if\|while\|for\)</p>
<p>这个命令匹配 &ldquo;endif&rdquo;，&rdquo;endwhile&rdquo; 和 &ldquo;endfor&rdquo;。</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/64462#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Wed, 21 Mar 2007 22:22:00 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/64462</link>
        <guid>http://jimlaren.javaeye.com/blog/64462</guid>
      </item>
      <item>
        <title>How Do I Access My Windows Partitions?</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61893" style="color:red;">http://jimlaren.javaeye.com/blog/61893</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText">If you are running Ubuntu on a computer with a Windows disk,  you may want to read and write to the disk. Ubuntu can safely read the Windows  NT NTFS partitions and can read and write to Windows 95/98/2000 FAT32  partitions.</p>
<p class="docText">First, load a terminal, and use the fdisk command to know what  partitions you currently have:</p>
<div class="docText">
<pre>foo@bar:~$ sudo fdisk -l<br /></pre>
</div>
<br />
<p class="docText">The output should be similar to this:</p>
<div class="docText">
<pre>Disk /dev/hda: 81.9 GB<br />Device Boot      Start    End       Blocks      Id     System<br />/dev/hda1 *          1    1306    10490413+      7     HPFS/NTFS<br />/dev/hda2         1307    1311       40162+     83     Linux<br />/dev/hda3         1312    1344      265072+     82     Linux swap<br />/dev/hda4         1345    9964    69240150       f     W95 Ext'd (LBA)<br />/dev/hda5         1345    1606     2104483+      b     W95 FAT32<br />/dev/hda6         1607    2852    10008463+     83     Linux<br />...<br /></pre>
</div>
<br />
<p class="docText">In this output, the /dev/hda1 partition (the first partition on  the first disk) is a 10GB Windows NTFS partition (probably called C:) and  /dev/hda5 is a 2GB FAT32 partition (probably called D:).</p>
<p class="docText">When you access a disk, you need to mount it first. To mount  it, you need to indicate a directory where the files from the disk are  accessedthis is called a mount point. Create mount points in /media for the  Windows <a name="iddle1072"></a><a name="iddle2060"></a><a name="iddle2367"></a><a name="iddle3057"></a><a name="iddle3058"></a>partitions. It is good to use /media/C  for C: and /media/D for D:, etc. to make things easy to remember.</p>
<div class="docText">
<pre>foo@bar:~$ sudo mkdir /media/C /media/D<br /></pre>
</div>
<br />
<p class="docText">To make the disks accessible when you boot the computer, you  need to add a few lines to /etc/fstab. This file indicates which disks are  available. Add the following two lines:</p>
<div class="docText">
<pre>/dev/hda1     /media/C     ntfs     nls=utf8,umask=0222    0     0<br />/dev/hda5     /media/D     vfat     defaults,umask=0000    0     0<br /></pre>
</div>
<br />
<p class="docText">The fourth column lets you specify options for mounting the  partition, and <tt>nls=utf8,umask=0222</tt> means that any user can read the  NTFS partition.</p>
<p class="docText">To mount the two partitions without restarting, run the  following command:</p>
<div class="docText">
<pre>foo@bar:~$ sudo mount -a<br /></pre>
</div>
<br />
<p class="docText">The two partitions are now available and will be automatically  mounted the next time Ubuntu is restarted.</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61893#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 20:06:48 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61893</link>
        <guid>http://jimlaren.javaeye.com/blog/61893</guid>
      </item>
      <item>
        <title>I Tried to Upgrade My System, but I Get an Error</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61891" style="color:red;">http://jimlaren.javaeye.com/blog/61891</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText">If you try to install some software or upgrade your computer,  and you get an error, the package manager may have tied itself in a knot. To try  to resolve this, open a terminal, and run the following commands:</p>
<div class="docText">
<pre>foo@bar:~$ sudo apt-get update<br />foo@bar:~$ sudo apt-get -f install<br /></pre>
</div>
<br />
<p class="docText">The first command updates your package list, and the second  command tries to fix your package manager. If this is successful the packages  that failed will be installed correctly.</p>
<p class="docText">In addition to these commands, you can reconfigure any packages  that have not yet been configured by running:</p>
<div class="docText">
<pre>foo@bar:~$ sudo dpkg configure pending</pre>
</div>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61891#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 19:59:49 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61891</link>
        <guid>http://jimlaren.javaeye.com/blog/61891</guid>
      </item>
      <item>
        <title>The Desktop Has Hung What Do I Do?</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61890" style="color:red;">http://jimlaren.javaeye.com/blog/61890</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText"><a name="iddle1395"></a><a name="iddle2539"></a>In the rare  situation that the desktop hangs, first try to restart it by pressing  Alt-Ctrl-Backspace at the same time. This kills and restarts the X server.  Another method of killing the X server is to press Alt+F2 to jump to a terminal,  log in, and then run this command:</p>
<div class="docText">
<pre>foo@bar:~$ /etc/init.d/gdm stop<br /></pre>
</div>
<br />
<p class="docText">This command stops the graphical login screen, which in turn  stops the X server. You can restart it with this command:</p>
<div class="docText">
<pre>foo@bar:~$ /etc/init.d/gdm start<br /></pre>
</div>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61890#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 19:59:18 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61890</link>
        <guid>http://jimlaren.javaeye.com/blog/61890</guid>
      </item>
      <item>
        <title>How Do I Compile an Application?</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61889" style="color:red;">http://jimlaren.javaeye.com/blog/61889</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText">When a distribution package is not available, the source code  is always available to compile with Open Source applications. Compilation is the  process of converting programming code into a program that you can run and use.  Although it sounds like a devilishly difficult process, it is typically fairly  simple.</p>
<p class="docText">You should first have a look on the application's Web page, or  in the INSTALL or README file that is included with the code to see what  software the application needs to run. When you know what is required, use  Synaptic to search for the required tools. Many of the requirements will be  software libraries (software that applications require to run), and these  libraries typically have &quot;lib&quot; at the start of the package name. As an example,  if you need to have the Vorbis audio codec installed, do a search in Synaptic  for Vorbis, and libvorbis will be one of the packages. You should also install  with -dev at the end of the package name (such as libvorbis-dev). These packages  allow you to compile software for that library.</p>
<p class="docText">The process of compiling software involves three steps: (1)  configuration, (2) compilation, and (3) installation. Open a terminal, move into  the directory from which you extracted the source code, and configure it:</p>
<div class="docText">
<pre>foo@bar:yourapp$ ./configure<br /></pre>
</div>
<br />
<p class="docText">When you run <tt>./configure</tt>, it checks to see that you  have all the required software. If it throws an error, it is likely that a  required tool or library is missing. Find out what it is, and install it.  Typically, configure will tell you what you need to install.</p>
<p class="docText">If the configure script works fine, compile the code with this  command:</p>
<div class="docText">
<pre>foo@bar:yourapp$ make<br /></pre>
</div>
<br />
<p class="docText"><a name="iddle1372"></a><a name="iddle1564"></a><a name="iddle1565"></a><a name="iddle1769"></a><a name="iddle3103"></a>If a problem  appears when compiling the software, it may be a bug or problem in the source  code. It is best to refer your problem to the author of the code for further  help.</p>
<p class="docText">If the compile process was successful, install the application  with this command:</p>
<div class="docText">
<pre>foo@bar:yourapp$ sudo make install<br /></pre>
</div>
<br />
<p class="docText">The software is now fully installed.</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61889#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 19:55:24 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61889</link>
        <guid>http://jimlaren.javaeye.com/blog/61889</guid>
      </item>
      <item>
        <title>Checking That the ISO Works</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61888" style="color:red;">http://jimlaren.javaeye.com/blog/61888</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <p class="docText"><a name="iddle1084"></a><a name="iddle1137"></a><a name="iddle1841"></a><a name="iddle2678"></a>Open a terminal, and then go to the  folder where the ISO image has been downloaded. As an example, if you saved it  to your disk in Firefox, it will have saved it to the Desktop folder in your  home folder:</p>
<div class="docText">
<pre>foo@bar:~$ cd Desktop<br /></pre>
</div>
<br />
<p class="docText">To test that the ISO image works, you are going to mount it and  access the files in a particular folder. First, create this folder:</p>
<div class="docText">
<pre>foo@bar:~$ mkdir test_iso<br /></pre>
</div>
<br />
<p class="docText">Now mount it on that folder:</p>
<div class="docText">
<pre>foo@bar:~$ sudo mount -o loop -t iso9660 my_iso_file.iso test_iso<br /></pre>
</div>
<br />
<p class="docText">That's it! Now you can browse the folder test_iso.</p>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61888#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 19:54:37 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61888</link>
        <guid>http://jimlaren.javaeye.com/blog/61888</guid>
      </item>
      <item>
        <title> Linux Folders</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/61887" style="color:red;">http://jimlaren.javaeye.com/blog/61887</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <table cellspacing="0" rules="rows" frame="hsides" cellpadding="4">
    <caption>
    <h5 class="docTableTitle">&nbsp;Linux Folders</h5>
    </caption> <colgroup align="left" span="2"> <col width="75" /> <col width="425" /></colgroup>
    <thead>
        <tr>
            <th scope="col" class="thead" align="left" valign="top">
            <p class="docText">Folder</p>
            </th>
            <th scope="col" class="thead" align="left" valign="top">
            <p class="docText">Use</p>
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/boot</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Contains important files to boot the computer including the  bootloader configuration and the kernel.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/dev</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Each device on your system (such as sound cards, Webcams, etc.)  has an entry in this folder. Each application accesses the device by using the  relevant items inside /dev.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/etc</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Systemwide configuration files for the software installed on  your system are stored here.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/home</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Each user account on the system has a home directory, and they  are stored here.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/lib</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Important system software libraries are stored here. You should  never need to delve into this world of the unknown.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/media</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Media devices such as CD drives and USB sticks are referenced  here when they are plugged in. More on this later.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/mnt</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Other devices can be mounted later. Again, more on this  later.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/opt</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Optional software can be installed here. This folder is usually  used when you want to build your own software. If you don't build your own  software, you ignore this folder.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/proc /sys</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Information about the current running status of the system is  stored here.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/root</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">This is the home directory for the main  superuser.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/sbin</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">Software that should only be run by the superuser is stored  here.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/usr</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">General software is installed here.</p>
            </td>
        </tr>
        <tr>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">/var</p>
            </td>
            <td class="docTableCell" align="left" valign="top">
            <p class="docText">This folder contains log files about the software on your  computer.</p>
            </td>
        </tr>
    </tbody>
</table>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/61887#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 19:53:42 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/61887</link>
        <guid>http://jimlaren.javaeye.com/blog/61887</guid>
      </item>
      <item>
        <title>[转载]Ubuntu 下删除 Openoffice.org</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/60831" style="color:red;">http://jimlaren.javaeye.com/blog/60831</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          一方面不是所有人都会用到 Openoffice.org<br />
<br />
另外，如果装了 Openoffice.org2 ， 那也没有必要 留着 Openoffice.org<br />
<br />
可是 Ubuntu 里好几个重要的包都依赖 Openoffice.org<br />
<br />
如果直接 sudo apt-get remove openoffice.org-bin<br />
<br />
那就会删掉好几个重要的包<br />
<br />
这儿有一个解决<br />
用一个空的 fake 包来包涵OOo<br />
<br />
Provides: openoffice.org, openoffice.org-bin, openoffice.org-gtk-gnome, openoffice.org-help-zh-cn, openoffice.org-help-zh-tw, openoffice.org-kde, openoffice.org-l10n-zh-cn, openoffice.org-l10n-zh-tw<br />
<br />
装上附件 的 .deb 文件<br />
fake_0.0.1-1_all.deb<br />
[链接以失效]<br />
<br />
再 sudo apt-get remove openoffice.org-bin<br />
<br />
就会只删除 openoffice.org ，而不影响其它包<br />
<br />
hua@hua:~/debs/$ sudo dpkg -i fake_0.0.1-1_all.deb<br />
<br />
选中了曾被取消选择的软件包 fake。<br />
(正在读取数据库 ... 系统当前总共安装有 125418 个文件和目录。)<br />
正在解压缩 fake (从 fake_0.0.1-1_all.deb) ...<br />
正在设置 fake (0.0.1-1) ...<br />
hua@hua:~/debs$<br />
hua@hua:~/debs$<br />
hua@hua:~/debs$ sudo apt-get remove openoffice.org<br />
正在读取软件包列表... 完成<br />
正在分析软件包的依赖关系树... 完成<br />
下列软件包将被【卸载】：<br />
openoffice.org openoffice.org-bin openoffice.org-debian-files openoffice.org-gtk-gnome<br />
openoffice.org-kde openoffice.org-l10n-zh-cn openoffice.org-l10n-zh-tw<br />
共升级了 0 个软件包，新安装了 0 个软件包，要卸载 7 个软件包，有 7 个软件未被升级。<br />
需要下载 0B 的软件包。<br />
解压缩后将会空出 194MB 的空间。<br />
您希望继续执行吗？[Y/n]y<br />
(正在读取数据库 ... 系统当前总共安装有 125418 个文件和目录。)<br />
正在删除 openoffice.org-l10n-zh-tw ...<br />
正在删除 openoffice.org-l10n-zh-cn ...<br />
正在删除 openoffice.org-kde ...<br />
正在删除 openoffice.org-gtk-gnome ...<br />
正在删除 openoffice.org-debian-files ...<br />
正在删除 openoffice.org-bin ...<br />
正在删除 openoffice.org ...
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/60831#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 09:56:29 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/60831</link>
        <guid>http://jimlaren.javaeye.com/blog/60831</guid>
      </item>
      <item>
        <title>[转载]Ubuntu下安装卸载桌面系统</title>
        <author>jimlaren</author>
        <description>
          <![CDATA[
          <br/>
          作者: <a href="http://jimlaren.javaeye.com">jimlaren</a>&nbsp;
          链接：<a href="http://jimlaren.javaeye.com/blog/60830" style="color:red;">http://jimlaren.javaeye.com/blog/60830</a>&nbsp;
          发表时间: 2007年03月19日
          <br/><br/>
          声明：本文系JavaEye网站发布的原创博客文章，未经作者书面许可，严禁任何网站转载本文，否则必将追究法律责任！
          <br/><br/>
          <span style="color: darkblue;">安装GNOME方法：<br />
<br />
<br />
sudo apt-get install gnome<br />
<br />
或者<br />
<br />
sudo apt-get install gnome-desktop<br />
<br />
删除Gnome的方法：<br />
<br />
apt-get &ndash;purge remove liborbit2<br />
<br />
＝＝＝＝＝＝＝＝＝＝＝＝<br />
<br />
安装kde方法:<br />
<br />
sudo apt-get install kde（实验可以）<br />
<br />
安装KDE:<br />
方法一：<br />
<br />
sudo apt-get install kubuntu-desktop<br />
sudo apt-get install language-pack-kde-zh language-pack-kde-zh-base language-pack-zh language-pack-zh-base language-support-zh<br />
<br />
方法二：<br />
<br />
sudo apt-get install kde kde-i18n-zhcn<br />
sudo apt-get install language-pack-kde-zh language-pack-kde-zh-base language-pack-zh language-pack-zh-base language-support-zh<br />
<br />
删除KDE的方法：<br />
zerolin 写道:<br />
for 5.04:<br />
代码:<br />
apt-get &ndash;purge remove kdelibs4 libarts1<br />
<br />
for 5.10:<br />
代码:<br />
apt-get &ndash;purge remove kdelibs4c2 libarts1c2<br />
<br />
for 6.06:<br />
代码:<br />
apt-get &ndash;purge remove kdelibs4c2a libarts1c2a<br />
<br />
＝＝＝＝＝＝＝＝＝＝＝＝<br />
安装Xfce方法：<br />
sudo apt-get install xubuntu-desktop<br />
<br />
卸载Xfce的方法:<br />
sudo apt-get remove xubuntu-desktop<br />
＝＝＝＝＝＝＝＝＝＝＝＝<br />
<br />
安装Fluxbox方法：<br />
<br />
sudo apt-get install fluxbox<br />
echo &ldquo;exec startfluxbox&rdquo; &gt; ~/.xinitrc<br />
<br />
卸载Fluxbox方法:<br />
sudo apt-get remove fluxbox<br />
＝＝＝＝＝＝＝＝＝＝＝＝<br />
<br />
把 Ubuntu 或 Kubuntu 还原到 只有 基本的 Xfce 的ubuntu(请谨慎使用):<br />
<br />
删除Ubuntu:<br />
<br />
sudo apt-get remove alacarte app-install-data app-install-data-commercial at-spi bicyclerepair bittorrent blt bluez-cups bluez-pcmcia-support bluez-pin bluez-utils brltty brltty-x11 bsh bug-buddy ca-certificates capplets-data contact-lookup-applet deskbar-applet diveintopython ekiga eog esound esound-common evince evolution evolution-data-server evolution-exchange evolution-plugins evolution-webcal fastjar festival festlex-cmu festlex-poslex festvox-kallpc16k file-roller firefox-gnome-support fping gcalctool gcj-4.1-base gconf-editor gdb gedit gedit-common gij-4.1 gimp-python gnome-about gnome-accessibility-themes gnome-app-install gnome-applets gnome-applets-data gnome-btdownload gnome-control-center gnome-cups-manager gnome-desktop-data gnome-doc-utils gnome-games gnome-games-data gnome-mag gnome-media gnome-menus gnome-mime-data gnome-netstatus-applet gnome-nettool gnome-panel gnome-panel-data gnome-pilot gnome-pilot-conduits gnome-power-manager gnome-screensaver gnome-session gnome-spell gnome-system-monitor gnome-system-tools gnome-terminal gnome-terminal-data gnome-themes gnome-utils gnome-volume-manager gnome2-user-guide gnopernicus gok gstreamer0.10-alsa gstreamer0.10-esd gstreamer0.10-gnomevfs gstreamer0.10-plugins-base gstreamer0.10-plugins-base-apps gstreamer0.10-plugins-good gstreamer0.10-tools gstreamer0.10-x gthumb gtk2-engines-crux gtk2-engines-highcontrast gtk2-engines-lighthouseblue gtk2-engines-pixbuf gtk2-engines-redmond95 gtk2-engines-thinice gtkhtml3.8 gucharmap guile-1.6-libs hal-device-manager hwdb-client java-common java-gcj-compat libadns1 libatspi1.0-0 libaudio2 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-glib1 libavc1394-0 libbeagle0 libbluetooth1 libbonobo2-0 libbonobo2-common libbonoboui2-0 libbonoboui2-common libbrlapi1 libbtctl2 libcamel1.2-8 libcdio6 libcompfaceg1 libcurl3 libcurl3-gnutls libdv4 libebook1.2-5 libecal1.2-3 libedata-book1.2-2 libedata-cal1.2-1 libedataserver1.2-7 libedataserverui1.2-6 libeel2-2 libeel2-data libegroupwise1.2-9 libesd-alsa0 libestools1.2 libexchange-storage1.2-1 libflac7 libgail-common libgail-gnome-module libgail17 libgcj-common libgcj7 libgcj7-jar libgd2-noxpm libgda2-3 libgda2-common libgdl-1-0 libgdl-1-common libgeoip1 libglew1 libglib-perl libgmp3c2 libgnome-desktop-2 libgnome-mag2 libgnome-menu2 libgnome-pilot2 libgnome-speech3 libgnome2-0 libgnome2-canvas-perl libgnome2-common libgnome2-perl libgnome2-vfs-perl libgnomebt0 libgnomecupsui1.0-1c2a libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-bin libgnomevfs2-common libgnomevfs2-extra libgnucrypto-java libgphoto2-2 libgphoto2-port0 libgpod0 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libgtk2-perl libgtkhtml2-0 libgtkhtml3.8-15 libgtksourceview-common libgtksourceview1.0-0 libgtop2-7 libgucharmap4 libguile-ltdl-1 libhsqldb-java libicu34 libid3-3.8.3c2a libidn11 libieee1284-3 libjasper-1.701-1 libjaxp1.2-java libjessie-java libjline-java liblircclient0 liblpint-bonobo0 libmagick9 libmdbtools libmetacity0 libmusicbrainz4c2a libmysqlclient15off libnautilus-burn3 libnautilus-extension1 libneon25 libnetcdf3 libnotify1 liboil0.3 libopal-2.2.0 libopenobex-1.0-0 libpanel-applet2-0 libpisock8 libpisync0 libportaudio0 libpq4 libpt-1.10.0 libpt-plugins-alsa libpt-plugins-v4l libpt-plugins-v4l2 libqthreads-12 libraptor1 librasqal0 libraw1394-5 librdf0 libsane libsdl1.2debian libsdl1.2debian-alsa libservlet2.3-java libsexy2 libshout3 libsmbclient libsndfile1 libsoup2.2-8 libsqlite0 libsqlite3-0 libstlport4.6c2 libtotem-plparser1 libvorbisenc2 libvorbisfile3 libwnck-common libwnck18 libxalan2-java libxerces2-java libxklavier10 libxml2-utils libxmlsec1 libxmlsec1-nss libxmlsec1-openssl libxres1 libxt-java metacity mysql-common nautilus nautilus-cd-burner nautilus-data nautilus-sendto notification-daemon openoffice.org openoffice.org-base openoffice.org-calc openoffice.org-common openoffice.org-core openoffice.org-draw openoffice.org-evolution openoffice.org-gnome openoffice.org-gtk openoffice.org-impress openoffice.org-java-common openoffice.org-math openoffice.org-writer openssl pkg-config python-adns python-cddb python-clientcookie python-crypto python-egenix-mxproxy python-egenix-mxstack python-egenix-mxtexttools python-egenix-mxtools python-epydoc python-eunuchs python-examples python-gadfly python-gd python-gdbm python-genetic python-geoip python-gmenu python-gnome2 python-gnome2-desktop python-gnome2-extras python-gst0.10 python-htmlgen python-htmltmpl python-id3lib python-imaging python-imaging-sane python-jabber python-kjbuckets python-launchpad-integration python-ldap python-libxml2 python-mysqldb python-netcdf python-newt python-numeric python-pam python-parted python-pexpect python-pgsql python-pisock python-pqueue python-pyao python-pylibacl python-pyogg python-pyopenssl python-pyorbit python-pyvorbis python-pyxattr python-reportlab python-simpletal python-soappy python-sqlite python-stats python-syck python-tk python-unit python-uno python-xdg python-xml python-xmpp python2.4-adns python2.4-clientcookie python2.4-crypto python2.4-dbus python2.4-dictclient python2.4-egenix-mxdatetime python2.4-egenix-mxproxy python2.4-egenix-mxstack python2.4-egenix-mxtexttools python2.4-egenix-mxtools python2.4-epydoc python2.4-eunuchs python2.4-examples python2.4-gadfly python2.4-gd python2.4-gdbm python2.4-geoip python2.4-gnome2 python2.4-gnome2-desktop python2.4-gnome2-extras python2.4-htmlgen python2.4-htmltmpl python2.4-id3lib python2.4-imaging python2.4-imaging-sane python2.4-jabber python2.4-kjbuckets python2.4-ldap python2.4-librdf python2.4-libxml2 python2.4-libxslt1 python2.4-mysqldb python2.4-pam python2.4-pexpect python2.4-pgsql python2.4-pycurl python2.4-pylibacl python2.4-pyopenssl python2.4-pyorbit python2.4-pyxattr python2.4-reportlab python2.4-simpletal python2.4-soappy python2.4-sqlite python2.4-syck python2.4-tk python2.4-unit python2.4-xml python2.4-xmpp rdesktop rhythmbox rss-glx screensaver-default-images serpentine sound-juicer ssh-askpass-gnome tangerine-icon-theme tcl8.4 tk8.4 totem totem-gstreamer tsclient ttf-opensymbol ubuntu-desktop ubuntu-docs update-notifier vino vnc-common whois xsane xsane-common xsltproc xvncviewer yelp zenity<br />
<br />
删除 Kubuntu:<br />
<br />
sudo apt-get remove adept akregator amarok amarok-xine app-install-data ark arts artsbuilder bicyclerepair blt bluez-cups bluez-pcmcia-support bluez-utils bogofilter bogofilter-bdb bogofilter-common brltty bsh ca-certificates debtags diveintopython enscript esound-common fastjar gcj-4.1-base gij-4.1 gtk2-engines-gtk-qt gwenview imagemagick java-common java-gcj-compat k3b kaddressbook kaffeine kaffeine-xine kamera karm katapult kate kaudiocreator kcontrol kcron kde-guidance kde-style-lipstik kde-systemsettings kdeadmin-kfile-plugins kdebase-bin kdebase-data kdebase-kio-plugins kdebluetooth kdegraphics-kfile-plugins kdelibs-bin kdelibs-data kdelibs4c2a kdemultimedia-kfile-plugins kdemultimedia-kio-plugins kdenetwork-filesharing kdenetwork-kfile-plugins kdepasswd kdepim-kio-plugins kdepim-kresources kdepim-wizards kdeprint kdesktop kdm kdnssd keep kfind kghostview khelpcenter kicker kio-apt kio-locate klaptopdaemon klipper kmail kmailcvt kmenuedit kmilo kmix kmplayer-base kmplayer-konq-plugins knetworkconf knotes koffice-data koffice-libs konq-plugins konqueror konqueror-nsplugins konsole kontact konversation kooka kopete korganizer kpdf kpf kppp krdc krfb krita krita-data kscd kscreensaver ksmserver ksnapshot ksplash ksplash-engine-moodin ksvg ksysguard ksysguardd ksystemlog ktorrent kubuntu-artwork-usplash kubuntu-default-settings kubuntu-desktop kubuntu-docs kubuntu-konqueror-shortcuts kwalletmanager kwin kwin-style-crystal language-selector-qt libadns1 libakode2 libarts1-akode libarts1c2a libartsc0 libaudio2 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-qt3-1 libbluetooth1 libbrlapi1 libcurl3 libcurl3-gnutls libdbus-qt-1-1c2 libesd-alsa0 libflac++5c2 libflac7 libgadu3 libgcj-common libgcj7 libgcj7-jar libgd2-noxpm libgeoip1 libgmp3c2 libgnucrypto-java libgpgme11 libgphoto2-2 libgphoto2-port0 libgsl0 libgstreamer-plugins-base0.10-0 libgstreamer0.10-0 libhsqldb-java libicu34 libid3-3.8.3c2a libidn11 libieee1284-3 libjasper-1.701-1 libjaxp1.2-java libjessie-java libjline-java libk3b2 libkcal2b libkcddb1 libkdepim1a libkipi0 libkleopatra1 libkmime2 libkonq4 libkpimexchange1 libkpimidentities1 libkscan1 libksieve0 libktnef1 liblockdev1 libmagick9 libmdbtools libmimelib1c2a libmpcdec3 libmusicbrainz4c2a libmysqlclient15off libneon25 libnetcdf3 libnss-mdns liboggflac3 libopenexr2c2a libopenobex-1.0-0 libpisock8 libpoppler1-qt libportaudio0 libpq4 libpythonize0 libqt3-mt libraptor1 libra</span>
          <br/>
          <span style="color:red;">
            <a href="http://jimlaren.javaeye.com/blog/60830#comments" style="color:red;">本文的讨论也很精彩，浏览讨论>></a>
          </span>
          <br/><br/><br/>
          <span style="color:#E28822;">JavaEye推荐</span>
          <br/>
          <ul class='adverts'><li><a href='/adverts/42' target='_blank'><span style="color:red;font-weight:bold;">搜狐网站诚聘Java、PHP和C++工程师</span></a></li><li><a href='/adverts/41' target='_blank'><span style="color:red;font-weight:bold;">北京: 千橡集团暨校内网诚聘软件研发工程师</span></a></li></ul>
          <br/><br/><br/>
          ]]>
        </description>
        <pubDate>Mon, 19 Mar 2007 09:50:17 +0800</pubDate>
        <link>http://jimlaren.javaeye.com/blog/60830</link>
        <guid>http://jimlaren.javaeye.com/blog/60830</guid>
      </item>
  </channel>
</rss>