[julia-users] Re: Capturing Error messages as strings

2016-04-03 Thread Matthew Pearce
Anyone? At the moment it is very hard to debug parallel work. With issues like #14456 and related problems, it would be extraordinarily helpful to have access to the full error messages from remotes. I care enough about this to actually try wri

Re: [julia-users] Re: dispatch on type of tuple from ...

2016-04-03 Thread 'Greg Plowman' via julia-users
I saw your repost on julia-dev, but replying here. m2 won't work because it expects a series of tuple arguments (which if supplied would slurp up into a tuple of tuples). m3 seems the way to go. I wouldn't necessarily look at it as indirect however. Think of it as one function with 2 methods:

[julia-users] Re: Julia console with inline graphics?

2016-04-03 Thread Lanfeng Pan
There is qtconsole to display inline images. On Saturday, April 2, 2016 at 5:45:22 AM UTC-5, Oliver Schulz wrote: > > Hi, > > I'm looking for a Julia console with inline graphics (e.g. to display > Gadfly plots). There's Jupyter/IJulia, of course, but I saw a picture of > something more conso

Re: [julia-users] dispatch slowdown when iterating over array with abstract values

2016-04-03 Thread 'Greg Plowman' via julia-users
Thanks for your replies. I'm sorry to trouble you again, but I'm still confused about general concepts. It seems to me that slowness of dynamic dispatch and type instability are orthogonal. I mean is dynamic dispatch inherently slow, or is it slow because it involves type instability? @code_w

[julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Cristóvão Duarte Sousa
> Decisions that in my opinion were made by people who do not write research-code: > 1. Indexing in Julia. being 1 based and inclusive, instead of 0 based and not including the end (like in c/python/lots of other stuff) > 2. No simple integer-division operator. I do not understand why this is re

Re: [julia-users] List comprehension for 1 <= i < j <= 4

2016-04-03 Thread Erik Schnetter
Nothing has been set in stone, but one proposed syntax is ```Julia l = collect((i, j) for j in range(i+1, 5) for i in range(1, 5)) ``` i.e. using parentheses instead of brackets, exchanging the order of `i` and `j`, and using an explicit call to `collect` to convert the generator into an array. W

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Chris Rackauckas
I came to this thinking it would be about how Julia pedagogy is a little more difficult than other scripting languages because there are a lot of details in the advanced features which are normally the points of conversation for more experienced users. That's a legitimate concern. However, this

Re: [julia-users] Re: Large number of methods for a function and Julia for data acquisition

2016-04-03 Thread Oliver Schulz
So, since we got you on this thread, Stefan - what's your take on the original question? :-) I mean, is it Ok to have (potentially) thousands of methods for getindex and setindex, or will this have serious consequences for compile time and/or dynamic dispatch situations? On Sunday, April 3, 20

Re: [julia-users] List comprehension for 1 <= i < j <= 4

2016-04-03 Thread Jonatan Pallesen
Performance is not the main factor. More importantly I don't think the vcat solution looks very neat. I'm curious about what the proposed generator syntax is.

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Oliver Schulz
IMHO having the "/" operator return a float was an excellent design decision in Julia. The amount of time I've seen people waste (with other languages) tracking down bugs caused by doing a/b with a > I question the alleged ubiquity of integer division. This is not an > operation I find myself ne

Re: [julia-users] Re: Large number of methods for a function and Julia for data acquisition

2016-04-03 Thread Stefan Karpinski
No worries. I just wanted to provide a link for context. On Sun, Apr 3, 2016 at 12:49 PM, Oliver Schulz wrote: > Oh, darn - sorry, Stefan. I wanted to change the topic since the > discussion had moved quite a bit from the original question, but I didn't > consider email clients. > > On Sunday, A

Re: [julia-users] Re: Large number of methods for a function and Julia for data acquisition

2016-04-03 Thread Oliver Schulz
Oh, darn - sorry, Stefan. I wanted to change the topic since the discussion had moved quite a bit from the original question, but I didn't consider email clients. On Sunday, April 3, 2016 at 2:06:06 PM UTC+2, Stefan Karpinski wrote: > > I'm afraid that changing the subject here removes all conte

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Stefan Karpinski
I question the alleged ubiquity of integer division. This is not an operation I find myself needing all that often. Of course, everyone's programming needs are different, but I just don't find myself wanting the integer quotient of a and b more often than I want to do a/b and get their ratio as a f

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Tim Holy
Indexing with // is a bit undesirable because 6//3 gets simplified to 2//1 upon construction, and there's no reason to pay the cost of that operation. With \\, would you worry about confusion from the fact that in a \\ b, a is in the denominator? Especially if it gets called the "integer divisio

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Eric Forgy
Just thinking out loud... On Sunday, April 3, 2016 at 11:49:33 PM UTC+8, Scott Jones wrote: > > What do you think about adding \\ as an integer division operator to Julia? > What about just writing some package to allow indexing arrays with rationals if this is so important to some people? If th

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Scott Jones
I didn't say that it was. However, I don't think that there is any evidence for the statement that: "Python community at large consider to be sufficiently much better", given that only around 1/3 of the community even uses Python 3 yet. The big reason (with lots of evidence to support this) was

Re: [julia-users] List comprehension for 1 <= i < j <= 4

2016-04-03 Thread Erik Schnetter
On Sun, Apr 3, 2016 at 4:12 AM, Jonatan Pallesen wrote: > I want to make a list comprehension for 1 <= i < j <= 4. It can be done with > a for loop like this: > > l = [] > for i in 1:4, j in i+1:4 > push!(l, (i,j)) > end > > In python a list comprehension can be made like this > > l = [(i, j)

Re: [julia-users] How to pass ARGS to a script inside julia

2016-04-03 Thread Yichao Yu
On Sun, Apr 3, 2016 at 9:16 AM, Gino Serpa wrote: > Hi, > I know that I can pass arguments to a script using ARGS and then just > running from the console prompt as in > >> julia test01.jl 2048 > > where the argument 2048 is passed to test01.jl. But what if I want to pass > this argument inside

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Stefan Karpinski
On Sun, Apr 3, 2016 at 8:50 AM, Scott Jones wrote: > Yes, Python3 did switch from 1/2 returning a float, but Python3 still is > having major problems with acceptance from the Python community, so I don't > think that's the best example to use. > The change of division is not the reason people ar

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Scott Jones
Yes, Python3 did switch from 1/2 returning a float, but Python3 still is having major problems with acceptance from the Python community, so I don't think that's the best example to use. It is a bit of a mess when you look at a number of languages. Python2 Python3 Lua Julia CC++ CacheObjectScri

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Scott Jones
For some reason, my posts are getting sent prematurely! Continuing: Since the integer division operator // of Python (2&3) and Lua already means something important in Julia, and \ is also taken, I'd like to propose \\ as an integer division operator for Julia. Having to always type \ d i v in

[julia-users] How to pass ARGS to a script inside julia

2016-04-03 Thread Gino Serpa
Hi, I know that I can pass arguments to a script using ARGS and then just running from the console prompt as in > julia test01.jl 2048 where the argument 2048 is passed to test01.jl. But what if I want to pass this argument inside julia to the same script julia > include("test01.jl") , wh

Re: [julia-users] dispatch slowdown when iterating over array with abstract values

2016-04-03 Thread Cedric St-Jean
Good call, it was already pointed ou t in that thread. On Sat, Apr 2, 2016 at 11:11 PM, Yichao Yu wrote: > On Sat, Apr 2, 2016 at 10:53 PM, Cedric St-Jean > wrote: > > That's actually a compiler bug, nice! > > > > abstract Fea

Re: [julia-users] Re: Large number of methods for a function and Julia for data acquisition

2016-04-03 Thread Stefan Karpinski
I'm afraid that changing the subject here removes all context for this message in most email systems. Groups seems to keep the message in context: https://groups.google.com/d/msg/julia-users/Dt6nbfhtaNQ/TCy6zT9HAAAJ On Sun, Apr 3, 2016 at 4:34 AM, Oliver Schulz wrote: > Hi Andrew, > > On Saturd

Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Stefan Karpinski
Python 3 changed the meaning of 1/2 to be 0.5, so arguing from a Pythonic perspective would seem to indicate that Julia has avoided Python's original mistake for / and chosen a behavior that Guido van Rossum and the the Python community at large consider to be sufficiently much better to warrant a

Re: [julia-users] List comprehension for 1 <= i < j <= 4

2016-04-03 Thread Tamas Papp
vcat([[(i,j) for j in (1+i):4] for i in 1:4]...) On Sun, Apr 03 2016, Jonatan Pallesen wrote: > I want to make a list comprehension for 1 <= i < j <= 4. It can be done > with a for loop like this: > > l = [] > for i in 1:4, j in i+1:4 > push!(l, (i,j)) > end > > In python a list comprehensio

[julia-users] List comprehension for 1 <= i < j <= 4

2016-04-03 Thread Jonatan Pallesen
I want to make a list comprehension for 1 <= i < j <= 4. It can be done with a for loop like this: l = [] for i in 1:4, j in i+1:4 push!(l, (i,j)) end In python a list comprehension can be made like this l = [(i, j) for i in range(1, 5) for j in range(i+1, 5)] But this Julia code gives an

Re: [julia-users] how to compute result type of /

2016-04-03 Thread Milan Bouchet-Valat
Le dimanche 03 avril 2016 à 10:34 +0200, Tamas Papp a écrit : > Hi, > > I want to explicitly specify the type of a comprehension (cf #7258). If > I have two values a::T and b::S, how can I compute the type of a/b using > just T and S? > > Currently I am using > > typeof(one(T)/one(S)) > > but s

[julia-users] Re: check exit code from ccall

2016-04-03 Thread Andreas Lobinger
ccall provides as output the return value of a call. If your library calls exit(1) then it interacts with the OS and asks for process termination. On Sunday, April 3, 2016 at 9:52:08 AM UTC+2, Martin Kuzma wrote: > > > > Hi, > is there a way to check exit status code from call to ccall? The c lib

[julia-users] how to compute result type of /

2016-04-03 Thread Tamas Papp
Hi, I want to explicitly specify the type of a comprehension (cf #7258). If I have two values a::T and b::S, how can I compute the type of a/b using just T and S? Currently I am using typeof(one(T)/one(S)) but surely there is something more elegant (also, it would be nice to know in general, no

[julia-users] Re: Large number of methods for a function and Julia for data acquisition

2016-04-03 Thread Oliver Schulz
Hi Andrew, On Saturday, April 2, 2016 at 7:10:00 PM UTC+2, Andrew Keller wrote: > > Regarding your first question posed in this thread, I think you might be > interested in this documentation > of how functions > will work in Julia 0.5 if

[julia-users] check exit code from ccall

2016-04-03 Thread Martin Kuzma
Hi, is there a way to check exit status code from call to ccall? The c library may call exit(1) if there is an error in the input and I want to be able to check if exit code from ccall is 1. Thanks Martin