This link is only to an archive of the source code; you would still have to
build julia after downloading this.
Ideally what you want is an ARM binary that's version 0.4 instead of a
nightly build but I don't see anywhere obvious where that can be downloaded.
RobotOS will start working on 0.5
For your second question, I would have expected just doing
deepcopy(MyType_Vec[[1,3,1]]) would have created a new array with a new
object allocated for each element. Instead, it puts the same object (which
is a copy) in the first and third positions and you get the same behavior.
Maybe this
jects, it will just work and
> do the right thing, even for expressions which have no possible string
> representation.
>
>
> On Thu, Apr 28, 2016 at 10:21 PM, Yichao Yu <yyc...@gmail.com
> > wrote:
>
>> On Thu, Apr 28, 2016 at 6:05 PM, Josh Langsfeld <jdl...@gmail.com
>
That's quite a strong statement to say never use parse. Could you explain?
I think manipulating strings is typically much easier than Expr objects.
On Thursday, April 28, 2016 at 8:38:27 AM UTC-4, Yichao Yu wrote:
>
>
> On Apr 28, 2016 7:15 AM, "Ben Lauwens"
> wrote:
> >
>
that all the anonymous
functions return Bools.
On Tuesday, April 26, 2016 at 2:24:18 PM UTC-4, Ali Rezaee wrote:
>
> Reading the rules from a file, how can I convert the strings to such
> anonymous functions?
>
> On Tuesday, April 26, 2016 at 6:48:21 PM UTC+2, Josh Langsfeld w
Maybe a better design would be to store the rules as anonymous functions
rather than code strings? Something like:
```
rules = [(x -> x[1] && x[2]), (x -> x[3] || x[4])] #parentheses not required
result = [rule(boolList) for rule in rules]
```
On Tuesday, April 26, 2016 at 12:09:33 PM UTC-4,
This is noted in the docs. See a few paragraphs down, "When a type is
applied like a function..."
http://docs.julialang.org/en/release-0.4/manual/types/#composite-types
On Tuesday, April 5, 2016 at 10:19:05 AM UTC-4, FANG Colin wrote:
>
> methods(TT)
>
> call(::Type{TT}, x::Float64,
Shouldn’t Dates.day(1) be the MethodError here? It calls what appears to be
an internal calculation method that happens to have the same name as the
exported and documented method.
On Monday, April 4, 2016 at 11:21:47 AM UTC-4, Jacob Quinn wrote:
Dates.day is the accessor funciton, returning
Hello Ayush,
Note that you are using julia 0.5 but are using the 0.4 documentation. You
want to be on this page
instead: http://docs.julialang.org/en/latest/manual/packages/
There's a little widget in the bottom right corner of the page that lets
you select the documentation version so you
Maybe a solution to this kind of design problem would be to allow multiple
top-level modules per package, with syntax to let you load the particular
one you want/need.
On Thursday, February 25, 2016 at 1:10:28 AM UTC-5, John Myles White wrote:
>
> I don't think Julia is really amenable to this
Whoops, sorry Yichao, I missed you had already given the suggested change.
On Wednesday, February 17, 2016 at 10:30:54 AM UTC-5, Yichao Yu wrote:
>
> On Wed, Feb 17, 2016 at 10:22 AM, J Luis
> wrote:
> > Hi, see
> >
> > function ttt()
> > t1 =
To get a two-dimensional output array (i.e., row vector), you can use a
non-scalar indexing expression such as t1[[1],:] or t1[1:1,:].
You probably knew this already, but just making a note for any others
reading who might not.
On Wednesday, February 17, 2016 at 10:51:04 AM UTC-5, J Luis
Exactly two years later seems like a good-enough time to bring this back
up. Has the situation changed here at all, maybe in a package? I've
experimented a bit and the code for doing row and column iteration at least
is absurdly simple. If multiple people would make use of it, where would be
a
Is there any straightforward way to define this function? :
onedimless{T}(A::AbstractArray{T,2})
I would like it to return almost the same concrete type as typeof(A), but
with an AbstractArray dimension type parameter of 1 instead of 2. E.g.,
onedimless(zeros(3,3))
== Array{Float64,1}.
For Array, sure, but I was hoping for something that would work for various
subtypes of AbstractArray.
On Wednesday, February 10, 2016 at 12:36:00 PM UTC-5, Lutfullah Tomak wrote:
Do yo mean something like
>
> onedimless{T,N}(A::Array{T,N}) = Array{T,N-1}
> ?
>
Yeah, it does seem ill-posed in general. Still, it would nice if I could do
this for at least some subtypes that use the same type parameter pattern,
even if the behavior was undefined when it doesn't use the same pattern.
Is there any method of dynamically computing a new type by changing one
Ok, but how does one actually create a new type object given a new set of
parameters?
On Wednesday, February 10, 2016 at 2:20:27 PM UTC-5, Yichao Yu wrote:
>
> On Wed, Feb 10, 2016 at 2:13 PM, Josh Langsfeld <jdl...@gmail.com
> > wrote:
> > Yeah, it does seem ill-po
given source array.
> ```
>
> Note that this puts the burden onto the creator of the type.
>
> On Wed, 2016-02-10 at 20:20, Yichao Yu <yyc...@gmail.com >
> wrote:
> > On Wed, Feb 10, 2016 at 2:13 PM, Josh Langsfeld <jdl...@gmail.com
> > wrote:
> >>
I may be mistaken, but I think setting the type parameter to be abstract is
indeed the same as setting the field itself to be abstract. This snippet is
my evidence:
julia> abstract ABC
julia> immutable A <: ABC
a::Float32
end
julia> type B{T<:ABC}
a::T
end
8:
>
> abstract ABC
>
> immutable A2 <: ABC
> a::Float64
> end
>
> julia> bA2, bABC2 = B{A2}(A2(1)), B{ABC}(A2(2))
> (B{A2}(A2(1.0)),B{ABC}(A2(2.0)))
>
> julia> sizeof(bA2), sizeof(bABC2)
> (8,8)
>
>
>
>
>
> On Thursday, February 4, 2016 at 2:
You should test it and decide what to put in it by modifying your own
forked copy of Cairo.jl. This is what's great about open-source; you get to
exactly see and control what impact the changes you want will have before
they get added to the official software.
On Monday, January 25, 2016 at
The tipoff is that you had to quote 'awards' to become a symbol. That's an
indicator that you're only referring to the variable name and not to any
value it might have coming out of the xpath function.
On Wednesday, January 13, 2016 at 4:14:18 PM UTC-5, Brandon Booth wrote:
>
> Thank you, I
Here's an idea for a more general and scalable approach rather than
checking each argument's type with an if-statement:
function f(args...)
argdict = Dict(zip(map(typeof, args), args))
f(argdict[A], argdict[B]) #etc...
end
Note that it won't work if any of your A,B,etc are abstract types
Just a quick note; it's quite limiting to put a type annotation of
'AbstractVector{Int64}' on 'lines', with nothing gained. This is a perfect
example of a time when the programmer should just leave off the annotation
and allow any expression that's valid for indexing to be used, including a
to signal the user that the
> entries of lines has some restriction for getindex to work.
>
> How about the type annotation for path? That seems reasonable to me too,
> but maybe I’m mistaken?
>
> On Wednesday, January 6, 2016 at 3:53:09 PM UTC-8, Josh Langsfeld wrote:
>
> Jus
As Yichao is hinting, you may find a macro to be a cleaner way of making
your functions instead of constructing and parsing a string.
macro return_fcn(N)
xexprs = Expr[:($(symbol(:x,i)) = X[$i]) for i=1:N]
return esc(:(
function $(symbol(:f,N))(X::Vector)
$(xexprs...)
On Tuesday, December 15, 2015 at 1:09:54 PM UTC-8, Kristoffer Carlsson
> wrote:
>>
>> The set is built as a number of key-value pairs of the hash and the
>> object. When you modify the object the key that contains the hash does not
>> get updated. A good reason not to pu
t from the outside
s = Set([[10,2,3]])
julia> push!(s, [10,2,3])
Set([[10,2,3],[10,2,3]])
julia> length(s)
2
julia> els = collect(s); els[1] == els[2]
true
Is something buggy going on here?
On Tuesday, December 15, 2015 at 10:57:31 AM UTC-5, Josh Langsfeld wrote:
>
> It's not arr
It's not array equality that's the issue here. Arrays with the same
elements are '==' (but not '==='). If you manually test pushing the same
array to a Set you'll see it works fine.
Jan, what happened is that your 'santa' function modifies and returns the
same array that was passed in instead
g.
> https://github.com/JuliaLang/julia/issues/2586
> https://github.com/JuliaLang/julia/issues/4893
>
> On Wed, Dec 9, 2015 at 10:50 AM, Josh Langsfeld <jdl...@gmail.com
> > wrote:
>
>> But an if statement does not introduce new scope, correct?
>>
>> Somethin
But an if statement does not introduce new scope, correct?
Something weird/unexpected does seem to be going on here:
julia> VERSION
v"0.5.0-dev+1491"
julia> if true
using Compat
println("Using")
foreach(println, 1:3)
end
Using
1
2
3
julia> if true
s trivial. However, in the end I want not only the minimum
> value, but also the additional tuple elements, which would be stripped off
> by the score_func.
>
> -erik
>
> On Tue, Dec 1, 2015 at 12:38 PM, Josh Langsfeld <jdl...@gmail.com
> > wrote:
>
>> Doesn't 'min'
Doesn't 'min' imply/require the usage of '<' ? A whole lot of methods would
need the extra argument added for consistency, including min, minimum,
maximum, etc...
Could a workable solution be to define a function that maps a tuple to a
real number instead of a comparison function and do
Should also mention that even when ["1", ["1","2","3"]] returns a two
element Vector{Any}, the inner array will still get inferred to be
Vector{ASCIIString} unless you add the Any prefix.
On Wednesday, November 18, 2015 at 12:30:28 PM UTC-5, Josh Langsfe
Your conclusion is correct. The final switch should happen pretty soon on
0.5 master. Until then, the work-around is to prefix all your brackets with
'Any', including the inner arrays.
On Wednesday, November 18, 2015 at 12:20:15 PM UTC-5, vis...@stanford.edu
wrote:
>
> Hi everyone,
>
> Julia
On Saturday, November 14, 2015 at 10:59:26 AM UTC-5, MA Laforge wrote:
>
>
>> - `immutable KD{Symbol} end` does not force the type parameter to be a
>> symbol. It does the same thing as the more typical 'T' (which could be
>> :tfund, Int, Array{Symbol,2}, or anything else).
>>
> Hmm... I
This looks like overengineering of what should be a simple problem. Why do
you want turn the keywords into arguments for dispatch? Dispatch is best
when you need different behavior for different types but here all your
input and output types are fixed.
You may have already known, but you can
You could do 'append!(vec, zeros(i-n))'.
On Monday, October 26, 2015 at 3:32:56 PM UTC-4, Cameron McBride wrote:
>
> Hi All,
>
> What's the best julian way to do the following:
>
> function vecadd!(vec, i, v)
> n = length(vec)
> if n < i
> resize!(vec, i)
> vec[n+1:i] =
[a; b] / vcat(...) is type stable. It may produce different output
depending on the types of a and b but it won't change behavior depending on
their values.
On Monday, October 19, 2015 at 10:20:06 AM UTC-4, Andras Niedermayer wrote:
>
> In light of the recent discussions (
>
There must have been some other subtle change you made when converting to
0.4. I see the same fill! behavior in 0.3.
julia> VERSION
v"0.3.11"
julia> X = Array(Vector{Int},5); fill!(X, Int[]);
julia> push!(X[1], 11); @show X;
X => [[11],[11],[11],[11],[11]]
On Tuesday, October 13, 2015 at
Actually Compat doesn't rewrite the code to call 'names' but just defines
'fieldnames' directly. So either
import Compat
Compat.fieldnames(x)
or
using Compat
fieldnames(x)
is sufficient.
On Wednesday, October 14, 2015 at 4:47:36 PM UTC-4, Milan Bouchet-Valat
wrote:
>
> Le mercredi 14
Essentially, it would really cool to be able to do something like 'type
SubString{T<: AbstractString} <:T ...' for dispatch purposes.
'SubString{ASCIIString} <: ASCIIString' would still return false in general.
On Thursday, September 17, 2015 at 1:47:24 PM UTC-4, Josh Langsfeld wro
I recently was stumped when I wanted to write a function that dispatched on
'ASCIIString' versus 'UTF8String' but then had to deal with a
'SubString{ASCIIString}'. It made me think that given Julia's prolific use
of wrapper types, it would be very nice to be able to dispatch on a type T
and
king them part of the core language eventually, but in the meantime,
> check out https://github.com/mauro3/Traits.jl
>
> On Thu, Sep 17, 2015 at 2:16 PM, Josh Langsfeld <jdl...@gmail.com
> > wrote:
>
>> Essentially, it would really cool to be able to do something like 't
You can access the 'parameters' field of a type instance object. But the
standard Julian way to get type parameters is to just define a helper
function:
typeparams{A,B}(::Type{T{A,B}}) = A,B
On Friday, September 11, 2015 at 3:20:17 PM UTC-4, Erik Schnetter wrote:
>
> Is there a function in
You can always just make the arguments give all the parameters:
type EulerAngles{T : Number, Seq}
angles::Vector{T}
end
EulerAngles{T}(seq, angles::Vector{T}) = EulerAngles{T,seq}(angles)
julia EulerAngles(321, [pi,pi/2,0])
Christoph and David,
If you want your package to be useful to the world, how should new users in
your domain find it? With a Google search?
I'm of the same opinion of Jeffrey that anything that could be helpful to
others should be registered in some capacity. Besides making it easier to
You can see the discussion about changing the deprecation suggestion
here: https://github.com/JuliaLang/julia/pull/11369
I think people liked it because it's a bit of an abuse of terminology to
call the [a:b;] form 'concatenation' when there is only one object being
put into the array. The
andreasnoackjen...@gmail.com
wrote:
You could, but unless the matrices are small, it would be slower because
it wouldn't use optimized matrix multiplication.
2015-07-08 10:36 GMT-04:00 Josh Langsfeld jdla...@gmail.com:
Maybe I'm missing something obvious, but couldn't you easily write your
Maybe I'm missing something obvious, but couldn't you easily write your own
'cross' function that uses a couple nested for-loops to do the arithmetic
without any intermediate allocations at all?
On Tuesday, July 7, 2015 at 6:24:34 PM UTC-4, Matthieu wrote:
Thanks, this is what I currently do
The philosophy I try to follow is to use multiple dispatch when you don't
care at the calling site what the types of your arguments are and therefore
which method will be called. For example, consider the case when you
receive some output from a library function and you either don't know or
tony.hf.f...@gmail.com wrote:
I have just put out an update to the Lint.jl master which should have some
examples of what you need. Hopefully this would fix the tuple length issue
for you.
On Wednesday, June 24, 2015 at 2:54:03 PM UTC-4, Josh Langsfeld wrote:
Thanks, Matt. I hope your stuff does
way to do this. You could take a look
at my Tuples package[1], which is an attempt at hashing out the API before
trying to get this functionality into base. Your feedback would be very
welcome!
1: https://github.com/mbauman/Tuples.jl
On Wednesday, June 24, 2015 at 1:14:41 PM UTC-4, Josh
My results don't show a significant performance advantage of the
comprehension. Averaging over 1000 runs of a million-element array, I got:
f1 (vectorized): 10.32 ms
f2 (loop): 2.07 ms
f3 (comprehension): 2.05 ms
f4 (map): 38.09 ms
Also, as you can see here
wrote:
Gah. I'm sorry. I can't reproduce my original results! I don't know why,
but the same tests I ran two days ago are not giving me the same timing. I
need to go back to the drawing board here.
On Wednesday, June 17, 2015 at 11:37:52 AM UTC-5, Josh Langsfeld wrote:
For me, map is 100x
/JuliaLang/julia/issues/11750.
On Thursday, June 18, 2015 at 11:04:29 AM UTC-5, Josh Langsfeld wrote:
It seems 'any' calls 'mapreduce' which calls 'mapfoldl' which has a
specialization that will stop computing in the case of searching for a
single true or false value. However, it seems
It seems 'any' calls 'mapreduce' which calls 'mapfoldl' which has a
specialization that will stop computing in the case of searching for a
single true or false value. However, it seems the call to mapreduce instead
goes to a more specific method that doesn't implement this shortcut. If
'any'
For me, map is 100x slower:
julia function f1(g,a)
[Pair(x,g) for x in a]
end
f1 (generic function with 1 method)
julia function f2(g,a)
map(x-Pair(x,g), a)
end
f2 (generic function with 1 method)
julia @time f1(2,ones(1_000_000));
25.158 milliseconds (28491
On Monday, 1 June 2015 02:35:28 UTC+10, Josh Langsfeld wrote:
I don't think this is correct actually. With Julia's metaprogramming
abilities, all macros could be handled by runtime functions.
The rule I follow is that macros should be used when some processing
needs to be done at compile time
AM UTC-10, Josh Langsfeld wrote:
That particular error was just because the = operator was implemented
and there was no fallback method to give an informative error. I sent in a
PR to fix that: #11372 https://github.com/JuliaLang/julia/pull/11372.
Beyond that, I managed to get it working
. Mai 2015 23:28:26 UTC+2 schrieb Josh Langsfeld:
I want to implement some functionality in multiple methods and have the
dispatch controlled by an Int variable N. The trick is I want one method
to be called if N == 0 and another one to be called for all other values of
N. Is there a way I can
I want to implement some functionality in multiple methods and have the
dispatch controlled by an Int variable N. The trick is I want one method
to be called if N == 0 and another one to be called for all other values of
N. Is there a way I can do this with Val{N} without making the method
(float64(a)))
nextfloat(a::JDate,b::Int64) = JDate(nextfloat(float64(a),b))
Then,
julia [j1:.5:j2]
ERROR: stack overflow
in = at promotion.jl:170 (repeats 8 times)
Any insight into why this is happening?
Thanks,
Chris
On Thursday, May 14, 2015 at 3:48:48 AM UTC-10, Josh Langsfeld wrote
Ideally, I would like to write
func{N::Int}(::Type{Val{N}) = N
and get no-method errors if N is a float, symbol, etc... Has there been
previous discussion on this topic?
On Wednesday, May 20, 2015 at 5:28:26 PM UTC-4, Josh Langsfeld wrote:
I want to implement some functionality in multiple
. Thanks for your
help.
Chris
On Wednesday, May 13, 2015 at 2:30:53 PM UTC-4, Josh Langsfeld wrote:
Yeah, I missed that you were subtyping FloatingPoint before. It still
worked ok for me though once I also defined colon methods suggested by the
ambiguity warnings. in my case it was:
colon
, define
colon(JDate,JDate,JDate)
before the new definition.
Then, when I test this, I still get a Array{Float64,1}.
Thanks,
Chris
On Wednesday, May 13, 2015 at 12:05:19 PM UTC-4, Josh Langsfeld wrote:
I believe you only need to add a method to Base.colon of the form
'colon(start
Is your concern that some other package might also export non-mutating
setindex and delete, thereby conflicting with yours? Or just that they
should exist in Base?
On Wednesday, May 13, 2015 at 2:35:44 PM UTC-4, Michael Francis wrote:
I added methods to NamedTuples.jl to support merge, set
I believe you only need to add a method to Base.colon of the form
'colon(start::JDate, step::Real, stop::JDate)'
I just tested it and that was the only thing needed to make the the
[J1:s:J2] syntax work.
On Wednesday, May 13, 2015 at 11:13:53 AM UTC-4, Chris wrote:
I have a simple custom
Or:
maximum([t.tau_max for t in TUnitS])
On Thursday, May 7, 2015 at 12:02:09 PM UTC-4, Darwin Darakananda wrote:
How about :
mapreduce(t - t.tau_max, max, TUnitS)
On Thursday, May 7, 2015 at 8:49:49 AM UTC-7, Michela Di Lullo wrote:
Hello everyone,
I have to compute the maximum
What's the motivation for wanting to restrict calling repack on
non-composite types? 'fieldnames' works fine on them too.
If you want to do a different operation on non-composites, wouldn't you
have to define specialized methods for different type families anyway since
they would all have
I vaguely remember Jeff saying after the tuple update something along the
lines of 'typeof(typeof(x)) == DataType for all x now'. So as Tom
mentioned, there won't be any cases when the not-a-datatype method will be
called.
On Friday, May 1, 2015 at 9:24:59 AM UTC-4, Tamas Papp wrote:
Not
An inferior solution to range() is '(1:N) .+ i'. [without the parens, it's
parsed as 1:(N .+ i) ]
On Wednesday, April 29, 2015 at 10:22:23 AM UTC-4, Sebastian Good wrote:
I find myself creating ranges of the form i:i+num-1. That is, the ith
thing, and num more. Whenever I see a +1 or -1 I
I don't know why it hasn't been mentioned (it was hinted at by Tamas) but
it seems to me the clear solution is for most of Base to actually be moved
into submodules like 'LinAlg'. Then to use those names, people need to call
'using LinAlg' or 'using Sparse', etc... Somebody mentioned how
Turning named functions into methods of a generic function is definitely
something Julia should take maximum advantage of. It does look like it
should work well in the case of 'factorize'. But I think it's a bit
unrelated from the naming convention issue. Most, if not the large
majority, of
To get custom printing of a user-defined type, you only have to overload
the show method:
julia type Pt
x::Int
y::Int
end
julia Pt(1,2)
Pt(1,2)
julia Base.show(io::IO, p::Pt) = print(io, Pt: x=$(p.x), y=$(p.y))
show (generic function with 86 methods)
julia Pt(1,2)
Pt:
Do you know apriori that the minima of f and g are at the same value of
(x,y)? If so, then you can just minimize h(x,y) = f(x,y) + g(x,y). If the
two minimums are located in different points, the problem does not seem
sufficiently well-posed.
On Thursday, April 9, 2015 at 4:19:31 PM UTC-4,
It should be noted that this is an issue with circular dependencies and
isn't specific to Julia at all. Sam's suggestions apply to software
engineering in general, and not just this particular scenario.
On Friday, March 6, 2015 at 5:30:13 PM UTC-5, Kristoffer Carlsson wrote:
If I have a
. Compilation is actually a separate step from using and import
On Tuesday, March 3, 2015 at 11:48:53 AM UTC-5, Josh Langsfeld wrote:
I'm curious about that workaround suggested in the FAQ, where you wrap
the function inside its own module. What is happening under the hood there?
Does
In PyPlot.jl, is there a way to create my figures and render them without a
figure window getting created? My window manager is interfering with the
size hint in the figure() function so it would be nice if I can go straight
to a file.
Thanks,
Josh
. Any idea how I can fix this?
On Wednesday, March 4, 2015 at 11:32:01 AM UTC-5, Josh Langsfeld wrote:
In PyPlot.jl, is there a way to create my figures and render them without
a figure window getting created? My window manager is interfering with the
size hint in the figure() function so
Ok, I got it working by doing pygui(:qt) or pygui(:gtk) before the 'using
PyPlot' call and mentioned in your docs.
I'm not totally clear what 'non-interactive' means for the backend. Working
directly in the REPL, is that not a default setting? And is that what I
ended up changing with either
I believe if all your type fields are concrete (which they are in the case
of Float64), the performance should be the same as using Vector{Float64}.
This is really nice since you get to use code that is much more
understandable like state.x instead of state[1] for no penalty.
And if your state
UTC+10, Josh Langsfeld wrote:
It's discussed in the FAQ so there must be a good reason for it, though
no rationale is mentioned.
http://docs.julialang.org/en/latest/manual/faq/#can-i-use-using-or-import-inside-a-function
On Monday, March 2, 2015 at 3:00:21 PM UTC-5, Patrick O'Leary wrote
It's discussed in the FAQ so there must be a good reason for it, though no
rationale is mentioned.
http://docs.julialang.org/en/latest/manual/faq/#can-i-use-using-or-import-inside-a-function
On Monday, March 2, 2015 at 3:00:21 PM UTC-5, Patrick O'Leary wrote:
On Saturday, February 28, 2015 at
It's equivalent to str = str * def. I believe that's the case for all +=,
*=, etc operators and all types.
On Thursday, February 26, 2015 at 9:23:19 AM UTC-5, Jerry Xiong wrote:
Considering below code:
str=abc
str*=def
Is the new string def just be appended after the memory space of abc,
FYI, transposing currently doesn't work even on built-in arrays because it
also calls transpose on each element as well. So it converts them all to
Array{T,2} and then can't fit them back into a Array{Array{T,1},1}.
On Wednesday, February 25, 2015 at 5:24:29 PM UTC-5, Jeff Bezanson wrote:
Assuming transposing works, you could do [[a,a,a]' ; [a,a,a]'] which isn't
entirely horrible
On Wednesday, February 25, 2015 at 5:50:04 PM UTC-5, Simon Danisch wrote:
Okay... So how do I realize:
a = vec3(...)
[ a a a ; a a a]
Well, all I think is, that arrays of arrays get treated like
something concatenates or
just constructs.
In this case, [b ; b] does indeed always have type Array{eltype(b)} and not
Array{typeof(b)} (unless typeof(b) == Number).
2015-02-26 0:10 GMT+01:00 Josh Langsfeld jdla...@gmail.com:
Assuming transposing works, you could do
(errors)
splice!(data,errors[x])
end
On Monday, February 23, 2015 at 8:17:29 AM UTC, Josh Langsfeld wrote:
corrected_data = deleteat!(x, errors) should be what you're looking for.
Alternately, a more functionally pure way to do it is to compute the good
indices and then just do
corrected_data = deleteat!(x, errors) should be what you're looking for.
Alternately, a more functionally pure way to do it is to compute the good
indices and then just do corrected_data = x[good_idx], though this will
make a copy of those elements of x.
On Sunday, February 22, 2015 at 3:14:11
If your initial knn function has logic that depends on the concrete type of
tree being input, it's a sign you should refactor that logic into separate
methods which are dispatched on by the concrete type. The simplest case of
this would be to just pass that argument during setup to every _knn
I don't see why you are only concerned about the value being negative. The
number itself is completely meaningless since your calculation basically
does the floating-point equivalent of divide zero by infinity. Anything
that comes out can't be remotely trusted.
I think you will need to
of dividing s3 by d.
On Thursday, February 12, 2015 at 10:13:42 AM UTC-5, Josh Langsfeld wrote:
I don't see why you are only concerned about the value being negative. The
number itself is completely meaningless since your calculation basically
does the floating-point equivalent of divide zero
that iterating over variables using symbols would be the thing to
do, but maybe not.
Cheers!
On Monday, February 9, 2015 at 3:27:46 PM UTC-5, Josh Langsfeld wrote:
Here's a macro that just has the effect of combining the code that would
check each variable's length into a short form. It refers
Here's a macro that just has the effect of combining the code that would
check each variable's length into a short form. It refers to the input
variables both by name and value.
macro lencheck(l,vars...)
exprs = Expr[]
for v in vars
sym = string(v)
push!(exprs,:(if
)* to *@eval $(myarg)*, the call prints *10*.
On Sunday, February 8, 2015 at 10:57:43 PM UTC-5, Josh Langsfeld wrote:
At least for why is doesn't work, the eval runs in the scope of the
current module, not in the local scope of the function:
julia myarg = a string
a string
julia f(myarg::Int
At least for why is doesn't work, the eval runs in the scope of the current
module, not in the local scope of the function:
julia myarg = a string
a string
julia f(myarg::Int) = println(eval(:myarg))
f (generic function with 1 method)
julia f(10)
a string
I don't know if there is a way to
For me, option 1 looks the most Julian. Maybe the clunkiness is arising
because the calc object shouldn't be a field of Atoms? Fields are just
suppose to store data, not logic or methods. If a certain subtype of
AbstractAtoms always uses the same calc object, then dispatching just on
the atoms
Sorry, disregard that last sentence which was supposed to have been edited
out.
On Wednesday, February 4, 2015 at 11:46:09 AM UTC-5, Josh Langsfeld wrote:
For me, option 1 looks the most Julian. Maybe the clunkiness is arising
because the calc object shouldn't be a field of Atoms? Fields
On Wed, Feb 4, 2015 at 2:29 PM, Christoph Ortner christophortn...@gmail.com
wrote:
If I read this correctly, then what you are saying is that I am allowed to
assume that my concrete abstract subtypes will contain certain fields, and
if they don't then too bad for them, they need to go and
1 - 100 of 119 matches
Mail list logo