[julia-users] What happened to Array + Scalar being deprecated?

2014-07-15 Thread Thomas Moore
Hi guys, A few months back I ran into what I thought was a rather annoying design decision: if A is an array and b is a number, then A + b is meaningless, and if we want to add b to all elements of A individually we need to use A .+ b. All of this was discussed in:

[julia-users] deepcopy of vector doesn't know type

2014-07-15 Thread Sheehan Olver
I noticed that deepcopy of a vector doesn't know that the result is the same type. Regular copy does, see below. Is this intentional or a bug? In [24]: v=rand(5) @code_typed deepcopy(v) Out[24]: 1-element Array{Any,1}: :($(Expr(:lambda, {:x},

[julia-users] Re: deepcopy of vector doesn't know type

2014-07-15 Thread Jeff Waller
On Tuesday, July 15, 2014 3:10:50 AM UTC-4, Sheehan Olver wrote: I noticed that deepcopy of a vector doesn't know that the result is the same type. Regular copy does, see below. Is this intentional or a bug? It looks to me like this is the reason function _deepcopy_array_t(x, T,

[julia-users] What happened to Array + Scalar being deprecated?

2014-07-15 Thread Ivar Nesje
The thing that happened was that lots of people disliked the new behavior and the depreciation was reverted. Consistency lost over convenience. See https://github.com/JuliaLang/julia/pull/5810#issuecomment-45773715

[julia-users] Re: What happened to Array + Scalar being deprecated?

2014-07-15 Thread Thomas Moore
On Tuesday, 15 July 2014 17:56:16 UTC+10, Ivar Nesje wrote: The thing that happened was that lots of people disliked the new behavior and the depreciation was reverted. Consistency lost over convenience. See https://github.com/JuliaLang/julia/pull/5810#issuecomment-45773715 Wahoo!

Re: [julia-users] Julia 0.2 and NumericExtensions

2014-07-15 Thread Dahua Lin
I will address the warning about add! today. Dahua On Monday, July 14, 2014 3:43:58 PM UTC-5, Kevin Squire wrote: Although annoying, these warnings won't actually cause any problems. The best bet to remove the warnings is to file an issue with NumericExtensions.jl, preferably (but not

Re: [julia-users] how to use searchsortedlast(v::AbstractArray{T,1},x,lo::Int64,hi::Int64,o::Ordering)

2014-07-15 Thread Florian Oswald
thanks kevin, that just cut my run time into half! brilliant. I'm sure other users would benefit from adding this to the documentation. then there's so many places where to add documentation in julia that it's hard to even think about where to start. :-) cheers florian On 14 July 2014 22:01,

Re: [julia-users] Raising an array by a power

2014-07-15 Thread Alan Edelman
If you read dot as point Then pointwise ops make a kind of sense

[julia-users] Re: ANN: Contour.jl

2014-07-15 Thread Tomas Lycken
I just added `coordinates`, which lets you access the coordinates of the contour lines as follows: ``` c = contours(x,y,z,0) # get contour level at z==0 for line in c.lines # line is a Curve2, which is basically a wrapper around a Vector{Vector2} xs, ys = coordinates(line) plot(xs,ys) #

[julia-users] Could not import Base.add into Winston

2014-07-15 Thread Xiaowei Zhang
OS X 10.8.5 + Fresh installation of Julia 0.3rc1 after installing Winston and import it, the warning Could not import Base.add! into DataStructures pops up and the `add` function in Winston cannot be used in the following example x = linspace(0, 3pi, 100) c = cos(x) s = sin(x) p =

[julia-users] Re: ANN: MapLight.jl and calling anyone else interested in working with government / legislative data

2014-07-15 Thread Westley Hennigh
Thanks! Hadn't heard of PolitiHacks - looks interesting On Monday, July 14, 2014 12:17:52 PM UTC-7, Tony Kelman wrote: Cool, there are a lot of interesting this you can do at the intersection of politics and data. I know a guy who runs a little organization called PolitiHacks, I doubt he's

[julia-users] Re: Could not import Base.add into Winston

2014-07-15 Thread Sam L
Functions deprecated after 0.2 were removed from 0.3-rc1 recently, including Base.add. The warning is happening because packages are trying to import add from Base and it no longer exists. The warning does not actually cause any issues and can be ignored in this case. add(p,

[julia-users] Re: output suppression bug

2014-07-15 Thread Zahirul ALAM
am I doing something worng? On Tuesday, 15 July 2014 14:36:47 UTC-4, Zahirul ALAM wrote: the following line of code does not suppress output. a = λ ; #comment however a = λ ; does suppress output

[julia-users] output suppression bug

2014-07-15 Thread Zahirul ALAM
the following line of code does not suppress output. a = λ ; #comment however a = λ ; does suppress output

[julia-users] Re: output suppression bug

2014-07-15 Thread Steven G. Johnson
Yes, this is a known bug; the output suppression in the REPL (and IJulia, and IPython) is a quick hack that doesn't really parse the source code, so it gets confused by comments. (Doing it properly is complicated because you have to distinguish real comments from # embedded in strings.) See:

Re: [julia-users] Re: essay on the history of programming languages

2014-07-15 Thread Ismael VC
Stepfan, I highly recommend you to use the Anaconda Python Distribution, if you are using Windows! Then you would also need pandoc, MiKTeX and some LaTeX editor to output the PDF. But you are right, Julia's package system is so much better! Genius. The only thing I don't get is how to install

Re: [julia-users] Re: essay on the history of programming languages

2014-07-15 Thread Job van der Zwan
Looking forward to it! And thanks for helping out, Yee siang Ng! On Monday, 14 July 2014 19:10:47 UTC+2, Stefan Karpinski wrote: Thank you! I'll work no getting this posted and hopefully we'll get an InfoQ video soon. On Mon, Jul 14, 2014 at 12:58 AM, Yee Sian Ng ngye...@gmail.com

[julia-users] Jupyter project

2014-07-15 Thread Sam L
I found this short talk about the Jupyter project on reddit: video https://www.youtube.com/watch?v=JDrhn0-r9Egt=4m10s, slide deck https://speakerdeck.com/fperez/project-jupyter. Project site: jupyter.org . I haven't heard of it before, but if I understand correctly, the Jupyter project is

Re: [julia-users] Re: Efficient linear transformation (A*x and A*X)

2014-07-15 Thread Andrei
Wow, excellent explanation! Thanks for all your answers! And yes, I'm definitely going to print out BLAS cheat sheet :) (By the way, I'm really impressed how friendly and helpful Julia community is. I hope it will stay the same when it grows up N times larger!) On Tue, Jul 15, 2014 at 4:09 AM,

Re: [julia-users] Re: Efficient linear transformation (A*x and A*X)

2014-07-15 Thread Stefan Karpinski
On Tue, Jul 15, 2014 at 1:10 PM, Andrei faithlessfri...@gmail.com wrote: (By the way, I'm really impressed how friendly and helpful Julia community is. I hope it will stay the same when it grows up N times larger!) I hope this too! This is a lovely community – thanks everyone for being so

[julia-users] Re: Could not import Base.add into Winston

2014-07-15 Thread Xiaowei Zhang
Thanks, Sam! There are some other packages having similar issues. I'll just wait for updates. Xiaowei 在 2014年7月16日星期三UTC+8上午1时07分14秒,Sam L写道: Functions deprecated after 0.2 were removed from 0.3-rc1 recently, including Base.add. The warning is happening because packages are trying to

[julia-users] Setting RNG seeds for parallel computing

2014-07-15 Thread Gray Calhoun
Hi everyone, I'm trying to start using Julia for some Monte Carlo simulations (not MCMC) which I'd like to parallelize. I haven't found any documentation for setting the RNG's seed for parallelization. The naive approach gives different results than non-parallel execution (which is not

[julia-users] [newb] Trouble with compound Boolean expressions

2014-07-15 Thread yaoismyhero
Hi, I am working on a Markov chain Monte Carlo script right now and am trying to figure out the parameter generation part of the script. In pseudocode, I am trying to do a = 0.1 b = 0.1 c = 0.1 function gen() a = a + rand() b = b + rand() c = c + rand() if a b c = 0

Re: [julia-users] [newb] Trouble with compound Boolean expressions

2014-07-15 Thread John Myles White
I think you want something more like a = 0 b = 0 c = 0 Also, you probably don't want to use global variables for code where performance matters. You should pass a, b and c to gen() as parameters gen(a, b, c). -- John On Jul 15, 2014, at 6:31 PM, yaoismyh...@gmail.com wrote: Hi, I am

[julia-users] insert! function only for item not items

2014-07-15 Thread Michael Louwrens
Should insert! not be able to insert a collection? x = [1,2,7,8] y = [3,4,5,6] insert!(x,2+1,y) Is then unable to complete the insertion and create [1,2,3,4,5,6,7,8]. There is a costlier way to do this at the moment however. splice! almost replicates the required functionality but it replaces

Re: [julia-users] insert! function only for item not items

2014-07-15 Thread Kevin Squire
Hi Michael, You can actually use splice!: julia splice!(x, 3:2, y) 0-element Array{Int64,1} julia x 8-element Array{Int64,1}: 1 2 3 4 5 6 7 8 3:2 is a convention in julia that indicates the (empty) location in the array between index 2 and index 3 (e.g., searchsorted(x,3) for your

[julia-users] how to insert at index?

2014-07-15 Thread cnbiz850
I did the following on a DataFrame, but got error. What should I do instead? julia df = insert!(df, 25, dfa) ERROR: `insert!` has no method matching insert!(::DataFrame, ::Int64, ::DataFrame)

Re: [julia-users] Setting RNG seeds for parallel computing

2014-07-15 Thread Andreas Noack
You'll have to set the seed on each process, i.e. fetch 2 srand(1); fetch 3 srand(2); However, I am not sure what our random number generator (dsfmt) promises about independence of the different streams. We should look into that to ensure that you get good random number when running in parallel.

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-15 Thread james . dillon . delaney
If your goal is that each call to rand(), regardless of process, sequentially pulls a number from the RNG stream, then perhaps you just need to create a MersenneTwister([seed]) object. mystream = MersenneTwister(1) ## Parallel execution srand(1) parfor = @parallel (vcat) for i=1:4