[julia-users] Re: small array/vector ops with broadcast and generators?

2016-09-25 Thread Jared Crean
Hello Steve, I'm not up to date on the new broadcast functionality, but I can say that the function norm does not heap allocate any memory, the heap allocation is coming from the x[p:p+2], which creates a new array of length 3 and copies the values from x into it. There are a few solutions

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

2016-09-25 Thread Isaiah Norton
Is there a reason to use this file format over NRRD [1]? To borrow a wise phrasing: I wonder if the world needs another lightweight raw data format ;) For what it's worth, NRRD is already supported by JuliaIO/Images.jl, and I believe addresses the use-cases identified in your readme, but with a

[julia-users] Re: Why was a fundamental indexing inconsistency introduced in 0.5?

2016-09-25 Thread Randy Zwitch
As someone who has never used repmat, I can't comment on that, but the "automatic squashing" makes perfect sense to me. The first syntax simplifies the structure down to a 1-D instead of a 2-D array with only one row (repmat aside, why would I want to keep the extra dimension if it doesn't

Re: [julia-users] Why was a fundamental indexing inconsistency introduced in 0.5?

2016-09-25 Thread Mauro
This was discussed at length here: https://github.com/JuliaLang/julia/issues/5949 And is featured in NEWS.md: https://github.com/JuliaLang/julia/blob/master/NEWS.md#julia-v050-release-notes Many languages do drop scalar-indexed dimensions, for instance Python/Numpy. On Mon, 2016-09-26 at 00:32,

Re: [julia-users] Is this a bug (related to scoping / nested macros)?

2016-09-25 Thread Yichao Yu
On Sep 25, 2016 6:57 PM, "Marius Millea" wrote: > > I can't figure out why this doesn't work: > > julia> macro outer() >quote >macro inner() >end >@inner >end >end > > > julia> @outer > ERROR:

[julia-users] Is this a bug (related to scoping / nested macros)?

2016-09-25 Thread Marius Millea
I can't figure out why this doesn't work: julia> macro outer() quote macro inner() end @inner end end julia> @outer ERROR: UndefVarError: @inner not defined Could it be a bug (I'm on 0.5) or am I missing something

[julia-users] Re: ASTs of complete modules/packages?

2016-09-25 Thread Cedric St-Jean
I faced very similar issues with ClobberingReload.jl. https://github.com/cstjean/ClobberingReload.jl/blob/master/src/ClobberingReload.jl Check out parse_file (courtesy of @stevengj), parse_module, and creload. I haven't "expanded" the includes, but it seems straight-forward to do with a

[julia-users] Re: Broadcast slices

2016-09-25 Thread Steven G. Johnson
On Saturday, September 24, 2016 at 9:38:55 PM UTC-4, Brandon Taylor wrote: > > I guess, but I'm trying to write a generic program where I don't know the > size of the array? I'm trying to find Nash Equilibrium for an n dimensional > array, where the player strategies are along dimensions

[julia-users] Why was a fundamental indexing inconsistency introduced in 0.5?

2016-09-25 Thread Joshua Jones
The change to indexing within matrices in 0.5.0 is fundamentally counterintuitive. For example: julia> frame32 = randn(16,7); julia> size(frame32[1,:]) (7,) julia> size(frame32[1:1,:]) (1,7) To be quite blunt, I think this is a terrible contradiction. It completely breaks the repmat syntax

[julia-users] Re: No operator overloading in DataFrames.jl?

2016-09-25 Thread John Myles White
Yes, this absence is intentional. This operation is far too magical. -- John On Sunday, September 25, 2016 at 7:49:27 PM UTC+2, nuffe wrote: > > The ability to add, subtract (etc) dataframes with automatic index > alignment is one of the great features with Pandas. Currently this is not >

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-25 Thread Michele Zaffalon
In an email a few days back, Steven Johnson wrote: "We could use type inference on the function t -> t^2 (which is buried in the generator) to determine a more specific eltype." A feature request, maybe? On Sun, Sep 25, 2016 at 11:29 PM, Christoph Ortner < christophortn...@gmail.com> wrote: > >

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-25 Thread Christoph Ortner
I didn't quite follow what the conclusion is: is it a bug that should be fixed (i.e. open an issue?), or is it expected behaviour and I should stop using generators when I need type inference? Thanks.

[julia-users] Re: problem when building julia 0.5 on plattform without indirect linking

2016-09-25 Thread Florian Oswald
see https://github.com/JuliaLang/julia/issues/18666 On Sunday, 25 September 2016 15:54:30 UTC+2, Florian Oswald wrote: > > hi, > > i am trying to build the julia release on a remote unix system and get > until this step: > > [uctpfos@jake julia]$ make > > *LINK* *usr/bin/julia* > >

[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package . Davide On Sunday, September 25, 2016 at 8:33:54 PM UTC+1, Dan wrote: > > Nice. > It is easier when the payoffs are in vector form. My last iteration: > > is_nash_equilibrium(po) = >

[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package . Davide On Sunday, September 25, 2016 at 8:33:54 PM UTC+1, Dan wrote: > > Nice. > It is easier when the payoffs are in vector form. My last iteration: > > is_nash_equilibrium(po) = >

[julia-users] HEADS-UP: breaking change in LightGraphs API

2016-09-25 Thread Seth
Sorry if this is not relevant to your use of LightGraphs, but I wanted to make sure everyone's aware of a change in the API for the `induced_subgraph()` function. Starting in LightGraphs 0.7.1, `induced_subgraph()` will, in addition to the subgraph itself, return a mapping of the original

[julia-users] Re: Broadcast slices

2016-09-25 Thread Dan
Nice. It is easier when the payoffs are in vector form. My last iteration: is_nash_equilibrium(po) = !reduce(|,falses(po[1]),(broadcast(<,po[i],mapslices(maximum,po[i],i)) for i=1:length(po))) A one-liner :) On Sunday, September 25, 2016 at 2:25:45 PM UTC-4, Brandon Taylor wrote: > > Cool!

[julia-users] Re: Broadcast slices

2016-09-25 Thread Brandon Taylor
Cool! The implementation I have is: equals_max(x) = x .== maximum(x) best_response_dimension(payoff_matrix, dimension) = mapslices(equals_max, payoff_matrix, dimension) is_nash_equilibrium(payoffs) = @chain begin payoffs broadcast(best_response_dimension, _, 1:length(_) )

Re: [julia-users] Is there a way to download a copy of Plots' documentation?

2016-09-25 Thread Tom Breloff
Also I'll state the obvious. The documentation is not a static reference. If you take a snapshot of it then it'll get outdated. On Sunday, September 25, 2016, Chris Rackauckas wrote: > You have to do what Sundara describes. This is a limitation of > Documenter.jl with the

[julia-users] No operator overloading in DataFrames.jl?

2016-09-25 Thread nuffe
The ability to add, subtract (etc) dataframes with automatic index alignment is one of the great features with Pandas. Currently this is not implemented in DataFrames.jl. I was just wondering if this is intentional? I was thinking about attempting to create a Pull Request, but the way Pandas

[julia-users] Re: Is there a way to download a copy of Plots' documentation?

2016-09-25 Thread Chris Rackauckas
You have to do what Sundara describes. This is a limitation of Documenter.jl with the mkdocs render. That would be a feature request for Documenter.jl . I think it's planned for the new native renderer, but I couldn't find the issue (and Plots would

Re: [julia-users] Minor troubles with quasiquoting syntax

2016-09-25 Thread Yichao Yu
On Sun, Sep 25, 2016 at 1:09 PM, Jamie Brandon wrote: > Here is some code I just wrote this evening: > > n = length(T.parameters) > index_types = typeof_index(T.parameters) > pushes = map(1:n) do i > :(push!(columns[$i], $(Symbol("key_$i" > end >

Re: [julia-users] Minor troubles with quasiquoting syntax

2016-09-25 Thread Jamie Brandon
Here is some code I just wrote this evening: n = length(T.parameters) index_types = typeof_index(T.parameters) pushes = map(1:n) do i :(push!(columns[$i], $(Symbol("key_$i" end body = quote $(pushes...) end for i in n:-1:1 body = quote $(Symbol("keys_$i")) =

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-25 Thread Michele Zaffalon
On Sat, Sep 24, 2016 at 8:54 PM, Steven G. Johnson wrote: > > julia> (begin;println(t);t^2;end for t=1:10) >> Base.Generator{UnitRange{Int64},##37#38}(#37,1:10) >> > > Julia knows that the input to the generator is a UnitRange{Int64}, i.e. > 1:10, so the input elements are

Re: [julia-users] Minor troubles with quasiquoting syntax

2016-09-25 Thread Yichao Yu
On Sun, Sep 25, 2016 at 12:39 PM, Jamie Brandon wrote: > I'm doing a lot of code-generation. There are two patterns that come up all > over the place - adding a suffix to a symbol and interpolating from an array > comprehension. This is pretty verbose even in the

[julia-users] Minor troubles with quasiquoting syntax

2016-09-25 Thread Jamie Brandon
I'm doing a lot of code-generation. There are two patterns that come up all over the place - adding a suffix to a symbol and interpolating from an array comprehension. This is pretty verbose even in the simplest case: quote ... row = tuple($([:($(Symbol("val_$ix))) for ix in order]...)) ...

Re: [julia-users] [ANN]: Deoplete-Julia: Fairly decent syntax completions in Neovim

2016-09-25 Thread El suisse
Cool!!! Thanks for sharing!!! 2016-09-25 12:15 GMT-03:00 Lyndon White : > Ok, I've had this kicking around for months. > It has taken me until now to get around to actually packaging it up so > that anyone could use it. > > Check it out:

[julia-users] ANN: RawArray.jl

2016-09-25 Thread David Smith
Hi, all: I finally pushed this out, and it might satisfy some of your needs for a simple way to store N-d arrays to disk. Hope you enjoy it. RawArray (.ra) is a simple file format for storing n-dimensional arrays. RawArray was designed to be portable, fast, storage efficient, and future

[julia-users] Re: Broadcast slices

2016-09-25 Thread Dan
Oops, that `cat` code was supposed to be: cat(1,map(x->reshape(x,1,size(x)...),array_of_array)...) Mew! On Sunday, September 25, 2016 at 11:54:43 AM UTC-4, Dan wrote: > > OK. So, to get the array to have the first dim as the player selector, you > can go: > >

[julia-users] Re: Broadcast slices

2016-09-25 Thread Dan
OK. So, to get the array to have the first dim as the player selector, you can go: cat(1,map(x->reshape(1,size(x)),array_of_arrays) Anyway, keeping with the same payoff_matrix as before, I realized you might just want a boolean array which is true if entry is a best response (for the

[julia-users] Re: Broadcast slices

2016-09-25 Thread Brandon Taylor
For now, I have an array of arrays. 1 payoff array for each player. The arrays can be zipped to get the strategy profiles. It seems to work, but having everything in 1 array just seems so much more neat. Which is why I was looking for a neat implementation of broadcast_slices to match. On

[julia-users] small array/vector ops with broadcast and generators?

2016-09-25 Thread vavasis
My code has many operations on small matrices and vectors. In Julia 0.4, carrying these out with subvector operations causes a needless heap allocation, so I've done them all with loops. In other words, instead of nr = norm(x[p:p+2]) I write nr = 0.0 for j = p : p + 2 nr

[julia-users] [ANN]: Deoplete-Julia: Fairly decent syntax completions in Neovim

2016-09-25 Thread Lyndon White
Ok, I've had this kicking around for months. It has taken me until now to get around to actually packaging it up so that anyone could use it. Check it out: https://github.com/JuliaEditorSupport/deoplete-julia It actually works pretty well (even if I can't write reasonable code in demos):

[julia-users] Re: Broadcast slices

2016-09-25 Thread Dan
Have you found the right implementation? Fiddling a bit, I tend to agree with Steven G. Johnson `for` loops would be the most efficient and probably the most understandable implementation. Also, would it not be easier to have the first index in the `payoff_matrix` determine which player's

Re: [julia-users] How to call macro stored in variable

2016-09-25 Thread Yichao Yu
On Sun, Sep 25, 2016 at 10:11 AM, Marius Millea wrote: > Ahh nice, thanks. Your macrocall suggestions reads cleanly too, I think it'd > look something like this: > > julia> macro macrocall(mac,args...) >Expr(:macrocall,esc(mac),map(esc,args)...) >end >

Re: [julia-users] How to call macro stored in variable

2016-09-25 Thread Marius Millea
Ahh nice, thanks. Your macrocall suggestions reads cleanly too, I think it'd look something like this: julia> macro macrocall(mac,args...) Expr(:macrocall,esc(mac),map(esc,args)...) end @macrocall (macro with 1 method) julia> @macrocall idmacro 1+2 3 What's the problem with

[julia-users] problem when building julia 0.5 on plattform without indirect linking

2016-09-25 Thread Florian Oswald
hi, i am trying to build the julia release on a remote unix system and get until this step: [uctpfos@jake julia]$ make *LINK* *usr/bin/julia* /opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.1/ld:

[julia-users] "both DataArrays and StatsBase export "rle"; uses of it in module DataFrames must be qualified"

2016-09-25 Thread K leo
I get a few warning messages like this often. Does it mean that DataFrames package need to be updated, or that I need to do something in my user code?

[julia-users] Re: Is there a way to download a copy of Plots' documentation?

2016-09-25 Thread SundaraRaman R
I don't know if the following is the best or easiest way, but: It appears the Plots.jl doc sources (https://github.com/JuliaPlots/PlotDocs.jl) are in MkDocs format, which by itself only allows html output; however, the author of MkDocs has released a Python package

[julia-users] Is there a way to download a copy of Plots' documentation?

2016-09-25 Thread K leo
in epub or even in pdf

Re: [julia-users] Re: LightXML Ubuntu 16.04 julia 0.4.5

2016-09-25 Thread Milan Bouchet-Valat
Le samedi 24 septembre 2016 à 06:17 -0700, Ján Adamčák a écrit : > Thanks, > > after installing  > > sudo apt-get install libxml2-dev > > is LightXML fully working. Could you file an issue against LightXML.jl? It should be able to install the package automatically, or could even work without

Re: [julia-users] How to call macro stored in variable

2016-09-25 Thread Yichao Yu
On Sun, Sep 25, 2016 at 7:25 AM, Marius Millea wrote: > I can store a macro to a variable (let use the identity macro "id" as an > example), > > julia> idmacro = macro id(ex) >:($(esc(ex))) >end > @id (macro with 1 method) > > > How can I use this macro

[julia-users] Re: How to call macro stored in variable

2016-09-25 Thread Marius Millea
Now that you mention it I'm not sure why I thought returning :($esc(ex)) was better than esc(ex), I think they give identical results in this case (maybe all cases?). But at any rate, that doesn't affect this problem since both do give the identical result. The problem seems to be that the

[julia-users] How to call macro stored in variable

2016-09-25 Thread Lutfullah Tomak
It you should return just esc(ex). It seems :($(esc(ex))) makes it an expression wrapping an expression.

[julia-users] How to call macro stored in variable

2016-09-25 Thread Marius Millea
I can store a macro to a variable (let use the identity macro "id" as an example), julia> idmacro = macro id(ex) :($(esc(ex))) end @id (macro with 1 method) How can I use this macro now? I can *almost* do it by hand by passing an expression as an argument and eval'ing the

[julia-users] Re: if-elseif-else programmatically

2016-09-25 Thread lapeyre . math122a
This is probably more efficient in high dimensions. I am thinking mostly about 1,2, and 3. I have many routines and want to avoid keeping three versions of each in sync. Your method will perform worse in 1D, and maybe 2D and 3D too. But, I'm starting to think that, for most of my applications,

[julia-users] Re: if-elseif-else programmatically

2016-09-25 Thread lapeyre . math122a
This is probably more efficient in high dimensions. I am thinking mostly about 1,2, and 3. I have many routines and want to avoid keeping three versions of each in sync. Your method will perform worse in 1D, and maybe 2D and 3D too. But, I'm starting to think that, for most of my applications,

[julia-users] Re: PkgDev.tag issues

2016-09-25 Thread Brandon Taylor
Ok, I deleted the extraneous tags, and retagged. Same thing messages about no changes to commit. So I git added the new v0.1.0 folder and then committed manually. Then I tried PkgDev.publish() and I got this: ERROR: GitError(Code:EAUTH, Class:None, No errors) in macro expansion at