Re: [julia-users] Why two (qualified) macro invocation forms?

2016-07-09 Thread Isaiah Norton
(also a work-around for a symbol hygiene issue: https://github.com/JuliaLang/julia/issues/15085) On Sun, Jul 10, 2016 at 12:46 AM, Isaiah Norton wrote: > I believe the second form may be vestigial at this point, and agree that > it is inconsistent. The usage is

Re: [julia-users] I would like to display links to new Julia Questions from StackOverflow in the Gitter Sidebar

2016-07-09 Thread Lyndon White
thanks. It is working On Sunday, 10 July 2016 12:25:52 UTC+8, Jacob Quinn wrote: > > Just sent it to you. > > On Sat, Jul 9, 2016 at 10:11 PM, Lyndon White > wrote: > >> >> Hi all, >> We were discussing this in the gitter chat >> . >>

Re: [julia-users] Why two (qualified) macro invocation forms?

2016-07-09 Thread Isaiah Norton
I believe the second form may be vestigial at this point, and agree that it is inconsistent. The usage is non-existent in base (except for one test), but there is at least one issue for which the current work-around requires the second form: https://github.com/JuliaLang/julia/issues/14208 On Fri,

Re: [julia-users] I would like to display links to new Julia Questions from StackOverflow in the Gitter Sidebar

2016-07-09 Thread Jacob Quinn
Just sent it to you. On Sat, Jul 9, 2016 at 10:11 PM, Lyndon White wrote: > > Hi all, > We were discussing this in the gitter chat > . > That it would be cool if everytime someone asked a Julia question on Stack > Overflow, it would

[julia-users] I would like to display links to new Julia Questions from StackOverflow in the Gitter Sidebar

2016-07-09 Thread Lyndon White
Hi all, We were discussing this in the gitter chat . That it would be cool if everytime someone asked a Julia question on Stack Overflow, it would appear in the Activity sidebar. *They way, when questions are asked on stackoverflow, people hanging around

[julia-users] Re: caching the pivot ordering for a sparse cholesky factorization?

2016-07-09 Thread Dan
Hi Gabe, SuiteSparse which comes together with Julia includes a library KLU which does sparse LU factorization. It has the option to return the fill-in reducing order it manages to find for a given sparsity pattern. With this returned structure it can subsequently factorize many matrices (and

Re: [julia-users] MathProgBase Conic problem specifying dual

2016-07-09 Thread Steven Varga
Hi Kevin! thanks letting me know; and for the quick response, I will re-post on julia-opt; best, steve On Sat, Jul 9, 2016 at 2:29 PM, Kevin Squire wrote: > Hi, it's probably worth asking this question on the julia-opt list. > > Cheers, >Kevin > > > > On Saturday,

Re: [julia-users] string interpolation for memory object name

2016-07-09 Thread Min-Woong Sohn
Thank you so much! I will try a dictionary. On Saturday, July 9, 2016 at 12:54:07 PM UTC-4, Isaiah wrote: > > Technically you *can* do the following: > > > @eval $(Symbol("logit_", outcomes[i], "_unadjusted")) = [... fix the RHS > too] > > But IMHO programming like this is kind of discouraged.

[julia-users] Re: Dear Sublime Text Users

2016-07-09 Thread Randy Lai
You need to have some unicodes highlighted and then run the reverse lookup command. I am using the default font on Mac (I suppose).

[julia-users] Re: Dear Sublime Text Users

2016-07-09 Thread mmh
Thanks you! I keep trying Atom (but it's painfully slow) and on many occasions am forced to use it due to its better Julia support. This is a very welcomed package. How does reverse lookup work? I selected some text and then entered reverse look up but nothing happened? Also what kind of font

Re: [julia-users] MathProgBase Conic problem specifying dual

2016-07-09 Thread Kevin Squire
Hi, it's probably worth asking this question on the julia-opt list. Cheers, Kevin On Saturday, July 9, 2016, steven Varga wrote: > > Is it possible to specify the dual of an SOCP/SDP using MathProgBase > interface? > > It is well documented how to specify primal

Re: [julia-users] Ambiguity error when dispatching on Union types

2016-07-09 Thread Darwin Darakananda
Thanks Tim! That was really helpful, especially the trick with adding an extra layer of functions with a different name. On Saturday, July 9, 2016 at 2:56:49 AM UTC-7, Tim Holy wrote: > > Ambiguities are often a bit tricky. Two tips I've adopted: > > - Have as few methods as possible, and

Re: [julia-users] string interpolation for memory object name

2016-07-09 Thread Isaiah Norton
Technically you *can* do the following: @eval $(Symbol("logit_", outcomes[i], "_unadjusted")) = [... fix the RHS too] But IMHO programming like this is kind of discouraged. (for one thing, undisciplined use can lead to big speed traps). An alternative is to hold a string-addressable handle to

Re: [julia-users] Enter permanently on a REPL mode

2016-07-09 Thread Isaiah Norton
https://github.com/JuliaLang/julia/issues/14081 On Fri, Jul 8, 2016 at 10:07 AM, Iagoba Apellaniz < iagoba.apella...@gmail.com> wrote: > I would prefer to enter permanently on a REPL mode like `shell`. See > RCall.jl packages behavior. Once you are on R you have to hit `backspace` > to get back

[julia-users] Re: changing record separator to read text files

2016-07-09 Thread Fred
It works using "" instead of '' ! Thanks ! julia> readuntil(f, "CKV\n") "\nTA\n>sp|P30464|1B15_HUMAN HLA class I histocompatibility antigen, B-15 alpha chain OS=Homo sapiens GN=HLA-B PE=1

[julia-users] Re: changing record separator to read text files

2016-07-09 Thread Fred
Thank you very much Dan ! Indeed readuntil works much better. But it seems to accept only one end line character. Is it possible to use a more complex pattern ? julia> readuntil(f, '>') "sp|P31946|1433B_HUMAN 14-3-3 protein beta/alpha OS=Homo sapiens GN=YWHAB PE=1

[julia-users] Re: changing record separator to read text files

2016-07-09 Thread Dan
`readuntil` is your friend. `readline` uses `readuntil`. In fact, it is defined as: readuntil(s,'\n') On Saturday, July 9, 2016 at 7:40:37 AM UTC-4, Fred wrote: > > Hi ! > > It is often very useful to read a text files by blocks of lines, using > another line separator than '\n'. > >

Re: [julia-users] Few questions about methods and sub()

2016-07-09 Thread Tim Holy
Thanks! --Tim On Saturday, July 9, 2016 6:40:36 AM CDT CrocoDuck O'Ducks wrote: > Thanks! > > I filed the issue right now. I will also have a deeper look at the source > code ... > although I am probably too much of a coding noob to

Re: [julia-users] More on Macros

2016-07-09 Thread Scott Jones
Is there any hope of #6910/#10940 getting in, maybe early in the v0.6 release cycle? Having bruised my brain more than once with the current macro rules and when to use esc() or not, it would be very nice to see macro hygiene really cleaned up before v1.0, and doing it early in the v0.6 cycle

Re: [julia-users] Few questions about methods and sub()

2016-07-09 Thread CrocoDuck O'Ducks
Thanks! I filed the issue right now. I will also have a deeper look at the source code ... although I am probably too much of a coding noob to figure out what to do (even with your precious hint). On Saturday, 9 July 2016 14:15:29

Re: [julia-users] indexing over `zip(collection1, collection2)`

2016-07-09 Thread Scott Jones
I've found it very useful, even if it is O(n) complexity to get the n-th element, to allow indexing. For a database, if you have a packed record (for example, like SQLite's row format), and you only need to access a single field, it's better to be able to do just that, and *not* have to unpack

Re: [julia-users] Few questions about methods and sub()

2016-07-09 Thread Tim Holy
Looks like xcorr has a type-instability. You can see this from x = rand(10 * 192000); u = rand(10 * 192000, 3); su = sub(u, :, 1); @code_warntype xcorr(x, su) Would you mind filing an issue? https://github.com/JuliaLang/julia/issues/new Alternatively, if you feel up to fixing it, the hint is

[julia-users] MathProgBase Conic problem specifying dual

2016-07-09 Thread steven Varga
Is it possible to specify the dual of an SOCP/SDP using MathProgBase interface? It is well documented how to specify primal problem, but don't see any pointers to formulate the dual. The dual formulation is motivated if A matrix is non-square having more variables in primal then constraints.

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread FANG Colin
I would suggest replace `round(result, 10)` with `round(result, 10) + 0.0` On Saturday, July 9, 2016 at 1:34:43 PM UTC+1, Davide Lasagna wrote: > > Thanks, interesting point. > > In my specific use case -0.0 and 0.0 actually need to have the same hash, > as they represent conceptually the same

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Scott Jones
At least Unums (1.0) and Arbs don't have that annoying asymmetry of IEEE floating point, you have exact zero, or inexact pos or neg "really small close to zero" in Unums, or zero with a radius of 0, or a 0 with radius that can be *quite* small around zero (+/-), or something that can be as

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Steven G. Johnson
Note that the DataStructures.jl package contains several sorted-container types, and the "searchsortedfirst" and "regress" functions will allow you to find the values in the container that are closest to a given key.

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Steven G. Johnson
On Saturday, July 9, 2016 at 8:34:43 AM UTC-4, Davide Lasagna wrote: > > A more robust approach would be to test if abs(result - result_i) < \delta > for each result_i in a collection of previous results. However, this > operation scales linearly with the length of the collection > There are

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Davide Lasagna
Thanks, interesting point. In my specific use case -0.0 and 0.0 actually need to have the same hash, as they represent conceptually the same abstract quantity. My data is the result of an iterative computation which is eventually rounded to 10 decimal places and then hashed. I use the result's

Re: [julia-users] Could someone explain @static?

2016-07-09 Thread Isaiah Norton
This is mostly for precompilation and library use. When compiling a shared library we can't rely on a runtime check if the compiler is not available (and trying to compile both branches is inefficient and might be impossible for the reason in the help section). On Saturday, July 9, 2016, feza

Re: [julia-users] ccall doesnt work in embed.c example

2016-07-09 Thread Isaiah Norton
The symbol exists but is not exported (t vs T). Try adding DLLEXPORT in front of the function declaration. On 0.4 it appears to have had a Windows-only export declaration. On Saturday, July 9, 2016, Sourabh Chadha wrote: > I am new to Julia and have been trying to use

[julia-users] Few questions about methods and sub()

2016-07-09 Thread CrocoDuck O'Ducks
Hi there! I am making few experiments with simple methods. This method calculates the delay between two signals (mono-dimensional arrays) using xcorr(): function finddelay{T <: Real}(x::AbstractArray{T, 1}, u::AbstractArray{T, 1 }) # Delay as lag between cross correlation from origin of time

[julia-users] changing record separator to read text files

2016-07-09 Thread Fred
Hi ! It is often very useful to read a text files by blocks of lines, using another line separator than '\n'. Especially in bio-informatics, for example DNA or Protein FASTA sequences are separated by '\n>' (see uniprot.txt attached). In Perl, it is possible to change the line separator

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Tom Breloff
Yes. They are different numbers. In a way, negative zero represents "a really small negative number" that can't be represented exactly using floating point. On Saturday, July 9, 2016, Davide Lasagna wrote: > Hi, > > I have just been bitten by a function hashing a custom

[julia-users] hashing floating point zeroes

2016-07-09 Thread Davide Lasagna
Hi, I have just been bitten by a function hashing a custom type containing a vector of floats. It turns out that hashing positive and negative floating point zeros returns different hashes. Demo: julia> hash(-0.0) 0x3be7d0f7780de548 julia> hash(0.0) 0x77cfa1eef01bca90 julia> hash(0)

Re: [julia-users] Dear Sublime Text Users

2016-07-09 Thread Tom Breloff
You has me at LaTeX. :) Looking forward to checking this out. On Saturday, July 9, 2016, Randy Lai wrote: > Hi all Sublime Text uers, > > > I have just created a tiny package Julia-Unicode > to help inserting LaTeX and >

Re: [julia-users] JuliaCon schedule announced

2016-07-09 Thread feza
Patiently waiting on stefan's talk On Sunday, July 3, 2016 at 1:58:48 PM UTC-4, Viral Shah wrote: > > They will keep trickling in. We will announce widely when everything is > up. > > -viral > > > > On 03-Jul-2016, at 9:25 AM, dnm > wrote: > > > > Will Stefan's talk and

[julia-users] Could someone explain @static?

2016-07-09 Thread feza
The docs read @static() Partially evaluates an expression at parse time. For example, @static is_windows() ? foo : bar will evaluateis_windows() and insert either foo or bar into the expression. This is useful in cases where a construct would be invalid on other platforms, such as a ccall to

[julia-users] Re: Symbolic differentiation similar to TensorFlow / Theano

2016-07-09 Thread Andrei Zh
Thanks for all your answers! Just to make it clear, at the moment I'm not really interested in TensorFlow itself, but specifically in its automatic differentiation capabilities. ReverseDiffSource.jl looks very promising and is indeed quite fast for `R^n -> R` in a few experiments I've made.

Re: [julia-users] Ambiguity error when dispatching on Union types

2016-07-09 Thread Tim Holy
Ambiguities are often a bit tricky. Two tips I've adopted: - Have as few methods as possible, and declare types on their arguments only when absolutely necessary. These measures greatly reduce your exposure to the risk of ambiguities. To achieve this, it sometimes takes a fair bit of thought

Re: [julia-users] Julia ccall windows

2016-07-09 Thread Bart Janssens
Hi Karli, With CxxWrap.jl you can write a small C++ wrapper in VisualStudio that can then easily be used from Julia to access your C++ functions. See https://github.com/barche/CxxWrap.jl It does require at least Visual Studio 2015 update 2 (I tested with the community edition). Cheers, Bart

[julia-users] missing sparse Cholesky functionality?

2016-07-09 Thread vavasis
According to the Julia manual, the :L factor obtained from sparse Cholesky is not useful because the permutation is not applied. The manual says that the :PtL factor should be used instead. However, there does not seem to be a documented method to bring the :PtL factor back into Julia: Here

Re: [julia-users] Error using inner constructors and type parameters

2016-07-09 Thread Milan Bouchet-Valat
Le vendredi 08 juillet 2016 à 18:20 -0700, James Noeckel a écrit : > type LinkedMesh{RT<:Real} >   faces::LinkedList{LinkedFace} >   vertices::Array{Point{3, RT}, 1} >   LinkedMesh(points::Array{Point{3, RT}, 1}) = new(nil(LinkedFace), > points) > end > > > When I pass the below value to the

[julia-users] Re: Julia version of Matplotlib griddata?

2016-07-09 Thread Josef Heinen
You can use the GR framework, e.g. srand(0) xd = -2 + 4 * rand(100) yd = -2 + 4 * rand(100) zd = [Float64(xd[i] * exp(-xd[i]^2 - yd[i]^2)) for i = 1:100] using GR contour(xd, yd, zd, colormap=44)

[julia-users] Dear Sublime Text Users

2016-07-09 Thread Randy Lai
Hi all Sublime Text uers, I have just created a tiny package Julia-Unicode to help inserting LaTeX and Unicode in Sublime Text. It uses the Julia mappings so you don't have to worry about the different betwwen ɛ (\varepsilon) and ϵ (\epsilon). You

[julia-users] Re: Symbolic differentiation similar to TensorFlow / Theano

2016-07-09 Thread Gabriel Goh
There is also https://github.com/mlubin/ReverseDiffSparse.jl I've never used it myself, but I thought i'd throw it out there. On Saturday, July 9, 2016 at 12:27:33 AM UTC-7, Gabriel Goh wrote: > > Forward differentiation has a bad complexity for functions of the form R^n > -> R. try using

[julia-users] Re: Symbolic differentiation similar to TensorFlow / Theano

2016-07-09 Thread Gabriel Goh
Forward differentiation has a bad complexity for functions of the form R^n -> R. try using ReverseDiffSource.jl instead This blog posts describes positive results using ReverseDiffSource.jl on an autoencoder

[julia-users] Re: Julia version of Matplotlib griddata?

2016-07-09 Thread Josef Heinen
You can use the GR framework, e.g. srand(0) xd = -2 + 4 * rand(100) yd = -2 + 4 * rand(100) zd = [Float64(xd[i] * exp(-xd[i]^2 - yd[i]^2)) for i = 1:100] using GR contour(xd, yd, zd)

[julia-users] IBM Power port

2016-07-09 Thread Viral Shah
The current master now seems to be in good shape for Power, for those interested in trying it out. OpenBLAS is still working out a few bugs, but in the meanwhile, I was able to successfully link against Atlas using the following Make.user: override USE_SYSTEM_BLAS = 1 override LIBBLAS =

[julia-users] ccall doesnt work in embed.c example

2016-07-09 Thread Sourabh Chadha
I am new to Julia and have been trying to use ccall to call C functions in embedded mode but i am unable to even successfully run the example embedding.c that is in package. The example file define a function my_c_sqrt and then tries to call it using jl_eval_string("println( ccall( :my_c_sqrt,

[julia-users] Error using inner constructors and type parameters

2016-07-09 Thread James Noeckel
type LinkedMesh{RT<:Real} faces::LinkedList{LinkedFace} vertices::Array{Point{3, RT}, 1} LinkedMesh(points::Array{Point{3, RT}, 1}) = new(nil(LinkedFace), points) end When I pass the below value to the above constructor, I get an error: points::AbstractArray{Point{3, FT}, 1} #the value