[julia-users] Re: Calling Julia from .NET

2014-10-06 Thread Tony Kelman
It should probably be noted in this thread that Julia master can now be compiled using Visual Studio (2013, only really tested with 64 bit so far since I still need to build new LLVM binaries for 32 bit), see https://github.com/JuliaLang/julia/pull/7761 for instructions and more information. It

[julia-users] Re: parametrized type weirdness? or Julia bug?

2014-10-06 Thread Jutho
I don't see the problem regarding point one. A type with parameters, as your SortedDict{D,K}, becomes an abstract type when the parameters are unspecified, e.g. SortedDict, but this is indeed printed/formatted with unspecified parameters put back (I guess with the name as you defined them), e.g

[julia-users] Re: Not fun

2014-10-06 Thread JVaz
Thanks everybody! I think this will do the trick.

[julia-users] parametrized type weirdness? or Julia bug?

2014-10-06 Thread vavasis
The code below is an excerpt from a more complicated code I am writing. It contains a parametrized type in which the parameter is itself another parametrized type. I have attached the printout (0.4.0-dev+323). Notice the error message at the end. My questions are: (1) How is it possible that

[julia-users] iterating through permutations in parallel

2014-10-06 Thread Jason Solack
Hello everyone, I'm trying to iterate through a collection of permutations in parallel and i'm having trouble iterating through the collection. In the code below i'm using "next(p)" in the place i'd like to grab the next permutation. This is also the first bit of processing i've done in paral

[julia-users] help debugging too many files open

2014-10-06 Thread ggggg
I'm getting an error claiming I have too many files open. I've already gone through my code and tried to ensure every open is matched by a close, and continue to get the error, suggesting that I missed an open. Is there a way I can check how many files are open, so I can see where in my code

Re: [julia-users] Re: Benchmarking julia parallel computing

2014-10-06 Thread Ben Arthur
thanks for your post erik. could you please elaborate why Julia does not scale well to larger clusters? also, what would it take to get Julia to utilize InfiniBand were it available. thanks, ben On Wednesday, October 1, 2014 12:26:11 PM UTC-4, Erik Schnetter wrote: > > For example, when run

[julia-users] passing additional parameters to DArray init function

2014-10-06 Thread Andre Bieler
with the syntax defined in the user manual for distributed arrays: DArray(init, dims[, procs, dist]) is there a way to have the init function accept additional parameters? so instead of having function init(I) #do something end but function init(I, a, b) #do something end or should I simp

[julia-users] passing additional arguments to DArray init function

2014-10-06 Thread Andre Bieler
with the syntax defined in the user manual for distributed arrays: DArray(init, dims[, procs, dist]) is there a way to have the init function accept additional parameters? so instead of having function foo(I) do something end but function foo(I, a, b) do something end or should I

Re: [julia-users] Not fun

2014-10-06 Thread Stefan Karpinski
Well, we're planning on merging ASCIIString and UTF8String so that only UTF8String exists. There are also other string types where index = character, such as UTF-32. On Mon, Oct 6, 2014 at 2:23 PM, Johan Sigfrids wrote: > Would it not be possible to only define indexing on ASCIIString? >

Re: [julia-users] Not fun

2014-10-06 Thread Johan Sigfrids
Would it not be possible to only define indexing on ASCIIString?

[julia-users] help with generation of sparse matrix

2014-10-06 Thread Andrei Berceanu
I have written the following Julia code to build a sparse matrix of dimension N^2xN^2 https://gist.github.com/berceanu/fe7e26840637517383d8 The code works (probably in a very suboptimal way) for small enough matrices, but for example if I set N=1000, genspmat(1000) quickly eats up my RAM and c

Re: [julia-users] names tuples or equivalent

2014-10-06 Thread John Myles White
Use a Dict. -- John On Oct 6, 2014, at 10:37 AM, Tamas Papp wrote: > Possibly -- I don't know Julia that well. Still, my understanding is > that code like > > --8<---cut here---start->8--- > type MyResult > a > b > end > > function foo() > MyResult(1,2

Re: [julia-users] Not fun

2014-10-06 Thread John Myles White
If you know you're only dealing with ASCII, I think you're much better operating on an array of Uint8. -- John On Oct 6, 2014, at 10:35 AM, Stefan Karpinski wrote: > On Mon, Oct 6, 2014 at 1:11 PM, John Myles White > wrote: > FWIW, I actually think strings shouldn't define indexing at all:

Re: [julia-users] names tuples or equivalent

2014-10-06 Thread Tamas Papp
Possibly -- I don't know Julia that well. Still, my understanding is that code like --8<---cut here---start->8--- type MyResult a b end function foo() MyResult(1,2) end function bar(result) result.a end --8<---cut here---end

Re: [julia-users] Solving sparse triangular systems

2014-10-06 Thread Douglas Bates
On Monday, October 6, 2014 12:31:17 PM UTC-5, Andreas Noack wrote: > > There are fwdTriSolve! and bwdTriSolve! in linalg/sparse.jl, but there are > not A_ldiv_B!(Triangular{SparsesCSC}, StridedVector) versions yet, but they > should be fairly easy to add. > Thanks, Andreas. I thought I had seen

Re: [julia-users] Not fun

2014-10-06 Thread Stefan Karpinski
On Mon, Oct 6, 2014 at 1:11 PM, John Myles White wrote: > FWIW, I actually think strings shouldn't define indexing at all: they > should only define iteration. > There's a pretty strong argument to be made for that. The fact that you can pretend that indices = characters if you happen to only ca

Re: [julia-users] Solving sparse triangular systems

2014-10-06 Thread Andreas Noack
There are fwdTriSolve! and bwdTriSolve! in linalg/sparse.jl, but there are not A_ldiv_B!(Triangular{SparsesCSC}, StridedVector) versions yet, but they should be fairly easy to add. Med venlig hilsen Andreas Noack 2014-10-06 13:06 GMT-04:00 Douglas Bates : > Is there an existing method for solvi

[julia-users] help with macro and splicing

2014-10-06 Thread Toivo Henningsson
You will need to escape those expressions or macro hygiene will rename some of the symbols in the code.

Re: [julia-users] Not fun

2014-10-06 Thread John Myles White
FWIW, I actually think strings shouldn't define indexing at all: they should only define iteration. -- John On Oct 6, 2014, at 10:10 AM, John Myles White wrote: > It's dangerous because strings aren't arrays of bytes: they're sequences of > codepoints. So you can't safely modify a string (w

Re: [julia-users] Re: Not fun

2014-10-06 Thread John Myles White
It's dangerous because strings aren't arrays of bytes: they're sequences of codepoints. So you can't safely modify a string (which is part of the reason they're immutable) without rewriting the whole string and you can't find a character in a sequence without reading the whole sequence. Another

[julia-users] Solving sparse triangular systems

2014-10-06 Thread Douglas Bates
Is there an existing method for solving sparse triangular systems - taking advantage of the sparseness and the triangularity? It seems that with the templated Triangular type taking the matrix type as well as the element type it should be straightforward to create a Triangular{Float64,SparseMat

[julia-users] Re: Not fun

2014-10-06 Thread David P. Sanders
El lunes, 6 de octubre de 2014 11:56:36 UTC-5, David P. Sanders escribió: > > > > El lunes, 6 de octubre de 2014 03:01:07 UTC-5, JVaz escribió: >> >> Hello, I am new in Julia and it's the first time I publish here, but I >> actually would find it useful to modify a string. For example, I want to

[julia-users] Re: Not fun

2014-10-06 Thread David P. Sanders
El lunes, 6 de octubre de 2014 03:01:07 UTC-5, JVaz escribió: > > Hello, I am new in Julia and it's the first time I publish here, but I > actually would find it useful to modify a string. For example, I want to do: > > string = "ACTGACTG" > string[3] = A--> (error) > There is no particul

RE: [julia-users] names tuples or equivalent

2014-10-06 Thread David Anthoff
It would be nice to have something like anonymous types (like in C#) for this situation. Although, if I remember correctly, one couldn't return them from a function, but not sure if that was for a fundamental reason or not. In any case, without having thought much about it, I would certainly love s

Re: [julia-users] Re: Not fun

2014-10-06 Thread Daniel Høegh
I know it's slow but is it considered dangerous then please enlighten me. Can it not be acceptable to some extend to sacrifice speed to simplicity, people will do this trick or maybe worse things.

Re: [julia-users] Re: Not fun

2014-10-06 Thread Stefan Karpinski
Yeah, I'm not convinced this is something we want to encourage. On Mon, Oct 6, 2014 at 12:07 PM, John Myles White wrote: > Indexing into strings is a either a slow or a dangerous way to live one's > life. > > -- John > > On Oct 6, 2014, at 9:05 AM, Daniel Høegh wrote: > > > Would it not make s

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

2014-10-06 Thread Florian Oswald
If I may, I've got an implementation of linear interpolation that I'm quite happy with. It uses a GSL kind of "accelerator" that remembers the index position of the last evaluation. the binary search for the correct bracket of x in the grid is the main bottleneck in my experience. So taking adv

Re: [julia-users] Re: Not fun

2014-10-06 Thread John Myles White
Indexing into strings is a either a slow or a dangerous way to live one's life. -- John On Oct 6, 2014, at 9:05 AM, Daniel Høegh wrote: > Would it not make sense to define replace for Int's and ranges like this? > replace(s::String, index::Int, r) = string(s[1:index-1]) * string(r) * > string

Re: [julia-users] Re: Not fun

2014-10-06 Thread Daniel Høegh
Would it not make sense to define replace for Int's and ranges like this? replace(s::String, index::Int, r) = string(s[1:index-1]) * string(r) * string(s[index+1:end]) replace(s::String, range::UnitRange{Int}, r) = string(s[1:first(range)-1]) * string(r) * string(s[last(range)+1:end])

Re: [julia-users] names tuples or equivalent

2014-10-06 Thread John Myles White
I think you're underselling (1), which provides the compiler with exactly the kind of information it needs to generate extremely efficient code while also providing names. -- John On Oct 6, 2014, at 8:44 AM, Tamas Papp wrote: > Hi, > > AFAIK tuples are the recommended way to return multiple

[julia-users] names tuples or equivalent

2014-10-06 Thread Tamas Papp
Hi, AFAIK tuples are the recommended way to return multiple values from a function, but this requires that the programmer remembers the order of values. I am wondering what the correct idiom is for returning key/value pairs, similarly to alist/plist in Common Lisp. I have considered the following

Re: [julia-users] problem with dataframes.Index when loading JLD dataset

2014-10-06 Thread John Myles White
Index is a data structure like a hash table that maps column names to column indices. It's defined in DataFrames. -- John On Oct 6, 2014, at 8:38 AM, Florian Oswald wrote: > Hi all, > > I'm currently trying to work out why I get an error when trying to load a > dict with several dataframes

[julia-users] problem with dataframes.Index when loading JLD dataset

2014-10-06 Thread Florian Oswald
Hi all, I'm currently trying to work out why I get an error when trying to load a dict with several dataframes in it with HDF5, JLD, see https://github.com/timholy/HDF5.jl/issues/158 which results in this error: *ERROR: stored type DataFrames.Index does not match currently loaded type* I just

Re: [julia-users] Re: Not fun

2014-10-06 Thread Michael Hatherly
Yeah :) I've never actually relied on that for anything important.

Re: [julia-users] Re: Not fun

2014-10-06 Thread Stefan Karpinski
Your code will almost certainly break in the 0.4 version of Julia if you do that. On Mon, Oct 6, 2014 at 10:45 AM, Michael Hatherly wrote: > You can (if you *really* have to) mutate a String by directly accessing > it’s data field like so: > > julia> s = "ACTGACTG" > julia> s.data[3] = 'A' > > Y

[julia-users] Re: Not fun

2014-10-06 Thread Michael Hatherly
You can (if you *really* have to) mutate a String by directly accessing it’s data field like so: julia> s = "ACTGACTG" julia> s.data[3] = 'A' You’ll run into problems if the characters aren’t all the same size though: julia> a = "∀ x ∈ X" julia> a.data 11-element Array{Uint8,1}: 0xe2 0x88

Re: [julia-users] Re: Not fun

2014-10-06 Thread Stefan Karpinski
I think this thread already covers the issue pretty thoroughly. s = string(s[1:2], "A", s[4:end]) Note that using "string" as a variable name is not advised since it's a function name. On Mon, Oct 6, 2014 at 4:01 AM, JVaz wrote: > Hello, I am new in Julia and it's the first time I publish her

[julia-users] Re: Not fun

2014-10-06 Thread JVaz
Hello, I am new in Julia and it's the first time I publish here, but I actually would find it useful to modify a string. For example, I want to do: string = "ACTGACTG" string[3] = A--> (error) And I cannot use replace because I don't wanna change all the T, I just wanna change the third cha

Re: [julia-users] Re: help with macro and splicing

2014-10-06 Thread Jacob Quinn
See the open issue here: https://github.com/JuliaLang/julia/issues/7669 On Mon, Oct 6, 2014 at 8:58 AM, Ivar Nesje wrote: > I think this is a parser limitation, rather than a bug in your macro. The > problem is that @invisible(a=1) is parsed as a function call with a keyword > argument, not as a

[julia-users] ANN: LogParser.jl

2014-10-06 Thread Randy Zwitch
Just a heads-up that I pushed LogParser.jl to METADATA this weekend. This package is somewhat small at the moment, providing just a single function for parsing Apache Server logs and providing a DataFrame method to work with the data in a tabular format. While my regex is specifically tailored

[julia-users] Re: help with macro and splicing

2014-10-06 Thread Ivar Nesje
I think this is a parser limitation, rather than a bug in your macro. The problem is that @invisible(a=1) is parsed as a function call with a keyword argument, not as an assignment expression. You can do substitute ex.head == :kw with ex.head = :(=) in the macro, but it seems like the wrong plac

[julia-users] Re: Julia LightTable and path to file

2014-10-06 Thread Daniel Høegh
You can circumvent the problem by inserting this in the top of a script/file: cd(dirname(@__FILE__)) Den søndag den 5. oktober 2014 22.18.55 UTC+2 skrev will ship: > > Using readcsv("filename.csv") to get data into an array. > This works with iJulia if the files are in the same directory. > A

[julia-users] Re: Getting at an array of C strings in a callback function?

2014-10-06 Thread Stephan Buchert
Great, thanks, your solution with a "precallback" works also for me. I have the package from http://copr.fedoraproject.org/coprs/nalimilan/julia/ which is released Julia Version 0.3.1 Sqlite hands in some cases NULL pointers to the callback, which apparently is no good input for bytestring. T

[julia-users] help with macro and splicing

2014-10-06 Thread Tamas Papp
Hi, I would like to create an @invisible macro that takes statements and appends `nothing` at the end. The motivation is to provide something similar to invisible() in R, if not in implementation then in functionality, especially because when I am using Gadfly then printing the plots opens them in

[julia-users] Re: Getting at an array of C strings in a callback function?

2014-10-06 Thread David Gonzales
I have tried about the same method and got it to work. if you included more code in the question, it might highlight a problem or make it easier to replicate, investigate the situation described. - To convert function to callback I used: precallback = function printrow(::Ptr{Void}, ncol::Cint,

[julia-users] Getting at an array of C strings in a callback function?

2014-10-06 Thread Stephan Buchert
The C function is int sqlite3_exec( sqlite3*, /* An open database */ const char *sql, /* SQL to be evaluated */ int (*callback)(void*,int,char**,char**), /* Callback function */ void *,/* 1st a