Re: [julia-users] Julia vs Clojure for Distributed Scientific Simulations

2016-01-27 Thread Ismael VC
I dont know if you can call Julia from Java, but you can call Java from
Julia, see:

* https://github.com/aviks/JavaCall.jl
* https://github.com/aviks/JavaCall.jl

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México



  

Tel. 6718 1818
richit.com.mx

2016-01-27 10:14 GMT-06:00 Mike Innes :

> With Clojure you're likely to get much better deployment / networking
> support, as well as the general robustness and tooling of the JVM. It's
> also really expressive for data manipulation (though not necessarily fast).
> Julia loses out on that but will blow Clojure out of the water for anything
> more computationally advanced; numerics, fiddly data structures etc.
>
> To over simplify the decision a little, I'd probably use Clojure for
> something running indefinitely (e.g. web server) and Julia for something
> finite (e.g. a simulation). But I think you just have to look at what you
> expect the key pain points to be, and compare that to the strengths of each
> language.
>
> On Wed, 27 Jan 2016 at 04:07 George  wrote:
>
>> I'm working on a scientific simulation that is going to require a
>> distributed environment.  There has been some discussion about whether to
>> use Julia or Clojure for this project.  A few micro benchmarks seem to have
>> different results for each language.  I'm not yet sold as to which language
>> may be more expressive in this situation, but Lisp might be a preferred
>> option mathematically for modeling purposes.
>>
>> Does anyone have any practical experience in dealing with both of these
>> languages and what your experiences were?
>>
>> Are there any meaningful benchmarks that compare the two, especially in a
>> distributed environment?
>>
>>
>> Thanks!
>>
>> -George
>>
>


Re: [julia-users] Why SimpleVector / svec?

2016-01-06 Thread Ismael VC
Thanks for your answer Tim, what do you think about wrapping the builtins
in julia functions, does it makes sense?

Rename builtins with a trailing underscore, and map them to julia generic
functions

applicable(args...) = _applicable(args...)
apply_type(args...) = _apply_type(args...)
arrayref(args...)   = _arrayref(args...)
arrayset(args...)   = _arrayset(args...)
arraysize(args...)  = _arraysize(args...)
fieldtype(args...)  = _fieldtype(args...)
getfield(args...)   = _getfield(args...)
invoke(args...) = _invoke(args...)
is(args...) = _is(args...)
isa(args...)= _isa(args...)
isdefined(args...)  = _isdefined(args...)
issubtype(args...)  = _issubtype(args...)
kwcall(args...) = _kwcall(args...)
nfields(args...)= _nfields(args...)
setfield!(args...)  = _setfield!(args...)
svec(args...)   = _svec(args...)
throw(args...)  = _throw(args...)
tuple(args...)  = _tuple(args...)
typeassert(args...) = _typeassert(args...)
typeof(args...) = _typeof(args...)

This would allow to extend things like getfield and setfield!, throw, etc.
I think.
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2016-01-06 8:42 GMT-06:00 Tim Holy :

> On Wednesday, January 06, 2016 06:06:17 AM Ismael Venegas Castelló wrote:
> > could we
> > switch to arrays instead of keep using svecs once julia defines the array
> > type?
>
> Won't work. svecs are used all over the C code, because the C code is the
> core
> from which you bootstrap. Moreover, you don't "throw away" the C code once
> more of julia is up and running---it's still used to manipulate ASTs,
> compute
> type intersection and subtyping, perform method dispatch, perform codegen,
> etc.
>
> If you tried to "switch" to arrays, you'd have to implement everything
> twice,
> effectively.
>
> --Tim
>
> >
> > El martes, 5 de enero de 2016, 9:09:08 (UTC-6), Matt Bauman escribió:
> > > On Tuesday, January 5, 2016 at 3:23:14 AM UTC-5, Ismael Venegas
> Castelló
> > >
> > > wrote:
> > >> Why force `methods` to work with anything?
> > >
> > > Because you can call anything:
> > >
> > > julia> call(x::Char) = x+1
> > > call (generic function with 1038 methods)
> > >
> > > julia> 'c'()
> > > 'd'
> > >
> > > julia> methods('c')
> > >
> > > 1-element Array{Any,1}:
> > >  call(x::Char) at none:1
> > >
> > > There's been a much stronger push for documenting the external
> interfaces,
> > > but there's more and more internal developer documentation these days,
> too
> > > ( http://docs.julialang.org/en/latest/devdocs/julia/).  It's getting
> > > better.
> > >
> > > I believe flisp.boot is a generated file.
> > >
> > > Builtins are simply functions (and types) that are written in C;
> necessary
> > > for bootstrapping.  You can find the mapping between their Julia names
> and
> > > the C definitions here:
> > >
> https://github.com/JuliaLang/julia/blob/baf174f5c252a438006c6f23ed7097fbab
> > > 004025/src/builtins.c#L1202-L1284.>
> > >  Search for their C names to find their definitions.  They accept any
> > >
> > > number of Any arguments within their function definitions, but those
> that
> > > require a certain number of arguments have error checking within the C
> > > function.
> > >
> > > Also note that anonymous functions have the type `Function`, too.  The
> > > introspection utility you want is `isgeneric`.  I imagine lots of this
> > > will
> > > change with the jb/functions branch, where all functions are generic.
>
>


Re: [julia-users] Why SimpleVector / svec?

2016-01-06 Thread Ismael VC
I see then documentation is the way to go, I don’t know how these functions
will fit with the new changes Jeff is making, but i also thought about
expanding the type hierarchy by adding an abstract BuiltinFunction just
like there is IntrinsicFunction albeit also undocumented, both would be
subtypes of Function:

help?> IntrinsicFunction
search: IntrinsicFunction

  No documentation found.

  Summary:

  immutable IntrinsicFunction <: Any

This would allow us to be more specific in the error handling here:

function methods(f::Function)
if !isgeneric(f)
if isa(f, Builtinfunction)
throw(ArgumentError("argument is a builtin function not a
generic function"))
elseif isa(f, IntrinsicFunction)
throw(ArgumentError("argument is an intrinsic function not
a generic function"))
end
end
f.env
end

Something like that, and then one can go on and look at the documentation
what are these other kinds of functions and why they are needed and why
they are different that generic functions.
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Frichit.com.mx%2F=4656540167962624=f413242b-5bad-4bb4-80bd-4d6c5b5b18de>

<https://www.facebook.com/richitsolution>
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Ftwitter.com%2Frichitsolution=4656540167962624=f413242b-5bad-4bb4-80bd-4d6c5b5b18de>
  <conta...@richit.com.mx>

Tel. 6718 1818
richit.com.mx

2016-01-06 10:03 GMT-06:00 Stefan Karpinski <ste...@karpinski.org>:

> To expand on why that is a little more, user-defined code can do anything
> it wants, including lie about, e.g. whether a function is applicable to
> arguments or not, whether one type is a subtype of another or not, what the
> type of something is, etc. These things are so basic to how Julia works
> that if we allow the user to lie about them, it's very likely that
> everything will completely break.
>
> On Wed, Jan 6, 2016 at 11:00 AM, Stefan Karpinski <ste...@karpinski.org>
> wrote:
>
>> If we allow many of these to be user-defined, they will break a lot of
>> things. See #1974 <https://github.com/JuliaLang/julia/issues/1974> for
>> example.
>>
>> On Wed, Jan 6, 2016 at 10:53 AM, Ismael VC <ismael.vc1...@gmail.com>
>> wrote:
>>
>>> Thanks for your answer Tim, what do you think about wrapping the
>>> builtins in julia functions, does it makes sense?
>>>
>>> Rename builtins with a trailing underscore, and map them to julia
>>> generic functions
>>>
>>> applicable(args...) = _applicable(args...)
>>> apply_type(args...) = _apply_type(args...)
>>> arrayref(args...)   = _arrayref(args...)
>>> arrayset(args...)   = _arrayset(args...)
>>> arraysize(args...)  = _arraysize(args...)
>>> fieldtype(args...)  = _fieldtype(args...)
>>> getfield(args...)   = _getfield(args...)
>>> invoke(args...) = _invoke(args...)
>>> is(args...) = _is(args...)
>>> isa(args...)= _isa(args...)
>>> isdefined(args...)  = _isdefined(args...)
>>> issubtype(args...)  = _issubtype(args...)
>>> kwcall(args...) = _kwcall(args...)
>>> nfields(args...)= _nfields(args...)
>>> setfield!(args...)  = _setfield!(args...)
>>> svec(args...)   = _svec(args...)
>>> throw(args...)  = _throw(args...)
>>> tuple(args...)  = _tuple(args...)
>>> typeassert(args...) = _typeassert(args...)
>>> typeof(args...) = _typeof(args...)
>>>
>>> This would allow to extend things like getfield and setfield!, throw,
>>> etc. I think.
>>> ​
>>>
>>> Ismael Venegas Castelló
>>>
>>> *Data Analyst*
>>>
>>> Cel. 044 55 6434 0229
>>>
>>> ivene...@richit.com.mx
>>>
>>> Cerro San Francisco 357, C.P. 04200
>>>
>>> Campestre Churubusco, Coyoacán
>>>
>>> Ciudad de México
>>>
>>> <http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Frichit.com.mx%2F=4656540167962624=8cd666ab-5464-4924-dee0-05beca79ab1e>
>>>
>>> <https://www.facebook.com/richitsolution>
>>> <http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2F

Re: [julia-users] Overriding the = operator

2016-01-06 Thread Ismael VC
Please ignore this part:

julia> macro ≔(v, b)
   e = Expr(:global, v)
   :(global $e; $(esc(v)) = $(esc(b)))

As you can see even the end keyword is missing, so it would have made an
incomplete input error.

It was a mistake on my part I pasted an incomplete part of a prior version
of the macro of when I was testing it *sorry for the confusion.*

Even when you added the end keyword yourself, you can see that the second
line says e = Expr(:global, v) and then the third says: :(global $e;
$(esc(v)) = $(esc(b))), so global is repeating two times, the message ERROR:
syntax: invalid syntax in "global" declaration is because this duplication,
is like trying to type:

julia> x = 5
5

julia> let
   global global x# ooops!
   end
ERROR: syntax: invalid syntax in "global" declaration
 in eval at boot.jl:263

You can see that before redefining the macro it works
​just ​
as expected.

​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2016-01-06 16:55 GMT-06:00 Rob J. Goedman :

> Hi Ismael,
>
> Just trying to learn from this thread, on both Julia 0.4.2 and 0.5 I get
> an error in the 2nd version of the macro:
>
> *julia> **≔(var, block) = @eval $var = $block*
> *≔ (generic function with 1 method)*
>
> *julia> *
>
> *julia> **@show :foo ≔ "some foo"; foo*
> :foo ≔ "some foo" = "some foo"
> *"some foo"*
>
> *julia> **@show :foo ≔ 42; foo*
> :foo ≔ 42 = 42
> *42*
>
> *julia> *
>
> *julia> **macro ≔(v, b)*
>*  e = Expr(:global, v)*
>*  :($e; $(esc(v)) = $(esc(b)))*
>*end*
> *@≔ (macro with 1 method)*
>
> *julia> *
>
> *julia> **@≔ foo :FOOL*
> *:FOOL*
>
> *julia> *
>
> *julia> **@≔ fooled :FOOLED; fooled*
> *:FOOLED*
>
> *julia> *
>
> *julia> **macro ≔(v, b)*
>*  e = Expr(:global, v)*
>*  :(global $e; $(esc(v)) = $(esc(b)))*
>*end*
> *@≔ (macro with 1 method)*
>
> *julia> *
>
> *julia> **@≔ bar "some bar"; bar*
> *ERROR: syntax: invalid syntax in "global" declaration*
> * in eval at ./boot.jl:265*
>
> *julia> *
>
> *julia> **@≔ bar 19; bar*
> *ERROR: syntax: invalid syntax in "global" declaration*
> * in eval at ./boot.jl:265*
>
> *julia> *
>
> *julia> **versioninfo()*
> Julia Version 0.5.0-dev+2021
> Commit bc1c18e (2016-01-06 17:45 UTC)
> Platform Info:
>   System: Darwin (x86_64-apple-darwin15.3.0)
>   CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
>   WORD_SIZE: 64
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
>   LAPACK: libopenblas64_
>   LIBM: libopenlibm
>   LLVM: libLLVM-3.3
>
> In addition to the ‘end’ line, is something else needed to make exporting
> to the global environment work?
>
> Regards,
> Rob
>
>
> On Jan 5, 2016, at 03:53, Ismael Venegas Castelló 
> wrote:
>
> You could use another similar operator like \coloneq:
>
> julia> ≔(var, block) = @eval $var = $block
> ≔ (generic function with 1 method)
>
> julia> @show :foo ≔ "some foo"; foo
> :foo ≔ "some foo" = "some foo"
> "some foo"
>
> julia> @show :foo ≔ 42; foo
> :foo ≔ 42 = 42
> 42
>
> julia> macro ≔(v, b)
>e = Expr(:global, v)
>:($e; $(esc(v)) = $(esc(b)))
>end
>
> julia> @≔ foo :FOO
> :FOO
>
> julia> @≔ foo :FOO; foo
> :FOO
>
> julia> macro ≔(v, b)
>e = Expr(:global, v)
>:(global $e; $(esc(v)) = $(esc(b)))
>
> julia> @≔ bar "some bar"; bar
> "some bar"
>
> julia> @≔ bar 7; bar
> 7
>
>
>
> El martes, 5 de enero de 2016, 3:18:07 (UTC-6), Julia Tylors escribió:
>>
>> Hi,
>>
>> How can i override the = operator?
>>
>> Thanks
>>
>> function ={T}(x::T,y::T)
>> ...
>> end
>>
>> didn't work
>>
>> Thanks
>>
>
>


Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2016-01-04 Thread Ismael VC
Just my thoughts:

   - You can’t have Set{R, S} only Set{T}, Set{DataType}([R, S]) for
   example.
   - The moment you want to dispatch on those subtypes you would need to do
   something like Union{Ts...}, where Ts is an array or set of such
   subtypes.
   - Union{R, S} == Union{S, R} is true.
   - Base.length(u::Union) = length(u.types) for cardinality.

It’s an interesting thought experiment! :D
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2016-01-04 21:04 GMT-06:00 Ray Toal :

> All good, but I just can't see it. If I have:
>
> julia> abstract T
> julia> type S <: T; end
> julia> type R <: T; end
>
> and I ask "What are the subtypes of T?" I would expect to get back either
>
> [S,R]
>
> or
>
> [R,S]
>
> or even
>
> Set{R,S}
>
> because each of those things have cardinality 2. Because there are 2
> subsets of T. If instead I were to get back the value
>
> Union{R,S}
>
> then that would be answering the question "What are the subtypes of T?"
> with the answer "This SINGLE type whose values are all the same as the
> original type." That I **can't** understand (and would be surprised if Jeff
> would), but if everyone else thinks it makes sense, no worries! We can
> disagree. Our expectations might differ on this.
>
> I thought it was a fun thought experiment to begin with
>
> Thanks for the discussion.
>
> On Monday, January 4, 2016 at 5:48:53 PM UTC-8, Ismael Venegas Castelló
> wrote:
>>
>> After watching the video: *Jeff Bezanzon: Julia - The base language,
>> future directions and speculations
>>  *as Scott mentions,
>> returning a Union type indeed starts to make sense to me.
>>
>>
>> El sábado, 2 de enero de 2016, 13:09:43 (UTC-6), Scott Jones escribió:
>>>
>>> Going by Jeff's JuliaCon 2015 talk, and the code in
>>> examples/JuliaTypes.jl, I think returning the subtypes as a set of types
>>> (which is the same as a union of types) makes perfect sense.
>>> I'm hoping that this change does make it into 0.5, I think it does clean
>>> up a lot of bad corner cases in the current type system (which Jeff also
>>> mentioned in his talk)
>>>
>>> On Tuesday, December 29, 2015 at 5:45:51 PM UTC-5, Ray Toal wrote:

 But maybe I'm not understanding this correctly? Was it suggested that a
 type union be the result of the subtypes method? I don't think that makes
 sense The subtypes of a type is a set of types, not a type (even if
 that type were the union of all the subtypes). It strikes me as a little
 odd, but I may have misheard, or there might me an interpretation of it
 that I haven't thought about.

 On Tuesday, December 29, 2015 at 7:02:41 AM UTC-8, Scott Jones wrote:
>
> Yes!  I was hoping that Jeff had implemented something super fast
> for type unions.




Re: [julia-users] Does any one have Raspberry Pi 2 Julia binaries?

2015-12-29 Thread Ismael VC
Thank you I will try it ASAP!

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México
<https://richit.com.mx/>

<https://www.facebook.com/richitsolution>
<https://twitter.com/richitsolution>  <conta...@richit.com.mx>

Tel. 6718 1818
richit.com.mx

2015-12-29 17:06 GMT-06:00 Viral Shah <vi...@mayin.org>:

>
> Can folks try the download here on various ARM systems and report? This is
> built from the julia 0.4 release branch.
>
> https://drive.google.com/open?id=0B0rXlkvSbIfhbWxOVllKUXc1RDA
>
> I will link these binaries on the Julia downloads page as alpha, with
> appropriate warnings and links to issues etc.
>
> -viral
>
>
> -viral
>
>
>
> > On 30-Dec-2015, at 12:41 AM, Ismael VC <ismael.vc1...@gmail.com> wrote:
> >
> > +1
> >
> > Viral yes please do when you get the chance. I think that's a great idea
> that will benefit many people, thank you very much!
> >
> > Ismael Venegas Castelló
> > Data Analyst
> > Cel. 044 55 6434 0229
> > ivene...@richit.com.mx
> > Cerro San Francisco 357, C.P. 04200
> > Campestre Churubusco, Coyoacán
> > Ciudad de México
> >
> >
> > Tel. 6718 1818
> > richit.com.mx
> >
> > 2015-12-29 10:50 GMT-06:00 Viral Shah <vi...@mayin.org>:
> > Perhaps I should just build for 0.4.2 and upload as an alpha release to
> our downloads page?
> >
> > -viral
> >
> >
> > On Monday, December 28, 2015 at 4:16:45 AM UTC+5:30, Milan Bouchet-Valat
> wrote:
> > Le dimanche 27 décembre 2015 à 11:47 -0800, Ismael Venegas Castelló a
> > écrit :
> > > has anyone successfully built Julia for Raspberry Pi 2? I understand
> > > that it's able to build now. If anyone has been able to do this
> > > ...could you share your binary? I'm building it right now, but it
> > > seems it's going to take ages, and I have yet to see it fail or not!
> > >
> > > I want to build a Raspberry Pi 2 Julia DIY calculator! Like this one:
> > > https://www.youtube.com/watch?v=lJu1ij_Emlk
> > >
> > > These could be used for plotting:
> > > https://github.com/johnmyleswhite/ASCIIPlots.jl
> > > https://github.com/sunetos/TextPlots.jl
> > > https://github.com/Evizero/UnicodePlots.jl
> > Viral posted a link to 0.4 ARM binaries here:
> > https://groups.google.com/d/msg/julia-users/lEDCaBbMMKM/jQ5W4-tdAAAJ
> >
> >
> > Regards
> >
>
>


Re: [julia-users] Re: passing function as arguments and avoiding unecessary allocations

2015-12-28 Thread Ismael VC
How about this?

julia> sinc{T<:AbstractFloat}(x::T) = x != 0 ? sin(π*x)/(π*x) : one(T)
sinc (generic function with 1 method)

julia> methods(sinc)
# 1 method for generic function "sinc":
sinc{T<:AbstractFloat}(x::T<:AbstractFloat) at none:1

julia> @vectorize_1arg AbstractFloat sinc
sinc (generic function with 4 methods)

julia> methods(sinc)
# 4 methods for generic function "sinc":
sinc{T<:AbstractFloat}(x::T<:AbstractFloat) at none:1
sinc{T<:AbstractFloat}(::AbstractArray{T<:AbstractFloat,1}) at operators.jl:380
sinc{T<:AbstractFloat}(::AbstractArray{T<:AbstractFloat,2}) at operators.jl:381
sinc{T<:AbstractFloat}(::AbstractArray{T<:AbstractFloat,N}) at operators.jl:383

julia> @time sinc(rand(10_000));
  0.055184 seconds (45.92 k allocations: 2.139 MB)

julia> @time sinc(rand(10_000));
  0.000251 seconds (10 allocations: 156.563 KB)

julia> @code_warntype sinc(rand(10_000))
Variables:
  #102#x::Array{Float64,1}
  #s76::Int64
  #s75::Int64
  #s74::Int64
  #101#i::Int64
  #s73::Int64

Body:
  begin  # operators.jl, line 380:
  GenSym(8) = (Base.arraylen)(#102#x::Array{Float64,1})::Int64
  GenSym(0) = $(Expr(:new, UnitRange{Int64}, 1, :(((top(getfield))(Base.Intr
insics,:select_value)::I)((Base.sle_int)(1,GenSym(8))::Bool,GenSym(8),(Base.box)
(Int64,(Base.sub_int)(1,1)))::Int64)))
  GenSym(1) = (Base.box)(Int64,(Base.checked_sadd)((Base.box)(Int64,(Base.ch
ecked_ssub)((top(getfield))(GenSym(0),:stop)::Int64,(top(getfield))(GenSym(0),:s
tart)::Int64)),1))
  0:
  GenSym(3) = (top(ccall))(:jl_alloc_array_1d,(top(apply_type))(Base.Array,F
loat64,1)::Type{Array{Float64,1}},(top(svec))(Base.Any,Base.Int)::SimpleVector,A
rray{Float64,1},0,GenSym(1),0)::Array{Float64,1}
  #s76 = 1
  #s75 = (top(getfield))(GenSym(0),:start)::Int64
  #s74 = 0
  unless (Base.box)(Base.Bool,(Base.not_int)(#s74::Int64 === GenSym(1)::Bool
)) goto 2
  3:
  #s74 = (Base.box)(Base.Int,(Base.add_int)(#s74::Int64,1))
  GenSym(10) = #s75::Int64
  GenSym(11) = (Base.box)(Base.Int,(Base.add_int)(#s75::Int64,1))
  #s73 = 1
  GenSym(12) = GenSym(10)
  GenSym(13) = (Base.box)(Base.Int,(Base.add_int)(1,1))
  #101#i = GenSym(12)
  #s73 = GenSym(13)
  GenSym(14) = GenSym(11)
  GenSym(15) = (Base.box)(Base.Int,(Base.add_int)(2,1))
  #s75 = GenSym(14)
  #s73 = GenSym(15)
  GenSym(4) = (Main.sinc)((Base.arrayref)(#102#x::Array{Float64,1},#101#i::I
nt64)::Float64)::Float64
  $(Expr(:type_goto, 0, GenSym(4)))
  $(Expr(:boundscheck, false))
  (Base.arrayset)(GenSym(3),GenSym(4),#s76::Int64)::Array{Float64,1}
  $(Expr(:boundscheck, :(Main.pop)))
  #s76 = (Base.box)(Base.Int,(Base.add_int)(#s76::Int64,1))
  4:
  unless (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_
int)(#s74::Int64 === GenSym(1)::Bool goto 3
  2:
  1:
  return GenSym(3)
  end::Array{Float64,1}

julia> sinc(rand(4, 4))
4x4 Array{Float64,2}:
 0.671308  0.28010.110566  0.0508818
 0.201512  0.416824  0.993366  0.537811
 0.999858  0.74607   0.836841  0.0222563
 0.592876  0.667453  0.612684  0.81811

julia> sinc(rand(4, 4, 2))
4x4x2 Array{Float64,3}:
[:, :, 1] =
 0.1301 0.406598  0.95419   0.0530077
 0.810275   0.917711  0.94  0.289211
 0.0391342  0.970136  0.456169  0.34722
 0.565740.726088  0.956873  0.99049

[:, :, 2] =
 0.632377  0.844147  0.963265  0.0472808
 0.569625  0.834078  0.183842  0.323166
 0.51727   0.989112  0.568156  0.874306
 0.533161  0.988943  0.931382  0.133851

julia>

​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2015-12-27 15:00 GMT-06:00 alan souza :

> Thanks for the tip. I was trying to annotate the function call before the
> loop without success.
>
> Do you know the reason for the speedup? Because the extra allocations
> still happening albeit a little less.
>
> thanks
>
> On Sunday, December 27, 2015 at 5:07:56 PM UTC-2, Lutfullah Tomak wrote:
>>
>> It seems adding typecheck is 2x improvements in my laptop.
>>y = zeros(T, n)
>> for i in eachindex(X)
>> y[i] = F(X[i])::T
>> end
>> return y
>>
>


Re: [julia-users] Re: How to avoid extra allocations when passing a function as parameter

2015-12-28 Thread Ismael VC
Yes, from version 0.4 onwards you can use T <: AbstractFloat, for version
0.3 and before, I think it would be T <: FloatingPoint.
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2015-12-27 14:58 GMT-06:00 alan souza :

> Sorry for the double posting.
> Actually I was only interested for "decimal" inputs (single and double
> precision) is there a better way to express this instead of using Real?
> thanks
>
>
> On Sunday, December 27, 2015 at 6:09:30 PM UTC-2, Ismael Venegas Castelló
> wrote:
>>
>> For calcF your variables:
>>
>> Variables:
>>   X::Array{Float64,1}
>>   F::F
>>   n::Int64
>>   y::Array{Float64,1}
>>   #s76::Int64
>>   i::Int64
>>   ##dims#7321::Tuple{Int64}
>>
>> and return value:
>>
>> return y::Array{Float64,1}
>> end::Array{Float64,1}
>>
>> Are correctly inferred if I use floats so it seems fine.
>>
>> But if I use int's as arguments to main I get an InexactError, are you
>> sure it should accept `T <: Real`?  Maybe you just need Float64?
>>
>>
>>
>> El domingo, 27 de diciembre de 2015, 11:21:35 (UTC-6), alan souza
>> escribió:
>>>
>>> Hi. I was wondering what is the correct way to pass a function as
>>> argument preserving the return type information of this function
>>>
>>> For instance in the following code:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *function sinc{T<:Real}(x::T)return T((x != zero(T)
>>> )?(sin(pi*x)/(pi*x)):(one(T)))endfunction calcF{T<:Real}(X::Array{T,1},
>>> F::Function)n = length(X); @assert(n > 0)y = zeros(T, n)for
>>> i in eachindex(X)y[i] = F(X[i])endreturn yendfunction
>>> calcSinc{T<:Real}(X::Array{T,1})n = length(X); @assert(n > 0)y
>>> = zeros(T, n)for i in eachindex(X)y[i] = sinc(X[i])end
>>> return yendfunction main{T<:Real}(min::T, max::T, d::T)X =
>>> collect(min:d:max)calcF(X, sinc)calcSinc(X)@code_warntype
>>> calcF(X, sinc)@time calcF(X, sinc)@code_warntype calcSinc(X)
>>> @time calcSinc(X)YF = calcF(X, sinc)YS = calcSinc(X)end*
>>>
>>> Running this code with julia (versions 0.5+dev or 0.4.2) I got these
>>> results:
>>>
>>>
>>>
>>>
>>>
>>>
>>> *  #s1 = GenSym(5) # /home/me/scratch/julia_fd/teste.jl, line
>>> 10:  GenSym(2) =
>>> (F::F)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::ANY
>>> (Base.arrayset)(y::Array{Float64,1},(top(typeassert))((Base.convert)(Float64,GenSym(2))::ANY,Float64)::Float64,i::Int64)::Array{Float64,1}
>>> 5:   unless
>>> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>>> ===
>>> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>>> goto 4  3:   0.080181 seconds (1.88 M allocations: 33.556 MB, 6.41% gc
>>> time)*
>>>
>>> and for the calcSinc function:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *   #s1 = GenSym(5) # /home/me/scratch/julia_fd/teste.jl, line 20:
>>> GenSym(2) =
>>> (Main.sinc)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::Float64
>>> (Base.arrayset)(y::Array{Float64,1},GenSym(2),i::Int64)::Array{Float64,1}
>>> 5:   unless
>>> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>>> ===
>>> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>>> goto 4  3:   0.031224 seconds (2 allocations: 4.794 MB)*
>>> Is there a way to prevent the result of function to "evaluate" to ::Any
>>> on the first case?
>>>
>>> thanks
>>>
>>>


Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2015-12-28 Thread Ismael VC
Ok then I'll make a PR for that, and see if I find more uses like this that
can be changed.

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Frichit.com.mx%2F=4656540167962624=a60b85b8-29a2-4387-dac4-d841433d9784>

<https://www.facebook.com/richitsolution>
<http://t.sidekickopen35.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Ftwitter.com%2Frichitsolution=4656540167962624=a60b85b8-29a2-4387-dac4-d841433d9784>
  <conta...@richit.com.mx>

Tel. 6718 1818
richit.com.mx

2015-12-28 12:12 GMT-06:00 Stefan Karpinski <ste...@karpinski.org>:

> Sure. That avoids unnecessarily copying the array.
>
> On Mon, Dec 28, 2015 at 10:51 AM, Ismael Venegas Castelló <
> ismael.vc1...@gmail.com> wrote:
>
>> Stefan, wouldn't using `sort!` instead of `sort` be better here in this
>> case?:
>>
>> subtypes(m::Module, x::DataType) = sort(collect(_subtypes(m, x)),
>> by=string)
>>
>> subtypes(m::Module, x::DataType) = sort!(collect(_subtypes(m, x)),
>> by=string)
>>
>>
>>
>> El lunes, 28 de diciembre de 2015, 9:25:08 (UTC-6), Stefan Karpinski
>> escribió:
>>>
>>> No, please don't spend time on this. We're not going to change this to
>>> return a heavyweight data structure like a Set when a simple structure like
>>> and Array will do. In mathematics sets are simpler than ordered
>>> collections, but in programming languages the relationship is reversed. In
>>> general data structures like Set are only used when they are necessary,
>>> such as when you need O(1) checking for inclusion. Since there's no such
>>> need here, an array is simpler and better.
>>>
>>> On Mon, Dec 28, 2015 at 2:40 AM, Kevin Squire <kevin@gmail.com>
>>> wrote:
>>>
>>>> Hi Ray,
>>>>
>>>> You're probably the first person to make this observation. I can see
>>>> your point, and I don't really have a strong argument or opinion,
>>>> really--the main reason it's sorted is probably because it looks
>>>> nicer--at least if I did write that code, that would  have been my
>>>> reasoning.
>>>>
>>>> If you're up for it, you could change it to create a set and submit a
>>>> pull request. No guarantees it gets accepted, but the likelihood increases
>>>> significantly over not submitting one. :-)
>>>>
>>>> Cheers,
>>>>Kevin
>>>>
>>>>
>>>> On Sunday, December 27, 2015, Ray Toal <ray@gmail.com> wrote:
>>>>
>>>>> I'm sure the order won't ever change, but I'd still find it odd if the
>>>>> documentation of subtypes were to say
>>>>>
>>>>> "Returns a list of subtypes, sorted by the name of the subtype"
>>>>>
>>>>> because, well, what about namespaces? What about all sorts of Unicode
>>>>> collation definitions that would have to be a part of such a definition?
>>>>>
>>>>> Yes, as much as I would like to just assert that the result of calling
>>>>> subtypes on Type produces the array [DataType, TypeConstructor, Union
>>>>> ] it's just not supposed to be an array, even if today we can
>>>>> guarantee that the array will be sorted, and it is ridiculously unlikely 
>>>>> to
>>>>> change.
>>>>>
>>>>> I just think of unordered collections as sets. I don't think anyone
>>>>> would or should ever write code that takes advantage of the fact that this
>>>>> array is sorted, though. :)
>>>>>
>>>>> Thanks for the responses
>>>>>
>>>>> Ray
>>>>>
>>>>>
>>>>> On Sunday, December 27, 2015 at 5:10:46 PM UTC-8, Kevin Squire wrote:
>>>>>>
>>>>>> Thanks for looking and posting (I've been on my phone).  I think I
>>>>>> might have written that code, actually. ;-)
>>>>>>
>>>>>> Cheers!
>>>>>>Kevin
>>>>>>
>>>>>> On Sunday, December 27, 2015, Ismael VC <ismael...@gmail.com> wrote:
>>>>>>
>>>>>>> Kevin I tested in my Win laptop with 0.3.11, 0.4.2

Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2015-12-28 Thread Ismael VC
I thougt one advantage of using sets would be the ability to use set
operations, but they work on arrays to, by the way the documentation of ie,
union falls short, because it’s actually more general than what it says (*not
only sets*):

help?> union
search: union union! Union @unix_only function Function functionloc functionlocs

  union(s1,s2...)
  ∪(s1,s2...)

  Construct the union of two or more sets. Maintains order with arrays.

julia> union([1, 1], [2])# this also works!
2-element Array{Int64,1}:
 1
 2

​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2015-12-28 12:44 GMT-06:00 Scott Jones :

> How would this fit in with Jeff's work on types/subtypes?
> At JuliaCon he did talk about improving the type system (something I've
> been really hoping to see).
> It seems to me that it might be more logically consistent to return a type
> union for this, but I understand that currently it is easier to work with
> returning a simple sorted vector.
>
> Scott
>
> On Sunday, December 27, 2015 at 12:10:38 AM UTC-5, Kevin Squire wrote:
>>
>>
>>
>> On Saturday, December 26, 2015, Ray Toal  wrote:
>>
>>> I noticed that
>>>
>>> *julia> **subtypes(Type)*
>>>
>>> *3-element Array{Any,1}:*
>>>
>>> * DataType  *
>>>
>>> * TypeConstructor*
>>>
>>> * Union *
>>>
>>> and was wondering if there was any significance in the order of the
>>> subtypes. If not, could the method have produced a Set instead?
>>>
>>>
>> It could, but why?  A set has a bit more overhead than an array, and for
>> most types, the number of subtypes is small enough that sets wouldn't
>> really offer any advantage.
>>
>> Is there something you want to do with the results that you think
>> requires a set?
>>
>> Cheers,
>> Kevin
>>
>


Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2015-12-27 Thread Ismael VC
Kevin I tested in my Win laptop with 0.3.11, 0.4.2, 0.4, 0.5+ also the same
versions in julia box, and the output is deterministically sorted, It seems
this has been the way it works for some time now, then I looked at the code
and it’s indeed sorted (should have done that first! :P ):

   - http://git.io/vEXL9

subtypes(m::Module, x::DataType) = sort(collect(_subtypes(m, x)), by=string)
subtypes(x::DataType) = subtypes(Main, x)

I would expect a very good reason in order to justify a change for this now.
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México




  

Tel. 6718 1818
richit.com.mx

2015-12-27 18:06 GMT-06:00 Kevin Squire :

> Ray, thanks for the clarification--makes sense. In fact, for introspection
> code like 'subtypes', performance is probably the wrong argument--it's
> unlikely that it occurs in performance-critical code. I think it's really
> that arrays are just simpler.
>
> One aesthetic change I could imagine would be to have the results sorted
> before returning, which would keep the same data structure, but solve your
> problem, and present the subtypes in a way the user would likely find more
> useful.
>
> Ismael, it might be a little brittle to depend on the current order
> (unless it's always sorted now).
>
> Cheers,
>Kevin
>
>
> On Sunday, December 27, 2015, Ismael Venegas Castelló <
> ismael.vc1...@gmail.com> wrote:
>
>> You can just do:
>>
>> @assert subtypes(Type) == [DataType, TypeConstructor, Union]
>>
>> I just tested this:
>>
>> julia> @time for i in 1:1000
>>@assert subtypes(Type) == [DataType, TypeConstructor, Union]
>>end
>>   3.025415 seconds (767.00 k allocations: 224.075 MB, 0.49% gc time)
>>
>>
>>
>> El sábado, 26 de diciembre de 2015, 12:52:51 (UTC-6), Ray Toal escribió:
>>>
>>> I noticed that
>>>
>>> *julia> **subtypes(Type)*
>>>
>>> *3-element Array{Any,1}:*
>>>
>>> * DataType  *
>>>
>>> * TypeConstructor*
>>>
>>> * Union *
>>>
>>> and was wondering if there was any significance in the order of the
>>> subtypes. If not, could the method have produced a Set instead?
>>>
>>>


[julia-users] Re: Parallel @sync @async

2015-12-02 Thread Ismael VC
You can use `vcat` to reduce it to an array:

julia> r = @parallel vcat for i=1:10
   a[rand(1:end)]
   end;

julia> typeof(r), size(r)
(Array{Float64,1},(10,))

Is this what you are after?

El domingo, 22 de noviembre de 2015, 17:17:46 (UTC-6), digxx escribió:
>
> As you could see, the reduction operator can be omitted if it is not 
> needed. In that case, the loop executes asynchronously,
> i.e. it spawns independent tasks on all available workers and returns an 
> array of RemoteRef (page 399)
> immediately without waiting for completion. The caller can wait for the 
> RemoteRef (page 399) completions at a
> later point by calling fetch() (page 398) on them, or wait for completion 
> at the end of the loop by prefixing it with
> @sync (page 399), like @sync @parallel for.
>
> (From the manual)
>
> When I try:
> a=randn(1000)
> r=@parallel for i=1:10
>a[rand(1:end)]
>end
> I get an array of remoteref()
> When calling fetch(r[1]) for example I get an empty line?
>
> What does completion mean in this sense?
> Each worker runs its own own loop and completion at the end or after each 
> iteration?
> e.g. 2 workers run from i= 1 to 100. Now completion means that after each 
> i the first finished worker waits for the other so they can proceed to i+1 
> ??
>
> For example the following test is much faster when I include an @async 
> infront of the execution part and leave the @sync out
> Does this parallel program even run parallel if I leave both @sync and 
> @sync out, since its seems to be slower than the serial alternative?
>
> @everywhere function myrange(q::SharedArray)
>  idx = indexpids(q)
>  if idx == 0
>   return 1:0
>  else
>  nchunks = length(procs(q))
>  splits = [round(Int, s) for s in linspace(0,size(q,1),nchunks+1)]
>  splits[idx]+1:splits[idx+1]
>  end
> end 
>
> @everywhere function g(q::SharedArray)
>  q[myrange(q)].^2
> end
>
>
> function h(q::SharedArray)
>  #@sync begin
>  res=Array(Float64,size(q,1));
>  for p in procs(q)
>   @async res[remotecall_fetch(p,myrange,q)]=remotecall_fetch(p,g,q)
>  end
>  #end
>  res
> end
>


[julia-users] How to upload file and also specify data options with Requests.jl?

2015-12-02 Thread Ismael VC
Hello everyone!

I've been trying/learning how to wrap HPE Haven OnDemand API 
 with Julia: HavenOnDemand.jl. but I 
havent figured out how to send multipart data, plus other parameters, it 
seems to me that one can only do one or the other:

"Main `HavenOnDemand` function, used to call **Haven OnDemand** API."
function call_HOD(
endpoint:: String,
async   :: Bool,# Some endpoints are `async_only`.
files   :: Vector{FileParam},
options :: Dict;
api_url :: String = "https://api.havenondemand.com;,
version :: Int= 1,
default_version :: Int= 1,
)

try
options["apikey"] = _HOD_API_KEY
catch
error("Use `HavenOnDemand.set_api_key(api_key::AbstractString)` 
first.")
end

sync_str = async ? "async" : "sync"
r = post(

"$(api_url)/$(version)/api/$(sync_str)/$(endpoint)/v$(default_version)",
files = files,# <--- HERE'S THE PROBLEM!
data = options
)
return r.status == 200 ? json(r) : throw(HODException(r))
end

"`DataFrame` that holds the `HavenOnDemand` data used wrap the API."
const _HOD_API = readtable(
joinpath(Pkg.dir("HavenOnDemand"), "src", "api.data"),
separator = ' '
)

# Meta wrap most of the API:
for row in eachrow(_HOD_API::DataFrame)
func_name, endpoint, async_only, description = [v for (k, v) in row]
title = join([ucfirst(s) for s in split(func_name, '_')], ' ')
docstring = """
**HPE Haven OnDemand: $(title)**

`$(func_name)([kwargs...])`

$description

All the arguments are optional and they must be supplied as keyword
arguments, non valid keyword names are ignored.

For information about valid arguments, visit:

* https://dev.havenondemand.com/apis/$(endpoint)
"""

@eval begin
@doc $docstring ->
function $(symbol(func_name))(; file = [], kwargs...)
return call_HOD(
$endpoint,
$async_only,
[FileParam(open(f)) for f in file],
Dict(kwargs)
)
end
end
end

The error I get is:

ERROR: Multiple body options specified. Please only specify one
 in do_stream_request at 
C:\Users\Peter\.julia\v0.4\Requests\src\Requests.jl:268

If I try to use both *`file`* and *`data`* in the *`Requests.post`* 
function. I need both because I send the *`apikey`* within the *`data`* 
parameter, if I just use *`file`*, then the *`apikey`* is not passed to the 
API and the request fails

These are some examples of what I'm trying to 
achieve: 
https://community.havenondemand.com/t5/Wiki/How-to-POST-a-multipart-form-data-Request/ta-p/200

Here are some implementations in other languages:

   - Ruby: http://git.io/vRmJb
   - Python: http://git.io/vRmfp
   
It all boils down to how to do something like this:

julia> post(
"$(api_url)/$(version)/api/$(sync_str)/$(endpoint)/v$(default_version)", files 
= [FileParam("open(text.txt"))], data = Dict("apikey" => ENV["HOD_API_KEY"])
)
ERROR: Multiple body options specified. Please only specify one
 in do_stream_request at 
C:\Users\Peter\.julia\v0.4\Requests\src\Requests.jl:268

Thanks in advance!


[julia-users] Re: How to upload file and also specify data options with Requests.jl?

2015-12-02 Thread Ismael VC
Curl:

curl -X POST --form "apikey=" --form "file=@myscan.pdf" --form 
"mode=document_photo" https://api.idolondemand.com/1/api/async/ocrdocument/v1



HTML:



Multipart Form Example


https://api.idolondemand.com/1/api/sync/ocrdocument/v1;
 method="post" enctype="multipart/form-data">


Submit





Node:

var needle = require('needle');
var data = {
  apikey: myapikey,
  file: { file: 'myscan.pdf', content_type: 'multipart/form-data' }
}

needle.post('https://api.idolondemand.com/1/api/async/ocrdocument/v1', data, { 
multipart: true }, function(err, resp, body) {
  console.log(body)
  // needle will read the file and include it in the form-data as binary
});


Ruby:

require 'httpclient'
require 'json'

data={file:open("myscan.pdf"), mode:"document_photo", apikey:"apikey"}
clnt = HTTPClient.new
resp=clnt.post(url, data)
body=JSON.parse(resp.body)


Python:

files = {'file': open('myscan.pdf', 'rb')}
data= {'apikey':myapikey,'mode':'document_photo'}
requests.post("https://api.idolondemand.com/1/api/async/ocrdocument/v1",data=data,files=files)
print r.json()


Julia ...how to???

El miércoles, 2 de diciembre de 2015, 19:20:51 (UTC-6), Ismael VC escribió:
>
> Hello everyone!
>
> I've been trying/learning how to wrap HPE Haven OnDemand API 
> <https://dev.havenondemand.com/apis> with Julia: HavenOnDemand.jl. but I 
> havent figured out how to send multipart data, plus other parameters, it 
> seems to me that one can only do one or the other:
>
> "Main `HavenOnDemand` function, used to call **Haven OnDemand** API."
> function call_HOD(
> endpoint:: String,
> async   :: Bool,# Some endpoints are `async_only`.
> files   :: Vector{FileParam},
> options :: Dict;
> api_url :: String = "https://api.havenondemand.com;,
> version :: Int= 1,
> default_version :: Int= 1,
> )
>
> try
> options["apikey"] = _HOD_API_KEY
> catch
> error("Use `HavenOnDemand.set_api_key(api_key::AbstractString)` 
> first.")
> end
>
> sync_str = async ? "async" : "sync"
> r = post(
> 
> "$(api_url)/$(version)/api/$(sync_str)/$(endpoint)/v$(default_version)",
> files = files,# <--- HERE'S THE PROBLEM!
> data = options
> )
> return r.status == 200 ? json(r) : throw(HODException(r))
> end
>
> "`DataFrame` that holds the `HavenOnDemand` data used wrap the API."
> const _HOD_API = readtable(
> joinpath(Pkg.dir("HavenOnDemand"), "src", "api.data"),
> separator = ' '
> )
>
> # Meta wrap most of the API:
> for row in eachrow(_HOD_API::DataFrame)
> func_name, endpoint, async_only, description = [v for (k, v) in row]
> title = join([ucfirst(s) for s in split(func_name, '_')], ' ')
> docstring = """
> **HPE Haven OnDemand: $(title)**
>
> `$(func_name)([kwargs...])`
>
> $description
>
> All the arguments are optional and they must be supplied as keyword
> arguments, non valid keyword names are ignored.
>
> For information about valid arguments, visit:
>
> * https://dev.havenondemand.com/apis/$(endpoint)
> """
>
> @eval begin
> @doc $docstring ->
> function $(symbol(func_name))(; file = [], kwargs...)
> return call_HOD(
> $endpoint,
> $async_only,
> [FileParam(open(f)) for f in file],
> Dict(kwargs)
> )
> end
> end
> end
>
> The error I get is:
>
> ERROR: Multiple body options specified. Please only specify one
>  in do_stream_request at 
> C:\Users\Peter\.julia\v0.4\Requests\src\Requests.jl:268
>
> If I try to use both *`file`* and *`data`* in the *`Requests.post`* 
> function. I need both because I send the *`apikey`* within the *`data`* 
> parameter, if I just use *`file`*, then the *`apikey`* is not passed to 
> the API and the request fails
>
> These are some examples of what I'm trying to achieve: 
> https://community.havenondemand.com/t5/Wiki/How-to-POST-a-multipart-form-data-Request/ta-p/200
>
> Here are some implementations in other languages:
>
>- Ruby: http://git.io/vRmJb
>- Python: http://git.io/vRmfp
>
> It all boils down to how to do something like this:
>
> julia> post(
> "$(api_url)/$(version)/api/$(sync_str)/$(endpoint)/v$(default_version)", 
> files 
> = [FileParam("open(text.txt"))], data = Dict("apikey" => 
> ENV["HOD_API_KEY"]))
> ERROR: Multiple body options specified. Please only specify one
>  in do_stream_request at 
> C:\Users\Peter\.julia\v0.4\Requests\src\Requests.jl:268
>
> Thanks in advance!
>


Re: [julia-users] Re: a=[1:1:10] WARNING ? What to creat vectors in 4.0 ?

2015-11-06 Thread Ismael VC
What DNF means is that must of the time you don't need to convert a range
into an array, since the range is tolerable. The only times I need to do
that is if I need to slice or index the elements of the range.

So what are you doing with this range?
El 06/11/2015 07:54, "Paul Analyst"  escribió:

> Not work   _
>_   _ _(_)_ |  A fresh approach to technical computing
>   (_) | (_) (_)|  Documentation: http://docs.julialang.org
>_ _   _| |_  __ _   |  Type "?help" for help.
>   | | | | | | |/ _` |  |
>   | | |_| | | | (_| |  |  Version 0.4.0 (2015-10-08 06:20 UTC)
>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
> |__/   |  x86_64-w64-mingw32
>
> julia> a=1:10
> 1:10
>
> julia>
>
> W dniu 2015-11-05 o 18:40, DNF pisze:
>
>> Did you try my suggestion? Just use
>> a = 1:10
>>
>> Doesn't it work the way you want?
>>
>
>


[julia-users] Julia Hands-on: Introductory Tutorial for Distributed Computing

2015-11-06 Thread Ismael VC
This is great news, I'll see you there on hangouts, thanks!

[julia-users] Re: a=[1:1:10] WARNING ? What to creat vectors in 4.0 ?

2015-11-05 Thread Ismael VC
Paul, you can also use this syntax with a semi colon:

   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0 (2015-10-08 06:20 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/   |  x86_64-w64-mingw32

julia> [1:10;]
10-element Array{Int64,1}:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10

julia>



El miércoles, 4 de noviembre de 2015, 13:43:55 (UTC-6), paul analyst 
escribió:
>
>_
>_   _ _(_)_ |  A fresh approach to technical computing
>   (_) | (_) (_)|  Documentation: http://docs.julialang.org
>_ _   _| |_  __ _   |  Type "?help" for help.
>   | | | | | | |/ _` |  |
>   | | |_| | | | (_| |  |  Version 0.4.0 (2015-10-08 06:20 UTC)
>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
> |__/   |  x86_64-w64-mingw32
>
> julia> a=[1:1:10]
> WARNING: [a] concatenation is deprecated; use collect(a) instead
>  in depwarn at deprecated.jl:73
>  in oldstyle_vcat_warning at abstractarray.jl:29
>  in vect at abstractarray.jl:32
> while loading no file, in expression starting on line 0
> 10-element Array{Int64,1}:
>   1
>   2
>   3
>   4
>   5
>   6
>   7
>   8
>   9
>  10
>
> julia>
>


[julia-users] Re: "using Gadfly" (using a package) only if needed

2015-11-05 Thread Ismael VC
This also works:

julia> function foo(x, y; make_plot::Bool=false)
   # ...
   if make_plot
   @eval using Gadfly
   plot(x = x, y = y, Geom.line)
   end
   # ...
   end
foo (generic function with 1 method)

julia> x = -π:0.1:π; foo(x, sin(x))

julia> x = -π:0.1:π; foo(x, sin(x), make_plot = true)

julia>



El martes, 4 de agosto de 2015, 12:26:58 (UTC-5), Felipe Jiménez escribió:
>
> I've written a function, fwhm, that goes fast without plotting anything 
> (which is the usual usage).
> But if one optional argument is dodraw = true, it draws a figure to 
> visualize its doings.
> To draw the figure it uses the package Gadfly. But "using Gadfly" takes 
> time to execute (the first time), and most of the sessions it is not needed 
> because by default dodraw = false.
> Since I cannot do "using Gadfly" inside a function, I cannot do something 
> like this:
>
> function fwhm(xk, yk; dodraw::Bool=false)
>   # ...
>
>   if dodraw
> using Gadfly
> plot(x=xk, y=yk)  # etc.
>   end
>
>   # ...
> end
>
> I don't want to add overhead time to every session I use the module where 
> fwhm is, because most of the times dodraw = false and I just need a fast 
> result without figures.
> Any idea?
> Thank you in advance.
>


[julia-users] Re: why does @eval (a=b) set a global variable?

2015-11-03 Thread Ismael VC
Deniz, I think you could use a macro:

[root@hd0 ~]# julia-0.5.0
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0-dev+1020 (2015-10-29 23:21 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit a36bb6d* (4 days old master)
|__/   |  x86_64-unknown-linux-gnu

julia> macro foo(k, v)
   quote
   $(esc(k)) = $v
   @show bar
   end
   end

julia> @foo bar 42
bar = 42
42

julia> bar
42

julia> @foo baz bar + 1
bar = 42
42

julia> baz
43



El lunes, 2 de noviembre de 2015, 11:52:38 (UTC-6), Deniz Yuret escribió:
>
> If I have the following function:
>
> function foo(k,v)
> @eval ($(symbol(k))=$v)
> println(bar)
> end
>
>
> and I call it with:
>
> foo("bar", 5)
>
> then the global variable bar is set to 5 and the function prints 5.
>
> Is there any way to make @eval set a local variable inside foo instead? 
>  (I tried prefixing the assignment with local which didn't work).
>
> thanks,
> deniz
>
>

[julia-users] Re: Is there a tutorial on how to set up my own Julia cluster?

2015-10-28 Thread Ismael VC
How can I start 2 workers on each node, using Julia 0.3.11?

[count*][user@]host[:port] [bind_addr[:port]]

I have a machine file, with only one node (one line), this examples are the 
ways it works, 
but adding only one worker per node, I'm using the default port for now and 
not using a different bind address:


   - Only host:

555.555.555.555

   - User and host:

root@555.555.555.555


The way I understand:

[count*][user@]host[:port] [bind_addr[:port]]

Is that `count` is an integer while `*` means zero or more repetitions in 
REGEX lang, 
at first it seems it doesn't need a space character between the count and 
the `user@host`,
but I have tried several forms and it doesn't work:

* Use `2` as `count`, separated by space, with `my_file` being either:

2 555.555.555.555

or

2 root@555.555.555.555

[root@example ~]# julia --machinefile my_file
ssh: connect to host 2 port 22: Invalid argument


It seems to me it tries to use the 2 as the host address :(

Could anyone please give me an example off a machine file which specifies 
the worker count?

Thanks in advance, cheers! 





El viernes, 25 de septiembre de 2015, 16:42:59 (UTC-5), Ismael VC escribió:
>
> Hello everyone!
>
> I am trying to set up a Julia cluster with 20 nodes, this is the very 
> first time I've tried something like this. I have looked around for 
> examples, but documentation is not very helpful for me:
>
> *Julia can be started in parallel mode with either the -p or 
> the --machinefile options. -p n will launch an additional n worker 
> processes, while --machinefile file will launch a worker for each line in 
> file file. The machines defined in file must be accessible via a 
> passwordless ssh login, with Julia installed at the same location as the 
> current host. Each machine definition takes the 
> form [count*][user@]host[:port] [bind_addr[:port]] . user defaults to 
> current user, port to the standard ssh port. count is the number of workers 
> to spawn on the node, and defaults to 1. The 
> optional bind-to bind_addr[:port] specifies the ip-address and port that 
> other workers should use to connect to this worker.*
>
> This is what I think I have understood so far:
>
> Ok I list the machines on a machine file, that's easy, I have a file like 
> this:
>
> n user@555.555.555.555
> n user@555.555.555.556
> n user@555.555.555.555
>
>
> *The machines defined in file must be accessible via a 
> passwordless ssh login,*
>
> This is the part that is difficult for me the most, it says that machines 
> must be accesible via paswordless ssh
>
> * with Julia installed at the same location as the current host.*
>
> I understand this as I need to install Julia en every node in the same 
> location, so I have 20 nodes, same software and hardware stacks. Does this 
> means that the nodes must be of the same operating system? the same bits 
> (32/64) only?
>
> Right now I have *20 CentOS 6.7 (64 bits)* nodes with* julia-0.3.11* 
> installed from the *generic linux binaries (64bits)*, all of them 
> installed at */opt/julia-0.3.11/bin* (added to the PATH and already 
> exported in /etc/profile)
>
> Now the plan in my mind is to use my laptop *(windows 7 64 bits, 
> julia-0.3.11 64 bits)* as master node and control the cluster with that, 
> so according to what I understand, I'll need to do (leaving password blank):
>
> ssh-keygen -t rsa
>
>
> From my Windows laptop (I plan to install Arch Linux soon), in order to 
> create my ssh key and then:
>
>
> cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
>
>
>
> To every node? So I have to be running the ssh server at every one of them? 
> (I understand I'll need it at the master node) This is where I simply don't 
> understand anymore, I haven't seen any tutorial, or article, or something 
> like that, just that paragraph in the manual, I know there is 
> ClusterManagers.jl but that sounds even more complicated for me right now.
>
>
> I also want to help David Sanders to set up another cluster (once I got this 
> figured out) in his lab at Science Faculty, UNAM. I promise to enhance the 
> documentation around this topic once I understand this.
>
>
> What do you guys think, do I have it all wrong?
>
>
> If anyone can help me, I'll be very grateful, thank's in advance!
>
>

[julia-users] Re: Is there a tutorial on how to set up my own Julia cluster?

2015-10-28 Thread Ismael VC
Hello everyone,

I have succesfully added all nodes and I can init julia like this:

[root@hd0 ~]# julia -p 2 --machinefile Beowulf
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.11 (2015-07-27 06:18 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/   |  x86_64-unknown-linux-gnu


julia> nprocs()
22


julia> nworkers()
21


julia> 


Where Beowulf file is like this:

hd1
hd2
hd3
hd4
hd5
hd6
hd7
hd8
hd9
hd10
hd11
hd12
hd13
hd14
hd15
hd16
hd17
hd18
hd19

If I change it to:

2 hd1
2 hd2
2 hd3
2 hd4
2 hd5
2 hd6
2 hd7
2 hd8
2 hd9
2 hd10
2 hd11
2 hd12
2 hd13
2 hd14
2 hd15
2 hd16
2 hd17
2 hd18
2 hd19



I get the same error I mentioned:

[root@hd0 ~]# julia -p 2 --machinefile Beowulf2
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
ssh: connect to host 2 port 22: Invalid argument
^CERROR: interrupt
 in match at ./regex.jl:119
 in parse_connection_info at multi.jl:1090
 in read_worker_host_port at multi.jl:1037
 in read_cb_response at multi.jl:1015
 in start_cluster_workers at multi.jl:1027
 in addprocs_internal at multi.jl:1234
 in addprocs at multi.jl:1244
 in process_options at ./client.jl:240
 in _start at ./client.jl:354
[root@hd0 ~]#



El viernes, 25 de septiembre de 2015, 16:42:59 (UTC-5), Ismael VC escribió:
>
> Hello everyone!
>
> I am trying to set up a Julia cluster with 20 nodes, this is the very 
> first time I've tried something like this. I have looked around for 
> examples, but documentation is not very helpful for me:
>
> *Julia can be started in parallel mode with either the -p or 
> the --machinefile options. -p n will launch an additional n worker 
> processes, while --machinefile file will launch a worker for each line in 
> file file. The machines defined in file must be accessible via a 
> passwordless ssh login, with Julia installed at the same location as the 
> current host. Each machine definition takes the 
> form [count*][user@]host[:port] [bind_addr[:port]] . user defaults to 
> current user, port to the standard ssh port. count is the number of workers 
> to spawn on the node, and defaults to 1. The 
> optional bind-to bind_addr[:port] specifies the ip-address and port that 
> other workers should use to connect to this worker.*
>
> This is what I think I have understood so far:
>
> Ok I list the machines on a machine file, that's easy, I have a file like 
> this:
>
> n user@555.555.555.555
> n user@555.555.555.556
> n user@555.555.555.555
>
>
> *The machines defined in file must be accessible via a 
> passwordless ssh login,*
>
> This is the part that is difficult for me the most, it says that machines 
> must be accesible via paswordless ssh
>
> * with Julia installed at the same location as the current host.*
>
> I understand this as I need to install Julia en every node in the same 
> location, so I have 20 nodes, same software and hardware stacks. Does this 
> means that the nodes must be of the same operating system? the same bits 
> (32/64) only?
>
> Right now I have *20 CentOS 6.7 (64 bits)* nodes with* julia-0.3.11* 
> installed from the *generic linux binaries (64bits)*, all of them 
> installed at */opt/julia-0.3.11/bin* (added to the PATH and already 
> exported in /etc/profile)
>
> Now the plan in my mind is to use my laptop *(windows 7 64 bits, 
> julia-0.3.11 64 bits)* as master node and control the cluster with that, 
> so according to what I understand, I'll need to do (leaving password blank):
>
> ssh-keygen -t rsa
>
>
> From my Windows laptop (I plan to install Arch Linux soon), in order to 
> create my ssh key and then:
>
>
> cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
>
>
>
> To every node? So I have to be running the ssh server at every one of the

[julia-users] Re: Is there a tutorial on how to set up my own Julia cluster?

2015-10-28 Thread Ismael VC
Thank you Seth, the count arg is not supported in 0.3.x, I'll update 
shortly to 0.4.x

El miércoles, 28 de octubre de 2015, 13:42:55 (UTC-6), Seth escribió:
>
>
> On Wednesday, October 28, 2015 at 10:20:00 AM UTC-7, Ismael VC wrote:
>>
>> How can I start 2 workers on each node, using Julia 0.3.11?
>>
>> [count*][user@]host[:port] [bind_addr[:port]]
>>
>> The way I understand:
>>
>> [count*][user@]host[:port] [bind_addr[:port]]
>>
>> Is that `count` is an integer while `*` means zero or more repetitions in 
>> REGEX lang, 
>> at first it seems it doesn't need a space character between the count and 
>> the `user@host`,
>> but I have tried several forms and it doesn't work:
>>
>
> I don't think your interpretation is correct. I think the "*" is syntax 
> for "(this many) times". Did you try appending an asterisk after the 
> number? That is, "2* user@host "?
>


[julia-users] Re: Is there a tutorial on how to set up my own Julia cluster?

2015-10-28 Thread Ismael VC
Thank you very much Greg that worked! :D

El miércoles, 28 de octubre de 2015, 13:31:53 (UTC-6), Greg Plowman 
escribió:
>
> On v0.3 try multiple entries (lines) in machine file, one for each worker.



Re: [julia-users] Re: Julia T-shirt and Sticker

2015-10-20 Thread Ismael VC
How about one with:

#JuliaLang

...an elegant programming language for a more civilized age.

? :P

On Tue, Oct 20, 2015 at 8:17 AM, Roger Luo  wrote:

> hope there is an official t-shirt in China too...if anyone can start a
> official store in Taobao
>
> wants to have one too
>
> 在 2014年6月9日星期一 UTC+8下午11:52:22,ther...@gmail.com写道:
>>
>> Hi all,
>>
>> Just FYI: I've made a Julia T-shirt and sticker on Zazzle (photo
>> attached).
>>
>> This is for my personal use only; hope this will not cause any problems.
>>
>> Regards,
>> - Sorami
>>
>


[julia-users] Re: ANN: A potential new Discourse-based Julia forum

2015-10-05 Thread Ismael VC
I've been testing it and I think it's an improvement over google forums. +1 
for moving to something better!

El sábado, 19 de septiembre de 2015, 19:16:36 (UTC-5), Jonathan Malmaud 
escribió:
>
> Hi all,
> There's been some chatter about maybe switching to a new, more modern 
> forum platform for Julia that could potentially subsume julia-users, 
> julia-dev, julia-stats, julia-gpu, and julia-jobs.   I created 
> http://julia.malmaud.com for us to try one out and see if we like it. 
> Please check it out and leave feedback. All the old posts from julia-users 
> have already been imported to it.
>
> It is using Discourse , the same forum 
> software used for the forums of Rust , 
> BoingBoing, and some other big sites. Benefits over Google Groups include 
> better support for topic tagging, community moderation features,  Markdown 
> (and hence syntax highlighting) in messages, inline previews of linked-to 
> Github issues, better mobile support, and more options for controlling when 
> and what you get emailed. The Discourse website 
>  does a better job of summarizing the 
> advantages than I could.
>
> To get things started, MIke Innes suggested having a topic on what we 
> plan on working on this coming wee 
> k.
>  
> I think that's a great idea.
>
> Just to be clear, this isn't "official" in any sense - it's just to 
> kickstart the discussion. 
>
> -Jon
>
>
>

[julia-users] Re: How to import all symbols from a module with @everywhere?

2015-09-26 Thread Ismael VC
This is the result:

* http://nbviewer.ipython.org/gist/Ismael-VC/3fa7fb19fff61b0c6eeb

530.838512 seconds (18.68 k allocations: 2.102 MB)

What's the advantage of  addprocs(CPU_CORES - 1) ? 

[julia-users] Re: How to import all symbols from a module with @everywhere?

2015-09-26 Thread Ismael VC
This is the result:

* http://nbviewer.ipython.org/gist/Ismael-VC/3fa7fb19fff61b0c6eeb

530.838512 seconds (18.68 k allocations: 2.102 MB)

What's the advantage of  addprocs(CPU_CORES - 1) ? 

[julia-users] Re: How to import all symbols from a module with @everywhere?

2015-09-26 Thread Ismael VC
Thank you very much Nils, that solved my issue! 

[julia-users] Is there a tutorial on how to set up my own Julia cluster?

2015-09-25 Thread Ismael VC
Hello everyone!

I am trying to set up a Julia cluster with 20 nodes, this is the very first 
time I've tried something like this. I have looked around for examples, but 
documentation is not very helpful for me:

*Julia can be started in parallel mode with either the -p or 
the --machinefile options. -p n will launch an additional n worker 
processes, while --machinefile file will launch a worker for each line in 
file file. The machines defined in file must be accessible via a 
passwordless ssh login, with Julia installed at the same location as the 
current host. Each machine definition takes the 
form [count*][user@]host[:port] [bind_addr[:port]] . user defaults to 
current user, port to the standard ssh port. count is the number of workers 
to spawn on the node, and defaults to 1. The 
optional bind-to bind_addr[:port] specifies the ip-address and port that 
other workers should use to connect to this worker.*

This is what I think I have understood so far:

Ok I list the machines on a machine file, that's easy, I have a file like 
this:

n user@555.555.555.555
n user@555.555.555.556
n user@555.555.555.555


*The machines defined in file must be accessible via a 
passwordless ssh login,*

This is the part that is difficult for me the most, it says that machines 
must be accesible via paswordless ssh

* with Julia installed at the same location as the current host.*

I understand this as I need to install Julia en every node in the same 
location, so I have 20 nodes, same software and hardware stacks. Does this 
means that the nodes must be of the same operating system? the same bits 
(32/64) only?

Right now I have *20 CentOS 6.7 (64 bits)* nodes with* julia-0.3.11* 
installed from the *generic linux binaries (64bits)*, all of them installed 
at */opt/julia-0.3.11/bin* (added to the PATH and already exported in 
/etc/profile)

Now the plan in my mind is to use my laptop *(windows 7 64 bits, 
julia-0.3.11 64 bits)* as master node and control the cluster with that, so 
according to what I understand, I'll need to do (leaving password blank):

ssh-keygen -t rsa


>From my Windows laptop (I plan to install Arch Linux soon), in order to create 
>my ssh key and then:


cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'



To every node? So I have to be running the ssh server at every one of them? (I 
understand I'll need it at the master node) This is where I simply don't 
understand anymore, I haven't seen any tutorial, or article, or something like 
that, just that paragraph in the manual, I know there is ClusterManagers.jl but 
that sounds even more complicated for me right now.


I also want to help David Sanders to set up another cluster (once I got this 
figured out) in his lab at Science Faculty, UNAM. I promise to enhance the 
documentation around this topic once I understand this.


What do you guys think, do I have it all wrong?


If anyone can help me, I'll be very grateful, thank's in advance!



[julia-users] How to import all symbols from a module with @everywhere?

2015-09-25 Thread Ismael VC
Hello everyone!

I have been trying to do some parallel tests with a simple example using 
Images and Colors,  you can see here:

   - http://nbviewer.ipython.org/gist/Ismael-VC/e18bcae78a49f68a0838

ERROR (unhandled task failure): On worker 15:
UndefVarError: Gray not defined


The same on every worker.

It seems that the problem is the way I'm importing the modules? I do:

addprocs(CPU_CORES)


@everywhere importall Images, Colors

@everywhere function procesar_imagen(imagen::AbstractString, σ=2)
imagen₁ = imread(imagen)
imagen₂ = convert(Image{Gray}, imagen₁)
σ₁ = [σ, σ]# un valor de σ por cada dimensión
imagen₃ = imfilter_gaussian(imagen₂, σ₁)
imagen₄ = reinterpret(Float64, data(imagen₃))
return var(imagen₄)
end

y = @time @parallel vcat for i = 1:100
gc()# llamar al recolector de basura
procesar_imagen("imagen.jpg")
end

gc()

y


Thanks in advance.

Cheers!


[julia-users] Re: Why does empty index returns first element?

2015-09-19 Thread Ismael VC
Don't know if this is terribly obvious, but what's the use case for 
0-dimensional arrays? I get that it means 0D arrays "are basicaly like 
scalars", but they're not treated as such, I'd love to know in which cases 
they could be useful.

https://groups.google.com/forum/#!topic/julia-users/o9kC6tVKpTk

El sábado, 19 de septiembre de 2015, 12:42:57 (UTC-5), Ismael VC escribió:
>
> I would have expected an error.
>
> Julia:
>
> julia> VERSION
> v"0.4.0-rc1"
>
> julia> x = [1:5;];
>
> julia> x[], x[1]
> (1,1)
>
> Python:
>
> >>> x = range(1, 6)
> >>> x[]
>   File "", line 1
> x[]
>   ^
> SyntaxError: invalid syntax
>
>
>

[julia-users] Why does empty index returns first element?

2015-09-19 Thread Ismael VC
I would have expected an error.

Julia:

julia> VERSION
v"0.4.0-rc1"

julia> x = [1:5;];

julia> x[], x[1]
(1,1)

Python:

>>> x = range(1, 6)
>>> x[]
  File "", line 1
x[]
  ^
SyntaxError: invalid syntax




[julia-users] Re: Why does enumerate fail in parallel?

2015-08-19 Thread Ismael VC
Enumerate is an iterator, you need to collect the items first:

julia @parallel for i in collect(enumerate(list))
   println(i)
   end

julia  From worker 2:  (1,a)
From worker 2:  (2,b)
From worker 3:  (3,c)


El miércoles, 19 de agosto de 2015, 12:17:35 (UTC-5), Nils Gudat escribió:

 I just rewrote one of my parallel loops and was surprised by this:

  list = [a, b, c]

  for i in enumerate(list)
println(i)
  end

 (1,a) 
 (2,b) 
 (3,c)

  addprocs(2)

  @sync @parallel for i in enumerate(list)
println(i)
  end

 ERROR: `getindex` has no method matching 
 getindex(::Enumerate{Array{ASCIIString,1}}, ::UnitRange{Int64})

 Am I doing something wrong here? Is this expected behaviour?



[julia-users] Re: Why does enumerate fail in parallel?

2015-08-19 Thread Ismael VC
Well that works but it's indeed odd, can you open a new issue for this?

El miércoles, 19 de agosto de 2015, 13:48:28 (UTC-5), Ismael VC escribió:

 Enumerate is an iterator, you need to collect the items first:

 julia @parallel for i in collect(enumerate(list))
println(i)
end

 julia  From worker 2:  (1,a)
 From worker 2:  (2,b)
 From worker 3:  (3,c)


 El miércoles, 19 de agosto de 2015, 12:17:35 (UTC-5), Nils Gudat escribió:

 I just rewrote one of my parallel loops and was surprised by this:

  list = [a, b, c]

  for i in enumerate(list)
println(i)
  end

 (1,a) 
 (2,b) 
 (3,c)

  addprocs(2)

  @sync @parallel for i in enumerate(list)
println(i)
  end

 ERROR: `getindex` has no method matching 
 getindex(::Enumerate{Array{ASCIIString,1}}, ::UnitRange{Int64})

 Am I doing something wrong here? Is this expected behaviour?



Re: [julia-users] Embarrassingly parallel workload

2015-08-19 Thread Ismael VC
There is an MPI wrapper for Julia, I don't know if it'll suit your needs 
thoug:

https://github.com/JuliaParallel/MPI.jl

El miércoles, 19 de agosto de 2015, 13:03:59 (UTC-5), Júlio Hoffimann 
escribió:

 Hi Kristoffer, sorry for the delay and thanks for the code.

 What I want to do is very simple: I have an expensive loop for i=1:N such 
 that each iteration is independent and produces a large array of size M. 
 The result of this loop is a matrix of size MxN. I have many CPU cores at 
 my disposal and want to distribute this work.

 In the past I accomplished that with MPI in Python: 
 https://github.com/juliohm/HUM/blob/master/pyhum/utils.py Whenever a 
 process in the pool is free it consumes an iteration of the loop. What 
 exactly the @parallel macro in Julia is doing? How can I modify the code I 
 previously posted in this thread to achieve such effect?

 -Júlio



[julia-users] Re: does JLD handle Int128 (saw at one time it did not)

2015-08-19 Thread Ismael VC
Have you tried using it with HDF5.jl?

https://github.com/timholy/HDF5.jl

El miércoles, 19 de agosto de 2015, 12:50:35 (UTC-5), Jeffrey Sarnoff 
escribió:

 Or, what is a good approach to saving and reloading Int128s .. -x .. +x?



Re: [julia-users] Re: JuliaCon 2015 videos

2015-08-18 Thread Ismael VC
Shashi how are you doing your presentations? They are awesome! Where can I 
find the code for that one?

El martes, 18 de agosto de 2015, 11:55:01 (UTC-5), Shashi Gowda escribió:

 If you have Escher installed and ready to go (See instructions on 
 escher-jl.org) you can safely skip the first 20 mins of my Escher.jl 
 video.

 A better talk on Escher is this one I gave recently at a conference in 
 Bangalore: https://youtu.be/UeVUsOX5rAo?t=150 it definitely packs more 
 content in lesser time.

 On Tue, Aug 18, 2015 at 9:42 PM, Frank Kampas fka...@gmail.com 
 javascript: wrote:

 The optimization video is private


 On Thursday, August 13, 2015 at 1:22:09 PM UTC-4, Viral Shah wrote:

 Folks, 

 I am happy to announce that the videos are almost all ready, and I will 
 start posting them in batches. I am starting with Jeff’s talk on our 
 Youtube channel: 

 https://www.youtube.com/user/JuliaLanguage 

 Direct link to the video: 

 https://www.youtube.com/watch?v=xUP3cSKb8sI 

 -viral 






[julia-users] [Escher] no method broadcast(::Function, ::Array{Float64,2}, ::Array{Float64,1})

2015-08-05 Thread Ismael VC


Hello everyone!

I’m trying to run an Escher script: http://git.io/vO14p based on the juno 
tutorial.

And I get this error:

`broadcast` has no method matching broadcast(::Function, ::Array{Float64,2}, 
::Array{Float64,1})
you may have intended to import Base.broadcast
 in anonymous at /home/ismael-vc/.julia/v0.3/Escher/src/cli/serve.jl:171
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:15
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:8
 in splitquery at /home/ismael-vc/.julia/v0.3/Mux/src/basics.jl:28
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:8
 in wcatch at /home/ismael-vc/.julia/v0.3/Mux/src/websockets.jl:12
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:8
 in todict at /home/ismael-vc/.julia/v0.3/Mux/src/basics.jl:21
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:12 (repeats 2 times)
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/Mux.jl:8
 in anonymous at /home/ismael-vc/.julia/v0.3/Mux/src/server.jl:36
 in handle at /home/ismael-vc/.julia/v0.3/WebSockets/src/WebSockets.jl:287
 in on_message_complete at 
/home/ismael-vc/.julia/v0.3/HttpServer/src/HttpServer.jl:359
 in on_message_complete at 
/home/ismael-vc/.julia/v0.3/HttpServer/src/RequestParser.jl:99

Yet the code is supposed to run:

   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type help() for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.11 (2015-07-27 06:18 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/   |  x86_64-apple-darwin13.4.0

julia using Images

julia function julia_set(z, max::Int=80)
 c = (φ-2)+(φ-1)im
 for n = 1:max
   abs(z) ≥ 2  return n-1
   z = z^2 + c
 end
 return max
   end
julia_set (generic function with 2 methods)

julia julia_set(x, y) = julia_set(x + y*im)
julia_set (generic function with 3 methods)

julia function julia_grid(n)
   broadcast(julia_set,
   linspace(-0.5, 1, n)',
   linspace(-1, 0.5, n)
   )
   end
julia_grid (generic function with 1 method)

julia julia(n) = convert(Image, scale(julia_grid(n), 1/80))
julia (generic function with 1 method)

julia julia(5)
Gray Image with:
  data: 5x5 Array{Float64,2}
  properties:
timedim: 0
colorspace: Gray
colordim: 0
spatialorder:  y x
pixelspacing:  1.0 1.0

julia

It works in juno:

https://lh3.googleusercontent.com/-EZ6aC3-5CEE/VcJ680nMstI/Ag8/dREtYikrDUc/s1600/Captura%2Bde%2Bpantalla%2B2015-08-05%2Ba%2Blas%2B15.47.51.png

I have tried using Linux and Mac, Julia 0.3.11 and 0.3.10, Escher package 
is on master. (Pkg.checkout(“Escher”))
​


Re: [julia-users] Juliacon 2015 videos?

2015-08-03 Thread Ismael VC
Jack I've red the license, does this means that I have to ask personally 
every video expositor for permission to subtitle their videos? AFAICT this 
CC license only would apply to MIT am I right?

Thanks!

El lunes, 3 de agosto de 2015, 8:24:29 (UTC-5), Jack Minardi escribió:

 I gave a talk at JuliaCon this year. I recently received an email asking 
 if I would respond with this text:

 I, the copyright holder, grant permission for MIT to distribute these 
 files under the Creative Commons CC-BY-4.0 license (
 https://creativecommons.org/licenses/by/4.0/)

 I did, and I assume most others did as well. So many of the videos will be 
 released under CC-BY-4.0


 On Monday, August 3, 2015 at 8:32:12 AM UTC-4, Ismael VC wrote:

 Kristoffer, everyone,

 I found 3 recent videos NOT from JuliaCon: 

 Shashi Gowda - Escher: democratizing beautiful visualizations

 * https://youtu.be/2e0tOV80hh0

 Viral B Shah - The many ways of parallel computing with Julia

 *https://youtu.be/HCcO-715acM

 PolyConf 15: Julia a fast dynamic language for technical computing / 
 Stefan Karpinski

 * https://youtu.be/ag_NtJRmYg8


 @Viral, @ Stefan and @Shashi, do you know the author/copy rights for 
 these ones? What about the ones from JuliaCon?

  I am pretty sure that JuliaCon 2014 videos are under some sort of 
 Creative Commons, but can’t quite remember which exact one. 

 If nobody is still sure of what license these are. Could somebody please 
 tell me how or with whom I can find this information? Are there more recent 
 videos like the ones I listed above? Is there a place where this video news 
 are posted?

 I guess I'll 'll just start translating the videos from JuliaCon once 
 they are released and hope that's ok. Could we plan in advance for next 
 year and think about the licenses the videos should have, so I can stop 
 annoying everyone with this?



 El lunes, 3 de agosto de 2015, 7:09:48 (UTC-5), Kristoffer Carlsson 
 escribió:

 Any update on videos?

 On Tuesday, July 21, 2015 at 12:56:58 AM UTC+2, Luke Stagner wrote:

 ?

 On Saturday, July 11, 2015 at 9:11:15 AM UTC-7, Ismael VC wrote:

 I was also specially interested in translating David Sanders 
 *Introduction 
 to Julia* at SciPy 2014. I tried to get in contact with Enthought 
 since January but I never got a reply: 

 Message: I’d like add translated captions into Spanish to your Julia 
 YouTube videos, and I was wondering how to go about it.

 I’ve seen a few on line tools, but I can’t import your video, from 
 here for example:
 http://captiontube.appspot.com
 I get: Please enter a valid URL for this YouTube video.
 Note: if you do not own the video and it is private or cannot be 
 embedded, you will not be able to import it. If you own the video, close 
 this dialog and choose Personal Video to import it.

 bvIt’s supposed to allow me to import it so I can translate it and 
 send the translations via e-mail to theEnthought YouTube account.

 Thank you very much!

 I just got this from their bot:

 We have received your support request (# 44258) and are reviewing it.

 ​

 On Sat, Jul 11, 2015 at 10:56 AM, Viral Shah vi...@mayin.org wrote:

 I am pretty sure that JuliaCon 2014 videos are under some sort of 
 Creative Commons, but can’t quite remember which exact one. Perhaps 
 someone 
 else may know.

 It would be great to have the spanish and other subtitles.

 -viral



  On 11-Jul-2015, at 8:16 pm, Ismael VC ismael...@gmail.com wrote:
 
  Also while I wait for this news I'd like to know which license is 
 used currently for the videos that are already at the Julia Youtube 
 channel. If it's ok I would also like to provide translated subtitles 
 for 
 some of these videos. I'm assuming this is something we all want as a 
 community, I'm I right?
 
  @sorami are you guys at also interested in this? Id like to know 
 which other stuff would you or anybody else expect to be part of 
 juila-i10n.
 
  Is there anyone else interested in translating julia resources to 
 other languages?
 
  On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael...@gmail.com 
 wrote:
  @Viral thank you for the update! What I want is to be able to 
 subtitle the videos, that's all.
 
  On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org 
 wrote:
  We have to work through all these details still.
 
  -viral
 
 
  On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:
  Please could anyone tell me what's the situation with the videos 
 copyrights would I be allowed to translate them into Spanish?
 
  El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter 
 escribió:
  Will there be videos of the 2015 Juliacon? Where... :-)
  Thanks.
 
 




Re: [julia-users] Juliacon 2015 videos?

2015-08-03 Thread Ismael VC
Kristoffer, everyone,

I found 3 recent videos NOT from JuliaCon: 

Shashi Gowda - Escher: democratizing beautiful visualizations

* https://youtu.be/2e0tOV80hh0

Viral B Shah - The many ways of parallel computing with Julia

*https://youtu.be/HCcO-715acM

PolyConf 15: Julia a fast dynamic language for technical computing / Stefan 
Karpinski

* https://youtu.be/ag_NtJRmYg8


@Viral, @ Stefan and @Shashi, do you know the author/copy rights for these 
ones? What about the ones from JuliaCon?

 I am pretty sure that JuliaCon 2014 videos are under some sort of 
Creative Commons, but can’t quite remember which exact one. 

If nobody is still sure of what license these are. Could somebody please 
tell me how or with whom I can find this information? Are there more recent 
videos like the ones I listed above? Is there a place where this video news 
are posted?

I guess I'll 'll just start translating the videos from JuliaCon once they 
are released and hope that's ok. Could we plan in advance for next year and 
think about the licenses the videos should have, so I can stop annoying 
everyone with this?



El lunes, 3 de agosto de 2015, 7:09:48 (UTC-5), Kristoffer Carlsson 
escribió:

 Any update on videos?

 On Tuesday, July 21, 2015 at 12:56:58 AM UTC+2, Luke Stagner wrote:

 ?

 On Saturday, July 11, 2015 at 9:11:15 AM UTC-7, Ismael VC wrote:

 I was also specially interested in translating David Sanders *Introduction 
 to Julia* at SciPy 2014. I tried to get in contact with Enthought since 
 January but I never got a reply: 

 Message: I’d like add translated captions into Spanish to your Julia 
 YouTube videos, and I was wondering how to go about it.

 I’ve seen a few on line tools, but I can’t import your video, from here 
 for example:
 http://captiontube.appspot.com
 I get: Please enter a valid URL for this YouTube video.
 Note: if you do not own the video and it is private or cannot be 
 embedded, you will not be able to import it. If you own the video, close 
 this dialog and choose Personal Video to import it.

 bvIt’s supposed to allow me to import it so I can translate it and send 
 the translations via e-mail to theEnthought YouTube account.

 Thank you very much!

 I just got this from their bot:

 We have received your support request (# 44258) and are reviewing it.

 ​

 On Sat, Jul 11, 2015 at 10:56 AM, Viral Shah vi...@mayin.org wrote:

 I am pretty sure that JuliaCon 2014 videos are under some sort of 
 Creative Commons, but can’t quite remember which exact one. Perhaps 
 someone 
 else may know.

 It would be great to have the spanish and other subtitles.

 -viral



  On 11-Jul-2015, at 8:16 pm, Ismael VC ismael...@gmail.com wrote:
 
  Also while I wait for this news I'd like to know which license is 
 used currently for the videos that are already at the Julia Youtube 
 channel. If it's ok I would also like to provide translated subtitles for 
 some of these videos. I'm assuming this is something we all want as a 
 community, I'm I right?
 
  @sorami are you guys at also interested in this? Id like to know 
 which other stuff would you or anybody else expect to be part of 
 juila-i10n.
 
  Is there anyone else interested in translating julia resources to 
 other languages?
 
  On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael...@gmail.com 
 wrote:
  @Viral thank you for the update! What I want is to be able to 
 subtitle the videos, that's all.
 
  On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org wrote:
  We have to work through all these details still.
 
  -viral
 
 
  On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:
  Please could anyone tell me what's the situation with the videos 
 copyrights would I be allowed to translate them into Spanish?
 
  El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter 
 escribió:
  Will there be videos of the 2015 Juliacon? Where... :-)
  Thanks.
 
 




Re: [julia-users] Juliacon 2015 videos?

2015-08-03 Thread Ismael VC
Thank you very much Jack, then it's all set, I'll keep waiting for the 
videos!

El lunes, 3 de agosto de 2015, 8:24:29 (UTC-5), Jack Minardi escribió:

 I gave a talk at JuliaCon this year. I recently received an email asking 
 if I would respond with this text:

 I, the copyright holder, grant permission for MIT to distribute these 
 files under the Creative Commons CC-BY-4.0 license (
 https://creativecommons.org/licenses/by/4.0/)

 I did, and I assume most others did as well. So many of the videos will be 
 released under CC-BY-4.0


 On Monday, August 3, 2015 at 8:32:12 AM UTC-4, Ismael VC wrote:

 Kristoffer, everyone,

 I found 3 recent videos NOT from JuliaCon: 

 Shashi Gowda - Escher: democratizing beautiful visualizations

 * https://youtu.be/2e0tOV80hh0

 Viral B Shah - The many ways of parallel computing with Julia

 *https://youtu.be/HCcO-715acM

 PolyConf 15: Julia a fast dynamic language for technical computing / 
 Stefan Karpinski

 * https://youtu.be/ag_NtJRmYg8


 @Viral, @ Stefan and @Shashi, do you know the author/copy rights for 
 these ones? What about the ones from JuliaCon?

  I am pretty sure that JuliaCon 2014 videos are under some sort of 
 Creative Commons, but can’t quite remember which exact one. 

 If nobody is still sure of what license these are. Could somebody please 
 tell me how or with whom I can find this information? Are there more recent 
 videos like the ones I listed above? Is there a place where this video news 
 are posted?

 I guess I'll 'll just start translating the videos from JuliaCon once 
 they are released and hope that's ok. Could we plan in advance for next 
 year and think about the licenses the videos should have, so I can stop 
 annoying everyone with this?



 El lunes, 3 de agosto de 2015, 7:09:48 (UTC-5), Kristoffer Carlsson 
 escribió:

 Any update on videos?

 On Tuesday, July 21, 2015 at 12:56:58 AM UTC+2, Luke Stagner wrote:

 ?

 On Saturday, July 11, 2015 at 9:11:15 AM UTC-7, Ismael VC wrote:

 I was also specially interested in translating David Sanders 
 *Introduction 
 to Julia* at SciPy 2014. I tried to get in contact with Enthought 
 since January but I never got a reply: 

 Message: I’d like add translated captions into Spanish to your Julia 
 YouTube videos, and I was wondering how to go about it.

 I’ve seen a few on line tools, but I can’t import your video, from 
 here for example:
 http://captiontube.appspot.com
 I get: Please enter a valid URL for this YouTube video.
 Note: if you do not own the video and it is private or cannot be 
 embedded, you will not be able to import it. If you own the video, close 
 this dialog and choose Personal Video to import it.

 bvIt’s supposed to allow me to import it so I can translate it and 
 send the translations via e-mail to theEnthought YouTube account.

 Thank you very much!

 I just got this from their bot:

 We have received your support request (# 44258) and are reviewing it.

 ​

 On Sat, Jul 11, 2015 at 10:56 AM, Viral Shah vi...@mayin.org wrote:

 I am pretty sure that JuliaCon 2014 videos are under some sort of 
 Creative Commons, but can’t quite remember which exact one. Perhaps 
 someone 
 else may know.

 It would be great to have the spanish and other subtitles.

 -viral



  On 11-Jul-2015, at 8:16 pm, Ismael VC ismael...@gmail.com wrote:
 
  Also while I wait for this news I'd like to know which license is 
 used currently for the videos that are already at the Julia Youtube 
 channel. If it's ok I would also like to provide translated subtitles 
 for 
 some of these videos. I'm assuming this is something we all want as a 
 community, I'm I right?
 
  @sorami are you guys at also interested in this? Id like to know 
 which other stuff would you or anybody else expect to be part of 
 juila-i10n.
 
  Is there anyone else interested in translating julia resources to 
 other languages?
 
  On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael...@gmail.com 
 wrote:
  @Viral thank you for the update! What I want is to be able to 
 subtitle the videos, that's all.
 
  On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org 
 wrote:
  We have to work through all these details still.
 
  -viral
 
 
  On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:
  Please could anyone tell me what's the situation with the videos 
 copyrights would I be allowed to translate them into Spanish?
 
  El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter 
 escribió:
  Will there be videos of the 2015 Juliacon? Where... :-)
  Thanks.
 
 




[julia-users] Re: Readtimearray function in Julia TimeSeries package

2015-08-03 Thread Ismael VC


You should file a bug report here: 
https://github.com/JuliaStats/TimeSeries.jl/issues

This readtimearray(fname::String; meta=Nothing, format::String=””) methods 
doesn’t exist, the documentation must be out of date:

julia methods(readtimearray)
# 1 method for generic function readtimearray:
readtimearray(fname::String) at 
/home/juser/.julia/v0.4/TimeSeries/src/readwrite.jl:4

http://timeseriesjl.readthedocs.org/en/latest/readwrite.html#readtimearray

The documentation doesn’t say anything about the header (it just says 
readtimearray is a wrapper of readcsv), but neither removing the header 
manually nor Pkg.update(); Pkg.checkout(TimeSeries) solve this issue.

El lunes, 3 de agosto de 2015, 7:07:37 (UTC-5), Danny Zuko escribió:

I would like to read a csv file of the following form with readtimearray:


 ,ES1 Index,VG1 Index,TY1 Comdty,RX1 Comdty,GC1 Comdty
 1999-01-04,1391.12,3034.53,66.515625,86.2,441.39
 1999-01-05,1404.86,3072.41,66.3125,86.17,440.63
 1999-01-06,1435.12,3156.59,66.4375,86.32,441.7
 1999-01-07,1432.32,3106.08,66.25,86.22,447.67
 1999-01-08,1443.81,3093.46,65.859375,86.36,447.06
 1999-01-11,1427.84,3005.07,65.71875,85.74,449.5
 1999-01-12,1402.33,2968.04,65.953125,86.31,442.92
 1999-01-13,1388.88,2871.23,66.21875,86.52,439.4
 1999-01-14,1366.46,2836.72,66.546875,86.73,440.01
  

 However, here's what I get when I evaluate readtimearray(myfile.csv)


 ERROR: `convert` has no method matching convert(::Type{UTF8String}, ::Float64)
  in push! at array.jl:460
  in readtimearray at /home/juser/.julia/v0.3/TimeSeries/src/readwrite.jl:25
  

 What is it that I am not seeing?

​


[julia-users] Escher.jl How to embed arbitrary javascript code?

2015-07-31 Thread Ismael VC
I have been trying to include a gist in an Escher web app:

function main(window)
vbox(
plaintext(Gist test),
Elem(:script, src = ~/.julia/v0.3/Patchwork/runtime/build.js),
Elem(:script,
display = inline,
src = 
https://gist.github.com/Ismael-VC/f5e64ca3e2f980340ae3.js;
)
)
end

But this only prints `Gist test`. I have also tried including the script in 
a markdown. I see here that `Patchwork/runtime/build.js` must be included 
for this to work:

https://github.com/shashi/Patchwork.jl#javascript-setup-and-patching

I'll try to look how does IJulia does this.


Re: [julia-users] Printf() of a variable number of arguments

2015-07-23 Thread Ismael VC
help? @sprintf
INFO: Loading help data...
Base.@sprintf(%Fmt, args...)

   Return @printf formatted output as string.

julia s = @sprintf this is a %s test
this is a test

julia println(s)
this is a test

That is because `@sprintf` returns a string which you haven't printed.


El miércoles, 22 de julio de 2015, 23:31:36 (UTC-5), Tero Frondelius 
escribió:

 Thanks. My real error was to use @sprintf macro, thus a follow up 
 question, why this isn't printing anything:
 macro Write(arr)
 quote
 for i in $arr
   @sprintf(%12.6f\n,i)
 end
 end
 end

 a = 1e5*rand(10)
 @Write a
 This is purely for learning purposes. This was simple enough example, 
 which I could try to develop myself. 
  

 On Thursday, July 23, 2015 at 1:21:04 AM UTC+3, Ismael VC wrote:

 You forgot to interpolate the expression with `$`:

 julia macro write(arr)

   quote

   for i in $arr

   @printf(%12.6f\n,i)

   end

   end

   end


 julia a = 1e5*rand(10)

 10-element Array{Float64,1}:

 46310.6

 25130.5

 30710.8

 82089.6

 48240.2

 80307.5

 62870.3

 78309.3

 63086.6

 86144.5


 julia @write a

 46310.583123

 25130.507159

 30710.765317

 82089.565630

 48240.227962

 80307.529256

 62870.334927

 78309.327456

 63086.608038

 86144.524017


 julia 

 But this can be done with anormal function.

 El miércoles, 22 de julio de 2015, 13:37:28 (UTC-5), Tero Frondelius 
 escribió:

 I'm trying to learn macros. Can you help me to get this working? 
 Currently the error is that arr is not defined. Probably an obvious 
 mistake, but I just don't get hang of it. 

 macro Write(arr)
 @eval begin
 for i in arr
  @sprintf(%12.6f\n,i)
 end
 end
 end


 a = 1e5*rand(10)
 @Write a



 On Tuesday, July 14, 2015 at 4:20:43 PM UTC+3, ele...@gmail.com wrote:

 You could just use a macro to take the format and the array and let it 
 write the messy loop for you.

 On Tuesday, July 14, 2015 at 8:39:44 PM UTC+10, Ferran Mazzanti wrote:

 Yes thanks, I knew already looped solutions :)
 I was looking for somethin' compact as in the fortran statement above, 
 though. It makes things more *neat*, if there's any such thing.

 On Tuesday, July 14, 2015 at 12:08:59 PM UTC+2, Kaj Wiik wrote:

 Would this work for you:
 julia a = 1e5*rand(1000)
 julia for i in a
@printf(%12.6f\n, i)
end
 74708.038385
 71244.774457
  5057.229038
  3761.297034
 ...

 Remember that loops are fast in Julia...

 Kaj



 On Tuesday, July 14, 2015 at 9:14:37 AM UTC+3, Ferran Mazzanti wrote:

 Thanks for the info. Actually my question comes from old fortran 
 style, where I can write something of the form
 Write(1,'1000f12.6') a
 where a is an array. The string inside the write function says I can 
 print 1000 doubkes in 12 characters with 6 decimals. So the string is a 
 constant literal, and array a can contain 1000 or less elements that 
 will 
 be properly formatted. Is there a way to do something like this in 
 Julia?
 What if Inwant to print 1000 float64 on the same line with a given 
 format for each element?
 Maybebthis is easier...
 Best regards and thanks.
 Ferran.



Re: [julia-users] Printf() of a variable number of arguments

2015-07-23 Thread Ismael VC
You are welcome, if you think this needs some clarification you could try
to edit the manual for the good of everyone else!

Cheers.

On Thu, Jul 23, 2015 at 8:26 AM, Tero Frondelius tero.frondel...@gmail.com
wrote:

 Thanks, it makes sense now. I actually read the documentation earlier, but
 didn't understand it. Now with the example it's very clear.


 On Thursday, July 23, 2015 at 3:56:39 PM UTC+3, Ismael VC wrote:

 help? @sprintf
 INFO: Loading help data...
 Base.@sprintf(%Fmt, args...)

Return @printf formatted output as string.

 julia s = @sprintf this is a %s test
 this is a test

 julia println(s)
 this is a test

 That is because `@sprintf` returns a string which you haven't printed.


 El miércoles, 22 de julio de 2015, 23:31:36 (UTC-5), Tero Frondelius
 escribió:

 Thanks. My real error was to use @sprintf macro, thus a follow up
 question, why this isn't printing anything:
 macro Write(arr)
 quote
 for i in $arr
   @sprintf(%12.6f\n,i)
 end
 end
 end

 a = 1e5*rand(10)
 @Write a
 This is purely for learning purposes. This was simple enough example,
 which I could try to develop myself.


 On Thursday, July 23, 2015 at 1:21:04 AM UTC+3, Ismael VC wrote:

 You forgot to interpolate the expression with `$`:

 julia macro write(arr)

   quote

   for i in $arr

   @printf(%12.6f\n,i)

   end

   end

   end


 julia a = 1e5*rand(10)

 10-element Array{Float64,1}:

 46310.6

 25130.5

 30710.8

 82089.6

 48240.2

 80307.5

 62870.3

 78309.3

 63086.6

 86144.5


 julia @write a

 46310.583123

 25130.507159

 30710.765317

 82089.565630

 48240.227962

 80307.529256

 62870.334927

 78309.327456

 63086.608038

 86144.524017


 julia

 But this can be done with anormal function.

 El miércoles, 22 de julio de 2015, 13:37:28 (UTC-5), Tero Frondelius
 escribió:

 I'm trying to learn macros. Can you help me to get this working?
 Currently the error is that arr is not defined. Probably an obvious
 mistake, but I just don't get hang of it.

 macro Write(arr)
 @eval begin
 for i in arr
  @sprintf(%12.6f\n,i)
 end
 end
 end


 a = 1e5*rand(10)
 @Write a



 On Tuesday, July 14, 2015 at 4:20:43 PM UTC+3, ele...@gmail.com wrote:

 You could just use a macro to take the format and the array and let
 it write the messy loop for you.

 On Tuesday, July 14, 2015 at 8:39:44 PM UTC+10, Ferran Mazzanti wrote:

 Yes thanks, I knew already looped solutions :)
 I was looking for somethin' compact as in the fortran statement
 above, though. It makes things more *neat*, if there's any such thing.

 On Tuesday, July 14, 2015 at 12:08:59 PM UTC+2, Kaj Wiik wrote:

 Would this work for you:
 julia a = 1e5*rand(1000)
 julia for i in a
@printf(%12.6f\n, i)
end
 74708.038385
 71244.774457
  5057.229038
  3761.297034
 ...

 Remember that loops are fast in Julia...

 Kaj



 On Tuesday, July 14, 2015 at 9:14:37 AM UTC+3, Ferran Mazzanti
 wrote:

 Thanks for the info. Actually my question comes from old fortran
 style, where I can write something of the form
 Write(1,'1000f12.6') a
 where a is an array. The string inside the write function says I
 can print 1000 doubkes in 12 characters with 6 decimals. So the 
 string is a
 constant literal, and array a can contain 1000 or less elements that 
 will
 be properly formatted. Is there a way to do something like this in 
 Julia?
 What if Inwant to print 1000 float64 on the same line with a given
 format for each element?
 Maybebthis is easier...
 Best regards and thanks.
 Ferran.




Re: [julia-users] Printf() of a variable number of arguments

2015-07-22 Thread Ismael VC
You forgot to interpolate the expression with `$`:

julia macro write(arr)

  quote

  for i in $arr

  @printf(%12.6f\n,i)

  end

  end

  end


julia a = 1e5*rand(10)

10-element Array{Float64,1}:

46310.6

25130.5

30710.8

82089.6

48240.2

80307.5

62870.3

78309.3

63086.6

86144.5


julia @write a

46310.583123

25130.507159

30710.765317

82089.565630

48240.227962

80307.529256

62870.334927

78309.327456

63086.608038

86144.524017


julia 

But this can be done with anormal function.

El miércoles, 22 de julio de 2015, 13:37:28 (UTC-5), Tero Frondelius 
escribió:

 I'm trying to learn macros. Can you help me to get this working? Currently 
 the error is that arr is not defined. Probably an obvious mistake, but I 
 just don't get hang of it. 

 macro Write(arr)
 @eval begin
 for i in arr
  @sprintf(%12.6f\n,i)
 end
 end
 end


 a = 1e5*rand(10)
 @Write a



 On Tuesday, July 14, 2015 at 4:20:43 PM UTC+3, ele...@gmail.com wrote:

 You could just use a macro to take the format and the array and let it 
 write the messy loop for you.

 On Tuesday, July 14, 2015 at 8:39:44 PM UTC+10, Ferran Mazzanti wrote:

 Yes thanks, I knew already looped solutions :)
 I was looking for somethin' compact as in the fortran statement above, 
 though. It makes things more *neat*, if there's any such thing.

 On Tuesday, July 14, 2015 at 12:08:59 PM UTC+2, Kaj Wiik wrote:

 Would this work for you:
 julia a = 1e5*rand(1000)
 julia for i in a
@printf(%12.6f\n, i)
end
 74708.038385
 71244.774457
  5057.229038
  3761.297034
 ...

 Remember that loops are fast in Julia...

 Kaj



 On Tuesday, July 14, 2015 at 9:14:37 AM UTC+3, Ferran Mazzanti wrote:

 Thanks for the info. Actually my question comes from old fortran 
 style, where I can write something of the form
 Write(1,'1000f12.6') a
 where a is an array. The string inside the write function says I can 
 print 1000 doubkes in 12 characters with 6 decimals. So the string is a 
 constant literal, and array a can contain 1000 or less elements that will 
 be properly formatted. Is there a way to do something like this in Julia?
 What if Inwant to print 1000 float64 on the same line with a given 
 format for each element?
 Maybebthis is easier...
 Best regards and thanks.
 Ferran.



[julia-users] Re: SOLVED: ERROR: `start` has no method matching start(::Nothing)

2015-07-21 Thread Ismael VC
Not related, but how do you edit the thread name in order to mark it as 
SOLVED? I haven't found a way to do this, thanks!

El lunes, 20 de julio de 2015, 14:09:00 (UTC-5), Kaj Wiik escribió:

 I started to get a strange error while debugging my code, here's a 
 simplified example:

 julia function foo(a)
println(foo..)
end
 foo (generic function with 1 method)

 julia a = foo(2)
 foo..

 julia a,b = foo(2)
 foo..
 ERROR: `start` has no method matching start(::Nothing)


 So, the problem was a missing return value, it is strange that missing one 
 value did not give error but two values It took a quite long time to 
 track this down. Perhaps a bit more informative error message would be 
 possible...?

 Cheers,
 Kaj



[julia-users] Re: Why is the type of a variable different from inside and outside a let block?

2015-07-21 Thread Ismael VC
Thank you both! I get it now:

julia let

  x::Float64 = 5

  x

  end::Float64

5.0



El lunes, 20 de julio de 2015, 23:03:03 (UTC-5), Ismael VC escribió:

 This was surprising:

 julia versioninfo()
 Julia Version 0.4.0-dev+5491
 Commit cb77503 (2015-06-21 09:45 UTC)
 Platform Info:
   System: Linux (x86_64-unknown-linux-gnu)
   CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3

 julia let
x::Float64 = 5
end::Float64
 ERROR: TypeError: typeassert: expected Float64, got Int64

 julia let
x::UTF8String = test
end::UTF8String
 ERROR: TypeError: typeassert: expected UTF8String, got ASCIIString




[julia-users] Why is the type of a variable different from inside and outside a let block?

2015-07-20 Thread Ismael VC
This was surprising:

julia versioninfo()
Julia Version 0.4.0-dev+5491
Commit cb77503 (2015-06-21 09:45 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

julia let
   x::Float64 = 5
   end::Float64
ERROR: TypeError: typeassert: expected Float64, got Int64

julia let
   x::UTF8String = test
   end::UTF8String
ERROR: TypeError: typeassert: expected UTF8String, got ASCIIString




[julia-users] Re: Indication of the future development in the online Julia documentation

2015-07-17 Thread Ismael VC
You could add a section in the manual which explains the depreciation 
process, I think it's really worth it.

El viernes, 17 de julio de 2015, 9:57:59 (UTC-5), Sisyphuss escribió:

 We are currently at v0.3. However, the upcoming v0.4 and v0.5 will bring 
 some breaking changes to Julia, which makes the learning of this language 
 harder. 

 To this end, I think it should be helpful if the prepared future 
 development could be indicated in the online help document. This will 
 definitely make this language more friendly to early adopter and let the 
 users foresee the trend of this language.




[julia-users] Proposal to internationalize the Julia web page.

2015-07-15 Thread Ismael VC
You can see the pull request 
here: https://github.com/JuliaLang/julialang.github.com/pull/252

Working demo here: http://julialanges.github.io

Please let me know what do you think.


Re: [julia-users] Re: Juliacon 2015 videos?

2015-07-11 Thread Ismael VC
Also while I wait for this news I'd like to know which license is used
currently for the videos that are already at the Julia Youtube channel. If
it's ok I would also like to provide translated subtitles for some of these
videos. I'm assuming this is something we all want as a community, I'm I
right?

@sorami are you guys at also interested in this? Id like to know which
other stuff would you or anybody else expect to be part of juila-i10n.

Is there anyone else interested in translating julia resources to other
languages?

On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael.vc1...@gmail.com wrote:

 @Viral thank you for the update! What I want is to be able to subtitle the
 videos, that's all.

 On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org wrote:

 We have to work through all these details still.

 -viral


 On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:

 Please could anyone tell me what's the situation with the videos
 copyrights would I be allowed to translate them into Spanish?

 El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter escribió:

 Will there be videos of the 2015 Juliacon? Where... :-)
 Thanks.





Re: [julia-users] Re: Juliacon 2015 videos?

2015-07-11 Thread Ismael VC
Everyone, please feel free to come and join us at the Gitter channel
**julia-i18n** for discussions regarding the internationalization of Julia:

* https://gitter.im/JuliaLangEs/julia-i18n

On Sat, Jul 11, 2015 at 9:46 AM, Ismael VC ismael.vc1...@gmail.com wrote:

 Also while I wait for this news I'd like to know which license is used
 currently for the videos that are already at the Julia Youtube channel. If
 it's ok I would also like to provide translated subtitles for some of these
 videos. I'm assuming this is something we all want as a community, I'm I
 right?

 @sorami are you guys at also interested in this? Id like to know which
 other stuff would you or anybody else expect to be part of juila-i10n.

 Is there anyone else interested in translating julia resources to other
 languages?

 On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael.vc1...@gmail.com
 wrote:

 @Viral thank you for the update! What I want is to be able to subtitle
 the videos, that's all.

 On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org wrote:

 We have to work through all these details still.

 -viral


 On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:

 Please could anyone tell me what's the situation with the videos
 copyrights would I be allowed to translate them into Spanish?

 El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter escribió:

 Will there be videos of the 2015 Juliacon? Where... :-)
 Thanks.






Re: [julia-users] Re: Juliacon 2015 videos?

2015-07-11 Thread Ismael VC
@Viral thank you for the update! What I want is to be able to subtitle the
videos, that's all.

On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org wrote:

 We have to work through all these details still.

 -viral


 On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:

 Please could anyone tell me what's the situation with the videos
 copyrights would I be allowed to translate them into Spanish?

 El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter escribió:

 Will there be videos of the 2015 Juliacon? Where... :-)
 Thanks.




Re: [julia-users] Juliacon 2015 videos?

2015-07-11 Thread Ismael VC
I was also specially interested in translating David Sanders *Introduction
to Julia* at SciPy 2014. I tried to get in contact with Enthought since
January but I never got a reply: 

 Message: I’d like add translated captions into Spanish to your Julia
YouTube videos, and I was wondering how to go about it.

I’ve seen a few on line tools, but I can’t import your video, from here for
example:
http://captiontube.appspot.com
I get: Please enter a valid URL for this YouTube video.
Note: if you do not own the video and it is private or cannot be embedded,
you will not be able to import it. If you own the video, close this dialog
and choose Personal Video to import it.

bvIt’s supposed to allow me to import it so I can translate it and send the
translations via e-mail to theEnthought YouTube account.

Thank you very much!

I just got this from their bot:

We have received your support request (# 44258) and are reviewing it.

​

On Sat, Jul 11, 2015 at 10:56 AM, Viral Shah vi...@mayin.org wrote:

 I am pretty sure that JuliaCon 2014 videos are under some sort of Creative
 Commons, but can’t quite remember which exact one. Perhaps someone else may
 know.

 It would be great to have the spanish and other subtitles.

 -viral



  On 11-Jul-2015, at 8:16 pm, Ismael VC ismael.vc1...@gmail.com wrote:
 
  Also while I wait for this news I'd like to know which license is used
 currently for the videos that are already at the Julia Youtube channel. If
 it's ok I would also like to provide translated subtitles for some of these
 videos. I'm assuming this is something we all want as a community, I'm I
 right?
 
  @sorami are you guys at also interested in this? Id like to know which
 other stuff would you or anybody else expect to be part of juila-i10n.
 
  Is there anyone else interested in translating julia resources to other
 languages?
 
  On Sat, Jul 11, 2015 at 9:29 AM, Ismael VC ismael.vc1...@gmail.com
 wrote:
  @Viral thank you for the update! What I want is to be able to subtitle
 the videos, that's all.
 
  On Fri, Jul 10, 2015 at 9:52 PM, Viral Shah vi...@mayin.org wrote:
  We have to work through all these details still.
 
  -viral
 
 
  On Friday, July 10, 2015 at 11:19:31 PM UTC+5:30, Ismael VC wrote:
  Please could anyone tell me what's the situation with the videos
 copyrights would I be allowed to translate them into Spanish?
 
  El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter escribió:
  Will there be videos of the 2015 Juliacon? Where... :-)
  Thanks.
 
 




[julia-users] Re: Juliacon 2015 videos?

2015-07-10 Thread Ismael VC
Please could anyone tell me what's the situation with the videos copyrights 
would I be allowed to translate them into Spanish?

El miércoles, 1 de julio de 2015, 7:07:18 (UTC-5), Hans-Peter escribió:

 Will there be videos of the 2015 Juliacon? Where... :-)
 Thanks.



[julia-users] Re: Differential equations system with SymPy function dsolve?

2015-07-08 Thread Ismael VC
Thanks, that's great!

El miércoles, 8 de julio de 2015, 19:49:33 (UTC-5), j verzani escribió:

 The answer is 

 dsolve(exs::Vector{Sym};kwargs...) = sympy_meth(:dsolve, exs; kwargs...)

 I just added this to the master version and will push to METADATA soon.

 On Wednesday, July 8, 2015 at 8:03:35 PM UTC-4, CasUpg wrote:

 Hi,
 I'm trying SymPy to solve differential equations system but it does not 
 work in Julia. In Python it does. If I write the following in Python:

 from sympy import *
 t = symbols('t')
 x = Function('x')
 y = Function('y')
 eq = (Eq(diff(x(t),t), 12*t*x(t) + 8*y(t)), Eq(diff(y(t),t), 21*x(t) + 7*
 t*y(t)))
 dsolve(eq)

 it returns:

 [x(t) == C1*x0 + C2*x0*Integral(8*exp(Integral(7*t, t))*exp(Integral(12*t
 , t))/x0**2, t),
  y(t) == C1*y0 + C2(y0*Integral(8*exp(Integral(7*t, t))*exp(Integral(12*t
 , t))/x0**2, t) + exp(Integral(7*t, t))*exp(Integral(12*t, t))/x0)]


 But if I type the following in Julia:

 julia versioninfo()
 Julia Version 0.3.10
 Commit c8ceeef (2015-06-24 13:54 UTC)
 Platform Info:
   System: Linux (i686-linux-gnu)
   CPU: Intel(R) Celeron(R) CPU B815 @ 1.60GHz
   WORD_SIZE: 32
   BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY 
 Nehalem)
   LAPACK: liblapack.so.3
   LIBM: libopenlibm
   LLVM: libLLVM-3.3


 using SymPy
 t, = @syms t
 x, y = symbols(x, y, cls=SymFunction)
 eq = [Eq(diff(x(t),t), 12*t*x(t) + 8*y(t)), Eq(diff(y(t),t), 21*x(t) + 7*
 t*y(t))]
 dsolve(eq)

 it returns:

 ERROR: `dsolve` has no method matching dsolve(::Array{Sym,1})


 In the SymPy file math.jl, there is only the following definition for 
 dsolve:

 dsolve(ex::Sym, fx::Sym) = sympy_meth(:dsolve, ex, fx)



 How can I extend it in order to solve differential equations systems?

 A try can be found in:

 https://gist.github.com/Ismael-VC/2f39cd8cf30d19a78349

 but it returns a wrong answer.



[julia-users] Re: Help in understanding Julia's ways

2015-07-06 Thread Ismael VC
Couldn't we just get a warning and let people shoot themselves in their 
foot if that's what they want?

Something like:

Warning: Using private method/type in module Foo at foo.jl:n.


I hate boilerplate redundancy, also I didn't knew about the fields of 
types are private, I do understand that not exported objects are kinda 
private.

El domingo, 5 de julio de 2015, 14:55:44 (UTC-5), Julian Manzano escribió:

 Hi All,

 I have been using C++ and Python for several years and I am very curious 
 about Julia, I've got the REPL working on my workstation and I am really 
 impressed so far with what I've seen.
 However there are some design decisions in the language that I fail to 
 understand and I would really appreciate if someone could explain the 
 rationale:

 The main point that I fail to understand is the decision not to allow 
 member functions. 
 The typical explanation that I find everywhere is that Julia designers 
 have chosen all the methods to be external because this is cleaner 
 (specially for mathematical methods where there is no clear owner) and 
 allows for multiple dispatch.
 This explanation does not convince me for the following reasons:

 1) We can have multiple dispatch a la Julia and still allow types to have 
 methods. These two things seeem independent to me.
 2) Dynamic multiple dispatch can also be done as a byproduct of single 
 dispatch using the visitor pattern (C++, Java, etc.), so in that sense, 
 multiple dispatch is not a new feature.
 3) Lack of member functions forces all field to be public and therefore I 
 cannot understand how Julia will avoid the object orgy anti-pattern (https
 ://en.wikipedia.org/wiki/Object_orgy)

 But hey, Julia still looks great, it is just that I would really like if 
 someone could explain away my concerns, most likely I am missing something 
 here.
 Thanks!
 Julian 



[julia-users] Re: questions about coroutines

2015-07-06 Thread Ismael VC
I thougth that using type annotations to assert the type would help, but it 
doesn't:

```
counter() = for i = 1:100 x = produce(i) end

function test₂()
a = zeros(Int, 100)
task = Task(counter)
for i = 1:100
a[i] = consume(task)::Int
end
end
```

El martes, 30 de junio de 2015, 11:20:36 (UTC-5), g escribió:

 I'm trying to understand coroutines for single threaded concurrency. I'm 
 surprised that produce()/consume() and RemoteRef have no mechanism for type 
 information, and as I understand it, are type unstable. One should 
 therefore avoid using these in inner loops I guess? Should we expect this 
 to remain the case?

 In Go it appears to be encouraged to heavily use concurrency even for 
 things as simple as generating a series of numbers. In julia you might say
 a = zeros(Int,100)
 for i=1:100 a[i]=i end

 In go you could certainly do that, but in my brief introduction it 
 appeared to be encouraged to do create a function that pushes i onto a 
 channel and then read numbers out from the channel. In julia with 
 produce/consume instead of a channel that would look like
 counter() = for i=1:100 produce(i) end
 a = zeros(Int,100)
 task = Task(counter)
 for i=1:100 a[i]=consume(task) end
 This seems seems to violate julia performance guidelines as I understand 
 them, since the the compiler doesn't know what type consume(task) will 
 return.

 So I tried to implement something more like a go channel, that has type 
 information. I thought it would be faster
 type GoChannel{T}
 v::T
 hasvalue::Bool
 c::Condition
 end
 It turned out to be about 2x slower than the produce()/consume() approach, 
 and using RemoteRef (which has a more go channel like API) is about 4x 
 slower than produce()/consume(). On my computer anyway, the 
 produce()/consume() approach is about 7x slower than using a channel in go 
 for the same thing.

 Gist with full code: 
 https://gist.github.com/g/c93a0f029620deca4f2e

 So I guess my questions are:
 Why isn't there at least an option to encode type information in 
 consume/produce and RemoteRef?
 Is there anything I could do to speed up my GoChannel implementation? Did 
 I make any mistakes in my other benchmarks?

  I know this is one of go's defining features, so it is perhaps 
 unsurprising that Julia isn't as fast for this yet. Is there room to speed 
 these concurrent communication constructs up?

 Thanks.



Re: [julia-users] Re: Juliacon 2015 videos?

2015-07-03 Thread Ismael VC
Indeed I would like to translate the videos to Spanish. How are the videos 
licensed?


El jueves, 2 de julio de 2015, 9:00:28 (UTC-5), Scott Jones escribió:

 There are also Spanish speaking volunteers (David Sander's great Julia 
 community in Mexico) waiting to get the videos (and permission) to subtitle 
 some (or hopefully all) of the talks.
 Same thing here, all of the talks I went to were wonderful, but I had to 
 miss a number of them that were also of interest to me.

 On Thursday, July 2, 2015 at 5:11:52 AM UTC-4, Stefan Karpinski wrote:

 The AV crew was actually paid and they're actively working on the videos, 
 so that should be done soonish. Will let everyone know once it's done, of 
 course. I'm eager to see them too since the conference was 1.5 track and I 
 couldn't see all of the talks!

 On Wed, Jul 1, 2015 at 8:52 AM, Randy Zwitch randy@fuqua.duke.edu 
 wrote:

 They were all recorded. Be patient, everyone is a volunteer :)

 On Wednesday, July 1, 2015 at 8:07:18 AM UTC-4, Hans-Peter wrote:

 Will there be videos of the 2015 Juliacon? Where... :-)
 Thanks.




[julia-users] Re: Sieve of Atkin performance.

2015-06-28 Thread Ismael VC
Stefan It's done, I've updated it with a MIT licence header: 
https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

El domingo, 28 de junio de 2015, 10:16:16 (UTC-5), Ismael VC escribió:

 Hello everyone!

 I’ve implemented this Sieve of Atkin: 

- https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

 function atkin(limit::Int = 0)
 @inbounds begin
 primes = [2, 3]

 if limit  0
 error(limit can't be negative (found $(limit)))

 elseif limit  2
 primes = Int[]

 elseif limit == 2
 primes = [2]

 else
 factor = round(Int, sqrt(limit))
 sieve = falses(limit)

 for x = 1:factor
 for y = 1:factor
 n = 4x^2 + y^2
 if n = limit  (n % 12 == 1 || n % 12 == 5)
 sieve[n] = !sieve[n]
 end

 n = 3x^2 + y^2
 if n = limit  n % 12 == 7
 sieve[n] = !sieve[n]
 end

 n = 3x^2 - y^2
 if x  y  n = limit  n % 12 == 11
 sieve[n] = !sieve[n]
 end
 end
 end

 for x = 5:factor
 if sieve[x]
 for y = x^2 : x^2 : limit
 sieve[y] = false
 end
 end
 end

 for i = 5:limit
 if sieve[i]
 push!(primes, i)
 end
 end
 end
 end
 return primes
 end

 Ported directly from the Wikipedia pseudocode:

- https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

 And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
 JuliaBox version 0.4.0-dev+5491):

- http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

 I also tested it on a Mac:

 ulia versioninfo()
 Julia Version 0.3.9
 Commit 31efe69 (2015-05-30 11:24 UTC)
 Platform Info:
 System: Darwin (x86_64-apple-darwin13.4.0)
 CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 WORD_SIZE: 64
 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
 LAPACK: libopenblas
 LIBM: libopenlibm
 LLVM: libLLVM-3.3

 julia gc(); @time primes(1000_000_000);
 elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

 julia gc(); @time atkin(1000_000_000);
 elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

 julia gc(); @time primes(10_000_000_000);
 elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc 
 time)

 julia gc(); @time atkin(10_000_000_000);
 elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
 time)

 Reference: 

- 
https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

 I’m trying to understand how does Base.primes and the Base.primesmask 
 functions work and also how is it that atkin performs better in time (and 
 sometimes also in space) than Base.primes in this tests.
 ​



[julia-users] Re: Sieve of Atkin performance.

2015-06-28 Thread Ismael VC
I used the wikipedia spanish version and algorithm, I didn't notice that 
it's a different one in the english version:

* https://es.wikipedia.org/wiki/Criba_de_Atkin#Pseudoc.C3.B3digo

I'll check that one too.

El domingo, 28 de junio de 2015, 10:16:16 (UTC-5), Ismael VC escribió:

 Hello everyone!

 I’ve implemented this Sieve of Atkin: 

- https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

 function atkin(limit::Int = 0)
 @inbounds begin
 primes = [2, 3]

 if limit  0
 error(limit can't be negative (found $(limit)))

 elseif limit  2
 primes = Int[]

 elseif limit == 2
 primes = [2]

 else
 factor = round(Int, sqrt(limit))
 sieve = falses(limit)

 for x = 1:factor
 for y = 1:factor
 n = 4x^2 + y^2
 if n = limit  (n % 12 == 1 || n % 12 == 5)
 sieve[n] = !sieve[n]
 end

 n = 3x^2 + y^2
 if n = limit  n % 12 == 7
 sieve[n] = !sieve[n]
 end

 n = 3x^2 - y^2
 if x  y  n = limit  n % 12 == 11
 sieve[n] = !sieve[n]
 end
 end
 end

 for x = 5:factor
 if sieve[x]
 for y = x^2 : x^2 : limit
 sieve[y] = false
 end
 end
 end

 for i = 5:limit
 if sieve[i]
 push!(primes, i)
 end
 end
 end
 end
 return primes
 end

 Ported directly from the Wikipedia pseudocode:

- https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

 And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
 JuliaBox version 0.4.0-dev+5491):

- http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

 I also tested it on a Mac:

 ulia versioninfo()
 Julia Version 0.3.9
 Commit 31efe69 (2015-05-30 11:24 UTC)
 Platform Info:
 System: Darwin (x86_64-apple-darwin13.4.0)
 CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 WORD_SIZE: 64
 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
 LAPACK: libopenblas
 LIBM: libopenlibm
 LLVM: libLLVM-3.3

 julia gc(); @time primes(1000_000_000);
 elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

 julia gc(); @time atkin(1000_000_000);
 elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

 julia gc(); @time primes(10_000_000_000);
 elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc 
 time)

 julia gc(); @time atkin(10_000_000_000);
 elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
 time)

 Reference: 

- 
https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

 I’m trying to understand how does Base.primes and the Base.primesmask 
 functions work and also how is it that atkin performs better in time (and 
 sometimes also in space) than Base.primes in this tests.
 ​



[julia-users] Sieve of Atkin performance.

2015-06-28 Thread Ismael VC


Hello everyone!

I’ve implemented this Sieve of Atkin: 

   - https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

function atkin(limit::Int = 0)
@inbounds begin
primes = [2, 3]

if limit  0
error(limit can't be negative (found $(limit)))

elseif limit  2
primes = Int[]

elseif limit == 2
primes = [2]

else
factor = round(Int, sqrt(limit))
sieve = falses(limit)

for x = 1:factor
for y = 1:factor
n = 4x^2 + y^2
if n = limit  (n % 12 == 1 || n % 12 == 5)
sieve[n] = !sieve[n]
end

n = 3x^2 + y^2
if n = limit  n % 12 == 7
sieve[n] = !sieve[n]
end

n = 3x^2 - y^2
if x  y  n = limit  n % 12 == 11
sieve[n] = !sieve[n]
end
end
end

for x = 5:factor
if sieve[x]
for y = x^2 : x^2 : limit
sieve[y] = false
end
end
end

for i = 5:limit
if sieve[i]
push!(primes, i)
end
end
end
end
return primes
end

Ported directly from the Wikipedia pseudocode:

   - https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
JuliaBox version 0.4.0-dev+5491):

   - http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

I also tested it on a Mac:

ulia versioninfo()
Julia Version 0.3.9
Commit 31efe69 (2015-05-30 11:24 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
LAPACK: libopenblas
LIBM: libopenlibm
LLVM: libLLVM-3.3

julia gc(); @time primes(1000_000_000);
elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

julia gc(); @time atkin(1000_000_000);
elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

julia gc(); @time primes(10_000_000_000);
elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc time)

julia gc(); @time atkin(10_000_000_000);
elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
time)

Reference: 

   - https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

I’m trying to understand how does Base.primes and the Base.primesmask 
functions work and also how is it that atkin performs better in time (and 
sometimes also in space) than Base.primes in this tests.
​


[julia-users] Re: Sieve of Atkin performance.

2015-06-28 Thread Ismael VC
Yes certainly Stefan, I'll update the gist with a MIT licence note.

El domingo, 28 de junio de 2015, 10:16:16 (UTC-5), Ismael VC escribió:

 Hello everyone!

 I’ve implemented this Sieve of Atkin: 

- https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

 function atkin(limit::Int = 0)
 @inbounds begin
 primes = [2, 3]

 if limit  0
 error(limit can't be negative (found $(limit)))

 elseif limit  2
 primes = Int[]

 elseif limit == 2
 primes = [2]

 else
 factor = round(Int, sqrt(limit))
 sieve = falses(limit)

 for x = 1:factor
 for y = 1:factor
 n = 4x^2 + y^2
 if n = limit  (n % 12 == 1 || n % 12 == 5)
 sieve[n] = !sieve[n]
 end

 n = 3x^2 + y^2
 if n = limit  n % 12 == 7
 sieve[n] = !sieve[n]
 end

 n = 3x^2 - y^2
 if x  y  n = limit  n % 12 == 11
 sieve[n] = !sieve[n]
 end
 end
 end

 for x = 5:factor
 if sieve[x]
 for y = x^2 : x^2 : limit
 sieve[y] = false
 end
 end
 end

 for i = 5:limit
 if sieve[i]
 push!(primes, i)
 end
 end
 end
 end
 return primes
 end

 Ported directly from the Wikipedia pseudocode:

- https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

 And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
 JuliaBox version 0.4.0-dev+5491):

- http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

 I also tested it on a Mac:

 ulia versioninfo()
 Julia Version 0.3.9
 Commit 31efe69 (2015-05-30 11:24 UTC)
 Platform Info:
 System: Darwin (x86_64-apple-darwin13.4.0)
 CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 WORD_SIZE: 64
 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
 LAPACK: libopenblas
 LIBM: libopenlibm
 LLVM: libLLVM-3.3

 julia gc(); @time primes(1000_000_000);
 elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

 julia gc(); @time atkin(1000_000_000);
 elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

 julia gc(); @time primes(10_000_000_000);
 elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc 
 time)

 julia gc(); @time atkin(10_000_000_000);
 elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
 time)

 Reference: 

- 
https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

 I’m trying to understand how does Base.primes and the Base.primesmask 
 functions work and also how is it that atkin performs better in time (and 
 sometimes also in space) than Base.primes in this tests.
 ​



[julia-users] Re: Sieve of Atkin performance.

2015-06-28 Thread Ismael VC


Best out of 10 runs with a limit of 100,000,000.

   - Base.primes: 

3.514 seconds (9042 k allocations: 194 MB, 0.22% gc time)

   - atkin: 

2.036 seconds (20 allocations: 78768 KB, 0.03% gc time)

   - eratosthenes: 

7.272 seconds (10 k allocations: 1677 MB, 1.58% gc time)

El domingo, 28 de junio de 2015, 10:16:16 (UTC-5), Ismael VC escribió:

Hello everyone!

 I’ve implemented this Sieve of Atkin: 

- https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

 function atkin(limit::Int = 0)
 @inbounds begin
 primes = [2, 3]

 if limit  0
 error(limit can't be negative (found $(limit)))

 elseif limit  2
 primes = Int[]

 elseif limit == 2
 primes = [2]

 else
 factor = round(Int, sqrt(limit))
 sieve = falses(limit)

 for x = 1:factor
 for y = 1:factor
 n = 4x^2 + y^2
 if n = limit  (n % 12 == 1 || n % 12 == 5)
 sieve[n] = !sieve[n]
 end

 n = 3x^2 + y^2
 if n = limit  n % 12 == 7
 sieve[n] = !sieve[n]
 end

 n = 3x^2 - y^2
 if x  y  n = limit  n % 12 == 11
 sieve[n] = !sieve[n]
 end
 end
 end

 for x = 5:factor
 if sieve[x]
 for y = x^2 : x^2 : limit
 sieve[y] = false
 end
 end
 end

 for i = 5:limit
 if sieve[i]
 push!(primes, i)
 end
 end
 end
 end
 return primes
 end

 Ported directly from the Wikipedia pseudocode:

- https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

 And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
 JuliaBox version 0.4.0-dev+5491):

- http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

 I also tested it on a Mac:

 ulia versioninfo()
 Julia Version 0.3.9
 Commit 31efe69 (2015-05-30 11:24 UTC)
 Platform Info:
 System: Darwin (x86_64-apple-darwin13.4.0)
 CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 WORD_SIZE: 64
 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
 LAPACK: libopenblas
 LIBM: libopenlibm
 LLVM: libLLVM-3.3

 julia gc(); @time primes(1000_000_000);
 elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

 julia gc(); @time atkin(1000_000_000);
 elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

 julia gc(); @time primes(10_000_000_000);
 elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc 
 time)

 julia gc(); @time atkin(10_000_000_000);
 elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
 time)

 Reference: 

- 
https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

 I’m trying to understand how does Base.primes and the Base.primesmask 
 functions work and also how is it that atkin performs better in time (and 
 sometimes also in space) than Base.primes in this tests.
 ​

​


[julia-users] Re: Sieve of Atkin performance.

2015-06-28 Thread Ismael VC


Is that header ok? What do you think about this? The wikipedia article 
claims that there is room for more improvement:

This pseudocode is written for clarity; although some redundant 
computations have been eliminated by controlling the odd/even x/y 
combinations, it still wastes almost half of its quadratic computations on 
non-productive loops that don’t pass the modulo tests such that it will not 
be faster than an equivalent wheel factorized (2/3/5) sieve of 
Eratosthenes. To improve its efficiency, a method must be devised to 
minimize or eliminate these non-productive computations.

El domingo, 28 de junio de 2015, 10:16:16 (UTC-5), Ismael VC escribió:

Hello everyone!

 I’ve implemented this Sieve of Atkin: 

- https://gist.github.com/Ismael-VC/179790a53c549609b3ce 

 function atkin(limit::Int = 0)
 @inbounds begin
 primes = [2, 3]

 if limit  0
 error(limit can't be negative (found $(limit)))

 elseif limit  2
 primes = Int[]

 elseif limit == 2
 primes = [2]

 else
 factor = round(Int, sqrt(limit))
 sieve = falses(limit)

 for x = 1:factor
 for y = 1:factor
 n = 4x^2 + y^2
 if n = limit  (n % 12 == 1 || n % 12 == 5)
 sieve[n] = !sieve[n]
 end

 n = 3x^2 + y^2
 if n = limit  n % 12 == 7
 sieve[n] = !sieve[n]
 end

 n = 3x^2 - y^2
 if x  y  n = limit  n % 12 == 11
 sieve[n] = !sieve[n]
 end
 end
 end

 for x = 5:factor
 if sieve[x]
 for y = x^2 : x^2 : limit
 sieve[y] = false
 end
 end
 end

 for i = 5:limit
 if sieve[i]
 push!(primes, i)
 end
 end
 end
 end
 return primes
 end

 Ported directly from the Wikipedia pseudocode:

- https://en.wikipedia.org/wiki/Sieve_of_Atkin#Pseudocode 

 And I’ve also compared atkin with Base.primes (IJulia notebook tested at 
 JuliaBox version 0.4.0-dev+5491):

- http://nbviewer.ipython.org/gist/Ismael-VC/25b1a0c1e11f306a40ae 

 I also tested it on a Mac:

 ulia versioninfo()
 Julia Version 0.3.9
 Commit 31efe69 (2015-05-30 11:24 UTC)
 Platform Info:
 System: Darwin (x86_64-apple-darwin13.4.0)
 CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
 WORD_SIZE: 64
 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
 LAPACK: libopenblas
 LIBM: libopenlibm
 LLVM: libLLVM-3.3

 julia gc(); @time primes(1000_000_000);
 elapsed time: 72.423236327 seconds (531889264 bytes allocated, 0.02% gc time)

 julia gc(); @time atkin(1000_000_000);
 elapsed time: 27.908726228 seconds (2342278320 bytes allocated, 0.17% gc time)

 julia gc(); @time primes(10_000_000_000);
 elapsed time: 809.601231674 seconds (4890727200 bytes allocated, 0.00% gc 
 time)

 julia gc(); @time atkin(10_000_000_000);
 elapsed time: 332.286719798 seconds (160351721104 bytes allocated, 0.32% gc 
 time)

 Reference: 

- 
https://github.com/JuliaLang/julia/issues/11594#issuecomment-115915833 

 I’m trying to understand how does Base.primes and the Base.primesmask 
 functions work and also how is it that atkin performs better in time (and 
 sometimes also in space) than Base.primes in this tests.
 ​

​


[julia-users] Invitation to JuliaLangEs events

2015-06-25 Thread Ismael VC
To all Julians!

Our community *JuliaLangEs https://github.com/JuliaLangEs* has been 
invited recently to two important technology events in Mexico.

The first one and the also the closest one is *Campus Party Mexico 2015*, 
which will be celebrated from 22 to 26 of July at Guadalajara and we have 
passes with 60% discount for you! Simply use the code MX6D60yrFoi4 when 
registering:

* http://mexico.campus-party.org

The second one is *MasterCard Masters of Code Mexico*, which will be 
celebrated 1 and 2 of August at Mexico City and we have free passes for 
you! Simply use the code AngelHACK when registering:

* http://mastersofcode.com/event/mexico-city-mexico-august-1-2-2015

But that's not all ...expect more surprises!

Julians assemble!!! ...see you there! ;)


[julia-users] Re: 4º Julia Meetup, México D.F.

2015-05-07 Thread Ismael VC


The next Julia meetup at Mexico City next Saturday May 9, starting at 
11:00am (GMT-5), will be the first one to be live streamed in Google 
Hangouts and Youtube, we hope everything works well! :D 

Meetup:

   - http://www.meetup.com/julialang-mx/events/221963847 

Youtube:

   - https://youtu.be/eF8Uheik7nU 

Hangout:

   - https://plus.google.com/…/events/cs8jc32jvgkqbliu972la9ug66c 

Contact:

   - https://gitter.im/Ismael-VC/julialang-es 

Facebook:

   - https://www.facebook.com/groups/julialang.es 

Google Groups:

   - https://groups.google.com/forum/#!forum/julia-users-es 


El domingo, 19 de abril de 2015, 23:34:16 (UTC-5), Ismael VC escribió:

If you live in Mexico City, the metropolitan area or just plan to visit us 
 this weekend, you are welcome next Saturday May 9 starting at 11:00 am, 
 at the *laboratory Libre IV, 2º floot, Physics Department, Faculty of 
 Science, Univercity City, UNAM*!

 Details: http://www.meetup.com/julialang-mx

​


[julia-users] Building Julia 0.3.7 in OSX 10.6.8 (Snow Leopard).

2015-05-03 Thread Ismael VC


Hello everyone!

I just got an old MacBook with OSX *10.6.8* Snow Leopard at work and I want 
to use the latest Julia release. I noticed that the latest supported 
release for this OS was 2.1, which is what I’m using for now.

The build fails with the following error:

$ make -j1# previously used `make cleanall`
/bin/sh: ./configure: No such file or directory
make[2]: *** [libuv/config.status] Error 127
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2

There indeed isn’t a .configure file. I just red that I need 
USE_SYSTEM_LIBUNWIND=1 for this OS version, so I will try that, but I don’t 
think that s related to this error.

Please note that I’ve never ever used a Mac before, so I’m not sure how to 
proceed. I saw there is brew and probably other methods to build julia, but 
I choose to try building it myself since that’s what I do in Arch Linux for 
the development branch, but I will also try the other options today 
(HomeBrew and MacPorts as far as I’m aware).

How can I tell what Error 127 and Error 2 are?

Cheers!
​


[julia-users] Build error: could not open \flisp.boot\.

2015-04-30 Thread Ismael VC


Hello everyone!

I’m trying to build Julia at PythonAnywhere https://www.pythonanywhere.com, 
and the build fails because of:

CC src/flisp/flisp.o
CC src/flisp/builtins.o
CC src/flisp/string.o
CC src/flisp/equalhash.o
CC src/flisp/table.o
CC src/flisp/iostream.o
CC src/flisp/julia_extensions.o
CC src/flisp/flmain.o
LINK src/flisp/libflisp.a
LINK src/flisp/flisp
FLISP src/julia_flisp.boot
fatal error:
(io-error file: could not open \flisp.boot\)
make[2]: *** [julia_flisp.boot] Error 1
make[2]: *** Waiting for unfinished jobs
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2
10:07 ~/julia (release-0.3)$

*Note:* I did make cleanall before trying again.

This are the VM specs:

10:08 ~/julia (release-0.3)$ cat /etc/issue
Ubuntu 14.04.2 LTS \n \l

10:15 ~/julia (release-0.3)$ uname -a
Linux giles-liveconsole2 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I found an issue that had the same problem at some point, but it was in 
BSD, so I believe it won’t be relevant, yet it’s here:

   - 
   https://groups.google.com/forum/#!msg/julia-dev/Z9J9NK9Ge5w/CNwXK3q2BgQJ 

Thanks in advance, cheers!
​


Re: [julia-users] Build error: could not open \flisp.boot\.

2015-04-30 Thread Ismael VC


If anyone is interested in checking out the console session, just send me a 
message to ismael.vc1...@gmail.com, thanks!

El jueves, 30 de abril de 2015, 11:59:13 (UTC-5), Ismael VC escribió:

Thank yo very much Isaiah, I've just did `make clean  make` again and I 
 still get the same error:

 ```
 Making install in SYM
 CC src/jltypes.o
 CC src/gf.o
 CC src/support/hashing.o
 CC src/support/timefuncs.o
 CC src/support/ptrhash.o
 CC src/support/operators.o
 CC src/support/utf8.o
 CC src/support/ios.o
 CC src/support/htable.o
 CC src/support/bitvector.o
 CC src/support/int2str.o
 CC src/support/libsupportinit.o
 CC src/support/arraylist.o
 CC src/support/strtod.o
 LINK src/support/libsupport.a
 CC src/flisp/flisp.o
 CC src/flisp/builtins.o
 CC src/flisp/string.o
 CC src/flisp/equalhash.o
 CC src/flisp/table.o
 CC src/flisp/iostream.o
 CC src/flisp/julia_extensions.o
 LINK src/flisp/libflisp.a
 CC src/flisp/flmain.o
 LINK src/flisp/flisp
 FLISP src/julia_flisp.boot
 fatal error:
 (io-error file: could not open \flisp.boot\)
 make[2]: *** [julia_flisp.boot] Error 1
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2

 16:18 ~/julia (release-0.3)$  ls -l src/flisp/flisp.boot 
 -rw-rw-r-- 1 MexLavu registered_users 35369 Apr 30 06:58 
 src/flisp/flisp.boot 
 ```

 PythonAnywhere lets us to share a console session, if you or anyone else 
 is interested in this error, I just need you email address to send you the 
 link.


 El jueves, 30 de abril de 2015, 9:22:45 (UTC-5), Isaiah escribió:

 I am guessing there is some other error further back. Try `make -j1` so 
 it fails immediately.

 On Thu, Apr 30, 2015 at 6:22 AM, Ismael VC ismael...@gmail.com wrote:

 Hello everyone!

 I’m trying to build Julia at PythonAnywhere 
 https://www.pythonanywhere.com, and the build fails because of:

 CC src/flisp/flisp.o
 CC src/flisp/builtins.o
 CC src/flisp/string.o
 CC src/flisp/equalhash.o
 CC src/flisp/table.o
 CC src/flisp/iostream.o
 CC src/flisp/julia_extensions.o
 CC src/flisp/flmain.o
 LINK src/flisp/libflisp.a
 LINK src/flisp/flisp
 FLISP src/julia_flisp.boot
 fatal error:
 (io-error file: could not open \flisp.boot\)
 make[2]: *** [julia_flisp.boot] Error 1
 make[2]: *** Waiting for unfinished jobs
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2
 10:07 ~/julia (release-0.3)$

 *Note:* I did make cleanall before trying again.

 This are the VM specs:

 10:08 ~/julia (release-0.3)$ cat /etc/issue
 Ubuntu 14.04.2 LTS \n \l

 10:15 ~/julia (release-0.3)$ uname -a
 Linux giles-liveconsole2 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 
 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 I found an issue that had the same problem at some point, but it was in 
 BSD, so I believe it won’t be relevant, yet it’s here:

- 
https://groups.google.com/forum/#!msg/julia-dev/Z9J9NK9Ge5w/CNwXK3q2BgQJ 

 Thanks in advance, cheers!
 ​


  ​


Re: [julia-users] Build error: could not open \flisp.boot\.

2015-04-30 Thread Ismael VC
Thank yo very much Isaiah, I've just did `make clean  make` again and I 
still get the same error:

```
Making install in SYM
CC src/jltypes.o
CC src/gf.o
CC src/support/hashing.o
CC src/support/timefuncs.o
CC src/support/ptrhash.o
CC src/support/operators.o
CC src/support/utf8.o
CC src/support/ios.o
CC src/support/htable.o
CC src/support/bitvector.o
CC src/support/int2str.o
CC src/support/libsupportinit.o
CC src/support/arraylist.o
CC src/support/strtod.o
LINK src/support/libsupport.a
CC src/flisp/flisp.o
CC src/flisp/builtins.o
CC src/flisp/string.o
CC src/flisp/equalhash.o
CC src/flisp/table.o
CC src/flisp/iostream.o
CC src/flisp/julia_extensions.o
LINK src/flisp/libflisp.a
CC src/flisp/flmain.o
LINK src/flisp/flisp
FLISP src/julia_flisp.boot
fatal error:
(io-error file: could not open \flisp.boot\)
make[2]: *** [julia_flisp.boot] Error 1
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2

16:18 ~/julia (release-0.3)$  ls -l src/flisp/flisp.boot 
-rw-rw-r-- 1 MexLavu registered_users 35369 Apr 30 06:58 
src/flisp/flisp.boot 
```

PythonAnywhere lets us to share a console session, if you or anyone else is 
interested in this error, I just need you email address to send you the 
link.


El jueves, 30 de abril de 2015, 9:22:45 (UTC-5), Isaiah escribió:

 I am guessing there is some other error further back. Try `make -j1` so it 
 fails immediately.

 On Thu, Apr 30, 2015 at 6:22 AM, Ismael VC ismael...@gmail.com 
 javascript: wrote:

 Hello everyone!

 I’m trying to build Julia at PythonAnywhere 
 https://www.pythonanywhere.com, and the build fails because of:

 CC src/flisp/flisp.o
 CC src/flisp/builtins.o
 CC src/flisp/string.o
 CC src/flisp/equalhash.o
 CC src/flisp/table.o
 CC src/flisp/iostream.o
 CC src/flisp/julia_extensions.o
 CC src/flisp/flmain.o
 LINK src/flisp/libflisp.a
 LINK src/flisp/flisp
 FLISP src/julia_flisp.boot
 fatal error:
 (io-error file: could not open \flisp.boot\)
 make[2]: *** [julia_flisp.boot] Error 1
 make[2]: *** Waiting for unfinished jobs
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2
 10:07 ~/julia (release-0.3)$

 *Note:* I did make cleanall before trying again.

 This are the VM specs:

 10:08 ~/julia (release-0.3)$ cat /etc/issue
 Ubuntu 14.04.2 LTS \n \l

 10:15 ~/julia (release-0.3)$ uname -a
 Linux giles-liveconsole2 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 
 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 I found an issue that had the same problem at some point, but it was in 
 BSD, so I believe it won’t be relevant, yet it’s here:

- 
https://groups.google.com/forum/#!msg/julia-dev/Z9J9NK9Ge5w/CNwXK3q2BgQJ 

 Thanks in advance, cheers!
 ​




Re: [julia-users] Build error: could not open \flisp.boot\.

2015-04-30 Thread Ismael VC
Thank you very much Isaiah, I will report this to PythonAnywhere, have a
nice day!

On Thu, Apr 30, 2015 at 2:07 PM, Isaiah Norton isaiah.nor...@gmail.com
wrote:

 The underlying issue is that uv_exepath [1] fails, leading to flisp being
 unable to find where it is running [2], which leads to the error message
 you observed.

 From some cursory googling, my I guess this is an issue with the
 PythonAnywhere docker and/or apparmor configuration. Clearly it is possible
 to run Julia under docker (see JuliaBox), so this will likely need to be
 resolved by PythonAnywhere.

 (related:
 http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
 )

 [1]
 https://github.com/libuv/libuv/blob/1f711e4d6d2137776a113b29a791d115fb4a0c63/src/unix/linux-core.c#L402-L419
 [2]
 https://github.com/JuliaLang/julia/blob/dea3d0e42029af05f58a0069491238462382e591/src/flisp/flisp.c#L2424-L2426



 On Thu, Apr 30, 2015 at 1:08 PM, Ismael VC ismael.vc1...@gmail.com
 wrote:

 If anyone is interested in checking out the console session, just send me
 a message to ismael.vc1...@gmail.com, thanks!

 El jueves, 30 de abril de 2015, 11:59:13 (UTC-5), Ismael VC escribió:

 Thank yo very much Isaiah, I've just did `make clean  make` again and I
 still get the same error:

 ```
 Making install in SYM
 CC src/jltypes.o
 CC src/gf.o
 CC src/support/hashing.o
 CC src/support/timefuncs.o
 CC src/support/ptrhash.o
 CC src/support/operators.o
 CC src/support/utf8.o
 CC src/support/ios.o
 CC src/support/htable.o
 CC src/support/bitvector.o
 CC src/support/int2str.o
 CC src/support/libsupportinit.o
 CC src/support/arraylist.o
 CC src/support/strtod.o
 LINK src/support/libsupport.a
 CC src/flisp/flisp.o
 CC src/flisp/builtins.o
 CC src/flisp/string.o
 CC src/flisp/equalhash.o
 CC src/flisp/table.o
 CC src/flisp/iostream.o
 CC src/flisp/julia_extensions.o
 LINK src/flisp/libflisp.a
 CC src/flisp/flmain.o
 LINK src/flisp/flisp
 FLISP src/julia_flisp.boot
 fatal error:
 (io-error file: could not open \flisp.boot\)
 make[2]: *** [julia_flisp.boot] Error 1
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2

 16:18 ~/julia (release-0.3)$  ls -l src/flisp/flisp.boot
 -rw-rw-r-- 1 MexLavu registered_users 35369 Apr 30 06:58
 src/flisp/flisp.boot
 ```

 PythonAnywhere lets us to share a console session, if you or anyone else
 is interested in this error, I just need you email address to send you the
 link.


 El jueves, 30 de abril de 2015, 9:22:45 (UTC-5), Isaiah escribió:

 I am guessing there is some other error further back. Try `make -j1` so
 it fails immediately.

 On Thu, Apr 30, 2015 at 6:22 AM, Ismael VC ismael...@gmail.com wrote:

 Hello everyone!

 I’m trying to build Julia at PythonAnywhere
 https://www.pythonanywhere.com, and the build fails because of:

 CC src/flisp/flisp.o
 CC src/flisp/builtins.o
 CC src/flisp/string.o
 CC src/flisp/equalhash.o
 CC src/flisp/table.o
 CC src/flisp/iostream.o
 CC src/flisp/julia_extensions.o
 CC src/flisp/flmain.o
 LINK src/flisp/libflisp.a
 LINK src/flisp/flisp
 FLISP src/julia_flisp.boot
 fatal error:
 (io-error file: could not open \flisp.boot\)
 make[2]: *** [julia_flisp.boot] Error 1
 make[2]: *** Waiting for unfinished jobs
 make[1]: *** [julia-release] Error 2
 make: *** [release] Error 2
 10:07 ~/julia (release-0.3)$

 *Note:* I did make cleanall before trying again.

 This are the VM specs:

 10:08 ~/julia (release-0.3)$ cat /etc/issue
 Ubuntu 14.04.2 LTS \n \l

 10:15 ~/julia (release-0.3)$ uname -a
 Linux giles-liveconsole2 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 
 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

 I found an issue that had the same problem at some point, but it was
 in BSD, so I believe it won’t be relevant, yet it’s here:

-

 https://groups.google.com/forum/#!msg/julia-dev/Z9J9NK9Ge5w/CNwXK3q2BgQJ

 Thanks in advance, cheers!
 ​


  ​





[julia-users] 4º Julia Meetup, México D.F.

2015-04-19 Thread Ismael VC
If you live in Mexico City, the metropolitan area or just plan to visit us 
this weekend, you are welcome next Saturday May 9 starting at 11:00 am, 
at the *laboratory Libre IV, 2º floot, Physics Department, Faculty of 
Science, Univercity City, UNAM*!

Details: http://www.meetup.com/julialang-mx


[julia-users] Unable to show `Interact` widget in IJulia.

2015-03-26 Thread Ismael VC
Hello guys!

One of my friends is having trouble with `Interact.jl`. He can't see any 
widget.

* MacOS
* Chromium
* Everything up to date.

Seems there is a connection issue, what could be causing it?

https://files.gitter.im/Ismael-VC/julialang-es/dyGs/Screen-Shot-2015-03-26-at-1.48.01-PM.png

Thanks in advance!


[julia-users] Re: Unable to show `Interact` widget in IJulia.

2015-03-26 Thread Ismael VC


https://files.gitter.im/Ismael-VC/julialang-es/mN7n/Screen-Shot-2015-03-26-at-4.26.25-PM.png


Well test with julia-v0.3.7


El jueves, 26 de marzo de 2015, 14:36:21 (UTC-6), Big Stone escribió:

 Same here on windows ipython3.0 / julia0.3.5,

 Maybe interact.jl is not in synch with recent breaking changes from 
 Ipython.



[julia-users] Re: Unable to show `Interact` widget in IJulia.

2015-03-26 Thread Ismael VC
I don't know any javascript and I don't use MacOS. He uses 64 bit MacOS, I 
suspect it is a firewall issue, but if it where the notebook wouldn't even 
work, am I correct? 

El jueves, 26 de marzo de 2015, 14:04:23 (UTC-6), Ismael VC escribió:

 Hello guys!

 One of my friends is having trouble with `Interact.jl`. He can't see any 
 widget.

 * MacOS
 * Chromium
 * Everything up to date.

 Seems there is a connection issue, what could be causing it?


 https://files.gitter.im/Ismael-VC/julialang-es/dyGs/Screen-Shot-2015-03-26-at-1.48.01-PM.png

 Thanks in advance!



[julia-users] Re: Unable to show `Interact` widget in IJulia.

2015-03-26 Thread Ismael VC
Avik sorry I didn't see your answer and thanks we'll try using Pkg.checkout.

El jueves, 26 de marzo de 2015, 18:46:45 (UTC-6), Avik Sengupta escribió:

 I think you need to run Pkg.checkout(Interact) at the Julia prompt to 
 get this working with ipython 3.0. 

 See https://github.com/JuliaLang/Interact.jl/issues/55 for details. 

 Regards
 -
 Avik

 On Thursday, 26 March 2015 20:36:21 UTC, Big Stone wrote:

 Same here on windows ipython3.0 / julia0.3.5,

 Maybe interact.jl is not in synch with recent breaking changes from 
 Ipython.



[julia-users] Re: What's the difference between @assert and @test?

2015-03-26 Thread Ismael VC
Thank you very much Ivar, that makes sense.

El miércoles, 25 de marzo de 2015, 14:22:28 (UTC-6), Ivar Nesje escribió:

 Good question!

 In 0.4 the printing for @test has been improved quite significantly to 
 display the values of variables.

 julia a,b = 1,2

 julia @test a==b 
 ERROR: test failed: (1 == 2) 
 in expression: a == b 
 in error at error.jl:19 
 in default_handler at test.jl:27 
 in do_test at test.jl:50 

 julia @assert a==b
 ERROR: AssertionError: a == b


 There is some discussion in #10614 
 https://github.com/JuliaLang/julia/issues/10614 about means to disable 
 assertions, so there is a conceptual difference in that assertions is used 
 inside a program to test for invalid inputs to functions, but tests are 
 usually runned externally to see that functions work correctly for 
 different outputs.

 Regards
 Ivar

 onsdag 25. mars 2015 18.26.30 UTC+1 skrev Ismael VC følgende:

 Hello guys!

 I just had someone ask me this question and I didn't know what to answer 
 him, example:

 julia using Base.Test

 julia @test 1 == 1

 julia @test 1 == 3
 ERROR: test failed: 1 == 3
  in error at error.jl:21 (repeats 2 times)

 julia @assert 1 == 1

 julia @assert 1 == 3
 ERROR: assertion failed: 1 == 3
  in error at error.jl:21 (repeats 2 times)

 I fail to see the difference, besides that `@test` conveys the idea of 
 testing. 

 Even the error message is even the same:  `in error at error.jl:21 
 (repeats 2 times)`

 Thanks!



[julia-users] What's the difference between @assert and @test?

2015-03-25 Thread Ismael VC
Hello guys!

I just had someone ask me this question and I didn't know what to answer 
him, example:

julia using Base.Test

julia @test 1 == 1

julia @test 1 == 3
ERROR: test failed: 1 == 3
 in error at error.jl:21 (repeats 2 times)

julia @assert 1 == 1

julia @assert 1 == 3
ERROR: assertion failed: 1 == 3
 in error at error.jl:21 (repeats 2 times)

I fail to see the difference, besides that `@test` conveys the idea of 
testing. 

Even the error message is even the same:  `in error at error.jl:21 (repeats 
2 times)`

Thanks!


Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Ismael VC
@Tammas Array{T}(0) works in 0.4-dev, but I think that's why there is also 
a Vector{T} typealias for Array{T,1}, so it could be Vector{T}(0) which is 
slightly better IMHO.

julia Vector{Int}(0)
0-element Array{Int64,1}

julia Array{Int,1}(0)
0-element Array{Int64,1}

julia Array{Int}(0)
0-element Array{Int64,1}



El jueves, 12 de marzo de 2015, 8:10:14 (UTC-6), Tamas Papp escribió:


 On Thu, Mar 12 2015, Ivar Nesje wrote: 

  
  So, what you would want to do is `Array{String,1}()`. 
  That ought to construct a array of strings with dimension 1 but 
 doesn't. 
  
  
  But in 0.4 you can use Array{String,1}(0) to create a 1d array with 0 
  elements. Note that you have to provide the size of the array, and 0 is 
 not 
  default (, but maybe it should be?) 

 Array{T}(dims...) 

 is equivalent to 

 Array{T,length(dims)}(dims...) 

 while the latter has a redundant parameter. So instead of providing a 
 default for dims..., wouldn't 

 Array{T}(0) 

 be an idiomatic solution for creating an empty vector of eltype T? Has 
 one less character than 

 Array{T,1}(0) 

 :D 

 Best, 

 Tamas 



Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ismael VC
tshort, could you provide us an example please?

El jueves, 12 de marzo de 2015, 4:59:14 (UTC-6), tshort escribió:

 The Lexicon package works well for me along with Mkdocs.
 On Mar 12, 2015 6:03 AM, Ján Adamčák jada...@gmail.com javascript: 
 wrote:

 Hi guys,

 Can I ask you for something like best practice with auto doc tools for 
 parsing Julia code? I try use Doxygen and Sphinx, but I think this is not 
 good solutions in this timeversion(0.3.6). And/Or some tool for generate 
 UML diagrams from julia code?

 Thanks.

 P.S.:
 My idea with this thread is generate something like big manual of 
 knowlege how to use auto doc tools in Julia.



Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ismael VC
Thank you very much Tom!

On Thu, Mar 12, 2015 at 9:26 AM, Tom Short tshort.rli...@gmail.com wrote:

 Here is an example of documentation for a package I maintain:

 https://tshort.github.io/Sims.jl/

 Here are examples of docstrings:

 https://github.com/tshort/Sims.jl/blob/master/src/sim.jl#L1-L96

 Here is the config file for Mkdocs:

 https://github.com/tshort/Sims.jl/blob/master/mkdocs.yml

 Here is a Julia script that uses the Lexicon package to build the API
 documentation from the docstrings:

 https://github.com/tshort/Sims.jl/blob/master/docs/build.jl

 Here are other packages that use Mkdocs:


 https://www.google.com/search?q=mkdocs.yml+jl+site:github.comie=utf-8oe=utf-8


 On Thu, Mar 12, 2015 at 10:28 AM, Ismael VC ismael.vc1...@gmail.com
 wrote:

 tshort, could you provide us an example please?

 El jueves, 12 de marzo de 2015, 4:59:14 (UTC-6), tshort escribió:

 The Lexicon package works well for me along with Mkdocs.
 On Mar 12, 2015 6:03 AM, Ján Adamčák jada...@gmail.com wrote:

 Hi guys,

 Can I ask you for something like best practice with auto doc tools for
 parsing Julia code? I try use Doxygen and Sphinx, but I think this is not
 good solutions in this timeversion(0.3.6). And/Or some tool for generate
 UML diagrams from julia code?

 Thanks.

 P.S.:
 My idea with this thread is generate something like big manual of
 knowlege how to use auto doc tools in Julia.





Re: [julia-users] Re: Julia T-shirt and Sticker

2015-03-10 Thread Ismael VC
 Any sufficiently advanced programing language is indistinguishable from
Julia

That's so much better Paulo! [?]

On Tue, Mar 10, 2015 at 6:44 AM, Michele Zaffalon 
michele.zaffa...@gmail.com wrote:

 No segfaults means zero distance?

 On Tue, Mar 10, 2015 at 1:22 PM, Mike Innes mike.j.in...@gmail.com
 wrote:

 The distance between Julia and insanity is measured only in segfaults





[julia-users] Re: Julia T-shirt and Sticker

2015-03-09 Thread Ismael VC
I would like a cap and stickers with the legend: Any sufficiently advanced 
julian technology is indistinguishable from magic. :D

El lunes, 9 de junio de 2014, 10:52:22 (UTC-5), ther...@gmail.com escribió:

 Hi all,

 Just FYI: I've made a Julia T-shirt and sticker on Zazzle (photo 
 attached). 

 This is for my personal use only; hope this will not cause any problems.

 Regards,
 - Sorami



Re: [julia-users] [code review] atomic units implementationf for AHN-algorithm.

2015-03-05 Thread Ismael VC
Mauro thank you very much for your insight. I don't know if it fills my
bill, but I'll find out.

On Thu, Feb 26, 2015 at 2:23 PM, Mauro mauro...@runbox.com wrote:

  I still don't have a clear picture of how to implement the other more
  complex components: compounds and mixtures. I'm experienced in Python
  which leds me to think in terms inheritance for the concrete types, which
  is the only part that is causing me troubles to grasp for now in Julia. I
  wonder if Traits.jl https://github.com/mauro3/Traits.jl could help me
 or
  confuse me even more.

 Traits.jl confuses me ;-) It would be great if you give Traits.jl a
 spin, it hasn't really been used yet.  (And there is a reason for that,
 as it will most likely break sometime down the road.)  Traits basically
 gives you the ability to group types (or tuples of types) into sets
 which are outside of the type hierarchy.  The most common way to define
 the grouping is by a set of functions (+signatures) which all types
 contained in the trait have to provide.  Although other groupings are
 possible too, e.g. mutable-vs-immutable.  You can then use traits for
 dispatch as well, just like types.  Does that fit your bill?



[julia-users] Re: [code review] atomic units implementationf for AHN-algorithm.

2015-02-27 Thread Ismael VC
How can I implement AtomicUnits promotion? After parameterizing AtomicUnits 
abstract type. This is what I have tried:

julia [C(1), H(1.0), H(1//2), C(big(1))]
4-element Array{AtomicUnit{T},1}:
 Carbon{Int64}(value = 1 + 0im, valence = 4, degree = 0, free = 4)
 Hydrogen{Float64}(value = 1.0 + 0.0im, valence = 1, degree = 0, free = 1)
 Hydrogen{Rational{Int64}}(value = 1//2 + 0//1*im, valence = 1, degree = 0, 
free = 1)
 Carbon{BigInt}(value = 1 + 0im, valence = 4, degree = 0, free = 4)

julia promote_rule{T:Real, S:Real}(::Type{AtomicUnit{T}}, 
::Type{AtomicUnit{S}}) = AtomicUnit{promote(T, S)}
promote_rule (generic function with 1 method)

julia [C(1), H(1.0), H(1//2), C(big(1))]# nothing happens!
4-element Array{AtomicUnit{T},1}:
 Carbon{Int64}(value = 1 + 0im, valence = 4, degree = 0, free = 4)
 Hydrogen{Float64}(value = 1.0 + 0.0im, valence = 1, degree = 0, free = 1)
 Hydrogen{Rational{Int64}}(value = 1//2 + 0//1*im, valence = 1, degree = 0, 
free = 1)
 Carbon{BigInt}(value = 1 + 0im, valence = 4, degree = 0, free = 4)

I want it to promote to `Array{AtomicUnit{BigFloat},1}` for the 
AtomicUnitSet{AtomicUnit{BigFloat}}:

https://github.com/Ismael-VC/AHN.jl/blob/master/src/molecular_units.jl#L1


El jueves, 26 de febrero de 2015, 12:27:05 (UTC-6), Ismael VC escribió:

 Hello everyone!

 I'd like to know your opinions about my atomic units implementation for 
 the artificial hydrocarbon networks algorithm, right now I'm working on the 
 molecular units


- atomic_units.jl http://bit.ly/1wkwO4C


 I still don't have a clear picture of how to implement the other more 
 complex components: compounds and mixtures. I'm experienced in Python 
 which leds me to think in terms inheritance for the concrete types, which 
 is the only part that is causing me troubles to grasp for now in Julia. I 
 wonder if Traits.jl https://github.com/mauro3/Traits.jl could help me 
 or confuse me even more.

 Cheers!



Re: [julia-users] Re: Unable to set up AppVeyor.

2015-02-26 Thread Ismael VC
Thanks again! I'm finally satisfied with my current setup. Now I can stop
playing around with GitHub and actually focus on the code! :D


Cheers!

On Thu, Feb 26, 2015 at 5:22 AM, Tony Kelman t...@kelman.net wrote:

 32 bit Linux is sort of doable, by manually downloading and extracting the
 32-bit generic linux binaries, but note that Travis Linux VM's are always
 64 bit. You probably need to install i386 versions of libc and several
 other basic packages in order to run 32 bit Linux binaries on a 64 bit OS.

 Then most Julia packages with binary dependencies are not currently set up
 to cross-build for a different architecture. Things should work properly if
 the actual OS is 32 bit, but trying to make 32 bit Julia along with
 packages and binary dependencies all work inside a 64 bit Travis VM would
 be quite a bit of work.

 Hopefully testing on 32-bit Windows, where things generally are set up a
 little better for downloading 32 bit versions of dependencies when running
 32 bit Julia (even when the OS is 64 bit Windows), should help you identify
 any integer-size or other bugs that may stem from differences between 32
 bit and 64 bit.


 On Wednesday, February 25, 2015 at 2:44:44 PM UTC-8, Ismael VC wrote:

 It works! One final doubt, how can I enable testing in Travis for both
 Linux 32 and 64 bits for both stable and development branches, the way I
 have it now for AppVeyour with Windows:


- https://ci.appveyor.com/project/Ismael-VC/ahn-jl


 Thank you very much Tony!

 Cheers

 El miércoles, 25 de febrero de 2015, 11:13:23 (UTC-6), Tony Kelman
 escribió:

 You need to use the same link as for nightly builds at the bottom of
 julialang.org/downloads, so it's download/win32 or download/win64
 for nightlies.

 OSX support on Travis has to be explicitly enabled by sending an email
 to them requesting it, but they're not accepting new requests at this time
 - see http://docs.travis-ci.com/user/multi-os/. Unless your package has
 binary dependencies or does anything especially operating-system-specific
 you should probably just focus on getting the Travis Linux testing working
 well first.


 On Wednesday, February 25, 2015 at 7:02:29 AM UTC-8, Ismael VC wrote:

 Ok now that I changed the appveyor file, it no longer finds the
 development versions:

 https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.32/job/
 hssfqsl3pjhlm9de

 a[00:00:00] Build started
 [00:00:08] git clone -q --branch=master git://github.com/Ismael-VC/
 AHN.jl.git C:\projects\ahn-jl
 [00:00:13] git checkout -qf 21b4216a09166a97fbc20b24cdb112cfc1bf6cae
 [00:00:13] Running Install scripts
 [00:00:13] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
 https://ci.appveyor.com/api/projects/$env:APPVEYOR_
 ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?
 recordsNumber=50).builds | ` Where-Object pullRequestId -eq
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There
 are newer queued builds for this pull request, failing early. }
 [00:00:13] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/+$env:JULIAVERSION),
 C:\projects\julia-binary.exe)
 [00:00:16] Exception calling DownloadFile with 2 argument(s): The
 remote server returned an error: (404) Not Found.
 [00:00:16] At line:1 char:43
 [00:00:16] + (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/+$env:JU ...
 [00:00:16] +
 ~~
 [00:00:16] + CategoryInfo  : NotSpecified: (:) [],
 MethodInvocationException
 [00:00:16] + FullyQualifiedErrorId : WebException
 [00:00:16]
 [00:00:16] Command executed with exception: Exception calling
 DownloadFile with 2 argument(s): The remote server returned an error:
 (404) Not Found.


 What should I put?

 devel/win32
 devel/win34

 unstable/win32
 unstable/win34

 I have not found any reference to this in https://status.julialang.org/

 I have also commented `linux` in my .travis.yml, but it's still tests
 for linux instead:

 https://travis-ci.org/Ismael-VC/AHN.jl/builds/52143873

 El lunes, 23 de febrero de 2015, 23:28:38 (UTC-6), Ismael VC escribió:

 This is the log:

 [00:00:00] Build started
 [00:00:10] git clone -q --branch=master git://github.com/Ismael-VC/
 AHN.jl.git C:\projects\ahn-jl
 [00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
 [00:00:17] Running Install scripts
 [00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_
 PROJECT_SLUG/history?recordsNumber=50).builds | ` Where-Object
 pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber)
 { ` throw There are newer queued builds for this pull request, failing
 early. }
 [00:00:17] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/download/+$env:JULIAVERSION),
 C:\projects\julia-binary.exe)
 [00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
 [00

[julia-users] [code review] atomic units implementationf for AHN-algorithm.

2015-02-26 Thread Ismael VC
Hello everyone!

I'd like to know your opinions about my atomic units implementation for 
the artificial hydrocarbon networks algorithm, right now I'm working on the 
molecular units


   - atomic_units.jl http://bit.ly/1wkwO4C


I still don't have a clear picture of how to implement the other more 
complex components: compounds and mixtures. I'm experienced in Python 
which leds me to think in terms inheritance for the concrete types, which 
is the only part that is causing me troubles to grasp for now in Julia. I 
wonder if Traits.jl https://github.com/mauro3/Traits.jl could help me or 
confuse me even more.

Cheers!


[julia-users] Re: Unable to set up AppVeyor.

2015-02-25 Thread Ismael VC
Tony, I've updated according to your comment. I also have a doubt about 
Travis. How can I test for OSX, right now it's only testing for Linux (both 
release and nightly), perhaps it's because I'm using a regular account? 
(though thats how the `.travis.yml` file comes out from `Pkg.generate`)

language: julia

os:
  - linux
  - osx

julia:
  - release
  - nightly

notifications:
  email: false

# uncomment the following lines to override the default test script
# script:
#   - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
#   - julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build(AHN); 
Pkg.test(AHN; coverage=true)'


After editing `appveyor.yaml` I can finally test automatically on stable 
and devel for both 32 and 64 bits for windows, thank you very much!

El miércoles, 25 de febrero de 2015, 3:49:01 (UTC-6), Tony Kelman escribió:

 A few things are wrong there. If you want to test on stable, then 
 JULIAVERSION should be stable/win32 or stable/win64, and the line in 
 install that downloads the binary should say $(
 http://status.julialang.org/+$env:JULIAVERSION), i.e. not include 
 download in it.

 You'll also want to replace mlubin with $env:APPVEYOR_ACCOUNT_NAME.


 On Monday, February 23, 2015 at 9:28:38 PM UTC-8, Ismael VC wrote:

 This is the log:

 [00:00:00] Build started
 [00:00:10] git clone -q --branch=master git://
 github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
 [00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
 [00:00:17] Running Install scripts
 [00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  
 | ` Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
 newer queued builds for this pull request, failing early. }
 [00:00:17] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/download/+$env:JULIAVERSION), 
 C:\projects\julia-binary.exe)
 [00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
 [00:00:19] This version of C:\projects\julia-binary.exe is not compatible 
 with the version of Windows you're running. Check your computer's system 
 information and then contact the software publisher.
 [00:00:19] Command exited with code 1



- 
https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.9/messages


 This is my `appveyor.yml`:

 environment:
   matrix:
   - JULIAVERSION: stable/win32
   
 skip_commits:
 # Add [av skip] to commit messages for docfixes, etc to reduce load on queue
   message: /\[av skip\]/

 install:
 # if there's a newer build queued for the same PR, cancel this one
   - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  | `
 Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
 throw There are newer queued builds for this pull request, failing 
 early. }
 # Download most recent Julia Windows binary
   - ps: (new-object 
 net.webclient).DownloadFile($(http://status.julialang.org/download/+$env:JULIAVERSION),
  C:\projects\julia-binary.exe)
 # Run installer silently, output to C:\projects\julia
   - C:\projects\julia-binary.exe /S /D=C:\projects\julia

 build_script:
 # Need to convert from shallow to complete for Pkg.clone to work
   - IF EXIST .git\shallow (git fetch --unshallow)
   - C:\projects\julia\bin\julia-debug -e versioninfo(); Pkg.init(); 
 Pkg.clone(pwd(), \AHN\)

 test_script:
   - C:\projects\julia\bin\julia-debug -e Pkg.test(\AHN\)



- https://github.com/Ismael-VC/AHN.jl/blob/master/appveyor.yml




[julia-users] Re: Unable to set up AppVeyor.

2015-02-25 Thread Ismael VC
Ok now that I changed the appveyor file, it no longer finds the development 
versions:

https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.32/job/hssfqsl3pjhlm9de

a[00:00:00] Build started
[00:00:08] git clone -q --branch=master 
git://github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
[00:00:13] git checkout -qf 21b4216a09166a97fbc20b24cdb112cfc1bf6cae
[00:00:13] Running Install scripts
[00:00:13] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
$env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
 
| ` Where-Object pullRequestId -eq 
$env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
newer queued builds for this pull request, failing early. }
[00:00:13] (new-object 
net.webclient).DownloadFile($(http://status.julialang.org/+$env:JULIAVERSION),
 
C:\projects\julia-binary.exe)
[00:00:16] Exception calling DownloadFile with 2 argument(s): The 
remote server returned an error: (404) Not Found.
[00:00:16] At line:1 char:43
[00:00:16] + (new-object 
net.webclient).DownloadFile($(http://status.julialang.org/+$env:JU ...
[00:00:16] +   
~~
[00:00:16] + CategoryInfo  : NotSpecified: (:) [], 
MethodInvocationException
[00:00:16] + FullyQualifiedErrorId : WebException
[00:00:16]  
[00:00:16] Command executed with exception: Exception calling 
DownloadFile with 2 argument(s): The remote server returned an error: 
(404) Not Found.


What should I put?

devel/win32
devel/win34

unstable/win32
unstable/win34

I have not found any reference to this in https://status.julialang.org/

I have also commented `linux` in my .travis.yml, but it's still tests for 
linux instead:

https://travis-ci.org/Ismael-VC/AHN.jl/builds/52143873

El lunes, 23 de febrero de 2015, 23:28:38 (UTC-6), Ismael VC escribió:

 This is the log:

 [00:00:00] Build started
 [00:00:10] git clone -q --branch=master git://
 github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
 [00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
 [00:00:17] Running Install scripts
 [00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  
 | ` Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
 newer queued builds for this pull request, failing early. }
 [00:00:17] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/download/+$env:JULIAVERSION), 
 C:\projects\julia-binary.exe)
 [00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
 [00:00:19] This version of C:\projects\julia-binary.exe is not compatible 
 with the version of Windows you're running. Check your computer's system 
 information and then contact the software publisher.
 [00:00:19] Command exited with code 1



- https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.9/messages


 This is my `appveyor.yml`:

 environment:
   matrix:
   - JULIAVERSION: stable/win32
   
 skip_commits:
 # Add [av skip] to commit messages for docfixes, etc to reduce load on queue
   message: /\[av skip\]/

 install:
 # if there's a newer build queued for the same PR, cancel this one
   - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER 
 -ne ((Invoke-RestMethod `
 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  | `
 Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
 throw There are newer queued builds for this pull request, failing 
 early. }
 # Download most recent Julia Windows binary
   - ps: (new-object 
 net.webclient).DownloadFile($(http://status.julialang.org/download/+$env:JULIAVERSION),
  C:\projects\julia-binary.exe)
 # Run installer silently, output to C:\projects\julia
   - C:\projects\julia-binary.exe /S /D=C:\projects\julia

 build_script:
 # Need to convert from shallow to complete for Pkg.clone to work
   - IF EXIST .git\shallow (git fetch --unshallow)
   - C:\projects\julia\bin\julia-debug -e versioninfo(); Pkg.init(); 
 Pkg.clone(pwd(), \AHN\)

 test_script:
   - C:\projects\julia\bin\julia-debug -e Pkg.test(\AHN\)



- https://github.com/Ismael-VC/AHN.jl/blob/master/appveyor.yml




[julia-users] Re: Unable to set up AppVeyor.

2015-02-25 Thread Ismael VC
Neither `win64`, `devel/win64`, `unstable/win64` or `nightly/win64` work.

El lunes, 23 de febrero de 2015, 23:28:38 (UTC-6), Ismael VC escribió:

 This is the log:

 [00:00:00] Build started
 [00:00:10] git clone -q --branch=master git://
 github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
 [00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
 [00:00:17] Running Install scripts
 [00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  
 | ` Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
 newer queued builds for this pull request, failing early. }
 [00:00:17] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/download/+$env:JULIAVERSION), 
 C:\projects\julia-binary.exe)
 [00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
 [00:00:19] This version of C:\projects\julia-binary.exe is not compatible 
 with the version of Windows you're running. Check your computer's system 
 information and then contact the software publisher.
 [00:00:19] Command exited with code 1



- https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.9/messages


 This is my `appveyor.yml`:

 environment:
   matrix:
   - JULIAVERSION: stable/win32
   
 skip_commits:
 # Add [av skip] to commit messages for docfixes, etc to reduce load on queue
   message: /\[av skip\]/

 install:
 # if there's a newer build queued for the same PR, cancel this one
   - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER 
 -ne ((Invoke-RestMethod `
 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  | `
 Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
 throw There are newer queued builds for this pull request, failing 
 early. }
 # Download most recent Julia Windows binary
   - ps: (new-object 
 net.webclient).DownloadFile($(http://status.julialang.org/download/+$env:JULIAVERSION),
  C:\projects\julia-binary.exe)
 # Run installer silently, output to C:\projects\julia
   - C:\projects\julia-binary.exe /S /D=C:\projects\julia

 build_script:
 # Need to convert from shallow to complete for Pkg.clone to work
   - IF EXIST .git\shallow (git fetch --unshallow)
   - C:\projects\julia\bin\julia-debug -e versioninfo(); Pkg.init(); 
 Pkg.clone(pwd(), \AHN\)

 test_script:
   - C:\projects\julia\bin\julia-debug -e Pkg.test(\AHN\)



- https://github.com/Ismael-VC/AHN.jl/blob/master/appveyor.yml




[julia-users] Re: Unable to set up AppVeyor.

2015-02-25 Thread Ismael VC
It works! One final doubt, how can I enable testing in Travis for both 
Linux 32 and 64 bits for both stable and development branches, the way I 
have it now for AppVeyour with Windows:


   - https://ci.appveyor.com/project/Ismael-VC/ahn-jl
   

Thank you very much Tony!

Cheers

El miércoles, 25 de febrero de 2015, 11:13:23 (UTC-6), Tony Kelman escribió:

 You need to use the same link as for nightly builds at the bottom of 
 julialang.org/downloads, so it's download/win32 or download/win64 for 
 nightlies.

 OSX support on Travis has to be explicitly enabled by sending an email to 
 them requesting it, but they're not accepting new requests at this time - 
 see http://docs.travis-ci.com/user/multi-os/. Unless your package has 
 binary dependencies or does anything especially operating-system-specific 
 you should probably just focus on getting the Travis Linux testing working 
 well first.


 On Wednesday, February 25, 2015 at 7:02:29 AM UTC-8, Ismael VC wrote:

 Ok now that I changed the appveyor file, it no longer finds the 
 development versions:


 https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.32/job/hssfqsl3pjhlm9de

 a[00:00:00] Build started
 [00:00:08] git clone -q --branch=master git://
 github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
 [00:00:13] git checkout -qf 21b4216a09166a97fbc20b24cdb112cfc1bf6cae
 [00:00:13] Running Install scripts
 [00:00:13] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
 https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  
 | ` Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
 newer queued builds for this pull request, failing early. }
 [00:00:13] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/+$env:JULIAVERSION), 
 C:\projects\julia-binary.exe)
 [00:00:16] Exception calling DownloadFile with 2 argument(s): The 
 remote server returned an error: (404) Not Found.
 [00:00:16] At line:1 char:43
 [00:00:16] + (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/+$env:JU ...
 [00:00:16] +   
 ~~
 [00:00:16] + CategoryInfo  : NotSpecified: (:) [], 
 MethodInvocationException
 [00:00:16] + FullyQualifiedErrorId : WebException
 [00:00:16]  
 [00:00:16] Command executed with exception: Exception calling 
 DownloadFile with 2 argument(s): The remote server returned an error: 
 (404) Not Found.


 What should I put?

 devel/win32
 devel/win34

 unstable/win32
 unstable/win34

 I have not found any reference to this in https://status.julialang.org/

 I have also commented `linux` in my .travis.yml, but it's still tests for 
 linux instead:

 https://travis-ci.org/Ismael-VC/AHN.jl/builds/52143873

 El lunes, 23 de febrero de 2015, 23:28:38 (UTC-6), Ismael VC escribió:

 This is the log:

 [00:00:00] Build started
 [00:00:10] git clone -q --branch=master git://
 github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
 [00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
 [00:00:17] Running Install scripts
 [00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  
 | ` Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
 newer queued builds for this pull request, failing early. }
 [00:00:17] (new-object net.webclient).DownloadFile($(
 http://status.julialang.org/download/+$env:JULIAVERSION), 
 C:\projects\julia-binary.exe)
 [00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
 [00:00:19] This version of C:\projects\julia-binary.exe is not 
 compatible with the version of Windows you're running. Check your 
 computer's system information and then contact the software publisher.
 [00:00:19] Command exited with code 1



- 
https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.9/messages


 This is my `appveyor.yml`:

 environment:
   matrix:
   - JULIAVERSION: stable/win32
   
 skip_commits:
 # Add [av skip] to commit messages for docfixes, etc to reduce load on queue
   message: /\[av skip\]/

 install:
 # if there's a newer build queued for the same PR, cancel this one
   - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
 $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
 
 https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
  | `
 Where-Object pullRequestId -eq 
 $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
 throw There are newer queued builds for this pull request, failing 
 early. }
 # Download most recent Julia Windows binary
   - ps: (new-object 
 net.webclient).DownloadFile($(http://status.julialang.org/download

[julia-users] Re: ERROR: `checked_mul` has no method matching checked_mul(::Int64, ::Base.GMP.BigInt)

2015-02-24 Thread Ismael VC
Done: https://github.com/JuliaLang/julia/issues/10311

El martes, 24 de febrero de 2015, 10:58:15 (UTC-6), Ismael VC escribió:

 Hello every one! 

 This only fails in v0.4.0-dev+ this is the log:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998218


 Here it is in v0.3.6:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998217

 And here is my test file`:


- 
https://github.com/Ismael-VC/AHN.jl/blob/master/test/atomic_tests.jl#L5


 I have narrowed down to this:

 julia versioninfo()
 Julia Version 0.4.0-dev+3353
 Commit 0179028* (2015-02-14 17:08 UTC)
 Platform Info:
   System: Windows (x86_64-w64-mingw32)
   CPU: Intel(R) Core(TM) i3 CPU   M 350  @ 2.27GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3

 julia nums_data = [
(int8(n), Int8),
(uint8(n), UInt8),
(int16(n), Int16),
(uint16(n), UInt16),
(int32(n), Int32),
(uint32(n), UInt32),
(int64(n), Int64),
(uint64(n), UInt64),
(int128(n), Int128),
(uint128(n), UInt128),
(true, Bool),
(complex(true, true), Bool),
(float16(n), Float16),
(float32(n), Float32),
(float64(n), Float64),
(BigInt(n), BigInt),
(BigFloat(n), BigFloat),
(n//n, Rational{Int}),
(n//n + n//big(n)*im, Rational{BigInt}),
(n+n*im, Int),
(Inf*im, Float64)
]
 ERROR: MethodError: `checked_mul` has no method matching 
 checked_mul(::Int64, ::
 LastMain.LastMain.Base.GMP.BigInt)
 Closest candidates are:
   checked_mul(::Int64, ::Int64)
   checked_mul(::LastMain.LastMain.Base.GMP.BigInt, 
 ::LastMain.LastMain.Base.GMP.
 BigInt)

  in + at rational.jl:166
  in + at complex.jl:118


 It doesn't mater if I use `Compat` or not.



[julia-users] ERROR: `checked_mul` has no method matching checked_mul(::Int64, ::Base.GMP.BigInt)

2015-02-24 Thread Ismael VC
Hello every one! 

This only fails in v0.4.0-dev+ this is the log:


   - https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998218
   

Here it is in v0.3.6:


   - https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998217
   
And here is my test file`:


   - https://github.com/Ismael-VC/AHN.jl/blob/master/test/atomic_tests.jl#L5


I have narrowed down to this:

julia versioninfo()
Julia Version 0.4.0-dev+3353
Commit 0179028* (2015-02-14 17:08 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i3 CPU   M 350  @ 2.27GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

julia nums_data = [
   (int8(n), Int8),
   (uint8(n), UInt8),
   (int16(n), Int16),
   (uint16(n), UInt16),
   (int32(n), Int32),
   (uint32(n), UInt32),
   (int64(n), Int64),
   (uint64(n), UInt64),
   (int128(n), Int128),
   (uint128(n), UInt128),
   (true, Bool),
   (complex(true, true), Bool),
   (float16(n), Float16),
   (float32(n), Float32),
   (float64(n), Float64),
   (BigInt(n), BigInt),
   (BigFloat(n), BigFloat),
   (n//n, Rational{Int}),
   (n//n + n//big(n)*im, Rational{BigInt}),
   (n+n*im, Int),
   (Inf*im, Float64)
   ]
ERROR: MethodError: `checked_mul` has no method matching 
checked_mul(::Int64, ::
LastMain.LastMain.Base.GMP.BigInt)
Closest candidates are:
  checked_mul(::Int64, ::Int64)
  checked_mul(::LastMain.LastMain.Base.GMP.BigInt, 
::LastMain.LastMain.Base.GMP.
BigInt)

 in + at rational.jl:166
 in + at complex.jl:118


It doesn't mater if I use `Compat` or not.


[julia-users] Re: ERROR: `checked_mul` has no method matching checked_mul(::Int64, ::Base.GMP.BigInt)

2015-02-24 Thread Ismael VC
I will Stefan, thanks!

El martes, 24 de febrero de 2015, 10:58:15 (UTC-6), Ismael VC escribió:

 Hello every one! 

 This only fails in v0.4.0-dev+ this is the log:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998218


 Here it is in v0.3.6:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998217

 And here is my test file`:


- 
https://github.com/Ismael-VC/AHN.jl/blob/master/test/atomic_tests.jl#L5


 I have narrowed down to this:

 julia versioninfo()
 Julia Version 0.4.0-dev+3353
 Commit 0179028* (2015-02-14 17:08 UTC)
 Platform Info:
   System: Windows (x86_64-w64-mingw32)
   CPU: Intel(R) Core(TM) i3 CPU   M 350  @ 2.27GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3

 julia nums_data = [
(int8(n), Int8),
(uint8(n), UInt8),
(int16(n), Int16),
(uint16(n), UInt16),
(int32(n), Int32),
(uint32(n), UInt32),
(int64(n), Int64),
(uint64(n), UInt64),
(int128(n), Int128),
(uint128(n), UInt128),
(true, Bool),
(complex(true, true), Bool),
(float16(n), Float16),
(float32(n), Float32),
(float64(n), Float64),
(BigInt(n), BigInt),
(BigFloat(n), BigFloat),
(n//n, Rational{Int}),
(n//n + n//big(n)*im, Rational{BigInt}),
(n+n*im, Int),
(Inf*im, Float64)
]
 ERROR: MethodError: `checked_mul` has no method matching 
 checked_mul(::Int64, ::
 LastMain.LastMain.Base.GMP.BigInt)
 Closest candidates are:
   checked_mul(::Int64, ::Int64)
   checked_mul(::LastMain.LastMain.Base.GMP.BigInt, 
 ::LastMain.LastMain.Base.GMP.
 BigInt)

  in + at rational.jl:166
  in + at complex.jl:118


 It doesn't mater if I use `Compat` or not.



[julia-users] Re: ERROR: `checked_mul` has no method matching checked_mul(::Int64, ::Base.GMP.BigInt)

2015-02-24 Thread Ismael VC
0.3.6:

julia n//n + n//big(n)*im
1//1 + 1//1*im

0.4.0-dev+:

julia n//n + n//big(n)*im
ERROR: MethodError: `checked_mul` has no method matching 
checked_mul(::Int64, ::
LastMain.LastMain.LastMain.Base.GMP.BigInt)
Closest candidates are:
  checked_mul(::Int64, ::Int64)
  checked_mul(::LastMain.LastMain.LastMain.Base.GMP.BigInt, 
::LastMain.LastMain.
LastMain.Base.GMP.BigInt)

 in + at rational.jl:166
 in + at complex.jl:118



El martes, 24 de febrero de 2015, 10:58:15 (UTC-6), Ismael VC escribió:

 Hello every one! 

 This only fails in v0.4.0-dev+ this is the log:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998218


 Here it is in v0.3.6:


- https://travis-ci.org/Ismael-VC/AHN.jl/jobs/51998217

 And here is my test file`:


- 
https://github.com/Ismael-VC/AHN.jl/blob/master/test/atomic_tests.jl#L5


 I have narrowed down to this:

 julia versioninfo()
 Julia Version 0.4.0-dev+3353
 Commit 0179028* (2015-02-14 17:08 UTC)
 Platform Info:
   System: Windows (x86_64-w64-mingw32)
   CPU: Intel(R) Core(TM) i3 CPU   M 350  @ 2.27GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3

 julia nums_data = [
(int8(n), Int8),
(uint8(n), UInt8),
(int16(n), Int16),
(uint16(n), UInt16),
(int32(n), Int32),
(uint32(n), UInt32),
(int64(n), Int64),
(uint64(n), UInt64),
(int128(n), Int128),
(uint128(n), UInt128),
(true, Bool),
(complex(true, true), Bool),
(float16(n), Float16),
(float32(n), Float32),
(float64(n), Float64),
(BigInt(n), BigInt),
(BigFloat(n), BigFloat),
(n//n, Rational{Int}),
(n//n + n//big(n)*im, Rational{BigInt}),
(n+n*im, Int),
(Inf*im, Float64)
]
 ERROR: MethodError: `checked_mul` has no method matching 
 checked_mul(::Int64, ::
 LastMain.LastMain.Base.GMP.BigInt)
 Closest candidates are:
   checked_mul(::Int64, ::Int64)
   checked_mul(::LastMain.LastMain.Base.GMP.BigInt, 
 ::LastMain.LastMain.Base.GMP.
 BigInt)

  in + at rational.jl:166
  in + at complex.jl:118


 It doesn't mater if I use `Compat` or not.



[julia-users] Unable to set up AppVeyor.

2015-02-23 Thread Ismael VC
This is the log:

[00:00:00] Build started
[00:00:10] git clone -q --branch=master 
git://github.com/Ismael-VC/AHN.jl.git C:\projects\ahn-jl
[00:00:17] git checkout -qf 49367576242db296b6cd360e086b0ca4acc0d492
[00:00:17] Running Install scripts
[00:00:17] if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and 
$env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod ` 
https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
 
| ` Where-Object pullRequestId -eq 
$env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { ` throw There are 
newer queued builds for this pull request, failing early. }
[00:00:17] (new-object 
net.webclient).DownloadFile($(http://status.julialang.org/download/+$env:JULIAVERSION),
 
C:\projects\julia-binary.exe)
[00:00:19] C:\projects\julia-binary.exe /S /D=C:\projects\julia
[00:00:19] This version of C:\projects\julia-binary.exe is not compatible 
with the version of Windows you're running. Check your computer's system 
information and then contact the software publisher.
[00:00:19] Command exited with code 1



   - https://ci.appveyor.com/project/Ismael-VC/ahn-jl/build/1.0.9/messages
   

This is my `appveyor.yml`:

environment:
  matrix:
  - JULIAVERSION: stable/win32
  
skip_commits:
# Add [av skip] to commit messages for docfixes, etc to reduce load on queue
  message: /\[av skip\]/

install:
# if there's a newer build queued for the same PR, cancel this one
  - ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER 
-ne ((Invoke-RestMethod `

https://ci.appveyor.com/api/projects/mlubin/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds
 | `
Where-Object pullRequestId -eq 
$env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw There are newer queued builds for this pull request, failing 
early. }
# Download most recent Julia Windows binary
  - ps: (new-object 
net.webclient).DownloadFile($(http://status.julialang.org/download/+$env:JULIAVERSION),
 C:\projects\julia-binary.exe)
# Run installer silently, output to C:\projects\julia
  - C:\projects\julia-binary.exe /S /D=C:\projects\julia

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
  - IF EXIST .git\shallow (git fetch --unshallow)
  - C:\projects\julia\bin\julia-debug -e versioninfo(); Pkg.init(); 
Pkg.clone(pwd(), \AHN\)

test_script:
  - C:\projects\julia\bin\julia-debug -e Pkg.test(\AHN\)



   - https://github.com/Ismael-VC/AHN.jl/blob/master/appveyor.yml
   



[julia-users] [ERROR: syntax: invalid assignment location] When trying to overload the `Base.==` method.

2015-02-19 Thread Ismael VC
Is this a parsing bug? I wanted to use `Base.==` to make it more explicit, 
as I've seen it's good style. This happens in both v0.3.5 and v0.4-dev

julia type Foo end

julia import Base.==

julia Base.==(x::Foo, y::Foo) = true
ERROR: syntax: invalid assignment location

julia Base.(==)(x::Foo, y::Foo) = true
ERROR: syntax: invalid method name Base.(==)

julia ==(x::Foo, y::Foo) = true
== (generic function with 80 methods)




[julia-users] Re: [ERROR: syntax: invalid assignment location] When trying to overload the `Base.==` method.

2015-02-19 Thread Ismael VC
Thank you Sean.

El jueves, 19 de febrero de 2015, 9:36:58 (UTC-6), Ismael VC escribió:

 Is this a parsing bug? I wanted to use `Base.==` to make it more explicit, 
 as I've seen it's good style. This happens in both v0.3.5 and v0.4-dev

 julia type Foo end

 julia import Base.==

 julia Base.==(x::Foo, y::Foo) = true
 ERROR: syntax: invalid assignment location

 julia Base.(==)(x::Foo, y::Foo) = true
 ERROR: syntax: invalid method name Base.(==)

 julia ==(x::Foo, y::Foo) = true
 == (generic function with 80 methods)




  1   2   3   >