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

2016-10-07 Thread Fengyang Wang
I would also personally prefer a Discourse-based forum to this Google Groups mailing list. On Saturday, September 19, 2015 at 8:16:36 PM UTC-4, Jonathan Malmaud wrote: > > Hi all, > There's been some chatter about maybe switching to a new, more modern > forum platform for Julia that could potent

[julia-users] Re: Unexpected results with typeof(DataFrame)

2016-10-07 Thread Fengyang Wang
I think you have misunderstood Kristoffer. It's possible the Int values themselves are of distinct types; note for instance julia> Array{Int, Int32(1)} Array{Int64,1} julia> Array{Int, 1} Array{Int64,1} julia> Array{Int, Int32(1)} == Array{Int, 1} false On Thursday, October 6, 2016 at 10:52

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Fengyang Wang
The ^ operator can be used for implication. Due to Curry-Howard, implication is isomorphic to function abstraction, which combinatorially can be counted using the exponentiation function. On Thursday, October 6, 2016 at 12:10:51 PM UTC-4, Kevin Liu wrote: > > How is an implication represented in

[julia-users] Re: Any examples of using Julia with online judge systems

2016-10-07 Thread Fengyang Wang
HackerRank supports Julia in its Algorithms domain and related contests. I sent a support request to extend this to the Mathematics domain. On Monday, June 27, 2016 at 10:39:52 PM UTC-4, Андрей Логунов wrote: > > Are there any projects/initiatives to apply Julia with online judge > systems (http

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Jussi Piitulainen
Indeed. implies(p::Bool, q::Bool) = q^p perjantai 7. lokakuuta 2016 10.25.06 UTC+3 Fengyang Wang kirjoitti: > > The ^ operator can be used for implication. Due to Curry-Howard, > implication is isomorphic to function abstraction, which combinatorially > can be counted using the exponentiatio

[julia-users] Re: StaticArrays vs FixedSizeArrays

2016-10-07 Thread Kristoffer Carlsson
See https://github.com/SimonDanisch/FixedSizeArrays.jl/issues/159 On Friday, October 7, 2016 at 8:10:56 AM UTC+2, Petr Hlavenka wrote: > > Hi, > With Julia 0.5 I'm little bit confused what is the best approach for high > speed array access. I'm writing a simulation where particles move in the >

Re: [julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-10-07 Thread Mosè Giordano
Hi Ismael, I can confirm the problems in http://julialang.org/downloads/platform.html are now fixed and I added the missing string. Thank you! However I just noticed that the description of Gadfly in http://julialang.org/downloads/plotting.html is back in English (this happens for both Italian a

[julia-users] Re: I have two data collection for mapreduce() vs. generator, which is correct/better implementation? (Julia 0.5)

2016-10-07 Thread Martin Florek
Thanks Andrew for answer. I also have experience that eachindex() is slightly faster. In Performance tips I found macros e.g. @simd. Do you have any experience with them? On Thursday, 6 October 2016 16:13:22 UTC+2, Martin Florek wrote: > > > Hi All, > > I'm new in Julia and I need to decide abou

[julia-users] multiple dispatch for operators

2016-10-07 Thread Sisyphuss
In Julia, we can do multiple dispatch for operators, that is the interpreter can identify: float + integer integer + integer integer + float float + float as well as *user-defined* data structure. Recently, I am working on Python (I have no choice because Spark hasn't yet a Julia binding). I int

[julia-users] Re: StaticArrays vs FixedSizeArrays

2016-10-07 Thread Simon Danisch
You might enjoy: GeometryTypes.jl Especially the Face type should be convenient: https://github.com/JuliaGeometry/GeometryTypes.jl/blob/master/src/faces.jl Its currently based on FixedSizeArrays, but I want to port it to StaticArrays whenever

[julia-users] travis with dependency on scipy?

2016-10-07 Thread David van Leeuwen
Hello, For a tiny package that depends on PyCall and python's scipy.spatial I am trying to engineer a `.travis.yml`, but I get an error in travis that `spatial.ConvexHull` is not known. This i

[julia-users] How to print an array with the correct shape in 0.5

2016-10-07 Thread spaceLem
In Julia 0.4.6 I could print or @show a 2d array, and it would give me a nicely formatted 2d array println(reshape(1:4,2,2)) [1 3 2 4] However in Julia 0.5 I instead get: println(reshape(1:4,2,2)) [1 3; 2 4] Is it still possible to print 2d arrays without flattening them? And if so, how? Rega

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Kevin Liu
Jeffrey, can you show the expression you put inside @code_llvm() and @code_native() for evaluation? On Friday, October 7, 2016 at 2:26:56 AM UTC-3, Jeffrey Sarnoff wrote: > > Hi Jussi, > > Your version compiles down more neatly than the ifelse version. On my > system, BenchmarkTools gives nearl

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Kevin Liu
Sorry, no need, I got this *julia> **@code_llvm(a<=b)* define i1 @"julia_<=_21637"(i1, i1) { top: %2 = xor i1 %0, true %3 = or i1 %1, %2 ret i1 %3 } *julia> **@code_llvm(ifelse(a,b,true))* define i1 @julia_ifelse_21636(i1, i1, i1) { top: %3 = select i1 %0, i1 %1, i1 %2 ret

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Kevin Liu
*julia> **@code_llvm(b^a)* define i1 @"julia_^_21646"(i1, i1) { top: %2 = xor i1 %1, true %3 = or i1 %0, %2 ret i1 %3 } On Friday, October 7, 2016 at 10:56:26 AM UTC-3, Kevin Liu wrote: > > Sorry, no need, I got this > > *julia> **@code_llvm(a<=b)* > > > define i1 @"julia_<=_21637"

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Kevin Liu
*julia> **@code_native(b^a)* .section__TEXT,__text,regular,pure_instructions Filename: bool.jl Source line: 39 pushq %rbp movq%rsp, %rbp Source line: 39 xorb$1, %sil orb %dil, %sil movb%sil, %al popq%rbp

[julia-users] Getting variable names of function though the AST?

2016-10-07 Thread Jon Norberg
Hi, I asked in a thread some year ago how to get the parameters and variables used in a function. I got some amazing help from the always very helpful community (Thanks Mauro and more, https://groups.google.com/forum/m/#!search/Jon$20norberg/julia-users/bV4VZxbzZyk). However, as already hinted

Re: [julia-users] Re: read binary file with endianness

2016-10-07 Thread Michele Zaffalon
Thank you. On Thu, Oct 6, 2016 at 8:42 PM, Steven G. Johnson wrote: > Yes, just read in the first byte, and then read in the rest of the data, > calling ntoh or hton as needed on each datum. >

[julia-users] Julia and the Tower of Babel

2016-10-07 Thread Gabriel Gellner
Something that I have been noticing, as I convert more of my research code over to Julia, is how the super easy to use package manager (which I love), coupled with the talent base of the Julia community seems to have a detrimental effect on the API consistency of the many “micro” packages tha

RE: [julia-users] Julia and the Tower of Babel

2016-10-07 Thread David Anthoff
I don’t have a solution, but I completely agree with the problem description. I guess one small step would be that package authors should follow the patterns in base, if there are any. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Gabriel Gellner S

Re: [julia-users] Calling DLL function

2016-10-07 Thread Jérémy Béjanin
The format is fairly complicated, but I need to take 4 bytes from that buffer and extract two 12-bit numbers from that 32-bit string (along with some reversing operations, as you can see in the function). I cannot seem to find bit operations that address/concatenate individual bits without goin

Re: [julia-users] Julia and the Tower of Babel

2016-10-07 Thread Tom Breloff
This is something that I've spent a lot of time and energy thinking and discussing, as part of both Plots and JuliaML. I think the situation can be improved in a big way, but this is not something with a "magic solution". It takes time, effort, and a constant desire to collaborate and design with

Re: [julia-users] Calling DLL function

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 12:10 PM, Jérémy Béjanin wrote: > The format is fairly complicated, but I need to take 4 bytes from that > buffer and extract two 12-bit numbers from that 32-bit string (along with > some reversing operations, as you can see in the function). I cannot seem to > find bit oper

[julia-users] Re: Julia and the Tower of Babel

2016-10-07 Thread Andreas Lobinger
Hello colleague, On Friday, October 7, 2016 at 5:35:46 PM UTC+2, Gabriel Gellner wrote: > > Something that I have been noticing, as I convert more of my research code > over to Julia, is how the super easy to use package manager (which I love), > coupled with the talent base of the Julia communi

[julia-users] Re: Julia and the Tower of Babel

2016-10-07 Thread John Myles White
I don't really see how you can solve this without a single dictator who controls the package ecosystem. I'm not enough of an expert in Python to say how well things work there, but the R ecosystem is vastly less organized than the Julia ecosystem. Insofar as it's getting better, it's because th

[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Jeffrey Sarnoff
Is there a way around the nonjuliance of Python within Python? Regards, Jeffrey On Friday, October 7, 2016 at 5:51:11 AM UTC-4, Sisyphuss wrote: > > In Julia, we

[julia-users] Re: Julia and the Tower of Babel

2016-10-07 Thread Gabriel Gellner
Yeah the R system is probably the best guide, as it also has a pretty easy to use package manager ... hence so, so many packages ;) I think python works without a single BDF (for science at least) since the core packages are monolithic, so the consistency is immediately apparent, and I find pro

[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Gabriel Gellner
Any reason to not just use a function? (like np.dot etc) My understanding is that in python '*' means elementwise multiplication, so even if you could monkeypatch numpys __mul__ method to do the right thing wouldn't you be changing the semantics? Gabriel On Friday, October 7, 2016 at 3:51:11 A

[julia-users] Indexing an Float64 scalar

2016-10-07 Thread Eduardo Lenz
Hi. What is exactly the point of a construction like " julia> a = 33.33 33.33 julia> a[1] 33.33 " be valid ? I think it should rise an error, but there is a getindex(::Float64, ::Int64) defined in the core language (v0.5).

Re: [julia-users] Indexing an Float64 scalar

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 1:59 PM, Eduardo Lenz wrote: > Hi. > > What is exactly the point of a construction like > > " > julia> a = 33.33 > 33.33 > > julia> a[1] > 33.33 > " > be valid ? I think it should rise an error, but there is a > getindex(::Float64, ::Int64) defined in the core language (v0.5

[julia-users] Re: StaticArrays vs FixedSizeArrays

2016-10-07 Thread Christoph Ortner
I've used FixedSizeArrays in the past but switch to StaticArrays, they seem more convenient in a few of ways, but for 90% of use cases they seem to be comparable. To protect myself against a possible move to yet another package, I added a layer of `typealias`.

[julia-users] How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-07 Thread Eric Davies
I'm trying to write a bunch of data to a process, then read out the result. Replaced the process here with `cat -` because that's close enough. function bloop(size) data = "f" ^ size print("start") (pout, pin, p) = readandwrite(`cat -`) print("write") write(pin, dat

Re: [julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Stefan Karpinski
I think you're asking on the wrong list :P On Fri, Oct 7, 2016 at 1:56 PM, Gabriel Gellner wrote: > Any reason to not just use a function? (like np.dot etc) > > My understanding is that in python '*' means elementwise multiplication, > so even if you could monkeypatch numpys __mul__ method to do

[julia-users] Threads.@threads and throw ErrorException interaction

2016-10-07 Thread Diego Javier Zea
Hi, I was starting to play with* Threads.@threads *and I noticed a strange behaviour when the macro is used together with *throw* and *ErrorException*: | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org/ release |__/

[julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
Calling objects of type T is only valid if N arguments are provided. What is the correct syntax for this? immutable T{N} t :: NTuple{N,Any} end (x::T)(args...) = error("wrong number of arguments") function {N}(x::T{N})(args::Varargs{Any,N}) print("do stuff here") end syntax: invalid functi

Re: [julia-users] Threads.@threads and throw ErrorException interaction

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:02 PM, Diego Javier Zea wrote: > Hi, > I was starting to play with Threads.@threads and I noticed a strange > behaviour when the macro is used together with throw and ErrorException: > > | | |_| | | | (_| | | Version 0.5.0 (2016-09-19 18:14 UTC) > _/ |\__'_|_|_|\__'_|

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:05 PM, Chris Stook wrote: > Calling objects of type T is only valid if N arguments are provided. What > is the correct syntax for this? > > immutable T{N} > t :: NTuple{N,Any} > end > > (x::T)(args...) = error("wrong number of arguments") function (x::T{N}){N}(args::Va

[julia-users] Re: travis with dependency on scipy?

2016-10-07 Thread Steven G. Johnson
On Friday, October 7, 2016 at 9:10:44 AM UTC-4, David van Leeuwen wrote: > > Hello, > > For a tiny package that depends > on PyCall and python's scipy.spatial I am trying to engineer a > `.travis.yml`, > You can always do ENV["PYTHON"]="" to force PyCa

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
That makes sense. I should have seen that. Thank you!

[julia-users] Trick to use plotlyjs in Atom

2016-10-07 Thread romain dupont
Hi, I woul dlike to share the following trick to use plotlyjs in Atom: using Plots plotlyjs() plot(rand(10)) gui() Cheers

Re: [julia-users] Threads.@threads and throw ErrorException interaction

2016-10-07 Thread Diego Javier Zea
Thanks Yichao, I found the related issue: https://github.com/JuliaLang/julia/issues/17532 Also I found useful your comment about task and IO in this issue: https://github.com/JuliaLang/julia/issues/14494 Thanks!

Re: [julia-users] How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-07 Thread Keno Fischer
Hi Eric, the problem here is that the kernel is blocking the process because there's nobody reading on the other side (since the writing process is blocked so it can't do any reading). We can probably do some things to improve the situation, but for now I'd recommend the following: - Start reading

Re: [julia-users] How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-07 Thread Eric Davies
Thanks, I will try both of those. I had tried making smaller pieces before but I'll try with `Base.process_events(false)`.

[julia-users] Re: Representation of a material conditional (implication)

2016-10-07 Thread Fengyang Wang
As Jussi Piitulainen noted, the ^ operator is backwards, so you need to wrap it around a function. On Friday, October 7, 2016 at 10:05:34 AM UTC-4, Kevin Liu wrote: > > *julia> **@code_native(b^a)* > >.section__TEXT,__text,regular,pure_instructions > > Filename: bool.jl > > Source

Re: [julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
No, no, no, I am expert of neither language. I sincerely want to learn the difference between these 2 languages. This will help me better understand both Python and Julia. On Friday, October 7, 2016 at 9:41:43 PM UTC+2, Stefan Karpinski wrote: > > I think you're asking on the wrong list :P > >

[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
You mean: def mydot(A,B): if isinstance(A, np.ndarray) and isinstance(B, np.ndarray): return np.dot(A, B) else: # mycode ? Maybe you are right. Since I can't overload `np.dot`, maybe the neater way is to write a higher level function and then delegate the work by inspectin

[julia-users] Re: multiple dispatch for operators

2016-10-07 Thread Sisyphuss
The multiplication maybe is not the best example. Actually, I wanted to say "addition". I wanted that my operator `+` works for: 1) np.ndarray + np.ndarray 2) np.ndarray + LRmatrix 3) LRmatrix + np.ndarray 4) LRmatrix + LRmatrix 1) is a part of Numpy. 3) and 4) can be implemented by `LRmatrix.__