Re: [julia-users] possible timing regression in A\b

2014-08-22 Thread John Myles White
Perhaps you have a defective BLAS installation for 0.3? — John On Aug 22, 2014, at 11:08 PM, Don MacMillen wrote: > Hmmm, thx for the experiment. To clarify, I assumed that the normal behavior > would have been closer > to the 4.0 time, but I don't have anything earlier. The 0.3 was just up

Re: [julia-users] possible timing regression in A\b

2014-08-22 Thread Don MacMillen
Hmmm, thx for the experiment. To clarify, I assumed that the normal behavior would have been closer to the 4.0 time, but I don't have anything earlier. The 0.3 was just updated using apt-get on Ubuntu 14.04 (VM running on windows). 0.4 was of course cloned and compiled. Just scraped and re-

Re: [julia-users] RFC: Colored output API

2014-08-22 Thread Elliot Saba
This is probably due to you running a script, which causes the base color routines to think that they are not being run interactively and this shut off the color. I tried to fix this a while back, but the codepath taken when running a script is a little convoluted. On Aug 22, 2014 6:33 PM, "Spencer

Re: [julia-users] possible timing regression in A\b

2014-08-22 Thread John Myles White
I don’t see this behavior at all on my system. After discarding an intial compilation step, here’s what I get: 0.3 — elapsed time: 3.013803287 seconds (400120776 bytes allocated, 1.77% gc time) 0.4 — elapsed time: 2.920384195 seconds (400120776 bytes allocated, 1.89% gc time) Also to clarify:

[julia-users] possible timing regression in A\b

2014-08-22 Thread Don MacMillen
Is anyone else seeing the following? If not, what could I have done to my env to trigger it? Thx. julia> VERSION v"0.3.0" julia> @time begin a = rand(5000,5000); b = rand(5000); x =a\b end; elapsed time: 31.413347385 seconds (440084348 bytes allocated, 0.12% gc time) julia> --

Re: [julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Jameson Nash
Upon reflection, I realized that your second one wasn't working because it is badly posed. Your definition implicitly assumes a lot about the structure and fields of any subtype that may not be true, or may have multiple answers. For example, with the following abstract definition: abstract MyAbs

[julia-users] Re: Best way to convert Any of vectors into matrix

2014-08-22 Thread Diego Javier Zea
A = Any[[1,2],[3,4],[5,6]] function to_matrix(A::Vector{Any}) ncol = length(A) nrow = length(A[1]) B = Array( typeof(A[1][1]) , (nrow, ncol) ) for i in 1:ncol for j in 1:nrow B[j,i] = A[i][j] end end

[julia-users] Best way to convert Any of vectors into matrix

2014-08-22 Thread Bradley Setzler
Good evening, I often have Any types filled with vectors (especially as the return of a pmap), and need them as a matrix or DataFrame. For example, suppose I have, julia> A 3-element Array{Any,1}: [1,2] [3,4] [5,6] But I want, julia> B 2x3 Array{Int64,2}: 1 3 5 2 4 6 I came up with the f

[julia-users] Re: suggestion for good algorithms?

2014-08-22 Thread Steven G. Johnson
> push!(combos, nonzeros) > Slight bug: this should be push!(combos, copy(nonzeros))

[julia-users] Re: suggestion for good algorithms?

2014-08-22 Thread Steven G. Johnson
(If this is for a real application and not just an exercise, you probably want to just do something directly with the `nonzeros` array inside the loop rather than pushing copies to a long array, especially if N and K are larger.)

[julia-users] Re: suggestion for good algorithms?

2014-08-22 Thread Steven G. Johnson
On Friday, August 22, 2014 6:23:45 PM UTC-4, K leo wrote: > > I want to find all the possible ways to fill a 1-dimensional array A (of > size say 30) with only -1, 0, or 1 to each element, such that > sum(abs(A)) is less than say 5. Simple loops don't seem to be very > efficient. Any suggestio

Re: [julia-users] suggestion for good algorithms?

2014-08-22 Thread K Leo
Thanks for the response, but sorry, can you clarify what that formula means? On 2014年08月23日 09:24, Tony Fong wrote: Er, there is an almost-close-form solution no? Start with (n(odd))C(n/2+-2.5) Tony

[julia-users] suggestion for good algorithms?

2014-08-22 Thread Tony Fong
Er, there is an almost-close-form solution no? Start with (n(odd))C(n/2+-2.5) Tony

Re: [julia-users] RFC: Colored output API

2014-08-22 Thread John Myles White
Abstractly, I’d love to be able to print using Color.jl. It seems like a much cleaner interface. But it’s not clear to me that Color.jl buys you a lot if your terminal doesn’t support a widerange of colors. — John On Aug 22, 2014, at 3:33 PM, Spencer Russell wrote: > I just filed an issue

[julia-users] Re: Problem with v 0.3.0 on MacOSX 10.9.4

2014-08-22 Thread Tony Kelman
Looks like a problem from the old Stats package which got renamed a while back. Try rm -rf /Users/hs/.julia/.cache/Stats On Friday, August 22, 2014 1:52:16 PM UTC-7, Henry Smith wrote: > > Hi, > > Just d/led it and tried it out. I had a couple of old versions of 0.2.x > (and still have 0.2.1

[julia-users] RFC: Colored output API

2014-08-22 Thread Spencer Russell
I just filed an issue [1] that currently the print_with_color() doesn't seem to use the correct colors on my system. While checking it out, I was thinking that print_with_color might fit in nicely with Color.jl. We could pull print_with_color out of Base and add all the color terminal codes to Co

[julia-users] suggestion for good algorithms?

2014-08-22 Thread K Leo
I want to find all the possible ways to fill a 1-dimensional array A (of size say 30) with only -1, 0, or 1 to each element, such that sum(abs(A)) is less than say 5. Simple loops don't seem to be very efficient. Any suggestions?

[julia-users] Re: ANN: PGF/TikZ packages

2014-08-22 Thread Kaj Wiik
Hi! I've been using Tikz, so this package is very welcome! However, using PGFPlots a=plot(rand(20),rand(20)) save("test.pdf", a) ERROR: `save` has no method matching save(::ASCIIString, ::TikzPicture) Any suggestions? This is in Julia 0.3.0 and Ubuntu 14.04. Cheers, Kaj

[julia-users] Re: Installing Julia on Ubuntu 13.04 through apt-get

2014-08-22 Thread eric l
Thanks it worked! I now have upgraded linux to 14.04. and run Julia version 0.3.0 However for whom that may interest apt-cache show julia-> still reference: Version: 0.2.1+dfsg-2 Thanks again. -Eric On Wednesday, August 20, 2014 12:08:17 PM UTC-7, Patrick O'Leary wrote: > > Raring went

[julia-users] Problem with v 0.3.0 on MacOSX 10.9.4

2014-08-22 Thread Henry Smith
Hi, Just d/led it and tried it out. I had a couple of old versions of 0.2.x (and still have 0.2.1 installed but trashed the others - some rc's). The computer is an iMac with 20 GB of RAM, 2.7 GHz quad i5. When I asked about the Pkg.status(), it came up with an error and similar for PKG.instal

[julia-users] Re: ANN: PGF/TikZ packages

2014-08-22 Thread Hisham Assi
Good news, I like pgflots. Thank You.

[julia-users] Re: reference for the Formula language used in MixedModels

2014-08-22 Thread Douglas Bates
On Thursday, August 21, 2014 4:41:02 PM UTC-5, Thomas Covert wrote: > > Thanks for the thorough explanation. To be clear, though, if "f" is a > PooledDataFactor, "f" is treated as a fixed effect in the Formula language, > whereas "(1|f)" is treated as a random effect? > That's correct, except t

Re: [julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Tim Holy
Got it now, that's a good strategy. Of course, it's the second one I'm more concerned about. --Tim On Friday, August 22, 2014 03:18:19 PM Jameson Nash wrote: > For the first, you are missing the base case for the recursion, so it > defaults to eltype(::Any) instead of eltype(::Type{MyAbstract{T}

Re: [julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Jameson Nash
For the first, you are missing the base case for the recursion, so it defaults to eltype(::Any) instead of eltype(::Type{MyAbstract{T}}) On Friday, August 22, 2014, Tim Holy wrote: > On Friday, August 22, 2014 01:17:53 PM Jameson Nash wrote: > > Instead of eltype as written, use the following f

[julia-users] Re: Semicolon prefix for shell command no longer working in IJulia Notebook

2014-08-22 Thread ronubi
Solved it. Shell mode works in IJulia notebook, but only for a single command in each cell.

Re: [julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Tim Holy
On Friday, August 22, 2014 01:17:53 PM Jameson Nash wrote: > Instead of eltype as written, use the following format: > eltype{T<:...}(::Type{T}) = eltype(super(T)) With this definition: Base.eltype{T<:MyAbstractType}(::Type{T}) = eltype(super(T)) eltype(MyType{Float32}) yields "Any". And for th

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Stefan Karpinski
On Aug 22, 2014, at 1:45 PM, Rafael Fourquet wrote: > > In short, be lazy when it gives opportunity for loop fusion, and saves > allocations. There's a complicated limit to when you want to fuse loops – at some point multiple iterations becomes better than fused loops and it all depends on how

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Rafael Fourquet
> Could you please explain why the iterator version is so much faster? Is > it simply from avoiding temporary array allocation? > That's what I understand, and maybe marginally because there is only one pass over the data.

julia-users@googlegroups.com

2014-08-22 Thread Stefan Karpinski
How & is parsed has nothing to do with whether we use a parser generator or not. The only relevance is that having a formal grammar would make it easier to know that & is special in this respect. But better documentation would serve that purpose better than a formal grammar. > On Aug 21, 2014,

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Rafael Fourquet
> If that was the way things worked, would sum(abs(A)) do the computation > right away or just wait until you ask for the result? In other words, > should sum also be lazy if we're doing all vectorized computations that > way? > sum(abs(A)) returns a scalar, so lazy would buy nothing here (in mos

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Stefan Karpinski
To do any of that justice, you end up with a language that looks basically like Haskell. So why not just use Haskell? > On Aug 22, 2014, at 1:11 PM, gael.mc...@gmail.com wrote: > > I'm not familiar with lazy evaluation (I've not used any language > implementing it). But I was wondering... > >

[julia-users] broadcasting question

2014-08-22 Thread Neal Becker
using Distance euclidean ([1:10;1:10], [1:10]) ERROR: DimensionMismatch("The lengths of a and b must match.") in get_common_len at /home/nbecker/.julia/v0.4/Distance/src/common.jl:11 in sumsqdiff at /home/nbecker/.julia/v0.4/Distance/src/metrics.jl:40 in euclidean at /home/nbecker/.julia/v0.4/

Re: [julia-users] Re: Conditional import within a function

2014-08-22 Thread Spencer Lyon
Ok thank you for working on it. I will just use PyPlot.plot for now and see if anyone can help us understand what is happening here. On Friday, August 22, 2014 1:24:35 PM UTC-4, Steve Kelly wrote: Changing plot() to PyPlot.plot() fixes it for me. > > type Foo > > > x::Int > end > > funct

Re: [julia-users] Re: Conditional import within a function

2014-08-22 Thread Steve Kelly
Changing plot() to PyPlot.plot() fixes it for me. type Foo x::Int end function check_defined_err(x::Symbol) if !isdefined(x) error("Module $x not defined. run `using $x` to fix the problem") end end function check_defined_eval(x::Symbol) if !isdefined(x) eval(Exp

Re: [julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Jameson Nash
Instead of eltype as written, use the following format: eltype{T<:...}(::Type{T}) = eltype(super(T)) This should help with the type inference issue too. I think M.name is already the type, so you don't need to use eval (which doesn't return the right thing anyways, in the general case) Sorry I c

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread gael . mcdon
I'm not familiar with lazy evaluation (I've not used any language implementing it). But I was wondering... Why not have a 'calculate_now' function to let the programmer choose when a result is guaranteed to be calculated? Otherwise, resort to lazy representations. There could be some heuristic

[julia-users] Semicolon prefix for shell command no longer working in IJulia Notebook

2014-08-22 Thread ronubi
I just upgraded to Julia v3.0. Prior to this, I could use a leading semicolon to enter shell (bash) commands. This still works from the REPL. Typing ';' changes the green 'julia> ' prompt to a red 'shell> ' prompt, which is nifty. But in IJulia notebook, it doesn't work. Any solution?

Re: [julia-users] Re: Conditional import within a function

2014-08-22 Thread Spencer Lyon
I’m actually still having issues with both of these options — I’ll try to enumerate what I think the problem is here. - When I do using MyPackage and my code is loaded (including the plotting routines). - Then when I call plot(x<:MyType) (sorry for the shorthand), the function i

[julia-users] Re: Call for participation: High Performance Technical Computing in Dynamic Languages workshop (11/17/2014)

2014-08-22 Thread Miles Lubin
I'm not an organizer of this workshop, but just wanted to remind everyone of this and note that the deadline for submission is now August 25th, so get to writing those papers! On Monday, March 31, 2014 10:14:21 AM UTC-6, Jiahao Chen wrote: > > It is my great pleasure to announce a workshop at th

Re: [julia-users] Conditional import within a function

2014-08-22 Thread Spencer Lyon
Thanks Steve, That is a good solution. I think I will probably end up doing this, or maybe even a combination of what you and Peter said and instead of throwing an error if it isn't defined, I will just define it for them. On Friday, August 22, 2014 12:16:14 PM UTC-4, Steve Kelly wrote: > > Wh

Re: [julia-users] Re: Conditional import within a function

2014-08-22 Thread Steve Kelly
Peter Simon, very cool. When I ran hit this problem I saw it as an opportunity to make my code more Julian. :P Eval FTW. On Fri, Aug 22, 2014 at 12:16 PM, Peter Simon wrote: > From https://groups.google.com/d/topic/julia-users/AWCerAdDLQo/discussion > : > > eval(Expr(:using,:PyPlot)) > > can b

[julia-users] Re: Conditional import within a function

2014-08-22 Thread Spencer Lyon
Thanks, good workaround. On Friday, August 22, 2014 12:16:03 PM UTC-4, Peter Simon wrote: > > From https://groups.google.com/d/topic/julia-users/AWCerAdDLQo/discussion > : > > eval(Expr(:using,:PyPlot)) > > can be used inside a conditional. > > --Peter > > On Friday, August 22, 2014 8:56:53 AM U

Re: [julia-users] Conditional import within a function

2014-08-22 Thread Steve Kelly
What I've been doing is very similar. I leave the plotting package up to the user, but they are first required to do one of: using PyPlot or using Gadfly inside their script. I then have a function similar to yours (named plot(x::MyType), to take advantage of multiple dispatch) that checks for isd

[julia-users] Re: Conditional import within a function

2014-08-22 Thread Peter Simon
>From https://groups.google.com/d/topic/julia-users/AWCerAdDLQo/discussion : eval(Expr(:using,:PyPlot)) can be used inside a conditional. --Peter On Friday, August 22, 2014 8:56:53 AM UTC-7, Spencer Lyon wrote: > > I am working on a library that defines various types as well as a few > “helpe

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Stefan Karpinski
On Fri, Aug 22, 2014 at 11:32 AM, Rafael Fourquet wrote: > My naive answer is then why not make vectorized functions lazy (like iabs > above, plus dimensions information) by default? Do you have links to > relevant discussions? > If that was the way things worked, would sum(abs(A)) do the compu

[julia-users] Conditional import within a function

2014-08-22 Thread Spencer Lyon
I am working on a library that defines various types as well as a few “helper” functions to plot those types with PyPlot. If I do [import|using] PyPlot at the top level of any file in my package, PyPlot is loaded when I do [using|import] MyPackage. This makes the startup time for my package m

[julia-users] Re: [julia-dev] Re: EXTREME CAUTION: Windows uninstaller

2014-08-22 Thread Elliot Saba
Thanks for taking care of that so quickly, Isaiah! -E On Fri, Aug 22, 2014 at 4:12 AM, Isaiah Norton wrote: > The (un)installer system has been updated and the download links have been > restored. > > > On Thu, Aug 21, 2014 at 7:58 PM, Isaiah Norton > wrote: > >> Please be aware that the Windo

Re: [julia-users] Backtrace doesn't show details of modules

2014-08-22 Thread Tim Holy
I'd say there's probably no need to file an issue, then. I'm glad you found the root of the problem! --Tim On Friday, August 22, 2014 06:13:00 AM Martin Klein wrote: > Hi Tim, > > as the problem seemed to be exclusive to my system I investigated further. > I used as many system libraries as pos

[julia-users] Manipulations with abstract parametric types

2014-08-22 Thread Tim Holy
Hi all, I've come up against a couple of surprising type-manipulation issues and I'm wondering if I'm just missing something. Hoping someone out there knows a better way of doing these manipulations. The issues arise when I try writing generic algorithms on abstract parametric types that need

[julia-users] Re: simple indexing question

2014-08-22 Thread Neal Becker
I should explain the real problem more clearly. I transmit a vector of symbols x[0...N-1], N denoting the time instant. Each symbol can take on some set of values from a set S, where the size(S) is usually a power of 2. I receive a vector of values over some channel, and compute the log-likel

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Rafael Fourquet
> > Obviously it would be even nicer not to have to do that :-) > My naive answer is then why not make vectorized functions lazy (like iabs above, plus dimensions information) by default? Do you have links to relevant discussions?

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Peter Simon
Could you please explain why the iterator version is so much faster? Is it simply from avoiding temporary array allocation? Thanks, --Peter On Friday, August 22, 2014 7:53:59 AM UTC-7, Rafael Fourquet wrote: > > We'd like to eventually be able to do stream fusion to make the vectorized >> vers

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Rafael Fourquet
> > We'd like to eventually be able to do stream fusion to make the vectorized > version as efficient as the manually fused version, but for now there's a > performance gap. > It is also not too difficult to implement a fused version via iterators, eg : immutable iabs{X} x::X end Base.start(

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Stefan Karpinski
Yes, that works nicely. Obviously it would be even nicer not to have to do that :-) On Fri, Aug 22, 2014 at 10:53 AM, Rafael Fourquet wrote: > We'd like to eventually be able to do stream fusion to make the vectorized >> version as efficient as the manually fused version, but for now there's a

Re: [julia-users] keyword argument function masking non-kwarg function

2014-08-22 Thread Stefan Karpinski
Simultaneous dispatch on positional and keyword arguments just seems nuts. Jeff and I spent a lot of time talking about that and could never come up with anything that seemed sane or comprehensible, so it ended up being what it is now. Another option would be to dispatch on positional arguments fir

[julia-users] Re: simple indexing question

2014-08-22 Thread Matt Bauman
Use `find` instead of `findn` to get the logical indexes, and then you can just: bit_mask[find(bit_mask)] I know you really like that space between function names and the leading parentheses, but in this case, it's giving you extra difficulties. I really recommend adopting the Julian style he

Re: [julia-users] Re: needless loss of performance: immutable conflates two concepts

2014-08-22 Thread Stefan Karpinski
To me the appeal of annotating arguments as read-only (in) or write-only (out) is to catch subtle programmer errors. The classic one is that you are writing a function that is intended not to modify some argument, but you unwittingly call a function that mutates it. If the compiler can also leverag

Re: [julia-users] why sum(abs(A)) is very slow

2014-08-22 Thread Stefan Karpinski
There is a sumabs function in Base for this reason. We'd like to eventually be able to do stream fusion to make the vectorized version as efficient as the manually fused version, but for now there's a performance gap. Note that the vectorized version is the same speed you would get in other languag

[julia-users] simple indexing question

2014-08-22 Thread Neal Becker
Trying to translate some of my simple numpy into julia. Probably I should just learn to stop vectorizing everything, but it's hard to resist the allure of compact notation julia> bit_mask 2x4 Array{Int64,2}: 0 1 0 1 0 0 1 1 OK, now find all the nonzero indices in bit_mask: julia> findn

[julia-users] Re: Distributed sparse matrices?

2014-08-22 Thread Dominique Orban
Yes I know that package, but that's for shared memory machines. I'm talking about distributed matrices. On Friday, August 22, 2014 2:55:46 AM UTC-4, Alex wrote: > > Hi Dominique, > > Madeleine Udell has a nice (unregistered?) package for parallel sparse > matrix multiplication using shared memor

Re: [julia-users] Backtrace doesn't show details of modules

2014-08-22 Thread Martin Klein
Hi Tim, as the problem seemed to be exclusive to my system I investigated further. I used as many system libraries as possible when compiling Julia instead of letting Julia's makefile download and compile the external dependencies. When I don't link Julia against my system libraries and let Jul

[julia-users] Re: array element-wise bit shift?

2014-08-22 Thread Neal Becker
Steven G. Johnson wrote: > Doesn't seems to be defined right now. Of course, you can just do [i >> 0 > for i in all_syms] and it will be just as fast as a vectorized version > would be. Vectorization is a convenience, though. https://github.com/JuliaLang/julia/issues/8086 -- -- Those who don'

[julia-users] Re: functions with state?

2014-08-22 Thread Steven G. Johnson
On Friday, August 15, 2014 2:21:05 PM UTC-4, Neal Becker wrote: > > I'm trying to do numerical integration. I want a function that has state > information. > > Let's say I'm trying to integrate some function F over x. In addition, F > has > some state > > function F (x, state) = > As oth

[julia-users] Re: array element-wise bit shift?

2014-08-22 Thread Steven G. Johnson
Doesn't seems to be defined right now. Of course, you can just do [i >> 0 for i in all_syms] and it will be just as fast as a vectorized version would be. Vectorization is a convenience, though.

[julia-users] array element-wise bit shift?

2014-08-22 Thread Neal Becker
Well, this doesn't work all_syms = [0:3] all_syms .>> 0 ERROR: `.>>` has no method matching .>>(::Array{Int64,1}, ::Int64) -- -- Those who don't understand recursion are doomed to repeat it

Re: [julia-users] BinDeps: How to test new provider?

2014-08-22 Thread Spencer Russell
Hi Lucas, Thanks for working on this. Currently the fact that BinDeps doesn't install arch packages is the one thing keeping AudioIO from working on pkg.julialang.org. I don't actually have an arch machine handy, but if you get it merged into BinDeps I'll be using it ASAP. On Sunday, August 17

[julia-users] Re: Printing inside function

2014-08-22 Thread Tomas Krehlik
Thanks, I knew it is going to be easy. :) On Friday, 22 August 2014 11:11:30 UTC+2, Alex wrote: > > Hi Tomas, > > you can try > > display(a) > > Best, > > Alex. > > On Friday, 22 August 2014 11:07:08 UTC+2, Tomas Krehlik wrote: >> >> I have probably a very simple and trivial question... I need to

[julia-users] Re: Printing inside function

2014-08-22 Thread Alex
Hi Tomas, you can try display(a) Best, Alex. On Friday, 22 August 2014 11:07:08 UTC+2, Tomas Krehlik wrote: > > I have probably a very simple and trivial question... I need to force > printing of a matrix inside a function for evaluation purposes. I am > totally fine with the standard printo

[julia-users] Printing inside function

2014-08-22 Thread Tomas Krehlik
I have probably a very simple and trivial question... I need to force printing of a matrix inside a function for evaluation purposes. I am totally fine with the standard printout when you call a variable from REPL. julia> a 2x2 Array{Int64,2}: 1 3 2 4 However, print and show functions both gi

[julia-users] Re: EXTREME CAUTION: Windows uninstaller

2014-08-22 Thread Isaiah Norton
The (un)installer system has been updated and the download links have been restored. On Thu, Aug 21, 2014 at 7:58 PM, Isaiah Norton wrote: > Please be aware that the Windows uninstaller for the 0.3-dev series and > the initial 0.3 release has a dangerous bug that could cause loss of > non-julia