Hi the goto needs to be defined within a function. The following works as
intended
julia> function test()
h=-1
@label p
h+=1
if h<3
@goto p
end
println("Done")
end
test (generic function with 1 method)
julia> test()
Done
You could try to run Julia with the `--inline=no` flag to see if you get more
debug information.
Hi
I am trying to open a process that should outlive the parrent process.
According to the documentation the detach function should enable this. But if i
run:
julia>p=spawn(detach(`julia -e "using IJulia; IJulia.notebook()"`))
It starts a notebook server but when i close the Julia terminal
Hi Xavier Gandibleux
The problem is you are using a very old version of Julia (0.2.1 released in
2014-02-11). In Julia terms this version is ancient. I presume you installed
Julia by apt-get. The easiest way to get the latest stable release is to go to
http://julialang.org/downloads/ and
Yes it does, it uses type inference to determine the return type of a function
call. This way the determination of the argument type is effect free. You could
maybe hook your package into the logic in REPLCompletion.jl in base.
Thank you for the fix Tom. I have made a PR to master to fix this see,
https://github.com/JuliaLang/julia/pull/14018. I have started a new repository
for build_executable to fix it and keep it up to date. It would be nice if you
could verify that the branch in
This has also been seen https://github.com/stevengj/PyCall.jl/issues/209
which is actually an upstream problem with the Continuum Analytics conda
package manager,
see https://github.com/conda/conda/issues/1753#issuecomment-153550914. I
can fix it locally by:
using Conda
Hi
Select the block then press Esc and then hit l-key. You can see all
shortcuts under Help/Keyboard Shortcuts
Den tirsdag den 3. november 2015 kl. 10.09.50 UTC+1 skrev 2n:
>
>
>
> Is there a way to display line numbers in the code cells in Jupyter
> notebooks?
>
Hello everyone
I found https://github.com/ipython-contrib/IPython-notebook-extensions,
which allows you to install some very useful extensions for the Jupyter
notebook. One of the extension allows for copy pasting cells across
notebooks and picture into a notebook. I thought I would share the
You can use Julia's type inference as:
Base.return_types(max,(Int, Float64))
But remember if the function contains any global non-constant variables the
function will most likely return any.
You can build an binary executable with this script:
https://github.com/JuliaLang/julia/blob/master/contrib/build_executable.jl. It
compiles the scripts main function into Julia's sysimg. I have used it myself
to distribute a small program.
Hi I hope someone could help me to understand why my code errors. I am trying
to wrap this http://pcre.org/current/doc/html/pcre2_substitute.html function
from the pcre2 library. I am working on latest master as it comes with pcre2.
My wrap look like:
function my_replace(s::AbstractString,
Awesome thank you so much, I had missed that the last argument should be a
pointer to the length and not the length. The working version is:
function my_replace(s::AbstractString, pat::Regex, rep_in)
offset=0
Base.compile(pat)
subject = bytestring(s)
rep = bytestring(rep_in)
Have you tried to restart the REPL, because I see no problems in running:
function fib_sum_2(x,y,z)
sum(x:x:z) + sum(y:y:z) - sum(lcm(x,y):lcm(x,y):z)
end
julia fib_sum_2(3,5,999)
233168
In 0.4 you can use this script:
https://github.com/JuliaLang/julia/blob/master/contrib/build_executable.jl. It
compiles the functions in the script to the sysimg and makes an exe file that
calls a main function.
https://github.com/davidanthoff/ExcelReaders.jl is a wraps of the xlrd Python
package.
If I add 'PyCall.pyinitialize()' after the 'require(PyCall)' then I get the
following error.
```
error during bootstrap: LoadError(at sysimg.jl line 286: LoadError(at
C:\Users\Hoegh\Julia-0.3.7_test\share\julia\base\userimg.
jl line 2: ErrorException(could not load module python: The specified
I thought I would share my success with all of you. By making a userimg.jl
in the julia folder containing the following and building the sysimg with
the command bellow, the load time of of PyPlot's can be reduced by a factor
of 3.
julia -e tic(); using PyPlot; toc()
INFO: Loading help data...
To complile it in sysimg you need to use the script in:
https://github.com/JuliaLang/julia/blob/master/contrib/build_executable.jl I
have only used it for building a small application.
Thank you Big Stone, I removed 0.3.7, Ipython, .julia/0.3 and the .ipython
folder in my home folder and the installed from fresh and it works:)
I installed 0.3.7 removed 0.3.6 and did a Pkg.build(IJulia) in 0.3.7
Unfortunately upgrading to 0.3.7 do not solve the problem on my computer:(
I know https://github.com/kbarbary/Dierckx.jl can interpolate unstructured data
into a grid.
This is also discussed here: https://github.com/stevengj/PyCall.jl/issues/113
If you by graphics in iJulia mean the plot opens in its own window, like in
matlab/python. If you execute `pygui(true)` and then plot something then the
plot will open in a window.
You can do it with an array comprehension like: [ for i=1:5]
I have cooked up a minimum test case of you code that displays the problem. If
you have the following
function test1(f, n)
for i=1:n
f(i)
end
end
function test2(n)
for i=1:n
g(i)
end
end
function test3(f, n)
for i=1:n
invoke(f, (Int,), i)
end
end
I should probably be mentioned in
http://docs.julialang.org/en/latest/manual/performance-tips/. It's also the
reason for:
f(i) = i
@time map(f, rand(1))
@time [f(i) for i in rand(1)]
where map is very slow compared to the array comprehension.
I have made a pull-request on it. See
https://github.com/JuliaLang/julia/pull/9699
You can serialize it see
https://groups.google.com/forum/m/?fromgroups#!topic/julia-users/zN7OmKwnG40
But when I try to deserialize I get an error. Do I do something wrong?
I have tried both MAT and HDF5 and they do not seem to have a convenient way of
saving my data structure. I hope some of you guys can help, thanks in advance.
Best regards Daniel Høegh
Yes it works when I remove the 0.4 syntax:)
But when you put using PyPlot in the top it does not work:( It's the
convertalypse. at https://github.com/JuliaLang/julia/issues/8631
Thanks Tim it works.
I really hope someone catch the root of the convertalypse soon:)
It has been discussed in:https://github.com/JuliaLang/julia/pull/9170
I have found a good notebook in https://gist.github.com/gizmaa/7214002
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_)| Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type help() for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.3 (2014-11-23 20:19 UTC)
_/
You need keys and value, they return iterators so call collect on them return a
vector
a=[a=1, b=2]
collect(keys(a))
collect(values(a))
Just restart the terminal.
I think Julia would benefit from having a MIT licensed scientific IDE written
in Julia similar to the Spyder project in python. But in short term we maybe
could leverage the Spyder project, I have hacked a crude implementation of a
Julia terminal into the Spyder enviroment using the existing
I think Julia would benefit from having a MIT licensed scientific IDE written
in Julia similar to the Spyder project in python. But in short term we maybe
could leverage the Spyder project, I have hacked a crude implementation of a
Julia terminal into the Spyder enviroment using the existing
Spyder is a Matlab like IDE with variableexplore, syntax checker, linter,
debugger and profiler. It's ships with many Python distribution that focus on
scientific use including WinPython PythonXY and Anaconda. I miss many of the
features/helpful tools in an IDE. I am sure they will come to
Hi Uwe
It's my pull-request but I have not worked on it for a while.
Here is my solution, there is one problem that i do not understand and hope
another can explain. When col=20 W is filled with NaN + NaN*im but for col=10
it work like matlab, I think it is because of overflow.
using PyPlot
col = 10;
m = 400;
cx = -.6;
cy = 0;
l = 1.5;
x = linspace(cx-l,cx +
This works:
ax = fig[:add_subplot](2,1,1, projection = 3d)
xgrid = repmat(x',n,1)
ygrid = repmat(y,1,n)
ax[:plot_surface](xgrid, ygrid, z, rstride=2,edgecolors=k, cstride=2,
cmap=ColorMap(gray), alpha=0.8, linewidth=0.25)
xlabel(X)
ylabel(Y)
subplot(212)
ax = fig[:add_subplot](2,1,2)
cp =
By wrapping it in a function as:
function test()
tic()
n = 1
x = 0.234
for i = 1:n
x = max(x*x, 1.0-x*x)
end
println(x)
print(Done.)
toc()
end
test() #jit compilation occurs
test() # timing 0.284217675 s
On my machine the original took 26.96566
I had a problem about this some time ago and I abandoned it because I could not
get it working and then this discussion actually helped solving the problem
today.
I have opened an issue on it on Github see
https://github.com/JuliaLang/julia/issues/9022
I think the reason why it is slow is due to indexing is making a copy of your
data and not passed by reference as in python. This behavior is going to change
in 0.4 where subarrays is introduced then the data is not copied.
You could try it by.
@time v=mat[:,1]; w=mat[:,2]
This should take long
I have made a minimum test case:
a=rand(1,2)
function newsum(a)
for i in 1:100
sum(a[:,1])+sum(a[:,2])
end
end
function newsum(a1,a2)
for i in 1:100
sum(a1)+sum(a2)
end
end
@time newsum(a)
@time newsum(a[:,1],a[:,2])
elapsed time: 0.073095574 seconds (17709844
When you use labels they should be escaped properly:
xlabel(\$\\sigma\$ [MPa])
or
xlabel(L$\sigma$ [MPa])
Hi is there a way to concatenate turple of strings that if the last string
is a space that does not remove it?
join((1, ))==1
, Daniel Høegh dhoe...@gmail.com
javascript: wrote:
Hi is there a way to concatenate turple of strings that if the last
string is a space that does not remove it?
join((1, ))==1
You just need to make sure the ticks you would like is within the range:
using PyPlot
data = pi*rand(10, 10)
imshow(data,vmin=0, vmax=pi)
cbar = colorbar(ticks=[0, pi])
I just did the exact same as the example then i got it working and then changed
it to you example.
using PyPlot
fig, ax = subplots()
data = pi*rand(10, 10)
cax = ax[:imshow](data,vmin=0, vmax=pi)
cbar = fig[:colorbar](cax, ticks=[0, pi])
cbar[:ax][:set_yticklabels]([ 0, \$\\pi\$])
It is probably due to this merged pull-request.
https://github.com/JuliaLang/julia/pull/8521
When you are using 0.4 you should not expect that packages is working.
I think if you update to a new nightly it will work because the library has
changed to conform to the pull-request.
I know it's slow but is it considered dangerous then please enlighten me. Can
it not be acceptable to some extend to sacrifice speed to simplicity, people
will do this trick or maybe worse things.
I have updated Julia to 0.3.1 to get rid of the error regarding profiling. When
I tried to install IJulia
I encountered an error see the log. I think it is an error in BinDeps but I am
not sure, can anybody help me?
```
julia Pkg.add(IJulia)
INFO: Cloning cache of BinDeps from
My versioninfo is:
julia versioninfo()
Julia Version 0.3.1
Commit c03f413* (2014-09-21 21:30 UTC)
Platform Info:
System: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK:
This is a known issue on windows it is fixed on the master and is coming as in
0.3.1. See issue https://github.com/JuliaLang/julia/issues/8350
I have the exact same problem with LibCURL. I am running Julia 0.3 on
Windows.
Den onsdag den 3. september 2014 21.21.04 UTC+2 skrev Kevin W Li:
This happened when I Pkg.add(IJulia) from a new Julia 0.3:
julia Pkg.add(IJulia)
INFO: Installing IJulia v0.1.15
INFO: Installing JSON v0.3.7
Thanks Jacob:)
Hi julia-users,
This is a Windows specific question,
I would like to excute the following:
run(`start /min Ipython`)
It should open a program in minimized state and the proces does not hang
until the program closes. But I get this error:
could not spawn `start /min Ipython`: no such file or
It just feel very unintuitive from a user perspective that it doesn't work as
in Python, prompt and other programs. Do you then know how to circumvent that
start doesn't exist / how to get the same effects?
63 matches
Mail list logo