[julia-users] ANN: NeuralNets.jl

2014-07-23 Thread Alireza Nejati
For about two weeks now, Zac Cranko, Pasquale Minervini, and I (Alireza Nejati a.k.a. anj1) have been working on a new package for neural networks in julia: NeuralNets.jl https://github.com/anj1/NeuralNets.jl. The goal is to create a clean, modular implementation of neural networks that can

[julia-users] Problem loading Images module

2014-07-23 Thread Andrew Gibb
Hi, I get the following error: julia using Images ERROR: syntax: invalid assignment location in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 in include at ./boot.jl:245 in include_from_node1 at ./loading.jl:128 in reload_path at loading.jl:152 in _require at

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread Mauro
It still needs relative imports with one dot: julia module A module B foo()=4 export foo end using .B foo() end Which is a bit odd. Because at the REPL, which is in module Main, this is not needed. This both works: julia module T end

Re: [julia-users] iterator construct seems incorrect?

2014-07-23 Thread Mauro
Hi Steve The more obvious way to implement the loop would be to put the body BEFORE the 'next' statement, and at first I thought that maybe the manual has a typo. But then I checked the file dict.jl, and I found indeed the code: done(t::ObjectIdDict, i) = is(next(t,i),()) So this means

Re: [julia-users] Problem loading Images module

2014-07-23 Thread Tim Holy
I don't have a Mac to test on, so others will hopefully be more useful. But here's an explanation of what you're seeing: - The error is being triggered when the package is first loaded. The reason commenting out those lines didn't fix it is that they only affect whether it's used when you read

Re: [julia-users] Problem loading Images module

2014-07-23 Thread Tim Holy
Also, it's always fine to open an issue; those of us who get ~300 julia-related emails a day can easily miss a post, but an issue has permanence and will eventually get noticed. I opened one for you here: https://github.com/timholy/Images.jl/issues/128 --Tim On Wednesday, July 23, 2014

[julia-users] Re: Problem loading Images module

2014-07-23 Thread ron . s . rock
Yes, that's my fault, I should have run the tests one last time. I fixed it and tagged a new version (0.2.47) a few ours ago, hoping no one would notice. A `Pkg.update()` should fix it for you.

[julia-users] Re: Problem loading Images module

2014-07-23 Thread Andrew Gibb
I see. Yes, that fixed it. But I learned quite a bit about github and julia in the meantime. :) I've noted the fix in the github issue. On Wednesday, 23 July 2014 12:32:29 UTC+1, ron.s...@gmail.com wrote: Yes, that's my fault, I should have run the tests one last time. I fixed it and

Re: [julia-users] Re: associative property of export/include/import?

2014-07-23 Thread Andreas Lobinger
Hello collague, On Tuesday, July 22, 2014 4:25:46 PM UTC+2, Mauro wrote: I agree that there should be some means of resolving conflicts (by warning, by precedence) but just dropping a whole set of methods because they conincidentially have the same name AND at the same time advertising

Re: [julia-users] Re: associative property of export/include/import?

2014-07-23 Thread Tomas Lycken
There is another option, which won’t necessarily work for plot but might resolve many other issues (and is frequently used on functions like push!): make both modules import a common function to extend. What took me a while to understand in this context, is the distinction between a

[julia-users] numpy equivalent functionality

2014-07-23 Thread Andrei Berceanu
Hi guys, I have 2 short numpy-related questions. In numpy, if one can invert an arbitrary array *arr* along a given axis using the syntax *arr[::-1,...]* What is the equivalent idiom in Julia? The other issue is, how can I truncate an array between a lower and upper bound? In numpy,

Re: [julia-users] numpy equivalent functionality

2014-07-23 Thread Jacob Quinn
Check out `clamp` for your second question: http://docs.julialang.org/en/latest/stdlib/base/#Base.clamp On Wed, Jul 23, 2014 at 10:07 AM, Andrei Berceanu andreiberce...@gmail.com wrote: Hi guys, I have 2 short numpy-related questions. In numpy, if one can invert an arbitrary array *arr*

[julia-users] Re: numpy equivalent functionality

2014-07-23 Thread Matt Bauman
On Wednesday, July 23, 2014 10:07:20 AM UTC-4, Andrei Berceanu wrote: In numpy, if one can invert an arbitrary array *arr* along a given axis using the syntax *arr[::-1,...]* And with regards to this, I think you're after `flipdim` —

Re: [julia-users] numpy equivalent functionality

2014-07-23 Thread Tim Holy
A[end:-1:1, ...] On Wednesday, July 23, 2014 07:07:20 AM Andrei Berceanu wrote: Hi guys, I have 2 short numpy-related questions. In numpy, if one can invert an arbitrary array *arr* along a given axis using the syntax *arr[::-1,...]* What is the equivalent idiom in Julia? The

[julia-users] getting started

2014-07-23 Thread ross
Is there anything that is intermediate between the manual and the introductory material that is kind of a taste of? I've looked in the documentation and teaching sections (not sure if the latter is relevant if I don't plan to teach with Julia), but haven't found anything that looked right. I

Re: [julia-users] numpy equivalent functionality

2014-07-23 Thread Andrei Berceanu
Thanks guys, works like a charm! A On Wednesday, July 23, 2014 4:32:56 PM UTC+2, Tim Holy wrote: A[end:-1:1, ...] On Wednesday, July 23, 2014 07:07:20 AM Andrei Berceanu wrote: Hi guys, I have 2 short numpy-related questions. In numpy, if one can invert an arbitrary array

[julia-users] Cannot install packages -- Problem with Git?

2014-07-23 Thread Daniel Carrera
Hello, I am running Julia 0.2.1 and for some reason I can no longer install any packages. Here is an example: julia Pkg.add(Cosmology) ERROR: failed process: Process(`git --git-dir=/home/daniel/.julia/.cache/Stats merge-base 87d1c8d890962dfcfd0b45b82907464787ac7c64

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread Stefan Karpinski
Main is the root module so /T and ./T are the same thing in Main. On Wed, Jul 23, 2014 at 3:36 AM, Mauro mauro...@runbox.com wrote: It still needs relative imports with one dot: julia module A module B foo()=4 export foo end using .B foo()

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread Mauro
On Wed, 2014-07-23 at 16:29, Stefan Karpinski ste...@karpinski.org wrote: Main is the root module so /T and ./T are the same thing in Main. but doesn't the same hold for any other folder? /MyMod/T and /MyMod/./T are the same thing On Wed, Jul 23, 2014 at 3:36 AM, Mauro mauro...@runbox.com

Re: [julia-users] numpy equivalent functionality

2014-07-23 Thread Stefan Karpinski
You can also write that range as `end:-1:1` in Julia (similar to Matlab). On Wed, Jul 23, 2014 at 8:14 AM, Andrei Berceanu andreiberce...@gmail.com wrote: Thanks guys, works like a charm! A On Wednesday, July 23, 2014 4:32:56 PM UTC+2, Tim Holy wrote: A[end:-1:1, ...] On Wednesday,

[julia-users] Embedding Julia; Composite Types

2014-07-23 Thread Jeff Waller
I've read the Embedding Julia docs which seem straightforward, except they seem to lack how to construct and communicate composite types. The type *** jl_value_t*** seems generic. Is this answered by reading the source?

Re: [julia-users] getting started

2014-07-23 Thread Stefan Karpinski
Also this: http://learnxinyminutes.com/docs/julia/. David Sander's tutorial is a nice start as well, although it's quite a long video: https://www.youtube.com/watch?v=vWkgEddb4-A. On Wed, Jul 23, 2014 at 8:15 AM, João Felipe Santos joao@gmail.com wrote: There's this nice programming by

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread Mauro
got it, tnx On Wed, 2014-07-23 at 16:51, Stefan Karpinski ste...@karpinski.org wrote: Not quite. Note the initial /. When you do `using M` or `import M` it is like `cat /M` – it is relative to the root of the module system, not the current level of module. When you do `using .M` it is like

Re: [julia-users] Re: associative property of export/include/import?

2014-07-23 Thread Stefan Karpinski
On Wed, Jul 23, 2014 at 6:06 AM, Andreas Lobinger lobing...@gmail.com wrote: In principle i agree, everything that is defined in the Modules is usable regarding its own namespace. But then, why do we have the export of functions? It's not even needed... If you strictly prefix all functions

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread Stefan Karpinski
For what's it's worth, we originally looked relative first and then absolute, but it was a usability nightmare. This is more explicit and, once you get it, I think much simpler. On Wed, Jul 23, 2014 at 9:06 AM, Mauro mauro...@runbox.com wrote: got it, tnx On Wed, 2014-07-23 at 16:51, Stefan

[julia-users] Re: Help needed, running slow

2014-07-23 Thread Arnaud Amiel
As suggested by a few of you, I put everything in a function and now it runs in 1/4 s, that is nearly 32 x improvement for 'no change' that is one of the aspects I don't like in julia. Anyway, lesson learnt I will now put everything inside functions and will learn how to use the profiler

[julia-users] Re: Help needed, running slow

2014-07-23 Thread Arnaud Amiel
Well spotted, not quite right, when not paying attention I regularly get confused with in and = although in this case it does not really matter. On Tuesday, 22 July 2014 23:45:21 UTC+1, J Luis wrote: Hmmm, is this right? for j in 1:f[i]

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread John Myles White
Why not view this as a learning opportunity to discover that changes you perceive to be minor are, in fact, not minor -- but are instead substantive changes to the semantics of your program? -- John On Jul 23, 2014, at 9:38 AM, Arnaud Amiel aam...@gmail.com wrote: As suggested by a few of

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Arnaud Amiel
I can see that but it was not directly obvious to me. I guess that is why I am playing with Julia. Now onto Euler 26 should not be too hard... On Wednesday, 23 July 2014 17:40:07 UTC+1, John Myles White wrote: Why not view this as a learning opportunity to discover that changes you perceive

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Stefan Karpinski
You don't like getting 32x speed improvements with almost no changes? There are plenty of languages where things are slow in both global and local scope, in which case you won't have that problem. I suspect, however, that is not actually preferable. On Jul 23, 2014, at 9:38 AM, Arnaud Amiel

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Kevin Squire
On Wed, Jul 23, 2014 at 9:38 AM, Arnaud Amiel aam...@gmail.com wrote: As suggested by a few of you, I put everything in a function and now it runs in 1/4 s, that is nearly 32 x improvement for 'no change' that is one of the aspects I don't like in julia. I've used Julia for a couple of years

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Jacob Quinn
There's https://github.com/JuliaLang/julia/issues/524 https://github.com/JuliaLang/julia/issues/964 And Jeff has mentioned it in his compiler list: https://github.com/JuliaLang/julia/issues/3440 -Jacob On Wed, Jul 23, 2014 at 1:18 PM, Kevin Squire kevin.squ...@gmail.com wrote: On Wed, Jul

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Stefan Karpinski
I definitely agree that the current status is suboptimal. Lord only knows I've spent a lot of time thinking about ways to fix the slow global scope issue. Many but by no means all of these thoughts are in the issues Jacob linked to. If we figure out a solution that seems to be the right way to do

Re: [julia-users] Re: how to properly nest modules in a package

2014-07-23 Thread ggggg
It makes sense now, thanks.

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Stefan Karpinski
Latest thoughts on the issue: https://github.com/JuliaLang/julia/issues/524#issuecomment-49914439 On Wed, Jul 23, 2014 at 10:48 AM, Stefan Karpinski ste...@karpinski.org wrote: I definitely agree that the current status is suboptimal. Lord only knows I've spent a lot of time thinking about

Re: [julia-users] Cannot install packages -- Problem with Git?

2014-07-23 Thread Mike Nolta
https://github.com/JuliaLang/julia/issues/7392 -Mike On Wed, Jul 23, 2014 at 11:17 AM, Daniel Carrera dcarr...@gmail.com wrote: Hello, I am running Julia 0.2.1 and for some reason I can no longer install any packages. Here is an example: julia Pkg.add(Cosmology) ERROR: failed process:

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Stefan Karpinski
Admit that you really want to program in OCaml ;-) On Jul 23, 2014, at 11:39 AM, John Myles White johnmyleswh...@gmail.com wrote: I think the difficulty here is that the people who are worst affected by these kinds of performance changes may be people who also might not know that they

Re: [julia-users] @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread Jacob Quinn
Very close! There were actually some changes recently to hashing in general that make it a bit easier to get this working (although undocumented https://github.com/JuliaLang/julia/issues/6833, *cough*, Stefan Karpinski, *cough*). Here are the only changes I made to get `@test_approx_eq` working:

[julia-users] Re: push! function and multidimensional arrays

2014-07-23 Thread Ivar Nesje
You can't use push! on multidimentional arrays. You can push onto a 1d array, and then reshape. Another way is to collect all the row/column vectors and use hcat(c...) or vcat(c...) to create an array. Ivar kl. 21:22:01 UTC+2 onsdag 23. juli 2014 skrev john pollack følgende: Hi. I want to

Re: [julia-users] getting started

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 11:15 -0400, João Felipe Santos wrote: There's this nice programming by example-style tutorial that you can skim to get a grasp of the syntax, features, and standard libraries, as well as some plotting libs: http://bogumilkaminski.pl/files/julia_express.pdf. -- João

Re: [julia-users] getting started

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 09:00 -0700, Stefan Karpinski wrote: Also this: http://learnxinyminutes.com/docs/julia/. That was one of the first things I looked at; I liked it a lot, but then needed something more. Ross David Sander's tutorial is a nice start as well, although it's quite a long video:

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Bradley Alpert
I for one am thrilled to be able to program every day in such a beautiful, flexible, clean language with generally good performance and in which sparkling performance is possible. By comparison, performance instability is a minor matter. There, I have thoroughly discredited myself by banal

Re: [julia-users] Cannot install packages -- Problem with Git?

2014-07-23 Thread Daniel Carrera
Thanks! On 23 July 2014 20:48, Mike Nolta m...@nolta.net wrote: https://github.com/JuliaLang/julia/issues/7392 -Mike On Wed, Jul 23, 2014 at 11:17 AM, Daniel Carrera dcarr...@gmail.com wrote: Hello, I am running Julia 0.2.1 and for some reason I can no longer install any packages.

Re: [julia-users] Re: push! function and multidimensional arrays

2014-07-23 Thread Kevin Squire
Some additional comments: 1. vcat will always create a new array, and copies the contents of the arrays to be concatenated into the new one. 2. Julia stores arrays in column-major order, so vcat(A, [1 2]) does the following - copy column 1 of A to temp array - copy the 1 from

Re: [julia-users] getting started

2014-07-23 Thread Sam L
It seems odd that [1; 2] != [1 2]'; typeof shows the former is 1-dimensional and the latter 2-dimensional (if I'm interpreting correctly), but that seems kind of inconsistent. A similar issue with indexing surprised me recently. If A is a 2-d array, A[:, 1] is a 1-d array but A[1, :]

[julia-users] Re: push! function and multidimensional arrays

2014-07-23 Thread Alireza Nejati
John, just to give some explanation: push! is there as an efficient push operation - one that ideally takes O(1) time because it simply extends the vector in-place rather than copying everything to a new vector. (In practice, though, it takes slightly longer than O(1) time because of the

Re: [julia-users] Re: push! function and multidimensional arrays

2014-07-23 Thread Stefan Karpinski
This explanation should maybe go straight in our FAQ :-) On Jul 23, 2014, at 3:12 PM, Alireza Nejati alireza@gmail.com wrote: John, just to give some explanation: push! is there as an efficient push operation - one that ideally takes O(1) time because it simply extends the vector

[julia-users] Re: iterator construct seems incorrect?

2014-07-23 Thread vavasis
Dear Julia users, Thank you for all your thoughtful replies on this matter. Indeed, you are all correct, and I misunderstood the construct. (The point that confused me was that in the call (i,state)=next(I,state), I mistakenly assumed that the returned state should correspond with returned

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Stefan Karpinski
My inclination is to include type checking and linting in base Julia, automatically invoked by a paranoid mode that also ignores inbounds annotations and such. Then the testing infrastructure should run tests in paranoid mode, linting and type checking the code to be tested. This seems like a

Re: [julia-users] Re: iterator construct seems incorrect?

2014-07-23 Thread Stefan Karpinski
Glad it makes sense. Maybe we could explain that better. On Jul 23, 2014, at 3:20 PM, vava...@uwaterloo.ca wrote: Dear Julia users, Thank you for all your thoughtful replies on this matter. Indeed, you are all correct, and I misunderstood the construct. (The point that confused me

[julia-users] Access to Distributed Arrays

2014-07-23 Thread Sebastian Vollmer
I am trying to access parts of a distributed array that belongs to the current worker res=dzeros((1,length(workers())), workers(), [1,length(workers())]) (for some reason res=dzeros((length(workers())), workers(), [length(workers())]) throws an error ) @spawnat 2 localpart(res)[1]+=rand()

[julia-users] Capture both STDOUT and STDERR from external program?

2014-07-23 Thread Iain Dunning
What is the best way to capture STDOUT and STDERR from an external program? If it can't be done separately, is there an equivalent to the bash-ism ./myprogram 21 log.txt

Re: [julia-users] getting started

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 14:43 -0700, Sam L wrote: It seems odd that [1; 2] != [1 2]'; typeof shows the former is 1-dimensional and the latter 2-dimensional (if I'm interpreting correctly), but that seems kind of inconsistent. A similar

Re: [julia-users] getting started

2014-07-23 Thread Sam L
Oops, not sure where I got that idea, you are correct! I could have sworn I tried that in the REPL... Brain glitch I suppose. On Wednesday, July 23, 2014 4:52:08 PM UTC-7, Ross Boylan wrote: On Wed, 2014-07-23 at 14:43 -0700, Sam L wrote: It seems odd that [1; 2] != [1

[julia-users] Re: @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread daniel . matz
Wonderful! Thank you! The associated problem here is that the error message didn't really help me. I know the developers are busy, but I hope that there's a way to eventually improve the error message for this situation. Thanks again. Daniel On Tuesday, July 22, 2014 9:22:31 PM UTC-5,

Re: [julia-users] Re: @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread Jacob Quinn
I think what would really be helpful here are explicit interfaces. There's an open issue about it: https://github.com/JuliaLang/julia/issues/6975 In a world with interfaces, you would have been told at some point (either inheriting from number or calling certain methods), that your type was

Re: [julia-users] Re: @test_approx_eq results in stack overflow for custom immutable type

2014-07-23 Thread daniel . matz
While I'm not a programming wizard like so many in this community, I do hope that the developers are familiar with the interfaces in Go. I didn't see any mention of Go in that issue, though. I like how in Julia the types and methods are decoupled, in that the methods aren't bound to the type,

[julia-users] Confused on templated constructor idiom

2014-07-23 Thread Sheehan Olver
Hi, I'm trying to do the attached code, which fails due to no method matching. What am I doing wrong? The #dostuff was just asserts so I fixed it by commenting out the interior constructor, but would like to understand better. Cheers, Sheehan type

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread Tony Kelman
Live editor/IDE integration of linting (and type-checking) a la Matlab would be quite nice to have one of these days. Julia seems to self-select for the type of people who actually listen to suggestions and are willing to experiment with refactoring and profiling, but I still fear the piles of

Re: [julia-users] Access to Distributed Arrays

2014-07-23 Thread Amit Murthy
The DArray has been distributed only on the workers. localpart(res) on the master process returns 0x0 Array{Float64,2} and hence the BoundsError() You need to pass the DArray object to dowork. The following will work. @everywhere function dowork(res) localpart(res)[1]+=rand() end @spawnat 2