[julia-users] Re: What features are interesting in a VS Code plug-in?

2015-10-08 Thread Burning Legion
-Autocomplete(Intellisense), with help for a function showing up on hover -Linter support -Debugger (this would be awhile of course for both vscode and gallium) Other than the basics, some nice commands would be: -Create a package This is just off the top of my head. What would be great is some

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread lewis
Thanks Tomas, but what you are saying seems to violate the manual. Here is the verbatim example: (from Chapter 12, "Methods", page 104) As you can see, the arguments must be precisely of type Float64. Other numeric types, such as integers or 32- bit floating-point values, are not

[julia-users] What features are interesting in a VS Code plug-in?

2015-10-08 Thread Tomas Lycken
I've just been invited to an early look at a plug-in SDK for Visual Studio Code, and I want to start experimenting with it in a plug-in for Julia development. What features are interesting in such a plug-in? I have no idea what the SDK will support, so your favorite feature might not be

Re: [julia-users] Is there a way to replace f(object, args...) with object.f(args...)?

2015-10-08 Thread Burning Legion
I grew to love multiple dispatch after awhile. It is quite different and honestly it does take awhile to fully make use of it. It made my life much easier once I had a grasp on it personally. What you want could be done as well by defining Man.eat(y) = feed(Man,y) in your constructor. On

[julia-users] Re: Is there a way to replace f(object, args...) with object.f(args...)?

2015-10-08 Thread cheng wang
Thank everyone! I am convinced by the trick feed(man, food). Just like: append!(collection, element) vs collection.add(element). append! gives me the feeling that I am controlling the program :) Best, Cheng

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread Tomas Lycken
This is well documented behavior, and has been the same since “forever” (it’s a fundamental design decision in Julia’s type system). The manual section on parametric types talks quite a lot about this, including

[julia-users] Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread lewis
Here is a simple function to evaluate a polynomial. Different potential function signatures are shown in the commented lines: # 1 function p{T<:Real, Y<:Real}(x::T, coeff::Array{Y,1}) # this works # 2 function p(x::Real, coeff::Array{Real,1}) # DOES NOT WORK # 3 function p(x::Any,

Re: [julia-users] Is there a way to replace f(object, args...) with object.f(args...)?

2015-10-08 Thread Glen O
This would all be so much easier if we had custom infix operations beyond the unicode ones. Just a thought, but what if |> were tweaked to have a ternary form |> (), so that a|>f(b) automatically gets interpreted as f(a,b)? If you had a function that outputs a function (say, f(j)=i->i^2+j^2),

[julia-users] Re: Julia list-of-lists elementwise equality vs array broadcasting

2015-10-08 Thread Maxim Berman
Thanks, good idea, Glen. Le lundi 5 octobre 2015 17:04:37 UTC+2, Glen O a écrit : > > B = (L .== L[1:1]) > > On Monday, 5 October 2015 22:34:35 UTC+10, Maxim Berman wrote: >> >> Hello, >> >> I tried to use element-wise equality on list-of-lists in julia: >> >> L = Vector{Int}[[1,2],[2,3]] >> B =

[julia-users] Re: Error occurred when I Push! this to Array{Any}

2015-10-08 Thread cheng wang
Simon, I defined a new push! methods. However the error thrown is "MethodError: `push!` has no method..." followed by "you may have intended to import Base.push!" So I misunderstood the error message. After I changed the function name, the error is fixed. Thanks very much! Btw, what is the right

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread Tomas Lycken
You’re reading the wrong part of the manual :) The missing piece of the puzzle is that, from your example, Array{Float64,1} <: Array{Real,1} is *not true*, and therefore, the invocation p(2.3, [1, 1.5]) *does not* match the method definition p(x::Real, coef::Array{Real,1}); the first

[julia-users] Error occurred when I Push! this to Array{Any}

2015-10-08 Thread cheng wang
Hello everyone, I got this error by the compiler (Julia 0.4rc): ERROR: LoadError: MethodError: `push!` has no method matching push!(::Array{Any,1}, ::Tuple{Array{ASCIIString,1},Array{ASCIIString,1},TestFilter}) As far as I see, this pushing should be ok. Could someone help ? Best, Cheng

[julia-users] Re: Error occurred when I Push! this to Array{Any}

2015-10-08 Thread Simon Danisch
This should work and nowadays overwritting push! should throw an error, so it's unlikely that you did this. What usually helps is to give a minimal reproducable example, e.g. via a github gist. Best, Simon Am Donnerstag, 8. Oktober 2015 12:48:38 UTC+2 schrieb cheng wang: > > Hello everyone, >

[julia-users] Re: Error occurred when I Push! this to Array{Any}

2015-10-08 Thread Kristoffer Carlsson
The right way is to import Base.push! and then add your owns. You probably shouldn't overwrite the ones for Base types but for your own types, it is perfectly acceptable.

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread Kristoffer Carlsson
There is a difference between an abstract type like Number and a type parameterized by an abstract types like Vector{Number}. While it is true that for example Float64 is a subtype of Number it is not true that Vector{Float64} is a subtype of Vector{Number}. On Thursday, October 8, 2015 at

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread lewis
Yup. Thanks Kristoffer. I did a few more little things in julia and figured it out before I saw your post: function(x::Real, y::Real) return 2x - y end function(x::Real, y::Array{Real, 1}) return 2x - y[1] end First one works; second one does not. It is the use of Array, a compound

Re: [julia-users] Translating Julia to Javascript via LLVM and Emscripten

2015-10-08 Thread Páll Haraldsson
On Monday, September 2, 2013 at 6:54:17 PM UTC, Stefan Karpinski wrote: > > This won't work at this point for the same reasons that we can't yet > generate binaries – we use the LLVM JIT incrementally rather than compiling > a large, complete chunk of LLVM code. If it is/were possible to use

Re: [julia-users] DataFrames' readtable very slow compared to R's read.csv when loading ~7.6M csv rows

2015-10-08 Thread Jacob Quinn
Pushed some fixes. Thanks for trying it out. -Jacob On Wed, Oct 7, 2015 at 11:54 PM, bernhard wrote: > Thank you Quinn > > Things do not work (for me) though. > > is it possible you are missing a comma after "col" in lines 24 and 33 of > Sink.jl > function

[julia-users] Re: Accessing MSYS2 built dlls from Julia

2015-10-08 Thread Bill Hart
Thanks for the explanation, Tony. Actually, I'm only investigating the feasibility of something. So weaning the library off posix is one possibility for us to consider. Bill. On Thursday, 8 October 2015 06:56:27 UTC+2, Tony Kelman wrote: > > When I try to ccall printf from cygwin1.dll (which

[julia-users] Julia getting stuck in long for loop / help at debugging not terminating code

2015-10-08 Thread axsk
Hello dear Julia fellows! I use a for loop to batch run a clustering-script with different data and parameters, you can find my code in the gist . Most of the work (~120s per call) is spend in the Hokusai.cluster call, which is a pure

[julia-users] Does the Windows Binary include Python?

2015-10-08 Thread Alex Dowling
Hello, I am helping a colleague debug some errors with the PyPlot in the Windows binary [Version 0.4.0-rc1 (2015-09-09 16:07 UTC)]. Here are the error messages: julia> using Pyplot INFO: Precompiling module Pyplot... ERROR: LoadError: PyCall not properly installed. Please run

[julia-users] Re: Use preallocation, A[:] vs A, and wrapping and passing collections of variables as types

2015-10-08 Thread Patrick Kofod Mogensen
Thanks again for the answer. This stuff really opened my mind to a lot of stupid thinks I have done in my code. The constant allocation and freeing of memory is very apparent when using @allocated on some of the code I'm working on right now. The allocated memory is drastically reduced, as one

[julia-users] div() for Floatingpoint number

2015-10-08 Thread Sisyphuss
Hello everyone, I want a function F(), so that F(0.154, 0.1) = 0.1 F(0.154, 0.01) = 0.15 F(0.154, 0.003) = 0.153 I tried `div(a,b)*b`. However, I got: div(0.128,0.0001) * 0.0001 = 0.1279 not equal to 0.1280 Any solution?

Re: [julia-users] div() for Floatingpoint number

2015-10-08 Thread Isaiah Norton
See http://julia.readthedocs.org/en/latest/manual/integers-and-floating-point-numbers/#rounding-modes and the rest of the discussion on that page. On Thu, Oct 8, 2015 at 11:01 AM, Sisyphuss wrote: > Hello everyone, > > I want a function F(), so that > F(0.154, 0.1) =

Re: [julia-users] Does the Windows Binary include Python?

2015-10-08 Thread Luthaf
I guess that is a bug in PyCall, so you should do your bug report there : https://github.com/stevengj/PyCall.jl/issues/new. Please ping me (@Luthaf) on the issue, because this might be related with Conda.jl Cheers, Luthaf Alex Dowling a écrit: Hello, I am helping a colleague debug some

Re: [julia-users] Does the Windows Binary include Python?

2015-10-08 Thread Steven G. Johnson
On Thursday, October 8, 2015 at 11:24:28 AM UTC-4, Steven G. Johnson wrote: > > > > On Thursday, October 8, 2015 at 10:42:38 AM UTC-4, Luthaf wrote: >> >> I guess that is a bug in PyCall, so you should do your bug report there : >> https://github.com/stevengj/PyCall.jl/issues/new. Please ping

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-10-08 Thread Chris
+1, I like the new display a lot. On Wednesday, October 7, 2015 at 10:53:00 PM UTC-4, Steven G. Johnson wrote: > > > > On Wednesday, October 7, 2015 at 8:05:19 PM UTC-4, Art Kuo wrote: >> >> I've coded up a simple replacement to the show() function for ranges. The >> idea is to give the user

Re: [julia-users] Re: Naming convention

2015-10-08 Thread Stefan Karpinski
On Thu, Oct 8, 2015 at 10:03 PM, Carlos Pita wrote: > this is specially true for Julia, considering that -by now- people are > mostly courting her because of how beautiful she is Please don't do this. Not everyone may be aware, but our community standards

Re: [julia-users] Re: Naming convention

2015-10-08 Thread Carlos Pita
I think in general Julia achieves a good (and difficult) balance between terseness, clarity and consistency. That said, here is an example where she doesn't: function_name function_module functionloc One could say that "loc" is a very short word (and that it's clear enough to avoid the longer

Re: [julia-users] installing using git

2015-10-08 Thread Isaiah Norton
Welcome to Julia. That's not going to work from the Julia prompt because git is not built-in to Julia. You need to use the package manager: http://docs.julialang.org/en/release-0.4/manual/packages/ or the git command line -- here are some tutorials for the latter:

Re: [julia-users] What does `Base.uncompressed_ast(f.code)` return?

2015-10-08 Thread Andrei Zh
Thanks, this explains it. On Thursday, October 8, 2015 at 6:41:05 PM UTC+3, Isaiah wrote: > > It is the expanded AST, i.e. the same as this (except for line numbers): > > (:(x -> x + 1) |> expand).ast > > As far as `eval`: try eval'ing `:(x -> x+1) |> expand` directly, and then > look at the

[julia-users] Re: Use preallocation, A[:] vs A, and wrapping and passing collections of variables as types

2015-10-08 Thread Kristoffer Carlsson
Maybe thinking of phat[:] = 1./(1+exp(-vector)) as tmp = 1./(1+exp(-vector)) copy!(phat, tmp) helps to understand what is going on better? On Thursday, October 8, 2015 at 11:12:54 PM UTC+2, Greg Plowman wrote: > > OK, so now I'm super confused now. > > I think there's a couple of things

[julia-users] Re: Replace value in a matriz

2015-10-08 Thread Rosangela Oliveira
Hi Mauricio, The output for that is "change_min_max! (generic function with 1 method) " I didn't understand.

[julia-users] Re: IPython keeps giving Kernel error

2015-10-08 Thread Tony Kelman
You can make a copy of the REQUIRE file and put that in a clean new version of .julia, which will automatically install the same set of packages next time you run Pkg.update() On Thursday, October 8, 2015 at 11:28:17 AM UTC-7, ron...@gmail.com wrote: > > I'm still stuck on this. > > On

[julia-users] Re: IPython keeps giving Kernel error

2015-10-08 Thread ronubi
Thanks for the suggestions, but they're not working for me at all. :-( On Thursday, October 8, 2015 at 6:12:00 PM UTC-7, Tony Kelman wrote: > > You can make a copy of the REQUIRE file and put that in a clean new > version of .julia, which will automatically install the same set of > packages

[julia-users] Passing a void** to C

2015-10-08 Thread Dominique Orban
I'm trying to call the C interface to the HSL MA97 from Julia. It's a symmetric indefinite factorization library that uses OpenMP. One of the main C functions expects a void** as argument. The example that ships with the library declares a void* variable named akeep. The main program doesn't

Re: [julia-users] Passing a void** to C

2015-10-08 Thread Steven G. Johnson
On Thursday, October 8, 2015 at 10:08:33 PM UTC-4, Isaiah wrote: > > akeep = Ptr{Void} > > > This is declaring a "DataType" variable (try `typeof(Ptr)` to see what I > mean). You need to construct an instance, so try: `akeep = > Ptr{Ptr{Void}}(0)` > > Then the ccall signature should be

[julia-users] Re: escaping double quotes inside backticks?

2015-10-08 Thread John Brock
A-ha, I see, thanks. Also, for anyone who comes across this post, I forgot the -o flag before 'StrictHostKeyChecking no'. On Thursday, October 8, 2015 at 4:35:07 PM UTC-7, Steven G. Johnson wrote: > > > > On Thursday, October 8, 2015 at 7:16:34 PM UTC-4, John Brock wrote: >> >> I'm trying to

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-10-08 Thread Art Kuo
Oh, clearly I did not understand show(). I've ported the changes to writemime instead, and as a bonus figured out how to automatically format for screen width (using Base.print_matrix_row). Just to recap: There is little or no problem with linspace or range being an object rather than array as

[julia-users] Re: Julia 0.4.0-rc4 abstract types in functional signatures don't seem to work

2015-10-08 Thread vavasis
I'd like to point out that the fact that Array{Float64,1} is not a subtype of Array{Any,1} makes it easier to reason about Julia program correctness and therefore avoid errors. Consider: function f(a::Array{Any,1}) push!(a, "hello") end Is this function correct? Assuming I didn't make

[julia-users] three items re warnings/errors in 0.4.0-rc4

2015-10-08 Thread vavasis
I have three suggestions concerning improving error- and warning-reporting in 0.4.0-rc4: (1) First, there appears to be an actual bug with error system. My program is giving BoundsError for an array subscript out of range, but the line number of the source statement in the error message is

[julia-users] Reactive loop

2015-10-08 Thread Yakir Gagnon
I’m trying to use Reactive to cyclically fetch data from an outer source. I want to have the value of some Signal update from this outer source, and once it’s updated, I want it to go and update itself again, and so on. Here are the details: I connect to a spectrometer with Andreas

[julia-users] Re: IPython keeps giving Kernel error

2015-10-08 Thread ronubi
I got it working now. The suggestion to start with an empty ~/.julia/ didn't work, but fortunately I just renamed .julia to .oldjulia and kept everything there. After removing the empty directory, I restored .oldjulia to .julia and then Pkg.update()found a whole slew of new versions of

[julia-users] Re: IPython keeps giving Kernel error

2015-10-08 Thread ronubi
I'm still stuck on this. On Wednesday, October 7, 2015 at 10:16:04 PM UTC-7, David P. Sanders wrote: > > You could try with the latest Julia 0.4 release candidate. Have you tried > deleting your whole .julia directory and reinstalling IJulia? Not yet. If I remove ~/.ijulia/, would I need to

[julia-users] Re: fminbox question

2015-10-08 Thread Weichi Ding
Thanks all. After the julias version has been updated to 0.3.11 it work fine now. Thanks for help! On Wednesday, September 30, 2015 at 7:34:22 PM UTC-4, Tony Kelman wrote: > > Julia 0.2.0 is nearly two years old, and very few packages are still > actively tested against it. Please upgrade to a

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-10-08 Thread lewis
I know it may feel to the insiders/developers that the requestors are being a bit dogmatic with expectations from other languages. 2 cautions: 1. Insiders need to be careful not to be defensive: converts are here because they are fans and evangelists (potentially) in their community. Gotchas