小编Toi*_*wén的帖子

创建 conda 环境:“发现冲突!” 当解决环境和“寻找最短冲突路径”永远运行时

我得到了一个environment.ubuntu.yml能够创建 conda 环境的文件。但是,运行conda create env --file environment.ubuntu.yml我得到以下输出:

conda env create --file environment.ubuntu.yml
Collecting package metadata (repodata.json): done
Solving environment: - 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
Examining fontconfig:   5%|?                 | 10/202 [00:00<00:00, 5393.91it/ ]
Comparing specs that have this dependency:   0%|         | 0/12 [00:00<?, ?it/s]
Finding shortest confli|  path for fontconfig==2.13.1=he4413a7_1000:  12%|?| 1/8
Finding shortest conflict path for fontconfig==2.13.1=he4413a7_1000:  25%|?| 2/8
Finding shortest conflict pa/  for fontconfig[version='>=2.13.0,<3.0a0']: …
Run Code Online (Sandbox Code Playgroud)

python environment ubuntu dependencies conda

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

使用 .natvis 文件在 VS Code 中可视化 C++ 对象

根据此链接,.natvis 文件可用于可视化本机对象。具体来说,我希望能够Eigen::Matrix使用这个 .natvis 文件检查对象。

但是,上面的链接不包含有关如何在 VS Code 中实际使用 .natvis 文件的任何信息。是否可以使用自定义 .natvis 文件?

这是我的 launch.json 文件以供参考:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++-8 build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb", …
Run Code Online (Sandbox Code Playgroud)

c++ ubuntu g++ natvis visual-studio-code

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

使用 Visual Studio Code 进行调试并将管道终端输出到文件

我正在使用 VS Code 在 Ubuntu 上调试应用程序,使用 launch.json 文件和 cmake 来构建和调试。这工作正常,我可以按预期在终端中看到程序的输出。但是,我想自动将此输出保存到文件中。我执行此操作的方式通常类似于mycommand > terminal_output.txt,但是我找不到使用 launch.json 文件复制此操作的方法,或者通过终端运行调试的方法(例如类似于 的方式debug --flags launch.json > terminal_output.txt)。

这是我的launch.json供参考:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "g++-8 build and debug active file",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}/${fileBasenameNoExtension}",
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "g++-8 build active file",
            "miDebuggerPath": "/usr/bin/gdb"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

有没有一种方法可以简单地做到这一点?

terminal cmake visual-studio-code vscode-debugger

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

防止 vscode-jest-tests 打开新终端

我正在使用 vscode-jest 和“调试”代码镜头来运行单独的测试。然而,当运行这样的测试时,它每次都会生成一个新的终端。如何通过修改 launch.json 文件中的启动配置来防止这种情况?

作为参考,这是我的 launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "name": "vscode-jest-tests",
            "request": "launch",
            "args": [
                "--runInBand"
            ],
            "cwd": "${workspaceFolder}/data-utils/",
            "console": "integratedTerminal",
            "internalConsoleOptions": "neverOpen",
            "disableOptimisticBPs": true,
            "program": "${workspaceFolder}/data-utils/node_modules/jest/bin/jest"
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

jestjs visual-studio-code vscode-debugger

5
推荐指数
0
解决办法
854
查看次数

在 Sublime Text 3 中隐藏一行

我的 html 文件中有一行包含图像的 Base64 表示形式。该行在编辑器中跨越了数千行,当总是滚动经过它时,这是一个巨大的麻烦。

ST3中有隐藏这条线的好方法吗?

html sublimetext3

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

创建一个cmd窗口并从C#应用程序写入它

我正在为Rhino的Grasshopper开发一个C#组件.当我运行一些非常繁重的迭代分析时,我想将结果连续输出到cmd窗口,以确保分析实际上正在运行.

这是我试过的:

using System.Diagnostics;


Result results = new Result();
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = false;
cmd.StartInfo.UseShellExecute = false;
cmd.Start();

do {
    results = RunHeavyOperation(results);
    cmd.StandardInput.WriteLine("echo " + results.usefulInfo);
} while (!results.conditionForEnd);

cmd.WaitForExit();

Result RunHeavyOperation(Result previousResults) {
    Result res = doHeavyStuff(previousResults);
    return res;
}
Run Code Online (Sandbox Code Playgroud)

我意识到我错过了一部分,但它是什么?

c# stdin cmd stdout

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

致命错误 C1001:编译器发生内部错误。'f:\dd\vctools\compiler\cxxfe\sl\p1\c\p0io.c'

在 Visual Studio 2013 中构建 C++ 解决方案时,出现此错误:

fatal error C1001: An internal error has occurred in the compiler. (compiler file: 'f:\dd\vctools\compiler\cxxfe\sl\p1\c\p0io.c')
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

c++ compiler-errors visual-studio-2013

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

跳过数组的每第 n 个元素

如何从 julia 数组中删除每个第 n 个元素?假设我有以下数组:a = [1 2 3 4 5 6]并且我想要b = [1 2 4 5]

在 javascript 中我会做类似的事情:

b = a.filter(e => e % 3);
Run Code Online (Sandbox Code Playgroud)

在 Julia 中如何做到这一点?

arrays julia

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

根据条件设置多个常量值

我想根据条件设置多个值。这段代码可以工作:

let a;
let b;

if (fooBar) {
  a = "foo";
  b = "bar";
} else {
  a = "baz";
  b = "Hello world!";
}
Run Code Online (Sandbox Code Playgroud)

但我试图坚持 FP(不可变变量)和 DRY 原则。

对于一个变量,我会这样做:

const a = fooBar
  ? "foo"
  : "baz";
Run Code Online (Sandbox Code Playgroud)

我可以以某种方式设置多个变量吗?

javascript functional-programming dry immutability ecmascript-6

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