提交#10就是主人.然而,我最终意识到我在测试中没有遇到过的问题.
我最终将提交#5,然后慢慢重新执行每个提交的开发并不断调整它以确保它不会重新导致错误.现在我基本上回到了提交#10,但是有一些改变可以防止错误发生.
我现在想要使用我的更改创建提交#11.但是当我试图推动掌握时,我得到了
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push master HEAD:<name-of-remote-branch>
Run Code Online (Sandbox Code Playgroud)
这是可以预料的.但是我如何才能真正实现这一目标呢?
我试过git push origin HEAD:master但后来得到了这个:
! [rejected] HEAD -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/tomhammond/sample.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing …Run Code Online (Sandbox Code Playgroud) 我发现我的架构中有两个"survey_id"列,这对我来说已经造成了一些问题.具体来说,我需要删除第二个索引,因为我不希望survey_id是唯一的.
add_index "completions", ["survey_id"], name: "index_completions_on_survey_id"
add_index "completions", ["survey_id"], name: "index_completions_on_survey_id_and_user_id", unique: true
Run Code Online (Sandbox Code Playgroud)
我试过了
def change
remove_index "completions", ["survey_id"], name => "index_completions_on_survey_id_and_user_id"
end
Run Code Online (Sandbox Code Playgroud)
和
def change
remove_index "completions", ["survey_id"], name: "index_completions_on_survey_id_and_user_id"
end
Run Code Online (Sandbox Code Playgroud)
但这些似乎都不起作用.此迁移删除索引的正确语法是什么?我觉得这是基本的,我只是错过了一些愚蠢的东西.提前致谢!
我正在尝试按照Android 接收位置更新教程.示例代码在Github上.
一切都在工作,除了这一行:
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
这是一个cannot resolve method requestLocationUpdates错误.我在文档中没有看到任何内容,但我对Android很新,所以可能会遗漏一些东西:).
这是完整的代码.我出错的任何想法?谢谢!
package location.test.example.com;
import android.app.Fragment;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;
import java.util.ArrayList;
import java.util.Date;
public class LocationFragment extends Fragment implements
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
protected GoogleApiClient …Run Code Online (Sandbox Code Playgroud) 知道为什么我的字体真棒图标最初会在页面上显示,然后在页面实际加载后变成空白正方形吗?这是我的gemfile:
gem 'rails', '4.0.1'
gem 'bootstrap-sass', '2.3.2.0'
gem 'bcrypt-ruby', '3.1.2'
gem 'faker', '1.1.2'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem "libv8", ">= 3.11.8"
gem "therubyracer", ">= 0.11.0", :group => :assets, :platform => :ruby, :requir\
e => "v8"
gem 'execjs'
gem 'rails_12factor', group: :production
gem 'font-awesome-rails'
gem 'font-awesome-sass'
Run Code Online (Sandbox Code Playgroud)
我的application.css文件:
*= require_self
*= require_tree .
*= require font-awesome
*/
@import 'twitter/bootstrap';
@import 'font-awesome/font-awesome';
Run Code Online (Sandbox Code Playgroud)
这是我如何调用图标:
<section id="our-services" class="pad-top-50">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4">
<div class="service">
<span class="service-icon">
<i class="fa fa-android"></i>
</span>
Run Code Online (Sandbox Code Playgroud) 我想以编程方式自动从我的rails应用程序在亚马逊上进行购买,因为我必须每周手动进行相同的购买.这将使用我自己的结算信息/帐户,而不是代表用户.
我搜索了他们的大部分API,发现你可以搜索一个项目,将它添加到购物车等等,但我似乎无法找到实际购买的方法.
有没有人知道通过API做到这一点的方法?它可以很好地自动化我们的手动过程.似乎它应该是可能的,因为https://zincapi.com/似乎促进了这一点.
这是几个星期前的工作,但现在我注意到我的OnReward消息不再从我的自定义插件调用.
在我的rewardcenter.cs类中,我调用插件类将侦听器设置为此脚本附加到的gameObject(在此示例中为它GameObject):
public class rewardcenter : MonoBehaviour {
int counter = 0;
void Start () {
OnReward("85");
}
// Update is called once per frame
void Update ()
{
if (counter == 20) {
#if UNITY_ANDROID
PluginClass.SetRewardListener(gameObject.name);
Debug.Log("Adding Android Reward Listener: " + gameObject.name);
#endif
}
counter++;
}
void OnReward(string quantity)
{
Debug.Log("OnReward: " + quantity);
}
}
Run Code Online (Sandbox Code Playgroud)
在PluginClass.cs文件中,您可以看到我如何调用setUnityObjectNamejava插件类上的调用来将unity对象设置为传入的GameObject的名称字符串GameObject:
private static AndroidJavaObject pluginClassInstance = null;
private static AndroidJavaObject activityContext = null;
// …Run Code Online (Sandbox Code Playgroud) 我正在开发一个基本的调查应用程序,用户可以在我的Android应用程序中进行调查,然后将选择发布回我的rails服务器.有一次,它向服务器公布了选择,但它最近在解析params并且不再创建用户选择时开始抛出错误.
我是HTTP的新手,并且一直在努力解决这个错误.任何帮助深表感谢!
如果我这样做卷曲请求:
curl -v -H 'Content-Type: application/json' -H 'Accept: application/json' -X POST -d {"question_id":"1","answer_id":"2"} http://ec2-54-186-132-102.us-west-2.compute.amazonaws.com:8080/questions/1/choices
Run Code Online (Sandbox Code Playgroud)
我最终在stacktrace中出现了这个错误:
Started POST "/questions/1/choices" for 172.31.10.156 at 2014-03-19 11:15:02 +0000
Error occurred while parsing request parameters.
Contents:
ActionDispatch::ParamsParser::ParseError (795: unexpected token at 'question_id:1'):
actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:53:in `rescue in parse_formatted_parameters'
actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:32:in `parse_formatted_parameters'
actionpack (4.0.0) lib/action_dispatch/middleware/params_parser.rb:23:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/flash.rb:241:in `call'
rack (1.5.2) lib/rack/session/abstract/id.rb:225:in `context'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/cookies.rb:486:in `call'
activerecord (4.0.0) lib/active_record/query_cache.rb:36:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
activerecord (4.0.0) lib/active_record/migration.rb:369:in …Run Code Online (Sandbox Code Playgroud) 我正在使用Ruby on Rails应用程序中的外部api.我需要在花车发送给这家公司,但他们只接受像值1.0,1.25,1.5,1.75,2.0,等.
我可能有像1.34或的价值1.80.理想情况下,我需要将它们四舍五入到最近0.25.实现这一目标的最佳方法是什么?如果我这样做1.34.round(0)会给我1.0比我需要的更低的东西.
谢谢!
我正在尝试关注Google的活动识别示例.
在示例中,当您单击按钮时,它们会启动活动识别,但是我想在应用程序启动时启动它 - 所以我尝试将它放在onConnected方法中.但是,它最终会抛出空指针异常.
这是我如何称呼它:
@Override
public void onConnected(Bundle connectionHint) {
Log.d(TAG, "onConnected");
try {
ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(
mGoogleApiClient,
UPDATE_INTERVAL_IN_MILLISECONDS,
getActivityDetectionPendingIntent()
).setResultCallback(this);
} catch (SecurityException securityException) {
logSecurityException(securityException);
}
}
Run Code Online (Sandbox Code Playgroud)
而错误:
03-21 20:28:57.939 2340-2340/getrewards.example.com.getrewards E/AndroidRuntime? FATAL EXCEPTION: main
Process: getrewards.example.com.getrewards, PID: 2340
java.lang.NullPointerException: Appropriate Api was not requested.
at com.google.android.gms.internal.jx.b(Unknown Source)
at com.google.android.gms.common.api.c.a(Unknown Source)
at com.google.android.gms.common.api.c.a(Unknown Source)
at com.google.android.gms.common.api.c.b(Unknown Source)
at com.google.android.gms.internal.nb.requestActivityUpdates(Unknown Source)
at getrewards.example.com.getrewards.RewardsFragment.onConnected(RewardsFragment.java:274)
at com.google.android.gms.internal.jm.f(Unknown Source)
at com.google.android.gms.common.api.c.gJ(Unknown Source)
at com.google.android.gms.common.api.c.d(Unknown Source)
at com.google.android.gms.common.api.c$2.onConnected(Unknown Source)
at …Run Code Online (Sandbox Code Playgroud) 我在我的项目中突然出现了这个错误,该项目有一个显示页面的WKWebView.该页面像以前一样加载.但是现在当我尝试从该页面导航到另一个页面时,我收到此错误:
[BoringSSL] Function boringssl_session_errorlog: line 2871 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
Run Code Online (Sandbox Code Playgroud)
它似乎与我的电脑/设备有关,因为我从来没有打过这个.
我发现的一些事情说我需要确保将另一个链接标志设置为-ObjC.还可以将"任意载荷"设置为"是".这两个都已设置,错误仍在继续.
该网页使用的是TLS 1.2.