Re: [julia-users] string processing after readdlm

2015-04-13 Thread David P. Sanders
El lunes, 13 de abril de 2015, 5:56:05 (UTC-5), JKPie escribió: ok, here is the example: a = Array{Float32}[] push!(a,[1 2 3]) push!(a,[4 5 4]) push!(a,[7 8 9]) Try `a = [vcat(a...)]` (I always forget this syntax... Maybe we need a convenience function for this, e.g. `make_matrix`?)

[julia-users] Puzzling behavior with multiple processes and STDOUT usage

2015-04-13 Thread Harry B
Hi, My goal is to have 10 parallel processes read the same file and each process consume 1/10th of that file. They of course all read all lines of the file, but skips over lines not belonging to it. So process #1 would process lines 1, 11, 21 etc. Second one would process lines 2, 12, 22 etc.

[julia-users] Speeding up indexing into a Dict{Vector,Vector}

2015-04-13 Thread Will Kearney
I'm hoping I can get some advice on optimizing some code. I have a data structure which is very conveniently represented as a Dict{Vector{Int},Vector{Float64}}. That is, I need to look up floating-point vectors stored at certain multidimensional (usually 2-10) positions represented as a

[julia-users] Re: smallest eigenvalue of sparse matrix

2015-04-13 Thread Jutho
When the matrix is real and symmetric, ARPACK does resort to Lanczos, or at least the implicitly restarted version thereof. Straight from the homepage: When the matrix A is symmetric it reduces to a variant of the Lanczos process called the Implicitly Restarted Lanczos Method (IRLM). I

[julia-users] Re: Puzzling behavior with multiple processes and STDOUT usage

2015-04-13 Thread Harry B
I have confirmed the same behavior with the latest nightly as well $ julia --version julia version 0.4.0-dev+4159 $ julia -p 10 -L ./julia_test_parallel.jl ./julia_test_parallel_driver.jl | wc -l 38968 $ julia -p 10 -L ./julia_test_parallel.jl ./julia_test_parallel_driver.jl | wc -l 53050 $

[julia-users] Increase size of a created sparse matrix?

2015-04-13 Thread wildart
Is it possible to increase size of a created sparse matrix in a following manner: julia m = sparse([2,3], [1,1], [1,3]) 3x1 sparse matrix with 2 Int64 entries: [2, 1] = 1 [3, 1] = 3 julia m[4,1] = 1 ERROR: BoundsError in setindex! at sparse/sparsematrix.jl:1493 julia m.m = 4 4

Re: [julia-users] Re: Spark and Julia

2015-04-13 Thread Jey Kottalam
Hi julia-users, I have the beginnings of a Spark interface for Julia up at https://github.com/jey/Spock.jl. This implementation follows the design used in Spark's Python and R bindings. It so far has the core of the Spark RDD interface implemented, but does not yet implement the additional

[julia-users] Re: Speeding up indexing into a Dict{Vector,Vector}

2015-04-13 Thread Seth
Two ideas that *might* work: 1) is hashing the key - that is, if you can represent the Vector{Int} as an immutable type (say, by somehow quickly changing it into an Int64 or Int128, perhaps using hash()) then you store the computed result as the key. The thing to keep in mind here is that if

[julia-users] Re: :(::) rather than Symbol in args[1] in :lambda Expr for cartesianarray

2015-04-13 Thread Todd Anderson
Here's a small example: function nef(weights, input_B) delta_B = cartesianarray(Float64, (input_B),) do j sum(weights[spikes_A, j]) end end ct = code_typed(nef, (Array{Float64,2}, Int64)) println(ct) Here's the output: {:($(Expr(:lambda, {:weights,:input_B},

[julia-users] Using Cartesian to define multidimensional convolution

2015-04-13 Thread Derek Thomas
Hi all, I'm trying to implement a multidimensional convolution defined like this in 2d: We initialize to zero a matrix c and add to it, starting at the (i,j)th position, submatrices b[i, j] * a[:, :] padded with zeros. I have this function: stagedfunction convn{T,N}(A::Array{T,N},

[julia-users] Infinite Dimensional Vectors

2015-04-13 Thread Mark Tabor
Hello All, I am looking for an efficient way to represent vectors that exist in an infinite dimensional space. Specifically I am working with large amounts of text data and will be receiving a lot of data that contains previously unseen words. Each text represents a vector that exists in the

[julia-users] Julia Installation Conflict with R

2015-04-13 Thread Yudong Ma
Hi. I am pretty new to Julia, and I did manage to install Julia on Ubuntu precise 64. Everything works except that the installation of Julia updates some libraries and these updates makes the R shared lib /usr/lib/libR.so complain that the symbol _pcre_valid_utf8 is undefined. The libraries

[julia-users] Julia installation issue

2015-04-13 Thread Yudong Ma
Hi I am very new to Julia, and I have encountered an installation issue of Julia. I did successfully install Julia in my Ubuntu precise. However it seems Julia also updated libpcre3, libpcrecpp2, libpcre3-dev etc..., and these updates broke my original R installation (R installed as a shared

Re: [julia-users] Using Cartesian to define multidimensional convolution

2015-04-13 Thread Tim Holy
You forgot the $N on the two @nref on the right hand side: On Monday, April 13, 2015 08:05:15 AM Derek Thomas wrote: (@nref $N ret k-(i_d + j_d)) = (@nref A i) * (@nref B j) --Tim

[julia-users] Re: Advice on vectorizing functions

2015-04-13 Thread SixString
For code outside of my inner loops, I still prefer vectorized functions for compactness and readability. This works: function ldexp!(x::Array{Float64}, e::Int) for i=1:length(x) x[i] = ldexp(x[i], e) end x end Why does this version result in complaints about no matching

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Stefan Karpinski
It's kind of unclear what you're trying to do. Are you printing an array and the repl hangs? On Mon, Apr 13, 2015 at 10:49 PM, Siyi Deng mr.siyi.d...@gmail.com wrote: Hi, I have a coefficient array which looks like b = [4.67933552111843e-07,-6.32591924726271e-05,-0.000160070579209537, ],

Re: [julia-users] Re: Speeding up indexing into a Dict{Vector,Vector}

2015-04-13 Thread Stefan Karpinski
If you want to have the original mutable vector around, you may want to keep it as a value instead of a key. You can do something like map the Vector{Int} to a single Int value, use that as a key and then keep the Vector{Int} as part of the Dict value. On Mon, Apr 13, 2015 at 6:06 PM, Seth

Re: [julia-users] Re: :(::) rather than Symbol in args[1] in :lambda Expr for cartesianarray

2015-04-13 Thread Isaiah Norton
This shows the first lambda arg again as :(j::Any) of type :(::). In my real code, it was at least figuring out in the second lambda arg to type j as {:j,Int64,0} but in this example it doesn't even figure out that j has to be of some Unsigned type and punts back to Any ({:j, Any, 0}). I'm

[julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Siyi Deng
Hi, I have a coefficient array which looks like b = [4.67933552111843e-07,-6.32591924726271e-05,-0.000160070579209537, ], with about 320 elements. The entire array in ascii is about 7000 chars. I cannot paste the array directly in REPL, julia simply stuck. I cannot put it in a script and

Re: [julia-users] Using Cartesian to define multidimensional convolution

2015-04-13 Thread Tim Holy
By the way, you can do this more easily now, without macros, like this: for IA in CartesianRange(size(A)) for IB in CartesianRange(size(B)) ret[IA+IB] = A[IA] * B[IB] end end --Tim On Monday, April 13, 2015 08:05:15 AM Derek Thomas wrote: Hi all, I'm trying to implement a

Re: [julia-users] Using Cartesian to define multidimensional convolution

2015-04-13 Thread Derek Thomas
Thanks. I noticed that right after I posted but couldn't find my post to fix it. Here's a working version using Base.Cartesian stagedfunction convn{T,N}(A::Array{T,N}, B::Array{T,N}) quote retsize = [size(A)...] + [size(B)...] - 1 retsize = tuple(retsize...) ret =

Re: [julia-users] Infinite Dimensional Vectors

2015-04-13 Thread Stefan Karpinski
Hard to say what underlying data structure you want here, but it may well be helpful for the keys to be lexicographically ordered – you may want to try a SortedDict as provided by the DataStructures https://github.com/JuliaLang/DataStructures.jl package. You may also want to define a WordVector

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Jacob Quinn
Can you share the script? It's hard to troubleshoot this kind of problem without seeing exactly what you're running. On Mon, Apr 13, 2015 at 9:37 PM, Siyi Deng mr.siyi.d...@gmail.com wrote: No, I'm copy and pasting the array, from a text editor to the REPL, and it hangs there. On Monday,

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Siyi Deng
Hi, my array as follows: b = [4.67933552111843e-07,-6.32591924726271e-05,-0.000160070579209537,-0.000332845978767382,-0.000588690359282295, -0.000924685049847179,-0.00131849652730193,-0.00172663844738962,-0.00208786977252048,-0.00233221212288082,

Re: [julia-users] Re: Julia installation issue

2015-04-13 Thread Isaiah Norton
Thanks for following up with the answer! I'm sure others will find this helpful. On Tue, Apr 14, 2015 at 12:30 AM, Yudong Ma mayud...@gmail.com wrote: It turns out I have to update R to the latest version. Older version R is not compatible with the updated version of libpcre3 (v1:8.30) shipped

[julia-users] Re: Julia installation issue

2015-04-13 Thread Yudong Ma
It turns out I have to update R to the latest version. Older version R is not compatible with the updated version of libpcre3 (v1:8.30) shipped with Julia. I have included the link as follow. https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1006573.html Hopefully this is useful

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Isaiah Norton
Are you using Windows? Pasting into the REPL there is especially bad, but `include` should work fine (and I just tested it). I also pasted this array into a putty session to a linux box and it only took a few seconds (due to putty not Julia, pretty sure it would be instant in a local login). I

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Siyi Deng
Yes I am using windows. Is there a way to help the pasting issue? because it severely limits the usefulness of REPL if you cannot paste directly into it.Including this array in a script hanged for me the first time I tried (was like 2 minutes). But seems to be working fine when I tested it

Re: [julia-users] Julia stuck at large floating point number array from source code

2015-04-13 Thread Siyi Deng
No, I'm copy and pasting the array, from a text editor to the REPL, and it hangs there. On Monday, April 13, 2015 at 7:53:29 PM UTC-7, Stefan Karpinski wrote: It's kind of unclear what you're trying to do. Are you printing an array and the repl hangs? On Mon, Apr 13, 2015 at 10:49 PM, Siyi

[julia-users] Re: Advice on vectorizing functions

2015-04-13 Thread elextr
On Tuesday, April 14, 2015 at 9:40:49 AM UTC+10, SixString wrote: For code outside of my inner loops, I still prefer vectorized functions for compactness and readability. This works: function ldexp!(x::Array{Float64}, e::Int) for i=1:length(x) x[i] = ldexp(x[i], e) end

[julia-users] Re: pre-allocation for sparse matrices

2015-04-13 Thread Kristoffer Carlsson
If you are overwriting all your previous values you can just send in the matrix into the function and update with A[i,j] = v On Monday, April 13, 2015 at 6:47:21 PM UTC+2, Andrei Berceanu wrote: Yes but so how do I update it inplace? On Monday, April 13, 2015 at 5:37:50 PM UTC+2,

Re: [julia-users] Re: ApproxFun First Order PDE Question

2015-04-13 Thread Dominic Steinitz
Thanks very much for this. I had assumed by specifying `\[f]` that I *had* given just one boundary condition. I tried your solution but ran into a problem which I have raised as a ticket as you suggest: https://github.com/ApproxFun/ApproxFun.jl/issues/159

Re: [julia-users] string processing after readdlm

2015-04-13 Thread JKpie
ok, here is the example: a = Array{Float32}[] push!(a,[1 2 3]) push!(a,[4 5 4]) push!(a,[7 8 9]) println(typeof(a)) writedlm(joinpath(path,text.txt),a) b = readdlm(joinpath(path,text.txt)) println(typeof(b)) println(b[1,:]) the result is: Array{Array{Float32,N},1} Array{Any,2} Any[Float32[1.0

[julia-users] Problem with addprocs

2015-04-13 Thread John
I'm unable to add a remote instance using addprocs (or a machine file). This works (without prompt): ssh xxx.xxx.xxx.xxx This command hangs with no output for the first minute: addprocs([usern...@xxx.xxx.xxx.xxx]) Then after one minute, the following message appears: Master process (id 1) could

[julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Tamas Papp
Hi, I had some code like if isa(spec, Symbol) A[i,spec] = 1 elseif isa(spec, Vector{(Symbol,Float64)}) @assert(isapprox(sum(map(x - x[2],spec)),1)) for (obs,prob) = spec A[i,obs] = prob end else error(don't know how to parse $spec for

[julia-users] Re: Symbolic relations package

2015-04-13 Thread Marcus Appelros
How about Equations? It captures the main theme so that people scrolling through the list of packages will instantly gather its purpose. Any other suggestions or objections? On Sunday, 12 April 2015 14:02:02 UTC+3, Marcus Appelros wrote: Am working on code to derive mathematical relations,

Re: [julia-users] string processing after readdlm

2015-04-13 Thread Stefan Karpinski
Is that supposed to be a lot of blank lines or is there something missing from the message? On Mon, Apr 13, 2015 at 6:56 AM, JKpie fablekil...@gmail.com wrote: ok, here is the example: a = Array{Float32}[] push!(a,[1 2 3]) push!(a,[4 5 4]) push!(a,[7 8 9]) println(typeof(a))

[julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Toivo Henningsson
You could make a typealias with a type parameter T for your type and check against that with isa.

[julia-users] Re: pre-allocation for sparse matrices

2015-04-13 Thread Andrei Berceanu
OK so I'm not sure how to directly access the CSC structure. Anyway, for clarity, here is the method which generates my sparse matrix. In a typical usage scenario, I need to generate and diagonalize a lot of these matrices, which are obtained varying the *s* Function. I guess this qualifies as

Re: [julia-users] string processing after readdlm

2015-04-13 Thread Mauro
I think you're expecting too much from writedlm/readdlm. I don't think it is all that useful beyond 2D arrays of simple datatype. An array of an array is not simple. What it seems to be doing write a string representation of `a` to the file: repr(a) You can recover its meaning with

[julia-users] Re: Holt-Winters D-E Smoothing in Julia

2015-04-13 Thread Philip Tellis
On Saturday, April 11, 2015 at 1:19:39 AM UTC-4, colint...@gmail.com wrote: Great! If you decide to open source it when done then please feel free to post a link into this thread or start a new thread on julia-stats as I for one would definitely be interested. Will do.

Re: [julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Mauro
On Mon, 2015-04-13 at 16:22, Tamas Papp tkp...@gmail.com wrote: On Mon, Apr 13 2015, Mauro mauro...@runbox.com wrote: Why can you not make it into a function? function foo!(spec::Symbol, A, i) A[i,spec] = 1 end function foo!{T:Real}(spec::Vector{(Symbol,T), A, i)

Re: [julia-users] Re: non-concatenating vector creation

2015-04-13 Thread Tamas Papp
This is perfect --- I think I will end up with something like typealias NCA Any and then I can use NCA[1,2,[3,4]] and later on remove NCA from my code easily. Thanks, Tamas On Mon, Apr 13 2015, Matt Bauman mbau...@gmail.com wrote: Is this what you're after? I think this should still work

Re: [julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Tamas Papp
On Mon, Apr 13 2015, Mauro mauro...@runbox.com wrote: Why can you not make it into a function? function foo!(spec::Symbol, A, i) A[i,spec] = 1 end function foo!{T:Real}(spec::Vector{(Symbol,T), A, i) @assert(isapprox(sum(map(x - x[2],spec)),1)) for (obs,prob) = spec

[julia-users] Re: Problem with addprocs

2015-04-13 Thread John
Oops, let me clarify: mycurrenthostname is not the same computer as xxx.xxx.xxx.xxx, it's my local computer's name on the network, whereas xxx.xxx.xxx.xxx is remote. On Monday, April 13, 2015 at 3:02:40 PM UTC+1, wil...@gmail.com wrote: This could be DNS issue. Try add 'mycurrenthostname

Re: [julia-users] Is the official name of the language Julia or julia?

2015-04-13 Thread cormullion
About that font: Twitter discussion with Muthu Nedumaran: https://twitter.com/typographica/status/572304422610452480 FontsInUse entry: http://fontsinuse.com/typefaces/38527/mn-latin

[julia-users] Re: non-concatenating vector creation

2015-04-13 Thread Matt Bauman
Is this what you're after? I think this should still work after the concatenation change is applied. julia Any[1,2,[3,4]] 3-element Array{Any,1}: 1 2 [3,4] On Monday, April 13, 2015 at 8:55:19 AM UTC-4, Tamas Papp wrote: Hi, I have been following issue 7128 [1] and the related other

Re: [julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Mauro
Why can you not make it into a function? function foo!(spec::Symbol, A, i) A[i,spec] = 1 end function foo!{T:Real}(spec::Vector{(Symbol,T), A, i) @assert(isapprox(sum(map(x - x[2],spec)),1)) for (obs,prob) = spec A[i,obs] = prob end A[i,spec] = 1 end foo!(spec,

Re: [julia-users] how to test if object is a Vector{(Symbol,T)} with T : Real

2015-04-13 Thread Tamas Papp
Thanks. Is there a local solution that does not interfere with the namespace? Best, Tamas On Mon, Apr 13 2015, Toivo Henningsson toivo@gmail.com wrote: You could make a typealias with a type parameter T for your type and check against that with isa.

Re: [julia-users] Re: in-place matrix division

2015-04-13 Thread Andrei Berceanu
The problem is, as I loop though my parameter space, I need to solve a lot of linear systems of the type \(A,B), where B stays the same but A changes depending on the parameters. Therefore a method that overwrites B doen't really help. On Friday, April 10, 2015 at 6:19:34 PM UTC+2, Andreas

[julia-users] non-concatenating vector creation

2015-04-13 Thread Tamas Papp
Hi, I have been following issue 7128 [1] and the related other issues, and noticed that constructs like [1,2,[3,4]] give a warning in the dev version I am using at the moment (v0.4.0-dev+4219), but I am wondering if there is a construct that I can use for non-concatenating vector creation _at the

[julia-users] Re: Problem with addprocs

2015-04-13 Thread wildart
This could be DNS issue. Try add 'mycurrenthostname xxx.xxx.xxx.xxx' to the 'hosts' file. On Monday, April 13, 2015 at 6:10:11 AM UTC-4, John wrote: I'm unable to add a remote instance using addprocs (or a machine file). This works (without prompt): ssh xxx.xxx.xxx.xxx This command hangs

Re: [julia-users] code review: my first outer constructor :)

2015-04-13 Thread Andrei Berceanu
Hi Gabriel, thanks a lot for your reply! (1) I use the WaveFunction type inside the Spectrum type, which as you can see is a collection of wavefunctions. For a typical usage case, have a look at http://nbviewer.ipython.org/github/berceanu/topo-photon/blob/master/anc/exploratory.ipynb I am not

Re: [julia-users] Julia gets a mention in phys.org

2015-04-13 Thread Ivan Ogasawara
very interesting! 2015-04-13 13:30 GMT-03:00 René Donner li...@donner.at: You can find more information on Picture here: http://mrkulk.github.io/www_cvpr15/ Am 13.04.2015 um 18:24 schrieb Seth catch...@bromberger.com: http://phys.org/news/2015-04-probabilistic-lines-code-thousands.html

[julia-users] Re: pre-allocation for sparse matrices

2015-04-13 Thread Andrei Berceanu
Yes but so how do I update it inplace? On Monday, April 13, 2015 at 5:37:50 PM UTC+2, Kristoffer Carlsson wrote: If you have the same sparse structures in your matrices then it should be sufficient to to the IJV - CSC sparse matrix conversion only once and then update A in place instead of

Re: [julia-users] Is the official name of the language Julia or julia?

2015-04-13 Thread Stefan Karpinski
Thanks for the additional info! On Mon, Apr 13, 2015 at 10:45 AM, cormull...@mac.com wrote: About that font: Twitter discussion with Muthu Nedumaran: https://twitter.com/typographica/status/572304422610452480 FontsInUse entry: http://fontsinuse.com/typefaces/38527/mn-latin

[julia-users] Method fieldnames not defined

2015-04-13 Thread 'Antoine Messager' via julia-users
Hi, I would like to find the field of SolverResults{Float64}. So according to the manual http://julia.readthedocs.org/en/latest/manual/types/, I just need to use the method fieldnames but unfortunately it is not defined. What can I do? Thank you, Antoine

[julia-users] Re: Error using pcolor

2015-04-13 Thread Tim Wheeler
The same code works fine on my machine. Maybe try running Pkg.update()?

[julia-users] Julia gets a mention in phys.org

2015-04-13 Thread Seth
http://phys.org/news/2015-04-probabilistic-lines-code-thousands.html Joining Kulkarni on the paper are his adviser, professor of brain and cognitive sciences Josh Tenenbaum; Vikash Mansinghka, a research scientist in MIT's Department of Brain and Cognitive Sciences; and Pushmeet Kohli of

Re: [julia-users] Is the official name of the language Julia or julia?

2015-04-13 Thread cormullion
The only remaining question is the significance of the four colored circles in the logo... :) Where's a symbologist when you need one?

Re: [julia-users] string processing after readdlm

2015-04-13 Thread Stefan Karpinski
No need to apologize – I was just trying to figure out if there was supposed to be an image there or something. On Mon, Apr 13, 2015 at 11:58 AM, JKpie fablekil...@gmail.com wrote: Thank you very much Mauro and Peter, hdf5 and JLD is a good solution. I just didn't know if it was a standard

Re: [julia-users] string processing after readdlm

2015-04-13 Thread Peter Simon
Also, if you don't need a .csv file, consider using the HDF5 and JLD packages which preserve the types of stored values: julia a = [1.,2.,3.,4] 4-element Array{Float64,1}: 1.0 2.0 3.0 4..0 julia b = Vector{Float64}[copy(a),2*copy(a),3*copy(a)] 3-element Array{Array{Float64,1},1}:

Re: [julia-users] Problem with addprocs

2015-04-13 Thread René Donner
Can you try whether using tunnel = true helps? http://docs.julialang.org/en/release-0.3/stdlib/parallel/#Base.addprocs When tunnel==false (the default), the workers need to be able to see each other directly, which will not work through firewalls which allow only ssh etc. Am 13.04.2015 um

[julia-users] Re: pre-allocation for sparse matrices

2015-04-13 Thread Kristoffer Carlsson
If you have the same sparse structures in your matrices then it should be sufficient to to the IJV - CSC sparse matrix conversion only once and then update A in place instead of generating a new IJV and converting to CSC again and again.

Re: [julia-users] Method fieldnames not defined

2015-04-13 Thread Stefan Karpinski
You are probably on Julia 0.3.x in which this function was called `names`. You can either use `names` or use the Compat package which lets you use names from the future. On Mon, Apr 13, 2015 at 11:37 AM, 'Antoine Messager' via julia-users julia-users@googlegroups.com wrote: Hi, I would like