小编Don*_*uck的帖子

Spring-boot版本2.0.0快照的某种bug

>         2016-12-05 19:31:32.802  INFO 13700 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing
> org.springframework.context.annotation.AnnotationConfigApplicationContext@446293d:
> startup date [Mon Dec 05 19:31:32 IST 2016]; root of context hierarchy
> 2016-12-05 19:31:33.313  INFO 13700 --- [           main]
> f.a.AutowiredAnnotationBeanPostProcessor : JSR-330
> 'javax.inject.Inject' annotation found and supported for autowiring
> 2016-12-05 19:31:33.342  INFO 13700 --- [           main]
> trationDelegate$BeanPostProcessorChecker : Bean
> 'configurationPropertiesRebinderAutoConfiguration' of type [class
> org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$fe413554]
> is not eligible for getting processed by all BeanPostProcessors (for
> example: not eligible …
Run Code Online (Sandbox Code Playgroud)

java netflix spring-boot

5
推荐指数
0
解决办法
431
查看次数

iOS:Facebook登录访问令牌错误:由于模拟器错误而退回到从NSUserDefaults加载访问令牌

根据说明进行配置后,我一直收到此错误,我无法在我的应用程序上成功使用Facebook登录.我在XCode 8.1上运行它并使用iOS 10.1模拟器.

我按照Facebook iOS SDK指南中的步骤操作,并将Facebook登录按钮放在我的视图控制器中.我显示了NSUserdefaults,其中一个键是"com.facebook.sdk:serverConfiguration",所以我相信它在那里保存.

- (void)viewDidLoad {
    [super viewDidLoad];
    if ([FBSDKAccessToken currentAccessToken]) {
        // User is logged in, do work such as go to next view controller.
        NSLog(@"test");
    }
    else {
        FBSDKLoginButton *loginButton = [[FBSDKLoginButton alloc] init];
        loginButton.center = self.view.center;
        [self.view addSubview:loginButton];
    }
    _loginButton.readPermissions =
    @[@"public_profile", @"email", @"user_friends"];
    NSLog(@"%@", [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]);
}
Run Code Online (Sandbox Code Playgroud)

xcode facebook facebook-graph-api ios ios-simulator

5
推荐指数
1
解决办法
7093
查看次数

Spring Error Controller响应,不可接受

我已经构建了一个错误控制器,它应该是我在Spring REST服务中捕获异常的"最后一行".但是,我似乎无法将POJO作为响应类型返回.为什么杰克逊不为这个案子工作?

我的班级看起来像:

@RestController
public class CustomErrorController implements ErrorController
{
  private static final String PATH = "/error";

  @Override
  public String getErrorPath()
  {
     return PATH;
  }


  @RequestMapping (value = PATH)
  public ResponseEntity<WebErrorResponse> handleError(HttpStatus status, HttpServletRequest request)
  {
     WebErrorResponse response = new WebErrorResponse();

    // original requested URI
    String uri = String.valueOf(request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI));
    // status code
    String code = String.valueOf(request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE));
    // status message
    String msg = String.valueOf(request.getAttribute(RequestDispatcher.ERROR_MESSAGE));

    response.title = "Internal Server Error";
    response.type = request.getMethod() + ": " + uri;
    response.code = Integer.valueOf(code);
    response.message …
Run Code Online (Sandbox Code Playgroud)

java rest spring spring-boot

5
推荐指数
1
解决办法
8683
查看次数

如何解析 LinkedIn 页面

有人可以帮助我如何通过curl解析这个链接吗?

https://www.linkedin.com/in/williamhgates/

这是我的代码:

只需运行它并查看结果:

$url = "https://www.linkedin.com/in/williamhgates/";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.linkedin.com/in/williamhgates/'));
$output = curl_exec($ch);
curl_close($ch);dd($output);die;
Run Code Online (Sandbox Code Playgroud)

我只想获取文件中的整个源代码,但它显示:

Could not process this client request HTTP method request for URL
Run Code Online (Sandbox Code Playgroud)

php html-parsing

5
推荐指数
1
解决办法
2749
查看次数

如何使用nginx 1.9.5作为gRPC的反向代理?

我想要

  • 用Java编写我的后端代码,
  • 使用HTTP/2(NGINX 1.9.5已支持HTTP/2),
  • 编写双向流,随时在客户端和服务器之间发送数据.

gRPC似乎是最好的选择,我想使用NGINX作为我的反向代理和加载平衡,我找不到任何文档来弄清楚如何将NGINX用于gRPC Java,有谁知道?


我看到gRPC PHP已经支持NGINX:https://github.com/grpc/grpc/tree/master/src/php#use-the-grpc-php-extension-with-nginxphp-fpm

但是我也看到有一个问题说它正在NGINX中提交第三方模块以获得gRPC支持,并且NGINX上有一张票据意味着我们无法为gRPC编写HTTP/2 NGINX代理模块,而我还看到nginx不支持完整的HTTP/2规范,gRPC无法通过它工作

我对此感到困惑,为什么有些帖子说gRPC PHP有效,但在其他帖子中它说它不能.

proxy nginx grpc grpc-java

5
推荐指数
1
解决办法
2635
查看次数

带有 brozot/Laravel-FCM 的 laravel fcm 推送通知不适用于 ios,但在 android 上运行良好

即使 ios 也可以从 fcm 控制台获得通知。

控制器功能

public function push(Request $request)
{
    $validator = Validator::make($request->all(), [
        'title' = > 'required',
            'body' = > 'required',
            'token' = > 'required',
            'type' = > 'required',
            'id' = > 'required',

    ]);

    if ($validator->fails()) {
        $this->throwValidationException(
            $request, $validator
        );
    }

    $title = $request['title'];
    $body = $request['body'];
    $type = $request['type'];
    $id = $request['id'];
    $dataarray = array(
        "id" = >$id,
        "type" = >$type,
        'title' = >$title,
        'body' = >$body,
        'image' = >'321451_v2.jpg',
    );

    $token = $request['token'];

    return …
Run Code Online (Sandbox Code Playgroud)

ios firebase firebase-authentication laravel-5.2 firebase-cloud-messaging

5
推荐指数
1
解决办法
4939
查看次数

图表返回错误:无法加载网址:此网址的域未包含在应用的域中

在App Domains中添加了域,还添加了有效的OAuth重定向URI ..但是,收到这样的错误消息我已经尽了最大努力......任何人都帮助我...这令人非常恼火,我正在失去耐心并感到恐慌.我真的不知道,这是我最大的错误.请参阅以下图片以了解有关我的问题的更多信息

图片1

图2

php facebook facebook-graph-api facebook-php-sdk

5
推荐指数
1
解决办法
5547
查看次数

Xcode:请求打开应用程序失败

在一切正常并运行项目之前的某个时候,但现在我遇到了问题request to open App failed

在此处输入图片说明

有没有人有解决这个问题的想法,为什么会出现这个问题?

xcode ios

5
推荐指数
1
解决办法
1万
查看次数

将列表转换为dict python

给出一个清单:

source = [{'A':123},{'B':234},{'C':345}]
Run Code Online (Sandbox Code Playgroud)

我需要这个列表中的dict格式:

newDict  = {'A':123,'B':234,'C':345}
Run Code Online (Sandbox Code Playgroud)

什么是语法上最干净的方法来实现这一目标?

python dictionary

5
推荐指数
1
解决办法
2620
查看次数

C++ 11默认类成员初始化与初始化列表同时进行

有人可以指出我,对C++标准的相应段落,或者可以提供一些解释,为什么我的代码不能编译,如果我取消注释文本({123})

一般来说,我理解通过初始化列表使用默认成员初始化和初始化有什么问题,但我不能参考确切的原因.

enum class MY: int
{
    A = 1
};

struct abc
{
    int a;/*{123};*/  //compilation failed if uncommented
    MY m;
};

abc a = {1, MY::A};
Run Code Online (Sandbox Code Playgroud)

编译错误,如果是未注释的文本:

错误:无法将'{1,A}'从'<brace-enclosed initializer list>'转换为'abc'

c++ c++11

5
推荐指数
1
解决办法
264
查看次数