[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread harven
Le mercredi 12 octobre 2016 01:45:25 UTC+2, Jared Crean a écrit : > > Very nice summary, thanks for posting. One question I had was what should > the signature of a function be to receive a generator? For example, if the > only method of extrema is extrema(A::AbstractArray), is that too >

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Mauro
On Wed, 2016-10-12 at 20:03, Yichao Yu wrote: > On Wed, Oct 12, 2016 at 1:22 PM, esproff wrote: > >> Consider the code: >> >> abstract AbstractFoo >> >> type Foo <: AbstractFoo >> end >> >> f(x::AbstractFoo, y::Integer) = "method 1" >> f(x::Foo, y::Real) =

[julia-users] Is 0.6(nightlies) pretty much broken?

2016-10-12 Thread Neal Becker
Seems like nothing I try is working now: Version 0.6.0-dev.896 (2016-10-07 08:16 UTC) Commit 38a63bd* (3 days old master) x86_64-redhat-linux julia> using Polynomials INFO: Recompiling stale cache file /home/nbecker/.julia/lib/v0.6/Polynomials.ji for module Polynomials. WARNING: The call to

Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread r5823
Tom, I appreciate the quick response. Your example does produce a plot with the appropriate ylimits, however the use of subplots is important for my application since I have multiple data sets of varying size that I would like to show on different subplots with a common set of ylimits (or

[julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread r5823
Is there a way to make the yaxis and/or the xaxis limits uniform across subplots in Plots.jl? For example, given the code: using Plots gr() p1 = Plots.plot([1, 2, 4]) p2 = Plots.plot([1,5,10,3]) Plots.plot(p1,p2,layout=(1,2)) The hope would be to substitute something along the lines of

Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread Tom Breloff
This should work as you want: plot([[1, 2, 4],[1,5,10,3]], layout=2, link=:all) There seems to be a bug with the link attribute when combining subplots. I'll look into it. On Wed, Oct 12, 2016 at 2:13 PM, r5823 wrote: > Is there a way to make the yaxis and/or the xaxis

[julia-users] Error setting limits on log scale in Plots.jl

2016-10-12 Thread r5823
When I call: using Plots plotlyjs() plot( xlims = (0,2), xscale = :log10, ) I get a plot where the xaxis is log scale and ranges from 1 to 100, as I would expect. However, if I call: plot( xlims = (-3,2), xscale = :log10, ) I do not get a plot where the xaxis is log scale and ranges from

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Yichao Yu
On Wed, Oct 12, 2016 at 2:41 PM, Mauro wrote: > On Wed, 2016-10-12 at 20:03, Yichao Yu wrote: > > On Wed, Oct 12, 2016 at 1:22 PM, esproff wrote: > > > >> Consider the code: > >> > >> abstract AbstractFoo > >> > >> type Foo <:

Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread Tom Breloff
This should be fixed on master now. Just add "link = :all" to your original example. On Wed, Oct 12, 2016 at 2:48 PM, r5823 wrote: > Tom, I appreciate the quick response. Your example does produce a plot > with the appropriate ylimits, however the use of subplots is

[julia-users] Re: Hermitian or Symmetric + UniformScaling

2016-10-12 Thread Andreas Noack
It's not on purpose. It is just that it hasn't been implemented yet. It would be great if you could open a pull request with such a method. You might also want to define a special type for C+λI such that you can avoid creating a new matrix but it is probably better to experiment with such a

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Mauro
On Wed, 2016-10-12 at 21:23, Mauro wrote: > On Wed, 2016-10-12 at 20:49, Yichao Yu wrote: >> On Wed, Oct 12, 2016 at 2:41 PM, Mauro wrote: >>> However, somewhat similar, this does not error: >>> >>> julia> g(x) = 1 >>> g (generic

[julia-users] Transpose view of a matrix

2016-10-12 Thread Alex Williams
Is there a preferred/standard way to create transposed view of a matrix. More or less I want something like: Y = permutedims(X, [2,1]) To return a view into X. Is the `PermutedDimsArray` that Tim Holy was working on going to be available in Base soon? Is the answer buried in this thread

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Jussi Piitulainen
Does that mean that an empty array comprehension is always Array{Any}? that array comprehensions are now type-inference-independent. That means > that the type of the resulting array only depends on the actual types of > values produced, not what the compiler can prove about the expression in

[julia-users] Re: multiple processes question

2016-10-12 Thread noel ryan
Thanks a lot Chris your insight has been extremely helpful

[julia-users] Julia Unicode (UTF-8) support (vs. Perl..); Also includes humourous, educational, list (part of, adviced to read all if you program [in Perl]..)

2016-10-12 Thread Páll Haraldsson
I'm aware of UTF-8 only in Julia 0.5 and LegacyEncodings.jl (and some of the proposed changes in 0.6, still I think only for basic UTF-8 support, not full Unicode, e.g. collation). [What/which language would have gold-standard Unicode (UTF-8) support, if not Perl; Rust (or Go)? Julia?

[julia-users] Re: binary dump of ragged data

2016-10-12 Thread Krisztián Pintér
On Tuesday, October 11, 2016 at 3:39:55 PM UTC+2, Tamas Papp wrote: > > I have a dataset of many (about 30 million) observations of the type > > Tuple{Person, Array{DataA,1}, Array{DataB,1}} > > where > > immutable Person # simplified > > immutable DataA > > I would like to dump this data in

[julia-users] collecting multiple vectors from infinite iterator

2016-10-12 Thread Tamas Papp
For example, I want collect_ragged(countfrom(1), [2,3,4]) to return 3-element Array{Any,1}: [1,2] [3,4,5] [6,7,8,9] I implemented it as function collect_ragged(iterator, lengths) result = Vector(length(lengths)) s = start(iterator) for (i,l) in enumerate(lengths)

[julia-users] Re: Unexpected results with typeof(DataFrame)

2016-10-12 Thread r5823
Looking back at this I agree I misunderstood Kristoffer, however I don't think that this is the problem. For context, my custom type is defined as follows: type Parjm x::Array{Float64,1} y::Array{Float64,1} end So the subelements of, say, temp[1,:A] are always arrays of Float64. If

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Evan Fields
Thanks for writing this up; it's helpful to see certain things highlighted and explained in more detail than news.md gives!

[julia-users] Hermitian or Symmetric + UniformScaling

2016-10-12 Thread cciliber
Hi, I am new to Julia and I was trying to learn it by doing some basic linear algebra workout : ) I was trying to compute the matrix (C + lambda * I), where C is Symmetric and I is the uniform scaling. However apparently the sum operator for these two object is not defined. I was wondering

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Christoph Ortner
f(n) = [ i^2 for i = 1:n ] julia> f(0) 0-element Array{Int64,1} On Wednesday, 12 October 2016 07:10:37 UTC+1, Jussi Piitulainen wrote: > > Does that mean that an empty array comprehension is always Array{Any}? > > that array comprehensions are now type-inference-independent. That means >> that

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Christoph Ortner
However, g(n) = sum( i^2 for i = 1:n ) julia> g(0) ERROR: MethodError: no method matching zero(::Type{Any}) Closest candidates are: zero(::Type{Base.LibGit2.Oid}) at libgit2/oid.jl:88 zero(::Type{Base.Pkg.Resolve.VersionWeights.VWPreBuildItem}) at pkg/resolve/versionweight.jl:80

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Jared Crean
Perfect, thanks. Jared Crean On Wednesday, October 12, 2016 at 2:40:03 PM UTC-4, harven wrote: > > > > Le mercredi 12 octobre 2016 01:45:25 UTC+2, Jared Crean a écrit : >> >> Very nice summary, thanks for posting. One question I had was what >> should the signature of a function be to

Re: [julia-users] Error setting limits on log scale in Plots.jl

2016-10-12 Thread Tom Breloff
The Plots convention is to set the actual number in the "lims" attribute, *not* the exponent. Do "xlims = (1e-3, 1e2)" However, it seems like the PlotlyJS backend doesn't handle this properly... I'll have to look into it. Also, for anyone else, the best venue for quick questions like this is in

Re: [julia-users] Error setting limits on log scale in Plots.jl

2016-10-12 Thread Tom Breloff
Just fixed on master: using Plots; plotlyjs() plot(rand(10), xlims = (1e-3,1e2), xscale = :log10) On Wed, Oct 12, 2016 at 2:59 PM, Tom Breloff wrote: > The Plots convention is to set the actual number in the "lims" attribute, > *not* the exponent. Do "xlims = (1e-3, 1e2)"

[julia-users] Re: Zero indexed arrays

2016-10-12 Thread lapeyre . math122a
You might get some ideas here https://github.com/alsam/OffsetArrays.jl On Saturday, October 8, 2016 at 6:39:19 PM UTC+2, Brian Rogoff wrote: > > > > Hi, > I saw in the release notes that Julia added support for different > array indexing methods. I decided to try my hand at implementing zero

[julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Cedric St-Jean
Very nice summary! I assume that there's a mile-long issue discussing this somewhere, but why doesn't the return type also assert that convert returns a value of the correct type? type A end Base.convert(::Type{Int}, ::A) = "hey" foo()::Int = A() foo() # returns "hey" On Wednesday, October

[julia-users] Filtering DataFrame with a function

2016-10-12 Thread Júlio Hoffimann
Hi, I have a DataFrame for which I want to filter rows that match a given criteria. I don't have the number of columns beforehand, so I cannot explicitly list the criteria with the :symbol syntax or write down a fixed number of indices. Is there any way to filter with a lambda expression? Or

[julia-users] What is really "big data" for Julia (or otherwise), 1D or multi-dimensional?

2016-10-12 Thread Páll Haraldsson
I'm thinking of a new algorithm for Julia.. I'm most concerned, about how much needs to fit in *RAM*, and curious what is considered big, in RAM (or not..). A. For 2D (or more), dense or sparse (including non-square), is at most a 2 billion for any highest dimensional a big limit? Note for

Re: [julia-users] Question about type ambiguity

2016-10-12 Thread Yichao Yu
On Wed, Oct 12, 2016 at 1:22 PM, esproff wrote: > Consider the code: > > abstract AbstractFoo > > type Foo <: AbstractFoo > end > > f(x::AbstractFoo, y::Integer) = "method 1" > f(x::Foo, y::Real) = "method 2" > > foo = Foo() > f(foo, 1) > > This code results in an ambiguity

Re: [julia-users] Re: Why does Julia 0.5 keep complaining about method re-definitions?

2016-10-12 Thread Tom Breloff
I just *immediately* found a bug thanks to the redefinition warning: julia> using Plots; plotlyjs() > INFO: Recompiling stale cache file /home/tom/.julia/lib/v0.5/Plots.ji for > module Plots. > WARNING: Method definition apply_recipe(Base.Dict{Symbol, Any}, > Type{Base.Dates.Date},

[julia-users] How do I move an array of strings from C to Julia?

2016-10-12 Thread Michael Eastwood
Hello julia-users, I maintain a package that wraps a C++ library. One feature of this library is called "tables". These tables are a widely used data format in my field and they can store arrays of ints, floats, doubles, complexs, and strings (the library defines a custom string type but it can

Re: [julia-users] collecting multiple vectors from infinite iterator

2016-10-12 Thread Mauro
Somewhat off topic, as you seem to be dealing with ragged arrays. Are you aware of https://github.com/mbauman/RaggedArrays.jl ? Also there are references to other, older implementations: https://github.com/mbauman/RaggedArrays.jl/issues/2 On Wed, 2016-10-12 at 16:16, Tamas Papp

[julia-users] Question about type ambiguity

2016-10-12 Thread esproff
Consider the code: abstract AbstractFoo type Foo <: AbstractFoo end f(x::AbstractFoo, y::Integer) = "method 1" f(x::Foo, y::Real) = "method 2" foo = Foo() f(foo, 1) This code results in an ambiguity error, since both methods contain one argument with a more specific type declaration than the

Re: [julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Steven G. Johnson
On Wednesday, October 12, 2016 at 9:26:54 PM UTC-4, Stefan Karpinski wrote: > > That's a fair point. It seems like it could/should be handled by the same > (not-yet-implemented) mechanism that ensures that `convert(T,x)::T` is > true. Of course, we could choose to enforce this fact via

Re: [julia-users] Filtering DataFrame with a function

2016-10-12 Thread Júlio Hoffimann
Hi David, Thank you for your elaborated answer and for writing a package for general queries, that is great! I will keep the package in mind if I need something more complex. I am currently looking for a lightweight solution within DataFrames, filtering is a very common operation. Right now, I

Re: [julia-users] Uniform axis across subplots in Plots.jl

2016-10-12 Thread r5823
Works great for gr and pyplot backends, but still trouble with plotlyjs On Wednesday, October 12, 2016 at 2:53:19 PM UTC-4, Tom Breloff wrote: > > This should be fixed on master now. Just add "link = :all" to your > original example. > > On Wed, Oct 12, 2016 at 2:48 PM, r5823

Re: [julia-users] Re: Julia 0.5 Highlights

2016-10-12 Thread Stefan Karpinski
That's a fair point. It seems like it could/should be handled by the same (not-yet-implemented) mechanism that ensures that `convert(T,x)::T` is true. Of course, we could choose to enforce this fact via lowering in this case, independent of enforcing it for convert. On Wed, Oct 12, 2016 at 7:40

RE: [julia-users] Filtering DataFrame with a function

2016-10-12 Thread David Anthoff
Hi Julio, you can use the Query package for the first part. To filter a DataFrame using some arbitrary julia expression, use something like this: using DataFrames, Query, NamedTuples q = @from i in df begin @where @select i end You can use any julia code in . Say your

[julia-users] Re: What is really "big data" for Julia (or otherwise), 1D or multi-dimensional?

2016-10-12 Thread cdm
do you have traditional main memory RAM in mind here ... ? with flash memory facilitating tremendous advances in (near) in-memory processing, the lines between traditional RAM and flash memory have become considerably blurred. ~ cdm On Wednesday, October 12, 2016 at 3:23:58 PM UTC-7, Páll

[julia-users] Re: ANN: Julia v0.5.0 released!

2016-10-12 Thread Yan Si
On Tuesday, September 20, 2016 at 5:08:41 AM UTC-4, Tony Kelman wrote: > At long last, we can announce the final release of Julia 0.5.0! See the > release notes at https://github.com/JuliaLang/julia/blob/release-0.5/NEWS.md > for more details, and expect a blog post with some highlights within

[julia-users] Could not allocate pools when using pmap

2016-10-12 Thread linan
Hello, I am a problem when I use pmap function to do parallel computing on a 48 cores workstation. The workstation has Linux system. I am using a recent updated julia-0.4.5. I downloaded the binary version and set up path to bin file to call Julia. It is fine to do julia abc.jl However,

Re: [julia-users] Filtering DataFrame with a function

2016-10-12 Thread anthoff
Were you worried about Query being not lightweight enough in terms of overhead, or in terms of syntax? I just added a more lightweight syntax for this scenario to Query. You can now do the following two things: q = @where(df, i->i.price > 30.) that will return a filtered iterator. You can

[julia-users] building Julia, cross compile using WSL

2016-10-12 Thread mmus
I'm trying to build a cross compiled version for Windows using Windows Subsystem For Ubuntu $ git status On branch master Your branch is up-to-date with 'origin/master'. commit 683945155c64b8b68bf03d768745d650d4df142a $ cat Make.user override XC_HOST = x86_64-w64-mingw32 I get the

Re: [julia-users] Filtering DataFrame with a function

2016-10-12 Thread Júlio Hoffimann
Thank you very Much David, these queries you showed are really nice. I meant that ideally I wouldn't need to install another package for a simple filter operation on the rows. -Júlio 2016-10-12 22:14 GMT-07:00 : > Were you worried about Query being not lightweight enough

[julia-users] How to convert a jpeg base64 encoded string to Image

2016-10-12 Thread lovebufan
I have some jpeg images saved as base64 encoded strings (such strings can be produced by ```stringmime("image/png", convert(Image, rand(5,5)))``` using Images.jl). but I tried a whole day and cannot convert them back (without disk I/O)...