Re: [julia-users] Generating function with macro inside a module, the function depending on a type defined outside the module

2016-01-15 Thread Lutfullah Tomak
Erik's suggestion works if I write 'Main.Foo' (Replace 'Main' whatever module 
'Foo' is defined) instead of 'Foo' in the macro 'mac'.

[julia-users] Chars with ending double quotes

2016-01-15 Thread Pablo Zubieta
Is there a particular reason for the following to be valid Chars?

'\""'
'\"""' # or any number of "s
'\a"'
'\Ψ"""'

More generally the pattern '\[Any valid code point][Any number of "]' seems 
to be a valid Char.




Re: [julia-users] Re: signal handling

2016-01-15 Thread John Travers
Thanks for all of your consideration of this. I had noted that libuv 
already exposes signals (and is already used in some places in base julia 
for this) in the github issue I mentioned.

On Friday, January 15, 2016 at 5:53:12 AM UTC+1, ele...@gmail.com wrote:
>
> Update libuv already has signal handling, giving a callback in normal 
> context.  So it "just" needs some Julia interfacing.
>
> On Friday, January 15, 2016 at 11:26:45 AM UTC+10, ele...@gmail.com wrote:
>>
>> Would need to look to see if notify() only uses things that are allowed 
>> in a signal handler, then it could be a good way to do it.
>>
>> [Note: I suspect notify() causes stack manipulations and those are not 
>> allowed in the signal handler, but I am not able to check right now]
>>
>>
>> On Friday, January 15, 2016 at 10:31:57 AM UTC+10, Eric Forgy wrote:
>>>
>>> I wonder if you can do what you want to do using Tasks and Conditions 
>>> ? 
>>> Your use case seems tailored for these guys.
>>>
>>

Re: [julia-users] Generating function with macro inside a module, the function depending on a type defined outside the module

2016-01-15 Thread Lutfullah Tomak
And also no need for f=@mac() just use @mac() instead.

Re: [julia-users] Generating function with macro inside a module, the function depending on a type defined outside the module

2016-01-15 Thread amiksvi
Thanks Erik for the suggestion, unfortunately this doesn't seem to work...


Re: [julia-users] Chars with ending double quotes

2016-01-15 Thread Stefan Karpinski
No, that's a bug! Can you file an issue?

On Fri, Jan 15, 2016 at 7:42 AM, Pablo Zubieta  wrote:

> Is there a particular reason for the following to be valid Chars?
>
> '\""'
> '\"""' # or any number of "s
> '\a"'
> '\Ψ"""'
>
> More generally the pattern '\[Any valid code point][Any number of "]'
> seems to be a valid Char.
>
>
>


Re: [julia-users] Cannot pull with rebase...?

2016-01-15 Thread fabian
"Pkg.dir()" give the same "Cannot pull with rebase..." error message.

Thanks.

On Wednesday, January 13, 2016 at 5:12:37 PM UTC+1, Stefan Karpinski wrote:
>
> What is the result of `Pkg.dir()`  in the Julia REPL? That's where your 
> packages live and the METADATA repo.
>
> On Wed, Jan 13, 2016 at 10:36 AM,  
> wrote:
>
>> Thanks for the reply. Unfortunately, I cannot find any such folder. This 
>> is the binary 64-bit version of Julia 0.4.2 on W10x64pro. I expected this 
>> to just install and run, but apparently this is not the case, at least not 
>> on W10...
>>
>>
>> On Tuesday, January 12, 2016 at 4:48:22 PM UTC+1, Stefan Karpinski wrote:
>>>
>>> If you go into ~/.julia/v0.4/METADATA and do `git status` you should see 
>>> what's going on there.
>>>
>>> On Tue, Jan 12, 2016 at 10:41 AM,  wrote:
>>>
 Hello all 
 (first post)

 I just now downloaded version 0.4.2 of Julia, and installed it on my 
 W10x64pro machine. I was going to use it to run the optimization packages, 
 so I did the Pkg.update() on the Julia cmd line, as instructed here 
 http://www.juliaopt.org/.

 To my surprise, i get the following error message:

 INFO: Updating METADATA...
 error: Cannot pull with rebase: You have unstaged changes.
 ERROR: failed process: Process(`git pull --rebase -q`, 
 ProcessExited(1)) [1]
  in pipeline_error at process.jl:555

 I have not done any changes to any source, just DL'ed and installed the 
 64-bit binary for windows, and I have no clue what is going on... Does 
 anyone have any ideas?

 Thanks.

>>>
>>>
>

Re: [julia-users] Chars with ending double quotes

2016-01-15 Thread Pablo Zubieta
I thought so. I filed and issue here:

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


Re: [julia-users] Re: Packages for multi-user install

2016-01-15 Thread jkrometi
Thank you for your help. I tried experimenting with LOAD_PATH a bit before 
I made this post and I couldn't get it to work. Here's an example - I have 
previously using Pkg.add() to add PyPlot to ~/.julia/gcc. However, if I try 
adding that directory to LOAD_PATH (via environment variables) then I am 
not able to use PyPlot:

[username@nrlogin1 01/15 09:38:08 ~]$ export JULIA_LOAD_PATH="/home/username
/.julia/gcc"
[username@nrlogin1 01/15 09:38:13 ~]$ ~/apps/gcc/5.2.0/julia/0.4.2/bin/julia
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.2 (2015-12-06 21:47 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/   |  x86_64-unknown-linux-gnu

julia> LOAD_PATH
3-element Array{ByteString,1}:
 "/home/username/.julia/gcc"
 "/home/username/apps/gcc/5.2.0/julia/0.4.2/local/share/julia/site/v0.4"
 "/home/username/apps/gcc/5.2.0/julia/0.4.2/share/julia/site/v0.4"  
julia> using PyPlot
ERROR: ArgumentError: PyPlot not found in path
 in require at ./loading.jl:233

julia> exit()


By contrast (mostly to show that PyPlot is indeed in that directory), 
PyPlot can be loaded and used if I set JULIA_PKGDIR to point to this 
directory:

[username@nrlogin1 01/15 09:38:22 ~]$ export JULIA_PKGDIR="/home/username
/.julia/gcc"
[username@nrlogin1 01/15 09:38:33 ~]$ ~/apps/gcc/5.2.0/julia/0.4.2/bin/julia
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.2 (2015-12-06 21:47 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/   |  x86_64-unknown-linux-gnu

julia> using PyPlot

julia> plot(1:100,sort(rand(100,)))
1-element Array{Any,1}:
 PyObject 

julia> close("all")

julia> exit()


The latter obviously won't work for what I want to do since I want users to 
be able to have their own PKGDIR where they can add packages that they 
need. Am I doing something incorrectly? 

Side note: If I do end up getting LOAD_PATH to work as you say, I suppose 
installing the global packages to one of the directories prepopulated into 
LOAD_PATH would be the "best practice"?

"/home/username/apps/gcc/5.2.0/julia/0.4.2/local/share/julia/site/v0.4"
"/home/username/apps/gcc/5.2.0/julia/0.4.2/share/julia/site/v0.4"  



On Thursday, January 14, 2016 at 10:34:14 PM UTC-5, Yichao Yu wrote:
>
> On Thu, Jan 14, 2016 at 10:26 PM, Tony Kelman  > wrote: 
> > You can add system-wide packages to LOAD_PATH while keeping the local 
> > Pkg.dir (maybe modify the JULIA_PKGDIR environment variable for the 
> initial 
> > installation of the system-wide packages). Not all packages work when 
> used 
> > from outside Pkg.dir, and Pkg operations often don't see them, but you 
> can 
> > try and see what works vs what doesn't. 
>
> Most packages I've tested works pretty well. (Just don't expect 
> `Pkg.*` to work). It's also usually not very hard to fix if it doesn't 
> work. 
>
> > 
> > 
> > On Thursday, January 14, 2016 at 9:11:20 AM UTC-8, jkro...@vt.edu 
> wrote: 
> >> 
> >> I work on a large compute cluster used by hundreds of university 
> >> researchers. Our scientific applications stack is managed via RPM. I 
> would 
> >> like to provide users with a Julia build that: 
> >> (1) Includes Julia base 
> >> (2) Provides some commonly-used secondary packages - the main ones that 
> I 
> >> have in mind right now are the plotting packages Gadfly and PyPlot and 
> >> perhaps also IJulia. But there may be others down the line. I want to 
> >> provide these centrally because many, many users will want to use them 
> and I 
> >> want to lower the barrier to entry. I also would like to figure out the 
> >> matplotlib dependencies in PyPlot for them so that they don't have to. 
> >> 
> >> The idea is to provide a base install that will be enough for many 
> users 
> >> (at least to get started); they can then use Pkg to add any other 
> packages 
> >> that they require. 
> >> 
> >> Is there a recommended method for centrally-installing packages like in 
> >> (2) while also allowing users to maintain additional packages in their 
> Home 
> >> directories? I have not been able to track down documentation for this. 
> >> 
> > 
>


Re: [julia-users] Generating function with macro inside a module, the function depending on a type defined outside the module

2016-01-15 Thread amiksvi
Indeed it works... I have no idea why but I needed to reboot.
Many thanks to both of you!


Re: [julia-users] Re: Packages for multi-user install

2016-01-15 Thread jkrometi
Disregard my previous note. I believe that I just needed to add "/v0.4" to 
the end of the path that I was adding to LOAD_PATH. I was confused by the 
fact that PKGDIR appends that automatically. I think I am probably good to 
go on this now.
Thank you for your help!
Justin


[julia-users] Curious behavior

2016-01-15 Thread David Gleich
Julia managed to surprise me today. I'm wondering how to understand what 
happens in this case and if it's a side effect of some design decision or 
syntax -- or a bug.

The following code executes without any errors

for i=1:5
for j=1:5
if i == j
blah
end
end
end

and "blah" can be anything you want! I discovered this because I had 

for i=1:5
for j=1:5
if i == j
contine # continue mis-spelled
end
end
end

This code executes and runs when pasted into the console or as part of a 
function in:

Julia-0.4 (in console and via ipython notebook), Julia-0.4.2 (on Juliabox) 
and Julia-0.5-dev (on Juliabox)

What I would have expected is some type of error such as "blah" is not 
defined, e.g.

julia> function myans()
 blah
   end
myans (generic function with 1 method)

julia> myans()
ERROR: UndefVarError: blah not defined
 in myans at none:2

It seems like this is likely some type of design implication because:

julia> function myans()
 blah
 1
   end
myans (generic function with 1 method)

julia> myans()
1

Any insights would be awesome for my own understanding!

Thanks,
David Gleich



Re: [julia-users] Curious behavior

2016-01-15 Thread Keno Fischer
See https://github.com/JuliaLang/julia/issues/6846

On Fri, Jan 15, 2016 at 9:51 PM, David Gleich  wrote:

> Julia managed to surprise me today. I'm wondering how to understand what
> happens in this case and if it's a side effect of some design decision or
> syntax -- or a bug.
>
> The following code executes without any errors
>
> for i=1:5
> for j=1:5
> if i == j
> blah
> end
> end
> end
>
> and "blah" can be anything you want! I discovered this because I had
>
> for i=1:5
> for j=1:5
> if i == j
> contine # continue mis-spelled
> end
> end
> end
>
> This code executes and runs when pasted into the console or as part of a
> function in:
>
> Julia-0.4 (in console and via ipython notebook), Julia-0.4.2 (on Juliabox)
> and Julia-0.5-dev (on Juliabox)
>
> What I would have expected is some type of error such as "blah" is not
> defined, e.g.
>
> julia> function myans()
>  blah
>end
> myans (generic function with 1 method)
>
> julia> myans()
> ERROR: UndefVarError: blah not defined
>  in myans at none:2
>
> It seems like this is likely some type of design implication because:
>
> julia> function myans()
>  blah
>  1
>end
> myans (generic function with 1 method)
>
> julia> myans()
> 1
>
> Any insights would be awesome for my own understanding!
>
> Thanks,
> David Gleich
>
>


[julia-users] Re: Packages for multi-user install

2016-01-15 Thread jkrometi
In case it's helpful to others, this is what I wound up with for the %build 
section of my spec file. So far it seems to work pretty well.

#Building requires cmake
module load cmake

# Use MKL for Intel
%if "%is_intel" == "1"
module load mkl

cat > Make.user<> Make.user<

[julia-users] Compiling Julia on Amazon EC2

2016-01-15 Thread Lars Ruthotto
I need some help installing julia on the Amazon EC2. I chose Linux Server 
and after installing a few packages (like git, gcc,..) I was able to 
compile julia by typing

git clone https://github.com/JuliaLang/julia.git
cd julia
git checkout release-0.4
make

All seemed to work fine, so I created an image and loaded it on a bunch of 
other instances. Starting julia on these instances  gave me an error:

ERROR: Target architecture mismatch. Please delete or regenerate 
sys.{so,dll,dylib}.

Is there anything I can do to prevent this from happening? Maybe setting 
MARCH or JULIA_CPU_TARGET when compiling julia?

Thanks,
Lars


[julia-users] VirtualArrays.jl

2016-01-15 Thread Samuel Massinon
A way to concatenate arrays without copying values.

https://github.com/invenia/VirtualArrays.jl


Re: [julia-users] VirtualArrays.jl

2016-01-15 Thread Yichao Yu
On Fri, Jan 15, 2016 at 5:51 PM, Samuel Massinon
 wrote:
> A way to concatenate arrays without copying values.
>
> https://github.com/invenia/VirtualArrays.jl

FYI, don't call eval in functions


[julia-users] Re: Compiling Julia on Amazon EC2

2016-01-15 Thread Tony Kelman
Yeah, try building with MARCH=x86-64 as a common minimum. Or if you know 
the oldest type of server any of these will run on you could pick something 
slightly newer.


On Friday, January 15, 2016 at 1:48:24 PM UTC-8, Lars Ruthotto wrote:
>
> I need some help installing julia on the Amazon EC2. I chose Linux Server 
> and after installing a few packages (like git, gcc,..) I was able to 
> compile julia by typing
>
> git clone https://github.com/JuliaLang/julia.git
> cd julia
> git checkout release-0.4
> make
>
> All seemed to work fine, so I created an image and loaded it on a bunch of 
> other instances. Starting julia on these instances  gave me an error:
>
> ERROR: Target architecture mismatch. Please delete or regenerate 
> sys.{so,dll,dylib}.
>
> Is there anything I can do to prevent this from happening? Maybe setting 
> MARCH or JULIA_CPU_TARGET when compiling julia?
>
> Thanks,
> Lars
>