Re: [julia-users] I noticed there is no do while loop

2014-04-08 Thread Cameron McBride
I've long enjoyed ruby's `loop` keyword for exactly this type of use. Cameron On Tue, Apr 8, 2014 at 4:28 PM, Stefan Karpinski ste...@karpinski.orgwrote: Eh, doesn't seem that hard to write `while true` and `while` by itself is kind of confusing. I also don't necessarily think this is how

[julia-users] Selectively read text columns into vectors?

2014-04-10 Thread Cameron McBride
Greetings, Does this exist somewhere in base and/or DataFrames: the ability to read only selected columns from some text input? Ideally, you could have each output vector of a different type (Float64, Int, etc.). (So it differs from readdlm() in philosophy.) A minimal implementation is below

Re: [julia-users] All packages for numerical math

2014-04-23 Thread Cameron McBride
Or you can use the non-vectorized version and save the overhead of the temporary arrays being created by the addition and multiplication steps. function trapz{T:Real}(x::Vector{T}, y::Vector{T}) local len = length(y) if (len != length(x)) error(Vectors must be of same length)

Re: [julia-users] All packages for numerical math

2014-04-24 Thread Cameron McBride
On Thu, Apr 24, 2014 at 4:28 AM, Hans W Borchers hwborch...@gmail.comwrote: function trapz2{T:Number}(x::Vector{T}, y::Vector{T}) local n = length(x) if (length(y) != n) error(Vectors 'x', 'y' must be of same length) end if n == 1; return 0.0;

Re: [julia-users] Re: Julia Hack Nights?

2014-04-29 Thread Cameron McBride
On Tue, Apr 29, 2014 at 2:13 PM, Iain Dunning iaindunn...@gmail.com wrote: Nothing has really been happening in Cambridge more often than those. What exactly is a hack night? All I had in mind was an informal meeting where there is work on something julia for the evening (an hour or two or

Re: [julia-users] Re: Julia Hack Nights?

2014-04-30 Thread Cameron McBride
believe Cameron mentioned to me May 9 as a possibility. Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intelligence Laboratory On Tue, Apr 29, 2014 at 3:31 PM, Cameron McBride cameron.mcbr...@gmail.com wrote: On Tue, Apr 29, 2014 at 2:13 PM, Iain Dunning

Re: [julia-users] Re: A Big Data stress test

2014-04-30 Thread Cameron McBride
If there is some desire for big data tests, there is a fair number of public astronomical datasets that wouldn't be too hard to package up. The catalog level versions aren't too different than the type of dataset metioned by Doug. There are a number of fairly simple analyses that could be done on

Re: [julia-users] style question about Float initialization

2014-05-01 Thread Cameron McBride
Would linked lists be a more natural storage for these events? On Thursday, May 1, 2014, Ethan Anderes ethanande...@gmail.com wrote: Oop the second line of the code block should read chain = Array{Float64,1}[theta_init]

Re: [julia-users] style question about Float initialization

2014-05-01 Thread Cameron McBride
Is there an idiomatic Julian way to deal with these cases without a large pre-allocation or push? I understand why your suggestion here would be faster than the original. This application aside, I see a lot of push!() usage in some of the libs (eg saving state in Optim.jl, readdlm in base, etc).

[julia-users] Julian way to write longer if/elseif/else clauses?

2014-05-02 Thread Cameron McBride
I'm still trying to settle into proper syntax and style, and all comments are welcome! For potentially longer if / elseif / else clauses, e.g. # an overly simplistic example if ndims(wt) == 2 println(Matrix stuff) elseif ndims(wt) == 1 println(Vector stuff) else

Re: [julia-users] Julian way to write longer if/elseif/else clauses?

2014-05-02 Thread Cameron McBride
Excellent. Thanks to both of you! Cameron On Fri, May 2, 2014 at 11:11 AM, Kevin Squire kevin.squ...@gmail.comwrote: On Friday, May 2, 2014, Cameron McBride cameron.mcbr...@gmail.com wrote: I'm still trying to settle into proper syntax and style, and all comments are welcome

Re: [julia-users] Re: Julian way to write longer if/elseif/else clauses?

2014-05-07 Thread Cameron McBride
your example. https://github.com/one-more-minute/Lazy.jl#macros On Friday, 2 May 2014 15:11:08 UTC+1, Cameron McBride wrote: I'm still trying to settle into proper syntax and style, and all comments are welcome! For potentially longer if / elseif / else clauses, e.g. # an overly simplistic

Re: [julia-users] for loops

2014-05-15 Thread Cameron McBride
I missed enumerate() for a while, and was happy I found it. I find it amusing how satisfying a few missing keystrokes can be. On a related but different note, from a similar influence, I keep wanting to pass blocks to iterators. Any chance that will ever happen? I realize that do..end blocks

Re: [julia-users] for loops

2014-05-15 Thread Cameron McBride
(args...)) You could always open a pull request if you wanted to see this in Base, too. On Thursday, 15 May 2014 21:18:31 UTC+1, Cameron McBride wrote: I missed enumerate() for a while, and was happy I found it. I find it amusing how satisfying a few missing keystrokes can

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Cameron McBride
I am not sure if this appeals to you, but I'm happy to share my configuration. I just use the REPL and a decent editor (vim), which I'm happy with. I've been using this setup for the past couple months (mid-March). I've only had occasionally issues, but I follow HEAD so that is expected. I am

Re: [julia-users] for loops

2014-05-17 Thread Cameron McBride
Stefan, Thank you. Your description really helps clarify things. The issue about different functionality for return in map vs for loops was obviously something I overlooked here. And yes, the influence is clearly ruby. I see how a macro could can duplicate the for loop structure. I guess I'm a

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-18 Thread Cameron McBride
Hi Jon, No -- I pull julia via git on github, and compile by hand every few days. I've symlinked ~/bin/julia to the directory that I compile julia into, so julia is in my path. On 10.9, the native option is Clang, which works fine.. I've been able to dodge gcc (gnu) for all system dependencies

Re: [julia-users] Benchmarking study: C++ Fortran Numba Julia Java Matlab the rest

2014-06-17 Thread Cameron McBride
Do any of the more initiated have an idea why Numba performs better for this application, as both it and Julia use LLVM? I'm just asking out of pure curiosity. Cameron On Tue, Jun 17, 2014 at 10:11 AM, Tony Kelman t...@kelman.net wrote: Your matrices are kinda small so it might not make much

Re: [julia-users] how use find ?

2014-07-12 Thread Cameron McBride
julia find( a . 5 ) cheers, Cameron On Sat, Jul 12, 2014 at 11:40 AM, paul analyst paul.anal...@mail.com wrote: I need all indexes where a[:] 5 julia a=rand(10)*10 10-element Array{Float64,1}: 4.84005 8.29994 8.8531 3.42319 2.60318 7.25313 0.816263 4.44463 6.71836

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread Cameron McBride
in the REPL, would it be reasonable to have ?? be able to do an apropos() search? Cameron On Fri, Jul 18, 2014 at 4:40 PM, Viral Shah vi...@mayin.org wrote: I think that most new users are unlikely to know about apropos. Perhaps we should put it in the julia banner. We can say something

Re: [julia-users] build-in function to find inverse of a matrix

2014-07-22 Thread Cameron McBride
+1 for sticky shell mode. I do like the ? - help and ?? - apropos mapping, as it's clear on the mode what the simple mapping is. But it's a minor point. Cameron On Tue, Jul 22, 2014 at 12:06 AM, Viral Shah vi...@mayin.org wrote: That’s not a crazy idea. ? could do help if there is an exact

Re: [julia-users] Re: Have Julia send an email (or sound) when code is done

2014-09-18 Thread Cameron McBride
On Thu, Sep 18, 2014 at 1:44 PM, Jake Bolewski jakebolew...@gmail.com wrote: Yo.jl I thought this was a joke, but naturally, it does exist: https://github.com/dichika/Yo.jl Also, not really a julia question -- the stata trick should work just as well on julia (or anything that goes before the

[julia-users] julia style to resize array with initialization?

2015-10-26 Thread Cameron McBride
Hi All, What's the best julian way to do the following: function vecadd!(vec, i, v) n = length(vec) if n < i resize!(vec, i) vec[n+1:i] = 0.0 end vec[i] += v end This seems somewhat typical for a growing array that's not just incremental (i.e. not just a push!()

Re: [julia-users] Re: julia style to resize array with initialization?

2015-10-27 Thread Cameron McBride
9147. I feel > like this falls into that same category of questions. > > On Mon, Oct 26, 2015 at 3:59 PM, Josh Langsfeld <jdla...@gmail.com> wrote: > >> You could do 'append!(vec, zeros(i-n))'. >> >> >> On Monday, October 26, 2015 at 3:32:56 PM UTC-4, Camero

Re: [julia-users] Re: dictionaries of sets -- or arrays of sets

2016-01-04 Thread Cameron McBride
Also, in the REPL you can use the help files. For example, try typing "?∈" (which shows this is basically the in() function, hence the \inTAB suggestion by Kristoffer). Cameron On Mon, Jan 4, 2016 at 12:59 PM, Kristoffer Carlsson wrote: > You can enter \in and then press

Re: [julia-users] Re: JuliaCon birds of a feather

2016-06-22 Thread Cameron McBride
Sounds like a good plan -- seems an interesting topic given a number of relevant talks today. Cameron On Wed, Jun 22, 2016 at 1:19 PM, Tom Breloff wrote: > For those at JuliaCon today, I'm organizing a dinner to discuss "The > future of Machine Learning and Data Science in

Re: [julia-users] using in try catch block

2016-06-27 Thread Cameron McBride
On Mon, Jun 27, 2016 at 1:02 PM, Yichao Yu wrote: > > On Jun 27, 2016 12:58 PM, "Tom Breloff" wrote: > > > > Yichao: is there an alternative "is_installed" definition that would check the load path? Lets assume I don't actually want to import it, just check.

[julia-users] Julia command line usage: tool versus library

2016-03-30 Thread Cameron McBride
Simple question (I think): Is there an easy or idiomatic way to differentiate if a julia file is being run directly from when it's included? I'm looking for the equivalent of this in ruby: if $0 == __FILE__ puts "Running file" else puts "Included file" end Thanks. Cameron

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
.5 -e 'include("example.jl")' > > Included file > > > On Friday, April 1, 2016 at 7:40:36 AM UTC-5, James Fairbanks wrote: >> >> What kind of production system is it? Why is it inconvenient to have two >> files, one that defines the library and one that pa

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
> and calls the "main" function? > > On Friday, April 1, 2016 at 8:21:03 AM UTC-4, Cameron McBride wrote: >> >> Thanks, I missed that thread. >> >> Although neither suggested solution works as I was hoping for. >> >> I am trying to shoehorn julia

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Cameron McBride
is thread > https://groups.google.com/d/msg/julia-users/ufpi8tV7sk8/-Uv0rtAWTWsJ > > > On Wednesday, March 30, 2016 at 2:37:44 PM UTC-4, Cameron McBride wrote: >> >> Simple question (I think): Is there an easy or idiomatic way to >> differentiate if a julia file is bei

Re: [julia-users] Composite Type Array

2016-07-22 Thread Cameron McBride
On Fri, Jul 22, 2016 at 3:09 PM, Cameron McBride <cameron.mcbr...@gmail.com> wrote: > julia> function get_event(v::Vector{ExampleEvent}, i) > n = length(v) > if i > n >for j in n:i >push!(v, ExampleEvent("

Re: [julia-users] When Julia v1.0 will be released?

2016-07-07 Thread Cameron McBride
> For industry, it probably means something similar. > > > I really hope people in industry won't act on this date, as it is not > nearly firm enough to bet a business on. We already have people writing > blog posts about how using Julia for their startup turned out to be a > mistake; we really

[julia-users] Re: [julia-dev] Convert a dense matrix A into a sparse matrix with sparsevec(A)

2016-09-09 Thread Cameron McBride
This thread is old, but I was poking through some unread bits and found it. Beyond that, it’s likely a better question for julia-users list (which I’m including here). Anyhow, the answer is that sparsevec converts a dense matrix into a sparse matrix format where zero values are not explicitly

Re: [julia-users] so many plotting packages

2016-10-28 Thread Cameron McBride
There is some work on this. On your list is Plots.jl, which is a unifying package that is backend agnostic. Specifically, http://github.com/tbreloff/Plots.jl Also, see: https://github.com/JuliaPlots Some seriously great stuff in there (and I say that as a user that has been plotting in Julia for

Re: [julia-users] matrix multiplications

2016-10-18 Thread Cameron McBride
You mean like the following? julia> A=[1.0 2.0; 3.0 4.0]; B=[1.0 1.0; 1.0 1.0]; Y = similar(B); Y.= A * B This doesn’t work as you might hope. I believe it just creates a temporary result of A*B and then stuffs it into the preexisting Y. On Tue, Oct 18, 2016 at 2:41 PM, Jérémy Béjanin

Re: [julia-users] matrix multiplications

2016-10-19 Thread Cameron McBride
I agree on the consistency part with other in-place operations. I certainly don’t feel it’s hard to just use A_mul_B!, but my familiarity with BLAS shouldn’t be taken for granted. And if an in-place operator syntax exists in the language already… How about the flip side of the argument, it

Re: [julia-users] Can't add PostgreSQL

2016-05-04 Thread Cameron McBride
I've been using PostgreSQL and DBI just fine for a few months now. The implementation has a few edges that need polishing and work, but the basics work just fine for the julia 0.4.x branch. The problem you ran into with fetchdf() not being implemented is that you tried to run it on the stmt