[julia-users] Some blog posts on Julia

2016-02-22 Thread Chris Rackauckas
Hey, I wanted to let everyone know I put a few blog posts out there on Julia. You can find them here: http://www.stochasticlifestyle.com/ I am by no means an expert on Julia, but I put some tutorials for some ways I have been using Julia, like how to use Julia on the XSEDE Comet HPC (which

Re: [julia-users] How to apply an array of functions to an array of values?

2016-02-22 Thread David P. Sanders
An alternative is a comprehension: [f(x) for (f,x) in zip(funs, vals)] El lunes, 22 de febrero de 2016, 16:29:21 (UTC-5), Stefan Karpinski escribió: > > Using a lambda works: > > julia> funs = [sin,cos,tan] > 3-element Array{Function,1}: > sin > cos > tan > > julia> vals = rand(3) > 3-elem

[julia-users] Re: Regex(...) vs. r"..."?

2016-02-22 Thread John Brock
Never mind, I figured out it was an escaping issue. This is all fine if you do Regex("\\d\\d"). On Monday, February 22, 2016 at 5:27:17 PM UTC-8, John Brock wrote: > > regex_from_macro = r"\d\d" > regex_from_function = Regex("\d\d") > > julia> regex_from_macro("45") > true > > julia> regex_fro

[julia-users] Regex(...) vs. r"..."?

2016-02-22 Thread John Brock
regex_from_macro = r"\d\d" regex_from_function = Regex("\d\d") julia> regex_from_macro("45") true julia> regex_from_function("45") false julia> regex_from_macro("5") false julia> regex_from_function("5") false Why does calling r"\d\d" result in different behavior than Regex("\d\d")? I

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

2016-02-22 Thread Patrick Kofod Mogensen
Ah, my bad. I (also back when this thread started) thought it was meant to be used "now", and if people seemed to be switching by themselves, there would be an official change. Sorry for the misunderstanding :) On Saturday, February 20, 2016 at 9:20:41 PM UTC+1, Jonathan Malmaud wrote: > > That

Re: [julia-users] How to apply an array of functions to an array of values?

2016-02-22 Thread Stefan Karpinski
Using a lambda works: julia> funs = [sin,cos,tan] 3-element Array{Function,1}: sin cos tan julia> vals = rand(3) 3-element Array{Float64,1}: 0.889165 0.64722 0.997409 julia> map((f,x)->f(x), funs, vals) 3-element Array{Float64,1}: 0.776546 0.797763 1.54857 On Mon, Feb 22, 2016 at 4:22

[julia-users] How to apply an array of functions to an array of values?

2016-02-22 Thread Erik Schnetter
I have an array of functions (`funs`) and an array of values (`vals`). I want to apply the former to the latter, element-wise. When I write ```Julia map(call, funs, vals) ``` Julia replies with ``` WARNING: call(f,args...) is deprecated, use f(args...) instead. ``` What is the correct syntax to u

Re: [julia-users] Plain text files manipulation

2016-02-22 Thread Stefan Karpinski
The Set contains more lines as it goes on – by the end of the first loop, it contains all the distinct lines in the first file, so you can save memory by giving the smaller file first. The lines will appear in the order they occur in the second file, however. I don't think it's possible to avoid ho

Re: [julia-users] Options for constructing a 3D surface from a point cloud

2016-02-22 Thread Chris
I will work on creating a small sample dataset, but the shape is essentially a "kidney bean" in 3D space. In fact, the actual "point cloud" is (right now) actually samples from a 3D probability density function, i.e. it's a "blob", and I want the 3D bounding surface of that blob. I imagine this

Re: [julia-users] Plain text files manipulation

2016-02-22 Thread barbara.g
I'm extremely grateful for your detailed answer. I'm not sure I have understood the implementation of the algorithm: the Set you mention will contain a single line during the entire process or will become heavier as time goes by ? Bye !

Re: [julia-users] how to implement lazy initialization?

2016-02-22 Thread Yichao Yu
On Mon, Feb 22, 2016 at 1:51 PM, Martin Kuzma wrote: > Let's say that i have a type T with array field like this: > > type T > x::Array{Int} You can define `T() = new()` here to make T() works > end > > I want to implement lazy initialization for the array. > > o = T(Int[]) # Or better calling

[julia-users] how to implement lazy initialization?

2016-02-22 Thread Martin Kuzma
Let's say that i have a type T with array field like this: type T x::Array{Int} end I want to implement lazy initialization for the array. o = T(Int[]) # Or better calling T(), but it raises exception o.x # Initilizes the array and returns it. I think this should be possible by overloading ge

[julia-users] Re: Different field type depending on parameter value

2016-02-22 Thread Kristoffer Carlsson
I also went with generated function and call overloading... //hides On Friday, February 19, 2016 at 5:53:20 PM UTC+1, Kristoffer Carlsson wrote: > > I think a simple example will explain better than I could myself. > > What I want to do is something similar to: > > immutable foo{1, T} > dat

Re: [julia-users] A scope bug?

2016-02-22 Thread Sisyphuss
I made a mistake. Sorry for the noise. On Monday, February 22, 2016 at 1:27:20 PM UTC+1, Yichao Yu wrote: > > On Mon, Feb 22, 2016 at 5:59 AM, Sisyphuss > wrote: > > I have the following PageRank code: > > n = 5 > > adj = Float64[0 0 1 1 0; > > 0 0 1 0 0; > > 0

Re: [julia-users] Adding element to array and filtering multi-dimensional arrays.

2016-02-22 Thread Dan
On Monday, February 22, 2016 at 12:18:02 PM UTC+2, Tamas Papp wrote: > > > On Mon, Feb 22 2016, Aleksandr Mikheev wrote: > > > Hi everyone. I have two simple questions, answer to which I cannot find > by > > myself. > > > > 1. Is there any way to add an element to array? For example, I have

Re: [julia-users] Plain text files manipulation

2016-02-22 Thread Stefan Karpinski
Not a Julia solution, but there are some standard UNIX command line tool for this: comm and uniq . These are how I would go about doing this kind of work, at least initially – it's what they're made for and they're very effici

Re: [julia-users] Updated performance tips?

2016-02-22 Thread Stefan Karpinski
Yes, ideally code should not get slower with new releases – unfortunately, keeping track of performance regressions can be a bit of a game of whack-a-mole. Having examples of code whose speed has regressed is very helpful. Thanks to Jarrett Revels excellent work, we now have some great performance

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

2016-02-22 Thread Stefan Karpinski
The official switch would include using discourse.julialang.org as the domain and up-to-date transfer of threads. On Sat, Feb 20, 2016 at 3:20 PM, Jonathan Malmaud wrote: > That site is just a tech demo so we can see what it would be like to > switch to Discourse; it wouldn't be in actual use un

[julia-users] Plain text files manipulation

2016-02-22 Thread barbara.g
Hi ! I have just stepped into Julia, I didn't know about it (her...) before. I must handle plain text file, sized many hundreds of MB, and above, each; the goal is to remove duplicate lines, to find lines present in both of two, to find lines present in one and not in another, etc. I was used

[julia-users] Are dataframes the best way to manipulate data?

2016-02-22 Thread Shahbaz Chaudhary
I'm pretty new to Julia and only have marginally more experience with R so please excuse me if I don't understand something basic. According to Julia's website, the final api/syntax for manipulating data has not been finalized yet, although the momentum seems to be moving towards a dataframe st

Re: [julia-users] Updated performance tips?

2016-02-22 Thread Milan Bouchet-Valat
Le lundi 22 février 2016 à 06:27 -0800, Jonathan Goldfarb a écrit : > I've really been enjoying writing Julia code as a user, and following > the language as it develops, but I have noticed that over time, > previously fast code sometimes gets slower, and (impressively) > previously slow code will

[julia-users] Updated performance tips?

2016-02-22 Thread Jonathan Goldfarb
I've really been enjoying writing Julia code as a user, and following the language as it develops, but I have noticed that over time, previously fast code sometimes gets slower, and (impressively) previously slow code will sometimes get faster, with updates to the Julia codebase. No complaint he

Re: [julia-users] Different field type depending on parameter value

2016-02-22 Thread Kristoffer Carlsson
I went with what Tim and Ben suggested with an extra parameter. It works pretty well except the last parameter is a bit annoying sometimes when dealing with Type, since Type is invariant. Thanks for everyone's suggestions

Re: [julia-users] Different field type depending on parameter value

2016-02-22 Thread Kristoffer Carlsson
I went with what Tim and Ben suggested with an extra parameter. It works pretty well except the last parameter is a bit annoying sometimes when dealing with Type, since Type is invariant. Thanks for everyone's suggestions

Re: [julia-users] A scope bug?

2016-02-22 Thread Yichao Yu
On Mon, Feb 22, 2016 at 5:59 AM, Sisyphuss wrote: > I have the following PageRank code: > n = 5 > adj = Float64[0 0 1 1 0; > 0 0 1 0 0; > 0 1 0 0 0; > 1 0 1 0 1; > 0 1 1 0 0] > adj ./= sum(adj,2) > > pageRank = ones(Float64,n) > N = 1 > for t

[julia-users] A scope bug?

2016-02-22 Thread Sisyphuss
I have the following PageRank code: n = 5 adj = Float64[0 0 1 1 0; 0 0 1 0 0; 0 1 0 0 0; 1 0 1 0 1; 0 1 1 0 0] adj ./= sum(adj,2) pageRank = ones(Float64,n) N = 1 for t = 1:N temp = zeros(n) for j = 1:n temp[j] = 0.15 + 0.85 * vecdot(

[julia-users] Re: New Database Package -- Postgres

2016-02-22 Thread Páll Haraldsson
On Friday, February 19, 2016 at 11:32:54 AM UTC, N Carson wrote: > > Just published a new Postgres adapter for Julia! > Great to know that PostgreSQL is better* supported, as that is what I use.. * Out of curiosity, I know all JDBC drivers are already support, and then [most?] all databases.. [b

Re: [julia-users] Adding element to array and filtering multi-dimensional arrays.

2016-02-22 Thread Tamas Papp
On Mon, Feb 22 2016, Aleksandr Mikheev wrote: > Hi everyone. I have two simple questions, answer to which I cannot find by > myself. > > 1. Is there any way to add an element to array? For example, I have > Array{...}(n,m) or Vector{...}(n). And I'd like to expand it, i.e. I want > to have now Ar

[julia-users] Adding element to array and filtering multi-dimensional arrays.

2016-02-22 Thread Aleksandr Mikheev
Hi everyone. I have two simple questions, answer to which I cannot find by myself. 1. Is there any way to add an element to array? For example, I have Array{...}(n,m) or Vector{...}(n). And I'd like to expand it, i.e. I want to have now Array{n+1,m} or Vector{...}(n+1). How can I do this? 2. I

[julia-users] Re: Realtime Audio Processing with PortAudio.jl

2016-02-22 Thread CrocoDuck O'Ducks
Cool! I will stay updated. Thanks! On Monday, 22 February 2016 07:50:39 UTC, Sebastian Kraft wrote: > > Please only stick to the examples given in the Readme.md file. Single > buffer IO is not working properly, yet. > My current plan is to extend open() so you can pass a callback function > whi