码迷,mamicode.com
首页 >  
搜索关键字:ruby rvm    ( 4311个结果
Ruby
Ruby is a true object oriented programming language.Ruby is a server-side scripting language similar to Python and PERL. Ruby can be embedded into HTM ...
分类:其他好文   时间:2016-12-21 09:28:04    阅读次数:195
ruby逐行遍历文件
ruby遍历文件内容,基本思路是逐行读取逐行打印,也是比较普遍的方法:#!/usr/bin/envruby #Encoding:utf8 file=File.open("/tmp/abc.txt") file.each_linedo|line| printline end file.close另外一种写法,一次性读取一次性打印,相对耗费更多内存,小文件场合比上面的方法更..
分类:其他好文   时间:2016-12-20 21:22:38    阅读次数:215
ruby的if判断
if判断的基本格式如下:if条件then#then可省略 处理 end1、判断文件是否存在#!/usr/bin/envruby ifFile.exist?("/etc/hosts") print"ok" end加上else#!/usr/bin/envruby ifFile.exist?("/etc/hosts") print"ok" else print"error,filenotexist" end如果程序在后台运行,那么需..
分类:其他好文   时间:2016-12-20 21:21:48    阅读次数:182
ruby仿awk处理列
直接上代码#!/usr/bin/envruby #encoding:utf-8 filename=ARGV[0] file=File.open(filename) =begin 逐列打印 =end file.each_linedo|line| myline=line.chomp! ary=myline.readlines putsary[1] end file.close用each_line逐行遍历,然后用readlines将行内容变为数组,然后..
分类:其他好文   时间:2016-12-20 21:21:32    阅读次数:145
eclipse使用
Eclipse 是一个开放源代码的、基于 Java 的可扩展开发平台。 Eclipse 是 Java 的集成开发环境(IDE),当然 Eclipse 也可以作为其他开发语言的集成开发环境,如C,C++,PHP,和 Ruby 等。Eclipse 附带了一个标准的插件集,包括Java开发工具(Java ...
分类:系统相关   时间:2016-12-20 18:04:57    阅读次数:249
《Distributed Programming With Ruby》读书笔记三 Hello World Rinda and TupleSpace (Part1.2-1)
Chapter2: Rinda Including 7 parts: "Hello World" the Rinda Way Understanding Tuples and TupleSpaces Callbacks and Observers Security with Rinda Renewi ...
分类:其他好文   时间:2016-12-19 00:14:54    阅读次数:217
《Distributed Programming With Ruby》读书笔记五 RingyDingy (Part2 chapter3)
Part II Third-Party Frameworks and Libraries The first part of this book takes a deep dive into two main libraries: DRb and Rinda Chapter3: RingyDingy ...
分类:其他好文   时间:2016-12-19 00:09:52    阅读次数:229
ruby yield 关键字用法实例
yield关键字我是这样理解,用它来占一个位置,先标记下这个地方将来要写代码的,等到调用的时候,再来编写具体的代码。有点像函数指针,或者C#里的委托,但其实并不太一样。 写测试接口的时候,每次的assert返回值不一样,但函数体大部分是相同的,只有参数不同。正好最近看到了yield,就熟悉一下用法, ...
分类:其他好文   时间:2016-12-18 23:53:41    阅读次数:352
全组合的递归实现(ruby)
着急用所以直接扒了一个C++算法翻译成了ruby…暂记 ...
分类:其他好文   时间:2016-12-18 23:35:14    阅读次数:157
python中urllib, urllib2,urllib3, httplib,httplib2, request的区别
permike原文python中urllib, urllib2,urllib3, httplib,httplib2, request的区别 若只使用python3.X, 下面可以不看了, 记住有个urllib的库就行了 python2.X 有这些库名可用: urllib, urllib2, urll ...
分类:编程语言   时间:2016-12-18 15:11:29    阅读次数:228
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!