小编shm*_*111的帖子

IntelliJ中的zsh

我想在IntelliJ中运行一个zsh终端,我设置了一个外部工具,它只是zsh并将工作目录设置为我的主目录.当我运行时,它会立即出现2个问题:

  1. 我的.zprofile尚未加载
  2. Tab没有自动完成任何事情

有谁知道我是否可以让IntelliS在IntelliJ中运行良好?

bash shell zsh intellij-idea

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

Intellij:更改JUnit测试类模板

我想自定义JUnit Test类模板,但是我无法在设置中找到它. 这家伙也有同样的问题.我在文件模板或实时模板中找不到任何内容.我正在使用Intellij 11.

junit templates intellij-idea

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

我找不到一张轻便的桌子作弊表

有没有人有LightTable的备忘单,甚至更好的paredit插件,似乎我的google-fu不能找到一个?

clojure paredit lighttable

15
推荐指数
3
解决办法
4557
查看次数

测试angularjs ui-router go()方法

我有一个控制器从中获取值$scope并将其发送到不同的状态:

controllers.controller('SearchController', ['$scope', '$state', '$stateParams',
function($scope, $state, $stateParams) {
    $scope.search = function() {
        $stateParams.query = $scope.keyword;
        $state.go('search', $stateParams);
    };
}]);
Run Code Online (Sandbox Code Playgroud)

我不确定如何对这种搜索方法进行单元测试.我怎样才能验证是否已调用go方法或when($state.go('search', $stateParams)).then(called = true);使用Karma/AngularJS进行某种操作?

javascript testing angularjs karma-runner angular-ui-router

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

在Spring Java配置中引用$ {user.home}

在xml配置中,我可以执行以下操作:

<context:property-placeholder
        location="file:${user.home}/.config}/api.properties"
        ignore-resource-not-found="true"
        system-properties-mode="OVERRIDE"/>
Run Code Online (Sandbox Code Playgroud)

在java配置中,我将执行以下操作:

/**
 * @return a {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer} so that placeholders are correctly populated
 * @throws Exception exception if the file is not found or cannot be opened or read
 */
@Bean
public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() throws Exception {
    PropertySourcesPlaceholderConfigurer propConfig = new PropertySourcesPlaceholderConfigurer();
    Resource[] resources = new UrlResource[]
            {new UrlResource("file:${user.home}/.config/api.properties")};
    propConfig.setLocations(resources);
    propConfig.setIgnoreResourceNotFound(true);
    propConfig.setIgnoreUnresolvablePlaceholders(true);
    return propConfig;
}
Run Code Online (Sandbox Code Playgroud)

但是这不理解$ {user.home}

java configuration spring

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

clojure assoc-if和assoc-if-new

我想在地图中添加一个条目,但前提是地图不包含我想要添加的密钥.即我想要插入但不更新.为了他,我创造了2个功能:

(defn assoc-if [pred coll k v]
  (if pred (assoc coll k v) coll))

(defn assoc-if-new [coll k v]
  (assoc-if (not (contains? coll k)) coll k v))
Run Code Online (Sandbox Code Playgroud)

我的问题是,这两个功能已不存在吗?

另外,我对Clojure很新,有关实现的任何提示吗?

clojure

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

git stash,jenkins pipeline,没有使用存储库的git工作

我正在尝试使用存储webhook到jenkins插件设置从Atlassian Stash触发jenkins multibranch管道.我的项目配置有定期设置为@daily,定期如果没有设置为1天我已索引我的分支但是当我点击隐藏webhook配置上的'触发詹金斯'按钮时,我得到以下错误

Error: Jenkins response: No git jobs using repository
Run Code Online (Sandbox Code Playgroud)

我之前已经读到这可能是因为在项目上禁用了轮询,但是没有设置在顶层启用它.我已经尝试在主分支Jenkinsfile中启用它,但是当我为主作业"查看配置"时它没有显示为已检查.我也可以在Jenkins日志中看到:

no trigger, or post-commit hooks disabled, on my-repo » master
Run Code Online (Sandbox Code Playgroud)

我找不到任何其他方法让这个工作?

git jenkins bitbucket-server jenkins-pipeline

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

eshell搜索历史

我正在使用emacs eshell,并希望通过我的命令历史回顾.在bash中你会做Cr然后键入一些东西然后反复按Cr直到找到你想要的命令.在eshell上,似乎我必须键入Mr然后键入命令的一部分并按Enter键然后键入Mr并再次输入以获得下一个匹配,依此类推.这意味着我必须一次又一次地继续{进入}先生{进入}先生{进入}而不是一次又一次地按Cr而不用移动我的手,是否有更好的方法?eshell上没有太多信息.

emacs search history eshell

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

在Ratpack Groovy中解析json

我在Groovy控制台中启动了一个小型的ratpack应用程序,但我无法从文档中找到如何获取已在请求中发送的json数据.

@Grab("io.ratpack:ratpack-groovy:0.9.4")
import static ratpack.groovy.Groovy.*
import groovy.json.JsonSlurper

ratpack {
  handlers {
    get {
      def slurper = new JsonSlurper()
      def result = slurper.parseText('{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}')
      render "Hello world! ${result.person}"
    }
    post("foo") {
      def slurper = new JsonSlurper()
      def result = slurper.parseText("WHAT DO i PUT HERE?")
      render "Hello world! ${result.person}"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

一个示例请求:

curl -XPOST -H "Content-Type: application/json" -d '{"person":{"name":"Guillaume","age":33,"pets":["dog","cat"]}}' localhost:5050/foo
Run Code Online (Sandbox Code Playgroud)

groovy json ratpack

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

F#NLog配置文件

我正在尝试在F#控制台应用程序中使用NLog,我已经设法使用App.config中的配置部分使其工作但是我无法使用独立的NLog.config文件使其工作.我的NLog.config文件位于app路径中,就在App.config下,内容为:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
    <targets>
        <target name="stdFile" xsi:type="File" fileName="c:/temp/compliant.log"/>
        <target name="display" xsi:type="OutputDebugString"/>
    </targets>
    <rules>
        <logger name="compliant.mail.*" minlevel="Debug" writeTo="stdFile,display" />
    </rules>
</nlog>
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

此外,即使我已经包含xsd,intellisense也不适用于xml.:(

f# xsd config nlog

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