小编hoi*_*jui的帖子

Android Studio复制文件在APK META-INF/BCKEY.DSA中复制

我的代码构建正常,但是当我尝试在调试中运行它时,我收到以下错误:

Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
    com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/BCKEY.DSA
        File1: D:\Android\AndroidStudio\gradle\m2repository\org\bouncycastle\bcpkix-jdk15on\1.48\bcpkix-jdk15on-1.48.jar
        File2: C:\Users\beili\.gradle\caches\modules-2\files-2.1\org.bouncycastle\bcprov-jdk15on\1.48\960dea7c9181ba0b17e8bab0c06a43f0a5f04e65\bcprov-jdk15on-1.48.jar
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

android android-studio

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

从 Markdown 文件中删除 HTML 注释

这在从 Markdown 转换为 HTML 时会派上用场,例如,如果需要防止注释出现在最终的 HTML 源代码中。

示例输入my.md

# Contract Cancellation

Dear Contractor X, due to delays in our imports, we would like to ...
<!--
    ... due to a general shortage in the Y market
    TODO make sure to verify this before we include it here
-->
best,
me <!-- ... or should i be more formal here? -->
Run Code Online (Sandbox Code Playgroud)

示例输出my-filtered.md

# Contract Cancellation

Dear Contractor X, due to delays in our imports, we would like …
Run Code Online (Sandbox Code Playgroud)

html bash markdown awk pandoc

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

KENDO UI 'Uncaught TypeError: e.slice is not a function'

我有一件非常奇怪的事情。在我的视图中添加以下 2 个脚本时。我得到了错误

'未捕获的类型错误:e.slice 不是函数'

在 ajax 调用的成功块上。

Html.AppendScriptParts(string.Format("~/Administration/Scripts/kendo/{0}/kendo.data.min.js", kendoVersion));
Html.AppendScriptParts(string.Format("~/Administration/Scripts/kendo/{0}/kendo.web.min.js", kendoVersion));
Run Code Online (Sandbox Code Playgroud)

这是我来自后端的回应。

{"ExtraData":null,"Data":[{"Id":3,"TotalLicense":0,"TotalAvailableLicense":0,"TotalSoldLicense":0,"TotalLicenseAssignedToCustomer":0,"ProductSKU":"SLN-PP-001","ProductName":"Prepaid code - Full Stream License BCM 30 days","LicenseNumber":"BCQH EKDJ LP8E","Runtime":null,"ActivationStart":"01/01/0001","ActivationEnd":"01/01/0001","OwnerName":"Suman Kumar","OwnerEmail":"contact@devodee.com","ShortDescription":null,"OrderNumber":7,"ProductSeName":"prepaid-code-full-stream-license-bcm-30-days","SearchProductSKU":null,"SearchProductName":null,"SearchLicenseNumber":null,"SearchOwnerName":null,"SearchOwnerEmail":null,"SearchOrderNumber":0,"ShowProductSKUFront":false,"ShowProductNameFront":false,"ShowLicenseNumberFront":false,"ShowRuntimeFront":false,"ShowActivationStartFront":false,"ShowActivationEndFront":false,"ShowOwnerNameFront":false,"ShowOwnerEmailFront":false,"ShowShortDescriptionFront":false,"ShowOrderNumberFront":false,"ShowProductSKUBack":false,"ShowProductNameBack":false,"ShowLicenseNumberBack":false,"ShowRuntimeBack":false,"ShowActivationStartBack":false,"ShowActivationEndBack":false,"ShowOwnerNameBack":false,"ShowOwnerEmailBack":false,"ShowShortDescriptionBack":false,"ShowOrderNumberBack":false,"CustomProperties":{}},{"Id":4,"TotalLicense":0,"TotalAvailableLicense":0,"TotalSoldLicense":0,"TotalLicenseAssignedToCustomer":0,"ProductSKU":"SLN-PP-001","ProductName":"Prepaid code - Full Stream License BCM 30 days","LicenseNumber":"DW4W BBAJ TFQX","Runtime":null,"ActivationStart":"01/01/0001","ActivationEnd":"01/01/0001","OwnerName":"Suman Kumar","OwnerEmail":"contact@devodee.com","ShortDescription":null,"OrderNumber":8,"ProductSeName":"prepaid-code-full-stream-license-bcm-30-days","SearchProductSKU":null,"SearchProductName":null,"SearchLicenseNumber":null,"SearchOwnerName":null,"SearchOwnerEmail":null,"SearchOrderNumber":0,"ShowProductSKUFront":false,"ShowProductNameFront":false,"ShowLicenseNumberFront":false,"ShowRuntimeFront":false,"ShowActivationStartFront":false,"ShowActivationEndFront":false,"ShowOwnerNameFront":false,"ShowOwnerEmailFront":false,"ShowShortDescriptionFront":false,"ShowOrderNumberFront":false,"ShowProductSKUBack":false,"ShowProductNameBack":false,"ShowLicenseNumberBack":false,"ShowRuntimeBack":false,"ShowActivationStartBack":false,"ShowActivationEndBack":false,"ShowOwnerNameBack":false,"ShowOwnerEmailBack":false,"ShowShortDescriptionBack":false,"ShowOrderNumberBack":false,"CustomProperties":{}}],"Errors":null,"Total":2}
Run Code Online (Sandbox Code Playgroud)

当我删除下面的 JS 时,

//Html.AppendScriptParts(string.Format("~/Administration/Scripts/kendo/{0}/kendo.data.min.js", kendoVersion));
Run Code Online (Sandbox Code Playgroud)

错误涂漆。但是这两个 JS 都必须添加到视图中才能实现其他一些功能。

kendo.web.min.js:13 Uncaught TypeError: e.slice is not a function
at init.success (kendo.web.min.js:13)
at i (jquery-1.10.2.min.js:4)
at Object.n.success (kendo.data.min.js:11)
at c (jquery-1.10.2.min.js:4)
at Object.fireWith [as resolveWith] (jquery-1.10.2.min.js:4)
at k (jquery-1.10.2.min.js:6)
at XMLHttpRequest.r (jquery-1.10.2.min.js:6)
Run Code Online (Sandbox Code Playgroud)

错误::脚本行和代码

任何人都可以详细说明这里出了什么问题,我错过了什么吗?

javascript kendo-ui kendo-grid

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

错误:未加载mongodb.jdbc.MongoDriver.你确定你已经包含了正确的jdbc驱动程序

我必须将mongoDB数据导入弹性搜索,因此我使用给定的conf与logstash:

input{
    jdbc{
        jdbc_driver_library => "D:/mongodb_unityjdbc_full.jar"
        jdbc_driver_class => "mongodb.jdbc.MongoDriver"
        jdbc_connection_string => "jdbc:mongodb://10.10.20.125:27017"
        jdbc_user => ""
        statement => "SELECT * FROM collection_name.documentname"
    }
}
output {
  elasticsearch {
    hosts => 'http://localhost:9200'
    index => 'person_data'
    document_type => "person_data"
 }
  stdout { codec => rubydebug }
}
Run Code Online (Sandbox Code Playgroud)

但是我收到以下错误:

错误:未加载mongodb.jdbc.MongoDriver.您确定在jdbc_driver_library中包含了正确的jdbc驱动程序吗?

mongodb elasticsearch logstash logstash-configuration

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

Silex 中的挂载操作 - 附加斜杠

我有一个在 Silex Framework 中开发的小型后端。我尝试使这个请求在 POST 上工作:

http://localhost/feedback/other

但是当使用挂载操作时,只有这个请求有效:

http://localhost/feedback/other/

如您所见,我必须在请求中添加一个额外的尾部斜杠。

以下是一些无法按预期工作的代码:

//index.php
$app->mount("/other", new FeedbackOther());

//FeedbackOther.php
$feedbackOther->get("/", "FeedbackOtherController::index")->bind('other');
$feedbackOther->post("","FeedbackOtherController::store");
Run Code Online (Sandbox Code Playgroud)

如果我做类似的事情

//index.php
$app->post('/other', "FeedbackOtherController::store");
$app->mount("/other", new FeedbackOther());

//FeedbackOther.php
$feedbackOther->get("/", "FeedbackOtherController::index")->bind('other');
Run Code Online (Sandbox Code Playgroud)

POST 请求无需附加斜杠即可工作,但在这种情况下,我看不到使用挂载操作的意义。

我也试过使用 .htacces 重写,但重写规则在 GET 中转换了 POST 请求。

php symfony silex

4
推荐指数
1
解决办法
1053
查看次数

正则表达式可以是数字字符,也可以是字母数字,但不仅仅是字母字符

要验证必须同时包含数字和字母的字段,我可以使用:

/^([0-9]+[a-zA-Z]+|[a-zA-Z]+[0-9]+)[0-9a-zA-Z]*$/
Run Code Online (Sandbox Code Playgroud)

但我想另外接受仅数字字符串.

regex

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

使用多线程在赋值之前引用的局部变量

用于添加和删除列表中的值的代码是在不同线程中执行的操作.

在多线程中使用这些全局变量:

from threading import Thread
import time

a=[]
i = 0
j = 0
Run Code Online (Sandbox Code Playgroud)

thread1的函数:

def val_in():
    while 1:
        a.append(raw_input())
        print "%s value at %d: %d added" % ( time.ctime(time.time()), i ,int(a[i])) // line 14
        i+=1
Run Code Online (Sandbox Code Playgroud)

线程2的功能:

def val_out():
    while 1:
        time.sleep(5)
        try:
            print "%s value at %d: %d deleted" % (time.ctime(time.time()), j, int(a.pop(j)))
            i-=1
        except:
            print"no values lefts"
        time.sleep(2)
Run Code Online (Sandbox Code Playgroud)

定义和启动线程:

t = Thread(target = val_in)
t1 = Thread(target= val_out)
t.start()
t1.start()
Run Code Online (Sandbox Code Playgroud)

现在当输入为1,它应该被添加到列表中a,但是有一个错误:

Error: Exception …
Run Code Online (Sandbox Code Playgroud)

python python-multithreading python-2.7

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

java中Timer的scheduleAtFixedRate()函数的delay和period参数的区别

在 中和 和 和有什么java.util.Timer.scheduleAtFixedRate(TimerTask timer, long delay, long period)区别?delayperiod

java timertask

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

没有可用的“org.springframework.boot.web.reactive.context.ReactiveWebApplicationContext”类型的合格 bean

我正在使用 webflux 和 springboottest 在 spring boot 中运行测试。

 buildscript {
    ext {
        springBootVersion = '2.0.5.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
}


ext {
    springCloudVersion = 'Finchley.SR1'
}

dependencies {
    compile('org.junit.jupiter:junit-jupiter-api')
    compile('org.springframework.boot:spring-boot-starter-webflux')
   testCompile('org.springframework.boot:spring-boot-starter-test')
    testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
    testCompile('io.projectreactor:reactor-test')

}

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
    }
}
Run Code Online (Sandbox Code Playgroud)

测试用例

@SpringBootTest
@ExtendWith({SpringExtension.class})

class DemoTest {

    private WebTestClient …
Run Code Online (Sandbox Code Playgroud)

spring spring-boot spring-boot-test spring-webflux

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

RDF Turtle语法问题

我有以下有效的Turtle语法:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix sc: <http://education.data.gov.uk/def/school/School#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos>.

<http://example.com/schools/#1000> a <http://education.data.gov.uk/def/school/School> . 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentName>    "Atherstone Early Years Centre". 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentNumber> "1000". 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/Address>  [<http://education.data.gov.uk/def/school/address1> "RATCLIFFE ROAD";     <http://education.data.gov.uk/def/school/postcode> "CV9 1LF"]. 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentType> "Nursery".
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/districtAdministrative> "North Warwickshire".
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/uniqueReferenceNumber> "2016".
<http://example.com/schools/#1000> geo:lat "52.5786677".
<http://example.com/schools/#1000> geo:long "-1.5420408".
Run Code Online (Sandbox Code Playgroud)

我基本上定义了一个学校对象,id#1000之后我添加了属性.我想知道我是否可以<http://example.com/schools/#1000>在每个属性之前摆脱定义,并以某种方式用括号或其他东西包围属性.有任何想法吗?

syntax rdf rdfs turtle-rdf

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