[julia-users] Re: Help wanted - does Cairo.jl work for everyone else except me?

2015-10-11 Thread cormullion
Thanks for that. I also reproduced the bug on MacOS 10.10 Yosemite. So I don't think it's the Mac version. On Saturday, October 10, 2015 at 6:37:38 PM UTC+1, Andreas Lobinger wrote: > > I attached a question to the libcairo mailing list: >

Re: [julia-users] Get an array or just a string of all installed Julia packages

2015-10-11 Thread Tim Holy
Try this: (new installation) Pkg.init() cp OldInstallation/.julia/v0.4/REQUIRE NewInstallation/.julia/v0.4/ (new installation) Pkg.update() As for your original question, collect(keys(Pkg.installed())) should do what you ask. --Tim On Saturday, October 10, 2015 12:47:01 PM

[julia-users] Why does these "tanh" diff so much in performance?

2015-10-11 Thread cheng wang
Hello everyone, I want to do an in-place tanh: y = tanh(x) assuming that y and x are preallocated (both are Array{Float64, 1024*1024}). I tested different implementations and got very different performance. Version1: julia> @time map!(tanh, y, x) 0.149988 seconds (3.15 M allocations: 48.000

Re: [julia-users] Re: Loading files and scoping of variables in parallel code

2015-10-11 Thread Tim Holy
IIUC, there were two reasons for deprecating require: - many people complained about the slew of related concepts (include, require, reload, using, import). require seems like the easiest of these to eliminate. - Package precompilation. It was quite ambiguous whether require(filename) should

Re: [julia-users] Loading files and scoping of variables in parallel code

2015-10-11 Thread Tim Holy
I'm not certain I understand the interaction between your functions and your data. Let me make a guess: you're basically wanting to supply some parameters as defaults? Then the strategy I'd recommend is the following: module MyModule export foo foo(x, p) = println("Got ", x, " and parameter

Re: [julia-users] Why does these "tanh" diff so much in performance?

2015-10-11 Thread Tim Holy
On Sunday, October 11, 2015 04:12:51 AM cheng wang wrote: > Hello everyone, > > I want to do an in-place tanh: y = tanh(x) assuming that y and x are > preallocated (both are Array{Float64, 1024*1024}). > I tested different implementations and got very different performance. > > Version1: >

[julia-users] Merge two dict with common keys being summed

2015-10-11 Thread Grey Marsh
Hello, How do I merge two a = Dict(2 => 5, 3 => 7, 5 => 1), b = Dict(2 => 3, 3 => 5, 11 => 4). I need to merge these two to a dict in which the values for common keys are added up. In case of the dicts a and b it would give c = Dict(2 => 8, 3 => 12, 5 => 1, 11 => 4). If I do merge(a,b) it

[julia-users] @parallel , double loop , what wrong?

2015-10-11 Thread paul analyst
Like here , what wrong ? k=100 mapa=zeros(k,k) julia> @parallel for i=1:k,j=1:k mapa[i,j]=sqrt(sum([D[i,:]-D[j,:]].^2)) end ERROR: syntax: invalid assignment location Paul

Re: [julia-users] Re: Loading files and scoping of variables in parallel code

2015-10-11 Thread Sara Freeman
I get the same error that Christopher is getting when I run include method in .4. However, it does work in .3 without conflicts. The include method seems to work with my code but I do not call any packages. So I am wondering if there is an error in one or several of the packages or if the

[julia-users] Does annotating values with abstract data type help?

2015-10-11 Thread cheng wang
In `performance tips`, there is an example: function foo(a::Array{Any,1}) x = a[1]::Int32 b = x+1 ... end It say the annotation ::Int32 helps in this case. So I was wondering if it still helps in the following case with abstract type annotation?? function foo(a::Array{Any,1}) x =

[julia-users] Re: Julia vs Dylan

2015-10-11 Thread kesarimd
> People looking at dylan today (may be because it is mentioned whenever multiple dispatch is discussed) may be inclined to evaluate it for numerical programming applications and compare it with other languages in the same domain. While it is possible for dylan to to used in this

Re: [julia-users] Why does these "tanh" diff so much in performance?

2015-10-11 Thread cheng wang
Thanks very much! On Sunday, October 11, 2015 at 1:21:28 PM UTC+2, Tim Holy wrote: > > On Sunday, October 11, 2015 04:12:51 AM cheng wang wrote: > > Hello everyone, > > > > I want to do an in-place tanh: y = tanh(x) assuming that y and x are > > preallocated (both are Array{Float64,

[julia-users] Julia ESS mode in Emacs

2015-10-11 Thread Alex
Hello, I have installed ESS and put the following into the initialization file: (add-to-list 'load-path "../ESS/lisp/") (load "../ESS/lisp/ess-site") (require 'ess-site) (setq inferior-julia-program-name ".../Julia-0.4.0/bin/julia.exe") After that I check if ESS is installed

[julia-users] Count value in DataFrames

2015-10-11 Thread Rosangela Oliveira
Hi, I would like count same column, i'm using DataFrames. I'm trying aggregate(df, :x2, sum, but i need to count (x1) the file has another column (x1) which i need to group by. There's some option in julia to count number? Thanks!

[julia-users] Re: Does annotating values with abstract data type help?

2015-10-11 Thread Kristoffer Carlsson
Int is a concrete type. On x64 it is Int64 and on x86 it is Int32. On Sunday, October 11, 2015 at 5:41:11 PM UTC+2, cheng wang wrote: > > In `performance tips`, there is an example: > function foo(a::Array{Any,1}) > x = a[1]::Int32 > b = x+1 > ... > end > It say the annotation ::Int32

[julia-users] Modules and namespaces

2015-10-11 Thread Andrew Keller
I'm using Julia 0.4.0 on Mac OS X 10.10.5. I'd like to put some code into a module, but I'm having some trouble with namespaces. The following fails (`UndefVarError: test.a not defined`) when enclosed inside `module test`. When outside the module, e.g. pasted into the REPL, the code works fine.

Re: [julia-users] Set of tuples?

2015-10-11 Thread Rick Danielson
Also helpful is https://groups.google.com/forum/#!topic/julia-users/0cvVuOmcFpw and a clean initialization appears to be: latlon = Set(Array(Tuple{Float64,Float64},0)) push!(latlon, (68.0, 14.5)) ; in((59.0, 10.5), latlon) -> false push!(latlon, (59.0, 10.5)) ; in((59.0, 10.5), latlon) -> true

Re: [julia-users] Re: Adjacent list

2015-10-11 Thread Stefan Karpinski
https://www.youtube.com/watch?v=l91ISfcuzDw https://www.youtube.com/watch?v=P4NjZj32wnA On Sun, Oct 11, 2015 at 11:14 AM, Christoph Ortner < christophortn...@gmail.com> wrote: > By lookup I meant searching for a specific entry. > > Btw, I am fully aware these theoretical algorithmic aspects, and

Re: [julia-users] Get an array or just a string of all installed Julia packages

2015-10-11 Thread lewis
Great. Thanks. When you say (new installation) Pkg.update() what is (new installation) on the command line? Does it mean cd over there first? On Sunday, October 11, 2015 at 3:08:12 AM UTC-7, Tim Holy wrote: > > Try this: > (new installation) Pkg.init() > cp

[julia-users] Re: Julia vs Dylan

2015-10-11 Thread Páll Haraldsson
On Sunday, October 11, 2015 at 4:00:40 PM UTC, kesa...@gmail.com wrote: > People looking at dylan today (may be because it is mentioned whenever > multiple dispatch is discussed) may be inclined to evaluate it for > numerical programming applications and compare it with other languages in >

[julia-users] Re: Merge two dict with common keys being summed

2015-10-11 Thread Dan
Since this is a common procedure when counting items in sequences, there is a specialized function (`merge`) and data structure (`Accumulator`) for it in the package `DataStructures`. Try a version of the following: using DataStructures a = Dict(2 => 5, 3 => 7, 5 => 1) b = Dict(2

Re: [julia-users] How to define function f(x::(Int...)) in Julia 0.4?

2015-10-11 Thread Jacob Quinn
I believe the current way to do this is: julia> t(x::Tuple{Vararg{Int}}) = sum(x) t (generic function with 1 method) julia> t((1,1)) 2 julia> t((1,1,1)) 3 julia> t((1,1,1,1)) 4 Though I recall there being an open issue or two on syntax to make this nicer. (something like `t(x::{Int...})` )

[julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Kristoffer Carlsson
Maybe you can give a link to the updated code?

[julia-users] Re: Does annotating values with abstract data type help?

2015-10-11 Thread cheng wang
Sorry. I wanted to say AbstractInt not Int. Then will this abstract annotation help? On Sunday, October 11, 2015 at 6:07:35 PM UTC+2, Kristoffer Carlsson wrote: > > Int is a concrete type. On x64 it is Int64 and on x86 it is Int32. > > On Sunday, October 11, 2015 at 5:41:11 PM UTC+2, cheng wang

[julia-users] [ANN] Mocha.jl v0.1.0 - deep learning library for Julia

2015-10-11 Thread Chiyuan Zhang
https://github.com/pluskid/Mocha.jl - Infrastructure - Backward compatibility with Julia v0.3, and Julia v0.4 compatability - Solver refactoring (@benmoran, @CarloLucibello) - Adam Solver (@benmoran) - Improved compatibility on Windows (@droidicus) - Network -

Re: [julia-users] Re: Does annotating values with abstract data type help?

2015-10-11 Thread Mauro
> Sorry. I wanted to say AbstractInt not Int. `Integer` is the abstract datatype. Anyway the answer is: no, it does not help. To make fast code Julia must know the memory layout of a type, which can only be known for a concrete type. > Then will this abstract annotation help? > > On Sunday,

[julia-users] How to define function f(x::(Int...)) in Julia 0.4?

2015-10-11 Thread Jerry Xiong
For example, in Julia 0.3, I can use below function definition: julia> f(::(Int...))="This is an Int tuple." julia> f((1,2)) "This is an Int tuple." julia> f((1,2,3)) "This is an Int tuple." How to define a function with unlimited tuple length in Julia 0.4?

Re: [julia-users] Re: Does annotating values with abstract data type help?

2015-10-11 Thread cheng wang
Thanks! On Sunday, October 11, 2015 at 7:45:35 PM UTC+2, Mauro wrote: > > > Sorry. I wanted to say AbstractInt not Int. > > `Integer` is the abstract datatype. Anyway the answer is: no, it does > not help. To make fast code Julia must know the memory layout of a > type, which can only be

Re: [julia-users] Re: Loading files and scoping of variables in parallel code

2015-10-11 Thread Tim Holy
Two main problems: 1. module KDFs doesn't know anything about variables stored in Main. (This has nothing to do with parallel code, this is just a basic scoping issue.) It should be function KDFeval(KDFinputs, data) ... L = pdf(f, data) ... end and then call it from MainScript as

[julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Alain Clo
See attached the updated code ( slight modifications, code embedded into a function acoustic(), and some loops interchanged). To see some images, uncomment at the end of the code. Enjoy ! Alain Le dimanche 11 octobre 2015 21:30:43 UTC+3, Kristoffer Carlsson a écrit : > > Maybe you can give a link

Re: [julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Alain Clo
Yes, I will take a look at shared arrays. The halo ( overlap of arrays resulting from the poisson's part of the wave equation) might be easier to program with a shared array. I will make an MPI version from the fortran as well. Is there an MPI for Julia available somewhere ? Thanks for your

Re: [julia-users] Modules and namespaces

2015-10-11 Thread Andrew Keller
Thank you for the helpful advice. In this particular case, I can indeed just do what you suggest and call @eval at the top level in my module in a for loop. It would be useful to know explicitly why it is considered poor form to define types inside a function; I don't think it is clear from the

Re: [julia-users] Inner constructor in a type with type parameters

2015-10-11 Thread Andrei Zh
I didn't know about such capability, thanks. But I still can't figure out how to call this constructor. E.g.: julia> Bar{Int}() ERROR: MethodError: `convert` has no method matching convert(::Type{Bar{ Int64}}) This may have arisen from a call to the constructor Bar{Int64}(...), since type

[julia-users] Programming Big Data with Julia

2015-10-11 Thread Deb Midya
Hi Julia Users, Thanks in advance. I am using Julia on Windows 10 64 bit. May I request you to assist me for the following please. I like to build up predictive models (e.g., GLM, Logistic Regression, Regression with Regularization, Bayesian, K-Nearest Neighbor, SVM, ANN, Tree or Ensemble

Re: [julia-users] Inner constructor in a type with type parameters

2015-10-11 Thread Yichao Yu
On Sun, Oct 11, 2015 at 6:54 PM, Andrei Zh wrote: > I didn't know about such capability, thanks. But I still can't figure out > how to call this constructor. E.g.: > > julia> Bar{Int}() > ERROR: MethodError: `convert` has no method matching >

[julia-users] Re: unknown option root

2015-10-11 Thread 'Stéphane Laurent' via julia-users
I get the beginning of the message ; > *Error unknown option: --rootin: process_options at ./client.jl:255* There is also a message about start.jl, but I didn't get the time to write it.

[julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Alain Clo
Pretty good improvements Thanks to you Kristoffer. I am puzzled why the changes on the truncations for sxloc and szloc brings a factor of 3 to the whole program, to the loop underneath. Maybe the truncation changed the indexing type to the whole array, right ? How did you figure out this affect

Re: [julia-users] Re: Loading files and scoping of variables in parallel code

2015-10-11 Thread Christopher Fisher
My appologies if the formatting was not readable. Essentially, I replaced the for loop in MainScript.jl with: MyData = rand(Normal(0,1),50) output = map(x->KDFeval(x,MyData),KDFargs) and the output was: 100-element DistributedArrays.DArray{Any,1,RemoteException}: #undef #undef #undef...

[julia-users] Inner constructor in a type with type parameters

2015-10-11 Thread Andrei Zh
Let's consider 2 types with inner constructors: type Foo x::Array{Int,1} Foo() = Foo(zeros(Int, 10)) end type Bar{T} x::Array{T,1} Bar() = Bar(zeros(T, 10)) end The only difference between them is that `Bar` has type parameter while `Foo` doesn't. I'd expect their inner

Re: [julia-users] Modules and namespaces

2015-10-11 Thread Isaiah Norton
You are calling `symbol` on an object, which results in a fully-qualified name when called inside a module: julia> module Foo abstract a f() = symbol(a) end julia> Foo.f() symbol("Foo.a") (or try adding `@show superSymb` inside your function) Creating a symbol from a

[julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Kristoffer Carlsson
The reason for the improvements when you fixed the truncations is that indexing with a float is deprecated and calling deprecated methods is very slow. For good performance it is therefore important not to repeatedly call any deprecated method. @inbounds is good if you have a very tight loop

Re: [julia-users] Modules and namespaces

2015-10-11 Thread Isaiah Norton
(see also: https://groups.google.com/forum/#!msg/julia-users/pDP37YGR-zc/IL4AJKc3AQAJ) On Sun, Oct 11, 2015 at 6:04 PM, Isaiah Norton wrote: > You are calling `symbol` on an object, which results in a fully-qualified > name when called inside a module: > > julia> module

[julia-users] Re: Does annotating values with abstract data type help?

2015-10-11 Thread Scott Jones
The abstract type would be Integer, not AbstractInt

Re: [julia-users] Re: Julia vs Dylan

2015-10-11 Thread Stefan Karpinski
Folks, this is a long-quiescent thread, let's not revive it. These kinds of "which language is better" discussions are not terribly healthy or constructive. On Sun, Oct 11, 2015 at 10:09 PM, Páll Haraldsson wrote: > On Sunday, October 11, 2015 at 4:00:40 PM UTC,

Re: [julia-users] Re: Julia vs Dylan

2015-10-11 Thread Stefan Karpinski
+1 – check out Dylan, it's a cool language that shares a lot with Julia. On Mon, Oct 12, 2015 at 6:52 AM, Bruce Mitchener wrote: > Stefan, > > Thanks! I was trying to find a constructive way to respond to what was > said here. If anyone is curious about Dylan, we

Re: [julia-users] Re: Julia vs Dylan

2015-10-11 Thread Bruce Mitchener
Stefan, Thanks! I was trying to find a constructive way to respond to what was said here. If anyone is curious about Dylan, we aren't close to dead, much less dead, and we are happy to talk in the proper venues. We are a quiet community busy doing good things. - Bruce Sent from my iPhone >

Re: [julia-users] Programming Big Data with Julia

2015-10-11 Thread Isaiah Norton
Please see http://pkg.julialang.org/ for a list of available packages. The rest of this question is really too broad to be answered here. On Sun, Oct 11, 2015 at 7:14 PM, Deb Midya wrote: > Hi Julia Users, > > Thanks in advance. > > I am using Julia on Windows 10 64 bit. > >

Re: [julia-users] Re: Julia vs Dylan

2015-10-11 Thread Eric Forgy
Hi Bruce, Dylan sounds interesting. One good thing about resurrecting this old discussion is making me aware of Dylan :) Similar to you, I was also looking for constructive words. For the most part, and it has been in some discussions again recently, we adopt the Julia Community Standards

Re: [julia-users] Re: unknown option root

2015-10-11 Thread Isaiah Norton
> > I am not using Julia in the session. Check `ps` for a zombie process? On Sun, Oct 11, 2015 at 3:40 PM, 'Stéphane Laurent' via julia-users < julia-users@googlegroups.com> wrote: > I get the beginning of the message ; > > >> *Error unknown option: --rootin: process_options at

Re: [julia-users] Modules and namespaces

2015-10-11 Thread Isaiah Norton
The Julia compiler is not really designed for this level of dynamicity. It is generally recommended to avoid eval if there is some simpler way to structure your program. In this case (function parameters) you might be able to create types to hold your parameters, and pass those around. Reading

[julia-users] Re: ANN: AMD.jl

2015-10-11 Thread Tony Kelman
Suitesparse is likely to be moved out of base and into a package for licensing reasons. It's unclear right now when that work will happen, it will be a little complicated to make bindeps handle such a messy library robustly. Would make sense in JuliaSparse.

[julia-users] Re: Merge two dict with common keys being summed

2015-10-11 Thread Grey Marsh
Thanks, it works great for the problem I had. On Sunday, October 11, 2015 at 10:31:31 PM UTC+5:30, Dan wrote: > > Since this is a common procedure when counting items in sequences, there > is a specialized function (`merge`) and data structure (`Accumulator`) > for it in the package

[julia-users] Re: FDTD 2D acoustic

2015-10-11 Thread Steven G. Johnson
On Sunday, October 11, 2015 at 4:48:55 PM UTC-4, Kristoffer Carlsson wrote: > > Some unsolicited comments on the code. > > You probably want to change line 118 and 119 to > > sxloc = trunc(Int, mxnx / 2) > szloc = trunc(Int, mxnz / 2) > > so that they really are ints, Without the "Int" it

Re: [julia-users] Programming Big Data with Julia

2015-10-11 Thread Tom Breloff
This is a great resource as well: https://github.com/svaksha/Julia.jl On Sun, Oct 11, 2015 at 9:28 PM, Isaiah Norton wrote: > Please see http://pkg.julialang.org/ for a list of available packages. > The rest of this question is really too broad to be answered here. > >