$ rhc app create -a [appname] -t diy-0.1
$ rhc cartridge add -a [appname] -c mysql-5.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# className & methodName are both String | |
# Object.send | |
def dynamic(className, methodName, *param) | |
k = Kernel.const_get(className).new() | |
k.send(methodName, *param) if k.respond_to? methodName | |
end | |
# Object.method | |
def dynamic(className, methodName, *param) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# one dimensional array | |
# yield | |
class Array | |
def my_map | |
arr = [] | |
each {|n,i| arr << yield(n)} | |
arr | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
require 'open-uri' | |
require 'net/http' | |
require 'net/ssh' | |
require 'net/scp' | |
require 'nokogiri-pretty' | |
require 'rexml/document' | |
include REXML |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
require 'spreadsheet' | |
require 'rexml/document' | |
include REXML | |
class Generator | |
attr_accessor :dataResult #array,获取每个xml所需数据 | |
attr_accessor :resultPath #string,生成的xml存储路径 | |
attr_accessor :excelPath #string,excel文件路径 | |
attr_accessor :templatePath #string,xml模板文件路径 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1、安装Rubyinstaller for windows | |
前往“http://rubyinstaller.org/downloads/”网站下载RubyInstaller for Windows。一般,请下载1.9.3以上版本。按照提示安装即可,其中需要勾选“Add Ruby executables to your PATH”选项。 | |
##################################################################### | |
2、安装gem | |
此工具所需gem包含:tiny_tds。可直接在命令行中联网安装,打开“cmd”,输入“gem install tiny_tds”。若联网安装失败,可使用已下载的“tiny_tds-0.6.2.gem”,在命令行中输入“gem install 路径/tiny_tds-0.6.2.gem”进行安装。 | |
##################################################################### | |
3、根据具体测试环境修改conf文件夹中的config.yml | |
(1)method1: | |
connect_username:数据库登陆名 | |
connect_password:数据库登陆密码 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import org.apache.jmeter.config.Arguments; | |
import org.apache.jmeter.protocol.java.sampler.JavaSamplerClient; | |
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; | |
import org.apache.jmeter.samplers.SampleResult; |
OlderNewer