Re: [julia-users] Cleaner way of using Val types?

2016-03-30 Thread Yichao Yu
On Wed, Mar 30, 2016 at 10:51 PM, Chris <7hunderstr...@gmail.com> wrote: > Here's my current dilemma, (hopefully) explained by this simple example: > > I have a composite type that has a bool field: > > type A > x::Float64 > b::Bool > end > > I have a function with different behavior based on

[julia-users] Cleaner way of using Val types?

2016-03-30 Thread Chris
Here's my current dilemma, (hopefully) explained by this simple example: I have a composite type that has a bool field: type A x::Float64 b::Bool end I have a function with different behavior based on the value of A.b. The manual

[julia-users] Re: Error: Kernel dead in Jupyter

2016-03-30 Thread Zahirul ALAM
Yea. This has fixed it. Thanks a lot to looking into it promptly. On Tuesday, 29 March 2016 06:56:46 UTC-4, Tony Kelman wrote: > > This should be resolved upstream by > https://build.opensuse.org/package/rdiff/windows:mingw:win64/mingw64-runtime?linkrev=base=40 > In a fee hours when

Re: [julia-users] Access stack frame address?

2016-03-30 Thread Yichao Yu
On Mar 30, 2016 6:22 PM, "Yichao Yu" wrote: > > > On Mar 30, 2016 6:21 PM, "Laurent Bartholdi" wrote: > > > > Hi, > > Is there a way to obtain the address of the current stack frame (the ebp register on x86 processors)? > > > > In GCC, there's the

Re: [julia-users] Access stack frame address?

2016-03-30 Thread Yichao Yu
On Mar 30, 2016 6:21 PM, "Laurent Bartholdi" wrote: > > Hi, > Is there a way to obtain the address of the current stack frame (the ebp register on x86 processors)? > > In GCC, there's the bultin primitive __builtin_frame_address() that does precisely that. Why do you

[julia-users] Access stack frame address?

2016-03-30 Thread Laurent Bartholdi
Hi, Is there a way to obtain the address of the current stack frame (the ebp register on x86 processors)? In GCC, there's the bultin primitive __builtin_frame_address() that does precisely that. Many thanks in advance, Laurent

Re: [julia-users] Re: regression from 0.43 to 0.5dev, and back to 0.43 on fedora23

2016-03-30 Thread Johannes Wagner
On Wednesday, March 30, 2016 at 1:58:23 PM UTC+2, Milan Bouchet-Valat wrote: > > Le mercredi 30 mars 2016 à 04:43 -0700, Johannes Wagner a écrit : > > Sorry for not having expressed myself clearly, I meant the latest > > version of fedora to work fine (24 development). I always used the > >

Re: [julia-users] git protocol packages

2016-03-30 Thread Tony Kelman
libgit2 can use the osx native tls library on mac, so we shouldn't need openssl there. Not sure why openssh is getting confused. I'm pretty sure there are https keychain helpers out there if it's entering your password for private repos that you're worried about.

Re: [julia-users] git protocol packages

2016-03-30 Thread Isaiah Norton
The problem is likely that libgit2 detects libssh2 with CMake's PKG_CHECK_MODULE. This uses `pkg-config`, so it finds whatever is already on your system rather than the built-from-source version. There may be some CMake magic to override that behavior, but probably the easiest way around is to

Re: [julia-users] git protocol packages

2016-03-30 Thread Erik Schnetter
I tried installing libssh2 automatically , but failed due to "use of undeclared identifier 'LIBSSH2_KNOWNHOST_KEY_UNKNOWN'". Apparently, the build process picks up a system include directory that has another, older libssh2 installed, while

Re: [julia-users] Artigos para ler

2016-03-30 Thread Abel Siqueira
Olá, você mandou esse e-mail para a lista de Julia. Acho que foi errado. Abraço Abel Soares Siqueira Em 30 de março de 2016 09:47, Eduardo Lenz escreveu: > Oi...estou colocando um quasi-newton aqui no nosso programa > e aumentei a base de dados, por sobreposição de

[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

[julia-users] Re: Load error:UdefVarError : Model not defined in include boot.jl:261

2016-03-30 Thread tannirind
Yes I got it Thank you BR On Wednesday, March 30, 2016 at 5:42:54 PM UTC+2, Iain Dunning wrote: > > You need to use the correct case: using JuMP > > On Wednesday, March 30, 2016 at 9:19:10 AM UTC-4, tann...@gmail.com wrote: >> >> Thank you Kelman, >> >> I was trying with this code here "using

[julia-users] Re: Does the Julia global RNG have a name?

2016-03-30 Thread Tim Wheeler
Ha! It is Base.GLOBAL_RNG On Wednesday, March 30, 2016 at 9:42:32 AM UTC-7, Tim Wheeler wrote: > > Hello Julia Users, > > Does the Julia global RNG have a name? Is it possible to do something as > follows? > > function sample_batch!(batch, dataset, rng::AbstractRNG = JULIA_GLOBAL_RNG > ) >

[julia-users] Capturing Error messages as strings

2016-03-30 Thread Matthew Pearce
Anyone know how to capture error messages as strings? This is for debugging of code run on remote machines, as the trace on the master node appears to be incomplete. Note I am *not* asking about the atexit() behaviour. I am asking about capturing non-fatal errors like sqrt(-1) rather than

[julia-users] Does the Julia global RNG have a name?

2016-03-30 Thread Tim Wheeler
Hello Julia Users, Does the Julia global RNG have a name? Is it possible to do something as follows? function sample_batch!(batch, dataset, rng::AbstractRNG = JULIA_GLOBAL_RNG) ... end Do I have to do something like this? function sample_batch!(rng::AbstractRNG, batch, dataset) ...

[julia-users] Re: Load error:UdefVarError : Model not defined in include boot.jl:261

2016-03-30 Thread Iain Dunning
You need to use the correct case: using JuMP On Wednesday, March 30, 2016 at 9:19:10 AM UTC-4, tann...@gmail.com wrote: > > Thank you Kelman, > > I was trying with this code here "using JuMp" is already mentioned > > using jump > using Ipopt > m=Model(solver=IpoptSolver()) > @defVar(m, x, start =

Re: [julia-users] Re: dispatch on type of tuple from ...

2016-03-30 Thread Tamas Papp
Hi Bill, It works for a single argument, but not for multiple ones. I have a self-contained example: --8<---cut here---start->8--- module Foos type Foo{T <: Tuple} end m1{T}(f::Foo{Tuple{T}}, index::T...) = 42 # suggested by Bill Hart m2{T}(f::Foo{T},

[julia-users] Re: Almost at 500 packages!

2016-03-30 Thread Adrian Salceanu
James, that's great. I'd say the most efficient way of doing this is if I finish the API and you do the REPL package for querying the API and displaying the results. We can discuss the data and the structure of the responses and I can provide you with mock responses, so you won't have to wait

Re: [julia-users] The Arrays are hard to pre-allocate for me, are they possible to be pre-allocated?

2016-03-30 Thread Lutfullah Tomak
Surely not the main issue here but doing `length( ϕ[:, 1] )` wastes memory for nothing. Instead use `size(ϕ, 1)` ? Also `for j1 in [1:n1-1; n2+1:ns]` this can be split to 2 for loops to avoid allocations and memory loads. j1 is off by 1 in indexing so just decrease ranges by 1 as `0:n1-2` and

Re: [julia-users] documentation of print() and println()

2016-03-30 Thread Stefan Karpinski
Yes, this is definitely a documentation oversight. I've opened an issue for it: https://github.com/JuliaLang/julia/issues/15693. On Wed, Mar 30, 2016 at 9:01 AM, wrote: > I believe that print (and println) can be used as follows: > > >print(io,"Highway ",61,"

Re: [julia-users] git protocol packages

2016-03-30 Thread Isaiah Norton
I'm not sure if this is supposed to be officially supported yet, but I was able to get ssh:// to work on OS X: 1. `brew install libssh2` 2. from julia root dir: `cd deps && make configure-libgit2 VERBOSE=1` 3. copy the cmake command printed by above, and re-run it manually. For some reason

[julia-users] double-dash cmdline syntax doesn't work ?

2016-03-30 Thread Didier Verna
Hello, I've installed Julia 0.4.5 on my Mac and I'm reading the user manual... The Getting Started section mentions the double-dash cmdline syntax, but it doesn't seem to work. With the script given as example that just shows the value of ARGS, I get this: didier(s000)% julia --color=yes --

[julia-users] Re: Load error:UdefVarError : Model not defined in include boot.jl:261

2016-03-30 Thread tannirind
Thank you Kelman, I was trying with this code here "using JuMp" is already mentioned using jump using Ipopt m=Model(solver=IpoptSolver()) @defVar(m, x, start = 0.0) @defVar(m, y, start = 0.0) @setNLObjective(m, Min, (1-x)^2 + 100(y-x^2)^2) solve(m) println("x = ", getValue(x), "y = ",

Re: [julia-users] Re: Is there a performance penalty for defining functions inside functions?

2016-03-30 Thread Mauro
No: `include` includes in global scope. On Wed, 2016-03-30 at 15:02, FANG Colin wrote: > What about include in a function? > > function mainFunc() > include("helper.jl") > > call helper() and do stuff > return something > end > > > inside helper.jl > >

[julia-users] Re: raytracing in julia

2016-03-30 Thread jw3126
It seems that the official FireRays repo currently can't be build on my system (Ubuntu 14.04), though there is already an issue about this. If there is only a C++ API, what kind of trouble does that mean for trying to wrap it with

[julia-users] Re: Is there a performance penalty for defining functions inside functions?

2016-03-30 Thread FANG Colin
What about include in a function? function mainFunc() include("helper.jl") call helper() and do stuff return something end inside helper.jl function helper() do stuff return something end On Wednesday, March 30, 2016 at 1:26:22 PM UTC+1, Christopher

[julia-users] documentation of print() and println()

2016-03-30 Thread paul . soederlind
I believe that print (and println) can be used as follows: >print(io,"Highway ",61," Revisited") However, ?print demonstrates only the print(x) usage. Same for the manual. No mentioning of the io or additional arguments. Did I miss something? /Paul S

[julia-users] Artigos para ler

2016-03-30 Thread Eduardo Lenz
Oi...estou colocando um quasi-newton aqui no nosso programa e aumentei a base de dados, por sobreposição de um ruído aleatório. Vamos ver se não vale a pena separar a base de dados para treino/verificação... Agora vamos para os artigos ! Olha este daqui !

[julia-users] Re: Is there a performance penalty for defining functions inside functions?

2016-03-30 Thread Christopher Fisher
There might be some cases where defining functions within functions can improve speed. As Mauro noted, this may not be true in .4 but will be fixed in .5. See the following for examples:

[julia-users] Re: Almost at 500 packages!

2016-03-30 Thread James Fairbanks
I am interested in this project and have some time on my hands over the next few weeks. On Wednesday, March 30, 2016 at 5:55:16 AM UTC-4, Adrian Salceanu wrote: > > I begun working on such a tool a few weeks ago. > > A) It goes over the METADATA (https://github.com/JuliaLang/METADATA.jl) > for

[julia-users] Load error:UdefVarError : Model not defined in include boot.jl:261

2016-03-30 Thread Tony Kelman
You need using JuMP

Re: [julia-users] parametric type question: N,T <: NTuple{N}

2016-03-30 Thread Tim Holy
That kind of type specification has been on the wish list for a long time. Maybe when #8974 lands (certainly not in julia 0.5). --Tim On Wednesday, March 30, 2016 01:24:54 PM Tamas Papp wrote: > Hi, > > I am working on a mini-library that makes tabulation of arbitrary data > easier. The design

Re: [julia-users] Re: regression from 0.43 to 0.5dev, and back to 0.43 on fedora23

2016-03-30 Thread Milan Bouchet-Valat
Le mercredi 30 mars 2016 à 04:43 -0700, Johannes Wagner a écrit : > Sorry for not having expressed myself clearly, I meant the latest > version of fedora to work fine (24 development). I always used the > latest julia nightly available on the copr nalimilan repo. Right now > that is:

Re: [julia-users] Re: regression from 0.43 to 0.5dev, and back to 0.43 on fedora23

2016-03-30 Thread Johannes Wagner
Sorry for not having expressed myself clearly, I meant the latest version of fedora to work fine (24 development). I always used the latest julia nightly available on the copr nalimilan repo. Right now that is: 0.5.0-dev+3292, Commit 9d527c5*, all use LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

[julia-users] parametric type question: N,T <: NTuple{N}

2016-03-30 Thread Tamas Papp
Hi, I am working on a mini-library that makes tabulation of arbitrary data easier. The design that works well at the moment is just wrapping a dictionary, which maps a Tuple of given type (and thus length) to a subtype of Real. The Tuple type gives the allowed key types. It could be defined like

[julia-users] Load error:UdefVarError : Model not defined in include boot.jl:261

2016-03-30 Thread tannirind
Hello Every one, I am solving simple non linear examples using JuMp with IpoptSolver. when i include file on julia. the specific error come .I updated packages as well. Load Error: UNdefVarError : Model not defined in include boot.jl:261 include_from model at loading. jl : 304 Any one have

[julia-users] Re: Almost at 500 packages!

2016-03-30 Thread Adrian Salceanu
I begun working on such a tool a few weeks ago. A) It goes over the METADATA (https://github.com/JuliaLang/METADATA.jl) for all the registered packages and then B) uses the GitHub API to get the README and additional stats (contributions, stars, followers, etc). Planning on C) exposing this

Re: [julia-users] The Arrays are hard to pre-allocate for me, are they possible to be pre-allocated?

2016-03-30 Thread 博陈
I tried @code_warntype, and the result show that the red alert appear only in the io part. Maybe it's not a type-stability issue. 在 2016年3月30日星期三 UTC+8上午3:18:24,Tim Holy写道: > > I haven't look at this myself, but have you tried Stefan's suggestion to > look > at `@code_warntype`? This might not