小编Cry*_*ark的帖子

SSH终端使用JS,HTML5和PHP

我正在寻找像GateOne这样的解决方案,我可以安装在支持PHP的服务器上,我没有ssh连接.它也支持Python,但如果没有实际的SSH访问,我就无法执行任何操作.这意味着只需将其放入文件夹即可.

我见过JavaScript(或JS + PHP)终端客户端,但解决方案似乎已经过时了.

例如,我希望能够执行一个简单ln -s ./dir1 ./dir2的创建符号链接.

javascript php ssh terminal html5

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

无法安装我自己的ElasticSearch插件

我不久前使用ES 0.20.1构建了自己的ES插件.工作得很好.今天,我想我会回到那个项目并首先尝试在最新版本(0.20.6)上重新部署它,因为我之前已经从0.19.8到0.20.1.

所以我更新了依赖关系以使用0.20.6 lib,运行我的测试(全部通过)并构建了插件.(我正在使用maven)

这生成了一个名为elasticsearch-MyPlugin-0.20.6.zipwich 的文件,其中包含jarmyplugin-0.0.1-SNAPSHOT-jar-with-dependencies.jar

然后像往常一样使用我的插件部署

sudo /usr/share/elasticsearch/bin/plugin -url /path/to/foler/containing/zipfile -install MyPlugin
Run Code Online (Sandbox Code Playgroud)

这用起来工作......但它现在抛出以下错误:

-> Installing MyPlugin...
Failed to install MyPlugin, reason: no protocol: /path/to/foler/containing/zipfile
Run Code Online (Sandbox Code Playgroud)

所以我回到了ES文档中关于安装插件的内容.

sudo /usr/share/elasticsearch/bin/plugin -url file:///path/to/foler/containing/zipfile -install elasticsearch-MyPlugin-0.20.6
Run Code Online (Sandbox Code Playgroud)

这是输出:

-> Installing elasticsearch-MyPlugin-0.20.6...
Trying file:/path/to/foler/containing/zipfile...
Downloading .DONE
failed to extract plugin [/usr/share/elasticsearch/plugins/elasticsearch-MyPlugin-0.20.6.zip]: ZipException[error in opening zip file]
Run Code Online (Sandbox Code Playgroud)

为了彻底,我有一个es-plugin.properties指向正确班级的文件.

我正在使用我使用的名称和/或我安装插件的方式存在问题,但我无法弄清楚什么是错的.

java plugins debian maven elasticsearch

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

查询与过滤器 - 执行顺序

我读过这个问题,我的一位同事让我怀疑:

在筛选查询中,何时应用过滤器?在执行查询之前或之后?结果何时缓存?

如果预先应用过滤器,在过滤器中复制查询部分不是一件好事吗?如果之后应用了过滤器,那么我无法理解缓存的内容.

elasticsearch

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

如何从每个日期的总和图表创建每个日期的累积总和图表?

我在谷歌电子表格中有这样的数据:

      | Day 1 | Day 2 | Day 3
Marc  |  10   |  5    |  8
Amy   |   -   |  15   |  3
Run Code Online (Sandbox Code Playgroud)

我想要的是一张图表,显示马克在第 1 天总共有 10 个,第 2 天有 15 个,第 3 天有 23 个,而 Amy 在第 1 天不存在,然后在第 2 天有 15 个,在第 3 天有 18 个。

理想的情况是直接生成图表的自动化解决方案,但我想我可以将一些数据提取到另一个工作表并用于我的图表。例如:

      | Day 1 | Day 2 | Day 3
Marc  |  10   |  15   |  23
Amy   |   -   |  15   |  18
Run Code Online (Sandbox Code Playgroud)

如果这是唯一的解决方案,我将如何根据我的第一个表的输入自动生成这样一个表,知道可能会添加新名称并且每天都会添加一列?

谢谢

charts google-sheets

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

KStream-KTable join 写入 KTable:如何将 join 与 ktable 写入同步?

我对以下拓扑的行为方式有一些问题:

String topic = config.topic();

KTable<UUID, MyData> myTable = topology.builder().table(UUIDSerdes.get(), GsonSerdes.get(MyData.class), topic);

// Receive a stream of various events
topology.eventsStream()
    // Only process events that are implementing MyEvent
    .filter((k, v) -> v instanceof MyEvent)
    // Cast to ease the code
    .mapValues(v -> (MyEvent) v)
    // rekey by data id
    .selectKey((k, v) -> v.data.id)
    .peek((k, v) -> L.info("Event:"+v.action))
    // join the event with the according entry in the KTable and apply the state mutation
    .leftJoin(myTable, eventHandler::handleEvent, UUIDSerdes.get(), EventSerdes.get())
    .peek((k, v) -> …
Run Code Online (Sandbox Code Playgroud)

apache-kafka-streams

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

设计和password_confirmation验证

我在设计和密码确认时遇到了麻烦。我已经在rails4中创建了一个模型测试,如下所示:

test "user requires a password_confirmation" do
  user = FactoryGirl.build(:user)
  assert user.valid?, "FactoryGirl should return a valid user"

  user.password_confirmation = nil

  # These are just some outputs to verify what's going on.
  # This is the condition in devises's password_required? method
  puts !user.persisted? || !user.password.nil? || !user.password_confirmation.nil? #=> true
  puts user.valid? #=> true

  assert user.invalid?, "Password confirmation should be required" # Fails here
  assert_equal 1, user.errors.size, "Only one error should have occured. #{user.errors.full_messages}"
end
Run Code Online (Sandbox Code Playgroud)

该测试在第二个assert("Password confirmation should be required" …

testing validation ruby-on-rails devise

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