当我运行命令时,grunt
我收到以下警告:
Running "karma:unit" (karma) task
Warning: No provider for "framework:jasmine"! (Resolving: framework:jasmine) Use --force to continue.
Run Code Online (Sandbox Code Playgroud)
有人知道如何解决这个问题吗?
看到这是Firefox 35的一个问题后,我安装了34并运行bundle exec rspec
,我的测试运行完美.但是当我再次尝试运行它时,它以某种方式打开了较新版本的Firefox,因为当我运行我的测试套件时再次出现以下错误:
Selenium::WebDriver::Error::JavascriptError: arguments[0] is undefined
Run Code Online (Sandbox Code Playgroud)
有没有办法保证我没有安装Firefox 35,Selenium会以某种方式找到并打开?我知道Firefox 34是我Applications
目录中Firefox的版本,但我不确定是否有新的firefox的副本副本,Selenium在launchy
使用时会抓取它.
所以我使用自定义函数来格式化我添加到a的子视图UICollectionViewCell
.它来自Brian Voong的公共项目:https://github.com/purelyswift/facebook_feed_dynamic_cell_content/blob/master/facebookfeed2/ViewController.swift.
func addConstraintsWithFormat(format: String, views: UIView...) {
var viewsDictionary = [String: UIView]()
for (index, view) in views.enumerate() {
let key = "v\(index)"
viewsDictionary[key] = view
view.translatesAutoresizingMaskIntoConstraints = false
}
addConstraints(NSLayoutConstraint.constraintsWithVisualFormat(format, options: NSLayoutFormatOptions(), metrics: nil, views: viewsDictionary))
}
Run Code Online (Sandbox Code Playgroud)
有趣的是,在我的UICollectionView
I中添加一个SubView
单元格,并将背景颜色设置为白色.当我注释掉设置子视图背景的线时,背景为白色,当我取消注释设置子视图的可视格式约束的线时,没有设置背景颜色.
以下两行相互冲突:
func chronicleOneClicked(sender: UIButton) {
point1view.backgroundColor = UIColor.whiteColor()
addSubview(point1view)
//When the below is commented the background of point1view disappears
//addConstraintsWithFormat("|-50-[v0]-50-|", views: point1view)
}
Run Code Online (Sandbox Code Playgroud)
当我这样做时,print(subviews)
我看到UIView
白色背景颜色是视图堆栈中最高的(堆栈顶部).当我打印出来时,subviews[subviews.count-1].backgroundColor
我得到的Optional(UIDeviceWhiteColorSpace …
我在我的ios Swift应用程序中集成了Google Sign-In.我在此处关注谷歌开发者页面上的官方说明(https://developers.google.com/identity/sign-in/ios/sign-in?ver=swift)
这是我的桥接标题:
#ifndef Header_h
#define Header_h
#endif /* Header_h */
#import <CommonCrypto/CommonCrypto.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <GoogleSignIn/GoogleSignIn.h>
Run Code Online (Sandbox Code Playgroud)
当我在我的AppDelegate.swift
函数中调用该行时
GGLContext.sharedInstance().configureWithError(&configureError)
Run Code Online (Sandbox Code Playgroud)
在里面.它说
Use of unresolved identifier 'GGLContext'
Run Code Online (Sandbox Code Playgroud)
任何帮助表示赞赏.
我跑的时候
npm install -g yo grunt-cli bower
Run Code Online (Sandbox Code Playgroud)
在我的终端,我得到以下依赖性错误:
npm ERR! peerinvalid The package generator-karma does not satisfy its siblings'
peerDependencies requirements!
npm ERR! peerinvalid Peer generator-angular@0.5.0 wants generator-karma@~0.5.0
npm ERR! System Darwin 12.4.1
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "yo" "grunt-cli" "bower"
npm ERR! cwd /Users/ryanwieghard/code/angin/indie-cinema-tools
npm ERR! node -v v0.10.20
npm ERR! npm -v 1.3.11
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/ryanwieghard/code/angin/indie-cinema-tools/npm-debug.log
npm ERR! not ok code …
Run Code Online (Sandbox Code Playgroud) 当我在开发模式下运行我的邮件程序时,我收到以下错误:
Net::ReadTimeout in SchoolApplicationsController#create
Run Code Online (Sandbox Code Playgroud)
这是获取超时的控制器方法
def create
@school_application = SchoolApplication.new(school_application_params)
@school_application.program_cost = @school_application.calculate_cost_to_charge(params[:school_application][:program], params[:school_application][:duration])
if @school_application.save
Rails.logger.debug("Hey mufugga")
NotificationsMailer.send_application(@school_application).deliver
redirect_to application_path(@school_application.id)
else
Rails.logger.debug(@school_application.errors.full_messages)
@school_application.errors.full_messages.each do |msg|
flash.now[:error] = msg
end
render action: "new"
end
end
Run Code Online (Sandbox Code Playgroud)
我很肯定错误是由NotificationsMailer
调用引起的,因为当我发表评论时,我不再收到错误.
这是我的邮件和设置:
class NotificationsMailer < ActionMailer::Base
default :from => "from@fls.net"
default :to => "ryan@fls.net"
def send_application(application)
@application = application
mail(:subject => "New Application")
end
end
Run Code Online (Sandbox Code Playgroud)
这是我的environments/development.rb
smtp设置:
Fls::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In …
Run Code Online (Sandbox Code Playgroud) 我正在使用Capybara编写一个规范来测试我网站上搜索栏的功能.按照本页上有关如何模拟按Rspec/Capybara中的Enter键的说明操作后,运行测试时出现以下错误:
Failure/Error: page.driver.execute_script(keypress)
Capybara::NotSupportedByDriverError:
Capybara::Driver::Base#execute_script
Run Code Online (Sandbox Code Playgroud)
难道我做错了什么?以下是我的spec文件的内容:
require 'spec_helper'
describe 'Search' do
it 'displays no results when non-existent things are looked up' do
visit root_path
page.first(".search-icon-small").click
fill_in "search", with: "NonExistent"
#simulate pressing Enter
keypress ="var e = $.Event('keydown', { keyCode: 13 }); $('body').trigger(e);"
page.driver.execute_script(keypress)
page.should have_content('No Results')
end
it 'displays content that exists' do
#Clients
client = Client.new
client.name = 'Gerard Leskovar'
client.save!
visit root_path
page.first(".search-icon-small").click
fill_in "search", with: "Leskovar"
keypress ="var e = $.Event('keydown', { keyCode: 13 }); …
Run Code Online (Sandbox Code Playgroud) 我正在尝试运行,bundle exec rspec
但是在我的调用中遇到了以下错误spec_helper.rb
template.rb:8:in `<class:Template>': uninitialized constant ActiveSupport::Autoload (NameError)
Run Code Online (Sandbox Code Playgroud)
这是我的spec_helper.rb
档案:
require 'rubygems'
require 'rspec/rails'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
end
Run Code Online (Sandbox Code Playgroud) 我改变了decorView
我的window
基本上切换之间View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
是真与假,这取决于我的观点的滚动位置。
由于我要同时更改ActionBar和状态Bar,因此我希望这两项更改至少应是瞬时的。但是我注意到在window.decorView.systemUiVisibility = newIntWithToggledLightMode
执行和渲染新的状态栏模式之间存在50ms的延迟。我不想将我的工具栏更改放置在postDelay处理程序中,只是为了与状态栏更改协调它们的同时出现。我以为可以onSystemUiVisibilityChangeInterface
更新状态栏ui时通知我,但只有在使状态栏不可见时才触发,而不仅仅是更改外观模式。是否有人遇到过这种情况,并提出了更优雅的解决方案?
我是Haskell的新手,我正在尝试编写一个简单的列表理解并将其分配给变量.这是我的haskell.hs
档案:
--find all multiples of 3 and 5 under 1000
multiples :: [Int]
let multiples = [x | x <- [1..1000], (x `mod` 5 == 0) || (x `mod` 3 == 0)]
Run Code Online (Sandbox Code Playgroud)
然后,当我尝试编译程序时,ghc haskell.hs
我收到以下错误:
haskell.hs:12:1:
parse error (possibly incorrect indentation or mismatched brackets)
Run Code Online (Sandbox Code Playgroud)
问候!