Re: [julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Jeff Waller
I feel that x^2 must among the things that are convenient and fast; it's one of those language elements that people simply depend on. If it's inconvenient, then people are going to experience that over and over. If it's not fast enough people are going experience slowness over and over. Lik

Re: [julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Jameson Nash
there already is a special inference pass for this: https://github.com/JuliaLang/julia/blob/3b2269d835e420d16ebf6758292213bcd896df8f/base/inference.jl#L2633 but it doesn't look like it is applicable to arrays perhaps it should be? or perhaps, for small isint() value's, we could try using Base.po

Re: [julia-users] How come &(x, y) isn't legal syntax?

2014-09-08 Thread Jake Bolewski
Anyt unary operator defined as a `syntatic_unary_operator` https://github.com/jakebolewski/JuliaParser.jl/blob/master/src/lexer.jl#L103 is special cased by the parser and works similarly. On Monday, September 8, 2014 4:31:48 PM UTC-4, Stefan Karpinski wrote: > > I believe it is because of the u

Re: [julia-users] Is it possible to manually set current module?

2014-09-08 Thread Andrei
Wow, interesting reading, thanks. So problem is not in "getting into" the module, but instead in dynamic recompilation of dependencies inside that module. Probably I should postpone my idea for future releases with that issues resolved. On Mon, Sep 8, 2014 at 1:23 AM, Isaiah Norton wrote: > Yes.

Re: [julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Stefan Karpinski
On Mon, Sep 8, 2014 at 5:10 PM, Patrick O'Leary wrote: > Can we please stop making stuff better already. Seriously, it's just > getting annoying. LoL. I did mention backporting this improvement to the 0.3 branch. I think that backporting as many things as we can to release-0.3 this time around

Re: [julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Simon Kornblith
I don't think there's anything wrong with specializing small powers. We already specialize small powers in openlibm's pow and even in inference.jl. If you want to compute x^2 at maximum speed, something, somewhere needs that when the power is 2 it should just call mulsd instead of doing whateve

[julia-users] Re: cld not defined in Julia 0.3.0

2014-09-08 Thread curiouslearn
Thank you, Simon. I did not know how to look at the docs for that release. On Monday, September 8, 2014 5:05:48 PM UTC-4, Simon Kornblith wrote: > > This was just added to Julia 0.4 yesterday, which is why it's not defined > in Julia 0.3 :). In general if you're using Julia 0.3 you should be loo

[julia-users] Re: cld not defined in Julia 0.3.0

2014-09-08 Thread Simon Kornblith
This was just added to Julia 0.4 yesterday, which is why it's not defined in Julia 0.3 :). In general if you're using Julia 0.3 you should be looking at the release-0.3 docs and not latest (click at the lower right on julia.readthedocs.org to change). Simon On Monday, September 8, 2014 4:59:28

[julia-users] cld not defined in Julia 0.3.0

2014-09-08 Thread curiouslearn
Is it a bug that when I call *cld* in Julia 0.3.0 on Mac OSX it says: ERROR: cld not defined Thanks.

Re: [julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread curiouslearn
That would be awesome. Please do so. On Monday, September 8, 2014 11:16:23 AM UTC-4, Tim Holy wrote: > > Actually, I believe there are serious intentions of backporting this > particular improvement to the release-0.3 branch. For precisely the > reasons > you give. > > --Tim > > On Monday, Se

Re: [julia-users] How come &(x, y) isn't legal syntax?

2014-09-08 Thread Stefan Karpinski
I believe it is because of the use of & in ccall as a pseudo-operator to pass the address of a scalar. Jeff will have to confirm or deny this though. On Mon, Sep 8, 2014 at 10:25 PM, Dan Luu wrote: > julia> 1 | 2 > 3 > julia> 1 & 2 > 0 > julia> 1 + 2 > 3 > julia> 1 $ 2 > 3 > julia> |(1, 2) > 3

Re: [julia-users] Failed attempt to publish a package

2014-09-08 Thread Isaiah Norton
> But I don't understand what to do or what this exactly means. I thought we had a guide for this somewhere, but I can't find it right now. So here is a quick shot at outlining the steps. Right now the git commit representing that "Tag 0.0.1" message in your output log only lives on your own com

Re: [julia-users] Failed attempt to publish a package

2014-09-08 Thread Keno Fischer
Pkg.publish definitely automatically forks and sets up a pull request. I suspect there is a different permissions problem going on. Perhaps you didn't register your public key with github? On Mon, Sep 8, 2014 at 4:27 PM, Ivar Nesje wrote: > You seem to have done things right. The problem is that

[julia-users] Failed attempt to publish a package

2014-09-08 Thread Ivar Nesje
You seem to have done things right. The problem is that you have not (yet) gotten push access to METADATA.jl, and currently nobody has written the code that lets Pkg.publish() automatically fork it on github.com and create a pull request. This means that you manually have to fork METADATA.jl and

[julia-users] How come &(x, y) isn't legal syntax?

2014-09-08 Thread Dan Luu
julia> 1 | 2 3 julia> 1 & 2 0 julia> 1 + 2 3 julia> 1 $ 2 3 julia> |(1, 2) 3 julia> &(1, 2) ERROR: unsupported or misplaced expression & julia> +(1, 2) 3 julia> $(1, 2) ERROR: unsupported or misplaced expression $ Is & used in some way julia that makes &(1, 2) potentially ambiguous? Apologies if

Re: [julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Stefan Karpinski
On Mon, Sep 8, 2014 at 7:48 PM, Tony Kelman wrote: > > Expectations based on the way Octave/Matlab work are really not applicable > to a system that works completely differently. > That said, we do want to make this faster – but we don't want to cheat to do it, and special casing small powers is

[julia-users] Definition of function with keywoed arguments via macro

2014-09-08 Thread jonas . hagen3
Hello! I'm trying to define a function using a macro. But I just dont get it. Look at the following Examples: Using default arguments, everything works as expected: macro myDef2(name) return esc(:( $name(x, y=3) = x*y )) end @myDef2 f2 f2(4) # gives 12, as expected f2(4, 5) #gives 20, as exp

[julia-users] Failed attempt to publish a package

2014-09-08 Thread Ed Scheinerman
I tried following the instructions here: http://docs.julialang.org/en/release-0.3/manual/packages/#publishing-your-package to publish my "Permutations" module (available here: https://github.com/scheinerman/Permutations.jl ) Here's the output I got: julia> Pkg.publish() INFO: Validating METAD

[julia-users] Module starts additional processes: need them to see module too

2014-09-08 Thread David Smith
What would be the best way to enclose a function inside of a module that fires up additional worker processes, where each worker process also sees the module? Normally, if starting julia with `julia -p N`, I'd use an `@everywhere using MyModule`, but this doesn't work here because the other pro

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Ethan Anderes
> Not quite. These problems with singleton dimensions appearing in > unexpected places often occur when working with high-dimensional arrays. > I'm unfortunately short on real-world examples I can readily share, but > I've definitely run into this before: a well-intentioned squeeze() ends up

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Patrick O'Leary
On Monday, September 8, 2014 1:28:46 PM UTC-5, Ethan Anderes wrote: > > Ok, if I’m reading that comment right, the problem is > > > julia> squeeze(rand(1)) > 0-dimensional Array{Float64,0}: > 0.721012 > > but isn’t that just a bug with my implementation? Or is type stability the > issue. For exam

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Ethan Anderes
Ok, if I’m reading that comment right, the problem is julia> squeeze(rand(1)) 0-dimensional Array{Float64,0}: 0.721012 but isn’t that just a bug with my implementation? Or is type stability the issue. For example, squeeze([5]) == 5 but squeeze([5 5]) == [5,5] doesn’t seem type stable. On M

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Patrick O'Leary
On Monday, September 8, 2014 1:13:09 PM UTC-5, Ethan Anderes wrote: > > I’m a bit surprised we don’t have a method for squeeze that works like > > function Base.squeeze(A) > sqzindx = find(collect(size(A)) .== 1) > if isempty(sqzindx) > return A > else > return squeeze(A, tuple(sqzi

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Ethan Anderes
I’m a bit surprised we don’t have a method for squeeze that works like function Base.squeeze(A) sqzindx = find(collect(size(A)) .== 1) if isempty(sqzindx) return A else return squeeze(A, tuple(sqzindx...)) end end which simply squeezes out all singleton dimensions. -Ethan On

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Jude
Thanks! On Monday, September 8, 2014 6:52:22 PM UTC+1, Ethan Anderes wrote: > > I think this is what you want: > > squeeze(A[1,:,:,:],1) > > > On Monday, September 8, 2014 10:39:47 AM UTC-7, Jude wrote: > > Hi, >> >> I was just wondering how to pull out only part of a matrix, for example, >> if I

[julia-users] Re: help with simple matrix conversion

2014-09-08 Thread Ethan Anderes
I think this is what you want: squeeze(A[1,:,:,:],1) On Monday, September 8, 2014 10:39:47 AM UTC-7, Jude wrote: Hi, > > I was just wondering how to pull out only part of a matrix, for example, > if I have a matrix of dimension (2,5,3,8) and I want to get the > corresponding matrix for when

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Tony Kelman
[whoops, mis-pasted this] > so the question is what to do about it? Identify actionable improvements. Maybe adding a branch somewhere and specializing on the most common powers is an acceptable solution. Best answer is fix LLVM bugs, some of this may go away when we switch to LLVM 3.5 which wa

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Tony Kelman
> http://www.spaceflightnow.com/news/n1408/27slscommitment/#.VA3nNPmwIpA Identify actionable improvements. Maybe adding a branch somewhere and specializing on the most common powers is an acceptable solution. Best answer is fix LLVM bugs, some of this may go away when we switch to LLVM 3.5 whic

[julia-users] help with simple matrix conversion

2014-09-08 Thread Jude
Hi, I was just wondering how to pull out only part of a matrix, for example, if I have a matrix of dimension (2,5,3,8) and I want to get the corresponding matrix for when the first dimension is set at 1, for example, A = ones(2,5,3,8) and I want A[1,:,:,:] ? So ultimately I end up with a 3 dim

Re: [julia-users] Image acquisition

2014-09-08 Thread Kevin Squire
Thanks for the plug, Tim. Miguel, what platform are you on? On Linux, it seems to work well, and reports suggest that it works on Macs as well. On Windows, acquisition works, but there seems to be some stability issues. I also have a pull request that I'm about to merge for better camera device

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Simon Kornblith
Actually, if you want this to be fast I don't think you can avoid the if y == 2 branch, although ideally it should be outside the loop and not inside it. LLVM will optimize x^2, but if it doesn't know what the y in x^y is at compile time, it will just call libm. It's not going to emit a branch t

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Jeff Waller
On Monday, September 8, 2014 12:37:16 PM UTC-4, Tony Kelman wrote: > > Calm down. It's very easy to match Octave here, by writing the standard > library in C. Julia chose not to go that route. Of course everyone would > like the concise vectorized syntax to be as fast as the for-loop syntax. If

[julia-users] Re: Two issues with Juno, the Julia plugin for LightTable

2014-09-08 Thread Erlend Magnus Viggen
Hi Mike, That sounds good! Will the Juno plugin be auto-updated when there is a new version available? Until then, I'll happily continue using Juno/LightTable as an enhanced editor and run and post-process my simulations in the REPL. On Monday, September 8, 2014 5:04:31 PM UTC+2, Mike Innes wro

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Douglas Bates
On Monday, September 8, 2014 11:18:02 AM UTC-5, Jeff Waller wrote: > > > > On Monday, September 8, 2014 7:37:52 AM UTC-4, Mohammed El-Beltagy wrote: >> >> Octave seems to be doing a pretty good job for this type of calculation. >> If you want to squeeze a bit more performance out of Julia, you can

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Tony Kelman
Calm down. It's very easy to match Octave here, by writing the standard library in C. Julia chose not to go that route. Of course everyone would like the concise vectorized syntax to be as fast as the for-loop syntax. If it were easy to do that *without* writing the standard library in C, it wo

Re: [julia-users] Image acquisition

2014-09-08 Thread Tim Holy
Kevin Squire's amazing VideoIO: https://github.com/kmsquire/VideoIO.jl --Tim On Monday, September 08, 2014 09:06:45 AM Miguel Belbut Gaspar wrote: > Hi, > > Has anyone found a way to do image acquisition (from a webcam or some kind > of digital camera) directly in Julia? Or should we communicat

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Jeff Waller
On Monday, September 8, 2014 7:37:52 AM UTC-4, Mohammed El-Beltagy wrote: > > Octave seems to be doing a pretty good job for this type of calculation. > If you want to squeeze a bit more performance out of Julia, you can try to > use explicit loops (devectorize as in > http://julialang.org/blo

Re: [julia-users] Interact + PyPlot: only update when releasing slider

2014-09-08 Thread Shashi Gowda
John's suggestion is also a good way to do this. You can sample the signals at a specific interval instead of on button clicks: # At 2 fps, with repeats dropped. sampled_coeffs = droprepeats(sampleon(fps(2), lift(tuple, α, β, γ))) On Mon, Sep 8, 2014 at 9:36 PM, Shashi Gowda wrote: > Unfortunat

[julia-users] Image acquisition

2014-09-08 Thread Miguel Belbut Gaspar
Hi, Has anyone found a way to do image acquisition (from a webcam or some kind of digital camera) directly in Julia? Or should we communicate directly with some library/dll to achieve that? Miguel

Re: [julia-users] Interact + PyPlot: only update when releasing slider

2014-09-08 Thread Shashi Gowda
Unfortunately, the @manipulate macro can only rerun the expression at every update of any of its input. What you need here is Reactive 's `sampleon` function: using Reactive, Interact f = figure(); α=slider(1:0.1:3) β=slider(1:0.1:3) γ=

Re: [julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Tim Holy
Actually, I believe there are serious intentions of backporting this particular improvement to the release-0.3 branch. For precisely the reasons you give. --Tim On Monday, September 08, 2014 08:10:21 AM Patrick O'Leary wrote: > On Monday, September 8, 2014 10:05:31 AM UTC-5, Tim Holy wrote: > >

Re: [julia-users] Interact + PyPlot: only update when releasing slider

2014-09-08 Thread Andrei Berceanu
Another option would be to use drop-down boxes with selectable values or custom text boxes instead of sliders, at least as a temporary fix. Anyone knows how I can do that? By the way, iirc, IPython does have the update-on-release mechanism implemented in their interactive widget functionality.

Re: [julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Patrick O'Leary
On Monday, September 8, 2014 10:05:31 AM UTC-5, Tim Holy wrote: > > And Jeff got another 2x speed increase on 0.4 since then. > --Tim > Here I am, trying to get along with a "stable" version for a while, and maybe actually start using it for things without being tempted to use the nightlies, a

Re: [julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Tim Holy
And Jeff got another 2x speed increase on 0.4 since then. --Tim On Monday, September 08, 2014 07:54:52 AM Patrick O'Leary wrote: > On Monday, September 8, 2014 9:32:34 AM UTC-5, Adam Smith wrote: > > I thought I remembered reading somewhere that they were targeting v0.4 to > > support bytecode cac

[julia-users] Re: Two issues with Juno, the Julia plugin for LightTable

2014-09-08 Thread Mike Innes
Hey Erlend, Thanks a lot for the detailed report. Honestly, PyPlot and terminal integration aren't things I've tested much recently, so there's a good chance I broke them at some point (sorry about that). Although the PyPlot error is weird because it looks like an internal problem. On the plus

[julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Patrick O'Leary
On Monday, September 8, 2014 9:32:34 AM UTC-5, Adam Smith wrote: > > I thought I remembered reading somewhere that they were targeting v0.4 to > support bytecode caching of imported packages (which would fix this issue), > but I can't seem to find evidence of that with a quick search. Did I > im

[julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Ivar Nesje
Stefan milestoned #7977 as 0.4-projects , but it was soon closed as a dup. I don't really think the milestones matters on issues like this. The important part is whether someo

[julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread Adam Smith
I thought I remembered reading somewhere that they were targeting v0.4 to support bytecode caching of imported packages (which would fix this issue), but I can't seem to find evidence of that with a quick search. Did I imagine it? On Monday, September 8, 2014 10:25:14 AM UTC-4, curiou...@gmail.

[julia-users] Re: Slow startup time on Mac OSX with Julia 0.3 .dmg package

2014-09-08 Thread curiouslearn
Jake, thank you for the answer. Yeah, it is unfortunate. Since the Julia development team is so awesome, I hope they fix it soon. For now, I will have to be more careful with not making errors before I try and run it. On Sunday, September 7, 2014 11:35:31 PM UTC-4, Jake Bolewski wrote: > > U

Re: [julia-users] Interact + PyPlot: only update when releasing slider

2014-09-08 Thread John Myles White
I suspect the only way to do this is to change Interact so that it exposes a minimum time threshold before it registers a state change. — John On Sep 8, 2014, at 4:16 AM, Andrei Berceanu wrote: > I have some code along the lines of > > f = figure() > @manipulate for α=1:0.1:3, β=1:0.1:3, γ=1

[julia-users] Re: Suprises with for loops

2014-09-08 Thread Tony Fong
@snotskie looped me into this discussion in the context of Lint I have updated Lint.jl (v0.1.1) to give warnings over * for-loop when the iterable is just a literal number * nested vcat, i.e.[[1,2],[3,4]]. Other array formats are unaffected since their ASTs are distinct. Tony On Monday, Septemb

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Mohammed El-Beltagy
Octave seems to be doing a pretty good job for this type of calculation. If you want to squeeze a bit more performance out of Julia, you can try to use explicit loops (devectorize as in http://julialang.org/blog/2013/09/fast-numeric/). Then you might also remove bounds checking in a loop for fa

[julia-users] Re: "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Tony Kelman
I recommend you read through this blog post - http://julialang.org/blog/2013/09/fast-numeric/ And maybe http://www.johnmyleswhite.com/notebook/2013/12/22/the-relationship-between-vectorized-and-devectorized-code/ too while you're at it, just replace "R" with "Octave" or "Matlab" and the concl

[julia-users] multi-panel interactive figure with PyPlot

2014-09-08 Thread Andrei Berceanu
I'm trying to create a two-panel interactive figure using Interact.jl and PyPlot.jl. Based on the example notebooks from Interact.jl, I came up with the following: using Reactive, Interact using PyPlot x = linspace(0,2π,1000); f, axes = plt.subplots(1,2, figsize=(4, 4)) @manipulate for α=1:0.1:

[julia-users] Interact + PyPlot: only update when releasing slider

2014-09-08 Thread Andrei Berceanu
I have some code along the lines of f = figure() @manipulate for α=1:0.1:3, β=1:0.1:3, γ=1:0.1:3; withfig(f) do y = fun(α,β,γ) PyPlot.plot(x, y) end end where fun is a *very slow* function to evaluate. Is there any way to tell @manipulate to update the resulting plot only aft

Re: [julia-users] Re: how to use union!(s, iterable)

2014-09-08 Thread Shashi Gowda
What is exactly is s? If you want to create a set, two_d_array = reshape([1:4], 2, 2) s = union!(Set{Int}(), two_d_array) seems to work.

[julia-users] "self" dot product of all columns in a matrix: Julia vs. Octave

2014-09-08 Thread Ján Dolinský
Hello, I am a new Julia user. I am trying to write a function for computing "self" dot product of all columns in a matrix, i.e. calculating a square of each element of a matrix and computing a column-wise sum. I am interested in a proper way of doing it because I often need to process large mat

Re: [julia-users] For Loop over set of vector names

2014-09-08 Thread gael . mcdon
By the way, if your "actions" on these variables are independant and in-place, the array method would have the extra advantage that it can be made parallel at no cost and that it whould let you access the updated values through the array but also through their original names.

Re: [julia-users] For Loop over set of vector names

2014-09-08 Thread gael . mcdon
Hi Alex, As John said, a dict would be far better. If you feel the need to access the bounding names through a template like this, then you'd better build a dict from the start or just before using your trick. If your elements are well known, you could even directly use an array : if you need

Re: [julia-users] Are dataframes indexed?

2014-09-08 Thread Steven Sagaert
Hi John, I didn't know this but I wasn't knocking on Hive (which is just fine). The problem as far as ML is concerned isn't Hive but Hadoop which isn't very suited for it. Sincerely, Steven On Monday, September 8, 2014 1:52:15 AM UTC+2, John Myles White wrote: > > I kind of suspect my team (wh