小编Sof*_*mur的帖子

无法在子模块路径中找到当前的源/主版本

在我的项目(使用git)中,我需要使用一个仍在进行中的库.我决定为该库创建一个子模块,因为我想不时更新它的最新版本(我不打算在那里进行自己的更改).

我做了:

git submodule add https://github.com/mb21/JSONedit.git
git commit -am 'added JSNedit submodule'
git push -u origin master
git pull origin master
Run Code Online (Sandbox Code Playgroud)

然后,我确实在我的本地文件夹中看到了JSONedit文件夹,并在我的git文件夹中看到了一个链接.但是当我这样做时git submodule update --remote JSONedit/,我得到了以下错误:

fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'JSONedit'
Run Code Online (Sandbox Code Playgroud)

有谁知道这里有什么问题吗?

git git-submodules

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

Docusaurus 是否可以支持访客评论?

我正在使用Docusaurus 2构建一个网站。

我的网站将包含文档和博客。我想知道是否可以让访客在文章下面发表评论?

我想,如果我们支持评论,我们也需要网站的身份验证系统。

如果原生 Docusaurus 不支持此功能,是否有任何插件可以做到这一点?

docusaurus

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

如何逐步调试/执行Ocaml程序?

我想知道是否可以逐步调试/执行Ocaml程序,例如在Visual Studio中调试C++程序.换句话说,我想逐行运行Ocaml程序,如果我们可以"观察"某些变量的值,那也很好.

顺便说一句,我使用Emacs作为编辑器.

有人可以帮忙吗?非常感谢你

编辑-1:正如sepp2k建议的那样,我试图在Emacs下运行camldebug.我在开始时遇到问题:网页提到"Caml调试器是在命令下在Emacs下启动的M-x camldebug,参数是progname要调试的可执行文件的名称." 其实我只有3个选择:

M-x camldebug
M-x camldebug-mode
M-x camldebug-step
Run Code Online (Sandbox Code Playgroud)

编辑-2:当我输入时M-x camldebug,输入,它显示Symbol's value as variable is void: caml-mode-map哪些不允许我输入可执行文件.

有人可以帮忙吗?谢谢!

debugging emacs ocaml

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

简单的方法来定义函数(Emacs,Ocaml)

我在Emacs下编码Ocaml ...

我想知道是否有跳转到函数定义的快捷方式(光标所在的位置).目前,这样做我在整个文件搜索功能的名称,或查找let the_name_of_the_functionlet rec the_name_of_the_functionand the_name_of_the_function这显然是乏味...

顺便说一下,我还有文件.annot.

有人可以帮忙吗?谢谢!

emacs ocaml keyboard-shortcuts

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

如何将字符串附加到OCaml中的字符串?

似乎在类型的标准库中没有函数char -> string -> string,它在a char的前面(或者在a的末尾插入)string.有解决方法,例如使用String.makeString.blit.有一种优雅的方式来做到这一点?

string ocaml char

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

两个记录中的两个字段在OCaml中具有相同的标签

我定义了两种记录类型:

type name =
    { r0: int; r1: int; c0: int; c1: int;
      typ: dtype;
      uid: uid (* key *) }

and func =
    { name: string;
      typ: dtype;
      params: var list;
      body: block }
Run Code Online (Sandbox Code Playgroud)

我稍后遇到一行代码错误: Error: The record field label typ belongs to the type Syntax.func but is mixed here with labels of type Syntax.name

任何人都可以告诉我,如果我们不应该有两个记录具有相同标签的两个字段,就像typ这里一样,这会使编译器混淆.

ocaml types record

9
推荐指数
2
解决办法
1872
查看次数

如何跟踪OCaml中的调试程序?

我有一个关于编码实践的一般问题......

在调试时,在我的代码的某些时候,我需要一些代码来打印当前状态; 当我不调试时,我不想将代码保留在那里,因为它阻碍了其他代码的可见性......

很难将它们打包成一个函数,因为大多数时候,它涉及局部变量,我不想将所有内容作为参数传递...

那么你如何管理这种"打印/检查"代码呢?有什么好的做法吗?

debugging ocaml coding-style

9
推荐指数
2
解决办法
1143
查看次数

svn:'https:// ...'的选项:无法连接到服务器

在工作中,我试图svn checkout https://...在终端中做一个,我得到了错误:svn: OPTIONS of 'https://...': could not connect to server (https://...)

我可以https://...在我的Internet Explorer中打开地址,输入登录名和密码后,我可以看到其中的文件.

总是在我的Internet Explorer中,我目前的代理设置是None.

以前,为了让svn在家工作,人们已经在我的文件中插入了以下行 /etc/subversion/servers:

[global]
http-proxy-host = kuzh.xxx.fr
http-proxy-port = 8080
Run Code Online (Sandbox Code Playgroud)

在这种情况下,有谁知道如何解决这个... could not connect to server ...错误?

Edit1目前我在家里尝试相同的命令,它的工作原理.因此,我认为@JN是正确的...我应该做的http-proxy-hosthttp-proxy-port[group]使得它考虑到我在家里,只有当,当我在其他地方没有考虑?

现在,问题是如何指定[group]in /etc/subversion/servers以便它知道我在家里......

svn ubuntu https proxy svn-checkout

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

发送$ http.get两次

编辑1:伙计们,我注意到我在我的身份验证工厂中调用$ http.get('/ posts')(出于特殊目的).抱歉这个愚蠢的问题.当赏金结束时我会删除它.

我有以下代码来加载页面https://localhost:3000/#/home,该页面从数据库中获取所有帖子并显示它们.

问题是,我意识到日志router.get /posts被打印了两次,而herethere只警告一次.

有谁知道这是否意味着$http.get进行了两次?如果是这样,问题出在哪里?

app.config(... ...) {
    $stateProvider
        .state('global', {
            templateUrl: '/htmls/global.html',
            controller: 'GlobalCtrl'
        })
        .state('global.home', {
            url: '/home',
            templateUrl: '/htmls/home.html',
            controller: 'MainCtrl',
            resolve: {
                postPromise: ['posts', function (posts) {
                    return posts.getAll();
                }]
            }
        });
}]);

app.factory('posts', ['$http', 'auth', function ($http, auth) {
    var o = { posts: [] };

    o.getAll = function () {
        alert("before");
        return $http.get('/posts').then(function (res) {
            alert("after");
            angular.copy(res.data, o.posts);
        })
    }
    ... ... …
Run Code Online (Sandbox Code Playgroud)

node.js express angularjs angularjs-factory angular-http

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

让Monaco Editor填充页面的其余部分(跨浏览器)

我想在一些固定文本下的页面中嵌入一个摩纳哥编辑器,我希望Monaco编辑器的高度完全填充页面的其余部分.人们给了我一个答案在这里:JSBin:

<html>
    <style>
        html, body, .rb {
            margin: 0;
            height: 100%;
        }

        .rb {
            display: table;
            width: 100%;
            border-collapse: collapse;
        }

        .top, .myME {
            display: table-row;
        }

        .buffer {
            display: table-cell;
        }

        .top .buffer {
            background: lightblue;
            height:1%;
        }

        .myME .buffer {
            background: tomato;
        }

        #container {
            position:relative;
        }

        #container > * {
            overflow:auto;
            max-width:100%;
            max-height:100%;
        }
    </style>
    <body>
        <div class="rb">
            <div class="top">
                <div class="buffer">
                1<br/>2<br/>3<br/>4<br/>
                </div>
            </div>
            <div class="myME">
                <div class="buffer" id="container">
                </div>
            </div>
        </div> …
Run Code Online (Sandbox Code Playgroud)

css height cross-browser display monaco-editor

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