<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/xslt/rss2.xsl" media="screen"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Latest from ChinaonRails's Snippets</title>
		<link>http://chinaonrails.com/go/snippets</link>
		<description>ChinaonRails | ChinaonRails are one of the very few China based web consultancies, who specialize in application development using RubyOnRails/Agile/Ajax.</description>
		<category>Technology</category>
		<language>zh_cn</language>
		<item>
			<title>ruby_archive 直接从压缩的文档中读取rb代码或文件 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/4417.html</link>
			<comments>http://chinaonrails.com/topic/view/4417.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://github.com/byuni/ruby_archive" rel="nofollow external" class="tpc"&gt;http://github.com/byuni/ruby_archive&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Seamless access to ruby source and other files inside zip archives&lt;br /&gt;
&lt;br /&gt;
rubyzip 是ruby的解压缩工具&lt;br /&gt;
&lt;a href="http://chinaonrails.com/topic/view/2607.html" rel="nofollow external" class="tpc"&gt;http://chinaonrails.com/topic/view/2607.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
使用此插件&lt;br /&gt;
&lt;br /&gt;
可以“直接”读压缩文件里的东西&lt;br /&gt;
&lt;br /&gt;
比如information.txt 在 archive.jar 里&lt;br /&gt;
&lt;img class="code" src="http://i.imagehost.org/0672/green_coconut_with_straw.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
f = File.open(’./archive.jar!/information.txt’,’r’)
			</description>
			<pubDate>Fri, 10 Sep 2010 11:05:24 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/4417.html</guid>
		</item>
		<item>
			<title>魔兽80级英雄榜 ... 1 reply</title>
			<link>http://chinaonrails.com/topic/view/4060.html</link>
			<comments>http://chinaonrails.com/topic/view/4060.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.128bitstudios.com/2010/05/09/ruby-and-armory/" rel="nofollow external" class="tpc"&gt;http://www.128bitstudios.com/2010/05/09/ruby-and-armory/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Pulling data from the Warcraft Armory with Ruby&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://j.imagehost.org/0353/2010-06-04_113602.jpg" border="0" /&gt;
			</description>
			<pubDate>Fri, 04 Jun 2010 11:36:56 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/4060.html</guid>
		</item>
		<item>
			<title>Dia 在Mac系统里对ruby程序实施囚禁 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/3939.html</link>
			<comments>http://chinaonrails.com/topic/view/3939.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;img class="code" src="http://www.publicrecordsguy.com/wp-content/uploads/dia-sealr.png" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
这个Dia跟画图的程序没关系，而是个类似军统的组织&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://github.com/robgleeson/Dia" rel="nofollow external" class="tpc"&gt;http://github.com/robgleeson/Dia&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
"Dia" allows you to sandbox an application or block of ruby on the OSX platform by restricting what access to Operating&lt;br /&gt;
&lt;br /&gt;
&lt;div class="quote"&gt;What restrictions can you apply?&lt;br /&gt;
&lt;br /&gt;
No internet access.&lt;br /&gt;
No network access of any kind.&lt;br /&gt;
No file system writes.&lt;br /&gt;
No file system writes, exlcuding writing to /tmp.&lt;br /&gt;
A complete lockdown of Operating System resources.&lt;/div&gt;
&lt;br /&gt;
不给上网封锁访问文件系统写权力，限制到沙盒子里玩不会玩出大事
			</description>
			<pubDate>Wed, 28 Apr 2010 11:44:00 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/3939.html</guid>
		</item>
		<item>
			<title>Encrypt with Ruby decrypt in PHP ... no reply</title>
			<link>http://chinaonrails.com/topic/view/3602.html</link>
			<comments>http://chinaonrails.com/topic/view/3602.html#reply</comments>
			<dc:creator>Caiwangqin</dc:creator>
			<author>Caiwangqin</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/1.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/1_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/1_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			Ruby encrypt decrypt&lt;br /&gt;
&lt;a href="http://coderay.rubychan.de/rays/show/6287" rel="nofollow external" class="tpc"&gt;http://coderay.rubychan.de/rays/show/6287&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
require 'openssl'&lt;br /&gt;
require 'base64'&lt;br /&gt;
def  encipher(data_to_encode)&lt;br /&gt;
    cipher = OpenSSL::Cipher::Cipher.new("des-ede3-cbc")&lt;br /&gt;
    key = "secretkey"&lt;br /&gt;
    cipher.encrypt(key)&lt;br /&gt;
    encoded_data = cipher.update(data_to_encode)&lt;br /&gt;
    encoded_data  cipher.final&lt;br /&gt;
    return Base64.encode64(encoded_data)&lt;br /&gt;
end&lt;br /&gt;
def decipher(encoded)&lt;br /&gt;
    encoded = Base64.decode64(encoded)&lt;br /&gt;
    &lt;br /&gt;
    cipher = OpenSSL::Cipher::Cipher.new("des-ede3-cbc")&lt;br /&gt;
    key = "secretkey"&lt;br /&gt;
    cipher.decrypt(key)&lt;br /&gt;
    encoded_data = cipher.update(encoded)&lt;br /&gt;
    encoded_data  cipher.final&lt;br /&gt;
    return encoded_data&lt;br /&gt;
end&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
PHP encrypt decrypt&lt;br /&gt;
&lt;a href="http://coderay.rubychan.de/rays/show/6288" rel="nofollow external" class="tpc"&gt;http://coderay.rubychan.de/rays/show/6288&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
function getkeyiv($key_size, $iv_size, $key, $iv='') {&lt;br /&gt;
  if ($iv == '') {&lt;br /&gt;
    $iv = 'OpenSSL for Ruby rulez!';&lt;br /&gt;
  }&lt;br /&gt;
  $iv = substr($iv,0,$iv_size);&lt;br /&gt;
  &lt;br /&gt;
  $gen = '';&lt;br /&gt;
  do  {&lt;br /&gt;
    $gen = $gen.md5($gen.$key.$iv,true);&lt;br /&gt;
  } while (strlen($gen)($iv_size+$key_size));&lt;br /&gt;
  $o[0] = substr($gen,0,$key_size);&lt;br /&gt;
  $o[1] = $iv; //this is not the generated IV,&lt;br /&gt;
                     //just the original "salt" cut to the required size&lt;br /&gt;
  return $o;&lt;br /&gt;
}&lt;br /&gt;
function trimpadding($str) {&lt;br /&gt;
   if (ord($str[strlen($str)-1])  9) {&lt;br /&gt;
    return rtrim($str,$str[strlen($str)-1]);&lt;br /&gt;
  } else {&lt;br /&gt;
    return $str;    &lt;br /&gt;
  }&lt;br /&gt;
} &lt;br /&gt;
function encipher($data_to_encode){&lt;br /&gt;
  $key = 'secretkey';&lt;br /&gt;
    &lt;br /&gt;
  $td = mcrypt_module_open(MCRYPT_TRIPLEDES, '',  MCRYPT_MODE_CBC, '');&lt;br /&gt;
  $iv_size = mcrypt_enc_get_iv_size($td);&lt;br /&gt;
  $key_size = mcrypt_enc_get_key_size($td);&lt;br /&gt;
  $genkey = getkeyiv($key_size, $iv_size,$key);&lt;br /&gt;
  if (mcrypt_generic_init($td,$genkey[0],$genkey[1]) != -1) {&lt;br /&gt;
          $encoded_data = mcrypt_generic($td, $data_to_encode);&lt;br /&gt;
  }&lt;br /&gt;
  mcrypt_generic_deinit($td);&lt;br /&gt;
  mcrypt_module_close($td);&lt;br /&gt;
    return base64_encode($encoded_data);&lt;br /&gt;
}&lt;br /&gt;
function decipher($encoded) {&lt;br /&gt;
  $key = 'secretkey';&lt;br /&gt;
  $decrypted='';&lt;br /&gt;
  $enc = base64_decode($encoded);&lt;br /&gt;
  $td = mcrypt_module_open(MCRYPT_TRIPLEDES, '',  MCRYPT_MODE_CBC, '');&lt;br /&gt;
  $iv_size = mcrypt_enc_get_iv_size($td);&lt;br /&gt;
  $key_size = mcrypt_enc_get_key_size($td);&lt;br /&gt;
  $genkey = getkeyiv($key_size, $iv_size,$key);&lt;br /&gt;
  if (mcrypt_generic_init($td,$genkey[0],$genkey[1]) != -1) {&lt;br /&gt;
          $decrypted = mdecrypt_generic($td, $enc);&lt;br /&gt;
  }&lt;br /&gt;
  mcrypt_generic_deinit($td);&lt;br /&gt;
  mcrypt_module_close($td);&lt;br /&gt;
  return trimpadding($decrypted);&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;/div&gt;
			</description>
			<pubDate>Wed, 16 Dec 2009 17:19:07 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/3602.html</guid>
		</item>
		<item>
			<title>竖排效果 ... 1 reply</title>
			<link>http://chinaonrails.com/topic/view/3554.html</link>
			<comments>http://chinaonrails.com/topic/view/3554.html#reply</comments>
			<dc:creator>axgle</dc:creator>
			<author>axgle</author>
			<!--<enclosure url="http://chinaonrails.com/img/p_0.gif" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p_0_s.gif" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p_0_n.gif" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			中国文字的竖排效果：从上往下，从右往左.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code"&gt;&lt;br /&gt;
#将多行文字，按照顺时针的方向，旋转90度。&lt;br /&gt;
def tb_rl(str)&lt;br /&gt;
	data=str.split("\n").map{|row|row.split(//u)}&lt;br /&gt;
	data.reverse!&lt;br /&gt;
	a=data.shift	 &lt;br /&gt;
	a.zip(*data).each do |e|&lt;br /&gt;
	 print e&lt;br /&gt;
	 puts&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
str="&lt;br /&gt;
中国&lt;br /&gt;
文字&lt;br /&gt;
"&lt;br /&gt;
&lt;br /&gt;
tb_rl(str.strip)&lt;br /&gt;
&lt;/div&gt;
问题：如果是&lt;br /&gt;
&lt;br /&gt;
中国&lt;br /&gt;
文字&lt;br /&gt;
好&lt;br /&gt;
&lt;br /&gt;
这种第三行“好”字后面有空位的如何处理？
			</description>
			<pubDate>Wed, 25 Nov 2009 19:43:27 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/3554.html</guid>
		</item>
		<item>
			<title>在下新手求一个脚本 ... 6 replies</title>
			<link>http://chinaonrails.com/topic/view/3230.html</link>
			<comments>http://chinaonrails.com/topic/view/3230.html#reply</comments>
			<dc:creator>JackyCheung</dc:creator>
			<author>JackyCheung</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/1421.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/1421_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/1421_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			这个脚本是要用到Win下的，虽然我平常是在Linux下。&lt;br /&gt;
&lt;br /&gt;
比如一个目录 D:\aa&lt;br /&gt;
&lt;br /&gt;
我要把这个目录下的所有文件批量重命名 &lt;br /&gt;
&lt;br /&gt;
请各位给个思路和脚本，&lt;br /&gt;
&lt;br /&gt;
主要是用到什么模块和类&lt;br /&gt;
&lt;br /&gt;
谢谢大家了阿&lt;br /&gt;
&lt;br /&gt;
再说句额外的话：谁知道Ruby在Win下打成Exe文件用什么模块？&lt;br /&gt;
就像Python中的py2exe一样的作用 &lt;br /&gt;
&lt;br /&gt;
知道的告诉下 谢谢了
			</description>
			<pubDate>Fri, 07 Aug 2009 11:45:17 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/3230.html</guid>
		</item>
		<item>
			<title>曼德布洛特集合 ruby实现数学和破碎之美 ... 5 replies</title>
			<link>http://chinaonrails.com/topic/view/3013.html</link>
			<comments>http://chinaonrails.com/topic/view/3013.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			曼德布洛特集合（Mandelbrot set）&lt;br /&gt;
曼德勃羅集合&lt;br /&gt;
&lt;br /&gt;
是在复平面上组成分形的点的集合。&lt;a href="http://en.wikipedia.org/wiki/Mandelbrot_set" rel="nofollow external" class="tpc"&gt;http://en.wikipedia.org/wiki/Mandelbrot_set&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
运行下面链接中的代码&lt;br /&gt;
&lt;a href="http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/" rel="nofollow external" class="tpc"&gt;http://www.xcombinator.com/2008/02/22/ruby-inject-and-the-mandelbrot-set/&lt;/a&gt;&lt;br /&gt;
结果图形和下面的很接近&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://img195.imageshack.us/img195/2650/322pxmandelzoom00mandel.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://blog.xuite.net/sinner66/blog/10158128" rel="nofollow external" class="tpc"&gt;http://blog.xuite.net/sinner66/blog/10158128&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
有一部电影叫维度；数学漫步（Dimensions: a walk through mathematics）记不得那集里有讲到Fractal&lt;br /&gt;
&lt;br /&gt;
http://www.dimensions-math.org/Dim_ZH_si.htm
			</description>
			<pubDate>Mon, 01 Jun 2009 15:34:19 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/3013.html</guid>
		</item>
		<item>
			<title>导入GPX 地图显示你的户外运动踪迹 ... 2 replies</title>
			<link>http://chinaonrails.com/topic/view/2949.html</link>
			<comments>http://chinaonrails.com/topic/view/2949.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.larsgebhardt.de/2009/05/10/how-to-display-nokia-sportstracker-gps-data-on-google-maps-with-ruby-on-rails/" rel="nofollow external" class="tpc"&gt;http://www.larsgebhardt.de/2009/05/10/how-to-display-nokia-sportstracker-gps-data-on-google-maps-with-ruby-on-rails/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://www.larsgebhardt.de/wp-content/bild-2.jpg" border="0" /&gt;
			</description>
			<pubDate>Tue, 12 May 2009 10:03:11 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2949.html</guid>
		</item>
		<item>
			<title>聪明大劲了的ruby代码有吗？上眼-...贡献 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2874.html</link>
			<comments>http://chinaonrails.com/topic/view/2874.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://stackoverflow.com/questions/708428/whats-an-example-of-ruby-code-thats-too-clever" rel="nofollow external" class="tpc"&gt;http://stackoverflow.com/questions/708428/whats-an-example-of-ruby-code-thats-too-clever&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
too clever 的标准是什么？&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://weblogs.baltimoresun.com/news/captioncall/computer-cat.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
short
			</description>
			<pubDate>Fri, 10 Apr 2009 11:45:05 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2874.html</guid>
		</item>
		<item>
			<title>10秒造个twitter的程序 ... 14 replies</title>
			<link>http://chinaonrails.com/topic/view/2858.html</link>
			<comments>http://chinaonrails.com/topic/view/2858.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://intridea.com/2009/4/3/rails-template-create-a-twitter-application-in-seconds?blog=company" rel="nofollow external" class="tpc"&gt;http://intridea.com/2009/4/3/rails-template-create-a-twitter-application-in-seconds?blog=company&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
当然离不开模板和twitter OAuth&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://www.hueniverse.com/.a/6a00e00993be888833011168915409970c-320wi" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://chinaonrails.com/topic/view/1677.html" rel="nofollow external" class="tpc"&gt;http://chinaonrails.com/topic/view/1677.html&lt;/a&gt;
			</description>
			<pubDate>Sat, 04 Apr 2009 10:45:58 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2858.html</guid>
		</item>
		<item>
			<title>rgit.rb，在任何子目录也能运行git命令 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2359.html</link>
			<comments>http://chinaonrails.com/topic/view/2359.html#reply</comments>
			<dc:creator>404</dc:creator>
			<author>404</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/48.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/48_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/48_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			#!/usr/bin/env ruby &lt;br /&gt;
   &lt;br /&gt;
 dirs = Dir.glob('**/.git').map { |d| d.chomp('/.git') } &lt;br /&gt;
   &lt;br /&gt;
 if ARGV.empty? &lt;br /&gt;
   STDERR.puts "usage: #{File.basename($0)} &amp;lt;cmd&amp;gt; ..." &lt;br /&gt;
   STDERR.puts "  Runs git &amp;lt;cmd&amp;gt; in every repository found in subdirs" &lt;br /&gt;
   exit &lt;br /&gt;
 end &lt;br /&gt;
   &lt;br /&gt;
 dirs.each do |dir| &lt;br /&gt;
   puts "-&amp;gt; #{dir}" &lt;br /&gt;
   Dir.chdir(dir) do &lt;br /&gt;
     system 'git', *ARGV &lt;br /&gt;
   end &lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://zargony.com/2008/10/30/recursive-git-rgit" rel="nofollow external" class="tpc"&gt;http://zargony.com/2008/10/30/recursive-git-rgit&lt;/a&gt;
			</description>
			<pubDate>Fri, 31 Oct 2008 09:09:45 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2359.html</guid>
		</item>
		<item>
			<title>使用SSH自动上传文件的ruby小程序 ... 1 reply</title>
			<link>http://chinaonrails.com/topic/view/2358.html</link>
			<comments>http://chinaonrails.com/topic/view/2358.html#reply</comments>
			<dc:creator>404</dc:creator>
			<author>404</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/48.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/48_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/48_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			gem install net-ssh -y&lt;br /&gt;
gem install net-sftp -y&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
require 'net/ssh' &lt;br /&gt;
require 'net/sftp' &lt;br /&gt;
Net::SSH.start('server', 'username', 'password') do |ssh| &lt;br /&gt;
ssh.sftp.connect do |sftp| &lt;br /&gt;
Dir.foreach('.') do |file| &lt;br /&gt;
puts file &lt;br /&gt;
end &lt;br /&gt;
end &lt;br /&gt;
end &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.infoq.com/articles/ruby-file-upload-ssh-intro" rel="nofollow external" class="tpc"&gt;http://www.infoq.com/articles/ruby-file-upload-ssh-intro&lt;/a&gt;
			</description>
			<pubDate>Fri, 31 Oct 2008 09:04:10 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2358.html</guid>
		</item>
		<item>
			<title>莫尔斯电报编解码 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2310.html</link>
			<comments>http://chinaonrails.com/topic/view/2310.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://judofyr.net/posts/morse.html" rel="nofollow external" class="tpc"&gt;http://judofyr.net/posts/morse.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
竟然写出这样的排列&lt;br /&gt;
&lt;img class="code" src="http://img296.imageshack.us/img296/4310/morsexb6.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
程序的“使用”问题：只对字母a-z编码解码，不含数字&lt;br /&gt;
&lt;br /&gt;
让键盘灯眨眼，闪烁出morse&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://chinaonrails.com/topic/view/1337.html" rel="nofollow external" class="tpc"&gt;http://chinaonrails.com/topic/view/1337.html&lt;/a&gt;
			</description>
			<pubDate>Mon, 20 Oct 2008 13:29:11 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2310.html</guid>
		</item>
		<item>
			<title>计算目录大小并排序 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2267.html</link>
			<comments>http://chinaonrails.com/topic/view/2267.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://roman.flucti.com/?p=43" rel="nofollow external" class="tpc"&gt;http://roman.flucti.com/?p=43&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Sorting directories by content size &lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://gist.github.com/15677" rel="nofollow external" class="tpc"&gt;http://gist.github.com/15677&lt;/a&gt;
			</description>
			<pubDate>Mon, 13 Oct 2008 16:52:30 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2267.html</guid>
		</item>
		<item>
			<title>多附件Multiple Attachments 的Rails 应用示例 ... 1 reply</title>
			<link>http://chinaonrails.com/topic/view/2191.html</link>
			<comments>http://chinaonrails.com/topic/view/2191.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.practicalecommerce.com/blogs/post/432-Multiple-Attachments-in-Rails" rel="nofollow external" class="tpc"&gt;http://www.practicalecommerce.com/blogs/post/432-Multiple-Attachments-in-Rails&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://www.practicalecommerce.com/uploads/images/0000/0566/Safari001.png" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
下载示范代码&lt;br /&gt;
http://www.practicalecommerce.com/files/multiple.zip&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://chinaonrails.com/topic/view/1433.html" rel="nofollow external" class="tpc"&gt;http://chinaonrails.com/topic/view/1433.html&lt;/a&gt;
			</description>
			<pubDate>Fri, 19 Sep 2008 09:02:13 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2191.html</guid>
		</item>
		<item>
			<title>分析G mail历史，以图示化显示 ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2190.html</link>
			<comments>http://chinaonrails.com/topic/view/2190.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://blog.logeek.fr/2008/9/18/analyzing-your-gmail-history" rel="nofollow external" class="tpc"&gt;http://blog.logeek.fr/2008/9/18/analyzing-your-gmail-history&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://blog.logeek.fr/assets/2008/9/15/gmail-1.png" border="0" /&gt;
			</description>
			<pubDate>Fri, 19 Sep 2008 09:01:11 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2190.html</guid>
		</item>
		<item>
			<title>Reverse Ajax 反向ajax 做聊天应用示范视频 ... 21 replies</title>
			<link>http://chinaonrails.com/topic/view/2162.html</link>
			<comments>http://chinaonrails.com/topic/view/2162.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.danielcadenas.com/2008/08/reverse-ajax-and-prototype.html" rel="nofollow external" class="tpc"&gt;http://www.danielcadenas.com/2008/08/reverse-ajax-and-prototype.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Reverse Ajax and Prototype with Mongrel handlers&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://dcadenas.googlepages.com/reverse_ajax.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
反向ajax&lt;br /&gt;
&lt;br /&gt;
从服务器端向多个浏览器主动推数据的一种技术。它的一种实现就是客户端向服务器请求后，服务器不立即回应，从而导致一个http长连接，等到有更新数据的时候，再利用这个连接“主动”向客户端回送。&lt;br /&gt;
&lt;br /&gt;
Comet，即Reverse-Ajax代表，一种从服务器端到浏览器实现数据流的技术，为基于实时事件的数据服务提供了新的发展前景-聊天chat room，即时通讯IM 等。&lt;br /&gt;
&lt;a href="http://ihower.idv.tw/blog/archives/1507" rel="nofollow external" class="tpc"&gt;http://ihower.idv.tw/blog/archives/1507&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
要服务器推送push，反向ajax!
			</description>
			<pubDate>Fri, 12 Sep 2008 10:21:29 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2162.html</guid>
		</item>
		<item>
			<title>Shinmun 小巧的blog引擎 ... 14 replies</title>
			<link>http://chinaonrails.com/topic/view/2135.html</link>
			<comments>http://chinaonrails.com/topic/view/2135.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.matthias-georgi.de/2008/9/shinmun-a-small-and-beautiful-blog-engine.html" rel="nofollow external" class="tpc"&gt;http://www.matthias-georgi.de/2008/9/shinmun-a-small-and-beautiful-blog-engine.html&lt;/a&gt;&lt;br /&gt;
Shinmun 似乎跟韩语有关&lt;br /&gt;
&lt;img class="code" src="http://salmosa.kaist.ac.kr/~wschun/pic/local/total.gif" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
是否读成“新shin 闻 mun”？&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://github.com/georgi/shinmun/tree/master" rel="nofollow external" class="tpc"&gt;http://github.com/georgi/shinmun/tree/master&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.matthias-georgi.de/2008/9/commenting-system-with-lightweight-json-store.html" rel="nofollow external" class="tpc"&gt;http://www.matthias-georgi.de/2008/9/commenting-system-with-lightweight-json-store.html&lt;/a&gt;&lt;br /&gt;
外挂式留言评论，用的是php 加JSON store&lt;br /&gt;
&lt;br /&gt;
http://smartic.us/2008/9/7/moving-from-mephisto-to-webby&lt;br /&gt;
&lt;a href="http://js-kit.com/" rel="nofollow external" class="tpc"&gt;http://js-kit.com/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://js-kit.com/images/js-kit-logo-home.png" border="0" /&gt;&lt;br /&gt;
http://disqus.com/&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://blog.disqus.net/wp-content/themes/redplanet-10/images/img4.jpg" border="0" /&gt;&lt;br /&gt;
社会化2.0的留言评论，把个人blog变成论坛&lt;br /&gt;
&lt;a href="http://www.showeb20.com/?p=1102" rel="nofollow external" class="tpc"&gt;http://www.showeb20.com/?p=1102&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://github.com/uggedal/reprise/tree/master" rel="nofollow external" class="tpc"&gt;http://github.com/uggedal/reprise/tree/master&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
重新开始-微小格式，所以也很小&lt;br /&gt;
As minimal a hAtom blog as possible
			</description>
			<pubDate>Mon, 08 Sep 2008 08:36:29 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2135.html</guid>
		</item>
		<item>
			<title>Toast聊天机器人 ... 2 replies</title>
			<link>http://chinaonrails.com/topic/view/2106.html</link>
			<comments>http://chinaonrails.com/topic/view/2106.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;img class="code" src="http://imagecache2.allposters.com/images/pic/GAN/AUD-024~Nifty-Fifties-Toast-Posters.jpg" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://rbandrews.livejournal.com/153671.html" rel="nofollow external" class="tpc"&gt;http://rbandrews.livejournal.com/153671.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a class="tpc" href="http://chinaonrails.com/q/聊天机器人"&gt;http://chinaonrails.com/q/聊天机器人&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
其它的bots&lt;br /&gt;
http://chinaonrails.com/topic/view/1007.html
			</description>
			<pubDate>Mon, 01 Sep 2008 12:53:23 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2106.html</guid>
		</item>
		<item>
			<title>会员Robin Lu 写的gem文档浏览器goo ... no reply</title>
			<link>http://chinaonrails.com/topic/view/2094.html</link>
			<comments>http://chinaonrails.com/topic/view/2094.html#reply</comments>
			<dc:creator>bd7lx</dc:creator>
			<author>bd7lx</author>
			<!--<enclosure url="http://chinaonrails.com/img/p/9.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_s.jpg" type="image/jpeg" />
			<enclosure url="http://chinaonrails.com/img/p/9_n.jpg" type="image/jpeg" />-->
			<category>Snippets</category>
			<description>
			&lt;a href="http://www.robinlu.com/blog/archives/218" rel="nofollow external" class="tpc"&gt;http://www.robinlu.com/blog/archives/218&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;img class="code" src="http://www.robinlu.com/blog/images/goo_icon.png" border="0" /&gt;&lt;br /&gt;
&lt;br /&gt;
想舞舞这只龙&lt;br /&gt;
&lt;br /&gt;
得请上苹果 oSX
			</description>
			<pubDate>Fri, 29 Aug 2008 08:14:53 +0800</pubDate>
			<guid>http://chinaonrails.com/topic/view/2094.html</guid>
		</item>
	</channel>
</rss>