Re: [julia-users] OptionTypes.jl

2014-08-11 Thread John Myles White
Agreed. I included it to allow users to make clear what the compiler ought to do. — John On Aug 11, 2014, at 10:55 PM, Stefan Karpinski wrote: > That seems like a really good candidate for improving the compiler to make > sure that it can eliminate the second check. > > > On Tue, Aug 12, 2

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread Stefan Karpinski
That seems like a really good candidate for improving the compiler to make sure that it can eliminate the second check. On Tue, Aug 12, 2014 at 1:54 AM, John Myles White wrote: > Yup. > > It’s unclear to me whether it should be included or not. It’s useful if > you’ve already done an explicit i

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread John Myles White
Yup. It’s unclear to me whether it should be included or not. It’s useful if you’ve already done an explicit isnull(x) check so that you can save a second check. — John On Aug 11, 2014, at 10:52 PM, Stefan Karpinski wrote: > What's the deal with unsafe_get? Does that segfault if you try to a

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread Stefan Karpinski
What's the deal with unsafe_get? Does that segfault if you try to access a null value reference value and give you random junk if you try to access an bits value? On Tue, Aug 12, 2014 at 1:09 AM, John Myles White wrote: > Ok, I’ve cleaned this up and renamed it to NullableTypes.jl: > https://gi

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread John Myles White
Ok, I’ve cleaned this up and renamed it to NullableTypes.jl: https://github.com/johnmyleswhite/NullableTypes.jl — John On Aug 11, 2014, at 9:17 PM, Stefan Karpinski wrote: > Sounds good. We could maybe include the Nullable type in Base and thus avoid > the issue of what to call the module. I

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Stefan Karpinski
Sorry, Pontus – I spelled your name wrong in an entirely different (and far less American) manner. Although "star dwelling" vs "stone dwelling" is maybe ok ;-) On Tue, Aug 12, 2014 at 12:11 AM, Pontus Stenetorp wrote: > To Jacob and the team, thank you for all your hard work. These videos > wi

[julia-users] Re: Testing OpenGL

2014-08-11 Thread bvanevery
On Sunday, July 6, 2014 5:11:41 PM UTC-4, Simon Danisch wrote: > > > go to `.julia/v0.3/ModernGL/test/` and run `julia runtests.jl > ` > If everything is fine, a window opens with a triangle, > That's what I get, with Julia Version 0.3.0-rc3+2 (2014-08-10 15:25 UTC). Didn't work with 0.2, got

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread John Myles White
Well, Facebook did just add stickers for The Expendables 3, so that might have been on my mind today. Seems like there’s no need for a Nullables module if this goes into Base. The library is so minimal as is and I’m about to pull some functionality out of it that’s not really necessary. — Joh

[julia-users] Re: erroneous cholfact behavior in conjunction with addprocs()

2014-08-11 Thread Thomas Covert
I think this is broken again: I'm observing single-threaded failures (i.e., the last line of the sample code fails when the addprocs(8) line is not commented out) on both a somewhat recent OS X home-brew build and also the current --HEAD home-brew build right now. I am using the standard 64-bit

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Pontus Stenetorp
To Jacob and the team, thank you for all your hard work. These videos will surely help spread the word about Julia. On 11 August 2014 20:53, Jacob Quinn wrote: > > Gather round and here the tales of a wonderous new language, presented by > Tim Holy, Pontus Stenetrop, and Arch Robison. Just to n

Re: [julia-users] OptionTypes.jl

2014-08-11 Thread John Myles White
Just wanted to come back to this thread now that I’m back from vacation. It sounds like the consensus of Jeff, Stefan, Keno and Jameson is that we’re better off working with an explicit Option{T} type than trying to get the compiler to handle Union(S, T) more efficiently. If people are willing

Re: [julia-users] Best way to generate random variables from the same family with different parameters?

2014-08-11 Thread John Myles White
Maybe open an issue to discuss this idea? Might be too far afield for Distributions, but it’s a cool idea that should go somewhere. — John On Aug 8, 2014, at 4:31 AM, Gabriel Mitchell wrote: > I agree that if the intended use is limited to getting a random value one > time then Johan's solut

[julia-users] Re: rand(x::Int32) doesn't exist, omission or intentional?

2014-08-11 Thread Jeff Waller
On Monday, August 11, 2014 1:34:05 PM UTC-4, Steven G. Johnson wrote: > > On Monday, August 11, 2014 9:04:23 AM UTC-4, Clemens Heitzinger wrote: >> >> Works like this (on 0.3.0-rc3): > > > Clemens, I think Jeff wanted to generate a random Float64 array from an > int32 size, not an array of rando

Re: [julia-users] function like read.clipboard?

2014-08-11 Thread Ivar Nesje
Ref: https://github.com/JuliaLang/julia/issues/4245

Re: [julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Peter Simon
Thanks, this is very much appreciated. After looking over your code and looking up the meaning of "hash collision" I now see that my code will silently fail sometimes, because I didn't check for collisions. So your provided code is very definitely useful to me now! --Peter On Monday, August

[julia-users] Re: How to find the indices of the unique rows in a matrix

2014-08-11 Thread Peter Simon
Thanks for the code and for pointing out the issue. Glad that it's on the radar for a future enhancement. --Pete On Monday, August 11, 2014 10:22:45 AM UTC-7, Peter Simon wrote: > > Greetings. > > I didn't find any built-in function to return the indices for the unique > rows in a matrix, so

Re: [julia-users] Is there a way to directly do a clean reinstallation of a package?

2014-08-11 Thread Job van der Zwan
Ah, thanks. Hadn't thought of looking on Github. On Monday, 11 August 2014 16:46:12 UTC+2, Isaiah wrote: > > Yes - just not implemented yet. See some related discussion here: > https://github.com/JuliaLang/julia/issues/7054 > > > > On Mon, Aug 11, 2014 at 7:22 AM, Job van der Zwan > wrote: > >> S

Re: [julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Simon Kornblith
Here it is copy/pasted from Base, in case it's useful for you for now: using Base.Cartesian, Base.Prehashed @ngenerate N typeof(A) function indunique{T,N}(A::AbstractArray{T,N}, dim:: Int) 1 <= dim <= N || return copy(A) hashes = zeros(Uint, size(A, dim)) # Compute hash for each row

Re: [julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Simon Kornblith
unique with a dim argument actually computes this as byproduct but does not return it. All we need is an API. On Monday, August 11, 2014 1:27:57 PM UTC-4, Jacob Quinn wrote: > > There's an open issue about it here: > https://github.com/JuliaLang/julia/issues/1845 > > I've also played around with

[julia-users] Re: julia unable to install on Ubuntu 13.10

2014-08-11 Thread sagar ram
make -id will ignore and proceeds further On Tuesday, 20 May 2014 18:31:38 UTC+1, Iain Dunning wrote: > > All those dependencies are in the READAME > > On Tuesday, May 20, 2014 6:46:41 AM UTC-4, Ivo Balbaert wrote: >> >> Sorry, message was posted too quickly: >> >> Here is my report of the build:

[julia-users] Re: rand(x::Int32) doesn't exist, omission or intentional?

2014-08-11 Thread Steven G. Johnson
On Monday, August 11, 2014 9:04:23 AM UTC-4, Clemens Heitzinger wrote: > > Works like this (on 0.3.0-rc3): Clemens, I think Jeff wanted to generate a random Float64 array from an int32 size, not an array of random Int32 values. I added a pull request (https://github.com/JuliaLang/julia/pull/795

Re: [julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Jacob Quinn
There's an open issue about it here: https://github.com/JuliaLang/julia/issues/1845 I've also played around with a simple version based on a Set: function uniqueind(C) out = Int[] seen = Set{eltype(C)}() for i = 1:length(C) @inbounds x = C[i] if !in(x, seen)

[julia-users] How to find the indices of the unique rows in a matrix

2014-08-11 Thread Peter Simon
Greetings. I didn't find any built-in function to return the indices for the unique rows in a matrix, so I tried rolling my own. I looked at, but didn't understand, the highly macro-ized, arbitrary dimensional code in the built-in unique() function. I did discover hashing, though, from lookin

Re: [julia-users] "export" within a macro

2014-08-11 Thread Jameson Nash
I think Stefan's email gives the impression that it would be hard to make eval(export) simply work. Whereas this is intentionally somewhat difficult, since it might not give the effect the user was expecting (runtime export statements could lead to inconsistent symbol lookup). Instead, exports sh

[julia-users] Re: rand(x::Int32) doesn't exist, omission or intentional?

2014-08-11 Thread Steven G. Johnson
On Sunday, August 10, 2014 7:14:08 PM UTC-4, Jeff Waller wrote: > > Is there a reason for this just kind of got overlooked because the usage > is rare? > I think it just got overlooked. Because ultimately it gets converted to an (Int...) tuple, it is easy to be lazy and just require that the

Re: [julia-users] circular list?

2014-08-11 Thread Kevin Squire
A hybrid approach might be useful. The Queue type in DataStructures.jl uses a linked list of array blocks. This could be extended to handle indexing and insertion/deletion in the middle, and should be pretty efficient and flexible. Cheers, Kevin On Monday, August 11, 2014, Andreas Lobinger wr

[julia-users] Re: "export" within a macro

2014-08-11 Thread Philippe Maincon
He he he! I missed the "return" statement in the doc (it's there, I cannot suggest any improvement, they are even titled "read the docs"), and from there I hacked my why to this ugly code. Well, macros are going to make sense now!!! I'll study the @deprecated code. Thank your both for your h

Re: [julia-users] circular list?

2014-08-11 Thread Andreas Lobinger
silly me ... a circular buffer is mod adressing in the case of algorithms on polygons, there might be the case of replacing an edge with a sequence of edges, and there people think a linked-list would be the better idea.

Re: [julia-users] circular list?

2014-08-11 Thread Andreas Lobinger
So where do i find a circular buffer in the datatypes of julia? For the background: If playing around with graphics algorithms and some of them use a closed doubly-linked-list to represent a closed polygon (so the vertices have left and right neighbors in any case). This is at the moment not t

Re: [julia-users] "export" within a macro

2014-08-11 Thread Stefan Karpinski
As Jacob points out, a macro body is a function that maps input expressions to the expression that will be evaluated instead due to macro expansion. If you're calling eval in the macro, you're evaluating code at macro expansion time – i.e. when your code is being parsed. This is almost certainly no

Re: [julia-users] Is there a way to directly do a clean reinstallation of a package?

2014-08-11 Thread Isaiah Norton
Yes - just not implemented yet. See some related discussion here: https://github.com/JuliaLang/julia/issues/7054 On Mon, Aug 11, 2014 at 7:22 AM, Job van der Zwan wrote: > Somehow my Jewel installation got messed up after running Pkg.update(), > giving me "metadata may be ahead of package" err

Re: [julia-users] circular list?

2014-08-11 Thread Stefan Karpinski
I suspect that using a circular buffer might be a more efficient implementation. You can even grow it on demand to handle arbitrary capacity. The way Julia's 1-d arrays are implemented, this will give you an efficient and flexible implementation. On

Re: [julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Stefan Karpinski
Turned off now. Interestingly, I wasn't seeing nearly so "skeezy" ads – just links to related content. Maybe they know I'm a moderator and change what they show. In any case, I think that Discus has clearly jumped the shark and having posts without comments is just fine. The discussion can go on HN

Re: [julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Stefan Karpinski
Yeah, that's coming from Disqus. Let's just turn it off. Used to be respectable, now, clearly not. On Mon, Aug 11, 2014 at 9:56 AM, Jacob Quinn wrote: > Hmmm...I hadn't noticed until now. Looks like it's coming from Disqus. > > > -Jacob > > > On Mon, Aug 11, 2014 at 9:53 AM, Spencer Russell

Re: [julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Jacob Quinn
Hmmm...I hadn't noticed until now. Looks like it's coming from Disqus. -Jacob On Mon, Aug 11, 2014 at 9:53 AM, Spencer Russell wrote: > Whatever hosting provider used for the julialang.org blog is putting > skeezy "around the web" ads at the bottom. Not sure if this is a new > development

[julia-users] Re: calculating limit of a function

2014-08-11 Thread j verzani
The SymPy package adds / for PyObjects and other functions so that working with SymPy is a bit easier that going through PyCall directly. The package needed a besselj function though. One is added now, output below. The problem is that the sympy functions are not generated programmatically, rat

Re: [julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Stefan Karpinski
Regarding the HN link: if you could go to the front page and click back to the video link before up voting (or just don't up-vote) that would be good – otherwise it sets off the voting ring detector and bans the story. > On Aug 11, 2014, at 8:59 AM, Johan Sigfrids wrote: > > Yay! I've been eag

[julia-users] Re: rand(x::Int32) doesn't exist, omission or intentional?

2014-08-11 Thread Clemens Heitzinger
Works like this (on 0.3.0-rc3): *julia> **methods(rand)* *# 31 methods for generic function "rand":* *rand(::Type{Float64}) at random.jl:88* *rand() at random.jl:89* *rand(::Type{Float32}) at random.jl:91* *rand(::Type{Float16}) at random.jl:92* *rand{T<:Real}(::Type{Complex{T<:Real}}) at ra

[julia-users] Re: JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Johan Sigfrids
Yay! I've been eagerly awaiting these. On Monday, August 11, 2014 2:53:18 PM UTC+3, Jacob Quinn wrote: > > Hey all, > > Gather round and here the tales of a wonderous new language, presented by Tim > Holy >

[julia-users] JuliaCon Opening Session Videos Posted!

2014-08-11 Thread Jacob Quinn
Hey all, Gather round and here the tales of a wonderous new language, presented by Tim Holy , Pontus Stenetrop

Re: [julia-users] "export" within a macro

2014-08-11 Thread Jacob Quinn
I think you just need to remove the eval() from your macro. Macros should always return Expr (expression) objects, and not be in the business of eval-ing things. -Jacob On Mon, Aug 11, 2014 at 7:16 AM, Philippe Maincon < philippe.main...@gmail.com> wrote: > Hi, > > Within a module, I am definin

[julia-users] Is there a way to directly do a clean reinstallation of a package?

2014-08-11 Thread Job van der Zwan
Somehow my Jewel installation got messed up after running Pkg.update(), giving me "metadata may be ahead of package" error messages. It was easy enough to fix: deleted the "Jewel" folder, opened Julia again and then ran Pkg.add("Jewel"). However, it made me wonder if a function to do all of tha

[julia-users] "export" within a macro

2014-08-11 Thread Philippe Maincon
Hi, Within a module, I am defining a macro, and then calling it multiple time to generate a bunch of functions. I would like to make these functions available to the user of the macro, so I should export them. My macro now looks like macro Op1(OP,A) eval(quote $OP(a::Dual) = Dual($

Re: [julia-users] when running julia --code-coverage, where is the *.cov file?

2014-08-11 Thread Tim Holy
All the .cov files are in the same directory as the corresponding .jl source file. So you'll find a bunch in julia/base (given the "all"), as well as any other files used by your test.jl. --Tim On Monday, August 11, 2014 03:37:41 AM Keith Campbell wrote: > Hello, > When running --code-coverage,

[julia-users] when running julia --code-coverage, where is the *.cov file?

2014-08-11 Thread Keith Campbell
Hello, When running --code-coverage, where does one find the .cov file? I tried: julia --code-coverage=all test.jl The program ran, but I couldn't find any coverage output. thanks, Keith Version 0.3.0-rc2+22 (2014-08-07 07:55 UTC) Commit 0816e99 (4 days old master) x86_64-redhat-linux

[julia-users] Re: calculating limit of a function

2014-08-11 Thread Hans W Borchers
As far as I see, Sympy *does* know the limit at 0.0: >>> from sympy import * >>> x = symbols('x') >>> limit(besselj(1, x)/x, x, 0) 1/2 If in Julia you call it like limit(besselj(1, x)/x, x, 0), then Julia assumes it to be its own function, not SymPy's. If on the other hand you c

[julia-users] circular list?

2014-08-11 Thread Andreas Lobinger
Hello colleagues, i'm not really into this CS term, so i might ask something stupid... What would you recommend to use for a circular list, a doubly-linked-list? Wishing a happy day, Andreas