[julia-users] Goto code

2016-07-31 Thread Daniel Høegh
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

[julia-users] Re: Error precompiling on Windows 64 (julia 0.4.0 and 0.4.6)

2016-07-22 Thread Daniel Høegh
You could try to run Julia with the `--inline=no` flag to see if you get more debug information.

[julia-users] spawn detach process windows

2016-03-13 Thread Daniel Høegh
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

Re: [julia-users] Error with PyPlot

2016-03-13 Thread Daniel Høegh
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

Re: [julia-users] ANN CustomREPLComepletions - custom string completions in function arguments (HDF5, NetCDF...)

2016-02-18 Thread Daniel Høegh
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.

[julia-users] Re: build_executable.jl fails in OSX yosemite

2015-11-16 Thread Daniel Høegh
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

[julia-users] Re: PyPlot not working on 0.4.0

2015-11-05 Thread Daniel Høegh
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

[julia-users] Re: line numbers in Jupyter

2015-11-03 Thread Daniel Høegh
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? >

[julia-users] Jupyter notebook extensions

2015-10-19 Thread Daniel Høegh
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

[julia-users] Runtime inference of a function's return type

2015-06-23 Thread Daniel Høegh
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.

[julia-users] Re: How to deploy Julia

2015-06-14 Thread Daniel Høegh
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.

[julia-users] Help to ccall

2015-06-03 Thread Daniel Høegh
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,

Re: [julia-users] Help to ccall

2015-06-03 Thread Daniel Høegh
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)

[julia-users] Error: expected Function, got Int64

2015-05-18 Thread Daniel Høegh
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

[julia-users] Re: .jl to .exe

2015-04-20 Thread Daniel Høegh
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.

[julia-users] Re: julia to excel using libxl

2015-04-15 Thread Daniel Høegh
https://github.com/davidanthoff/ExcelReaders.jl is a wraps of the xlrd Python package.

[julia-users] Re: Precompilation of PyCall and Color reduce PyPlot load time.

2015-04-11 Thread Daniel Høegh
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

[julia-users] Precompilation of PyCall and Color reduce PyPlot load time.

2015-04-09 Thread Daniel Høegh
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...

Re: [julia-users] Re: GPU-ODE

2015-04-04 Thread Daniel Høegh
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.

[julia-users] Re: debugging Kernel died in IJulia

2015-03-29 Thread Daniel Høegh
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:)

[julia-users] Re: debugging Kernel died in IJulia

2015-03-29 Thread Daniel Høegh
I installed 0.3.7 removed 0.3.6 and did a Pkg.build(IJulia) in 0.3.7

[julia-users] Re: debugging Kernel died in IJulia

2015-03-27 Thread Daniel Høegh
Unfortunately upgrading to 0.3.7 do not solve the problem on my computer:(

Re: [julia-users] Interpolation based on sorted but a priori unknown grid (code review?)

2015-03-23 Thread Daniel Høegh
I know https://github.com/kbarbary/Dierckx.jl can interpolate unstructured data into a grid.

[julia-users] Startup slow time when built with userimg.jl

2015-02-08 Thread Daniel Høegh
This is also discussed here: https://github.com/stevengj/PyCall.jl/issues/113

[julia-users] Re: module PyPlot won't initialize on julia 0.3.5

2015-01-25 Thread Daniel Høegh
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.

[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread Daniel Høegh
You can do it with an array comprehension like: [ for i=1:5]

[julia-users] Speed of Julia when a function is passed as an argument, and a different, but much faster coding.

2015-01-11 Thread Daniel Høegh
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

Re: [julia-users] Speed of Julia when a function is passed as an argument, and a different, but much faster coding.

2015-01-11 Thread Daniel Høegh
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.

Re: [julia-users] Installing packages system-wide

2015-01-09 Thread Daniel Høegh
I have made a pull-request on it. See https://github.com/JuliaLang/julia/pull/9699

[julia-users] How save Dict{Any,Int64} ?

2014-12-11 Thread Daniel Høegh
You can serialize it see https://groups.google.com/forum/m/?fromgroups#!topic/julia-users/zN7OmKwnG40

[julia-users] serialize a dictionary gives an error

2014-12-10 Thread Daniel Høegh
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

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread 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

Re: [julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Daniel Høegh
Thanks Tim it works. I really hope someone catch the root of the convertalypse soon:)

[julia-users] QRPackedQ not properly transposed

2014-12-03 Thread Daniel Høegh
It has been discussed in:https://github.com/JuliaLang/julia/pull/9170

[julia-users] Re: Plot3D with Julia + PyPlot

2014-12-03 Thread Daniel Høegh
I have found a good notebook in https://gist.github.com/gizmaa/7214002

Re: [julia-users] Re: Simple Finite Difference Methods

2014-12-03 Thread Daniel Høegh
_ _ _ _(_)_ | 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) _/

[julia-users] How to remove from Dict separately 1st and 2nd column?

2014-11-30 Thread Daniel Høegh
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))

[julia-users] removing function completely?

2014-11-29 Thread Daniel Høegh
Just restart the terminal.

[julia-users] Re: Julia and Microsoft Visual Studio

2014-11-28 Thread Daniel Høegh
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

[julia-users] Re: Julia and Microsoft Visual Studio

2014-11-28 Thread Daniel Høegh
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

[julia-users] Re: Julia and Microsoft Visual Studio

2014-11-28 Thread Daniel Høegh
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

[julia-users] Re: Julia and Microsoft Visual Studio

2014-11-28 Thread Daniel Høegh
Hi Uwe It's my pull-request but I have not worked on it for a while.

[julia-users] Re: Meshgrid in Julia: a working example and possible alternatives

2014-11-25 Thread Daniel Høegh
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 +

[julia-users] How to generate subplots with 2D and 3D plots?

2014-11-23 Thread Daniel Høegh
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 =

[julia-users] Efficiency of julia compiler on a simple program (from a julia newbie)

2014-11-22 Thread Daniel Høegh
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

Re: [julia-users] example for ccall use and fortran

2014-11-15 Thread Daniel Høegh
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

[julia-users] Performance confusions on matrix extractions in loops, and memory allocations

2014-11-09 Thread Daniel Høegh
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

[julia-users] Re: Performance confusions on matrix extractions in loops, and memory allocations

2014-11-09 Thread Daniel Høegh
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

[julia-users] Re: Multiple Plots with Winston

2014-11-05 Thread Daniel Høegh
When you use labels they should be escaped properly: xlabel(\$\\sigma\$ [MPa]) or xlabel(L$\sigma$ [MPa])

[julia-users] join((1, )) removes the space in the end

2014-10-22 Thread Daniel Høegh
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

Re: [julia-users] join((1, )) removes the space in the end

2014-10-22 Thread Daniel Høegh
, 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

[julia-users] change ticklabels in colorbar in PyPlot

2014-10-13 Thread Daniel Høegh
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])

[julia-users] change ticklabels in colorbar in PyPlot

2014-10-13 Thread Daniel Høegh
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\$])

[julia-users] using HDF5, JLD fails suddenly

2014-10-11 Thread Daniel Høegh
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.

[julia-users] using HDF5, JLD fails suddenly

2014-10-11 Thread Daniel Høegh
I think if you update to a new nightly it will work because the library has changed to conform to the pull-request.

Re: [julia-users] Re: Not fun

2014-10-06 Thread Daniel Høegh
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.

[julia-users] Julia 0.3.1 error when installing IJulia

2014-09-26 Thread Daniel Høegh
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

[julia-users] Julia 0.3.1 error when installing IJulia

2014-09-26 Thread Daniel Høegh
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:

[julia-users] Profile.print() dies

2014-09-16 Thread Daniel Høegh
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

[julia-users] Re: LibCURL does not build...

2014-09-04 Thread Daniel Høegh
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

Re: [julia-users] Could not spawn `start /min python -c print('test')`

2014-08-27 Thread Daniel Høegh
Thanks Jacob:)

[julia-users] Could not spawn `start /min python -c print('test')`

2014-08-26 Thread Daniel Høegh
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

Re: [julia-users] Could not spawn `start /min python -c print('test')`

2014-08-26 Thread Daniel Høegh
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?