Re: [julia-users] Re: Dict get destroys global variable?

2016-09-22 Thread K leo
Thank you Isaiah for pointing that out! On Friday, September 23, 2016 at 12:06:17 PM UTC+8, Isaiah wrote: > > Use `global a = ...` > Please see: > http://docs.julialang.org/en/latest/manual/variables-and-scoping/#hard-local-scope > > global variables are only inherited for reading but not for

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Tsur Herman
I can a see a point in what you say .. eltype of a function should be the return type of that function if it can be inferred. Because an array is just a special kind of function with a special notation. On Friday, 23 September 2016, Steven G. Johnson wrote: > > > On

Re: [julia-users] Re: Dict get destroys global variable?

2016-09-22 Thread Isaiah Norton
Use `global a = ...` Please see: http://docs.julialang.org/en/latest/manual/variables-and-scoping/#hard-local-scope global variables are only inherited for reading but not for writing On Fri, Sep 23, 2016 at 12:00 AM, K leo wrote: > Sorry, this is not related to Dict at

[julia-users] Re: Dict get destroys global variable?

2016-09-22 Thread K leo
Sorry, this is not related to Dict at all. If I replace the "a=get..." statement with simply "a=2", the global variable is no longer accessible. What is wrong? On Friday, September 23, 2016 at 11:52:24 AM UTC+8, K leo wrote: > > Calling "get" anywhere in a function makes a global variable

[julia-users] Dict get destroys global variable?

2016-09-22 Thread K leo
Calling "get" anywhere in a function makes a global variable undefined. Can anyone please help explaining the following? 1) without calling "get", the global variable is fine: a=0 > > Dicta = Dict{Int,Int}() > > function testGlobal() > > println(a) > > merge!(Dicta, Dict(1=>1)) > > #

[julia-users] How does promote_op work?

2016-09-22 Thread Sheehan Olver
The subject says it all: it looks like one can override promote_op to support the following behaviour: *julia> **import Base.+* *julia> **immutable Foo end* WARNING: Method definition (::Type{Main.Foo})() in module Main at REPL[5]:1 overwritten at REPL[10]:1. *julia> **+(a::Foo,b::Foo) =

Re: [julia-users] how to get rid of axis in Plots ?

2016-09-22 Thread Roger Herikstad
Just filed an issue #500 . Thanks for looking into this! On Thursday, September 22, 2016 at 6:34:49 PM UTC+8, Tom Breloff wrote: > > This isn't configurable right now, but I've wanted the same thing. Can you > open an issue and I'll add when I

[julia-users] Re: Broadcast slices

2016-09-22 Thread Steven G. Johnson
At some point, it is simpler to just write loops than to try and express a complicated operation in terms of higher-order functions like broadcast.

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Steven G. Johnson
On Thursday, September 22, 2016 at 6:10:29 PM UTC-4, Tsur Herman wrote: > > The real problem is that eltype(t^2 for t in rand(10)) returns Any. > > > that is not a problem (t^2 for t in rand(10)) is a generator its element > type is Any which means a pointer to something complex. > >> It is a

Re: [julia-users] Is FMA/Muladd Working Here?

2016-09-22 Thread Chris Rackauckas
So, in the end, is `@fastmath` supposed to be adding FMA? Should I open an issue? On Wednesday, September 21, 2016 at 7:11:14 PM UTC-7, Yichao Yu wrote: > > On Wed, Sep 21, 2016 at 9:49 PM, Erik Schnetter > wrote: > > I confirm that I can't get Julia to synthesize a

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Tsur Herman
The real problem is that eltype(t^2 for t in rand(10)) returns Any. that is not a problem (t^2 for t in rand(10)) is a generator its element type is Any which means a pointer to something complex. On Friday, September 23, 2016 at 12:50:18 AM UTC+3, Steven G. Johnson wrote: > > I don't think

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Tsur Herman
By the way my test3 functions is super fast @time test3(r) 0.32 seconds (4 allocations: 160 bytes) On Friday, September 23, 2016 at 12:48:50 AM UTC+3, Tsur Herman wrote: > > > On my side both function perform equally. although test2 had to be timed > twice to get to the same

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Steven G. Johnson
I don't think the empty case should be the problem. If it can't infer the type, sum just throws an error. So test1(r) actually always returns the same type for r::Array{Float64} in any case where it returns a value at al. The real problem is that eltype(t^2 for t in rand(10)) returns Any.

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Tsur Herman
On my side both function perform equally. although test2 had to be timed twice to get to the same performance. julia> test2(x)= sum( [t^2 for t in x] ) julia> @time test2(r) 0.017423 seconds (13.22 k allocations: 1.339 MB) julia> @time test2(r) 0.000332 seconds (9 allocations: 781.531 KB)

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Patrick Kofod Mogensen
There might be a perfectly valid explanation for this, but this also surprises me. r = rand(10) f(x) = x^2 test1(r) = sum( f(x) for t in r ) test2(r) = sum( [f(x) for t in r] ) @code_warntype test1(r) # return type Any is inferred @code_warntype test2(r) # return type Float64 is inferred

Re: [julia-users] Re: Adding publications easier

2016-09-22 Thread Tony Kelman
Yeah I didn't realize the readme was suggesting that either, sorry. We should automate the complicated part on our side.

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Christoph Ortner
would it maybe be possible to introduce a macro like @inbounds that somehow turns off the check that the generator is empty?

[julia-users] PkgDev.tag issues

2016-09-22 Thread Tony Kelman
What does Pkg.status() say? What operating system are you using? What is git status in METADATA and the package repo?

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Christoph Ortner
Yeah, this definitely matters for performance. It is a real shame since the generators are so elegant to use. inner1(R, i) = sum( R[j,i] for j = 1:size(R,1) ) inner2(R, i) = sum( [R[j,i] for j = 1:size(R,1)] ) function test(R, inner) n = [ inner(R, i)^2 for i = 1:size(R,2) ] N =

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Christoph Ortner
sum( Float64[] ) = 0.0 ?

Re: [julia-users] Implementing compilers or interpreters in Julia?

2016-09-22 Thread Tim Besard
Op donderdag 22 september 2016 12:55:01 UTC-4 schreef Isaiah: > - Cxx.jl, if you want to target LLVM > I've been working on LLVM.jl to make this even easier: - https://github.com/maleadt/LLVM.jl - irbuilder + execution example: https://github.com/maleadt/LLVM.jl/blob/master/examples/sum.jl Is

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Patrick Kofod Mogensen
I've seen the same, and the answer I got at the JuliaLang gitter channel was that it could not be inferred because r could be of length 0, and in that case, the return type could not be inferred. My Julia-fu is too weak to then explain why the comprehension would be able to infer the return

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Christoph Ortner
I didn't actually test performance - the problem for me was re-use of the output of test1. But it is hard to reproduce this with a simple example. The same code works in some situations and not in others - I haven't yet found out why.

[julia-users] Re: ANN: Julia v0.5.0 released!

2016-09-22 Thread Jeffrey Sarnoff
whoo-hoo! On Tuesday, September 20, 2016 at 5:08:44 AM UTC-4, Tony Kelman wrote: > > At long last, we can announce the final release of Julia 0.5.0! See the > release notes at > https://github.com/JuliaLang/julia/blob/release-0.5/NEWS.md for more > details, and expect a blog post with some

Re: [julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Stefan Karpinski
I see the same, yet: julia> r = rand(10^5); julia> @time test1(r) 0.000246 seconds (7 allocations: 208 bytes) 33375.54531253989 julia> @time test2(r) 0.001029 seconds (7 allocations: 781.500 KB) 33375.54531253966 So test1 is efficient, despite the codewarn output. Not sure what's up. On

[julia-users] Broadcast slices

2016-09-22 Thread Brandon Taylor
Is there a way to slice two or more arrays along the same dimension, broadcast a function over the slices, then put the results back together again along the sliced dimension? Essentially, broadcast_slices?

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

2016-09-22 Thread Stefan Karpinski
Yikes... recycled static IP address :| On Thu, Sep 22, 2016 at 1:02 PM, mmh wrote: > http://julia.malmaud.com > > > Now links to some random dudes website :P > > On Monday,

Re: [julia-users] Re: Adding publications easier

2016-09-22 Thread Magnus Röding
Thanks for the quick response in changing the workflow, now it's more at my (and hopefully others') level. Den torsdag 22 september 2016 kl. 17:56:13 UTC+2 skrev Stefan Karpinski: > > I didn't realize that there was a README that actually tells you to do all > of that. I've opened an issue >

[julia-users] Generators vs Comprehensions, Type-stability?

2016-09-22 Thread Christoph Ortner
I hope that there is something I am missing, or making a mistake in the following example: r = rand(10) test1(r) = sum( t^2 for t in r ) test2(r)= sum( [t^2 for t in r] ) @code_warntype test1(r) # return type Any is inferred @code_warntype test2(r) # return type Float64 is inferred This

Re: [julia-users] Julia's current state of web-programming

2016-09-22 Thread Adrian Salceanu
Escher is pretty cool, but it’s more about data interactions and visualizations (dashboards?), rather than building full featured web apps and products. I’m working on Genie: https://github.com/essenciary/Genie.jl a full stack MVC web framework for Julia, in the spirit of Rails or Django. It now

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

2016-09-22 Thread mmh
http://julia.malmaud.com Now links to some random dudes website :P On Monday, September 19, 2016 at 3:39:34 PM UTC-4, Jonathan Malmaud wrote: > > Discourse lives! > On Mon, Sep 19, 2016 at 3:01

Re: [julia-users] Implementing compilers or interpreters in Julia?

2016-09-22 Thread Isaiah Norton
Any answer if going to be fairly opinion-based. That said, here are some opinions :) some advantages: - interactive development - performance - Cxx.jl, if you want to target LLVM - multiple dispatch some disadvantages: - lack of ML-style pattern-matching -- though multiple dispatch on node type

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

2016-09-22 Thread Ismael Venegas Castelló
Dear Patrick, Basically Transifex got us covered there, it has a nifty feature called transifex live which automatically extracts and updates the string database in the correct way, all the translators have to do is fiddle around with the web interface to get used to it, and start translating

Re: [julia-users] Re: Adding publications easier

2016-09-22 Thread Stefan Karpinski
I didn't realize that there was a README that actually tells you to do all of that. I've opened an issue since there's no reason someone should have to install Jekyll in order to submit a publication that uses Julia – that's way over

Re: [julia-users] Re: Adding publications easier

2016-09-22 Thread Stefan Karpinski
You don't need Jekyll installed to edit markdown files. You can even edit files directly in the web and preview the rendering. Admittedly, installing Jekyll is a pain and seems to have gotten worse over time somehow, but you don't need to do any of that to submit a publication. On Thu, Sep 22,

[julia-users] Julia's current state of web-programming

2016-09-22 Thread Alexey Cherkaev
Hi all, What is the current state of web programming with Julia? http://juliawebstack.org/ seems quite out of date (still suggesting to use Morsel, which is marked as deprecated). Escher looks quite nice (https://github.com/shashi/Escher.jl), but still fails to build on both 0.4 and 0.5

[julia-users] Implementing compilers or interpreters in Julia?

2016-09-22 Thread Sebastian the Eight
I'm curious how adept Julia is for writing compilers/interpreters? It's fairly easy to find example toy compilers for most other languages (C, OCaml, Ruby etc), but Julia seems to be lacking any examples except for its own. I was wondering if there are advantages or disadvantages for using

Re: [julia-users] Re: Visualizing a Julia AST (abstract syntax tree) as a tree

2016-09-22 Thread David P. Sanders
El jueves, 22 de septiembre de 2016, 10:29:11 (UTC-4), Tom Breloff escribió: > > Hi David this is very cool and useful! I'd be happy to have it in > PlotRecipes if you don't find a better home for it. If there's a generic > function to produce an adjacency list then we could use my graph

Re: [julia-users] Re: Visualizing a Julia AST (abstract syntax tree) as a tree

2016-09-22 Thread Tom Breloff
Hi David this is very cool and useful! I'd be happy to have it in PlotRecipes if you don't find a better home for it. If there's a generic function to produce an adjacency list then we could use my graph recipes. When I have the time (i.e. soonish when I really want nicer graphs) I plan on

[julia-users] Re: Visualizing a Julia AST (abstract syntax tree) as a tree

2016-09-22 Thread David P. Sanders
Here's an example of the output. El miércoles, 21 de septiembre de 2016, 17:24:52 (UTC-4), David P. Sanders escribió: > >

[julia-users] Re: How to deal with methods redefinition warnings in 0.5?

2016-09-22 Thread Cedric St-Jean
I haven't implemented it yet in ClobberinReload.jl, but I suspect that include("file.jl"); IJulia.clear_output() can provide some pain relief (at the cost of missing the meaningful warnings) if you're using IJulia. On Tuesday, September 20, 2016 at 8:59:05 AM UTC-4, Matthieu wrote: > > +1. I

[julia-users] Re: Maps in Julia?

2016-09-22 Thread 'Philippe Roy' via julia-users
Yeesian, I took the time to read the entire presentation. It does look very promising! Thanks for such work, I'll certainly keep an eye on it. Le mercredi 21 septembre 2016 08:37:27 UTC-4, Yeesian Ng a écrit : > > It is based on slow work-in-progress, but I have slides >

Re: [julia-users] Re: Debugging stack allocation

2016-09-22 Thread Yichao Yu
On Thu, Sep 22, 2016 at 8:44 AM, Jamie Brandon wrote: > Well, I managed to answer the first part of my question. A variable won't be > stack-allocated unless the compiler can prove it is always defined before > being used. Mine were, but the control flow was too

[julia-users] Re: Debugging stack allocation

2016-09-22 Thread Jamie Brandon
Well, I managed to answer the first part of my question. A variable won't be stack-allocated unless the compiler can prove it is always defined before being used. Mine were, but the control flow was too complex for the compiler to deal with. I added `local finger = Finger{1}(0,0)` in a few places

[julia-users] Re: Adding publications easier

2016-09-22 Thread Magnus Röding
I have now made a new attempt, ending up having everything installed and seemingly working on an Ubuntu 16.04 system. My workflow so far is: - git clone https:// to local repo (I have a github account) - edit julia.bib and _EDIT_ME_index.md according to instructions - run 'make' in

[julia-users] Re: Debugging stack allocation

2016-09-22 Thread Jamie Brandon
Oh, for comparison, this simper function contains no heap allocation at all, so the compiler is definitely willing to do this under some circumstances. function foo() finger = Finger{1}(1,1) for _ in 1:1000 finger = Finger{1}(finger.hi + finger.lo, finger.lo) end finger end On 22

[julia-users] Debugging stack allocation

2016-09-22 Thread Jamie Brandon
I have a query compiler which emits Julia code. The code contains lots of calls to generated functions, which include sections like this: hi = gallop(column, column[finger.lo], finger.lo, finger.hi, <=) Finger{$(C+1)}(finger.lo, hi) Finger is an immutable, isbits type: immutable

Re: [julia-users] how to get rid of axis in Plots ?

2016-09-22 Thread Tom Breloff
This isn't configurable right now, but I've wanted the same thing. Can you open an issue and I'll add when I have a couple minutes? I think the plotlyjs backend does this by default though. On Thursday, September 22, 2016, Roger Herikstad wrote: > Hey, > Similar

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

2016-09-22 Thread Patrick Kofod Mogensen
How does this sync with the "original website"? I mean, what if something changes on the original website? On Thursday, September 22, 2016 at 8:35:38 AM UTC+2, Ismael Venegas Castelló wrote: > > I forgot, you guys can see the staging domain here: > > >- http://julialanges.github.io > >

[julia-users] Julia v0.5.0 always killed on a memory limited cluster

2016-09-22 Thread Alan Crawford
I am using Julia v0.5.0 on a memory limited SGE cluster. In particular, to submit jobs on the cluster, both h_vmem and tmem resource flags need to be passed to in qsub command. However, all of Julia jobs keep on being killed because workers seem to be very hungry for virtual memory and ask for

[julia-users] Re: how to get rid of axis in Plots ?

2016-09-22 Thread Roger Herikstad
Hey, Similar question; how do I remove only the upper and right border? My personal preference is to only show the left and bottom border. In Winston, I'd do this p = Winston.plot([1,2,3],[3,4,5]) Winston.setattr(p.frame, "draw_axis", false) Thanks! On Wednesday, June 29, 2016 at 2:15:47

[julia-users] Re: Plotting lots of data

2016-09-22 Thread CrocoDuck O'Ducks
Hi! Thank you for your package. Yes, I managed to get my plots working with GR. For some reason now it is plotting all the lines, I don't get the weird white bands anymore. On Wednesday, 21 September 2016 12:52:43 UTC+1, Igor wrote: > > Hello! > did you managed to plot big data sets? You can

[julia-users] Re: Maps in Julia?

2016-09-22 Thread Michael Borregaard
Yeesian, this looks really promising! It will be great to follow the progress of this.

Re: [julia-users] Re: Plotting lots of data

2016-09-22 Thread Igor _
Chris, thank you for the information!! 21 сент. 2016 г. 23:07 пользователь "Chris Rackauckas" написал: > Usually I'm plotting the run from really long differential equations > solution. The one I am mentioning is from a really long stochastic > differential equation solution

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

2016-09-22 Thread Ismael Venegas Castelló
I forgot, you guys can see the staging domain here: - http://julialanges.github.io Please let me know what you think! El jueves, 22 de septiembre de 2016, 1:32:13 (UTC-5), Ismael Venegas Castelló escribió: > > Looking how to contribute to Julia? Check out the web translation project >