ruby好像有指针啊!!!
b = "123"
a = b
b.gsub!(/2/,"")
puts a
得到的结果是13,发现如果a = b的话貌似只是把b的指针给了a,但是如果b的值发生了变化a才能从b中独立出来。
如果把上面的代码改成
b = "123"
a = "#{b}"
b.gsub!(/2/,"")
puts a
则得到的结果为123,这里是把b的值给了a
不知道我的猜想对不对!
相关文档:
喜欢玩阿月系列RPG游戏的我,跟不少童鞋一样下了RPGMakerXP来瞻仰一下。当时觉得这个软件太方便了,用鼠标随便点点就能弄出来个有趣的小游戏。因为里面不仅自带不少地图和人物行走图等素材,容易上手的操作方式也让自己大有成就感……可是游戏毕竟是离不开编程,解开游戏包,看 ......
To get it done is not easy. I spent a whole day to figure out the various compatibility issues along the way out.
Now there still might be potential issues, but it works by my rough test.
Step 1: Install Apache Cassandra
You may know that the Ruby gem cassandra will do it for you.
  ......
The following is improved version of the code created by David Mullet, from
http://rubyonwindows.blogspot.com/2007/03/ruby-ado-and-sqlserver.html
require 'win32ole'
class SqlServer
# This class manages database connection and queries
attr_accessor :connection, :data, :fields
attr_wr ......
可用库:getoptlong.rs, optionparser
对应类:GetoptLong, OptionParser
前者已过时,建议使用后者,且后者比前者易用。
后者特点:
1. 参数描述和代码处理写在一起
2. 输出参数说明,不需单独维护
3. 可选参数和命令参数描述简洁
4. 参数可自动转换为特定的类
5. ......
1,安装ruby
下载地址: http://rubyinstaller.org/download.html
2,安装rails
使用命令下载:在命令行运行gem install rails --remote
2,初步了解ruby的文章
http://www.bcbbs.net/html/29671.html
http://www.bcbbs.net/dev/List64.aspx ......