我在本地安装了朱莉娅,把它解压到一个文件夹里。然后我尝试将可执行文件添加到/usr/local/bin中,因为我不想修改$PATH。
sudo ln -s bin/julia-1.5.3/bin/julia /usr/local/bin/julia
如果我现在在一个新的shell窗口中执行Julia,将弹出以下消息:
$ julia
zsh: command not found: julia
$ ls -l /usr/local/bin/
total 12
lrwxrwxrwx 1 root root 25 Jan 1 10:08 julia -> bin/julia-1.5.3/b
我有一个程序安装在我的pc (windows 7服务器虚拟机)上,它将数据导出到dde。出口是非常错误的,因为dde链接的一部分不工作的一部分时间,等等。
我见过一个,它建议在每次运行之前应该关闭dde链接
Application.DDETerminateAll
或
For i = 1 To 1000
Application.DDETerminate (i) ' Closes all DDE links whose channels might be open
Next i
我正在寻找解决方案,并认为也许可以通过excel 2010或windows regis
我想使用MATLAB中的for循环来解决以下DDE:
xdot(t) = Ax(t) + BKx(t-h)
其中:
A = [0 1 ; -1 0.1];
B = [0 ; 1];
h = 0.2;
K = [-0.0469 -1.7663];
t = [0 5]
用传统的方法解决这一问题是简单的,结果是可以接受的。
sol = dde23(ddefun,lags,history,tspan,options,varargin)
然而,当我试图解决它使用for循环,结果是错误的。下面是我的for循环的简单代码。
time = 0:0.001:5;
for i = 2:5001
x(:,1) =
我在Ipython中准备了一个小的演示,在这里我想展示在Julia中进行并行操作是多么的容易。
它基本上是蒙特卡洛Pi计算
问题是我不能让它在IPython (木星)笔记本中并行工作,它只使用一个。
我创办了朱莉娅:julia -p 4
如果我在REPL中定义了函数并在那里运行,它就能正常工作。
@everywhere function compute_pi(N::Int)
"""
Compute pi with a Monte Carlo simulation of N darts thrown in [-1,1]^2
Returns esti
我在堆栈溢出和Julia文档中都找不到对以下“设计问题”的答案:
假设我想定义以下对象
struct Person
birthplace::String
age::Int
end
由于Person是不变的,我很高兴没有人能够改变任何创建的Person的birthplace,尽管如此,这也意味着随着时间的推移,我也不能改变他们的age .
另一方面,如果我将Person类型定义为
mutable struct Person
birthplace::String
age::Int
end
我现在可以让它们成为age,但是我没有以前在birthplace上的安全性,任何人都可以访问它并修改它。
到目
我在朱莉娅尝试这样做的时候遇到了绑定的问题:
type Chain
value :: Int
son :: Chain
#Make the last link in the chain point to itself
#so as to spare us from the julia workaround for nulls
Chain(value::Int) = (chain = new(); chain.value = value; chain.son = chain; chain)
end
#Create three separate node
在Julia标准库中有一个Markdown模块。然而,在中并没有说明如何在这个标记中包含普通的html。例如
using Markdown
a = Markdown.parse("This is *important* text with <i>html</i> in it");
# parsed as
Markdown.Paragraph(Any["This is ", Markdown.Italic(Any["important"]), " text with <i>html</i> i
当我想在Windows上使用GLM软件包时,我遇到了问题
Rmath not properly installed. Please run Pkg.build("Rmath") and restart Julia.
但随后会发生以下错误:
Failed to precompile Rmath to ...
,然后产生错误通知。
通过确定“SecurityProtocol”的异常:"NULL不能转换为"System.Net.SecurityProtocolType“类型,因为它不是枚举值的可能值。
你知道如何解决这个问题吗?
当我在homebrew中升级软件时,我得到以下警告:
➜ ~ brew upgrade
Warning: Calling fails_with :llvm is deprecated!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/formula.rb:2373:in `fails_with'
我猜这个问题与我几周前安装的julia编程语言有关,但julia已经被删除了。我如何解决这个问题?
更新:
由➜ ~ brew list | grep julia | xargs brew remove解决的问题
当我试图在Julia中使用请求时,输出了以下错误:
julia> using Requests
INFO: Precompiling module Requests...
ERROR: LoadError: LoadError: error compiling version: could not load library "libz"
libz: cannot open shared object file: No such file or directory
while loading /home/michael/.julia/v0.4/Libz/src/lowlev
我有一些Julia代码,其中我使用readdlm函数打开了大量文件。我的代码如下所示:
for file in large_list_of_files
open(file) do filehandle
data = readdlm(filehandle)
end
#Do some data processing and store results
end
当我运行这个命令时,我得到了这个错误:
LoadError: SystemError: opening file <filename>: Too many open files
while
我试图用Octave和Julia求解一个具有大平方系统矩阵的随机线性系统。由于Octave和Julia的语法非常相似,所以我在Octave shell和Julia shell中运行以下代码:
N = 5000;
A = rand(N, N);
b = rand(N, 1);
x = A\b;
r = norm(A*x - b)/norm(b)
八度在1e-12附近返回r。另一方面,朱莉娅返回一个错误:
ERROR: stack overflow
in getrf! at linalg/lapack.jl:342
in LU at linalg/factorization.jl:134
i
我想从我的python代码中调用一个julia脚本。pyjulia没有问题,但是如果我把它设计成一个类,就会有一个问题。我想初始化julia并在init函数中包含一个脚本。下面的例子是,我不能在函数中使用self.jul。它引发一个错误,因为self.jul没有函数"myJulFuntion“。我确信它在朱莉娅脚本中,因为如果我把东西从init移到callJulFunc并调用jl.myJulFuntion(params),它就能工作。
有什么想法吗?
问题是,
import julia
julia.Julia()
from julia import Main as jl
class
我正在尝试编写一个接受参数的函数,该参数可以是元组或数组。例如,这是可行的:
julia> temp(x::Union{Vector{Int64},NTuple{4,Int64}}) = sum(x)
temp (generic function with 1 method)
julia> temp((3,1,5,4))
13
julia> temp([3,1,5,4])
13
另一方面,当我尝试使用未指定长度的元组时,它对数组失败:
julia> temp(x::Union{Vector{Int64},NTuple{N,Int64}}) where N = sum
自从我从0.6版开始向Julia v0.7过渡以来,我经常看到这个问题。我收到以下警告:
Warning: Package xxxxx does not have POMDPSimulators in its dependencies:
│ - If you have xxxxx checked out for development and have
│ added POMDPSimulators as a dependency but haven't updated your primary
│ environment's manifest file, try `