Re: [julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Mike Innes
The distance between Julia and insanity is measured only in segfaults

Re: [julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Sorami Hisamoto
Any sufficiently advanced programing language is indistinguishable from Julia +1

Re: [julia-users] Computed type for parametrized method definition

2015-03-10 Thread Mauro
abstract typeA immutable typeA1 : typeA end immutable typeA2 : typeA end type typeB1 end type typeB2 end More Julian would be to write: transformType(T::Type{typeA1}) = typeB1 transformType(T::Type{typeA2}) = typeB2 transformType(T::Type) = error(Cannot handle type $T) function

[julia-users] Dimension mismatch error in Julia!

2015-03-10 Thread Kacem HARIZ
*Here is the code:* *w=1;* *γ=0.01;* *f(x,y)= [y;-w^2*sin(x)-u*w^2*cos(x) -2γ*y];* *for i=1:sizeof(Sx)* *x0=Sx[i+2];* *y0=Sy[i+2];* *for j=1:sizeU* *u=U[i];* *t,NX=ODE.ode45(f,[0,0.1],[x0,y0])* *end* *end* with Sx and Sy vectors of the same size, and U an other

[julia-users] Dimension mismatch error in Julia!​

2015-03-10 Thread Kacem HARIZ
I got stuck by an error in Julia! please I need help! *here is the code:* *w=1;* *γ=0.01;* *f(x,y)= [y;-w^2*sin(x)-u*w^2*cos(x) -2γ*y];* *for i=1 : numberOfStates* *x0=Sx[i+2];* *y0=Sy[i+2];* *for j=1:sizeU* *u=U[i];* *t,NX=ODE.ode45(f(x,y,u),[0,0.1],[x0,y0])* *

Re: [julia-users] Dimension mismatch error in Julia!

2015-03-10 Thread Andreas Noack
It is more helpful if you can provide a self contained example that we can run. However, I think you've been bitten by our white space concatenation. When you define f, the second element is written *-w^2*sin(x)-u*w^2*cos(x) -2γ*y* *but I think that is getting parsed as*

Re: [julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Michele Zaffalon
No segfaults means zero distance? On Tue, Mar 10, 2015 at 1:22 PM, Mike Innes mike.j.in...@gmail.com wrote: The distance between Julia and insanity is measured only in segfaults

Re: [julia-users] Re: Strange behaviour

2015-03-10 Thread Milan Bouchet-Valat
Le mardi 10 mars 2015 à 01:40 -0700, David van Leeuwen a écrit : Hello, On Friday, March 6, 2015 at 2:22:42 AM UTC+1, Tony Kelman wrote: I suppose this is related to + and - being unary operators? Ding ding. Unfortunately space being the horizontal

[julia-users] Re: Dimension mismatch error in Julia!​

2015-03-10 Thread Jonathan Goldfarb
Looks like a couple things going on here: - The error is due to a mix of hcat and vcat in the definition of f; replacing it with either *f(x,y)= [y;-w^2*sin(x)-u*w^2*cos(x); -2γ*y];* or *f(x,y)= [y, -w^2*sin(x)-u*w^2*cos(x), -2γ*y];* will fix this error. I predict other errors down the line: -

Re: [julia-users] Dimension mismatch error in Julia!​

2015-03-10 Thread Mauro
It would be helpful if you could post an example which runs with just copy-paste into the REPL. On Tue, 2015-03-10 at 10:55, Kacem HARIZ kacem.ha...@gmail.com wrote: I got stuck by an error in Julia! please I need help! *here is the code:* *w=1;* *γ=0.01;* *f(x,y)=

Re: [julia-users] @async weirdness

2015-03-10 Thread Sam L
I see the behavior on OS X. It also occurs with three println's. | | |_| | | | (_| | | Version 0.3.7-pre+1 (2015-02-17 22:12 UTC) _/ |\__'_|_|_|\__'_| | Commit d15f183* (21 days old release-0.3) |__/ | x86_64-apple-darwin13.4.0 julia t = @async

[julia-users] Re: How to generate composite types with a macro?

2015-03-10 Thread Spencer Lyon
Seems like you have a good answer already, but for what it’s worth I have the following code in a package I’m developing: # Some helpful typealiases to keep things tidy typealias SymExpr Union(Symbol, Expr) typealias VecSymExpr Union(Vector{Symbol}, Vector{Expr}) # Take a name and type and

[julia-users] @async weirdness

2015-03-10 Thread Ben Arthur
in my continuing quest to understand Julia tasks, i have created the following contrived example which does not behave as i would expect. can anyone help explain please? thanks in advance. julia function printfoobar() println(foo) println(bar) end printfoobar

Re: [julia-users] Computed type for parametrized method definition

2015-03-10 Thread Mauro
Have a look at stagedfunction (v0.4). I tried with the nightly build, but without success (using stagedfunction instead of function) - however, it looks like it is the solution, maybe I will just have to wait until this is implemented (and the syntax set). You will need to adapt the code

Re: [julia-users] Intel Xeon Phi support?

2015-03-10 Thread Jeff Waller
On Tuesday, March 10, 2015 at 1:39:42 PM UTC-4, Stefan Karpinski wrote: I'm not sure what that would mean – CPUs don't ship with software. Julia will support Kinght's Landing, however, although it probably won't do so until version 0.5. On Tue, Mar 10, 2015 at 1:36 PM, Karel Zapfe

[julia-users] Re: How to embed Julia into Visual Studoi 2013?

2015-03-10 Thread Jeff Waller
On Tuesday, March 10, 2015 at 12:25:20 PM UTC-4, Yuhui ZHI wrote: Hello everyone, I have a question: how to embed Julia into VS2013? I have read this: https://github.com/JuliaLang/julia/blob/release-0.3/doc/manual/embedding.rst But I still have no idea. I am using vs2013 in the

Re: [julia-users] Intel Xeon Phi support?

2015-03-10 Thread Viral Shah
LLVM support for KNL is already in place. So yes, it will come quickly, but in a released version of Julia, that is certainly no earlier than 0.5. It is also quite likely that we need good multi-threading support to ensure a good experience for KNL - which is also happening simultaneously. I

[julia-users] Re: Could it be a bug of PyCall or PyPlot?

2015-03-10 Thread Jerry Xiong
Many thanks! On Monday, March 9, 2015 at 10:24:42 PM UTC+1, Steven G. Johnson wrote: On Monday, March 9, 2015 at 5:24:22 PM UTC-4, Steven G. Johnson wrote: On Monday, March 9, 2015 at 5:18:52 PM UTC-4, Steven G. Johnson wrote: Yes, I should probably define a pycall method for ColorMap.

Re: [julia-users] Referencing function scope variables from @async blocks

2015-03-10 Thread Ben Arthur
+1 for documenting whether @async introduces a scope block. is what amit said true? On Saturday, July 20, 2013 at 4:23:21 AM UTC-4, Amit Murthy wrote: My understanding is that let blocks only localize variables explicitly specified on the first line, while @async localizes all variables.

Re: [julia-users] How to embed Julia into Visual Studoi 2013?

2015-03-10 Thread Stefan Karpinski
The embedding talked about in that page is how to call Julia from C/C++ programs. While VS2013 is a C++ program, unless you have the source for it, that doesn't really help. It may be possible to write a Julia plugin for VS2013, however, but that would take a lot of time, effort and expertise. On

Re: [julia-users] Intel Xeon Phi support?

2015-03-10 Thread Stefan Karpinski
I'm not sure what that would mean – CPUs don't ship with software. Julia will support Kinght's Landing, however, although it probably won't do so until version 0.5. On Tue, Mar 10, 2015 at 1:36 PM, Karel Zapfe kza...@gmail.com wrote: Hello: Is it true then, that Knight's Landing will have

RE: [julia-users] How to embed Julia into Visual Studoi 2013?

2015-03-10 Thread David Anthoff
There is actually an open source pluging for python for VS that is developed by MS. The whole package is VERY smooth (including debugger etc). If someone wanted to create a julia plugin for VS, that would probably be a great starting point. Certainly not me, though :) From:

Re: [julia-users] Re: Create formatted string

2015-03-10 Thread Tony Fong
Try Formatting.jl? (https://github.com/lindahua/Formatting.jl) On Wednesday, March 11, 2015 at 7:16:55 AM UTC+7, Dominique Orban wrote: This is an old question about computed format strings, but it's still biting me. I've been following your suggestion and I defined print_formatted(fmt,

Re: [julia-users] @async weirdness

2015-03-10 Thread Amit Murthy
What about if you don't print t . t = @async (println(foo);println(bar); println(baz)); On Wed, Mar 11, 2015 at 9:31 AM, Sam L sam.len...@gmail.com wrote: Same thing on arch linux actually: | | |_| | | | (_| | | Version 0.3.7-pre+15 (2015-03-02 23:43 UTC) _/ |\__'_|_|_|\__'_| |

Re: [julia-users] @async weirdness

2015-03-10 Thread Sam Lendle
Baz shows up then. From OS X: julia t = @async (println(foo);println(bar); println(baz)); foo julia bar julia baz _ On Tue, Mar 10, 2015 at 9:28 PM, Amit Murthy amit.mur...@gmail.com wrote: What about if you don't print t . t = @async (println(foo);println(bar); println(baz)); On Wed,

Re: [julia-users] @async weirdness

2015-03-10 Thread elextr
And same on 0.3.6 from the PPA on Linux | | |_| | | | (_| | | Version 0.3.6 (2015-01-08 22:33 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org release |__/ | x86_64-linux-gnu julia t = @async (println(foo);println(bar); println(baz)) foo Task (queued)

Re: [julia-users] @async weirdness

2015-03-10 Thread Amit Murthy
Works fine on Linux. On Tue, Mar 10, 2015 at 11:28 PM, Ben Arthur bjarthu...@gmail.com wrote: in my continuing quest to understand Julia tasks, i have created the following contrived example which does not behave as i would expect. can anyone help explain please? thanks in advance. julia

Re: [julia-users] @async weirdness

2015-03-10 Thread Sam L
Same thing on arch linux actually: | | |_| | | | (_| | | Version 0.3.7-pre+15 (2015-03-02 23:43 UTC) _/ |\__'_|_|_|\__'_| | Commit 0f0b136 (8 days old release-0.3) |__/ | x86_64-unknown-linux-gnu julia t = @async (println(foo);println(bar); println(baz)) foo Task

Re: [julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Ismael VC
Any sufficiently advanced programing language is indistinguishable from Julia That's so much better Paulo! [?] On Tue, Mar 10, 2015 at 6:44 AM, Michele Zaffalon michele.zaffa...@gmail.com wrote: No segfaults means zero distance? On Tue, Mar 10, 2015 at 1:22 PM, Mike Innes

[julia-users] How to embed Julia into Visual Studoi 2013?

2015-03-10 Thread Yuhui ZHI
Hello everyone, I have a question: how to embed Julia into VS2013? I have read this: https://github.com/JuliaLang/julia/blob/release-0.3/doc/manual/embedding.rst But I still have no idea. I am using vs2013 in the system of Windows10. I have created a project and now I want to use Julia in

[julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Daniel Carrera
On Monday, 9 March 2015 19:20:11 UTC+1, Paulo Jabardo wrote: Well, if that is the case, why not go one step further: Any sufficiently advanced programing language is indistinguishable from Julia +1 I would buy that t-shirt.

[julia-users] Re: Sparse matrix with diagonal index

2015-03-10 Thread Amit Jamadagni
Just was curious why it was not matching with the implementations in python library. I was working on the angular momentum operators and relating stuff from QuTiP which does similar stuff in python. On Wednesday, March 11, 2015 at 1:23:55 AM UTC+5:30, Steven G. Johnson wrote: On Tuesday,

Re: [julia-users] How to unpack a .tar file in Julia?

2015-03-10 Thread Stefan Karpinski
I would just shell out to the tar command and then work with the untarred directory. On Tue, Mar 10, 2015 at 4:05 PM, Weijian Zhang zweiji...@gmail.com wrote: Hello, I have a .tar.gz file. With GZip.jl, I can write code to unzip it to a .tar file. But how can I unpack this .tar file in

[julia-users] Re: Sparse matrix with diagonal index

2015-03-10 Thread Steven G. Johnson
But when I give in julia spdiagm(x, 1, length(x), length(x)) ERROR: BoundsError in sparse at sparse/csparse.jl:50 in spdiagm at sparse/sparsematrix.jl:2133 in spdiagm at sparse/sparsematrix.jl:2141 I get the above error. Any leads on this would be great. Thanks. You need to use

[julia-users] Re: Sparse matrix with diagonal index

2015-03-10 Thread Amit Jamadagni
Thank you very much for the response. But the behavior of the same in scipy is different i.e., it omits the elements. Is this not the expected behavior ?? The same result is as follows using scipy and numpy : import numpy as np import scipy.sparse as sp m = np.arange(3, -4, -1) t =

[julia-users] How to unpack a .tar file in Julia?

2015-03-10 Thread Weijian Zhang
Hello, I have a .tar.gz file. With GZip.jl, I can write code to unzip it to a .tar file. But how can I unpack this .tar file in Julia? Thanks, Weijian

Re: [julia-users] Intel Xeon Phi support?

2015-03-10 Thread Jeff Waller
On Tuesday, March 10, 2015 at 2:07:34 PM UTC-4, Viral Shah wrote: LLVM support for KNL is already in place. So yes, it will come quickly, but in a released version of Julia, that is certainly no earlier than 0.5. It is also quite likely that we need good multi-threading support to ensure

[julia-users] Creating custom distribution

2015-03-10 Thread Benjamin Deonovic
I'm trying to create a custom distribution. I define: immutable myDist : DiscreteMultivariateDistribution #code end function _logpdf{T:Real}(d::myDist, X::AbstractVector{T}) # code end _pdf(d::myDist, X::AbstractVector) = exp(_logpdf(d, X)) I can succesfully create a distribution

[julia-users] ERROR: `convert` has no method matching convert(::Type{Int64...}, ::Int64)

2015-03-10 Thread Maxwell
Hello folks, I am trying to run a little bootstrap in Julia using pmap and I am getting the following error from each process: fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on fatal error on

[julia-users] for and function don't work in the same way in terms of scope

2015-03-10 Thread Wendell Zheng
*Input 1:* y = 0 function foo() y = 10 end foo() y *Output 1:* 0 *Input 2:* y = 0 for i = 1:1 y = 10 end y *Output 2:* 10 In the first example, y introduces a local variable. In the second example, y is still a global variable. This is not consistent to what the official document

Re: [julia-users] Specifying return type of a function

2015-03-10 Thread Shivkumar Chandrasekaran
Thanks! I guess I will put the return type in the calling code instead. Nuisance though. On Tuesday, March 10, 2015 at 2:39:37 PM UTC-7, Mauro wrote: Sadly not. Have a look at https://github.com/JuliaLang/julia/issues/1090 and https://github.com/JuliaLang/julia/pull/10269 The

Re: [julia-users] Specifying return type of a function

2015-03-10 Thread Milan Bouchet-Valat
Le mardi 10 mars 2015 à 15:12 -0700, Shivkumar Chandrasekaran a écrit : Thanks! I guess I will put the return type in the calling code instead. Nuisance though. But you shouldn't need to. Julia is able to find out what the return type is as long as you write type-stable code. Can you give more

[julia-users] Re: Creating custom distribution

2015-03-10 Thread Sam L
Your _logpdf is not the same as Distributions._logpdf, so when you define it on ::myDist, you're not extending Distributions.jl's function. You can either import it with import Distributions._logpdf and define it as you do above, or define it as function

[julia-users] Re: Strange behaviour

2015-03-10 Thread David van Leeuwen
Hello, On Friday, March 6, 2015 at 2:22:42 AM UTC+1, Tony Kelman wrote: I suppose this is related to + and - being unary operators? Ding ding. Unfortunately space being the horizontal concatenation operator means some operations parse very differently and in highly whitespace-sensitive

[julia-users] Error array could not be broadcast to a common size

2015-03-10 Thread Rafael Guariento
Hi I am trying to run the following code but I get an error when I try to run the model (evaluate the result variable (calling the ODE23)) the error is: Error array could not be broadcast to a common size Does anyone have any idea why? Thanks in advance # Load libraries using ODE using

Re: [julia-users] Re: Create formatted string

2015-03-10 Thread Dominique Orban
This is an old question about computed format strings, but it's still biting me. I've been following your suggestion and I defined print_formatted(fmt, args...) = @eval @printf($fmt, $(args...)) Now I am in a situation where fmt is computed inside a function, and my function executes in