[julia-users] support for the original role of quiet NaNs

2015-08-02 Thread Jeffrey Sarnoff
Quiet NaNs (QNaNs) were introduced into the Floating Point Standard as a tool for applied numerical work. That's why there are so many of them (Float64s have nearly 2^52 of them, Float32s have nearly 2^23 and Float16s have nearly 2^10 QNaNs). AFAIK Julia and most other languages use one or

[julia-users] ANN: support for the orignial role of quiet NaNs

2015-08-02 Thread Jeffrey Sarnoff
Quiet NaNs (QNaNs) were introduced into the Floating Point Standard as a tool for applied numerical work. That's why there are so many of them (Float64s have nearly 2^52 of them, Float32s have nearly 2^23 and Float16s have nearly 2^10 QNaNs). AFAIK Julia and most other languages use one or

[julia-users] Re: Interact - basic usage

2015-08-02 Thread Shashi Gowda
using Reactive, Interact idx = slider(1:3) display(idx) array_elem = lift(i - A[i], idx) Or, to the same effect @manipulate for 1=1:3 A[i] end On Sunday, August 2, 2015 at 6:38:40 AM UTC+5:30, Júlio Hoffimann wrote: Hi, Suppose I have: idx = slider(1:3) How do I use the value

[julia-users] Re: Winston savefig problem when using FramedPlot

2015-08-02 Thread Kaj Wiik
Hi! Try savefig(p, test.svg) Kaj On Sunday, August 2, 2015 at 7:06:21 AM UTC+3, Lauri Nurminen wrote: Hi, I have the following problem with Winston savefig in short, if I do julia using Winston x = randn(100); y = randn(100); pp = Points(x,y); p = FramedPlot(); add(p,pp);

[julia-users] Re: Winston savefig problem when using FramedPlot

2015-08-02 Thread Kaj Wiik
Hmm, just noticed that saving to pdf does not work anymore: julia savefig(p,test.pdf) ERROR: `convert` has no method matching convert(::Type{Float64}, ::SubString {UTF8String}) in convert at base.jl:13 in _str_size_to_pts at /home/kjwiik/.julia/v0.3/Winston/src/renderer.jl:54 in savepdf at

Re: [julia-users] Re: Interact - basic usage

2015-08-02 Thread Júlio Hoffimann
Thank you Shashi. -Júlio

Re: [julia-users] Stack trace refers to wrong or nonexistent line number?

2015-08-02 Thread Tim Holy
Short of better line numbers (which we all want), a useful trick that often works is to put `@show L` at the top of your loop; this will reveal which L is causing the problem. Then, comment out the loop and just set L to this value. More generally, you're doing a lot of computation at the

Re: [julia-users] Non-destructive assignment operator

2015-08-02 Thread Isaiah Norton
See also: https://github.com/SimonDanisch/FixedSizeArrays.jl and https://github.com/JuliaLang/julia/issues/11902 On Sun, Aug 2, 2015 at 9:51 AM, Tom Breloff t...@breloff.com wrote: Depending on your performance needs, you could make a copy constructor with keyword arg overrides: immutable

Re: [julia-users] Non-destructive assignment operator

2015-08-02 Thread Tom Breloff
Depending on your performance needs, you could make a copy constructor with keyword arg overrides: immutable Foo x y end Foo(foo::Foo; x=foo.x, y=foo.y) foo1 = Foo(1, 2) foo2 = Foo(foo1; y=5) Note: this constructor could easily be written as a macro: @copyconstruct immutable Foo x y end

Re: [julia-users] Stack trace refers to wrong or nonexistent line number?

2015-08-02 Thread 'Ben Crowell' via julia-users
Thanks, Isaiah, for spending so much time to help me with this problem -- much appreciated!! Ben

[julia-users] Non-destructive assignment operator

2015-08-02 Thread Cedric St-Jean
In my (generally functional) code, I frequently find myself asking for An object like X but with Y different, eg. that image but with the background set to transparent or that dataframe but with all inactive customers' profit set to 0. The usual idiom is: img2 = copy(img) img2[img2.==black] =

[julia-users] Interact and PyPlot - @lift and withfig()

2015-08-02 Thread Júlio Hoffimann
Hi, Suppose I have: s = slider(1:10) img = @lift eye(s) How can I create the interactive plot in Jupyter using @lift? @lift imshow(img) I know @manipulate has the withfig() option where we can pass the PyPlot Figure object, what about @lift? -Júlio

Re: [julia-users] question about altering the shape of a 3-d array

2015-08-02 Thread Dawid Crivelli
Jim, are you porting DMRG code from Matlab to Julia?

Re: [julia-users] Interact and PyPlot - @lift and withfig()

2015-08-02 Thread Júlio Hoffimann
Hi Shashi, thank you very much for your help. What is slider_val in your code snippet? I actually have multiple sliders and other widgets that I want to play with before plotting. Is there any version of @manipulate where I can pass all sorts of widgets at once? @manipulate slider, checkbox,

Re: [julia-users] Interact and PyPlot - @lift and withfig()

2015-08-02 Thread Shashi Gowda
On Mon, Aug 3, 2015 at 12:30 AM, Júlio Hoffimann julio.hoffim...@gmail.com wrote: Hi Shashi, thank you very much for your help. What is slider_val in your code snippet? I actually have multiple sliders and other widgets that I want to play with before plotting. Is there any version of

Re: [julia-users] PSA: Changes to Base Docstrings

2015-08-02 Thread Tim Holy
Congrats, Mike and Michael! --Tim On Sunday, August 02, 2015 07:21:45 PM Mike Innes wrote: Hi All, As of #11943 https://github.com/JuliaLang/julia/pull/11943, Julia uses the shiny new doc system to provide help for functions in the REPL. Previously, docstrings were stored in ReStructured

Re: [julia-users] question about altering the shape of a 3-d array

2015-08-02 Thread Jim Nason
Hi Dawid: My apologies. Perhaps, I misunderstood your message. I am porting a co-author's MatLab code that uses a particle filter to estimate the latent state vector of a stochastic volatility model into Julia Once this is complete, the goal is to wrap a Metropolis-Hasting simulator around

Re: [julia-users] Sorting Out Scope Rules...

2015-08-02 Thread Stefan Karpinski
This is a little too vague to understand what's causing your confusion. Could you provide some code examples? On Sun, Aug 2, 2015 at 3:15 PM, Forrest Curo treegest...@gmail.com wrote: I have a program which uses Tk and Cairo to draw a gameboard in a window. I would like to put this as a

[julia-users] Sorting Out Scope Rules...

2015-08-02 Thread Forrest Curo
I have a program which uses Tk and Cairo to draw a gameboard in a window. I would like to put this as a function in a larger program; but the window and board persist and remain accessible only while the loop in that program continues to run. Okay, then, if I want to avoid clutter in the parts of

Re: [julia-users] Non-destructive assignment operator

2015-08-02 Thread Cedric St-Jean
Both options are very interesting, thank you! On Sunday, August 2, 2015 at 10:04:01 AM UTC-4, Isaiah wrote: See also: https://github.com/SimonDanisch/FixedSizeArrays.jl and https://github.com/JuliaLang/julia/issues/11902 On Sun, Aug 2, 2015 at 9:51 AM, Tom Breloff t...@breloff.com

[julia-users] PSA: Changes to Base Docstrings

2015-08-02 Thread Mike Innes
Hi All, As of #11943 https://github.com/JuliaLang/julia/pull/11943, Julia uses the shiny new doc system to provide help for functions in the REPL. Previously, docstrings were stored in ReStructured text files https://github.com/JuliaLang/julia/tree/master/doc/stdlib as part of the manual, but now

Re: [julia-users] question about altering the shape of a 3-d array

2015-08-02 Thread Jim Nason
Hi Dawid: Yes. The mapping is not exactly onto but close. Jim On 08/02/2015 02:55 PM, Dawid Crivelli wrote: Jim, are you porting DMRG code from Matlab to Julia?

[julia-users] Re: PSA: Changes to Base Docstrings

2015-08-02 Thread Scott Jones
Wonderful job! Been waiting for this since JuliaCon! On Sunday, August 2, 2015 at 3:22:03 PM UTC-4, Mike Innes wrote: Hi All, As of #11943 https://github.com/JuliaLang/julia/pull/11943, Julia uses the shiny new doc system to provide help for functions in the REPL. Previously, docstrings

Re: [julia-users] Sorting Out Scope Rules...

2015-08-02 Thread Yichao Yu
On Sun, Aug 2, 2015 at 6:14 PM, Stefan Karpinski ste...@karpinski.org wrote: This is a little too vague to understand what's causing your confusion. Could you provide some code examples? On Sun, Aug 2, 2015 at 3:15 PM, Forrest Curo treegest...@gmail.com wrote: I have a program which uses Tk

Re: [julia-users] Inline built-in math functions

2015-08-02 Thread Scott Jones
On Sunday, August 2, 2015 at 7:44:49 PM UTC-4, Yichao Yu wrote: On Sun, Aug 2, 2015 at 7:32 PM, holocro...@gmail.com javascript: wrote: Poking through the Julia source, I noticed that most built-in math functions do not have the @inline decorator (see base/complex.jl and

[julia-users] Inline built-in math functions

2015-08-02 Thread holocronweaver
Poking through the Julia source, I noticed that most built-in math functions do not have the @inline decorator (see base/complex.jl and base/intfuncs.jl for examples). When I added the decorator to a select group of base functions my code was using in tight loops, overall execution time

Re: [julia-users] Inline built-in math functions

2015-08-02 Thread Yichao Yu
On Sun, Aug 2, 2015 at 7:32 PM, holocronwea...@gmail.com wrote: Poking through the Julia source, I noticed that most built-in math functions do not have the @inline decorator (see base/complex.jl and base/intfuncs.jl for examples). When I added the decorator to a select group of base

Re: [julia-users] Interact and PyPlot - @lift and withfig()

2015-08-02 Thread Júlio Hoffimann
Hi Shashi, When I type: s = slider(1:10) a = @lift eye(s) display(s) fig = figure() @manipulate for a=a; withfig(fig) do imshow(a) end end I get the interactive plot correct, but an extra undesired print of the array in Jupyter. What I can do to fix that? -Júlio

Re: [julia-users] Interact and PyPlot - @lift and withfig()

2015-08-02 Thread Júlio Hoffimann
I got it, the widgets are shown automatically by @manipulate, I'm changing the code already. Thanks, Júlio. 2015-08-02 16:42 GMT-07:00 Júlio Hoffimann julio.hoffim...@gmail.com: Hi Shashi, When I type: s = slider(1:10) a = @lift eye(s) display(s) fig = figure() @manipulate for a=a;