您的当前位置:首页 > 建站学院 > 后端开发 > 
  • Ruby 中模块

    后端开发2025年07月22日

    使用模块中常量 :模块名::常量名 定义模块用module...end 。模块与类非常相似,但是: A) 模块不可以有实例对象; B) 模块不可以有子类。 ...

  • [导入]Thumbnailer in Ruby and RMagick

    后端开发2025年07月22日

    require 'RMagick' maxwidth = 120 maxheight = 160 aspectratio = maxwidth.to_f / maxheight.to_f imgfile = 'world' pic = Magick::Image.read(imgfile + '.jpg').first imgwidth = pic.col...

  • [导入]Produce GIF or PNG barcode images from a Ruby on Rails application using RMagick and Gbarcode

    后端开发2025年07月22日

    This is a Ruby on Rails controller that produces PNG barcode images using RMagick (http://rmagick.rubyforge.org/) and Gbarcode (http://gbarcode.rubyforge.org/), the Ruby Gnu Barco...

  • ruby测试框架

    后端开发2025年07月21日

    发布时间:2012-03-4 22:45 来源:伯乐在线 分类: 程序员 都等你发言 :) 分享到: 在去年的YOW Melbourne开发者大会上,我参加了一些研习班。这些研习班由@coreyhaines和 @rains负责,因此TDD(测试驱动开发)成为了主要讨论的内容。通常这不是一个问题,但是令人沮丧的是(考虑到这是2010年举办的开发者大会),那时...

  • 从python入门ruby

    后端开发2025年07月21日

    1、Ruby的函数可以不使用括号 def h(name) puts "hello #{name}" end h "jack" 2、python可以直接访问实例的属性,ruby不行,且Ruby的类名必须以大写字母开头 为什么python需要self:假如创建了一个类MyClass,实例化MyClass得到了MyObje...

  • 在mac上安装ruby

    后端开发2025年07月21日

    1、先装RVM,一个多版本ruby环境的管理和切换工具 curl -sSL https://get.rvm.io | bash -s stable 会自动装上最新版。更新RVM版本:$ rvm get stable 载入RVM环境 source ~/.rvm/scripts/rvm 检查是否安装成功 rvm -v 2、安装Ruby 列出ruby可安装的版本...

  • sublime搭建c++/java/lua/python/ruby的配置文件

    后端开发2025年07月21日

    本人电脑win7 64位 提前装一下convert to utf-8插件,编译运行出现乱码,组合键ctrl+shift+c把源文件转成gbk编码. 仍乱码的话,重启编辑器|电脑|重新编辑中文部分。 c++ { "working_dir": "$file_path", "cmd": "g++ -Wall -fexec-charset=GBK \"$file_...

  • Ruby 线程(一)

    后端开发2025年07月21日

    本章包括: · Creating and Manipulating Threads · Synchronizing Threads · Summary He draweth out the thread of his verbosity finer than the staple of his argument. William Shakespeare, ...

  • Ruby 线程(二)

    后端开发2025年07月20日

    6、Using a Thread Group 线程组是管理线程的一种方式,它将线程彼此从逻辑上关联起来。通常,所有线程属于Default线程组(它是个类常量)。但如果创建了一个新线程组,则新线程会被添加到其中。 一个线程每次只可属于一个线程组。当线程被添加到线程组时,它自动地被从它先前的线程组中移出。 ThreadGroup.new类方法创建一个新线程组,...

  • ruby中容易犯的错误

    后端开发2025年07月20日

    • First and foremost, run your scripts with warnings enabled (the -w command-line option).• If you happen to forget a “,” in an argument list—especially to print—you can produce s...