小编Jam*_*s Z的帖子

点网核心Preview-2.0中的身份验证

我在.net-core Preview-2的Web api项目中尝试了jwt令牌身份验证,但是它无法正常工作。

JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication(IA ?? pplicationBuilder,JwtBearerOptions)'已过时:'see go.microsoft.com/fwlink/?linkid=845470';

当我尝试使用相同的代码来标记Net Core 1.2时,它可以正常运行。我该怎么办?

在此处输入图片说明

.net-core .net-core-rc2 asp.net-core-webapi

3
推荐指数
1
解决办法
3018
查看次数

Google 登录出现异常

我正在研究Google SignIn. 按下登录按钮后,我遇到了异常。GoogleService-Info.plist我也在服用

例外情况是:由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“您的应用程序缺少对以下 URL 方案的支持:com.googleusercontent.apps.337335047637-ciu1dmqo156sdv1idjmm9olljduofdam”

objective-c ios google-signin ios10

3
推荐指数
1
解决办法
3220
查看次数

ElasticSearch 中出现错误

我将 ElasticSearch-5.2.1 与 springboot 一起使用,并在 elasticsearch.bat 中出现以下错误

java.lang.IllegalStateException:从不支持的版本接收到消息:[2.0.0]最小兼容版本是:[5.0.0]

在我的应用程序控制台中出现以下错误:

引起原因:org.elasticsearch.client.transport.NoNodeAvailableException:配置的节点均不可用:[{#transport#-1}{127.0.0.1}{127.0.0.1:9300}]

当我在 google 中搜索时,它要求升级传输客户端,但是如何将传输客户端从 2.0 升级到 5.0

下面是我的配置代码:

@Value("${elasticsearch.port}")
private int EsPort;

@Value("${elasticsearch.clustername}")
private String EsClusterName;
Run Code Online (Sandbox Code Playgroud)

@Value("${elasticsearch.host}") 私有字符串 EsHost;

 @Bean
public Client client() throws Exception {

    Settings esSettings = Settings.settingsBuilder().put("cluster.name", EsClusterName).build();


    return TransportClient.builder()
            .settings(esSettings)
            .build()
            .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(EsHost), EsPort));
}

@Bean
public ElasticsearchOperations elasticsearchTemplate() throws Exception {
    return new ElasticsearchTemplate(client());
}
Run Code Online (Sandbox Code Playgroud)

spring-data-elasticsearch

3
推荐指数
1
解决办法
3345
查看次数

如何在kotlin中的customadpter项目上实现clicklistener?

我想在recyclerview项目上实现onClickListener.这是我的CustomAdapter.kt代码.

package com.png.kotlinsample

/**
 * Created by admin on 13-08-2017.
 */
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView

/**
 * Created by prashant on 6/19/2017.
 */

class CustomAdapter(val userList: ArrayList<User>, val listener: (User) -> Unit) : RecyclerView.Adapter<CustomAdapter.ViewHolder>() {

    //this method is returning the view for each item in the list
        class MyAdapter(val userList: ArrayList<User>)
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CustomAdapter.ViewHolder {
        val v = LayoutInflater.from(parent.context).inflate(R.layout.row_layout, parent, false)
        return ViewHolder(v)
    }

    //this method is binding …
Run Code Online (Sandbox Code Playgroud)

android kotlin

3
推荐指数
1
解决办法
3141
查看次数

如何在 ng2-smart-table 中添加自定义 css

我在 ng2-smart-table 中使用 angular 2。

这是我的代码。

settings = {
    mode:"external",
    actions:{add:false,position:'right',custom: [{ name: 'View', title: `<i class="fa fa-eye" aria-hidden="true"></i>` }]},
    edit: {
      editButtonContent: '<i class="fa fa-pencil-square" aria-hidden="true"></i>',
      saveButtonContent: '<i class="ion-checkmark"></i>',
      cancelButtonContent:'<i class="ion-close"></i>',
    },
    delete: {
      deleteButtonContent: '<i class="fa fa-trash" aria-hidden="true"></i>',
      confirmDelete: true
    },
    columns: {
       Check:{
        title: "Check",
        type: 'html',
        },
        filter: false
       },
       orderby:{
        title: "Name",
        filter: true
       },
       purchased:{
        title: "Purchased",
        type: 'html',
        },
        filter: false
       },
       shipto:{
        title: "Ship To",
        filter: true
       },
       date:{
        title: "Date",
        filter: …
Run Code Online (Sandbox Code Playgroud)

angular

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

Android Google Place Picker在签名APK中工作,但在Live应用中无效

我有一个应用程序,其中我使用了Google Place Picker.我面临着一个非常奇怪的问题.当我使用我的应用程序的密钥库创建签名APK时,Place Picker工作得非常好.我通过Google PlayStore上传了相同的APK.当我打开Place Picker时它会自动关闭.我已经在网上阅读了很多评论,也在SO中.但是我无法确定为什么它在签名APK中运行良好,而且Google PlayStore上的相同APK无效.

当我检查Google PlayStore的LIVE应用程序的日志时,它会给出如下错误:

Volley : [198] BasicNetwork.performRequest: Unexpected response code 403
for https: //www.googleapis.com/placesandroid/v1/search?key=MY_KEY/ ? V / ConnectivityManager : isActiveNetworkMetered() returns: true
/ ? E / AsyncOperation : serviceID = 65, operation = SearchPlaces
OperationException[Status {
 statusCode = PLACES_API_INVALID_APP, resolution = null
}]
Run Code Online (Sandbox Code Playgroud)

我已经在我的Google Developer Console中检查过我的密钥是否相同.我还检查了我从KeyStore文件创建的SHA.一切都很好(否则它也不适用于签名APK,如果有任何错误).

以下是我从我的Activity中调用Place Picker的方法

int PLACE_PICKER_REQUEST = 999;
PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();
startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);
Run Code Online (Sandbox Code Playgroud)

这是我的AndroidManifest.xml文件,我在其中提供了我的API密钥,这些元数据是应用程序标记.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example" >
    // ALL PERMISSIONS ARE HERE
    <application
        android:allowBackup="true" …
Run Code Online (Sandbox Code Playgroud)

android google-maps key google-places-api developer-console

3
推荐指数
1
解决办法
929
查看次数

Pyspark错误+方法__getnewargs __([])不存在

我正在使用spark版本2.2.0和Python 2.7.我正在使用pyspark连接BigSQL并尝试检索数据.以下是我使用的代码

import cPickle as cpick
import numpy as np
import pandas as pd
import time
import sys
from pyspark.sql.session import SparkSession 
spark = SparkSession.builder.getOrCreate() 
spark_train_df = spark.read.jdbc("jdbc:db2://BigSQL URL:Port:sslConnection=true;","Schema.Table",
             properties={"user": "my userid", 
                      "password": "password",
                      'driver' : 'com.ibm.db2.jcc.DB2Driver'})
spark_train_df.registerTempTable('data_table')
# query to get columns necessary to create indexes
sql = "select * FROM data_table"
train_df = spark.sql(sql)

cmr_dict = { 'date': time.strftime('%a, %b %d, %Y'),
            'description': '`cmrs` contains data from data_table',
           'cmrs': train_df}

with open('cmrs.pkl', mode='wb') as fp:
    cpick.dump(cmr_dict, fp, cpick.HIGHEST_PROTOCOL) …
Run Code Online (Sandbox Code Playgroud)

python pyspark pyspark-sql

3
推荐指数
1
解决办法
1204
查看次数

RocksDB 与 Cassandra

MyRocks (MySql) 和 Cassandra 都使用 LSM 架构来存储数据。因此,我使用 MyRocks 作为存储引擎在 MySql 中填充了大约 500 万行,也在 Cassandra 中填充了大约 500 万行。在 Cassandra 中,仅需要 1.7 GB 的磁盘空间,而在以 MyRocks 作为存储引擎的 MySql 中,则需要 19 GB。

我错过了什么吗?两者都使用相同的LSM机制。但为什么它们的数据大小不同呢?

更新:

我猜这与文本栏有关。我的表结构是(bigint,bigint,varchar,text)。

  • 填充行数:300 000
  • 在 MyRocks 中数据大小 185MB
  • 在 Cassandra 中 - 13 MB。

但如果我删除文本列,那么:

  • 我的摇滚 - 21.6 MB
  • 卡桑德拉 - 11 MB

对这种行为有什么想法吗?

mysql cassandra nosql mariadb rocksdb

3
推荐指数
1
解决办法
1714
查看次数

找不到'AppModule'的NgModule元数据

我已经检查过几次但不确定AppModule.ts中缺少什么我有另一个AppRoutingModule.ts模块

错误:

C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web>ng build
Date: 2017-11-26T14:01:44.636Z
Hash: 3222da75cdc5af92bdb9
Time: 8949ms
chunk {inline} inline.bundle.js, inline.bundle.js.map (inline) 5.83 kB [entry] [rendered]
chunk {main} main.bundle.js, main.bundle.js.map (main) 303 bytes [initial] [rendered]
chunk {polyfills} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 323 bytes [initial] [rendered]
chunk {styles} styles.bundle.js, styles.bundle.js.map (styles) 11.4 kB [initial] [rendered]
Run Code Online (Sandbox Code Playgroud)

错误中的错误:

No NgModule metadata found for 'AppModule'.
    at NgModuleResolver.resolve (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler\bundles\compiler.umd.js:20111:23)
    at CompileMetadataResolver.getNgModuleMetadata (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler\bundles\compiler.umd.js:15101:60)
    at visitLazyRoute (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler\bundles\compiler.umd.js:29995:104)
    at AotCompiler.listLazyRoutes (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler\bundles\compiler.umd.js:29963:20)
    at AngularCompilerProgram.listLazyRoutes (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler-cli\src\transformers\program.js:157:30)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (C:\Ravidas\Visual.Studio\Publish Health\Club.90.Web\node_modules\@angular\compiler-cli\src\ngtools_api.js:44:36)
    at AngularCompilerPlugin._getLazyRoutesFromNgtools …
Run Code Online (Sandbox Code Playgroud)

angular-cli angular

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

如何通过 python 在电报机器人中获取实时位置?

我正在使用python-telegram-bot图书馆。我想跟踪用户的实时位置,但我不知道该怎么做。我尝试使用作业队列:

def notification(bot, job):
  updates = bot.get_updates()
  print([u.message.location for u in updates])
# Add job to queue

job = job_queue.run_repeating(notification, 10, 1, context=chat_id)
chat_data['job'] = job
Run Code Online (Sandbox Code Playgroud)

但更新无效。我想每 1 分钟跟踪一次位置。

python location python-telegram-bot telegram-bot

3
推荐指数
2
解决办法
9748
查看次数