Re: [julia-users] Re: parallel and PyCall

2015-12-06 Thread Yakir Gagnon
OMG I went through so much round about ways to avoid that error... This would be amazing if it works!!! Thanks! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Mon, Dec 7

[julia-users] If a key gets pressed in a keyboard and no one is around to press enter, does it have any side effects?

2015-11-26 Thread Yakir Gagnon
Sorry for the click-bate title... Is there any way I can bind a keyboard stroke to some event? For example, during the execution of some program, if the user all of a sudden presses, say, the 'a' key then some variable gets assigned with some value. I guess this would require some kind of

[julia-users] escher fps

2015-11-25 Thread Yakir Gagnon
Hi! I’m trying to have a plot of some data update continuously using Escher.jl. I thought one natural way would be to use the fps function from Reactive.jl. The following works fine for 10 frames per second: using Winston main(window) = lift(_ -> plot(rand(10)), fps(10)) But I get ERROR

[julia-users] escher fps

2015-11-25 Thread Yakir Gagnon
Hi! I'm trying to have a plot of some data update continuously using `Escher.jl`. I thought one natural way would be to use the `fps` function from `Reactive.jl`. The following works fine for 10 frames per second: ```julia using Winston main(window) = lift(_ -> plot(rand(10)), fps(10)) ``` But I

Re: [julia-users] Re: [Escher] lower and upper bound sliders automatically adjust not to intersect

2015-11-04 Thread Yakir Gagnon
ift(mymin, u, l) function main(window) push!(window.assets, "widgets") vbox(slider(1:100, value = 100) >>> u, consume(u) do x slider(0:(x - 1), value = 0) >>> l end, u, ll ) end ​ Yakir Gagnon The Queensland Brain Institut

Re: [julia-users] Escher show pdf file

2015-11-04 Thread Yakir Gagnon
Yes, that's what I mean. Thanks (I added another comment on that "issue" in github). Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Wed, Nov 4, 2015 at 3:01 PM, Sh

[julia-users] [Escher] lower and upper bound sliders automatically adjust not to intersect

2015-11-03 Thread Yakir Gagnon
I thought others might find this useful: Two sliders that don’t overlap. The second’s upper bound is automatically adjusted so not to overlap with the first’s value. u = Input(100) l = Input(0) function main(window) push!(window.assets, "widgets") vbox(slider(1:100, value = 100) >>>

[julia-users] Re: [Escher] lower and upper bound sliders automatically adjust not to intersect

2015-11-03 Thread Yakir Gagnon
to this… On Wednesday, November 4, 2015 at 11:43:08 AM UTC+10, Yakir Gagnon wrote: I thought others might find this useful: > Two sliders that don’t overlap. The second’s upper bound is automatically > adjusted so not to overlap with the first’s value. > > u = Input(100) > l = Inpu

[julia-users] Escher show pdf file

2015-11-02 Thread Yakir Gagnon
I guess this is for the future, but in case it’s easy and already here, I sure could use some kind of pdf viewing in Escher… So something like the image(path_to_image) -> tile from the Content API, only for a (local, in assets) pdf. Thanks for all the great work! A slow work around will be

[julia-users] Re: parallel and PyCall

2015-10-30 Thread Yakir Gagnon
in yieldto at ./task.jl:67 > in wait at ./task.jl:367 > in wait at ./task.jl:282 > in wait at ./channels.jl:97 > in take! at ./channels.jl:84 > in take! at ./multi.jl:792 > in remotecall_fetch at multi.jl:729 > [inlined code] from multi.jl:368 > in call_on_owner at mu

[julia-users] Re: parallel and PyCall

2015-10-29 Thread Yakir Gagnon
@Matthew: did you find a solution? On Tuesday, October 27, 2015 at 8:44:53 AM UTC+10, Yakir Gagnon wrote: > > Yea, right? So what’s the answer? How can we if at all do any PyCalls > parallely? > > On Monday, October 26, 2015 at 11:49:35 PM UTC+10, Matthew Pearce wrote: &g

[julia-users] Re: A grateful scientist

2015-10-27 Thread Yakir Gagnon
Wow, I'm glad there's been such a positive response! I meant every word and more. I too have a publication coming up soon (albeit not in Nature -- which is beyond awesome) and Julia is referenced there. As it will probably be in every publication I have from now on. Thanks again! On

Re: [julia-users] A grateful scientist

2015-10-26 Thread Yakir Gagnon
Thanks Scott T! On Monday, October 26, 2015 at 11:16:05 PM UTC+10, Scott T wrote: > > (Oh and Yakir, your work sounds like one of the coolest interdisciplinary > mixes I could possibly think of.) > > On Monday, 26 October 2015 13:11:47 UTC, Scott T wrote: >> >> I'll add my voice to say thanks

[julia-users] Re: parallel and PyCall

2015-10-26 Thread Yakir Gagnon
Yea, right? So what’s the answer? How can we if at all do any PyCalls parallely? On Monday, October 26, 2015 at 11:49:35 PM UTC+10, Matthew Pearce wrote: Thought I had an idea about this, I was wrong: > > ```julia > > julia> @everywhere using PyCall > > julia> @everywhere @pyimport pylab > >

Re: [julia-users] Re: non-responsive REPL with PyCall

2015-10-25 Thread Yakir Gagnon
in the manual > http://julia.readthedocs.org/en/latest/manual/parallel-computing/). In > that case you REPL would be responsive as the I/O is done in another > process. > > On Monday, October 12, 2015 at 10:10:39 PM UTC+2, Yakir Gagnon wrote: >> >> I see, thanks for the g

Re: [julia-users] Re: non-responsive REPL with PyCall

2015-10-25 Thread Yakir Gagnon
Finally had some time. Thanks for all the suggestions! I wouldn't know how to change stuff in that other python library (I only know some matlab and julia). But thanks. On Wednesday, October 14, 2015 at 5:49:32 AM UTC+10, Steven G. Johnson wrote: > > Note that PyCall supports passing Julia

[julia-users] A grateful scientist

2015-10-25 Thread Yakir Gagnon
Hi Julia community and developers, I'm a postdoc researching color vision, biological optics, polarization vision, and camouflage. I've always used Matlab in my research and made the switch to Julia about two years ago. I just wanted to report, for what it's worth, that as a researcher I think

[julia-users] parallel and PyCall

2015-10-25 Thread Yakir Gagnon
How can I use pyimport with multiple processes? So say I want (taken from here ) using PyCall @pyimport math math.sin(math.pi / 4) - sin(pi / 4) # returns 0.0 How exactly can I make this work (after launching julia with say 2 processes): r =

[julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
Title... I have a bunch of tabs and it all takes time to load. I don't need the functions to evaluate before the user presses on something. Any easy way i can prevent all the signals from running their functions when the pages load up?

Re: [julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
d what you mean. Thanks again for the awesome work! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, Oct 15, 2015 at 2:46 AM, Shashi Gowda <shashigowd...@gmail.com> w

Re: [julia-users] Escher image update

2015-10-14 Thread Yakir Gagnon
Thanks, yea I just asynchronously clean everything *.jpg in assets/ before I continue with the rest of the actions in the lift. Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089

Re: [julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
*amazing... Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, Oct 15, 2015 at 2:29 PM, Yakir Gagnon <12.ya...@gmail.com> wrote: > OMG amaing. Tha

Re: [julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
OMG amaing. Thanks again ...!!! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, Oct 15, 2015 at 2:17 PM, Shashi Gowda <shashigowd...@gmail.com> wrote: > Me

Re: [julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
have some results, and then I want to access those results in another tab in combination with other inputs and widgets etc... Sorry for all the questions.. Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work

Re: [julia-users] Prevent Escher from evaluating signals on start

2015-10-14 Thread Yakir Gagnon
Solved it! All I needed to do is direct the result from the consume to a variable that was then accessible anywhere else. So: A = consume( . . . ) do o result end consume( . . . ) do o end

[julia-users] Escher image update

2015-10-13 Thread Yakir Gagnon
I have some widgets that run imagemagick updating images in `assets/`, and the only way I can get those to update with `image` is to change their names... So if I just do this: ```julia run(`convert a.jpg assets/a.jpg`) image("assets/a.jpg") ``` the image doesn't get updated. But this

[julia-users] non-responsive REPL with PyCall

2015-10-12 Thread Yakir Gagnon
I'm using PyCall to retrieve a vector of floats from an external spectrometer (a gizmo that measures light intensities per wavelength). I have it all set up in scheduled tasks with channels as the containers for the intensities and the python module I'm using is from [Andreas

[julia-users] ImageView brightness/contrast GUI

2015-10-12 Thread Yakir Gagnon
Is there any good way for the contrast GUI to return the min and max values from ContrastSettings? Right now I think I’ll add global variables to ImageView.jl/src/contrast.jl and have them set to whatever cs::ContrastSettings is… Thanks (Tim)! ​

[julia-users] Reactive loop

2015-10-08 Thread Yakir Gagnon
I’m trying to use Reactive to cyclically fetch data from an outer source. I want to have the value of some Signal update from this outer source, and once it’s updated, I want it to go and update itself again, and so on. Here are the details: I connect to a spectrometer with Andreas

[julia-users] @spawn plot(rand(100))

2015-10-03 Thread Yakir Gagnon
How do I plot on a remote process? julia -p 2 using Winston @spawn plot(rand(100)) doesn’t show any plot. ​

[julia-users] Escher image

2015-09-29 Thread Yakir Gagnon
How do you show a local image (say it’s in the directory where you ran escher --serve)? ​

Re: [julia-users] Escher image

2015-09-29 Thread Yakir Gagnon
Thanks! On Tuesday, September 29, 2015 at 9:55:06 PM UTC+10, Shashi Gowda wrote: > > You can put the image in the assets/ directory under the directory you > started the server in and then show it with image("assets/img.jpg") > > On Tue, Sep 29, 2015, 11:50 AM Yakir

Re: [julia-users] Escher plotting example

2015-09-29 Thread Yakir Gagnon
while it doesn't issue any errors, the slider doesn't affect the plot...? Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Wed, Sep 30, 2015 at 2:25 PM, Yakir Gagnon <12

[julia-users] Escher plotting example

2015-09-29 Thread Yakir Gagnon
I’m trying to use Escher as the main GUI for a program I’m writing. I need to replot some data every time the user changes a slider. The plotting.jl example seems like the best point to start at. But I get the following error (shown only in the browser, not at the shell): UndefVarError: inch

Re: [julia-users] Escher plotting example

2015-09-29 Thread Yakir Gagnon
omg, awesome! Thank you (again)! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Wed, Sep 30, 2015 at 2:17 PM, Shashi Gowda <shashigowd...@gmail.com> wrote:

[julia-users] escher examples

2015-09-28 Thread Yakir Gagnon
I'm about to delve into the Escher and Reactive docs, but are there a bunch of *simple* examples for how to use the widgets etc (other than https://shashi.github.io/Escher.jl/widgets-api.html)? Something like "here's a .jl file that has a button that runs some function"... Thanks!!!

[julia-users] Re: Julia nightlies

2015-08-18 Thread Yakir Gagnon
OK, I'm gonna git pull make then. That's the only way, right? On Wednesday, August 19, 2015 at 4:54:05 AM UTC+10, Uwe Fechner wrote: Well, removing the link from the website does not help with the travis failures: https://travis-ci.org/mlubin/NaNMath.jl/jobs/76114115 Regards: Uwe Am

[julia-users] Re: weird read behavior

2015-08-13 Thread Yakir Gagnon
Hi Ariel! Yea, I suspected as much, but I tried to see what they do in io.jl and *thought* they too had a for loop… Not so sure now. On Thursday, August 13, 2015 at 7:23:05 PM UTC+10, Ariel Keselman wrote: in the first version you read a single large chunk while in the second you read many

[julia-users] Re: weird read behavior

2015-08-13 Thread Yakir Gagnon
Awesome, thanks Ariel. I'll try and remember @which, that's super useful!!! On Thursday, August 13, 2015 at 8:40:11 PM UTC+10, Ariel Keselman wrote: just to clarify: there is no loop since the array is a bits type. Otherwise the else clause calls into io.jl line 125: function

[julia-users] weird read behavior

2015-08-12 Thread Yakir Gagnon
Which I'm sure depends on some mistake I'm making, but what? This: ```julia function imread!(a,fname,sz) stream, _ = open(`dcraw -w -H 0 -o 0 -h -4 -c $fname`) data = read(stream, UInt16, 3, sz[1], sz[2]) for i in eachindex(a) a[i] = (data[2,i] + 1.)/65536 end end ``` is a lot faster than this:

Re: [julia-users] save data as image without Images.jl

2015-08-07 Thread Yakir Gagnon
(stream,round(UInt8,255x[i,j])) end end end ​ Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Fri, Aug 7, 2015 at 1:49 PM, Yakir Gagnon 12.ya...@gmail.com wrote

Re: [julia-users] save data as image without Images.jl

2015-08-07 Thread Yakir Gagnon
])) end end end ​ Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Fri, Aug 7, 2015 at 7:26 PM, Yakir Gagnon 12.ya...@gmail.com wrote: In case this helps anyone

Re: [julia-users] save data as image without Images.jl

2015-08-06 Thread Yakir Gagnon
smaller parts of Images.jl will become more complex/functional/specialized). ​ Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Fri, Aug 7, 2015 at 1:32 PM, Tim Holy tim.h

[julia-users] save data as image without Images.jl

2015-08-06 Thread Yakir Gagnon
I love and use Tim’s amazing Images.jl package. But, sometimes I generate some data which results in an image. I then just want to save that image to disk (or pipe it to imagemagick or something). I know I can include Images and imwrite it to disk. But to load Images seems redundant just for

[julia-users] write data as an image

2015-08-06 Thread Yakir Gagnon
I love and use Tim's amazing `Images.jl` package. But, sometimes I generate some data which results in an image. I then just want to save that image to disk (or pipe it to `imagemagick` or something). I know I can `include Images` and `imwrite` it to disk. But to load `Images` seems redundant

[julia-users] How to load adule on only one process

2015-08-03 Thread Yakir Gagnon
In the documents (p. 175): - include(“DummyModule.jl”) (page 309) loads the file on just a single process (whichever one executes the statement). - using DummyModule causes the module to be loaded on all processes; however, the module is brought into scope only on the one

[julia-users] array of commands

2015-08-01 Thread Yakir Gagnon
I'm trying to build and run a complicated imagemagick command from within Julia (drawing tons of ellipses in various colors, sizes, etc). To accomplish this I need to basically build a command out of many smaller parts that are parsed in a for-loop. It looks a bit like this right now:

[julia-users] Re: array of commands

2015-08-01 Thread Yakir Gagnon
Found it: cmd = `convert in.jpg` for i = 1:xn, j = 1:yn color,fillop,x,y,a,b = stuff that depends on i and j cmd = `$cmd -fill $color -stroke none -draw fill-opacity $fillop ellipse $y,$x $a,$b 0,360 ` end run(`$cmd out.jpg`) On Saturday, August 1, 2015 at 4:49:51 PM UTC+10, Yakir

Re: [julia-users] Is it possible to imread indexed images?

2015-05-18 Thread Yakir Gagnon
Cool, thanks again Tim! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Fri, May 15, 2015 at 12:05 AM, Tim Holy tim.h...@gmail.com wrote: I'm not sure myself how hard

Re: [julia-users] Example of imread from an imagemagick stream

2015-05-18 Thread Yakir Gagnon
I’m now using open instead of readandwrite… ​ Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Fri, May 15, 2015 at 10:27 AM, Yakir Gagnon 12.ya...@gmail.com wrote: Thanks

Re: [julia-users] Re: how to create a command with an unquoted backslash in it?

2015-05-18 Thread Yakir Gagnon
Right, yea, it was all a mistake I made and I thought the parenthesis were the culprits... Thanks anyway!!! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Sun, May 17, 2015

Re: [julia-users] Re: how to create a command with an unquoted backslash in it?

2015-05-16 Thread Yakir Gagnon
Problem solved. I had a mistake in the imagemagick command and thought it was the parenthesis. It wasn't. Sorry about the rant. No need for any special treatment for the parenthesis. It just works. On 17/05/2015 8:00 AM, Yakir Gagnon 12.ya...@gmail.com wrote: Hmm. That doesn't work: I just get

Re: [julia-users] Re: how to create a command with an unquoted backslash in it?

2015-05-16 Thread Yakir Gagnon
Hmm. That doesn't work: I just get '\\)' which results in an error if I try to run it. On 16/05/2015 10:34 PM, Steven G. Johnson stevenj@gmail.com wrote: Just put them in quotes? e.g. `convert image.png \\( . \\)`

Re: [julia-users] Example of imread from an imagemagick stream

2015-05-14 Thread Yakir Gagnon
+10, Tim Holy wrote: If you dig through the commit history of Images.jl, at some point you'll find the commit that switched from using Cmd to the C api for interacting with ImageMagick. That should have quite a few examples. --Tim On Thursday, May 14, 2015 05:25:19 AM Yakir Gagnon

[julia-users] how to create a command with an unquoted backslash in it?

2015-05-14 Thread Yakir Gagnon
I'm trying to run an external imagemagick command. As such, it needs to include some escaped parenthesis. In shell it would look like this: convert img.png \( -clone 0 -crop 450x+450+0 -dither None -remap colormap1.png \) \( -clone 0 -crop 450x+951+0 -dither None -remap colormap2.png \)

[julia-users] 4D interpolation from scattered points

2015-05-13 Thread Yakir Gagnon
I have a bunch (~1000) of x,y,z and a corresponding value, V. One unique V for each x,y,z. I want to interpolate and extrapolate wildly (so I really don't care about how accurate or correct it is). The x,y,z I have are not regularly spaced or anything. They're scattered across some range (they

[julia-users] Re: 4D interpolation from scattered points

2015-05-13 Thread Yakir Gagnon
:19:18 AM UTC+10, Luke Stagner wrote: You can use Polyharmonic Splines http://nbviewer.ipython.org/gist/lstagner/04a05b120e0be7de9915 On Wednesday, May 13, 2015 at 5:33:08 AM UTC-7, Yakir Gagnon wrote: I have a bunch (~1000) of x,y,z and a corresponding value, V. One unique V for each x,y,z

Re: [julia-users] multiple inner constructors

2015-05-08 Thread Yakir Gagnon
Awesome! Thanks guys! On 23:13, Fri, 08/05/2015 Kevin Squire kevin.squ...@gmail.com wrote: You could also just write it using outer constructors. It is slightly more verbose, but cleans up the A type nicely. type A{T} x::T end function A{T:Number}(y::T) y 0 ? A{T}(zero(y)) :

[julia-users] multiple inner constructors

2015-05-07 Thread Yakir Gagnon
I want to make a parametric type that needs some checking, so I want to include an inner constructor. But since the type of the arguments can change, then the method of checking (the validity of the arguments) needs to depend on the type. I know the following works, but thought it would be

Re: [julia-users] Re: join Cmd

2015-04-27 Thread Yakir Gagnon
No no, @Tony got it right. I'm sorry I was so unclear. Thanks Tony, what you suggest is to interpolate the code parts as strings into the Cmd. That works. Thanks both of you! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell

[julia-users] join Cmd

2015-04-26 Thread Yakir Gagnon
I'm using Julia to build a imagemagick command (for a complicated gif). I'm using a for loop to build the many frames for the gif. This means I end up with an Array of Cmds where the first element is some header (i.e. `convert -delay 1 -size $(w)x$h xc:black -antialias`), then come the frames,

[julia-users] Calling functions that expect a Function type argument with a FastAnonymous function instead

2015-02-16 Thread Yakir Gagnon
Tried to make the title as explanatory as possible... Say I have an anonymous function and I @anonize it with FastAnonymous. I then want to pass that anonized function to another function from *some other module*. That other function is expecting a Function type as one of its arguments, not

Re: [julia-users] Calling functions that expect a Function type argument with a FastAnonymous function instead

2015-02-16 Thread Yakir Gagnon
for permission :-). ) --Tim On Monday, February 16, 2015 07:21:45 PM Yakir Gagnon wrote: Tried to make the title as explanatory as possible... Say I have an anonymous function and I @anonize it with FastAnonymous. I then want to pass that anonized function to another function from

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

2015-01-31 Thread Yakir Gagnon
Awesome work. On Friday, August 22, 2014 at 7:05:08 AM UTC+10, Mykel Kochenderfer wrote: There are three new Julia packages for interfacing with PGF/TikZ http://www.ctan.org/pkg/pgf for making publication-quality graphics. 1. TikzPictures.jl https://github.com/sisl/TikzPictures.jl. Basic

[julia-users] Zeal docset

2014-11-04 Thread Yakir Gagnon
Anyone managed to get/generate a docset for zeal http://zealdocs.org/?

[julia-users] Re: Zeal docset

2014-11-04 Thread Yakir Gagnon
build the docs yourself, doc2dash ( https://pypi.python.org/pypi/doc2dash) should work, but I haven't tried it. On Tuesday, November 4, 2014 2:38:45 AM UTC-6, Yakir Gagnon wrote: Anyone managed to get/generate a docset for zeal http://zealdocs.org/?

Re: [julia-users] Re: Geometry package

2014-10-22 Thread Yakir Gagnon
Woohoo! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, Oct 23, 2014 at 7:18 AM, Ariel Keselman skar...@gmail.com wrote: maybe this can help: https://github.com

[julia-users] eval create new functions

2014-10-05 Thread Yakir Gagnon
Need some help with macro / metaprogramming: I have a couple of base functions, such as: r - 110.3/(4.213e-7*r^1.526 + 1.0) - 110.3 r - 510.3 - 510.3*(1.0 - 3.84e-6*r)^(1/2) r - 0.0009465*r that I want to use to create say 10 new functions that all have different added errors (like,

[julia-users] Re: eval create new functions

2014-10-05 Thread Yakir Gagnon
Awesome!!! That's exactly what I needed! I missed the need for symbol in there, and tried to put the $k part together with everything else. This is great, thanks Toivo! On Monday, October 6, 2014 4:50:14 AM UTC+10, Toivo Henningsson wrote: I think that you will have to provide a little more

Re: [julia-users] Re: Geometry package

2014-10-01 Thread Yakir Gagnon
, 2014 8:05:51 PM UTC-4, Yakir Gagnon wrote: A Geometry package has been discussed here https://groups.google.com/d/topic/julia-dev/vZpZ8NBX_z8/discussion and here https://groups.google.com/d/topic/julia-dev/fqwnyOojRdg/discussion (Spherical, Geographic, Homogeneous coordinate systems in 1 to 4

[julia-users] Geometry package

2014-09-30 Thread Yakir Gagnon
A Geometry package has been discussed here https://groups.google.com/d/topic/julia-dev/vZpZ8NBX_z8/discussion and here https://groups.google.com/d/topic/julia-dev/fqwnyOojRdg/discussion (Spherical, Geographic, Homogeneous coordinate systems in 1 to 4 dimensions and more). I'm in need of

[julia-users] Re: Geometry package

2014-09-30 Thread Yakir Gagnon
dir::Direction end Ray(a::Array,b::Array) = Ray(Point(a),Direction(b)) step(a::Point,b::Number,c::Direction) = Point(a.c + b*c.v) end Let me know what you guys think. On Wednesday, October 1, 2014 10:05:51 AM UTC+10, Yakir Gagnon wrote: A Geometry package has been discussed here https

Re: [julia-users] constants environment

2014-09-14 Thread Yakir Gagnon
(a) )) end exp end @allconst begin a = 1 b = 2 end ``` (see the Metaprogramming section in the manual for more information) On Sat, Sep 13, 2014 at 8:37 AM, Yakir Gagnon 12.y...@gmail.com javascript: wrote: I often define a bunch

[julia-users] Re: constants and containers

2014-09-14 Thread Yakir Gagnon
My original intention was to ask if there was any way we could declare a const array who's elements are also constants. Since the following is possible: julia const a = [1,2,3] 3-element Array{Int64,1}: 1 2 3 julia a[1] = 2 2 and it would be useful to have arrays that are as constant as a

Re: [julia-users] constants environment

2014-09-13 Thread Yakir Gagnon
) On Sat, Sep 13, 2014 at 8:37 AM, Yakir Gagnon 12.y...@gmail.com javascript: wrote: I often define a bunch of constants at the beginning of a program. Wouldn't it be nice if we could start an environment of constants to avoid writing `const` before every one of the rows at the beginning

[julia-users] constants and containers

2014-09-13 Thread Yakir Gagnon
I understand the difference between variables that are constant and containers that are constants, but how do you get a container of constants? Say I have a custom type. I initiate an instance of said type. But I want that instance to be constant, including its fields. Is that possible?

[julia-users] Re: ERROR: stack overflow

2014-08-29 Thread Yakir Gagnon
I ended up doing something like this: for i = 1:n x = map(t - t[1],p[i]) y = map(t - t[2],p[i]) z = map(t - t[3],p[i]) end Hope this is helpful to someone..!

[julia-users] ERROR: stack overflow

2014-08-28 Thread Yakir Gagnon
Hi! I found a couple of similar issues, but I couldn't figure this out on my own. I'm using ImmutableArrays I then prepared the following array of arrays to later populate it with n arrays of Vector3 type vectors: p = {Array(Vector3,1) for i in 1:n} This p array gets populated with n

[julia-users] Re: ERROR: stack overflow

2014-08-28 Thread Yakir Gagnon
Figured I'd include a minimum working example. This throws the same stack overflow error: using ImmutableArrays n = 10 p = {Array(Vector3,1) for i in 1:n} m = rand(1000:1,n) for i = 1:n p[i][1] = Vector3(rand(3)) # just for initiating the array so that there won't be an #undef first

Re: [julia-users] Re: Computing colors of molecules with Julia

2014-08-25 Thread Yakir Gagnon
to the 700. the UV purple and IR black should be closer to the ends than what we see. Any idea what's going wrong? Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Tue, Aug 26

Re: [julia-users] Re: Computing colors of molecules with Julia

2014-08-25 Thread Yakir Gagnon
(f) xl = [400:100:700] nxl = length(xl) wli = wl2-wl1 w = zeros(nxl) for i = 1:nxl r = (xl[i]-wl1)/wli w[i] = width*r end w .-= width/2 Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61

Re: [julia-users] Re: Computing colors of molecules with Julia

2014-08-25 Thread Yakir Gagnon
with xcolor is at 440 nm: Julia says 440 nm is violet while xcolor says it's blue. I grabbed a 440 nm interference filter (I'm in a lab) and looked. It was violet. Thanks for your time! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072

Re: [julia-users] Computing colors of molecules with Julia

2014-08-21 Thread Yakir Gagnon
Hi Jiahao! Awesome piece, thanks for that! I was wondering about the differences between the spectrum you posted for 380--780 nm and what I'd expect (see attached image - taken from figure 1 page 31 in the manual for the LaTeX package xcolor v2.11). Doing this: xyz = colormatch(wl) rgb =

Re: [julia-users] Images imwrite PNG with Alpha transparency

2014-06-24 Thread Yakir Gagnon
(0,1,100) .* ones(1,128); # alpha gradient img = colorim(A, ARGB) This builds an ARGB image. You could alternatively choose an RGBA image if you prefer (for which A is the 4th channel). --Tim On Monday, June 23, 2014 10:00:44 PM Yakir Gagnon wrote: How, if possible, can I

Re: [julia-users] Images imwrite PNG with Alpha transparency

2014-06-24 Thread Yakir Gagnon
Thank you so much! On Wednesday, June 25, 2014 3:10:28 AM UTC+10, Tim Holy wrote: convert(Image, img) where img is your ImageCmap --Tim On Tuesday, June 24, 2014 05:13:20 AM Yakir Gagnon wrote: Great! I didn't know it was that simple, but if I have an indexed image I created

[julia-users] Images imwrite PNG with Alpha transparency

2014-06-23 Thread Yakir Gagnon
How, if possible, can I imwrite a PNG image that has transparency in it? I'm assuming something like: using Images imwrite( I,name.png,alpha=A) Thanks!

[julia-users] Re: Images imwrite PNG with Alpha transparency

2014-06-23 Thread Yakir Gagnon
Just as an alternative, one cold post process the imae with imagemagick. The trick is to code the image with the colormap so that the transparent part will be white and: run(`convert name.png -transparent white name.png`) On Tuesday, June 24, 2014 3:00:44 PM UTC+10, Yakir Gagnon wrote: How

[julia-users] Re: Images imwrite PNG with Alpha transparency

2014-06-23 Thread Yakir Gagnon
Right, this isn't ideal because the transparency is discretely expressed as either white or nothing. I'd rather have a gradient of opacity (just like any other color, 256 levels?). On Tuesday, June 24, 2014 3:14:29 PM UTC+10, Yakir Gagnon wrote: Just as an alternative, one cold post process

Re: [julia-users] Using Image.jl for false-color maps

2014-06-19 Thread Yakir Gagnon
How do you extract the colors from the colormap? So if I have some colormap: a = ColorMap([RGB(1,0,0),RGB(0,0,1)],100,1.) How do I get the vector of colors (should contain 100 colors from red to blue)? On Sunday, September 22, 2013 2:46:48 AM UTC+10, Steven G. Johnson wrote: See also

[julia-users] for loops

2014-05-15 Thread Yakir Gagnon
I love the for file in files ... do something with file ... end syntax. But sometimes it's really useful to be able to have an iterator accessible in the for loop, like: for file in files ... do something with file ... ... and with i that equals find(file == files) ... end Is there something

Re: [julia-users] for loops

2014-05-15 Thread Yakir Gagnon
OMG. So awesome! Thanks!!! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, May 15, 2014 at 11:33 PM, Kevin Squire kevin.squ...@gmail.comwrote: One nice thing about

Re: [julia-users] for loops

2014-05-15 Thread Yakir Gagnon
Love the Lazy thing, I'm real tempted to use lazy more, will do once I'm more sure of what I'm doing. Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, May 15, 2014 at 11

Re: [julia-users] reading NEF images

2014-05-13 Thread Yakir Gagnon
indirectly to imread as well. So that's one option. On Tuesday, May 13, 2014 11:24:03 AM UTC+10, Tim Holy wrote: You'll probably have more luck with `readsfrom` than `readall`. --Tim On Monday, May 12, 2014 04:34:14 PM Yakir Gagnon wrote: I have a bunch of NEF images that I need to do some

[julia-users] reading NEF images

2014-05-12 Thread Yakir Gagnon
I have a bunch of NEF images that I need to do some calculations with. I could just convert and save them all to some normal format with dcraw, but that will just take disk-space. I'd rather read them into Julia somehow. dcraw has an option to output the image to the pipe (dcraw -c filename),

[julia-users] squeeze mean

2014-04-28 Thread Yakir Gagnon
I guess I can understand why the dimension of the mean of a say 3-dimension array along the (say) third dimension is still a 3-dimensional array with a singleton (say) last dimension. But is there any better way to remove that dimension than: d = 3 a = rand(3,5,10) mu1 = mean(a,d) mu =

Re: [julia-users] squeeze mean

2014-04-28 Thread Yakir Gagnon
, var, cumsum, cumprod, etc along said dimension... Just a thought. I realize though that this is a little too close to matlab-thinking and not so julia-ish Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332

Re: [julia-users] imwrite ImageCmap

2014-03-27 Thread Yakir Gagnon
Indeed!!! Thank you so much! Yakir Gagnon The Queensland Brain Institute (Building #79) The University of Queensland Brisbane QLD 4072 Australia cell +61 (0)424 393 332 work +61 (0)733 654 089 On Thu, Mar 27, 2014 at 10:21 PM, Tim Holy tim.h...@gmail.com wrote: This is fixed if you do

[julia-users] imwrite ImageCmap

2014-03-26 Thread Yakir Gagnon
Stuck... Can someone give me an example of imwriting the output from ImageCmap? So this for instance does not work (taken from Using Image.jl for false-color mapshttps://groups.google.com/d/msg/julia-users/3LPIMCkxeFc/Gi37L86T3cgJ ): using Images, Color # build a sample image datafloat =

[julia-users] Re: using Images error

2014-03-25 Thread Yakir Gagnon
on debugging on old versions, if the problem could possibly have been fixed in the mean time. Can you try to update Julia? Ivar kl. 07:19:11 UTC+1 tirsdag 25. mars 2014 skrev Yakir Gagnon følgende: I get this error from just using Images. ERROR: type: Image: in A, expected A:StoredArray{T,N}, got

Re: [julia-users] Re: using Images error

2014-03-25 Thread Yakir Gagnon
make[2]: *** [/home/yakir/julia/usr/lib/libopenlibm.so] Error 2 make[1]: *** [julia-release] Error 2 make: *** [release] Error 2 On Tuesday, March 25, 2014 10:25:20 PM UTC+10, Tim Holy wrote: On Tuesday, March 25, 2014 04:51:14 AM Yakir Gagnon wrote: I'll gladly try it. ... Sorry, but how

  1   2   >