[julia-users] Re: pyplot how to change bground color ?

2016-06-25 Thread Henri Girard


matplotlib commands
But it 's not very convivial, is there something
like bgroundcolor=("black"),often I don't use ax.

rect.set_facecolor('red')


ax.patch.set_facecolor('black')

axisbg='#ababab'


Le vendredi 24 juin 2016 12:56:42 UTC+2, Henri Girard a écrit :
>
> Hi,
> I didn't find anything to modify background in pyplot, it's so easy in 
> plots but that doesn't work for pyplot, even maplotlib command ?
> Any help ?
> HG
>


[julia-users] Re: Tutorial Julia language brazilian portuguese

2016-06-25 Thread felipenoris
Great material!

Em sexta-feira, 24 de junho de 2016 19:57:25 UTC-4, jmarcell...@ufpi.edu.br 
escreveu:
>
> Hello everyone
>
> I am writing a tutorial Julia language Portuguese (over 200 pages):
>
> https://github.com/jmarcellopereira/juliatutorialbr
>


Re: [julia-users] Tutorial Julia language brazilian portuguese

2016-06-25 Thread Filipe Braida do Carmo
Muito bom!

Parabéns!

On Fri, Jun 24, 2016 at 8:57 PM,  wrote:

> Hello everyone
>
> I am writing a tutorial Julia language Portuguese (over 200 pages):
>
> https://github.com/jmarcellopereira/juliatutorialbr
>



-- 
--
Filipe Braida do Carmo
-
BSc em Ciência da Computação - Universidade Federal do Rio de Janeiro - UFRJ
Mestre em Engenharia de Sistemas e Computação - PESC/COPPE/UFRJ
Doutorando em Engenharia de Sistemas e Computação - PESC/COPPE/UFRJ


Re: [julia-users] Tutorial Julia language brazilian portuguese

2016-06-25 Thread Abel Siqueira
Thanks João, will keep an eye on it.

Abel Soares Siqueira

2016-06-24 20:57 GMT-03:00 :

> Hello everyone
>
> I am writing a tutorial Julia language Portuguese (over 200 pages):
>
> https://github.com/jmarcellopereira/juliatutorialbr
>


[julia-users] customized `userimg_path` for `build_sysimg`

2016-06-25 Thread Xiaoqing Rong-Mullins
Julia 0.4.6

I wanted to build a custom system image by running 
`build_sysimg(sysimg_path, "native", userimg_path)`, with `userimg_path` 
pointing to a file with contents like "using some_packages". The resulting 
system image doesn't seem to load my "some_packages". As I read the code 
"build_sysimg.jl", it seemed to me that `userimg_path` was not used for 
building process.

Is the option `userimg_path` a work in process and not fully functional 
yet? If yes, when would it be fully functional?

I apologize in advance if I misunderstood the situation. Thanks.


[julia-users] Re: Segfaults in SharedArrays

2016-06-25 Thread Andrew
I didn't see the SharedArray fix on the 0.4.6 commit log.

On Saturday, June 25, 2016 at 2:01:31 PM UTC-4, Nils Gudat wrote:
>
> No luck unfortunately on 0.4.6 either, so it seems the SharedArray fix 
> (assuming it made it into 0.4.6) didn't help.
> Any other ideas? How does one figure out the source of a segfault?
>


[julia-users] Re: polynomial terms in formula specification

2016-06-25 Thread Patrick Kofod Mogensen
I think Michael might be aware of this, but was hoping that the formula 
interface was as flexible as in R, which it is not. I believe there used to 
be support for more transformations in ~, but it was removed.

On Saturday, June 25, 2016 at 1:12:27 PM UTC+2, Douglas Bates wrote:
>
> On Friday, June 24, 2016 at 8:39:09 AM UTC-4, Michael Borregaard wrote:
>>
>> Sorry for asking a question that should be super-basic, but I have looked 
>> all over the internet for this for an hour now: How does one specify 
>> polynomial terms in glm models?
>>
>> In R, I would:
>>
>> y ~ x + I(x^2)
>>
>> Thanks!
>>
>
> If you are using a DataFrame for the data source, just add a column 
>
> df[:x2] = abs2(df[:x])
>
> and change the formula to
>
> y ~ 1 + x + x2
>
> BTW, it is good practice to include the " 1 + ".  We are still considering 
> changing the formula interface to require the intercept to be explicitly 
> stated.
>  
>


[julia-users] Re: Kernerk dead

2016-06-25 Thread Patrick Kofod Mogensen
We need more information, but Marco might be using nightlies on JuliaBox. I 
get "kernel died" at least, no matter what code I try to run.

On Friday, June 24, 2016 at 7:30:48 PM UTC+2, cdm wrote:
>
>
> what system are you on (Mac, Linux, Win ...)?
>
> have you run Pkg.update() lately ?
>
>
> more info on your setup will almost certainly help ...
>
> good luck !
>
>
>
> On Friday, June 24, 2016 at 7:51:01 AM UTC-7, Marco Forti wrote:
>>
>> Hi all,
>>
>> I am facing a problem: everytime I try to run a code this message use to 
>> appear
>>
>> "The kernel has died, and the automatic restart has failed. It is 
>> possible the kernel cannot be restarted. If you are not able to restart the 
>> kernel, you will still be able to save the notebook, but running code will 
>> no longer work until the notebook is reopened."
>>
>> Any clue about how to solve it?
>>
>> Thanks,
>> Marco
>>
>

[julia-users] readdlm() pound sign at beginning of string is not read

2016-06-25 Thread Anonymous
Let's say I have a file of the form

1#hello
2hello

Where the space between the number and the ascii string is intended to be a 
tab, then I run

my_file = readdlm(file, '\t')

this reads in the first line as "".  Is this the desired functionality?  It 
works fine with other characters like @ or &.


[julia-users] Re: Segfaults in SharedArrays

2016-06-25 Thread Nils Gudat
No luck unfortunately on 0.4.6 either, so it seems the SharedArray fix 
(assuming it made it into 0.4.6) didn't help.
Any other ideas? How does one figure out the source of a segfault?


Re: [julia-users] Parallel computing: SharedArrays not updating on cluster

2016-06-25 Thread Kevin Keys
To clarify: shared memory arrays cannot be used *across multiple nodes* of 
a compute cluster. If you schedule your code to run on only one node of a 
cluster, then your code should work fine. This is what I do on my 
university cluster; see here 

.

If you need more parallel computing power than what is available on one 
cluster node, then, as others have said, you will need to appeal to a 
different array paradigm.

KLK

El dimecres, 22 juny de 2016 12:09:49 UTC-7, Stefan Karpinski va escriure:
>
> That's right – shared memory arrays cannot, by definition, be used on a 
> non-shared memory distributed system like a cluster. You may want 
> DistributedArrays .
>
> On Tue, Jun 21, 2016 at 10:15 PM, 'Greg Plowman' via julia-users <
> julia...@googlegroups.com > wrote:
>
>> Yes.
>> AFAIK,
>> Shared arrays are shared across multiple processes on the same machine.
>> Distributed arrays can be distributed across different machines.
>
>
>

[julia-users] Re: Tensorflow like dataflow graphs for Julia?

2016-06-25 Thread Kevin Keys
Perhaps TensorOperations.jl  
? Also Julia has TensorFlow wrappers 
.
KLK

El divendres, 24 juny de 2016 16:27:31 UTC-7, Gabriel Goh va escriure:
>
> I'm wondering if a library in Julia exists where I can specify dataflow 
> graphs which can be compiled and differenciated, similar to what tensorflow 
> does. Thanks a lot!
>


[julia-users] Re: Drop element from tuple

2016-06-25 Thread Kristoffer Carlsson
You cannot hack around the fact that a tuple is immutable so you need to 
construct a new one from scratch.

On Saturday, June 25, 2016 at 9:45:06 AM UTC-4, jw3126 wrote:
>
> @Sisyphuss: The problem with vectors is that they are always heap 
> allocated. If you do stuff involving lots of small size vectors things 
> become slow. What I need to do is projecting points onto simplexes in 1-4 
> dimensions, so this a task base arrays are bad at. I tried to do it only 
> allocating the arrays once and mutating them. But this makes the code very 
> quickly very ugly... Now I use the FixedSizeArrays 
> package instead, 
> which is based on Tuples.
>
> @Tim: Thanks for the insights! On my machine slowness starts to kick in at 
> size 9 already. I tried to read the llvm code, but did not really 
> understand it. It seems however that the machine will not go through N 
> (out, t) pairs for a tuple of length N?
>
> Also is it possible in Julia, to implement this function in a low level 
> way, like directly shifting bits in the tuple?
>
>
> On Saturday, June 25, 2016 at 12:45:55 PM UTC+2, Sisyphuss wrote:
>>
>> Why not use `vector`?
>>
>> On Friday, June 24, 2016 at 4:16:49 PM UTC+2, jw3126 wrote:
>>>
>>> I have a Tuple and I want to drop its ith element (e.g. construct a new 
>>> tuple with the same elements, except the ith is missing). For example
>>>
>>> (1,2,3,4) , 1 --> (2,3,4)
>>> (1,2,3,4) , 3 --> (1,2,4)
>>> (1,2,3,4) , 4 --> (1,2,3)
>>>
>>> How to do this?
>>>
>>

[julia-users] Re: Drop element from tuple

2016-06-25 Thread jw3126
@Sisyphuss: The problem with vectors is that they are always heap 
allocated. If you do stuff involving lots of small size vectors things 
become slow. What I need to do is projecting points onto simplexes in 1-4 
dimensions, so this a task base arrays are bad at. I tried to do it only 
allocating the arrays once and mutating them. But this makes the code very 
quickly very ugly... Now I use the FixedSizeArrays 
package instead, which 
is based on Tuples.

@Tim: Thanks for the insights! On my machine slowness starts to kick in at 
size 9 already. I tried to read the llvm code, but did not really 
understand it. It seems however that the machine will not go through N 
(out, t) pairs for a tuple of length N?

Also is it possible in Julia, to implement this function in a low level 
way, like directly shifting bits in the tuple?


On Saturday, June 25, 2016 at 12:45:55 PM UTC+2, Sisyphuss wrote:
>
> Why not use `vector`?
>
> On Friday, June 24, 2016 at 4:16:49 PM UTC+2, jw3126 wrote:
>>
>> I have a Tuple and I want to drop its ith element (e.g. construct a new 
>> tuple with the same elements, except the ith is missing). For example
>>
>> (1,2,3,4) , 1 --> (2,3,4)
>> (1,2,3,4) , 3 --> (1,2,4)
>> (1,2,3,4) , 4 --> (1,2,3)
>>
>> How to do this?
>>
>

Re: [julia-users] preANN: ArbFloats. the sequel. (extended precision *values* as floating point numbers)

2016-06-25 Thread Tom Breloff
Thanks Jeffrey.  Starred and followed.  For those following from a
distance, ArbFloats (IMO) are a *much* faster alternative to
"fixed-precision Unums 1.0", and could nicely form the basis of interval
arithmetic with open/closed endpoints, paving/uboxing algorithms, and more.

On Sat, Jun 25, 2016 at 4:29 AM, Jeffrey Sarnoff 
wrote:

> If the first ArbFloats.jl was proof of concept, this one is concept of
> proof.
>
> This is a pre-announcement in response to some requests for access and my
> preference.
>
> These quantities are information-richest floating point representations of
> using arithmetic, elementary and some special functions.
> ArbFloats presents digits that neither lead nor mislead the perception of
> value, showing more or fewer digits would be less informative.
>
> When announced (ANN), I will offer more explanation and examples and any
> overlooked details,
> no worries -- if you do not need this now, wait for me to have fuller
> tests written, etc.
> .
> If you do need it or just want to play with it, please do and share your
> experience with me.
>
> https://github.com/jsarnoff-juliacon/ArbFloats.jl
>
>


[julia-users] Plots with Plots

2016-06-25 Thread daycaster
Plots.jl looks amazing! 

A couple of questions: 
Is there any way to control the fonts used in a plot? I can't see any obvious 
way to specify fonts outside the usual range of "Helvetica"/"Courier".

Also, I can't get any results from searching the docs. Is search currently 
broken or are there ways to specify words that I don't know?

[julia-users] Re: polynomial terms in formula specification

2016-06-25 Thread Douglas Bates
On Friday, June 24, 2016 at 8:39:09 AM UTC-4, Michael Borregaard wrote:
>
> Sorry for asking a question that should be super-basic, but I have looked 
> all over the internet for this for an hour now: How does one specify 
> polynomial terms in glm models?
>
> In R, I would:
>
> y ~ x + I(x^2)
>
> Thanks!
>

If you are using a DataFrame for the data source, just add a column 

df[:x2] = abs2(df[:x])

and change the formula to

y ~ 1 + x + x2

BTW, it is good practice to include the " 1 + ".  We are still considering 
changing the formula interface to require the intercept to be explicitly 
stated.
 


[julia-users] Re: Drop element from tuple

2016-06-25 Thread Sisyphuss
Why not use `vector`?

On Friday, June 24, 2016 at 4:16:49 PM UTC+2, jw3126 wrote:
>
> I have a Tuple and I want to drop its ith element (e.g. construct a new 
> tuple with the same elements, except the ith is missing). For example
>
> (1,2,3,4) , 1 --> (2,3,4)
> (1,2,3,4) , 3 --> (1,2,4)
> (1,2,3,4) , 4 --> (1,2,3)
>
> How to do this?
>


Re: [julia-users] Re: Drop element from tuple

2016-06-25 Thread Tim Holy
It might scale just fine, because LLVM might discover the pattern of your 
"giant switch statement" and essentially compute a jump location. Even if not, 
if you're calling this repeatedly with a tuple of consistent length, the 
branches become predictable and then they kind of don't count. So in most 
cases I doubt it's possible to beat the performance of the solution you 
posted.

For small tuples, you can essentially match the performance of your generated 
function using "lispy" recursion. This is more friendly for the compiler, 
which you may or may not care about. (It's something we care about in Base, 
but there's no reason you necessarily have to worry about it in your own 
code.)

First, a couple of convenience functions:

@inline push(t::Tuple, item) = (t..., item)
@inline unshift(t::Tuple, item) = (item, t...)
# we'll also need something like shift!, but that's already present
# and called Base.tail

Now let's implement your function:

drop_ith(t, i) = 1 <= i <= length(t) ?
_drop_ith((), t, i) :
throw(ArgumentError("need 1 <= $i <= $(length(t))"))
@inline function _drop_ith(out, t, i)
h, t1 = t[1], Base.tail(t)
_drop_ith(length(out)+1 == i ? unshift(out, h) : push(out, h), t1, i)
end
_drop_ith(out, ::Tuple{}, i) = Base.tail(out)

This uses the sneaky trick of preserving type-stability by putting the element 
you want to drop into the first position, thus ensuring that the tuple always 
grows by 1 on each level of recursion. (For tuples, the length is part of the 
type, so making the length predictable is critical for type-stability.) At the 
end, you strip off the first element.

This works well up to tuples of size 14; any bigger, and a variable called 
MAX_TUPLETYPE_LEN ends up kicking in and hurting performance. However, it has 
the advantage of not needing Val tricks or @generated functions. In cases 
where there's less run-time checking, this approach can usually match 
@generated solutions, so the general technique is worth knowing.

Best,
--Tim

On Friday, June 24, 2016 9:12:53 AM CDT jw3126 wrote:
> The following is faster, though it does not scale very well for large
> indices because of ridiculous if chains...
> 
> ```
> @generated function droptup{N,T,i}(x::NTuple{N,T}, ::Type{Val{i}})
> @assert 1 <= i <= N
> args = [:(x[$j]) for j in deleteat!([1:N...], i)]
> Expr(:tuple, args...)
> end
> 
> @generated function droptup{N,T}(x::NTuple{N,T}, i::Int)
> quote
> @nif $N d->(i==d) d-> droptup(x, Val{d})
> end
> end
> 
> using BenchmarkTools
> x = (10,20,30,40)
> 
> @benchmark droptup($x, 4)
> ```
> 
> BenchmarkTools.Trial:
>   samples:  1
>   evals/sample: 1000
>   time tolerance:   5.00%
>   memory tolerance: 1.00%
>   memory estimate:  0.00 bytes
>   allocs estimate:  0
>   minimum time: 6.00 ns (0.00% GC)
>   median time:  6.00 ns (0.00% GC)
>   mean time:6.11 ns (0.00% GC)
>   maximum time: 70.00 ns (0.00% GC)
> 
> On Friday, June 24, 2016 at 4:50:59 PM UTC+2, jw3126 wrote:
> > Okay thanks, it works! However it has extremely poor performance. I would
> > love to do this stack allocated.
> > 
> > ```
> > using BenchmarkTools
> > function subtuple(t::Tuple,i::Integer)
> > 
> > idx = 1:length(t)
> > idx = setdiff(idx,i)
> > t[idx]
> > 
> > end
> > 
> > @benchmark subtuple($(1,2,3,4), $1)
> > ```
> > 
> > BenchmarkTools.Trial:
> >   samples:  1
> >   evals/sample: 10
> >   time tolerance:   5.00%
> >   memory tolerance: 1.00%
> >   memory estimate:  1.33 kb
> >   allocs estimate:  22
> >   minimum time: 1.52 μs (0.00% GC)
> >   median time:  1.69 μs (0.00% GC)
> >   mean time:1.96 μs (9.07% GC)
> >   maximum time: 323.58 μs (98.21% GC)
> > 
> > On Friday, June 24, 2016 at 4:42:17 PM UTC+2, STAR0SS wrote:
> >> You can do something like that:
> >> 
> >> t = tuple(1,2,3,4)
> >> 
> >> function subtuple(t::Tuple,i::Integer)
> >> 
> >> idx = 1:length(t)
> >> idx = setdiff(idx,i)
> >> t[idx]
> >> 
> >> end
> >> 
> >> subtuple(t,3)
> >> 
> >> (1,2,4)




[julia-users] preANN: ArbFloats. the sequel. (extended precision *values* as floating point numbers)

2016-06-25 Thread Jeffrey Sarnoff
If the first ArbFloats.jl was proof of concept, this one is concept of 
proof.

This is a pre-announcement in response to some requests for access and my 
preference.

These quantities are information-richest floating point representations of 
using arithmetic, elementary and some special functions.
ArbFloats presents digits that neither lead nor mislead the perception of 
value, showing more or fewer digits would be less informative.

When announced (ANN), I will offer more explanation and examples and any 
overlooked details, 
no worries -- if you do not need this now, wait for me to have fuller tests 
written, etc.
.
If you do need it or just want to play with it, please do and share your 
experience with me.

https://github.com/jsarnoff-juliacon/ArbFloats.jl



[julia-users] Re: JuliaCon schedule announced

2016-06-25 Thread David P. Sanders


El viernes, 24 de junio de 2016, 13:44:32 (UTC-4), Alex Coventry escribió:
>
> I would like to attend the hackathon tomorrow (Sat Jun 25.)  I'd be 
> grateful for a pointer to where / when it's going to be.
>

It will be at the Stata Center at MIT -- see http://juliacon.org/#location

starting at 8:45am, I believe.



 

>
> Best,
> Alex
>
> On Thursday, June 9, 2016 at 5:34:18 PM UTC-4, Viral Shah wrote:
>>
>> The JuliaCon talks and workshop schedule has now been announced.
>>
>> http://juliacon.org/schedule.html
>>
>> Please buy your tickets if you have been procrastinating. We have seen 
>> tickets going much faster this year, and waiting until the day before is 
>> unlikely to work this year. Please also spread the message to your friends 
>> and colleagues and relevant mailing lists. Here's the conference poster for 
>> emailing and printing:
>>
>> http://juliacon.org/pdf/juliacon2016poster3.pdf
>>
>> -viral
>>
>