[julia-users] Re: Simulink alternative, based on Julia?

2016-11-01 Thread J Luis
This example 
from
 
the nuklear lib looks like this lib (C, 
header only) could be used for that.

terça-feira, 1 de Novembro de 2016 às 08:51:03 UTC, Uwe Fechner escreveu:
>
> Hello,
>
> from my point of view, Julia is already a viable alternative to Matlab for 
> flight
> and energy system simulations.
>
> What still is missing is a block editor for dynamic systems like Simulink.
>
> The best, open source alternative to Simulink that I know of is XCos, 
> which is part of Scilab.
> XCos is a block diagram editor and GUI for the hybrid simulator
>
> I think, that the XCos GUI is implemented in Java.
> See: https://www.scilab.org/scilab/features/xcos
>
> What would be a reasonable approach for implementing a block diagram
> editor for Julia? Using QML.jl? Or could such an editor be implemented
> with web technologies, based on Atom?
>
> Any ideas welcome.
>
> Uwe Fechner
>


[julia-users] Re: ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread J Luis
Ok, sorry. Found it. Needed to 

 using PkgDev

but not that obvious since for using Pkg one do not need to 'using' it.

segunda-feira, 24 de Outubro de 2016 às 22:57:06 UTC+1, J Luis escreveu:
>
> Hi,
>
> I'm trying to tag a new version of a package for the first time (initial 
> tag was done with 0.4) but
>
> Pkg.update()
> ...
> WARNING: julia is fixed at 0.5.0-rc4+0 conflicting with requirement for 
> GLFW: [0.5.0,∞)
> INFO: Upgrading ArgParse: v0.3.1 => v0.4.0
> INFO: Upgrading Compat: v0.9.2 => v0.9.3
> INFO: Upgrading PkgDev: v0.1.2 => v0.1.3
>
> julia> PkgDev.tag(:patch)
> ERROR: UndefVarError: PkgDev not defined
>
> julia> PkgDev.tag("GMT",:patch)
> ERROR: UndefVarError: PkgDev not defined
>
> julia> PkgDev.tag("GMT",v"0.0.2")
> ERROR: UndefVarError: PkgDev not defined
>
> What's wrong here?
>
>

[julia-users] ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread J Luis
Hi,

I'm trying to tag a new version of a package for the first time (initial 
tag was done with 0.4) but

Pkg.update()
...
WARNING: julia is fixed at 0.5.0-rc4+0 conflicting with requirement for GLFW
: [0.5.0,∞)
INFO: Upgrading ArgParse: v0.3.1 => v0.4.0
INFO: Upgrading Compat: v0.9.2 => v0.9.3
INFO: Upgrading PkgDev: v0.1.2 => v0.1.3

julia> PkgDev.tag(:patch)
ERROR: UndefVarError: PkgDev not defined

julia> PkgDev.tag("GMT",:patch)
ERROR: UndefVarError: PkgDev not defined

julia> PkgDev.tag("GMT",v"0.0.2")
ERROR: UndefVarError: PkgDev not defined

What's wrong here?



[julia-users] Re: Float64: 1.0 vs. 1.

2016-10-23 Thread J Luis
It parses .+ as broadcasting of two Ints. Do instead

typeof(1. +1)
Float64



segunda-feira, 24 de Outubro de 2016 às 02:33:15 UTC+1, 
christop...@unibas.ch escreveu:
>
> What is the difference between 1.0 and 1. ?
> Both are of type Float64, but adding 1 leads to the result 2.0, i.e., 
> Float64, in the first case,
> and 2, i.e., Int64 in the second.
>
>   _
>_   _ _(_)_ |  A fresh approach to technical computing
>   (_) | (_) (_)|  Documentation: http://docs.julialang.org
>_ _   _| |_  __ _   |  Type "?help" for help.
>   | | | | | | |/ _` |  |
>   | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
> |__/   |  x86_64-apple-darwin13.4.0
>
> julia> typeof(1.0)
> Float64
>
> julia> typeof(1.)
> Float64
>
> julia> typeof(1.0+1)
> Float64
>
> julia> typeof(1.+1)
> Int64
>
> Many thanks in advance, Christoph
>


Re: [julia-users] Re: Why does Julia 0.5 keep complaining about method re-definitions?

2016-09-28 Thread J Luis


> This a very heavy install.  It's fetching tons of things that I have not 
> used.  Not sure what they are, but seems like trashing my system.
>

Yes, unfortunately Conda is an unbearably big dependency (over 1.xxx Gb) 
that sneaks in via un-suspicious packages. A dependency this big should 
never install without a strict user consent. Docs explain how to avoid it 
but don't find the explanation clear. I had to declare this

ENV["JUPYTER"]="C:/programs/WinPython-3.5.2.2_64/python-3.5.2.amd64/Scripts/jupyter"

to really prevent a Conda installation 
 

>
> On Wednesday, September 28, 2016 at 4:30:32 AM UTC+8, Cedric St-Jean wrote:
>>
>> Yeah, it's because of IJulia, sorry about that. I need it to support 
>> autoreloading. I could split the package in two, but it's small enough 
>> already that it doesn't feel like the right call. 
>>
>> One day we'll get conditional imports...
>>
>> On Tue, Sep 27, 2016 at 4:14 PM, Daniel Carrera  
>> wrote:
>>
>>> Thanks! You are a savior!
>>>
>>> Here is something odd: when I installed it with Pkg.clone(...) my Julia 
>>> decided that it also had to update Conda and install Jupyter. Is this some 
>>> weird quirk of my setup. I notice that you import IJulia, so I guess that 
>>> has something to do with it. It's not a big deal; I just thought it was 
>>> weird to see the package manager installing stuff like Qt, fontconfig, SSL, 
>>> and libxml just to clobber include().
>>>
>>> But other than that, it works fabulously. Thank you so much!
>>>
>>> Cheers,
>>> Daniel.
>>>
>>>
>>>
>>> On 27 September 2016 at 21:45, Cedric St-Jean  
>>> wrote:
>>>
 I wrote a work-around earlier today:

 Pkg.clone("git://github.com/cstjean/ClobberingReload.jl.git")

 using ClobberingReload: sinclude # silent include
 sinclude("foo.jl")   # no redefinition warnings


 It's fresh off the press, so please file an issue if you encounter a 
 problem. It calls `include` under the hood; there's no magic involved. I 
 just intercept STDERR and remove the redefinition warnings.

 On Tuesday, September 27, 2016 at 3:13:00 PM UTC-4, Andrew wrote:
>
> It seems like a lot of people are complaining about this. Is there 
> some way to suppress method overwritten warnings for an include() 
> statement? Perhaps a keyword like include("foo.jl", quietly = true)?
>
> On Tuesday, September 27, 2016 at 1:56:27 PM UTC-4, Daniel Carrera 
> wrote:
>>
>> Hello,
>>
>> I'm not sure when I upgraded, but I am using Julia 0.5 and now it 
>> complains every time I redefine a method, which is basically all the 
>> time. 
>> When I'm developing ideas I usually have a file with a script that I 
>> modify 
>> and reload all the time:
>>
>> julia> include("foo.jl");
>>
>> ... see the results, edit file ...
>>
>> julia> include("foo.jl");
>>
>> ... see the results, edit file ...
>> julia> include("foo.jl");
>>
>> ... see the results, edit file ...
>>
>>
>> And so on. This is what I do most of the time. But now every time I 
>> `include("foo.jl")` I get warnings for every method that has been 
>> redefined 
>> (which is all of them):
>>
>> julia> include("foo.jl");
>>
>> WARNING: Method definition (::Type{Main.Line})(Float64, Float64) in 
>> module Main at /home/daniel/Data/Science/Thesis/SI.jl:4 overwritten at 
>> /home/daniel/Data/Science/Thesis/SI.jl:4.
>> WARNING: Method definition (::Type{Main.Line})(Any, Any) in module 
>> Main at /home/daniel/Data/Science/Thesis/SI.jl:4 overwritten at 
>> /home/daniel/Data/Science/Thesis/SI.jl:4.
>> WARNING: Method definition new_line(Any, Any, Any) in module Main at 
>> /home/daniel/Data/Science/Thesis/SI.jl:8 overwritten at 
>> /home/daniel/Data/Science/Thesis/SI.jl:8.
>>
>>
>> Is there a way that this can be fixed? How can I recover Julia's 
>> earlier behaviour? This is very irritating, and I don't think it makes 
>> sense for a functional language like Julia. If I wrote a method as a 
>> variable assignment (e.g. "foo = x -> 2*x") Julia wouldn't complain.
>>
>>
>> Thanks for the help,
>> Daniel.
>>
>
>>>
>>

[julia-users] Any way of recovering a corrupted .julia?

2016-09-20 Thread J Luis
Hi,

So I did it again. While trying to install ImageMagick and at same time 
attempting to convince Julia that I already had one ImageMagick installed 
in my Win machine and manually deleted some files.
After that the chaos. Every Pkg.update() has something to complain. For 
example

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Cloning cache of GLVisualize from https:
//github.com/JuliaGL/GLVisualize.jl.git
ERROR: GitError(Code:ENOTFOUND, Class:Repository, Could not find repository 
from 'C:\j\.julia\v0.5\.cache\GMT')
 in Base.LibGit2.GitRepo(::String) at .\libgit2\repository.jl:11

it looks that I have no alternative than to wipe it completely and start a 
new.
And, I see that it's still there the (confess, annoyingly fact) that a 
Pkg.rm() doesn't remove anything but merely moves the "removed" package to 
the .trash directory.

In such cases, is there anyway to rescue the corrupted .julia?





[julia-users] Re: Maps in Julia?

2016-09-08 Thread J Luis
To give you guys an idea, these are all GMT mapping examples 



quinta-feira, 8 de Setembro de 2016 às 19:52:40 UTC+1, Chris escreveu:
>
> The PyCall README is quite comprehensive, and the Basemap documentation 
> has some good examples. Otherwise, I basically just used trial and error 
> until things worked the way I expected -- you get the hang of it eventually.
>
> On Thursday, September 8, 2016 at 2:47:12 PM UTC-4, Philippe Roy wrote:
>>
>> I guess using PyCall could work indeed. Is there some kind of tutorial 
>> about this matter (i.e. Basemap in Julia through pyCall) that you know of? 
>> I'm not really proficient in Julia and Python now (hoping to learn though!).
>>
>> Thanks! 
>>
>> Le jeudi 8 septembre 2016 14:33:47 UTC-4, Chris a écrit :
>>>
>>> This doesn't specifically answer your question, but I have used Basemap 
>>> via PyCall without too much trouble in the past.
>>>
>>> On Thursday, September 8, 2016 at 2:05:53 PM UTC-4, Philippe Roy wrote:

 Hello!

 I'm trying to do a geographical map in Julia. Is that even possible? I 
 can't find any package similar to the Matlab Mapping Toolbox or Basemap 
 for 
 Python. 

 Thanks for any info!

>>>

[julia-users] Re: Maps in Julia?

2016-09-08 Thread J Luis
Hi,

The GMT.jl  is still under development, 
namely it's waiting for the next (this month) release of GMT5.3, but it 
already gives you access to one of most powerful Mapping Tools.

quinta-feira, 8 de Setembro de 2016 às 19:33:47 UTC+1, Chris escreveu:
>
> This doesn't specifically answer your question, but I have used Basemap 
> via PyCall without too much trouble in the past.
>
> On Thursday, September 8, 2016 at 2:05:53 PM UTC-4, Philippe Roy wrote:
>>
>> Hello!
>>
>> I'm trying to do a geographical map in Julia. Is that even possible? I 
>> can't find any package similar to the Matlab Mapping Toolbox or Basemap for 
>> Python. 
>>
>> Thanks for any info!
>>
>

Re: [julia-users] Re: Hard time with Compat and 0.5

2016-08-29 Thread J Luis
Ah, I got it now. Thanks.

segunda-feira, 29 de Agosto de 2016 às 17:05:58 UTC+1, Tim Holy escreveu:
>
> To rephrase what Steven and Tony said, for some things you won't need a 
> macro. 
> For example, `unsafe_wrap` didn't exist on Julia 0.4, but Compat contains 
> an 
> implementation  of `unsafe_wrap` for use on Julia 0.4. It's just a 
> plain-old 
> function call, so you don't need `@compat`---just use it in the same way 
> you'd 
> use `unsafe_wrap` on Julia 0.5. 
>
> `@compat` is necessary only for more complicated cases where there's a 
> reason 
> why you can't make it just an ordinary function call. 
>
> To sum up, to get rid of deprecation warnings write your code in the new 
> syntax. Add `@compat` only when Compat.jl's README tells you to do so. 
>
> --Tim 
>
> On Monday, August 29, 2016 8:46:42 AM CDT J Luis wrote: 
> > Ok, but than how do I quiet the tons of deprecation messages that show 
> up? 
> > 
> > segunda-feira, 29 de Agosto de 2016 às 15:57:34 UTC+1, Tony Kelman 
> escreveu: 
> > > You generally only need to call the @compat macro when you're trying 
> to 
> > > use some new syntax that didn't parse correctly on older versions of 
> > > Julia. 
> > > If it parses correctly, Compat usually implements it with normal 
> functions 
> > > and methods, no need for a syntax-rewriting macro. 
> > > 
> > > On Monday, August 29, 2016 at 6:11:19 AM UTC-7, J Luis wrote: 
> > >>> No, it is: 
> > >>> 
> > >>> t = unsafe_wrap(Array, Gb.data, h.size) 
> > >>> 
> > >>> as in the deprecation warning. 
> > >> 
> > >> Thanks (I'd figured it out too meanwhile) 
> > >> 
> > >>> (You don't need @compat just for function calls.   You only need 
> @compat 
> > >>> for things where the syntax changes in a more complicated way.) 
> > >> 
> > >> Hmm, what do you mean by this? If I don't use @compat (which I tried) 
> I 
> > >> get tons of deprecation messages. 
>
>
>

[julia-users] Re: Hard time with Compat and 0.5

2016-08-29 Thread J Luis
Ok, but than how do I quiet the tons of deprecation messages that show up?

segunda-feira, 29 de Agosto de 2016 às 15:57:34 UTC+1, Tony Kelman escreveu:
>
> You generally only need to call the @compat macro when you're trying to 
> use some new syntax that didn't parse correctly on older versions of Julia. 
> If it parses correctly, Compat usually implements it with normal functions 
> and methods, no need for a syntax-rewriting macro.
>
>
> On Monday, August 29, 2016 at 6:11:19 AM UTC-7, J Luis wrote:
>>
>>  
>>>
>>> No, it is:
>>>
>>> t = unsafe_wrap(Array, Gb.data, h.size)
>>>
>>> as in the deprecation warning.
>>>
>>  
>> Thanks (I'd figured it out too meanwhile)
>>  
>>
>>> (You don't need @compat just for function calls.   You only need @compat 
>>> for things where the syntax changes in a more complicated way.)
>>>
>>
>> Hmm, what do you mean by this? If I don't use @compat (which I tried) I 
>> get tons of deprecation messages. 
>>
>

[julia-users] Re: Hard time with Compat and 0.5

2016-08-29 Thread J Luis
 
>
> No, it is:
>
> t = unsafe_wrap(Array, Gb.data, h.size)
>
> as in the deprecation warning.
>
 
Thanks (I'd figured it out too meanwhile)
 

> (You don't need @compat just for function calls.   You only need @compat 
> for things where the syntax changes in a more complicated way.)
>

Hmm, what do you mean by this? If I don't use @compat (which I tried) I get 
tons of deprecation messages. 


[julia-users] Re: Hard time with Compat and 0.5

2016-08-26 Thread J Luis
Ok, I figured that one (Really needed a first argument 'Array')

But now this

@show(typeof(X.name))
name = bytestring([X.name...])

typeof(X.name) = Tuple{UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8
,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8}
WARNING: bytestring(v::Vector{UInt8}) is deprecated, use String(copy(v)) 
instead.

changing to as suggested

@compat String(copy(X.name))

yields

WARNING: copy(x::Tuple) is deprecated, use identity(x) instead.
 in depwarn(::String, ::Symbol) at .\deprecated.jl:64
 in copy(::Tuple{UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8
,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8}) at .\deprecated.jl:50
 in GMTJL_Set_Object(::Ptr{Void}, ::GMT.GMT_RESOURCE, ::Array{Any,1}) at C:\
j\.julia\v0.5\GMT\src\gmt_main.jl:890
 in gmt(::String) at C:\j\.julia\v0.5\GMT\src\gmt_main.jl:230
 in ex02(::String, ::String) at C:\j\.julia\v0.5\GMT\test\gallery.jl:108
 in gallery(::String, ::String, ::String) at C:\j\.julia\v0.5\GMT\test\
gallery.jl:22
 in gallery(::String) at C:\j\.julia\v0.5\GMT\test\gallery.jl:14
 in eval(::Module, ::Any) at .\boot.jl:234
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at .\REPL.jl:64
 in macro expansion at .\REPL.jl:95 [inlined]
 in (::Base.REPL.##3#4{Base.REPL.REPLBackend})() at .\event.jl:46
while loading no file, in expression starting on line 0
ERROR: MethodError: Cannot `convert` an object of type Tuple{UInt8,UInt8,
UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,UInt8,
UInt8,UInt8} to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.





[julia-users] Hard time with Compat and 0.5

2016-08-26 Thread J Luis
Hi, 
So I started trying to port my code to 0.5 using Compat and it seams a hell 
is expecting me. 
This is one example of what happens when I try to follow the deprecation 
suggestions. This

t = pointer_to_array(Gb.data, h.size)
#@compat t = unsafe_wrap(Gb.data, h.size)

warns that

WARNING: pointer_to_array{T}(p::Ptr{T},d::Union{Integer,Tuple{Vararg{Integer
}}},own::Bool=false) is deprecated, use unsafe_wrap(Array,p,d,own) instead.
 in depwarn(::String, ::Symbol) at .\deprecated.jl:64
 in pointer_to_array(::Ptr{Float32}, ::UInt64, ::Bool) at .\deprecated.jl:50 
(repeats 2 times)
 in GMTJL_grid_init(::Ptr{Void}, ::Bool, ::GMT.GMTJL_GRID, ::Array{Any,1}, 
::Array{Any,1}, ::Int64) at C:\j\.julia\v0.5\GMT\src\gmt_main.jl:1014

so I make it

@compat t = unsafe_wrap(Gb.data, h.size)

which errors with

ERROR: MethodError: no method matching unsafe_wrap(::Ptr{Float32}, ::UInt64)
 in GMTJL_grid_init(::Ptr{Void}, ::Bool, ::GMT.GMTJL_GRID, ::Array{Any,1}, 
::Array{Any,1}, ::Int64) at C:\j\.julia\v0.5\GMT\src\gmt_main.jl:1014

and this was just an example that I could understand.

versioninfo()
Julia Version 0.5.0-rc1+1
Commit acfd04c (2016-08-05 15:23 UTC)
Platform Info:
  System: NT (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.7.1 (ORCJIT, haswell)















Re: [julia-users] Re: Help catting

2016-07-17 Thread J Luis
Hmm, thanks ... but too mysterious for me. What is 'dest' and 'i' (columns 
I guess, but how to loop on it?)? 

segunda-feira, 18 de Julho de 2016 às 01:34:11 UTC+1, Yichao Yu escreveu:
>
> On Sun, Jul 17, 2016 at 8:05 PM, J Luis > 
> wrote: 
> > Ghrrr, this works 
> > 
> > julia> [pointer_to_array(C[1], DS.n_rows) pointer_to_array(C[2], 
> DS.n_rows)] 
> > 186x2 Array{Float64,2}: 
> >  7.0  53.3242 
> >  6.99583  53.325 
> >  6.99249  53.3264 
> > ... 
>
> You'll be better off to just create the Matrix and copy over the data 
> with `unsafe_copy!(pointer(dest, DS.n_rows * (i - 1) + 1), 
> unsafe_load(DS.data, i), DS.n_rows)` 
>
> > 
> > but I need a generic solution for a variable number of columns. 
> > 
> > 
> > segunda-feira, 18 de Julho de 2016 às 00:40:25 UTC+1, J Luis escreveu: 
> >> 
> >> Hi, need help reshaping an output from C that comes out in N (columns) 
> >> vectors into a 2-D matrix 
> >> 
> >> julia> C = pointer_to_array(DS.data, 2) 
> >> 2-element Array{Ptr{Float64},1}: 
> >>  Ptr{Float64} @0x1bf17360 
> >>  Ptr{Float64} @0x1bf17970 
> >> 
> >> and 
> >> 
> >> julia> pointer_to_array(C[1], DS.n_rows) 
> >> 186-element Array{Float64,1}: 
> >>  7.0 
> >>  6.99583 
> >>  6.99249 
> >> ... 
> >> 
> >> and I need to reshape these 2 columns into a 186x2 matrix but that's 
> where 
> >> all my attempts fails. I tried for example 
> >> 
> >> julia> hcat([pointer_to_array(C[k], DS.n_rows) for k=1:2]) 
> >> 2x1 Array{Array{T,N},2}: 
> >> 
> >> 
> [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
>
> >> … 
> >> 
> 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
>  
>
> >> 
> >> 
> [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
>
> >> … 
> >> 
> 53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]
>  
>
> >> 
> >> or 
> >> 
> >> julia> cat(2,[pointer_to_array(C[k], DS.n_rows) for k=1:2]) 
> >> 2x1 Array{Array{T,N},2}: 
> >> 
> >> 
> [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
>
> >> … 
> >> 
> 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
>  
>
> >> 
> >> 
> [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
>
> >> … 
> >> 
> 53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]
>  
>
> >> 
> >> but that is not what I need,  as mentioned I need a Mx2 matrix. 
> >> 
> >> Thanks 
> >> 
> >> Joaquim 
>


[julia-users] Re: Help catting

2016-07-17 Thread J Luis
Ghrrr, this works

julia> [pointer_to_array(C[1], DS.n_rows) pointer_to_array(C[2], DS.n_rows)]
186x2 Array{Float64,2}:
 7.0  53.3242
 6.99583  53.325
 6.99249  53.3264
...

but I need a generic solution for a variable number of columns.

segunda-feira, 18 de Julho de 2016 às 00:40:25 UTC+1, J Luis escreveu:
>
> Hi, need help reshaping an output from C that comes out in N (columns) 
> vectors into a 2-D matrix
>
> julia> C = pointer_to_array(DS.data, 2)
> 2-element Array{Ptr{Float64},1}:
>  Ptr{Float64} @0x1bf17360
>  Ptr{Float64} @0x1bf17970
>
> and
>
> julia> pointer_to_array(C[1], DS.n_rows)
> 186-element Array{Float64,1}:
>  7.0
>  6.99583
>  6.99249
> ...
>
> and I need to reshape these 2 columns into a 186x2 matrix but that's where 
> all my attempts fails. I tried for example 
>
> julia> hcat([pointer_to_array(C[k], DS.n_rows) for k=1:2])
> 2x1 Array{Array{T,N},2}:
>  [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
>  … 
>  
> 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
>  [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
>  … 
>  
> 53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]
>
> or
>
> julia> cat(2,[pointer_to_array(C[k], DS.n_rows) for k=1:2])
> 2x1 Array{Array{T,N},2}:
>  [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
>  … 
>  
> 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
>  [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
>  … 
>  
> 53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]
>
> but that is not what I need,  as mentioned I need a Mx2 matrix.
>
> Thanks
>
> Joaquim
>


[julia-users] Help catting

2016-07-17 Thread J Luis
Hi, need help reshaping an output from C that comes out in N (columns) 
vectors into a 2-D matrix

julia> C = pointer_to_array(DS.data, 2)
2-element Array{Ptr{Float64},1}:
 Ptr{Float64} @0x1bf17360
 Ptr{Float64} @0x1bf17970

and

julia> pointer_to_array(C[1], DS.n_rows)
186-element Array{Float64,1}:
 7.0
 6.99583
 6.99249
...

and I need to reshape these 2 columns into a 186x2 matrix but that's where 
all my attempts fails. I tried for example 

julia> hcat([pointer_to_array(C[k], DS.n_rows) for k=1:2])
2x1 Array{Array{T,N},2}:
 [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
 … 
 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
 [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
 … 
 
53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]

or

julia> cat(2,[pointer_to_array(C[k], DS.n_rows) for k=1:2])
2x1 Array{Array{T,N},2}:
 [7.0,6.99583,6.99249,6.98917,6.98639,6.98306,6.98029,6.97694,6.97417,6.97111 
 … 
 6.44916,6.44472,6.44056,6.43612,6.43139,6.42611,6.42167,6.41694,6.41306,6.4089]
 [53.3242,53.325,53.3264,53.3281,53.33,53.3314,53.3331,53.3344,53.3364,53.338 
 … 
 
53.6008,53.6017,53.6028,53.6033,53.6042,53.6047,53.6053,53.6061,53.6072,53.6075]

but that is not what I need,  as mentioned I need a Mx2 matrix.

Thanks

Joaquim


[julia-users] Re: Array of types, how to?

2016-07-15 Thread J Luis
Thanks again, seams to be working. Will test it more tomorrow.

sábado, 16 de Julho de 2016 às 02:42:56 UTC+1, Chris Rackauckas escreveu:
>
> Oh, I guess it's just with most of the Base types you can do that (they 
> must have internal constructors for it). The convert issue comes up because 
> you have type checks on your fields, i.e. ::Type, otherwise you could just 
> make an internal constructor which calls new(nothing,nothing). No sweat, 
> you can just make an internal constructor:
>
> D() = new(Array{Float64,2}(),string())
>
> (or anything like that). Since your Type is not mutable, you can just 
> overwrite what you put in there.
>
> On Friday, July 15, 2016 at 6:37:54 PM UTC-7, J Luis wrote:
>>
>> Thanks. Didn't know one could create empty types,, but is it a 0.5 
>> feature. Because on 0.4
>>
>> julia> Di=D()
>> ERROR: MethodError: `convert` has no method matching convert(::Type{D})
>> This may have arisen from a call to the constructor D(...),
>> since type constructors fall back to convert methods.
>>
>>
>>
>> sábado, 16 de Julho de 2016 às 02:28:30 UTC+1, Chris Rackauckas escreveu:
>>>
>>> Well, you just made the type D, so you can make Array{D,n} or anything 
>>> else like that. The Base types are not special in Julia, anywhere you can 
>>> use a type, you can use your own.
>>>
>>> You can create an empty form of your type via dinstance = D(). You can 
>>> then add to it by setting dinstance.data = someMatrix; dinstance.header = 
>>> "hi!". In fact, you can make a whole array of empty D's by Darr = [D() for 
>>> i in 1:N] and then set the fields in a loop by Darr[i].data = someMatrix. 
>>> You might want to read the documentation on type for more details.
>>>
>>> If you need the fields to be mutable, you can make one of the fields in 
>>> the type be a dictionary and use that, or you can use a cell array (I think 
>>> these may be deprecated?)
>>>
>>>
>>> On Friday, July 15, 2016 at 6:14:26 PM UTC-7, J Luis wrote:
>>>>
>>>> Hi,
>>>>
>>>> I need to mimic what in Matlab is called a struct matrix. e.g.
>>>>
>>>> >> D=struct('data',{rand(2,2);rand(2,2)},'text',{'aa';'bb'})
>>>>
>>>> D = 
>>>>
>>>> 2x1 struct array with fields:
>>>>
>>>> data
>>>> text
>>>>
>>>>
>>>> in MEX I would use (and actually that's what I do in the C MEX code 
>>>> that I'm trying to port)
>>>>
>>>> mxCreateStructMatrix()
>>>>
>>>> For one single of this it's easy
>>>>
>>>> type D
>>>>data::Array{Float64,2}
>>>>header::ASCIIString
>>>>end
>>>>
>>>> but how do I create an array of D's?
>>>> And probably worst, I need to fill them with the data that comes from a 
>>>> ccall(). So not only I do not know to create the array as I have no idea 
>>>> either on how fill it since one cannot create empty types and fill them in 
>>>> loops.
>>>>
>>>> Thanks
>>>>
>>>

[julia-users] Re: Array of types, how to?

2016-07-15 Thread J Luis
Thanks. Didn't know one could create empty types,, but is it a 0.5 feature. 
Because on 0.4

julia> Di=D()
ERROR: MethodError: `convert` has no method matching convert(::Type{D})
This may have arisen from a call to the constructor D(...),
since type constructors fall back to convert methods.



sábado, 16 de Julho de 2016 às 02:28:30 UTC+1, Chris Rackauckas escreveu:
>
> Well, you just made the type D, so you can make Array{D,n} or anything 
> else like that. The Base types are not special in Julia, anywhere you can 
> use a type, you can use your own.
>
> You can create an empty form of your type via dinstance = D(). You can 
> then add to it by setting dinstance.data = someMatrix; dinstance.header = 
> "hi!". In fact, you can make a whole array of empty D's by Darr = [D() for 
> i in 1:N] and then set the fields in a loop by Darr[i].data = someMatrix. 
> You might want to read the documentation on type for more details.
>
> If you need the fields to be mutable, you can make one of the fields in 
> the type be a dictionary and use that, or you can use a cell array (I think 
> these may be deprecated?)
>
>
> On Friday, July 15, 2016 at 6:14:26 PM UTC-7, J Luis wrote:
>>
>> Hi,
>>
>> I need to mimic what in Matlab is called a struct matrix. e.g.
>>
>> >> D=struct('data',{rand(2,2);rand(2,2)},'text',{'aa';'bb'})
>>
>> D = 
>>
>> 2x1 struct array with fields:
>>
>> data
>> text
>>
>>
>> in MEX I would use (and actually that's what I do in the C MEX code that 
>> I'm trying to port)
>>
>> mxCreateStructMatrix()
>>
>> For one single of this it's easy
>>
>> type D
>>data::Array{Float64,2}
>>header::ASCIIString
>>end
>>
>> but how do I create an array of D's?
>> And probably worst, I need to fill them with the data that comes from a 
>> ccall(). So not only I do not know to create the array as I have no idea 
>> either on how fill it since one cannot create empty types and fill them in 
>> loops.
>>
>> Thanks
>>
>

[julia-users] Array of types, how to?

2016-07-15 Thread J Luis
Hi,

I need to mimic what in Matlab is called a struct matrix. e.g.

>> D=struct('data',{rand(2,2);rand(2,2)},'text',{'aa';'bb'})

D = 

2x1 struct array with fields:

data
text


in MEX I would use (and actually that's what I do in the C MEX code that 
I'm trying to port)

mxCreateStructMatrix()

For one single of this it's easy

type D
   data::Array{Float64,2}
   header::ASCIIString
   end

but how do I create an array of D's?
And probably worst, I need to fill them with the data that comes from a 
ccall(). So not only I do not know to create the array as I have no idea 
either on how fill it since one cannot create empty types and fill them in 
loops.

Thanks


Re: [julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-07 Thread J Luis
Just to tell that the NTuples way works beautifully, specially because we 
no longer are tied to an immutable that made the communication Julia -> C 
quite painfull.

Thanks

Joaquim

segunda-feira, 6 de Junho de 2016 às 21:09:32 UTC+1, Steven G. Johnson 
escreveu:
>
> On Monday, June 6, 2016 at 1:11:53 PM UTC-4, Milan Bouchet-Valat wrote:
>>
>> > tuples yes, but when I search for ``NTuples`` in the docs there is 
>> > barely any hit and all that come show it being used as a type 
>> > dfinition but found no mention of what it is. Yes, a ``ntuple`` 
>> > function is documented but I guess it's not the same thing. 
>> The codes could be improved, but basically NTuple is a standard tuple 
>> with all elements being of the same type: 
>
>
> https://github.com/JuliaLang/julia/pull/16791 
>


Re: [julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread J Luis
Ah, simple than.

Thanks


segunda-feira, 6 de Junho de 2016 às 18:11:53 UTC+1, Milan Bouchet-Valat 
escreveu:
>
> Le lundi 06 juin 2016 à 09:56 -0700, J Luis a écrit : 
> > 
> > > What exactly are you after?  
> > > 
> >  What I'm after is simple. To be able to access the members 
> > ``x_units`` and so on of 
> > 
> > http://gmt.soest.hawaii.edu/doc/latest/GMT_API.html#gmt-grids 
> > 
> > with the wrapper  
> > 
> > https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1236 
> > 
> > (note, the thing is working in its bulk but I'm having issues with 
> > those strings as I mentioned before) 
> > 
> > 
> > > There's not much more to it than using tuples, which should be well 
> > > documented. 
> > > 
> > tuples yes, but when I search for ``NTuples`` in the docs there is 
> > barely any hit and all that come show it being used as a type 
> > dfinition but found no mention of what it is. Yes, a ``ntuple`` 
> > function is documented but I guess it's not the same thing. 
> The codes could be improved, but basically NTuple is a standard tuple 
> with all elements being of the same type: 
> julia> NTuple{3,UInt8} 
> Tuple{UInt8,UInt8,UInt8} 
>
> julia> isa((1,2), NTuple{2,Int}) 
> true 
>
>
> Regards 
>
> > > We wrapped Vulkan with this Clang version: https://github.com/Julia 
> > > GPU/VulkanCore.jl/blob/master/gen/api/vk_common_1.0.0.jl#L1367 
> > > 
> > Thanks. I will look. 
> > 
> > Joaquim 
> >   
> > > 
> > > Best, 
> > > Simon 
> > > 
> > > > Hi, 
> > > > 
> > > > I have one of those types generated from a C struct with Clang.jl 
> > > > that turns a stack variable into a lng list of members (for 
> > > > example (but I have longer ones)) 
> > > > 
> > > > https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1 
> > > > 246 
> > > > 
> > > > (an in interlude: isn't yet any better way of representing a C 
> > > > "char str[256];"?) 
> > > > 
> > > > when executed I get (example) 
> > > > 
> > > > julia> hdr.x_units 
> > > > GMT.Array_80_Uint8(0x6c,0x6f,0x6e,0x67,0x69,0x74,0x75,0x64,0x65,0 
> > > > x20,0x5b,0x64,0x65,0x67,0x72,0x65,0x65,0x73,0x5f,0x65,0x61,0x73,0 
> > > > x74,0x5d,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 
> > > > x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 
> > > > x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 
> > > > x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0 
> > > > x00,0x00,0x00,0x00,0x00,0x00) 
> > > > 
> > > > but I need to transform it into a string. After some suffering I 
> > > > came out with this solution 
> > > > 
> > > > julia> join([Char(hdr.x_units.(n)) for n=1:sizeof(hdr.x_units)]) 
> > > > "longitude 
> > > > [degrees_east]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 
> > > > 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" 
> > > > 
> > > > well, it works but it's kind or ugly. Is there a better way of 
> > > > achieving this? Namely, how could I avoid creating a string with 
> > > > all of those \0's? I know I can remove them after, but what about 
> > > > not copying them on first place? 
> > > > 
> > > > Thanks 
> > > > 
> > > > 
>


[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread J Luis

segunda-feira, 6 de Junho de 2016 às 17:19:08 UTC+1, Simon Danisch escreveu:
>
> What exactly are you after? 
>

 What I'm after is simple. To be able to access the members ``x_units`` and 
so on of


http://gmt.soest.hawaii.edu/doc/latest/GMT_API.html#gmt-grids

with the wrapper 

https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1236

(note, the thing is working in its bulk but I'm having issues with those 
strings as I mentioned before)


There's not much more to it than using tuples, which should be well 
> documented.
>

tuples yes, but when I search for ``NTuples`` in the docs there is barely 
any hit and all that come show it being used as a type dfinition but found 
no mention of what it is. Yes, a ``ntuple`` function is documented but I 
guess it's not the same thing.
 

>
> We wrapped Vulkan with this Clang version: 
> https://github.com/JuliaGPU/VulkanCore.jl/blob/master/gen/api/vk_common_1.0.0.jl#L1367
>

Thanks. I will look.

Joaquim
 

>
> Best,
> Simon
>
> Am Montag, 6. Juni 2016 01:41:34 UTC+2 schrieb J Luis:
>>
>> Hi,
>>
>> I have one of those types generated from a C struct with Clang.jl that 
>> turns a stack variable into a lng list of members (for example (but I 
>> have longer ones))
>>
>> https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1246
>>
>> (an in interlude: isn't yet any better way of representing a C "char 
>> str[256];"?)
>>
>> when executed I get (example)
>>
>> julia> hdr.x_units
>> GMT.Array_80_Uint8(0x6c,0x6f,0x6e,0x67,0x69,0x74,0x75,0x64,0x65,0x20,0x5b
>> ,0x64,0x65,0x67,0x72,0x65,0x65,0x73,0x5f,0x65,0x61,0x73,0x74,0x5d,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
>>
>> but I need to transform it into a string. After some suffering I came out 
>> with this solution
>>
>> julia> join([Char(hdr.x_units.(n)) for n=1:sizeof(hdr.x_units)])
>> "longitude 
>> [degrees_east]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
>>
>> well, it works but it's kind or ugly. Is there a better way of achieving 
>> this? Namely, how could I avoid creating a string with all of those \0's? I 
>> know I can remove them after, but what about not copying them on first 
>> place?
>>
>> Thanks
>>
>>

[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread J Luis
Thanks Simon, some progress but I never worked with NTuples. Is there any 
example wrapper that uses this technique that  I can read/study?

segunda-feira, 6 de Junho de 2016 às 15:23:17 UTC+1, Simon Danisch escreveu:
>
> On master, Clang will emit NTuples, which is a bit nicer at least!
>
> bytestring(UInt8[a...])
> a = map(UInt8, ("abcd"...,))
>
> Am Montag, 6. Juni 2016 01:41:34 UTC+2 schrieb J Luis:
>>
>> Hi,
>>
>> I have one of those types generated from a C struct with Clang.jl that 
>> turns a stack variable into a lng list of members (for example (but I 
>> have longer ones))
>>
>> https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1246
>>
>> (an in interlude: isn't yet any better way of representing a C "char 
>> str[256];"?)
>>
>> when executed I get (example)
>>
>> julia> hdr.x_units
>> GMT.Array_80_Uint8(0x6c,0x6f,0x6e,0x67,0x69,0x74,0x75,0x64,0x65,0x20,0x5b
>> ,0x64,0x65,0x67,0x72,0x65,0x65,0x73,0x5f,0x65,0x61,0x73,0x74,0x5d,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
>>
>> but I need to transform it into a string. After some suffering I came out 
>> with this solution
>>
>> julia> join([Char(hdr.x_units.(n)) for n=1:sizeof(hdr.x_units)])
>> "longitude 
>> [degrees_east]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
>>
>> well, it works but it's kind or ugly. Is there a better way of achieving 
>> this? Namely, how could I avoid creating a string with all of those \0's? I 
>> know I can remove them after, but what about not copying them on first 
>> place?
>>
>> Thanks
>>
>>

[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread J Luis
The problem is that the text is inside one of those immutables generated by 
Clang (see: 
https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L371) so no 
simple bytestring(data) works because it complains that no method exists to 
convert from GMT.Array_80_Uint8 type

And worst, because I also need to make the inverse conversion from a string 
in Julia to those types ... and they are immutables another level of 
suffering is expecting me.
It really would be nice to have a simple way of doing this Julia<->C 
communication involving C structures with static members (e.g char 
str[512];)

segunda-feira, 6 de Junho de 2016 às 14:47:41 UTC+1, Steven G. Johnson 
escreveu:
>
> Slight correction: if you pass bytestring(data) a Vector{UInt8}, it 
> assumes the length of the data is the length of the string (in bytes), and 
> does not assume nul-terminated data. 



[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread J Luis
Thanks but the string encoding is not an issue. This julia code is a 
wrapper to a library that I know it uses only ASCII in the variables being 
accessed.

segunda-feira, 6 de Junho de 2016 às 10:57:29 UTC+1, Páll Haraldsson 
escreveu:
>
> On Sunday, June 5, 2016 at 11:41:34 PM UTC, J Luis wrote:
>>
>> Hi,
>>
>> I have one of those types generated from a C struct with Clang.jl that 
>> turns a stack variable into a lng list of members (for example (but I 
>> have longer ones))
>>
>> https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1246
>>
>> (an in interlude: isn't yet any better way of representing a C "char 
>> str[256];"?)
>>
>> when executed I get (example)
>>
>> julia> hdr.x_units
>> GMT.Array_80_Uint8(0x6c,0x6f,0x6e,0x67,0x69,0x74,0x75,0x64,0x65,0x20,0x5b
>> ,0x64,0x65,0x67,0x72,0x65,0x65,0x73,0x5f,0x65,0x61,0x73,0x74,0x5d,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
>> 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)
>>
>> but I need to transform it into a string. After some suffering I came out 
>> with this solution
>>
>> julia> join([Char(hdr.x_units.(n)) for n=1:sizeof(hdr.x_units)])
>> "longitude 
>> [degrees_east]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
>>
>> well, it works
>>
>
> Well, maybe not!
>
> If you can have multi-byte string encoding, such as UTF8, then indexing by 
> bytes will not work (UTF16, is not likely in your case, as \0 can happen in 
> the middle of strings, other multi-byte encodings, I know less about, might 
> or might not be safe). UTF8 and all the single-byte encodings I know, such 
> as ASCII, strictly allow \0 in the middle of a string, while a Cstring of 
> them assumes it can't happen.
>
> There should be a function (maybe there is), where you can point to a 
> Cstring (note it IS a type in Julia, for the C API.. at least) [or you 
> could hack Cstring.data to point to the first byte..] Note, it might assume 
> the string ends with \0, but I'm not sure in your case it will happen for 
> sure.. Then you need to guard with a function that takes care of finding 
> the first \0 with a fallback to max-size=x_units.
>
> Why is:
>
> immutable Cstring <: Any
>
> not a subtype of AbstractString? Anyway, you may want to convert the 
> string then to UTF8String.
>
>
> but it's kind or ugly. Is there a better way of achieving this? Namely, 
>> how could I avoid creating a string with all of those \0's? I know I can 
>> remove them after, but what about not copying them on first place?
>>
>> Thanks
>>
>>

[julia-users] Reconstruct a string from a Clang.jl generated looong type

2016-06-05 Thread J Luis
Hi,

I have one of those types generated from a C struct with Clang.jl that 
turns a stack variable into a lng list of members (for example (but I 
have longer ones))

https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1246

(an in interlude: isn't yet any better way of representing a C "char 
str[256];"?)

when executed I get (example)

julia> hdr.x_units
GMT.Array_80_Uint8(0x6c,0x6f,0x6e,0x67,0x69,0x74,0x75,0x64,0x65,0x20,0x5b,
0x64,0x65,0x67,0x72,0x65,0x65,0x73,0x5f,0x65,0x61,0x73,0x74,0x5d,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00)

but I need to transform it into a string. After some suffering I came out 
with this solution

julia> join([Char(hdr.x_units.(n)) for n=1:sizeof(hdr.x_units)])
"longitude 
[degrees_east]\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"

well, it works but it's kind or ugly. Is there a better way of achieving 
this? Namely, how could I avoid creating a string with all of those \0's? I 
know I can remove them after, but what about not copying them on first 
place?

Thanks



Re: [julia-users] Time handling: Micro/Nanosecond precision and time string formatting like Unix

2016-04-29 Thread J Luis
Sorry, I see my mistake. I know that it's an overflow but I forgot that '2' 
is a signed 64 int so the max allowed is

julia> 2^63-1
9223372036854775807

sexta-feira, 29 de Abril de 2016 às 14:26:38 UTC+1, Yichao Yu escreveu:
>
> On Fri, Apr 29, 2016 at 9:17 AM, J Luis > 
> wrote: 
> > OK, now I'm puzzled (0.4 on Win 64) 
> > 
> > julia> 2^60 
> > 1152921504606846976 
> > 
> > julia> 2^62 
> > 4611686018427387904 
> > 
> > julia> 2^63 
> > -9223372036854775808 
> > 
> > julia> 2^64 
> > 0 
> > 
> > 
>
> This is integer overflow. 
>
> > 
> > 
> > sexta-feira, 29 de Abril de 2016 às 14:03:52 UTC+1, Stefan Karpinski 
> > escreveu: 
> >> 
> >> I'll answer with a pair of questions: 
> >> 
> >> what range of dates can you represent using a 64-bit integer to 
> nanosecond 
> >> precision? 
> >> what range of dates can you represent using a 64-bit integer to 
> >> millisecond precision? 
> >> 
> >> 
> >> On Fri, Apr 29, 2016 at 8:06 AM, Ben Southwood  
> >> wrote: 
> >>> 
> >>> Are there any packages that can handle "Unix style" times?  How come 
> >>> Julia can only handle seconds in 0.4.5 and milliseconds in 0.5 
> (unstable)? 
> >>> Shouldn't we just aim big and go all the way to nanos? 
> >>> 
> >>> For example, it would be great if I could handle the following times. 
> >>> 
> >>> 2015-12-11 09:46:40.882362Z 
> >>> 
> >>> 2015-09-11 14:37:12.960014+01:00, 
> >>> 
> >> 
> > 
>


Re: [julia-users] Time handling: Micro/Nanosecond precision and time string formatting like Unix

2016-04-29 Thread J Luis
OK, now I'm puzzled (0.4 on Win 64)

julia> 2^60
1152921504606846976

julia> 2^62
4611686018427387904

julia> 2^63
-9223372036854775808

julia> 2^64
0




sexta-feira, 29 de Abril de 2016 às 14:03:52 UTC+1, Stefan Karpinski 
escreveu:
>
> I'll answer with a pair of questions:
>
>- what range of dates can you represent using a 64-bit integer to 
>nanosecond precision?
>- what range of dates can you represent using a 64-bit integer to 
>millisecond precision?
>
>
> On Fri, Apr 29, 2016 at 8:06 AM, Ben Southwood  > wrote:
>
>> Are there any packages that can handle "Unix style" times?  How come 
>> Julia can only handle seconds in 0.4.5 and milliseconds in 0.5 (unstable)?  
>> Shouldn't we just aim big and go all the way to nanos?
>>
>> For example, it would be great if I could handle the following times.
>>
>> 2015-12-11 09:46:40.882362Z
>>
>> 2015-09-11 14:37:12.960014+01:00,
>>
>>
>

[julia-users] Re: Options for constructing a 3D surface from a point cloud

2016-04-21 Thread J Luis

Is something like this 
that
 
you want?
Maybe Simon can make us a generic example on how to plot the point clouds 
like this.

quinta-feira, 21 de Abril de 2016 às 11:59:07 UTC+1, Simon Danisch escreveu:
>
> Well just for visualization you should checkout glvisualize 
> ... 
>
> Am Mittwoch, 17. Februar 2016 18:46:57 UTC+1 schrieb Chris:
>>
>> If I have a set of 3D points, randomly sampled from some arbitrary 
>> surface, what are my options (in terms of Julia packages) for 
>> reconstructing the surface for plotting? I've done a little research and 
>> found the Meshes.jl package, but I can't find any good examples or 
>> documentation for it. In case it's not already obvious, I'm completely new 
>> to this topic, so any direction would be appreciated.
>>
>> Thanks,
>> Chris
>>
>

[julia-users] Re: Help with pipes

2016-03-13 Thread J Luis
Created issue 15479 <https://github.com/JuliaLang/julia/issues/15479>

domingo, 13 de Março de 2016 às 00:59:28 UTC, ele...@gmail.com escreveu:
>
> Ok, the docs 
> http://docs.julialang.org/en/release-0.4/stdlib/io-network/#Base.IOBuffer 
> seem to say it creates an IOStream, and pipeline says it accepts one 
> http://docs.julialang.org/en/release-0.4/stdlib/base/?highlight=pipeline#Base.pipeline
>  
> so one of them is wrong.
>
> On Sunday, 13 March 2016 10:49:55 UTC+10, J Luis wrote:
>>
>> Thanks but doesn't work either
>>
>> a = IOBuffer();
>> print(a, P.ps);
>>
>> julia> run(pipeline(a, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH 
>> -sDEVICE=bbox -`))
>> ERROR: MethodError: `uvtype` has no method matching uvtype(::Base.
>> AbstractIOBuffer{Array{UInt8,1}})
>>  in _jl_spawn at process.jl:253
>>
>>
>>
>> domingo, 13 de Março de 2016 às 00:36:19 UTC, ele...@gmail.com escreveu:
>>>
>>> Can't test ATM, but argument one IOBuffer(ps_string) ?
>>>
>>> On Sunday, 13 March 2016 09:52:52 UTC+10, J Luis wrote:
>>>>
>>>> Hi,
>>>>
>>>> I need to reproduce a similar behavior of this on command line. 
>>>>
>>>> cat barco.eps | gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -
>>>> %%BoundingBox: 0 0 71 64
>>>> %%HiResBoundingBox: 0.00 0.00 70.865998 63.305998
>>>>
>>>> What it does is to send the contents of a PostScript file (ascii file) 
>>>> through ghostscript and get the result printed on stdout
>>>>
>>>> Now, instead of a file I have in Julia the contents of that file as a 
>>>> long string and wanted to feed it to ghostscript, first to do the 
>>>> BoundingBox query and later on to convert the ps into a raster. So I tried
>>>>
>>>>  run(pipeline(P.ps, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH 
>>>> -sDEVICE=bbox -`))
>>>> ERROR: open: no such file or directory (ENOENT)
>>>>  in open at fs.jl:82
>>>>
>>>> I guess the reason lies on the *pipeline *manual mention when it says 
>>>> that "Strings refer to filenames". So given that P.ps above is a 
>>>> string it tries to open it as a file.
>>>> So my question is, how can I put the string inpipeline's first argument 
>>>> and get the output in a Julia variable?
>>>>
>>>> Thanks
>>>>
>>>> Joaquim
>>>>
>>>

[julia-users] Re: Help with pipes

2016-03-12 Thread J Luis
Thanks but doesn't work either

a = IOBuffer();
print(a, P.ps);

julia> run(pipeline(a, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox 
-`))
ERROR: MethodError: `uvtype` has no method matching uvtype(::Base.
AbstractIOBuffer{Array{UInt8,1}})
 in _jl_spawn at process.jl:253



domingo, 13 de Março de 2016 às 00:36:19 UTC, ele...@gmail.com escreveu:
>
> Can't test ATM, but argument one IOBuffer(ps_string) ?
>
> On Sunday, 13 March 2016 09:52:52 UTC+10, J Luis wrote:
>>
>> Hi,
>>
>> I need to reproduce a similar behavior of this on command line. 
>>
>> cat barco.eps | gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -
>> %%BoundingBox: 0 0 71 64
>> %%HiResBoundingBox: 0.00 0.00 70.865998 63.305998
>>
>> What it does is to send the contents of a PostScript file (ascii file) 
>> through ghostscript and get the result printed on stdout
>>
>> Now, instead of a file I have in Julia the contents of that file as a 
>> long string and wanted to feed it to ghostscript, first to do the 
>> BoundingBox query and later on to convert the ps into a raster. So I tried
>>
>>  run(pipeline(P.ps, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox 
>> -`))
>> ERROR: open: no such file or directory (ENOENT)
>>  in open at fs.jl:82
>>
>> I guess the reason lies on the *pipeline *manual mention when it says 
>> that "Strings refer to filenames". So given that P.ps above is a string 
>> it tries to open it as a file.
>> So my question is, how can I put the string inpipeline's first argument 
>> and get the output in a Julia variable?
>>
>> Thanks
>>
>> Joaquim
>>
>

[julia-users] Help with pipes

2016-03-12 Thread J Luis
Hi,

I need to reproduce a similar behavior of this on command line. 

cat barco.eps | gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -
%%BoundingBox: 0 0 71 64
%%HiResBoundingBox: 0.00 0.00 70.865998 63.305998

What it does is to send the contents of a PostScript file (ascii file) 
through ghostscript and get the result printed on stdout

Now, instead of a file I have in Julia the contents of that file as a long 
string and wanted to feed it to ghostscript, first to do the BoundingBox 
query and later on to convert the ps into a raster. So I tried

 run(pipeline(P.ps, `gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox -`
))
ERROR: open: no such file or directory (ENOENT)
 in open at fs.jl:82

I guess the reason lies on the *pipeline *manual mention when it says that 
"Strings refer to filenames". So given that P.ps above is a string it tries 
to open it as a file.
So my question is, how can I put the string inpipeline's first argument and 
get the output in a Julia variable?

Thanks

Joaquim


Re: [julia-users] Meshgrid function

2016-03-09 Thread J Luis


> I think this is a big mistake so many Julia developers (not all) are 
> making: 
>
>
I agree with this. For all those in future that are not necessarily 
programmers (and Julia hopes to attract many of those, I believe) and will 
need a meshgrid, the time will take them to find out the alternative can 
hardly be seen a efficiency factor from the language.
That said, meshgrid is one of my favorite hates in Matlab  so big is the 
resources waste it carries with, but when I need it I like it to be there.


[julia-users] Re: String interpolation question

2016-03-09 Thread J Luis
Worked for me

julia> s="I like $x"
"I like 2"



quarta-feira, 9 de Março de 2016 às 13:59:47 UTC, Eric Forgy escreveu:
>
> If I have
>
> x = 2
> s = "I like \$x"
>
>
> Is there a nice way to get
>
> "I like 2"
>
>
> ?
>
>

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

2016-03-08 Thread J Luis
Ok, thanks ... but will wait for a simpler thing to use.

terça-feira, 8 de Março de 2016 às 19:32:28 UTC, Avik Sengupta escreveu:
>
> Use the "Eclipse IDE for Java Developers". That should give you the least 
> amount of cruft. 
>
> Regards
> -
> Avik
>
> On Tuesday, 8 March 2016 19:00:22 UTC, J Luis wrote:
>>
>> A quick previous question. Which Eclipse version from the (many) 
>> available options should we install  (Java is completely out of my 
>> interest)?
>>
>> http://www.eclipse.org/downloads/
>>
>> Thanks
>>
>> terça-feira, 8 de Março de 2016 às 13:56:39 UTC, Liye zhang escreveu:
>>>
>>> If you are trying to find an IDE for Julia which is as convenient as 
>>> PyDev for python, or RStudio for R, you can test JuliaDT. Thanks for 
>>> the authors' excellent work!
>>>
>>> https://github.com/JuliaComputing/JuliaDT/releases/tag/v0.0.1 
>>>
>>> More about this software,
>>> http://juliacomputing.com/blog/2016/02/06/Eclipse-JuliaDT.html
>>>
>>

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

2016-03-08 Thread J Luis
A quick previous question. Which Eclipse version from the (many) available 
options should we install  (Java is completely out of my interest)?

http://www.eclipse.org/downloads/

Thanks

terça-feira, 8 de Março de 2016 às 13:56:39 UTC, Liye zhang escreveu:
>
> If you are trying to find an IDE for Julia which is as convenient as PyDev 
> for python, or RStudio for R, you can test JuliaDT. Thanks for the 
> authors' excellent work!
>
> https://github.com/JuliaComputing/JuliaDT/releases/tag/v0.0.1 
>
> More about this software,
> http://juliacomputing.com/blog/2016/02/06/Eclipse-JuliaDT.html
>


[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread J Luis
Ok, thanks.

Joaquim

quinta-feira, 3 de Março de 2016 às 16:45:20 UTC, Josef Heinen escreveu:
>
> The build problem is fixed (in the master branch).
> peaks() is part of GR - also in the master branch.
>
> The next GR.jl release will be released this weekend.
>
> On Thursday, March 3, 2016 at 5:28:29 PM UTC+1, J Luis wrote:
>>
>> Hmm, is 'peaks' part of GR? Because
>>
>> julia> using GR
>>
>> julia> z = peaks();
>> ERROR: UndefVarError: peaks not defined
>>
>>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread J Luis
Hmm, is 'peaks' part of GR? Because

julia> using GR

julia> z = peaks();
ERROR: UndefVarError: peaks not defined



quinta-feira, 3 de Março de 2016 às 16:24:07 UTC, Josef Heinen escreveu:
>
> I could re-produce the problem on a fresh Windows installation.
> Removing the downloaded archive leads to a chmod error, although I don't 
> use this function in build.jl.
> Will have to use another method to delete the file.
>
> Nevertheless, the package should be installed 
>
> On Thursday, March 3, 2016 at 3:13:33 PM UTC+1, J Luis wrote:
>>
>> But unfortunately on Windows
>>
>> INFO: Downloading pre-compiled GR 0.17.3 binary
>> =[ ERROR: GR 
>> ]==
>>
>> LoadError: chmod: no such file or directory (ENOENT)
>> while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting 
>> on line 25
>>
>>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread J Luis
Oops, don't know what happened to the message asking me what version was 
it, and my reply to it (both disappeared), but here it goes again. 
It eas trying to install v0.0.17

julia> Pkg.add("GR")
INFO: Cloning cache of GR from git://github.com/jheinen/GR.jl.git
INFO: Installing GR v0.9.17
INFO: Building GR
INFO: Downloading pre-compiled GR 0.17.3 binary
=[ ERROR: GR 
]==

LoadError: chmod: no such file or directory (ENOENT)
while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting on 
line 25



quinta-feira, 3 de Março de 2016 às 14:13:33 UTC, J Luis escreveu:
>
> But unfortunately on Windows
>
> INFO: Downloading pre-compiled GR 0.17.3 binary
> =[ ERROR: GR 
> ]==
>
> LoadError: chmod: no such file or directory (ENOENT)
> while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting 
> on line 25
>
>
>
> quinta-feira, 3 de Março de 2016 às 08:26:20 UTC, Josef Heinen escreveu:
>>
>> *Pkg.add("GR")*
>>
>> *using GR*
>> *z = peaks()*
>> *surface(z)*
>>
>>
>> <https://lh3.googleusercontent.com/-2CSDxUlOqeM/Vtf1BpM3awI/ACE/gUeA-pQotpQ/s1600/surface.png>
>>
>>
>>
>> On Thursday, March 3, 2016 at 5:10:52 AM UTC+1, mauri...@gmail.com wrote:
>>>
>>> Hello Julia users, 
>>>
>>> I would like to know if anyone knows how we can have 3D scatter plots or 
>>> meshed surfaces color plots using Julia.  
>>>
>>> My problem is based on four variables, so I'm trying to visualize the 
>>> data according to these options. 
>>>
>>> Any idea or example code will be really helpful. 
>>>
>>> Thanks!
>>>
>>

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-03 Thread J Luis
But unfortunately on Windows

INFO: Downloading pre-compiled GR 0.17.3 binary
=[ ERROR: GR 
]==

LoadError: chmod: no such file or directory (ENOENT)
while loading C:\j\.julia\v0.4\GR\deps\build.jl, in expression starting on 
line 25



quinta-feira, 3 de Março de 2016 às 08:26:20 UTC, Josef Heinen escreveu:
>
> *Pkg.add("GR")*
>
> *using GR*
> *z = peaks()*
> *surface(z)*
>
>
> 
>
>
>
> On Thursday, March 3, 2016 at 5:10:52 AM UTC+1, mauri...@gmail.com wrote:
>>
>> Hello Julia users, 
>>
>> I would like to know if anyone knows how we can have 3D scatter plots or 
>> meshed surfaces color plots using Julia.  
>>
>> My problem is based on four variables, so I'm trying to visualize the 
>> data according to these options. 
>>
>> Any idea or example code will be really helpful. 
>>
>> Thanks!
>>
>

Re: [julia-users] eachindex is much slower than normal indexing for matrices

2016-02-25 Thread J Luis
Nope

julia> s=0.0;

julia> m=rand(1,1000);

julia> @time for i in 1:1, j in 1:1000
   s = s + m[i,j]
   end
ERROR: UndefVarError: s not defined
 [inlined code] from .\none:2
 in anonymous at .\no file:4294967295
 in eval at :0



quinta-feira, 25 de Fevereiro de 2016 às 14:58:44 UTC, Yichao Yu escreveu:
>
> On Thu, Feb 25, 2016 at 9:57 AM, Yichao Yu > 
> wrote: 
> > On Thu, Feb 25, 2016 at 9:33 AM, abc > 
> wrote: 
> >> Ah, yes, this seems to have fixed the problem, thank you. 
> >> 
> >> Now, when not in global scope, using eachindex is definitely the 
> fastest 
> >> approach. 
> >> I made some measurements over 1000 runs for each of the approaches in 
> the 
> >> original post, here are the averages: 
> >> Using eachindex: 0.0026683 
> >> Using ranges: 0.0041256 
> >> Using in: 0.0031200 
> >> 
> >> I guess I'll stick with eachindex. :) 
> >> 
> >> On Thursday, February 25, 2016 at 1:50:04 PM UTC, Stefan Karpinski 
> wrote: 
> >>> 
> >>> Can you try it not in global scope? 
> >>> 
> >>> On Thu, Feb 25, 2016 at 5:17 AM, abc  wrote: 
>  
>  For the following matrix 
>  my_matrix = randn(1, 1000) 
>  using eachindex to access all elements is much slower than using 
> ranges 
>  or even for el in my_matrix, even though it says in the documentation 
>  (
> http://docs.julialang.org/en/release-0.4/stdlib/arrays/#Base.eachindex) 
>  that eachindex uses ranges for Arrays. 
>  
>  Some code and numbers: 
>  julia> sum = 0.0 
>  julia> @time for iter in eachindex(my_matrix) 
>   sum += my_matrix[iter] 
>   end 
> 1.288944 seconds (50.00 M allocations: 915.519 MB, 3.36% gc time) 
>  julia> sum = 0.0 
>  julia> @time for i in 1:1, j in 1:1000 
>   sum += my_matrix[i,j] 
>   end 
> 0.681678 seconds (34.38 M allocations: 524.582 MB, 2.45% gc time) 
> > 
> > ^^ I believe this one is also iterating in the wrong direction. Try 
> > `for j in ..., for i in ...` 
>
> `for j in ... , i in ...` * 
>
> > 
>  julia> sum = 0.0 
>  julia> @time for el in my_matrix 
>   sum += el 
>   end 
> 1.063564 seconds (40.00 M allocations: 762.993 MB, 3.41% gc time) 
>  
>  Am I reading the documentation wrong, or is there something strange 
> with 
>  the matrix indexing? Because as it is, I don't see any benefit of 
> using 
>  anything different than simple ranges for manipulating matrices. 
> >>> 
> >>> 
> >> 
>


[julia-users] Re: eachindex is much slower than normal indexing for matrices

2016-02-25 Thread J Luis
Incidentally, this errors in 0.5 (but works fine in 0.4)

julia> s=0.0;

julia> m=rand(1,1000);

julia> @time for el in m
  s = s + el
  end
ERROR: UndefVarError: s not defined
 [inlined code] from .\none:2
 in anonymous at .\no file:4294967295
 in eval at :0



quinta-feira, 25 de Fevereiro de 2016 às 13:35:56 UTC, abc escreveu:
>
> For the following matrix
> my_matrix = randn(1, 1000)
> using eachindex to access all elements is much slower than using ranges 
> or even for el in my_matrix, even though it says in the documentation (
> http://docs.julialang.org/en/release-0.4/stdlib/arrays/#Base.eachindex) 
> that eachindex uses ranges for Arrays.
>
> Some code and numbers:
> julia> sum = 0.0
> julia> @time for iter in eachindex(my_matrix)
>  sum += my_matrix[iter]
>  end
>1.288944 seconds (50.00 M allocations: 915.519 MB, 3.36% gc time)
> julia> sum = 0.0
> julia> @time for i in 1:1, j in 1:1000
>  sum += my_matrix[i,j]
>  end
>0.681678 seconds (34.38 M allocations: 524.582 MB, 2.45% gc time)
> julia> sum = 0.0
> julia> @time for el in my_matrix
>  sum += el
>  end
>1.063564 seconds (40.00 M allocations: 762.993 MB, 3.41% gc time)
>
> Am I reading the documentation wrong, or is there something strange with 
> the matrix indexing? Because as it is, I don't see any benefit of using 
> anything different than simple ranges for manipulating matrices.
>


[julia-users] Re: Options for constructing a 3D surface from a point cloud

2016-02-17 Thread J Luis
It is not yet registered but you can use GMT 
, namely its module 'surface' to do a 
minimum curvature interpolation (but other algorithms are available as 
well).

quarta-feira, 17 de Fevereiro de 2016 às 17:46:57 UTC, Chris escreveu:
>
> If I have a set of 3D points, randomly sampled from some arbitrary 
> surface, what are my options (in terms of Julia packages) for 
> reconstructing the surface for plotting? I've done a little research and 
> found the Meshes.jl package, but I can't find any good examples or 
> documentation for it. In case it's not already obvious, I'm completely new 
> to this topic, so any direction would be appreciated.
>
> Thanks,
> Chris
>


Re: [julia-users] Is this a 0.5 bug?

2016-02-17 Thread J Luis
Ok, thanks. Surprising for Matlab users but ok.

quarta-feira, 17 de Fevereiro de 2016 às 15:30:54 UTC, Yichao Yu escreveu:
>
> On Wed, Feb 17, 2016 at 10:22 AM, J Luis > 
> wrote: 
> > Hi, see 
> > 
> > function ttt() 
> > t1 = [-1167.3955469319576 9.9]; 
> > t2 = [-1170.4689400259758 -15.31]; 
> > t = [t1[1,:]; t2[1,:]] 
> > @show(t1,t2,t) 
> > end 
> > 
> > prints on 0.4 
> > 
> > t1 = [-1167.3955469319576 9.9] 
> > t2 = [-1170.4689400259758 -15.31] 
> > t = [-1167.3955469319576 9.9 
> >  -1170.4689400259758 -15.31] 
> > 2x2 Array{Float64,2}: 
> >  -1167.4 9.9 
> >  -1170.47  -15.31 
> > 
> > but on 0.5 (built yesterday) 
> > 
> > t1 = [-1167.3955469319576 9.9] 
> > t2 = [-1170.4689400259758 -15.31] 
> > t = [-1167.3955469319576,9.9,-1170.4689400259758,-15.31] 
> > 4-element Array{Float64,1}: 
> >  -1167.4 
> >  9.9 
> >  -1170.47 
> >-15.31 
>
> IIUC this is an intentional change 
> https://github.com/JuliaLang/julia/pull/13612. 
>
> An easy way to fix the compatibility on 0.4 and 0.5 is to use 1:1 instead 
> of 1. 
>


[julia-users] Is this a 0.5 bug?

2016-02-17 Thread J Luis
Hi, see

function ttt()
t1 = [-1167.3955469319576 9.9];
t2 = [-1170.4689400259758 -15.31];
t = [t1[1,:]; t2[1,:]]
@show(t1,t2,t)
end

prints on 0.4

t1 = [-1167.3955469319576 9.9]
t2 = [-1170.4689400259758 -15.31]
t = [-1167.3955469319576 9.9
 -1170.4689400259758 -15.31]
2x2 Array{Float64,2}:
 -1167.4 9.9
 -1170.47  -15.31

but on 0.5 (built yesterday)

t1 = [-1167.3955469319576 9.9]
t2 = [-1170.4689400259758 -15.31]
t = [-1167.3955469319576,9.9,-1170.4689400259758,-15.31]
4-element Array{Float64,1}:
 -1167.4
 9.9
 -1170.47
   -15.31


Re: [julia-users] Re: Googling the functions I need in Julia is hard

2016-02-12 Thread J Luis
One main 'dislike' I find in the documentation is that, contrary to Matlab 
and R examples that have one page for each function, in julia we have lots 
of functions per page with short and often cryptic descriptions. Example

std(*v*[, *region*])

Compute the sample standard deviation of a vector or array v, optionally 
along dimensions in region.

To have longer and, VERY IMPORTANT, usage examples one need a per function 
page manual.

sexta-feira, 12 de Fevereiro de 2016 às 11:10:54 UTC, Milan Bouchet-Valat 
escreveu:
>
> Le vendredi 12 février 2016 à 09:51 +0100, Michele Zaffalon a écrit : 
> > But the original point is still valid: using the search box in the 
> > official documentation page http://docs.julialang.org/en/release-0.4, 
> > searching for "standard deviation" does not bring up any useful hit, 
> > despite the fact that Base.std is fairly well documented and contains 
> > the words standard deviation. 
> > Is there a reason why it should work at the REPL but not in the 
> > webpage? 
> Searching for "deviation" works, so it's quite mysterious that 
> "standard deviation" doesn't... Looks like a bug in the Sphinx search 
> engine. 
>
> Google's behavior is really weird too. Even a query like "standard 
> deviation julia site:docs.julialang.org" gives the manual page home for 
> the standard library first (even if it doesn't contain "deviation"), as 
> well as pages mentioning "standard error". Maybe some pages are not 
> indexed at all? Could something be tweaked in the Sphinx configuration? 
>
>
> Regards 
>
> > 
> > On Fri, Feb 12, 2016 at 9:25 AM, Mauro > 
> wrote: 
> > > Also at the Julia REPL: 
> > > 
> > > julia> apropos("standard deviation") 
> > > randn! 
> > > stdm 
> > > std 
> > > randn 
> > > 
> > > help?> std 
> > > search: std stdm STDIN STDOUT STDERR setdiff setdiff! hist2d 
> > > hist2d! stride strides StridedArray StridedVector StridedMatrix 
> > > StridedVecOrMat redirect_stdin 
> > > 
> > >   std(v[, region]) 
> > > 
> > >   Compute the sample standard deviation of a vector or array v, 
> > > optionally along dimensions in region. The algorithm returns an 
> > > estimator of the generative 
> > >   distribution's standard deviation under the assumption that 
> > > each entry of v is an IID drawn from that generative distribution. 
> > > This computation is equivalent to 
> > >   calculating sqrt(sum((v - mean(v)).^2) / (length(v) - 1)). 
> > > Note: Julia does not ignore NaN values in the computation. For 
> > > applications requiring the handling of 
> > >   missing data, the DataArray package is recommended. 
> > > 
> > > Having said this, documentation always needs improvements and is 
> > > certainly not on Matlab's level of completeness.  Please contribute 
> > > where you find it lacking.  See 
> > > https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#impr 
> > > oving-documentation 
> > > 
> > > 
> > > On Fri, 2016-02-12 at 09:18, NotSoRecentConvert  > 
> > > wrote: 
> > > > You can even download the entire thing as a PDF, HTML, or EPUB if 
> > > you want 
> > > > to highlight, annotate, or bookmark your most searched functions. 
> > > Look in 
> > > > the lower right of the page for "v: latest" and click it for more 
> > > options. 
> > > > 
> > > > On Friday, February 12, 2016 at 8:03:27 AM UTC+1, Lutfullah Tomak 
> > > wrote: 
> > > >> 
> > > >> There is this one 
> > > >> 
> > > >> http://docs.julialang.org/en/release-0.4/stdlib/math/#Base.std 
> > > >> 
> > > >> Instead of google, I use this manual for search. 
> > > >> 
> > > >> 
> > > 
>


[julia-users] Re: Conda

2016-02-04 Thread J Luis
Small? Mine (that I didn't ask for) has 320 Mb.

quinta-feira, 4 de Fevereiro de 2016 às 19:44:54 UTC, digxx escreveu:
>
> When I do not have Conda installed but install PyCall in Julia does 
> Pkg.add("PyCall") still installs its own small PYthon distribution?
>


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 
> >> 
>


Re: [julia-users] Re: Trying again Cxx on Windows

2016-01-05 Thread J Luis
Well, I did remove deps\build\llvm-3.7.1 but when making again I get tons 
of.
Guess that it's time to stop and try again in a couple of months.


Cannot export 
ZZNK4llvm14MCLOHDirective11getEmitSizeERKNS_16MachObjectWriterERKNS_11MCAsmLayoutEENK20raw_counting_ostream11current_posEv:
 
symbol not defined
Cannot export 
ZnwIN4llvm15MallocAllocatorELy4096ELy4096EEPvyRNS0_20BumpPtrAllocatorImplIT_XT0_EXT1_EEE:
 
symbol not defined
Cannot export _jit_debug_descriptor: symbol not defined
Cannot export _jit_debug_register_code: symbol not defined
collect2.exe: error: ld returned 1 exit status

terça-feira, 5 de Janeiro de 2016 às 23:23:39 UTC, Isaiah escreveu:
>
> Good point, you don't need LLDB for only Cxx.jl (I was trying to build 
> Gallium).
>
> You do need BUILD_LLVM_CLANG. I haven't had much luck enabling 
> sub-projects in Make.user with an existing LLVM build, so my only 
> recommendation would be to remove the LLVM build directory.
>
> On Tue, Jan 5, 2016 at 6:08 PM, J Luis > 
> wrote:
>
>> I'm not trying to build with LLDB. Actually, I had to build with (in 
>> Make.user)
>>
>> LLVM_VER=3.7.1
>>
>> adding the other settings advised in the Cxx page lead to lots of errors. 
>> But after having build with the above, I added
>>
>> override BUILD_LLVM_CLANG=1
>> override USE_LLVM_SHLIB=1
>>
>> and advanced more (make install still has many errors)
>>
>> with this I got a clang and the ScopeInfo.h file, but it was not yet 
>> found. 
>> I think there is an error in Cxx\deps\BuildBootstrap.Makefile. It has
>>
>> -I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/lib \
>>
>> but there are no header files in it. Changing the line to
>>
>> -I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/include 
>> \
>>
>> allowed me to proceed a bit further. It now errors 
>>
>> V:/julia64/usr/bin/../../deps/srccache/llvm-3.7.1/tools/clang/include/clang/Basic/DiagnosticIDs.h:53:49:
>>  
>> fatal error: cl
>> ang/Basic/DiagnosticCommonKinds.inc: No such file or directory
>>  #include "clang/Basic/DiagnosticCommonKinds.inc"
>>
>> but the file exists in
>>
>>deps\build\llvm-3.7.1\build_Release\tools\clang\include\clang\Basic
>> or
>>usr-staging\llvm-3.7.1\build_Release\V\julia64\usr\include\clang\Basic
>>
>>
>>
>>
>>
>>
>> terça-feira, 5 de Janeiro de 2016 às 22:28:02 UTC, Isaiah escreveu:
>>>
>>> Last time I tried this (~October), there were still issues with using 
>>> LLVM as a shared library, and with building LLDB using the recommended 
>>> win32 thread model toolchain. See comments here:
>>> https://github.com/Keno/Cxx.jl/issues/62#issuecomment-88979566
>>>
>>> If you have gotten through the LLDB build then maybe that no longer 
>>> applies.
>>>
>>> and indeed, I have no ScopeInfo.h arround
>>>
>>>
>>> https://github.com/Keno/Cxx.jl/issues/207#issuecomment-169043432
>>>
>>> On Tue, Jan 5, 2016 at 4:57 PM, J Luis  wrote:
>>>
>>>> but even if I remove those "coward" lines, it errors later with
>>>>
>>>> ../src/bootstrap.cpp:31:34: fatal error: clang/Sema/ScopeInfo.h: No 
>>>> such file or directory
>>>>  #include "clang/Sema/ScopeInfo.h"
>>>>   ^
>>>> compilation terminated.
>>>> BuildBootstrap.Makefile:95: recipe for target 'build/bootstrap.o' failed
>>>> make: *** [build/bootstrap.o] Error 1
>>>>
>>>> and indeed, I have no ScopeInfo.h arround
>>>>
>>>> terça-feira, 5 de Janeiro de 2016 às 19:37:54 UTC, Keno Fischer 
>>>> escreveu:
>>>>>
>>>>> `:` probably? May have to add the makefile magic that turns 
>>>>> windows-style paths into msys style paths.
>>>>>
>>>>> On Tue, Jan 5, 2016 at 8:35 PM, J Luis  wrote:
>>>>>
>>>>>> Hmm, I found a problem. When running Julia it doesn't know anything 
>>>>>> about 'make'. So I added the msys2 dir where it lives to the path and 
>>>>>> moved 
>>>>>> to next error
>>>>>>
>>>>>> Tuning for julia installation at: C:\programs\julia64\usr\bin
>>>>>> C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing 
>>>>>> to build into directory with a shell-metacharacter in the path (got: 
>>>>>> C:/programs/julia64/usr/bin/../..).  Stop.
>>>>>>
>>>>>> What  " shell-metacharacter "?
>>>>>>
>>>>>>
>>>>>>
>>>>>> terça-feira, 5 de Janeiro de 2016 às 19:21:31 UTC, J Luis escreveu:
>>>>>>>
>>>>>>> So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying 
>>>>>>> (again) to build Cxx, but ...
>>>>>>>
>>>>>>> any idea why it errors with (which is not true)?
>>>>>>>
>>>>>>> Pkg.build("Cxx")
>>>>>>> LoadError: could not spawn `make -f BuildBootstrap.Makefile 
>>>>>>> JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory 
>>>>>>> (ENOENT)
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>> Joaquim
>>>>>>>
>>>>>>
>>>>>
>>>
>

Re: [julia-users] Re: Trying again Cxx on Windows

2016-01-05 Thread J Luis
and even if I make it find that inc file

../src/bootstrap.cpp: In function 'llvm::Function* 
CloneFunctionAndAdjust(CxxInstance*, llvm::Function*, llvm::FunctionT
ype*, bool, llvm::ClonedCodeInfo*, const clang::CodeGen::CGFunctionInfo&, 
clang::FunctionDecl*, bool, bool*, void**)':
../src/bootstrap.cpp:584:62: error: request for member 'getPointer' in 
'Cxx->CxxInstance::CGF->clang::CodeGen::CodeGenFu
nction::GetAddrOfLocalVar(PVD)', which is of pointer type 'llvm::Value*' 
(maybe you meant to use '->' ?)
   llvm::Value *ArgPtr = Cxx->CGF->GetAddrOfLocalVar(PVD).getPointer();
  ^
../src/bootstrap.cpp:631:57: error: 'Address' is not a member of 
'clang::CodeGen'
   
Cxx->CGF->EmitAggregateCopy(Cxx->CGF->ReturnValue,clang::CodeGen::Address(Call,clang::CharUnits::fromQuantity(siz
eof(void*))),FD->getReturnType());

... (more errors)



terça-feira, 5 de Janeiro de 2016 às 23:08:15 UTC, J Luis escreveu:
>
> I'm not trying to build with LLDB. Actually, I had to build with (in 
> Make.user)
>
> LLVM_VER=3.7.1
>
> adding the other settings advised in the Cxx page lead to lots of errors. 
> But after having build with the above, I added
>
> override BUILD_LLVM_CLANG=1
> override USE_LLVM_SHLIB=1
>
> and advanced more (make install still has many errors)
>
> with this I got a clang and the ScopeInfo.h file, but it was not yet 
> found. 
> I think there is an error in Cxx\deps\BuildBootstrap.Makefile. It has
>
> -I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/lib \
>
> but there are no header files in it. Changing the line to
>
> -I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/include \
>
> allowed me to proceed a bit further. It now errors 
>
> V:/julia64/usr/bin/../../deps/srccache/llvm-3.7.1/tools/clang/include/clang/Basic/DiagnosticIDs.h:53:49:
>  
> fatal error: cl
> ang/Basic/DiagnosticCommonKinds.inc: No such file or directory
>  #include "clang/Basic/DiagnosticCommonKinds.inc"
>
> but the file exists in
>
>deps\build\llvm-3.7.1\build_Release\tools\clang\include\clang\Basic
> or
>usr-staging\llvm-3.7.1\build_Release\V\julia64\usr\include\clang\Basic
>
>
>
>
>
>
> terça-feira, 5 de Janeiro de 2016 às 22:28:02 UTC, Isaiah escreveu:
>>
>> Last time I tried this (~October), there were still issues with using 
>> LLVM as a shared library, and with building LLDB using the recommended 
>> win32 thread model toolchain. See comments here:
>> https://github.com/Keno/Cxx.jl/issues/62#issuecomment-88979566
>>
>> If you have gotten through the LLDB build then maybe that no longer 
>> applies.
>>
>> and indeed, I have no ScopeInfo.h arround
>>
>>
>> https://github.com/Keno/Cxx.jl/issues/207#issuecomment-169043432
>>
>> On Tue, Jan 5, 2016 at 4:57 PM, J Luis  wrote:
>>
>>> but even if I remove those "coward" lines, it errors later with
>>>
>>> ../src/bootstrap.cpp:31:34: fatal error: clang/Sema/ScopeInfo.h: No such 
>>> file or directory
>>>  #include "clang/Sema/ScopeInfo.h"
>>>   ^
>>> compilation terminated.
>>> BuildBootstrap.Makefile:95: recipe for target 'build/bootstrap.o' failed
>>> make: *** [build/bootstrap.o] Error 1
>>>
>>> and indeed, I have no ScopeInfo.h arround
>>>
>>> terça-feira, 5 de Janeiro de 2016 às 19:37:54 UTC, Keno Fischer escreveu:
>>>>
>>>> `:` probably? May have to add the makefile magic that turns 
>>>> windows-style paths into msys style paths.
>>>>
>>>> On Tue, Jan 5, 2016 at 8:35 PM, J Luis  wrote:
>>>>
>>>>> Hmm, I found a problem. When running Julia it doesn't know anything 
>>>>> about 'make'. So I added the msys2 dir where it lives to the path and 
>>>>> moved 
>>>>> to next error
>>>>>
>>>>> Tuning for julia installation at: C:\programs\julia64\usr\bin
>>>>> C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing 
>>>>> to build into directory with a shell-metacharacter in the path (got: 
>>>>> C:/programs/julia64/usr/bin/../..).  Stop.
>>>>>
>>>>> What  " shell-metacharacter "?
>>>>>
>>>>>
>>>>>
>>>>> terça-feira, 5 de Janeiro de 2016 às 19:21:31 UTC, J Luis escreveu:
>>>>>>
>>>>>> So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying 
>>>>>> (again) to build Cxx, but ...
>>>>>>
>>>>>> any idea why it errors with (which is not true)?
>>>>>>
>>>>>> Pkg.build("Cxx")
>>>>>> LoadError: could not spawn `make -f BuildBootstrap.Makefile 
>>>>>> JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory 
>>>>>> (ENOENT)
>>>>>>
>>>>>> Thanks
>>>>>>
>>>>>> Joaquim
>>>>>>
>>>>>
>>>>
>>

Re: [julia-users] Re: Trying again Cxx on Windows

2016-01-05 Thread J Luis
I'm not trying to build with LLDB. Actually, I had to build with (in 
Make.user)

LLVM_VER=3.7.1

adding the other settings advised in the Cxx page lead to lots of errors. 
But after having build with the above, I added

override BUILD_LLVM_CLANG=1
override USE_LLVM_SHLIB=1

and advanced more (make install still has many errors)

with this I got a clang and the ScopeInfo.h file, but it was not yet found. 
I think there is an error in Cxx\deps\BuildBootstrap.Makefile. It has

-I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/lib \

but there are no header files in it. Changing the line to

-I$(JULIAHOME)/deps/srccache/llvm-$(LLVM_VER)/tools/clang/include \

allowed me to proceed a bit further. It now errors 

V:/julia64/usr/bin/../../deps/srccache/llvm-3.7.1/tools/clang/include/clang/Basic/DiagnosticIDs.h:53:49:
 
fatal error: cl
ang/Basic/DiagnosticCommonKinds.inc: No such file or directory
 #include "clang/Basic/DiagnosticCommonKinds.inc"

but the file exists in

   deps\build\llvm-3.7.1\build_Release\tools\clang\include\clang\Basic
or
   usr-staging\llvm-3.7.1\build_Release\V\julia64\usr\include\clang\Basic






terça-feira, 5 de Janeiro de 2016 às 22:28:02 UTC, Isaiah escreveu:
>
> Last time I tried this (~October), there were still issues with using LLVM 
> as a shared library, and with building LLDB using the recommended win32 
> thread model toolchain. See comments here:
> https://github.com/Keno/Cxx.jl/issues/62#issuecomment-88979566
>
> If you have gotten through the LLDB build then maybe that no longer 
> applies.
>
> and indeed, I have no ScopeInfo.h arround
>
>
> https://github.com/Keno/Cxx.jl/issues/207#issuecomment-169043432
>
> On Tue, Jan 5, 2016 at 4:57 PM, J Luis > 
> wrote:
>
>> but even if I remove those "coward" lines, it errors later with
>>
>> ../src/bootstrap.cpp:31:34: fatal error: clang/Sema/ScopeInfo.h: No such 
>> file or directory
>>  #include "clang/Sema/ScopeInfo.h"
>>   ^
>> compilation terminated.
>> BuildBootstrap.Makefile:95: recipe for target 'build/bootstrap.o' failed
>> make: *** [build/bootstrap.o] Error 1
>>
>> and indeed, I have no ScopeInfo.h arround
>>
>> terça-feira, 5 de Janeiro de 2016 às 19:37:54 UTC, Keno Fischer escreveu:
>>>
>>> `:` probably? May have to add the makefile magic that turns 
>>> windows-style paths into msys style paths.
>>>
>>> On Tue, Jan 5, 2016 at 8:35 PM, J Luis  wrote:
>>>
>>>> Hmm, I found a problem. When running Julia it doesn't know anything 
>>>> about 'make'. So I added the msys2 dir where it lives to the path and 
>>>> moved 
>>>> to next error
>>>>
>>>> Tuning for julia installation at: C:\programs\julia64\usr\bin
>>>> C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing 
>>>> to build into directory with a shell-metacharacter in the path (got: 
>>>> C:/programs/julia64/usr/bin/../..).  Stop.
>>>>
>>>> What  " shell-metacharacter "?
>>>>
>>>>
>>>>
>>>> terça-feira, 5 de Janeiro de 2016 às 19:21:31 UTC, J Luis escreveu:
>>>>>
>>>>> So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying 
>>>>> (again) to build Cxx, but ...
>>>>>
>>>>> any idea why it errors with (which is not true)?
>>>>>
>>>>> Pkg.build("Cxx")
>>>>> LoadError: could not spawn `make -f BuildBootstrap.Makefile 
>>>>> JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory 
>>>>> (ENOENT)
>>>>>
>>>>> Thanks
>>>>>
>>>>> Joaquim
>>>>>
>>>>
>>>
>

Re: [julia-users] Re: Trying again Cxx on Windows

2016-01-05 Thread J Luis
but even if I remove those "coward" lines, it errors later with

../src/bootstrap.cpp:31:34: fatal error: clang/Sema/ScopeInfo.h: No such 
file or directory
 #include "clang/Sema/ScopeInfo.h"
  ^
compilation terminated.
BuildBootstrap.Makefile:95: recipe for target 'build/bootstrap.o' failed
make: *** [build/bootstrap.o] Error 1

and indeed, I have no ScopeInfo.h arround

terça-feira, 5 de Janeiro de 2016 às 19:37:54 UTC, Keno Fischer escreveu:
>
> `:` probably? May have to add the makefile magic that turns windows-style 
> paths into msys style paths.
>
> On Tue, Jan 5, 2016 at 8:35 PM, J Luis > 
> wrote:
>
>> Hmm, I found a problem. When running Julia it doesn't know anything about 
>> 'make'. So I added the msys2 dir where it lives to the path and moved to 
>> next error
>>
>> Tuning for julia installation at: C:\programs\julia64\usr\bin
>> C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing to 
>> build into directory with a shell-metacharacter in the path (got: 
>> C:/programs/julia64/usr/bin/../..).  Stop.
>>
>> What  " shell-metacharacter "?
>>
>>
>>
>> terça-feira, 5 de Janeiro de 2016 às 19:21:31 UTC, J Luis escreveu:
>>>
>>> So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying (again) 
>>> to build Cxx, but ...
>>>
>>> any idea why it errors with (which is not true)?
>>>
>>> Pkg.build("Cxx")
>>> LoadError: could not spawn `make -f BuildBootstrap.Makefile 
>>> JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory (ENOENT)
>>>
>>> Thanks
>>>
>>> Joaquim
>>>
>>
>

[julia-users] Re: Trying again Cxx on Windows

2016-01-05 Thread J Luis
Hmm, I found a problem. When running Julia it doesn't know anything about 
'make'. So I added the msys2 dir where it lives to the path and moved to 
next error

Tuning for julia installation at: C:\programs\julia64\usr\bin
C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing to 
build into directory with a shell-metacharacter in the path (got: 
C:/programs/julia64/usr/bin/../..).  Stop.

What  " shell-metacharacter "?


terça-feira, 5 de Janeiro de 2016 às 19:21:31 UTC, J Luis escreveu:
>
> So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying (again) 
> to build Cxx, but ...
>
> any idea why it errors with (which is not true)?
>
> Pkg.build("Cxx")
> LoadError: could not spawn `make -f BuildBootstrap.Makefile 
> JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory (ENOENT)
>
> Thanks
>
> Joaquim
>


[julia-users] Trying again Cxx on Windows

2016-01-05 Thread J Luis
So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying (again) to 
build Cxx, but ...

any idea why it errors with (which is not true)?

Pkg.build("Cxx")
LoadError: could not spawn `make -f BuildBootstrap.Makefile 
JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory (ENOENT)

Thanks

Joaquim


Re: [julia-users] What is @d?

2015-12-24 Thread J Luis
https://www.mythicsoft.com/agentransack
You won't have grepping problems again.

quinta-feira, 24 de Dezembro de 2015 às 05:41:05 UTC, Eric Forgy escreveu:
>
> Cool! Thanks Greg. I am also using Atom and happy to learn new tricks :)
>
> On Thursday, December 24, 2015 at 1:33:04 PM UTC+8, Greg Plowman wrote:
>>
>> Hi Eric,
>>
>> I too am a long suffering Windows user.
>>
>> I find the Atom editor to be useful here:
>> From the menu bar, Find->Find in Project
>> I typed  "macro d("
>>
>> 1 result found in 1 file for macro d(
>> v0.4\Lazy\src\macros.jl
>> 241 macro d(xs...)
>>
>> And here's the macro:
>>
>> macro d(xs...)
>>   @cond if VERSION < v"0.4-"
>> Expr(:typed_dict, :(Any=>Any), map(esc, xs)...)
>>   else
>> :(Dict{Any, Any}($(map(x->esc(prockey(x)), xs)...)))
>>   end
>> end
>>
>>
>> -- Greg
>>
>>

[julia-users] Re: Julia backtraces from C and thread safety in julia runtime.

2015-12-16 Thread J Luis
Right, sorry I misunderstood your question.

quarta-feira, 16 de Dezembro de 2015 às 16:52:31 UTC, Kristoffer Carlsson 
escreveu:
>
> That looks a bit opposite to what I want to do. You describe how to get 
> backtraces in calling a compiled library form julia. What I want is the 
> julia backtraces when calling julia from its C-api.



[julia-users] Re: Julia backtraces from C and thread safety in julia runtime.

2015-12-16 Thread J Luis
On Windows and with VS what I do is:

- Build the external library in debug mode (if not possible, game over)

- On the VS IDE load julia.exe in "Tools -> Attach to process"

- run the julia command

in case of crashes the IDE pops up right on the offending line. If 
sometimes this does not work, load the C source code in the IDE and set 
break-points as usual. When the julia command is executed the program flow 
will stop at the break-point.

quarta-feira, 16 de Dezembro de 2015 às 10:28:34 UTC, Kristoffer Carlsson 
escreveu:
>
> Hello, I've been looking at embedding some material models written in 
> Julia in a larger FEM project written in C++ (https://www.dealii.org/).
>
> I have a few questions that would make improve my workflow.
>
> 1.) To ease with debugging I would want to get the back trace with line 
> numbers from C when an exception is raised. Right now I use:
>
> void check_exception() {
>  if (jl_exception_occurred()) {
>  jl_show(jl_stderr_obj(), jl_exception_occurred());
>  jl_printf(jl_stderr_stream(), "\n");
>  return -1;
>  }
>  return 0;
> }
>
> but this only gives me for example:
> DimensionMismatch("A has dimensions (2,1) but B has dimensions (6,6)")
> without any extra information.
>
> Is there a convenient way to also print out the back trace?
>
> 2. What is the status of thread safety when calling function with jl_call 
> from c(++)? deal.ii has very good support for implementing multithreading 
> so it would be nice if I could use julia multithreaded. I know that there 
> has been a lot of progress w.r.t thread safety on master but I am not sure 
> what the current status is.
>
> Thanks
> // Kristoffer
>


Re: [julia-users] Re: More conda troubles

2015-11-20 Thread J Luis
Ghrr, you're damn right. It now works with my own netcdf dll and its 
dependencies.
Thanks

sexta-feira, 20 de Novembro de 2015 às 15:07:13 UTC, Benjamin Deonovic 
escreveu:
>
>
> I'm guessing the issue isn't NetCDF versus netCDF (capitlization?)
> On Friday, November 20, 2015 at 8:25:37 AM UTC-6, J Luis wrote:
>>
>> Yes, but furthermore you don't seam to be on Windows where further 
>> problems exist because the shared library (dll) names differ (libnetcdf.xx 
>> on unix and netcdf.dll on Windows)
>>
>> I actually tried to work-around this with my favorite solution, which is 
>> to make the name of the library a veriable, as in
>>
>> @windows? (const thelib = "netcdf4_w64") : (const thelib = "libnetcdf")  
>> # Name of GMT shared lib.
>>
>> and than using the 'thelib' in calls to ccall but I get a new error 
>>
>> julia> using netCDF
>> WARNING: requiring "netCDF" in module "Main" did not define a 
>> corresponding module.
>>
>> sexta-feira, 20 de Novembro de 2015 às 14:16:46 UTC, Benjamin Deonovic 
>> escreveu:
>>>
>>> Actually it doesn't seem to have worked:
>>>
>>> julia> Pkg.test("NetCDF")
>>> INFO: Testing NetCDF
>>> INFO: NetCDF tests passed
>>>
>>>
>>> I think the issue is witht he package NetCDF not anything you are doing. 
>>>
>>

Re: [julia-users] Re: More conda troubles

2015-11-20 Thread J Luis
Yes, but furthermore you don't seam to be on Windows where further problems 
exist because the shared library (dll) names differ (libnetcdf.xx on unix 
and netcdf.dll on Windows)

I actually tried to work-around this with my favorite solution, which is to 
make the name of the library a veriable, as in

@windows? (const thelib = "netcdf4_w64") : (const thelib = "libnetcdf")  # 
Name of GMT shared lib.

and than using the 'thelib' in calls to ccall but I get a new error 

julia> using netCDF
WARNING: requiring "netCDF" in module "Main" did not define a corresponding 
module.

sexta-feira, 20 de Novembro de 2015 às 14:16:46 UTC, Benjamin Deonovic 
escreveu:
>
> Actually it doesn't seem to have worked:
>
> julia> Pkg.test("NetCDF")
> INFO: Testing NetCDF
> INFO: NetCDF tests passed
>
>
> I think the issue is witht he package NetCDF not anything you are doing. 
>


Re: [julia-users] Re: More conda troubles

2015-11-20 Thread J Luis
Well, some variation of it yes. But I don't even have a deps.jl so test for 
its existence in netcdf_c.jl always fails.

sexta-feira, 20 de Novembro de 2015 às 11:11:48 UTC, Luthaf escreveu:
>
> Is this error the same as https://github.com/JuliaGeo/NetCDF.jl/issues/6 ?
>
> -- 
> Luthaf
>
> Le 19 novembre 2015 à 23:12:50, J Luis (jmf...@gmail.com ) a 
> écrit:
>
> Nope. The trouble is that after installing 295 MB of Condas (I mean a full 
> python when I already had one and did not ask for another), there was some 
> problem and libnetcdf was not installed.
>
>
> quinta-feira, 19 de Novembro de 2015 às 21:12:15 UTC, Tony Kelman 
> escreveu: 
>>
>> Looks like that's probably a dlopen failure? Or check the libnetcdf in 
>> dependency walker? 
>>
>>
>> On Thursday, November 19, 2015 at 12:35:10 PM UTC-8, J Luis wrote: 
>>>
>>> oops, I obviously meant 'cache' not 'cash'
>>>
>>> quinta-feira, 19 de Novembro de 2015 às 20:33:28 UTC, J Luis escreveu: 
>>>>
>>>> It's so annoying that Pkg.rm() does not rm. So I manually cleaned the 
>>>> cash and .trash after Pkg.rm("Conda") but it still doesn't install netCDF.
>>>> I wish I could use what I already have in my computer (netcdf and all 
>>>> of its dependencies) and not duplicating them (if it worked).
>>>>
>>>> julia> Pkg.build("NetCDF")
>>>> INFO: Building NetCDF
>>>> Fetching package metadata: 
>>>> Solving package specifications: 
>>>> # All requested packages already installed.
>>>> # packages in environment at C:\j\.julia\v0.4\Conda\deps\usr:
>>>> #
>>>> libnetcdf 4.3.3.1   vc9_4  [vc9]
>>>> ===[ ERROR: NetCDF 
>>>> ]
>>>>
>>>> LoadError: Provider BinDeps.PackageManager failed to satisfy dependency 
>>>> libnetcdf
>>>> while loading C:\j\.julia\v0.4\NetCDF\deps\build.jl, in expression 
>>>> starting on line 12
>>>>
>>>>
>>>> quinta-feira, 19 de Novembro de 2015 às 20:18:47 UTC, J Luis escreveu: 
>>>>>
>>>>> In fact I had. I always call julia from a bat file that I use to set 
>>>>> paths of interest and calls my WinPython portable installation. Now 
>>>>> changed 
>>>>> that but I'm again in a broken state
>>>>>
>>>>> julia> Pkg.rm("NetCDF")
>>>>> INFO: Installing Conda v0.1.8
>>>>> INFO: Removing Formatting v0.1.4
>>>>> INFO: Removing NetCDF v0.3.0
>>>>> INFO: Package database updated
>>>>>
>>>>> julia> Pkg.add("NetCDF")
>>>>> INFO: Installing Formatting v0.1.4
>>>>> INFO: Installing NetCDF v0.3.0
>>>>> INFO: Building NetCDF
>>>>> Error: This installation of conda is not initialized. Use 'conda 
>>>>> create -n
>>>>> envname' to create a conda environment and 'source activate envname' to
>>>>> activate it.
>>>>>
>>>>> # Note that pip installing conda is not the recommended way for 
>>>>> setting up your
>>>>> # system.  The recommended way for setting up a conda system is by 
>>>>> installing
>>>>> # Miniconda, see: http://repo.continuum.io/miniconda/index.html
>>>>> ===[ ERROR: NetCDF ]==
>>>>>
>>>>> quinta-feira, 19 de Novembro de 2015 às 19:53:39 UTC, Steven G. 
>>>>> Johnson escreveu: 
>>>>>>
>>>>>> Have you set up some environment variables that could affect Python? 
>>>>>>  e.g. is PYTHONPATH or similar set in your environment?  Maybe Conda 
>>>>>> should 
>>>>>> unset these before running the conda scripts.
>>>>>>
>>>>>

[julia-users] Re: More conda troubles

2015-11-19 Thread J Luis
Nope. The trouble is that after installing 295 MB of Condas (I mean a full 
python when I already had one and did not ask for another), there was some 
problem and libnetcdf was not installed.


quinta-feira, 19 de Novembro de 2015 às 21:12:15 UTC, Tony Kelman escreveu:
>
> Looks like that's probably a dlopen failure? Or check the libnetcdf in 
> dependency walker?
>
>
> On Thursday, November 19, 2015 at 12:35:10 PM UTC-8, J Luis wrote:
>>
>> oops, I obviously meant 'cache' not 'cash'
>>
>> quinta-feira, 19 de Novembro de 2015 às 20:33:28 UTC, J Luis escreveu:
>>>
>>> It's so annoying that Pkg.rm() does not rm. So I manually cleaned the 
>>> cash and .trash after Pkg.rm("Conda") but it still doesn't install netCDF.
>>> I wish I could use what I already have in my computer (netcdf and all of 
>>> its dependencies) and not duplicating them (if it worked).
>>>
>>> julia> Pkg.build("NetCDF")
>>> INFO: Building NetCDF
>>> Fetching package metadata: 
>>> Solving package specifications: 
>>> # All requested packages already installed.
>>> # packages in environment at C:\j\.julia\v0.4\Conda\deps\usr:
>>> #
>>> libnetcdf 4.3.3.1   vc9_4  [vc9]
>>> ===[ ERROR: NetCDF 
>>> ]
>>>
>>> LoadError: Provider BinDeps.PackageManager failed to satisfy dependency 
>>> libnetcdf
>>> while loading C:\j\.julia\v0.4\NetCDF\deps\build.jl, in expression 
>>> starting on line 12
>>>
>>>
>>> quinta-feira, 19 de Novembro de 2015 às 20:18:47 UTC, J Luis escreveu:
>>>>
>>>> In fact I had. I always call julia from a bat file that I use to set 
>>>> paths of interest and calls my WinPython portable installation. Now 
>>>> changed 
>>>> that but I'm again in a broken state
>>>>
>>>> julia> Pkg.rm("NetCDF")
>>>> INFO: Installing Conda v0.1.8
>>>> INFO: Removing Formatting v0.1.4
>>>> INFO: Removing NetCDF v0.3.0
>>>> INFO: Package database updated
>>>>
>>>> julia> Pkg.add("NetCDF")
>>>> INFO: Installing Formatting v0.1.4
>>>> INFO: Installing NetCDF v0.3.0
>>>> INFO: Building NetCDF
>>>> Error: This installation of conda is not initialized. Use 'conda create 
>>>> -n
>>>> envname' to create a conda environment and 'source activate envname' to
>>>> activate it.
>>>>
>>>> # Note that pip installing conda is not the recommended way for setting 
>>>> up your
>>>> # system.  The recommended way for setting up a conda system is by 
>>>> installing
>>>> # Miniconda, see: http://repo.continuum.io/miniconda/index.html
>>>> ===[ ERROR: NetCDF ]==
>>>>
>>>> quinta-feira, 19 de Novembro de 2015 às 19:53:39 UTC, Steven G. Johnson 
>>>> escreveu:
>>>>>
>>>>> Have you set up some environment variables that could affect Python? 
>>>>>  e.g. is PYTHONPATH or similar set in your environment?  Maybe Conda 
>>>>> should 
>>>>> unset these before running the conda scripts.
>>>>>
>>>>

[julia-users] Re: More conda troubles

2015-11-19 Thread J Luis
oops, I obviously meant 'cache' not 'cash'

quinta-feira, 19 de Novembro de 2015 às 20:33:28 UTC, J Luis escreveu:
>
> It's so annoying that Pkg.rm() does not rm. So I manually cleaned the cash 
> and .trash after Pkg.rm("Conda") but it still doesn't install netCDF.
> I wish I could use what I already have in my computer (netcdf and all of 
> its dependencies) and not duplicating them (if it worked).
>
> julia> Pkg.build("NetCDF")
> INFO: Building NetCDF
> Fetching package metadata: 
> Solving package specifications: 
> # All requested packages already installed.
> # packages in environment at C:\j\.julia\v0.4\Conda\deps\usr:
> #
> libnetcdf 4.3.3.1   vc9_4  [vc9]
> ===[ ERROR: NetCDF 
> ]
>
> LoadError: Provider BinDeps.PackageManager failed to satisfy dependency 
> libnetcdf
> while loading C:\j\.julia\v0.4\NetCDF\deps\build.jl, in expression 
> starting on line 12
>
>
> quinta-feira, 19 de Novembro de 2015 às 20:18:47 UTC, J Luis escreveu:
>>
>> In fact I had. I always call julia from a bat file that I use to set 
>> paths of interest and calls my WinPython portable installation. Now changed 
>> that but I'm again in a broken state
>>
>> julia> Pkg.rm("NetCDF")
>> INFO: Installing Conda v0.1.8
>> INFO: Removing Formatting v0.1.4
>> INFO: Removing NetCDF v0.3.0
>> INFO: Package database updated
>>
>> julia> Pkg.add("NetCDF")
>> INFO: Installing Formatting v0.1.4
>> INFO: Installing NetCDF v0.3.0
>> INFO: Building NetCDF
>> Error: This installation of conda is not initialized. Use 'conda create -n
>> envname' to create a conda environment and 'source activate envname' to
>> activate it.
>>
>> # Note that pip installing conda is not the recommended way for setting 
>> up your
>> # system.  The recommended way for setting up a conda system is by 
>> installing
>> # Miniconda, see: http://repo.continuum.io/miniconda/index.html
>> ===[ ERROR: NetCDF ]==
>>
>> quinta-feira, 19 de Novembro de 2015 às 19:53:39 UTC, Steven G. Johnson 
>> escreveu:
>>>
>>> Have you set up some environment variables that could affect Python? 
>>>  e.g. is PYTHONPATH or similar set in your environment?  Maybe Conda should 
>>> unset these before running the conda scripts.
>>>
>>

[julia-users] Re: More conda troubles

2015-11-19 Thread J Luis
It's so annoying that Pkg.rm() does not rm. So I manually cleaned the cash 
and .trash after Pkg.rm("Conda") but it still doesn't install netCDF.
I wish I could use what I already have in my computer (netcdf and all of 
its dependencies) and not duplicating them (if it worked).

julia> Pkg.build("NetCDF")
INFO: Building NetCDF
Fetching package metadata: 
Solving package specifications: 
# All requested packages already installed.
# packages in environment at C:\j\.julia\v0.4\Conda\deps\usr:
#
libnetcdf 4.3.3.1   vc9_4  [vc9]
===[ ERROR: NetCDF 
]

LoadError: Provider BinDeps.PackageManager failed to satisfy dependency 
libnetcdf
while loading C:\j\.julia\v0.4\NetCDF\deps\build.jl, in expression starting 
on line 12


quinta-feira, 19 de Novembro de 2015 às 20:18:47 UTC, J Luis escreveu:
>
> In fact I had. I always call julia from a bat file that I use to set paths 
> of interest and calls my WinPython portable installation. Now changed that 
> but I'm again in a broken state
>
> julia> Pkg.rm("NetCDF")
> INFO: Installing Conda v0.1.8
> INFO: Removing Formatting v0.1.4
> INFO: Removing NetCDF v0.3.0
> INFO: Package database updated
>
> julia> Pkg.add("NetCDF")
> INFO: Installing Formatting v0.1.4
> INFO: Installing NetCDF v0.3.0
> INFO: Building NetCDF
> Error: This installation of conda is not initialized. Use 'conda create -n
> envname' to create a conda environment and 'source activate envname' to
> activate it.
>
> # Note that pip installing conda is not the recommended way for setting up 
> your
> # system.  The recommended way for setting up a conda system is by 
> installing
> # Miniconda, see: http://repo.continuum.io/miniconda/index.html
> ===[ ERROR: NetCDF ]==
>
> quinta-feira, 19 de Novembro de 2015 às 19:53:39 UTC, Steven G. Johnson 
> escreveu:
>>
>> Have you set up some environment variables that could affect Python? 
>>  e.g. is PYTHONPATH or similar set in your environment?  Maybe Conda should 
>> unset these before running the conda scripts.
>>
>

[julia-users] Re: More conda troubles

2015-11-19 Thread J Luis
In fact I had. I always call julia from a bat file that I use to set paths 
of interest and calls my WinPython portable installation. Now changed that 
but I'm again in a broken state

julia> Pkg.rm("NetCDF")
INFO: Installing Conda v0.1.8
INFO: Removing Formatting v0.1.4
INFO: Removing NetCDF v0.3.0
INFO: Package database updated

julia> Pkg.add("NetCDF")
INFO: Installing Formatting v0.1.4
INFO: Installing NetCDF v0.3.0
INFO: Building NetCDF
Error: This installation of conda is not initialized. Use 'conda create -n
envname' to create a conda environment and 'source activate envname' to
activate it.

# Note that pip installing conda is not the recommended way for setting up 
your
# system.  The recommended way for setting up a conda system is by 
installing
# Miniconda, see: http://repo.continuum.io/miniconda/index.html
===[ ERROR: NetCDF ]==

quinta-feira, 19 de Novembro de 2015 às 19:53:39 UTC, Steven G. Johnson 
escreveu:
>
> Have you set up some environment variables that could affect Python?  e.g. 
> is PYTHONPATH or similar set in your environment?  Maybe Conda should unset 
> these before running the conda scripts.
>


[julia-users] More conda troubles

2015-11-19 Thread J Luis
After the troubles with conda that I reported 2 or 3 days ago I ended up 
nuking my .julia dir. 
Now I being bitten again

julia> Pkg.build("NetCDF")
INFO: Building NetCDF
Traceback (most recent call last):
  File "C:\j\.julia\v0.4\Conda\deps\usr\Scripts\conda-script.py", line 2, 
in 
from conda.cli import main
ImportError: No module named conda.cli


[julia-users] Re: Build of julia with clang on windows. Clang.jl cannot build

2015-11-19 Thread J Luis
Just remove the '-rdynamic'  from that line of the Makefile. But you'll 
find some other problem later that I don't remember anymore (I've tried 
this too some time ago)

Joaquim

quinta-feira, 19 de Novembro de 2015 às 11:51:14 UTC, Tony Kelman escreveu:
>
> Check if there's already an issue about this at Clang.jl. If not, open a 
> new one.



Re: [julia-users] Pkg.update error

2015-11-18 Thread J Luis


>
> No. Ref https://github.com/JuliaLang/julia/issues/13200. Just try again. 
>

Sorry, but


julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating cache of Clang...
INFO: Updating CodeTools...
INFO: Updating GMT...
INFO: Updating MutateIt...
INFO: Updating Atom...
INFO: Updating jlcall...
INFO: Updating cache of Clang...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> using PyCall
INFO: Precompiling module PyCall...
ERROR: LoadError: PyCall not properly installed. Please run 
Pkg.build("PyCall")
 in error at error.jl:21
while loading C:\j\.julia\v0.4\PyCall\src\PyCall.jl, in expression starting 
on line 36
ERROR: Failed to precompile PyCall to C:\j\.julia\lib\v0.4\PyCall.ji
 in compilecache at loading.jl:383

julia> Pkg.build("PyCall")
INFO: Building PyCall
INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for module 
Conda.
WARNING: Module BinDeps uuid did not match cache file
WARNING: deserialization checks failed while attempting to load cache from 
C:\j\.julia\lib\v0.4\Conda.ji
INFO: Precompiling module Conda...
INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for module 
Conda.
WARNING: Module BinDeps uuid did not match cache file
[ ERROR: PyCall 
]

LoadError: __precompile__(true) but require failed to create a precompiled 
cache file
while loading C:\j\.julia\v0.4\PyCall\deps\build.jl, in expression starting 
on line 12



 

>
> > 
> > INFO: Building PyCall 
> > INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for 
> > module Conda. 
> > WARNING: Module BinDeps uuid did not match cache file 
> > WARNING: deserialization checks failed while attempting to load 
> cache 
> > from C:\j\.julia\lib\v0.4\Conda.ji 
> > INFO: Precompiling module Conda... 
> > INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for 
> > module Conda. 
> > WARNING: Module BinDeps uuid did not match cache file 
> > [ ERROR: 
> > PyCall ] 
> > 
> > LoadError: __precompile__(true) but require failed to create a 
> > precompiled cache file 
> > while loading C:\j\.julia\v0.4\PyCall\deps\build.jl, in expression 
> > starting on line 12 
>


[julia-users] Pkg.update error

2015-11-18 Thread J Luis
Is this because I don't have (nor want to have) Anaconda Python?
Win8 here.

INFO: Building PyCall
INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for 
module Conda.
WARNING: Module BinDeps uuid did not match cache file
WARNING: deserialization checks failed while attempting to load cache 
from C:\j\.julia\lib\v0.4\Conda.ji
INFO: Precompiling module Conda...
INFO: Recompiling stale cache file C:\j\.julia\lib\v0.4\Conda.ji for 
module Conda.
WARNING: Module BinDeps uuid did not match cache file
[ ERROR: 
PyCall ]

LoadError: __precompile__(true) but require failed to create a 
precompiled cache file
while loading C:\j\.julia\v0.4\PyCall\deps\build.jl, in expression 
starting on line 12


Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
Right, way simpler like that.
I did the PR but I insist that the bit I learned is not enough to make a 
good description improvement (maybe next time)

terça-feira, 17 de Novembro de 2015 às 17:03:49 UTC, Tim Holy escreveu:
>
> Hmm, it seems the "easy way" has been removed from the docs. Anyone know 
> why? 
> Now I see why this request might have seemed onerous. 
>
> Short answer: you can just do it in your web browser, just click on the 
> "pencil icon" near the upper right when browsing any file in the source 
> tree. 
> Edit the docs, write a short message describing the change, and click 
> submit. 
> Someone will review your change. 
>
> --Tim 
>
> On Tuesday, November 17, 2015 08:42:50 AM J Luis wrote: 
> > I don't want to be seam ungrateful nor very dumb but do you think one 
> can 
> > learn how to make  a doc fix by reading? 
> > 
> > 
> https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-doc 
> > umentation 
> > <
> https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-d 
> > > 
> > 
> > I happen to have a Julia source code but I can't build it anymore since 
> > 
> > one month (msys2 build is broken). However, I did find the doc of that 
> > function and made a local change but can't commit because I obviously 
> have 
> > no commit rights. I was hopping that TotoiseGIT would propose me to do a 
> > PR, but it doesn't. 
> > 
> > terça-feira, 17 de Novembro de 2015 às 15:26:13 UTC, Tim Holy escreveu: 
> > > On Tuesday, November 17, 2015 07:23:03 AM J Luis wrote: 
> > > > I know Tim, but honestly I don't feel knowledge'd enough to submit a 
> doc 
> > > > improvement for a function that half an hour ago I could not even 
> know 
> > > 
> > > how 
> > > 
> > > > to make it work. 
> > > 
> > > But now you do! It's a fair exchange: get help on the mailing list, 
> then 
> > > submit the changes that would prevent future users from having the 
> same 
> > > problem you had. Lots of us do that all the time; if more people did 
> that, 
> > > julia's rough edges would be smoothed that much more quickly. 
> > > 
> > > --Tim 
> > > 
> > > > Joaquim 
> > > > 
> > > > terça-feira, 17 de Novembro de 2015 às 15:16:52 UTC, Tim Holy 
> escreveu: 
> > > > > On Tuesday, November 17, 2015 07:03:05 AM J Luis wrote: 
> > > > > > Yes, it works thanks. But man we are not supposed to be wizards 
> when 
> > > > > > reading the docs. 
> > > > > 
> > > > > Submit a doc fix? 
> > > 
> > > 
> https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-d 
> > > 
> > > > > ocumentation 
> > > > > 
> > > > > --Tim 
> > > > > 
> > > > > > terça-feira, 17 de Novembro de 2015 às 14:36:39 UTC, 
> > > 
> > > randm...@gmail.com 
> > > 
> > > > > > escreveu: 
> > > > > > > julia> 
> > > 
> > > find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"]) 
> > > 
> > > > > > > should do the trick. The docs at least imply that both 
> arguments 
> > > > > 
> > > > > should be 
> > > > > 
> > > > > > > vectors -- for one because of the plural and locations is 
> supposed 
> > > 
> > > to 
> > > 
> > > > > be a 
> > > > > 
> > > > > > > list. 
> > > > > > > 
> > > > > > > Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis: 
> > > > > > >> The doc 
> > > > > > >> < 
> > > 
> > > 
> http://docs.julialang.org/en/release-0.4/stdlib/libdl/?highlight=libdl#L 
> > > 
> > > > > > >> ibdl.find_library> 
> > > > > > >> 
> > > > > > >> julia> 
> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > > > >> you may have intended to import Base.find_library 
> > > > > > >> 
> > > > > > >>  in find_library at deprecated.jl:32 
> > > > > > >> 
> > > > > > >> julia> 
> > > > > 
> > > > > Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > > > 
> > > > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > > > >> you may have intended to import Base.find_library 
> > > > > > >> 
> > > > > > >> julia> 
> > > 
> > > Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > 
> > > > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > > > >> you may have intended to import Base.find_library 
> > > > > > >> 
> > > > > > >>  in find_library at deprecated.jl:32 
> > > > > > >> 
> > > > > > >> julia> 
> > > 
> > > Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib") 
> > > 
> > > > > > >> ERROR: UndefVarError: libgmt not defined 
> > > > > > >> 
> > > > > > >> (but it is there) 
> > > > > > >> 
> > > > > > >> Thanks 
>
>

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
I don't want to be seam ungrateful nor very dumb but do you think one can 
learn how to make  a doc fix by reading?

https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation
 
<https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-d>

I happen to have a Julia source code but I can't build it anymore since > 
one month (msys2 build is broken). However, I did find the doc of that 
function and made a local change but can't commit because I obviously have 
no commit rights. I was hopping that TotoiseGIT would propose me to do a 
PR, but it doesn't.


terça-feira, 17 de Novembro de 2015 às 15:26:13 UTC, Tim Holy escreveu:
>
> On Tuesday, November 17, 2015 07:23:03 AM J Luis wrote: 
> > I know Tim, but honestly I don't feel knowledge'd enough to submit a doc 
> > improvement for a function that half an hour ago I could not even know 
> how 
> > to make it work. 
>
> But now you do! It's a fair exchange: get help on the mailing list, then 
> submit the changes that would prevent future users from having the same 
> problem you had. Lots of us do that all the time; if more people did that, 
> julia's rough edges would be smoothed that much more quickly. 
>
> --Tim 
>
> > 
> > Joaquim 
> > 
> > terça-feira, 17 de Novembro de 2015 às 15:16:52 UTC, Tim Holy escreveu: 
> > > On Tuesday, November 17, 2015 07:03:05 AM J Luis wrote: 
> > > > Yes, it works thanks. But man we are not supposed to be wizards when 
> > > > reading the docs. 
> > > 
> > > Submit a doc fix? 
> > > 
> > > 
> https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-d 
> > > ocumentation 
> > > 
> > > --Tim 
> > > 
> > > > terça-feira, 17 de Novembro de 2015 às 14:36:39 UTC, 
> randm...@gmail.com 
> > > > 
> > > > escreveu: 
> > > > > julia> 
> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"]) 
> > > > > 
> > > > > should do the trick. The docs at least imply that both arguments 
> > > 
> > > should be 
> > > 
> > > > > vectors -- for one because of the plural and locations is supposed 
> to 
> > > 
> > > be a 
> > > 
> > > > > list. 
> > > > > 
> > > > > Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis: 
> > > > >> The doc 
> > > > >> < 
> > > 
> > > 
> http://docs.julialang.org/en/release-0.4/stdlib/libdl/?highlight=libdl#L 
> > > 
> > > > >> ibdl.find_library> 
> > > > >> 
> > > > >> julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > >> you may have intended to import Base.find_library 
> > > > >> 
> > > > >>  in find_library at deprecated.jl:32 
> > > > >> 
> > > > >> julia> 
> > > 
> > > Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > 
> > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > >> you may have intended to import Base.find_library 
> > > > >> 
> > > > >> julia> 
> Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > > > >> ERROR: MethodError: `find_library` has no method matching 
> > > > >> find_library(::ASCIIString, ::ASCIIString) 
> > > > >> you may have intended to import Base.find_library 
> > > > >> 
> > > > >>  in find_library at deprecated.jl:32 
> > > > >> 
> > > > >> julia> 
> Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib") 
> > > > >> ERROR: UndefVarError: libgmt not defined 
> > > > >> 
> > > > >> (but it is there) 
> > > > >> 
> > > > >> Thanks 
>
>

Re: [julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
I know Tim, but honestly I don't feel knowledge'd enough to submit a doc 
improvement for a function that half an hour ago I could not even know how 
to make it work. 

Joaquim

terça-feira, 17 de Novembro de 2015 às 15:16:52 UTC, Tim Holy escreveu:
>
> On Tuesday, November 17, 2015 07:03:05 AM J Luis wrote: 
> > Yes, it works thanks. But man we are not supposed to be wizards when 
> > reading the docs. 
>
> Submit a doc fix? 
>
> https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation
>  
>
> --Tim 
>
> > 
> > terça-feira, 17 de Novembro de 2015 às 14:36:39 UTC, randm...@gmail.com 
> > 
> > escreveu: 
> > > julia> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"]) 
> > > 
> > > should do the trick. The docs at least imply that both arguments 
> should be 
> > > vectors -- for one because of the plural and locations is supposed to 
> be a 
> > > list. 
> > > 
> > > Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis: 
> > >> The doc 
> > >> <
> http://docs.julialang.org/en/release-0.4/stdlib/libdl/?highlight=libdl#L 
> > >> ibdl.find_library> 
> > >> 
> > >> julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > >> ERROR: MethodError: `find_library` has no method matching 
> > >> find_library(::ASCIIString, ::ASCIIString) 
> > >> you may have intended to import Base.find_library 
> > >> 
> > >>  in find_library at deprecated.jl:32 
> > >> 
> > >> julia> 
> Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > >> ERROR: MethodError: `find_library` has no method matching 
> > >> find_library(::ASCIIString, ::ASCIIString) 
> > >> you may have intended to import Base.find_library 
> > >> 
> > >> julia> Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib") 
> > >> ERROR: MethodError: `find_library` has no method matching 
> > >> find_library(::ASCIIString, ::ASCIIString) 
> > >> you may have intended to import Base.find_library 
> > >> 
> > >>  in find_library at deprecated.jl:32 
> > >> 
> > >> julia> Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib") 
> > >> ERROR: UndefVarError: libgmt not defined 
> > >> 
> > >> (but it is there) 
> > >> 
> > >> Thanks 
>
>

[julia-users] Re: How does 'find_library' works?

2015-11-17 Thread J Luis
Yes, it works thanks. But man we are not supposed to be wizards when 
reading the docs. 

terça-feira, 17 de Novembro de 2015 às 14:36:39 UTC, randm...@gmail.com 
escreveu:
>
>
> julia> find_library(["libgmt.dylib"],["/Users/j/programs/gmt5/lib"])
>
> should do the trick. The docs at least imply that both arguments should be 
> vectors -- for one because of the plural and locations is supposed to be a 
> list.
>
> Am Dienstag, 17. November 2015 15:24:38 UTC+1 schrieb J Luis:
>>
>> The doc 
>> <http://docs.julialang.org/en/release-0.4/stdlib/libdl/?highlight=libdl#Libdl.find_library>
>>
>> julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
>> ERROR: MethodError: `find_library` has no method matching 
>> find_library(::ASCIIString, ::ASCIIString)
>> you may have intended to import Base.find_library
>>  in find_library at deprecated.jl:32
>>
>> julia> Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
>> ERROR: MethodError: `find_library` has no method matching 
>> find_library(::ASCIIString, ::ASCIIString)
>> you may have intended to import Base.find_library
>>
>> julia> Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
>> ERROR: MethodError: `find_library` has no method matching 
>> find_library(::ASCIIString, ::ASCIIString)
>> you may have intended to import Base.find_library
>>  in find_library at deprecated.jl:32
>>
>>
>> julia> Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib")
>> ERROR: UndefVarError: libgmt not defined
>>
>> (but it is there)
>>
>> Thanks
>>
>

[julia-users] How does 'find_library' works?

2015-11-17 Thread J Luis
The doc 


julia> find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
ERROR: MethodError: `find_library` has no method matching 
find_library(::ASCIIString, ::ASCIIString)
you may have intended to import Base.find_library
 in find_library at deprecated.jl:32

julia> Libdl.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
ERROR: MethodError: `find_library` has no method matching 
find_library(::ASCIIString, ::ASCIIString)
you may have intended to import Base.find_library

julia> Base.find_library("libgmt.dylib","/Users/j/programs/gmt5/lib")
ERROR: MethodError: `find_library` has no method matching 
find_library(::ASCIIString, ::ASCIIString)
you may have intended to import Base.find_library
 in find_library at deprecated.jl:32


julia> Libdl.find_library(libgmt.dylib,"/Users/j/programs/gmt5/lib")
ERROR: UndefVarError: libgmt not defined

(but it is there)

Thanks


[julia-users] Re: Anaconda Python

2015-11-02 Thread J Luis


> Does winpython have a minimal core and a binary-only package management 
> system on top of it? Do they have binaries for the likes of scipy, 
> matplotlib, jupyter etc that work with pycall and ijulia?
>

Not very experimented with Python by WinPython seams perfect for me. No 
install, no nothing. Just add it to path ... when need. Everything at hand 
with its own package manager or pip or easy_install. Multiple bitage 
pythons can leave side by side, works fine with Julia. "What else"? 


[julia-users] Re: Windows woes

2015-10-28 Thread J Luis


Hi,
>
> I am at a loss how to proceed, so please forgive a rambling unfocused plea 
> for help and I appreciate any questions to help me focus my search for a 
> solution.
>
> I have Julia 0.4.0 installed on my MacBook running Windows 10 (I know I 
> know :)). My installation is nice and snappy with no issues. I've got Juno 
> set up and am quite happy.
>
 
So, since this was a bit OT let me abuse on it. (I've also a MBP + Bootcamp 
Win 8.1 and happy with it). How did you install Win10, from scratch or did 
you update Windows?
I wanted to try VS2015 to build Julia with it but some trouble doesn't let 
me update Win to a point where I can install VS2015, hence my question (and 
a bit Julia on topic now).

Thanks

Joaquim


Re: [julia-users] Re: For loop = or in?

2015-10-27 Thread J Luis
Please, leave the '=' alone. It's very well as is.

terça-feira, 27 de Outubro de 2015 às 18:20:19 UTC, FANG Colin escreveu:
>
> Julia tries to attract people from Python & R, which use `in`. As for 
> matlab, it is not a direct competitor.
>
> Anyway, I think we only need 1 of the 2. "There should be one-- and 
> preferably only one --obvious way to do it."
>
> Maybe enhance the documentation for the time being.
>
>
> On 27 October 2015 at 16:38, Glen O > 
> wrote:
>
>> "When calculating a Fibonacci number, we have to apply 
>> F_n=F_(n-1)+F_(n-2) repeatedly. So to find F_6, we apply the equation for n 
>> equals 3 through 6". Writing it as "for n in 3 through 6" or "for n in the 
>> range 3 through 6" wouldn't make nearly as much sense.
>>
>> As I said, for general iterables, like vectors, the "in" keyword makes 
>> more sense. But when you're talking about a counter variable, equals makes 
>> a much more natural expression - you're not really constructing the range 
>> object, you're just telling the program you want the counter to start at 
>> the first value, and increment until it reaches the second value.
>>
>> On Wednesday, 28 October 2015 02:23:54 UTC+10, Tom Breloff wrote:
>>>
>>> It definitely makes sense for a range.
>>>
>>>
>>> Sorry... gotta disagree... mathematical set notation is more 
>>> appropriate, especially for scientific computing.  This is coming from a 
>>> former matlab user, btw, so it's not like I was confused by the syntax.   
>>> The "for i = 1:5" syntax is actually more reminiscent of C:  "for (int i=1; 
>>> i<=5; i++)", and I'm guessing that the syntax originated more from that 
>>> rather than scientific concepts.
>>>
>>> On Tue, Oct 27, 2015 at 11:58 AM, feza  wrote:
>>>
 +1 @Tom Breloff .  
 I was confused about this when starting out. Comparing   `for i in 
 1:3` vs  `for i = 1:3`, even though I regularly use matlab if you think 
 about it for `i = 1:10` doesn't really make a lot of sense. It would be 
 nice if it was just one way as opposed to the confusion about whether = or 
 in should be used.

 On Tuesday, October 27, 2015 at 10:26:44 AM UTC-4, Tom Breloff wrote:
>
> It's harmless, sure, but I would prefer that everyone uses "in" 
> exclusively so that there's one less thing to waste brainpower on.  You 
> don't say "for each x equals the range 1 to n", you say "for each x in 
> the 
> range 1 to n".  I don't think "=" has a place here at all except to allow 
> copy/pasting of Matlab code (which creates other performance problems 
> anyways).
>
> On Tue, Oct 27, 2015 at 10:04 AM, Stefan Karpinski <
> ste...@karpinski.org> wrote:
>
>> My general approach is to only use = when the RHS is an explicit 
>> range, as in `for i = 1:n`. For everything else I use `for i in v`. I 
>> would 
>> be ok with dropping the = syntax at some point, but it seems pretty 
>> harmless to have it.
>>
>> On Tue, Oct 27, 2015 at 8:56 AM, FANG Colin  
>> wrote:
>>
>>> Thank you. In that case I will happily stick with `in`.
>>>
>>>
>>> On Monday, October 26, 2015 at 8:43:22 PM UTC, Alireza Nejati wrote:

 There is no difference, as far as I know.

 '=' seems to be used more for explicit ranges (i = 1:5) and 'in' 
 seems to be used more for variables (i in mylist). But using 'in' for 
 everything is ok too.

 The '=' is there for familiarity with matlab. Remember that julia's 
 syntax was in part designed to be familiar to matlab users.

 On Tuesday, October 27, 2015 at 8:26:07 AM UTC+13, FANG Colin wrote:
>
> Hi All
>
> I have got a stupid question:
>
> Are there any difference in "for i in 1:5" and "for i = 1:5"?
>
> Does the julia community prefer one to the other? I see use of 
> both in the documentations and source code.
>
> Personally I haven't seen much use of "for i = 1:5" in other 
> languages.
>
> Thanks.
>

>>
>
>>>
>

[julia-users] Re: Dear @sprintf, you shouldn't do this

2015-10-26 Thread J Luis
Update. It turned out that the error was still different. Further down the 
script I had another similar line

  t = gmt(@sprintf("filter1d -Fm1 -T%d/%d/1 -E", sampr1, sampr2), 
ship_pg)

and was this line that was causing the error (because 'sampr1, sampr2' was 
not accepted, only sampr1[1], sampr2[1]) but the error message was very 
misleading because it accused the first occurrence of @sprintf()

Julia v0.4 on Win 

segunda-feira, 26 de Outubro de 2015 às 23:37:00 UTC, J Luis escreveu:
>
> It took me a while to figure out why it was erroring
>
> Given this piece of a script
>
> @show(sampr1, sampr2)
> @show(typeof(sampr1), typeof(sampr2))
> @show(@sprintf("-T%d/%d/1", sampr1[1], sampr2[1]))
>
> it error ed with an incomprehensible error
>
> sampr1 = [-1167.0]
> sampr2 = [1169.0]
> typeof(sampr1) = Array{Float64,2}
> typeof(sampr2) = Array{Float64,2}
> @sprintf("-T%d/%d/1",sampr1[1],sampr2[1]) = "-T-1167/1169/1"
> ERROR: TypeError: non-boolean (Array{Bool,2}) used in boolean context
>  [inlined code] from show.jl:127
>
> it turned out that it wanted
>
> @show(@sprintf("-T%d/%d/1", sampr1[1,1], sampr2[1,1]))
>
> but the sampr1 & sampr2 are the result of a previous computation so not at 
> all obvious of what was going on. Specially because accessing sampr1[1] is 
> a perfectly valid statement
>
> julia> sampr1 = zeros(1,1);
> 1x1 Array{Float64,2}:
>  0.0
>
> julia> sampr1[1]
> 0.0
>
>

[julia-users] Dear @sprintf, you shouldn't do this

2015-10-26 Thread J Luis
It took me a while to figure out why it was erroring

Given this piece of a script

@show(sampr1, sampr2)
@show(typeof(sampr1), typeof(sampr2))
@show(@sprintf("-T%d/%d/1", sampr1[1], sampr2[1]))

it error ed with an incomprehensible error

sampr1 = [-1167.0]
sampr2 = [1169.0]
typeof(sampr1) = Array{Float64,2}
typeof(sampr2) = Array{Float64,2}
@sprintf("-T%d/%d/1",sampr1[1],sampr2[1]) = "-T-1167/1169/1"
ERROR: TypeError: non-boolean (Array{Bool,2}) used in boolean context
 [inlined code] from show.jl:127

it turned out that it wanted

@show(@sprintf("-T%d/%d/1", sampr1[1,1], sampr2[1,1]))

but the sampr1 & sampr2 are the result of a previous computation so not at 
all obvious of what was going on. Specially because accessing sampr1[1] is 
a perfectly valid statement

julia> sampr1 = zeros(1,1);
1x1 Array{Float64,2}:
 0.0

julia> sampr1[1]
0.0



Re: [julia-users] Re: How to feval?

2015-10-22 Thread J Luis
Anyway, unfortunately none of the above solutions work for files. If the 
file is called "GMT_insert.jl", and is in the path, I get variations around 
(+ file extension - file extension) of

ERROR: UndefVarError: GMT_insert not defined
 

quinta-feira, 22 de Outubro de 2015 às 18:30:04 UTC+1, J Luis escreveu:
>
> Speed is not critical here. I am porting this script
>
>
> http://gmt.soest.hawaii.edu/projects/gmt-matlab-octave-api/repository/changes/trunk/src/gmtest.m
>
> that will call the test scripts that live, as for example, here
>
> 
> http://gmt.soest.hawaii.edu/projects/gmt/repository/show/branches/5.2.0/doc/scripts/ml
>
> and compare the produced output with the reference PS file that is also in 
> the testing dirs.
>
> If it works, as I hope and will test later. It's good enough for me but 
> off course faster alternatives are always wellcome.
>
> Thanks
>
> quinta-feira, 22 de Outubro de 2015 às 18:16:05 UTC+1, Stefan Karpinski 
> escreveu:
>>
>> This will not be fast. It's also wildly insecure if the string come from 
>> an external source. I'd strongly recommend figuring out a different 
>> approach to what you're doing, but it's hard to provide guidance without 
>> more context.
>>
>> On Thu, Oct 22, 2015 at 12:34 PM, Alex Ames  
>> wrote:
>>
>>> You could define your own feval:
>>>
>>> feval(fn_str, args...) = eval(parse(fn_str))(args...)
>>>
>>> This has the advantage of accepting anonymous functions and multiple 
>>> arguments if necessary:
>>> julia> feval("sin",5.0)
>>> -0.9589242746631385
>>>
>>> julia> fn_str = "a_plus_b(a,b) = a + b"
>>> "a_plus_b(a,b) = a + b"
>>>
>>> julia> feval(fn_str,2,3)
>>> 5
>>>
>>> On Thursday, October 22, 2015 at 8:20:33 AM UTC-5, J Luis wrote:
>>>>
>>>> Thanks, at least it's a place to start.
>>>>
>>>> quinta-feira, 22 de Outubro de 2015 às 14:10:44 UTC+1, Kristoffer 
>>>> Carlsson escreveu:
>>>>>
>>>>> Maybe
>>>>>
>>>>> julia> eval(Symbol("sin"))(5.0)
>>>>> -0.9589242746631385
>>>>>
>>>>> Not sure if this is the best solution.
>>>>>
>>>>>
>>>>> On Thursday, October 22, 2015 at 2:57:31 PM UTC+2, J Luis wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I need to convert this piece of Matlab code
>>>>>>
>>>>>>   [ps, orig_path] = feval(str2func(test), out_path);
>>>>>>
>>>>>> where 'test' is the name of a function and 'out_path' it unique input 
>>>>>> argument. I have read and re-read the eval function and for once it's 
>>>>>> clear 
>>>>>> for me how it works (sorry, I find this sentence highly cryptic 
>>>>>> "Evaluate 
>>>>>> an expression in the given module and return the result" ) but worst, I 
>>>>>> don't see anywhere how it could call a function with input arguments.
>>>>>>
>>>>>> How can I achieve the same result in Julia?
>>>>>>  
>>>>>> Thanks. 
>>>>>>
>>>>>
>>

Re: [julia-users] Re: How to feval?

2015-10-22 Thread J Luis
Speed is not critical here. I am porting this script

   
http://gmt.soest.hawaii.edu/projects/gmt-matlab-octave-api/repository/changes/trunk/src/gmtest.m

that will call the test scripts that live, as for example, here


http://gmt.soest.hawaii.edu/projects/gmt/repository/show/branches/5.2.0/doc/scripts/ml

and compare the produced output with the reference PS file that is also in 
the testing dirs.

If it works, as I hope and will test later. It's good enough for me but off 
course faster alternatives are always wellcome.

Thanks

quinta-feira, 22 de Outubro de 2015 às 18:16:05 UTC+1, Stefan Karpinski 
escreveu:
>
> This will not be fast. It's also wildly insecure if the string come from 
> an external source. I'd strongly recommend figuring out a different 
> approach to what you're doing, but it's hard to provide guidance without 
> more context.
>
> On Thu, Oct 22, 2015 at 12:34 PM, Alex Ames  > wrote:
>
>> You could define your own feval:
>>
>> feval(fn_str, args...) = eval(parse(fn_str))(args...)
>>
>> This has the advantage of accepting anonymous functions and multiple 
>> arguments if necessary:
>> julia> feval("sin",5.0)
>> -0.9589242746631385
>>
>> julia> fn_str = "a_plus_b(a,b) = a + b"
>> "a_plus_b(a,b) = a + b"
>>
>> julia> feval(fn_str,2,3)
>> 5
>>
>> On Thursday, October 22, 2015 at 8:20:33 AM UTC-5, J Luis wrote:
>>>
>>> Thanks, at least it's a place to start.
>>>
>>> quinta-feira, 22 de Outubro de 2015 às 14:10:44 UTC+1, Kristoffer 
>>> Carlsson escreveu:
>>>>
>>>> Maybe
>>>>
>>>> julia> eval(Symbol("sin"))(5.0)
>>>> -0.9589242746631385
>>>>
>>>> Not sure if this is the best solution.
>>>>
>>>>
>>>> On Thursday, October 22, 2015 at 2:57:31 PM UTC+2, J Luis wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I need to convert this piece of Matlab code
>>>>>
>>>>>   [ps, orig_path] = feval(str2func(test), out_path);
>>>>>
>>>>> where 'test' is the name of a function and 'out_path' it unique input 
>>>>> argument. I have read and re-read the eval function and for once it's 
>>>>> clear 
>>>>> for me how it works (sorry, I find this sentence highly cryptic "Evaluate 
>>>>> an expression in the given module and return the result" ) but worst, I 
>>>>> don't see anywhere how it could call a function with input arguments.
>>>>>
>>>>> How can I achieve the same result in Julia?
>>>>>  
>>>>> Thanks. 
>>>>>
>>>>
>

[julia-users] Re: How to feval?

2015-10-22 Thread J Luis
Thanks, at least it's a place to start.

quinta-feira, 22 de Outubro de 2015 às 14:10:44 UTC+1, Kristoffer Carlsson 
escreveu:
>
> Maybe
>
> julia> eval(Symbol("sin"))(5.0)
> -0.9589242746631385
>
> Not sure if this is the best solution.
>
>
> On Thursday, October 22, 2015 at 2:57:31 PM UTC+2, J Luis wrote:
>>
>> Hi,
>>
>> I need to convert this piece of Matlab code
>>
>>   [ps, orig_path] = feval(str2func(test), out_path);
>>
>> where 'test' is the name of a function and 'out_path' it unique input 
>> argument. I have read and re-read the eval function and for once it's clear 
>> for me how it works (sorry, I find this sentence highly cryptic "Evaluate 
>> an expression in the given module and return the result" ) but worst, I 
>> don't see anywhere how it could call a function with input arguments.
>>
>> How can I achieve the same result in Julia?
>>  
>> Thanks. 
>>
>

[julia-users] How to feval?

2015-10-22 Thread J Luis
Hi,

I need to convert this piece of Matlab code

  [ps, orig_path] = feval(str2func(test), out_path);

where 'test' is the name of a function and 'out_path' it unique input 
argument. I have read and re-read the eval function and for once it's clear 
for me how it works (sorry, I find this sentence highly cryptic "Evaluate 
an expression in the given module and return the result" ) but worst, I 
don't see anywhere how it could call a function with input arguments.

How can I achieve the same result in Julia?
 
Thanks. 


[julia-users] Re: Windows: enforce update of ENV["PATH"] after modifying it.

2015-10-16 Thread J Luis
What???

I do that type of things all the time and never need to sign-out.
How do you change the PATH variable? If done with the System->... 
Environment variables box, one have to hit 'Apply' and that's it.

sexta-feira, 16 de Outubro de 2015 às 13:07:24 UTC+1, Tomas Lycken escreveu:
>
> Modifying environment variables on Windows usually requires at least a 
> sign out-sign in again. Can you try that?
>
> // T
>
> On Friday, October 16, 2015 at 2:06:26 PM UTC+2, bernhard wrote:
>>
>> Hi 
>> can anyone help me with this? When PATH is modified this is not 
>> immediately reflected in Julia (even after closing and starting Julia 
>> again). I wonder if this can be done without a reboot.
>> I am not sure whether this is at all a Julia issue though.
>>
>> Bernhard
>>
>

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-30 Thread J Luis
I want to add my voice to the dislikers. Those are the type of surprises 
that are not welcome mainly for matlab users. 

quarta-feira, 30 de Setembro de 2015 às 16:53:57 UTC+1, Christoph Ortner 
escreveu:
>
> I also strongly dislike the `linspace` change; I like the idea though of 
> having `linspace` and `linrange`, where the former should give the array.
> Christoph
>
>
> On Wednesday, 30 September 2015 10:21:36 UTC+1, Michele Zaffalon wrote:
>>
>> I just realize that the thread is about 0.3.11 and I am showing output 
>> for 0.4.0-rc2. Sorry for the noise.
>>
>> On Wed, Sep 30, 2015 at 11:17 AM, Michele Zaffalon > > wrote:
>>
>>>
>>> On Wed, Sep 30, 2015 at 9:50 AM, Milan Bouchet-Valat  
>>> wrote:
>>>
 Le mercredi 30 septembre 2015 à 08:55 +0200, Michele Zaffalon a écrit :
 > Just curious: linspace returns a Range object, but logspace returns a
 > vector because there is no much use case for a LogRange object?
 >
 > @feza: I have also seen the deprecation warning going away after a
 > couple of calls, but I am not sure why. If you restart Julia, the
 > deprecations reappear.
 Deprecation warnings are only printed once for each call place. The
 idea is that once you're aware of it, there's no point in nagging you.

 Anyway, that warning is most probably not related to linspace at all,
 but rather to the array concatenation syntax resulting in an effect
 equivalent to collect(). If you show us a piece of code that prints the
 warning, we can give you more details.


 Regards

>>>
>>> Sorry, you are right, I was referring to the concatenation.
>>> It prints it exaclty twice if I type it in the REPL, it always prints it 
>>> if I define it within a function e.g. a() = [1:3].
>>>
>>> C:\Users\michele.zaffalon>julia
>>>_
>>>_   _ _(_)_ |  A fresh approach to technical computing
>>>   (_) | (_) (_)|  Documentation: http://docs.julialang.org
>>>_ _   _| |_  __ _   |  Type "?help" for help.
>>>   | | | | | | |/ _` |  |
>>>   | | |_| | | | (_| |  |  Version 0.4.0-rc2 (2015-09-18 17:51 UTC)
>>>  _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
>>> |__/   |  x86_64-w64-mingw32
>>>
>>> julia> [1:3]
>>> WARNING: [a] concatenation is deprecated; use collect(a) instead
>>>  in depwarn at deprecated.jl:73
>>>  in oldstyle_vcat_warning at abstractarray.jl:29
>>>  in vect at abstractarray.jl:32
>>> while loading no file, in expression starting on line 0
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>
>>> julia> [1:3]
>>> WARNING: [a] concatenation is deprecated; use collect(a) instead
>>>  in depwarn at deprecated.jl:73
>>>  in oldstyle_vcat_warning at abstractarray.jl:29
>>>  in vect at abstractarray.jl:32
>>> while loading no file, in expression starting on line 0
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>
>>> julia> [1:3]
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>
>>> julia> a() = [1:3]
>>> a (generic function with 1 method)
>>>
>>> julia> a()
>>> WARNING: [a] concatenation is deprecated; use collect(a) instead
>>>  in depwarn at deprecated.jl:73
>>>  in oldstyle_vcat_warning at abstractarray.jl:29
>>>  in a at none:1
>>> while loading no file, in expression starting on line 0
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>
>>> julia> a()
>>> WARNING: [a] concatenation is deprecated; use collect(a) instead
>>>  in depwarn at deprecated.jl:73
>>>  in oldstyle_vcat_warning at abstractarray.jl:29
>>>  in a at none:1
>>> while loading no file, in expression starting on line 0
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>
>>> julia> a()
>>> WARNING: [a] concatenation is deprecated; use collect(a) instead
>>>  in depwarn at deprecated.jl:73
>>>  in oldstyle_vcat_warning at abstractarray.jl:29
>>>  in a at none:1
>>> while loading no file, in expression starting on line 0
>>> 3-element Array{Int64,1}:
>>>  1
>>>  2
>>>  3
>>>  
>>>

 > On Wed, Sep 30, 2015 at 5:40 AM, feza  wrote:
 > > Strange it *was* giving me an error saying deprecated and that I
 > > should use collect, but now it's fine.
 > >
 > >
 > > On Tuesday, September 29, 2015 at 10:28:12 PM UTC-4, Sheehan Olver
 > > wrote:
 > > > fez, I'm pretty sure the code works fine without the collect:
 > > > when exp is called on linspace it converts it to a vector.
 > > > Though the returned t will be linspace object.
 > > >
 > > > On Wednesday, September 30, 2015 at 12:10:55 PM UTC+10, feza
 > > > wrote:
 > > > > Here's the code I was using where I needed to use collect (I've
 > > > > been playing around with Julia, so any suggestions on this code
 > > > > for perf is welcome ;) ) . In general linspace (or the :
 > > > > notation)  is also used commonly to lay  a grid in space for
 > > > > solving a PDE for some other use cases.
 > > > >
 > > > > function gp(n)
 > > > > n = convert(Int,n)
>

[julia-users] Re: Julia code 5x to 30x slower than Matlab code

2015-09-27 Thread J Luis
Yes, we will be releasing Win binaries when it's released. It's for the 
mean time that interested people needs to build from source.

domingo, 27 de Setembro de 2015 às 14:50:25 UTC+1, Marcio Sales escreveu:
>
> I hope to have a release version in about a month, which is the estimated 
>> time for releasing GMT5.2. There are still several issues from the GMT side 
>> but overall most of it works already. Feel free to test it (see the 
>> gallery.jl for several usage examples) but note that you'll have to install 
>> and build GMT5.2svn yourself. And I only tested it on Windows.
>>
>
> Ok. Will Windows binaries be available then? I use windows and 
> unfortunately can't install the dependencies required to build in the 
> computer I work on. 
>


[julia-users] Re: Julia code 5x to 30x slower than Matlab code

2015-09-25 Thread J Luis


sexta-feira, 25 de Setembro de 2015 às 17:03:36 UTC+1, Marcio Sales 
escreveu:
>
> Looks good. Would be nice having wrappers for that in Julia.
>

https://github.com/joa-quim/GMT.jl

I hope to have a release version in about a month, which is the estimated 
time for releasing GMT5.2. There are still several issues from the GMT side 
but overall most of it works already. Feel free to test it (see the 
gallery.jl for several usage examples) but note that you'll have to install 
and build GMT5.2svn yourself. And I only tested it on Windows.


[julia-users] Re: Julia code 5x to 30x slower than Matlab code

2015-09-25 Thread J Luis


sexta-feira, 25 de Setembro de 2015 às 14:47:49 UTC+1, Marcio Sales 
escreveu:
>
> all right... Well.. Julia's price will allways be better... 
> Btw.. what about crowdfunded initiatives? Has anyone tried that? I would 
> be wiling to donate for a geospatial visualization package, for example...
>
 

Would this http://gmt.soest.hawaii.edu/ fit your wishes?


[julia-users] Re: printing UInt displays hex instead of decimal

2015-09-16 Thread J Luis
I also find that the hex printing without specifically requiring it is very 
annoying.

quarta-feira, 16 de Setembro de 2015 às 23:08:23 UTC+1, 
holocro...@gmail.com escreveu:
>
> On Wednesday, September 16, 2015 at 5:38:30 PM UTC-4, Steven G. Johnson 
> wrote:
>
>> It's not a bug, it's intentional.  The feeling is that most applications 
>> of UInt** types are using them as bitstrings, in which cases a hex display 
>> is more useful. 
>>
>
> UInt is very useful for catching signed integers occurring in places they 
> shouldn't, so I use it whenever I explicitly expect a number to be 
> unsigned. I think this usage should be encouraged, but having UInt print 
> hex seems to discourage this. That said, those routinely dealing with 
> binary strings would want a hex output. Maybe there should be an interface 
> for declaring the default output format for a specific type, similar to 
> stream formatting in C++?
>


Re: [julia-users] Re: IDE for Julia

2015-09-14 Thread J Luis


>
>> I'm have many years of experience with Matlab and find its IDE a 
>> can't-work-without-it tool. When one experiments its debugger the reason 
>> becomes obvious.
>>
>>
> Do you claim that Fortran, C and Perl never achieved success until someone 
> wrote an IDE with a built-in debugger? ... Yeah, I know that's not what you 
> want to say. Please understand that even if you find an IDE indispensable 
> for Matlab, that doesn't make IDEs indispensable for all people for all 
> languages. The fair thing to say about IDEs is that they are a really good 
> idea to have because there are people who really really want them.
>
> Daniel
>
 
You have to admit that it's not fair to do such comparisons for the simple 
fact that when those languages started (and long long time after) IDEs like 
we are talking simply did not exist. Not that they do, you can't live 
without them. I do but with pain and let just don't forget that we are 
talking of general acceptance and not only the "Carnival of hackers".

I've seen this discussion some here ago in the Octave mailing list. See how 
much it was adopted (rather poorly in my view), specially on Windows.

Joaquim

>

Re: [julia-users] Re: IDE for Julia

2015-09-14 Thread J Luis


segunda-feira, 14 de Setembro de 2015 às 09:26:05 UTC+1, Daniel Carrera 
escreveu:
>
>
> On 14 September 2015 at 08:16, Uwe Fechner  > wrote:
>
>> While I understand your point, the success of a new programming language 
>> depends on the availability of a good IDE.
>>
>
> No it doesn't.
>
> C, C++, Perl, Python, Fortran, JavaScript, PHP, and arguably even Java 
> became successful long before they acquired an IDE. I think that there are 
> more languages that became successful without an IDE than with one, so 
> let's not overstate the issue. An IDE is *good* to have because *some* 
> people want them. Good documentation is more important. Having the right 
> features and being at the right place at the right time is even more 
> important.
>

Yes it does (IMO off course)
 
I'm have many years of experience with Matlab and find its IDE a 
can't-work-without-it tool. When one experiments its debugger the reason 
becomes obvious.



Re: [julia-users] Re: How to capture the output of a system command?

2015-09-12 Thread J Luis
Thanks, I'll keep an eye on that PR.
One other thing that is also missing is the possibility of returning the 
command status like Matlab does. In my workaround above I force it to be 
ignored (otherwise it may abort the function execution) but we than have no 
info of its value. Right, one can do a

success(cm)

but this implies running the command twice ... and `cmd` may do a heavy job

sábado, 12 de Setembro de 2015 às 15:51:40 UTC+1, Miguel Bazdresch escreveu:
>
> See this PR: https://github.com/JuliaLang/julia/pull/12807/files
>
> This is a change to `open` that would allow capturing STDERR the way you 
> want. This change won't make it into v0.4, but the code in there could 
> point you towards a solution. I hope to have some time soon to dive into 
> this (I need to implement the same thing in Gaston).
>
> -- mb
>
> On Sat, Sep 12, 2015 at 10:47 AM, J Luis > 
> wrote:
>
>> Right, that's indeed what is (very sadly) happening. It turned out that 
>> the stderr output is the part that I really need in this case. 
>> The only working solution I found was to do 
>>
>> run(pipeline(ignorestatus(cmd), stdout=DevNull, stderr="errs.txt"))
>> t = readall("errs.txt");
>>
>> but it's annoying having to write a disk file and read its contents.
>>  
>> Had some hope on this one, but no way too
>>
>> julia> readall(run(pipeline(ignorestatus(cm), STDOUT, STDOUT)))
>> Image Difference (RootMeanSquaredError):
>>NormalizedAbsolute
>>     ==
>>  Red: 0.370961869024311.0
>>Green: 0.361139119723667.3
>> Blue: 0.263868247017292.6
>>Total: 0.335490001721986.3
>> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
>> (0.33549 > 0.001).
>> ERROR: MethodError: `readall` has no method matching readall(::Void)
>>
>> and this one completely hangs the REPL giviing me no choice but killing 
>> the shell window
>>
>> rd,wr=redirect_stderr();
>> run(pipeline(ignorestatus(cmd), stdout=DevNull, stderr=rd))
>>
>> now if try to read from 'rd'
>>
>> readall(rd)# ---> IceAge
>>
>>
>> sábado, 12 de Setembro de 2015 às 15:35:39 UTC+1, Miguel Bazdresch 
>> escreveu:
>>>
>>> What could be happening is that `gm.exe` is printing that message to 
>>> STDERR, which is not captured by `readall()`. In theory, the new pipeline 
>>> infrastructure should let you capture STDERR, but I haven't had the time to 
>>> figure out exactly how. Maybe somebody who knows will chime in.
>>>
>>> -- mb
>>>
>>> On Fri, Sep 11, 2015 at 9:17 PM, J Luis  wrote:
>>>
>>>> Found a ignorestatus function. Better, but not yet good enough. It 
>>>> still prints a message even if using a suppression ';'
>>>>
>>>> julia> readall(ignorestatus(cm));
>>>> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds 
>>>> limit (0.336711 > 0.001).
>>>>
>>>>
>>>> sábado, 12 de Setembro de 2015 às 02:00:25 UTC+1, J Luis escreveu:
>>>>>
>>>>> Thanks. It turned out my main error was that I was build the Cmd 
>>>>> object by first creating the command as a string and after wrapping it in 
>>>>> back ticks.
>>>>>
>>>>> But I continue in troubles. Right, I can run the command, a 
>>>>> GraphicsMagic image comparison command, but when that comparison say the 
>>>>> two images are different gm.exe returns an error code != 0 and Julia 
>>>>> interprets it a command error. But it isn't, it only means the two images 
>>>>> are different. As a consequence the julia function where this happens 
>>>>> aborts (an example in REPL bellow).
>>>>>
>>>>> I tried with a try catch but not even that prevented the function 
>>>>> abortion. How can I get out of this one?
>>>>>
>>>>> julia> readall(cm)
>>>>> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds 
>>>>> limit (0.33549 > 0.001).
>>>>> ERROR: failed process: Process(`C:/programs/GraphicsMagick/gm.exe 
>>>>> compare -density 200 -maximum-error 0.001 -highlight-color magenta 
>>>>> -highlight-style assign -metric rmse -file V:/example_02.png 
>>>>> C:/progs_cygw/GMTdev/gmt5/branches/5.2.0/doc/examples/ex02/
>>>>> example_02.ps V:/example_02.ps`, ProcessExited(1)) [1]
>>>>>  in pipeline_error at process.jl:548
>>>>>
>>>>> sábado, 12 de Setembro de 2015 às 01:17:57 UTC+1, Simon Kornblith 
>>>>> escreveu:
>>>>>>
>>>>>> readall(`cat test`) or similar
>>>>>>
>>>>>> On Friday, September 11, 2015 at 7:56:43 PM UTC-4, J Luis wrote:
>>>>>>>
>>>>>>> Ok, I've spend about an hour around "run" "open", "run(pipeline(..." 
>>>>>>> but no way.
>>>>>>> In Matlab I would do
>>>>>>>
>>>>>>> [status, cmdout] = system(cmd);
>>>>>>>
>>>>>>> but in Julia the most a can reach is to run the command
>>>>>>>
>>>>>>> com = "C:/programs/GraphicsMagick/gm.exe compare -density 200 ...
>>>>>>>
>>>>>>>run(`com')
>>>>>>>
>>>>>>> but I need the result of that execution. 
>>>>>>> How to?
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>
>

Re: [julia-users] Re: How to capture the output of a system command?

2015-09-12 Thread J Luis
Right, that's indeed what is (very sadly) happening. It turned out that the 
stderr output is the part that I really need in this case. 
The only working solution I found was to do 

run(pipeline(ignorestatus(cmd), stdout=DevNull, stderr="errs.txt"))
t = readall("errs.txt");

but it's annoying having to write a disk file and read its contents.
 
Had some hope on this one, but no way too

julia> readall(run(pipeline(ignorestatus(cm), STDOUT, STDOUT)))
Image Difference (RootMeanSquaredError):
   NormalizedAbsolute
    ==
 Red: 0.370961869024311.0
   Green: 0.361139119723667.3
Blue: 0.263868247017292.6
   Total: 0.335490001721986.3
C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
(0.33549 > 0.001).
ERROR: MethodError: `readall` has no method matching readall(::Void)

and this one completely hangs the REPL giviing me no choice but killing the 
shell window

rd,wr=redirect_stderr();
run(pipeline(ignorestatus(cmd), stdout=DevNull, stderr=rd))

now if try to read from 'rd'

readall(rd)# ---> IceAge


sábado, 12 de Setembro de 2015 às 15:35:39 UTC+1, Miguel Bazdresch escreveu:
>
> What could be happening is that `gm.exe` is printing that message to 
> STDERR, which is not captured by `readall()`. In theory, the new pipeline 
> infrastructure should let you capture STDERR, but I haven't had the time to 
> figure out exactly how. Maybe somebody who knows will chime in.
>
> -- mb
>
> On Fri, Sep 11, 2015 at 9:17 PM, J Luis > 
> wrote:
>
>> Found a ignorestatus function. Better, but not yet good enough. It still 
>> prints a message even if using a suppression ';'
>>
>> julia> readall(ignorestatus(cm));
>> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
>> (0.336711 > 0.001).
>>
>>
>> sábado, 12 de Setembro de 2015 às 02:00:25 UTC+1, J Luis escreveu:
>>>
>>> Thanks. It turned out my main error was that I was build the Cmd object 
>>> by first creating the command as a string and after wrapping it in back 
>>> ticks.
>>>
>>> But I continue in troubles. Right, I can run the command, a 
>>> GraphicsMagic image comparison command, but when that comparison say the 
>>> two images are different gm.exe returns an error code != 0 and Julia 
>>> interprets it a command error. But it isn't, it only means the two images 
>>> are different. As a consequence the julia function where this happens 
>>> aborts (an example in REPL bellow).
>>>
>>> I tried with a try catch but not even that prevented the function 
>>> abortion. How can I get out of this one?
>>>
>>> julia> readall(cm)
>>> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds 
>>> limit (0.33549 > 0.001).
>>> ERROR: failed process: Process(`C:/programs/GraphicsMagick/gm.exe 
>>> compare -density 200 -maximum-error 0.001 -highlight-color magenta 
>>> -highlight-style assign -metric rmse -file V:/example_02.png 
>>> C:/progs_cygw/GMTdev/gmt5/branches/5.2.0/doc/examples/ex02/example_02.ps 
>>> V:/example_02.ps`, ProcessExited(1)) [1]
>>>  in pipeline_error at process.jl:548
>>>
>>> sábado, 12 de Setembro de 2015 às 01:17:57 UTC+1, Simon Kornblith 
>>> escreveu:
>>>>
>>>> readall(`cat test`) or similar
>>>>
>>>> On Friday, September 11, 2015 at 7:56:43 PM UTC-4, J Luis wrote:
>>>>>
>>>>> Ok, I've spend about an hour around "run" "open", "run(pipeline(..." 
>>>>> but no way.
>>>>> In Matlab I would do
>>>>>
>>>>> [status, cmdout] = system(cmd);
>>>>>
>>>>> but in Julia the most a can reach is to run the command
>>>>>
>>>>> com = "C:/programs/GraphicsMagick/gm.exe compare -density 200 ...
>>>>>
>>>>>run(`com')
>>>>>
>>>>> but I need the result of that execution. 
>>>>> How to?
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>

[julia-users] Re: How to capture the output of a system command?

2015-09-11 Thread J Luis
Found a ignorestatus function. Better, but not yet good enough. It still 
prints a message even if using a suppression ';'

julia> readall(ignorestatus(cm));
C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
(0.336711 > 0.001).

sábado, 12 de Setembro de 2015 às 02:00:25 UTC+1, J Luis escreveu:
>
> Thanks. It turned out my main error was that I was build the Cmd object by 
> first creating the command as a string and after wrapping it in back ticks.
>
> But I continue in troubles. Right, I can run the command, a GraphicsMagic 
> image comparison command, but when that comparison say the two images are 
> different gm.exe returns an error code != 0 and Julia interprets it a 
> command error. But it isn't, it only means the two images are different. As 
> a consequence the julia function where this happens aborts (an example in 
> REPL bellow).
>
> I tried with a try catch but not even that prevented the function 
> abortion. How can I get out of this one?
>
> julia> readall(cm)
> C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
> (0.33549 > 0.001).
> ERROR: failed process: Process(`C:/programs/GraphicsMagick/gm.exe compare 
> -density 200 -maximum-error 0.001 -highlight-color magenta -highlight-style 
> assign -metric rmse -file V:/example_02.png 
> C:/progs_cygw/GMTdev/gmt5/branches/5.2.0/doc/examples/ex02/example_02.ps 
> V:/example_02.ps`, ProcessExited(1)) [1]
>  in pipeline_error at process.jl:548
>
> sábado, 12 de Setembro de 2015 às 01:17:57 UTC+1, Simon Kornblith escreveu:
>>
>> readall(`cat test`) or similar
>>
>> On Friday, September 11, 2015 at 7:56:43 PM UTC-4, J Luis wrote:
>>>
>>> Ok, I've spend about an hour around "run" "open", "run(pipeline(..." but 
>>> no way.
>>> In Matlab I would do
>>>
>>> [status, cmdout] = system(cmd);
>>>
>>> but in Julia the most a can reach is to run the command
>>>
>>> com = "C:/programs/GraphicsMagick/gm.exe compare -density 200 ...
>>>
>>>run(`com')
>>>
>>> but I need the result of that execution. 
>>> How to?
>>>
>>> Thanks
>>>
>>>
>>>
>>>
>>>

[julia-users] Re: How to capture the output of a system command?

2015-09-11 Thread J Luis
Thanks. It turned out my main error was that I was build the Cmd object by 
first creating the command as a string and after wrapping it in back ticks.

But I continue in troubles. Right, I can run the command, a GraphicsMagic 
image comparison command, but when that comparison say the two images are 
different gm.exe returns an error code != 0 and Julia interprets it a 
command error. But it isn't, it only means the two images are different. As 
a consequence the julia function where this happens aborts (an example in 
REPL bellow).

I tried with a try catch but not even that prevented the function abortion. 
How can I get out of this one?

julia> readall(cm)
C:/programs/GraphicsMagick/gm.exe compare: image difference exceeds limit 
(0.33549 > 0.001).
ERROR: failed process: Process(`C:/programs/GraphicsMagick/gm.exe compare 
-density 200 -maximum-error 0.001 -highlight-color magenta -highlight-style 
assign -metric rmse -file V:/example_02.png 
C:/progs_cygw/GMTdev/gmt5/branches/5.2.0/doc/examples/ex02/example_02.ps 
V:/example_02.ps`, ProcessExited(1)) [1]
 in pipeline_error at process.jl:548

sábado, 12 de Setembro de 2015 às 01:17:57 UTC+1, Simon Kornblith escreveu:
>
> readall(`cat test`) or similar
>
> On Friday, September 11, 2015 at 7:56:43 PM UTC-4, J Luis wrote:
>>
>> Ok, I've spend about an hour around "run" "open", "run(pipeline(..." but 
>> no way.
>> In Matlab I would do
>>
>> [status, cmdout] = system(cmd);
>>
>> but in Julia the most a can reach is to run the command
>>
>> com = "C:/programs/GraphicsMagick/gm.exe compare -density 200 ...
>>
>>run(`com')
>>
>> but I need the result of that execution. 
>> How to?
>>
>> Thanks
>>
>>
>>
>>
>>

[julia-users] How to capture the output of a system command?

2015-09-11 Thread J Luis
Ok, I've spend about an hour around "run" "open", "run(pipeline(..." but no 
way.
In Matlab I would do

[status, cmdout] = system(cmd);

but in Julia the most a can reach is to run the command

com = "C:/programs/GraphicsMagick/gm.exe compare -density 200 ...

   run(`com')

but I need the result of that execution. 
How to?

Thanks






Re: [julia-users] fieldoffsets and the C macro offsetof

2015-09-11 Thread J Luis
Yes, but it requires confirmation that Clang.jl effectively does that and I 
don't have a Clang.jl at hand now (it might have been me, though the Git 
history that I have does not show it)

sexta-feira, 11 de Setembro de 2015 às 22:01:05 UTC+1, Scott Jones escreveu:
>
> That should be reported as a bug in Clang.jl.
> size_t should is unsigned 32 or 64-bit (on today's platforms), and Cint is 
> signed 32-bit, not at all the same!
>
> On Thursday, September 10, 2015 at 11:22:13 PM UTC-4, J Luis wrote:
>>
>> Ok, couldn't resist to one more attempt and I may have found the issue. 
>> If you look at the n_alloc member in  here
>>
>> https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1445
>>
>> and here
>>
>>
>> http://gmt.soest.hawaii.edu/projects/gmt/repository/entry/branches/5.2.0/src/gmt_resources.h#L543
>>
>> you'll notice that it is size_t in C an Cint in Julia (converted with 
>> Clang). If I change the Julia type to Csize_t than the offsets are the same.
>>
>> Now I'm really going to sleep.
>>
>> sexta-feira, 11 de Setembro de 2015 às 04:07:53 UTC+1, J Luis escreveu:
>>>
>>> No, that's not the case. Pure C built with VS2013
>>>
>>> Ok, tomorrow I'll try to post links to code showing this case.
>>>
>>> sexta-feira, 11 de Setembro de 2015 às 04:03:48 UTC+1, Jameson escreveu:
>>>>
>>>> generally no, unless you are using C++11 features or ms-bitfields
>>>>
>>>> On Thu, Sep 10, 2015 at 11:01 PM J Luis  wrote:
>>>>
>>>>> Thanks, it's very late here and posting the case will take time. But 
>>>>> one thing before I go.
>>>>> The fact that I'm using a Julia compiled with mingw64 and accessing a 
>>>>> dll built with VS could explain this, no?
>>>>>
>>>>>
>>>>>
>>>>> sexta-feira, 11 de Setembro de 2015 às 03:47:12 UTC+1, Jameson 
>>>>> escreveu:
>>>>>
>>>>>> Yes (unless C doesn't have an equivalent representation), can you 
>>>>>> post the case?
>>>>>>
>>>>>> On Thu, Sep 10, 2015 at 10:43 PM J Luis  wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> When we have a immutable that mimics a C struct, are the results of 
>>>>>>> fieldoffsets() from the Julia side and offsetoff() at the C side 
>>>>>>> supposed 
>>>>>>> to give the same result?
>>>>>>> (Well, I already found one case were they don't)
>>>>>>>
>>>>>>

[julia-users] Re: How do I install Clang.jl on Windows 7?

2015-09-11 Thread J Luis
Ah, I knew I had written that but could not find it anymore.
Just an update. Some months ago I tried again when on a rare occasion that 
I was able to build Julia+LLVM-SVN. Unfortunately the result regarding 
building Clang.jl was more or less the same as reported in that issue.

sexta-feira, 11 de Setembro de 2015 às 12:16:56 UTC+1, Tony Kelman escreveu:
>
> Last time I checked the LLVM binary installer on Windows doesn't provide 
> shared libraries of libclang. There's one issue from last year on this: 
> https://github.com/ihnorton/Clang.jl/issues/65
>
> You may be able to get further with a source build of Julia and LLVM, 
> which takes some time on Windows. Might be easier to just do whatever 
> Clang.jl generation you need to do on Linux or in a VM.
>
>
> On Thursday, September 10, 2015 at 5:31:32 PM UTC-7, Chris Stook wrote:
>>
>> Thanks for the suggestion.  BinDeps.debug gives the same error.
>>>
>>  
>>
>>> BinDeps.debug("Clang") 
>>>
>>
>> INFO: Reading build script...
>>
>>
>>  could not spawn `which llvm-config`: no such file or directory (ENOENT)
>>
>> while loading C:\Users\Chris\.julia\v0.3\Clang\deps\build.jl, in expression 
>> starting on line 10
>> while loading In[3], in expression starting on line 1
>>
>>  in _jl_spawn at process.jl:217 (repeats 2 times)
>>
>>
>>
>> I'm slowly working through the instructions to compile julia with 
>> MinGW/MSYS2 so I can compile with BUILD_LLVM_CLANG=1
>>
>> Chris
>>  
>>
>

Re: [julia-users] fieldoffsets and the C macro offsetof

2015-09-10 Thread J Luis
Ok, couldn't resist to one more attempt and I may have found the issue. If 
you look at the n_alloc member in  here

https://github.com/joa-quim/GMT.jl/blob/master/src/libgmt_h.jl#L1445

and here

http://gmt.soest.hawaii.edu/projects/gmt/repository/entry/branches/5.2.0/src/gmt_resources.h#L543

you'll notice that it is size_t in C an Cint in Julia (converted with 
Clang). If I change the Julia type to Csize_t than the offsets are the same.

Now I'm really going to sleep.

sexta-feira, 11 de Setembro de 2015 às 04:07:53 UTC+1, J Luis escreveu:
>
> No, that's not the case. Pure C built with VS2013
>
> Ok, tomorrow I'll try to post links to code showing this case.
>
> sexta-feira, 11 de Setembro de 2015 às 04:03:48 UTC+1, Jameson escreveu:
>>
>> generally no, unless you are using C++11 features or ms-bitfields
>>
>> On Thu, Sep 10, 2015 at 11:01 PM J Luis  wrote:
>>
>>> Thanks, it's very late here and posting the case will take time. But one 
>>> thing before I go.
>>> The fact that I'm using a Julia compiled with mingw64 and accessing a 
>>> dll built with VS could explain this, no?
>>>
>>>
>>>
>>> sexta-feira, 11 de Setembro de 2015 às 03:47:12 UTC+1, Jameson escreveu:
>>>
>>>> Yes (unless C doesn't have an equivalent representation), can you post 
>>>> the case?
>>>>
>>>> On Thu, Sep 10, 2015 at 10:43 PM J Luis  wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> When we have a immutable that mimics a C struct, are the results of 
>>>>> fieldoffsets() from the Julia side and offsetoff() at the C side supposed 
>>>>> to give the same result?
>>>>> (Well, I already found one case were they don't)
>>>>>
>>>>

Re: [julia-users] fieldoffsets and the C macro offsetof

2015-09-10 Thread J Luis
No, that's not the case. Pure C built with VS2013

Ok, tomorrow I'll try to post links to code showing this case.

sexta-feira, 11 de Setembro de 2015 às 04:03:48 UTC+1, Jameson escreveu:
>
> generally no, unless you are using C++11 features or ms-bitfields
>
> On Thu, Sep 10, 2015 at 11:01 PM J Luis > 
> wrote:
>
>> Thanks, it's very late here and posting the case will take time. But one 
>> thing before I go.
>> The fact that I'm using a Julia compiled with mingw64 and accessing a dll 
>> built with VS could explain this, no?
>>
>>
>>
>> sexta-feira, 11 de Setembro de 2015 às 03:47:12 UTC+1, Jameson escreveu:
>>
>>> Yes (unless C doesn't have an equivalent representation), can you post 
>>> the case?
>>>
>>> On Thu, Sep 10, 2015 at 10:43 PM J Luis  wrote:
>>>
>>>> Hi,
>>>>
>>>> When we have a immutable that mimics a C struct, are the results of 
>>>> fieldoffsets() from the Julia side and offsetoff() at the C side supposed 
>>>> to give the same result?
>>>> (Well, I already found one case were they don't)
>>>>
>>>

Re: [julia-users] fieldoffsets and the C macro offsetof

2015-09-10 Thread J Luis
Thanks, it's very late here and posting the case will take time. But one 
thing before I go.
The fact that I'm using a Julia compiled with mingw64 and accessing a dll 
built with VS could explain this, no?


sexta-feira, 11 de Setembro de 2015 às 03:47:12 UTC+1, Jameson escreveu:
>
> Yes (unless C doesn't have an equivalent representation), can you post the 
> case?
>
> On Thu, Sep 10, 2015 at 10:43 PM J Luis > 
> wrote:
>
>> Hi,
>>
>> When we have a immutable that mimics a C struct, are the results of 
>> fieldoffsets() from the Julia side and offsetoff() at the C side supposed 
>> to give the same result?
>> (Well, I already found one case were they don't)
>>
>

  1   2   3   4   >