Re: [julia-users] Re: Plots with scale bars

2016-08-10 Thread Islam Badreldin
Hi Tom, Thanks for your input. This solution seems similar to the one proposed on matlabcentral. It's fine for now, but it'd be great if switching between a plot with x-y axes to a plot with only scale bars can be done neatly using a single switch or function, while hiding all the details from

[julia-users] Re: Issue with ccall

2016-08-10 Thread Jameson
The arguments don't get written in a tuple. This should work: ccall(("__a1_MOD_teste","./a1.o"), Void, (Int64,), b) On Wednesday, August 10, 2016 at 11:09:32 AM UTC-4, Abimael Jr wrote: > > > Hello Julia's fans > > I am starting studing Julia. As I have some code in Fortran, I really >

Re: [julia-users] Combining composite type & PyPlot methods with @manipulate (regarding a port/extension of QuTiP's Bloch Sphere)

2016-08-10 Thread Willem Hekman
Hi Tom, Plots.jl very interesting, love the idea. However, at first glance I cant find an example where @manipulate is used, could you provide me with one? Btw I`ll watch your JuliaCon talk this evening, I`m very curious ;-) On Wednesday, August 10, 2016 at 5:09:05 PM UTC+2, Tom Breloff

Re: [julia-users] Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
You are right. My previous timings were totally wrong anyway, due to a bug I introduced into my program. After fixing it, a fair comparison shows that: Base.:+{N}(a::NTuple{N}, b::NTuple{N}) = ntuple(i -> a[i] + b[i], Val{N}) is exactly the same speed as the recursive functions I was using. And

[julia-users] Re: Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
In order to be a little more specific I wanted to add, that it seems weird that I can use the variables for the if clause, but not for creating the other ranges, it's just that I don't know how to express myself correctly, I hope you can understand me. El miércoles, 10 de agosto de 2016,

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Erik Schnetter
I want to create a type, and need more flexibility than Julia's `type` definitions offer (see ). Currently, I have a function that generates the type, and returns the type. I would like to make this a generated function (as it was in Julia 0.4). The

Re: [julia-users] Plots with scale bars

2016-08-10 Thread Tom Breloff
Sure. You could maybe make a recipe, or just make a function that does this. You'll probably want to make use of 'axis_limits' to get the data range. Like this: amin, amax = axis_limits(plt[1][:yaxis]) Here 'plt[1]' returns the first Subplot. On Wednesday, August 10, 2016, Islam Badreldin

[julia-users] Re: Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Jameson
Yes, you can delete anything old (the same goes for usr-staging and deps/srccache). I've also been slowly developing a PR that will allow the build system to automatically erase the build directories after its finished with them, but it's not ready yet. But someday... On Wednesday, August

Re: [julia-users] Re: Use reference of array comprehension internal variables?

2016-08-10 Thread Stefan Karpinski
julia> [(x, y, z) for x = 1:n for y = x:n for z = y:n if x^2 + y^2 == z^2] 6-element Array{Tuple{Int64,Int64,Int64},1}: (3,4,5) (5,12,13) (6,8,10) (8,15,17) (9,12,15) (12,16,20) On Wed, Aug 10, 2016 at 12:58 PM, Ismael Venegas Castelló < ismael.vc1...@gmail.com> wrote: > In order to be a

Re: [julia-users] Re: Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
OMG that's awesome, we need more docs about this feature, thank you very much Stefan! El miércoles, 10 de agosto de 2016, 12:02:34 (UTC-5), Stefan Karpinski escribió: > > julia> [(x, y, z) for x = 1:n for y = x:n for z = y:n if x^2 + y^2 == z^2] > 6-element Array{Tuple{Int64,Int64,Int64},1}: >

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Jameson
AFAIK, defining an arbitrary new type at runtime is impossible, sorry. In v0.4 it was allowed, because we hoped that people understood not to try. See also https://github.com/JuliaLang/julia/issues/16806. Note that it is insufficient to "handle" the repeat calling via caching in a Dict or

[julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Gunnar Farnebäck
I realize the question is about the performance of the zip approach but may I suggest just running mean(v)? On Wednesday, August 10, 2016 at 11:34:08 AM UTC+2, Tamas Papp wrote: > > I was benchmarking code for calculating means of vectors, eg > > v = [rand(100) for i in 1:100] > > m1(v) =

[julia-users] Re: Permissions in my 'usr' don't look right

2016-08-10 Thread Jameson
The build should be fine after `chown -R`. I suspect you accidentally typed `make` in a root terminal you had open, since there's no other way linux would have let you chown them to root. Unless you prefer to suspect an alien virus is altering the permissions bits on your hard drive using

[julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Jameson
It is tracking the dynamic scope of the code generator, it doesn't care about what code you emit. The generator function must not cause any side-effects and must be entirely computed from the types of the inputs and not other global state. Over time, these conditions are likely to be more

Re: [julia-users] Adding tuples

2016-08-10 Thread Shashi Gowda
Base.:+{N}(a::NTuple{N}, b::NTuple{N}) = ntuple(i -> a[i] + b[i], Val{N}) should be slightly faster and should not allocate unlike Base.:+{N}(a::NTuple{N}, b::NTuple{N}) = ntuple(i -> a[i] + b[i], N) On Wed, Aug 10, 2016 at 8:36 PM, 'Bill Hart' via julia-users < julia-users@googlegroups.com>

[julia-users] Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
Is there a way to make reference of the internal variables of an array comprehension? I'm trying to improve this Rosetta Code task: - https://rosettacode.org/wiki/List_comprehensions#Julia const n = 20 sort(filter(x -> x[1] < x[2] && x[1]^2 + x[2]^2 == x[3]^2, [(a, b, c) for a= 1:n, b=1:n,

[julia-users] Re: Adding tuples

2016-08-10 Thread Pablo Zubieta
Does something like this seems good enough? Base.:+{N}(a::NTuple{N}, b::NTuple{N}) = ntuple(i -> a[i] + b[i], N) there is also map(+, a, b) where `a`, and `b` are the tuples you want to sum elementwise. There is a chance that eventually one will be able to also use broadcast or elementwise

Re: [julia-users] Re: Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
Oh, I didn't know about that either. This is also what I'm looking for. When I looked through tuple.jl for inspiration and through the documentation I just didn't see these (probably my fault for not looking carefully enough). Bill. On 10 August 2016 at 16:53, Pablo Zubieta

[julia-users] Combining composite type & PyPlot methods with @manipulate (regarding a port/extension of QuTiP's Bloch Sphere)

2016-08-10 Thread Willem Hekman
Hello all, I have been spending my time making http://qutip.org/docs/3.1.0/guide/guide-bloch.html work in Julia by translating the main parts of the source code http://qutip.org/docs/3.1.0/modules/qutip/bloch.html . In short, what I've

Re: [julia-users] Adding tuples

2016-08-10 Thread Erik Schnetter
The built-in type `CartesianIndex` supports adding and subtracting, and presumably also multiplication. It is implemented very efficiently, based on tuples. Otherwise, to generate efficient code, you might have to make use of "generated functions". These are similar to macros, but they know about

[julia-users] "eval cannot be used in a generated function"

2016-08-10 Thread Erik Schnetter
I'm encountering the error "eval cannot be used in a generated function" in Julia 0.5 for code that is working in Julia 0.4. My question is -- what exactly is now disallowed? For example, if a generated function `f` calls another (non-generated) function `g`, can `g` then call `eval`? Does the

Re: [julia-users] Re: Plots with scale bars

2016-08-10 Thread Tom Breloff
I threw this together really quickly... excuse the mess: using Plots # initial plot plot(linspace(10,34,100), 30rand(100,2).+[0 60], leg=false, ylim=(-60,150), axis=nothing, xguide="Time(ms)", yguide="current(mA)") # lines and annotations x,y = 12,-40 plot!([x,x,x+10], [y+10,y,y],

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Uwe Fechner
Here: rc1+1 on the release-0.5 branch has the bug fixed, and may be more useful to test against: https://s3.amazonaws.com/julianightlies/bin/linux/x64/0.5/julia-0.5.0-acfd04c18b-linux64.tar.gz Uwe On Wednesday, August 10, 2016 at 1:12:57 PM UTC+2, Tamas Papp wrote: > > Where can I find

[julia-users] Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
Does anyone know an efficient way to add NTuples in Julia? I can do it using recursive functions, but for various reasons this is not efficient in my context. I really miss something like tuple(a[i] + b[i] for i in 1:N) to create the resulting tuple all in one go (here a and b would be

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Yichao Yu
On Wed, Aug 10, 2016 at 6:29 PM, Andreas Lobinger wrote: > There is a memory allocation(?) bug in 0.5.0-rc1+0, > The bug is not related to memory allocation is is likely unrelated to this either. > recommendation is to go to rc1+1. > > On Wednesday, August 10, 2016 at

[julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread David Gold
I want to say it's the iteration over the large ZipIterator that's giving you grief. Possibly relevant (since n-arg map implementation falls back on iterating over zipped argument arrays): https://github.com/JuliaLang/julia/issues/17321 On Wednesday, August 10, 2016 at 5:34:08 AM UTC-4, Tamas

[julia-users] Re: Plots with scale bars

2016-08-10 Thread Willem Hekman
If you'd try to do this using PyPlot you can remove the x- and y-axis by translating the necesarry matplotlib code i.e. http://www.shocksolution.com/2011/08/removing-an-axis-or-both-axes-from-a-matplotlib-plot/ to the syntax that PyPlot takes, which is slightly different. You would get

[julia-users] Re: Adding tuples

2016-08-10 Thread Pablo Zubieta
And just to throw out another option, you might also consider ((a[i] + b[i] for i = 1:N)...) Pablo.

[julia-users] Issue with ccall

2016-08-10 Thread Abimael Jr
Hello Julia's fans I am starting studing Julia. As I have some code in Fortran, I really interested in the ccall function to call some specialized code in Fortran. I wrote a simple function inside a module to do some tests passing a parameter to receive a value from a Fortran value. The

Re: [julia-users] Combining composite type & PyPlot methods with @manipulate (regarding a port/extension of QuTiP's Bloch Sphere)

2016-08-10 Thread Tom Breloff
Hi Willem. If you make a Plots recipe for your type, you should be able to use your pseudocode by replacing 'render' with 'plot'. https://juliaplots.github.io/recipes/ On Wed, Aug 10, 2016 at 10:18 AM, Willem Hekman wrote: > Hello all, > > I have been spending my time

Re: [julia-users] Re: Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
map is incredibly slow and not at all useful for something like addition. However the first example looks like what I am looking for, depending on how it is implemented. Thanks. Bill. On 10 August 2016 at 16:45, Pablo Zubieta wrote: > Does something like this seems good

Re: [julia-users] Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
This code seems to be (about 50%) faster than recursive functions: Base.:+{N}(a::NTuple{N}, b::NTuple{N}) = ntuple(i -> a[i] + b[i], N) But this seems (about 50%) slower: ((a[i] + b[i] for i = 1:N)...) Anyway, I can use the first method, until I find something faster. It's definitely way

[julia-users] Re: BigInt / BigFloat / Bitshift

2016-08-10 Thread Jeffrey Sarnoff
> > What is the difference between >> and >>> ? from the help (in the REPL, at the prompt press the question mark and then enter >> or >>>) >>(x, n) Right bit shift operator, x >> n. For n >= 0, the result is x shifted right by n bits, where n >= 0, filling with 0s if x >= 0, 1s if x

[julia-users] Re: Still confused about how to use pmap with sharedarrays in Julia

2016-08-10 Thread 'Greg Plowman' via julia-users
I have also found the combination of shared arrays, anonymous functions and parallel constructs confusing. StackOverflow question helped me Shared array usage in Julia In essence, "although the underlying data is shared

Re: [julia-users] Adding tuples

2016-08-10 Thread Jeffrey Sarnoff
Bill, Following Eric's note, I tried (with a,b equi-length tuples) function addTuples(a,b) ca = CartesianIndex(a) cb = CartesianIndex(b) return (ca+cb).I end for me, with 100 values it ran ~60% faster, and with 1000 values much much faster than ntuple(i -> a[i] + b[i], N) On

Re: [julia-users] Adding tuples

2016-08-10 Thread Jeffrey Sarnoff
that slows it down by a factor of 5 On Wednesday, August 10, 2016 at 2:37:25 PM UTC-4, Bill Hart wrote: > > How about compared with: > > ntuple(i -> a[i] + b[i], Val{N}) > > > On 10 August 2016 at 20:32, Jeffrey Sarnoff > wrote: > >> Bill, >> >> Following Eric's note, I

[julia-users] Re: What do do when @less does not work?

2016-08-10 Thread Jeffrey Sarnoff
Páll FYI this is most current of the evolving approaches to extended precision https://github.com/JuliaArbTypes/ArbFloats.jl On Wednesday, August 10, 2016 at 2:58:16 PM UTC-4, Jeffrey Sarnoff wrote: > > When one writes a module/package that implements a new type it is prudent > to provide a

Re: [julia-users] Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
How about compared with: ntuple(i -> a[i] + b[i], Val{N}) On 10 August 2016 at 20:32, Jeffrey Sarnoff wrote: > Bill, > > Following Eric's note, I tried (with a,b equi-length tuples) > function addTuples(a,b) > ca = CartesianIndex(a) > cb = CartesianIndex(b)

Re: [julia-users] Adding tuples

2016-08-10 Thread Jeffrey Sarnoff
almost certainly -- I use BenchmarkTools for this sort of timing, and can recommend it. On Wednesday, August 10, 2016 at 2:56:17 PM UTC-4, Bill Hart wrote: > > For me, the version using CartesianIndex is exactly the same speed as the > syntax with the Val, which in turn is faster than without

Re: [julia-users] Adding tuples

2016-08-10 Thread 'Bill Hart' via julia-users
For me, the version using CartesianIndex is exactly the same speed as the syntax with the Val, which in turn is faster than without Val. It probably depends a lot on the application and what the compiler can handle. Bill. On 10 August 2016 at 20:45, Jeffrey Sarnoff

Re: [julia-users] Adding tuples

2016-08-10 Thread Kristoffer Carlsson
The Val{N} version will makes the compiler specialize the tuple creation for that specific value of N. It should be significantly faster for small lengths of the tuple and the return value should also be inferrable. On Wednesday, August 10, 2016 at 8:59:45 PM UTC+2, Jeffrey Sarnoff wrote: > >

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Kristoffer Carlsson
The sparse solvers use UMFPACK and CHOLMOD which are C-libraries and thus only support the standard number types. You would need a pure julia written solver that could take any number type. The stackoverflow error was fixed here: https://github.com/JuliaLang/julia/pull/14902 On Wednesday,

[julia-users] Problems with A\b and BigFloat

2016-08-10 Thread Nicklas Andersen
Hello I'm trying to solve a large, sparse and unsymmetrical linear system Ax = b. For this task I'm using Julias *SparseMatrixCSC *type for the definition of my matrices and Julias built in backslash ' \ ' operator for the solution of the system. I need *quadruple precision* and thus I've been

[julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Kit Adams
I am investigating the feasibility of embedding Julia in a C++ real-time signal processing framework, using Julia-0.4.6 (BTW, the performance is looking amazing). However, for this usage I need to retain Julia state variables across c++ function calls, so the stack based JL_GC_PUSH() and

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Yichao Yu
On Wed, Aug 10, 2016 at 2:17 PM, Kit Adams wrote: > I am investigating the feasibility of embedding Julia in a C++ real-time > signal processing framework, using Julia-0.4.6 (BTW, the performance is > looking amazing). > > However, for this usage I need to retain Julia state

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Erik Schnetter
On Wed, Aug 10, 2016 at 1:45 PM, Jameson wrote: > AFAIK, defining an arbitrary new type at runtime is impossible, sorry. In > v0.4 it was allowed, because we hoped that people understood not to try. > See also https://github.com/JuliaLang/julia/issues/16806. Note that it is >

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Chris Rackauckas
Though I don't know if they have sparse algorithms. But they have a good base something there to help you get started making one... On Wednesday, August 10, 2016 at 2:20:54 PM UTC-7, Chris Rackauckas wrote: > > GenericSVD.jl has linear > solver

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Stefan Karpinski
On Wed, Aug 10, 2016 at 5:49 PM, Jameson Nash wrote: > module scope is compile time != runtime This isn't much of an explanation. I think this would seem like less of a "because I say so" if you provided an explanation of what the problem with calling eval within a generated

[julia-users] Re: BigInt / BigFloat / Bitshift

2016-08-10 Thread David P. Sanders
El miércoles, 10 de agosto de 2016, 18:20:11 (UTC-4), digxx escribió: > > As far as I understand Julia adjusts the bitsize of an integer when I use > BigInt. > For example n=big(10)^1 is as many bits as needed. > Now 2*n is still an integer though dividing makes a bigfloat out of it. > How

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Ralph Smith
The OP wants extremely high precision and indicated that he was willing to factor the matrix. I recommended iterative refinement which converges very quickly, and exploits the state-of-the-art direct solvers. The solvers in IterativeSolvers.jl are for a different domain, where the matrix is

Re: [julia-users] Re: Advice for parallel computing

2016-08-10 Thread Islam Badreldin
You can also try `DistributedArrays` and `map`. Basically, you first distribute the array of your composite type on multiple Julia processes, then you call `map` on the distributed array. See the first talk by Andreas Noack in the Parallel Computing workshop for more details 

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Chris Rackauckas
Yes textbook answer is, why do you want to use `\`? Iterative techniques are likely better suited for the problem. There's no need to roll you own, the package IterativeSolvers.jl has a good number of techniques implemented which are well-suited for the problem since A is a large sparse matrix.

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Ralph Smith
Here is a textbook answer. Appropriate choice of n depends on condition of A. """ iterimprove(A,b,n=1,verbose=true) Solve `A x = b` for `x` using iterative improvement """ function iterimprove{T<:AbstractFloat}(A::SparseMatrixCSC{T}, >

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Chris Rackauckas
It really depends on what he means by "large" and "sparse". There is no indication from the OP that he specifically is choosing a direct over an iterative method, just that he knows \ is the go-to for solving Ax=b that he tried. It should be mentioned that direct solvers are O(n^3) and

Re: [julia-users] Adding tuples

2016-08-10 Thread Jeffrey Sarnoff
relative to the same thing without the Val On Wednesday, August 10, 2016 at 2:45:06 PM UTC-4, Jeffrey Sarnoff wrote: > > that slows it down by a factor of 5 > > On Wednesday, August 10, 2016 at 2:37:25 PM UTC-4, Bill Hart wrote: >> >> How about compared with: >> >> ntuple(i -> a[i] + b[i],

[julia-users] Re: What do do when @less does not work?

2016-08-10 Thread Jeffrey Sarnoff
When one writes a module/package that implements a new type it is prudent to provide a type-specific value hashing function. This is particularly important for immutable types where hash codes and isequal are more tightly coupled than they are with mutable types. memhash_seed is a

[julia-users] Re: Problems with A\b and BigFloat

2016-08-10 Thread Chris Rackauckas
GenericSVD.jl has linear solver routines which work for generic number types (like BigFloat). You can use an SVD to solve the linear system. It's not as fast as other methods, but you may find this useful. On Wednesday, August 10, 2016 at 12:47:10

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Jameson Nash
> Why is it impossible to generate a new type at run time? I surely can do this by calling `eval` at module scope. module scope is compile time != runtime > Or I could create a type via a macro. Again, compile time != runtime > Given this, I can also call `eval` in a function, if I ensure the

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Tim Holy
AFAICT, it remains possible to do dynamic type generation if you (1) print the code that would define the type to a file, and (2) `include` the file. function create_type_dynamically{T}(::Type{T}) type_name = string("MyType", T) isdefined(Main, Symbol(type_name)) && return nothing

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Bart Janssens
On Wed, Aug 10, 2016 at 9:11 AM Yichao Yu wrote: > On Wed, Aug 10, 2016 at 2:17 PM, Kit Adams wrote: > >> I am investigating the feasibility of embedding Julia in a C++ real-time >> signal processing framework, using Julia-0.4.6 (BTW, the performance is

[julia-users] Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Tomas Lycken
After being away from Julia and the community for a couple of months, I started updating my Julia installations today in order to test some of my packages and make sure they’re ready for 0.5, and I started getting warnings about disk usage. Since I’m dual-booting Ubuntu and Windows on a

Re: [julia-users] Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Tamas Papp
Have you tried git gc? Sometimes it saves a lot of space for me. Also, unless you really need sources in a git repo, you can try the binary distributions, which are considerably smaller (around 200Mb). On Wed, Aug 10 2016, Tomas Lycken wrote: > After being away from Julia and the community for

Re: [julia-users] Methods inside type definition, use of "self" ?

2016-08-10 Thread Tamas Papp
Broadly yes. In Julia (and Common Lisp, Dylan, etc), methods do not "belong" to a class intrinsically. If you want to read up about this paradigm, search for "multiple dispatch" or "multimethods". On Wed, Aug 10 2016, Willem Hekman wrote: > Hello all, > > I must say that I`m quite new to object

[julia-users] Re: Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Kristoffer Carlsson
The .git history for LLVM is also pretty big ~ 500 MB. I also see I have 3 builds of openblas so if you have multiple of them, you could remove the unnecessary ones.

[julia-users] Methods inside type definition, use of "self" ?

2016-08-10 Thread Willem Hekman
Hello all, I must say that I`m quite new to object oriented programming. Do I understand correctly from the manual that in Julia (unlike python) you do not use the keyword "self" and declare methods that apply to a type outside the type definition? To illustrate, let's say we want to have a

Re: [julia-users] Methods inside type definition, use of "self" ?

2016-08-10 Thread Mauro
Yes, this is correct. The difference to classic OO programming languages is that in Julia a method is not "owned" by a type. Instead it can be owned by several types as dispatch is on all arguments. In python and other OO dispatch is only on the first (usually implicit) argument. For your

[julia-users] Re: Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Andreas Lobinger
Hello colleague, On Wednesday, August 10, 2016 at 10:11:46 AM UTC+2, Tomas Lycken wrote: > > Both instances of Julia are runnable, so I don’t think I deleted something > I shouldn’t have in either folder. > > What has changed to make Julia 0.5 so big? Are there any build artifacts I >

[julia-users] Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Kristoffer Carlsson
The openblas tests take an extreme amount of space (600MB) so getting rid of those is pretty good. They are in "build/openblas-SHAID/{ctest/test}

[julia-users] Re: Advice for parallel computing

2016-08-10 Thread André Lage
hi Dupont, I would first check if ParallelAccelerator.jl does what you need: https://github.com/IntelLabs/ParallelAccelerator.jl Best, André Lage. On Wednesday, July 6, 2016 at 7:26:10 AM UTC-3, Dupont wrote: > > Hi, > > I have an array of composite type > > A = Array{MyType}(N) > > that

Re: [julia-users] map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Mauro
Whilst this does not explain your observation, note that splatting large vectors is bad for performance. On Wed, 2016-08-10 at 11:33, Tamas Papp wrote: > I was benchmarking code for calculating means of vectors, eg > > v = [rand(100) for i in 1:100] > > m1(v) = map(mean,

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Kit Adams
I guess I could try using std::remove() followed by jl_array_del_end() to remove entries. Cheers, Kit On Wednesday, August 10, 2016 at 9:45:55 PM UTC+12, Kit Adams wrote: > > Thank you for those links, they are a great help. > > Is there an "unprotect_from_gc(T* val)"? > > I am looking for a

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Bart Janssens
On Wed, Aug 10, 2016 at 11:46 AM Kit Adams wrote: > Thank you for those links, they are a great help. > > Is there an "unprotect_from_gc(T* val)"? > > I am looking for a smart pointer a bit like v8's UniquePersistent<>. > > I guess I could make one that searched through the

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Tamas Papp
Where can I find (64bit, Linux) binaries for rc1+1? On Wed, Aug 10 2016, Andreas Lobinger wrote: > There is a memory allocation(?) bug in 0.5.0-rc1+0, recommendation is to go > to rc1+1. > > On Wednesday, August 10, 2016 at 12:04:36 PM UTC+2, Tamas Papp wrote: >> >> Thanks. Forgot to say that

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Tomas Lycken
I don't think there are such binaries - you'd have to build from source - but my reproduction was on rc1+1, so that bug is (probably) not relevant to this issue. // T On Wednesday, August 10, 2016 at 1:12:57 PM UTC+2, Tamas Papp wrote: > > Where can I find (64bit, Linux) binaries for rc1+1? >

Re: [julia-users] Methods inside type definition, use of "self" ?

2016-08-10 Thread Willem Hekman
Thank you for the quick reply. With this example it makes much sense: Depending on the language you will have to adopt a different style of programming. That makes much sense ;-) On Wednesday, August 10, 2016 at 9:46:26 AM UTC+2, Mauro wrote: > > Yes, this is correct. The difference to

[julia-users] BigInt / BigFloat / Bitshift

2016-08-10 Thread digxx
As far as I understand Julia adjusts the bitsize of an integer when I use BigInt. For example n=big(10)^1 is as many bits as needed. Now 2*n is still an integer though dividing makes a bigfloat out of it. How big is the bigfloat? does it "resolve" up to the last integer? Does it increase

[julia-users] Re: BigInt / BigFloat / Bitshift

2016-08-10 Thread digxx
What is the difference between >> and >>> ?

[julia-users] Re: BigInt / BigFloat / Bitshift

2016-08-10 Thread digxx
Sorry: for example (n/2)^10 is still legid up to the last digit (neglecting the fact that these would be zero in this case anyway) that was actually a question though I missed the question marks. about the bitshift I found it being 4<<2 for example but is there sth like that for any basis?

[julia-users] Re: Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Kit Adams
Thanks for the heads up Palli. I was using "real-time" in the sense of a process running continuously with new data coming in, flowing through signal processing chains and being displayed and recorded, rather than being absolutely time critical. If a Julia gc causes a momentary delay in one or

Re: [julia-users] GlobalRef(Module, func) vs. :(Module.func)

2016-08-10 Thread Andrei Zh
One more question related to the topic. I try to get function body expression in Julia 0.5 using: lambda = methods(func, types).ms[1].lambda_template Base.uncompressed_ast(lambda) However this gives an expression with argument names replaced by `SlotNumber` (e.g. `_2`). Is there a way to get

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Kit Adams
Thanks for those ideas Bart. I think I will try stashing an index into the array in the smart pointer (along side the pointer) and use your idea of a stack of indices to the available null entries. I'm currently working on embedding v8 for comparison purposes, so I won't do this immediately.

[julia-users] VideoIO failing to import in julia 0.4.6 (Fedora 24)

2016-08-10 Thread Shivkumar Chandrasekaran
On "import VideoIO" here is the relevant piece of the error: ERROR: LoadError: LoadError: could not open file /home/shiv/.julia/v0.4/VideoIO/src/ffmpeg/AVUtil/src/../../../ffmpeg/AVUtil/v55/LIBAVUTIL.jl The problem is that it is looking for "v55" directory but even github seems to have only

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Jameson Nash
The `eval` there is redundant with `include`. But there's nothing wrong with running julia code during compile-time to dynamically generate code. The confusion there comes from the fact that Julia has a compile-step between each toplevel statement, which allows you to intermix runtime and compile.

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-10 Thread Erik Schnetter
The upshot of the discussions seems to be "it won't work in 0.5 because the experts say so, and there are no plans to change that". So I'm going to accept that statement. I think I'll use the following work-around: ```Julia immutable Wrapper{Tag,Types} data::Types end ``` where I use `Tag` as

Re: [julia-users] GlobalRef(Module, func) vs. :(Module.func)

2016-08-10 Thread Yichao Yu
On Thu, Aug 11, 2016 at 6:40 AM, Andrei Zh wrote: > One more question related to the topic. I try to get function body > expression in Julia 0.5 using: > > lambda = methods(func, types).ms[1].lambda_template > Base.uncompressed_ast(lambda) > > However this gives an

[julia-users] Still confused about how to use pmap with sharedarrays in Julia

2016-08-10 Thread Graydon Barz
What is the best way to modify the following Julia code: my_output = pmap(x -> my_function(x, my_shared_array), x_list) so that 'output' is consistent with my_output = map(x -> my_function(x, myarray), x_list)? My naive attempt above resulted in a an error: RemoteException(pid#,

Re: [julia-users] VideoIO failing to import in julia 0.4.6 (Fedora 24)

2016-08-10 Thread Kevin Squire
You could install an older version of ffmpeg. I've made progress in wrapping later versions, and just need time to finish it up. I'll post a WIP pull request soon, and hopefully finish it soon as well (but I've been saying that for a while). Cheers, Kevin On Wed, Aug 10, 2016 at 3:31 PM,

[julia-users] map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Tamas Papp
I was benchmarking code for calculating means of vectors, eg v = [rand(100) for i in 1:100] m1(v) = map(mean, zip(v...)) m2(v) = mapslices(mean, hcat(v...), 2) @elapsed m1(v) @elapsed m2(v) m2 is faster, but for 1000 vectors, v = [rand(100) for i in 1:1000] m1 with zip takes "forever" (CPU

[julia-users] Re: Permissions in my 'usr' don't look right

2016-08-10 Thread Colin Beckingham
If I change the dirs julia/usr and julia/usr-staging with a chmod recursively to me as a user, then make completes and make testall is successful. This is a complete shot in the dark, perhaps someone could let me know if I should reinstall from scratch. I believe this happened in the last 24

[julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Tomas Lycken
For completeness: I can reproduce this behavior for m1. m2 returns fine after a little over four times the time it took for 100 vectors. // T On Wednesday, August 10, 2016 at 11:34:08 AM UTC+2, Tamas Papp wrote: > > I was benchmarking code for calculating means of vectors, eg > > v =

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Andreas Lobinger
There is a memory allocation(?) bug in 0.5.0-rc1+0, recommendation is to go to rc1+1. On Wednesday, August 10, 2016 at 12:04:36 PM UTC+2, Tamas Papp wrote: > > Thanks. Forgot to say that I am using v"0.5.0-rc1+0". > >

[julia-users] Re: Why is Julia 0.5 built from source almost twice as large (on disk) as Julia 0.4?

2016-08-10 Thread Tomas Lycken
Thanks for the replies. Is it safe to assume that anything in deps/build that exists in multiple versions, is only needed in the latest of those? For instance, I have ``` 159M deps/build/llvm-3.3 318M deps/build/llvm-3.7.1 881M deps/build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6 943M

Re: [julia-users] Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Kit Adams
Thank you for those links, they are a great help. Is there an "unprotect_from_gc(T* val)"? I am looking for a smart pointer a bit like v8's UniquePersistent<>. I guess I could make one that searched through the array for the value in order to remove it (in the smart pointer's dtor). Thanks,

Re: [julia-users] Re: map(mean, zip(v...)) doesn't scale

2016-08-10 Thread Tamas Papp
Thanks. Forgot to say that I am using v"0.5.0-rc1+0". @time tells me that m1 allocates a lot. I understand that using zip for this purpose is suboptimal, I just want to understand why it does not scale, because I find zip convenient for a lot of idioms. On Wed, Aug 10 2016, Tomas Lycken wrote:

[julia-users] Re: Replacement for jl_gc_preserve() and jl_gc_unpreserve()?

2016-08-10 Thread Páll Haraldsson
On Wednesday, August 10, 2016 at 6:57:15 AM UTC, Kit Adams wrote: > > I am investigating the feasibility of embedding Julia in a C++ real-time > signal processing framework, using Julia-0.4.6 (BTW, the performance is > looking amazing). > There are other thread[s] on Julia and real-time, I'll