小编Cod*_*oss的帖子

是否可以在OSX上以Mono或.NET从Unity C#运行R代码?

有没有办法在Mono中使用Unity的C#运行R脚本?

如果无法使用Mono运行R脚本,我愿意使用.NET

更新

因此,以下代码将调用R脚本,但如果从unity monodevelop调用则不会输出文件.将字符串返回到mono是可以的,但是在startInfo.UseShellExecute和startInfo.RedirectStandardOutput上更改true和false会引发错误.以下是将调用R代码的C#代码:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "Rscript";
startInfo.WorkingDirectory = Application.dataPath + "/myUnity/Scripts/";
startInfo.Arguments = "Rexp1.R";
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = true;
startInfo.RedirectStandardOutput = false;
process.StartInfo = startInfo;
process.Start();
Run Code Online (Sandbox Code Playgroud)

我确定R脚本会输出一个文件,或者我可以抓住stdout并保持它.我将很高兴输出到文件或具有统一允许返回的字符串是R脚本的输出.

更新2* - 这是R脚本.

sink("output.txt")
nts <- matrix(rnorm(100), nrow = 500)
ds <- dist(nts,method = "euclidean", diag = TRUE, upper=TRUE)
dm <- as.matrix(ds)  # distance matrix
print(dm)
sink()
Run Code Online (Sandbox Code Playgroud)

c# macos r monodevelop unity-game-engine

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

登录时拒绝 Docker 权限以及我尝试的所有操作

我是 docker 新手,我尝试或未找到的所有内容都被拒绝。我无法在任何 docker 容器中安装任何东西,而且似乎没有任何效果。我看过其他人,似乎没有人知道为什么每个 docker 容器都不能为我工作。下面是一个例子:

sudo docker run -it ubuntu
[sudo] password for user: 
bash: /root/.bashrc: Permission denied
root@ac9449598270:/# vi test.txt
bash: vi: command not found
root@ac9449598270:/# apt-get install vim
W: Unable to read /etc/apt/apt.conf.d/01-vendor-ubuntu - open (13: Permission denied)
W: Unable to read /etc/apt/apt.conf.d/01autoremove - open (13: Permission denied)
W: Unable to read /etc/apt/apt.conf.d/01autoremove-kernels - open (13: Permission denied)
W: Unable to read /etc/apt/apt.conf.d/70debconf - open (13: Permission denied)
W: Unable to read /etc/apt/apt.conf.d/docker-autoremove-suggests - open (13: …
Run Code Online (Sandbox Code Playgroud)

linux ubuntu docker

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

让最基本的Backgrid.js示例正常工作

我想尝试使用backgrid.js最基本的例子.换句话说,我可以将源文件夹放入我的xampp/htdocs文件夹并运行而不必执行任何其他操作的示例.

我已经尝试了很多方法来运行代码,但我无法得到任何东西.这是我试图看到一个工作示例的html页面.

<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css"/>
    <link rel="stylesheet" href="lib/backgrid.css"/>
    <script src="jquery-1.10.2.min.js"></script>
    <script src="underscore-min.js"></script>
    <script src="backbone-min.js"></script>
    <script src="lib/backgrid.js"></script>
</head>

<body>
<div id="grid">
    <script type="text/javascript">
        var Territory = Backbone.Model.extend({});

        var Territories = Backbone.Collection.extend({
            model: Territory,
            url: "territories.json"
        });

        var territories = new Territories();

        var columns = [{
            name: "id", // The key of the model attribute
            label: "ID", // The name to display in the header
            editable: false, // By default every cell in a column is editable, but …
Run Code Online (Sandbox Code Playgroud)

javascript jquery backgrid

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

标签 统计

backgrid ×1

c# ×1

docker ×1

javascript ×1

jquery ×1

linux ×1

macos ×1

monodevelop ×1

r ×1

ubuntu ×1

unity-game-engine ×1