Re: [julia-users] Anyone running into a build error on latest master on OSX?

2016-01-20 Thread Isaiah Norton
Probably outdated/mismatched XCode version leading to some error earlier in
the build. See:
https://github.com/JuliaLang/julia/issues/14593
https://github.com/JuliaLang/julia/pull/14605

On Wed, Jan 20, 2016 at 7:59 PM, Jonathan Goldfarb 
wrote:

> Not sure if this is the place for this kind of discussion, but here goes.
> Been building from source from master periodically and enjoying poking
> around in the source, but have run into an issue apparently due to the
> updated LLVM version, and am wondering if anyone else is having similar
> issues. After removing (I think) everything, including "brew rm --force
> $(brew deps --HEAD julia);", I tried the following:
>
> - brew install git gcc
> - clone julia repo to clean directory
> - Add
>
> BUILD_LLVM_CLANG=1
> to Make.user as suggested by Clang.jl/Cxx.jl (removing this step does not 
> apparently fix the build, but changes the error)
>
> - run make
>
> and have gotten the following:
>
> llvm[6]: Copying runtime library darwin/eprintf to build dir
> cp:
> /Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/tools/clang/runtime/compiler-rt/clang_darwin/eprintf/libcompiler_rt.a:
> No such file or directory
> make[6]: ***
> [/Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/Release/lib/clang/3.7.1/lib/darwin/libclang_rt.eprintf.a]
> Error 1
> make[5]: *** [compiler-rt/.makeall] Error 2
> make[4]: *** [all] Error 1
> make[3]: *** [clang/.makeall] Error 2
> make[2]: *** [all] Error 1
> make[1]: *** [build/llvm-3.7.1/build_Release/Release/lib/libLLVMCodeGen.a]
> Error 2
> make: *** [julia-deps] Error 2
>
> Searching online suggests that this was an error with an older version of
> clang/LLVM, but it appears here again.
>
> Anybody else running into this?
>
> Regards,
> Max
>


Re: [julia-users] Anyone running into a build error on latest master on OSX?

2016-01-20 Thread Jonathan Goldfarb
I'd be inclined to agree, but along the way I had tried xcode-select
--install, which has no effect, and gives the error that the command line
tools were already installed. I read somewhere that installing the full
xcode app is necessary (or does this just run some kind of update?)

On Wed, Jan 20, 2016 at 9:21 PM Isaiah Norton 
wrote:

> Probably outdated/mismatched XCode version leading to some error earlier
> in the build. See:
> https://github.com/JuliaLang/julia/issues/14593
> https://github.com/JuliaLang/julia/pull/14605
>
> On Wed, Jan 20, 2016 at 7:59 PM, Jonathan Goldfarb 
> wrote:
>
>> Not sure if this is the place for this kind of discussion, but here goes.
>> Been building from source from master periodically and enjoying poking
>> around in the source, but have run into an issue apparently due to the
>> updated LLVM version, and am wondering if anyone else is having similar
>> issues. After removing (I think) everything, including "brew rm --force
>> $(brew deps --HEAD julia);", I tried the following:
>>
>> - brew install git gcc
>> - clone julia repo to clean directory
>> - Add
>>
>> BUILD_LLVM_CLANG=1
>> to Make.user as suggested by Clang.jl/Cxx.jl (removing this step does not 
>> apparently fix the build, but changes the error)
>>
>> - run make
>>
>> and have gotten the following:
>>
>> llvm[6]: Copying runtime library darwin/eprintf to build dir
>> cp:
>> /Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/tools/clang/runtime/compiler-rt/clang_darwin/eprintf/libcompiler_rt.a:
>> No such file or directory
>> make[6]: ***
>> [/Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/Release/lib/clang/3.7.1/lib/darwin/libclang_rt.eprintf.a]
>> Error 1
>> make[5]: *** [compiler-rt/.makeall] Error 2
>> make[4]: *** [all] Error 1
>> make[3]: *** [clang/.makeall] Error 2
>> make[2]: *** [all] Error 1
>> make[1]: ***
>> [build/llvm-3.7.1/build_Release/Release/lib/libLLVMCodeGen.a] Error 2
>> make: *** [julia-deps] Error 2
>>
>> Searching online suggests that this was an error with an older version of
>> clang/LLVM, but it appears here again.
>>
>> Anybody else running into this?
>>
>> Regards,
>> Max
>>
>
> --
Regards,
Max Goldfarb


[julia-users] immutability, value types and reference types?

2016-01-20 Thread asynth
Julia's immutable types are value types and mutable types are reference 
types. In the Julia docs on types there is a paragraph that begins:

 "It is instructive, particularly for readers whose background is C/C++, to 
consider why these two properties go hand in hand. [...]" 

However this paragraph only explains why value types should be immutable, 
it doesn't describe why you can't define a reference type that is 
immutable. So, why not? 


Re: [julia-users] interp1-like functionality from Grid.jl

2016-01-20 Thread argel . ramirez
Cant get it to work, maybe i'm not understanding something. Can you help me?
On Julia V 4.0.2:

AltInterp = 
> CoordInterpGrid(Znw,squeeze(Altura_segun_corte[xx,yy,:],(1,2)),BCnil,InterpLinear);
>
throws:

> ERROR: LoadError: MethodError: `convert` has no method matching 
> convert(::Type{Grid.CoordInterpGrid{T<:AbstractFloat,N,BC<:Grid.BoundaryCondition,IT<:Grid.InterpType,R}},
>  
> ::Array{Float64,1}, ::Array{Float64,1}, ::Type{Grid.BCnil}, 
> ::Type{Grid.InterpLinear})
> This may have arisen from a call to the constructor 
> Grid.CoordInterpGrid{T<:AbstractFloat,N,BC<:Grid.BoundaryCondition,IT<:Grid.InterpType,R}(...),
> since type constructors fall back to convert methods.
> Closest candidates are:
>   Grid.CoordInterpGrid{N,T<:AbstractFloat}(::NTuple{N,Range{T}}, 
> ::Array{T<:AbstractFloat,N}, ::Any...)
>   Grid.CoordInterpGrid{R<:Range{T},T<:AbstractFloat}(::R<:Range{T}, 
> ::Array{T<:AbstractFloat,1}, ::Any...)
>   call{T}(::Type{T}, ::Any)
>   ...
>  in call at essentials.jl:57
>  [inlined code] from Cortes_horizontales_U_V_mod2.jl:46
>  in anonymous at no file:0
>  in include at ./boot.jl:261
>  in include_from_node1 at ./loading.jl:304
> while loading Cortes_horizontales_U_V_mod2.jl, in expression starting on 
> line 42
>

I can't understand nothing from this error message! my variables in here 
are:
 

>  julia> typeof(Znw)
> Array{Float64,1}
>
> julia> typeof(squeeze(Altura_segun_corte[1,1,:],(1,2)))
> Array{Float64,1}
>
> julia> sizeof(Znw)
> 224
>
> julia> sizeof(squeeze(Altura_segun_corte[1,1,:],(1,2)))
> 224
>
> What would the problem be? 

El sábado, 19 de abril de 2014, 11:06:30 (UTC-5), Simon Byrne escribió:
>
> I actually wanted this functionality myself. See
> https://github.com/timholy/Grid.jl/pull/14
>
> On Thursday, 17 April 2014 13:26:57 UTC+1, Tim Holy wrote:
>>
>> That's fine. That's how it always works; things happen in Julia when 
>> someone 
>> finds the time to do them. 
>>
>> --Tim 
>>
>> On Wednesday, April 16, 2014 10:07:46 PM Spencer Lyon wrote: 
>> > I'd love to beef up this wrapper type and add it to grid, but 
>> unfortunately 
>> > I wont' be able to get to it for a while -- probably late June. 
>> > 
>> > On Tuesday, April 15, 2014 9:06:57 AM UTC-4, Tim Holy wrote: 
>> > > On Tuesday, April 15, 2014 05:35:27 AM Spencer Lyon wrote: 
>> > > > It seems to me that this would be fairly standard functionality. I 
>> am 
>> > > 
>> > > sure 
>> > > 
>> > > > there is a benefit to having the default getindex methods deal in 
>> “index 
>> > > > units” instead of physical ones, but I can’t tell what that benefit 
>> is? 
>> > > 
>> > > Is 
>> > > 
>> > > > there a reason you chose to have it set up the way it is? 
>> > > 
>> > > When physical units = indexing units, you save one multiply and one 
>> add on 
>> > > each interpolation operation. So it's best to implement the base 
>> operation 
>> > > "minimally," and add wrapper types that require more operations 
>> around it. 
>> > > I've not personally ever needed anything else (I mostly do 
>> interpolation 
>> > > on 
>> > > images), and no one else has added it to Grid, either. 
>> > > 
>> > > If you wanted to add your wrapper type to Grid, I think that would be 
>> > > great. 
>> > > Some additional things to think about: 
>> > > - Derivatives (here, the chain rule is your friend) 
>> > > - Dimensions higher than 1 
>> > > - It's no longer just a shift, it's also scaled, so a name change 
>> might be 
>> > > in 
>> > > order. 
>> > > 
>> > > --Tim 
>>
>

Re: [julia-users] Re: How to combine @generated and @inline?

2016-01-20 Thread Jeffrey Sarnoff
I'd prefer @inline @generated
because @generated @inline seems to say "generate this function inline" 
(not "inline the function generated")

On Wednesday, January 20, 2016 at 2:50:55 PM UTC-5, Matt Bauman wrote:
>
> Yeah, I was thinking about that as I responded.  An easier intermediate 
> solution (which could be implemented purely in the Julia macro) would be to 
> support `@inline quote … end`.  Either way, the semantics are a little 
> strange — you're not inlining the quote block, nor are you inlining the 
> function generator itself.
>
> On Wednesday, January 20, 2016 at 2:39:23 PM UTC-5, Stefan Karpinski wrote:
>>
>> This seems like a viable feature request if you want to open an issue – 
>> i.e. @inline @generated or @generated @inline should arrange that the 
>> resulting function body be annotated appropriately.
>>
>> On Wed, Jan 20, 2016 at 2:35 PM, Matt Bauman  wrote:
>>
>>> You need to manually attach the inline annotation within the function 
>>> body that gets generated.  See, e.g., 
>>> https://github.com/JuliaLang/julia/blob/275c7e8929dd391960ba88e741c6f537ccca6cc9/base/multidimensional.jl#L233-L236
>>>
>>> On Wednesday, January 20, 2016 at 2:27:14 PM UTC-5, Erik Schnetter wrote:

 I have a generated function that generates a very small function 
 (essentially a vector load instruction). Unfortunately, this function 
 is not inlined, and I thus want to mark the generated function as 
 @inline. How do I do so? 

 Writing either "@inline @generated" or "@generated @inline" both fail. 

 -erik 

 -- 
 Erik Schnetter  
 http://www.perimeterinstitute.ca/personal/eschnetter/ 

>>>
>>

[julia-users] Anyone running into a build error on latest master on OSX?

2016-01-20 Thread Jonathan Goldfarb
Not sure if this is the place for this kind of discussion, but here goes. 
Been building from source from master periodically and enjoying poking 
around in the source, but have run into an issue apparently due to the 
updated LLVM version, and am wondering if anyone else is having similar 
issues. After removing (I think) everything, including "brew rm --force 
$(brew deps --HEAD julia);", I tried the following:

- brew install git gcc 
- clone julia repo to clean directory
- Add 

BUILD_LLVM_CLANG=1
to Make.user as suggested by Clang.jl/Cxx.jl (removing this step does not 
apparently fix the build, but changes the error)

- run make

and have gotten the following: 

llvm[6]: Copying runtime library darwin/eprintf to build dir
cp: 
/Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/tools/clang/runtime/compiler-rt/clang_darwin/eprintf/libcompiler_rt.a:
 
No such file or directory
make[6]: *** 
[/Users/jgoldfar/Public/julia/deps/build/llvm-3.7.1/build_Release/Release/lib/clang/3.7.1/lib/darwin/libclang_rt.eprintf.a]
 
Error 1
make[5]: *** [compiler-rt/.makeall] Error 2
make[4]: *** [all] Error 1
make[3]: *** [clang/.makeall] Error 2
make[2]: *** [all] Error 1
make[1]: *** [build/llvm-3.7.1/build_Release/Release/lib/libLLVMCodeGen.a] 
Error 2
make: *** [julia-deps] Error 2

Searching online suggests that this was an error with an older version of 
clang/LLVM, but it appears here again.

Anybody else running into this?

Regards,
Max


Re: [julia-users] Re: Sort function

2016-01-20 Thread Stefan Karpinski
We used to have lexicographic sorting of arrays but removed it. I don't
recall the reasoning.

On Wed, Jan 20, 2016 at 11:22 AM, Tim Wheeler 
wrote:

> You should be able to write your own Base.isless function for the types
> you need to support.
>
>
> On Wednesday, January 20, 2016 at 7:48:40 AM UTC-8, Ted Fujimoto wrote:
>>
>> Hi,
>>
>> In Python, we have this:
>>
>> >>> sorted([(1, [2,3]), (1,[2,1])])
>> [(1, [2, 1]), (1, [2, 3])]
>>
>> In Julia, this produces a MethodError:
>>
>> julia> sort([(1, [2,3]), (1,[2,1])])
>> ERROR: MethodError: `isless` has no method matching
>> isless(::Array{Int64,1}, ::Array{Int64,1})
>>  in isless at tuple.jl:113
>>  in sort! at sort.jl:221
>>  in sort! at sort.jl:310
>>  in sort! at sort.jl:402
>>  in sort at sort.jl:413
>>
>> Is this desirable? Should this be submitted as an issue?
>>
>> Thanks.
>>
>>
>>


Re: [julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread Tom Short
I use `cd` under shell on Linux, too. It's a nice shortcut.

On Wed, Jan 20, 2016 at 11:20 AM, J Luis  wrote:

> On Windows one can
>
> julia> pwd()
> "C:\\programs\\Julia-0.4"
>
> shell> cd
> C:\j
>
> julia> pwd()
> "C:\\j"
>
> quarta-feira, 20 de Janeiro de 2016 às 15:45:04 UTC, Yichao Yu escreveu:
>>
>> On Wed, Jan 20, 2016 at 10:39 AM, Tony Kelman  wrote:
>> > Julia has portable functions for all of these, you don't need to use
>> shell
>> > mode for cd, dir, readdir, mkdir, rm, mv, or cp.
>>
>> FWIW, you can't use shell for `cd` on any platforms supported by julia.
>>
>> >
>> >
>> >
>> > On Wednesday, January 20, 2016 at 4:56:07 AM UTC-8, Andreas Lobinger
>> wrote:
>> >>
>> >> Hello colleague,
>> >>
>> >> On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman
>> wrote:
>> >>>
>> >>> Unix shell commands that we happened to be getting from git are no
>> longer
>> >>> on Julia's path. This is not temporary. Windows is not unix. If you
>> want to
>> >>> use unix shell commands on windows, either download and add your own
>> windows
>> >>> posix layer to your path (temporarily in juliarc, not permanently
>> where it
>> >>> will break other software), or call powershell which has many aliases
>> >>> spelled the same as unix shell commands.
>> >>
>> >>
>> >> i agree, windows is not unix (it never was) and the following might
>> not be
>> >> helpful, but
>> >> Matlab provides (on any OS) a very small set of shell-like commands
>> (cd,
>> >> dir, ls,mkdir, rmdir,  delete, movefile, copyfile).
>> >>
>> >> And providing something like this at a julia REPL should be considered
>> >> user friendly.
>> >>
>> >> Wishing a happy day,
>> >>Andreas
>> >>
>>
>


Re: [julia-users] Re: Code review request: interacting with another program via stdin, stdout, stderr.

2016-01-20 Thread Miguel Bazdresch
Tom,

Interesting thoughts; I'll consider putting a package together. For the
time being, I've implemented these ideas in Gaston, and after some testing
it looks like the implementation is solid.

Thanks,

-- mb

On Tue, Jan 12, 2016 at 2:36 AM, Tomas Lycken 
wrote:

> The other global variables actually hold data, which changes according to
> the values read from the different streams. Inspired by the wrapper idea, I
> wrapped them in a type so that it becomes clear that they are always
> strings; hopefully this will help with performance.
>
> You won’t see any performance difference from just wrapping them. However,
> since you can now rebind the fields of the wrappers (which have strictly
> specified types) instead of rebinding the variables themselves, all those
> variables can now be marked const. This should give you some additional
> speed gain.
>
> Another thing to consider, is that you probably want to be able to do this
> with several commands in parallel. (Consider, for example, running multiple
> echo programs and passing stuff between them) For that, you would need to
> wrap all of this in a function anyway. I would consider the following API:
>
> function popen3(f::Function, cmd::Cmd)
> # setup all streams, like your current popen3 function does
>
> # also, create all state handling for the different streams
>
> # finally, pass suitable arguments to f to let the user provide the 
> actual action
> f(pin.in, out.out, err.out) # for example, maybe something else makes 
> more sense
> end
>
> The caller can then use a do block to consume this:
>
> popen3(`./inout`) do pin, pout, perr
> # use the streams here
> end
>
> Since it’s all now wrapped in a function, “globals” won’t be a performance
> problem anymore. As a bonus, you can work with several, parallel,
> invocations without conflict between them. You might still see some
> slowness due to passing anonymous functions, but it’s a) probably
> negligible compared to the IO cost, and b) it’s actively being worked on
>  and will eventually be
> fast.
>
> // T
>
> On Tuesday, January 12, 2016 at 3:50:04 AM UTC+1, Miguel Bazdresch wrote:
>
> Tomas,
>>
>> Thanks for your feedback! I couldn't find a package that handles this
>> already. If this technique proves to work reliably in Gaston, I'll be happy
>> to put it in a package.
>>
>> Regarding `readnow`, I never rebind it. It doesn't hold any actual value;
>> it is just a `Condition()`, which can be used to notify asynchronous tasks.
>> I followed your advice and made it a `const`.
>>
>> The other global variables actually hold data, which changes according to
>> the values read from the different streams. Inspired by the wrapper idea, I
>> wrapped them in a type so that it becomes clear that they are always
>> strings; hopefully this will help with performance.
>>
>> The latest version of the code is at
>> https://gist.github.com/mbaz/bb7e2cbaaecc031b1d88
>>
>> -- mb
>>
>> On Mon, Jan 11, 2016 at 9:05 AM, Tomas Lycken 
>> wrote:
>>
>>> Interesting question! If you find a good approach to do this, wrapping
>>> it in a package is certainly interesting (have you checked that there
>>> aren’t any packages that handle this already?).
>>>
>>> I can’t help much with the threading stuff, but regarding your global
>>> variable it should be possible to work around the slowness of that. I don’t
>>> know how, or when, you re-bind readnow, but there are two ways to fix
>>> it depending on the specifics:
>>>
>>>1.
>>>
>>>You never rebind readnow, just mutate it. Mark it const, and it’s
>>>fast. (const means *impossible to rebind*, not *impossible to mutate*
>>>)
>>>2.
>>>
>>>You rebind readnow, and Condition() is mutable: Mark it const and
>>>mutate it instead of rebinding.
>>>3.
>>>
>>>You rebind readnow and Condition() is immutable: Wrap the Condition
>>>in a mutable type, which you assign to const readnow instead, and
>>>then rebind the field in this mutable type. Something like this:
>>>
>>> type ConditionWrapper
>>> c::Condition
>>> end
>>>
>>> const readnow = ConditionWrapper(Condition())
>>>
>>> # where you update:
>>> readnow.c = Condition(args...)
>>>
>>> This all assumes that Condition is an immutable concrete type, and you
>>> just want to switch it out for an instance with other field values. If you
>>> actually need to change the *type* of readnow, all bets are off and
>>> this trick won’t work.
>>>
>>> // T
>>>
>>> On Friday, January 8, 2016 at 9:28:02 PM UTC+1, Miguel Bazdresch wrote:
>>>
>>> Hello,

 I'd be grateful if you could take a look at some code and suggest
 improvements.

 I'm trying to interact with a long-lived process (gnuplot). This
 process reads commands from its STDIN; after each command is executed, it
 produces output on either its STDOUT or STDERR. It's impossible to predict
 ahead of 

[julia-users] Re: Problem with types used in macro from a different module!!

2016-01-20 Thread Julia Tylors
Thanks, I had to cancel the hygiene too.

On Monday, January 18, 2016 at 1:45:23 PM UTC-8, Cedric St-Jean wrote:
>
> We're missing your `decompose_function` so I couldn't run it, but from the 
> last time I worked with function-definition macros, I believe the correct 
> way to write it should be to add `esc` to the arguments so that it doesn't 
> apply hygiene, this way:
>
> function $(esc(f))($(map(esc, args)...))
>
> Unfortunately, last I checked there was a bug in Julia that prevented 
> this, and instead I have to cancel hygiene on the whole expression (and use 
> `gensym` where appropriate)
>
> esc(:(function $f($(args...))
> ...)
>
> Does that solve your issue?
>
> On Monday, January 18, 2016 at 2:33:00 PM UTC-5, Julia Tylors wrote:
>>
>> #
>> #IMPLEMENTATION CODE:
>> #
>>
>> module Y
>> export modify
>>
>> """
>> A LOT OF CODE HERE, REMOVED FOR SIMPLICITY
>> """
>>
>> function _modify(expr)
>> is_lambda,f,args,body = decompose_function(expr)
>> if is_lambda
>> quote
>> ($(args...)) -> $(transform(body))
>> end
>> else
>> quote
>> function $(esc(f))($(args...))
>>   $(transform(body))
>> end
>> end
>> end
>> end
>>
>> macro modify(func)
>> _modify(func)
>> end
>> end
>>
>> #
>> #USAGE CODE:
>> #
>>
>> module X
>> using Y
>> type Arg{T}
>> x::T
>> end
>> println(macroexpand( quote 
>> @modify function f(x::Arg{Bool})
>>  y = 12
>>  if x
>>y+1
>>  else
>>y-1
>> end
>> end
>> end))
>> end
>>
>> #
>> #GENERATED CODE:
>> #
>>
>> begin
>> begin 
>> function f(#22#x::Y.Arg{Y.Bool}) 
>> begin  
>> #21#y = 12 # 
>> begin 
>> "LOTS OF CODE HERE"
>> end
>> end
>> end
>> end
>> end
>>
>> #
>> #QUESTION
>> #
>>
>> In the generated code, the argument Arg{Bool} is treated as if it is an 
>> element of module Y, but it is an element of module Y. So when the code 
>> executes, the interpreter complains and says:
>> ERROR: LoadError: UndefVarError: Arg not defined
>>
>> Why $(args...) in the implementation code doesn't work?
>>
>> Thanks
>>
>>
>>

[julia-users] Re: Sort function

2016-01-20 Thread Tim Wheeler
You should be able to write your own Base.isless function for the types you 
need to support.

On Wednesday, January 20, 2016 at 7:48:40 AM UTC-8, Ted Fujimoto wrote:
>
> Hi,
>
> In Python, we have this:
>
> >>> sorted([(1, [2,3]), (1,[2,1])])
> [(1, [2, 1]), (1, [2, 3])]
>
> In Julia, this produces a MethodError:
>
> julia> sort([(1, [2,3]), (1,[2,1])])
> ERROR: MethodError: `isless` has no method matching 
> isless(::Array{Int64,1}, ::Array{Int64,1})
>  in isless at tuple.jl:113
>  in sort! at sort.jl:221
>  in sort! at sort.jl:310
>  in sort! at sort.jl:402
>  in sort at sort.jl:413
>
> Is this desirable? Should this be submitted as an issue?
>
> Thanks.
>
>
>

Re: [julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread Yichao Yu
On Wed, Jan 20, 2016 at 10:39 AM, Tony Kelman  wrote:
> Julia has portable functions for all of these, you don't need to use shell
> mode for cd, dir, readdir, mkdir, rm, mv, or cp.

FWIW, you can't use shell for `cd` on any platforms supported by julia.

>
>
>
> On Wednesday, January 20, 2016 at 4:56:07 AM UTC-8, Andreas Lobinger wrote:
>>
>> Hello colleague,
>>
>> On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman wrote:
>>>
>>> Unix shell commands that we happened to be getting from git are no longer
>>> on Julia's path. This is not temporary. Windows is not unix. If you want to
>>> use unix shell commands on windows, either download and add your own windows
>>> posix layer to your path (temporarily in juliarc, not permanently where it
>>> will break other software), or call powershell which has many aliases
>>> spelled the same as unix shell commands.
>>
>>
>> i agree, windows is not unix (it never was) and the following might not be
>> helpful, but
>> Matlab provides (on any OS) a very small set of shell-like commands (cd,
>> dir, ls,mkdir, rmdir,  delete, movefile, copyfile).
>>
>> And providing something like this at a julia REPL should be considered
>> user friendly.
>>
>> Wishing a happy day,
>>Andreas
>>


[julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread Tony Kelman
Julia has portable functions for all of these, you don't need to use shell 
mode for cd, dir, readdir, mkdir, rm, mv, or cp.


On Wednesday, January 20, 2016 at 4:56:07 AM UTC-8, Andreas Lobinger wrote:
>
> Hello colleague,
>
> On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman wrote:
>>
>> Unix shell commands that we happened to be getting from git are no longer 
>> on Julia's path. This is not temporary. Windows is not unix. If you want to 
>> use unix shell commands on windows, either download and add your own 
>> windows posix layer to your path (temporarily in juliarc, not permanently 
>> where it will break other software), or call powershell which has many 
>> aliases spelled the same as unix shell commands.
>
>
> i agree, windows is not unix (it never was) and the following might not be 
> helpful, but 
> Matlab provides (on any OS) a very small set of shell-like commands (cd, 
> dir, ls,mkdir, rmdir,  delete, movefile, copyfile).
>
> And providing something like this at a julia REPL should be considered 
> user friendly.
>
> Wishing a happy day,
>Andreas
>  
>


[julia-users] Sort function

2016-01-20 Thread Ted Fujimoto
Hi,

In Python, we have this:

>>> sorted([(1, [2,3]), (1,[2,1])])
[(1, [2, 1]), (1, [2, 3])]

In Julia, this produces a MethodError:

julia> sort([(1, [2,3]), (1,[2,1])])
ERROR: MethodError: `isless` has no method matching 
isless(::Array{Int64,1}, ::Array{Int64,1})
 in isless at tuple.jl:113
 in sort! at sort.jl:221
 in sort! at sort.jl:310
 in sort! at sort.jl:402
 in sort at sort.jl:413

Is this desirable? Should this be submitted as an issue?

Thanks.




Re: [julia-users] Re: Sort function

2016-01-20 Thread Ted Fujimoto
Got it. Thanks!

On Wed, Jan 20, 2016 at 11:33 AM Stefan Karpinski 
wrote:

> We used to have lexicographic sorting of arrays but removed it. I don't
> recall the reasoning.
>
> On Wed, Jan 20, 2016 at 11:22 AM, Tim Wheeler 
> wrote:
>
>> You should be able to write your own Base.isless function for the types
>> you need to support.
>>
>>
>> On Wednesday, January 20, 2016 at 7:48:40 AM UTC-8, Ted Fujimoto wrote:
>>>
>>> Hi,
>>>
>>> In Python, we have this:
>>>
>>> >>> sorted([(1, [2,3]), (1,[2,1])])
>>> [(1, [2, 1]), (1, [2, 3])]
>>>
>>> In Julia, this produces a MethodError:
>>>
>>> julia> sort([(1, [2,3]), (1,[2,1])])
>>> ERROR: MethodError: `isless` has no method matching
>>> isless(::Array{Int64,1}, ::Array{Int64,1})
>>>  in isless at tuple.jl:113
>>>  in sort! at sort.jl:221
>>>  in sort! at sort.jl:310
>>>  in sort! at sort.jl:402
>>>  in sort at sort.jl:413
>>>
>>> Is this desirable? Should this be submitted as an issue?
>>>
>>> Thanks.
>>>
>>>
>>>
>


Re: [julia-users] Re: How to combine @generated and @inline?

2016-01-20 Thread Stefan Karpinski
This seems like a viable feature request if you want to open an issue –
i.e. @inline @generated or @generated @inline should arrange that the
resulting function body be annotated appropriately.

On Wed, Jan 20, 2016 at 2:35 PM, Matt Bauman  wrote:

> You need to manually attach the inline annotation within the function body
> that gets generated.  See, e.g.,
> https://github.com/JuliaLang/julia/blob/275c7e8929dd391960ba88e741c6f537ccca6cc9/base/multidimensional.jl#L233-L236
>
> On Wednesday, January 20, 2016 at 2:27:14 PM UTC-5, Erik Schnetter wrote:
>>
>> I have a generated function that generates a very small function
>> (essentially a vector load instruction). Unfortunately, this function
>> is not inlined, and I thus want to mark the generated function as
>> @inline. How do I do so?
>>
>> Writing either "@inline @generated" or "@generated @inline" both fail.
>>
>> -erik
>>
>> --
>> Erik Schnetter 
>> http://www.perimeterinstitute.ca/personal/eschnetter/
>>
>


[julia-users] Re: Calling C from Julia with OpenMP (Windows)

2016-01-20 Thread pokerhontas2k8
copying the libgomp.dll into my working directory worked! Thanks! 

Am Mittwoch, 20. Januar 2016 03:36:54 UTC+1 schrieb Tony Kelman:
>
> Take a look at the libcspline3.dll in Dependency Walker. You're likely 
> missing a libgomp dll which you'll need to copy from your compiler 
> installation and put it next to libcspline3.dll. Where did you install the 
> gcc compiler from and are you calling it from inside an environment like 
> cygwin or msys[2]?
>
>
> On Tuesday, January 19, 2016 at 4:15:45 PM UTC-8, 
> pokerho...@googlemail.com wrote:
>>
>>
>>
>> Hi,
>>
>>
>> I am trying to call C code from Julia.It works for 'regular' C code but 
>> now I have code that (potentially) uses OpenMP which causes trouble. I am 
>> trying to interpolate a function using a spline approximation. In short, if 
>> I type:
>>
>> gcc -shared -O3 nspline_omp.c -o libcspline.dll -ffast-math
>>
>>
>> and then call one of the functions in the library from Julia using ccall, 
>> it works. But judging from the speed and comparison with other languages, 
>> only 1 thread is used. The code certainly supports multi-threading, for a 
>> my friend of mine on his Mac, it worked. If I type:
>>
>> gcc -shared -O3 nspline_omp.c -o libcspline2.dll -ffast-math -fopenmp 
>>
>> iand try to call it from Julia, it doesn't work anymore, in particular:
>>
>> LoadError: error compiling spline: could not load library "libcspline2.dll" 
>> The specified module could not be found.
>>
>>
>> Libdl.dlopen("libcspline2.dll")
>>
>> gives the same error. As an example, consider:
>>
>> #include
>>
>> int banana(int hello) {
>>  int nt;
>> #pragma omp parallel
>> {
>>  nt = omp_get_num_threads();
>> }
>>  return nt;
>> }
>>
>>
>> #include 
>> int main() { printf("%d\n", banana(12)); }
>>
>>
>> which perfectly works when compiled as .exe (gcc helloworld.c -fopenmp). 
>> When I try to compile 
>>
>> #include 
>> #include 
>>
>> int banana(int hello) {
>>  int nt;
>> #pragma omp parallel
>>  {
>>  nt = omp_get_num_threads();
>>  }
>>  return nt;
>> }
>>
>> as a shared library using
>>
>> gcc -shared -O3 helloworld2.c -o libcpsline3.dll -ffast-math -fopenmp
>>
>> and then in Julia:
>>
>> Libdl.dlopen("libcspline3.dll")
>> LoadError: could not load library "libcspline3.dll" 
>> The specified module could not be found.
>>
>>
>> Finally, I am new to Julia and C and basically I have not much of an idea 
>> what I am doing, so it could be an obvious mistake. Thanks for your help. 
>>
>>
>>
>>

Re: [julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Yichao Yu
On Wed, Jan 20, 2016 at 2:01 PM, cdm  wrote:
> maybe interactive mode is off somehow ...
>
> does a call to
>
>ion()
>
> help ... ?

IIRC interactive mode isn't initialized yet in juliarc.jl, that's why
using atreplinit should make a difference

>
>
>
> On Wednesday, January 20, 2016 at 12:05:51 AM UTC-8, Daniel Carrera wrote:
>>
>> Hello,
>>
>> Here is an odd problem. If I put in "using PyPlot" inside my ~/.juliarc.jl
>> file, when I start the Julia shell I cannot get any plots. There is no error
>> message, just no plot:
>>
>> $ julia
>> ...
>> julia> x = linspace(0,2pi);
>> julia> y = sin(x);
>> julia> plot(x,y)
>> 1-element Array{Any,1}:
>>  PyObject 
>>
>>
>> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the
>> Julia shell, everything works great. Does anyone know what's happening?
>>
>> Cheers,
>> Daniel.


[julia-users] How to combine @generated and @inline?

2016-01-20 Thread Erik Schnetter
I have a generated function that generates a very small function
(essentially a vector load instruction). Unfortunately, this function
is not inlined, and I thus want to mark the generated function as
@inline. How do I do so?

Writing either "@inline @generated" or "@generated @inline" both fail.

-erik

-- 
Erik Schnetter 
http://www.perimeterinstitute.ca/personal/eschnetter/


[julia-users] how to loop over variable names

2016-01-20 Thread grandemundo82
I am trying to do something in Julia that s very easy to do in some other 
language (STATA for instance). I want to apply the same list of command to 
a set of variables. For instance:

for each myvar in the set {variable1, variable2, variable2}:

grid_"myvar" = linspace(lb_"myvar",ub_"myvar",size_grid)

for ii=1:size_grid
 mytype."myvar" = grid_"myvar"[ii]
 vector_"myvar" = function(mytpe)
end.


In that stata i would simply do a loop for each and then use `myvar" when 
my variable name appears in the RHS or LHS of an equation.

Thank you all!





[julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread cdm
maybe interactive mode is off somehow ...

does a call to

   ion()

help ... ?



On Wednesday, January 20, 2016 at 12:05:51 AM UTC-8, Daniel Carrera wrote:
>
> Hello,
>
> Here is an odd problem. If I put in "using PyPlot" inside my ~/.juliarc.jl 
> file, when I start the Julia shell I cannot get any plots. There is no 
> error message, just no plot:
>
> $ julia 
> ...
> julia> x = linspace(0,2pi);
> julia> y = sin(x);
> julia> plot(x,y)
> 1-element Array{Any,1}:
>  PyObject 
>
>
> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the 
> Julia shell, everything works great. Does anyone know what's happening?
>
> Cheers,
> Daniel.
>


[julia-users] Distributed algorithms for full waveform inversion: Slides/code from JuliaCon 2015?

2016-01-20 Thread Oliver Lylloff
Hi there,

Has anyone seen slides and/or code from the talk Lars Ruthotto gave at 
JuliaCon https://youtu.be/k71RYq2eK50 ?

Best,
Oliver


[julia-users] Re: How to combine @generated and @inline?

2016-01-20 Thread Matt Bauman
You need to manually attach the inline annotation within the function body 
that gets generated.  See, 
e.g., 
https://github.com/JuliaLang/julia/blob/275c7e8929dd391960ba88e741c6f537ccca6cc9/base/multidimensional.jl#L233-L236

On Wednesday, January 20, 2016 at 2:27:14 PM UTC-5, Erik Schnetter wrote:
>
> I have a generated function that generates a very small function 
> (essentially a vector load instruction). Unfortunately, this function 
> is not inlined, and I thus want to mark the generated function as 
> @inline. How do I do so? 
>
> Writing either "@inline @generated" or "@generated @inline" both fail. 
>
> -erik 
>
> -- 
> Erik Schnetter  
> http://www.perimeterinstitute.ca/personal/eschnetter/ 
>


Re: [julia-users] Re: How to combine @generated and @inline?

2016-01-20 Thread Matt Bauman
Yeah, I was thinking about that as I responded.  An easier intermediate 
solution (which could be implemented purely in the Julia macro) would be to 
support `@inline quote … end`.  Either way, the semantics are a little 
strange — you're not inlining the quote block, nor are you inlining the 
function generator itself.

On Wednesday, January 20, 2016 at 2:39:23 PM UTC-5, Stefan Karpinski wrote:
>
> This seems like a viable feature request if you want to open an issue – 
> i.e. @inline @generated or @generated @inline should arrange that the 
> resulting function body be annotated appropriately.
>
> On Wed, Jan 20, 2016 at 2:35 PM, Matt Bauman  > wrote:
>
>> You need to manually attach the inline annotation within the function 
>> body that gets generated.  See, e.g., 
>> https://github.com/JuliaLang/julia/blob/275c7e8929dd391960ba88e741c6f537ccca6cc9/base/multidimensional.jl#L233-L236
>>
>> On Wednesday, January 20, 2016 at 2:27:14 PM UTC-5, Erik Schnetter wrote:
>>>
>>> I have a generated function that generates a very small function 
>>> (essentially a vector load instruction). Unfortunately, this function 
>>> is not inlined, and I thus want to mark the generated function as 
>>> @inline. How do I do so? 
>>>
>>> Writing either "@inline @generated" or "@generated @inline" both fail. 
>>>
>>> -erik 
>>>
>>> -- 
>>> Erik Schnetter  
>>> http://www.perimeterinstitute.ca/personal/eschnetter/ 
>>>
>>
>

[julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Kaj Wiik

Yes, calling ion() does help, thanks!


On Wednesday, January 20, 2016 at 9:01:36 PM UTC+2, cdm wrote:
>
> maybe interactive mode is off somehow ...
>
> does a call to
>
>ion()
>
> help ... ?
>
>
>
> On Wednesday, January 20, 2016 at 12:05:51 AM UTC-8, Daniel Carrera wrote:
>>
>> Hello,
>>
>> Here is an odd problem. If I put in "using PyPlot" inside my 
>> ~/.juliarc.jl file, when I start the Julia shell I cannot get any plots. 
>> There is no error message, just no plot:
>>
>> $ julia 
>> ...
>> julia> x = linspace(0,2pi);
>> julia> y = sin(x);
>> julia> plot(x,y)
>> 1-element Array{Any,1}:
>>  PyObject 
>>
>>
>> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the 
>> Julia shell, everything works great. Does anyone know what's happening?
>>
>> Cheers,
>> Daniel.
>>
>

Re: [julia-users] how to loop over variable names

2016-01-20 Thread Erik Schnetter
You would use this syntax:

for var in (:var1, :var2, :var3)
mytype.(var) = ...
end

-erik


On Wed, Jan 20, 2016 at 2:10 PM,   wrote:
> I am trying to do something in Julia that s very easy to do in some other
> language (STATA for instance). I want to apply the same list of command to a
> set of variables. For instance:
>
> for each myvar in the set {variable1, variable2, variable2}:
>
> grid_"myvar" = linspace(lb_"myvar",ub_"myvar",size_grid)
>
> for ii=1:size_grid
>  mytype."myvar" = grid_"myvar"[ii]
>  vector_"myvar" = function(mytpe)
> end.
>
>
> In that stata i would simply do a loop for each and then use `myvar" when my
> variable name appears in the RHS or LHS of an equation.
>
> Thank you all!
>
>
>



-- 
Erik Schnetter 
http://www.perimeterinstitute.ca/personal/eschnetter/


[julia-users] Re: Executing anonymous function on worker fails when wrapped in a module

2016-01-20 Thread Lutfullah Tomak
I get it now. Lowered code shows
return Banana.CPU_CORES
Even writing Base.CPU_CORES translated to
Banana.Base.CPU_CORES
I wonder if there is a direct way to eliminate Banana. prefix in lowered code.

[julia-users] Re: Executing anonymous function on worker fails when wrapped in a module

2016-01-20 Thread Lutfullah Tomak
Defining module as
@everywhere module Banana
.
end

and importing as

@everywhere using Banana

works for me. I don't know why it requires defining Banana module on remote 
worker though.

[julia-users] Re: Sort function

2016-01-20 Thread Sisyphuss
>From the error information, the comparison of Array is not implemented yet.


On Wednesday, January 20, 2016 at 4:48:40 PM UTC+1, Ted Fujimoto wrote:
>
> Hi,
>
> In Python, we have this:
>
> >>> sorted([(1, [2,3]), (1,[2,1])])
> [(1, [2, 1]), (1, [2, 3])]
>
> In Julia, this produces a MethodError:
>
> julia> sort([(1, [2,3]), (1,[2,1])])
> ERROR: MethodError: `isless` has no method matching 
> isless(::Array{Int64,1}, ::Array{Int64,1})
>  in isless at tuple.jl:113
>  in sort! at sort.jl:221
>  in sort! at sort.jl:310
>  in sort! at sort.jl:402
>  in sort at sort.jl:413
>
> Is this desirable? Should this be submitted as an issue?
>
> Thanks.
>
>
>

Re: [julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread J Luis
On Windows one can

julia> pwd()
"C:\\programs\\Julia-0.4"

shell> cd
C:\j

julia> pwd()
"C:\\j"

quarta-feira, 20 de Janeiro de 2016 às 15:45:04 UTC, Yichao Yu escreveu:
>
> On Wed, Jan 20, 2016 at 10:39 AM, Tony Kelman  > wrote: 
> > Julia has portable functions for all of these, you don't need to use 
> shell 
> > mode for cd, dir, readdir, mkdir, rm, mv, or cp. 
>
> FWIW, you can't use shell for `cd` on any platforms supported by julia. 
>
> > 
> > 
> > 
> > On Wednesday, January 20, 2016 at 4:56:07 AM UTC-8, Andreas Lobinger 
> wrote: 
> >> 
> >> Hello colleague, 
> >> 
> >> On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman wrote: 
> >>> 
> >>> Unix shell commands that we happened to be getting from git are no 
> longer 
> >>> on Julia's path. This is not temporary. Windows is not unix. If you 
> want to 
> >>> use unix shell commands on windows, either download and add your own 
> windows 
> >>> posix layer to your path (temporarily in juliarc, not permanently 
> where it 
> >>> will break other software), or call powershell which has many aliases 
> >>> spelled the same as unix shell commands. 
> >> 
> >> 
> >> i agree, windows is not unix (it never was) and the following might not 
> be 
> >> helpful, but 
> >> Matlab provides (on any OS) a very small set of shell-like commands 
> (cd, 
> >> dir, ls,mkdir, rmdir,  delete, movefile, copyfile). 
> >> 
> >> And providing something like this at a julia REPL should be considered 
> >> user friendly. 
> >> 
> >> Wishing a happy day, 
> >>Andreas 
> >> 
>


[julia-users] Re: Executing anonymous function on worker fails when wrapped in a module

2016-01-20 Thread 'Greg Plowman' via julia-users
OK, it seems a workaround may be to use something like eval(Base.Main, 
:(()->CPU_CORES)) in place of the standard anonymous function.

Below, Lemon.getCores(pid) doesn't work, Apple.getCores(pid) does work.

Is there a better way? This workaround seems awkward and overly complicated.

module Lemon
export getCores
getCores(pid) = remotecall_fetch(pid, ()->CPU_CORES)
end

module Apple
export getCores
getCores(pid) = remotecall_fetch(pid, eval(Base.Main, :(()->CPU_CORES)))
end


Still not sure whether using anonymous function,()->CPU_CORES, is a good 
way to return a global variable from a worker?

I also noted that eval'ing in Main, Base and Base.Main all seemed to work.
I'm not really sure about the differences between these modules. Can 
someone explain?

-- Greg


Re: [julia-users] Re: Sort function

2016-01-20 Thread Pablo Zubieta
I don't know why it was removed, but if you need that to work you can define

function Base.isless(A::AbstractVector, B::AbstractVector)
a, b = length(A), length(B)
a == 0 && return b > 0
for i in 1:min(a,b)
A[i] != B[i] && return A[i] < B[i]
end
return a < b
end

and then your example your work.


Re: [julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Tom Breloff
I don't know exactly what's going on, but seems that PyPlot's display
initialization needs to happen after the ~/.juliarc.jl file is loaded.  It
doesn't solve your problem properly, but you can do something similar...
add "using Plots; pyplot()" to your juliarc.jl and your commands should
work (but going through Plots obviously)

On Wed, Jan 20, 2016 at 5:35 AM, Kaj Wiik  wrote:

> Hi!
>
> I have the same problem with
>
> julia> versioninfo()
> Julia Version 0.4.3
> Commit a2f713d (2016-01-12 21:37 UTC)
> Platform Info:
>   System: Linux (x86_64-unknown-linux-gnu)
>   CPU: Intel(R) Core(TM) i5 CPU   M 520  @ 2.40GHz
>   WORD_SIZE: 64
>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
>   LAPACK: libopenblas64_
>   LIBM: libopenlibm
>   LLVM: libLLVM-3.3
>
> Kaj
>
>
>
> On Wednesday, January 20, 2016 at 10:05:51 AM UTC+2, Daniel Carrera wrote:
>>
>> Hello,
>>
>> Here is an odd problem. If I put in "using PyPlot" inside my
>> ~/.juliarc.jl file, when I start the Julia shell I cannot get any plots.
>> There is no error message, just no plot:
>>
>> $ julia
>> ...
>> julia> x = linspace(0,2pi);
>> julia> y = sin(x);
>> julia> plot(x,y)
>> 1-element Array{Any,1}:
>>  PyObject 
>>
>>
>> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the
>> Julia shell, everything works great. Does anyone know what's happening?
>>
>> Cheers,
>> Daniel.
>>
>


Re: [julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Yichao Yu
On Jan 20, 2016 1:25 PM, "Tom Breloff"  wrote:
>
> I don't know exactly what's going on, but seems that PyPlot's display
initialization needs to happen after the ~/.juliarc.jl file is loaded.  It
doesn't solve your problem properly, but you can do something similar...
add "using Plots; pyplot()" to your juliarc.jl and your commands should
work (but going through Plots obviously)

atreplinit and eval should work

>
> On Wed, Jan 20, 2016 at 5:35 AM, Kaj Wiik  wrote:
>>
>> Hi!
>>
>> I have the same problem with
>>
>> julia> versioninfo()
>> Julia Version 0.4.3
>> Commit a2f713d (2016-01-12 21:37 UTC)
>> Platform Info:
>>   System: Linux (x86_64-unknown-linux-gnu)
>>   CPU: Intel(R) Core(TM) i5 CPU   M 520  @ 2.40GHz
>>   WORD_SIZE: 64
>>   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
>>   LAPACK: libopenblas64_
>>   LIBM: libopenlibm
>>   LLVM: libLLVM-3.3
>>
>> Kaj
>>
>>
>>
>> On Wednesday, January 20, 2016 at 10:05:51 AM UTC+2, Daniel Carrera
wrote:
>>>
>>> Hello,
>>>
>>> Here is an odd problem. If I put in "using PyPlot" inside my
~/.juliarc.jl file, when I start the Julia shell I cannot get any plots.
There is no error message, just no plot:
>>>
>>> $ julia
>>> ...
>>> julia> x = linspace(0,2pi);
>>> julia> y = sin(x);
>>> julia> plot(x,y)
>>> 1-element Array{Any,1}:
>>>  PyObject 
>>>
>>>
>>> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the
Julia shell, everything works great. Does anyone know what's happening?
>>>
>>> Cheers,
>>> Daniel.
>
>


[julia-users] Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Daniel Carrera
Hello,

Here is an odd problem. If I put in "using PyPlot" inside my ~/.juliarc.jl 
file, when I start the Julia shell I cannot get any plots. There is no 
error message, just no plot:

$ julia 
...
julia> x = linspace(0,2pi);
julia> y = sin(x);
julia> plot(x,y)
1-element Array{Any,1}:
 PyObject 


But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the 
Julia shell, everything works great. Does anyone know what's happening?

Cheers,
Daniel.


[julia-users] Re: Help: PyPlot cannot be included in ~/.juliarc.jl?

2016-01-20 Thread Kaj Wiik
Hi!

I have the same problem with

julia> versioninfo()
Julia Version 0.4.3
Commit a2f713d (2016-01-12 21:37 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Core(TM) i5 CPU   M 520  @ 2.40GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Kaj


On Wednesday, January 20, 2016 at 10:05:51 AM UTC+2, Daniel Carrera wrote:
>
> Hello,
>
> Here is an odd problem. If I put in "using PyPlot" inside my ~/.juliarc.jl 
> file, when I start the Julia shell I cannot get any plots. There is no 
> error message, just no plot:
>
> $ julia 
> ...
> julia> x = linspace(0,2pi);
> julia> y = sin(x);
> julia> plot(x,y)
> 1-element Array{Any,1}:
>  PyObject 
>
>
> But if I remove PyPlot from ~/.juliarc.jl and insert it manually in the 
> Julia shell, everything works great. Does anyone know what's happening?
>
> Cheers,
> Daniel.
>


Re: [julia-users] Difference between Juno/LT & Juno/Atom

2016-01-20 Thread Zheng Wendell
Wish that this IDE will be released as archive like LightTable.


[julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread Andreas Lobinger
Hello colleague,

On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman wrote:
>
> Unix shell commands that we happened to be getting from git are no longer 
> on Julia's path. This is not temporary. Windows is not unix. If you want to 
> use unix shell commands on windows, either download and add your own 
> windows posix layer to your path (temporarily in juliarc, not permanently 
> where it will break other software), or call powershell which has many 
> aliases spelled the same as unix shell commands.


i agree, windows is not unix (it never was) and the following might not be 
helpful, but 
Matlab provides (on any OS) a very small set of shell-like commands (cd, 
dir, ls,mkdir, rmdir,  delete, movefile, copyfile).

And providing something like this at a julia REPL should be considered user 
friendly.

Wishing a happy day,
   Andreas
 


Re: [julia-users] Re: Ccalling structure const char *

2016-01-20 Thread Alexander Sikorski
I forgot the dirname(), so thanks for helping me out here. Works now with
const :)

On Fri, Jan 1, 2016 at 4:58 PM, Milan Bouchet-Valat 
wrote:

> Le mardi 29 décembre 2015 à 13:58 -0800, Steven G. Johnson a écrit :
> > That's odd.  If you do "const path = ...", I don't think it matters
> > to the compiler whether the right-hand-side is a string literal or an
> > expression that generates a string; the end result is the same.
> >
> > I just tried it, and ccall((:symbol, path), ...) works fine for me
> > when path is defined via "const path = joinpath(...)".  Are you sure
> > you remembered the "const"?
> Indeed, it looks like we were both confused, it works fine if you do
> const path = joinpath(dirname(@__FILE__),"..","bin","lib.so")
>
> But without the dirname() call you'd get a "Could not open file" error
> of course.
>
>
> Regards
>


Re: [julia-users] Re: Shell commands in Julia 0.4.2 in Windows 10

2016-01-20 Thread Páll Haraldsson



On mið 20.jan 2016 12:56, Andreas Lobinger wrote:

Hello colleague,

On Wednesday, January 13, 2016 at 11:28:39 PM UTC+1, Tony Kelman wrote:

Unix shell commands that we happened to be getting from git are no
longer on Julia's path. This is not temporary. Windows is not unix.
If you want to use unix shell commands on windows, either download
and add your own windows posix layer to your path (temporarily in
juliarc, not permanently where it will break other software), or
call powershell which has many aliases spelled the same as unix
shell commands.


i agree, windows is not unix (it never was) and the following might not
be helpful, but
Matlab provides (on any OS) a very small set of shell-like commands (cd,
dir, ls,mkdir, rmdir,  delete, movefile, copyfile).


Just to be clear, is this issue about shell access in the REPL, or for 
run() ?


If only in the REPL, as for convenience, for interactive use, I see not 
problem with accessing the cmd or powershell (latter better? does it or 
former have a good subset of compatibility, e.g. with the subset above?) 
on Windows and bash in Linux/Unix for e.g.:


for i in $( ls ); do
  echo item: $i
done

that didn't work, and I wouldn't expect to work in Windows (but I would 
in Unix).



And providing something like this at a julia REPL should be considered
user friendly.


Exactly, but only in the REPL. If run() would allow access to a shell, 
then incompatibility comes in, in full force or we would promise to 
provide one (e.g. bash) for Unix compatibility - and it would be a bad idea.


--
Palli.