的Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.1.1'
gem 'mysql2'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'devise'
gem 'cancan'
gem 'attr_encrypted'
gem 'faker', '1.0.1'
gem 'jdbc-mysql', '5.1.28', :platform => :jruby
gem 'thinking-sphinx', '~> 3.1.0'
gem 'kaminari'
gem 'postmark-rails', '~> 0.5.0'
gem 'slim-rails'
gem 'strong_password', '~> 0.0.3'
gem 'jquery-turbolinks'
gem 'whenever', :require => false
gem 'nokogiri'
gem …Run Code Online (Sandbox Code Playgroud) 我正在使用MSSQL 2005.
我有StringIO对象,其中包含我的zip文件内容.
以下是我获取zip二进制数据的方法:
stringio = Zip::ZipOutputStream::write_buffer do |zio|
Eclaim.find_by_sql("SET TEXTSIZE 67108864")
zio.put_next_entry("application.xml")
#zio.write @claim_db[:xml]
biblio = Nokogiri::XML('<?xml version="1.0" encoding="utf-8"?>' + @claim_db[:xml], &:noblanks)
zio.write biblio.to_xml
builder = Nokogiri::XML::Builder.new(:encoding => 'utf-8') do |xml|
xml.documents {
docs.where("ext not in (#{PROHIBITED_EXTS.collect{|v| "'#{v}'"}.join(', ')})").each{|doc|
zio.put_next_entry("#{doc[:materialtitle_id]}.#{doc[:ext]}")
zio.write doc[:efile]
xml.document(:id => doc[:materialtitle_id]) {
xml.title doc[:title]
xml.code doc[:code]
xml.filename "#{doc[:materialtitle_id]}.#{doc[:ext]}"
xml.extname doc[:ext]
}
}
}
end
zio.put_next_entry("docs.xml")
zio.write builder.to_xml
end
stringio
Run Code Online (Sandbox Code Playgroud)
在我的控制器中我尝试:
data.rewind
@claim.docs.create(
:title => 'Some file',
:ext => 'zip', …Run Code Online (Sandbox Code Playgroud) Mac OS X Lion 10.7.4
PhoneGap 1.2
我正在使用Ipad 6.0 Simulator构建我的应用程序.
var pictureSource,
destinationType;
function onDeviceReady() {
pictureSource = navigator.camera.PictureSourceType;
destinationType = navigator.camera.DestinationType;
if (noConnection()) alert("No internet connection. Working in offline mode.");
deviceId = device.uuid;
initDb();
initFileSystem();
}
$("#take-photo").click(function(e){
e.preventDefault();
navigator.camera.getPicture(onPhotoUriSuccess,
onPhotoFail,
{quality: 85, destinationType: destinationType.FILE_URI}
);
return false;
});
Run Code Online (Sandbox Code Playgroud)
看起来一切都是正确但我得到一个错误'没有相机可用'.
也许是因为我正在运行我的应用程序wuth Ipad 6.0 Simulator.
我有Ipad 6.0模拟器和iOS设备可用于我的应用程序.当我选择iOS设备并运行时,我收到错误'没有配置的iOS设备可用兼容的iOS版本...'
如何让我的相机可用?
我想通过所有穿越日我的页面上的元素:

th元素的路径是div [id ='specs-list']/table/tbody/tr/th:
我的脚本是:
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.gsmarena.com');
driver.findElement(webdriver.By.name('sName')).sendKeys('iphone 4s');
driver.findElement(webdriver.By.id('quick-search-button')).click();
driver.findElement(webdriver.By.xpath("//div[@id='specs-list']/table/tbody/tr/th")).then(function(elem){
console.log(elem.getText());
});
Run Code Online (Sandbox Code Playgroud)
但我得到:
drobazko@drobazko:~/www$ node first_test.js
{ then: [Function: then],
cancel: [Function: cancel],
isPending: [Function: isPending] }
Run Code Online (Sandbox Code Playgroud)
相反,文本General
问题是:
1.如何获得正确的文本字符串?
2.如何穿越的许多个要素是什么?