[julia-users] Re: [ANN] Book: Julia High Performance

2016-05-04 Thread Scott Jones
Very well written, IMO. I'm halfway through it, and have already recommended that they buy a few copies for the Dynactionize Belgium (Antwerpen), India (Kochi), and Spain (Barcelona) offices (I think it will save me a lot of time answering performance questions about Julia!) Kudos to Avik! On

[julia-users] Re: [ANN] Major Breaking Release/Overhaul for ODBC.jl

2016-05-04 Thread Scott Jones
This is absolutely wonderful! You should also point out that this fixes a number of string encoding issues. Along with the NUMERIC/DECIMAL type support, better architecture, more complete testing, it really has made great strides! -Scott

[julia-users] Re: Newbie questions: How to use PlotlyJS in Atom/Juno properly

2016-05-04 Thread Cedric St-Jean
I haven't tried it, but Hydrogen might be what you're looking for? On Wednesday, May 4, 2016 at 3:19:24 PM UTC-4, Ben Southwood wrote: > > Hello Julia-users, > > I can currently create PlotlyJS plots in Atom/Juno. However, the only way > I know of creating

[julia-users] Re: Calling a function when type field changes.

2016-05-04 Thread Cedric St-Jean
I would use a regular function like inc_count(item::Item, n) but you can get the interface you asked for with an extra type definition: import Base.+, Base.convert type Counter n end convert(::Type{Counter}, n::Int) = Counter(n) function +(c::Counter, m) println("Item value +$(m)")

Re: [julia-users] Re: turn off warnings?

2016-05-04 Thread Tim Holy
Relevant discussions: https://github.com/JuliaLang/julia/pull/14759#issuecomment-215733627 and of course https://github.com/JuliaLang/julia/pull/16125 --Tim On Wednesday, May 04, 2016 02:28:33 PM Ben Arthur wrote: > +1 > > both matlab and python can suppress warnings. any plan to permit this

[julia-users] Why multiple abstract type inheritance is not possible in Julia?

2016-05-04 Thread Martin Kuzma
Hello everyone, I know that subtyping from more than one abstract type is not possible. I also found multiple issues on github with this problem. But i could not find enywhere a reason why it is not possible. Can somebody please explain to me why? Does it have something to do with how the

[julia-users] Re: Possible mistake in the manual?

2016-05-04 Thread passerby51
I think I have done the pull request on GitHub (ID: aaamini). I hope I have done it correctly. On Wednesday, May 4, 2016 at 12:34:59 PM UTC-7, passerby51 wrote: > > OK... thanks. Not sure how to do a pull request, but will try to learn. > Otherwise, will try to edit on GitHub. (I have to revive

[julia-users] Re: Possible mistake in the manual?

2016-05-04 Thread passerby51
OK... thanks. Not sure how to do a pull request, but will try to learn. Otherwise, will try to edit on GitHub. (I have to revive my dusty old Github account it seems!) On Wednesday, May 4, 2016 at 11:28:30 AM UTC-7, Matt Bauman wrote: > > Good catch! Would you be willing to open a pull request

[julia-users] Newbie questions: How to use PlotlyJS in Atom/Juno properly

2016-05-04 Thread Ben Southwood
Hello Julia-users, I can currently create PlotlyJS plots in Atom/Juno. However, the only way I know of creating publishing a plot is to use display(my_plot). This always generates a new plot window. How do I send new plots to the same plot window? Where is the documentation I can read that

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Ben Southwood
Thanks for all the help! On Wednesday, May 4, 2016 at 1:32:19 PM UTC-4, Sam Urmy wrote: > > df = @linq df |> > groupby(:PetalLength) |> > transform(cs = cumsum(:PetalLength)) > > You can also use the @linq macro to pipe the output from one operation to > the next, which often reads more

Re: [julia-users] Reactive.jl - Resetting an accumulator

2016-05-04 Thread Achu
That works perfectly. Thanks! On Wednesday, 4 May 2016 12:09:03 UTC-5, Shashi Gowda wrote: > > This is a commonly recurring pattern. Here is a walk through of a nice > solution to this: > > *Step 1. Create the types to give richer meaning to updates* > > abstract Action# optional >

[julia-users] Re: Possible mistake in the manual?

2016-05-04 Thread Matt Bauman
Good catch! Would you be willing to open a pull request to correct it? You can edit it directly on GitHub if you'd prefer: https://github.com/JuliaLang/julia/edit/master/doc/manual/arrays.rst Thanks! On Wednesday, May 4, 2016 at 2:08:58 PM UTC-4, passerby51 wrote: > > Hello, > > In the

[julia-users] Possible mistake in the manual?

2016-05-04 Thread passerby51
Hello, In the discussion of arrays in the manual, in the assignment section it says of this: A[I_1, I_2, ..., I_n] = X The it does the following: If X is an array, its size must be (length(I_1), length(I_2), ..., >

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Sam Urmy
df = @linq df |> groupby(:PetalLength) |> transform(cs = cumsum(:PetalLength)) You can also use the @linq macro to pipe the output from one operation to the next, which often reads more clearly than nesting the function calls and is a little closer to the Pandas syntax. On Wednesday,

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Sam Urmy
@linq df |> groupby(:Species) |> transform(cs = cumsum(:PetalLength) On Wednesday, May 4, 2016 at 9:23:26 AM UTC-4, Cedric St-Jean wrote: > > That's way better, thank you! > > I never thought I'd say this, but I miss pandas. I could write > > df['cs'] =

Re: [julia-users] Reactive.jl - Resetting an accumulator

2016-05-04 Thread Shashi Gowda
This is a commonly recurring pattern. Here is a walk through of a nice solution to this: *Step 1. Create the types to give richer meaning to updates* abstract Action# optional immutable Update <: Action val end immutable Reset <: Action end # ... many more such action types can be

Re: [julia-users] nested macro with `let`

2016-05-04 Thread Yichao Yu
On Wed, May 4, 2016 at 12:09 PM, Gustavo Goretkin wrote: > I have this macro > > """given symbols, produce a dictionary of symbol=>value""" > macro symbol_dict(symbols...) > Dict([__x=>@eval($(__x)) for __x in symbols]) > end Do not use `@eval` in macro, it

[julia-users] Reactive.jl - Resetting an accumulator

2016-05-04 Thread Achu
Hi I have a signal x Signal{Float64} and I have this other signal that defined by peak_x=foldp(max,0.0,x). Is there a way for me to reinitialize peak_x back to 0? Thanks! Achu

[julia-users] nested macro with `let`

2016-05-04 Thread Gustavo Goretkin
I have this macro """given symbols, produce a dictionary of symbol=>value""" macro symbol_dict(symbols...) Dict([__x=>@eval($(__x)) for __x in symbols]) end that works like this julia> (x,y) = (30,50) (30,50) julia> @symbol_dict(x,y) Dict{Any,Any} with 2 entries: :y => 50 :x => 30 I

Re: [julia-users] Can't add PostgreSQL

2016-05-04 Thread Jacob Quinn
Hey Ross, It actually sounds like you're still on the older release of ODBC (you can check by running Pkg.installed()). To get the latest version (that matches the current documentation), you'll have to run: Pkg.update() Then restart Julia to make sure you have the latest code. -Jacob On

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Tom Short
The closest I could come to your pandas approach is with the following. DataFrames don't have an index, but GroupedDataFrames do. I created an `ave` function that does something like the R function with the same name: using DataFrames, DataFramesMeta, RDatasets df = dataset("datasets", "iris") df

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Cedric St-Jean
That's way better, thank you! I never thought I'd say this, but I miss pandas. I could write df['cs'] = df.groupby('PetalLength').transform(cumsum) That's not possible in Julia because DataFrames don't have a row index. On Wednesday, May 4, 2016 at 9:04:21 AM UTC-4, tshort wrote: > > Here's

Re: [julia-users] Warning cfunction does not return

2016-05-04 Thread 'Bill Hart' via julia-users
In this case the library interface requires that the function does not return. On 4 May 2016 at 15:03, Yichao Yu wrote: > On Wed, May 4, 2016 at 8:32 AM, 'Bill Hart' via julia-users > wrote: > > At the very least the warning should print

Re: [julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Tom Short
Here's another way with DataFramesMeta [1]: using DataFrames, DataFramesMeta, RDatasets df = dataset("datasets", "iris")@transform(groupby(df, :Species), cs = cumsum(:PetalLength)) ​ [1] https://github.com/JuliaStats/DataFramesMeta.jl/ On Wed, May 4, 2016 at 8:09 AM, Cedric St-Jean

Re: [julia-users] Warning cfunction does not return

2016-05-04 Thread Yichao Yu
On Wed, May 4, 2016 at 8:32 AM, 'Bill Hart' via julia-users wrote: > At the very least the warning should print correctly. Currently there is no > end-of-line when the message is printed, so we end up with a handful of > these errors stuck one after the other. > >

Re: [julia-users] Warning cfunction does not return

2016-05-04 Thread 'Bill Hart' via julia-users
At the very least the warning should print correctly. Currently there is no end-of-line when the message is printed, so we end up with a handful of these errors stuck one after the other. But I too wonder what is the purpose of the warning. On 4 May 2016 at 14:27, Yichao Yu

Re: [julia-users] Warning cfunction does not return

2016-05-04 Thread Yichao Yu
On Wed, May 4, 2016 at 8:20 AM, 'Bill Hart' via julia-users wrote: > Julia is now issuing warnings because functions do not return, e.g: > > function flint_abort() > error("Problem in the Flint-Subsystem") > end > > > What is the standard way of making Julia accept

[julia-users] Warning cfunction does not return

2016-05-04 Thread 'Bill Hart' via julia-users
Julia is now issuing warnings because functions do not return, e.g: function flint_abort() error("Problem in the Flint-Subsystem") end What is the standard way of making Julia accept this as a valid function (it is not meant to return)?

[julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Cedric St-Jean
"Do blocks" are one of my favourite things about Julia, they're explained in the docs . Basically it's just a convenient way of defining and passing a function (the code that comes after `do`)

Re: [julia-users] Can't add PostgreSQL

2016-05-04 Thread Cameron McBride
I've been using PostgreSQL and DBI just fine for a few months now. The implementation has a few edges that need polishing and work, but the basics work just fine for the julia 0.4.x branch. The problem you ran into with fetchdf() not being implemented is that you tried to run it on the stmt

[julia-users] Re: Calling a function when type field changes.

2016-05-04 Thread Kristoffer Carlsson
I believe you would need field access overloading for this to work cleanly: https://github.com/JuliaLang/julia/issues/1974 On Wednesday, May 4, 2016 at 11:03:18 AM UTC+2, Yonghee Kim wrote: > > I'd like write a simple log when type field value has changed > > something like this > type Item

[julia-users] Calling a function when type field changes.

2016-05-04 Thread Yonghee Kim
I'd like write a simple log when type field value has changed something like this type Item id::Int32 count::UInt32 # function for writing a log end

[julia-users] Calling a function when field of type changes?

2016-05-04 Thread Yonghee Kim
I'd like write a simple log when type field value has changed something like this type Item id::Int32 count::UInt32 # function for writing a log end

Re: [julia-users] promotion and conversion

2016-05-04 Thread Lutfullah Tomak
I think I wasn't clear. I was telling after your new method definition like julia>convert(::Type{A1}, a::A2) = A1(a) #without trailing semicolon convert (generic function with 1 method) Because you had trailing semicolon prompt did not show the result. I agree that documentation should mention

[julia-users] Re: Newbie question. Need help with grouping dataframes, cumulative sums and plotting.

2016-05-04 Thread Ben Southwood
Thanks Cedric, that worked very well. I'm having a little trouble following the documentation as to how the "by ... do ..." structure actually works. Would you mind explaining what the code is doing? On Tuesday, May 3, 2016 at 10:07:10 PM UTC-4, Cedric St-Jean wrote: > > Something like > >

Re: [julia-users] promotion and conversion

2016-05-04 Thread Arda Aytekin
Hey Stefan, Actually, I did not import these functions, nor did I try extending Base.{convert,promote_rule} versions. Following purely the documentation, one cannot understand easily whether they should extend them, or not. Sorry for being dumb --- extending Base. versions solved my issue. But

[julia-users] Re: Should `zero(Matrix{Float64},10,10)` be defined to be equivalent to `zeros(Float64,10,10)`?

2016-05-04 Thread Kristoffer Carlsson
See https://github.com/JuliaLang/julia/issues/11557 On Wednesday, May 4, 2016 at 8:56:12 AM UTC+2, Sheehan Olver wrote: > > > I'm developing BandedMatrices.jl, which currently uses `bzeros`, `beye`, > `brand` etc. to construct BandedMatrix analogues of `zeros`/`spzeros`, > `eye`/`speye` and

Re: [julia-users] calling sort on a range with rev=true

2016-05-04 Thread 'Greg Plowman' via julia-users
Thanks Steven for fixing this. (If you pass them keyword arguments, then they pretty much have to return a > full array, rather than try to be clever and return another range, for > type-stability. e.g. sort(-5:5, by=abs) can't be expressed in terms of a > range.) At first I didn't

[julia-users] Re: TensorSpace in ApproxFun

2016-05-04 Thread Eric Forgy
To save others two minutes of their lives :) https://gitter.im/ApproxFun/ApproxFun.jl On Wednesday, May 4, 2016 at 3:02:21 PM UTC+8, Sheehan Olver wrote: > > Hi Michele, > > I'll reply to this in ApproxFun's Gitter, which is is a better forum for > ApproxFun specific questions. > > Cheers, >

[julia-users] Re: TensorSpace in ApproxFun

2016-05-04 Thread Sheehan Olver
Hi Michele, I'll reply to this in ApproxFun's Gitter, which is is a better forum for ApproxFun specific questions. Cheers, Sheehan On Tuesday, May 3, 2016 at 6:55:07 PM UTC+10, Michele Zaffalon wrote: > > Hello, > > I am confused by `ApproxFun.TensorSpace`. I understand the following. > >

[julia-users] Should `zero(Matrix{Float64},10,10)` be defined to be equivalent to `zeros(Float64,10,10)`?

2016-05-04 Thread Sheehan Olver
I'm developing BandedMatrices.jl, which currently uses `bzeros`, `beye`, `brand` etc. to construct BandedMatrix analogues of `zeros`/`spzeros`, `eye`/`speye` and `rand`/`speye`. But I just saw in ArrayFire.jl an alternative syntax, rand(AFArray{Float64}, 100, 100) constructs a 100 x 100