[julia-users] Re: warning with @load in JLD

2016-08-30 Thread Simon Kornblith
The reason this particular form of @load now shows a warning is that it can't be made to work properly in a function. If you can't know either the file name or the variable names ahead of time, there are two things you could do: - Use the load function (e.g. x = load("data_run$(run).jld"))

[julia-users] Re: RandIP A random IP generator for Large scale network mapping.

2016-08-30 Thread Páll Haraldsson
On Tuesday, August 30, 2016 at 5:26:29 AM UTC, Jacob Yates wrote: > > I've been working on porting a script I wrote in python to julia and have > been having some issues with the script freezing. > > So pretty much all this script does is generate a random IP address and > checks to see if its

Re: [julia-users] Set Data Structure

2016-08-30 Thread Kevin Squire
Note that you can also write this as julia> s = Set([2,3,1]) Set([2,3,1]) julia> 2 in s true julia> s in 2 false Which might make it easier to understand why the second one fails. Cheers, Kevin On Mon, Aug 29, 2016 at 3:00 PM, Erik Schnetter wrote: > On Mon, Aug

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Christoph Ortner
If this is your only use-case of I, then you don't need it anyways. Just write 1.0 * A instead; same effect, independent of what type of array A is. But what if I use I in a different way? Suppose I want to A[1:5,1:5] = eye(5); I can't do that with I. Of course we could give it another type

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Júlio Hoffimann
I don't think there is anything like pushing the language to computer scientists, it's the exact opposite, making it seamlessly fast without forcing the user to manipulate types. Again, you write B = I*A and get B = copy(A) performance. That is the original proposal. Most of us follow the same

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Christoph Ortner
I agree with Sheehan that this affect a number of functions in Base, not just eye - that was the point I was trying to make, sorry I wasn't clear. I raised this in a discussion in a formal issue somewhere, which I can't find now. Somebody (Steven Johnson?) argued that `zeros` and `ones` are

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Chris Rackauckas
Even then, creating the 5x5 dense matrix to then copy it into A[1:5,1:5] is not what you'd want to do. Ideally would just have eye(5) return something like I which has a size, and just sets A[i,j]=1 if i=j 0 otherwise, with checks that it's the right size. Actually, the current I would do it if

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Christoph Ortner
> I agree that there can be a teaching problem with Julia. A lot of things happen like fast magic to "mathematicians not trained in CS". yes, this is the issue. FWIW in other respects it is nice to use Julia for teaching, e.g., the fact that there are no classes is great! > I don't think the

[julia-users] warning with @load in JLD

2016-08-30 Thread Ethan Anderes
I often use @load as a way to conveniently load a bunch of variables obtained from a simulation run. For example, the simulation script might look like this using JLD run = 1 # <--- simulation parameter a,b,c = 1,2,3 @save "data_run$(run).jld" a b c Then, to view these simulations later, I

[julia-users] I want to publish a package into the Julia Ecosystem

2016-08-30 Thread Jeffrey Sarnoff
Please give me a way that requires no imagination (mourning Gene Wilder). The github repository is here: https://github.com/JuliaArbTypes/ArbFloats.jl I have read related: v0.4 does not help me, and generalities are unfamiliar to me. julia> PkgDev.publish() INFO: Validating METADATA INFO:

[julia-users] Re: FYI: Second transpiler to Julia(?), from Ruby, and benchmarks

2016-08-30 Thread Páll Haraldsson
On Monday, August 29, 2016 at 6:42:08 PM UTC, Chris Rackauckas wrote: > > That's a good showing for Julia for the larger matrices? However, for > smaller matrices it's a large constant time. Is it including > startup/compilation time? Did they not "run it twice"? > > 1. I guess they must include

[julia-users] Re: Package development - best practices

2016-08-30 Thread Kevin Liu
Just make an alias of, say, ~/.julia/v0.4/mypackage (hidden) and paste the alias in the directory you want, e.g. Google Drive/mypackage_alias (not hidden) Whatever changes you make to mypackage_alias will change mypackage, which can then be called on the REPL with This way you don't have to

Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread Yichao Yu
On Tue, Aug 30, 2016 at 6:25 PM, mmh wrote: > > > > > FWIW, your "simple" function has 10 operations that generates ~40 instructions

[julia-users] Re: warning with @load in JLD

2016-08-30 Thread Ethan Anderes
Terrific. The second option works great (and will be my first sanctioned use of eval...been avoiding it like the plague after reading all the warnings about it on google groups). Thanks! Ethan On Tuesday, August 30, 2016 at 12:37:44 PM UTC-7, Simon Kornblith wrote: > > The reason this

[julia-users] code_native complex for simple snippet

2016-08-30 Thread mmh

Re: [julia-users] Running Julia in Ubuntu

2016-08-30 Thread Henri Girard
WHICH UBUNTU VERSION ? Le 30/08/2016 à 00:30, Angshuman Goswami a écrit : I was running Julia to run my MPC code. I needed to upgrade and hence i deleted the folder i cloned from git hub. Now I have two problems: 1) Installing julia by sudo get-apt install julia, I get the following

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread Alexei Serdiuk
Gred, thank you. This is exactly want I looked for. среда, 31 августа 2016 г., 4:26:02 UTC+3 пользователь Greg Plowman написал: > > >> I could use an array, but one product can correspond to different number >> of bases. >> >> That's why I decided to use tuples. >> >> You could use an Array of

[julia-users] Re: I want to publish a package into the Julia Ecosystem

2016-08-30 Thread Jeffrey Sarnoff
Got it sorted. For the next one to find doing this to be as a treacle oriel: http://docs.julialang.org/en/latest/manual/packages/#man-manual-publish do what it says slowly and deliberately (read twice, press enter once), On Tuesday, August 30, 2016 at 7:15:00 PM UTC-4,

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Christoph Ortner
On Wednesday, 31 August 2016 00:14:30 UTC+1, Sheehan Olver wrote: > > I agree with Chris, though I prefer Matrix(eye(5)) to collect(eye(5)). > >> Matrix(eye(5)) looks reasonably pleasing to the eyes :). (but still 8 keystrokes more than needed)

[julia-users] @threads all vs. @parallel ???

2016-08-30 Thread digxx
Sorry if there is already some information on this though I didnt find it... So: What is the difference between these? I have used @parallel so far for parallel loops but recently saw this @threads all in some video and I was wondering what the difference is? Could anyone elaborate or give me a

[julia-users] Re: @threads all vs. @parallel ???

2016-08-30 Thread Andrew
I have also been wondering this. I tried @threads yesterday and it got me around a 4-fold speedup on a loop which applied a function to each element in an array, and I conveniently didn't need to bother using SharedArrays as I would with @parallel. On Tuesday, August 30, 2016 at 7:20:36 PM

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread 'Greg Plowman' via julia-users
> > > I could use an array, but one product can correspond to different number > of bases. > > That's why I decided to use tuples. > > You could use an Array of (different length) Arrays, similar to Array of Tuples. Another strategy might be to construct a vector of (Product, Base) pairs,

[julia-users] issues with Pycall

2016-08-30 Thread Angshuman Goswami
I am trying to use Julia for running an MPC but I am getting the following error: All was running fine in the Julia 0.4.4 but when I updated my system to 0.4.7 this happened julia> using RobotOS INFO: Precompiling module PyCall... WARNING: unable to determine host cpu name. julia:

Re: [julia-users] Running Julia in Ubuntu

2016-08-30 Thread Angshuman Goswami
14.04 On Tuesday, August 30, 2016 at 2:55:30 AM UTC-4, Henri Girard wrote: > > WHICH UBUNTU VERSION ? > > Le 30/08/2016 à 00:30, Angshuman Goswami a écrit : > > I was running Julia to run my MPC code. I needed to upgrade and hence i > deleted the folder i cloned from git hub. Now I have two

[julia-users] Re: I want to publish a package into the Julia Ecosystem

2016-08-30 Thread Jeffrey Sarnoff
I tried the way given in the new latest [docs] (http://docs.julialang.org/en/latest/manual/packages/#man-manual-publish) to deal with the METADATA manually. It seems METADATA has outgrown github defaults: Sorry, we had to truncate this directory to 1,000 files. 126 entries were omitted from

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Sheehan Olver
I agree with Chris, though I prefer Matrix(eye(5)) to collect(eye(5)). I've found teaching-wise that saying "Matlab has Dense and Sparse. Julia has a lot more special types." worked pretty well to explain the situation. The issue though is with rand: it seems like overkill for rand(5,5)

Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread Erik Schnetter
With unsigned shift counts the generated code should be shorter, since Julia then knows in which direction to shift. -erik On Tue, Aug 30, 2016 at 7:24 PM, mmh wrote: > Is there an unsafe version of >> and << that does not do range checks? > > > On Tuesday, August 30, 2016

[julia-users] Re: Running Julia in Ubuntu

2016-08-30 Thread Angshuman Goswami
I did that and now I am getting this error when I type julia to run in the command line bash: /usr/local/bin/julia: cannot execute binary file: Exec format error On Tuesday, August 30, 2016 at 4:55:54 AM UTC-4, Kaj Wiik wrote: > > I have been using the third route very successfully: > >

Re: [julia-users] Set Data Structure

2016-08-30 Thread Jared Crean
That's nifty, thanks. Jared Crean On Tuesday, August 30, 2016 at 11:51:02 AM UTC-4, Kevin Squire wrote: > > Note that you can also write this as > > julia> s = Set([2,3,1]) > Set([2,3,1]) > > julia> 2 in s > true > > julia> s in 2 > false > > Which might make it easier to understand why the

[julia-users] Re: @threads all vs. @parallel ???

2016-08-30 Thread Chris Rackauckas
That's pretty much it. Threads are shared memory, which have less overhead (and are thus faster), and can share variables between them. @parallel is multiprocessing, i.e. each worker process has its own set of defined variables which do not overlap, and data has to be transferred between them.

[julia-users] Re: FYI: Second transpiler to Julia(?), from Ruby, and benchmarks

2016-08-30 Thread Steven G. Johnson
On Monday, August 29, 2016 at 11:57:32 AM UTC-4, Páll Haraldsson wrote: > > Interesting benchmarks here ("virtual_module" is transpiled, but "Julia > 0.4.6 not, only to compare, and [can be] a little slower than Python..): > An accurate transpiler from Ruby or Python to Julia is pretty much

[julia-users] SharedArray fails to gc() when called within a sequence of functions? 0.5.0-rc3

2016-08-30 Thread Rafael Menegassi
Dear all Quite new in julia so sorry if made something wrong; Reduced the case to simplest possible; Using SharedArray within a sequence of functions: addprocs(4) function chisq(n::Integer) A=SharedArray(Float64, n) @sync @parallel for i in 1:n A[i]=(rand()-rand())^2 end sumsq=sum(A) end

[julia-users] How to publish a package

2016-08-30 Thread M Hashmi
Hi, I need to know that how to publish a package for Julia. Regards, Mudassar

[julia-users] Saving and Loading data (when JLD is not suitable)

2016-08-30 Thread Lyndon White
I like JLD. I really do. But I have a problem that it can't solve -- not due to a limitation of JLD, but due to HDF5. HDF5 is (AFAIK) designed with rectangular arrays in mind -- everything else is secondary. If your the type you are trying to serialize is more or less a Structure of Arrays,

[julia-users] Re: Running Julia in Ubuntu

2016-08-30 Thread Angshuman Goswami
When i performed build again errors cropped up. Pkg.build("PyCall") WARNING: unable to determine host cpu name. INFO: Building PyCall INFO: No system-wide Python was found; got the following error: could not spawn `/usr/local/lib/python2.7 -c "import distutils.sysconfig;

[julia-users] Re: How to publish a package

2016-08-30 Thread Chris Rackauckas
Some of this might be a little old now, but it'll guide you step-by-step on how to take your functions into a registered module with unit tests: http://www.stochasticlifestyle.com/finalizing-julia-package-documentation-testing-coverage-publishing/ . Hope it helps! On Tuesday, August 30, 2016

Re: [julia-users] High memory consumption with loops

2016-08-30 Thread Venil Noronha
Thanks Steve! The problem was finally found to be with some matrix operations. We've used an alternate approach and it seems to be fixed now. Venil On Thursday, August 25, 2016 at 6:41:25 PM UTC-7, vav...@uwaterloo.ca wrote: > > I don't have any suggestions about the performance, but I do have

[julia-users] Re: Running Julia in Ubuntu

2016-08-30 Thread Angshuman Goswami
I am running julia on a 32 bit system and I made sure the version i downloaded is 32 bit On Tuesday, August 30, 2016 at 10:34:25 PM UTC-4, Angshuman Goswami wrote: > > I did that and now I am getting this error when I type julia to run in the > command line > bash: /usr/local/bin/julia: cannot

Re: [julia-users] Re: Return type of eye()

2016-08-30 Thread Sheehan Olver
I agree with On Wednesday, August 31, 2016 at 3:26:22 AM UTC+10, Chris Rackauckas wrote: > > Even then, creating the 5x5 dense matrix to then copy it into A[1:5,1:5] > is not what you'd want to do. Ideally would just have eye(5) return > something like I which has a size, and just sets

Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread mmh
Is there an unsafe version of >> and << that does not do range checks? On Tuesday, August 30, 2016 at 6:46:36 PM UTC-4, Yichao Yu wrote: > > > > On Tue, Aug 30, 2016 at 6:25 PM, mmh > wrote: > >> >>

Re: [julia-users] @threads all vs. @parallel ???

2016-08-30 Thread Yichao Yu
On Tue, Aug 30, 2016 at 7:20 PM, digxx wrote: > Sorry if there is already some information on this though I didnt find > it... > So: What is the difference between these? > I have used @parallel so far for parallel loops but recently saw this > @threads all in some video

[julia-users] Re: Running Julia in Ubuntu

2016-08-30 Thread Angshuman Goswami
julia> Pkg.status() 7 required packages: - AmplNLWriter 0.2.2 - CoinOptServices 0.1.2 - IJulia1.2.0 - Ipopt 0.2.4 - JuMP 0.14.0 - PyCall1.7.1 - RobotOS

[julia-users] Re: Saving and Loading data (when JLD is not suitable)

2016-08-30 Thread Lyndon White
On Wednesday, 31 August 2016 12:47:37 UTC+8, Lyndon White wrote: > > > So I have one of the models, saved using their custom format ( > https://github.com/sbos/AdaGram.jl/blob/master/src/util.jl#L94) > It is *6Gb*, and takes ages to load and save. > I switch to JLD, *13Gb* even worse. > I used

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread Yichao Yu
On Tue, Aug 30, 2016 at 3:39 PM, Kristoffer Carlsson wrote: > t = () > condition = true > for i = 1:N > if condition==true > t = (t..., i) > Note that you shouldn't do this unless you only have very few elements. > end > end > > > This does not modify

[julia-users] Re: Adding items into a tuple

2016-08-30 Thread Kristoffer Carlsson
t = () condition = true for i = 1:N if condition==true t = (t..., i) end end This does not modify the tuple but replaces it with a new longer one. On Tuesday, August 30, 2016 at 7:26:29 AM UTC+2, Alexei Serdiuk wrote: > > Hi, > > I need to choose items from a range (1:N)

[julia-users] Re: Running Julia in Ubuntu

2016-08-30 Thread Kaj Wiik
I have been using the third route very successfully: Download the binary from e.g. https://julialang.s3.amazonaws.com/bin/linux/x64/0.4/julia-0.4.6-linux-x86_64.tar.gz or https://s3.amazonaws.com/julialang/bin/linux/x64/0.5/julia-0.5.0-rc3-linux-x86_64.tar.gz (http://julialang.org/downloads/)

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread Yichao Yu
On Tue, Aug 30, 2016 at 3:55 PM, Yichao Yu wrote: > > > On Tue, Aug 30, 2016 at 3:39 PM, Kristoffer Carlsson < > kcarlsso...@gmail.com> wrote: > >> t = () >> condition = true >> for i = 1:N >> if condition==true >> t = (t..., i) >> > > Note that you shouldn't do

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread Alexei Serdiuk
Thank you very much, it works! I'll explain you why I want to use tuples. I have a range of products 1:N. Every product can be made of several mutually exclusive bases. I need to make a lot of loop of this kind for k in Products, b in Bases if accordance[k,b]=true ... end; end

Re: [julia-users] Re: Adding items into a tuple

2016-08-30 Thread Tim Holy
On Tuesday, August 30, 2016 3:57:36 PM CDT Yichao Yu wrote: > And even then, this completely looses the advantage of using tuple > (inferrable size and element types) so you shouldn't do this in general > unless you are going to do a lot of work with the tiny tuple afterwards. Right. If you want

Re: [julia-users] Running Julia in Ubuntu

2016-08-30 Thread Tim Holy
I'm rather surprised that building from source gave you version 0.4.7; I don't think that makes sense (it should have been master). Are you sure you know what you're running? (Try `.julia` from the directory in which you built julia, rather than just `julia`.) Best, --Tim On Monday, August