Re: [julia-users] BinDeps: How to access include path?

2014-11-17 Thread Milan Bouchet-Valat
Le dimanche 16 novembre 2014 à 15:41 -0500, Erik Schnetter a écrit : I see. I was afraid that the C structs may change in between different versions of the library. If the structs are re-analyzed when the wrapper is installed, this would not be an issue. Stable libraries shouldn't change

Re: [julia-users] BinDeps: How to access include path?

2014-11-17 Thread Erik Schnetter
On Mon, Nov 17, 2014 at 3:15 AM, Milan Bouchet-Valat nalimi...@club.fr wrote: Le dimanche 16 novembre 2014 à 15:41 -0500, Erik Schnetter a écrit : I see. I was afraid that the C structs may change in between different versions of the library. If the structs are re-analyzed when the wrapper

[julia-users] try/catch by exception type

2014-11-17 Thread Luthaf
Hello ! Is there a way to catch an exception by type in Julia ? Coming from python, I am very tempted to do this kind of things: ``` try # Access a dict here catch e if isa(KeyError, e) # Handle the KeyError, as I know what to do in that case else # Re-throw to upper level

[julia-users] Re: How should I structure my code?

2014-11-17 Thread yfractal
macro need_m() :(m * 20) end function algoX() m = 10 @need_m end algoX() # 200 I think you can create two similar macro to solve your problem. But i think this is bad practice. I think you should create some code without a scope, as I know, the macro can do such

Re: [julia-users] try/catch by exception type

2014-11-17 Thread Jacob Quinn
Check out the somewhat lengthy, but informative thread on developing additional functionality with regards to exception handling. https://github.com/JuliaLang/julia/issues/7026 -Jacob On Mon, Nov 17, 2014 at 9:49 AM, Luthaf lut...@luthaf.fr wrote: Hello ! Is there a way to catch an exception

Re: [julia-users] try/catch by exception type

2014-11-17 Thread Luthaf
Ok, thank you ! So the way to go is better ask for permission than for forgiveness ! John Myles White a écrit : I don't believe this is possible in Julia right now. Which is ok in this case, since working with a KeyError is a very un-Julian way to check for key existence. You'll want to use

Re: [julia-users] try/catch by exception type

2014-11-17 Thread John Myles White
Yes, we are civilized after all. -- John On Nov 17, 2014, at 2:53 PM, Luthaf lut...@luthaf.fr wrote: Ok, thank you ! So the way to go is better ask for permission than for forgiveness ! John Myles White a écrit : I don't believe this is possible in Julia right now. Which is ok in

Re: [julia-users] help() doesn't work in REPL in julia-0.4.0-1439 from julianightlies PPA

2014-11-17 Thread Omar Antolín Camarena
Well, as of julia-0.4.0-1454~ubuntu14.04.1 It still happens. By the way, I was wrong about which package to blame, it's not julia-doc but julia itself (julia-doc contains the manual and other documentation, but the basic help strings the REPL help() functions prints are actually in the julia

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Eka Palamadai
Semantically, ones(n,1) creates a vector and not a matrix. Why is ones(n,1) different from ones(n)? The type system is very confusing and non-intuitive. On Sunday, November 16, 2014 7:28:28 PM UTC-5, Andreas Noack wrote: The input should be two Vectors, but your first argument is a Matrix

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Andreas Noack
Semantically, ones(n,1) creates a vector and not a matrix. I'd rather say that in MATLAB ones(n,1) creates a vector. This has been discussed many times on the list and in issues. In particular, see the famous https://github.com/JuliaLang/julia/issues/4774. In Julia, Vector{T} and Matrix{T}

[julia-users] Re: Arrayfire and Julia

2014-11-17 Thread Test This
Happy to see thus reaction from a core julia developer. Hope julia makes parallel programming on CPUs and GPUs easier.

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Eka Palamadai
which I think is reasonable is a subjective argument. It would be helpful if the type system is intuitive and non-confusing to programmers. On Monday, November 17, 2014 12:24:58 PM UTC-5, Andreas Noack wrote: Semantically, ones(n,1) creates a vector and not a matrix. I'd rather say that in

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Tim Holy
What's intuitive is very dependent upon your background. If you're coming from Matlab, for example, everything is a matrix and Matlab does this extraordinarily-confusing thing: ones(3,3,3) gives me a 3d array; ones(3,3) gives me a 2d array; but ones(3) ans = 1 1 1 1 1

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Eka Palamadai
I don't know what matlab does. As a user, ones(n,1) and ones(n) both return me a vector, and it is confusing to find that ones(n,1) != ones(n). On Monday, November 17, 2014 12:53:25 PM UTC-5, Tim Holy wrote: What's intuitive is very dependent upon your background. If you're coming from

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Tim Holy
Your best bet, then, is to decide as quickly as possible whether you want to use Julia. If you start reading here: http://docs.julialang.org/en/latest/manual/faq/#what-does-type-stable-mean you'll maximize your chances of quickly discovering other things that will likely annoy you :-). While

[julia-users] Re: try/catch by exception type

2014-11-17 Thread Simon Danisch
What about using multiple dispatch? handle(::ExceptionType1, ::MyObject) = ... handle(::ExceptionType2, ::MyObject) = ... handle(::ExceptionType3, ::MyObject) = ... handle(e::Exception, ::MyObject) = rethrow(e) try # Access a dict here catch e handle(e, dict) end Am Montag, 17.

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Douglas Bates
On Monday, November 17, 2014 12:02:07 PM UTC-6, Eka Palamadai wrote: I don't know what matlab does. As a user, ones(n,1) and ones(n) both return me a vector, and it is confusing to find that ones(n,1) != ones(n). As Andreas and Tim have tried to say, your claim that ones(n,1) and

Re: [julia-users] BinDeps: How to access include path?

2014-11-17 Thread Milan Bouchet-Valat
Le lundi 17 novembre 2014 à 08:42 -0500, Erik Schnetter a écrit : On Mon, Nov 17, 2014 at 3:15 AM, Milan Bouchet-Valat nalimi...@club.fr wrote: Le dimanche 16 novembre 2014 à 15:41 -0500, Erik Schnetter a écrit : I see. I was afraid that the C structs may change in between different

[julia-users] capture STDIN character by character, turning off REPL.

2014-11-17 Thread Gustavo Goretkin
I would like to capture STDIN character by character, without any characters going to the REPL. Right now if I have function stdio_producer() while true c = read(STDIN,Char) if c == '\e' println(Done) break else print(:); print(c)

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Jeff Waller
As a user, ones(n,1) and ones(n) both return me a vector, and it is confusing to find that ones(n,1) != ones(n) I was where you are now a few months ago. It's a learning cure thing, I think, because now I don't make that mistake anymore or I'm like, oh yea, of course and change it 2

[julia-users] Dimension Independent Array Access

2014-11-17 Thread Christoph Ortner
I would appreciate advise how to best implement the following: I have an N^d array A, where the dimension d depends on the application (d \in \{1, 2, 3\}). Somewhere else I have a list L which is a d x M array or integers corresponding to points/elements in this array, e.g. if

[julia-users] Re: Help with metaprogramming

2014-11-17 Thread Greg Plowman
Thanks Simon and Tim.

Re: [julia-users] Dimension Independent Array Access

2014-11-17 Thread Tim Holy
You can do a lot better by dispatching on the dimension of A. Something like this: mygetindex{T}(A::AbstractArray{T,2}, L, Lcol) = A[L[1,Lcol], L[2,Lcol]] mygetindex{T}(A::AbstractArray{T,3}, L, Lcol) = A[L[1,Lcol], L[2,Lcol], L[3,Lcol]] Put your timing loops in a function so you take

Re: [julia-users] SymTridiagonal

2014-11-17 Thread Eka Palamadai
Thanks. Fortunately (or unfortunately) i have to use julia, and will have to make noise where something is confusing. On Monday, November 17, 2014 1:26:09 PM UTC-5, Tim Holy wrote: Your best bet, then, is to decide as quickly as possible whether you want to use Julia. If you start reading

Re: [julia-users] Concrete parametric types

2014-11-17 Thread i . costigan
Yeah realised that just after I posted my message :S On Monday, 17 November 2014 13:07:42 UTC+11, Jameson wrote: : is the subtype operator :: is the isa operator You can't (currently) express conditions of the form you want (except as assertions in the constructor) On Sun, Nov 16, 2014 at

[julia-users] Metaprogramming: what's going on here/is there a better way?

2014-11-17 Thread Randy Zwitch
I've seen this type of function generation in other packages, and wanted to try it for myself. This file in Twitter.jl has 5 functions with the same overall structure: https://github.com/randyzwitch/Twitter.jl/blob/master/src/help.jl Here's what I ended up doing, which works, but I've got no

Re: [julia-users] Metaprogramming: what's going on here/is there a better way?

2014-11-17 Thread Randy Zwitch
It would appear so...I swear that I tried that, but I guess I didn't try that permutation! So what's it about the @eval macro that doesn't allow for regular string interpolation, that I have to use the string() function instead of an inline $? On Monday, November 17, 2014 9:50:55 PM UTC-5,

[julia-users] Re: Arrayfire and Julia

2014-11-17 Thread Zahirul ALAM
May be somehow we will be able to integrate this with Julia so well that we will always have the first-mover advantage ;) -zahir On Monday, 17 November 2014 00:35:02 UTC-5, Viral Shah wrote: Wow, I did not know about this. We certainly should leverage this. The API looks easy to call too

Re: [julia-users] Metaprogramming: what's going on here/is there a better way?

2014-11-17 Thread elextr
On Tuesday, November 18, 2014 12:59:50 PM UTC+10, Randy Zwitch wrote: It would appear so...I swear that I tried that, but I guess I didn't try that permutation! So what's it about the @eval macro that doesn't allow for regular string interpolation, that I have to use the string()

[julia-users] Re: Dimension Independent Array Access

2014-11-17 Thread Christoph Ortner
Dear Tim, Many thanks - this was illuminating and helped me understand the bottleneck. But it seems I did not give the correct amount of information in my question. In fact, I also want to access A[ idx ] for general index vectors idx that do not necessarily belong to the L array. For