Stefan, your calc looks forward on the data. Typically we want to look
back:
mean(data[max(1, i-period):i])
On Tuesday, February 10, 2015 at 8:59:08 AM UTC-5, Stefan Karpinski wrote:
>
> There's always going to be a loop since that's what the computer is doing.
> Either you wrote it or
to be varying and on the order of 29105550 and 1000
respectively.
On Monday, February 1, 2016 at 1:48:00 PM UTC-5, Yichao Yu wrote:
>
>
> On Feb 1, 2016 1:38 PM, "Bryan Rivera" <future...@gmail.com >
> wrote:
> >
> > Hi Eric,
> >
> > I get 'garba
I figured it out.
Is it ok to use Ref this way?
cfunction(callbackfun, Void, (Ptr{UInt8}, UInt32, Ref{SomeConcreteType}))
I figured this out.
Is using Ref in such a way be acceptable?
cfunction(callbackfun, Void, (Ptr{UInt8}, UInt32, Ref{SomeConcreteType}))
I've seen some enthusiasm about Juno, but I think we might be reinventing
the wheel here.
Atom's approach using web technologies really appeals to me.
It doesn't have all the features of IntelliJ, but it has the potential to.
Hi Eric,
I get 'garbage' results if I don't use Ref.
The number returned may change slightly, but it is way too large. I don't
know if it's a memory address or what.
"the type parameter can simply be replaced with the abstract type itself. "
I believe I was having trouble with this. Could be part of the bug.
t; >
> > Thanks!
> >
> > Chris
> >
> >
> > On Sunday, January 31, 2016 at 4:27:00 AM UTC-5, Bryan Rivera wrote:
> >>
> >> I just realized #13412 has been merged.
> >>
> >> What should this look like now that `Base.
Working on 0.5.0-dev+2422:
julia> type SomeCallBack
z::Int
end
julia> (_::SomeCallBack)(c) = _.z + c
julia> s = SomeCallBack(24)
SomeCallBack(24)
julia> s(10)
34
julia> @code_llvm s(10)
define i64 @julia_SomeCallBack_23730(%jl_value_t*, i64) #0 {
top:
%2 =
For some reason I need to specify Ref{UInt32} instead of just UInt32.
Float64 does not seem to require the same.
Can anyone explain this behavior?
function callbackfun(a::UInt32, b::Float64, c::UInt32)
...
end
cfunction(callbackfun, Void, (Ref{UInt32},Float64,Ref{UInt32}))
typedef
performance guarantees apply. Does that answer your question?
>
> On Thursday, January 21, 2016 at 9:02:50 PM UTC-5, Bryan Rivera wrote:
>>
>> I think what I wrote above might be too complicated, as it is an attempt
>> to solve this problem.
>>
>>
> same performance guarantees apply. Does that answer your question?
>
> On Thursday, January 21, 2016 at 9:02:50 PM UTC-5, Bryan Rivera wrote:
>>
>> I think what I wrote above might be too complicated, as it is an attempt
>> to solve this problem.
>>
>>
I just realized #13412 <https://github.com/JuliaLang/julia/pull/13412> has
been merged.
What should this look like now that `Base.call(...)` is deprecated?
Thinking something like:
(_::SomeCallBack)(c) = _.z + c
On Sunday, January 31, 2016 at 3:47:03 AM UTC-5, Bryan Rivera wrote:
>
Are circular type trees supposed to work?
We can't even join types:
*abstract A*
*abstract B*
*type D <: Union{A, B} # Fail*
*end*
*typealias D Union{A,B}*
*julia> **D <: Union{A,B}*
*true*
*;) thanks*
Whoops. Can I get editing permission for my own posts?
*typealias D Union{A,B}*
*julia> **D <: Union{A,B}*
*true*
*Is this what you meant?*
*So if the example code is a bug, does this mean Julia should have a
recursive type tree?*
Why are these ops causing a segfault?
unsafe_pointer_to_objref( Ptr{UInt32}(1000) )
unsafe_load( Ptr{UInt32}(1000) )
The only reason I am using a pointer is because of a C function call.
When I try to write a test using only Julia, it fails. The load is what I
narrowed it down to.
julia> @code_llvm unsafe_load( Ptr{UInt32}(1000) )
define i32 @julia_unsafe_load_21205(i32*) {
top:
%1 = load i32* %0, align 1
ret i32 %1
}
Does this mean `Ptr{UInt32}(1000)` does not alloc any memory?
What effect does the 1000 have?
Ok, it makes sense now.
Why can't this:
function functionWithPaths(state::State, a::Int, b::Int, onPathA)
if( a > b)
onPathA(a, b)
state.value = a
else
state.value = a + b
end
end
function test()
array = zeros(Int, 100)
onPathA(a, b) = array[a] = b
functionWithPaths(State(0), 10, 20,
Yea, the callback also has its issues.
Will those new lambdas be in 0.5? I thought they were already available in
0.5dev.
I can hardly wait.
Is it just me, or is this something long overdue for Julia? (don't get me
wrong, I know time is precious)
Good to know, this is quite a core issue. I see performant lambda's as a
must.
Next would be to have C++ like options for how local vars are handled. We
should be able to negate some options with intelligent compilation.
Those Python vs. Julia benchmarks are about to get a whole lot faster
I don't know what your exact use case is, but you should't be using macros
like that.
Does @inline g() suit your purposes?
If not, I recommend making your example a bit more pertinent to what you
want accomplished.
On Friday, January 22, 2016 at 3:43:10 PM UTC-5, ami...@gmail.com wrote:
>
>
gt; the
> > > spacial overhead of storing multiple functions.
> > >
> > > Can we be greedy? :)
> > >
> > > On Thursday, January 21, 2016 at 9:56:51 PM UTC-5, Cedric St-Jean
> wrote:
> > >> Something like this?
> > >>
It doesn't look like I can edit my posts anymore. Is that normal?
I have to cleanup the copied OP.
I tried to mitigate that by not timing the code where @anon is called. Is
that still the case given the two snippets?
I tried to mitigate that by not timing the code where @anon is called. Is
that still the case given the two snippets?
On Friday, January 22, 2016 at 2:15:20 PM UTC-5, Tim Holy wrote:
>
> On Friday, January 22, 2016 10:21:31 AM Bryan Rivera wrote:
> > For 1000 elements:
> >
Yea those were averages of 5 runs each, minus the first for JIT.
On Friday, January 22, 2016 at 1:24:00 PM UTC-5, Stefan Karpinski wrote:
>
> Make sure you time it twice – the faster version may generate more code.
>
> On Fri, Jan 22, 2016 at 1:21 PM, Bryan Rivera <future...@gmail
Hopefully you can help me out with this.
I left out function implementations that we should't need to see. This
part of the code I think seems ok:
abstract Intervalizer{Time <: Integer, Value <: Union{AbstractFloat, Integer
}}
type StreamingIntervalizer{Time, Value} <: Intervalizer{Time,
I think I almost got it - just need to figure out how to inject
onCompletedInterval with the proper vars in macro.
macro gen_intervalize(onCompletedInterval)
return quote
if(isNextInterval(i.intervalState, time))
onCompletedInterval(getCurrentIntervalTime(i.intervalState), i.
You are on the potentially unstable dev branch 0.5.
Try 0.4 instead.
You should probably file this as an issue on Julia's github.
On Friday, January 22, 2016 at 7:32:55 AM UTC-5, Lutfullah Tomak wrote:
>
> I have a julia script that runs IJulia
> as
>
> #!/bin/sh
> julia -e "using IJulia;
Thanks for the responses guys.
@Mauro Hopefully I'm approved soon :)
@Viral Makes sense, looks like it works.
@Kevin This is the only email I've used to post here. It might be another
Bryan.
. My feeling is that .call
> overloading is not to be abused in Julia, so I would favor using a regular
> function call with a descriptive name instead of call overloading, but the
> same performance guarantees apply. Does that answer your question?
>
> On Thursday, Januar
The goal is to remove all overhead associated with using Nullable, since we
know at compile time what path (in the if branch) will result in None vs
Some. Since we know this, we can simply inject `function2` into
`function1`. However, we have an issue that `function2 ` requires the
variable
I think what I wrote above might be too complicated, as it is an attempt to
solve this problem.
In essence this is what I want:
function function1(a, b, onGreaterThanCallback)
if(a > b)
c = a + b
res = onGreaterThanCallback(c, z)
return res + 1
else
# do anything
#
Guys, it's killing me having to wait hours until my posts are approved.
(Ability to edit would be nice as well.. Although it looks like I can edit
all of my posts save for the original.)
What must be done to overcome this limit?
ple dispatch. However you can
>> do something like:
>>
>> type Wallet
>> dotTest::Function
>> end
>>
>> Which might have ambiguous performance impact.
>> On Jan 17, 2016 12:45 PM, "Bryan Rivera" <futurehori...@gmail.com&g
Looks to me like the compiler is smart enough to see there is no use for
blah, and therefore removes it from final output.
I have seen some code out in the wild that allows us to use dot syntax like
so:
function dotTest!(wallet::Wallet, valueToAdd::Int):
...
end
wallet = Wallet(100)
wallet.dotTest!(5) # Does not work
dotTest!(wallet, 5) # Works
However I cannot get it to work, the method is not found
This works on El Capitan:
sudo nano /etc/paths
Add this line to end of file:
/Applications/Julia-0.4.2.app/Contents/Resources/julia/bin
Ctrl-O then enter to save.
42 matches
Mail list logo