小编mys*_*eim的帖子

Java(swing)有这样的按钮吗?

例如,libre office有一个带下拉菜单的按钮,但它不是组合框:

按钮快照

Swing有模拟或类似的东西吗?

java swing

6
推荐指数
1
解决办法
1253
查看次数

如何用java regex拆分字符串后面看?

我从文件中读取这个字符串:

abc | abc(abc\| abc)| def

我想得到数组包括3项:

  1. ABC
  2. abc(abc\| abc)
  3. 高清

如何正确编写正则表达式? line.split("(?!<=\\)\\|")不起作用.

java regex

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

与 Angular 组件的名称相同

为组件使用相同的名称和选择器是一种好习惯吗?

例如:

products ->
  list.component.html 
  list.component.ts // class ListComponent
users ->
  list.component.html
  list.component.ts // class ListComponent
Run Code Online (Sandbox Code Playgroud)

或者更好地使用这种风格:

products ->
  products-list.component.html 
  products-list.component.ts // class ProductsListComponent
users ->
  users-list.component.html
  users-list.component.ts // class UsersListComponent
Run Code Online (Sandbox Code Playgroud)

typescript angular

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

将图像内容保存在html文件中

是否可以在html中保存图像?我想用几张图片创建html.也许我需要用base64解码图像内容并将其粘贴到html标记中?

html css image

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

zsh:找不到命令:jhipster

我无法运行jhipster生成器,得到错误: zsh: command not found: jhipster

我的系统是Ubuntu 16.04,我使用zsh:

? yarn global add generator-jhipster
yarn global v0.24.5
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "generator-jhipster@4.5.0" with binaries:
      - jhipster
warning No license field
Done in 1.87s.
? jhipster
zsh: command not found: jhipster
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

我也在我的.zshrc中有这个:

# npm
export PATH="$PATH:/home/romanovi/.npm-global/bin"
export NODE_PATH="$NODE_PATH:/home/romanovi/.npm-global/lib/node_modules"

# Yarn
export PATH="$PATH:`yarn global bin`"
Run Code Online (Sandbox Code Playgroud)

yeoman-generator jhipster

4
推荐指数
2
解决办法
3959
查看次数

如何使用 Ruby 和 IO.popen 写入和读取进程?

我写了这个,但是没用...

输出 = IO.popen("irb", "r+") do |pipe|
  管道获取
  管道.puts“10**6”
  管道获取
  pipeline.puts“退出”
结尾

我这样重写

IO.popen("irb", "w+") 做 |pipe|
  3.times {puts pipeline.gets} # 启动噪音
  管道.puts“10**6\n”
  puts pipeline.gets # 我期望“ => 1000000”
  pipeline.puts "quit" # 我希望从 irb 退出
结尾
但它也不起作用

ruby popen

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

摆动有什么选择吗?

摆动有什么选择吗?我需要一个高性能的GUI工具包来在linux(Ubuntu)上创建桌面应用程序.我已经创建了2年的swing应用程序,因此我想使用java.

java swing

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

有没有 ELK-stack 的轻量级替代品?

我有一个带有 1GB RAM 的 VPS。我想找一个ELK的替代品,因为我的vps服务器太弱了。我只需要从 logstash 获取日志并在一些 web gui 上可视化它。

logging elastic-stack

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

消费者模拟方法

我想repository.actionOnFile(String path, Consumer<InputStream> action)在此源中进行模拟:

@Autowired
private FileRepositoryService repository;

public Document getDocument(URL url) {
    MutableObject<Document> obj = new MutableObject<>();
    Consumer<InputStream> actionOnFile = inputStream -> obj.setValue(getDocument(inputStream));
    try {
        repository.actionOnFile(url.toExternalForm(), actionOnFile);
    } catch (S3FileRepositoryException e) {
        throw e.getCause();
    }
    return obj.getValue();
}
Run Code Online (Sandbox Code Playgroud)

问题在于第二个参数是lambda表达式。

如何使用模仿来模拟它,我需要accept将输入流传递给方法以对其进行测试?

java lambda mocking

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

如何在vue.js 2中使用mathjax?

我的package.json:

  "dependencies": {
    "bootstrap": "^3.3.7",
    "mathjax": "^2.7.2",
    "vue": "^2.5.2",
    "vue-moment": "^3.1.0",
    "vue-router": "^3.0.1"
  },
Run Code Online (Sandbox Code Playgroud)

我有一个组成部分:

<template>
  <div class="post--body" v-html="previewText" id="post--body"></div>
</template>

<script>

import MathJax from 'mathjax'

export default {
  name: 'blog-post',
  data () {
    return {
      post: {body: ""}
    }
  },
  mounted() {
    fetch("/api/post/" + this.$route.params.id)
        .then(response => response.json())
        .then(data => {
            this.post = data;
        })
    this.$nextTick(function () {
      console.log("tick")
      MathJax.Hub.Typeset()   
    })
  },
  computed: {
    previewText () {
      return this.post.body
    } 
  }
}
</script>
Run Code Online (Sandbox Code Playgroud)

但是我在MathMenu.js上收到了“ Uncaught SyntaxError:Unexpected token <”(未捕获的SyntaxError:意外的令牌<)?V = …

mathjax vue.js vuejs2

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