我刚刚按照这里的优秀指南:https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.0,了解如何使用Javascript SDK启用网站的facebook登录.
我试过了 - 当我点击我的登录按钮时,我收到错误:
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
Run Code Online (Sandbox Code Playgroud)
我注意到这个错误的URL:
https://www.facebook.com/v2.0/dialog/oauth?scope=public_profile%2Cemail&response_type=none&redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Freturn%2Farbiter%3Frelation%3Dopener%26close%3Dtrue%23origin%3Dhttp%253A%252F%252Flocalhost%253A56378%252Ff1c45491ec&seen_revocable_perms_nux=false&ref=LoginButton&auth_type=&default_audience&state=fdcac98d4&app_id=251165285007053&client_id=251165285007053&display=popup
Run Code Online (Sandbox Code Playgroud)
所以我去我的facebook应用程序并添加我的no-ip主机名和'localhost' - 它不喜欢localhost所以我删除它.
但是,由于仍然从域localhost发送请求,我仍然收到消息.
有没有办法测试本地运行?我在开发期间没有要部署的域.
javascript facebook facebook-graph-api facebook-javascript-sdk
我正在编写一个使用android语音识别的应用程序.但是我的应用程序在模拟器上运行不好 - 然而在移动设备上运行良好.
在模拟器上,我通过logcat收到一条红色错误消息,上面写着:
05-06 20:19:38.527:ERROR/SpeechRecognizer(1745):没有选择的语音识别服务
有谁知道如何启用模拟器来支持语音识别服务?
干杯,
我正在使用Ruby on rails和它旁边的paperclip进行图像存储和链接.它很棒.
我现在想使用rake db:seed工具并使用'Event'对象填充我的seeds.rb文件.
我使用种子文件来填充我的应用程序的其他区域使用如下语法:
categories = Category.create([{ name: 'General'}, {name: 'Clubs'}, {name: 'For Mum'}, {name: 'Services'}])
Run Code Online (Sandbox Code Playgroud)
这是填充简单的类别模型,只有1个字段名称.如何为更复杂的模型创建种子,例如我的"事件"模型,它也期望图像作为其中的一部分?我可以以某种方式有种子图像目录并使用种子本地加载文件?
请您给我看一个使用种子rake文件创建带有Paperclip图像字段的模型实例的解决方案的示例.
谢谢!
我有一个输入框和一个按钮。我希望所有按钮都位于输入框的右侧devices > 768 px。
因为devices <=768 px我希望按钮位于col-xs-12中心对齐的输入框下方。
到目前为止,这是我的尝试:
<form id="signup-form" class="new_invitation" action="/invitations" accept-charset="UTF-8" method="post">
<div class="col-sm-4 col-sm-offset-3 input-position">
<input class="form-control full-width" placeholder="enter email address" id="InputEmail" type="text" name="invitation[recipient_email]">
</div>
<div class="col-xs-12 col-sm-2 input-position">
<input type="submit" name="commit" value="JOIN IN" class="btn btn-cta" id="gabetabtn">
</div></form>
Run Code Online (Sandbox Code Playgroud)
但是,在<= 768像素的设备上,按钮未居中,但正确位于输入框的下方:
如何将col-xs-12div 的内容居中?我尝试过center-block并col-centered引导CSS类似乎都不起作用?
---编辑--- 如果我在col-xs-12 div中添加text-center,它将正确地使按钮元素居中,但同时也将按钮在col-sm-2 div中居中,也如下图所示:
在具有<= 768像素的设备上,如何使按钮恰好位于输入文本字段的右侧,并且也位于输入文本字段下方的行的中心?
extra_info当我将鼠标悬停在狗的图像上时,我想显示我div 的内容.
我看过这样的语法:
.circular:hover + div.extra_info {
display:absolute;
}
Run Code Online (Sandbox Code Playgroud)
但是我无法让它发挥作用!
到目前为止,这是我的代码:
.circular {
margin-top: 50px;
position: relative;
z-index: 199 !important;
float: left;
display: block;
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid #ffffff;
}
.circular:hover {
border: 2px solid #16D3AE;
}
.extra_info {
display: none;
}Run Code Online (Sandbox Code Playgroud)
<img src=http://officialhuskylovers.com/wp-content/uploads/2015/05/Cute-dog-listening-to-music-1_1.jpg class="circular">
<div class="extra_info">
<h3>A lovely doggy woggy</h3>
</div>Run Code Online (Sandbox Code Playgroud)
我有一个存储在bitbucket上的现有项目,并将其克隆到我的Windows框中.
我进入主项目目录并运行
rails server
Run Code Online (Sandbox Code Playgroud)
我收到消息:
Could not find rake-10.4.1 in any of the sources
Run `bundle install` to install missing gems.
Run Code Online (Sandbox Code Playgroud)
所以我运行bundle install - 响应:
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/............
Resolving dependencies...
Gem::RemoteFetcher::FetchError: SSL_connect returned=1 errno=0 state=SSLv3 read
server certificate B: certificate verify failed (https://rubygems.org/gems/rake-
10.4.1.gem)
An error occurred while installing rake (10.4.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.1'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)
所以我运行命令
gem install rake -v '10.4.1' …Run Code Online (Sandbox Code Playgroud) 我使用模型中的validates_associated来使用其他模型的验证代码.这个问题是验证失败的消息是"..无效".
我想将模型验证失败的实际描述性错误冒出来!
我发现了这个问题: 与模型的错误消息相关的验证
哪个看起来像一个非常接近的解决方案:
module ActiveRecord
module Validations
class AssociatedBubblingValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
(value.is_a?(Array) ? value : [value]).each do |v|
unless v.valid?
v.errors.full_messages.each do |msg|
record.errors.add(attribute, msg, options.merge(:value => value))
end
end
end
end
end
module ClassMethods
def validates_associated_bubbling(*attr_names)
validates_with AssociatedBubblingValidator, _merge_attributes(attr_names)
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
但实际上它遇到了一个错误:
undefined method `valid?' for #<TicketType::ActiveRecord_Associations_CollectionProxy:0x007ff86474a478>
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助完成这个几乎工作的工作!?
完整的错误跟踪是:
undefined method `valid?' for #<TicketType::ActiveRecord_Associations_CollectionProxy:0x007ff8646ba148>
Extracted source (around line #6):
4
5
6
7
8
9
def validate_each(record, attribute, value)
(value.is_a?(Array) ? …Run Code Online (Sandbox Code Playgroud) 我知道这可能不是最好的做法,但这就是我想要做的.
当我的广播接收器被调用时 - 启动一个不是全屏并且具有透明背景的新活动 - 在您当前的活动/桌面壁纸之上打开.
我到目前为止的代码如下:
我用以下方法创建+调用新活动:
Intent testActivityIntent = new Intent(context, com.andy.tabletsms.work.SMSPopup.class);
testActivityIntent.putExtra("com.andy.tabletsms.message", main.msgs.get(i));
testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
testActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
context.startActivity(testActivityIntent);
Run Code Online (Sandbox Code Playgroud)
然后活动的主题是:
机器人:主题= "@安卓风格/ Theme.Translucent.NoTitleBar"
而活动的代码只是一个简单布局的沼泽标准活动.然而,当该广播接收器启动活动时 - 它出现在应用程序启动时启动的上一个活动的顶部.....根据此图像显示:

我已经按照Android应用程序计费的示例代码进行了访问:http://developer.android.com/guide/market/billing/billing_integrate.html
我已将该代码集成到我的应用程序中 - 并遵循所有步骤,包括签署apk - 上传,在应用程序产品列表中创建等.
出于某种原因,当我的应用程序在onCreate方法中的这些行时:
Log.e("sc2","About to check if billing is supported");
// Check if billing is supported.
ResponseHandler.register(mDungeonsPurchaseObserver);
if (!mBillingService.checkBillingSupported()) {
Log.e("sc2","failed check for billing supported");
showDialog(DIALOG_CANNOT_CONNECT_ID);
}
if (!mBillingService.checkBillingSupported(Consts.ITEM_TYPE_SUBSCRIPTION)) {
Log.e("sc2","failed check for billing supported subscriptions");
showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID);
}
Log.e("sc2","Finished checking if billing is supported");
Run Code Online (Sandbox Code Playgroud)
两个对话框都没有显示 - 表明所有内容都与市场结算服务绑定正确.
但是在PurchaseObserver回调这些行:
private class SC2PurchaseObserver extends PurchaseObserver {
public SC2PurchaseObserver(Handler handler) {
super(UpgradesActivity.this, handler);
}
@Override
public void onBillingSupported(boolean supported, String type) {
if (Consts.DEBUG) {
Log.e("sc2", …Run Code Online (Sandbox Code Playgroud) 我的标记中有一些代码如下:
<% Response.Write(((String)objRow["Post"]).Trim()); %>
Run Code Online (Sandbox Code Playgroud)
objRow ["Post"]中的值是HTML标记 - 类似于:
<p><span style="color: #ff0000;">asdsada</span></p>
Run Code Online (Sandbox Code Playgroud)
其内容使用tinymce创建.我现在想要渲染生成的html - 基本上是先前创建的保存函数的视图函数.
目前,我的标记字面上将你在那里看到的HTML吐出到我的网站上 - 但我真正想要的是一条红色的文字说asdsada.
请帮忙
android ×3
html ×3
css ×2
javascript ×2
asp.net ×1
associations ×1
c# ×1
facebook ×1
gem ×1
java ×1
jquery ×1
paperclip ×1
rake ×1
rendering ×1
ruby ×1
speech ×1
taskaffinity ×1
validation ×1