[julia-users] Please help me understand comprehensions for creating an array

2015-10-26 Thread Ferran Mazzanti
Hi folks, I try to create an array of constant float64 values. Something I did was: a = 0.8; Nb = 100; p = zeros(Nb) for i in 1:Nb p[i] = a/Nb end and typeof(p) returns Array{Float64,1} so far, so good :) But now I do the following instead to shorten things: a = 0.8; Nb = 100; p = [ a/Nb for

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread Kristoffer Carlsson
Read here: https://github.com/stevengj/PyCall.jl#usage More specifically, this section: "The biggest diffence from Python is that object attributes/members are accessed with o[:attribute]rather than o.attribute, and you use get(o, key) rather than o[key]. (This is because Julia does not

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread Simon Danisch
This is not wanted but expected behavior, since type inference of non constant globals doesn't work very well (since the type can change unpredictable). Two fixes: put your code in a function, or declare a and Nb as const. This is directly related:

Re: [julia-users] functions on iterable types

2015-10-26 Thread DNF
Hmm. Trying to answer myself: I guess my suggested solution would miss functions that don't specify the type, but just rely on the iterable behaviour. On Monday, October 26, 2015 at 6:53:03 AM UTC+1, DNF wrote: > > I may be missing something, but what about using the TypeTrees module to >

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread Kristoffer Carlsson
Change last line to: h = PyPlot.plt[:hist](x,nbins) On Monday, October 26, 2015 at 11:28:35 AM UTC+1, Ferran Mazzanti wrote: > > Hi folks, > > using Linux Mint 17.1 here. I upgraded to julia 0.4.0 and now this simple > code, taken from the web and tested on previous versions, > > using PyPlot

Re: [julia-users] DataFrame type specification

2015-10-26 Thread Andrew Gibb
That worked. Thanks.

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread Ferran Mazzanti
That worked, thanks :) But this syntax I can not understand... where can I find documentation about how to do that? Just to avoid asking agains cuh kind of questions... Thanks again. On Monday, October 26, 2015 at 11:31:59 AM UTC+1, Kristoffer Carlsson wrote: > > Change last line to: > > h =

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread Kristoffer Carlsson
You can also rewrite it as p = Float64[ a/Nb for i in 1:Nb] On Monday, October 26, 2015 at 12:08:33 PM UTC+1, Simon Danisch wrote: > > This is not wanted but expected behavior, since type inference of non > constant globals doesn't work very well (since the type can change > unpredictable). >

Re: [julia-users] functions on iterable types

2015-10-26 Thread DNF
I must admit I don't understand very well what snippet is supposed to do. But, for example, it doesn't work for :sum or :maximum or anything like that. On Monday, October 26, 2015 at 9:23:35 AM UTC+1, harven wrote: > > > > Le lundi 26 octobre 2015 07:15:56 UTC+1, DNF a écrit : >> >> Hmm. Trying

[julia-users] PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread Ferran Mazzanti
Hi folks, using Linux Mint 17.1 here. I upgraded to julia 0.4.0 and now this simple code, taken from the web and tested on previous versions, using PyPlot x = randn(1000) # Values nbins = 50 # Number of bins fig = figure("pyplot_histogram",figsize=(6,6)) # Not strictly required ax = axes() #

Re: [julia-users] functions on iterable types

2015-10-26 Thread harven
Le lundi 26 octobre 2015 07:15:56 UTC+1, DNF a écrit : > > Hmm. Trying to answer myself: I guess my suggested solution would miss > functions that don't specify the type, but just rely on the iterable > behaviour. > > It is easy to get the list of thunks that work on iterables. type

Re: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread Stefan Karpinski
On Mon, Oct 26, 2015 at 2:17 PM, Christoph Ortner < christophortn...@gmail.com> wrote: > Fabian - Many thanks for your comments. This was very helpful. > > (c) if I want to write code now that shouldn't break with 0.5, what should >> I do? >> > > I think when you need a copy, just surround your

[julia-users] low rank matrix-vector multiplication and order of operations

2015-10-26 Thread Michael Lindon
I have a somewhat large matrix-vector product to calculate, where the matrix is not full rank. I can perform a low rank factorization of the nxn Matrix M as M=LL' where L is nxp. I'd like to use this information to speed up the computation. Here is a minimal example: x=rand(1,100)

[julia-users] WinRPM Download failure

2015-10-26 Thread Achu
I got this when I ran Pkg.update() and also on WinRPM.update() INFO: Building WinRPM INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml WARNING: Unknown download failure, error code: 2148270086 WARNING:

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-26 Thread Scott Jones
>One possible naming scheme could be to follow the example of Int and Integer and have Vec, Mat, Arr be the concrete types and Vector, Matrix and Array be the abstract types. I'm really not sure this would be worth the trouble at this point or if we really want the AbstractArray names to be

[julia-users] deserialize error with closured array of functions

2015-10-26 Thread Александр Кольцов
About my problem. Code: ... p = _belineInterpolateGrid(map(t -> sin( norm(t) ), grid), grid) serialize(open("/data/test.function", "w"), p) p0 = deserialize(open("/data/test.function", "r")) >> ERROR: MethodError: `convert` has no method matching convert(::Type{LambdaStaticData}, ::Array{Any,1})

[julia-users] Re: Help on optimization problem

2015-10-26 Thread Vincent Zoonekynd
It is also similar to (metric) multi-dimensional scaling (MDS): the problem of finding coordinates that best explain a distance matrix (it is often a full matrix, but most of the algorithms should also work with a partial one). Your approximate coordinates would be used as an initial guess for

[julia-users] Re: WinRPM Download failure

2015-10-26 Thread Tony Kelman
Pretty sure I tagged that change as soon as I noticed the 13.1 downloads stopped working. You likely need to Pkg.update(), be sure you don't have local modifications preventing the winrpm package from updating, then restart julia and do Pkg.build()

[julia-users] Re: A grateful scientist

2015-10-26 Thread Christopher Fisher
I work with mathematical models of cognition and switched to Julia from Matlab about a year and a half ago. Aside from the debugger (step,step in, etc.), I don't miss Matlab all. Once the statistical packages mature, I'll phase out R too. I think the language is shaping up quite well and the

Re: [julia-users] A grateful scientist

2015-10-26 Thread Yakir Gagnon
Thanks Scott T! On Monday, October 26, 2015 at 11:16:05 PM UTC+10, Scott T wrote: > > (Oh and Yakir, your work sounds like one of the coolest interdisciplinary > mixes I could possibly think of.) > > On Monday, 26 October 2015 13:11:47 UTC, Scott T wrote: >> >> I'll add my voice to say thanks

[julia-users] low rank matrix-vector multiplication and order of operations

2015-10-26 Thread Kristoffer Carlsson
With parenthesis you never do a matrix matrix multiplication.

[julia-users] Re: JuliaBox limitations on parallel computing

2015-10-26 Thread André Lage
Hi, I'll be giving a hands-on tutorial on Julia next week. I expect about 30 people in 6th November, from 12h30 to 16h (UTC-3), to use IJulia notebook sessions to learn Julia and run some simple parallel code with few Workers. Would it be a problem? Thanks, André Lage. On Sunday, October

[julia-users] use of @generated for specializing on functions

2015-10-26 Thread Alireza Nejati
Hi all, I was wondering if this is a julian use of the @generated macro: type Functor{Symbol} end # A simple general product-sum operator; # returns a[1]⊙b[1] ⊕ a[2]⊙b[2] ⊕ ... @generated function dot{⊕,⊙,T}(::Type{Functor{⊕}}, ::Type{Functor{⊙}}, a::Array{T}, b::Array{T}) return quote

[julia-users] Re: use of @generated for specializing on functions

2015-10-26 Thread Alireza Nejati
I missed a word in there. Meant to say, "runs at the same speed as hard-coding the * and + functions". Anyway, I wanted to know if there's a better way of doing something similar without using the @generated macro.

[julia-users] For loop = or in?

2015-10-26 Thread FANG Colin
Hi All I have got a stupid question: Are there any difference in "for i in 1:5" and "for i = 1:5"? Does the julia community prefer one to the other? I see use of both in the documentations and source code. Personally I haven't seen much use of "for i = 1:5" in other languages. Thanks.

[julia-users] GUI applications with Julia

2015-10-26 Thread Piotr W
Hi, I consider use of Julia in my project. I have a low experience in programming in the "classical" meaning, but I have some experience in programming in Mathcad. Now I would like to rewrite the algorithm I have developed in Mathcad and create an application with GUI. My question is if Julia

[julia-users] alternate LISP integration ...

2015-10-26 Thread cdm
i have recently consumed an element of the video content emanating from the S.L. StrangeLoop ... "Pixie - A Lightweight Lisp with 'Magical' Powers" by Timothy Baldridge https://www.youtube.com/watch?v=1AjhFZVfB9c curious to see if anyone

[julia-users] julia style to resize array with initialization?

2015-10-26 Thread Cameron McBride
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] = 0.0 end vec[i] += v end This seems somewhat typical for a growing array that's not just incremental (i.e. not just a push!()

Re: [julia-users] use of @generated for specializing on functions

2015-10-26 Thread Yichao Yu
On Mon, Oct 26, 2015 at 4:27 PM, Alireza Nejati wrote: > Hi all, > > I was wondering if this is a julian use of the @generated macro: > > type Functor{Symbol} end > > # A simple general product-sum operator; > # returns a[1]⊙b[1] ⊕ a[2]⊙b[2] ⊕ ... > @generated function

[julia-users] Re: alternate LISP integration ...

2015-10-26 Thread cdm
somewhat related ... is it still possible to get the femtolisp REPL in the post v0.4.0 world ... ? thanks, cdm

[julia-users] Re: A grateful scientist

2015-10-26 Thread Alireza Nejati
I've been coding in julia so much lately that I actually think my brain might be forgetting the other languages I used to know! On Monday, October 26, 2015 at 4:30:26 PM UTC+13, Yakir Gagnon wrote: > > Hi Julia community and developers, > I'm a postdoc researching color vision, biological

[julia-users] Re: use of @generated for specializing on functions

2015-10-26 Thread Alireza Nejati
I didn't know there was already a discussion going on this. Thanks for the links. My goal here isn't to replace Dot{} but rather to figure out what the most julian way of doing this would be. Thanks again though.

[julia-users] Using Juno/LT to run Julia Code, Error, `getindex` has no method matching getindex(::DataFrame, ::ASCIIString

2015-10-26 Thread aarond
As you can see in the screen shot below this is the chunk of code I am trying to run. Error seems to occur with the `getindex` and it seems to be related to the line of code: for (index, idImage) in enumerate(labelsInfoTrain["ID"], as both are highlighted in pink, Very confused how to fix,

[julia-users] Pkg.add("DecisionTree") getting error, failed pocess: Process(`git ' --worktree = C:\Users.....

2015-10-26 Thread aarond
Hi I am running my Julia code in Juno/LT. I am trying to add the decision tree package but I am getting a major error seen in the screenshot below. Any help would be much appreciated.

[julia-users] Re: WinRPM Download failure

2015-10-26 Thread Christopher Alexander
I'm not sure if they've tagged their latest version of master, but the change is in there: https://github.com/JuliaLang/WinRPM.jl/commit/cb12a4136e9afb2a158ff888bc8ea81d3e72e619 Basically the openSUSE_13.1 needs to be openSUSE_13.2 in the url. I had this problem like last week and I just

Re: [julia-users] A grateful scientist

2015-10-26 Thread Gabriel Gellner
Seriously +9000 to this sentiment. I am new to Julia but man what this community has made is incredible. The beauty of this project staggers me. Not having to mess around with C for a large chunk of my new codes inner loops feels like magic every time. Thank you all so much. Gabriel On

Re: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread Christoph Ortner
Hi Stefan, Many thanks for the clarifications. Just for the record: I've often complained about the changes to Julia since 0.2, but this is one that I am more on the fence about. Christoph

[julia-users] Re: alternate LISP integration ...

2015-10-26 Thread cdm
sorry to have left off the repo link: https://github.com/pixie-lang/pixie

[julia-users] low rank matrix-vector multiplication and order of operations

2015-10-26 Thread Kristoffer Carlsson
See for example https://en.m.wikipedia.org/wiki/Matrix_chain_multiplication

[julia-users] Re: julia style to resize array with initialization?

2015-10-26 Thread Josh Langsfeld
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] =

[julia-users] Re: For loop = or in?

2015-10-26 Thread Alireza Nejati
There is no difference, as far as I know. '=' seems to be used more for explicit ranges (i = 1:5) and 'in' seems to be used more for variables (i in mylist). But using 'in' for everything is ok too. The '=' is there for familiarity with matlab. Remember that julia's syntax was in part

[julia-users] Re: parallel and PyCall

2015-10-26 Thread Yakir Gagnon
Yea, right? So what’s the answer? How can we if at all do any PyCalls parallely? On Monday, October 26, 2015 at 11:49:35 PM UTC+10, Matthew Pearce wrote: Thought I had an idea about this, I was wrong: > > ```julia > > julia> @everywhere using PyCall > > julia> @everywhere @pyimport pylab > >

[julia-users] Dear @sprintf, you shouldn't do this

2015-10-26 Thread J Luis
It took me a while to figure out why it was erroring Given this piece of a script @show(sampr1, sampr2) @show(typeof(sampr1), typeof(sampr2)) @show(@sprintf("-T%d/%d/1", sampr1[1], sampr2[1])) it error ed with an incomprehensible error sampr1 = [-1167.0] sampr2 = [1169.0] typeof(sampr1) =

[julia-users] Re: Dear @sprintf, you shouldn't do this

2015-10-26 Thread J Luis
Update. It turned out that the error was still different. Further down the script I had another similar line t = gmt(@sprintf("filter1d -Fm1 -T%d/%d/1 -E", sampr1, sampr2), ship_pg) and was this line that was causing the error (because 'sampr1, sampr2' was not accepted, only sampr1[1],

[julia-users] Re: WinRPM Download failure

2015-10-26 Thread Avik Sengupta
Yes, this has been tagged. However, in this update, the source URL's have changed, but they wont take effect till Julia is restarted (if WinRPM has been loaded in that session prior to the update). Regards - Avik On Monday, 26 October 2015 20:38:49 UTC, Tony Kelman wrote: > > Pretty sure I

[julia-users] Re: Interest in a Seattle-Area Julia Meetup?

2015-10-26 Thread lewis
Happy also to join. On Monday, October 19, 2015 at 8:47:06 PM UTC-7, Daniel Jones wrote: > > Count me in! I'm happy to present something as well. I know of a few Julia > users at UW, not all of whom are necessarily on github, so I suspect > there'd be more than 9 people interested. > > > On

[julia-users] Re: WinRPM Download failure

2015-10-26 Thread Tony Kelman
I don't expect the default source urls to change more than once every few years, except for tweaks having to do with caching.

[julia-users] Re: missing const qualifier

2015-10-26 Thread vavasis
In 2014 when I first learned about Julia, I also suggested on this newsgroup that there should be a 'const' keyword as in C++ to annotate function arguments and return variables that are supposed to be read-only. Possibly you can find the old thread with google. I received a lot of feedback

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread David P. Sanders
Apologies, this seems to have changed recently -- PyPlot no longer overwrites Base.hist. You can do plt[:hist]

Re: [julia-users] 900mb csv loading in Julia failed: memory comparison vs python pandas and R

2015-10-26 Thread Jacob Quinn
Just a quick follow-up here: after some benchmarking of my own on a windows machine, the culprit ended up being a deathly slow `strtod` system library function on windows. It takes a few hoops to get the performance right, which I discovered is already done in Base Julia, it just wasn't exported.

[julia-users] Moving from 0.3 to 0.4

2015-10-26 Thread Phil Tomson
Are there any docs on moving from 0.3 to 0.4? Or do we just look in the changelog? I know some things have been deprecated and other things added. Also looking for kind of a "Best practices" sort of guideline for 0.4 - I suspect there were practices in 0.3 that aren't recommended now in 0.4.

[julia-users] missing const qualifier

2015-10-26 Thread Carlo Lucibello
It would be nice to annotate the return type of methods with a constant qualifier, in order to have an efficient and safe behaviour at the same time. I mean something like this: type A data::Vector{Int} end # invalid but desiderable julia code const function getdata(a::A) return a.data

[julia-users] Re: JuliaBox limitations on parallel computing

2015-10-26 Thread tanmaykm
Hi Iliyan, this sounds great! On Tuesday, October 27, 2015 at 10:53:33 AM UTC+5:30, Iliyan Zarov wrote: > > For anyone wishing to run large parallel programs I may be able to help - > I'm working on a cloud computing platform for Julia that takes care of > provisioning and managing all

[julia-users] Re: [ANN] MXNet.jl - Flexible and Efficient Deep Learning for Julia

2015-10-26 Thread Carlo Lucibello
How does this compare to Mocha.jl? Il giorno lunedì 26 ottobre 2015 04:27:31 UTC+1, Chiyuan Zhang ha scritto: > > MXNet.jl is the dmlc/mxnet > Julia package. > MXNet.jl brings flexible and efficient GPU

RE: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread David Anthoff
Are there plans to throw deprecation warnings in julia 0.5 whenever one slices an array with [], and then reuse the [] syntax to return views in julia 0.6? That would be approach that is consistent with previous changes of functionality, right? I’m very much in favor of the new design, but

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread David P. Sanders
If you do `using PyPlot` then you can just use `hist` directly: using PyPlot x = randn(1) hist(x, 100) El lunes, 26 de octubre de 2015, 10:21:59 (UTC-6), Ferran Mazzanti escribió: > > Oh, thnks for the info... > > On Monday, October 26, 2015 at 12:25:26 PM UTC+1, Kristoffer Carlsson >

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread David P. Sanders
(You then must call Base.hist if you want the version from Base.) El lunes, 26 de octubre de 2015, 23:13:23 (UTC-6), David P. Sanders escribió: > > > If you do `using PyPlot` then you can just use `hist` directly: > > using PyPlot > > x = randn(1) > hist(x, 100) > > El lunes, 26 de octubre

[julia-users] [ANN] DataStreams.jl, CSV.jl, SQLite.jl New Releases

2015-10-26 Thread Jacob Quinn
Hey everyone, I know it's been mentioned here and there, but now it's official: two new packages have been officially released for 0.4, DataStreams.jl and CSV.jl. SQLite.jl has also gone through a big overhaul to modernize the code and rework the data processing interface. DataStreams.jl is a

[julia-users] Re: JuliaBox limitations on parallel computing

2015-10-26 Thread tanmaykm
Hi André, I think it should be fine as long as the code is not compute intensive and across <10 workers. Best, Tanmay On Tuesday, October 27, 2015 at 10:53:33 AM UTC+5:30, André Lage wrote: > > Hi, > > I'll be giving a hands-on tutorial on Julia next week. I expect about 30 > people in 6th

[julia-users] Figure out how to get pointer to ge

2015-10-26 Thread Taylor Maxwell
I am moving some of my code to 0.4 and I am having trouble figuring out how to get a pointer for beginning of a UInt matrix. In the past I did: *julia> **bpt = convert(Ptr{Uint8},b) #where b it my Uint8 matrix* *Ptr{Uint8} @0x7fdd243fca70* in 0.4 I get: *julia> **bpt =

[julia-users] Re: JuliaBox limitations on parallel computing

2015-10-26 Thread tanmaykm
Hi Chris, a few minutes of running parallel Julia will not really have a negative impact. The parallel programs I was referring to were 100 odd workers each, and there were more than one users running similar tasks at some point which was too much for a single machine to handle. Also, we have

[julia-users] Re: JuliaBox limitations on parallel computing

2015-10-26 Thread cdm
perhaps time for an asterisk on the JuliaBox banner: "The Julia community is doing amazing things. We want you in on it!*" * ... but not massively in parallel, consuming the resources of the community. there are positives and negatives to this sort of problem ... the fact that the problem

Re: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread Gabriel Gellner
On Monday, 26 October 2015 11:17:58 UTC-7, Christoph Ortner wrote: > > Fabian - Many thanks for your comments. This was very helpful. > > (c) if I want to write code now that shouldn't break with 0.5, what should >> I do? >> > > I think when you need a copy, just surround your getindex with a

[julia-users] Performance of SubStrings Sets

2015-10-26 Thread Matt
I'm writing a package that compute various string distances. Some distances require to compare the set of n-grams (continugous sequences of n characters) for each string. For now, the implementation of these distances is quite slow. I've written the function for jaccard on a gist here

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread DNF
I learn new great stuff all the time with this language: You should actually do p = fill(a/Nb, Nb) On Monday, October 26, 2015 at 12:59:03 PM UTC+1, DNF wrote: > > If you want constant values you should do > > p = zeros(Nb) + a/Nb > or > p = ones(Nb) * a/Nb >

Re: [julia-users] A grateful scientist

2015-10-26 Thread Stefan Karpinski
Thank you for writing this – it's a lovely thing to wake up to. I'm sure all the others who make Julia happen and read this list daily feel the same. On Sunday, October 25, 2015, Yakir Gagnon <12.ya...@gmail.com> wrote: > Hi Julia community and developers, > I'm a postdoc researching color

Re: [julia-users] A grateful scientist

2015-10-26 Thread Jon Norberg
Utterly seconding that. Amazing community and beautiful language. Thanks all! Jon Norberg

Re: [julia-users] A grateful scientist

2015-10-26 Thread Scott T
(Oh and Yakir, your work sounds like one of the coolest interdisciplinary mixes I could possibly think of.) On Monday, 26 October 2015 13:11:47 UTC, Scott T wrote: > > I'll add my voice to say thanks as well! I made the switch from Python to > Julia for some astrophysical models in my PhD,

[julia-users] CUDArt.CudaArry - fill! not working

2015-10-26 Thread Matthew Pearce
I'm not having much luck filling a CUDArt.CudaArray matrix with a value. julia> C = CUDArt.CudaArray(Float64, (10,10)) CUDArt.CudaArray{Float64,2}(CUDArt.CudaPtr{Float64}(Ptr{Float64} @ 0x000b034a0e00),(10,10),0) julia> fill!(C, 2.0) ERROR: KeyError: (0,"fill_contiguous",Float64) not found

[julia-users] Computing a matrix with SharedArrays longer than without parallelism

2015-10-26 Thread amiksvi
Dear all, This topic follows that one: https://groups.google.com/forum/#!topic/julia-users/S86qxRkJ0ao which was not extremely easy to read so I take the liberty to reformulate my problem in simpler terms. I want to compute a matrix row by row, and since these computations can be done

[julia-users] Re: CUDArt.CudaArry - fill! not working

2015-10-26 Thread Kristoffer Carlsson
julia> CUDArt.init([0]) ERROR: UndefVarError: init not defined is surprising. Try reinstall the package. On Monday, October 26, 2015 at 3:39:53 PM UTC+1, Matthew Pearce wrote: > > Incidentally this second method doesn't work. > > On Monday, October 26, 2015 at 1:46:03 PM UTC, Kristoffer

[julia-users] Re: Hausdorff distance

2015-10-26 Thread Andrew McLean
The naïve algorithm is O(N^2), I think the most efficient algorithms come close to O(N). There is quite a lot of literature on efficient algorithms. - Andrew On Friday, 23 October 2015 23:28:46 UTC+1, Júlio Hoffimann wrote: > Hi, > > I want to make the Hausdorff distance ( >

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread Ferran Mazzanti
Interesting answers :) But the problem is not filling an array with constant values, but filling an array with a comprehension :) I can change the p = [ a/Nb for i in 1:Nb] line with some other thing and still get the same answer. For instance: a = 0.8; Nb = 100; p = [ i*1.0/Nb for i in 1:Nb]

Re: [julia-users] Please help me understand comprehensions for creating an array

2015-10-26 Thread Stefan Karpinski
This will change on master soon but for now, either do this in a function – with function arguments or local variables it's not a problem – or specify an element type. On Monday, October 26, 2015, Ferran Mazzanti wrote: > Interesting answers :) > > But the problem is

Re: [julia-users] functions on iterable types

2015-10-26 Thread harven
Le lundi 26 octobre 2015 12:52:04 UTC+1, DNF a écrit : > > I must admit I don't understand very well what snippet is supposed to do. > But, for example, it doesn't work for :sum or :maximum or anything like > that. > > A thunk is a function that takes a single argument. Cheers,

[julia-users] Re: CUDArt.CudaArry - fill! not working

2015-10-26 Thread Kristoffer Carlsson
I believe you need to use an initialized device. See https://github.com/JuliaGPU/CUDArt.jl#gpu-initialization For example: devices(dev->true) do devlist C = CUDArt.CudaArray(Float64, (10,10)) fill!(C, 2.0) println(to_host(C)) end On Monday, October 26, 2015 at 2:30:40 PM

[julia-users] Re: parallel and PyCall

2015-10-26 Thread Matthew Pearce
Thought I had an idea about this, I was wrong: ```julia julia> @everywhere using PyCall julia> @everywhere @pyimport pylab julia> remotecall_fetch(pylab.cumsum, 5, collect(1:10)) ERROR: cannot serialize a pointer [inlined code] from error.jl:21 in serialize at serialize.jl:420 [inlined

Re: [julia-users] functions on iterable types

2015-10-26 Thread Stefan Karpinski
On Mon, Oct 26, 2015 at 9:28 AM, harven wrote: > > A thunk is a function that takes a single argument. > A thunk is a zero-argument function in functional programming – i.e. a piece of deferred computation.

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread DNF
If you want constant values you should do p = zeros(Nb) + a/Nb or p = ones(Nb) * a/Nb On Monday, October 26, 2015 at 11:35:06 AM UTC+1, Ferran Mazzanti wrote: > > Hi folks, > > I try to create an array of constant float64 values. Something I did was: > > a = 0.8; > Nb = 100; > p = zeros(Nb)

Re: [julia-users] A grateful scientist

2015-10-26 Thread Scott T
I'll add my voice to say thanks as well! I made the switch from Python to Julia for some astrophysical models in my PhD, because I suck at C and Fortran and didn't like the messiness of dealing with something like Cython. Julia has been great for this and has introduced me gently to the

Re: [julia-users] CUDArt.CudaArry - fill! not working

2015-10-26 Thread Tim Holy
When your problem is with a particular package, it's often best to file an issue with the package. In this case, I bet your CUDA/CUDArt installation is broken, since for me this works fine: julia> devices(dev->true) do devlist device(0) C = CudaArray(Float64, (10,10))

[julia-users] Re: CUDArt.CudaArry - fill! not working

2015-10-26 Thread Matthew Pearce
Thanks also Tim.

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread DNF
OK. The phrasing of the question indicated to me that you were trying to create an array of Float64 values, and that the comprehension was just the tool to accomplish that. In that case, Kristoffer Carlsson gave a good answer: p = Float64[ a/Nb for i in 1:Nb] On Monday, October 26, 2015 at

[julia-users] Re: CUDArt.CudaArry - fill! not working

2015-10-26 Thread Matthew Pearce
Thanks Kristoffer, indeed that works. I'm slightly baffled by the initialisation process. In my session I had already used fill! successfully on a matrix already on the device, so presumed everything had been initialised. Clearly that's not enough.

Re: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread Fabian Gans
On Friday, October 23, 2015 at 9:08:55 PM UTC+2, Christoph Ortner wrote: > > > Apparently yes. For me it is very counterintuitive that this would be the > default behaviour. But presumably there was a lot of discussion that this > is desirable. > > (a) What are reasons, other than performance?

[julia-users] Re: PyPlot histogram does not work (for me at least) in 0.4.0 (?)

2015-10-26 Thread Ferran Mazzanti
Oh, thnks for the info... On Monday, October 26, 2015 at 12:25:26 PM UTC+1, Kristoffer Carlsson wrote: > > Read here: https://github.com/stevengj/PyCall.jl#usage > > More specifically, this section: > > "The biggest diffence from Python is that object attributes/members are > accessed with

Re: [julia-users] Re: OT: make githup notifications un-read?

2015-10-26 Thread Yichao Yu
On Mon, Oct 26, 2015 at 1:22 PM, Waldir Pimenta wrote: > I added the feed of my github notifications to my feed reader app. That > works well for me as a way to do just that: see the list of notifications, > open the corrsponding issues / PRs, and still have the github

[julia-users] OT: make githup notifications un-read?

2015-10-26 Thread Andreas Lobinger
Hello colleagues, it feels strange to ask this here, but is there a way to read githup notifications and keep them unread at the same time? As i use a smartphone i sometimes during the day scan my githup notifications and by doing that i put them in 'read' state and by the time i reach a

[julia-users] Re: OT: make githup notifications un-read?

2015-10-26 Thread Waldir Pimenta
I added the feed of my github notifications to my feed reader app. That works well for me as a way to do just that: see the list of notifications, open the corrsponding issues / PRs, and still have the github notifications marked as unread when I access github.com directly. The only problem is

Re: [julia-users] Re: Hausdorff distance

2015-10-26 Thread Júlio Hoffimann
Thanks, will take a look. -Júlio

Re: [julia-users] Re: Re: are array slices views in 0.4?

2015-10-26 Thread Christoph Ortner
Fabian - Many thanks for your comments. This was very helpful. (c) if I want to write code now that shouldn't break with 0.5, what should > I do? > I think when you need a copy, just surround your getindex with a copy function. (e.g. copy(x[:,10]) instead of x[:,10]). But this would lead me

Re: [julia-users] Re: Hausdorff distance

2015-10-26 Thread Andrew McLean
This is not exactly my area of expertise, but this recently published paper looks like a good starting point. [1] A. A. Taha and A. Hanbury, ‘An Efficient Algorithm for Calculating the Exact Hausdorff Distance’, *IEEE Transactions on Pattern Analysis and Machine Intelligence*, vol. 37, no. 11,