有人可以建议我一个解决方案,为什么当我使用命令运行测试来运行位于其中的mvn testCucumber runner 类时,但 Maven 构建无法识别它。就像我说的,测试运行做了它应该做的事情,但构建仍然失败。ExampleRunnerTest\\src\\test\\java
1 Scenarios (\xe2\x86\x90[32m1 passed\xe2\x86\x90[0m)\n6 Steps (\xe2\x86\x90[32m6 passed\xe2\x86\x90[0m)\n1m36.764s\n\nTests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 98.777 sec - in BasicTest\n\nResults :\nTests run: 0, Failures: 0, Errors: 0, Skipped: 0\n[INFO] ------------------------------------------------------------------------\n[INFO] BUILD FAILURE\n[INFO] ------------------------------------------------------------------------\n\nRun Code Online (Sandbox Code Playgroud)\n@RunWith(Cucumber.class)\n@CucumberOptions(features = "src/main/java/cucumber/feature/Basic.feature", glue = "cucumber/stepDefinition",\n format = {"pretty", "html:target/cucumber", "json:target/cucumber-report.json"})\n\npublic class BasicTest {\n}\nRun Code Online (Sandbox Code Playgroud)\n 我有这个指南针错误
Line 3: Invalid CSS after "@charset "UTF-8"": expected selector or at-rule, was "@import 'compass';")
Run Code Online (Sandbox Code Playgroud)
该文件如下。它甚至不包含我自己的任何代码
@charset "UTF-8"
@import 'compass';
Run Code Online (Sandbox Code Playgroud)
我知道人们说当该@import行缺少分号时会发生此错误,但我的文件有分号。
并且相同的文件(scss 和 config.rb)可以在 linux 中轻松编译,没有问题。
有人知道出了什么问题吗?
给出错误的配置是
Windows 8.1
ruby 2.1.6p336 (2015-04-13 revision 50298) [i386-mingw32]
Compass 1.0.3 (Polaris)
Sass 3.4.16 (Selective Steve)
Run Code Online (Sandbox Code Playgroud)
我尝试了很多组合
(1)
-------------------
@import 'compass';
-------------------
// only this line, no @charset line.
// Result: compilation ok, but I need charset because
// my COMMENTS (yes only comments) have UTF8 chars.
Run Code Online (Sandbox Code Playgroud)
(2)
------------------- …Run Code Online (Sandbox Code Playgroud) 我是 spark 新手,我正在尝试创建简单的 JavaDStream 来使用 spark-testing-base API 测试我的工作。到目前为止我所做的是:
JavaStreamingContext streamingContext = new
JavaStreamingContext(jsc(),Durations.seconds(10));
List<String> list = new LinkedList<String>();
list.add("first");
list.add("second");
list.add("third");
JavaRDD<String> myVeryOwnRDD = jsc().parallelize(list);
Queue<JavaRDD<String>> queue = new LinkedList<JavaRDD<String>>();
queue.add( myVeryOwnRDD );
JavaDStream<String> javaDStream = streamingContext.queueStream( queue );
javaDStream.foreachRDD( x-> {
x.collect().stream().forEach(n-> System.out.println("item of list: "+n));
});
Run Code Online (Sandbox Code Playgroud)
我希望它会打印我的列表......它没有。我得到了它:
12:19:05.454 [main] DEBUG org.apache.spark.util.ClosureCleaner - +++ Cleaning closure <function1> (org.apache.spark.streaming.api.java.JavaDStreamLike$$anonfun$foreachRDD$3) +++
12:19:05.468 [main] DEBUG org.apache.spark.util.ClosureCleaner - + declared fields: 3
12:19:05.469 [main] DEBUG org.apache.spark.util.ClosureCleaner - public static final long org.apache.spark.streaming.api.java.JavaDStreamLike$$anonfun$foreachRDD$3.serialVersionUID
12:19:05.469 …Run Code Online (Sandbox Code Playgroud) 拥有Dataset<Row>单列json字符串:
+--------------------+
| value|
+--------------------+
|{"Context":"00AA0...|
+--------------------+
Run Code Online (Sandbox Code Playgroud)
Json样本:
{"Context":"00AA00AA","MessageType":"1010","Module":"1200"}
Run Code Online (Sandbox Code Playgroud)
我怎样才能最有效地获得Dataset<Row>如下所示:
+--------+-----------+------+
| Context|MessageType|Module|
+--------+-----------+------+
|00AA00AA| 1010| 1200|
+--------+-----------+------+
Run Code Online (Sandbox Code Playgroud)
我正在流处理这些数据,我知道当我从文件中读取时,spark可以通过他自己做到这一点:
spark
.readStream()
.schema(MyPojo.getSchema())
.json("src/myinput")
Run Code Online (Sandbox Code Playgroud)
但现在我正在读取kafka的数据,它以另一种形式提供数据.我知道我可以使用像Gson这样的解析器,但我想让火花为我做.
在Spark 1.6中,StreamingContext我可以使用函数reduceByKeyAndWindow
events
.mapToPair(x-> new Tuple2<String,MyPojo>(x.getID(),x))
.reduceByKeyAndWindow((a, b) ->
a.getQuality() > b.getQuality() ? a : b
, Durations.seconds(properties.getWindowLenght()),
Durations.seconds(properties.getSlidingWindow()))
.map(y->y._2);
Run Code Online (Sandbox Code Playgroud)
现在我试图用spark 2.0.2和Dataframes重现这个逻辑.我能够重现丢失的函数reduceByKey但没有窗口
events
.groupByKey(x-> x.getID() ,Encoders.STRING())
.reduceGroups((a,b)-> a.getQuality()>=b.getQuality() ? a : b)
.map(x->x._2, Encoders.bean(MyPojo.class))
Run Code Online (Sandbox Code Playgroud)
我能够实现窗口 groupBy
events
.groupBy(functions.window(col("timeStamp"), "10 minutes", "5 minutes"),col("id"))
.max("quality")
.join(events, "id");
Run Code Online (Sandbox Code Playgroud)
当我使用groupBy时,我只有15列中的两列,所以我试图让他们回来加入,但后来我得到了解雇: join between two streaming DataFrames/Datasets is not supported;
有没有办法让我重现reduceByKeyAndWindow火花2的逻辑?
我想转换Row的DataFrame成只使用火花API JSON字符串。
从输入 Row
+----------------+-----------+
| someThing| else|
+----------------+-----------+
| life| 42|
+----------------+-----------+
Run Code Online (Sandbox Code Playgroud)
和
myDataFrame
.select(struct("*").as("col"))
.select(to_json(col("col")))
.writeStream()
.foreach(new KafkaWriter())
.start()
Run Code Online (Sandbox Code Playgroud)
using KafkaWriter,即使用row.toString()我得到:
[{
"someThing":"life",
"else":42
}]
Run Code Online (Sandbox Code Playgroud)
当我想得到这个时:
{
"someThing":"life",
"else":42
}
Run Code Online (Sandbox Code Playgroud)
(没有[])
任何的想法?
我Anaconda3@windows用来导入,scipy(v1.0.0)但编译时出现错误。我在网上查了其他类似的案例,但没有找到解决办法,有谁知道吗?
import numpy as np
import scipy
Run Code Online (Sandbox Code Playgroud)
错误消息
ImportError
Traceback (most recent call
last) <ipython-input-12-eb63b9337447> in <module>()
1 import numpy as np
----> 2 import scipy
~\AppData\Roaming\Python\Python36\site-packages\scipy\__init__.py in
<module>()
116 del _NumpyVersion
117
--> 118 from scipy._lib._ccallback import LowLevelCallable
119
120 from scipy._lib._testutils import PytestTester
~\AppData\Roaming\Python\Python36\site-packages\scipy\_lib\_ccallback.py
in <module>()
----> 1 from . import _ccallback_c
2
3 import ctypes
4
5 PyCFuncPtr = ctypes.CFUNCTYPE(ctypes.c_void_p).__bases__[0]
ImportError: cannot import name '_ccallback_c'
Run Code Online (Sandbox Code Playgroud) 我有这个例子:https : //stackblitz.com/edit/angular-asevei?file=app%2Fcdk-drag-drop-sorting-example.html
一切正常,但是在 将选择框“重置”到列表中的第一个值时。
有没有什么办法解决这一问题?它只是视觉上的,但对用户来说非常刺耳。我曾尝试使用该cdkDragPreview选项,但无法使其正常工作。
成分:
import { Component } from '@angular/core';
import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
import { FormBuilder, FormGroup, FormArray } from '@angular/forms';
@Component({
selector: 'cdk-drag-drop-sorting-example',
templateUrl: 'cdk-drag-drop-sorting-example.html',
styleUrls: ['cdk-drag-drop-sorting-example.css'],
})
export class CdkDragDropSortingExample {
myForm: FormGroup;
constructor(private fb: FormBuilder) {
this.myForm = this.fb.group({
title: ['title'],
items: fb.array([
fb.group({
name: fb.control('1'),
note: fb.control('quux')
}),
fb.group({
name: fb.control('2'),
note: fb.control('bar')
}),
fb.group({
name: fb.control('3'),
note: fb.control('baz')
})
])
})
}
drop(event: …Run Code Online (Sandbox Code Playgroud) 当我在 cmd 中编写 flutter doctor 命令时,出现此错误。
No valid Android SDK platforms found in G:\SdkManager\platforms. Candidates were:
- android-21
- android-27
- android-28
- android-8.0.0
Run Code Online (Sandbox Code Playgroud)
我在这里阅读了该函数的 scipy 文档:scipy.ndimage.uniform_filter1d。然而,当我尝试使用它时,我无法理解它的工作原理。我阅读了文档,在 Python Shell 中运行了该示例,使用了我自己的示例,但仍然没有进展。例如:
>>> from scipy.ndimage import uniform_filter1d
>>> uniform_filter1d([2, 8, 0, 4, 1, 9, 9, 0], size=3)
array([4, 3, 4, 1, 4, 6, 6, 3])
>>> uniform_filter1d([1, 2, 3, 4, 5, 6, 7, 8], size=3)
array([1, 2, 3, 4, 5, 6, 7, 7])
Run Code Online (Sandbox Code Playgroud)
当我看到第二个数组的输出时,感觉这个函数保留了数组的大部分元素。然而,在第二个示例中,感觉就像除了 4 和 1 之外,输出数组中的所有其他元素都是全新的。
因此,我希望您能帮助我了解此功能的工作和使用。
java ×5
apache-spark ×4
json ×2
python ×2
scala ×2
scipy ×2
angular ×1
angular-cdk ×1
compass-sass ×1
cucumber ×1
flutter ×1
maven ×1
pom.xml ×1
spring ×1
unit-testing ×1