Re: [julia-users] Re: Best way to return many arrays from function

2015-11-17 Thread Adrian Cuthbertson
Or (closer to your question): *julia> **X=myfn()* *([1,2,3],[4,5])* *julia> **a1,a2 = X* *([1,2,3],[4,5])* On Wed, Nov 18, 2015 at 6:56 AM, Adrian Cuthbertson < adrian.cuthbert...@gmail.com> wrote: > You can also just return your (array or any other) variables as a comma > separated list w

Re: [julia-users] Re: Best way to return many arrays from function

2015-11-17 Thread Adrian Cuthbertson
You can also just return your (array or any other) variables as a comma separated list which will return them as a tuple. Then "capture" them again as a tuple on the calling side. E.g julia> myfn() = [1:3],[4:5] myfn (generic function with 2 methods) julia> (x1,x2) = myfn() ([1,2,3],[4,5]) juli

[julia-users] problem running jl files

2015-11-17 Thread Forrest Curo
I have the latest julia version installed on ubuntu and debian partitions on my hard drive. On the ubuntu, I can type [for example]: julia --depwarning=no newbox.jl and that file loads, runs, exits. On the debian, julia comes up in REPL mode and my file seems unrecognized. (Likewise if I stay in

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
OK, forget the earlier stuff. Calculating A'A was a disappointment. Calculating AA' is the reward. First, lets look at the function: function AAtr(sp::SparseMatrixCSC) res = zeros(eltype(sp),sp.m,sp.m) for i=1:sp.n for j=sp.colptr[i]:(sp.colptr[i+1]-1) for k=sp.colptr[

[julia-users] Re: Progress meter for parallel workers

2015-11-17 Thread Benjamin Deonovic
I made a progress meter for parallel runners once in julia about a year ago. I've since stopped using the code but it might inspire you to make something similar: http://pastebin.com/yy1a9RCv On Monday, November 16, 2015 at 10:06:13 AM UTC-6, Tomas Lycken wrote: > > There has been some discussi

[julia-users] Re: Progress meter for parallel workers

2015-11-17 Thread Benjamin Deonovic
I made progress meters for parllel runners about a year ago in Julia using Tk.jl. I've seen stopped using that bit of acode but here is what I have unearthed from the depths: Progress Types type ProgressFrame trace::Bool widget::Tk_Widget functio

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
Embarrassingly, there is yet another bug. while sp.colptr[col+1]=sp.colptr[col2+1] col2+= 1 end res[col,col2] += sp.nzval[i]*sp.nzval[j] end end res end On Wednesday, November 18, 2015 at 4:18:37 AM UTC+2, Dan wrote: > > It works, but it is

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
It works, but it is slow (compared to `full(A'*A)`) On Wednesday, November 18, 2015 at 3:56:31 AM UTC+2, Dan wrote: > > And finally, getting rid of debug print. > > function AtrA(sp::SparseMatrixCSC) > res = zeros(eltype(sp),sp.n,sp.n) > col = 1 > @inbounds for i=1:length(sp.nzval) >

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
And finally, getting rid of debug print. function AtrA(sp::SparseMatrixCSC) res = zeros(eltype(sp),sp.n,sp.n) col = 1 @inbounds for i=1:length(sp.nzval) while sp.colptr[col+1]=sp.colptr[col2+1] col2+= 1 end res[col,col2] += sp.nzval[i]*sp

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
Oops... a bug (which showed itself when matrix was sparser than my previous tests): [when columns where completely empty, the first `if` should have been a `while`] function AtrA(sp::SparseMatrixCSC) res = zeros(eltype(sp),sp.n,sp.n) col = 1 @inbounds for i=1:length(sp.nzval)

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
This is an O(nnz(A)^2) implementation. But, benchmarks will determine the best solution. function AtrA(sp::SparseMatrixCSC) res = zeros(eltype(sp),sp.n,sp.n) col = 1 @inbounds for i=1:length(sp.nzval) if sp.colptr[col+1]==i col+= 1 end col2 = 1

[julia-users] Re: 2-by-2 dense linear system performance

2015-11-17 Thread Pavel
Quite useful, thank you. Essentially choosing the form of exact expression based on matrix element comparison. Appears to be reasonably stable and over 10 times speedup! On Tuesday, November 17, 2015 at 12:57:33 AM UTC-8, Kristoffer Carlsson wrote: > > Maybe this link is of use? http://stackove

[julia-users] Re: Best way to return many arrays from function

2015-11-17 Thread Eric Forgy
Coming from Matlab, I recently had the same question. Have a look at Dict. For speed, you may want to define new types, but for a quick "struct" equivalent, you can try Dict. On Wednesday, November 18, 2015 at 6:37:44 AM UTC+8, Jason McConochie wrote: > > Thank you. Perfect with defining the typ

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
Well, its not as simple as that because of everything being sparse (adding columns is not just a loop over sum). Actually, it would be interesting to see a clever solution. On Wednesday, November 18, 2015 at 2:14:39 AM UTC+2, Dan wrote: > > the columns of A'A when A is sparse are just sparse li

[julia-users] Re: Converting ASCIIString to and from Array{UInt8,1}

2015-11-17 Thread Dan
`convert` is the go-to equivalent in Julia of casting. In this case: uint_array = convert(Vector{UInt8},str) but there are many ways of getting similar results! BTW `convert(ASCIIString,uint_array)` gets back. On Wednesday, November 18, 2015 at 1:49:36 AM UTC+2, James Gilbert wrote: > > Solv

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Dan
the columns of A'A when A is sparse are just sparse linear combinations of columns of A. the coefficients being stored in the column-based sparse matrix representation (internally a vector of coefficients with pointers to new-column indices). so simply generating column by column with a for loop

[julia-users] Re: Converting ASCIIString to and from Array{UInt8,1}

2015-11-17 Thread James Gilbert
Solved! After finding base/ascii.jl I find I can: str = "hello" uint_array = str.data str = ASCIIString(uint_array) though I probably shouldn't be calling str.data outside of the Julia language files...

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread Sheehan Olver
For both non-integer indexing and linrange, it seems that complaints about "hard for newcomers" really mean "hard for newcomers from Matlab". Maybe there should be a MatlabCompat.jl package that restores Matlab behaviour. For some things, this can be done without overloading base: *julia> **

[julia-users] Re: Best way to return many arrays from function

2015-11-17 Thread Jason McConochie
Thank you. Perfect with defining the type after as someArray1::Vector{Float64} On Tuesday, November 17, 2015 at 11:16:08 PM UTC+1, Benjamin Deonovic wrote: > > You can use types: > > type myResult > someArray1::Vector > someArray2::Vector > end > > > > On Tuesday, November 17, 2015 at 4:06:10

Re: [julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Eric Forgy
This is very cool and it should be possible to natively include this inside Atom/Juno.

[julia-users] Re: Best way to return many arrays from function

2015-11-17 Thread Benjamin Deonovic
You can use types: type myResult someArray1::Vector someArray2::Vector end On Tuesday, November 17, 2015 at 4:06:10 PM UTC-6, Jason McConochie wrote: > > In matlab I group arrays into structures such that I can deal with one > variable as the output from the function > e.g. > function o=s

RE: [julia-users] Best way to return many arrays from function

2015-11-17 Thread David Anthoff
Have a look at the NamedTuples package. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Jason McConochie Sent: Tuesday, November 17, 2015 1:26 PM To: julia-users Subject: [julia-users] Best way to return many arrays from function In matlab I group arr

[julia-users] Converting ASCIIString to and from Array{UInt8,1}

2015-11-17 Thread James Gilbert
Hi, I'm just beginning julia, and have written nearly 100 lines of code! Let the stupid question begin: I thought I'd try to implement the equivalent of Perl's tr/// function (or sed's y///) to operate on ASCIIStrings, and I thought an efficient way to code it would be to create a look up table

[julia-users] Best way to return many arrays from function

2015-11-17 Thread Jason McConochie
In matlab I group arrays into structures such that I can deal with one variable as the output from the function e.g. function o=someFunction(in) o.someArray1=[0,0,0,0]; o.someArray2=[1,1,1,1]; end What is the Julia equivalent? Maintaining the efficiency of the contiguous columnar array access

[julia-users] Writing CSV

2015-11-17 Thread digxx
with writedlm("C:\\Users\\Diger\\Documents\\Julia\\x_values.csv",zip(x_s[1,1:end],x[1:end],epsilon[1,1:end,1],omega[300,1:end,1]),',') I wanted to write a csv file comma separated... Now in the manual it says that everything is saved as string, though the last column (omega) is saved as double whi

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread Milan Bouchet-Valat
Le mardi 17 novembre 2015 à 02:46 -0800, Peter Kovesi a écrit : > Thanks Eric. Yes I appreciate that the language is highly flexible > and one can do lots of things. I don't want to get hung up on using > indexing with integer valued floats in particular, my concern is more > philosophical I'm sy

[julia-users] Re: Looking for a few good algorithms

2015-11-17 Thread Douglas Bates
More careful reading of the spmatmul function in base/sparse/linalg.jl provided a method directly downdates the dense square matrix C (i.e. does not form a sparse A'A then downdate) but I still need to form a transpose. If anyone knows of a fast way of forming A'A without creating the transpos

Re: [julia-users] Julia users at SC'15?

2015-11-17 Thread Mark Dewing
Okay, let's meet there.

[julia-users] Julia to ISPC translation, a la @simd

2015-11-17 Thread Damien
Hi all, I've been working on a little project to translate bits of Julia code to Intel's ISPC ( http://ispc.github.io/ ). It's in alpha status with lots of loose bits, but I got the Mandelbrot ISPC example to compile: https://github.com/damiendr/ISPC.jl/blob/master/examples/ISPC-mandelbrot.ipyn

Re: [julia-users] Julia users at SC'15?

2015-11-17 Thread Erik Schnetter
Sounds good. I may be a few minutes late if the BoF session runs over. Let's meet at a more interesting place -- what about poster #65 (HPX), near the division between ballrooms D and G? -erik On Tue, Nov 17, 2015 at 8:50 AM, Mark Dewing wrote: > So you're saying JIT compilation works better t

Re: [julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Tom Breloff
Ok in that case, I'll look into building it into Plots as an "inline backend"... meaning the JSON conversion and html wrapping can just happen directly instead of calling out to an existing package. Honestly, that might turn out to be easier anyways. On Tue, Nov 17, 2015 at 2:11 PM, Randy Zwitch

Re: [julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Randy Zwitch
Uh, I take that back. The latest update to the Plotly package references 0.2.1 and is mostly API calls. I don't time for a whole re-write. https://github.com/plotly/Plotly.jl On Tuesday, November 17, 2015 at 2:00:02 PM UTC-5, Randy Zwitch wrote: > > Plot.ly already has a Julia package, so it see

[julia-users] Looking for a few good algorithms

2015-11-17 Thread Douglas Bates
The short version is: I have a sparse matrix A like julia> m1.R[1,2] 6040x3706 sparse matrix with 1000209 Float64 entries: [1 ,1] = 0.0874371 [6 ,1] = 0.0765784 [8 ,1] = 0.0558497 [9 ,1] = 0.0635299 [10 ,1] = 0.0333554

Re: [julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Randy Zwitch
Plot.ly already has a Julia package, so it seems like just a matter of not calling the API and instead doing the JS calls. I think the bigger question is whether the company has a plan to update their package yet. I'd (probably) be interested in fixing the package, assuming it didn't take hours

Re: [julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Tom Breloff
This is great! For those involved with Plotly.jl, Vega.jl, Bokeh.jl, or anything else with similar technology, are there any major hurdles in accessing this from Julia? On Tue, Nov 17, 2015 at 1:04 PM, Hans-Peter wrote: > See announcement: https://plot.ly/javascript/open-source-announcement/. >

[julia-users] Interesting: Plotly has become open source

2015-11-17 Thread Hans-Peter
See announcement: https://plot.ly/javascript/open-source-announcement/. I only used PyPlot so far but this sounds interesting. Offline 'plotly plotting' without api key should be possible now.

[julia-users] Re: Creating a stable version of Julia + Packages for a semester long course?

2015-11-17 Thread Viral Shah
While not directly relevant right away, one idea that we have mulled over is the possibility of people having their own METADATA snapshots or even completely private METADATAs. This is just a thought, and there may be better ways to do this. We have this same problem maintaining JuliaBox. 0.3

Re: [julia-users] linspace-like range generators and keyword ordering

2015-11-17 Thread MA Laforge
Thanks for clarifying that Josh. I thought my issues were because of a subtlety of Julia's type system that I did not understand.

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
Right, way simpler like that. I did the PR but I insist that the bit I learned is not enough to make a good description improvement (maybe next time) terça-feira, 17 de Novembro de 2015 às 17:03:49 UTC, Tim Holy escreveu: > > Hmm, it seems the "easy way" has been removed from the docs. Anyone kno

Re: [julia-users] Creating a stable version of Julia + Packages for a semester long course?

2015-11-17 Thread Viral Shah
Various classes are using JuliaBox now. There are occasional hiccups, but they are much fewer nowadays. If you do use JuliaBox, we'll be happy to support in any way we can. Also, the JuliaBox local install is a good way forward if it is not a large class. It will work on one big shared memory m

Re: [julia-users] linspace-like range generators and keyword ordering

2015-11-17 Thread MA Laforge
Thanks Matt, I kind of like the explicit nature of "Exactly". I will have to let the idea sink in a bit more.

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread Tim Holy
Hmm, it seems the "easy way" has been removed from the docs. Anyone know why? Now I see why this request might have seemed onerous. Short answer: you can just do it in your web browser, just click on the "pencil icon" near the upper right when browsing any file in the source tree. Edit the docs

Re: [julia-users] Anyone interested in H20.ai package?

2015-11-17 Thread Randy Zwitch
https://github.com/randyzwitch/H2O.jl/issues/1 On Tuesday, November 17, 2015 at 11:03:23 AM UTC-5, Randy Zwitch wrote: > > I guess it depends on how you look at it, but I was using the Requests > library (which uses HttpParser). So we wouldn't have to deal with the > BinDeps issue explicitly, bu

Re: [julia-users] how to reset variables

2015-11-17 Thread Stefan Karpinski
Since the julia-opt mailing list exists and is a much more targeted venue for questions about optimization, would you mind asking such questions there instead? I suspect you're more likely to get useful answers as well. On Tue, Nov 17, 2015 at 11

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
I don't want to be seam ungrateful nor very dumb but do you think one can learn how to make a doc fix by reading? https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation I happen to hav

[julia-users] how to reset variables

2015-11-17 Thread Michela Di Lullo
Hello, I solve my model to find a LP solution, then I want to renew a binary constraint, then *reset* all the variables and solve the model again with some found violated constraints. How do I *reset *variables? Thank you for any info, Michela

Re: [julia-users] Anyone interested in H20.ai package?

2015-11-17 Thread Randy Zwitch
I guess it depends on how you look at it, but I was using the Requests library (which uses HttpParser). So we wouldn't have to deal with the BinDeps issue explicitly, but it's still there. I don't really care about the licensing, so making it Apache is no big deal to me. I'll write up my note

Re: [julia-users] Anyone interested in H20.ai package?

2015-11-17 Thread Christof Stocker
Funny coincidence. I have been playing around with its REST API recently. I was thinking of mirroring the R package (and thus have a more or less identical interface), which is Apache licensed and is really nice to use. I did, however, have two concerns that discouraged me. My main concern is t

Re: [julia-users] Re: Creating a stable version of Julia + Packages for a semester long course?

2015-11-17 Thread Zheng Wendell
Just curious about when JIT compiles the code during the runtime, at what directory it stores? On Mon, Nov 16, 2015 at 10:33 PM, Sheehan Olver wrote: > I guess if the students are limited to the pre-assigned packages all > running on the same machine, then the cache can be shared and the Pkg.bui

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread Tim Holy
On Tuesday, November 17, 2015 07:23:03 AM J Luis wrote: > I know Tim, but honestly I don't feel knowledge'd enough to submit a doc > improvement for a function that half an hour ago I could not even know how > to make it work. But now you do! It's a fair exchange: get help on the mailing list, the

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
I know Tim, but honestly I don't feel knowledge'd enough to submit a doc improvement for a function that half an hour ago I could not even know how to make it work. Joaquim terça-feira, 17 de Novembro de 2015 às 15:16:52 UTC, Tim Holy escreveu: > > On Tuesday, November 17, 2015 07:03:05 AM J L

Re: [julia-users] Module documentation not formatting properly

2015-11-17 Thread Tim Holy
Works for me on 0.4.1. What release are you on? --Tim On Tuesday, November 17, 2015 06:50:37 AM NotSoRecentConvert wrote: > Is there a special way of documenting a module and its functions? > > When I document the module itself I am able to get full markdown formatting > but when I move on to th

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread Tim Holy
On Tuesday, November 17, 2015 07:03:05 AM J Luis wrote: > Yes, it works thanks. But man we are not supposed to be wizards when > reading the docs. Submit a doc fix? https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation --Tim > > terça-feira, 17 de Novembro de 2

[julia-users] Anyone interested in H20.ai package?

2015-11-17 Thread Randy Zwitch
I've been using H2O quite a bit at work, because it does a few things well (I mostly use it for random forest and GBM) and is easy to use. I talked with the company at length about creating a Julia package and the company is supportive of open-source contributions, so I created a stump of a pac

[julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
Yes, it works thanks. But man we are not supposed to be wizards when reading the docs. terça-feira, 17 de Novembro de 2015 às 14:36:39 UTC, randm...@gmail.com escreveu: > > > julia> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"]) > > should do the trick. The docs at least imply th

[julia-users] Module documentation not formatting properly

2015-11-17 Thread NotSoRecentConvert
Is there a special way of documenting a module and its functions? When I document the module itself I am able to get full markdown formatting but when I move on to the functions it will do the title but the rest defaults to code formatting despite all of my efforts. "# Test `This` will work."

[julia-users] Re: How does 'find_library' works?

2015-11-17 Thread randmstring
julia> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"]) should do the trick. The docs at least imply that both arguments should be vectors -- for one because of the plural and locations is supposed to be a list. Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis: > > The

[julia-users] How does 'find_library' works?

2015-11-17 Thread J Luis
The doc julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") ERROR: MethodError: `find_library` has no method matching find_library(::ASCIIString, ::ASCIIString) you may have intended to impor

[julia-users] Re: Julia #1 on Hacker News

2015-11-17 Thread André Lage
Congratulations! Here goes the link at moore.org: https://www.moore.org/newsroom/press-releases/2015/11/10/bringing-julia-from-beta-to-1.0-to-support-data-intensive-scientific-computing André Lage. On Sunday, November 15, 2015 at 12:37:14 PM UTC-3, Mauro wrote: > > The Moore Foundation's sponso

Re: [julia-users] Julia users at SC'15?

2015-11-17 Thread Mark Dewing
So you're saying JIT compilation works better than JIT meetings :) How about meeting tonight (Tuesday) at 7:00 and getting some food? (gathering place TBD - maybe by SC registration?) Mark On Monday, November 16, 2015 at 6:46:03 PM UTC-6, Eric Forgy wrote: > > Way to plan ahead guys :D > > On T

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread elextr
On Tuesday, November 17, 2015 at 10:34:03 PM UTC+10, Mauro wrote: > > Julia tries, and I think succeeds, in solving the two language problem. > The two language problem being that one uses one language for most > things but drops down to a fast language for bottlenecks and/or one > language to

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread Mauro
Julia tries, and I think succeeds, in solving the two language problem. The two language problem being that one uses one language for most things but drops down to a fast language for bottlenecks and/or one language to prototype one for production. This means that Julia has to cater to a wide rang

[julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread Christoph Ortner
Hi Peter, I've had multiple discussions along similar lines over the past year, since I started coding in Julia. I think I lost every single argument. Personally, I think you are right and I think this is an important issue. However, Julia is open source, so the decisions are made by those who

[julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread Peter Kovesi
Thanks Eric. Yes I appreciate that the language is highly flexible and one can do lots of things. I don't want to get hung up on using indexing with integer valued floats in particular, my concern is more philosophical For much of what I do I am wanting to solve some technical problem within

[julia-users] customizing a fast binary spy() function

2015-11-17 Thread Joachim Dahl
I am analyzing a dataset of sparse matrices, and would like to generate plots of the sparsity patterns using Gadfly. By reading different posts, I've come up with this approach: using Gadfly n = 1000 A = sparse(tril(ones(n,n))) is, js = findn(A) draw(PNG("myplot.png",10cm,10cm), plot(x

[julia-users] Re: sparse rank, sparse nullspace, sparse linear algebra over rationals?

2015-11-17 Thread ming . chau
hello, getting the rank of a huge sparse matrix is mathematically difficult http://math.stackexchange.com/questions/554777/rank-computation-of-large-matrices bests, M. Le lundi 16 novembre 2015 22:12:04 UTC+1, Laurent Bartholdi a écrit : > > Hello world, > I'm new at julia, and trying it out as

[julia-users] 2-by-2 dense linear system performance

2015-11-17 Thread Kristoffer Carlsson
Maybe this link is of use? http://stackoverflow.com/a/10188318

[julia-users] 2-by-2 dense linear system performance

2015-11-17 Thread Kristoffer Carlsson
Maybe this link is of use? http://stackoverflow.com/a/10188318