Re: [julia-users] Difference between ascii(foobar) and simply foobar?

2015-08-22 Thread Stefan Karpinski
I'm considering changing the type of string literals. That requires this change to make tests continue to pass. Whether that happens or not, this change makes the tests independent of the type of string literals, which is a good thing. On Fri, Aug 21, 2015 at 7:42 PM, Scott Jones

Re: [julia-users] Defining composite types with fields that include each other

2015-08-22 Thread Stefan Karpinski
https://github.com/JuliaLang/julia/issues/269 On Sat, Aug 22, 2015 at 1:33 AM, Paul Thompson pm...@case.edu wrote: Hi: I want to define two types, and each will have a field that is the other type. For instance: type Foo bar::Bar otherfield1 otherfield2 end type Bar foo::Foo

Re: [julia-users] Re: Sumatra

2015-08-22 Thread Magnus Lie Hetland
No, I haven't yet – but might still be interested :)

[julia-users] Re: How to use multiplication or operation of three dimensional matrix, when change R code to Julia code? It is always error.

2015-08-22 Thread Tony Kelman
Currently Julia only drops trailing singleton dimensions in indexing. So if F is n-by-m-by-k, then F[:, i, :] is n-by-1-by-k. You need to use reshape or squeeze to convert that to an n-by-k 2-dimensional matrix. Note that writing code in this direct-port slicing style is going to involve a lot

Re: [julia-users] throw vs error

2015-08-22 Thread Stefan Karpinski
Not sure how that's really a response to what I said, which acknowledges that it's an ambiguity... On Sat, Aug 22, 2015 at 12:58 AM, Michele Zaffalon michele.zaffa...@gmail.com wrote: Verbosity aside, (which may also be disputable since errors are supposed to be rare...), I still do not see

Re: [julia-users] throw vs error

2015-08-22 Thread Michele Zaffalon
You are right, my reply was unnecessary. On Sat, Aug 22, 2015 at 10:14 AM, Stefan Karpinski ste...@karpinski.org wrote: Not sure how that's really a response to what I said, which acknowledges that it's an ambiguity... On Sat, Aug 22, 2015 at 12:58 AM, Michele Zaffalon

[julia-users] Can't use @manipulate in jupyter

2015-08-22 Thread Shubham Bhushan
Hi I tried using Gadfly and Interact and tried the example from Interact.jl github notebooks. My code doesn't evaluate. It just keeps processing and doesn't plot anything, the kernel however is shown to be busy @manipulate for ϕ = 0:π/16:4π, f = [:sin = sin, :cos = cos], both = false if

[julia-users] Correct way to define function and function!

2015-08-22 Thread Timothée Poisot
Hi, I caught myself wondering about the correct way to use function and function! -- or rather, how other people deal with this. Let's say I have a simple function that operates on an array, and I want a version to modify the original object, and one that doesn't. Is this the correct way of

[julia-users] Re: How to use multiplication or operation of three dimensional matrix, when change R code to Julia code? It is always error.

2015-08-22 Thread Sisyphuss
Will `ArrayView` overcome the unnecessary copying? On Saturday, August 22, 2015 at 11:54:39 AM UTC+2, Tony Kelman wrote: Currently Julia only drops trailing singleton dimensions in indexing. So if F is n-by-m-by-k, then F[:, i, :] is n-by-1-by-k. You need to use reshape or squeeze to

Re: [julia-users] incrementing counter in a function

2015-08-22 Thread Yichao Yu
On Sat, Aug 22, 2015 at 2:49 PM, Tero Frondelius tero.frondel...@gmail.com wrote: Why testvariable is not incremented? function incrementvariable(numb) numb += 1 end function testing() global testvariable = 0 for i = 1:3 incrementvariable(Ptr{testvariable}) end

Re: [julia-users] incrementing counter in a function

2015-08-22 Thread Yichao Yu
On Sat, Aug 22, 2015 at 6:34 PM, Tero Frondelius tero.frondel...@gmail.com wrote: Can you show how to use the Ref in practice, this is merely for academic purposes, because I had to use the list style anyways for further use of my code? For your questions: this is no performance critical.

[julia-users] Re: incrementing counter in a function

2015-08-22 Thread Sisyphuss
Oups, a typo ``testvariable+=1` On Saturday, August 22, 2015 at 11:35:33 PM UTC+2, Sisyphuss wrote: You can write `testvariable=incrementvariable(testvariable)`. But it's wield to write a dedicated function to implement the increment. Can't you just write `testvariable+=testvariable`?

Re: [julia-users] Defining composite types with fields that include each other

2015-08-22 Thread Kevin Squire
In particular, this comment has a work-around: https://github.com/JuliaLang/julia/issues/269#issuecomment-68421745 On Saturday, August 22, 2015, Stefan Karpinski ste...@karpinski.org wrote: https://github.com/JuliaLang/julia/issues/269 On Sat, Aug 22, 2015 at 1:33 AM, Paul Thompson

[julia-users] Re: new package InterestRates.jl

2015-08-22 Thread Eric Forgy
Hi Felipe, This looks great. Thanks for sharing. We'll see if we can help develop this further. Thanks also for pointing to Imanuel's FinancialMarkets.jl https://github.com/imanuelcostigan/FinancialMarkets.jl. His package on OTC derivative data (dataonderivatives.jl

[julia-users] Re: incrementing counter in a function

2015-08-22 Thread Sisyphuss
You can write `testvariable=incrementvariable(testvariable)`. But it's wield to write a dedicated function to implement the increment. Can't you just write `testvariable+=testvariable`? On Saturday, August 22, 2015 at 8:49:33 PM UTC+2, Tero Frondelius wrote: Why testvariable is not

Re: [julia-users] Difference between ascii(foobar) and simply foobar?

2015-08-22 Thread Scott Jones
On Saturday, August 22, 2015 at 9:47:56 AM UTC+2, Stefan Karpinski wrote: I'm considering changing the type of string literals. That requires this change to make tests continue to pass. Whether that happens or not, this change makes the tests independent of the type of string literals,

Re: [julia-users] throw vs error

2015-08-22 Thread Michele Zaffalon
Bright ideas? I am afraid not. Had you said dumb ideas, I would have suggested either to remove it completely, leave it as a shortname for throw(ErrorException) or to replace with something that cannot be caught, but for this one I cannot suggest a use case (maybe writing way past array

Re: [julia-users] Performance between R, Julia and Cpp

2015-08-22 Thread Cedric St-Jean
Also, Julia compiles code on the fly, so you should put it in a function, then call it once before timing it to let it warm up. You can also profile the code and use ProfileView.jl to view where the bottleneck is. There are many tricks to making things faster. On Saturday, August 22, 2015 at

Re: [julia-users] Re: Correct way to define function and function!

2015-08-22 Thread Timothée Poisot
Thanks for these infos. I will definitely pre-allocate memory (in fact I do in the real code). t Le samedi 22 août 2015 à 14:24 -0700, Sisyphuss a écrit : I don't think it's much less efficient to copy` in your second example. In the second function., you should allocate memory for `y`

[julia-users] ANN: PLplot.jl

2015-08-22 Thread wildart
Hi all, I've started working on a Julia PLplot wrapper https://github.com/wildart/PLplot.jl. PLplot is a powerful cross-platform library that can be used to create standard x-y plots, semi-log plots, log-log plots, contour plots, 3D surface plots, mesh plots, bar and pie charts, dynamic

[julia-users] Re: Correct way to define function and function!

2015-08-22 Thread Kristoffer Carlsson
What do you mean copying the object is inefficient? Do you mean that it is cheaper to build it from scratch than to start with the copy? On Saturday, August 22, 2015 at 9:51:48 PM UTC+2, Timothée Poisot wrote: Hi, I caught myself wondering about the correct way to use function and

[julia-users] Re: What is the fastest way to perform 100k blocking IO operations in parallel?

2015-08-22 Thread Andrei Zh
BTW, I'm not sure I use @parallel correctly, so I tried to start tasks manually with @async too: @time @sync for url in urls @async begin resp = get(url) println(Status: $(resp.status)) end end But I didn't notice any difference in performance. On Sunday, August 23,

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Tony Kelman
Most likely your github ssh keys were not set up? Or needed to be reset? On Saturday, August 22, 2015 at 11:02:53 AM UTC-7, Uwe Fechner wrote: Ok, publishing METADATA manually worked: Publishing METADATA manually If Pkg.publish()

[julia-users] new package InterestRates.jl

2015-08-22 Thread felipenoris
Hello, just added *InterestRates.jl* package to METADATA. It provides tools for term structure models (Nelson Siegel, Svensson) and interpolation of yield curves in finance (Linear, FlatForward, natural Cubic Spline). Hopefully helpful to someone. Installation: *Pkg.add(InterestRates)*. Docs

[julia-users] incrementing counter in a function

2015-08-22 Thread Tero Frondelius
Why testvariable is not incremented? function incrementvariable(numb) numb += 1 end function testing() global testvariable = 0 for i = 1:3 incrementvariable(Ptr{testvariable}) end println(testvariable) end Or actually what should I change to get the testvariable

[julia-users] Re: Correct way to define function and function!

2015-08-22 Thread Sisyphuss
Another (maybe better) option is ``` baz!(z,x) = begin ... return z; end baz(x) = baz!(similar(x),x) ``` You can call them by ``` baz!(x,x) z = baz(x) ``` On Saturday, August 22, 2015 at 11:24:51 PM UTC+2, Sisyphuss wrote: I don't think it's much less efficient to copy` in your second

Re: [julia-users] incrementing counter in a function

2015-08-22 Thread Tero Frondelius
Can you show how to use the Ref in practice, this is merely for academic purposes, because I had to use the list style anyways for further use of my code? For your questions: this is no performance critical. On Sunday, August 23, 2015 at 1:18:00 AM UTC+3, Yichao Yu wrote: On Sat, Aug 22,

Re: [julia-users] Performance between R, Julia and Cpp

2015-08-22 Thread Yichao Yu
On Sat, Aug 22, 2015 at 6:55 PM, Michael Wang cwang.michael...@gmail.com wrote: I am new to Julia. I heard that Julia has the performance with Cpp even though it is a high level language. I tested an example on my machine, however, the result was that Julia was in the same ballpark with R not

[julia-users] What is the fastest way to perform 100k blocking IO operations in parallel?

2015-08-22 Thread Andrei Zh
I'm writing a kind of a web scanner that should retrieve and analyze about 100k URLs as fast as possible. Of course, it will take time anyway, but I'm looking for how to utilize my CPUs and network as much as possible. My initial approach was to add all available processors, pack urls into

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Miles Lubin
Pkg.tag(NaNMath) Pkg.publish() is all you should have to do.

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Uwe Fechner
Well, it is not that easy. I did: Pkg.tag(NaNMath,:minor) which worked well. Pkg.pubish() did not work. First I had to do: git config --global github.user ufechner7 which worked fine. Than I had to do: Pkg.add(JSON) It would be nice if the error message of the missing JSON package would

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Uwe Fechner
Ok, publishing METADATA manually worked: Publishing METADATA manually If Pkg.publish() http://julia.readthedocs.org/en/latest/stdlib/pkg/#Base.Pkg.publish fails you can follow these instructions to manually publish your package. By “forking” the main METADATA repository, you can create a

[julia-users] PSA: There are timezones now!

2015-08-22 Thread Eric Davies
Here they are! https://github.com/quinnj/TimeZones.jl IMO it's better than pytz, which is exciting. All credit goes to Curtis Vogt @omus.

Re: [julia-users] throw vs error

2015-08-22 Thread Stefan Karpinski
No worries, if you've got any bright ideas how we should resolve this throw/error thing... On Sat, Aug 22, 2015 at 7:06 AM, Michele Zaffalon michele.zaffa...@gmail.com wrote: You are right, my reply was unnecessary. On Sat, Aug 22, 2015 at 10:14 AM, Stefan Karpinski ste...@karpinski.org

[julia-users] Re: Can't use @manipulate in jupyter

2015-08-22 Thread Shubham Bhushan
I'd really appreciate any ideas I know this is very little to go on but maybe some of you can just spitball some ideas that might work. I really would like to use this functionality On Saturday, August 22, 2015 at 5:40:13 PM UTC+5:30, Shubham Bhushan wrote: Hi I tried using Gadfly and

[julia-users] Creating a new version of a package

2015-08-22 Thread Uwe Fechner
Hello, I was invited to tag a new version of the package NaNMath.jl . https://github.com/mlubin/NaNMath.jl Does anyone know, how to do this? Best regards: Uwe Fechner

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Timothée Poisot
Yes! There is a good documentation here: http://julia.readthedocs.org/en/latest/manual/packages/ It works for 0.3 as well as 0.4. t Le 2015-08-22 12:20, Uwe Fechner uwe.fechner@gmail.com a écrit : Hello, I was invited to tag a new version of the package NaNMath.jl .

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Uwe Fechner
Ok. As far as I understand, I first have to create a tag in the NaNMath.jl repository. Then I have to fork METADATA.jl. (I did this). But what next? Am Samstag, 22. August 2015 18:31:03 UTC+2 schrieb Timothée Poisot: Yes! There is a good documentation here:

[julia-users] Re: Can't use @manipulate in jupyter

2015-08-22 Thread David P. Sanders
Which version of Jupyter / IPython are you using? This is all going through an upheaval at the moment. My guess is that you need Pkg.checkout(Interact) to get the latest version of Interact.jl that works with version 3.0 of the Notebook. (But not, apparently, with the very latest version 4.0

Re: [julia-users] Creating a new version of a package

2015-08-22 Thread Rob J. Goedman
Uwe, The way I proceed is to: 1) Clone the forked version of METADATA.jl to your desktop. 2) Remove the entry for NaNMath.jl in this local, cloned version of METADATA.jl. 3) Replace it with the entry from your NanMath.jl in .julia/v0.x METADATA.jl. 4) Merge back to your forked verion on