Re: [julia-users] Method ambiguity when defining new Number types

2015-05-22 Thread Jutho Haegeman
That’s probably true. But using the if construction in the high level function is certainly fine; and avoids having to use the if in the low-level kernel, which will be called many times. On 22 May 2015, at 10:31, Toivo Henningsson toivo@gmail.com wrote: I would think that calling the

Re: [julia-users] Has anyone done a Pascal-style with statement (i.e., macro)?

2015-05-22 Thread Simon Byrne
R has such a function: http://www.inside-r.org/r-doc/base/with But given the mess that is R's scoping rules, this is perhaps not something we should attempt to emulate. I think Toivo's suggestion is very reasonable. On Friday, 22 May 2015 05:53:39 UTC+1, Toivo Henningsson wrote: I think at

[julia-users] Re: Method ambiguity when defining new Number types

2015-05-22 Thread Jutho
Thanks for the detailed response. The MathConst idea is possibly a great suggestion which I will look into. With respect to the calling the low-level function, I don't think there is a big difference between your suggestion and my one-liner, as long as the return type of the function is the

[julia-users] Fitting a sinusoidal model to time series data

2015-05-22 Thread Adriaan van Niekerk
Hi I am trying to fit a sinusoidal model (y = *a* + *b*x + *c**sin( *d* * x * pi - *e ** pi)) to time series data. I can successfully fit an unconstrained model with the curve_fit function using the LsqFit package. My problem is that the frequency parameter (*d* above) needs to be in the range

Re: [julia-users] Re: unique function lhs

2015-05-22 Thread Tim Holy
See also https://groups.google.com/d/msg/julia-users/HLLxDpaONh8/zEBlsGKZxHcJ and the correction about get! below it. --Tim On Friday, May 22, 2015 01:16:10 AM Alex wrote: Hi, This came up recently on the mailing list:

[julia-users] Re: Function to split a vector into n equal sized vectors

2015-05-22 Thread Alex
Hi Josha, I am not sure if there is a function like that in the standard library. But you can use something like this function rsplit!(v,r) a = Array(Vector{eltype(v)},0) while length(v) = length(r) push!(a, splice!(v,r)) end !isempty(v) push!(a, v)

Re: [julia-users] Re: Julia Summer of Code

2015-05-22 Thread Jeff Waller
On Thursday, May 21, 2015 at 4:55:16 PM UTC-4, Jey Kottalam wrote: Hi Jeff, they relied on a 3rd party to containerize a Pythonprogram for transmission That is due to the pecularities of Python's serialization module than anything intrinsic to creating a Spark binding. (E.g.

[julia-users] Re: unique function lhs

2015-05-22 Thread elextr
On Friday, May 22, 2015 at 5:51:04 PM UTC+10, Stéphane Mottelet wrote: Hello, I wonder why unique has only one output. I need the index of first occurence of each unique row of a matrix, how can I do ? Unique returns an array of all the unique elements, not indexes. Thanks for

[julia-users] Re: unique function lhs

2015-05-22 Thread Alex
Hi, This came up recently on the mailing list: https://groups.google.com/forum/#!searchin/julia-users/unique/julia-users/205gVuPuZFU/m4g5I3ehCgQJ Maybe the discussion there helps. Best, Alex. On Friday, 22 May 2015 09:51:04 UTC+2, Stéphane Mottelet wrote: Hello, I wonder why unique has

[julia-users] unique function lhs

2015-05-22 Thread Stéphane Mottelet
Hello, I wonder why unique has only one output. I need the index of first occurence of each unique row of a matrix, how can I do ? Thanks for help, S.

Re: [julia-users] Re: Method ambiguity when defining new Number types

2015-05-22 Thread Toivo Henningsson
I would think that calling the function as in your initial example would cause type inference to conclude Union types for alpha and beta, and cause code generation to always use dynamic dispatch. Another thing to consider is to make sure that the called function is still type stable when passed a

[julia-users] Using macroexpand for non-debugging

2015-05-22 Thread Peter Brady
I've noticed that a common pattern in my code is to use macroexpand inside functions/macros to generate expressions which are then further manipulated into what I need. As an example, here's a short function I wrote to unroll a finite difference stencil at a wall (which is then spliced into a

Re: [julia-users] Re: High-performance metric collector in Julia

2015-05-22 Thread Andrei Zh
BTW, I've measured throughput of Redis on my machine, and it resulted in only 30K/sec, which is 10 times slower than ZMQ. Possibly, some hybrid solution of several alternative backends will work. On Saturday, May 23, 2015 at 2:04:02 AM UTC+3, Andrei Zh wrote: It still helps a lot, because

Re: [julia-users] Re: High-performance metric collector in Julia

2015-05-22 Thread Andrei Zh
It still helps a lot, because you can have many reporting programs, each talking to different processes on the server, and those processes are able to get the transactions done very quickly, with multiple write daemons and journaling daemons doing the actual I/O from the shared buffer

Re: [julia-users] Julia Summer of Code

2015-05-22 Thread Viral Shah
Jey - just checking if you are listing what the project needs - or if you would be able to participate to build these? -viral On 23-May-2015, at 7:54 am, Jey Kottalam j...@cs.berkeley.edu wrote: The core functionality is there, but there's also more to be implemented to have a complete

Re: [julia-users] Re: Julia Summer of Code

2015-05-22 Thread Jey Kottalam
The core functionality is there, but there's also more to be implemented to have a complete interface to spark-core: - distributed I/O - broadcast vars - accumulator vars - custom partitioners - persistence (caching) - missing transforms and actions -Jey On Fri, May 22, 2015 at 12:46 AM, Jeff

[julia-users] Sumatra

2015-05-22 Thread Diego Tapias
I am just curious whether someone currently uses Sumatra https://pythonhosted.org/Sumatra/ for managing and keeping track of scentific projects, of course, written in julia. I just tried it but without good results. ​

[julia-users] Multidimensional DataArray as column of DataFrame

2015-05-22 Thread Josef Sachs
DataFrames apparently do not allow columns to be multidimensional DataArrays. julia DataFrame(A = 1:5, B = DataArray(reshape(1:15,(5,3 ERROR: ArgumentError: setindex!(::DataFrame, ...) only broadcasts scalars, not arrays in setindex! at

Re: [julia-users] Julia parallel when number of tasks number of CPUs

2015-05-22 Thread René Donner
You dont have to worry about this, pmap distributes the work onto the workers (one each), and once a worker is done it gets a new piece of work to do. Am 21.05.2015 um 09:49 schrieb Fred fred.softwa...@gmail.com: Hi ! When the number of tasks exceed the number of CPUs, is it safe to send

Re: [julia-users] Multidimensional DataArray as column of DataFrame

2015-05-22 Thread Tom Short
DataFrames was written with the intent that columns are vector-like objects. Sometimes other objects can be used, but support of features gets iffy. Options that might work include: * Wrap your multidimensional object in a vector type that returns the appropriate subset when indexed by a row.

[julia-users] debugging import conflicts?

2015-05-22 Thread Andreas Lobinger
Hello colleagues, maybe it's obvious, how do i track down import conflicts (not in my code)? I have here _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help()

Re: [julia-users] Method ambiguity when defining new Number types

2015-05-22 Thread Simon Byrne
In 0.4 you can also use the Val{T} type for dispatching on particular values (it's used in Base.LinAlg in a couple of places). Things like this highlight how old the BLAS specification really is: level-3 BLAS (the most recent) is now 27 years old. They were written with machines such as the

[julia-users] Re: Making fast higher-order functions/types that use interpolation

2015-05-22 Thread Tomas Lycken
The best way is probably to introduce a small type hierarchy for your heat capacity specification, some of which interpolate and some of which don't. For example, ``` abstract HeatCapacity immutable ConstantHeatCapacity{T} : HeatCapacity C::T end heatcapacity(c::ConstantHeatCapacity, x) =

[julia-users] converting quantities to FloatingPoint type

2015-05-22 Thread Gustavo Goretkin
Example desired behavior: Float32 - Float32 Array{Int}- Array{Float64} Array{Float32} - Array{Float32} Complex{Int} - Complex{Float32} Complex{Float32} - Complex{Float32} Dual{Int} - Dual{Int} etc. In short, I want to do convert some vector/algebra over the field of S to be over the field of T

[julia-users] Re: Function to split a vector into n equal sized vectors

2015-05-22 Thread 'josha W' via julia-users
Hi, Alex, Thank you very much for the coding. It is really helpful. However, this code itself can not solve all the problem because since there are two additional requirements for this task (sorry I forgot to mention on the first place) . 1) the sampling have to be random 2) the last few

[julia-users] Re: Making fast higher-order functions/types that use interpolation

2015-05-22 Thread Scott T
Second code block should have call(rsf::RunsSomeFunction, x) = rsf.f(x) instead and, if it's not obvious from the `call` functions, I'm using 0.4 - would be happy to hear about what the plans are for making higher-order functions faster so I can pass them around as arguments without worrying

[julia-users] Making fast higher-order functions/types that use interpolation

2015-05-22 Thread Scott T
I'm aware of the fact that higher-order functions will currently be slow, and you can get around this by using a package like FastAnonymous or by using custom types: function SomeFunction(value, par) # do stuff with value based on parameter end type RunsSomeFunction par1 end