Re: [julia-users] Change array of arrays to a one dimensional array

2015-03-18 Thread Sisyphuss
I'd like to know how to create an array of array... On Wednesday, March 18, 2015 at 2:03:48 AM UTC+1, Andreas Noack wrote: new_array = vcat(data...) 2015-03-17 20:59 GMT-04:00 Christopher Fisher fish...@miamioh.edu javascript:: Hi all- pmap outputs the results as an array of arrays

Re: [julia-users] parse() and line numbers

2015-03-18 Thread cormullion
Thanks, Isaiah. I see there's already an issue for this at https://github.com/jakebolewski/JuliaParser.jl/issues/4.

Re: [julia-users] Parallel performance test question

2015-03-18 Thread Andreas Noack
It has caused a lot of frustration. See #9118. I think the easiest right now is for p in procs() @spawnat p blas_set_num_threads(k) end 2015-03-17 23:19 GMT-04:00 Sheehan Olver dlfivefi...@gmail.com: Hi, I've created the following to test the performance of parallel processing on our

Re: [julia-users] Concatenating ArrayViews

2015-03-18 Thread Ján Dolinský
Hi Tim, Indeed, ChainedVectors is an excellent start. It implements the desired functionality but purely for vectors. What I am looking for could be called ChainedMatrices. Thanks for the tip. Best Regards, Jan Dňa utorok, 17. marca 2015 11:49:55 UTC+1 Tim Holy napísal(-a): Not currently,

[julia-users] fill array

2015-03-18 Thread pip7kids
Hi I want to fill an array based on a condition - eg a = [] z = [1,2,3,4] for i = 1:length(z) if i 2 continue end end so, I would now like to see the values 1 2 in my array a Regards

[julia-users] Re: fill array

2015-03-18 Thread Konstantin Markov
julia a = [i for i=filter(x-x3,z)] 2-element Array{Any,1}: 1 2 On Wednesday, March 18, 2015 at 8:31:57 PM UTC+9, pip7...@gmail.com wrote: Hi I want to fill an array based on a condition - eg a = [] z = [1,2,3,4] for i = 1:length(z) if i 2 continue end end so, I

Re: [julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
Thank you for the link. However, I am familiar with interpolation. What I don't understand is how you change `test2` in order to use it. Because there's no quote directly in that macro, Julia will complain about using '$' in a non-quoted expression. On Wednesday, March 18, 2015 at 8:37:25 AM

[julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
If I do something simple like: macro test() :(parsefloat(3.1459)) end @test() # 3.1459 everything works as expected. However, if I try this instead: macro test2(ex) ex end @test2(:(parsefloat(3.1459))) # :(parsefloat(3.1459)) Not what I expected, but it makes sense what's happening:

[julia-users] Re: inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
After some thought, I realized that the easiest way to unquote is to reach inside the Expr and pull out what is needed. If I do a dump of `ex` I get: Expr head: Symbol quote args: Array(Any,(1,)) 1: Expr head: Symbol call args: Array(Any,(2,)) 1: Symbol parsefloat

Re: [julia-users] Concatenating ArrayViews

2015-03-18 Thread Tim Holy
I don't think it exists, but the point is...you could start the ChainedMatrices package, building on the example of ChainedVectors :-). --Tim On Wednesday, March 18, 2015 01:39:26 AM Ján Dolinský wrote: Hi Tim, Indeed, ChainedVectors is an excellent start. It implements the desired

[julia-users] Re: fill array

2015-03-18 Thread René Donner
or simply a = filter(x-x3, z) Am Mittwoch, 18. März 2015 12:46:52 UTC+1 schrieb Konstantin Markov: julia a = [i for i=filter(x-x3,z)] 2-element Array{Any,1}: 1 2 On Wednesday, March 18, 2015 at 8:31:57 PM UTC+9, pip7...@gmail.com wrote: Hi I want to fill an array based on a

Re: [julia-users] inserting an Expr into AST via macro

2015-03-18 Thread Isaiah Norton
See http://docs.julialang.org/en/release-0.3/manual/metaprogramming/#interpolation On Mar 18, 2015 8:08 AM, Abe Schneider abe.schnei...@gmail.com wrote: If I do something simple like: macro test() :(parsefloat(3.1459)) end @test() # 3.1459 everything works as expected. However, if I

[julia-users] Re: inserting an Expr into AST via macro

2015-03-18 Thread Abe Schneider
Unfortunately my solution only works if you pass in an expression directly. If you try something like this: val = :(parsefloat(3.1459)) @test2(val) It will fail, since `val` is a symbol. Any other ideas? The reason I'm trying to solve the problem in the first place is that I have semantic

Re: [julia-users] Change array of arrays to a one dimensional array

2015-03-18 Thread René Donner
You mean as a literal? Any[[1,2], [4,5,6]] will give you: 2-element Array{Any,1}: [1,2] [4,5,6] Or when you want to create that array of array programmatically: julia [ones(2) for i in 1:2] 2-element Array{Array{Float64,1},1}: [1.0,1.0] [1.0,1.0] Am Mittwoch, 18. März 2015

[julia-users] Re: fill array

2015-03-18 Thread René Donner
You can achieve this with filter: http://docs.julialang.org/en/release-0.3/stdlib/collections/?highlight=filter#Base.filter Am Mittwoch, 18. März 2015 12:31:57 UTC+1 schrieb pip7...@gmail.com: Hi I want to fill an array based on a condition - eg a = [] z = [1,2,3,4] for i = 1:length(z)

Re: [julia-users] ImageView and the Can't find usable init.tcl vs GTK

2015-03-18 Thread Tim Holy
If you want to try to fix this, I recommend some reading: http://docs.julialang.org/en/latest/manual/modules/ and start tweaking the source code at places corresponding to those error messages. Best, --Tim On Tuesday, March 17, 2015 03:42:27 PM J Luis wrote: Unfortunately none of those make a

[julia-users] Re: Some simple use cases for multi-threading

2015-03-18 Thread Simon Byrne
On Saturday, 14 March 2015 13:06:26 UTC, John wrote: My main use cases involve operations that I want to parallelize over the last dimension of an array. I think this is a nice straightforward case, and something that a lot of other vector math libraries do (e.g. I believe that Intel's MKL

[julia-users] Re: fill array

2015-03-18 Thread pip7kids
Thanks everybody - got it! Regards On Wednesday, 18 March 2015 12:04:48 UTC, René Donner wrote: or simply a = filter(x-x3, z) Am Mittwoch, 18. März 2015 12:46:52 UTC+1 schrieb Konstantin Markov: julia a = [i for i=filter(x-x3,z)] 2-element Array{Any,1}: 1 2 On Wednesday, March

[julia-users] Re: fill array

2015-03-18 Thread René Donner
I am not sure what you mean - are you expecting a different behavior than this? Both z and a are containing what they should. julia z = [1,2,3,4] 4-element Array{Int64,1}: 1 2 3 4 julia a = filter(x-x3, z) 2-element Array{Int64,1}: 1 2 julia z 4-element Array{Int64,1}: 1 2 3 4 julia

Re: [julia-users] ImageView and the Can't find usable init.tcl vs GTK

2015-03-18 Thread J Luis
Sorry, doing to many things at same time and didn't realize that the Graphics not defined was an easy to fix issue. But now I'm getting different ones that I wont be able to fix. Besides many warning of the type Warning: New definition

Re: [julia-users] Parallel performance test question

2015-03-18 Thread Sheehan Olver
Ok I'll give it a shot! Though in my context I can't see a good reason that k is not just auto evaluated first... Sent from my iPad On 18 Mar 2015, at 8:29 pm, Andreas Noack andreasnoackjen...@gmail.com wrote: It has caused a lot of frustration. See #9118. I think the easiest right now

[julia-users] Re: fill array

2015-03-18 Thread pip7kids
One thing I forgot to ask is what if I wan to keep the array as it is and then add to it ...if I run a = filter(x-x3, z) ... it overwrites the array. Regards On Wednesday, 18 March 2015 14:04:45 UTC, pip7...@gmail.com wrote: Thanks everybody - got it! Regards On Wednesday, 18 March

Re: [julia-users] Re: Time type

2015-03-18 Thread Seth
Apropos? https://www.youtube.com/watch?v=-5wpm-gesOY On Saturday, March 14, 2015 at 7:28:23 AM UTC-7, Stefan Karpinski wrote: There are no leap seconds in universal time. There are leap seconds in UTC which bridges terrestrial time (SI seconds) with universal time (day = 1 earth rotation;

Re: [julia-users] Some simple use cases for multi-threading

2015-03-18 Thread James Fairbanks
Where are you working on atomics? On Tuesday, March 17, 2015 at 3:21:39 PM UTC-4, Kiran Pamnany wrote: The threading model is loop parallelism--OpenMP-like parallel blocks and for loops with static scheduling only (for now). There are three forms, demonstrated in test/threads.jl. I'm

Re: [julia-users] Working with a custom type - questions

2015-03-18 Thread Chris
Thanks all for your input, I realize now this is still somewhat of a gray area. What I ended up doing was just adding a couple convert methods, and a promotion rule. It's a relatively simple type, so that was sufficient for my purposes. The tip to use a parametric type for Arrays was

[julia-users] gadfly plot of array with single nonzero element

2015-03-18 Thread Andrei Berceanu
Trying to plot a Matrix with a single nonzero element in Gadfly using *using Gadflya = zeros(Float64, 10,10);a[5,5] = 1;spy(a)* The result is shown in the attached figure. How can I convince Gadfly to show me also the zero values, in order to see the whole array, not just one element? To

[julia-users] Re: Some simple use cases for multi-threading

2015-03-18 Thread Sebastian Good
Task stealing parallelism is an increasingly common use case and easy to program. e.g. Cilk, Grand Central Dispatch, On Thursday, March 12, 2015 at 11:52:37 PM UTC-4, Viral Shah wrote: I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push

[julia-users] Linking directly with LLVM generated bytecode

2015-03-18 Thread Sebastian Good
I've compiled a separate set of functions with another LLVM-based toolchain (in this case Intel's SPMD compiler, ispc). If I have it emit LLVM byte code (i.e. as a .bc file), is it possible to link that LLVM code directly into a Julia session? I can compile the library into a dynamic library,

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-03-18 Thread David van Leeuwen
On a somewhat related note: if you really require non-integer indices, you can always try NamedArrays: using NamedArrays m = NamedArray(rand(4), ([1//1, 1//2, 1//3, 1//4],), (weird,)) m[1//1] m[1//2] == m[2//4] m[1//4] == m[4] ---david On Monday, March 16, 2015 at 8:50:13 AM UTC+1, Mauro

Re: [julia-users] Re: Some simple use cases for multi-threading

2015-03-18 Thread Jacob Quinn
+1 to Mike's suggestion. I've looked into incorporating his auto-complete functionality into Sublime-IJulia, but the lag/locking up is a deal killer. On Wed, Mar 18, 2015 at 4:35 PM, Mike Innes mike.j.in...@gmail.com wrote: In eval clients like Juno autocomplete locks up while evaluating, so

[julia-users] Experiences from running a small Julia tutorial + online notebooks

2015-03-18 Thread Scott T
A few days ago, I ran a short introduction to Julia talk and tutorial for the Institute of Astronomy at the University of Cambridge. The audience consisted mostly of other students, with a few post-docs. Astronomers as a group use a wide range of programming tools, from Fortran through to

Re: [julia-users] Re: Some simple use cases for multi-threading

2015-03-18 Thread Mike Innes
In eval clients like Juno autocomplete locks up while evaluating, so that's something I'm looking forward to solving with some thready goodness. Not quite GUI as such but close. On 18 Mar 2015 18:12, Sebastian Good sebast...@palladiumconsulting.com wrote: Task stealing parallelism is an

Re: [julia-users] Re: inserting an Expr into AST via macro

2015-03-18 Thread Jameson Nash
writing a code snippet like val = :(parsefloat(3.1459)) @test2(val) is perhaps a great way to confuse yourself, although it is a common mistake. the problem is that it makes it seem like the two arguments execute in sequence, whereas the macro expansion pass actually runs prior to the code

Re: [julia-users] Experiences from running a small Julia tutorial + online notebooks

2015-03-18 Thread Kyle Barbary
Thanks for the report, and the notebooks. Nice to see some other astronomers using (or at least hearing about) Julia. - Kyle

[julia-users] Maple's conformal plot of a complex function

2015-03-18 Thread Shivkumar Chandrasekaran
Before I re-invent the wheel, is there something similar to Maple's plot[conformal] for conformal plotting of a complex function in Julia? Here is the relevant Maple help page: http://www.maplesoft.com/support/help/Maple/view.aspx?path=plots%2fconformal If not, what is the best/good starting

Re: [julia-users] Unable to find were it breaks IUP (0.4 after 0.4.0-dev+3703)

2015-03-18 Thread Jameson Nash
Thanks for checking. I seem to be able to trivially reproduce on linux too. Issue filed: https://github.com/JuliaLang/julia/issues/10570 On Sun, Mar 15, 2015 at 11:06 PM J Luis jmfl...@gmail.com wrote: The changes referred in

Re: [julia-users] Linking directly with LLVM generated bytecode

2015-03-18 Thread Isaiah Norton
Start with Base.llvmcall. It is not documented, yet, but there are some examples in the tests: https://github.com/JuliaLang/julia/blob/master/test/llvmcall.jl The codegen part is in src/ccall.cpp. On Wed, Mar 18, 2015 at 2:30 PM, Sebastian Good sebast...@palladiumconsulting.com wrote: I've

Re: [julia-users] Re: Time type

2015-03-18 Thread Jacob Quinn
Here's 50 lines that implement the bulk of the functionality. Might be worth just throwing this in Base since it's so simple. (this is 0.4 compatible, you'll want to do just `using Dates` for 0.3) using Base.Dates immutable Time value::Millisecond end MS(x) = Millisecond(x) value(x::Time)

Re: [julia-users] ImageView and the Can't find usable init.tcl vs GTK

2015-03-18 Thread Tim Holy
Presumably that branch needs to make use of Compat. --Tim On Wednesday, March 18, 2015 08:26:24 AM J Luis wrote: Sorry, doing to many things at same time and didn't realize that the Graphics not defined was an easy to fix issue. But now I'm getting different ones that I wont be able to fix.

[julia-users] intel compiler builded julia

2015-03-18 Thread Wen Ling
Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen

[julia-users] automatic parallelization with sambamba on llvm ...

2015-03-18 Thread cdm
quite interesting: http://www.sciencedaily.com/releases/2015/03/150312082830.htm enjoy !!! cdm

[julia-users] Re: fill array

2015-03-18 Thread pgs
Hi I guess what I'm trying to say is that if array a started life as [11,12,13,14] - then if we use filter(x-x3, z) which returns 1,2 - I would like 1,2 added to array a resulting in a array being . [11,12,13,14,1,2] or [1,2,11,12,13,14] Regards On Wednesday, March 18, 2015 at 3:05:54 PM

[julia-users] Re: Overloading Base functions or creating new ones?

2015-03-18 Thread David van Leeuwen
I'd be interested to know a case where confusion could arise. ---david On Monday, March 16, 2015 at 4:15:22 PM UTC+1, Patrick O'Leary wrote: On Monday, March 16, 2015 at 10:09:40 AM UTC-5, David van Leeuwen wrote: Related to this question: what if you want to use the name of a base

Re: [julia-users] fill array

2015-03-18 Thread René Donner
julia z = [1,2,3,4] ... julia a = filter(x-x3, z) ... julia c = [a;z] 6-element Array{Int64,1}: 1 2 1 2 3 4 I think you will find most of what you need in http://docs.julialang.org/en/release-0.3/manual/arrays/ Am 18.03.2015 um 20:55 schrieb pgs philsiv...@googlemail.com: Hi I guess

Re: [julia-users] Re: Overloading Base functions or creating new ones?

2015-03-18 Thread Mauro
I'd be interested to know a case where confusion could arise. I remember that I got confused by a python library using the bit-shift operator for writing to files (C++ style). Got me confused for sure. I think it makes sense that typing, say, ?map should give you a help text which applies to