Re: [julia-users] Re: Cell array of images like Matlab

2016-09-09 Thread El suisse
julia version??? julia>versioninfo() ​ 2016-09-09 21:19 GMT-03:00 Drew Mahedy : > In Julia, if I try and concatenate two images together of type: > > Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via > > cat( 3, img, img ), > > I get the following error: > >

[julia-users] Re: Parallel computing and type-stability

2016-09-09 Thread Sleort
@Yichao Yu: Sure. I'm aware that there is a lot of overhead in the inter process communication. This was just a minimal test case, not something I expect to run fast(er). (A silly nworker() implementation indeed;-)) I was just curious if it is possible to reduce the type instability showing up

Re: [julia-users] IBM Power port

2016-09-09 Thread Viral Shah
One more nightly on power: http://s3.amazonaws.com/julianightlies/bin/linux/ppc64le/0.6/julia-0.6.0-5f91c39b1c-linuxppc64.tar.gz With this PR being merged, I am hoping 0.5 will build fine on the powerpc buildbot, and that we should start getting regular nightlies (until something break).

[julia-users] Cannot start Julia in Atom

2016-09-09 Thread Yuanchu Dang
ERROR: LoadError: ArgumentError: Juno not found in path in require at loading.jl:249 in include at boot.jl:261 in include_from_node1 at loading.jl:320 in process_options at client.jl:280 in _start at client.jl:378 while loading C:\Users\think\.atom\packages\julia-client\script\boot.jl, in

[julia-users] Installation error

2016-09-09 Thread Yuanchu Dang
Was told: Error installing Atom.jl package Go to the Packages → Julia → Open Terminal menu and run `Pkg.add("Atom")` in Julia, then try again. If you still see an issue, please report it to: julia-users@googlegroups.com But doesn't work:

[julia-users] Re: newest stable version of julia on EC2 AWS instances - starcluster

2016-09-09 Thread Michael Prentiss
I do not know an answer, but you may want to use the amazon cluster generator (cfncluster). It is under constant development, unlike starcluster. It may be easier. https://github.com/awslabs/cfncluster On Friday, September 9, 2016 at 7:21:33 PM UTC-5, Alexandros Fakos wrote: > > Hi, > > I

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread Yichao Yu
On Fri, Sep 9, 2016 at 9:03 PM, Yichao Yu wrote: > > > On Fri, Sep 9, 2016 at 8:36 PM, K leo wrote: > >> Bart, >> >> Can you explain what you mean by "need to be rooted"? The jl_new_struct >> statement as Isaiah suggested works, why do we need the

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread Yichao Yu
On Fri, Sep 9, 2016 at 8:36 PM, K leo wrote: > Bart, > > Can you explain what you mean by "need to be rooted"? The jl_new_struct > statement as Isaiah suggested works, why do we need the additional > statements as you suggested? > Because it doesn't, it'll segfault at any

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread K leo
Bart, Can you explain what you mean by "need to be rooted"? The jl_new_struct statement as Isaiah suggested works, why do we need the additional statements as you suggested? On Saturday, September 10, 2016 at 3:38:27 AM UTC+8, Bart Janssens wrote: > > > > On Fri, Sep 9, 2016 at 6:44 PM

[julia-users] newest stable version of julia on EC2 AWS instances - starcluster

2016-09-09 Thread Alexandros Fakos
Hi, I am trying to run julia in parallel on EC2 AWS. I use the starcluster package to create a cluster of instances. The problem is that the instances have already installed the 0.3.0 prerelease. I log in the starcluster master node and use the instructions from

[julia-users] Re: Cell array of images like Matlab

2016-09-09 Thread Drew Mahedy
In Julia, if I try and concatenate two images together of type: Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via cat( 3, img, img ), I get the following error: Only two-dimensional images are supported On Wednesday, September 7, 2016 at 7:24:14 PM UTC-7, Uwe Fechner wrote: > >

[julia-users] Re: Cell array of images like Matlab

2016-09-09 Thread Drew Mahedy
In Julia, if I try and concatenate two images together of type: Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2} via cat( 3, img, img ), I get the following error: Only two-dimensional images are supported On Friday, September 9, 2016 at 5:01:39 PM UTC-7, Drew Mahedy wrote: > >

[julia-users] Re: Cell array of images like Matlab

2016-09-09 Thread Drew Mahedy
Here is what the code looks like in MATLAB: AA = cell( size(trimcoorddir,1), 1 ); figpathdir2 = dir( strrep( figpath2, '\', filesep ) ); fignames2 = {figpathdir2.name}; for i = 1:length(trimcoorddir); if all( strcmp( fignames2, trimcoord{i}.filename ) == 0 ); A = imread( strrep(

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread K leo
Thanks again. What is jl_init("/Users/inorton/git/jl71/usr/lib/")? On Saturday, September 10, 2016 at 12:44:32 AM UTC+8, Isaiah wrote: > > (Disregard my suggestion about `Ptr{TestType}`, `jl_call1` only takes > boxed arguments so that won't work) > > The problem is that the passed argument type

[julia-users] Re: whole arrays pass by reference while matrix columns by value?

2016-09-09 Thread Alexandros Fakos
thank you all for your helpful suggestions! alex On Wednesday, September 7, 2016 at 7:00:00 PM UTC-5, Alexandros Fakos wrote: > > Hi, > > a=rand(10,2) > b=rand(10) > sort!(b) modifies b > but sort!(a[:,1]) does not modify the first column of matrix a > > why is that? Does this mean that i cannot

[julia-users] Re: Parallel computing and type-stability

2016-09-09 Thread Richard Dennis
When I run this code in Julia 0.5.0-rc4 the code is much shorter and most of the red indicating type instability is gone. Cheers.

[julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-09 Thread Chris Rackauckas
Yes, you can checkout a branch of the repository via Pkg.checkout("Package","branch"). Note that the default is for the master branch, i.e. Pkg.checkout("ProfileView") will checkout master. This will put you on the "current up-to-date" branch, which could be different than the most recent

[julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-09 Thread Neal Becker
Chris Rackauckas wrote: > Did you checkout master? > No I just did Pkg.add("ProfileView"). I don't actually know how to do otherwise - is that a Pkg option? > On Friday, September 9, 2016 at 2:55:21 PM UTC-7, Neal Becker wrote: >> >> using ProfileView >> INFO: Precompiling module

[julia-users] Re: Maps in Julia?

2016-09-09 Thread Andy Ferris
> > ... and transform geographic coordinates (GNSS logger lat, lon) to UTM > (cartesian, unit = metre) by calling libgeographic. > Geodesy.jl now has a native port of libgeographics UTM conversion code - you might possibly find that convenient. Andy

[julia-users] Re: Running octave scrips from julia

2016-09-09 Thread Chris Rackauckas
You accidentally revived a >1 year old thread. On Friday, September 9, 2016 at 4:32:56 AM UTC-7, Steven G. Johnson wrote: > > > > On Friday, February 6, 2015 at 2:03:23 PM UTC-5, astromono wrote: >> >> in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245 >> > > I think you must

[julia-users] Re: Running octave scrips from julia

2016-09-09 Thread Chris Rackauckas
I guess not >1 year, but getting close to a year. On Friday, September 9, 2016 at 4:32:56 AM UTC-7, Steven G. Johnson wrote: > > > > On Friday, February 6, 2015 at 2:03:23 PM UTC-5, astromono wrote: >> >> in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245 >> > > I think you

[julia-users] Re: ProfileView not compatible with julia-0.5?

2016-09-09 Thread Chris Rackauckas
Did you checkout master? On Friday, September 9, 2016 at 2:55:21 PM UTC-7, Neal Becker wrote: > > using ProfileView > INFO: Precompiling module ProfileView. > WARNING: Module Compat with uuid 314389968181888 is missing from the > cache. > This may mean module Compat does not support

[julia-users] ProfileView not compatible with julia-0.5?

2016-09-09 Thread Neal Becker
using ProfileView INFO: Precompiling module ProfileView. WARNING: Module Compat with uuid 314389968181888 is missing from the cache. This may mean module Compat does not support precompilation but is imported by a module that does. ERROR: LoadError: Declaring __precompile__(false) is not allowed

Re: [julia-users] Re: Why is BLAS.dot slower than BLAS.axpy!?

2016-09-09 Thread Sheehan Olver
I did blas_set_num_threads(1) with the same profile numbers. This is using Apple’s BLAS. Maybe I’ll try 0.5 and OpenBLAS for comparison. > On 10 Sep 2016, at 2:34 AM, Andreas Noack > wrote: > > Try to time it again with threading disabled. Sometimes the

[julia-users] Re: Parallel computation of Array of user-defined types

2016-09-09 Thread amiksvi
Thanks German, indeed I have seen that SharedArrays couldn't be used for user-defined types... I tried to compare the approach you suggested with the serial one, and results are so awfully slow with the parallel version that I might have done something wrong... Here it is: @everywhere type T a

[julia-users] Re: "WARNING: replacing module" when invoking function with @everywhere - but module not available otherwise

2016-09-09 Thread Adrian Salceanu
Thanks for the info and for the link, it's a good read. I wonder if anybody else has run into the issues Tim Holy mentions, with @everywhere using X. Cheers! vineri, 9 septembrie 2016, 20:23:22 UTC+2, Patrick Belliveau a scris: > > Hi, > Running your code effectively executes > >

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread Bart Janssens
On Fri, Sep 9, 2016 at 6:44 PM Isaiah Norton wrote: >// construct a TestType instance > > jl_value_t* jl_A = > jl_new_struct((jl_datatype_t*)jl_get_function((jl_module_t*)mod, > "TestType"), > jl_box_float64(A.a), >

[julia-users] Re: Maps in Julia?

2016-09-09 Thread Kaj Wiik
Wow, that's interesting! Thanks for pointing that out! On Friday, September 9, 2016 at 4:28:12 PM UTC+3, Michael Borregaard wrote: > > You can open esri shapefiles with shapefiles.jl. There is a plotting > function for shapefiles in plotrecipes.jl. You can layer shapefiles to > create vector

[julia-users] Re: "WARNING: replacing module" when invoking function with @everywhere - but module not available otherwise

2016-09-09 Thread Patrick Belliveau
Hi, Running your code effectively executes @everywhere using HttpServer This is known to generate those method redefinition warnings. The behaviour of using in a parallel environment is a known unresolved bug. It seems like the best syntax to use right now is import HttpServer #Executed

Re: [julia-users] Re: idiom for standard basis vector (eg [0,1,0])

2016-09-09 Thread Erik Schnetter
Here is something short: ```Julia bv(i,n) = [j==i for j in 1:n] ``` This returns a vector of `Bool`. In Julia, `Bool` is a numeric type that is automatically promoted to `Int` / `Float` / etc. where necessary. If you want, you can add an explicit type (e.g. `Float64`) in front of the array

[julia-users] Re: idiom for standard basis vector (eg [0,1,0])

2016-09-09 Thread Matt Bauman
You could implement: Base.getindex(U::UniformScaling, I::AbstractArray, j::Int) = [U[i,j] for i in I] Base.getindex(U::UniformScaling, i::Int, J::AbstractArray) = [U[i,j] for j in J] Base.getindex(U::UniformScaling, I::AbstractArray, J::AbstractArray) = [U[i, j] for i in I, j in J] Then:

[julia-users] "WARNING: replacing module" when invoking function with @everywhere - but module not available otherwise

2016-09-09 Thread Adrian Salceanu
Hi, I'm fumbling around with a little script with the end goal of running HttpServer handlers on multiple ports, in parallel, with each handler on a separate worker. The code looks like this: # parallel_http.jl using HttpServer function serve(port::Int) http = HttpHandler() do

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Steven G. Johnson
On Friday, September 9, 2016 at 11:47:45 AM UTC-4, Christoph Ortner wrote: > > Because I want to reinterpret it as a Vector of fixed size arrays. Can > this be done with a PyArray directly? (I can't try it out right now) No.

[julia-users] Re: idiom for standard basis vector (eg [0,1,0])

2016-09-09 Thread Steven G. Johnson
On Friday, September 9, 2016 at 11:56:58 AM UTC-4, Christoph Ortner wrote: > > I predict that - right now - somebody is writing an answer explaining why > this is terrible and you need an abstract array type with lazy evaluation. > ;) Well, we already have the built-in constant I. I[i,j] is

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread Isaiah Norton
(Disregard my suggestion about `Ptr{TestType}`, `jl_call1` only takes boxed arguments so that won't work) The problem is that the passed argument type does not match any available method (because it isn't actually passed a julia type at all) so `jl_call1` silently gives up. The `jl_call*` methods

[julia-users] Re: Parallel computation of Array of user-defined types

2016-09-09 Thread Germán Aquino
I usually use a combination of @spawn and fetch. @spawn fires a lightweigth task that can return a value of any type, which can be collected by the main thread with fetch: refs = Vector{RemoteRef}(N) for i in 1:N refs[i] = @spawn begin doSomethingAndReturnValueOfTypeT end end for i in 1:N v[i]

[julia-users] Re: Why is BLAS.dot slower than BLAS.axpy!?

2016-09-09 Thread Andreas Noack
Try to time it again with threading disabled. Sometimes the threading heuristics can cause unintuitive performance. On Friday, September 9, 2016 at 6:39:13 AM UTC-4, Sheehan Olver wrote: > > > I have the following code that is part of a Householder routine, where > j::Int64, > N::Int64,

Re: [julia-users] Parallel computing and type-stability

2016-09-09 Thread Yichao Yu
On Fri, Sep 9, 2016 at 12:07 PM, Sleort wrote: > I've been playing around with the parallel functionality of Julia (0.4.6) > in order to get a better understanding of it. Just for the sake of testing, > I made a "silly" nworkers() implementation like > julia> function

[julia-users] Parallel computing and type-stability

2016-09-09 Thread Sleort
I've been playing around with the parallel functionality of Julia (0.4.6) in order to get a better understanding of it. Just for the sake of testing, I made a "silly" nworkers() implementation like julia> function silly_nworkers() @parallel (+) for p in workers() 1 end end which, as

[julia-users] idiom for standard basis vector (eg [0,1,0])

2016-09-09 Thread Christoph Ortner
I predict that - right now - somebody is writing an answer explaining why this is terrible and you need an abstract array type with lazy evaluation. ;)

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Christoph Ortner
Because I want to reinterpret it as a Vector of fixed size arrays. Can this be done with a PyArray directly? (I can't try it out right now)

[julia-users] PyPlot x(y)tick label fontsize

2016-09-09 Thread Ralph Smith
ax[:tick_params]("both",labelsize=24) See http://matplotlib.org/api/pyplot_api.html for related functions and arguments.

[julia-users] Re: [julia-dev] Convert a dense matrix A into a sparse matrix with sparsevec(A)

2016-09-09 Thread Cameron McBride
This thread is old, but I was poking through some unread bits and found it. Beyond that, it’s likely a better question for julia-users list (which I’m including here). Anyhow, the answer is that sparsevec converts a dense matrix into a sparse matrix format where zero values are not explicitly

[julia-users] Precompilation (using usrimg.jl) of pkg using binary lib

2016-09-09 Thread Joaquim Masset Lacombe Dias Garcia
Hi all! I have a package which depends a external binary library(I will just write dll from now on), I want to figure out a way to call the dll in a way that if some user decides to precompile a system image with this library it can still work. My package is Xpress.jl (I know it wraps

Re: [julia-users] Re: basic question on structuring modules

2016-09-09 Thread Tamas Papp
Depends on what you want. If it is part of something larger but want to keep it in a separate file, you can just include it --- this is a standard solution for writing more complex modules. On Fri, Sep 09 2016, Neal Becker wrote: > K leo wrote: > >> The module name needs to be the same as the

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread Adrian Salceanu
If you don't want to use a module you will have to explicitly include the file using include(path::AbstractString) And the content of the file will be evaluated in the current context (providing mixin behavior). That should be OK for very short scripts / apps. For anything bigger you should

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread Adrian Salceanu
By convention, module names should be PascalCase. Thus, you'll end up with # Foo.jl module Foo function foo() end end Julia being case sensitive, there will be no name clashes. vineri, 9 septembrie 2016, 15:29:48 UTC+2, Neal Becker a scris: > > Let's say I have a simple module which

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread Neal Becker
K leo wrote: > The module name needs to be the same as the file, so in this case you need > to change the function name. > > On Friday, September 9, 2016 at 9:29:48 PM UTC+8, Neal Becker wrote: >> >> Let's say I have a simple module which contains 1 function called "foo" >> >> I might create

[julia-users] Re: basic question on structuring modules

2016-09-09 Thread K leo
The module name needs to be the same as the file, so in this case you need to change the function name. On Friday, September 9, 2016 at 9:29:48 PM UTC+8, Neal Becker wrote: > > Let's say I have a simple module which contains 1 function called "foo" > > I might create foo.jl that contains > >

[julia-users] PyPlot x(y)tick label fontsize

2016-09-09 Thread MLicer
Dear all, i am using PyPlot for a simple sine plot and i am trying to increase the fontsize of x(y) *tick* labels (*not* x(y) *axis* labes). The following code... using PyPlot # generate data: x = 0:0.01:30 sin_noise(arr) = sin(arr) + rand(length(arr)) # Create a figure fig =

[julia-users] Re: ANN: Julia 0.5.0-rc4 now available

2016-09-09 Thread Uwe Fechner
Nice work! The regression of RC3 on the load time packages is fixed. On Friday, September 9, 2016 at 9:39:38 AM UTC+2, Tony Kelman wrote: > > I have just tagged and uploaded release candidate 4 for Julia version > 0.5.0. Binaries are available from > > >

[julia-users] basic question on structuring modules

2016-09-09 Thread Neal Becker
Let's say I have a simple module which contains 1 function called "foo" I might create foo.jl that contains foo.jl module foo function foo ... end end This doesn't work, it seems the module name collides with the function name. foo.jl module foo_mod function foo ... end end This

[julia-users] Re: Maps in Julia?

2016-09-09 Thread Michael Borregaard
You can open esri shapefiles with shapefiles.jl. There is a plotting function for shapefiles in plotrecipes.jl. You can layer shapefiles to create vector maps. I am happy to help out if you want to use this.

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread K leo
Isaiah, Thanks for the reply. I tried your advice A, i.e. "change to an immutable on julia side, and change function signature to 'Ptr{TestType}'", and the code behaves the same as before, i.e. it compiles OK and runs OK but does not show the output of the println in the function. I guess

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Steven G. Johnson
On Friday, September 9, 2016 at 8:33:09 AM UTC-4, Christoph Ortner wrote: > > It now looks to me like the "problem" is with Python, not with PyCall; I > thought the assignment pyobj.X = X would be by reference, but apparently > it makes a copy ?!? > Converting an array from Julia to Python

Re: [julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread Isaiah Norton
In c, 'struct TestType' is plain old data, not a Julia type (jl_value_t). Either change to an immutable on julia side, and change function signature to 'Ptr{TestType}'; or allocate a 'jl_value_t*' with the correct type tag, and set the fields. On Friday, September 9, 2016, K leo

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Christoph Ortner
To partially answer my own question --- I just hadn't thought of this alternative route before --- the following seems to do it: X = pointer_to_array(Xpy.data, (Xpy.dims[2], Xpy.dims[1]), false) Are there any concerns associated with this other than the risk that Python might free the

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Christoph Ortner
It now looks to me like the "problem" is with Python, not with PyCall; I thought the assignment pyobj.X = X would be by reference, but apparently it makes a copy ?!? Alternatively, to achieve what I want I could do Xpy = PyArray( pyobj.X ) Now Xpy is really a reference to the array I want

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Christoph Ortner
Sorry - I was rushing when I wrote this. What I meant was: after the assignment pyobj["X"] = Xpy, if I modify X in-place, this modification does not seem to propagate to pyobj.X. I will try to put together an example.

[julia-users] idiom for standard basis vector (eg [0,1,0])

2016-09-09 Thread Tamas Papp
Is there a preferred constructor for standard basis vectors? Eg something equivalent to function sbvec(T, n, i) v = zeros(T, n) v[i] = one(T) v end Note that I am not implying that there should be one in Base etc. I would just avoid defining if already available, but could not find

[julia-users] Re: Inference and Core.Box - why is this happening?

2016-09-09 Thread Patrick Kofod Mogensen
I was referred to that issue earlier but didn't quite get why, but now I see it! Thanks. On Friday, September 9, 2016 at 1:02:27 PM UTC+2, Lutfullah Tomak wrote: > > Using a captured variable in a closure makes it somehow a Core.box. > Generator defines an anonymous with maxV so it is hitting

Re: [julia-users] Julia with fewer dependencies?

2016-09-09 Thread Joaquim Dias Garcia
Thanks! That is a great start! Joaquim > On 6 de set de 2016, at 03:24, Michele Zaffalon > wrote: > > Is this maybe what you are looking for > https://groups.google.com/d/msg/julia-users/WStpLtrKiFA/JhiAbc-vAwAJ? > >> On Mon, Sep 5, 2016 at 11:10 PM, Joaquim

[julia-users] Re: @profile does not allow variable assignment on v0.5

2016-09-09 Thread Florian Oswald
I'm pretty sure this behaved differently some time ago, because that was a piece of working code. It's not worth a bug report though. On Friday, 9 September 2016 13:19:12 UTC+2, Lutfullah Tomak wrote: > > I think it is on the way @profile defined makes it not processed in outer > scope > >

[julia-users] Re: Preferred MIME type for Julia

2016-09-09 Thread Steven G. Johnson
On Thursday, September 8, 2016 at 8:42:51 PM UTC-4, Fengyang Wang wrote: > > What is the standard MIME type for Julia code? > > My reading of the MIME standard leads to me think > application/x-julia > > is the accurate choice. However, I could only find few results on Google, > and Julia

[julia-users] Re: Assigning a field in Python via reference

2016-09-09 Thread Steven G. Johnson
On Friday, September 9, 2016 at 2:56:02 AM UTC-4, Christoph Ortner wrote > > (2) convert it to a PyArray (no copy) : > Xpy = PyArray(X) > > > (3) then assign this to a field of an object: > pyobj["X"] = Xpy orpyobj["X"] = Xpy.o or > > The aim is, when I modify X, then the data

[julia-users] Re: Running octave scrips from julia

2016-09-09 Thread Steven G. Johnson
On Friday, February 6, 2015 at 2:03:23 PM UTC-5, astromono wrote: > > in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245 > I think you must have pinned PyCall at some ancient version, because the current pyinit.jl file only has 115 lines.

[julia-users] Re: @profile does not allow variable assignment on v0.5

2016-09-09 Thread Lutfullah Tomak
I think it is on the way @profile defined makes it not processed in outer scope julia> macroexpand(:(@profile y = f(5))) quote # profile.jl, line 11: try # profile.jl, line 12: #10#status = (Base.Profile.start_timer)() # profile.jl, line 13: if #10#status < 0 # profile.jl,

Re: [julia-users] @profile does not allow variable assignment on v0.5

2016-09-09 Thread Yichao Yu
On Fri, Sep 9, 2016 at 6:04 AM, Florian Oswald wrote: > hi all, > > on v0.5-rc3, I see this > > *julia> **f(x)=x^3* > > *f (generic function with 1 method)* > > > *julia> **@profile y = f(5)* > > *125* > > > *julia> **y* > > *ERROR: UndefVarError: y not defined* > > > >

[julia-users] Re: Inference and Core.Box - why is this happening?

2016-09-09 Thread Lutfullah Tomak
Using a captured variable in a closure makes it somehow a Core.box. Generator defines an anonymous with maxV so it is hitting something like this https://github.com/JuliaLang/julia/issues/15276 Smaller repro function c!{T}(::T,P) if length(P)>2 maxV = one(T) d = x->maxV end P end

[julia-users] Parallel computation of Array of user-defined types

2016-09-09 Thread amiksvi
Hello, What would be the best option to parallelize this code: type T a end f(i) = T(i) v = map(f, collect(1:1:100)) This example could sound stupid but the point is that I have a function ```f``` that returns a rather complicated user-defined type ```T```, and I need to store a lot of these

[julia-users] Why is BLAS.dot slower than BLAS.axpy!?

2016-09-09 Thread Sheehan Olver
I have the following code that is part of a Householder routine, where j::Int64, N::Int64, R.cols::Vector{Int64}, wp::Ptr{Float64}, M::Int64, v::Ptr{Float64}: … for j=k:N v=r+(R.cols[j]+k-2)*sz dt=BLAS.dot(M,wp,1,v,1) BLAS.axpy!(M,-2*dt,wp,1,v,1)

[julia-users] @profile does not allow variable assignment on v0.5

2016-09-09 Thread Florian Oswald
hi all, on v0.5-rc3, I see this *julia> **f(x)=x^3* *f (generic function with 1 method)* *julia> **@profile y = f(5)* *125* *julia> **y* *ERROR: UndefVarError: y not defined* which used to work in previous versions. Is that intended behaviour?

[julia-users] Inference and Core.Box - why is this happening?

2016-09-09 Thread Patrick Kofod Mogensen
So, I am kind of confused here. In my code, a maxV = maximum(V) is labeled as Core.Box in @code_warntype, but if I remove a line after the line where maxV is calculated, it is correctly labelled as eltype(V). Can anyone explain what happens/what I am doing wrong here? This is not the whole

Re: [julia-users] Re: How I did get a spurious method for *{T}(Irrational{T},Irrational{T})?

2016-09-09 Thread Tim Holy
https://github.com/JuliaLang/julia/issues/18419 --Tim On Wednesday, September 7, 2016 12:59:05 AM CDT Lutfullah Tomak wrote: > A reduced case that also makes multiplication of the same Irrational an > error. > >_ >_ _ _(_)_ | A fresh approach to technical

[julia-users] How to use jl_call1 with a struct argument?

2016-09-09 Thread K leo
I tried the following, it compiles OK and runs OK, but it appears the julia function is not called (because there is no output from the println statement). What is wrong? #include > #include > using namespace std; > struct TestType { > double a; > double b; > }; > int main(int argc,

[julia-users] ANN: Julia 0.5.0-rc4 now available

2016-09-09 Thread Tony Kelman
I have just tagged and uploaded release candidate 4 for Julia version 0.5.0. Binaries are available from https://s3.amazonaws.com/julialang/bin/linux/x64/0.5/julia-0.5.0-rc4-linux-x86_64.tar.gz https://s3.amazonaws.com/julialang/bin/linux/x86/0.5/julia-0.5.0-rc4-linux-i686.tar.gz

[julia-users] Assigning a field in Python via reference

2016-09-09 Thread Christoph Ortner
I am trying to (1) create an array in Julia: X = rand(3,10) (2) convert it to a PyArray (no copy) : Xpy = PyArray(X) (3) then assign this to a field of an object: pyobj["X"] = Xpy orpyobj["X"] = Xpy.o or The aim is, when I modify X, then the data in pyobj[:X] should