[julia-users] Hang generating sys-all.o

2016-08-13 Thread Jared Crean
I am playing around with Julia's static compilation capabilities described here: http://juliacomputing.com/blog/2016/02/09/static-julia.html, but part of the process hangs. When I try to generate a system image containing compiled code for all functions: julia5l --output-o sys-all.o --sysimage

[julia-users] Re: ANN: Optim v0.6

2016-08-13 Thread Kristoffer Carlsson
It is linked right at the top in the README? On Saturday, August 13, 2016 at 11:40:24 PM UTC+2, Uwe Fechner wrote: > > Hello, > in the README it says, "for more information, see the documentation". > Is the documentation online available? I cannot find it. > > Uwe > > On Saturday, August 13,

Re: [julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread Stefan Karpinski
Another way to test it would be firstbit(n::Integer) = n != (n << 1) >> 1 This does not count negative integers. Or if you want to count negative integers, then this does the trick: firstbit(n::Integer) = n != (n << 1) >>> 1 For all of the above, calling this on BigInts doesn't make much

[julia-users] Re: ANN: Optim v0.6

2016-08-13 Thread Uwe Fechner
Hello, in the README it says, "for more information, see the documentation". Is the documentation online available? I cannot find it. Uwe On Saturday, August 13, 2016 at 10:07:57 PM UTC+2, Patrick Kofod Mogensen wrote: > > We are happy to announce that Optim v0.6 has been released. > > Since

[julia-users] ANN: Optim v0.6

2016-08-13 Thread Patrick Kofod Mogensen
We are happy to announce that Optim v0.6 has been released. Since v0.5, we've seen some great additions and changes to the package. Much of this has happened with the help of new and old contributors, and therefore this version tag should really be dedicated to them. We've had nine contributors

Re: [julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread Erik Schnetter
You can also write ```Julia firstbit(n::Integer) = signed(n) < 0 ``` I hope that LLVM generates the same machine code for this as for Steven's bit masks above. Using bit masks is more general since it allows you to test every bit, not just the "first" (sign) bit. -erik On Sat, Aug 13, 2016 at

[julia-users] Re: Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Chris Rackauckas
There's a PR for this on Parameters.jl. See this: https://github.com/mauro3/Parameters.jl/pull/13 On Saturday, August 13, 2016 at 1:04:19 AM UTC-7, Adrian Salceanu wrote: > > Hi, > > This seems to be a recurring question per my googlings, but still I could > not find a satisfactory answer.

Re: [julia-users] Re: working with tree-like type

2016-08-13 Thread Keno Fischer
I haven't gotten around to writing documentation yet, because I'm not quite happy with the abstraction. If you give me a rough idea of what kind of tree it is, I can probably tell you the right thing to do. The most basic interface is just to return an iterator over a node's children from

[julia-users] Re: working with tree-like type

2016-08-13 Thread Andreas Lobinger
Hello colleague, On Saturday, August 13, 2016 at 6:38:31 PM UTC+2, Steven G. Johnson wrote: > > > On Friday, August 12, 2016 at 2:45:12 AM UTC-4, Andreas Lobinger wrote: > > can someone please point me to some (more) documentation/packages about >> handling tree structures in types?

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Daniel O'Malley
The populateexpression function from MetaProgTools might be helpful. For example, you could do something like: julia> q = :(x + y + 3) :(x + y + 3) julia> eval(MetaProgTools.populateexpression(q, Dict("x"=>1, "y"=>2))) 6 On Saturday, August 13, 2016 at 3:07:38 AM UTC-6, Adrian Salceanu wrote:

[julia-users] Re: working with tree-like type

2016-08-13 Thread Steven G. Johnson
On Friday, August 12, 2016 at 2:45:12 AM UTC-4, Andreas Lobinger wrote: > > Hello colleagues, > > can someone please point me to some (more) documentation/packages about > handling tree structures in types? AbstractTrees.jl leaves me a little bit > alone without docu (yes, i've seen the

[julia-users] Re: Error trying to use Julia with Juno and Atom

2016-08-13 Thread Steven G. Johnson
First, open the Julia command-line app and type "Pkg.update()". If you get the same error about being unable to connect to github.com, then you have a network problem. Probably you are behind some kind of proxy or firewall? There are instructions online somewhere about setting up git to

Re: [julia-users] Re: Multimedia I/O

2016-08-13 Thread Steven G. Johnson
On Friday, August 12, 2016 at 6:53:53 PM UTC-4, Stefan Karpinski wrote: > > The 2-argument show is "mime-type agnostic". I think Jameson of Jeff may > have added some documentation of this? > https://github.com/JuliaLang/julia/issues/18004

Re: [julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread Stefan Karpinski
Note that there's a rather annoying feature of x86 that the bsf and bsr instructions leave the destination register as is (undefined, but in practice whatever was there before) when the argument register is zero. The upshot is that unless the user expresses at the LLVM level that they don't care

[julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread Steven G. Johnson
On Saturday, August 13, 2016 at 9:22:14 AM UTC-4, jw3126 wrote: > > Sorry my question was confusing. What I want is a function that behaves as > follows on bittypes: > > *0*0101101 -> 0 > *0*1110101 -> 0 > *0*1011011 -> 0 > *1*0011101 -> 1 > *1*1010001 -> 1 > *1*0110111 -> 1 > Normally to

[julia-users] Re: Incredibly elusive julia 0.5 bug - new undefined behaviour?

2016-08-13 Thread Scott T
See #18015 On Friday, 12 August 2016 20:59:20 UTC+1, Scott T wrote: > > I've got a really REALLY elusive bug which as far as I can tell boils down > to this line of code: > > shuffleFields!(A, getb(A), getc(A), geta(A)) > > where the intent is to

Re: [julia-users] Re: Incredibly elusive julia 0.5 bug - new undefined behaviour?

2016-08-13 Thread Scott T
This seems very likely. Adding @noinline to the definition of the function that is acting like shuffleFields! gets rid of the bug. Still trying to reduce the test case though. On Saturday, 13 August 2016 01:39:45 UTC+1, Keno Fischer wrote: > > Sounds like a potential bug in the inliner. Would

Re: [julia-users] Re: "eval cannot be used in a generated function"

2016-08-13 Thread Cedric St-Jean
Naive suggestion: since you can eval inside the macro body (à la FastAnonymous), couldn't your generated function expand into a macro call? On Friday, August 12, 2016 at 12:19:49 PM UTC-4, Erik Schnetter wrote: > > On Fri, Aug 12, 2016 at 4:06 AM, Tomas Lycken > wrote: >

Re: [julia-users] Re: ANN: Julia 0.5.0-rc2 now available

2016-08-13 Thread Yichao Yu
On Sat, Aug 13, 2016 at 7:51 PM, Evan Fields wrote: > Thanks Tony. Two questions, one related to Uwe's question: > > 1) I noticed earlier that 0.5.0-rc0 starts up much faster than 0.4.6 but > is a little slower on initial function calls. > Likely due to LLVM's

[julia-users] Re: ANN: Julia 0.5.0-rc2 now available

2016-08-13 Thread Cedric St-Jean
Langue changes: https://github.com/JuliaLang/julia/blob/master/NEWS.md On Saturday, August 13, 2016 at 7:51:39 AM UTC-4, Evan Fields wrote: > > Thanks Tony. Two questions, one related to Uwe's question: > > 1) I noticed earlier that 0.5.0-rc0 starts up much faster than 0.4.6 but > is a little

[julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread jw3126
Sorry my question was confusing. What I want is a function that behaves as follows on bittypes: *0*0101101 -> 0 *0*1110101 -> 0 *0*1011011 -> 0 *1*0011101 -> 1 *1*1010001 -> 1 *1*0110111 -> 1 function firstbit(x) leading_ones(x) > 0 end has the right behaviour, but it feels indirect and I

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On Sat, Aug 13, 2016 at 8:06 PM, Adrian Salceanu wrote: > That's pretty difficult as my goal is to use embedded Julia as the > templating language. Similar to Ruby's ERB, ex: http://www.stuartellis.eu/ > articles/erb/ > > So say in the template I have something like >

[julia-users] Re: Numer of ones in bitstype

2016-08-13 Thread Scott Jones
Do you want the least significant 1 bit set? Then use trailing_zeros(x). (I use that a lot for packing floating point values, which are right justified in the word (if you consider the msb as being the rightmost bit). If you want the most significant 1 bit set, then leading_zeros(x) (which

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
That's pretty difficult as my goal is to use embedded Julia as the templating language. Similar to Ruby's ERB, ex: http://www.stuartellis.eu/articles/erb/ So say in the template I have something like <% if foo == "bar" %> Bar <% else %> Baz <% end %> The idea is to use Julia itself to parse

[julia-users] Re: ANN: Julia 0.5.0-rc2 now available

2016-08-13 Thread Evan Fields
Thanks Tony. Two questions, one related to Uwe's question: 1) I noticed earlier that 0.5.0-rc0 starts up much faster than 0.4.6 but is a little slower on initial function calls. Does it load or precompile less of the standard library on startup? 2) Is there / will there be a list of important

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On Sat, Aug 13, 2016 at 7:13 PM, Adrian Salceanu wrote: > Thanks > > It's for a templating engine. The user creates the document (a string) > which contains interpolated variables placeholders and markup. When the > template is rendered, the placeholders must be

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Thanks It's for a templating engine. The user creates the document (a string) which contains interpolated variables placeholders and markup. When the template is rendered, the placeholders must be replaced with the corresponding values from the dict. The lines in the template are eval-ed and

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On 8/13/16, Adrian Salceanu wrote: > Thanks, but I don't know what the dict contains, it is user defined. Your code above seems to suggest that you have some known keys and unknown keys. In which case it makes sense to pop the known keys manually and possibly handle

Re: [julia-users] Numer of ones in bitstype

2016-08-13 Thread jw3126
Using the leading_zeros hint, I can access the first bit as follows: firstbit(x) = leading_ones(x) > 0 This seems indirect however. And the code native also seems longer then what I would have hoped for: @code_native firstbit(x) .text Filename: In[78] Source line: 1 pushq

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On 8/13/16, Adrian Salceanu wrote: > Hi, > > This seems to be a recurring question per my googlings, but still I could > not find a satisfactory answer. > > I'm looking for a generic way of doing this: > > render_template(template_content, Dict(:greeting => "Hello",

Re: [julia-users] Numer of ones in bitstype

2016-08-13 Thread jw3126
Using the leading_zeros hint, I can access the first bit as follows: firstbit(x) = leading_ones(x) > 0 Is this the most efficient way to access the first bit in julia? The code native seems longer then what I would have hoped for: @code_native firstbit(0x12) .text Filename: int.jl Source

Re: [julia-users] let block question

2016-08-13 Thread Yichao Yu
On 8/13/16, feza wrote: > Is there any difference between > > version1: > > let x > x = 0 > end > > > vs. > > version2: > > let > local x = 0 > end > > > vs > > version3: > let x = 0 > end As you noticed, the return values are different. `let` (like many non-loop code

[julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Hi, This seems to be a recurring question per my googlings, but still I could not find a satisfactory answer. I'm looking for a generic way of doing this: render_template(template_content, Dict(:greeting => "Hello", :greeted => "World", :other => Dict("foo" => 1))) where function