Re: [julia-users] Finalizer function not called consistently when ending a julia instance

2016-04-01 Thread Lee Bates
Thanks Tim, My plan is to use the above type as column values in a DataFrame. I want to be able to grow the DataFrame so I intend on making the above type similar to a C++ Vector (has reserve capacity). However, this will result in the file at some stage growing in size. As such I'll need to

Re: [julia-users] string version of expressions not parseable

2016-04-01 Thread Erik Schnetter
Vishesh I would use `serialize` and `deserialize` to ensure that you get exactly the same expression back that you wrote out initially. There are several caveats that would be very difficult to get correct in a string representation, e.g. if objects are aliased (if the same object appears

[julia-users] Re: programatically unquote something

2016-04-01 Thread 'Greg Plowman' via julia-users
I'm not an expert, nor do I understand what you're trying to do. Presumably you've read: http://docs.julialang.org/en/release-0.4/manual/metaprogramming/ I'm also somewhat confused by various ways to create expressions, and their relationship to each other: :(code) quote code end

[julia-users] Re: programatically unquote something

2016-04-01 Thread Eric Forgy
Hi Visesh, That sounds awesome. It is out of my area, but it reminds me of an effort I would love to see progress on: - port Julia parser to JavaScript That issue was closed in favor of: - Support compiling to JavaScript with

Re: [julia-users] Finalizer function not called consistently when ending a julia instance

2016-04-01 Thread Lee Bates
Thanks Tim, My eventual plan is to use the above type as columns in a DataFrame. This will require multiple mmapped vectors to be created. It looks like the Anonymous function creates a file called "", this means you can only use it to mmap an array once at any time.

[julia-users] Re: programatically unquote something

2016-04-01 Thread vishesh
Hi Eric, Thanks for being so helpful. My larger goal (and I understand there are others working on this too) is a lisp-looking syntax for julia. I'd like to be able to use Julia's inbuilt macro mechanisms to basically macroexpand a clojure-looking file of code I can write (defmacro m [x]

[julia-users] dispatch slowdown when iterating over array with abstract values

2016-04-01 Thread Tim Wheeler
Hello Julia Users. I ran into a weird slowdown issue and reproduced a minimal working example. Maybe someone can help shed some light. abstract Feature type A <: Feature end evaluate(f::A) = 1.0 type B <: Feature end evaluate(f::B) = 0.0 function slow(features::Vector{Feature}) retval =

[julia-users] Re: programatically unquote something

2016-04-01 Thread Eric Forgy
Hi Visesh, I'm interested in your questions and they are similar to things I've struggled with, but I can't help much so I hope someone else can. BUT... I wonder if you can explain a bit more about what is the big picture you are trying to achieve? It feels to me that you are trying to do

[julia-users] How to specify a template argument as a super type

2016-04-01 Thread Scott Lundberg
You can define: abstract Name1{S <: Name2} <: Name3{S} but I want to define: abstract Name1{S <: Name2} <: S However the second line does not work. Is there some other way to accomplish the same thing? Thanks!

[julia-users] Re: programatically unquote something

2016-04-01 Thread vishesh
oh wait, is it eval? eval(:(:x)) -> :x? On Friday, April 1, 2016 at 5:52:42 PM UTC-7, vis...@stanford.edu wrote: > > > x = :(:x) > > $x > > *ERROR: unsupported or misplaced expression $* > > > Is there a quote/unquote function that mimics the behavior or what happens > when you wrap something

[julia-users] programatically unquote something

2016-04-01 Thread vishesh
> x = :(:x) > $x *ERROR: unsupported or misplaced expression $* Is there a quote/unquote function that mimics the behavior or what happens when you wrap something with :() or do $x? I want to retrieve what's inside the variable x's expression. It's not sufficient to just wrap in Expr(:quote,

[julia-users] string version of expressions not parseable

2016-04-01 Thread vishesh
basically, if I do: > e = Expr(:quote, :(:x)) # (quoting a symbol) > show(e) *:($(Expr(:quote, :(:x* > print(e) *$(Expr(:quote, :(:x)))* > string(e) *"\$(Expr(:quote, :(:x)))"* > parse(string(e)) *:($(Expr(:$, :(Expr(:quote,$(Expr(:quote, :(:x* that's not the same expression

Re: [julia-users] My test is not failing properly

2016-04-01 Thread Tony Fong
Feature added. On Saturday, March 12, 2016 at 8:46:09 PM UTC-5, Tony Fong wrote: > > Noted. > > https://github.com/tonyhffong/Lint.jl/issues/127 > > > On Saturday, March 12, 2016 at 3:58:58 PM UTC-5, Milan Bouchet-Valat wrote: >> >> Le samedi 12 mars 2016 à 12:30 -0800, Douglas Bates a écrit :

[julia-users] Re: Is Ubuntu's PPA needed for installing Julia?

2016-04-01 Thread Tony Kelman
apt-get, deb packaging, and launchpad are seriouslu overkill for checking if a new version is available, and if so downloading and installing it. A PPA is also ubuntu specific, which doesn't help anyone using any other distribution.

Re: [julia-users] Re: raytracing in julia

2016-04-01 Thread Bart Janssens
Sorry for the shameless plug for my own package, but maybe CxxWrap.jl could help here: https://github.com/barche/CxxWrap.jl It was recently registered and works on Julia 0.4 and 0.5. If it seems like an option for you, I could help you get started to write the wrapper. Regards, Bart On

RE: [julia-users] Pkg.update() - Version of julia and JuliaParser do not match

2016-04-01 Thread David Anthoff
You can’t be on master for JuliaParser if you use julia 0.4.x, Keno just sent around a message on julia-dev that JuliaParser master is now julia 0.5 only. But if you do Pkg.free(“JuliaParser”) things should just work, in that case the package manager should just give you the last version of

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Josef Sachs
> On Fri, 1 Apr 2016 06:11:26 -0700 (PDT), Curtis Vogt said: > There does exist a way to do this in Julia 0.5 using the PROGRAM_FILE > > constant: > [ ... ] Curtis, thanks so much for that. Just want to note that it

[julia-users] Re: Is Ubuntu's PPA needed for installing Julia?

2016-04-01 Thread Uwe Fechner
Which is a pity, because a PPA (that is maintained) provides a way to automatically get updates. Perhaps Ubuntu 16.04 will provide an easier way to provide up-to-date Ubuntu packages using the Snappy format. On Friday, April 1, 2016 at 5:14:37 PM UTC+2, Kristoffer Carlsson wrote: > > Nope. I

[julia-users] Re: Given code is not giving the optimal solution .

2016-04-01 Thread Tim Wheeler
solve(m) print(m.colVal) That gives me this, which I believe is the right answer. Note that you included a space between `solve` and `(m)`, which is not recommended. 2-element Array{Float64,1}: 0.0 0.0 On Friday, April 1, 2016 at 4:03:30 AM UTC-7, tann...@gmail.com wrote: > > Hello to every

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
Ahh, nice. Thanks! Cameron On Fri, Apr 1, 2016 at 9:11 AM, Curtis Vogt wrote: > There does exist a way to do this in Julia 0.5 using the PROGRAM_FILE > > constant: > > Given the file:

Re: [julia-users] programminjuliahelp

2016-04-01 Thread Adrian Salceanu
Sure, like the Error says, "UndefVarError: x not defined”  Julia does not know what x and y are you talking about when you reference them in the if statement.  You need to declare them and provide their values (or declare them and get the values later from somewhere, input or database):  x =

[julia-users] Is Ubuntu's PPA needed for installing Julia?

2016-04-01 Thread Kristoffer Carlsson
Nope. I think the PPA is getting removed.

[julia-users] Re: getting a warning when overloading +(a,b)

2016-04-01 Thread Giuseppe Ragusa
``` import Base.+ type numerr num err end +(a::numerr, b::numerr) = numerr(a.num + b.num, sqrt(a.err^2 + b.err^2)); +(a::Any, b::numerr) = numerr(a + b.num, b.err); +(a::numerr, b::Any) = numerr(a.num + b, a.err); x = numerr(10, 1); y = numerr(20, 2); println(x+y) println(2+x)

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
Just trying to do a drop in "tool" for a few tasks. It's mostly a political workflow thing internally, and a single script worked -- so I wasn't trying to grow it further. My technical question is addressed (as there isn't any specific way, but it's a small thing that the julia style doesn't want

[julia-users] Pkg.update() - Version of julia and JuliaParser do not match

2016-04-01 Thread Aswathi Radhakrishnan
Hi, When I do Pkg.update(), I am getting the following error. I am on OS X. I tried Pkg.resolve() and many other workaround but it didn't resolve the problem. Has anyone encountered this issue? *julia> **Pkg.update()* *INFO: Updating METADATA...* *INFO: Updating JuliaParser...* *INFO:

[julia-users] getting a warning when overloading +(a,b)

2016-04-01 Thread Gerson J. Ferreira
I'm trying to overload simple math operators to try a code for error propagation, but I'm getting a warning. Here's a short code that already shows the warning message: type numerr num err end +(a::numerr, b::numerr) = numerr(a.num + b.num, sqrt(a.err^2 + b.err^2)); +(a::Any,

[julia-users] Is Ubuntu's PPA needed for installing Julia?

2016-04-01 Thread K leo
So the PPA has not been maintained for many months. I tried to download a Linux generic version of Julia and it appears to work well on my Xubuntu 15.10 64bits. So my question is do we really need the PPA to install Julia?

[julia-users] programminjuliahelp

2016-04-01 Thread Angeliki Avramidou
Hi, Im a student of the University of the Aegean, and i need your help with a project in Julia. I have done this programm so far, but something is missing in the beginning and i dont what i have to do to run the programm. Do i have to put numbers? if x < y println("x is less than y")

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Curtis Vogt
There does exist a way to do this in Julia 0.5 using the PROGRAM_FILE constant: Given the file: "example.jl" if abspath(PROGRAM_FILE) == @__FILE__ println("Running file") else println("Included file") end

Re: [julia-users] How to test if a type is concrete?

2016-04-01 Thread jw3126
Thanks! On Friday, April 1, 2016 at 2:45:58 PM UTC+2, Yichao Yu wrote: > > On Fri, Apr 1, 2016 at 8:32 AM, jw3126 > wrote: > > How to check if a Type is concrete? e.g. > > > > isconcrete(Array{Float64, 1}) > > true > > isconcrete(Int) > > false > > isleaftype > > > >

Re: [julia-users] How to test if a type is concrete?

2016-04-01 Thread Yichao Yu
On Fri, Apr 1, 2016 at 8:32 AM, jw3126 wrote: > How to check if a Type is concrete? e.g. > > isconcrete(Array{Float64, 1}) > true > isconcrete(Int) > false isleaftype > > > Also is there an established way to check if the return value of a function > is type stable for given

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread James Fairbanks
What kind of production system is it? Why is it inconvenient to have two files, one that defines the library and one that parses the command line and calls the "main" function? On Friday, April 1, 2016 at 8:21:03 AM UTC-4, Cameron McBride wrote: > > Thanks, I missed that thread. > > Although

[julia-users] How to test if a type is concrete?

2016-04-01 Thread jw3126
How to check if a Type is concrete? e.g. isconcrete(Array{Float64, 1}) true isconcrete(Int) false Also is there an established way to check if the return value of a function is type stable for given input? (e.g. check if @code_warntype shows return type in ALL CAPS.)

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
Thanks, I missed that thread. Although neither suggested solution works as I was hoping for. I am trying to shoehorn julia into various parts of our pipeline and production systems. Having a single library that can function as an executable via shell is helpful. It's not a big deal, I just

[julia-users] Re: Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets

2016-04-01 Thread Páll Haraldsson
On Wednesday, March 9, 2016 at 3:58:06 AM UTC, Michael G wrote: > > I am maintaining the SL4A project and we are getting requests to add Julia > to the repo. Is anyone interested in helping out so we can run julia on > SL4A??? I would need a little help on implementation since I am unfamiliar >

Re: [julia-users] Dict comprehension not type stable unless wrapped in a function

2016-04-01 Thread Yichao Yu
On Fri, Apr 1, 2016 at 5:33 AM, Tamas Papp wrote: > Hi, > > I ran into a problem with the result type of Dict comprehensions. If I > wrap the comprehension in a function, it produces the narrowest type, > otherwise the type of value is Any. Code looks like this: > > ## this

[julia-users] Given code is not giving the optimal solution .

2016-04-01 Thread tannirind
Hello to every one, Any one can tell me the code given below is not giving the optimal solution .it gives the just range of x1 and x2. I want to calculate optimal value of the function. Thank you for your time. Best Regards, Tanveer Iqbal using JuMP using Ipopt m = Model(solver =

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
oh cool that's convenient, for some reason the nzrange function isn't mentioned in the documentation. On Friday, April 1, 2016 at 2:46:53 AM UTC-7, Mauro wrote: > > On Fri, 2016-04-01 at 11:07, Anonymous > wrote: > > but what if I need to access the coordinates of the

Re: [julia-users] Finalizer function not called consistently when ending a julia instance

2016-04-01 Thread Tim Holy
This is different from what you're asking, but would Mmap.mmap(Mmap.Anonymous(), type, dims, offset) work for you? --Tim On Thursday, March 31, 2016 08:21:31 PM Lee Bates wrote: > Hi, > > I'm creating a Julia type that conatins a Mmapped Vector. The intention is > that the binary file

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Mauro
On Fri, 2016-04-01 at 11:07, Anonymous wrote: > but what if I need to access the coordinates of the nonzero entries of a > sparse matrix for some reason? Is there a faster way to do it than using > my colvals function? help?> nzrange search: nzrange nzrange(A, col)

[julia-users] Dict comprehension not type stable unless wrapped in a function

2016-04-01 Thread Tamas Papp
Hi, I ran into a problem with the result type of Dict comprehensions. If I wrap the comprehension in a function, it produces the narrowest type, otherwise the type of value is Any. Code looks like this: ## this version is not type stable, result of comprehension is a Dict ## with value type Any

Re: [julia-users] Re: raytracing in julia

2016-04-01 Thread Simon Danisch
Sorry, totally forgot to reply. Well, Cxx only works with a differently compiled julia, which is why I'm not using it yet to wrap user facing libraries. There a few half backed plans to support ray tracing for hit detection at some point... But preferably on the GPU, maybe simply with FireRay;) It

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
but what if I need to access the coordinates of the nonzero entries of a sparse matrix for some reason? Is there a faster way to do it than using my colvals function? On Friday, April 1, 2016 at 2:03:31 AM UTC-7, Mauro wrote: > > The reason rowvals exists is to access the vector of row-indices

Re: [julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Mauro
The reason rowvals exists is to access the vector of row-indices of a CSC-matrix, i.e. one of the internals of CSC, to allow efficient iteration over the non-zeros. However, there is no equivalent colvals internal, so there is little reason to do this and even less reason to encourage it.

[julia-users] why is there no colvals function for sparse matrices in base?

2016-04-01 Thread Anonymous
There is a rowals function, and then there is a find function, and the find function actually allows you to write a one line colvals function: colvals(S::SparseMatrixCSC) = round(Int, floor(find(S)/(size(S, 1)+0.1))+1) shouldn't someone add this to base?

Re: [julia-users] Access stack frame address?

2016-04-01 Thread Laurent Bartholdi
Thanks a lot! That works perfectly! Closed. On Thu, Mar 31, 2016, 14:08 Yichao Yu wrote: > On Thu, Mar 31, 2016 at 7:52 AM, Yichao Yu wrote: > > On Thu, Mar 31, 2016 at 5:23 AM, Laurent Bartholdi > > wrote: > >> Thanks for