Re: [julia-users] Initializing a SharedArray Memory Error

2014-12-10 Thread Tim Holy
After your gc() it should be able to be unmapped, see https://github.com/JuliaLang/julia/blob/f3c355115ab02868ac644a5561b788fc16738443/base/mmap.jl#L113 My guess is something in the parallel architecture is holding a reference. Have you tried going at this systematically from the internal repres

Re: [julia-users] Re: home page content

2014-12-10 Thread Tim Holy
I like the Haskell one better than the Rust one. --Tim On Tuesday, December 09, 2014 11:14:41 PM Valentin Churavy wrote: > An other nice example might be the new haskell > homepage http://new-www.haskell.org/ > > For the runnable part. Maybe we could use tmpnb/juliabox to host an example > noteb

Re: [julia-users] Re: How fast reduce the Vector range of values? (Recode for smaler numbers)

2014-12-10 Thread Paul Analyst
And how to do it if the "J" is an array rather than a vector? So that was also Jcodes array of the same size as J? julia> J 1557211x2 Array{Int64,2}: 930070 930070 1475172 1475172 .... 21474836496 21474836496 4296445417 4296445417 Paul W d

[julia-users] Re: home page content

2014-12-10 Thread Giacomo Kresak
Yes some plots examples would be great to improve the applicability of Julia. Issue has been discussed by Steven G. Johnson on: Dec 3 https://github.com/gizmaa/Julia_Examples/issues/1 Also a wonderful notebook in https://gist.github.com/gizmaa/7214002. Anyway THANKS for the effort. - G. On

Re: [julia-users] Re: home page content

2014-12-10 Thread Valentin Churavy
I agree that displaying runnable code widgets are useless, but showing the good integration with Jupyter/IPython via juliabox/tmpnb/SAGE is not. It would enable to demonstrated people features of Julia without having them actually installing yet another programming environment, thus reducing the

Re: [julia-users] Re: home page content

2014-12-10 Thread Simon Byrne
Yeah, I don't think we need runnable widgets on the main page. A better option would be to have a "Run in JuliaBox" link which could start a new session. As far as code samples go, the ideal ones should: * be around 10 lines or so * demonstrate the key features of Julia (i.e. all the things unde

Re: [julia-users] Re: home page content

2014-12-10 Thread Job van der Zwan
My two cents: - Plots are great, but please make them readable for the colourblind - use triangles/squares/etc in addition to circles, use lightness and saturation on top of hue. I can't make sense of the linked examples so far. - Code widgets are probably not that interesting outsid

Re: [julia-users] Re: home page content

2014-12-10 Thread elextr
One thing, (probably not on the front page) would be online access to the latest Git version for those of us limited to packaged versions.

[julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-10 Thread Ján Dolinský
> Hi, >> >> Thanks for the explanation. Suppose I have a named array X with 3 columns >> "x1", "x2" and "x3" and I do prod(X, 2). Will the resulting array (a single >> columns in this case) have a sensible name like "x1x2x3" ? Or more >> generally, how are these new names generated and for whi

[julia-users] Installing packages system-wide

2014-12-10 Thread Ján Dolinský
Hello, I'd like to ask how to install Julia packages system-wide so that users do not have to install packages individually on their own but rather just once by an admin. Thanks, Jan

Re: [julia-users] Re: home page content

2014-12-10 Thread Hans W Borchers
Look at the R home page. R is one of the most popular languages, and esp. so for statistical and computational applications. A programming language does not need bloated home pages. I like the old Haskell home page much more than the new one. The new one has large, uninformative background pictu

[julia-users] serialize a dictionary gives an error

2014-12-10 Thread Daniel Høegh
I have a dictionary that like: Dict{ASCIIString,Array{Array{Float64,2},1}} with 83 entries: It is generated by reading 350 mb of dlm files. I would like to save so it is faster reloadable, currently it takes 60s to load from the dlm files. I have tried to serialize to save the data. open("test.b

Re: [julia-users] Re: home page content

2014-12-10 Thread Tamas Papp
>From the discussion, it looks like that homepages for programming languages (and realed projects) serve two purposes: A. provide resources for the existing users (links to mailing lists, package directories, documentation, etc) B. provide information for potential new users (showcasing features

Re: [julia-users] Re: home page content

2014-12-10 Thread Jan Niklas Hasse
> > Am I the only one who thinks these runnable code widgets are totally > useless? I'm curious as to how users interact with them in the real > world. I bet 99% of them either ignore it or just press the button and see > the default output. The ones who probably interact with it the most ar

[julia-users] BinDeps fails to find a built dependency (but only on Travis)

2014-12-10 Thread Michael Eastwood
I'm in the process of wrapping part of an important tool for Radio Astronomers: CasaCore (relevant branch: https://github.com/mweastwood/CasaCore.jl/tree/maketraviswork). Unfortunately CasaCore is a C++ library, so I have first written a C interface that needs to be compiled. I am using BinDep

[julia-users] Julia on android

2014-12-10 Thread googler
Hi all Do anyone knows how I can run a julia program in android platform? Is there any support given? Any help is appreciated!! Thanks and Regards googler

Re: [julia-users] Installing packages system-wide

2014-12-10 Thread Stefan Karpinski
There's a Julia variable called LOAD_PATH that is arranged to point at two system directories under your julia installation. E.g.: julia> LOAD_PATH 2-element Array{Union(ASCIIString,UTF8String),1}: "/opt/julia-0.3.3/usr/local/share/julia/site/v0.3" "/opt/julia-0.3.3/usr/share/julia/site/v0.3"

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
H seems to work fine for me. Does the program in this gist work for you? On Wednesday, 10 December 2014 13:30:38 UTC, Daniel Høegh wrote: > > I have a dictionary that like: > Dict{ASCIIString,Array{Array{Float64,2},1}} with 83 entri

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Daniel Høegh
Yes it works when I remove the 0.4 syntax:) But when you put using PyPlot in the top it does not work:( It's the "convertalypse." at https://github.com/JuliaLang/julia/issues/8631

Re: [julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Tim Holy
If you do a Pkg.update(), there's a good chance Gunnar's bandaid in Color will fix this for you. --Tim On Wednesday, December 10, 2014 08:23:02 AM Daniel Høegh wrote: > Yes it works when I remove the 0.4 syntax:) > But when you put using PyPlot in the top it does not work:( It's the > "convertal

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
Sorry, it's just too natural nowadays :P On Wednesday, 10 December 2014 16:23:02 UTC, Daniel Høegh wrote: > > Yes it works when I remove the 0.4 syntax:) > But when you put using PyPlot in the top it does not work:( It's the > "convertalypse." at https://github.com/JuliaLang/julia/issues/8631

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
> > Yes it works when I remove the 0.4 syntax:) > Sorry it's just too natural for me nowadays :P On Wednesday, 10 December 2014 16:23:02 UTC, Daniel Høegh wrote: > > Yes it works when I remove the 0.4 syntax:) > But when you put using PyPlot in the top it does not work:( It's the > "converta

Re: [julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Daniel Høegh
Thanks Tim it works. I really hope someone catch the root of the "convertalypse" soon:)

[julia-users] [ANN, x-post julia-stats] Mocha.jl v0.0.4 (Deep Learning Framework for Julia)

2014-12-10 Thread Chiyuan Zhang
For those who don't know: Mocha is a Deep Learning framework for Julia , inspired by the C++ Deep Learning framework Caffe . Some hilights: - *Modular Architecture*: Mocha has a clean architecture with isolated components like netw

Re: [julia-users] Re: How fast reduce the Vector range of values? (Recode for smaler numbers)

2014-12-10 Thread Sean Marshallsay
Vector{T} is just a typealias for Array{T, 1} so it's still an array but limited to one dimension. Your problem can be solved with convert(Array{Int, 2}, Jcodes) or equivalently convert(Matrix{Int}, Jcodes) On Wednesday, 10 December 2014 11:09:55 UTC, paul analyst wrote: > > And how to do it

Re: [julia-users] Re: home page content

2014-12-10 Thread Christian Peel
One thing that I would very much appreciate is some kind of development schedule. For example - Some kind of general roadmap - a plan for when 0.4 and future releases will come - Any plans to switch to a regular schedule? (yearly, six months, ...) - What features remain before a 1.0

Re: [julia-users] Re: home page content

2014-12-10 Thread Valentin Churavy
I like the point: Solving P=NP reminds me of rust's * In theory. Rust is a work-in-progress and may do anything it likes up to > and including eating your laundry. On Wednesday, 10 December 2014 19:15:05 UTC+1, Christian Peel wrote: > > One thing that I would very much appreciate is some kind

Re: [julia-users] Re: home page content

2014-12-10 Thread Stefan Karpinski
We can add a bullet point about Julia not eating your laundry. My point of view is that Julia's pre-1.0 status does not mean that it can do whatever it wants and we have no responsibility. Rather it sends the much milder signal that between now and 1.0 we may change the language and standard librar

Re: [julia-users] Re: home page content

2014-12-10 Thread Tamas Papp
On Wed, Dec 10 2014, Christian Peel wrote: > provide would be helpful. Also, I'd be happy for something like a weekly > update; or a weekly blog post to help those who don't peruse this group in > depth each day. there was http://thisweekinjulia.github.io/ but it has not been updated since la

Re: [julia-users] Re: home page content

2014-12-10 Thread John Myles White
As always in Julia (and OSS in general), I think the problem is that there's no labor supply to do most "nice" things for the community. Everybody would love to see weekly updates. Not many people have both the time and desire to do the work. -- John On Dec 10, 2014, at 10:41 AM, Tamas Papp

Re: [julia-users] Initializing a SharedArray Memory Error

2014-12-10 Thread benFranklin
I think you are right about some references not being released yet: If I change the while loop to include you way of replacing every reference, the put! actually never gets executed, it just waits: while true zeroMatrix = SharedArray(Float64,(nQ,nQ,3,nQ,nQ,nQ),pids=workers(), init = x->

[julia-users] Poor parallel performance

2014-12-10 Thread Dejan Miljkovic
I am getting performance degradation after parallelizing the code that is calculating graph centrality. Graph is relatively large, 100K vertices. Single threaded application take approximately 7 minutes. As recommended on julialang site ( http://julia.readthedocs.org/en/latest/manual/parallel-

Re: [julia-users] Re: home page content

2014-12-10 Thread Christian Peel
OK, thanks for the replies; John's reply below makes the situation clear. Chris On Wednesday, December 10, 2014 10:46:03 AM UTC-8, John Myles White wrote: > > As always in Julia (and OSS in general), I think the problem is that > there's no labor supply to do most "nice" things for the community

Re: [julia-users] Re: home page content

2014-12-10 Thread Tracy Wadleigh
It might be nice to have a few examples of workflows that people who use Julia in real life have set up for themselves. On Wed, Dec 10, 2014 at 2:03 PM, Christian Peel wrote: > OK, thanks for the replies; John's reply below makes the situation clear. > > Chris > > On Wednesday, December 10, 2014

[julia-users] Re: home page content

2014-12-10 Thread Christoph Ortner
I would really like to see a page along the lines of http://www.mathworks.com/examples/ I've tried to start something like it at http://homepages.warwick.ac.uk/staff/C.Ortner/index.php?page=julia This was aimed mostly at my own research group and some friends and colleagues. Some ideas:

Re: [julia-users] Re: home page content

2014-12-10 Thread Isaiah Norton
> > I've tried to start something like it at > http://homepages.warwick.ac.uk/staff/C.Ortner/index.php?page=julia > This was aimed mostly at my own research group and some friends and > colleagues. > Your "Why Julia" section is really fantastic. On Wed, Dec 10, 2014 at 2:47 PM, Christoph Ortn

Re: [julia-users] Re: home page content

2014-12-10 Thread Randy Zwitch
Note that the framework is in place via juliabloggers.com. If someone wanted to pick up this task, but didn't want to dedicate creating a blog, I'm willing to create an author account to post directly. On Wednesday, December 10, 2014 1:46:03 PM UTC-5, John Myles White wrote: > > As always in Jul

[julia-users] Re: Reviewing a Julia programming book for Packt

2014-12-10 Thread milktrader
I've likewise been contacted to review the book and have agreed. Dan On Thursday, December 4, 2014 6:31:13 PM UTC-5, Wilfred Hughes wrote: > > I received an email today about being a technical reviewer for a book on > Julia! > > We're currently developing a book titled *Mastering Julia* aiming

Re: [julia-users] Re: How fast reduce the Vector range of values? (Recode for smaler numbers)

2014-12-10 Thread Paul Analyst
Thx, but not work, julia> JJ=hcat(J,J); julia> JJa = (Int=>eltype(JJ))[j => i for (i,j) in enumerate(unique(JJ))]; julia> JJcodes = Int64[JJa[j] for j in JJ]; julia> convert(Array{Int, 2}, Jcodes) ERROR: `convert` has no method matching convert(::Type{Array{Int64,2}}, ::Array{Int64,1}) in c

[julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
Well, temporary array was also on my mind. However, things are I believe a little bit more complicated. Here is the code with three timed options. As you can see, the first two options are the fast one (multiplication with a scalar) and the slow one (multiplication with a one by one matrix)

[julia-users] Multiple assignment in multidimensional array

2014-12-10 Thread Tudor Berariu
Hello! I have a 4x4 array of zeros. julia> X = zeros(4,4) 4x4 Array{Float64,2}: 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 I have an 2xN array containing indices of elements in X that I want to assign a new value. julia> ind = [1 1; 2 2; 3 3] 3x2 Array{Int6

[julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
Actually: option (4) was also tested: # 16.333766821 seconds (3008899660 bytes fs[1]= f; fs *= (Jac * w[j]); Fe += Ns[j] .* fs; So, allocation of memory was reduced somewhat, runtime not so much. On Wednesday, December 10, 2014 12:45:20 PM UTC-8, Petr Krysl wrote: > Well, tempora

Re: [julia-users] Re: home page content

2014-12-10 Thread Stefan Karpinski
Yeah, that's really a good "why Julia". On Wed, Dec 10, 2014 at 2:55 PM, Isaiah Norton wrote: > I've tried to start something like it at >> http://homepages.warwick.ac.uk/staff/C.Ortner/index.php?page=julia >> This was aimed mostly at my own research group and some friends and >> colleagues.

Re: [julia-users] Multiple assignment in multidimensional array

2014-12-10 Thread Stefan Karpinski
The classic vectorized Matlab approach is to use sub2ind: julia> X[sub2ind(size(X), ind[:,1], ind[:,2])] = 2 2 julia> X 4x4 Array{Float64,2}: 2.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 0.0 0.0 Of course, in Julia you also have the option of just using a for loop: f

Re: [julia-users] Multiple assignment in multidimensional array

2014-12-10 Thread Stefan Karpinski
please don't cross-post questions in multiple places – it's the same people reading and answering in both places: http://stackoverflow.com/questions/27410076/multiple-assignment-in-multidimensional-array On Wed, Dec 10, 2014 at 4:06 PM, Stefan Karpinski wrote: > The classic vectorized Matlab app

Re: [julia-users] Multiple assignment in multidimensional array

2014-12-10 Thread Tudor Berariu
Thank you for the answer! I'm sorry about cross-posting. It won't happen again! On Wednesday, December 10, 2014 11:08:53 PM UTC+2, Stefan Karpinski wrote: > > please don't cross-post questions in multiple places – it's the same > people reading and answering in both places: > http://stackoverfl

Re: [julia-users] Multiple assignment in multidimensional array

2014-12-10 Thread Stefan Karpinski
No worries, glad I could answer your question. On Wed, Dec 10, 2014 at 4:20 PM, Tudor Berariu wrote: > Thank you for the answer! I'm sorry about cross-posting. It won't happen > again! > > On Wednesday, December 10, 2014 11:08:53 PM UTC+2, Stefan Karpinski wrote: >> >> please don't cross-post qu

RE: [julia-users] Re: home page content

2014-12-10 Thread David Anthoff
+1 on that! Even vague plans that are subject to change would be great to have. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Christian Peel Sent: Wednesday, December 10, 2014 10:15 AM To: julia-users@googlegroups.com Subject: Re: [julia-users] Re: home

Re: [julia-users] Re: home page content

2014-12-10 Thread Stefan Karpinski
I have to say the concept of putting plans up on the home page fills me with dread. That means I have update the home page while I'm planning things and as that plan changes and then do the work and then document it. It's hard enough to actually do the work. On Wed, Dec 10, 2014 at 4:44 PM, David

Re: [julia-users] Re: home page content

2014-12-10 Thread John Myles White
Stefan, I shared your moment of terror about the idea of posting plans (essentially all of which will be invalidated) to the home page. Although it's huge volume of e-mail, I do feel like people who want to keep up with new developments in Julia should try to subscribe to the issue tracker and

Re: [julia-users] BinDeps fails to find a built dependency (but only on Travis)

2014-12-10 Thread Elliot Saba
It would be helpful if you could have julia execute "using BinDeps; BinDeps.debug("CasaCore")" after attempting to build. It also looks like you have another error that we should look into: Warning: error initializing module GMP: ErrorException("The dynamically loaded GMP library (version 5.0.2

Re: [julia-users] Re: home page content

2014-12-10 Thread Randy Zwitch
I think it would please everyone if you moved daily televised scrums. On Wednesday, December 10, 2014 4:53:50 PM UTC-5, John Myles White wrote: > > Stefan, I shared your moment of terror about the idea of posting plans > (essentially all of which will be invalidated) to the home page. > > Althou

[julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
I don't know if this is correct, but here is a guess: Option 3 still requires a temp array ( to calculate the result of the paren fs= ([f] * Jac * w[j]); ), and option 4 eliminates that temp. The cost of the temp over the 2 million loops is ~200MB and 0.6 sec CPU time. So WHY is the difference

[julia-users] customized hash function (or equality function)?

2014-12-10 Thread Evan Pu
Hi, this should be a simple affair. I have a polynomial object that keeps track of its coefficients, it is defined as follows: immutable Poly1 coef :: Array{Float64} end I would like to make a dictionary with keys that are Poly1 type, like follows: # creation r_dict1 = [Poly1([1.0, 2.0]) =>

Re: [julia-users] Re: home page content

2014-12-10 Thread Tony Kelman
-1 on trying to put plans, schedule, roadmap on the website. "This week in Julia" was a great contribution to the community but evidently took more effort than Matt had time to keep up with. New features get developed as the PR's for them get worked on and finished. You can subscribe to just th

[julia-users] Roadmap

2014-12-10 Thread David Anthoff
I hear you, and I didn’t think much before sending my email. Couple of points: I totally agree this should certainly not be on the homepage. I also agree that there is no need for a detailed schedule, deadlines or anything like that. I think the only thing that would be immensely helpful at l

Re: [julia-users] Roadmap

2014-12-10 Thread John Myles White
FWIW, my sense is that no one really knows what's going to happen between 0.4 and 1.0. There are lots of projects that are seen as essential before 1.0, but many of those are tenatively on the 0.4 release targets (static compilation, array views, package documentation, etc.). At JuliaCon, I rea

[julia-users] Re: customized hash function (or equality function)?

2014-12-10 Thread Steven G. Johnson
Base.hash(p::Poly1, h::Uint) = hash(p.coef, h) Base.(==)(p1::Poly1, p2::Poly2) = p1.coef == p2.coef (If you override hash you should always override == to be consistent, and vice versa.)

RE: [julia-users] Roadmap

2014-12-10 Thread David Anthoff
Thanks, this is really useful! I would very much cherish an email like this maybe after a release from some of the core team members. It just gives a nice insight into the current plans. Cheers, David From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Joh

[julia-users] Re: Roadmap

2014-12-10 Thread Tony Kelman
Thanks for making this a new thread, it was getting off-topic. Jeff's probably very busily working on https://github.com/JuliaLang/julia/issues/8839 right now and might not have plans that extend too far beyond that, but you'll have to ask him. I think you'll get different answers to these ques

[julia-users] defining types in macros broken in 0.4

2014-12-10 Thread Sheehan Olver
The below works fine in 0.3 but I get ERROR: error compiling anonymous: type definition not allowed inside a local scope In 0.4. How am I suppose to define types inside a Macro? As far as I can tell, the esc() should cause everything to run in the current scope which isn't local. macro

[julia-users] Re: customized hash function (or equality function)?

2014-12-10 Thread Evan Pu
wonderful! thanks!! On Wednesday, December 10, 2014 8:24:17 PM UTC-5, Steven G. Johnson wrote: > > Base.hash(p::Poly1, h::Uint) = hash(p.coef, h) > Base.(==)(p1::Poly1, p2::Poly2) = p1.coef == p2.coef > > (If you override hash you should always override == to be consistent, and > vice versa.) >

Re: [julia-users] BinDeps fails to find a built dependency (but only on Travis)

2014-12-10 Thread Kyle Barbary
Not sure if this is the same, but Mike Nolta and I also had a problem building FITSIO.jl on Travis that we could not reproduce locally on Ubuntu 14.04. We eventually gave up and just used the apt package for cfitsio instead of building it from source. See https://github.com/JuliaAstro/FITSIO.jl/pu

RE: [julia-users] Roadmap

2014-12-10 Thread Boylan, Ross
Somewhere, not necessarily on the front page, some tips for people wondering where the project is heading would be good. Not a list of plans, but orienting info like "no one knows", and an explanation of how to get a sense of current (i.e., for 0.4 right now) and future issues from the bug trac

Re: [julia-users] Roadmap

2014-12-10 Thread Tim Holy
Really nice summaries, John and Tony. On Thursday, December 11, 2014 02:08:54 AM Boylan, Ross wrote: > BTW, is 0.4 still in a "you don't want to go there" state for users of > julia? In short, yes---for most users I'd personally recommend sticking with 0.3. Unless you simply _must_ have some of

Re: [julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Tim Holy
Can you post short but complete code examples in a gist? https://gist.github.com/ That would make it easier to follow than chasing code examples across long email chains. --Tim On Wednesday, December 10, 2014 02:35:38 PM Petr Krysl wrote: > I don't know if this is correct, but here is a guess:

Re: [julia-users] defining types in macros broken in 0.4

2014-12-10 Thread Tim Holy
Seems like it might be worth filing an issue. It would help if it's complete enough that people could copy-paste the `macroexpand`ed code and get it to work. (Things like `BandedOperator`, etc, are not available in this snippet.) --Tim On Wednesday, December 10, 2014 05:53:54 PM Sheehan Olver w

[julia-users] scope using let and local/global variables

2014-12-10 Thread Michael Mayo
Hi folks, I have the following code fragment: x=1 let x=2 println(x)# Line 1 exp=:(x+1) println(eval(exp))# Line 2 end It contains two variables both named x, one inside the scope defined by let, and one at global scope. If I run this code the output is: 2 2 This indicat

Re: [julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
The code is really short: N=200 function doit1(N) Fe=zeros(3,1);Ns=zeros(3,1)+1.0;f=-6.0;Jac=1.0; for i=1:N Fe += Ns * (f * Jac); end Fe end function doit2(N) Fe=zeros(3,1);Ns=zeros(3,1)+1.0;f=-6.0;Jac=1.0; for i=1:N Fe += Ns

[julia-users] Community Support for Julia on Travis CI

2014-12-10 Thread Pontus Stenetorp
Everyone, I am happy to announce that we now have Julia support on Travis [1]. This has been an effort on the part of the newly formed JuliaCI [2] group and concretely this means that a complete `.travis.yml` for a Julia project can now be as concise as: language: julia julia: - r

Re: [julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Tim Holy
Multiplying two Float64s yields another Float64; most likely, this will be stored in the CPU's registers. In contrast, [f]*Jac creates an array, on each iteration, that has to be stored on the heap. A faster variant devectorizes: function doit1a(N) Fe=zeros(3,1);Ns=zeros(3

Re: [julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
https://gist.github.com/anonymous/054f6fd269f97a4442db On Wednesday, December 10, 2014 7:06:43 PM UTC-8, Tim Holy wrote: > > Can you post short but complete code examples in a gist? > https://gist.github.com/ > That would make it easier to follow than chasing code examples across long > email c

Re: [julia-users] Re: Finite element code in Julia: Curious overhead in .* product

2014-12-10 Thread Petr Krysl
Thanks. Now my head is really spinning! See, before I posted the original question I tried expanding the loop in the actual FE code, and the code was SLOWER and was using MORE memory: With the expression Fe += Ns[j] * (f * Jac * w[j]); : 6.223416655 seconds (1648832052 bytes With the expanded

Re: [julia-users] scope using let and local/global variables

2014-12-10 Thread Jameson Nash
eval, by design, doesn't work that way. there are just too many better alternatives. typically, an anonymous function / lambda is the best and most direct replacement: let x=2 println(x)# Line 1 exp = () -> x+1 println(exp())# Line 2 end On Wed Dec 10 2014 at 10:43:00 PM Mi

Re: [julia-users] scope using let and local/global variables

2014-12-10 Thread Michael Mayo
Thanks, but its not quite what I'm looking for. I want to be able to edit the Expr tree and then evaluate different expressions using variables defined in the local scope,not the global scope (e.g. for genetic programming, where random changes to an expression are repeatedly evaluated to find t

[julia-users] Unexpected append! behavior

2014-12-10 Thread Sean McBane
Hi all, I'm an engineering student with interests in numerical simulation of, well, just about anything, and stumbled across Julia and have been experimenting a bit. I have no idea if this question has been addressed before, but I'm seeing a behavior that's not quite what I'd expect from the a

[julia-users] Changes to array are not visible from caller

2014-12-10 Thread Mark Stock
Hello, n00b Julia user here. I have two functions that change the values of a passed-in array. One works (dxFromX), but for the other one (eulerStep) the caller does not see any changes to the array. Why is this? function dxFromX!(x,dxdt) fill!(dxdt,0.0) for itarg = 1:size(x,1) for isrc

Re: [julia-users] Unexpected append! behavior

2014-12-10 Thread John Myles White
Hi Sean, I'm really confused by the output you're showing. > > X = [1,2]; Y = [1,2]; > > append!(X,Y) > 4-element Array(Int64,1): > 1 > 2 > 3 > 4 Do you really get this output? That seems like a huge bug if so. But I don't see that at all, which is what I'd expect. -- John

Re: [julia-users] scope using let and local/global variables

2014-12-10 Thread Jameson Nash
I'm not quite sure what a genetic program of that sort would look like. I would be interested to hear if you get something out of it. Another alternative is to use a module as the environment: module MyEnv end eval(MyEnv, :(code block)) This is (roughly) how the REPL is implemented to work. On

Re: [julia-users] Unexpected append! behavior

2014-12-10 Thread Ivar Nesje
I assume the first line should be > X = [1,2]; Y = [3,4]; Then the results you get makes sense. The thing is that julia has mutable arrays, and the ! at the end of append! indicates that it is a function that mutates it's argument.

Re: [julia-users] Changes to array are not visible from caller

2014-12-10 Thread Isaiah Norton
`x += ...` is equivalent to writing `x = x + ...` which rebinds the variable within that function. Instead, do an explicit array assignment `x[:,:] = ...` This is discussed in the manual with a warning about type changes, but the implication for arrays should probably be made clear as well: http:/

Re: [julia-users] Unexpected append! behavior

2014-12-10 Thread Sean McBane
Ivar is correct; I was running in the Windows command prompt and couldn't copy and paste so I copied it by hand and made an error. Ok, so I understand that append!(X,Y) is modifying X in place. But I still do not get where the output for the second case, where the result of append!(X,Y) is assi

Re: [julia-users] Unexpected append! behavior

2014-12-10 Thread Alex Ames
Functions that end with an exclamation point modify their arguments, but they can return values just like any other function. For example: julia> x = [1,2]; y = [3, 4] 2-element Array{Int64,1}: 3 4 julia> append!(x,y) 4-element Array{Int64,1}: 1 2 3 4 julia> z = append!(x,y) 6-element Arr