[julia-users] Re: Matlab function exist()

2014-04-16 Thread Avik Sengupta
There is isdefined , which may be what you need. http://julia.readthedocs.org/en/latest/stdlib/base/?highlight=isdefined#Base.isdefined eg: isdefined(Main, :x) On Wednesday, 16 April 2014 06:40:27 UTC+1, Peter wrote: Is there an equivalent for the Matlab function exist() which checks for

[julia-users] Re: open a file and writing lines to it

2014-04-16 Thread harven
Le mercredi 16 avril 2014 05:49:44 UTC+2, gdeloscampos a écrit : Hello, I am wondering if anyone can point me to documentation about opening, reading and writing to connections? IO = open(temp, a) # a stands for append write(IO, string1\n) write(IO, string2\n) close(IO) Another

[julia-users] Re: open a file and writing lines to it

2014-04-16 Thread harven
Le mercredi 16 avril 2014 08:49:53 UTC+2, harven a écrit : Le mercredi 16 avril 2014 05:49:44 UTC+2, gdeloscampos a écrit : Hello, I am wondering if anyone can point me to documentation about opening, reading and writing to connections? It seems that file interaction is not really

Re: [julia-users] What is the find command in Julia?

2014-04-16 Thread RecentConvert
Is there a faster way of doing this? Dstr2 = Array(Float64,length(Dstc[time])-1,2) # Preallocate averaged Dstr array for i=1:1:length(Dstc[time]) - 1 f = find(Dstc[time][i] .= Dstr[time] . Dstc[time][i+1]) dN = Dstr[NH3][f] Dstr2[i,1] = f[1] Dstr2[i,2] = mean(dN) end Dstr and

[julia-users] Re: problem with map after upgrade

2014-04-16 Thread harven
Le mercredi 16 avril 2014 00:09:14 UTC+2, Matt Bauman a écrit : In Julia 0.2, readlines returned an Array with Any elements. In recent versions, that's been sharpened to an Array with ASCII- and UTF8Strings. Thanks for the answer. So apparently utf16 is not supported anymore? From what

Re: [julia-users] What is the find command in Julia?

2014-04-16 Thread harven
Le mercredi 16 avril 2014 11:08:31 UTC+2, RecentConvert a écrit : Is there a faster way of doing this? Dstr2 = Array(Float64,length(Dstc[time])-1,2) # Preallocate averaged Dstr array for i=1:1:length(Dstc[time]) - 1 f = find(Dstc[time][i] .= Dstr[time] . Dstc[time][i+1]) dN =

Re: [julia-users] What is the find command in Julia?

2014-04-16 Thread Tony Kelman
The logical indexing version of that would be f = Dstc[time][i] .= Dstr[time] . Dstc[time][i+1] dN = Dstr[NH3][f] In other words dropping the find and using a boolean array (BitArray) to do the indexing. In Matlab this is usually faster, not sure whether the same speed comparison translates to

Re: [julia-users] What is the find command in Julia?

2014-04-16 Thread Tim Holy
Use the profiler to find out what the bottlenecks are. But just looking at the code reveals some possible candidates: - You repeatedly call Dstr[time], Dstc[time], and Dstr[NH3]. Consider assigning them to a variable at the beginning of the loop. - Your code allocates memory on each iteration.

[julia-users] Pkg.tag

2014-04-16 Thread Simon Byrne
I'm trying to push a new package to METADATA, but I'm having some trouble. I've run julia Pkg.tag(KDE) INFO: Tagging KDE v0.0.1 which tags the KDE repo, but doesn't make any changes to METADATA repo. What am I missing? (I'm running the julia nightly) simon

Re: [julia-users] Pkg.tag

2014-04-16 Thread Amit Murthy
What does Pkg.publish() show? On Wed, Apr 16, 2014 at 4:17 PM, Simon Byrne simonby...@gmail.com wrote: I'm trying to push a new package to METADATA, but I'm having some trouble. I've run julia Pkg.tag(KDE) INFO: Tagging KDE v0.0.1 which tags the KDE repo, but doesn't make any changes

Re: [julia-users] Pkg.tag

2014-04-16 Thread Simon Byrne
Hmm, something's not right here: julia Pkg.update() INFO: Updating METADATA... INFO: INFO: INFO: INFO: Updating GSLDists...Updating BoostDists...Updating RmathDist...Updating KDE... INFO: Computing changes... INFO: No packages to install, update or remove julia Pkg.publish() ERROR:

Re: [julia-users] Pkg.tag

2014-04-16 Thread Amit Murthy
My bad. I manually updated METADATA for HTTPClient package and may have screwed up. Give me a minute. On Wed, Apr 16, 2014 at 4:29 PM, Simon Byrne simonby...@gmail.com wrote: Hmm, something's not right here: julia Pkg.update() INFO: Updating METADATA... INFO: INFO: INFO: INFO: Updating

Re: [julia-users] Pkg.tag

2014-04-16 Thread Amit Murthy
Sorry, couldn't find anything wrong with my edits. I don't see the error you are seeing on my machine though. On Wed, Apr 16, 2014 at 4:43 PM, Amit Murthy amit.mur...@gmail.com wrote: My bad. I manually updated METADATA for HTTPClient package and may have screwed up. Give me a minute. On

Re: [julia-users] Pkg.tag

2014-04-16 Thread Simon Byrne
Hmm, I tried deleting my whole .julia and I still get the same message. I'll file an issue. On Wednesday, 16 April 2014 12:18:09 UTC+1, Amit Murthy wrote: Sorry, couldn't find anything wrong with my edits. I don't see the error you are seeing on my machine though. On Wed, Apr 16, 2014 at

[julia-users] Should 10x1 Array{Float64,2} be the same than 10-element Array{Float64,1}

2014-04-16 Thread joanenric barcelo
Hello, I'm coming from Matlab and now, I'm staring playing with Julia and her packages. One of the things that surprised me the most is that ones(1) and ones(1,1) does not output the same result. The first one outputs 10-element Array{Float64,1} while the second command 10x1 Array{Float64,2}.

[julia-users] Re: emacs IJulia notebook?

2014-04-16 Thread James Porter
I would recommend installing IPython 2.0 (the latest version), Pkg.checkout(IJulia) to get the latest there (two weeks can mean fairly out of date, Julia-land moves quickly for the moment), and upgrading your emacs packages to the latest, and seeing if that helps (or at the very least gives a

[julia-users] Re: Should 10x1 Array{Float64,2} be the same than 10-element Array{Float64,1}

2014-04-16 Thread James Porter
Hi joanenric— Julia makes a distinction between column vectors (10-element Array{Float64,1}) and row vectors (10x1 Array{Float64,2}). You can see this reflected in how they print: julia [1,2,3] 3-element Array{Int64,1}: 1 2 3 # column vector julia [1 2 3] 1x3 Array{Int64,2}: 1 2 3 #

[julia-users] Counterintuitive slices of 2d array

2014-04-16 Thread Paweł Biernat
Hi, consider the 2d array x=[j+10*i for i=1:2, j=1:2] I would like to take a slice along the first and the second dimensions, i.e. julia x[1:2,1] 2-element Array{Int64,1}: 11 21 julia x[1,1:2] 1x2 Array{Int64,2}: 11 12 why is the second result a 2d array? Shouldn't a slice of 2d array

[julia-users] Re: Counterintuitive slices of 2d array

2014-04-16 Thread Paweł Biernat
Adding a real life use case: x=[j+10*i for i=1:2, j=1:2] function f(x::Array{Int,1}) x end and then julia f(x[1:2,1]) 2-element Array{Int64,1}: 11 21 julia f(x[1,1:2]) ERROR: no method f(Array{Int64,2})

Re: [julia-users] Should 10x1 Array{Float64,2} be the same than 10-element Array{Float64,1}

2014-04-16 Thread John Myles White
Yes, this is a less well-known property of DataFrames: they'll allow anything as inputs, including objects of very high order. That's actually useful, especially when working with Hive. But it is confusing, so we could raise an error when taking in a scalar object of a type that has ndims 1.

Re: [julia-users] Re: Counterintuitive slices of 2d array

2014-04-16 Thread Bob Nnamtrop
I completely agree with you and would love to see julia drop singleton dimensions indexed with scalar. There is an issue on this with lots of discussion, which was left at the point of waiting til someone implements some code to give it a try (see https://github.com/JuliaLang/julia/issues/5949).

[julia-users] Re: emacs IJulia notebook?

2014-04-16 Thread Andrew Dabrowski
I'm trying iPython 2.0, but now I'm getting this error: https://github.com/tkf/emacs-ipython-notebook/issues/137 That seems to still be an open issue with iPython 2. I get the same error whether I use stable emacs 24 or a bleeding edge version.

[julia-users] line continuation

2014-04-16 Thread cnbiz850
Searched but didn't find an answer. Does Julia allow statement to continue on the next line?

Re: [julia-users] Re: Counterintuitive slices of 2d array

2014-04-16 Thread Paweł Biernat
Thanks for linking to the issue. It seems that the array slicing is just a tip of the iceberg, I had no idea about the discussion on the algebraic interpretation of n x n arrays and respective operators. I somewhat understand the arguments behind the need of elementwise operators (although

Re: [julia-users] line continuation

2014-04-16 Thread Stefan Karpinski
If the expression is incomplete, continuation is automatic. There is no explicit continuation syntax. On Apr 16, 2014, at 6:01 PM, cnbiz850 cnbiz...@gmail.com wrote: Searched but didn't find an answer. Does Julia allow statement to continue on the next line?

Re: [julia-users] line continuation

2014-04-16 Thread cnbiz850
Thanks for the answer. I tested previously this but it did not work: if ab bc cd de ef But now this works: if ab bc cd de ef So the got to be on the end of the first for it to know that the line is not finished. On 04/17/2014 06:25 AM, Stefan Karpinski wrote: If the

[julia-users] Complex Schur decomposition

2014-04-16 Thread Joey Huchette
Is there an implementation in Base (or elsewhere) of a Schur decomposition that returns a complex matrix matrix T that is triangular? For reference, MATLAB has a optional switch between the two forms. I didn't do enough digging to see if this option is exposed by Lapack, so maybe the conversion

[julia-users] Optimal pmap usage

2014-04-16 Thread Gustavo Camilo
Hi all, I'm currently using pmap to distribute to a bunch of cores some work to do. I was just wondering how you guys are structuring this. Basically I have a function written in C that I need to pass a bunch of parameters to so that it can do its work, so I first create a tuple with all the

Re: [julia-users] Export/view movie of plots

2014-04-16 Thread Sheehan Olver
Thanks for all the suggestions. I did the command below in the end, which should do for now. I use PyPlot for the plot commands. The only issue is that it's a bit slow to export. function tomovie(v::Array) tm=string(time_ns()) dr=/tmp/ * tm * mov mkdir(dr) for

[julia-users] Performance expectations and benchmarks

2014-04-16 Thread Gilberto Noronha
Hi all, I was looking at some benchmark results (mainly the ones on julialang.org) and I could not resist the thought that they are a bit misleading. I say this as a Julia fan (I wish I did not think this way!) because realistically I don't think one can expect a real world Julia application

[julia-users] Performance expectations and benchmarks

2014-04-16 Thread Kevin Squire
While getting performance from Julia isn't always straightforward (see http://julia.readthedocs.org/en/latest/manual/performance-tips/), I'm curious why you find the benchmarks misleading? Is it because they're focused on minimal examples, or maybe because they don't include some of your use

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-16 Thread Iain Dunning
I implemented a version of simplex method for rational numbers - so you solve it exactly in pure Julia. https://github.com/IainNZ/RationalSimplex.jl Not for serious work - just for fun! On Saturday, April 12, 2014 11:50:26 AM UTC-4, Stéphane Laurent wrote: Thank you everybody. I have updated

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-16 Thread Miles Lubin
Where's the MathProgBase interface? :) On Wed, Apr 16, 2014 at 11:07 PM, Iain Dunning iaindunn...@gmail.com wrote: I implemented a version of simplex method for rational numbers - so you solve it exactly in pure Julia. https://github.com/IainNZ/RationalSimplex.jl Not for serious work - just

Re: [julia-users] Re: Create formatted string

2014-04-16 Thread Dominique Orban
How would one go about benchmarking a set of implementations like those? On Sunday, April 13, 2014 3:22:58 PM UTC-7, Stefan Karpinski wrote: Please don't do this – or if you do and your program is amazingly slow, then consider yourself warned. You can define a custom formatting function

Re: [julia-users] Performance expectations and benchmarks

2014-04-16 Thread Iain Dunning
Some more involved benchmarks here: http://arxiv.org/pdf/1312.1431v1.pdf achieve similar performance to the front-page benchmarks - see section 4. On Wednesday, April 16, 2014 10:12:51 PM UTC-4, Jameson wrote: There are very few types in Julia that are not custom. Custom Types include:

Re: [julia-users] Performance expectations and benchmarks

2014-04-16 Thread Joey Huchette
Have you run the benchmarks on newer versions of Julia? Would be interesting to see the delta. On Wednesday, April 16, 2014 11:15:17 PM UTC-4, Iain Dunning wrote: Some more involved benchmarks here: http://arxiv.org/pdf/1312.1431v1.pdf achieve similar performance to the front-page benchmarks

Re: [julia-users] Complex Schur decomposition

2014-04-16 Thread Andreas Noack Jensen
The trick is to convert your matrix to complex before the calculation. schurfact(complex(A))[:T] gives the triangular part. 2014-04-17 1:18 GMT+02:00 Joey Huchette joehuche...@gmail.com: Is there an implementation in Base (or elsewhere) of a Schur decomposition that returns a complex matrix

Re: [julia-users] Complex Schur decomposition

2014-04-16 Thread Joey Huchette
Ahh simple enough, thanks. It might be nice to have a keyword argument that just dispatches on this---it's not completely obvious that's the right thing to do unless you dig around lapack.jl (or get a hint). I can PR. On Thursday, April 17, 2014 12:18:00 AM UTC-4, Andreas Noack Jensen wrote:

Re: [julia-users] interp1-like functionality from Grid.jl

2014-04-16 Thread Spencer Lyon
I'd love to beef up this wrapper type and add it to grid, but unfortunately I wont' be able to get to it for a while -- probably late June. On Tuesday, April 15, 2014 9:06:57 AM UTC-4, Tim Holy wrote: On Tuesday, April 15, 2014 05:35:27 AM Spencer Lyon wrote: It seems to me that this would

Re: [julia-users] Complex Schur decomposition

2014-04-16 Thread Andreas Noack Jensen
I prefer the present solution where we use dispatch instead of keywords. I think it is transparent what is happening: real matrix - real schur form, complex matrix - complex schur form. However, we could add a line in the documentation explaining it. If you are okay with that idea, please open a