Re: [julia-users] Accessing the loop variable (and pi as float)

2014-05-17 Thread Chris Foster
On Sat, May 17, 2014 at 9:59 PM, Hans W Borchers hwborch...@gmail.com wrote: Yesterday I implemented a function calculating arc length of curves (to the last digit) when I came across the following stumbling blocks. Image the following function where I leave a for-loop with a 'break' statement:

[julia-users] Re: Accessing the loop variable (and pi as float)

2014-05-17 Thread Hans W Borchers
Thanks, Mike, for the prompt answer. But what if i want to explicitly exclude integers. I think with Real I would allow them. On Saturday, May 17, 2014 2:13:09 PM UTC+2, Mike Innes wrote: I think your first example is right, although someone may well correct me on that. That's how I've done

Re: [julia-users] Re: Accessing the loop variable (and pi as float)

2014-05-17 Thread Mike Innes
Well, you could do this by defining another method on the (more specific) Integer type: test(x::Real) = x*x test(x::Integer) = error() There's also the FloatingPoint type, but that excludes pi. I have to say, though, that it seems odd that you'd want to do this, seeing as integers are

Re: [julia-users] Accessing the loop variable (and pi as float)

2014-05-17 Thread Hans W Borchers
It's true that the looser scoping rules of langauges like matlab and python can be convenient. On the whole I prefer tighter scoping rules like C++ though: they make code easier to reason about by making the data flow more local. The situation I met was not as clear as you describe it

Re: [julia-users] Accessing the loop variable (and pi as float)

2014-05-17 Thread Chris Foster
On Sat, May 17, 2014 at 11:14 PM, Hans W Borchers hwborch...@gmail.com wrote: and it took me some time before I realized that the answer came from outside the function. That behavior can really lead to very difficult testing situations. Fair enough. I suspect there can be some subtle bugs

Re: [julia-users] Re: Design patterns for an API

2014-05-17 Thread Tim Holy
If you want to make that fast, you need to wrap that inside a function, using a separate name for each user-supplied f. Example: function sumf_with_sinc_plus_x(xs) @sumf(sinc_plus_x, xs) end function sumf_with_exp(xs) @sumf(exp, xs) end If you don't wrap it in a function, then it runs

[julia-users] Algebra, Eigen, Varimax. Precision of calculations.

2014-05-17 Thread paul analyst
Varimax rotation loadings matrix sizes of about 3000x3000, unless as a result of errors of machine completely loses ortogonality. Please help with the rotation of large matrices. Paul

[julia-users] sizehint for new array

2014-05-17 Thread Andrew Dabrowski
What's the proper way to use sizehint when defining a new array? Is it newarray = sizehint( f( oldarray ), n ), or do you have to already have the new variable defined before using sizehint?

Re: [julia-users] Re: Design patterns for an API

2014-05-17 Thread Mike Innes
That macro being slow at the top level isn't really a strike against the macro technique, because it's easily resolved: (Although oddly enough, a let binding doesn't really help here – anyone know why?) macro sumf(f, xs) quote function inner(s = 0.0, x = $(esc(xs))) for i =

[julia-users] GSOC 3D Visualizations plotting API - Make a wish!

2014-05-17 Thread Simon Danisch
Hi, I'm currently in the planning phase for my GSOC 3D Visualization project, which also means, that I need to define what the most important visualization forms are. I must admit, that I haven't done much plotting myself, so I would have to guess what the really important bits are. Instead of

[julia-users] Compile once, run many?

2014-05-17 Thread Vale Cofer-Shabica
My apologies if I've missed something fundamental; I'm half a day into using Julia. I'm porting a classical mechanics simulation from C to Julia. Even in the C case, my potential energy function is FORTRAN black box. I've written a wrapper and am able to call the function easily. This is

[julia-users] Re: GSOC 3D Visualizations plotting API - Make a wish!

2014-05-17 Thread Tobias Knopp
Hi Simon, it is a great idea to ask for community feedback on what people want from 3D graphics. Here are some ideas from me: - In general I think it is really useful to have interactive graphics. But for publications there will a need to export the data to an image. This could be done by

Re: [julia-users] Compile once, run many?

2014-05-17 Thread Isaiah Norton
If you are on Julia 0.2, the biggest improvement will come from moving to Julia 0.3-pre (nightly builds) where pre-compilation functionality was added. This should get startup time down to around 0.5s or so depending on your computer. You would still need some JIT time for your own code, but this

[julia-users] Downloaded binary startup way slower than when compiled from github

2014-05-17 Thread Dom Luna
I find it weird that the downloaded one has a drastically slower REPL startup than when compiled from github repo. $ where julia /Applications/Julia-0.3.0-prerelease-0b05b21911.app/Contents/Resources/julia/bin/julia /usr/local/bin/julia I'm symlinking $HOME/julia/julia to /usr/local/bin/julia

Re: [julia-users] for loops

2014-05-17 Thread Cameron McBride
Stefan, Thank you. Your description really helps clarify things. The issue about different functionality for return in map vs for loops was obviously something I overlooked here. And yes, the influence is clearly ruby. I see how a macro could can duplicate the for loop structure. I guess I'm a

[julia-users] Re: GSOC 3D Visualizations plotting API - Make a wish!

2014-05-17 Thread Mike Innes
You might want to have a look through matplotlib's 3D API – personally I'd be really to see basic 3D plotting working really well. http://matplotlib.org/1.3.1/mpl_toolkits/mplot3d/tutorial.html Looking forward to seeing what you come up with! On Saturday, 17 May 2014 17:51:37 UTC+1, Simon

Re: [julia-users] Downloaded binary startup way slower than when compiled from github

2014-05-17 Thread Isaiah Norton
The pre-compiled system image must not have been included in the nightly distribution. I just pinged the OS X nightly maintainer about this on the issue tracker, see: https://github.com/JuliaLang/julia/issues/5459#issuecomment-43418116 On Sat, May 17, 2014 at 2:23 PM, Dom Luna dluna...@gmail.com

[julia-users] Re: Downloaded binary startup way slower than when compiled from github

2014-05-17 Thread Tobias Knopp
It seems that the compiled system image is not included in the prerelease binaries. Am Samstag, 17. Mai 2014 20:23:46 UTC+2 schrieb Dom Luna: I find it weird that the downloaded one has a drastically slower REPL startup than when compiled from github repo. $ where julia

[julia-users] DataFrame (2 questions)

2014-05-17 Thread Rob J. Goedman
The DataFrames package still gives me a hard time (coming from R). Two issues I run into most often: 1. Below error message, not sure what I'm doing wrong here. Do I need to use join()? Or am I missing a use of comprehension? In ModelFrames the '.' is not allowed, so I would like to be able to

Re: [julia-users] sizehint for new array

2014-05-17 Thread Andrew Dabrowski
But is it wrong to use it the way I suggested? On Saturday, May 17, 2014 4:27:19 PM UTC-4, Tim Holy wrote: I use it right after creating an array that I'm going to be modifying with push!: a = Array(Int, 0) sizehint(a, 10^5) Now I'll be able to push! at least 10^5 elements without it

Re: [julia-users] Re: Downloaded binary startup way slower than when compiled from github

2014-05-17 Thread Elliot Saba
Yep, we used to do this on purpose, since we didn't have a good way of restricting the optimizations used by the compiler. Now we've got a good baseline set, and the nightlies needed their configurations to be matched. New binaries should be up by tonight. -E On Sat, May 17, 2014 at 11:34 AM,

Re: [julia-users] GSOC 3D Visualizations plotting API - Make a wish!

2014-05-17 Thread J Luis
Hi Simon, In Earth Sciences, and Geophysics in particular, netCDF is king. There is a damn fast and good program called Fledermaus (http://www.qps.nl/display/fledermaus) that creates awesome 3D displays of grid surfaces (and some 3D solid objects as well). However, it's a commercial product

Re: [julia-users] DataFrame (2 questions)

2014-05-17 Thread Rob J. Goedman
Thanks John, On May 17, 2014, at 11:57 AM, John Myles White johnmyleswh...@gmail.com wrote: In (1), you’re trying to put to insert multiple columns into a single column, which means that you’re effectively inserting a column with 6 entries instead of 3. The error message should probably be

[julia-users] Help Understanding an InexactError() in Code Sample

2014-05-17 Thread zach
I'm trying to understand why I'm getting an InexactError() in the following bit of code: NTAB = 8 htab = [3280.84 * x for x in (0.0, 11.0, 20.0, 32.0, 47.0, 51.0, 71.0, 84.852)] ttab = [1.8 * x for x in (288.15, 216.65, 216.65, 228.65, 270.65, 270.65, 214.65,

Re: [julia-users] Help Understanding an InexactError() in Code Sample

2014-05-17 Thread Jameson Nash
Where did you define k? I don't see it in you code snippet. It seems likely that it isn't an integer, given the error On Saturday, May 17, 2014, z...@rescale.com wrote: I'm trying to understand why I'm getting an InexactError() in the following bit of code: NTAB = 8 htab = [3280.84 * x for

[julia-users] Re: DataFrames, no method push!

2014-05-17 Thread carlos cinelli
I have just installed Julia and DataFrames and faced the same problem: using DataFrames df = DataFrame() df[:A] = 1:8 no method push!(Index,Symbol) On Saturday, May 17, 2014 12:47:57 AM UTC-3, Travis Porco wrote: This from Julia 0.2.1 on MacOSX 10.7.5, using the DataFrames package, just now

Re: [julia-users] Help Understanding an InexactError() in Code Sample

2014-05-17 Thread zach
Sorry I missed a line when transcribing the code snippet in my message. The while loop should read: while true k = (i + j) / 2 if h htab[k] j = k else i = k end if j = i+1 break end end On Saturday, May 17, 2014 7:46:40 PM UTC-7, Jameson