[julia-users] Re: Why does this code never return?

2016-01-03 Thread elextr
Reload reloads the *package* not the module, see http://docs.julialang.org/en/release-0.4/stdlib/base/#Base.reload. On Sunday, January 3, 2016 at 5:16:07 PM UTC+10, Greg Plowman wrote: > > This seemed a little non-obvious to me as well. > > I guess the take-away is that "loading" a module (via an

Re: [julia-users] Using MATLAB error

2016-01-03 Thread Yao Lu
I know the reason. The package haven't passed the test for 0.4. 在 2015年12月29日星期二 UTC+8上午12:32:40,Mauro写道: > > This works for me: > > julia> using MATLAB > > julia> x=[1,2,3] > 3-element Array{Int64,1}: > 1 > 2 > 3 > > julia> @mput x > A MATLAB session is open successfully > > on 0.3 an

[julia-users] How to provide flavours of a package?

2016-01-03 Thread Marcus Kriele
I am writing a package with example code for a book, and I anticipate code enhancements and code changes in future editions of this book. At the same time, I want to make sure that future readers of older editions can run the code with then current Julia versions. My current solution is as fol

[julia-users] Re: Only two days left: TRIPLE your support for your favorite open source projects!

2016-01-03 Thread SundaraRaman R
On Sunday, January 3, 2016 at 12:40:53 AM UTC+5:30, Stefan Karpinski wrote: > > Google groups decided that this was spam, so it's too late for this. > Thanks, Google. > Hey, if having one more moderator would help push such non-spam messages off the queue quicker, I'm willing to take up the wor

Re: [julia-users] Re: Macros _str and usage of "some string here"

2016-01-03 Thread Eric Forgy
Hi, Resurrecting an old thread :) Hmm... I was recently playing around with MATLAB.jl and fell in love with the mat"" syntax. I've also been playing around with getting Julia and JS to talk to each other (and, by extension, JS talking to Matlab via Julia) and I'd really like to be able to do t

[julia-users] How to provide flavours of a package?

2016-01-03 Thread Tony Kelman
Have a look at Pkg.checkout for switching branches. Should also work given a commit sha, I think.

Re: [julia-users] Cryptic error message related to some "data" function, which does not appear in my own code...

2016-01-03 Thread Theodore Papamarkou
Just in case someone else bumps into a similar matter, the error related to a change in the way that "in" statements are represented by Julia expressions. In Julia 0.4.2 *:(i in 1:5) *results to *:($(Expr(:in, :i, :(1:5 *which is an expression of head *:in*, whereas in Julia 0.5 the same

Re: [julia-users] Using MATLAB error

2016-01-03 Thread Eric Forgy
Hi Yao Lu, As Mauro mentioned, I don't think this is a problem with MATLAB.jl. I am using it on 0.4.2 with no problems. julia> versioninfo() Julia Version 0.4.2 Commit bb73f34 (2015-12-06 21:47 UTC) Platform Info: System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
Informal testing on one machine shows 2.5x viz BigFloat at worst over all sizes. I am not changing the names (these are not submissions to the package ecosystem -- they are available), and I recognize that these are not IEEE754-2008 Binary128 .. format. I have no idea about how to compare

[julia-users] Question about type inference and profiling

2016-01-03 Thread Stuart Brorson
Hello Julia users, I have been using the profiler in an attempt to identify where my code spends most of its time. When I run the profiler, I get a large number of calls into inference.jl. Here are the first (approximately) 10 lines of my profile report: julia> Profile.print(format=:flat) Co

Re: [julia-users] Question about type inference and profiling

2016-01-03 Thread Stuart Brorson
Duh! * If I need to nail down my variable types better (to eliminate type instability and get better performance), what is the recommended way to identify variables or locations in the code where types should be better defined? A pointer to blog posts or documentation is a fine way to

[julia-users] Creating and destroying a matrix in a loop

2016-01-03 Thread Stuart Brorson
Hello again Julia users, Sorry for the noise today, but I have another question which a quick search didn't answer. I am working on a function with a loop which creates an enlarged copy of the same matrix at every iteration. Let's say it looks similar to this: for i = 1:N A = zeros(BigFloat,

Re: [julia-users] Creating and destroying a matrix in a loop

2016-01-03 Thread Yichao Yu
On Sun, Jan 3, 2016 at 12:20 PM, Stuart Brorson wrote: > Hello again Julia users, > > Sorry for the noise today, but I have another question which a quick > search didn't answer. > > I am working on a function with a loop which creates an enlarged copy > of the same matrix at every iteration. Let

Re: [julia-users] Question about type inference and profiling

2016-01-03 Thread Tim Holy
Run your code once before you profile it---otherwise you're profiling the JIT compiler as well as the runtime. Best, --Tim On Sunday, January 03, 2016 11:50:48 AM Stuart Brorson wrote: > Duh! > > > * If I need to nail down my variable types better (to eliminate type > > > > instability and

Re: [julia-users] Re: How to organise (float) data in Julia?

2016-01-03 Thread Kevin Squire
Hi Tero, Would you (or anyone else following this thread) be able to update the documentation with the information here and submit a pull request? More information is available here: https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation Cheers, Kevin On Sat,

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Fredrik Johansson
On Saturday, January 2, 2016 at 5:50:58 PM UTC+1, Scott Jones wrote: > > This is very interesting! I'm curious as to how it will compare to Unums, > as it seems both Fredrik Johannson's Arb and Unums are trying to fix a lot > of the same problems with current floating point. > Arb is a library

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
OK, I am changing the names. On Sunday, January 3, 2016 at 3:10:21 PM UTC-5, Fredrik Johansson wrote: > > > On Saturday, January 2, 2016 at 5:50:58 PM UTC+1, Scott Jones wrote: >> >> This is very interesting! I'm curious as to how it will compare to >> Unums, as it seems both Fredrik Johannson'

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
Unless there is objection, I will use Digits35, Digits75, Digits150, Digits300 (and adjust the rounding accordingly). On Sunday, January 3, 2016 at 3:24:11 PM UTC-5, Jeffrey Sarnoff wrote: > > OK, I am changing the names. > > On Sunday, January 3, 2016 at 3:10:21 PM UTC-5, Fredrik Johansson wrot

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
And I'll make the internal Ball value available using showball() -- other requests? On Sunday, January 3, 2016 at 3:28:53 PM UTC-5, Jeffrey Sarnoff wrote: > > Unless there is objection, I will use Digits35, Digits75, Digits150, > Digits300 (and adjust the rounding accordingly). > > On Sunday, Ja

Re: [julia-users] Imitating scanf

2016-01-03 Thread Steven White
Adrian--thanks! I have a followup: parse seems about 100 times slower than the equivalent C++ code. I would have hoped for only a factor of two or so. Here is a C++ code fragment: for(int i = 1; i <= 100; i++) { std::string s("4.123456789"); std::istringstream iss(s); double d; iss >> d

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
FloatHigher.jl has been revised. It now exports Digits30, Digits70, Digits140, Digits300 instead of FloatNN type names. Additionally, showball(x) is available (see README for examples). The individual files will follow, renamed DIGITS30.jl

Re: [julia-users] Imitating scanf

2016-01-03 Thread Mauro
> function testparse() > parse("4.123456789") > end Try: function testparse() parse(Float64, "4.123456789") end I get 100x speedup. > @time testparse() > @time for i=1:1 > testparse() > end > Running this on the same machine takes about 0.65 seconds. I get similar > results i

[julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
Hi; I am looking for a way to detect constructor calls in a Expr and the return statements. a = quote x = Foo(12) y = x.val + x.id

[julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
I am planning to detect the constructor calls and return statement of a function a = quote begin x = Foo(12) y = 5 + 6 f(x.val,y) x.val * y end a is an Expr, in this expression , I would like to detect the constructor calls (Foo(12)( and distinguish them from nor

[julia-users] popcount?

2016-01-03 Thread Jamie Brandon
Contrary to https://groups.google.com/forum/#!msg/julia-users/B_5SYRaY9YI/0Auz3c_IWr8J I'm not seeing popcnt emitted on my machine. Is there something additional I need to do? Is there a way to see what cpu-target julia is setting? cat /proc/cpuinfo | grep popcnt flags: fpu vme de pse t

Re: [julia-users] Imitating scanf

2016-01-03 Thread Steven White
Excellent. I get a more than 100x speedup to. Then the question is, how to make a good utility function, which reads numbers from a line of input with the types specified for speed. Here is something that seems to work correctly: function getline(src,a,b...) ss = split(readline(src)) t

[julia-users] popcount?

2016-01-03 Thread Kristoffer Carlsson
I get the popcnt instruction with my source compiled julia version but not with the downloaded binary.

Re: [julia-users] popcount?

2016-01-03 Thread Erik Schnetter
If you built Julia yourself, you will find LLVM's `llc` utility in the staging directory (i.e. in Julia's source tree): $ ./usr/bin/llc --version LLVM (http://llvm.org/): LLVM version 3.3 Optimized build. Built Dec 17 2015 (12:43:16). Default target: x86_64-apple-darwin15.2.0 Host CPU: c

Re: [julia-users] popcount?

2016-01-03 Thread Jamie Brandon
I get jamie@wanderer:~$ llc-3.6 --version LLVM (http://llvm.org/): LLVM version 3.6.2 Optimized build. Built Aug 18 2015 (08:39:18). Default target: x86_64-pc-linux-gnu Host CPU: core-avx2 If try to set the arch at runtime I get: jamie@wanderer:~$ julia --cpu-target=native ERROR: Juli

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Isaiah Norton
There is no AST-level distinction between a "constructor call" and a "normal function call", see [1]. Look at the code in 'reflection.jl' to see how to determine the applicable method for a given name (which may be a constructor). If that doesn't help, it would be helpful to clarify the goal. For

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
Hi, my end goal is whenever a constructor call is made, I want to detect it and keep track of it by creating an object For example f = Foo(12) I want to detect this and create a record and save it to a db. Thanks On Sunday, January 3, 2016 at 6:58:49 PM UTC-8, Isaiah wrote: > > There is

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Eric Forgy
Hi, Maybe I am missing something, but could you just put the recording code in the constructor itself? type Foo x::Int function Foo(x) record_Foo() new(x) end end

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Jeffrey Sarnoff
Hi Julia, The simplest way to do this is to make Foo a type and define its type constructor to behave as you wish. type Foo n::Float64 end function Foo(n::Float64) record = createRecordForFooDB(n) saveRecordInFooDB(record) println("saved Foo($(n)) to DB") end On Sunday, January

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Scott Jones
I think the DIGITSxxx names makes it sound like this might be a decimal format, which seems a bit of a concern. What about Ball128, Ball256, etc. or Arb*, or ArbFloat*? Distinguishing Arb floating types from plain old IEEE floats is good, IMO, since these seem a lot more interesting! ;-) On Sund

Re: [julia-users] ANN: Float128 and Float{256,512,1024} for common math

2016-01-03 Thread Jeffrey Sarnoff
I thought DecimalNN would be decimal format. I chose Digits30 because it is geared to display 30 digits (base 10) accurately. To call these BallNN or ArbNN would be doing a disservice to the Arb software .. I am using Arb, but only partially and not as an interval-valued entity. For that reason

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
But the you can't be doing this for every new type which is being defined by other programmers. So I need more general way. For every constructor of every type, That makes it a bit problematic. Thanks On Sunday, January 3, 2016 at 7:59:11 PM UTC-8, Jeffrey Sarnoff wrote: > > Hi Julia, > > The s

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Jeffrey Sarnoff
Do you want to create DB entries when other programmer's types are called? On Sunday, January 3, 2016 at 11:22:10 PM UTC-5, Julia Tylors wrote: > > But the you can't be doing this for every new type which is being defined > by other programmers. > So I need more general way. For every constructor

Re: [julia-users] Re: Macros _str and usage of "some string here"

2016-01-03 Thread Isaiah Norton
> > can someone help me understand the difference between: Potentially-interpolatable strings parse as expressions (try your example w/out the dollar-sign), except when used in a string-literal macro -- in that case, the dollar-sign is escaped. For example: # helper macro... julia> macro L_str(

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Jeffrey Sarnoff
Are you trying to instrument all creation of typed instances? On Sunday, January 3, 2016 at 11:24:25 PM UTC-5, Jeffrey Sarnoff wrote: > > Do you want to create DB entries when other programmer's types are called? > > On Sunday, January 3, 2016 at 11:22:10 PM UTC-5, Julia Tylors wrote: >> >> But th

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
Yes basically I am trying to instrument all creation of typed instances. detect an constructor call and record it. for a specific piece of code. For example @detect function f(x::Int64) y = Foo(x) end On Sunday, January 3, 2016 at 8:28:04 PM UTC-8, Jeffrey Sarnoff wrote: > > Are you t

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Jeffrey Sarnoff
I have no direct knowledge of that. Until someone else can give you more specific guidance, take a look at how profiling is done (as that involves the same task): https://github.com/timholy/IProfile.jl http://docs.julialang.org/en/latest/manual/profile/ https://github.com/JuliaLang/julia/blob/ma

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Tim Holy
You could try looking for :new exprs: julia> type Foo f::Int end julia> f() = Foo(12) f (generic function with 1 method) julia> @code_typed f() 1-element Array{Any,1}: :($(Expr(:lambda, Any[], Any[Any[],Any[],Any[],Any[]], :(begin # none, line 1: return $(Expr(:new, :((top(getfield))(

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Julia Tylors
How about we override Base.call{T}(::Type{T},args...) = ( mystuff; original Base.call; ) Can i do something like this? Thanks On Sunday, January 3, 2016 at 6:58:49 PM UTC-8, Isaiah wrote: > > There is no AST-level distinction between a "constructor call" and a > "normal function call", see [1]

Re: [julia-users] Detecting the constructor calls & return calls in an expr

2016-01-03 Thread Jeffrey Sarnoff
I can get you halfway there: julia> Base.call{T<:Function}(fn::T, arg::Any) = begin println("I see: ($fn($arg))"); fn(arg) end call (generic function with 1037 methods) julia> Base.call{T<:Function}(fn::T, arg1::Any, arg2::Any) = begin println("I see: ($fn($arg1,$arg2))"); fn(arg1,arg2) end cal

Re: [julia-users] Re: Macros _str and usage of "some string here"

2016-01-03 Thread Eric Forgy
Thanks Isaiah. Reading through that history was fun and informative :) In this discussion, Stefan initially suggested we can use interp_parse to help with interpolation with non-standard string literals, but by the end of the discussion, interp_p