小编Mad*_*hat的帖子

在运行脚本之前使用 Github.com 检查 ssh

我有这个:

ssh -T git@github.com || {
  echo "Could not ssh to/with Github, check your auth";
  exit 1;
}
Run Code Online (Sandbox Code Playgroud)

我得到:

Hi ORESoftware! You've successfully authenticated, but GitHub does not provide shell access.
Could not ssh to/with Github, check your auth
Run Code Online (Sandbox Code Playgroud)

由于退出代码不为零,我是否真的需要解析输出以查看是否可以建立身份验证?

git ssh github

7
推荐指数
2
解决办法
1465
查看次数

spring cloud配置服务器与consul之间的区别?

我很困惑何时使用spring cloud config serverconsul。两者都会以自己的方式读取配置文件。你能告诉我什么时候使用spring cloud 配置服务器以及什么时候使用consul吗?

spring-boot consul spring-cloud

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

由于警告:RequireJS 失败,所有检查均失败。使用 --force 继续

我不是一个普通的开发人员。
我想要的只是为select2添加语言翻译;翻译默认src/js/select2/i18n/en.js文件内容,创建新文件,将标签从英文更改为非英文。
提交拉取请求后,我看到所有检查都失败了,并且低于 CI/Linting 结果:

Run grunt compile lint
Running "requirejs:dist" (requirejs) task
Error: ENOENT: no such file or directory, open
'/home/runner/work/select2/select2/src/js/select2/i18n/en.js'
In module tree:
select2/core
select2/options
select2/defaults
Warning: RequireJS failed. Use --force to continue.

Aborted due to warnings.
##[error]Process completed with exit code 6.
Run Code Online (Sandbox Code Playgroud)

CI/Tests 和 CI/Minification 的结果相同。需要做什么才能成功合并翻译文件。

javascript github jquery-select2 gruntjs

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

为什么 runBlocking 不会阻塞调用线程

我正在尝试了解 kotlin 中的 runBlocking。

 println("before runBlocking ${Thread.currentThread().name}")

    runBlocking { // but this expression blocks the main thread
        delay(2000L) // non blocking
        println("inside runBlocking ${Thread.currentThread().name}")
        delay(2000L)
    }

    println("after runBlocking ${Thread.currentThread().name}")
Run Code Online (Sandbox Code Playgroud)

输出

before runBlocking main
inside runBlocking main
after runBlocking main
Run Code Online (Sandbox Code Playgroud)

科特林说

  1. runBlocking -Runs a new coroutine并且可blocks the current thread中断直到它完成
  2. 调用 runBlocking 的主线程会阻塞,直到 runBlocking 内的协程完成。

第 1 点:-如果 runBlocking 阻塞了main上面示例中的线程。然后在 runBlocking 中我如何main再次获得线程。

第 2 点:-如果Runs a new coroutine上面的语句为真,那么为什么它没有coroutine在 …

kotlin kotlin-coroutines

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

在此方法中找不到对返回值的引用

我在这个存储库中签出了类似redux的android实现。在一个文件中,我找到了如下的方法实现:

@Override
public Dispatcher create(Store<AppState> store, Dispatcher 
nextDispatcher) {
   return action -> {
    log("dispatching action: " + action);
    nextDispatcher.dispatch(action);
    log("new state: " + store.getState());
       };
}
Run Code Online (Sandbox Code Playgroud)

我无法了解return此方法的工作原理,因为没有提到action??。还想知道如何将此方法实现转换为Kotlin,因为在这种情况下Android Studio的Kotlin转换器无济于事。感谢您的帮助。谢谢!

java android kotlin

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