为什么我不能在浏览器中使用 chrome 的控制台触发或模拟用户点击?就像我在页面上有一个链接一样,我$('#app .mylink').click()应该去某个地方。
我安装了https://github.com/big-data-europe/docker-hadoop-spark-workbench
然后开始了docker-compose up.我导航到git自述文件中提到的各种网址,所有内容似乎都已启动.
然后我开始了一个本地的apache zeppelin:
./bin/zeppelin.sh start
Run Code Online (Sandbox Code Playgroud)
在zeppelin解释器设置中,我已导航到spark解释器并更新master以指向安装的本地群集 docker
master:从更新local[*]到spark://localhost:8080
然后我在笔记本中运行以下代码:
import org.apache.hadoop.fs.{FileSystem,Path}
FileSystem.get( sc.hadoopConfiguration ).listStatus( new Path("hdfs:///")).foreach( x => println(x.getPath ))
Run Code Online (Sandbox Code Playgroud)
我在zeppelin日志中遇到此异常:
INFO [2017-12-15 18:06:35,704] ({pool-2-thread-2} Paragraph.java[jobRun]:362) - run paragraph 20171212-200101_1553252595 using null org.apache.zeppelin.interpreter.LazyOpenInterpreter@32d09a20
WARN [2017-12-15 18:07:37,717] ({pool-2-thread-2} NotebookServer.java[afterStatusChange]:2064) - Job 20171212-200101_1553252595 is finished, status: ERROR, exception: null, result: %text java.lang.NullPointerException
at org.apache.zeppelin.spark.Utils.invokeMethod(Utils.java:38)
at org.apache.zeppelin.spark.Utils.invokeMethod(Utils.java:33)
at org.apache.zeppelin.spark.SparkInterpreter.createSparkContext_2(SparkInterpreter.java:398)
at org.apache.zeppelin.spark.SparkInterpreter.createSparkContext(SparkInterpreter.java:387)
at org.apache.zeppelin.spark.SparkInterpreter.getSparkContext(SparkInterpreter.java:146)
at org.apache.zeppelin.spark.SparkInterpreter.open(SparkInterpreter.java:843)
at org.apache.zeppelin.interpreter.LazyOpenInterpreter.open(LazyOpenInterpreter.java:70)
at org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:491)
at org.apache.zeppelin.scheduler.Job.run(Job.java:175)
at org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139) …Run Code Online (Sandbox Code Playgroud) 我正在使用handontable js插件.我想在afterChange钩子中使用getCellMeta函数但不能正常工作.我在使用函数outChange hook后,函数正常工作.但是没有在afterChange挂钩工作.
var container = document.getElementById('t1'),
options = document.querySelectorAll('.options input'),
table,
hot;
hot = new Handsontable(container, {
autoWrapRow: true,
startRows: 81,
startCols: 206,
autoColumnSize : true,
stretchH: 'all',
afterChange : function(change,source) {
if (source === 'loadData') {
return;
}
var test = this.getCellMeta(change[0],change[1]); // not working, not return "id" meta
console.log(test);
}
});
$.ajax({
url: 'path',
type: 'GET',
dataType: 'json',
success: function (res) {
var data = [], row, pc = 0;
for (var …Run Code Online (Sandbox Code Playgroud) 使用案例:
我正在使用REST Api来提供视频游戏的战斗结果.这是一个团队与团队在线游戏,每个团队由3名玩家组成,他们可以从100个不同角色中选择不同的角色.我想计算每个球队组合的胜负数和平局数.我每秒大约获得1000次战斗结果.我连接每个团队的角色ID(升序)然后我保存每个组合的赢/输和抽奖.
我目前的实施:
const combinationStatsSchema: Schema = new Schema({
combination: { type: String, required: true, index: true },
gameType: { type: String, required: true, index: true },
wins: { type: Number, default: 0 },
draws: { type: Number, default: 0 },
losses: { type: Number, default: 0 },
totalGames: { type: Number, default: 0, index: true },
battleDate: { type: Date, index: true, required: true }
});
Run Code Online (Sandbox Code Playgroud)
对于每个返回的日志,我执行upsert并将这些查询批量发送(5-30行)到MongoDB:
const filter: any = { combination: log.teamDeck, gameType, battleDate };
if …Run Code Online (Sandbox Code Playgroud) 我为我的项目选择了 vuetify。很棒的前端框架。问题是,如何使 v-parallax 显示完整图像而不进行裁剪。下面显示了一些代码,完整的代码托管在代码笔中。
<v-parallax
src="https://blog-images-bucket.s3.amazonaws.com/media/private/carlos-muza-84523_u62x84y.jpg"
height="600"
jumbotron
></v-parallax>
Run Code Online (Sandbox Code Playgroud)
https://codepen.io/tonywangcn/pen/WdENYQ
谢谢!
我使用的是kafka-0.8.1.1版本,在这个版本中,自动重新连接不能通过java代码工作.我有属性文件
props.put("zookeeper.connect", "zoo1:2181,zoo2:2181");
props.put("group.id", KAFKA_GROUPID);
props.put("zookeeper.session.timeout.ms", "10000");
props.put("zookeeper.sync.time.ms", "200");
props.put("auto.commit.interval.ms", "1000");
Run Code Online (Sandbox Code Playgroud)
当我启动消费者线程时,它连接到kafka服务器,在线程运行服务器之间丢失与kafka服务器的连接2小时.如果它重新连接kafka消费者没有收到任何消息,它也不会抛出任何错误流.
我们如何检测它丢失连接并自动重新连接消费者线程.
提前致谢
我正在尝试编译一个简单的 scala 程序,我正在使用 StreamingContext ,这是我的代码片段:
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.scheduler.SparkListener
import org.apache.spark.scheduler.SparkListenerStageCompleted
import org.apache.spark.streaming.StreamingContext._ //error:object streaming is not a member of package org.apache.spark
object FileCount {
def main(args: Array[String]) {
val conf = new SparkConf()
.setAppName("File Count")
.setMaster("local")
val sc = new SparkContext(conf)
val textFile = sc.textFile(args(0))
val ssc = new StreamingContext(sc, Seconds(10)) //error : not found: type StreamingContext
sc.stop()
}
}
Run Code Online (Sandbox Code Playgroud)
我有这两个错误:
object streaming is not a member of package org.apache.spark
Run Code Online (Sandbox Code Playgroud)
和
not found: type StreamingContext
Run Code Online (Sandbox Code Playgroud)
任何帮助请!
我想输出火花和火花流到卡夫卡一次.但正如文档所说的那样
"输出操作(如foreachRDD)至少有一次语义,也就是说,如果发生工作失败,转换后的数据可能会被多次写入外部实体."
要进行事务更新,spark建议使用批处理时间(在foreachRDD中可用)和RDD的分区索引来创建标识符.该标识符唯一地标识流应用程序中的blob数据.代码如下:
dstream.foreachRDD { (rdd, time) =>
rdd.foreachPartition { partitionIterator =>
val partitionId = TaskContext.get.partitionId()
val **uniqueId** = generateUniqueId(time.milliseconds, partitionId)
// use this uniqueId to transactionally commit the data in partitionIterator
}
}
Run Code Online (Sandbox Code Playgroud)
但是,如何使用UNIQUEID卡夫卡,使事务提交.
谢谢
所以我正在按照指南使用twit将图像上传到twitter w节点.
这是我的代码
function upload_random_image(){
console.log('Opening an image...');
var image_path = path.join(__dirname, '/random_cam/' + random_cam()),
b64content = fs.readFileSync(image_path, { encoding: 'base64' });
console.log('Uploading an image...');
T.post('media/upload', { media_data: b64content }, function (err, data, response) {
if (!err){
console.log('ERROR');
console.log(err);
}
else{
console.log('Uploaded an image!');
T.post('statuses/update', {
media_ids: new Array(data.media_id_string)
},
function(err, data, response) {
if (!err){
console.log('Error!');
console.log(err);
}
else{
console.log('Posted an image!');
}
}
);
}
});
}
Run Code Online (Sandbox Code Playgroud)
也许我错过了回调函数,我知道如果必须是一个函数,但我不明白为什么我的函数不起作用.
错误:
throw new TypeError('"callback" argument must be a function');
Run Code Online (Sandbox Code Playgroud)
完整代码: …
我正在使用梦魇js来自动化文件下载.所以两天前我们决定将这个工具移到aws lambda中,我能够使用nightmare-lambda-tutorial获得使用噩梦运行的aws东西,但我的lambda使用了另一个噩梦模块噩梦 - download-manager添加此下载管理器,lambda失败并显示'MODULE_NOT_FOUND'消息,虽然我使用npm install安装了软件包,但我确实找到了node_modules中的文件夹和文件.
因此,通过调试,我发现即使使用最初的几行代码,lambda也会失败,例如,
var binaryPack = require('./lib/bootstrap/nightmare-lambda-pack'),
Xvfb = require('./lib/bootstrap/xvfb'),
Nightmare = require('nightmare');
require('nightmare-download-manager')(Nightmare);
Run Code Online (Sandbox Code Playgroud)
第4行将导致模块未找到错误.知道如何解决这个问题吗?
javascript ×5
apache-spark ×3
node.js ×3
apache-kafka ×2
scala ×2
aws-lambda ×1
callback ×1
css ×1
docker ×1
ecmascript-6 ×1
express ×1
hadoop ×1
handsontable ×1
hdfs ×1
hook ×1
java ×1
jquery ×1
mongodb ×1
nightmare ×1
performance ×1
twitter ×1
upsert ×1
vue.js ×1
vuetify.js ×1