Re: [julia-users] Re: ANN: SimpleTraits.jl

2016-09-17 Thread Eric Forgy
Thanks Mauro and Tim. This looks really clever +1


[julia-users] Re: electron framework / javascript / LLVM / Julia numerics?

2016-09-17 Thread Eric Forgy
Here is an old issue where some thoughts were discussed. I remain hopeful 
this will be possible someday in the not-too-distant future:

https://github.com/JuliaLang/julia/issues/9430


Re: [julia-users] Website issue

2016-08-15 Thread Eric Forgy
Would be nice if julialang.org were hosted on a Julia server. Just saying :)

On Monday, August 15, 2016 at 10:53:33 PM UTC+8, Stefan Karpinski wrote:
>
> Unless GitHub adds support or we change hosting, julialang.org won't 
> support HTTPS.
>


Re: [julia-users] Re: CALL TO ACTION for package devs

2016-08-04 Thread Eric Forgy
True. Another frustrating newbie mistake :)

Sent from my iPhone

> On 5 Aug 2016, at 7:50 AM, Kristoffer Carlsson  wrote:
> 
> I would say that if you want to contribute to a package you should be on the 
> latest master commit and work from there.
> 
>> On Friday, August 5, 2016 at 1:45:46 AM UTC+2, Eric Forgy wrote:
>> I agree. Another consequence of v0.5 updates on master that are not tagged 
>> is that newbies, wanting to help, end up fixing things that are already 
>> fixed not realizing. I've done this a couple of times and it is frustrating.


[julia-users] CALL TO ACTION for package devs

2016-08-04 Thread Eric Forgy
I agree. Another consequence of v0.5 updates on master that are not tagged is 
that newbies, wanting to help, end up fixing things that are already fixed not 
realizing. I've done this a couple of times and it is frustrating.

[julia-users] Re: Unexpected Performance Behaviour

2016-08-01 Thread Eric Forgy
I still don't understand the details of the new functions in v0.5. but I'd 
be inclined to think this test depends on whether you're on v0.4.6 or 
v0.5.0.

On Tuesday, August 2, 2016 at 12:53:27 PM UTC+8, Greg Plowman wrote:
>
> I get timing/allocations the other way around. (test1, hard-coded version 
> is fast without allocation)
> @code_warntype for test2 shows type-instability for s (because return type 
> cannot be inferred for f1)
>
>
> On Tuesday, August 2, 2016 at 2:33:24 PM UTC+10, Christoph Ortner wrote:
>
>> Below are two tests, in the first a simple polynomial is "hard-coded", in 
>> the second it is passed as a function. I would expect the two to be 
>> equivalent, but the second case is significantly faster. Can anybody 
>> explain what is going on?  @code_warntype doesn't show anything that would 
>> explain it? 
>>
>> function test1(N)
>>
>> r = 0.234; s = 0.0
>> for n = 1:N
>> s += r^3 + r^5
>> end
>> return s
>> end
>>
>>
>> function test2(N, f1)
>> r = 0.234; s = 0.0
>> for n = 1:N
>> s += f1(r)
>> end
>> return s
>> end
>>
>>
>> g1(r) = r^3 + r^5
>>
>>
>> test1(10)
>> test2(10, g1)
>>
>>
>> println("Test1: hard-coded functions")
>> @time test1(1_000_000)
>> @time test1(1_000_000)
>> @time test1(1_000_000)
>>
>>
>> println("Test2: pass functions")
>> @time test2(1_000_000, g1)
>> @time test2(1_000_000, g1)
>> @time test2(1_000_000, g1)
>>
>>
>>
>>
>> # $ julia5 weird_test2.jl
>> # Test1: hard-coded functions
>> #   0.086683 seconds (4.00 M allocations: 61.043 MB, 50.75% gc time)
>> #   0.142487 seconds (4.00 M allocations: 61.035 MB, 76.91% gc time)
>> #   0.025388 seconds (4.00 M allocations: 61.035 MB, 4.28% gc time)
>> # Test2: pass functions
>> #   0.000912 seconds (5 allocations: 176 bytes)
>> #   0.000860 seconds (5 allocations: 176 bytes)
>> #   0.000846 seconds (5 allocations: 176 bytes)
>>
>>
>>
>>
>>
>>

Re: [julia-users] Re: A Very Simple Benchmark for Brutal-force Loops in Several Languages: revised, Julia is fast!

2016-07-31 Thread Eric Forgy
I mentioned to Prof. Edelman (only half jokingly) at an event in Singapore, 
that we should add Excel/VBA to the list of benchmarks. 

If I'm in a corporate setting and trying to sell Julia for some internal 
project, the person making the call has probably never heard of any of the 
languages in the Julia benchmark, but they have heard of Excel/VBA, so, as 
silly as it may seem, I actually think it could go a long way for Julia 
evangelists to see more comparisons to Excel/VBA.

On Monday, August 1, 2016 at 1:45:24 AM UTC+8, hustf wrote:
>
> It is nice to have a little check on speed from time to time. I still use 
> VBA for easy cooperation with less programming savvy colleguaes.
>
> Julia 1.17s.
> VBA (excel alt + f11):12 s.
>
> This is a bit unfair to neolithic man Joel Spolsky since no optimization 
> was performed:
>
> Sub benchmark()
> nsamples = 100
> Dim y() As Double
> ReDim y(1 To nsamples)
> x = y
> For i = 1 To nsamples
> x(i) = (i - 1) * 5 / (nsamples - 1)
> Next
> Debug.Print ("\nBrutal-force loops, 100 times:")
> sngtime = Timer
> For m = 1 To 100
> For n = 1 To nsamples
> y(n) = Cos(2 * x(n) + 5)
> Next
> Next
> Debug.Print Timer - sngtime
> End Sub
>
>

[julia-users] Re: web scraping with Julia

2016-07-31 Thread Eric Forgy
I once did some web scraping using Blink.jl.

With Blink, you can inject your own JS into any page. I posted a video 
 of me changing the logo of 
julialang.org (in my browser only of course) :)

Blink together with my Pages.jl  
should get you pretty far.

On Monday, August 1, 2016 at 6:23:07 AM UTC+8, Ivan Pandžić wrote:
>
> Hey, guys, I have already searched a lot online, but can't seem to get 
> anything working. I have tried LibCURL.jl, Requests.jl and HTTPClient.jl. 
> Basically, what I need is something that allows me to get the contents of a 
> website. What's the best way?
>
> Thanks!
>
> Ivan
>


[julia-users] Re: SQL Server in-memory analytics using Julia?

2016-07-19 Thread Eric Forgy
For reference, have a look at 28:50 
here: https://www.youtube.com/watch?v=2s5IJpq0BIE

On Tuesday, July 19, 2016 at 10:49:40 PM UTC+8, Eric Forgy wrote:
>
> This is a long shot, but SQL Server has in-memory analytics available 
> using R, but, of course, it would be great to have in-memory analytics 
> available using Julia.
>
> Does anyone have any info on this? Is anyone working on this? How might we 
> help?
>


[julia-users] SQL Server in-memory analytics using Julia?

2016-07-19 Thread Eric Forgy
This is a long shot, but SQL Server has in-memory analytics available using 
R, but, of course, it would be great to have in-memory analytics available 
using Julia.

Does anyone have any info on this? Is anyone working on this? How might we 
help?


[julia-users] Re: Fast higher order differentiation

2016-07-18 Thread Eric Forgy
Hi Young Chun,

Welcome to Julia! Like Jeffrey, I think your question was a good one and 
the outcome is even better.

I don't know how others feel, but as an "oldie", it is super encouraging to 
me that:

   1. People can even ask questions like this
   2. Julia provides a highly satisfactory solution

When I was a kid, we had to walk uphill to in the snow to school both ways 
and we could not ask such questions. Even if we could ask, the answer would 
be less than satisfactory. The possibilities the young scientists today are 
provided is tremendous and I look forward to seeing what you and others 
come up with.

Out of curiosity, is anyone using Julia for fast polynomial approximations 
such as fast-multipole methods in gravitation/electromagnetics? This kind 
of fast auto-differentiation seems perfectly suited for these large-scale 
problems.

Cheers!
Eric


Re: [julia-users] JuliaCon schedule announced

2016-07-11 Thread Eric Forgy


Anyone else having trouble watching Stefan's talk? It keeps stalling (feels 
like I'm on a modem), but my connection is fairly decent




On Tuesday, July 12, 2016 at 7:47:40 AM UTC+8, Viral Shah wrote:
>
> Stefan's video is up now, as is Tim Holy's and pretty most of them.
>
> Julia 1.0
> https://www.youtube.com/watch?v=5gXMpbY1kJY
>
> Arrays and Iteration
> https://www.youtube.com/watch?v=fl0g9tHeghA
>
> -viral
>
> On Saturday, July 9, 2016 at 6:23:48 AM UTC-4, feza wrote:
>>
>> 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 the other keynote be up? 
>>> > 
>>> > On Friday, July 1, 2016 at 12:36:19 AM UTC-4, Christian Peel wrote: 
>>> > A link: https://www.youtube.com/user/JuliaLanguage/videos 
>>> > 
>>> > On Thu, Jun 30, 2016 at 3:43 AM, Viral Shah  wrote: 
>>> > They have already started appearing. Hopefully by next week they will 
>>> all be up and we will announce then. 
>>> > 
>>> > -viral 
>>> > 
>>> > On Jun 28, 2016 11:44 AM, "mmh"  wrote: 
>>> > Hi Viral, we have an eta on when the talks will be up on youtube? 
>>> > 
>>> > On Wednesday, June 22, 2016 at 11:13:25 AM UTC-4, Viral Shah wrote: 
>>> > Live streaming was too expensive and we did not do it this year, but 
>>> we certainly want to next year. 
>>> > 
>>> > -viral 
>>> > 
>>> > On Jun 22, 2016 10:33 AM, "Gabriel Gellner"  
>>> wrote: 
>>> > For future conferences I would be super stoked to pay some fee to have 
>>> early access if that would help at all. Super stoked to see so many of 
>>> these sweet talks! 
>>> > 
>>> > On Wednesday, June 22, 2016 at 6:49:43 AM UTC-7, Viral Shah wrote: 
>>> > Yes they will be and hopefully much sooner than last year. 
>>> > 
>>> > -viral 
>>> > 
>>> > On Jun 22, 2016 7:31 AM, "nuffe"  wrote: 
>>> > Will all the talks be posted on youtube, like last year? If so, do you 
>>> know when? Thank you (overseas enthusiast) 
>>> > 
>>> > On Thursday, June 9, 2016 at 11:34:18 PM UTC+2, Viral Shah wrote: 
>>> > The JuliaCon talks and workshop schedule has now been announced. 
>>> > 
>>> > http://juliacon.org/schedule.html 
>>> > 
>>> > Please buy your tickets if you have been procrastinating. We have seen 
>>> tickets going much faster this year, and waiting until the day before is 
>>> unlikely to work this year. Please also spread the message to your friends 
>>> and colleagues and relevant mailing lists. Here's the conference poster for 
>>> emailing and printing: 
>>> > 
>>> > http://juliacon.org/pdf/juliacon2016poster3.pdf 
>>> > 
>>> > -viral 
>>> > 
>>> > 
>>> > 
>>> > -- 
>>> > chris...@ieee.org 
>>>
>>>

[julia-users] Re: ANN: New Julia Packages website

2016-07-08 Thread Eric Forgy
Btw, Genie.jl also looks super cool +1. Are you on Gitter or?

On Friday, July 8, 2016 at 10:37:59 PM UTC+8, Eric Forgy wrote:
>
> This looks pretty awesome. Thanks!
>
> I found a bunch of awesome looking new packages too with this, e.g. 
> Rust.jl :heart_eyes:
>


[julia-users] Re: ANN: New Julia Packages website

2016-07-08 Thread Eric Forgy
This looks pretty awesome. Thanks!

I found a bunch of awesome looking new packages too with this, e.g. Rust.jl 
:heart_eyes:


[julia-users] Re: FENS16

2016-07-05 Thread Eric Forgy
To save other curious onlookers a few seconds of Googling, here is a link :)

http://forum2016.fens.org


Re: [julia-users] JuliaCon schedule announced

2016-06-30 Thread Eric Forgy
Just noticed a small set of videos have appeared already +1

On Wednesday, June 29, 2016 at 10:47:30 PM UTC+8, Viral Shah wrote:
>
> We are hopeful they should be up by next week. 
>


[julia-users] Re: Multiple JULIA_PKGDIR directories in a hierarchy for supporting a shared environment

2016-06-27 Thread Eric Forgy
Hi David,

I'm not a pro, but I had similar issues and went with a main Julia package 
that contains many other Julia packages as Git submodules. In this way, my 
team can just clone the main Julia package and do a "git submodule init" 
and "git submodule update" and they get all the packages from the main 
Julia package. Then I added two lines to my .juliarc.jl file that add the 
Git submodule directory to my LOAD_PATH. Now my team can add any packages 
they like but are assured to have the same packages (and versions) for the 
main Julia package.

Best regards,
Eric

On Tuesday, June 28, 2016 at 1:28:25 AM UTC+8, David Parks wrote:
>
> I want to set up a specific Julia environment on a cluster for other 
> people to use. I have particular packages, including some that are dev 
> branches, and even some that draw from my own fork of a branch to support a 
> custom feature for this environment. So the package setup is non trivial 
> and I don't want everyone else to have to follow the details.
>
> Is there a way (now or in the future) to have a hierarchy of package 
> directories, so I could have a main repository that I setup and control for 
> the relevant packages, but still allow users to extend on that but into 
> their own package directory?
>
> Or is there a way good way for me to auto-configure a complex package 
> directory for the user? I suppose the obvious answer is to just write a 
> package setup script, which might be a suitable solution. But I wonder if 
> anything else is possible or on the horizon.
>
> Thanks,
> David
>
>

[julia-users] Re: VS code extension

2016-06-22 Thread Eric Forgy
On Thursday, June 23, 2016 at 10:36:58 AM UTC+8, Gabriel Gellner wrote:
>
> Are there benefits to using this over atom? Why are people moving over? 
> Pros, Cons?
>

Hi Gabriel,

In my case, we are using Visual Studio (not VS Code) for ASP.NET and Julia 
in Atom/Juno (.NET & Julia talk to each other behind the scenes). It would 
be good if we could do everything from a single editor, so I could either 
move ASP.NET to Atom (unlikely) or Julia to VS (early stage, but doable). 
Or... I could continue using two different IDEs, which is not the end of 
the world.

Best regards,
Eric




Re: [julia-users] Re: VS code extension

2016-06-22 Thread Eric Forgy
Hi David,

This is awesome. Thanks for this. Out of curiosity, is this the same syntax 
highlighting used in Juno? It feels a little different and I've gotten used 
to Juno. 

I was able to get the same Julia.tmBundle to work in Visual Studio (not VS 
Code) and filed an issue here 
.

Thanks.

Best regards,
Eric

On Thursday, June 23, 2016 at 12:18:28 AM UTC+8, David Anthoff wrote:
>
> The VS code extension now lives here 
> https://github.com/JuliaEditorSupport/julia-vscode.
>
>  
>
> Cheers,
>
> David
>
>  
>
> *From:* julia...@googlegroups.com  [mailto:
> julia...@googlegroups.com ] *On Behalf Of *Lyndon White
> *Sent:* Tuesday, June 21, 2016 7:53 PM
> *To:* julia-users >
> *Subject:* [julia-users] Re: VS code extension
>
>  
>
> I would be happy to transfer 
> https://github.com/oxinabox/julia-vim-completions to an Org.
> Though probably worth waiting til it is wrapped up into a form people who 
> are not me can use.
>
>
>
>
>
> On Wednesday, 22 June 2016 06:26:52 UTC+8, David Anthoff wrote:
>
> Hi all,
>
>  
>
> I’ve created a new github repo for a VS code extension 
> https://github.com/davidanthoff/julia-vscode and it is published here 
> https://marketplace.visualstudio.com/items?itemName=julialang.language-julia. 
> Be5invis will delete the old julia extension from the marketplace because 
> he is no longer maintaining it. At this point my extension has zero 
> additional features over his old one, except that there is a public github 
> repo where in theory people could contribute.
>
>  
>
> Two questions:
>
> 1) could we move the github repo under some official julia organization? I 
> know most other editor plugins are under julialang, but I also remember 
> talk about creating something like a juliaeditor org or something like 
> that? In any case, I would like to move the repo to something more 
> official. I’m happy to maintain it for the foreseeable future, so no fear 
> on that front.
>
> 2) I used the julia logo. I hope that is ok from a copyright point of 
> view? I took it from the repo for the julia homepage, and that whole repo 
> seemed to be under an MIT license, but just wanted to be sure.
>
>  
>
> And if anyone wants to add stuff to the extension, PRs are welcome! 
> Especially a debug adapter would of course be fantastic.
>
>  
>
> Cheers,
>
> David 
>
>  
>
> --
>
> David Anthoff
>
> University of California, Berkeley
>
>  
>
> http://www.david-anthoff.com
>
>  
>
>

[julia-users] Re: Git-maggedon

2016-06-21 Thread Eric Forgy
Update:

I went back and changed v0.4 -> v0.4_temp2 and did a Pkg.Init() and 
Pkg.add("JSON") using v0.4.5 just to see if it was related to upgrading. 

I see the exact same problem. I suspect my Git is corrupted somehow which 
is wreaking havoc with Pkg. That is just a guess.

Any ideas?


On Wednesday, June 22, 2016 at 12:37:50 AM UTC+8, Eric Forgy wrote:
>
> I just upgraded to v0.4.6 on Windows, but I think this problem might 
> predate the upgrade (I think the upgrade was partially in hopes of 
> resolving this).
>
> I don't know if this is a Julia issue or a Git issue, but if I add any 
> package, e.g.
>
> julia> Pkg.add("JSON")
>
> The package gets added to my package directory, but no branch is checked 
> out so I am on HEAD.
>
> Worse, instead of my remotes being things like:
>
> remotes/origin/master
>
> I see things like
>
> remotes/cached/heads/master
>
> Any idea what's going on? I'm on a critical business trip and my 
> development is completely paralyzed until I can resolve this so I really 
> sincerely appreciate any help.
>
> In an act of desperation, I moved v0.4 -> v0.4_temp, Pkg.init() and 
> reinstalled every single package. I still have exactly the same problem, so 
> I am unable to do anything with Julia until I fix this.
>
> Thank you very much and best regards,
> Eric
>
>
>

[julia-users] Git-maggedon

2016-06-21 Thread Eric Forgy
I just upgraded to v0.4.6 on Windows, but I think this problem might 
predate the upgrade (I think the upgrade was partially in hopes of 
resolving this).

I don't know if this is a Julia issue or a Git issue, but if I add any 
package, e.g.

julia> Pkg.add("JSON")

The package gets added to my package directory, but no branch is checked 
out so I am on HEAD.

Worse, instead of my remotes being things like:

remotes/origin/master

I see things like

remotes/cached/heads/master

Any idea what's going on? I'm on a critical business trip and my 
development is completely paralyzed until I can resolve this so I really 
sincerely appreciate any help.

In an act of desperation, I moved v0.4 -> v0.4_temp, Pkg.init() and 
reinstalled every single package. I still have exactly the same problem, so 
I am unable to do anything with Julia until I fix this.

Thank you very much and best regards,
Eric




[julia-users] Re: Tips for optimizing this short code snippet

2016-06-18 Thread Eric Forgy
I'd be curious to see if any magic happens if you try to run it with v0.5 :)

Although not anonymous, you're still passing functions as arguments and I 
think that might be faster in v0.5, but I'm not sure.


[julia-users] Re: Tips for optimizing this short code snippet

2016-06-18 Thread Eric Forgy
Try code_warntype. I'm guessing you have some type instabilities, e.g. I 
see some 1's and 0's, where it might be better to use 1.0 and 0.0. Not sure 
:)

On Saturday, June 18, 2016 at 9:48:29 PM UTC+8, Marius Millea wrote:
>
> Thanks, yea, I had read that too and at some point checked if it mattered 
> and it didn't seem to which wasn't entirely surprising since its on the 
> outer loop. 
>
> But I just checked again given your comment and on Julia 0.4.5 it seems to 
> actually be 2x slower if I switch it to this:
>
> function f(x)
> invg(y) = 1/g(y)
> quadgk(invg,0,x)[1]  # <=== outer integral
> end
>
> Odd...
>
>
> On Saturday, June 18, 2016 at 3:41:37 PM UTC+2, Eric Forgy wrote:
>>
>> Which version of Julia are you using? One thing that stands out is the 
>> anonymous function y->1/g(y) being passed as an argument to quadgk. I'm not 
>> an expert, but I've heard this is slow in v0.4 and below, but should be 
>> fast in v0.5. Just a though.
>>
>> On Saturday, June 18, 2016 at 8:53:57 PM UTC+8, Marius Millea wrote:
>>>
>>> Hi all, I'm sort of just starting out with Julia, I'm trying to get 
>>> gauge of how fast I can make some code of which I have Cython and Fortran 
>>> versions to see if I should continue down the path of converting more or my 
>>> stuff to Julia (which in general I'd very much like to, if I can get it 
>>> fast enough). I thought maybe I'd post the code in question here to see if 
>>> I could get any tips. I've stripped down the original thing to what I think 
>>> are the important parts, a nested integration with an inner function 
>>> closure and some global variables. 
>>>
>>> module test
>>>
>>> const a = 1.
>>>
>>> function f(x)
>>> quadgk(y->1/g(y),0,x)[1]  # <=== outer integral
>>> end
>>>
>>> function g(y)
>>> integrand(x) = x^2*sqrt(x^2*y^2+a)/(exp(sqrt(x^2+y^2))+a)
>>> quadgk(integrand,0,Inf)[1]   # <=== inner integral
>>> end
>>>
>>> end
>>>
>>>
>>> > @timeit test.f(1.)
>>> 100 loops, best of 3: 3.10 ms per loop
>>>
>>>
>>>
>>>
>>> Does anyone have any tips that squeezes a little more out of this code? 
>>> I have run ProfileView on it, and although I'm not sure I fully understand 
>>> how to read its output, I think it's saying the majority of runtime is 
>>> spent in quadgk itself. So perhaps I should look into using a different 
>>> integration library? 
>>>
>>> Thanks for any help. 
>>>
>>>

[julia-users] Re: Tips for optimizing this short code snippet

2016-06-18 Thread Eric Forgy
Which version of Julia are you using? One thing that stands out is the 
anonymous function y->1/g(y) being passed as an argument to quadgk. I'm not 
an expert, but I've heard this is slow in v0.4 and below, but should be 
fast in v0.5. Just a though.

On Saturday, June 18, 2016 at 8:53:57 PM UTC+8, Marius Millea wrote:
>
> Hi all, I'm sort of just starting out with Julia, I'm trying to get gauge 
> of how fast I can make some code of which I have Cython and Fortran 
> versions to see if I should continue down the path of converting more or my 
> stuff to Julia (which in general I'd very much like to, if I can get it 
> fast enough). I thought maybe I'd post the code in question here to see if 
> I could get any tips. I've stripped down the original thing to what I think 
> are the important parts, a nested integration with an inner function 
> closure and some global variables. 
>
> module test
>
> const a = 1.
>
> function f(x)
> quadgk(y->1/g(y),0,x)[1]  # <=== outer integral
> end
>
> function g(y)
> integrand(x) = x^2*sqrt(x^2*y^2+a)/(exp(sqrt(x^2+y^2))+a)
> quadgk(integrand,0,Inf)[1]   # <=== inner integral
> end
>
> end
>
>
> > @timeit test.f(1.)
> 100 loops, best of 3: 3.10 ms per loop
>
>
>
>
> Does anyone have any tips that squeezes a little more out of this code? I 
> have run ProfileView on it, and although I'm not sure I fully understand 
> how to read its output, I think it's saying the majority of runtime is 
> spent in quadgk itself. So perhaps I should look into using a different 
> integration library? 
>
> Thanks for any help. 
>
>

[julia-users] Re: ANN: Documenter.jl

2016-06-18 Thread Eric Forgy
A documentation package with no documentation? How can that be? :D

Re: [julia-users] Re: Pkg.update() installing a package I never Pkg.add()'ed

2016-06-16 Thread Eric Forgy
Thanks Yichao. Pkg.dependents("A") came up empty. It turns out the same 
thing happened to two of my private packages that had same-name public 
packages: "A.jl" and "B.jl".

Pkg.dependends("A") and Pkg.dependents("B") both came up empty.

Somehow, Julia really did install new packages on Pkg.update() that are not 
required, but share the same name as private packages that I manually moved 
out of the package directory. This feels like Julia bug to me.

I ended up doing a Pkg.rm("A"), Pkg.rm("B) and then Pkg.update(). This time 
it worked. Julia did not install the public versions of "A.jl" and "B.jl" 
and my code is working again.

On Friday, June 17, 2016 at 11:06:28 AM UTC+8, Yichao Yu wrote:
>
> `Pkg.dependents` or just grep for it in all the `REQUIRE` files. 
>


[julia-users] Re: Pkg.update() installing a package I never Pkg.add()'ed

2016-06-16 Thread Eric Forgy
Thanks Tony. Pkg.status() tells me "A.jl" is one of the required packages, 
but I can't think of what is requiring it. It is a small somewhat obscure 
package. Any idea how to determine which package is requiring "A.jl"?

On Friday, June 17, 2016 at 6:03:58 AM UTC+8, Tony Kelman wrote:
>
> Check Pkg.status(). Most likely, a package that you actually did add has 
> changed its dependencies with its latest version.
>


[julia-users] Pkg.update() installing a package I never Pkg.add()'ed

2016-06-16 Thread Eric Forgy
Hi,

I have a private package "A.jl" and it turns out there is also a public 
package "A.jl" I didn't know about. I manually moved my package folder from 
my package directory to another folder, updated LOAD_PATH so everything 
still worked and did a Pkg.update(). For some reason, Pkg.update() then 
pulled down the public "A.jl" causing the public "A.jl" to take precedence 
over my private "A.jl".

It took me some time to figure out why my code was no longer working.

Why did Pkg.update() pull down a public package that I never Pkg.add()'ed?

What should I do to avoid this in the future?

Thanks,
Eric

julia> versioninfo()
Julia Version 0.4.5
Commit 2ac304d (2016-03-18 00:58 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3




[julia-users] Re: Git submodules vs Julia submodules

2016-06-15 Thread Eric Forgy
Hi Tony,

I'm not sure I understand. I am using Julia 0.4.5 (Windows), but not using 
anything explicit from package manager to handle the Git submodules. I just 
do a `git submodule add ...` from the command line (not REPL). I can't 
imagine package manager breaking this in 0.5. Will it? This libgit2 seems 
to be causing all kinds of problems for Windows users, e.g. I still cannot 
even play with 0.5 until this 
 is resolved.

Eric

On Thursday, June 16, 2016 at 3:10:03 AM UTC+8, Tony Kelman wrote:
>
> Assuming you're using Julia 0.4 here? Since Julia 0.5 has transitioned to 
> using libgit2 for the package manager, I don't think you'll have explicit 
> support for git submodules right away.
>


[julia-users] Re: Git submodules vs Julia submodules

2016-06-15 Thread Eric Forgy
I got it! :)

I CAN use GIt submodules, which will make consistency across the team much 
easier with these private packages.

I just need to add `Pkg.dir("A","src")` to `LOAD_PATH` :)

The world is good again :)

On Wednesday, June 15, 2016 at 10:57:21 PM UTC+8, Eric Forgy wrote:
>
> Hi,
>
> I have a large private package that depends on many other private packages 
> and each smaller package may depends on other private packages. It is a bit 
> tangled, but working.
>
> For example:
>
> # A,B,C,D are all private packages
> module A
>
> using B, C, D
>
> ...
>
> end
>
> with
>
> module D
>
> using B, C
>
> ...
>
> end
>
> However, I was having trouble ensuring that my team was using the same 
> versions of all these private packages.
>
> So... I got a bright idea to use Git submodules for module A with B,C,D 
> being Git submodules.
>
> Now, I changed module A to:
>
> module A
>
> modules = ["B","C","D"]
> for mod in modules
> include(Pkg.dir("A","src",mod,"src","$mod.jl"))
> end
>
> ...
>
> end
>
> and I removed modules B,C,D from my package directory.
>
> HOWEVER, module D is still `using B,C`, but I obviously get errors for 
> that because B & C are no longer in my package directory.
>
> The, in desperation, I started trying things like:
>
> modules = ["B","C"]
> for mod in modules
> sym = Symbol(mod)
> isdefined(sym) || eval(Expr(:using, sym))
> end
>
> and various permutations. 
>
> REQUIRE would seem like a good thing to try, but according to this 
> <https://groups.google.com/forum/#!searchin/julia-users/REQUIRE%7Csort:date/julia-users/YTz59MAXHvY/cihOYBWJBgAJ>,
>  
> REQUIRE doesn't work for packages not in METADATA.
>
> Any ideas? Can I use Git submodules for this and somehow get `using` to 
> work or punt and stop using `using` in the submodules and just include my 
> files in each submodule?
>
> Thank you for any help.
>
>
>
>
>

[julia-users] Git submodules vs Julia submodules

2016-06-15 Thread Eric Forgy
Hi,

I have a large private package that depends on many other private packages 
and each smaller package may depends on other private packages. It is a bit 
tangled, but working.

For example:

# A,B,C,D are all private packages
module A

using B, C, D

...

end

with

module D

using B, C

...

end

However, I was having trouble ensuring that my team was using the same 
versions of all these private packages.

So... I got a bright idea to use Git submodules for module A with B,C,D 
being Git submodules.

Now, I changed module A to:

module A

modules = ["B","C","D"]
for mod in modules
include(Pkg.dir("A","src",mod,"src","$mod.jl"))
end

...

end

and I removed modules B,C,D from my package directory.

HOWEVER, module D is still `using B,C`, but I obviously get errors for that 
because B & C are no longer in my package directory.

The, in desperation, I started trying things like:

modules = ["B","C"]
for mod in modules
sym = Symbol(mod)
isdefined(sym) || eval(Expr(:using, sym))
end

and various permutations. 

REQUIRE would seem like a good thing to try, but according to this 
,
 
REQUIRE doesn't work for packages not in METADATA.

Any ideas? Can I use Git submodules for this and somehow get `using` to 
work or punt and stop using `using` in the submodules and just include my 
files in each submodule?

Thank you for any help.






[julia-users] Re: Changing the year in two digit year using DateTime

2016-06-14 Thread Eric Forgy
How's this?

julia>  v1 = ["96/15/03", "15/15/03"]
2-element Array{ASCIIString,1}:
 "96/15/03"
 "15/15/03"

julia> dt = DateTime(v1,"yy/dd/mm")
2-element Array{DateTime,1}:
 0096-03-15T00:00:00
 0015-03-15T00:00:00

julia> [Dates.year(d) > 16 ? d+Dates.Year(1900) : d+Dates.Year(2000) for d 
in dt]
2-element Array{Any,1}:
 1996-03-15T00:00:00
 2015-03-15T00:00:00


On Tuesday, June 14, 2016 at 3:00:01 PM UTC+8, akrun wrote:
>
> Hi,
>
> If I have a vector of dates
>
>v1 = ["96/15/03", "15/15/03"]
>
> Using DateTime, it gives
>
> DateTime(v1, "yy/dd/mm")
> #2-element Array{DateTime,1}:
> #0096-03-15T00:00:00
> #0015-03-15T00:00:00
>
> How do I get
>
>  1996-03-15T00:00:00 and 2015-03-15T00:00:00
>
> Thanks
>


Re: [julia-users] Standard wrapper for global variable optimization hack?

2016-06-13 Thread Eric Forgy
Creating a global instance of a special type seems reasonable to me. I also 
use global Dict's for this kind of thing.

Instead of inc_global, I might define 

Base.(:+)(w::wrapper,s) = w.x + s 

so you can just do `w += 1` :)

If you find a better way, I would love to see it.

PS: Minor point, but looks like you have a typo. Should be `const w = 
wrapper(0.0)` I think. No biggie.

On Tuesday, June 14, 2016 at 8:41:40 AM UTC+8, Arch Robison wrote:
>
> Indeed the one-element vector case was what inspired my wrapper.  I 
> created the wrapper to avoid the run-time bounds check on the vector, 
> though I suppose I could sprinkle @inbounds to eliminate it.
>
> On Mon, Jun 13, 2016 at 6:40 PM, Eric Forgy  > wrote:
>
>> Not sure if this is the best way (curious about 'Ref'), but you could 
>> also make x a 1-element vector:
>>
>> const x = [0]
>>
>> x[1] += 1
>>
>
>

[julia-users] Standard wrapper for global variable optimization hack?

2016-06-13 Thread Eric Forgy
Not sure if this is the best way (curious about 'Ref'), but you could also make 
x a 1-element vector:

const x = [0]

x[1] += 1


[julia-users] Re: ANN: DC.jl - automagical linked plots in your IJulia Notebook

2016-06-12 Thread Eric Forgy
What about DCJS.jl to be consistent with PlotlyJS.jl and ThreeJS.jl?

The JS library is DC.js and is known as such so I would think DCJS.jl would be 
alright.

Re: [julia-users] Re: why not make the ternary operator into an optional binary operator?

2016-06-08 Thread Eric Forgy
Sorry for my terse response. I was in a taxi on the way to a meeting and was 
trying to be helpful :sweat_smile:

Hopefully it is clear now.

[julia-users] why not make the ternary operator into an optional binary operator?

2016-06-08 Thread Eric Forgy
This is already available using '&&'

expression && do_something

Re: [julia-users] Differential Equations Package

2016-06-07 Thread Eric Forgy
Hi Chris (et al)

It sounds like you've got a lot on your plate, but we apparently have some 
common interests.

When the smoke settles for you and you're looking for some night time 
reading (i.e. cure for insomnia), you might have a look at some of my old 
papers:

   - 
   - Noncommutative Geometry and Stochastic Calculus: Applications in 
   Mathematical Finance 
   

I'm pretty sure I am the first person to apply NCG to finance :)

I followed that one up a couple years later with a more concrete 
application for practitioners:

   - Financial Modelling Using Discrete Stochastic Calculus 
   
   
Discrete stochastic calculus provides a kind of meta algorithm. It is an 
> algorithm for generating algorithms.
>

If that doesn't cure your insomnia, this one surely will:

   -  Discrete Differential Geometry on Causal Graphs 
   
   
The above is a follow-up to work started in my dissertation at UIUC:

   - Differential Geometry in Computational Electromagnetics 
   
   
It was still a work in progress, but its not easy creating an entirely new 
framework for scientific computation, so I guess they thought it was enough 
:)

Anyway, I mention this because discrete stochastic calculus (DSC) would 
have a completely natural implementation in Julia using concepts similar to 
automatic differentiation to give you things like Ito formula for free. If 
I could clone myself, I would develop that, but I'm a "seniorpreneur", i.e. 
industry veteran (a.k.a. old man) working on my third FinTech startup, so 
it is on the back burner for now :)

My friend, John Baez, changed his academic passion from quantum gravity to 
environmental science a few years ago, which motivated me to start applying 
DSC to problems in fluid dynamics with some very cool result for Burgers 
 and Navier-Stokes equations (all unpublished). You can find a bunch of 
info about that here 

. 

Cheers

PS: Just before hitting "Send", I notice several of the links in my last 
reference are broken, which tends to happen after more than 5 years :), so 
here is one that should be good for Burgers stuff:

   - Discrete Burgers equation revisited 
   
   
The important quote:

> I did not do much more with the discrete Burgers equation for reasons 
> similar to John's. As far as I am concerned the problem is solved. I wrote 
> down and implemented in code an algorithm having the magical property that 
> the accuracy gets BETTER the longer you simulate. You cannot ask for more 
> than that.


Finally:

   -  Towards Navier-Stokes from noncommutative geometry 
   
   
Fun stuff! I miss doing research like that :)




[julia-users] RFC: WebSocket client library

2016-06-07 Thread Eric Forgy
I'll definitely check this out. Thanks!

We're doing a lot with websockets, but have a two-language problem. I do a lot 
of server prototyping in Julia, but production server is ASP.NET MVC (driven by 
customers mostly), so having a Julia client will help a lot.

Re: [julia-users] Differential Equations Package

2016-06-06 Thread Eric Forgy
Sounds awesome Chris +1


[julia-users] Re: parametrized type with inner constructor fails

2016-06-03 Thread Eric Forgy
I've been bitten by this many times and see so many others being bitten. I 
know the docs explain this as well as I could, but it would be great if 
someone could come up with some educational magic to improve the docs a bit 
more.

On Saturday, June 4, 2016 at 10:17:16 AM UTC+8, David P. Sanders wrote:
>
>
>
> El viernes, 3 de junio de 2016, 22:06:20 (UTC-4), xdavidliu escribió:
>>
>> with
>>
>>
>> type foo
>> x::Int
>> foo(x) = x > 0 ? new(x) : new(-x)
>> end
>>
>>
>> type bar{T<:Integer}
>> x::T
>> end
>>
>>
>> type baz{T<:Integer}
>> x::T
>> baz(x) = x > 0 ? new(x) : new(-x)
>> end
>>
>>
>>
>> "foo(-5).x" gives 5, "bar(-5).x" gives -5, but "baz(-5).x" gives a 
>> "MethodError: 'convert' has no method matching..." error. 
>>
>> It seems the relevant section in the manual is this 
>> ,
>>  
>> but I only have a single field (as opposed to the examples in the link in 
>> which there are almost always two or more fields), so there should be no 
>> type disagreement or ambiguity here. Is this intended behavior?
>>
>
> This is rather subtle.
> The inner constructor defines *only* the parametrised constructor:
>
> julia> type baz{T<:Integer}
>   x::T
>   baz(x) = x > zero(x) ? new(x) : new(-x)
>   end
>
> julia> methods(baz)
> 2-element Array{Any,1}:
>  call{T}(::Type{T}, arg) at essentials.jl:56
>  call{T}(::Type{T}, args...) at essentials.jl:57
>
> julia> baz{Int}(-5)
> baz{Int64}(5)
>
> If you want to use a non-parametrized constructor like baz(-5), you need 
> to explicitly define it:
>
> julia> baz{T}(x::T) = baz{T}(x)
>
> Note that on the left, this means "for each T, define a function baz(x) 
> for x of that type"; on the right it tells you to call the parametric 
> constructor with *that particular* type T:
>
> julia> baz(-5)
> baz{Int64}(5)
>  
>


[julia-users] Re: Thanks Julia

2016-06-03 Thread Eric Forgy
The Abstract looks awesome. All-optical processors is something I've been 
looking forward to since nearly going to University of Arizona to study the 
topic back in 1994 :)

On Friday, June 3, 2016 at 10:37:54 PM UTC+8, M. Zahirul ALAM wrote:
>
> I have started using Julia roughly two summers ago. I have been visiting 
> this forum ever since looking for answers and tips. You guys have been 
> incredible. I have used 80 percent of the of the calculations for the 
> following paper using Julia. Sadly, during the final revision, we had to 
> take the Julia reference (and a few more) out of the paper due to the 
> journal's policy on a maximum number of references. But a big thanks is in 
> order.   THANK YOU ALL !!
>
> Here is a link: http://science.sciencemag.org/content/352/6287/795
>


[julia-users] Re: What features are interesting in a VS Code plug-in?

2016-05-28 Thread Eric Forgy
Make sure to cast your votes here:

https://visualstudio.uservoice.com/forums/293070-visual-studio-code/suggestions/7763118-julia-language-support

On Saturday, May 28, 2016 at 11:00:26 AM UTC+8, love...@gmail.com wrote:
>
> any updates?
>>
>>

Re: [julia-users] Re: Congratulations to Keno

2016-05-28 Thread Eric Forgy
Ah yes. I see. If you go to the link Jeff posted and read down through more 
than 30 rows of a table, you can find a row:

Harvard University Commencement May 28 (Th) May 26 (Th) May 25 (Th) May 24 
(Th) May 30 (Th)
If you scroll back up to the top again, you will find that the third column 
`May 26 (Th)` corresponds to the school year 2015-2016. How could I have 
missed that? :D

Congrats! 



Re: [julia-users] Re: Congratulations to Keno

2016-05-27 Thread Eric Forgy
It must be a very public secret since they won't tell us :)

I would love to congratulate Keno too, but feels a little hollow not knowing 
why :)

Re: [julia-users] Re: Congratulations to Keno

2016-05-26 Thread Eric Forgy
I still don't get it. Must be good though :)

On Friday, May 27, 2016 at 12:40:24 PM UTC+8, Jeff Bezanson wrote:
>
> http://www.registrar.fas.harvard.edu/calendar/five-year-calendar 
>
> Congratulations indeed! 
>
> On Thu, May 26, 2016 at 11:15 PM, Eric Forgy  > wrote: 
> > Context? Link? :) 
> > 
> > On Friday, May 27, 2016 at 7:01:25 AM UTC+8, Josef Sachs wrote: 
> >> 
> >> Well done!  Onward and upward! 
>


[julia-users] Re: Congratulations to Keno

2016-05-26 Thread Eric Forgy
Context? Link? :)

On Friday, May 27, 2016 at 7:01:25 AM UTC+8, Josef Sachs wrote:
>
> Well done!  Onward and upward! 
>


Re: [julia-users] Re: Lack of an explicit return in Julia, heartache or happiness?

2016-05-24 Thread Eric Forgy
On Wednesday, May 25, 2016 at 6:30:19 AM UTC+8, Stefan Karpinski wrote:
>
> That way unless you put an explicit return in a long form function, it 
> automatically returns nothing, avoiding accidentally returning the value of 
> the last expression.
>

This makes sense to me. The current behavior is not horrible, but I have 
been confused a few times by my functions returning stuff unexpectedly. I 
admit, that is mostly me being sloppy and I usually fix it by adding a 
`return`. I also like the clarity that `return val` provides. It would be 
breaking in a big way (even for my private stuff), but might be worth it. 
So far I do not do a lot of work with macros, but I am curious about Tamas' 
concern earlier.


Re: [julia-users] Lack of an explicit return in Julia, heartache or happiness?

2016-05-24 Thread Eric Forgy
On Wednesday, May 25, 2016 at 1:34:56 AM UTC+8, David Anthoff wrote:
>
> I like that idea.
>

Me too +1. Not a big deal though, 


[julia-users] Re: Plots problem ?

2016-05-23 Thread Eric Forgy
Try x.^2.

On Tuesday, May 24, 2016 at 12:48:49 AM UTC+8, Henri Girard wrote:
>
> Hi,
> I don't know why this plot doesn't work ? 
> It tells me the domain is wrong ?
> I don't understand why ?
> Any help ?
> Regards
> Henri
>
>
> using Plots
> x=linspace(-2,2)
> f(x) =  sqrt(4-x^2)
> g(x) = -sqrt(4-x^2)
> h(x) = sqrt(-x^2+2*x)
> k(x) = -sqrt(-x^2-2*x)
> plot([g,f,h,k],-2,2,aspect_ratio=1)
>


[julia-users] Re: linreg strangely picky about inputs

2016-05-23 Thread Eric Forgy
20x speedup sounds pretty good to me. I was going to say, "Come on! You can 
do better than that!" but was afraid the sarcasm wouldn't come across as 
intended :)

Nice work and hope to see more from you. I'm sure I can learn a lot :)

On Monday, May 23, 2016 at 11:37:45 PM UTC+8, Gabriel Gellner wrote:
>
> Okay so I have completely hand coded the cov/var calculation to avoid any 
> overhead, and now I get around the 20x speedup you mentioned. I really 
> don't see any significant benefit of returning a tuple, allocating the 2 
> element array has an insignificant overhead even for flot64 vectors of size 
> 10 inside hot loops. I really don't like the ugly output and lack 
> definitions of arithmatic that returning the tuple forces for no clear 
> benefit in my mind. If this is really wanted I would much rather have a 
> linreg! method, so that the default behavior is not effected by this 
> optimization. I will of course change this if the will of the people is to 
> have a tuple, but I am -1.
>
> Another quick question do I make a new issue/pull request for this 
> behavior? As it is no longer the trivial change of my current pull request. 
> Also should this function be moved out of linalg.jl since it is really not 
> using the linear algebra routines anymore?
>
> The code I have come up with is:
>
> function linreg5{S <: Number, T <: Number}(x::AbstractArray{S}, 
> y::AbstractArray{T})
> n = length(x)
> @assert n == length(y)
> mx = mean(x) # need to know this at each step so calculate before
> tot_dx = 0.0
> tot_y = 0.0
> tot_xy = 0.0
> for i in 1:n
> tot_dx += (x[i] - mx)^2
> tot_y += y[i]
> tot_xy += x[i]*y[i]
> end
> b1 = (tot_xy - mx*tot_y)/tot_dx # a 1\n cancels in the top and bottom
> b0 = tot_y/n - b1*mx
> return [b0, b1]
> end
>
> If anyone has any comments on what could be made better.
>
> Thanks,
> Gabriel
>
> On Monday, May 23, 2016 at 5:58:37 AM UTC-7, Andreas Noack wrote:
>>
>> Almost, but return a tuple instead of an array to avoid array allocation. 
>> Tight now, cov allocates temporary arrays for the demeaned vectors but that 
>> should probably be changed later anyway.
>>
>> On Monday, May 23, 2016 at 2:50:34 AM UTC-4, Gabriel Gellner wrote:
>>>
>>> So I am not able to get such a dramatic speed up. Do you mean something 
>>> beyond:
>>>
>>> function linreg2{S <: Number, T <: Number}(x::AbstractArray{S}, 
>>> y::AbstractArray{T})
>>> mx = mean(x)
>>> my = mean(y)
>>> b1 = Base.covm(x, mx, y, my)/varm(x, mx)
>>> b0 = my - b1*mx
>>> return [b0, b1]
>>> end
>>>
>>> Which I find speeds up around 3x, or do you mean writing a custom cov 
>>> function that is smarter about memory? (I am returning an array as I like 
>>> to be able to do vector math on the coefficients ... but if I return a 
>>> tuple it isn't much faster for me)
>>>
>>> On Sunday, May 22, 2016 at 8:37:43 PM UTC-7, Andreas Noack wrote:

 I don't think that linreg has received much attention over the years. 
 Most often it is almost as simple to use \. It you take a look at 
 linreg then I'd suggest that you try to write in terms of cov and var and 
 return a tuple instead of an Array. That will speed up the computation 
 already now and with an unallocating cov, I see 20x speed up over linreg 
 for n=1 and Float64 element on 0.4.

 On Saturday, May 21, 2016 at 2:33:20 PM UTC-4, Gabriel Gellner wrote:
>
>
>
> I think it's an error.  The method definition should probably just be:
>>
>> linreg{T<:Number,S<:Number}(X::AbstractVector{T}, 
>> y::AbstractVector{S}) = [ones(T, size(X,1)) X] \ y
>>
>> which will allow it to work for X and y of different types.
>>
>> Is using the more specific typing (<: Number) the current best 
> practices? I notice a lot of the methods in linalg/generics.jl just check 
> for AbstractVectors etc without requiring numeric types even though that 
> would be the more correct check.
>  
>
>> A PR (pull request) with a patch and a test case would be most 
>> welcome.
>>
> On it! Taking me a bit of sweat to figure out the build process and 
> github stuff but once I have that all sorted a PR will be submitted. 
> Thanks 
> for the quick response. 
>


[julia-users] One year of Rust

2016-05-18 Thread Eric Forgy
Hi guys, 

One of my first posts to this forum more than a year ago when I first 
became infatuated with the language Julia, I asked about how Julia and Rust 
might work together. Since then, I have spent most of my time learning and 
coding in Julia with one eye on Rust. Rust is also a beautiful language and 
if you like Julia, you might like it as well. They are celebrating their 
first birthday, i.e. 1-year after 1.0, and wrote a nice summary. Hope you 
enjoy it :)

   - One year of Rust 
   

I fully expect to see an equally (or more) favorable review on Julia's 
first birthday (after 1.0) :)

Best regards,
Eric


Re: [julia-users] Slow reading of file

2016-05-14 Thread Eric Forgy
I don't see any "Please help me speed up my code"s or even any question marks 
at all. I just see complaints about Julia even after receiving initial 
suggestions from busy people (without any "Thank you"s). That may be one reason 
you're not receiving more helpful responses. Just a thought...

[julia-users] Re: Strange behavior with docstring

2016-05-13 Thread Eric Forgy
On Friday, May 13, 2016 at 6:56:43 PM UTC+8, Michael Hatherly wrote:
>
> Yes, do blocks can’t be documented, but perhaps a nicer error message 
> would be more useful. Could you open an issue so this doesn’t get lost. 
> Thanks.
>
Sure. Issue #16359  


[julia-users] Re: Strange behavior with docstring

2016-05-13 Thread Eric Forgy
Maybe a clue...

Callback is a constructor, so I have many such docstrings before the 
constructors, e.g. 

# """
# Callback used to message a specified connected browser.
# """
Callback("message") do args
message(args...)
end

# """
# Callback used to broadcast to all connected browsers.
# """
Callback("broadcast") do args
broadcast(args...)
end

# """
# Callback used for blocking Julia control flow until notified by the 
WebSocket.
# """
Callback("notify") do name
if haskey(conditions,name)
notify(conditions[name])
else
error("""Condition "$name" was not found.""")
end
end

I guess I shouldn't use docstring in this case. My bad :)

On Friday, May 13, 2016 at 6:16:25 PM UTC+8, Eric Forgy wrote:
>
> Hi,
>
> I am stumped on this one...
>
> I'm working on a package and, for the life of me, couldn't find my bug. 
> So, on a hunch, I started commented out my docstrings one by one. I kept 
> getting the error until I commented out the very last docstring and then 
> the code worked as expected. So the source of my error is the docstring?
>
> Here's what it looks like:
>
> """
> Callback used for blocking Julia control flow until notified by the 
> WebSocket.
> """
> Callback("notify") do name
> if haskey(conditions,name)
> notify(conditions[name])
> else
> error("""Condition "$name" was not found.""")
> end
> end
> # This is line 50 in callbacks.jl
>
> This is the last code snippet in an included file. Running it, I get the 
> following error:
>
> julia> using Pages
> ERROR: LoadError: LoadError: MethodError: `argtype` has no method 
> matching argtype(::ASCIIString)
>  in include at boot.jl:261
>  in include_from_node1 at loading.jl:320
>  in include at boot.jl:261
>  in include_from_node1 at loading.jl:320
>  in require at loading.jl:259
> while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\callbacks.jl, in 
> expression starting on line 50
> while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\Pages.jl, in 
> expression starting on line 56
>
> If I comment out that last docstring, everything works as expected.
>
> julia> using Pages
>
> julia> Pages.start();
> Listening on 0.0.0.0:8000...
>
> julia> include(Pkg.dir("Pages","examples","examples.jl"));
>
> Any ideas?
>
> julia> versioninfo()
> Julia Version 0.4.5
> Commit 2ac304d (2016-03-18 00:58 UTC)
> Platform Info:
>   System: Windows (x86_64-w64-mingw32)
>   CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
>   WORD_SIZE: 64
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
>   LAPACK: libopenblas64_
>   LIBM: libopenlibm
>   LLVM: libLLVM-3.3
>
> Thanks!
>


[julia-users] Strange behavior with docstring

2016-05-13 Thread Eric Forgy
Hi,

I am stumped on this one...

I'm working on a package and, for the life of me, couldn't find my bug. So, 
on a hunch, I started commented out my docstrings one by one. I kept 
getting the error until I commented out the very last docstring and then 
the code worked as expected. So the source of my error is the docstring?

Here's what it looks like:

"""
Callback used for blocking Julia control flow until notified by the 
WebSocket.
"""
Callback("notify") do name
if haskey(conditions,name)
notify(conditions[name])
else
error("""Condition "$name" was not found.""")
end
end
# This is line 50 in callbacks.jl

This is the last code snippet in an included file. Running it, I get the 
following error:

julia> using Pages
ERROR: LoadError: LoadError: MethodError: `argtype` has no method matching 
argtype(::ASCIIString)
 in include at boot.jl:261
 in include_from_node1 at loading.jl:320
 in include at boot.jl:261
 in include_from_node1 at loading.jl:320
 in require at loading.jl:259
while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\callbacks.jl, in 
expression starting on line 50
while loading C:\Users\Eric Forgy\.julia\v0.4\Pages\src\Pages.jl, in 
expression starting on line 56

If I comment out that last docstring, everything works as expected.

julia> using Pages

julia> Pages.start();
Listening on 0.0.0.0:8000...

julia> include(Pkg.dir("Pages","examples","examples.jl"));

Any ideas?

julia> versioninfo()
Julia Version 0.4.5
Commit 2ac304d (2016-03-18 00:58 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Thanks!


[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-12 Thread Eric Forgy
I'm also interested in this question. Having been lurking around for more 
than a year, I've seen this kind of question come up a few times and don't 
remember the answers, but remember seeing answers and they were helpful. I 
think it would be cool/helpful if Julia Computing had an "About Us 
" page with bios and answers to similar 
questions to the above for each person.


On Friday, May 13, 2016 at 1:01:04 AM UTC+8, David Parks wrote:
>
> I'm a few weeks into Julia and excited and motivated to learn and be as 
> efficient as possible. I'm sure I'm not alone. I know my way around now, 
> but am I as efficient as I can be? 
>
> What haven't I tried? What haven't I seen? What haven't I asked?
>
> For those of you who have been around longer, could you share your advice 
> on efficient day-to-day development style?
>
> For example:
>
>- What IDE do you use? Are you using Atom? A combination of Atom and 
>the REPL? Something else?
>- How do you debug complex code efficiently? How do you debug other 
>peoples code efficiently?
>- Do you have a favorite way of visualizing your work?
>- Are there must have tools? packages? utilities?
>- Any simple day-to-day efficiency/advice you could share with others 
>who didn't yet know to ask.
>
>
>

[julia-users] Re: [ANN] Book: Julia High Performance

2016-05-11 Thread Eric Forgy
The discount price was only available a couple days. I missed it too, but still 
bought it. Oops :)

Re: [julia-users] using subscripts \_1, \_2, ... as field names

2016-05-10 Thread Eric Forgy
Maybe you could override getindex so that A[1,1] is the interior nxn matrix, 
A[1,2] and A[2,1] are the bounding vectors and A[2,2] is the scalar?

[julia-users] Re: TensorSpace in ApproxFun

2016-05-04 Thread Eric Forgy
To save others two minutes of their lives :)

https://gitter.im/ApproxFun/ApproxFun.jl

On Wednesday, May 4, 2016 at 3:02:21 PM UTC+8, Sheehan Olver wrote:
>
> Hi Michele,
>
> I'll reply to this in ApproxFun's Gitter, which is is a better forum for 
> ApproxFun specific questions.
>
> Cheers,
> Sheehan
>
>
> On Tuesday, May 3, 2016 at 6:55:07 PM UTC+10, Michele Zaffalon wrote:
>>
>> Hello,
>>
>> I am confused by `ApproxFun.TensorSpace`. I understand the following.
>>
>> dom1, dom2 = Fourier(), Chebyshev()
>> dom = dom1 ⊗ dom2
>> @assert TensorSpace(Fourier(), Chebyshev()) == dom1 ⊗ dom2
>> d1, d2 = Derivative(dom1), Derivative(dom2)
>> @assert Derivative(dom1, 1) == Derivative(dom1)
>>
>>
>> Here are the parts I do not understand:
>>
>> 1) Why doesn't the following evaluate to either error or 0? `dom1` is a 
>> single variable space
>>
>> Derivative(dom1, 2) * Fun([0,0,1], dom1)
>>
>> 2) Why isn't this statement true? `d1` is the partial derivative with 
>> respect to the first variable of `dom`
>>
>> Derivative(dom1) ⊗ I == Derivative(dom, 1) # --> false
>>
>> 3) Sorry for the dumb question but what is `Derivative(dom)`? Is 
>> `Derivative(dom)==Derivative(dom, 1)`? It looks like the following is true 
>> for all `f`
>>
>> (Derivative(dom1) ⊗ I) * f == Derivative(dom) * f == Derivative(dom, 1) * 
>> f # --> true
>>
>> whose first part seems to contradict 2).
>>
>>
>> It looks like negation of derivative for the tensor space is not defined:
>>
>> (-Derivative(dom1)) * Fun([0,0,1],dom1) # valid expression for single 
>> variable function
>> (-Derivative(dom)) * Fun([0,0,1],dom) # invalid expression for the 
>> tensor space
>>
>> Also, I would like to define the divergence and I expect div rot = 0 
>> identically. I fail to define \partial_1\partial_2 but \partial_2\partial_1 
>> works
>>
>> stream_fun = Fun(randn(5), dom)
>> jϕ = Derivative(dom, 2) * stream_fun
>> jz = Derivative(dom, 1) * stream_fun
>> #Derivative(dom, 1) * jϕ #  ∂_1∂_2(stream_fun) --> error
>> Derivative(dom, 2) * jz # ∂_2∂_1(stream_fun) --> OK 
>>
>>
>> Last: `ApproxFun.transform(dom, y)` changes the values of `y` 
>> invalidating the convention about functions modifying its arguments.
>>
>>
>> michele
>>
>

[julia-users] Re: ANN: Optim.jl v0.4.5 released

2016-05-03 Thread Eric Forgy
Thank you guys. That makes perfect sense :+1:


[julia-users] Re: ANN: Optim.jl v0.4.5 released

2016-05-03 Thread Eric Forgy
This sounds great and your changes with the API and dispatch are reassuring 
because I recently implemented something similar (for a totally unrelated 
package). A general question... 

You wrote

optimize(df, x0, BFGS())

I'm curious why you didn't make this

optimize(df, x0, BFGS)

Is there any performance difference between the two and why did you go with 
the former rather than the latter?

Thanks for the update.

Best regards,
Eric


Re: [julia-users] Cloning private package with 0.5

2016-04-24 Thread Eric Forgy
Thanks Jacob. I'll have a look at that, but would that help with Travis and 
Appveyor?

In Git for Windows, am I really going to have to change all my remotes for 
all my private repos now? That will be a huge pain. Can Pkg please do this 
for me? Where would be a good place to raise this issue?


RE: [julia-users] Cloning private package with 0.5

2016-04-22 Thread Eric Forgy
I have the same problem (on Windows) and really hoping this gets fixed before 
0.5 is released. I have a ton of private repos.

I'd prefer a solution that lets me keep my remotes at 
g...@github.com:EricForgy/MyPrivateRepo.jl. It would be more than a little 
annoying if I have to change every one to https. Hopefully, Pkg can do some 
magic and make the changes for me if needed.

Re: [julia-users] 'do' notation in documentation?

2016-04-17 Thread Eric Forgy
Hi Andreas,

I don't know how to improve the documentation, but I was also confused by 
the "do" notation. It seemed kind of mysterious to me at first.

Now, I think I got it and use it often.

Basically, it is a nice way to rewrite a function whose FIRST argument is a 
function. For example, say you have

function foo(bar::Function,x,y,x)
# Do something with bar, x, y and z
end

where bar has arguments a,b,c.

Since bar is the FIRST argument of foo, we can call foo like this:

foo(x,y,z) do a,b,c
# Do something with x,y,z and a,b,c
end

This is much easier to read (and more flexible) than

foo(a,b,c -> begin
# Do something with x,y,z
 end,x,y,z)

In your cd("METADATA"), that is equivalent

cd(()->something,"METADATA")

Hope this helps. 

On Sunday, April 17, 2016 at 5:35:42 PM UTC+8, Kevin Squire wrote:
>
> Hello, Andreas, see:
>
>
> http://docs.julialang.org/en/release-0.4/manual/functions/#do-block-syntax-for-function-arguments
>
> Cheers,
>Kevin 
>
> On Sunday, April 17, 2016, Andreas Lobinger  > wrote:
>
>> Hello colleagues,
>>
>> although it's around and found in some/many lines, where is actually the 
>> documentation of the 'do' notation.
>> I'm sitting here, trying to debug a Pkg problem and the lines
>> cd("METADATA") do
>>  something 
>> end
>>
>> give me some problems in understanding. While it's obviously some kind of 
>> implicit loop, what is the loop index or subject?
>>
>> Wishing a happy day,
>> Andreas
>>
>

Re: [julia-users] Re: Parametric types which add or delete fields.

2016-04-16 Thread Eric Forgy
Thank you Tim! That is some excellent wisdom. I appreciate that and shared 
it with my team.

On Friday, April 15, 2016 at 10:35:02 PM UTC+8, Tim Holy wrote:
>
> Your best bet is always to benchmark. Here's how I make such decisions: 
>
> # The type-based system: 
> julia> immutable Container1{T} 
>val::T 
>end 
>
> julia> inc(::Int) = 1 
> inc (generic function with 1 method) 
>
> julia> inc(::Float64) = 2 
> inc (generic function with 2 methods) 
>
> julia> inc(::UInt8) = 3 
> inc (generic function with 3 methods) 
>
> julia> vec = [Container1(1), Container1(1.0), Container1(0x01)] 
> 3-element Array{Container1{T},1}: 
>  Container1{Int64}(1) 
>  Container1{Float64}(1.0) 
>  Container1{UInt8}(0x01) 
>
> julia> function loop_inc1(vec, n) 
>s = 0 
>for k = 1:n 
>for item in vec 
>s += inc(item.val) 
>end 
>end 
>s 
>end 
> loop_inc1 (generic function with 1 method) 
>
> # The dictionary solution 
> julia> immutable Container2 
>code::Symbol 
>end 
>
> julia> vec2 = [Container2(:Int), Container2(:Float64), Container2(:UInt8)] 
> 3-element Array{Container2,1}: 
>  Container2(:Int) 
>  Container2(:Float64) 
>  Container2(:UInt8)   
>
> julia> dct = Dict(:Int=>1, :Float64=>2, :UInt8=>3) 
> Dict(:Int=>1,:UInt8=>3,:Float64=>2) 
>
> julia> function loop_inc2(vec, dct, n) 
>s = 0 
>for k = 1:n 
>for item in vec 
>s += dct[item.code] 
>end 
>end 
>s 
>end 
> loop_inc2 (generic function with 1 method) 
>
> # The switch solution 
> julia> function loop_inc3(vec, n) 
>s = 0 
>for k = 1:n 
>for item in vec 
>if item.code == :Int 
>s += 1 
>elseif item.code == :Float64 
>s += 2 
>elseif item.code == :UInt8 
>s += 3 
>else 
>error("Unrecognized code") 
>end 
>end 
>end 
>s 
>end 
>
> loop_inc3 (generic function with 1 method) 
>
> julia> loop_inc1(vec, 1) 
> 6 
>
> julia> loop_inc2(vec2, dct, 1) 
> 6 
>
> julia> loop_inc3(vec2, 1) 
> 6 
>
> julia> @time loop_inc1(vec, 10^4) 
>   0.002274 seconds (10.17 k allocations: 167.025 KB) 
> 6 
>
> julia> @time loop_inc1(vec, 10^5) 
>   0.025834 seconds (100.01 k allocations: 1.526 MB) 
> 60 
>
> julia> @time loop_inc2(vec2, dct, 10^5) 
>   0.010278 seconds (6 allocations: 192 bytes) 
> 60 
>
> julia> @time loop_inc3(vec2, 10^5) 
>   0.001561 seconds (6 allocations: 192 bytes) 
> 60 
>
>
> So in terms of run time, the bottom line is: 
> - The "switch" version is fastest (by quite a lot), but ugly. 
> - The dictionary is intermediate. You would likely be able to do even 
> better 
> with a "perfect hash" dictionary, see 
> http://stackoverflow.com/questions/36385653/return-const-dictionary 
> - The type-based solution is slowest, but not much worse than the 
> dictionary. 
>
> Note that none of this analysis includes compilation time. If you're 
> writing a 
> large system, the type-based one in particular will require longer JIT 
> times, 
> whereas the first two get by with only a single type and hence will need 
> much 
> less compilation. 
>
> Of course, if `inc` were a complicated function, it might change the 
> entire 
> calculus here. That's really the key: what's the tradeoff between the 
> amount of 
> computation per element and the price you pay for dispatch to a type- 
> specialized method? There is no universal answer to this question. 
>
> Best, 
> --Tim 
>
>

Re: [julia-users] Re: Parametric types which add or delete fields.

2016-04-15 Thread Eric Forgy
On Friday, April 15, 2016 at 6:40:37 PM UTC+8, Tim Holy wrote:
>
> If in contrast item[i+1] has a different type than item[i], and the amount 
> of 
> processing is quite modest, then it may not be worth it. Because julia 
> can't 
> predict the type at compile-time, it has to look up the type at run-time, 
> search for the appropriate method in method tables, decide (via type 
> intersection) which one matches, determine whether it has been 
> JIT-compiled 
> yet (and do so if not), and then make the call. You're asking the full 
> type- 
> system and JIT-compilation machinery to basically execute the equivalent 
> of a 
> switch statement or dictionary lookup in your own code. Julia can do this, 
> but 
> it's a lot of churn under the hood. If this is the situation you're in, it 
> seems likely to be better to just write that switch statement or to use a 
> dictionary. 
>

Hi Tim, 

Thanks for writing this. I am finally starting to write some serious Julia 
code and I am in exactly the situation you described above. It is kind of 
depressing to read what you wrote, but it makes sense I guess. Now I need 
to rethink my strategy.

It's probably obvious, but could you or someone else help elaborate on 
"just write that switch statement or use a dictionary"?

What is the best way to deal with this situation?

Basically, I have a long list of concrete objects "PriceableType1", 
"PriceableType2", etc, all subtypes of "AbstractPriceableType" and I have a 
different "Price" function for each different concrete time that dispatches 
as I run through the list to come up with the price of the list.

Should I make methods "priceType1", "priceType2", etc and just switch based 
on "typeof" rather than use dispatch? :(

Thanks again and have a great weekend!
Eric


[julia-users] Re: Setting min()=Inf and max()=-Inf

2016-04-12 Thread Eric Forgy
Hi Anonymous,

One of the nice things about Julia is that if you want that feature in your 
code, you just need to do this:

import Base: min, max

min() = Inf
max() = -Inf

Voila. It will be a good/fast as if it was in Base (because it is now - for 
you and anyone using your package) :)

I hope this helps.

Best regards,
Eric

On Wednesday, April 13, 2016 at 10:22:10 AM UTC+8, Anonymous wrote:
>
> Have the Julia developers considered the effects of setting Base.min()=Inf 
> and Base.max()=-Inf.  This is common in real analysis since it plays nice 
> with set theory, i.e.
>
> A ⊆ B  =>  max(A) ≤ max(B)
>
> A ⊆ B  =>  min(A) ≥ min(B)
>
> Thus since the empty set ø is a subset of every set, the max of it should 
> be smaller than the maximum of any nonempty set, and the min of it should 
> be larger than the minimum of any nonempty set.
>


[julia-users] Re: I am trying to figure out how to pass DataTypes for a dataframe to @ListStore in Gtk.jl

2016-04-12 Thread Eric Forgy
Hi,

I'm not sitting at a computer at the moment, but just curious if you've tried

ls = @ListStore(eltypes(df)...)

Sorry for the noise if that doesn't work :)


[julia-users] Re: package testing, other OSs

2016-04-11 Thread Eric Forgy
Hi Andreas,

For Windows CI, you can use https://www.appveyor.com/

Hope this helps.

Eric

On Monday, April 11, 2016 at 3:48:04 PM UTC+8, Andreas Lobinger wrote:
>
> Hello colleagues,
>
> i think i asked this here some time before, but maybe there is an update...
>
> 1) Is there a recommendation how to test packages on Windows, if one 
> doesn't have a windows computer available? Travis-ci supports linux+OSX on 
> x86-64 but that's it. (?)
> 2) pkg.julialang.org is run manually (and from time to time, not regular) 
> and tests linux only?
> 3) How to test for julia on non-x86-64 (and btw: what non-x86-64 exists?)?
>
> Wishing a happy day,
> Andreas
>


[julia-users] Re: [ANN] VulkanCore

2016-04-10 Thread Eric Forgy
This looks really cool (was one of my first tweets on my new startup's 
twitter account :))

My world is currently "web". Does Vulkan fit in that world? It is not 
supported by Apple, so does that mean it does not work in Safari? How about 
other browsers?

If Vulkan doesn't fit well in the "web" world, it looks cool enough to get 
me to consider stepping outside my comfort zone :)

I'm looking forward to seeing where this effort goes. Thanks a lot :+1:


Re: [julia-users] What is the correct way to use the type alias Vector and Matrix in multiple dispatch?

2016-04-08 Thread Eric Forgy
julia> foo{T}(A::Vector{Matrix{T}}) = 1

This says: foo is a function with parameter "T" that takes an argument of 
type "Vector{Matrix{T}}".

No problem.

julia> bar(A::Vector{Matrix}) = 1


This says: bar is a function with no parameters that takes an argument of 
type "Vector{Matrix}". 

However, "Vector" is a typealias for "Array{T,1}" for some type "T". So 
whether or not you explicitly state the parameter, "Vector" is still a 
parameterized typed. 

No problem.

baz(A::Vector{Matrix{T}}) = 1

This says: baz is a function with no parameter that takes an argument 
"Vector{Matrix}" with parameter "T".

See the problem? 

To use a parameter, you need to specify that the function has a parameter.

This section of the documentation might be helpful: TypeVars 
.

Hope this helps.

Best regards,
Eric


[julia-users] Small packages?

2016-04-04 Thread Eric Forgy
Hi,

I've been working with Julia for a little while now and notice that I'm 
starting to develop a number of very small packages that I use and reuse 
all the time.

I was curious about your opinions on publishing very small "utility" 
packages? For example, I am consider making a very tiny package the just 
defines a few types that I will use and reuse in many different/distinct 
packages and don't want to redefine them each time. However, once I publish 
the bigger packages, they will have dependencies on these tiny packages, 
which means I'll need to publish these tiny packages too.

Any thoughts? Is that "ok" or is that bad style?

Best regards,
Eric


Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
On Monday, April 4, 2016 at 11:32:23 PM UTC+8, Milan Bouchet-Valat wrote:
>
> Even if that's a bug, calling a type String isn't a great idea given 
> that it's going to be the new name for ASCIIString/UTF8String in Base. 
> Better choose something more explicit. 
>

I hear you, but I do want types corresponding to the Entity Data Model. I 
"think" by keeping things in a small encapsulated module, e.g. EDM.String, 
I should be able to avoid too many train wrecks. I'm also using EDM.Int64 
without disastrous results so far. Fingers crossed :) 


Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
On Monday, April 4, 2016 at 10:54:42 PM UTC+8, Yichao Yu wrote:
>
> Just tried it on master and this looks like a bug. Please file this on 
> the issue tracker. 
>

Ok. Thanks for looking into it Yichao.

https://github.com/JuliaLang/julia/issues/15760 


Re: [julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
Hi Yichao,

> On 4 Apr 2016, at 10:53 PM, Yichao Yu  wrote:
> Do you define your own `String` type in `MyModule` that is different
> from `Base.String`.

Yeah. I just left the office and in a taxi, but this is it:

type String{T<:AbstractString}
value::T
End


[julia-users] WARNING: Base.String is deprecated [Help defining my own "String"]

2016-04-04 Thread Eric Forgy
Hello,

I am doing some work trying to get Julia to play nice with .NET and want to 
define some Julia types corresponding to the Entity Data Model 
.

So far everything is good, but I am getting irritating deprecation warnings 
about Base.String, but I am not using Base.String anywhere as far as I can 
see. I am always using MyModule.String, yet I am still getting these 
warnings.

How can I eliminate the warnings without literally killing the warnings? 
All the code is working fine, so I can try to ignore them, but it is quite 
distracting.

The warnings do not always appear, e.g.

julia> MyModule.String("Hello")
"Hello"

This is good.

However,

julia> MyModule.String
WARNING: Base.String is deprecated, use AbstractString instead.
  likely near no file:0

Is there someway to overwrite some incarnation of "show". I guess it might 
be using Base.String in "show" for some reason.

I THINK this is the culprit that is polluting all my other "shows", so if I 
can sort this out, I hope I'm good everywhere.

I was using 4.2 (on Windows) and thought upgrading to 4.5 might help, but I 
have the same problem on 4.5.

Any ideas?

Thank you.


Re: [julia-users] Re: Julia is a great idea, but it disqualifies itself for a big portion of its potential consumers

2016-04-03 Thread Eric Forgy
Just thinking out loud...

On Sunday, April 3, 2016 at 11:49:33 PM UTC+8, Scott Jones wrote:
>
> What do you think about adding \\ as an integer division operator to Julia?
>

What about just writing some package to allow indexing arrays with 
rationals if this is so important to some people? If the denominator is not 
1, it errors or something.

My experience so far with Julia is that if there is a feature you'd like to 
have that is not in Base, it is easy to add that feature in a package and 
see little loss in performance. It should be easy to write a package that 
introduces arrays with index starting at 0 and it should be easy to write a 
package that indexes arrays with rationals so you can just write things 
like a[10//5].


[julia-users] Re: programatically unquote something

2016-04-01 Thread Eric Forgy
Hi Visesh,

That sounds awesome. It is out of my area, but it reminds me of an effort I 
would love to see progress on:

   - port Julia parser to JavaScript 
   <https://github.com/JuliaLang/julia/issues/2418>
   
That issue was closed in favor of:

   - Support compiling to JavaScript with Emscripten 
   <https://github.com/JuliaLang/julia/issues/9430>
   
Since we just passed April 1:

Stefan's comment on the issue above:

*The Julia parser is written in Scheme and evaluated using Jeff's femtolisp 
implementation. It would be handy for many things, including the web repl 
to be able to parse Julia code in JavaScript. A couple of possible 
approaches exist:*


   1. *Find a JavaScript Scheme implementation and port the existing flisp 
  code to it.*
  2. *Use emscripten <https://github.com/kripken/emscripten> to compile 
  flisp to JavaScript.*
   
*Not sure which approach is better, but this would be an interesting and 
largely self-contained project. See discussion 
here: https://groups.google.com/d/topic/julia-dev/SWkJWxrS5xo/discussion 
<https://groups.google.com/d/topic/julia-dev/SWkJWxrS5xo/discussion>.*


I also remember watching a video where Jeff Bezanson was giving a demo and 
made a comment (paraphrased), "See, Julia is just Lisp". If someone call 
recall that and post a link, it might be of interest to you :)

Best regards,
Eric

On Saturday, April 2, 2016 at 11:37:40 AM UTC+8, vis...@stanford.edu wrote:
>
> Hi Eric,
>
> Thanks for being so helpful.
> My larger goal (and I understand there are others working on this too) is 
> a lisp-looking syntax for julia. 
> I'd like to be able to use Julia's inbuilt macro mechanisms to basically 
> macroexpand a clojure-looking file of code
>
> I can write
>
> (defmacro m [x] '(if ~x 1 0)) 
> (defn f [x] (@m x)) 
>
> and get
>
> macro m(x)
>   :($x ? 1 : 0)
> end
>
> function f(x) @m x end
>
> then also macro expand the module, so
>
> macro m(x)
>   :(if $x 1 0)
> end 
>
> function f(x) x ? 1 : 0 end
>
> and then convert it back, so i get
>
> (defn f [x] (if x 1 0)) 
>
> In that case, I'd be able to use julia as the macroexpander in a process 
> that then can use wisp.js and the like to port everything to js, or hy to 
> port to python, etc. 
> There's really no "need" to do this (can just use cljs or just write js 
> directly for any actual purpose), but I wanted to do some learning about 
> transpilers/macro systems and quoting issues and figured this would be a 
> fun learning project. I also wanted to learn julia and about julia, so it's 
> been very good for that too.
>
> You can see what's going on here:
> https://github.com/vshesh/Sexpr.jl 
>
> The idea about stringifying expressions comes from the fact that I'm 
> trying to write all the modules to file first, so that they all exist if 
> they import symbols from each other (and so I can macro expand them 
> individually). 
>
> this particular issue is showing up because there are reserved words in 
> julia that you can't just print out/stringify and expect to parse back.
>
> Eg for the macro example above, you end up with (if, true, 1, 0) as the 
> form you're returning. Of course, the parser chokes on an empty if followed 
> by a comma, so the solution is to quote it, and get  (:if, true, 1, 0) 
> (quote of a constant = constant). Now I'd need to unquote stuff on the way 
> out after the macro returns something 
> I'm not even sure I'm asking the right questions here; there's a chance 
> I've set up the whole thing the wrong way, but I'm pretty sure it's 
> necessary to translate the forms returned by the macro back into julia 
> (since they come out as s-expressions) and that's where the current two 
> questions are coming from.
>
> Thank you!
> Vishesh
>
>
> On Friday, April 1, 2016 at 6:37:34 PM UTC-7, Eric Forgy wrote:
>>
>> Hi Visesh,
>>
>> I'm interested in your questions and they are similar to things I've 
>> struggled with, but I can't help much so I hope someone else can.
>>
>> BUT... I wonder if you can explain a bit more about what is the big 
>> picture you are trying to achieve? It feels to me that you are trying to do 
>> something slightly un-Julian. If you explain the big picture of what you're 
>> trying to achieve, I suspect someone here can help you find a clean Julian 
>> way to achieve it.
>>
>> So far, your questions are clear, focused and concise, but without a 
>> bigger context, I suspect some experts here are unsure how to help although 
>> they could probably suggest a cleaner app

[julia-users] Re: programatically unquote something

2016-04-01 Thread Eric Forgy
Hi Visesh,

I'm interested in your questions and they are similar to things I've 
struggled with, but I can't help much so I hope someone else can.

BUT... I wonder if you can explain a bit more about what is the big picture 
you are trying to achieve? It feels to me that you are trying to do 
something slightly un-Julian. If you explain the big picture of what you're 
trying to achieve, I suspect someone here can help you find a clean Julian 
way to achieve it.

So far, your questions are clear, focused and concise, but without a bigger 
context, I suspect some experts here are unsure how to help although they 
could probably suggest a cleaner approach.

It sounds like you want to read an expression for a file? Is that right? If 
so, that doesn't "feel" right to me.

In any case, good luck and welcome to Julia :)

Best regards,
Eric

On Saturday, April 2, 2016 at 8:56:48 AM UTC+8, vis...@stanford.edu wrote:
>
> oh wait, is it eval?
>
> eval(:(:x)) -> :x?
>
> On Friday, April 1, 2016 at 5:52:42 PM UTC-7, vis...@stanford.edu wrote:
>>
>> > x = :(:x)
>> > $x
>>
>> *ERROR: unsupported or misplaced expression $*
>>
>>
>> Is there a quote/unquote function that mimics the behavior or what 
>> happens when you wrap something with :() or do $x? I want to retrieve 
>> what's inside the variable x's expression.
>>
>> It's not sufficient to just wrap in Expr(:quote, ...) since that's not 
>> the same as :() and similarly I can't find any documentation on how to 
>> unquote something.
>>
>> There must be some routine being called in order to do the 
>> quoting/unquoting - is there a way to access it?
>>
>>
>> Vishesh
>>
>

Re: [julia-users] git protocol packages

2016-03-31 Thread Eric Forgy
PS: This also means Travis and Appveyor no longer work for me when the package 
I'm testing depends on other private repos. I really hope a solution to this 
problem can be found.

Re: [julia-users] git protocol packages

2016-03-31 Thread Eric Forgy
I have the same issue with private repos and SSH on Windows. It was working 
fine before the switch.

Re: [julia-users] ANN: Quantumoptics.jl - a quantum optics toolbox for julia

2016-03-26 Thread Eric Forgy
Hi Sebastian,

I agree with the above comments. The documentation is super nice. Makes me 
wish I had a use for the package, but my days of QM are far behind me :)

It looks like there might be some minor formatting issue on this page 
though:

https://bastikr.github.io/QuantumOptics.jl/particle.html

Just FYI (and to let you know I enjoyed reading the entire docs from 
beginning to end :))

Best regards,
Eric


[julia-users] Re: string function for expressions: surgically add a specific method to a recursion chain

2016-03-23 Thread Eric Forgy
Hi Vishesh,

I'm not an expert, but one thought that comes to mind is to* not* import 
Base.string. Then you can just define a "string" function local to your 
module and then call Base.string, when you want to use the Base Julia 
"string". By importing Base.string and then defining string, you are 
changing the nature of Base Julia "string", which doesn't sound like a good 
idea to me.

Hope this helps.

Eric

On Wednesday, March 23, 2016 at 11:09:04 AM UTC+8, vis...@stanford.edu 
wrote:
>
> Hi,
>
> I'd like to understand how one can surgically add a piece to a long type 
> chain of something like string in julia.
>
> Say I want to update the printing of expression objects. 
>
> So:
>
> module M
> import Base.string
> function string(ex::Expr)
>   if ex.head == :$
> string("\$(", map(string, ex.args)..., ")")
>   else 
> Base.string(ex)
>   end
> end 
> end
>
> However, if it executes the last command in the list, this somehow calls 
> my string function rather than the Base string function, leading to an 
> infinite recursion.
>
> If I name the function differently and don't override Base.string, eg:
>
> module M
> function tostring(ex::Expr)
>   if ex.head == :$
> string("\$(", map(tostring, ex.args)..., ")")
>   else 
> string(ex)
>   end
> end 
> end
>
> then the string(ex) call never calls tostring again (for obvious reasons).
>
> Which means that if I want to implement my own custom string function on 
> expressions, I have to actually replicate the logic for EVERY type 
> possible, which is a LOT of work. I'd rather not do this, and I was hoping 
> to understand why I can't just exist as a new method definition that will 
> work only on a specific type (expr) in this case, and do what would 
> normally be right in other cases. 
>
> Vishesh
>
>

Re: [julia-users] DataFrame from string

2016-03-22 Thread Eric Forgy
On Tuesday, March 22, 2016 at 5:12:35 PM UTC+8, Milan Bouchet-Valat wrote:
>
> I never said it would be added to Base. I should have been a bit more 
> explicit, but I was referring to the next version of DataFrames.jl. 
>

Phew. That makes sense. So I was confused. Not the first time and won't be 
the last. Thanks for clarifying :) 


Re: [julia-users] DataFrame from string

2016-03-21 Thread Eric Forgy
On Tuesday, March 22, 2016 at 12:09:32 AM UTC+8, Milan Bouchet-Valat wrote:
>
> And with the next release (available from git master) you will be able 
> to do this directly: 
> df = csv""" 
> 1, 7.6 
> 2, 45.6 
> 3, 12.1 
> ... 
> """ 
>

This looks cool and my first reaction was, "Neat!", but why base Julia? 
Will it support string interpolation, e.g.

x = 7.6
df = csv"""
1, $x
2, 45.6
3, 12.1
...
"""

This seems like something suitable for nice package, but confused why it 
would be added to base (when I thought one goal was to make base smaller). 
I am probably confused :)


[julia-users] Re: Announcing JuDE: autocomplete and jump to definition support for Atom

2016-03-20 Thread Eric Forgy
*drool*

That looks awesome. Can't wait to try it out. Thanks!

[julia-users] Re: SI prefixes (M, k, m, u, n, ...)

2016-03-15 Thread Eric Forgy
Hi MA,

I like your idea and I also wonder about registering small packages. I'm 
actually a fan of it so I'd say go for it, but curious to know what others 
think.

Have you seen SIUnits.jl ? It shares 
some similarities, but in the context of SI units, e.g. it wouldn't handle 
10.75n, but it would handle 10.75nm.

Cheers!

On Wednesday, March 16, 2016 at 2:08:27 AM UTC+8, MA Laforge wrote:
>
> I often find it useful to display values using SI prefixes.
>
> For example, I find:
> 10.75n
>
> to be more readable than:
> 1.075e-8
>
> ...So I created a module for this functionality:
> https://github.com/ma-laforge/NumericIO.jl
>
> *Question:*
> Should I be publishing this to METADATA?  It seems a bit heavy to register 
> an entire module for this simple functionality.
>
> Is there something else to do that would be more appropriate (a better 
> place for this functionality)?
>
> *Comment:*
> This module makes use of Grisu, which I do not believe is a public feature 
> of Julia... So I am not convinced it is technically "acceptable" to rely on 
> it from an external module.
>
> MA
>


[julia-users] Re: can't get pyjulia to work

2016-03-14 Thread Eric Forgy
Btw, I had a quick look at pyjulia. It is very cool and works with 
PyCall.jl to handles conversions etc. My solution is much less grand, but 
would work if the arguments to your calls to Julia are simple and could be 
serialized to JSON.

On Tuesday, March 15, 2016 at 8:34:03 AM UTC+8, Eric Forgy wrote:
>
> I have never used Python, but hearing your scenario, I wonder if a Julia 
> API might be acceptable?
>
> Yesterday, I've submitted a package to METADATA I use quite a lot for my 
> own work with similar scenarios (Pages 
> <https://github.com/EricForgy/Pages.jl>). I use it mostly for calling 
> Julia from JavaScript (and vice versa), but it would work for any language 
> that supports HTTP requests and WebSockets.
>
> If it interested, I could help get you set up so you can start 
> experimenting with it.
>
> PS: Until it is merged to METADATA (:pray:), the installation instructions 
> would be
>
> Pkg.clone("https://github.com/EricForgy/Pages.jl.git";)
>
> instead of 
>
> Pkg.add("Pages")
>
> Best regards,
> Eric
>


[julia-users] Re: can't get pyjulia to work

2016-03-14 Thread Eric Forgy
I have never used Python, but hearing your scenario, I wonder if a Julia 
API might be acceptable?

Yesterday, I've submitted a package to METADATA I use quite a lot for my 
own work with similar scenarios (Pages 
). I use it mostly for calling Julia 
from JavaScript (and vice versa), but it would work for any language that 
supports HTTP requests and WebSockets.

If it interested, I could help get you set up so you can start 
experimenting with it.

PS: Until it is merged to METADATA (:pray:), the installation instructions 
would be

Pkg.clone("https://github.com/EricForgy/Pages.jl.git";)

instead of 

Pkg.add("Pages")

Best regards,
Eric


[julia-users] Re: Julia crashes at startup on Windows

2016-03-14 Thread Eric Forgy
I had something similar happen on one of my machines and the answer was the 
antivirus software thought Julia was a virus. Have a look at the antivirus 
software and make sure that Julia is clear.

Hope this helps.

On Tuesday, March 15, 2016 at 6:39:23 AM UTC+8, danie...@gmail.com wrote:
>
> A colleague was trying to install Julia on his Windows machine.  He 
> downloaded the self-extracting archive, extracted it, and then tried to 
> launch Julia.  It showed a blank console for a few seconds, and then 
> closed.  I had him try the nightly build, and it failed in the same way.
>
> He opened up a console manually and pasted in the julia.exe path, and was 
> able to get this output as Julia crashed:
>
>
> C:\windows\system32>C:\Users\pcuthber\AppData\Local\Julia-0.5.0-dev\bin\julia.exe
> A s s e r t i o n f a i l e d !
> P r o g r a m : C : \ U s e r s \ p c u t h b e r \ A p p D a t a \ L o c 
> a l
> \ J u l i a - 0 . 5 . 0 - d e v \ b i n \ j u l i a . e x e
> F i l e : / h o m e / A d m i n i s t r a t o r / b u i l d b o t / s l a 
> v e
> / p a c k a g e _ w i n 6 _ 2 - x 6 4 / b u i l d / d e p s / s r c c a c 
> h e /
> l i b u v / s r c / u v - c o m m o n . c , L i n e 8 3
> E x p r e s s i o n : 0
>
>
> Any ideas as to what is going on?
>
> Thank you!
>
> Daniel
>


Re: [julia-users] Re: a excellent Julia IDE, JuliaDT

2016-03-10 Thread Eric Forgy
On Friday, March 11, 2016 at 10:29:12 AM UTC+8, Eric Forgy wrote:
>
> Hope this gets sorted soon :pray: :D
>

Prayers answered. It is working for me again. Thanks! :) 


Re: [julia-users] Re: a excellent Julia IDE, JuliaDT

2016-03-10 Thread Eric Forgy
On Thursday, March 10, 2016 at 10:43:12 PM UTC+8, Mike Innes wrote:
>
> Yes, the old Juno on LightTable was starting to code rot badly – we've 
> taken those binaries down now. In Atom you'll find that you can get the 
> same features through the julia-client plugin.
>

But woe be to you if you have a space in your Windows user name :)

https://github.com/JunoLab/atom-julia-client/issues/128

Hope this gets sorted soon :pray: :D


[julia-users] Re: String interpolation question

2016-03-09 Thread Eric Forgy


On Thursday, March 10, 2016 at 12:08:25 PM UTC+8, Eric Forgy wrote:
>
> I was also trying my package StringInterpolations.jl. I could get this to 
> work:
>
> x = 2
> @interpolate "I like \$x"
>
> But this did not work
>
> x = 2
> s = "I like \$x"
> @interpolate s
>
> In the former case, the argument is a string. In the latter, the argument 
> is a symbol. Any idea how I can fix this?
>
> Here is the line in my package:
>
>
> https://github.com/EricForgy/StringInterpolation.jl/blob/master/src/interpolate.jl#L53
>

In my second example above, 

x = 2
s = "I like \$x"
@interpolate s

the macro is taking `s` to be a symbol when I want the string passed into 
the macro. How do I that? 


Re: [julia-users] Re: What to read to understand finishing v0.5?

2016-03-09 Thread Eric Forgy
On Thursday, March 10, 2016 at 2:00:46 PM UTC+8, Viral Shah wrote:
>
> Not relevant here, but I also feel that we are closing in on 1.0. Maybe 
> another release or two after 0.5.
>

+1 (or should that be +1.0) :D


[julia-users] Re: String interpolation question

2016-03-09 Thread Eric Forgy
Thanks Scott. I thought of that, but couldn't see immediately how to do 
what I wanted. Could you help? :)

Btw, J Luis, thanks but notice the "\$" :) It certainly works without the 
"\" already :)

I was also trying my package StringInterpolations.jl. I could get this to 
work:

x = 2
@interpolate "I like \&x"

But this did not work

x = 2
s = "I like \$x"
@interpolate s

In the former case, the argument is a string. In the latter, the argument 
is a symbol. Any idea how I can fix this?

Here is the line in my package:

https://github.com/EricForgy/StringInterpolation.jl/blob/master/src/interpolate.jl#L53


On Thursday, March 10, 2016 at 1:25:06 AM UTC+8, Scott Jones wrote:
>
> If you're interested, try out what I was working on in 
> https://github.com/ScottPJones/StringUtils.jl/pull/1 
> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FScottPJones%2FStringUtils.jl%2Fpull%2F1&sa=D&sntz=1&usg=AFQjCNGrR-Zq17BBxXUWpTPkdQEJA-NHnQ>,
>  
> combination of Swift style interpolation, Emoji, LaTex and Unicode 
> character literals, and in-line formatting for interpolated expressions.
>
> On Wednesday, March 9, 2016 at 8:59:47 AM UTC-5, Eric Forgy wrote:
>>
>> If I have
>>
>> x = 2
>> s = "I like \$x"
>>
>>
>> Is there a nice way to get
>>
>> "I like 2"
>>
>>
>> ?
>>
>>

[julia-users] String interpolation question

2016-03-09 Thread Eric Forgy
If I have

x = 2
s = "I like \$x"


Is there a nice way to get

"I like 2"


?



Re: [julia-users] Meshgrid function

2016-03-07 Thread Eric Forgy
That's awesome Tomas. Thanks for the lesson :D


[julia-users] Re: Julia for app development using react native and emscripten/WASM (or other)

2016-03-05 Thread Eric Forgy
Hi datnamer,

Have you seen this?

   - Support compiling to JavaScript with Emscripten 
   
   
I am looking forward to this capability. WebAssembly 
 looks very promising too.

Cheers,
Eric


On Sunday, March 6, 2016 at 10:47:02 AM UTC+8, datnamer wrote:
>
> Hi everyone.
>
> Question about julia's future utility for univeral app developement.
>
> Will static compile and emscripten eventually allow Julia to compile to JS 
> that can be used in react native? 
>
> What are the other potential avenues for Julia mobile and multi platform 
> apps? 
>
> Thanks 
>
>
>
>
>

[julia-users] OAuth 2.0 and Azure AD

2016-03-05 Thread Eric Forgy
Hi,

I am trying to write a "trusted" application in Julia that can login 
silently to Azure AD using known credentials (username/password). I found 
some ways to do this with .NET libraries, but having trouble reverse 
engineering them to a point I can implement the same in Julia.

It is probably a long shot, but I was wondering if anyone has had any luck 
logging in Azure AD from Julia silently without being prompted for 
username/password?

Any ideas would be greatly appreciated. I've been scratching my head for a 
couple days now.

Thanks!

Best regards,
Eric


  1   2   3   >