[julia-users] ANN: VideoIO.jl wrapper for ffmpeg/libav

2014-08-19 Thread Kevin Squire
VideoIO.jl is a wrapper around libav/ffmpeg libraries, which are the defacto open-source libraries for video IO. At this point, the library offers an easy way to open video files or a camera and read sequences of images, as either arrays, or optionally as `

[julia-users] Compile-time switchable @assert

2014-08-19 Thread Jan Kybic
Hi to all, I like to have asserts that I can switch on for debugging and switch off later on for performance, to eliminate the run-time penalty. I could not find this functionality in Julia, so I implemented it. My implementation is attached. The usage is simple, similar to @assert: include(

[julia-users] Re: Compile-time switchable @assert

2014-08-19 Thread Ivar Nesje
See also #7732 I'm not sure why this is not getting traction. It seems like a useful feature to me, but it probably doesn't seem to add much value, and it has impact on the correctness of high performance Julia libraries. It should probably be ha

Re: [julia-users] Re: Compile-time switchable @assert

2014-08-19 Thread Kevin Squire
Also check out Logging.jl, which does have macros for enabling/disabling printing/logging at different levels. Kevin On Tue, Aug 19, 2014 at 3:09 AM, Ivar Nesje wrote: > See also #7732 > > I'm not sure why this is not getting traction. It seems

Re: [julia-users] Re: Compile-time switchable @assert

2014-08-19 Thread Jan Kybic
On Tuesday, August 19, 2014 12:11:49 PM UTC+2, Kevin Squire wrote: > > Also check out Logging.jl, which does have macros for enabling/disabling > printing/logging at different levels. > > Thank you for point out Logging.jl, it seems to do what I was looking for. Jan

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Johan Sigfrids
Is there a way for a user that downloads the RC4 binary to run the test suit? That would be a good way to help uncover those pesky bugs. On Monday, August 18, 2014 6:36:47 PM UTC+3, Stefan Karpinski wrote: > > +1,000,000 > > > On Mon, Aug 18, 2014 at 11:25 AM, John Myles White > wrote: > >> One

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Florian Oswald
i was reluctant to download the RC4 binary for mac from the website because the link and package name show up as julia-0.3.0-rc3-osx10.7+.dmg, even though inside the dmg there is indeed RC4. i basically thought there is no binary of RC4 yet, maybe this should be updated on the website? On Tuesd

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Ivar Nesje
#7846 and Base.runtests kl. 14:52:00 UTC+2 tirsdag 19. august 2014 skrev Johan Sigfrids følgende: > > Is there a way for a user that downloads the RC4 binary to run

[julia-users] From array of Char to String

2014-08-19 Thread Ning Yin
Hi Julia users, I was trying to convert an array of char's to string, and I've noticed functions such as string or CharString, but non of these seem to work for my case: Julia console: == julia> a = ['a', 'b', 'c'] 3-element Array{Char,1}: 'a' 'b' 'c' julia> string(a) "Char[a,b

Re: [julia-users] From array of Char to String

2014-08-19 Thread Jacob Quinn
Try join() On Tue, Aug 19, 2014 at 8:04 AM, Ning Yin wrote: > Hi Julia users, > > I was trying to convert an array of char's to string, and I've noticed > functions such as string or CharString, but non of these seem to work for > my case: > > Julia console: > == > julia> a = ['a',

[julia-users] `ccall: could not find function jl_uv_dlopen` with 0.3.0-rc1

2014-08-19 Thread Spencer Russell
jl_uv_dlopen was added 2 weeks ago and is now used by BinDeps, so older Julia installs are breaking. Installing 0.3.0-rc4 fixes the issue. Just in case anyone else runs into the issue. peace, s

[julia-users] Re: live plotting in PyPlot.jl?

2014-08-19 Thread ggggg
You could try adapting this python stack overflow answer. I've only ever done it with qt4 and the matplotlib api from python, but it is certainly possible. http://stackoverflow.com/questions/11874767/real-time-plotting-in-while-loop-with-matplotlib The key suggestions seem to be 1. Call pl

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Elliot Saba
Whoops, sorry about that Florian! There must be a small error in the .dmg filename, but if you open it, you see there is a Julia-0.3.0-rc4.app inside. -E On Tue, Aug 19, 2014 at 9:08 AM, Ivar Nesje wrote: > #7846 > > and > > Base.runtests >

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Florian Oswald
hey! yeah no worries! when I overcame my impatience (which led me to abort the download after 2 seconds because of the "wrong" name), I found out that the package had the correct content. cheers On 19 August 2014 16:54, Elliot Saba wrote: > Whoops, sorry about that Florian! There must be a s

[julia-users] Potential Addprocs problem

2014-08-19 Thread John Drummond
Hi, I'm running on windows Server 2008 R2 Standard Julia 0.3.0 RC4 The first three lines of my code are println("about to add processors") addprocs(24) println("added processors") Some of the times I start the program alls the instances start except for 1 or 2 which then sits there churning awa

[julia-users] How to require the current master of pacakge

2014-08-19 Thread Spencer Lyon
Is there a way to specify that a package depends on the current master branch of another package. My problem is the following: - I am developing a package that samples from the MultivariateNormal distribution in Distributions.jl. - This pacakge calls unwhiten! from PDMats.jl. -

Re: [julia-users] How to require the current master of pacakge

2014-08-19 Thread John Myles White
I don't think this is possible. This sounds like a case where PDMats needs a new release. You can implement a release yourself, make a pull request to METADATA and ask Dahua for permission to merge it. -- John On Aug 19, 2014, at 10:13 AM, Spencer Lyon wrote: > Is there a way to specify that

[julia-users] Re: How to require the current master of pacakge

2014-08-19 Thread Spencer Lyon
That's what I thought. I'm happy to do that To do this I just need to do `Pkg.tag("PDMats")` Then push that commit to my fork of METADATA and submit a PR, right? On Tuesday, August 19, 2014 10:13:06 AM UTC-7, Spencer Lyon wrote: > > Is there a way to specify that a package depends on the curre

Re: [julia-users] Re: How to require the current master of pacakge

2014-08-19 Thread Leah Hanson
That should work. :) -- Leah On Tue, Aug 19, 2014 at 12:28 PM, Spencer Lyon wrote: > That's what I thought. I'm happy to do that > > To do this I just need to do > > `Pkg.tag("PDMats")` > > Then push that commit to my fork of METADATA and submit a PR, right? > > > On Tuesday, August 19, 2014 1

[julia-users] Re: live plotting in PyPlot.jl?

2014-08-19 Thread Steven G. Johnson
On Tuesday, August 19, 2014 11:09:21 AM UTC-4, g wrote: > > You could try adapting this python stack overflow answer. I've only ever > done it with qt4 and the matplotlib api from python, but it is certainly > possible. > > > http://stackoverflow.com/questions/11874767/real-time-plotting-i

Re: [julia-users] We have typed functions, don't we?

2014-08-19 Thread Rafael Fourquet
> > This is a really cool family of tricks. Time for me to start replacing some > ::Function specifiers in my argument lists... I saw in julia base that `Base.Callable`, an alias for Union(Function, DataType), is used in argument lists. I'm starting to consider replacing most normal functions by

Re: [julia-users] Re: How to require the current master of pacakge

2014-08-19 Thread Spencer Lyon
Done: https://github.com/JuliaLang/METADATA.jl/pull/1273 Thanks guys On Tuesday, August 19, 2014 10:58:46 AM UTC-7, Leah Hanson wrote: > > That should work. :) > > -- Leah > > > On Tue, Aug 19, 2014 at 12:28 PM, Spencer Lyon > wrote: > >> That's what I thought. I'm happy to do that >> >> To do t

[julia-users] style: parametric functions or abstract types on arguments

2014-08-19 Thread Spencer Lyon
Suppose I am defining a function that operates on any two real numbers. Which of the following ways of specifying types is preferred (in terms of idomatic Julia and performance considerations) and why? ```julia function foo1(x::Real, y::Real) = ... function foo2{ T<: Real}(x::T, y::T) = ... f

[julia-users] Re: style: parametric functions or abstract types on arguments

2014-08-19 Thread Tobias Knopp
function foo4(x,y) is also a valid way that allows most flexibility. From a performance point of view all functions are equally fast. Specifying types is not done for performance reasons but to allow for dispatching on the type. foo2 and foo3 are of course semantically different because foo2 re

[julia-users] Re: style: parametric functions or abstract types on arguments

2014-08-19 Thread Johan Sigfrids
Performance wise it makes no difference. The JIT will produce the same code for all three: foo1(x::Real, y::Real) = x + y foo2{ T<: Real}(x::T, y::T) = x + y foo3{T <: Real, S <: Real}(x::T, y::S) = x + y You can verify it by running @code_native on all of them. They will all result in the sa

Re: [julia-users] Optim.jl line search problems

2014-08-19 Thread Thomas Covert
I'm seeing this same error (ERROR: assertion failed: lsr.slope[ib] < 0) again, and this time my gradients (evaluated at "reasonable" input values) match the finite difference output generated by Calculus.jl's "gradient" function. The function I am trying to minize is globally convex (its a mul

[julia-users] Binary dependencies always being downloaded in 0.2

2014-08-19 Thread Ken Crowell
(Posted earlier in IRC, but I'm told this is considerably more active.) So in the recent past (a few weeks ago), on 0.2 on Ubuntu trusty, I could pre-install the binary dependencies of ICU, HttpParser, Nettle, ZMQ, etc. and the Julia package install would proceed smoothly without trying to down

Re: [julia-users] Binary dependencies always being downloaded in 0.2

2014-08-19 Thread Keno Fischer
Before anything else, try `Pkg.checkout("BinDeps")` and see if that fixes it. On Tue, Aug 19, 2014 at 3:11 PM, Ken Crowell wrote: > (Posted earlier in IRC, but I'm told this is considerably more active.) > > So in the recent past (a few weeks ago), on 0.2 on Ubuntu trusty, I could > pre-install t

[julia-users] Re: style: parametric functions or abstract types on arguments

2014-08-19 Thread Spencer Lyon
Excellent, thank you for the quick and helpful responses. One more related question. If I were to define a function that could either on an Array{T} where T <: Number or on T itself, is there any reason not to do this: typealias ScalarOrArray{T} Union(T, Array{T}) function bar{T}(x::ScalarO

Re: [julia-users] Binary dependencies always being downloaded in 0.2

2014-08-19 Thread Ken Crowell
Yes, that did fix it. dev@3e9693d449ff:~$ rm -rf .julia dev@3e9693d449ff:~$ julia -e 'Pkg.init()' INFO: Initializing package repository /home/dev/.julia/v0.2 INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl dev@3e9693d449ff:~$ julia -e 'Pkg.add("BinDeps")' INFO: Cloning cache of

[julia-users] Re: style: parametric functions or abstract types on arguments

2014-08-19 Thread Tobias Knopp
Hi Spencer, yes the ScalarOrArray type will work and be fast. In that case you could have also not specified the types at all. We call this "duck typing" which is a term that comes from the python world. I think there is no "preferred" way to do this in Julia and there are people that favor the

[julia-users] REPL v0.3, matlab-like completion

2014-08-19 Thread Carlos Becker
Hi all, I think this is a typically asked question, but I don't know whether it is possible now in julia v0.3. Namely to make the up/down arrows search completion history in the REPL. If so, I will be happy to document it in the docs in the FAQ section. Thanks. --

[julia-users] Re: REPL v0.3, matlab-like completion

2014-08-19 Thread ggggg
I couldn't find it via googling, but there is a page that documents this. Although the documentation would benefit from descriptions of how to use these shortcuts in windowed terminals (eg shift page-up works in the OSX terminal). http://docs.julialang.org/en/latest/manual/interacting-with-julia

[julia-users] Re: REPL v0.3, matlab-like completion

2014-08-19 Thread Steven G. Johnson
There is interest in this feature, but it hasn't been implemented yet: https://github.com/JuliaLang/julia/issues/6377

[julia-users] Optional import mechanism

2014-08-19 Thread Júlio Hoffimann
Dear all, Consider the following code: try require("ImageView") global view = ImageView.view catch err @show err # fallback to nothing global view = view(args...; kargs...) = (nothing, nothing) end I have ImageView installed, but the catch block is executed with err => UndefV

Re: [julia-users] Re: live plotting in PyPlot.jl?

2014-08-19 Thread Sheehan Olver
OK This worked (after modifying by hand matplotlib/pyplot.py to change plt.show(block=False) to plt.ion(), possibly updating matplotlib would work): PyPlot.show() for k=1:20 PyPlot.plot([1:10],1+k*[1:10]) PyPlot.draw() PyPlot.pause(0.05) end On 20 Aug 2014, at 4:02 am, Steven G. Jo

Re: [julia-users] Optional import mechanism

2014-08-19 Thread Kevin Squire
What happens if you use import instead is require? On Tuesday, August 19, 2014, Júlio Hoffimann wrote: > Dear all, > > Consider the following code: > > try > require("ImageView") > global view = ImageView.view > catch err > @show err > # fallback to nothing > global view = vi

Re: [julia-users] REPL v0.3, matlab-like completion

2014-08-19 Thread Tim Holy
You know about the Ctrl-r shortcut though, right? --Tim On Tuesday, August 19, 2014 10:57:19 PM Carlos Becker wrote: > Hi all, > > I think this is a typically asked question, but I don't know whether it is > possible now in julia v0.3. > Namely to make the up/down arrows search completion history

[julia-users] Re: style: parametric functions or abstract types on arguments

2014-08-19 Thread Spencer Lyon
Thanks Tobi, that was exactly the type of response I was looking for. On Tuesday, August 19, 2014 1:22:45 PM UTC-7, Tobias Knopp wrote: > > Hi Spencer, > > yes the ScalarOrArray type will work and be fast. In that case you could > have also not specified the types at all. > We call this "duck ty

Re: [julia-users] Optional import mechanism

2014-08-19 Thread Júlio Hoffimann
Hi Kevin, What happens if you use import instead is require? > ERROR: error compiling anonymous: unsupported or misplaced expression import in function anonymous Júlio. >

Re: [julia-users] Optional import mechanism

2014-08-19 Thread Joey Huchette
It’s a bit ugly, but this should work: try eval(Expr(:import, :ImageView)) global view = ImageView.view catch err @show err # fallback to nothing global view = view(args...; kargs...) = (nothing, nothing) end On Tuesday, August 19, 2014 9:00:39 PM UTC-4, Júlio Hoffimann wrot

Re: [julia-users] Optional import mechanism

2014-08-19 Thread Júlio Hoffimann
Hi Joey, > It’s a bit ugly, but this should work: > > try > eval(Expr(:import, :ImageView)) > global view = ImageView.view > catch err > @show err > # fallback to nothing > global view = view(args...; kargs...) = (nothing, nothing) > end > > Unfortunately it doesn't work: err

Re: [julia-users] Suggestion: Start using Julia 0.3-RC4

2014-08-19 Thread Tony Kelman
> Is there a way for a user that downloads the RC4 binary to run the test suit? That would be a good way to help uncover those pesky bugs. This question makes me happy. Thanks Ivar for answering it!

Re: [julia-users] Optional import mechanism

2014-08-19 Thread Miles Lubin
This may do what you want (snippet from JuMP): if isdir(Pkg.dir("ArrayViews")) eval(Expr(:import,:ArrayViews)) const subarr = ArrayViews.view else const subarr = Base.sub end On Tuesday, August 19, 2014 7:38:27 PM UTC-6, Júlio Hoffimann wrote: > > Hi Joey, > >> It’s a bit ugly, but t

[julia-users] Re: We have typed functions, don't we?

2014-08-19 Thread vavasis
As a newcomer to Julia, I'm having a bit of trouble following this discussion: is it OK if I try to summarize it in my own words and you tell me whether I've understood? 'Traditional' Julia: you can pass a function f as an argument to another function g. Rafael's functors: instead you create n

Re: [julia-users] From array of Char to String

2014-08-19 Thread Ning Yin
Thanks! That worked. I also found out that both string(a...) and CharString(a...) worked, though I don't understand why the '...' is necessary here. On Tuesday, August 19, 2014 9:50:33 PM UTC+8, Jacob Quinn wrote: > > Try join() > > > On Tue, Aug 19, 2014 at 8:04 AM, Ning Yin > > wrote: > >> H

Re: [julia-users] From array of Char to String

2014-08-19 Thread Isaiah Norton
That is the splice operator (also known as "splat"). It causes the contents of `a` to be passed as indvidual arguments rather than passing `a` as an array. So, string() behaves differently. On Tue, Aug 19, 2014 at 11:55 PM, Ning Yin wrote: > Thanks! That worked. > > I also found out that both s

Re: [julia-users] From array of Char to String

2014-08-19 Thread John Myles White
We should really have a FAQ for this. This is something that tripped me up for a while. I’ll write up sometime. — John On Aug 19, 2014, at 9:11 PM, Isaiah Norton wrote: > That is the splice operator (also known as "splat"). It causes the contents > of `a` to be passed as indvidual arguments

Re: [julia-users] From array of Char to String

2014-08-19 Thread Ivar Nesje
It also seems kind of reasonable to special case string() for Array{Char,1}. It will be inconsistent with other Array stringifications, but print/show/writemime/dump/xdump/showcompact/... can still give emphasize the array property with an array representation. kl. 06:12:37 UTC+2 onsdag 20. aug