<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>夜弓的咖啡馆</title>
	
	<link>http://www.yegong.net</link>
	<description>夜弓=Cooper=某间咖啡室的老板(尚未开张)</description>
	<lastBuildDate>Wed, 10 Mar 2010 09:33:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="yegong" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>31.16345</geo:lat><geo:long>121.342224</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feed.yegong.net/" /><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeed.yegong.net%2F" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeed.yegong.net%2F" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeed.yegong.net%2F" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeed.yegong.net%2F" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeed.yegong.net%2F" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Abstract in Python</title>
		<link>http://www.yegong.net/abstract-in-python/</link>
		<comments>http://www.yegong.net/abstract-in-python/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 09:33:08 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[decorator]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=886</guid>
		<description><![CDATA[Python does not support the abstract in syntax level. However, there&#8217;re many solutions, Python IAQ, and here (in Chinese). However, I don&#8217;t like them because lack of aesthetic. And I found a way by using the python decorator syntax.
Python没有在语法层面上对抽象类，抽象方法提供支持。但有很多方法绕过了这一阻碍。例如很偏门的Python IAQ，以及粲言堂。但我不喜欢这些解决方案，我不喜欢这些解决方案因为它们缺少美感。因此，我找到了一个利用Python修饰器来实现抽象类、抽象方法。
Here&#8217;s the sample code for abstract class,
def abstract(cls):
  if hasattr(cls, '__init__'):
    method [...]]]></description>
			<content:encoded><![CDATA[<p>Python does not support the abstract in syntax level. However, there&#8217;re many solutions, <a href="http://norvig.com/python-iaq.html">Python IAQ</a>, and <a href="http://xuecan.blogspot.com/2007/05/python.html">here</a> (in Chinese). However, I don&#8217;t like them because lack of aesthetic. And I found a way by using the python decorator syntax.</p>
<p>Python没有在语法层面上对抽象类，抽象方法提供支持。但有很多方法绕过了这一阻碍。例如很偏门的<a href="http://norvig.com/python-iaq.html">Python IAQ</a>，以及<a href="http://xuecan.blogspot.com/2007/05/python.html">粲言堂</a>。但我不喜欢这些解决方案，我不喜欢这些解决方案因为它们缺少美感。因此，我找到了一个利用Python修饰器来实现抽象类、抽象方法。</p>
<p>Here&#8217;s the sample code for abstract class,</p>
<pre>def abstract(cls):
  if hasattr(cls, '__init__'):
    method = getattr(cls, '__init__')
  else:
    method = None
  def init_method(self, *argv):
    if self.__class__ == cls:
      raise NotImplementedError('abstract method')
    if method:
      method(self, *argv)
  setattr(cls, '__init__', init_method)
  return cls
</pre>
<p>Now it&#8217;s quite easy to use it,</p>
<pre>@abstract
class Foo(object):
  pass

class Bar(Foo):
  pass
</pre>
<p>Decorator is a normal method which accept at least 1 arg. It can apply on class or method. It will change the being defined class or method to the return value. So when decorating a class, the return value should be the class itself in most case. And we need to remember the decorated object is not defined, just still processing. So the member method of class is still a function object, not linked to the class yet. So we can&#8217;t retrieve the class trait from it.</p>
<p>简单的说，Decorator就是任何一个接收至少一个参数的方法。以@的形式应用在类和方法上。通过应用Decorator，把类或方法的定义修改成这个Decorator方法的返回值。因此，当我们需要修饰一个类的时候，应当返回这个类本身。因为通常我们修改一个类，是想在这个类上添加新的类属性和类方法，而非是需要重新定义一个新类。此外，还有一点值得注意，那就是在运行Decorator的时候，这个定义还没有完成，因此，任何被修饰的类方法只是一个普通的function对象，尚未连接到它所属的类上去。也就是说，我们无法从这个function对象上得到所属类的信息。</p>
<p><a href="http://www.yegong.net/abstract-in-python/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/abstract/" rel="tag">abstract</a>, <a href="http://www.yegong.net/tag/class/" rel="tag">class</a>, <a href="http://www.yegong.net/tag/decorator/" rel="tag">decorator</a>, <a href="http://www.yegong.net/tag/method/" rel="tag">method</a>, <a href="http://www.yegong.net/tag/python/" rel="tag">python</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/abstract-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>我是shell脚本控</title>
		<link>http://www.yegong.net/i-m-scriptcon/</link>
		<comments>http://www.yegong.net/i-m-scriptcon/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 05:41:26 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=874</guid>
		<description><![CDATA[最近两个月都沉迷于shell脚本中，这从博客更新就看得出来。
开始是延时播入vpn的脚本，它解决了开机时网络不通的情况下播入vpn的问题。理论上用/etc/network/interfaces配置文件也应可以完成，但我设置了if-up还是有问题，所以就转而考虑shell脚本。
第二个shell脚本是用于中文内码转换的。平时下载得到txt文件大多是gbk编码的，但使用统一的utf8必将更加方便。iconv可以完成这个工作，但它每次只能对一个文件进行处理，显然增加了我的工作量。于是我利用脚本，对通配符进行循环并配合上tellenc对输入文件的内码进行猜测。现在的问题是tellenc的结果不一定很准确，这是只根据前10行进行猜测造成的。可能我会在这方面加入更多硬编码的干预，或者写一个更强大的tellenc来准确的得到编码。
然后就是Google离开中国时写下的一个监控工具。也就是不断的通过域名解析，ping，首页分析，反向dns等方法来观察gfw什么时候，用什么方式对Google下手。这个脚本经过几次强化已经比较完善，稍微修改一下就可以对其他的站点进行同样的监控。
还有一个脚本是用于满足我下列需要：在Apache的.htaccess文件中添加和更新若干Allow From XXX.XXX.XXX.XXX，其中XXX.XXX.XXX.XXX应该是指定的动态域名的ip。在写这个脚本的过程中，我学习到了sed的复杂用法。需要面对的是Apache配置文件的注释风格——只有行首的#被认为是注释的开始。因此我需要在每一个Allow From的上一行加上一个动态域名的md5用于识别，sed将替换掉这个md5的下一行，sed -e &#8220;/$md5/N&#8221; -e &#8220;/$md5/c# $domain : $md5\nAllow From $ip&#8221;。
还有一个小作品和这个主机分享计划的发起者Michael(bemike.org)有那么一点关系。和他在msn上的聊﻿天中我猜测他有那么一个工具能够截屏并上传到图片分享网站。这很是让人羡慕Mac软件的优秀。于是我写了一个shell脚本来完成同样的事情：scrot用来截取屏幕，yfrog的python api将图片上传，notify-send将url在屏幕上显示，xclip用于将url复制到剪切板。最后，我还用Compiz把PrtScn，Alt+PrtScn都绑定到了这个脚本上。
最终章用于满足我下载的需求——登录到路由器上检查是否有其他电脑接入了网络。然后根据这一点来控制打开和关闭amuled。既不影响上网网速，又最大程度的利用网络，如果路由器能够对流量就进行统计就更好了。
小礼物：bash tips，如果有疑问的话请请先看这个视频。
预告：shell脚本暂时告一段落，下面Python脚本和Go语言即将登台演出。
Leave a comment
Category : Coding &#124; Tags : bash, linux, script, shell

]]></description>
			<content:encoded><![CDATA[<p>最近两个月都沉迷于shell脚本中，这从博客更新就看得出来。</p>
<p>开始是延时播入vpn的脚本，它解决了开机时网络不通的情况下播入vpn的问题。理论上用/etc/network/interfaces配置文件也应可以完成，但我设置了if-up还是有问题，所以就转而考虑shell脚本。</p>
<p>第二个shell脚本是用于中文内码转换的。平时下载得到txt文件大多是gbk编码的，但使用统一的utf8必将更加方便。iconv可以完成这个工作，但它每次只能对一个文件进行处理，显然增加了我的工作量。于是我利用脚本，对通配符进行循环并配合上tellenc对输入文件的内码进行猜测。现在的问题是tellenc的结果不一定很准确，这是只根据前10行进行猜测造成的。可能我会在这方面加入更多硬编码的干预，或者写一个更强大的tellenc来准确的得到编码。</p>
<p>然后就是Google离开中国时写下的一个监控工具。也就是不断的通过域名解析，ping，首页分析，反向dns等方法来观察gfw什么时候，用什么方式对Google下手。这个脚本经过几次强化已经比较完善，稍微修改一下就可以对其他的站点进行同样的监控。</p>
<p>还有一个脚本是用于满足我下列需要：在Apache的.htaccess文件中添加和更新若干Allow From XXX.XXX.XXX.XXX，其中XXX.XXX.XXX.XXX应该是指定的动态域名的ip。在写这个脚本的过程中，我学习到了sed的复杂用法。需要面对的是Apache配置文件的注释风格——只有行首的#被认为是注释的开始。因此我需要在每一个Allow From的上一行加上一个动态域名的md5用于识别，sed将替换掉这个md5的下一行，<span class="code">sed -e &#8220;/$md5/N&#8221; -e &#8220;/$md5/c# $domain : $md5\nAllow From $ip&#8221;</span>。</p>
<p>还有一个小作品和这个主机分享计划的发起者Michael(bemike.org)有那么一点关系。和他在msn上的聊﻿天中我猜测他有那么一个工具能够截屏并上传到图片分享网站。这很是让人羡慕Mac软件的优秀。于是我写了一个shell脚本来完成同样的事情：scrot用来截取屏幕，yfrog的python api将图片上传，notify-send将url在屏幕上显示，xclip用于将url复制到剪切板。最后，我还用Compiz把PrtScn，Alt+PrtScn都绑定到了这个脚本上。</p>
<p>最终章用于满足我下载的需求——登录到路由器上检查是否有其他电脑接入了网络。然后根据这一点来控制打开和关闭amuled。既不影响上网网速，又最大程度的利用网络，如果路由器能够对流量就进行统计就更好了。</p>
<p>小礼物：<a href="https://yegong.net/y/6">bash tips</a>，如果有疑问的话请请先看<a href="http://vimeo.com/8137911">这个视频</a>。</p>
<p>预告：shell脚本暂时告一段落，下面Python脚本和Go语言即将登台演出。</p>
<p><a href="http://www.yegong.net/i-m-scriptcon/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/bash/" rel="tag">bash</a>, <a href="http://www.yegong.net/tag/linux/" rel="tag">linux</a>, <a href="http://www.yegong.net/tag/script/" rel="tag">script</a>, <a href="http://www.yegong.net/tag/shell/" rel="tag">shell</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/i-m-scriptcon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google is leaving… Here’s a shell script to monitor that.</title>
		<link>http://www.yegong.net/google-is-leaving/</link>
		<comments>http://www.yegong.net/google-is-leaving/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:46:12 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Talking]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[GFW]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=848</guid>
		<description><![CDATA[Google正要离开中国。
计划今天晚上去来福士16楼为Google献上一束鲜花。
抗战二十年
此外，还特意写了一个bash脚本来记录下这一切。以一个程序员的方法来纪念。
#!/bin/bash
export PATH="/bin:/usr/bin"

LOG=~/google.log
TMP=/tmp/google.index.html
FMT="+%Y-%m-%d %H:%M:%S"
HOST=www.g.cn
NS=202.96.209.5

while [ 1 ]
do
  date "$FMT" &#124; tee -a $LOG
  ips=`dig @$NS $HOST &#124; sed -n -r 's/^.*IN\s+A\s+(.*)$/\1/p'`
  if [ -n "$ips" ]
  then
    for ip in $ips
    do
      wget -O $TMP $ip &#62; /dev/null 2&#62; /dev/null
  [...]]]></description>
			<content:encoded><![CDATA[<p>Google正要离开中国。</p>
<p>计划今天晚上去来福士16楼为Google献上一束鲜花。<br />
<a href="http://www.yegong.net/wp-content/uploads/2010/01/flight-for-twenty-years-together.mp3">抗战二十年</a></p>
<div id="attachment_856" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yegong.net/wp-content/uploads/2010/01/2010-01-13-19.56.28.jpg" rel="lightbox[848]"><img class="size-medium wp-image-856" title="Flowers for Google" src="http://www.yegong.net/wp-content/uploads/2010/01/2010-01-13-19.56.28-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Flowers for Google</p></div>
<p>此外，还特意写了一个bash脚本来记录下这一切。以一个程序员的方法来纪念。</p>
<pre>#!/bin/bash
export PATH="/bin:/usr/bin"

LOG=~/google.log
TMP=/tmp/google.index.html
FMT="+%Y-%m-%d %H:%M:%S"
HOST=www.g.cn
NS=202.96.209.5

while [ 1 ]
do
  date "$FMT" | tee -a $LOG
  ips=`dig @$NS $HOST | sed -n -r 's/^.*IN\s+A\s+(.*)$/\1/p'`
  if [ -n "$ips" ]
  then
    for ip in $ips
    do
      wget -O $TMP $ip &gt; /dev/null 2&gt; /dev/null
      google=`cat $TMP | sed -n -r "s/^.*Google.*$/OK/p" \
        | sed -n -r '1p'`
      if [ -n "$google" ]
      then
        echo "$ip OK" | tee -a $LOG
      else
        echo "$ip ERROR" | tee -a $LOG
      fi
    done
  else
    echo "Can't resolve the host: $HOST" | tee -a $LOG
  fi
  sleep 2
done</pre>
<hr /><span style="color: #ff0000;">Updated on 15th Jan 2010:</span><br />
升级了一下脚本，使得: 1.通过反向解析检测Google是否遭到域名劫持; 2. 支持同时检测多个Google旗下的域名.</p>
<pre>#!/bin/bash
export PATH="/bin:/usr/bin"

LOG=~/google.log
TMP=/tmp/google.index.html
FMT="+%Y-%m-%d %H:%M:%S"
GOOGLE_DOMAINS=("www.g.cn" "www.google.cn" "www.google.com")
NS=202.96.209.5

while [ 1 ]
do
  date "$FMT" | tee -a $LOG
  for domain in ${GOOGLE_DOMAINS[@]}
  do
    echo $domain | tee -a $LOG
    ips=`dig @$NS $domain \
      | sed -n -r 's/^.*IN\s+A\s+(.*)$/\1/p'`
    if [ -n "$ips" ]
    then
      for ip in $ips
      do
        server=`nslookup -q=ptr $ip \
          | sed -n -r 's/^.*name = (.*)$/\1/p'`
        is_server_1e100=`echo $server \
          | sed -n -r 's/^.+\.1e100\.net\./OK/p'`
        if [ "$is_server_1e100" = "OK" ]
        then
          wget -O $TMP $ip &gt; /dev/null 2&gt; /dev/null
          is_google=`cat $TMP \
            | sed -n -r "s/^.*Google.*$/OK/p" | sed -n -r '1p'`
          if [ -n "$is_google" ]
          then
              echo "$ip OK" | tee -a $LOG
          else
              echo "$ip ERROR: NOT GOOGLE PAGE" | tee -a $LOG
          fi
        else
          echo "$ip ERROR: DONAME HIJACK" | tee -a $LOG
        fi
      done
    else
      echo "ERROR: STOP RESOLVE: $domain" | tee -a $LOG
    fi
  done
  echo "" | tee -a $LOG
  sleep 2
done</pre>
<p><a href="http://www.yegong.net/google-is-leaving/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a>,  <a href="http://www.yegong.net/category/talking/" title="View all posts in Talking" rel="category tag">Talking</a> | Tags : <a href="http://www.yegong.net/tag/bash/" rel="tag">bash</a>, <a href="http://www.yegong.net/tag/gfw/" rel="tag">GFW</a>, <a href="http://www.yegong.net/tag/google/" rel="tag">Google</a>, <a href="http://www.yegong.net/tag/linux/" rel="tag">linux</a>, <a href="http://www.yegong.net/tag/script/" rel="tag">script</a>, <a href="http://www.yegong.net/tag/shell/" rel="tag">shell</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/google-is-leaving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.yegong.net/wp-content/uploads/2010/01/flight-for-twenty-years-together.mp3" length="1031436" type="audio/mpeg" />
		</item>
		<item>
		<title>bash script notes (1)</title>
		<link>http://www.yegong.net/bash-script-notes-1/</link>
		<comments>http://www.yegong.net/bash-script-notes-1/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 11:01:12 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[笔记]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=815</guid>
		<description><![CDATA[I tied to study the shell script a few times. But on that time, I didn&#8217;t get enough knowledge to deal with it. Now, I&#8217;m back.
Situation 1
I want to startup the vpn service when the computer startup. I added pon vpn_name to rc.local. However, this can be failed because when this line execute, the network [...]]]></description>
			<content:encoded><![CDATA[<p>I tied to study the shell script a few times. But on that time, I didn&#8217;t get enough knowledge to deal with it. Now, I&#8217;m back.</p>
<p><strong>Situation 1</strong></p>
<p>I want to startup the vpn service when the computer startup. I added <span class="code">pon vpn_name</span> to rc.local. However, this can be failed because when this line execute, the network may not be ready. So I decide to write a script to do this. It will wait until the Internet up. Here&#8217;s it.</p>
<pre>#!/bin/bash

sleep_time=1
export PATH=$PATH:/usr/bin

while [ 1 ]
do
  ping_success=`ping -c 1 -n vpn.yegong.net | \
    sed -n -r 's/^.* (.) received.*$/\1/p'`
  if [ $ping_success -eq 1 ]
  then
    pon yegong
    exit 0
  fi
  sleep $sleep_time
  sleep_time=$(expr $sleep_time + 1)
done</pre>
<ol>
<li><span class="code">export PATH</span> is very important.</li>
<li><span class="code">`ping -c 1 -n vpn.yegong.net | sed -n -r &#8217;s/^.* (.) received.*$/\1/p&#8217;`</span>, using ` surround the command to get the output text.</li>
<li><span class="code">sed -n -r &#8217;s/^.* (.) received.*$/\1/p&#8217;</span>, using sed to simplify the output. It&#8217;s the regular expression. Very similar with <a href="http://www.yegong.net/tag/vim/">VIM replace syntax</a>, isn&#8217;t it?</li>
<li><span class="code">if [ $ping_success -eq 1 ]</span>, <span class="code">[ condition ]</span> means the test program, equivalent to <span class="code">test condition</span>, so <span class="code">man test</span> will show more usage.</li>
<li><span class="code">sleep_time=$(expr $sleep_time + 1)</span>, it seems that every variable in shell is a string, so you can&#8217;t simply write <span class="code">x=x+1</span>. Instead of,  expr program read a string expression and output the results. Please notice the space in the expression.</li>
</ol>
<p><strong>Situation 2</strong></p>
<p>For each text files in a directory, convert the file encoding to utf8.</p>
<p>There&#8217;s a simple util can guess the file encoding. It can be found at <a href="http://wyw.dcweb.cn/">Wu Yongwei&#8217;s Programming Page</a> (<del>Can&#8217;t access when I write the article</del>). Then I just need a script to combine the tellenc and iconv.</p>
<pre>TMP_FILE="/tmp/utf8lize.output"
ENCODING="utf-8"

if [ $# == 0 ]
then
  echo "Usage: utf8lize FILES"
  exit 1
fi

for f in "$@"
do
  if [ -f "$f" ]
  then
    enc=`tellenc "$f"`
    if [ $enc != $ENCODING ] &amp;&amp; [ $enc != "binary" ]
    then
      echo $f : $enc
      cp "$f" "$f.bak"
      iconv -f "$enc" -t "$ENCODING" -o "$TMP_FILE" "$f"
      cp "$TMP_FILE" "$f"
      rm -f "$TMP_FILE"
    fi
  fi
done</pre>
<ol>
<li><span class="code">$#</span> results the number of arguments when it been executed.</li>
<li><span class="code">for f in &#8220;$@&#8221;</span> is the for-each loop. And <span class="code">&#8220;$@&#8221;</span> indicates the all program arguments. In addition, when you run the program <span class="code">utf8lize *</span>, * will convert to filenames array. Using the &#8221; to surrounding <span class="code">$@</span> can deal the filename with space.</li>
</ol>
<p><a href="http://www.yegong.net/bash-script-notes-1/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/bash/" rel="tag">bash</a>, <a href="http://www.yegong.net/tag/linux/" rel="tag">linux</a>, <a href="http://www.yegong.net/tag/script/" rel="tag">script</a>, <a href="http://www.yegong.net/tag/study/" rel="tag">study</a>, <a href="http://www.yegong.net/tag/tutorial/" rel="tag">tutorial</a>, <a href="http://www.yegong.net/tag/note/" rel="tag">笔记</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/bash-script-notes-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reset the layout/views setting of eclipse</title>
		<link>http://www.yegong.net/reset-the-layout-views-setting-of-eclipse/</link>
		<comments>http://www.yegong.net/reset-the-layout-views-setting-of-eclipse/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 07:54:24 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[xulrunner]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=811</guid>
		<description><![CDATA[It&#8217;s the second time to get such a bug of eclipse.
It seems that eclipse can&#8217;t work fine with the newer/older version of XulRunner other than 1.9.* in many distribution of Linux. Ubuntu is in the list.
The result is that I can&#8217;t open the javadoc view of eclipse. Everytime when I click the tab, a error [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s the second time to get such a bug of eclipse.</p>
<p>It seems that eclipse can&#8217;t work fine with the newer/older version of XulRunner other than 1.9.* in many distribution of Linux. Ubuntu is in the list.</p>
<p>The result is that I can&#8217;t open the javadoc view of eclipse. Everytime when I click the tab, a error dialog will pop. Then I switch to other tab and go on coding. But this time I&#8217;m not so lucky. I just close the eclipse. It got crazy then. Eclipse can&#8217;t startup any more. Eclipse can&#8217;t startup because it want to restore the last state. But it failed to open the javadoc view, and then break.</p>
<p>Too many article about this problem from Google. The keyword can be found at %workspace%/.metadata/.log.</p>
<blockquote><p>SWTError, XPCOM</p></blockquote>
<p><a href="http://sandakith.wordpress.com/2008/07/11/eclipse-ganymede-startup-problem-in-ubuntu-orgeclipseswtswterror-xpcom-erro/">Some solutions</a> looks good, and proved by the follow comments. However, none of them works on my machine.</p>
<p>Surely, I can find a way for me. I just need to reset the layout of eclipse. Then <a href="http://coskunscastle.blogspot.com/2007/11/how-to-export-eclipse-workbench-layout.html">Google tell</a> us it&#8217;s controlled by this file, %workspace%/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml. I just delete it and then everything works fine now.</p>
<p>In addition, I also remove the javadoc view to prevent the accident happen. This can&#8217;t be done from eclipse UI because XulRunner problem. However, you can do it in the config file. Open the workbench.xml, and delete this one</p>
<blockquote><p>&lt;view id=&#8221;org.eclipse.jdt.ui.JavadocView&#8221;/&gt;</p></blockquote>
<p><a href="http://www.yegong.net/reset-the-layout-views-setting-of-eclipse/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/eclipse/" rel="tag">eclipse</a>, <a href="http://www.yegong.net/tag/firefox/" rel="tag">firefox</a>, <a href="http://www.yegong.net/tag/javadoc/" rel="tag">javadoc</a>, <a href="http://www.yegong.net/tag/xulrunner/" rel="tag">xulrunner</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/reset-the-layout-views-setting-of-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM tips (2)</title>
		<link>http://www.yegong.net/vim-tips-2/</link>
		<comments>http://www.yegong.net/vim-tips-2/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 06:19:37 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VIM]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=805</guid>
		<description><![CDATA[
利用&#8221;ayy复制后，可使用&#8221;Ayy继续复制，新的内容会添加到寄存器a的尾部。
除了利用*来匹配当前光标下的单词外，还可以用表示向后查找的#。此外还有g*和g#，区别在于*,#要求严格匹配一个单词。
启动参数:
vim + filename，vim打开后自动把光标移动到文末
vim +/pattern filename，vim打开后自动查找pattern
多缓冲区编辑:
利用:n和:N在缓冲区间移动
利用:e filename来新开一个缓冲区
利用:e#回到上一个缓冲区，其中#表示上一个被编辑的缓冲区，类似的%表示当前缓冲区
外部命令:
:! command，执行外部命令
:!!，执行最近一次执行的外部命令
录制与回放:
当执行了:命令后，命令会自动存入:缓冲区，可以用@:回放
:r !command与!!command有类似的作用，区别在于前者是插入而后者是替换

Leave a comment
Category : Coding &#124; Tags : linux, Tips, VIM

]]></description>
			<content:encoded><![CDATA[<ol>
<li>利用&#8221;ayy复制后，可使用&#8221;Ayy继续复制，新的内容会添加到寄存器a的尾部。</li>
<li>除了利用*来匹配当前光标下的单词外，还可以用表示向后查找的#。此外还有g*和g#，区别在于*,#要求严格匹配一个单词。</li>
<li>启动参数:<br />
vim + filename，vim打开后自动把光标移动到文末<br />
vim +/pattern filename，vim打开后自动查找pattern</li>
<li>多缓冲区编辑:<br />
利用:n和:N在缓冲区间移动<br />
利用:e filename来新开一个缓冲区<br />
利用:e#回到上一个缓冲区，其中#表示上一个被编辑的缓冲区，类似的%表示当前缓冲区</li>
<li>外部命令:<br />
:! command，执行外部命令<br />
:!!，执行最近一次执行的外部命令</li>
<li>录制与回放:<br />
当执行了:命令后，命令会自动存入:缓冲区，可以用@:回放</li>
<li>:r !command与!!command有类似的作用，区别在于前者是插入而后者是替换</li>
</ol>
<p><a href="http://www.yegong.net/vim-tips-2/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/linux/" rel="tag">linux</a>, <a href="http://www.yegong.net/tag/tips/" rel="tag">Tips</a>, <a href="http://www.yegong.net/tag/vim/" rel="tag">VIM</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/vim-tips-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Ctrl Tips</title>
		<link>http://www.yegong.net/ctrl-tips/</link>
		<comments>http://www.yegong.net/ctrl-tips/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 07:13:25 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Control-Key]]></category>
		<category><![CDATA[Ctrl-Backspace]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VIM]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=788</guid>
		<description><![CDATA[Control键对于国人来说主要就是Ctrl+C和Ctrl+V。
今天要说的是Ctrl+Backspace, Ctrl+Delete, Ctrl+Left, Ctrl+Right。
其实很简单，就是在四个键原有的功能上加上的“按单词&#8230;”的限定。例如：Ctrl+Backspace，从光标所在处开始向前删除一个单词。

这在写英文时比较有用
写代码时也很方便
中文词组没有空格，因此其效果变为按标点符号进行删除和移动。也许有时会有用，一旦误操作要及时Ctrl+Z喔
大多数的文本编辑器都支持这一操作，以及Firefox, Internet Explorer, eclipse等，你甚至可以在Windows Explorer的地址栏这样做。Notepad支持除Ctrl+Backspace以外的三个组合键。
对于Vim，需要自行定义inoremap &#60;C-BS&#62;    &#60;C-W&#62;在.vimrc中

PS. 今天中午发现，我键盘上磨损的顺序是Space &#62; F &#62; IAJ &#62; K;N &#62; LEUON。这是Vim的效果么？
Leave a comment
Category : Coding &#124; Tags : Control-Key, Ctrl-Backspace, Tip, Tips, VIM

]]></description>
			<content:encoded><![CDATA[<p>Control键对于国人来说主要就是Ctrl+C和Ctrl+V。</p>
<p>今天要说的是Ctrl+Backspace, Ctrl+Delete, Ctrl+Left, Ctrl+Right。</p>
<p>其实很简单，就是在四个键原有的功能上加上的“按单词&#8230;”的限定。例如：Ctrl+Backspace，从光标所在处开始向前删除一个单词。</p>
<ol>
<li>这在写英文时比较有用</li>
<li>写代码时也很方便</li>
<li>中文词组没有空格，因此其效果变为按标点符号进行删除和移动。也许有时会有用，一旦误操作要及时Ctrl+Z喔</li>
<li>大多数的文本编辑器都支持这一操作，以及Firefox, Internet Explorer, eclipse等，你甚至可以在Windows Explorer的地址栏这样做。Notepad支持除Ctrl+Backspace以外的三个组合键。</li>
<li>对于Vim，需要自行定义inoremap &lt;C-BS&gt;    &lt;C-W&gt;在.vimrc中</li>
</ol>
<p>PS. 今天中午发现，我键盘上磨损的顺序是<span style="color: #ff0000;">Space</span> &gt; <span style="color: #ff0000;">F</span> &gt; <span style="color: #ff0000;">I</span><span style="color: #ff0000;">A</span><span style="color: #ff0000;">J</span> &gt; <span style="color: #ff0000;">K</span><span style="color: #ff0000;">;</span><span style="color: #ff0000;">N</span> &gt; <span style="color: #ff0000;">L</span><span style="color: #ff0000;">E</span><span style="color: #ff0000;">U</span><span style="color: #ff0000;">O</span><span style="color: #ff0000;">N</span>。这是Vim的效果么？</p>
<p><a href="http://www.yegong.net/ctrl-tips/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/control-key/" rel="tag">Control-Key</a>, <a href="http://www.yegong.net/tag/ctrl-backspace/" rel="tag">Ctrl-Backspace</a>, <a href="http://www.yegong.net/tag/tip/" rel="tag">Tip</a>, <a href="http://www.yegong.net/tag/tips/" rel="tag">Tips</a>, <a href="http://www.yegong.net/tag/vim/" rel="tag">VIM</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/ctrl-tips/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>悼念那八年</title>
		<link>http://www.yegong.net/8-years/</link>
		<comments>http://www.yegong.net/8-years/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 04:41:26 +0000</pubDate>
		<dc:creator>arsenek</dc:creator>
				<category><![CDATA[Talking]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=784</guid>
		<description><![CDATA[昨晚，和胖娃聊到他和现任女友的事情，把本来我基本隔天就在想起的那些事又过了一遍。胖娃1点睡了之后，我老是睡不着，一睡不着就开始胡思乱想。这十几天来，psp内播放得最多的就是“对不起谢谢”“goodbye to romance”&#8221;don&#8217;t look back in angers&#8221;。前天从猩猩宿舍出来本来说晚上去看陈绮贞的演唱会，但是一方面走嘿累了，一方面确实不想和同事去听容易挑起情绪的歌。每次听到“你到过下雪的北京”就莫名的伤感。
2001冬天开始，2004年带着一种得意的心情去了成都，2009年不晓得朗阁的就拉爆了。其实我晓得，小的矛盾因为我到了北京就放得无穷大了，09年春节的经历真的让我好痛苦。8年就这样过了给。也没得愤怒，就是带着遗憾就过了。一直在想，关于自己，8年做了好多错事，做了好多能做好没做好的事，想起都让个人包眼睛水。胖娃昨天说以后我老婆比他老婆幸福，我能理解人。其实胖娃只是把好处放大了，却没看到我对ex做的那些哈事。
昨晚把签名档改了之后，今早ex来问我，聊了几句之后突然好想哭，30分钟前就跑到厕所隔间里面偷偷的抹眼睛水。我把ex从一个相信爱情的小妮子变成了一个不相信永远的女人，给人家画了好大个美丽的前景然后又自己撕了。经常想起大学四年P事没做，如果我能留在重庆又是另外的境遇，如果我能学点能养活自己的东西而不是在毕业后才开始想学习可能又是另外的境遇。所以现在只想好好对家人朋友也是自己该遭。无聊之余有asn的比赛看也算是个慰籍。
昨天和胖娃说的两件事情我是真的在冷个想，一是有认真的考虑去当老师，小学老师，中学老师都行；一是如果最好的兄弟们都结婚了，快的话30岁之前送完所有人应该没问题吧，我想自己去个新的地方。
呵呵，刚才聊完，ex说以后就叫我慧能了，我突然觉得好好笑。又哭又笑，黄狗撒尿。
end
Leave a comment
Category : Talking &#124; Tags : 

]]></description>
			<content:encoded><![CDATA[<p>昨晚，和胖娃聊到他和现任女友的事情，把本来我基本隔天就在想起的那些事又过了一遍。胖娃1点睡了之后，我老是睡不着，一睡不着就开始胡思乱想。这十几天来，psp内播放得最多的就是“对不起谢谢”“goodbye to romance”&#8221;don&#8217;t look back in angers&#8221;。前天从猩猩宿舍出来本来说晚上去看陈绮贞的演唱会，但是一方面走嘿累了，一方面确实不想和同事去听容易挑起情绪的歌。每次听到“你到过下雪的北京”就莫名的伤感。</p>
<p>2001冬天开始，2004年带着一种得意的心情去了成都，2009年不晓得朗阁的就拉爆了。其实我晓得，小的矛盾因为我到了北京就放得无穷大了，09年春节的经历真的让我好痛苦。8年就这样过了给。也没得愤怒，就是带着遗憾就过了。一直在想，关于自己，8年做了好多错事，做了好多能做好没做好的事，想起都让个人包眼睛水。胖娃昨天说以后我老婆比他老婆幸福，我能理解人。其实胖娃只是把好处放大了，却没看到我对ex做的那些哈事。</p>
<p>昨晚把签名档改了之后，今早ex来问我，聊了几句之后突然好想哭，30分钟前就跑到厕所隔间里面偷偷的抹眼睛水。我把ex从一个相信爱情的小妮子变成了一个不相信永远的女人，给人家画了好大个美丽的前景然后又自己撕了。经常想起大学四年P事没做，如果我能留在重庆又是另外的境遇，如果我能学点能养活自己的东西而不是在毕业后才开始想学习可能又是另外的境遇。所以现在只想好好对家人朋友也是自己该遭。无聊之余有asn的比赛看也算是个慰籍。</p>
<p>昨天和胖娃说的两件事情我是真的在冷个想，一是有认真的考虑去当老师，小学老师，中学老师都行；一是如果最好的兄弟们都结婚了，快的话30岁之前送完所有人应该没问题吧，我想自己去个新的地方。</p>
<p>呵呵，刚才聊完，ex说以后就叫我慧能了，我突然觉得好好笑。又哭又笑，黄狗撒尿。</p>
<p>end</p>
<p><a href="http://www.yegong.net/8-years/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/talking/" title="View all posts in Talking" rel="category tag">Talking</a> | Tags : </p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/8-years/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Repair the network infrastructure of the rental house</title>
		<link>http://www.yegong.net/repair-the-network-infrastructure-of-the-rental-house/</link>
		<comments>http://www.yegong.net/repair-the-network-infrastructure-of-the-rental-house/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 15:48:27 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[cable]]></category>
		<category><![CDATA[DD-WRT]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[OpenWrt]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=769</guid>
		<description><![CDATA[Today, I fixed the cables of my house.
The main reason that drives me to do is the weak signal of the wireless network.
I have a Netgear WGT624 v4, which is sending a very bad signal.1 One week ago, it&#8217;s about -50dB when I check it from the iwconfig. But yesterday, it&#8217;s just -76dB.
It&#8217;s true that [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I fixed the cables of my house.</p>
<p>The main reason that drives me to do is the weak signal of the wireless network.</p>
<p>I have a Netgear WGT624 v4, which is sending a very bad signal.<span style="color: #ff0000;"><sup>1</sup></span> One week ago, it&#8217;s about -50dB when I check it from the iwconfig. But yesterday, it&#8217;s just -76dB.</p>
<p>It&#8217;s true that there&#8217;re some antennae can work with the bad signal. But most of them just can gain 10dB. So this can&#8217;t be a final solution. Then I checked the preserved cables of house. It&#8217;s nice that they all roads to the <del>SCTR</del> weak current box. However, the cables is not connected, with no sign, and even have no RJ45 connector. It took me about two hours to pair<span> the cables and make connectors for them. </span></p>
<p><span>Quite a heavy work. I </span>learnt<span> the </span>order<span> of the subcables from it. In Chinese, it&#8217;s 白橙 橙, 白绿 蓝, 白蓝 绿, 白棕 棕.<br />
</span></p>
<p><span>Actually, you can&#8217;t make connectors with the </span>customized order<span>. Because the subcables are </span>in twisted pair, not just simple lines. So the electronic signal will interfere with each other if you got a wrong order.</p>
<p><span>Note</span>s,</p>
<p>1. I want to but don&#8217;t know how to setup a <a href="http://www.dd-wrt.com/">DD-WRT</a> or <a href="http://openwrt.org/">OpenWrt</a> on it. Many appreciation if someone can help.</p>
<p>PS,</p>
<p>I&#8217;ve made a very nice configuration of compiz and terminator. It&#8217;s amazing to key down the shell commands/vim on the beautiful desktop background. Maybe I will try the <a href="http://awesome.naquadah.org/">awesome</a> next month.</p>
<div id="attachment_772" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.yegong.net/wp-content/uploads/2009/11/terminator-screenshot.png" rel="lightbox[769]"><img class="size-medium wp-image-772" title="Screenshot for Terminator" src="http://www.yegong.net/wp-content/uploads/2009/11/terminator-screenshot-300x187.png" alt="chars and words is now floating before the cloud." width="300" height="187" /></a><p class="wp-caption-text">chars and words is now floating before the cloud.</p></div>
<p><a href="http://www.yegong.net/repair-the-network-infrastructure-of-the-rental-house/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/cable/" rel="tag">cable</a>, <a href="http://www.yegong.net/tag/dd-wrt/" rel="tag">DD-WRT</a>, <a href="http://www.yegong.net/tag/network/" rel="tag">network</a>, <a href="http://www.yegong.net/tag/openwrt/" rel="tag">OpenWrt</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/repair-the-network-infrastructure-of-the-rental-house/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Experience of ubuntu karmic and the fix of eclipse</title>
		<link>http://www.yegong.net/karmic-experience/</link>
		<comments>http://www.yegong.net/karmic-experience/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 04:47:33 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[karmic]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.yegong.net/?p=756</guid>
		<description><![CDATA[Thanks, Arsenek, for your nice prologue.
I just upgraded the ubuntu to 9.10 rc for the machine in office this week.
It&#8217;s cool.
The new input method is easy to use.You just need to apt-get purge ibus and reinstall them. I think the package in the cd image is out-of-date.
Also, I installed a new icon theme, Nerdy Lines. [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks, Arsenek, for your nice prologue.</p>
<p>I just upgraded the ubuntu to 9.10 rc for the machine in office this week.</p>
<p>It&#8217;s cool.</p>
<p>The new input method is easy to use.You just need to apt-get purge ibus and reinstall them. I think the package in the cd image is out-of-date.</p>
<p>Also, I installed a new icon theme, <a href="http://art.gnome.org/themes/icon?page=2">Nerdy Lines</a>. Then I found much icons didn&#8217;t work correctly, so I fixed most of them. As the license of origin work is <a href="http://creativecommons.org/licenses/by-nc-nd/2.0/">cc-by-nc-nd 2.0</a>, so my modification can&#8217;t be released.</p>
<p><a href="http://www.yegong.net/wp-content/uploads/2009/10/icon-nerdy-liines.png" rel="lightbox[756]"><img class="aligncenter size-full wp-image-757" title="icon-nerdy-liines" src="http://www.yegong.net/wp-content/uploads/2009/10/icon-nerdy-liines.png" alt="icon-nerdy-liines" width="96" height="72" /></a></p>
<p>Only got one problem of karmic today, I found that eclipse can&#8217;t create the new project / import a existed project / quick search.</p>
<p>Lots guys reported the same issue everywhere. It seems a problem about the gtk library. A easy solution is</p>
<pre>export GDK_NATIVE_WINDOWS=true
cd ~/share/eclipse/
./eclipse</pre>
<p>Please copy it to a shell script in the PATH to replace the eclipse symbol link.</p>
<p>If you got another problem which is in the eclipse starting up stage &#8212; eclipse dies at one small blank popup window. I just can tell it&#8217;s caused by the XULRunner. You can uninstall it and get a standalone version of firefox.</p>
<p><strong><span style="color: #ff0000;">Update Oct.31 2009</span></strong> : The home machine is also updated to the karmic.</p>
<p><a href="http://www.yegong.net/karmic-experience/#comments">Leave a comment</a></p>
<p>Category : <a href="http://www.yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a> | Tags : <a href="http://www.yegong.net/tag/9-10/" rel="tag">9.10</a>, <a href="http://www.yegong.net/tag/eclipse/" rel="tag">eclipse</a>, <a href="http://www.yegong.net/tag/karmic/" rel="tag">karmic</a>, <a href="http://www.yegong.net/tag/ubuntu/" rel="tag">ubuntu</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://www.yegong.net/karmic-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
