Use `enumerate`:
julia> a = [1,3,5,8]
julia> b = [1,2,5,7]
julia> intersect(enumerate(a), enumerate(b))
2-element Array{Tuple{Int64,Int64},1}:
(1,1)
(3,5)
On July 5, 2016 at 13:20:15, siyu song (siyuphs...@gmail.com) wrote:
Good to know this method. Thanks a lot.
在 2016年7月6日星期三
I've got ODBC.jl set up to retrieve a couple of queries. This works, but it
is returning a DataFrame with column eltypes of Nullable{Int64},
Nullable{Dec64}, etc. I'd like to convert the numeric element types to
Float64 for use in my analysis (which was written based on reading .csv's
of the
Wait until next year. I can't present on Julia codes there until they're
published (adviser's rules). I think in general that would apply a to a lot
of people: started getting involved during v0.3, did a project in v0.4
which is now submitted, but won't be out there to present until next year.
Julia Computing sponsored the bags. Though I was surprised there was no
booth..
On Tuesday, July 12, 2016 at 9:33:49 AM UTC+10, Xiangxi Gao wrote:
>
> So I am crashing the SIAM annual conference held at the Boston Westin
> Hotel this year from 7/11 to 7/15 and noticed a lot of Mathworks folks
On Thu, Jul 21, 2016 at 7:03 PM, wrote:
>
>
> How can I get ylim when using PyPlot? I tried all the suggestions I found on
> stackoverflow. None of them works, e.g. get_ylim(). Here is the error:
>
> ERROR: LoadError: UndefVarError: get_ylim not defined
>
> Can anyone give
On Thu, Jul 21, 2016 at 7:02 PM, Marius Millea wrote:
>
>
> On Thu, Jul 21, 2016 at 11:37 PM, Cedric St-Jean
> wrote:
>>
>> Neat macro.
>>
>>>
>>> For this though, my macro needs to somehow figure out that "inc" was also
>>> defined with @self
How can I get ylim when using PyPlot? I tried all the suggestions I found
on stackoverflow. None of them works, e.g. get_ylim(). Here is the error:
ERROR: LoadError: UndefVarError: get_ylim not defined
Can anyone give me an example of getting the current ylim? Thanks!!
On Thu, Jul 21, 2016 at 11:37 PM, Cedric St-Jean
wrote:
> Neat macro.
>
>
>> For this though, my macro needs to somehow figure out that "inc" was also
>> defined with @self (since it shouldn't blindly add self as a first arg so
>> other non-@self'ed function calls). Is
and also compare (note the @sync)
@time @sync @parallel for i in 1:10
sleep(1)
end
Also note that using reduction with @parallel will also wait:
z = @parallel (*) for i = 1:n
A
end
On Friday, July 22, 2016 at 3:11:15 AM UTC+10, Kristoffer Carlsson wrote:
>
>
> julia> @time for i in
Hello,
I'm trying to continue the discussion of
https://github.com/JuliaLang/julia/issues/15479
julia> run(pipeline(IOBuffer("a xyz b"), `grep xyz`))
ERROR: MethodError: `uvtype` has no method matching
uvtype(::Base.AbstractIOBuffer{Array{UInt8,1}})
in _jl_spawn at process.jl:253
in
Ah, ok, so I can just safely ignore it! Thanks, David
> -Original Message-
> From: julia-users@googlegroups.com [mailto:julia-
> us...@googlegroups.com] On Behalf Of Yichao Yu
> Sent: Thursday, July 21, 2016 2:40 PM
> To: Julia Users
> Subject: Re:
On Thu, Jul 21, 2016 at 5:33 PM, David Anthoff wrote:
> Thanks everyone for the answers!
>
> I guess Tim's email in particular means that the presence of box might
> indicate a problem, or not ;)
Base.box in the ast doesn't indicate a problem. Any type instability
should be
Neat macro.
> For this though, my macro needs to somehow figure out that "inc" was also
> defined with @self (since it shouldn't blindly add self as a first arg so
> other non-@self'ed function calls). Is this possible in Julia?
>
You could have a global Set that would contain the names of
fill_W1! allocates memory because it makes copies when constructing the
right hand sides. fill_W2 allocates memory in order to construct the
comprehensions (that you then discard). In both cases memory allocation
could plausibly be avoided by a sufficiently smart compiler, but until
Julia
Thanks everyone for the answers!
I guess Tim's email in particular means that the presence of box might
indicate a problem, or not ;)
I guess it would be nice if there was some (easy) way to figure out whether
things get boxed or not, apart from looking at the assembler/llvm code.
>
Hi Todd,
First, congratulations to @acc team for the great job!
We are implementing a new version of CloudArray
(https://github.com/gsd-ufal/CloudArray.jl) by using
Parallel.Accelerator.jl. We are implementing a cloud service for processing
fully PolSAR images, real PolSAR images from NASA
Thanks!
El jueves, 21 de julio de 2016, 17:26:09 (UTC+2), Viral Shah escribió:
>
> Both these tutorials are up now. The others seem are there.
>
> -viral
>
> On Sunday, July 17, 2016 at 1:00:17 AM UTC-4, Tony Kelman wrote:
>>
>> I don't see the tutorial that David Sanders gave, or the one that I
thanks, I think I found the problem -- my float() function should force
Float64
On Thursday, July 21, 2016 at 4:36:53 PM UTC-4, Jeffrey Sarnoff wrote:
>
> I thought I could specialize fix_dec(), the catchall is something like
> `fix_dec(x::AbstractFloat, n::Int)` and I had intended to define
Yes, it works. Thank you so much for your help!
On Thursday, July 21, 2016 at 4:11:24 PM UTC-4, Gabriel Gellner wrote:
>
> Can you just cast the array to Float64 or whatever numeric type you need
> to column to be?
>
> On Thursday, July 21, 2016 at 9:50:14 AM UTC-7, Ping Hou wrote:
>>
>> Hi,
>>
I thought I could specialize fix_dec(), the catchall is something like
`fix_dec(x::AbstractFloat, n::Int)` and I had intended to define
`fix_dec{P}(x::ArbFloat{P}, n::Int)`.
On Thursday, July 21, 2016 at 4:31:37 PM UTC-4, Yichao Yu wrote:
>
> On Thu, Jul 21, 2016 at 3:42 PM, Jeffrey Sarnoff
>
On Thu, Jul 21, 2016 at 4:01 PM, Marius Millea wrote:
> In an attempt to make some numerical code (ie something thats basically just
> a bunch of equations) more readable, I am trying to write a macro that lets
> me write the code more succinctly. The code uses parameters
On Thu, Jul 21, 2016 at 3:42 PM, Jeffrey Sarnoff
wrote:
> I got this error
> ERROR: StackOverflowError:
> in fix_dec(::ArbFloats.ArbFloat{116}, ::Int64) at ./printf.jl:932 (repeats
> 8 times)
>
>
> I tried to import Base.fix_dec, Core.fix_dec to override the
Can you just cast the array to Float64 or whatever numeric type you need to
column to be?
On Thursday, July 21, 2016 at 9:50:14 AM UTC-7, Ping Hou wrote:
>
> Hi,
>
> I encountered a problem when I running my code.
>
> LoadError: MethodError: `abs` has no method matching abs(::Array{Any,1})
>
In an attempt to make some numerical code (ie something thats basically
just a bunch of equations) more readable, I am trying to write a macro that
lets me write the code more succinctly. The code uses parameters from some
data structure, call it "mytype", so its littered with "t.a", "t.b",
I got this error
ERROR: StackOverflowError:
in fix_dec(::ArbFloats.ArbFloat{116}, ::Int64) at ./printf.jl:932 (repeats
8 times)
I tried to import Base.fix_dec, Core.fix_dec to override the definition --
neither worked.
Discussion: https://github.com/JuliaLang/julia/issues/12441
On Thursday, July 21, 2016 at 2:49:19 PM UTC-4, gTcV wrote:
>
> I recently frequently encounter the situation where I need to both copy as
> well as optionally convert an object. It turns out `convert` on its own
> will not do the job
It's a little unclear what you want to do that you can't figure out how to
accomplish. You can allocate an uninitialized vector of ExampleEvent
objects:
julia> type ExampleEvent
fld1::ASCIIString
fld2::Int16
fld3::Int64
fld4::Int64
Hi Yared,
The error you are getting is something LibCURL is erring on, as described
here. https://curl.haxx.se/libcurl/c/libcurl-errors.html
If I try using curl with your settings, I get
~ $ curl -u anonymous '192.168.251.200/dataOnFTP.bin'
Enter host password for user 'anonymous':
curl: (7)
Hi
I was working on processing large data sets & historically I've used
structs in C++ & other languages for this type of task. I attempted to use
a Composite Type in Julia & preallocate a large array before filling it
w/values as my algo processes the data.
My example was:
type
I recently frequently encounter the situation where I need to both copy as
well as optionally convert an object. It turns out `convert` on its own
will not do the job in this case as it doesn't create a copy if the
conversion is trivial:
julia> v = Vector{Int}();
julia>
Another quick solution is to just create an array/tuple that PyPlot will
recognize as an RGB array/tuple:
myColors = distinguishable_colors(N)
PyPlot_myColors = [[red(i), green(i), blue(i)] for i in myColors]
You can also save yourself the time from needing to call the new color
scheme for every
Yes, true, I just copied it so that I knew what character it was.
julia> @time for i in 1:10
sleep(1)
end
10.054067 seconds (60 allocations: 3.594 KB)
julia> @time @parallel for i in 1:10
sleep(1)
end
0.195556 seconds (28.91 k allocations: 1.302 MB)
1-element Array{Future,1}:
Future(1,1,8,#NULL)
On Thursday, July
in Jupyer notebook, add processors with addprocs(N)
On Thursday, 21 July 2016 12:59:02 UTC-4, Nathan Smith wrote:
>
> To be clear, you need to compare the final 'z' not the final 'A' to check
> if your calculations are consistent. The matrix A does not change through
> out this calculation,
To be clear, you need to compare the final 'z' not the final 'A' to check
if your calculations are consistent. The matrix A does not change through
out this calculation, but the matrix z does.
Also, there is no parallelism with the @parallel loop unless your start
julia with 'julia -np N' where
Nevermind. You have a non-zero probability of having zero offspring since
it's Poisson. This works if every element is at least 1. However, you can
have the population size decrease, which then causes errors if you resize
first. But then you still want to put the new elements in the first n
Nathan,
the execution of these two functions gives essentially the same timings, no
matter of many processes I have added with addprocs()
Very surprising to me...
Of course I prefer the speeded-up version :)
Best,
Ferran.
On Thursday, July 21, 2016 at 6:40:14 PM UTC+2, Nathan Smith wrote:
>
>
The output format isn't intended to be valid input format in either version
of Julia, e.g. on 0.4:
julia> 2x3
ERROR: UndefVarError: x3 not defined
in eval(::Module, ::Any) at ./boot.jl:234
in macro expansion at ./REPL.jl:92 [inlined]
in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at
(I'm just untangling some confusion on my end. Is the following correct?)
In 0.4, array dimensions were printed like this:
julia> zeros(2,3)
2x3 Array{Float64,2}:
0.0 0.0 0.0
0.0 0.0 0.0
In 0.5, the "x" is replaced with a "×":
julia> zeros(2,3)
2×3
Hi Nathan,
I posted the codes, so you can check if they do the same thing or not.
These went to separate cells in Jupyter, nothing more and nothing less.
Not even a single line I didn't post. And yes I understand your line of
reasoning, so that's why I got astonished also.
But I can see what is
I posted this because I also find the results... astonishingly surprising.
Howeverm the timings are apparently real, as the first one took more than
1.5mins on my wrist watch, and the second calculation was instantly.
And no, no function wrapping whatsoever...
On Thursday, July 21, 2016 at
Try comparing these two function:
function serial_example()
A = [[1.0 1.001];[1.002 1.003]
z = A
for i in 1:10
z *= A
end
return z
end
function parallel_example()
A = [[1.0 1.001]; [1.002 1.003]]
z = @parallel (*) for i in 1:10
A
Hey Ferran,
You should be suspicious when your apparent speed up surpasses the level of
parallelism available on your CPU. I looks like your codes don't actually
compute the same thing.
I'm assuming you're trying to compute the matrix exponential of A
(A^10) by repeatedly multiplying
I wouldn't expect that much of a change unless you have a whole lot of
cores (even then, wouldn't expect this much of a change).
Is this wrapped in a function when you're timing it?
On Thursday, July 21, 2016 at 9:00:47 AM UTC-7, Ferran Mazzanti wrote:
>
> Hi,
>
> mostly showing my
Hi,
mostly showing my astonishment, but I can even understand the figures in
this stupid parallelization code
A = [[1.0 1.0001];[1.0002 1.0003]]
z = A
tic()
for i in 1:10
z *= A
end
toc()
A
produces
elapsed time: 105.458639263 seconds
2x2 Array{Float64,2}:
1.0 1.0001
1.0002
I see it now. Sum the elements to resize the array, and then loop through
backwards adding the values (so that way you don't overwrite what
you haven't used).
On Thursday, July 21, 2016 at 8:34:11 AM UTC-7, Kristoffer Carlsson wrote:
>
> Sum the elements and resize the array to that length?
Cached...
Sometimes the badge image is cashed and can be quite hard to update. Ctrl + F5
sometimes work.
You can change line 70 to be in place with a loop:
for i in 1:length(x)
x[i] = x[i] + deltax[i]
end
I don't think you can do
x[:] =x .+deltax
as fancy syntax here since the x is part of the statement though (you can
check). This should cut out an allocation here and bring down the time.
Sum the elements and resize the array to that length?
Both these tutorials are up now. The others seem are there.
-viral
On Sunday, July 17, 2016 at 1:00:17 AM UTC-4, Tony Kelman wrote:
>
> I don't see the tutorial that David Sanders gave, or the one that I gave.
> Might be others missing too?
I doubt we are going to be able to do much at this point. Andreas and I are
checking with the video person, but not looking promising on this front.
-viral
On Tuesday, July 19, 2016 at 1:39:40 AM UTC-4, Christian Peel wrote:
>
> I saw quite a few videos with the same problem.
>
> On Mon, Jul
Hi Islam,
Thanks for your input
I was able to find all windowing functions; however, there is nothing
about PSD ( power spectral density). In python and matlab, there is
function pwelch which does both windowing and FFT and wondering if there is
the same function in Julia.
Here is simple
Let me explain. The easy place to add an in-place operation with resize!
would be with the RNG call, rpois. I used resize! to make the Poisson RNG
go a little faster. It's now:
function rpois!(n::Int,p::Vector{Float64},out::Vector{Int})
resize!(out,n)
for i in 1:n
@inbounds
Odd; refresh on Chrome wasn't refreshing properly. Fancy looking at my code
speed question ;) ?
On Thursday, July 21, 2016 at 3:49:01 PM UTC+1, Chris Rackauckas wrote:
>
> Click refresh when you're on the repo readme? It updated on my screen,
> refresh to make sure you're not displaying the
I'm a new user, so have mercy in your responses.
I've written a method that takes a matrix and vector as input and then
fills in column icol of that matrix with the vector of given values that
have been shifted upward by ishift indices with periodic boundary
conditions. To make this clear,
Dear All,
I'm having some issues with code speed for some Gillespie type simulations.
The toy model is described here:
http://phylodynamics.blogspot.co.uk/2013/06/comparing-performance-of-r-and-rcpp-for.html
http://phylodynamics.blogspot.co.uk/2013/06/an-sir-model-in-julia.html
I get good
Click refresh when you're on the repo readme? It updated on my screen,
refresh to make sure you're not displaying the site from cache.
On Thursday, July 21, 2016 at 7:41:47 AM UTC-7, Simon Frost wrote:
>
> Dear Chris,
>
> Yes, I am an idiot ;)
>
> Any idea why the badge isn't updating?
>
> Best
Dear Chris,
Yes, I am an idiot ;)
Any idea why the badge isn't updating?
Best
Simon
On Thursday, July 21, 2016 at 9:06:51 AM UTC+1, Chris Rackauckas wrote:
>
> Look at the files it's trying to cover... it's DataFrames.jl :)
>
> I sent you a pull request to fix your travis.yml to be for your
I had the same thought. Could just make a new AbstractArray which keeps a
larger array and tracks the current usage. I bet it's 10 lines of code to
make it generic.
On Thursday, July 21, 2016, Christoph Ortner
wrote:
>
> feels like one may want a little auxiliary
I believe what you want is the constant `PROGRAM_FILE`.
http://julia.readthedocs.io/en/latest/stdlib/constants/#Base.PROGRAM_FILE
I using a script written in Julia, called with the shebang line
#!/usr/bin/env julia
Now I would like to have symlinks of a different name to the script, and
have it perform slighly different tasks depending on which name was
used. In Bash, I would use $0, is there something equivalent in Julia?
feels like one may want a little auxiliary package that can make available
small chunks from a long pre-allocated vector.
On Thursday, 21 July 2016 10:37:12 UTC+1, Chris Rackauckas wrote:
>
> Maybe. I thought about that, but I don't think that satisfies the "elegant
> and compactness"
Maybe. I thought about that, but I don't think that satisfies the "elegant
and compactness" requirement, unless there's an easy way to do the growing
without too much extra code hanging around.
On Thursday, July 21, 2016 at 1:54:10 AM UTC-7, Christoph Ortner wrote:
>
> could still preallocate
could still preallocate and grow as needed?
On Thursday, 21 July 2016 02:48:58 UTC+1, Chris Rackauckas wrote:
>
> Most of the arrays are changing size each time though, since they
> represent a population which changes each timestep.
>
> On Wednesday, July 20, 2016 at 6:47:39 PM UTC-7, Steven G.
Look at the files it's trying to cover... it's DataFrames.jl :)
I sent you a pull request to fix your travis.yml to be for your package.
On Thursday, July 21, 2016 at 12:16:35 AM UTC-7, Simon Frost wrote:
>
> Dear All,
>
> I'm trying to get code coverage working, but despite having some tests -
Dear All,
I'm trying to get code coverage working, but despite having some tests - at
the moment, just running examples - I get 0% coverage
http://github.com/sdwfrost/Gillespie.jl
Is this because I'm just using 'include' in runtests.jl?
Best
Simon
67 matches
Mail list logo