chomp:去掉字符串末尾的\n或\rchop:去掉字符串末尾的最后一个字符,不管是\n\r还是普通字符to_s:转换成字符串to_i:转换成数值object.nil?:判断是否为空,空返回:true
分类:
其他好文 时间:
2014-08-25 16:37:34
阅读次数:
208
惯例优于配置(Convention over Configuration)来源于Ruby On Rails框架的设计理念,也被认为是Rails大获成功的关键因素之一。这里所谓的惯例,可以理解为框架对编程的一些约束,我们可以根据实现制订的默认准则,通过反射技能完成对象的建立,对象的协作,甚至是使用程序...
分类:
其他好文 时间:
2014-08-25 16:29:54
阅读次数:
160
Problem 34
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are...
分类:
其他好文 时间:
2014-08-25 11:59:14
阅读次数:
243
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please...
分类:
其他好文 时间:
2014-08-25 10:06:04
阅读次数:
198
Issue:Gem files will remain installed in /tmp/bundler20140825-31835-p0c0p/sqlite3-1.3.9/gems/sqlite3-1.3.9 for inspection.Results logged to /tmp/bundl...
分类:
数据库 时间:
2014-08-25 01:10:23
阅读次数:
284
导入 当模块化布局的时候 导入头和尾 私有化 不生成css文件 文件名前面加下划线 结果 嵌套导入 导入css文件 不推荐 注释 和默认变量值
分类:
其他好文 时间:
2014-08-24 14:04:02
阅读次数:
192
scss两种格式 sass 大括号 scss css写法 Arguments: --no-cache –style compressed --update $FileName$:css/$FileNameWithoutExtension$.css 标示部分是 输出的css类型 和额外输出路径 就是 ...
分类:
其他好文 时间:
2014-08-24 12:56:22
阅读次数:
297
配置你的服务器 你需要在你的服务器上安装Ruby的环境,你可以使用RVM或者是rbenv. 上传到github 这步需要将你的应用上传到github,在你的github上创建新的repository,然后在你本机代码位置执行下面的命令,初始化g...
如果下列任何组件之一已经被安装,请酌情忽略1.Snort参照 CentOS6.5 安装snort2.GIT非官方个3.Ruby 版本限制> 1.9.2系统自带版本过低首先卸载掉yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ...
分类:
其他好文 时间:
2014-08-24 00:14:31
阅读次数:
663