[julia-users] Re: Parametric types which add or delete fields.

2016-04-14 Thread Anonymous
OP here, So it looks like the consensus is to use a single type with un-used features set to nothing. I've actually been playing around with this approach since I posted this question. Here's what I've got: abstract AbstractCar abstract Color abstract Year typealias ColorOrVoid

[julia-users] Parametric types which add or delete fields.

2016-04-14 Thread Toivo Henningsson
As you say, it's a lot of types. If you would really need to instantiate an exponential number of types then maybe you should reconsider, because the jit compiler has to do quite a lot of work for each type that is used. But if you're not actually going to instantiate such a humongous number

Re: [julia-users] Re: Mathematical Computing course in Julia

2016-04-14 Thread Tamas Papp
If you encounter issues like this, I am sure that reporting them on Github or even submitting a PR would be helpful. I was also thinking about using Julia for a course recently, the debugger was the reason I postponed it for next year (so still using R with all its quirks). Best, Tamas On Fri,

Re: [julia-users] Parametric types which add or delete fields.

2016-04-14 Thread Tamas Papp
(Note that your code is not valid in Julia as you wrote it, missing `type` for many declarations, etc.) You could have type Car{C,H,M,Y} color::C horsepower::H model::M year::Y end and set parameters to Void when they are not needed. This would enforce what you require, and

Re: [julia-users] Re: PyCall exception.jl's pycheckv - hidden exceptions or is it normal for that to take some time?

2016-04-14 Thread Isaiah Norton
Your profiling result is not necessarily unreasonable. The listed line number (exception.jl:78) is where the macro-wrapped code is actually executed, and "pass_image_to_ff" sounds like it could be expensive. Is the Julia-Pycall-TF wrapper copying data in that function? If so, then it may be

[julia-users] Parametric types which add or delete fields.

2016-04-14 Thread Anonymous
So I have a pretty complex problem in designing my type data structure which I haven't been able to solve. Let's say I have an abstract car type: abstract AbstractCar now let's say I have the following possible features for a car: color horsepower model year Now I want to be able to create

[julia-users] Re: Mathematical Computing course in Julia

2016-04-14 Thread Sheehan Olver
When the course is over I'll give a description of any issues encountered using Julia for teaching. At the moment there are two big ones: the error messages are hard for students to parse, and the documentation is incomplete. An example of the latter that came up is *help?> **reshape*

[julia-users] Mathematical Computing course in Julia

2016-04-14 Thread Sheehan Olver
I'm currently lecturing the course MATH3076/3976 Mathematical Computing at U. Sydney in Julia, and thought that others may be interested in the resources I've provided: http://www.maths.usyd.edu.au/u/olver/teaching/MATH3976/ The lecture notes and labs are all Jupyter notebooks. I've also

[julia-users] Re: Modifying large vectors of repeated data

2016-04-14 Thread Dan
Similar `rle` and `inverse_rle` functions exists in StatsBase.jl https://github.com/JuliaStats/StatsBase.jl/blob/master/src/misc.jl#L15 . These function may be enough for the application involved. On Thursday, April 14, 2016 at 6:48:40 PM UTC+3, Kenta Sato wrote: > > I guess what you want is

[julia-users] [ANN] Spark.jl - Julia interface to Apache Spark

2016-04-14 Thread Andrei Zh
Spark.jl provides Julia bindings for Apache Spark - by far the most popular computational framework in Hadoop ecosystem. Find it at: https://github.com/dfdx/Spark.jl There's still *a lot* of work to do (Spark API is *huge*), but Spark.jl already supports: - map and reduce functions, as

Re: [julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread Tony Kelman
Some retroactive adjustment of inter-package lower bounds might be called for to fix this kind of issue. On Thursday, April 14, 2016 at 12:06:45 PM UTC-7, Tim Holy wrote: > > You probably have a stale version of Compose, check Pkg.status() and/or do > a > Pkg.update(). > > --Tim > > On

Re: [julia-users] Re: causes of system crash?

2016-04-14 Thread Tony Kelman
If this is in a VM and @simd results in different behavior, this may be the VM and LLVM not agreeing on which instruction sets your system is capable of handling. On Thursday, April 14, 2016 at 6:29:58 AM UTC-7, Isaiah wrote: > > Some library mismatch of the generic version causing the crashes

Re: [julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread Tim Holy
You probably have a stale version of Compose, check Pkg.status() and/or do a Pkg.update(). --Tim On Thursday, April 14, 2016 11:38:15 AM Richard Dennis wrote: > Hi, > > after I type using GtkIDE I get the following. Any thoughts? > > >- > >INFO: Precompiling module Immerse... > >

[julia-users] Re: PyCall exception.jl's pycheckv - hidden exceptions or is it normal for that to take some time?

2016-04-14 Thread Tim Wheeler
The relevant lines are: pycall(tfJuliaInterface.pass_image_to_ff, Void, weights, means, covs, model.sess, model.deepdrive, model.input_tensor) pyerr_check("pass image to ff") def pass_image_to_ff(weights, means, covs, sess, NN, image): feed = {NN.input_image: image,

[julia-users] PyCall exception.jl's pycheckv - hidden exceptions or is it normal for that to take some time?

2016-04-14 Thread Tim Wheeler
Hello Julia users, I am using PyCall to run some Python code. I did some profiling and found that my time is dominated by the pycheckv macro. My question is whether this is normal or if there are hidden exceptions in my Python code that I need to worry about. pyerr_check is not revealing any

[julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread Richard Dennis
Hi, after I type using GtkIDE I get the following. Any thoughts? - INFO: Precompiling module Immerse... - ERROR: LoadError: LoadError: UndefVarError: absolute_native_units not defined in include at boot.jl:261 in include_from_node1 at loading.jl:320 in

Re: [julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread lawrence dworsky
Thanks for pointing me in the right direction. I had some (possibly corrupt) junk from earlier installations. I cleaned out everything and reinstalled Julia 0.4.5. Everything is working fine now. GtkIDE looks real neat. Larry On Thu, Apr 14, 2016 at 8:38 AM, Andreas Lobinger

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread Tim Holy
On Thursday, April 14, 2016 01:09:19 PM James Fairbanks wrote: > I can't add the constraint that B and C must be "consistent" to the type > definitions. However, the constructor can use that constraint in the type > annotation on its arguments. > In that case there is nothing to stop you from

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread James Fairbanks
Correction: > So the general thing happening here is: > > > type A{B,C} >c::C > end > > function A{B,C}(c::C{B}) >return A{B,typeof(c)}(c) > end > > > Rest of original message: > I can't add the constraint that B and C must be "consistent" to the type > definitions. However, the

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread James Fairbanks
Thanks Tim, > As you feared, using .types this way messes up inference. The better > approach > is > > SparseArray{K,V,N}(data::Associative{K,V}, dims::NTuple{N,Int}) = > SparseArray{V, N, typeof(data)}(data, dims) > So the general thing happening here is: type A{B,C} c::C end function

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread Tim Holy
On Thursday, April 14, 2016 11:54:45 AM James Fairbanks wrote: > function SparseArray(data, dims) > nt, t = eltype(data).types > n = length(nt.types) > C = typeof(data) > return SparseArray{t, n, C}(data, dims) > end As you feared, using .types this way messes up inference. The

Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread daniel . matz
OK, yeah, I had the same problem when I had EDITOR="emacs -nw", so that it didn't launch the GUI but just opened up in the terminal. Maybe we should make an issue and ask that edit be made a little more clever. In your case, it could perhaps detect that there isn't a windowing system

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread James Fairbanks
> > Exactly! It's not currently possible to express the > "triangular-dispatch-like" dependency between `C` and `T`, `N`, so you can > just enforce it in the constructors. An ArgumentError here is probably > sensible, but I often find that in cases like these the inner constructor > becomes

[julia-users] Re: Modifying large vectors of repeated data

2016-04-14 Thread Kenta Sato
I guess what you want is RLEVector of RLEVectors.jl: https://github.com/phaverty/RLEVectors.jl. This does run-length encoding for repeated elements and hence applying a function to all elements would be fast. julia> v = RLEVector(vcat(zeros(1), ones(1)))

Re: [julia-users] How can I do something when an object is deallocated?

2016-04-14 Thread Dawei Si
Thank you! This is just what I want! 在 2016年4月14日星期四 UTC+8下午11:34:55,Isaiah写道: > > http://docs.julialang.org/en/release-0.4/stdlib/base/#Base.finalizer > > On Thu, Apr 14, 2016 at 11:15 AM, Dawei Si > wrote: > >> I'm writing a program in julia with an C library that provides

Re: [julia-users] How can I do something when an object is deallocated?

2016-04-14 Thread Isaiah Norton
http://docs.julialang.org/en/release-0.4/stdlib/base/#Base.finalizer On Thu, Apr 14, 2016 at 11:15 AM, Dawei Si wrote: > I'm writing a program in julia with an C library that provides "new" and > "free" function, and I want to store a pointer in my custom type in julia. > When

[julia-users] How can I do something when an object is deallocated?

2016-04-14 Thread Dawei Si
I'm writing a program in julia with an C library that provides "new" and "free" function, and I want to store a pointer in my custom type in julia. When an instance of the type is created it will create an object in the C library, but how can I free it when the object in julia is deallocated?

Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread Josef Sachs
> On Thu, 14 Apr 2016 07:46:18 -0700 (PDT), daniel matz said: > I'm on Mac OS X with Julia 0.4.3. The edit function is defined in > interactiveutil.jl > . > What is the output if you run this at the REPL: >

Re: [julia-users] Re: Need help with GR and PyPlot

2016-04-14 Thread Josef Heinen
Both problems are solved with the latest build. Please rebuild (or re-install) the GR.jl master branch. It seems, that the (new) Cairo backend needs some more testing :-) Regards, Josef On Thursday, April 14, 2016 at 8:59:37 AM UTC+2, Daniel Carrera wrote: > > Hello Josef, > > Thanks for the

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread Matt Bauman
On Thursday, April 14, 2016 at 8:38:33 AM UTC-4, James Fairbanks wrote: > > Is that from this package https://github.com/JuliaSparse/SparseVectors.jl > or somewhere else? > Yes, and it was incorporated into Base in 0.5. It's basically a one-column SparseMatrixCSC. > > They should have

[julia-users] Modifying large vectors of repeated data

2016-04-14 Thread Terry Seaward
Hi, I have a large vector of repeated data (dates in my case, but I'd like to keep this generic). In R I can apply a function to the elements efficiently using something like this: myfun <- function(x, fun, ...) { ux <- unique(x); fun(ux, ...)[match(x, ux)] } myfun(x, as.character)

Re: [julia-users] Re: edit() with foreground emacs

2016-04-14 Thread daniel . matz
I'm on Mac OS X with Julia 0.4.3. The edit function is defined in interactiveutil.jl . What is the output if you run this at the REPL: Base.editor() What happens if you do this at the REPL: run(`emacs Makefile`) If you

Re: [julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread Andreas Lobinger
Hello colleague, On Thursday, April 14, 2016 at 2:34:28 PM UTC+2, lawrence dworsky wrote: > > I don't seem to be able to get any of this to work. Both Pkg.add entries > return > > > fatal: your current branch 'master' does not have any commits yet > ... > ... > in add at

Re: [julia-users] Re: causes of system crash?

2016-04-14 Thread Isaiah Norton
> > Some library mismatch of the generic version causing the crashes sounds > very likely, doesn't it? No. On Thu, Apr 14, 2016 at 8:51 AM, K leo wrote: > I did more tests and runs. Now I put most @inbounds and @simd back and > even added more in other places. A few runs

[julia-users] Re: causes of system crash?

2016-04-14 Thread K leo
I did more tests and runs. Now I put most @inbounds and @simd back and even added more in other places. A few runs over 3 hours did not get any problem. Someone mentioned about heat. I am actually running these on the deck with outside temperature over 34C. The MacBook Pro is hot but has

Re: [julia-users] Re: What do you call an (Associative{Int,T} or AbstractArray{T})

2016-04-14 Thread James Fairbanks
On Apr 13, 2016 7:57 PM, "Matt Bauman" > If your default element is going to be zero(T), have you tried using SparseVectors? Is that from this package https://github.com/JuliaSparse/SparseVectors.jl or somewhere else? > They should have *significantly* better performance

Re: [julia-users] Re: GtkIDE.jl, a semi-functional editor for Julia

2016-04-14 Thread lawrence dworsky
I don't seem to be able to get any of this to work. Both Pkg.add entries return fatal: your current branch 'master' does not have any commits yet ... ... in add at pkg.jl:23 I have no idea what this means. My installation of Julia is brand new so I don't think it's messed up.

[julia-users] [ANN] ConnectionPools.jl

2016-04-14 Thread jock . lawrie
Hi all, Introducing ConnectionPools.jl , a package for managing database connection pools. Currently only Redis connections have been tested. I'll add tests for other databases on an as-needed basis. As always, thoughts/criticisms/suggestions

Re: [julia-users] Re: Need help with GR and PyPlot

2016-04-14 Thread Daniel Carrera
Hello Josef, Thanks for the help. I am now back in front of my Macbook and I tried your instructions. savefig() still doesn't work but the message is different now: julia> savefig("plot.png") GKS: dlopen(/Users/daniel/.julia/v0.4/GR/deps/gr/lib/cairoplugin.so, 1): Library not loaded: