Re: [julia-users] Why do bools have functions like abs and sign defined?

2014-09-11 Thread Tim Holy
It's because

julia super(Bool)
Integer

julia super(Integer)
Real

and you'd expect these to be defined for Integers. If this weren't the case 
then

function myalgorithm{T:Real}(x::AbstractArray{T})
# do something involving abs
end

would fail if the user supplied an array of Bools. I could create a special 
version of myalgorithm for Array{Bool} that omitted calls to abs, but that 
would be a pain in the neck, and I'd have to worry about every single possible 
element type (does Uint16 have an abs method? let's check). Since Julia 
compiles a new version of myalgorithm specificially for Array{Bool}, there's 
also no performance hit (such trivial functions just get inlined out into no-
ops).

--Tim

On Wednesday, September 10, 2014 10:20:42 PM Dan Luu wrote:
 In bool.jl, there are things like
 
 signbit(x::Bool) = false
 sign(x::Bool) = x
 abs(x::Bool) = x
 abs2(x::Bool) = x
 
 Are these because Bool is a subtype of something where you'd expect
 these to be defined, or are these useful in their own right, and if
 so, when would you use these?
 
 
 Thanks,
 Dan



Re: [julia-users] Rationale for colon quote syntax

2014-09-11 Thread Stefan Karpinski
It's a bit of a pun on the Ruby symbol syntax :foo. Since the symbol :foo
is the quoted form of the identifier foo, the idea is that :expr
generalizes that syntax to arbitrary expressions. I have now and then
wished that `expr` was the syntax for that, that's how you quote code in
Markdown and we often write that in email, for example, but that syntax is
already used for Julia shell commands and I rather like that syntax too.


On Thu, Sep 11, 2014 at 6:49 AM, Aubrey Barnard aubrey.f.barn...@gmail.com
wrote:

 Julia Users,

 I am trying to find out what the rationale is for some of the Julia syntax
 choices, in particular the choice of colon as the quote character. (I think
 knowing the rationale can help those new to the language, like myself, come
 to grips with its syntax.) Is there some discussion or document that you
 can point me to? I searched the issues on GitHub, the julia-dev group, and
 the julia-users group but came back empty-handed.

 Thanks for any information or pointers.

 Aubrey



Re: [julia-users] Re: ANN: revamped Images based on Color, FixedPointNumbers

2014-09-11 Thread Stefan Karpinski
Btw, I got everything to work and it made a great demo. People love 
transformations of monkey faces.

 On Sep 9, 2014, at 2:44 PM, Stefan Karpinski ste...@karpinski.org wrote:
 
 Yes, but now I'm wrestling with Tk. Should have gotten this working way 
 earlier.
 
 
 On Tue, Sep 9, 2014 at 2:39 PM, Tim Holy tim.h...@gmail.com wrote:
 Is it fixed now?
 --Tim
 
 On Tuesday, September 09, 2014 02:18:34 PM Stefan Karpinski wrote:
  Ah, I was getting the same thing in the REPL, but that was because of
  TerminalExtensions, which uses the same display API, which seems to be
  broken.
 
  On Tue, Sep 9, 2014 at 2:11 PM, Tim Holy tim.h...@gmail.com wrote:
   Missing method problem; I'm afraid that in these early days, there are
   simply
   going to be some of these, because this is a huge expansion of the type
   hierarchy and I'm sure I didn't catch everything that everyone will try.
   (I
   rarely use IJulia in part because I have a weird display bug that seems 
   to
   affect only me---individual pixels are displayed as tiles with spaces
   between
   them---and I haven't yet succeeded in tracking it down.)
  
   Should be fixed if you do Pkg.update(). I can't promise that whatever
   larger-
   scale thing you were trying will work, however, unless you give me a more
   complete example.
  
   Best,
   --Tim
  
   On Tuesday, September 09, 2014 12:27:35 PM Stefan Karpinski wrote:
I'm seeing this error:
   
`mapinfo` has no method matching
  
   mapinfo(::Type{RGB{UfixedBase{Uint8,8}}},
  
::Image{RGB{UfixedBase{Uint8,8}},2,Array{RGB{UfixedBase{Uint8,8}},2}})
   
 in base64 at base64.jl:125
 in display_dict at
 /Users/stefan/.julia/IJulia/src/execute_request.jl:34
   
What versions of things are required to make this work? I wonder it 
this
  
   is
  
something obviously wrong. My system info:
   
Julia Version 0.3.1-pre+48
Commit 8c1b105 (2014-09-08 12:46 UTC)
   
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)
  CPU: Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
   
30 required packages:
 - ASCIIPlots0.0.2
 - DataArrays0.2.0
 - DataFrames0.5.7
 - DataStructures0.3.2
 - Debug 0.0.4
 - Distributions 0.5.4
 - Example   0.3.3+ master
 - Gadfly0.3.7
 - Gaston0.0.0  master
 - IJulia0.1.15
 - Images0.4.2
 - ImmutableArrays   0.0.6
 - Iterators 0.1.6
 - JSON  0.3.7
 - Morsel0.0.4
 - NLopt 0.1.3  master
 - ODBC  0.3.8+ master
 - PyCall0.4.8
 - PyPlot1.3.3
 - RDatasets 0.1.1
 - RNGTest   0.0.1+ 421b289d
 - SIUnits   0.0.2
 - SortingAlgorithms 0.0.1
 - SpecialMatrices   0.1.3
 - Stats 0.1.0
 - TerminalExtensions0.0.2
 - TestImages0.0.5
 - TimeSeries0.4.5
 - Winston   0.11.4
 - ZMQ   0.1.13
   
38 additional packages:
 - ArrayViews0.4.6
 - BinDeps   0.3.5
 - Cairo 0.2.17
 - Cartesian 0.3.0
 - Codecs0.1.2
 - Color 0.3.7
 - Compose   0.3.7
 - Contour   0.0.4
 - Dates 0.3.1
 - Datetime  0.1.7
 - Distances 0.1.1
 - FixedPointNumbers 0.0.4
 - GZip  0.2.13
 - GnuTLS0.0.1
 - Hexagons  0.0.2
 - Homebrew  0.1.10
 - HttpCommon0.0.6
 - HttpParser0.0.9
 - HttpServer0.0.8
 - IniFile   0.2.3
 - KernelDensity 0.0.2
 - LibTrading0.0.1  master (dirty)
 - Loess 0.0.3
 - MathProgBase  0.3.0
 - Meddle0.0.5
 - NAG   0.0.0- master
 (unregistered)
 - Nettle0.1.5
 - PDMats0.2.4
 - REPLCompletions  

[julia-users] Re: How to use plan_fft

2014-09-11 Thread Viral Shah
I think you want to do something like:

p = plan_fft(data,1,FFTW.MEASURE)

or

p = plan_fft(data,(1,2),FFTW.MEASURE)


-viral

On Thursday, September 11, 2014 1:15:28 AM UTC+5:30, Jim Christoff wrote:

 I have used Jullia's default fft for several months and have had no 
 problems. I recently decided to try  plan_fft to improve performance.
 I seem to a problem using the plan_fft method. Any help would be 
 appreciated.

 data is a 2d complex Nu by Nt array
 The following is one of many attempts:


 p = plan_fft(data,Nu,Nt,MEASURE)
 GG= p(data)



Re: [julia-users] Re: 0.4 Roadmap for DataFrames, DataArrays, etc...

2014-09-11 Thread Viral Shah
The state of NA has always been where I stop using DataFrames - and I think 
this roadmap is perfect to coincide with the 0.4 release.

What are your thoughts on multi-threading, should we be able to land that 
in 0.4? Perhaps we can speed up some easily parallelizable operations.

-viral

On Sunday, September 7, 2014 11:47:44 AM UTC+5:30, John Myles White wrote:

 Yeah, that’s a way more ambitious project. That’ll take at least a year to 
 make any progress at all. Before I could even begin, I need to finish DBI 
 and then build up something SQLAlchemy for Julia.

 Thankfully, the 0.4 changes should put DataFrames in a good state that we 
 can depend on for some time into the future.

  — John

 On Sep 6, 2014, at 11:15 PM, Iain Dunning iaindunn...@gmail.com wrote:

 I saw on some list/issue you were thinking of working on a more fresh 
 approach to the whole data storage situation - is that post 0.4?

 On Saturday, September 6, 2014 10:30:04 PM UTC-4, John Myles White wrote:

 I am hoping that the 0.4 release of Julia will coincide with a major 
 cleanup of the Data* world. I wrote up a very high level overview of my 
 goals here: https://gist.github.com/johnmyleswhite/ad5305ecaa9de01e317e 

 There’s still more work to do to flesh out these ideas, but the basic 
 principles are pretty close to finalized. There’s also a rough draft of 
 much of the core functionality we’ll need to add to support this roadmap. 

 I wanted to give everyone a heads up so that people understand where the 
 Data* packages are headed. The big idea is that we’ll be pushing more work 
 out into the type system, which will give substantial performance 
 improvements. 

  — John 




Re: [julia-users] Re: BeagleBone Black

2014-09-11 Thread Viral Shah
Could you try building master on the BBB again? It should hopefully have a 
comparable CPU as the Chromebook. It also helps if it is running Ubuntu, to 
install various dependencies to cut down the build time.

-viral

On Thursday, September 4, 2014 11:14:18 AM UTC+5:30, Steve Kelly wrote:

 I can confirm the arm-make3 branch does not build on the BBB. My company 
 is interested in getting Julia on ARM. I think the biggest issue is that 
 ubiquitous ARM devices are poor for building software quickly. Also with 
 Red Hat and possibly Amazon entering the ARM server space this will become 
 more feasible in the next year.


 On Thu, Sep 4, 2014 at 1:01 AM, Viral Shah vi...@mayin.org wrote:

 See the arm-make3 branch. I have an ARM chromebook, and it currently 
 crashes in building the system image. I haven't been able to look into this 
 further. I am guessing we will be ready in the 0.5 timeframe.

 If someone does want to try their hand at the ARM port, I can set up ssh 
 on my chromebook.

 -viral


 On Wednesday, September 3, 2014 7:05:35 PM UTC-7, 2Cubed wrote:

 I would love to get Julia and/or IJulia up and running on my BeagleBone 
 Black, but it seems that Julia is currently x86-specific.  Any idea when it 
 will be available for ARM?




[julia-users] Type parameter trouble (bug?)

2014-09-11 Thread Magnus Lie Hetland
Is this something that should work (i.e., is it a bug)?

abstract AbstractX{N}


type A{T}

end 


type B{T, N, X : AbstractX{N}}

x::X

t::NTuple{N, A{T}}

end 

I get the error message

*ERROR: N not defined*

The line in question is the type declaration for B. I certainly get that 
this could be outlawed … but it seems that *similar* declarations are OK. 
And if I comment out *either* of the two fields of B, it works just fine. 
(Commenting out other parts of the example quickly leads to something that 
works, too, though I'm not seeing the logic in it at the moment.)


[julia-users] Re: Type parameter trouble (bug?)

2014-09-11 Thread Magnus Lie Hetland
On a semi-related note, could I use an abstract class as an aggregate of 
type parameters, somehow?

That is, if I have something like

abstract X{T}


t{T}(x::X{T}) = T

and I have another type that takes a type parameter Y : X, could I use 
t(Y) in the declaration of fields? It seems I can't use it directly… I 
could certainly use metaprogramming, but I was looking for something a bit 
more straightforward. The alternative, I guess, is to always pass along all 
the type parameters of Y along with Y. If I have even a hint of a hierarchy 
of nested types/type parameters, this gets unwieldy fast. What's the way to 
go here?


[julia-users] Re: How to use plan_fft

2014-09-11 Thread Jim Christoff
Thanks , that was the problem.

On Wednesday, September 10, 2014 3:45:28 PM UTC-4, Jim Christoff wrote:

 I have used Jullia's default fft for several months and have had no 
 problems. I recently decided to try  plan_fft to improve performance.
 I seem to a problem using the plan_fft method. Any help would be 
 appreciated.

 data is a 2d complex Nu by Nt array
 The following is one of many attempts:


 p = plan_fft(data,Nu,Nt,MEASURE)
 GG= p(data)



Re: [julia-users] Re: Type parameter trouble (bug?)

2014-09-11 Thread Magnus Lie Hetland
Ah, thanks.


Re: [julia-users] Re: Type parameter trouble (bug?)

2014-09-11 Thread Magnus Lie Hetland
I see the issue is that I'm forgetting the ubiquity of dispatch here ;-) I 
don't really need to dispatch on the more specific type, I think. I 
primarily want the type checking, and I guess I can get that in an internal 
constructor. But how would I best go about doing that? I mean, I could just 
include a separate type assertion statement, but what's the idiomatic way 
of doing it?


Re: [julia-users] Re: Type parameter trouble (bug?)

2014-09-11 Thread Magnus Lie Hetland
Answering my own question here: I guess just adding a type declaration on 
the relevant parameter of the inner constructor is a way to go?


Re: [julia-users] Why do bools have functions like abs and sign defined?

2014-09-11 Thread Simon Kornblith
But then the question is why we define specialized versions for Bool rather 
than using the methods for Real in number.jl. For all but abs LLVM is smart 
enough to optimize the methods for Real to no-ops.

Simon

On Thursday, September 11, 2014 5:27:10 AM UTC-4, Tim Holy wrote:

 It's because 

 julia super(Bool) 
 Integer 

 julia super(Integer) 
 Real 

 and you'd expect these to be defined for Integers. If this weren't the 
 case 
 then 

 function myalgorithm{T:Real}(x::AbstractArray{T}) 
 # do something involving abs 
 end 

 would fail if the user supplied an array of Bools. I could create a 
 special 
 version of myalgorithm for Array{Bool} that omitted calls to abs, but that 
 would be a pain in the neck, and I'd have to worry about every single 
 possible 
 element type (does Uint16 have an abs method? let's check). Since Julia 
 compiles a new version of myalgorithm specificially for Array{Bool}, 
 there's 
 also no performance hit (such trivial functions just get inlined out into 
 no- 
 ops). 

 --Tim 

 On Wednesday, September 10, 2014 10:20:42 PM Dan Luu wrote: 
  In bool.jl, there are things like 
  
  signbit(x::Bool) = false 
  sign(x::Bool) = x 
  abs(x::Bool) = x 
  abs2(x::Bool) = x 
  
  Are these because Bool is a subtype of something where you'd expect 
  these to be defined, or are these useful in their own right, and if 
  so, when would you use these? 
  
  
  Thanks, 
  Dan 



Re: [julia-users] Re: Type parameter trouble (bug?)

2014-09-11 Thread Tim Holy
You can get triangular dispatch using the trick here:
https://github.com/JuliaLang/julia/issues/2345#issuecomment-54537633

--Tim

On Thursday, September 11, 2014 05:47:29 AM Magnus Lie Hetland wrote:
 Answering my own question here: I guess just adding a type declaration on
 the relevant parameter of the inner constructor is a way to go?



Re: [julia-users] Re: ANN: revamped Images based on Color, FixedPointNumbers

2014-09-11 Thread Tim Holy
Great to hear! I'll look forward to seeing the demo someday, and of course any 
comments you have about the API.

Best,
--Tim

On Thursday, September 11, 2014 01:19:11 PM Stefan Karpinski wrote:
 Btw, I got everything to work and it made a great demo. People love
 transformations of monkey faces.
  On Sep 9, 2014, at 2:44 PM, Stefan Karpinski ste...@karpinski.org wrote:
  
  Yes, but now I'm wrestling with Tk. Should have gotten this working way
  earlier. 
  On Tue, Sep 9, 2014 at 2:39 PM, Tim Holy tim.h...@gmail.com wrote:
  Is it fixed now?
  --Tim
  
  On Tuesday, September 09, 2014 02:18:34 PM Stefan Karpinski wrote:
   Ah, I was getting the same thing in the REPL, but that was because of
   TerminalExtensions, which uses the same display API, which seems to be
   broken.
   
   On Tue, Sep 9, 2014 at 2:11 PM, Tim Holy tim.h...@gmail.com wrote:
Missing method problem; I'm afraid that in these early days, there
are
simply
going to be some of these, because this is a huge expansion of the
type
hierarchy and I'm sure I didn't catch everything that everyone will
try.
(I
rarely use IJulia in part because I have a weird display bug that
seems to
affect only me---individual pixels are displayed as tiles with spaces
between
them---and I haven't yet succeeded in tracking it down.)

Should be fixed if you do Pkg.update(). I can't promise that whatever
larger-
scale thing you were trying will work, however, unless you give me a
more
complete example.

Best,
--Tim

On Tuesday, September 09, 2014 12:27:35 PM Stefan Karpinski wrote:
 I'm seeing this error:
 
 `mapinfo` has no method matching

mapinfo(::Type{RGB{UfixedBase{Uint8,8}}},

 ::Image{RGB{UfixedBase{Uint8,8}},2,Array{RGB{UfixedBase{Uint8,8}},2
 ::}})
  
  in base64 at base64.jl:125
  in display_dict at
  /Users/stefan/.julia/IJulia/src/execute_request.jl:34
 
 What versions of things are required to make this work? I wonder it
 this

is

 something obviously wrong. My system info:
 
 Julia Version 0.3.1-pre+48
 Commit 8c1b105 (2014-09-08 12:46 UTC)
 
 Platform Info:
   System: Darwin (x86_64-apple-darwin13.3.0)
   CPU: Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz
   WORD_SIZE: 64
   BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY
   Sandybridge)
   LAPACK: libopenblas
   LIBM: libopenlibm
   LLVM: libLLVM-3.3
 
 30 required packages:
  - ASCIIPlots0.0.2
  - DataArrays0.2.0
  - DataFrames0.5.7
  - DataStructures0.3.2
  - Debug 0.0.4
  - Distributions 0.5.4
  - Example   0.3.3+ master
  - Gadfly0.3.7
  - Gaston0.0.0  master
  - IJulia0.1.15
  - Images0.4.2
  - ImmutableArrays   0.0.6
  - Iterators 0.1.6
  - JSON  0.3.7
  - Morsel0.0.4
  - NLopt 0.1.3  master
  - ODBC  0.3.8+ master
  - PyCall0.4.8
  - PyPlot1.3.3
  - RDatasets 0.1.1
  - RNGTest   0.0.1+ 421b289d
  - SIUnits   0.0.2
  - SortingAlgorithms 0.0.1
  - SpecialMatrices   0.1.3
  - Stats 0.1.0
  - TerminalExtensions0.0.2
  - TestImages0.0.5
  - TimeSeries0.4.5
  - Winston   0.11.4
  - ZMQ   0.1.13
 
 38 additional packages:
  - ArrayViews0.4.6
  - BinDeps   0.3.5
  - Cairo 0.2.17
  - Cartesian 0.3.0
  - Codecs0.1.2
  - Color 0.3.7
  - Compose   0.3.7
  - Contour   0.0.4
  - Dates 0.3.1
  - Datetime  0.1.7
  - Distances 0.1.1
  - FixedPointNumbers 0.0.4
  - GZip  0.2.13
  - GnuTLS0.0.1
  - Hexagons  0.0.2
  - Homebrew  0.1.10
  - HttpCommon0.0.6
  - HttpParser0.0.9
  - HttpServer0.0.8
  - IniFile   0.2.3
  - KernelDensity 0.0.2
  - LibTrading0.0.1   

[julia-users] Re: Array Performance

2014-09-11 Thread Steven G. Johnson
On Wednesday, September 10, 2014 10:37:30 PM UTC-4, Jimmie Houchin wrote:

 It is very nice to reduce the number of times dropping down into C/C++ 
 will be required. It is required any time you need to connect to a C/C++ 
 library. 


Actually, it's never required to drop down to C just to call a C library; 
you can do that quite comfortably from Julia using ccall, without writing a 
single line of C code.   Calling C++ is currently more tricky (not just in 
Julia; this is true in other languages as well); you currently need C 
wrappers (much like what SWIG does).  However, there is a prototype package 
to call C++ that should become available in the Julia 0.4 timeframe (since 
it relies on some new language features slated to appear in Julia 0.4).


[julia-users] Re: ANN: ApproxFun v0.0.3 with general linear PDE solving on rectangles

2014-09-11 Thread Steven G. Johnson
This is great!

At this point, what are the major differences in functionality between 
ApproxFun and Chebfun?


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Steven G. Johnson


On Tuesday, September 9, 2014 1:36:08 PM UTC-4, Ross Boylan wrote:

 How would documentation handle type information for the arguments to a 
 method?  There are 3 possible sources: the comments, the text of the 
 function arguments (e.g. someArg::FooType), and the compiler. 


Also handled by my proposal.Documentation that is specific to the types 
of the arguments would be attached to the Method object in Julia, and 
Method objects include information about the argument types etc.   
 (Documentation that is generic to all methods of a particular function 
would be attached to the Function object).

I really think that embedding documentation in comments is a mistake. 
 Documentation needs to be a part of the language, included in a 
semantically meaningful way, not an add-on that is semantically meaningless 
(comments). 


Re: [julia-users] Re: How to build Julia in a portable way (for compute farm deployment)?

2014-09-11 Thread Elliot Saba
Your approach is correct, unfortunately our Makefiles are not yet smart
enough https://github.com/JuliaLang/julia/issues/8312 to set
OPENBLAS_DYNAMIC_ARCH=0 if you have overridden OPENBLAS_TARGET_ARCH, so you
need to set that as well in order for your OPENBLAS_TARGET_ARCH flag to
have any meaning.

Anything you learn about this topic that is not contained within
DISTRIBUTING.md should be in there, so for example this little nugget of
advice should probably go in there along with anything else you've
struggled to figure out.  Modifications to that file are welcome, just send
a pull request and ping @staticfloat so I'll check it out.  That file
should be the repository of information regarding these topics, but it's
likely out of date since it's been a while since it was written.
-E


[julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Nima Dehghani
hi,
I update julia packages on my Osx. After the update, I got an error about 
building zmq and nettle...it could not build them again. So, I removed 
.julia directory and re-installed from scratch and noticed that when I add 
IJulia, during its installation, it reaches the build of zmq and nettle and 
can not do it. 

INFO: Building Nettle

===[ ERROR: Nettle 
]


ccall: could not find function jl_uv_dlopen

while loading /Users/nima/.julia/v0.3/Nettle/deps/build.jl, in expression 
starting on line 38




INFO: Building ZMQ

=[ ERROR: ZMQ 
]=


ccall: could not find function jl_uv_dlopen

while loading /Users/nima/.julia/v0.3/ZMQ/deps/build.jl, in expression 
starting on line 21





line 38 and line 21 are both calling BinDeps:

@BinDeps.install [:nettle = :nettle]
@BinDeps.install [:zmq = :zmq]


what is jl_uv_dlopen? why it can not be found while I have BinDeps?
any ideas?

Cheers
-n

ps. this is the output of C library links:

~ nima$ otool -L $(which curl)

/usr/bin/curl:

/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 
8.0.0)

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
1197.1.1)

~ nima$ otool -L 
/Applications/Julia-0.3.0.app/Contents/Resources/julia/libexec/git-core/git-remote-https

/Applications/Julia-0.3.0.app/Contents/Resources/julia/libexec/git-core/git-remote-https:

/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)

/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 
7.0.0)

/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current 
version 50.0.0)

/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 
8.0.0)

/usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 
7.2.0)

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
1197.1.1)



Re: [julia-users] Re: BeagleBone Black

2014-09-11 Thread Steve Kelly
Viral, I started the build on our BBB on master. We are running Debian sid
with the stock BBB
 kernel. I tried running the build with the stock arm-make3 branch on
Monday and the LLVM build failed. I tried to use the system 3.5 but that
failed as well.

Are you using Clang or GCC?

On Thu, Sep 11, 2014 at 8:09 AM, Viral Shah vi...@mayin.org wrote:

 Could you try building master on the BBB again? It should hopefully have a
 comparable CPU as the Chromebook. It also helps if it is running Ubuntu, to
 install various dependencies to cut down the build time.

 -viral


 On Thursday, September 4, 2014 11:14:18 AM UTC+5:30, Steve Kelly wrote:

 I can confirm the arm-make3 branch does not build on the BBB. My company
 is interested in getting Julia on ARM. I think the biggest issue is that
 ubiquitous ARM devices are poor for building software quickly. Also with
 Red Hat and possibly Amazon entering the ARM server space this will become
 more feasible in the next year.


 On Thu, Sep 4, 2014 at 1:01 AM, Viral Shah vi...@mayin.org wrote:

 See the arm-make3 branch. I have an ARM chromebook, and it currently
 crashes in building the system image. I haven't been able to look into this
 further. I am guessing we will be ready in the 0.5 timeframe.

 If someone does want to try their hand at the ARM port, I can set up ssh
 on my chromebook.

 -viral


 On Wednesday, September 3, 2014 7:05:35 PM UTC-7, 2Cubed wrote:

 I would love to get Julia and/or IJulia up and running on my BeagleBone
 Black, but it seems that Julia is currently x86-specific.  Any idea when it
 will be available for ARM?





Re: [julia-users] Re: BeagleBone Black

2014-09-11 Thread Viral Shah
I am using GCC 4.8 and building LLVM 3.5 as part of the build.

-viral
On 11 Sep 2014 21:21, Steve Kelly kd2...@gmail.com wrote:

 Viral, I started the build on our BBB on master. We are running Debian sid
 with the stock BBB
  kernel. I tried running the build with the stock arm-make3 branch on
 Monday and the LLVM build failed. I tried to use the system 3.5 but that
 failed as well.

 Are you using Clang or GCC?

 On Thu, Sep 11, 2014 at 8:09 AM, Viral Shah vi...@mayin.org wrote:

 Could you try building master on the BBB again? It should hopefully have
 a comparable CPU as the Chromebook. It also helps if it is running Ubuntu,
 to install various dependencies to cut down the build time.

 -viral


 On Thursday, September 4, 2014 11:14:18 AM UTC+5:30, Steve Kelly wrote:

 I can confirm the arm-make3 branch does not build on the BBB. My company
 is interested in getting Julia on ARM. I think the biggest issue is that
 ubiquitous ARM devices are poor for building software quickly. Also with
 Red Hat and possibly Amazon entering the ARM server space this will become
 more feasible in the next year.


 On Thu, Sep 4, 2014 at 1:01 AM, Viral Shah vi...@mayin.org wrote:

 See the arm-make3 branch. I have an ARM chromebook, and it currently
 crashes in building the system image. I haven't been able to look into this
 further. I am guessing we will be ready in the 0.5 timeframe.

 If someone does want to try their hand at the ARM port, I can set up
 ssh on my chromebook.

 -viral


 On Wednesday, September 3, 2014 7:05:35 PM UTC-7, 2Cubed wrote:

 I would love to get Julia and/or IJulia up and running on my
 BeagleBone Black, but it seems that Julia is currently x86-specific.  Any
 idea when it will be available for ARM?






Re: [julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Keno Fischer
You probably have a version of julia that is  0.2.1 but  0.3, please
update to 0.3.

On Thu, Sep 11, 2014 at 11:14 AM, Nima Dehghani nimadehgh...@gmail.com wrote:
 hi,
 I update julia packages on my Osx. After the update, I got an error about
 building zmq and nettle...it could not build them again. So, I removed
 .julia directory and re-installed from scratch and noticed that when I add
 IJulia, during its installation, it reaches the build of zmq and nettle and
 can not do it.

 INFO: Building Nettle

 ===[ ERROR: Nettle
 ]


 ccall: could not find function jl_uv_dlopen

 while loading /Users/nima/.julia/v0.3/Nettle/deps/build.jl, in expression
 starting on line 38


 

 INFO: Building ZMQ

 =[ ERROR: ZMQ
 ]=


 ccall: could not find function jl_uv_dlopen

 while loading /Users/nima/.julia/v0.3/ZMQ/deps/build.jl, in expression
 starting on line 21


 



 line 38 and line 21 are both calling BinDeps:

 @BinDeps.install [:nettle = :nettle]
 @BinDeps.install [:zmq = :zmq]


 what is jl_uv_dlopen? why it can not be found while I have BinDeps?
 any ideas?

 Cheers
 -n

 ps. this is the output of C library links:

 ~ nima$ otool -L $(which curl)

 /usr/bin/curl:

 /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version
 8.0.0)

 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)

 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 1197.1.1)

 ~ nima$ otool -L
 /Applications/Julia-0.3.0.app/Contents/Resources/julia/libexec/git-core/git-remote-https

 /Applications/Julia-0.3.0.app/Contents/Resources/julia/libexec/git-core/git-remote-https:

 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)

 /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version
 7.0.0)

 /usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version
 50.0.0)

 /usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version
 8.0.0)

 /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version
 7.2.0)

 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
 1197.1.1)




Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Ivar Nesje
If code in a comment has side effects, the whole thing seems like a very 
bad idea, because code that was commented out, might be executed.

kl. 18:12:44 UTC+2 torsdag 11. september 2014 skrev Rafael Fourquet 
følgende:


 Then one could use the existing Julia syntax for substituting values into 
 the documentation, like:

 # This is a comment. 1 + 2 = $(1 + 2)


 I don't have a strong opinion on this topic, but I really don't understand 
 why this is better than using directly:

 @doc This is a doc string: 1 + 2 = $(1+2)

 What is lost when using a string compared to comments?



Re: [julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Keno Fischer
Hmm, that's pretty bad.

Elliot, any idea what's going on?

On Thu, Sep 11, 2014 at 12:19 PM, Nima Dehghani nimadehgh...@gmail.com wrote:
 Keno, it is the latest version that I installed and caused the issue.  This
 one:
 https://s3.amazonaws.com/julialang/bin/osx/x64/0.3/julia-0.3.0-osx10.7+.dmg

 On Thursday, September 11, 2014 12:10:58 PM UTC-4, Keno Fischer wrote:

 You probably have a version of julia that is  0.2.1 but  0.3, please
 update to 0.3.




Re: [julia-users] Re: BeagleBone Black

2014-09-11 Thread Steve Kelly
Okay I am on GCC 4.9. I will try to get the build running on Wheezy as well.

On Thu, Sep 11, 2014 at 12:02 PM, Viral Shah vi...@mayin.org wrote:

 I am using GCC 4.8 and building LLVM 3.5 as part of the build.

 -viral
 On 11 Sep 2014 21:21, Steve Kelly kd2...@gmail.com wrote:

 Viral, I started the build on our BBB on master. We are running Debian
 sid with the stock BBB
  kernel. I tried running the build with the stock arm-make3 branch on
 Monday and the LLVM build failed. I tried to use the system 3.5 but that
 failed as well.

 Are you using Clang or GCC?

 On Thu, Sep 11, 2014 at 8:09 AM, Viral Shah vi...@mayin.org wrote:

 Could you try building master on the BBB again? It should hopefully have
 a comparable CPU as the Chromebook. It also helps if it is running Ubuntu,
 to install various dependencies to cut down the build time.

 -viral


 On Thursday, September 4, 2014 11:14:18 AM UTC+5:30, Steve Kelly wrote:

 I can confirm the arm-make3 branch does not build on the BBB. My
 company is interested in getting Julia on ARM. I think the biggest issue is
 that ubiquitous ARM devices are poor for building software quickly. Also
 with Red Hat and possibly Amazon entering the ARM server space this will
 become more feasible in the next year.


 On Thu, Sep 4, 2014 at 1:01 AM, Viral Shah vi...@mayin.org wrote:

 See the arm-make3 branch. I have an ARM chromebook, and it currently
 crashes in building the system image. I haven't been able to look into 
 this
 further. I am guessing we will be ready in the 0.5 timeframe.

 If someone does want to try their hand at the ARM port, I can set up
 ssh on my chromebook.

 -viral


 On Wednesday, September 3, 2014 7:05:35 PM UTC-7, 2Cubed wrote:

 I would love to get Julia and/or IJulia up and running on my
 BeagleBone Black, but it seems that Julia is currently x86-specific.  Any
 idea when it will be available for ARM?






Re: [julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Nima Dehghani
Keno, it is the latest version that I installed and caused the issue.  This 
one:
https://s3.amazonaws.com/julialang/bin/osx/x64/0.3/julia-0.3.0-osx10.7+.dmg 

On Thursday, September 11, 2014 12:10:58 PM UTC-4, Keno Fischer wrote:

 You probably have a version of julia that is  0.2.1 but  0.3, please 
 update to 0.3. 



[julia-users] Re: Array Performance

2014-09-11 Thread Jimmie Houchin



On 09/11/2014 09:12 AM, Steven G. Johnson wrote:

On Wednesday, September 10, 2014 10:37:30 PM UTC-4, Jimmie Houchin wrote:

It is very nice to reduce the number of times dropping down into C/C++
will be required. It is required any time you need to connect to a
C/C++
library.


Actually, it's never required to drop down to C just to call a C
library; you can do that quite comfortably from Julia using ccall,
without writing a single line of C code.   Calling C++ is currently more
tricky (not just in Julia; this is true in other languages as well); you
currently need C wrappers (much like what SWIG does).  However, there is
a prototype package to call C++ that should become available in the
Julia 0.4 timeframe (since it relies on some new language features
slated to appear in Julia 0.4).


You are correct. I expressed that badly.

I do very much look forward to the ability to call C++ natively. I have 
some C++ libraries that I want to use. One has a C wrapper and one does 
not. It will be nice to not require a C wrapper.


Jimmie



Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Jason

 I don't have a strong opinion on this topic, but I really don't understand
 why this is better than using directly:

 @doc This is a doc string: 1 + 2 = $(1+2)

 What is lost when using a string compared to comments?


The primary difference to me is the ease of expansion that comes along with
comments. Ie, if there is already one line of comments, I just hit newline
in my editor, and it automatically adds a new comment leader and I can add
an additional thought to the comment. Whereas with strings and markup, I
have to go and tidy up the ending quotations.

But if we're proposing modifying the parser anyways, then we could get the
best of both worlds with a* doc* keyword that is line terminated or block
terminated just like the let keyword:

doc begin
  lots of documentation, blah
  blah
end


also one lined:

doc Foo is a function with 


and with optional arguments for specifying documentation type:

doc rst Using some restructuredtext here.


Re: [julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Nima Dehghani
actually, there was a wrong symbolic link to prerelease v0.3 in my sys 
aliases that fixed the issue...now it installed fine. Thx

On Thursday, September 11, 2014 12:24:03 PM UTC-4, Keno Fischer wrote:

 Hmm, that's pretty bad. 



Re: [julia-users] issue with Ijulia/BinDep after Pkg.update()

2014-09-11 Thread Elliot Saba
Cool, glad it got worked out for you!
-E

On Thu, Sep 11, 2014 at 9:41 AM, Nima Dehghani nimadehgh...@gmail.com
wrote:

 actually, there was a wrong symbolic link to prerelease v0.3 in my sys
 aliases that fixed the issue...now it installed fine. Thx

 On Thursday, September 11, 2014 12:24:03 PM UTC-4, Keno Fischer wrote:

 Hmm, that's pretty bad.




[julia-users] create a matrix dynamically with Julia

2014-09-11 Thread Charles Novaes de Santana
Dear all,

I would like to create dynamically a matrix with two columns and N rows
(where N can be any number between 0 and 1000). I thought I could do it by
using the function cat, but I am facing some problems with this.

My code:
A=[];
(...)
A=cat(1,A,[1 2]);

Is it a good way to create a matrix without defining its dimension a
priori?

I was expecting that A would be a matrix 1x2, but I got the following error
message:

ERROR: mismatch in dimension 2
 in cat_t at abstractarray.jl:689
 in cat at abstractarray.jl:666

I am using julia Version 0.4.0-dev+523 (2014-09-10 15:51 UTC)

Thank you in advance for any comment,

Charles

-- 
Um axé! :)

--
Charles Novaes de Santana, PhD
http://www.imedea.uib-csic.es/~charles


[julia-users] Re: create a matrix dynamically with Julia

2014-09-11 Thread Douglas Bates
The short answer is vcat, as in

julia A = Array(Int,(0,2))
0x2 Array{Int64,2}

julia vcat(A,[1,2]')
1x2 Array{Int64,2}:
 1  2

Note that the ' is important as it cause the column vector [1,2] to be 
reshaped into a 1 by 2 matrix.

You may find it more effective to create the columns separately using push! 
and then use hcat to create the matrix when you are done, if this is 
feasible.  Using push! to append a new element onto the end of a vector is 
likely to be more efficient than vcat'ing matrices.

julia c1 = Int[]; c2 = Int[]
0-element Array{Int64,1}

julia for i in 1:10
  push!(c1,i)
  push!(c2,abs2(i))
   end

julia hcat(c1,c2)
10x2 Array{Int64,2}:
  11
  24
  39
  4   16
  5   25
  6   36
  7   49
  8   64
  9   81
 10  100



On Thursday, September 11, 2014 11:54:45 AM UTC-5, Charles Santana wrote:


 Dear all,

 I would like to create dynamically a matrix with two columns and N rows 
 (where N can be any number between 0 and 1000). I thought I could do it by 
 using the function cat, but I am facing some problems with this.

 My code:
 A=[];
 (...)
 A=cat(1,A,[1 2]);

 Is it a good way to create a matrix without defining its dimension a 
 priori? 

 I was expecting that A would be a matrix 1x2, but I got the following 
 error message:

 ERROR: mismatch in dimension 2
  in cat_t at abstractarray.jl:689
  in cat at abstractarray.jl:666

 I am using julia Version 0.4.0-dev+523 (2014-09-10 15:51 UTC)

 Thank you in advance for any comment,

 Charles

 -- 
 Um axé! :)

 --
 Charles Novaes de Santana, PhD
 http://www.imedea.uib-csic.es/~charles
  


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Steven G. Johnson



 The primary difference to me is the ease of expansion that comes along 
 with comments. Ie, if there is already one line of comments, I just hit 
 newline in my editor, and it automatically adds a new comment leader and I 
 can add an additional thought to the comment. Whereas with strings and 
 markup, I have to go and tidy up the ending quotations.


Given triple-quoted string literals, I don't see what the problem is.   Why 
is it hard to insert a new line in:

   doc 
   blah blah
blah
   
   function foo(...)
 ...
   end

 

 But if we're proposing modifying the parser anyways, then we could get the 
 best of both worlds with a* doc* keyword that is line terminated or block 
 terminated just like the let keyword:

 doc begin
   lots of documentation, blah
   blah
 end


Why is begin...end better than  ?
 


[julia-users] What wrong , help ;0

2014-09-11 Thread paul analyst
julia i
2
julia pp=[];
julia target=25;
julia for i in efy;
   var_name = symbol(p * string(i));
   pp=vcat(pp,@eval $var_name[1:target]);
   #println(sum(@eval $var_name[1:target]))
   end;
ERROR: p2 not defined
 in anonymous at no file:3

julia

Paul


[julia-users] Re: What wrong , help ;0

2014-09-11 Thread Jake Bolewski
what is efy?  Your example is not reproducible. 

On Thursday, September 11, 2014 2:22:31 PM UTC-4, paul analyst wrote:

 julia i
 2
 julia pp=[];
 julia target=25;
 julia for i in efy;
var_name = symbol(p * string(i));
pp=vcat(pp,@eval $var_name[1:target]);
#println(sum(@eval $var_name[1:target]))
end;
 ERROR: p2 not defined
  in anonymous at no file:3

 julia

 Paul



Re: [julia-users] 0.4 Roadmap for DataFrames, DataArrays, etc...

2014-09-11 Thread John Myles White
Viral,

Can you give specific examples where NA caused troubles for you? Were they 
performance problems or something else?

If we get multi-theading really solid halfway to 0.4, we can probably use it in 
some of the NullableArrays code to speed up operations on vectors.

 -- John

On Sep 11, 2014, at 5:05 AM, Viral Shah vi...@mayin.org wrote:

 The state of NA has always been where I stop using DataFrames - and I think 
 this roadmap is perfect to coincide with the 0.4 release.
 
 What are your thoughts on multi-threading, should we be able to land that in 
 0.4? Perhaps we can speed up some easily parallelizable operations.
 
 -viral
 
 On Sunday, September 7, 2014 11:47:44 AM UTC+5:30, John Myles White wrote:
 Yeah, that’s a way more ambitious project. That’ll take at least a year to 
 make any progress at all. Before I could even begin, I need to finish DBI and 
 then build up something SQLAlchemy for Julia.
 
 Thankfully, the 0.4 changes should put DataFrames in a good state that we can 
 depend on for some time into the future.
 
  — John
 
 On Sep 6, 2014, at 11:15 PM, Iain Dunning iaindunn...@gmail.com wrote:
 
 I saw on some list/issue you were thinking of working on a more fresh 
 approach to the whole data storage situation - is that post 0.4?
 
 On Saturday, September 6, 2014 10:30:04 PM UTC-4, John Myles White wrote:
 I am hoping that the 0.4 release of Julia will coincide with a major cleanup 
 of the Data* world. I wrote up a very high level overview of my goals here: 
 https://gist.github.com/johnmyleswhite/ad5305ecaa9de01e317e 
 
 There’s still more work to do to flesh out these ideas, but the basic 
 principles are pretty close to finalized. There’s also a rough draft of much 
 of the core functionality we’ll need to add to support this roadmap. 
 
 I wanted to give everyone a heads up so that people understand where the 
 Data* packages are headed. The big idea is that we’ll be pushing more work 
 out into the type system, which will give substantial performance 
 improvements. 
 
  — John 
 
 



Re: [julia-users] 0.4 Roadmap for DataFrames, DataArrays, etc...

2014-09-11 Thread Viral Shah
I don't have the codes handy, as they would usually involve trying to play
around with data in csv files. I have run into performance problems for the
most part. However, I have at times also run into cases where I felt things
were not as expressive as I would have liked. These cases are probably
because of my lack of understanding - but I will make sure I collect them
and ask the next time.

On Thu, Sep 11, 2014 at 11:43 AM, John Myles White johnmyleswh...@gmail.com
 wrote:

 Viral,

 Can you give specific examples where NA caused troubles for you? Were they
 performance problems or something else?

 If we get multi-theading really solid halfway to 0.4, we can probably use
 it in some of the NullableArrays code to speed up operations on vectors.

  -- John


 On Sep 11, 2014, at 5:05 AM, Viral Shah vi...@mayin.org wrote:

 The state of NA has always been where I stop using DataFrames - and I
 think this roadmap is perfect to coincide with the 0.4 release.

 What are your thoughts on multi-threading, should we be able to land that
 in 0.4? Perhaps we can speed up some easily parallelizable operations.

 -viral

 On Sunday, September 7, 2014 11:47:44 AM UTC+5:30, John Myles White wrote:

 Yeah, that’s a way more ambitious project. That’ll take at least a year
 to make any progress at all. Before I could even begin, I need to finish
 DBI and then build up something SQLAlchemy for Julia.

 Thankfully, the 0.4 changes should put DataFrames in a good state that we
 can depend on for some time into the future.

  — John

 On Sep 6, 2014, at 11:15 PM, Iain Dunning iaindunn...@gmail.com wrote:

 I saw on some list/issue you were thinking of working on a more fresh
 approach to the whole data storage situation - is that post 0.4?

 On Saturday, September 6, 2014 10:30:04 PM UTC-4, John Myles White wrote:

 I am hoping that the 0.4 release of Julia will coincide with a major
 cleanup of the Data* world. I wrote up a very high level overview of my
 goals here: https://gist.github.com/johnmyleswhite/ad5305ecaa9de01e317e

 There’s still more work to do to flesh out these ideas, but the basic
 principles are pretty close to finalized. There’s also a rough draft of
 much of the core functionality we’ll need to add to support this roadmap.

 I wanted to give everyone a heads up so that people understand where the
 Data* packages are headed. The big idea is that we’ll be pushing more work
 out into the type system, which will give substantial performance
 improvements.

  — John






-- 
-viral


[julia-users] Pull latex.jl out from PyPlot

2014-09-11 Thread Tim Wheeler
Hello Julia-Users!

I have found the LaTeX code in latex.jl from PyPlot pretty useful.
I imagine anyone working with LaTeX from Julia would have a need for it, 
but not everyone needs PyPlot at the same time. Is anyone considering 
making latex.jl a standalone LaTeX package so we don't have to rely on 
PyPlot being installed?


[julia-users] Re: Image acquisition

2014-09-11 Thread Simon Danisch
Very nice library!!
I made a little example for the usage of VideoIO with GLPlot.

On my PC, its a lot faster than VideoIO.viewcam(), and you can use real 
time filterig
https://gist.github.com/SimonDanisch/fa3993176a015215092c
Hope you like it!

Best,
Simon

Am Montag, 8. September 2014 18:06:45 UTC+2 schrieb Miguel Belbut Gaspar:

 Hi,

 Has anyone found a way to do image acquisition (from a webcam or some kind 
 of digital camera) directly in Julia? Or should we communicate directly 
 with some library/dll to achieve that?

 Miguel



[julia-users] Comprehension Produces Any

2014-09-11 Thread Christoph Ortner

Here is a short code snippet, that got me puzzled. 
[Julia Version 0.3.0, Commit 7681878* (2014-08-20 20:43 UTC), Darwin 
(x86_64-apple-darwin13.3.0)]



a = rand(3,3)

b = rand(3,3)

println(typeof(

[a[i,j]*b[i,j] for i = 1:3, j=1:3]))

println(typeof(a .* b))

Array{Any,2}
Array{Float64,2}



Should Julia not create the same output in both cases? Is this a bug or 
intended?


 --Christoph

Julia Version 0.3.0
Commit 7681878* (2014-08-20 20:43 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)





Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Jason

 Why is begin...end better than  ?


For block documentation they are equivalent, but the triple quotes are
heavy for lots of single line comments. Eg: look at the average comment
length of this randomly chosen Haskell source file
http://hackage.haskell.org/package/vector-0.6.0.2/docs/src/Data-Vector.html
.

But in the end, it's just bikeshedding over style at this point. It looks
like most of us are in agreement about:

   1. Coupling the documentation to the AST
   2. Documentation being markup agnostic/flexible

Now it's just a matter of syntax. Which ironically can sometimes derail
entire language features for years at a time. Eg: better record syntax
https://ghc.haskell.org/trac/ghc/wiki/Records in Haskell has been in the
need of the right syntax (although semantics are a hangup there as well)
for many years.

Perhaps we need a temporary BDFL
http://www.wikiwand.com/en/Benevolent_dictator_for_life for Julia to just
make an arbitrary (good) decision and get us all into the glorious days of
documented packages.


Re: [julia-users] Re: What wrong , help ;0

2014-09-11 Thread Paul Analyst

julia efy
4x1 Array{Int64,2}:
  1
  7
  8
 10

W dniu 2014-09-11 o 20:27, Jake Bolewski pisze:

what is efy?  Your example is not reproducible.

On Thursday, September 11, 2014 2:22:31 PM UTC-4, paul analyst wrote:

julia i
2
julia pp=[];
julia target=25;
julia for i in efy;
   var_name = symbol(p * string(i));
   pp=vcat(pp,@eval $var_name[1:target]);
   #println(sum(@eval $var_name[1:target]))
   end;
ERROR: p2 not defined
 in anonymous at no file:3

julia

Paul





Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
If I understand correctly, Docile.jl is a macro-based implementation of
SGJ's suggestion, right? So if we're in agreement about non-comment-based
documentation, we could start using that now, and later switch from @doc
to the keyword doc when it's implemented.

Are any packages documented with Docile? That would be a good illustration
of how well this works.

-- Leah

On Thu, Sep 11, 2014 at 3:10 PM, Jason ja...@jasonknight.us wrote:

 Why is begin...end better than  ?


 For block documentation they are equivalent, but the triple quotes are
 heavy for lots of single line comments. Eg: look at the average comment
 length of this randomly chosen Haskell source file
 http://hackage.haskell.org/package/vector-0.6.0.2/docs/src/Data-Vector.html
 .

 But in the end, it's just bikeshedding over style at this point. It looks
 like most of us are in agreement about:

1. Coupling the documentation to the AST
2. Documentation being markup agnostic/flexible

 Now it's just a matter of syntax. Which ironically can sometimes derail
 entire language features for years at a time. Eg: better record syntax
 https://ghc.haskell.org/trac/ghc/wiki/Records in Haskell has been in
 the need of the right syntax (although semantics are a hangup there as
 well) for many years.

 Perhaps we need a temporary BDFL
 http://www.wikiwand.com/en/Benevolent_dictator_for_life for Julia to
 just make an arbitrary (good) decision and get us all into the glorious
 days of documented packages.



Re: [julia-users] Re: What wrong , help ;0

2014-09-11 Thread Leah Hanson
do you have a variable named p2?

On Thu, Sep 11, 2014 at 3:12 PM, Paul Analyst paul.anal...@mail.com wrote:

  julia efy
 4x1 Array{Int64,2}:
   1
   7
   8
  10

 W dniu 2014-09-11 o 20:27, Jake Bolewski pisze:

 what is efy?  Your example is not reproducible.

 On Thursday, September 11, 2014 2:22:31 PM UTC-4, paul analyst wrote:

 julia i
 2
 julia pp=[];
 julia target=25;
 julia for i in efy;
var_name = symbol(p * string(i));
pp=vcat(pp,@eval $var_name[1:target]);
#println(sum(@eval $var_name[1:target]))
end;
 ERROR: p2 not defined
  in anonymous at no file:3

 julia

 Paul





[julia-users] How to manage local, propretary packages

2014-09-11 Thread Peter Simon
I've introduced several packages at work for my coworkers' use.  I expect 
more to be added in the future, both from myself and other Julia users. 
 These packages must be considered proprietary to our company, and so 
cannot be hosted on GitHub nor listed in the GitHub-hosted METADATA.  Some 
of these local packages depend on standard, publicly available packages, 
which are listed in their REQUIRE files.  I have been telling others to use 
`Pkg.clone(...)` for the local packages, which works well for ensuring that 
the users also obtain the dependent packages automatically (via the package 
manager), but there is a problem.  The package manager does not seem to 
keep track of the version number of a cloned package.  For example, if I 
tag a package as 0.0.2, clone it, then do a `Pkg.installed` , the package 
manager reports that the version is 0.0.0-.  Nor does the package manager 
automatically update the package when a new version is available and the 
user types `Pkg.upate()`.   Is there a better way to manage the local 
packages?

Thanks,
--Peter


Re: [julia-users] How to manage local, propretary packages

2014-09-11 Thread Keno Fischer
The best thing I can think of is to have a company-local METADATA that
you periodically update withe METADATA from GitHub.

On Thu, Sep 11, 2014 at 4:34 PM, Peter Simon psimon0...@gmail.com wrote:
 I've introduced several packages at work for my coworkers' use.  I expect
 more to be added in the future, both from myself and other Julia users.
 These packages must be considered proprietary to our company, and so cannot
 be hosted on GitHub nor listed in the GitHub-hosted METADATA.  Some of these
 local packages depend on standard, publicly available packages, which are
 listed in their REQUIRE files.  I have been telling others to use
 `Pkg.clone(...)` for the local packages, which works well for ensuring that
 the users also obtain the dependent packages automatically (via the package
 manager), but there is a problem.  The package manager does not seem to keep
 track of the version number of a cloned package.  For example, if I tag a
 package as 0.0.2, clone it, then do a `Pkg.installed` , the package manager
 reports that the version is 0.0.0-.  Nor does the package manager
 automatically update the package when a new version is available and the
 user types `Pkg.upate()`.   Is there a better way to manage the local
 packages?

 Thanks,
 --Peter


RE: [julia-users] How to manage local, propretary packages

2014-09-11 Thread Peter Simon
Thanks for the suggestion, Keno.  I have a couple of follow-on questions:

1.  How do I make the package manager attend to the local METADATA file rather 
than try to grab/update it from GitHub?  Would I edit the definition of 
DEFAULT_META in pkg.jl?  Does this require recompiling Julia?
2.  Some the local Julia installations are on users' individual PC's (running 
Windows).  Will this strategy work for them as well as the Linux users?  For 
the latter, I am the Julia maintainer, so I could make the necessary changes, 
once I understand them.

Thanks
--Peter

 -Original Message-
 From: julia-users@googlegroups.com [mailto:julia-
 us...@googlegroups.com] On Behalf Of Keno Fischer
 Sent: Thursday, September 11, 2014 1:36 PM
 To: julia-users@googlegroups.com
 Subject: Re: [julia-users] How to manage local, propretary packages
 
 The best thing I can think of is to have a company-local METADATA that you
 periodically update withe METADATA from GitHub.
 
 On Thu, Sep 11, 2014 at 4:34 PM, Peter Simon psimon0...@gmail.com
 wrote:
  I've introduced several packages at work for my coworkers' use.  I
  expect more to be added in the future, both from myself and other Julia
 users.
  These packages must be considered proprietary to our company, and so
  cannot be hosted on GitHub nor listed in the GitHub-hosted METADATA.
  Some of these local packages depend on standard, publicly available
  packages, which are listed in their REQUIRE files.  I have been
  telling others to use `Pkg.clone(...)` for the local packages, which
  works well for ensuring that the users also obtain the dependent
  packages automatically (via the package manager), but there is a
  problem.  The package manager does not seem to keep track of the
  version number of a cloned package.  For example, if I tag a package
  as 0.0.2, clone it, then do a `Pkg.installed` , the package manager
  reports that the version is 0.0.0-.  Nor does the package manager
 automatically update the package when a new version is available and the
  user types `Pkg.upate()`.   Is there a better way to manage the local
  packages?
 
  Thanks,
  --Peter



Re: [julia-users] How to manage local, propretary packages

2014-09-11 Thread Keno Fischer
It's just a question of calling Pkg.init(YOUR URL HERE) before doing
anything else. Of course, if you want to distribute custom binaries,
you can edit DEFAULT_META. I don't see any problems with windows.

On Thu, Sep 11, 2014 at 4:48 PM, Peter Simon psimon0...@gmail.com wrote:
 Thanks for the suggestion, Keno.  I have a couple of follow-on questions:

 1.  How do I make the package manager attend to the local METADATA file 
 rather than try to grab/update it from GitHub?  Would I edit the definition 
 of DEFAULT_META in pkg.jl?  Does this require recompiling Julia?
 2.  Some the local Julia installations are on users' individual PC's (running 
 Windows).  Will this strategy work for them as well as the Linux users?  For 
 the latter, I am the Julia maintainer, so I could make the necessary changes, 
 once I understand them.

 Thanks
 --Peter

 -Original Message-
 From: julia-users@googlegroups.com [mailto:julia-
 us...@googlegroups.com] On Behalf Of Keno Fischer
 Sent: Thursday, September 11, 2014 1:36 PM
 To: julia-users@googlegroups.com
 Subject: Re: [julia-users] How to manage local, propretary packages

 The best thing I can think of is to have a company-local METADATA that you
 periodically update withe METADATA from GitHub.

 On Thu, Sep 11, 2014 at 4:34 PM, Peter Simon psimon0...@gmail.com
 wrote:
  I've introduced several packages at work for my coworkers' use.  I
  expect more to be added in the future, both from myself and other Julia
 users.
  These packages must be considered proprietary to our company, and so
  cannot be hosted on GitHub nor listed in the GitHub-hosted METADATA.
  Some of these local packages depend on standard, publicly available
  packages, which are listed in their REQUIRE files.  I have been
  telling others to use `Pkg.clone(...)` for the local packages, which
  works well for ensuring that the users also obtain the dependent
  packages automatically (via the package manager), but there is a
  problem.  The package manager does not seem to keep track of the
  version number of a cloned package.  For example, if I tag a package
  as 0.0.2, clone it, then do a `Pkg.installed` , the package manager
  reports that the version is 0.0.0-.  Nor does the package manager
 automatically update the package when a new version is available and the
  user types `Pkg.upate()`.   Is there a better way to manage the local
  packages?
 
  Thanks,
  --Peter



Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Tim Holy
I hadn't looked at Docile in a long time, and from the commit history clearly 
there has been a lot of recent development.

Based on a very brief look, I'd say it's so much better than what we (don't) 
have that, as long as Michael says he's committed to continuing its 
development, I'd favor merging it to base in the next 30 seconds or so.

Seriously. This has dragged on so long, let's go for it. Docile looks very 
good, and as we discover we need more features or changes in behavior, we can 
do it.

--Tim



On Thursday, September 11, 2014 03:17:45 PM Leah Hanson wrote:
 If I understand correctly, Docile.jl is a macro-based implementation of
 SGJ's suggestion, right? So if we're in agreement about non-comment-based
 documentation, we could start using that now, and later switch from @doc
 to the keyword doc when it's implemented.
 
 Are any packages documented with Docile? That would be a good illustration
 of how well this works.
 
 -- Leah
 
 On Thu, Sep 11, 2014 at 3:10 PM, Jason ja...@jasonknight.us wrote:
  Why is begin...end better than  ?
  
  
  For block documentation they are equivalent, but the triple quotes are
  heavy for lots of single line comments. Eg: look at the average comment
  length of this randomly chosen Haskell source file
  http://hackage.haskell.org/package/vector-0.6.0.2/docs/src/Data-Vector.ht
  ml .
  
  But in the end, it's just bikeshedding over style at this point. It looks
  
  like most of us are in agreement about:
 1. Coupling the documentation to the AST
 2. Documentation being markup agnostic/flexible
  
  Now it's just a matter of syntax. Which ironically can sometimes derail
  entire language features for years at a time. Eg: better record syntax
  https://ghc.haskell.org/trac/ghc/wiki/Records in Haskell has been in
  the need of the right syntax (although semantics are a hangup there as
  well) for many years.
  
  Perhaps we need a temporary BDFL
  http://www.wikiwand.com/en/Benevolent_dictator_for_life for Julia to
  just make an arbitrary (good) decision and get us all into the glorious
  days of documented packages.



RE: [julia-users] How to manage local, proprietary packages

2014-09-11 Thread Peter Simon
Ah!  I had a look at the source code for `Pkg.init` and see that its default 
first argument is DEFAULT_META, which is initialized to 
git://github.com/JuliaLang/METADATA.jl.  So `Pkg.init` is used to point the 
package manager to the global METAFILE package directory.  This is definitely 
not what I took away from the documentation, which reads:


help? Pkg.init
Base.Pkg.init()

   Initialize Pkg.dir() as a package directory. This will be done
   automatically when the JULIA_PKGDIR is not set and
   Pkg.dir() uses its default value.



This is the same as the online docs.  Since the documentation talks about 
`Pkg.dir()` I thought it was for establishing the local package repository 
location.  Looks like the documentation wrong/out of date?  

Thanks,
--Peter



Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Michael Hatherly
Docile.jl author here, 

When I began writing it had some Steven's ideas in mind from one of the 
earlier discussion here (or GitHub issues list perhaps).

I had initially though of following go's use of comments above code objects 
to document them, but that doesn't allow for interpolating data from the 
module into the docstrings, which I believe Stefan had suggested at some 
point. Doing this allows you to programmatically generate docstrings such 
as when generating functions using `for` and `@eval` loops. You wouldn't be 
able to do this with comment in their current form and I'd think it wise to 
just leave comment as they are.

I'd be very much in favour of a `doc` keyword rather than the current macro 
I'm using, but it's got me surprisingly far.

Docile is, for the most part, self-documenting. `@doc` itself can't be 
documented using `@doc` unfortunately, perhaps there's some way around 
that. Spencer Lyon mentioned recently his interest in using it for one of 
his own packages.

-- Mike


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Michael Hatherly
I am committed to continuing work on this, though other work can limit the 
amount of time I have. There's still some rough edges, and I'm not sure how 
to overcome some difficulties such as `@doc` not being able to document 
itself.

-- Mike


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
Could you manually add the `@doc` documentation to the _METDATA_ object?
The macro edits a variable, which you should be able to do outside the
macro as well, right?

-- Leah

On Thu, Sep 11, 2014 at 4:28 PM, Michael Hatherly michaelhathe...@gmail.com
 wrote:

 I am committed to continuing work on this, though other work can limit the
 amount of time I have. There's still some rough edges, and I'm not sure how
 to overcome some difficulties such as `@doc` not being able to document
 itself.

 -- Mike



[julia-users] Values vs. Bindings: making sense of things

2014-09-11 Thread Mohammed El-Beltagy
In a recent blog by John Myles White 
http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/
 
it was suggested that Julia make strong distinction  between values and 
binding. For example 

a = [1, 2, 3]

function foo!(a)
 a[1] = 10
 return
end
a


Would give an output 

3-element Array{Int64,1}:
 10
  2
  3

But subsequently running 
function bar!(a)
a = [1, 2]
return
end
a
would give an output of 

3-element Array{Int64,1}:
 10
  2
  3

The reason why the variable a was not changed in the case of boo!, but 
was changed in the case of foo! has to do with the fact values are the 
same their binding. 
However to illustrate that point, the examples given in the blog are quite 
erroneous. For example 
[1,2,3]==[1,2,3]
would yield an out of true, whereas the blog post indicated that is 
should be false. This the because the == operator unpacks the values in 
the binding and does and element wise comparison. 
A better was illustrate that problem is make use of julia's object_id 
function. For example 
a=[1,2,3]
@printf(Object ID in outerscope 0x%x\n, object_id(a))
function bar!(a)
@printf(Object ID in \!bar and before assignment 0x%x\n, object_id(a))
a = [1, 2]
@printf(Object ID in \!bar after assignment 0x%x\n, object_id(a))
   return
end
bar!(a)
@printf(Object ID in outerscope after \!bar is 0x%x\n, object_id(a))
a
The output will be

Object ID in outerscope 0xa19caeb70115d4f0
Object ID in !bar and before assignment 0xa19caeb70115d4f0
Object ID in !bar after assignment 0x782193112dfbbbd5
Object ID in outerscope after !bar is 0xa19caeb70115d4f0

Out[1]:

3-element Array{Int64,1}:
 1
 2
 3

This would mean the when calling a function in Julia the following is true:

   - The binding of the argument to the function can never change, though 
   the values of that binding might. 
   - The binding can be overridden locally in the scope of the function, 
   but that is only valid in inside the function's scope
   
A modification to the above code that does not attempt to override the 
original binding, shown below would not change the object id. 
a=[1,2,3]
@printf(Object ID in outerscope 0x%x\n, object_id(a))
function bar!(a)
@printf(Object ID in \!bar and before assignment 0x%x\n, object_id(a))
empty!(a)
push!(a,[1, 2]...)
@printf(Object ID in \!bar after assignment 0x%x\n, object_id(a))
   return
end
bar!(a)
@printf(Object ID in outerscope after \!bar is 0x%x\n, object_id(a))
a

Is this how julia handles values and bindings, or it there more to this 
picture?
 


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Michael Hatherly
I'm doing it using an internal macro `@docref` [1] to track the line number 
and then in `src/doc.jl` I store the documentation in `__METADATA__` along 
with the line and source file found using `@docref`. A bit hacky, but it's 
only for a couple of docs.

[1] 
https://github.com/MichaelHatherly/Docile.jl/blob/c82675d4a39932d1d378e954844018cefc091858/src/Docile.jl#L14-L17


Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Leah Hanson
Oh, I missed that. That's totally the approach I would take, and I don't
really see it as a problem to use a separate channel to document the
documentation functions/macros. It seems like a messiness related more to
bootstrapping (documenting using the system you're writing) rather than a
design problem.

I guess the need to document @doc goes away if it become the keyword doc,
since you would need some separate way to document keywords (if you were
going to do that) anyway.

-- Leah

On Thu, Sep 11, 2014 at 4:58 PM, Michael Hatherly michaelhathe...@gmail.com
 wrote:

 I'm doing it using an internal macro `@docref` [1] to track the line
 number and then in `src/doc.jl` I store the documentation in `__METADATA__`
 along with the line and source file found using `@docref`. A bit hacky, but
 it's only for a couple of docs.

 [1]
 https://github.com/MichaelHatherly/Docile.jl/blob/c82675d4a39932d1d378e954844018cefc091858/src/Docile.jl#L14-L17



Re: [julia-users] Does Julia have something similar to Python's documentation string?

2014-09-11 Thread Michael Hatherly
Yeah, that's how I had be rationalising it to myself, I'm glad it wasn't 
just me.

-- Mike


Re: [julia-users] Help needed with creating Julia package

2014-09-11 Thread Bill Hart
I had a go at making a preliminary package which should vaguely build on
Linux when using Nemo is run from within the src/ directory.

I checked this works on my machine at least.

I also checked that Pkg.clone(https://github.com/wbhart/nemo.git;) clones
the Nemo repository from within Julia. But this seems to only clone the
repository and doesn't appear to issue using Nemo as I had expected.

Also typing using Nemo manually says that it can't find Nemo. What
command to users have to issue to get using Nemo to actually do something?

Bill.



On 10 September 2014 16:26, Isaiah Norton isaiah.nor...@gmail.com wrote:


 This was what I thought of trying first. But I couldn't figure out how it
 worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.


 For Pkg manager purposes, the association will be created later (when you
 register the package).

 It also isn't clear where Julia creates the empty git repository. In the
 current directory? Or in some subdirectory of the Julia source tree?


 Under `$HOME/.julia/v0.3` (or v0.4 if you are on git master)

 For the most part I can just run configure, make, make install for now and
 set some library paths (if I can figure out what kind of system I am on).


 There are some macros to help with this: @osx, @linux, @unix (both), and
 @windows. There is also a variable called OS_NAME with a platform-specific
 value (:Windows, :Linux, etc.) See:

 http://docs.julialang.org/en/release-0.3/manual/calling-c-and-fortran-code/#handling-platform-variations



 On Wed, Sep 10, 2014 at 10:18 AM, Bill Hart goodwillh...@googlemail.com
 wrote:



 On Wednesday, 10 September 2014 15:57:56 UTC+2, Isaiah wrote:

 Is there documentation somewhere explaining how to do the latter? Or can
 someone help me with doing the latter?


 You could run `Pkg.generate(Nemo)` and then copy and commit (some of)
 the resulting files in your own Nemo git tree; there aren't very many.


 This was what I thought of trying first. But I couldn't figure out how it
 worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.

 It also isn't clear where Julia creates the empty git repository. In the
 current directory? Or in some subdirectory of the Julia source tree?


 I can't find any documentation explaining where to put the commands in a
 Pkg to actually git clone flint, build it, install it and set up paths for
 Nemo. Given the complexities of installing flint for the user, I'd like to
 have the Julia package manager do this automatically if at all possible.
 And I see it does seem to be possible. I just can't figure out how.


 The Pkg manager will look for a file called `MYPKG/deps/build.jl` and
 run that if it exists. That's just a Julia file, so you can do whatever you
 want there (shell out, etc.).


 Perfect. For the most part I can just run configure, make, make install
 for now and set some library paths (if I can figure out what kind of system
 I am on).

 Finding the Julia installation on the system in order to link against the
 gmp/mpfr might be slightly more difficult.


 One option is to use the BinDeps package which provides primitives for
 interacting with various package managers and build systems:

 https://github.com/JuliaLang/BinDeps.jl

 A very advanced and fully-developed usage example can be found in the
 Cairo package, which has Autotools, Apt, Yum, and several other targets:

 https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl

 There are a number of other examples to draw from. Hopefully the above
 links will give you a sense of where to start. I can help out on Linux and
 Windows (@ihnorton on github).


 Thanks.

 Bill.




 On Wed, Sep 10, 2014 at 9:31 AM, Bill Hart goodwi...@googlemail.com
 wrote:

 Hi,

 I have been writing a new Julia package, which I have called Nemo (it's
 essentially a limited computer algebra system).

 I have two specific problems:

 1) The git and GitHub repository for Nemo already exists, but I haven't
 created a Julia Pkg yet.

 https://github.com/wbhart/nemo

 The documentation on creating a Julia Pkg seems to assume you are going
 to start with the Pkg then commit code to the git repository that it
 creates, not create a git/github project and then add the necessary stuff
 to turn it into a Julia package.

 Is there documentation somewhere explaining how to do the latter? Or
 can someone help me with doing the latter?

 (I have a couple of small build issues to fix in order for flint to
 work on Windows 64 before it will work there. But I will be working on
 those right away. I have managed to get it to work with Julia there, just
 not hacked the fixes into the flint build system yet. Other than this minor
 thing, I am quite ready to 

[julia-users] Compiled R

2014-09-11 Thread asim Ansari
Hi

This article by Duncan Temple Lang on Compiling R could be of interest. 
Mentions Juila a few times. 

Asim 

http://arxiv.org/pdf/1409.3144.pdf


Re: [julia-users] Help needed with creating Julia package

2014-09-11 Thread Bill Hart
It's ok, I got it. Pkg.build()

Bill.

On 12 September 2014 00:38, Bill Hart goodwillh...@googlemail.com wrote:

 I had a go at making a preliminary package which should vaguely build on
 Linux when using Nemo is run from within the src/ directory.

 I checked this works on my machine at least.

 I also checked that Pkg.clone(https://github.com/wbhart/nemo.git;)
 clones the Nemo repository from within Julia. But this seems to only clone
 the repository and doesn't appear to issue using Nemo as I had expected.

 Also typing using Nemo manually says that it can't find Nemo. What
 command to users have to issue to get using Nemo to actually do something?

 Bill.



 On 10 September 2014 16:26, Isaiah Norton isaiah.nor...@gmail.com wrote:


 This was what I thought of trying first. But I couldn't figure out how it
 worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.


 For Pkg manager purposes, the association will be created later (when you
 register the package).

 It also isn't clear where Julia creates the empty git repository. In the
 current directory? Or in some subdirectory of the Julia source tree?


 Under `$HOME/.julia/v0.3` (or v0.4 if you are on git master)

 For the most part I can just run configure, make, make install for now
 and set some library paths (if I can figure out what kind of system I am
 on).


 There are some macros to help with this: @osx, @linux, @unix (both), and
 @windows. There is also a variable called OS_NAME with a platform-specific
 value (:Windows, :Linux, etc.) See:

 http://docs.julialang.org/en/release-0.3/manual/calling-c-and-fortran-code/#handling-platform-variations



 On Wed, Sep 10, 2014 at 10:18 AM, Bill Hart goodwillh...@googlemail.com
 wrote:



 On Wednesday, 10 September 2014 15:57:56 UTC+2, Isaiah wrote:

 Is there documentation somewhere explaining how to do the latter? Or
 can someone help me with doing the latter?


 You could run `Pkg.generate(Nemo)` and then copy and commit (some of)
 the resulting files in your own Nemo git tree; there aren't very many.


 This was what I thought of trying first. But I couldn't figure out how
 it worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.

 It also isn't clear where Julia creates the empty git repository. In the
 current directory? Or in some subdirectory of the Julia source tree?


 I can't find any documentation explaining where to put the commands in
 a Pkg to actually git clone flint, build it, install it and set up paths
 for Nemo. Given the complexities of installing flint for the user, I'd 
 like
 to have the Julia package manager do this automatically if at all 
 possible.
 And I see it does seem to be possible. I just can't figure out how.


 The Pkg manager will look for a file called `MYPKG/deps/build.jl` and
 run that if it exists. That's just a Julia file, so you can do whatever you
 want there (shell out, etc.).


 Perfect. For the most part I can just run configure, make, make install
 for now and set some library paths (if I can figure out what kind of system
 I am on).

 Finding the Julia installation on the system in order to link against
 the gmp/mpfr might be slightly more difficult.


 One option is to use the BinDeps package which provides primitives for
 interacting with various package managers and build systems:

 https://github.com/JuliaLang/BinDeps.jl

 A very advanced and fully-developed usage example can be found in the
 Cairo package, which has Autotools, Apt, Yum, and several other targets:

 https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl

 There are a number of other examples to draw from. Hopefully the above
 links will give you a sense of where to start. I can help out on Linux and
 Windows (@ihnorton on github).


 Thanks.

 Bill.




 On Wed, Sep 10, 2014 at 9:31 AM, Bill Hart goodwi...@googlemail.com
 wrote:

 Hi,

 I have been writing a new Julia package, which I have called Nemo
 (it's essentially a limited computer algebra system).

 I have two specific problems:

 1) The git and GitHub repository for Nemo already exists, but I
 haven't created a Julia Pkg yet.

 https://github.com/wbhart/nemo

 The documentation on creating a Julia Pkg seems to assume you are
 going to start with the Pkg then commit code to the git repository that it
 creates, not create a git/github project and then add the necessary stuff
 to turn it into a Julia package.

 Is there documentation somewhere explaining how to do the latter? Or
 can someone help me with doing the latter?

 (I have a couple of small build issues to fix in order for flint to
 work on Windows 64 before it will work there. But I will be working on
 those right away. I have managed to get it to work 

Re: [julia-users] Help needed with creating Julia package

2014-09-11 Thread Bill Hart
OK, I can build Nemo. But how do I load modules from Nemo now that it is
installed and built.

For example using Nemo, using Rings, using Fields all fail,
complaining that it can't find the modules.

I must be missing a step somewhere.

Bill.

On 12 September 2014 00:47, Bill Hart goodwillh...@googlemail.com wrote:

 It's ok, I got it. Pkg.build()

 Bill.

 On 12 September 2014 00:38, Bill Hart goodwillh...@googlemail.com wrote:

 I had a go at making a preliminary package which should vaguely build on
 Linux when using Nemo is run from within the src/ directory.

 I checked this works on my machine at least.

 I also checked that Pkg.clone(https://github.com/wbhart/nemo.git;)
 clones the Nemo repository from within Julia. But this seems to only clone
 the repository and doesn't appear to issue using Nemo as I had expected.

 Also typing using Nemo manually says that it can't find Nemo. What
 command to users have to issue to get using Nemo to actually do something?

 Bill.



 On 10 September 2014 16:26, Isaiah Norton isaiah.nor...@gmail.com
 wrote:


 This was what I thought of trying first. But I couldn't figure out how
 it worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.


 For Pkg manager purposes, the association will be created later (when
 you register the package).

 It also isn't clear where Julia creates the empty git repository. In the
 current directory? Or in some subdirectory of the Julia source tree?


 Under `$HOME/.julia/v0.3` (or v0.4 if you are on git master)

 For the most part I can just run configure, make, make install for now
 and set some library paths (if I can figure out what kind of system I am
 on).


 There are some macros to help with this: @osx, @linux, @unix (both), and
 @windows. There is also a variable called OS_NAME with a platform-specific
 value (:Windows, :Linux, etc.) See:

 http://docs.julialang.org/en/release-0.3/manual/calling-c-and-fortran-code/#handling-platform-variations



 On Wed, Sep 10, 2014 at 10:18 AM, Bill Hart goodwillh...@googlemail.com
  wrote:



 On Wednesday, 10 September 2014 15:57:56 UTC+2, Isaiah wrote:

 Is there documentation somewhere explaining how to do the latter? Or
 can someone help me with doing the latter?


 You could run `Pkg.generate(Nemo)` and then copy and commit (some
 of) the resulting files in your own Nemo git tree; there aren't very many.


 This was what I thought of trying first. But I couldn't figure out how
 it worked out what GitHub repository to associate this with, or whether it
 would try to create one, possibly scrubbing my existing nemo repository on
 GitHub. Obviously I don't want to lose my commit history.

 It also isn't clear where Julia creates the empty git repository. In
 the current directory? Or in some subdirectory of the Julia source tree?


 I can't find any documentation explaining where to put the commands in
 a Pkg to actually git clone flint, build it, install it and set up paths
 for Nemo. Given the complexities of installing flint for the user, I'd 
 like
 to have the Julia package manager do this automatically if at all 
 possible.
 And I see it does seem to be possible. I just can't figure out how.


 The Pkg manager will look for a file called `MYPKG/deps/build.jl` and
 run that if it exists. That's just a Julia file, so you can do whatever 
 you
 want there (shell out, etc.).


 Perfect. For the most part I can just run configure, make, make install
 for now and set some library paths (if I can figure out what kind of system
 I am on).

 Finding the Julia installation on the system in order to link against
 the gmp/mpfr might be slightly more difficult.


 One option is to use the BinDeps package which provides primitives for
 interacting with various package managers and build systems:

 https://github.com/JuliaLang/BinDeps.jl

 A very advanced and fully-developed usage example can be found in the
 Cairo package, which has Autotools, Apt, Yum, and several other targets:

 https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl

 There are a number of other examples to draw from. Hopefully the above
 links will give you a sense of where to start. I can help out on Linux and
 Windows (@ihnorton on github).


 Thanks.

 Bill.




 On Wed, Sep 10, 2014 at 9:31 AM, Bill Hart goodwi...@googlemail.com
 wrote:

 Hi,

 I have been writing a new Julia package, which I have called Nemo
 (it's essentially a limited computer algebra system).

 I have two specific problems:

 1) The git and GitHub repository for Nemo already exists, but I
 haven't created a Julia Pkg yet.

 https://github.com/wbhart/nemo

 The documentation on creating a Julia Pkg seems to assume you are
 going to start with the Pkg then commit code to the git repository that 
 it
 creates, not create a git/github project and then add the necessary stuff
 to turn it into a 

Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread Jiahao Chen
You may be interested in issue #7258
https://github.com/JuliaLang/julia/issues/7258 and the julia-dev thread
https://groups.google.com/forum/#!topic/julia-dev/DF8LUiH7FP4linked to in
there.

Thanks,

Jiahao Chen
Staff Research Scientist
MIT Computer Science and Artificial Intelligence Laboratory

On Thu, Sep 11, 2014 at 3:40 PM, Christoph Ortner 
christophortn...@gmail.com wrote:


 Here is a short code snippet, that got me puzzled.
 [Julia Version 0.3.0, Commit 7681878* (2014-08-20 20:43 UTC), Darwin
 (x86_64-apple-darwin13.3.0)]



 a = rand(3,3)

 b = rand(3,3)

 println(typeof(

 [a[i,j]*b[i,j] for i = 1:3, j=1:3]))

 println(typeof(a .* b))

 Array{Any,2}
 Array{Float64,2}



 Should Julia not create the same output in both cases? Is this a bug or
 intended?


  --Christoph

 Julia Version 0.3.0
 Commit 7681878* (2014-08-20 20:43 UTC)
 Platform Info:
   System: Darwin (x86_64-apple-darwin13.3.0)






Re: [julia-users] Re: ANN: ApproxFun v0.0.3 with general linear PDE solving on rectangles

2014-09-11 Thread Sheehan Olver

Chebfun is a lot more full featured, and ApproxFun is _very_ rough 
around the edges.  ApproxFun will probably end up a very different animal than 
chebfun: right now the goal is to tackle PDEs on a broader class of domains, 
something I think is beyond the scope of Chebfun due to issues with Matlab's 
speed, memory management, etc.   

Here’s a partial list of features in Chebfun not in ApproxFun:

1)  Automatic edge detection and domain splitting
2)  Support for delta functions
3)  Built-in time stepping (pde15s)
4)  Eigenvalue problems
5)  Automatic nonlinear ODE solver
6)  Operator exponential
7)  Smarter constructor for determining convergence
8)  Automatic differentiation

I have no concrete plans at the moment of adding these features, though 
eigenvalue problems and operator exponentials will likely find their way in at 
some point.   


Sheehan


On 12 Sep 2014, at 12:14 am, Steven G. Johnson stevenj@gmail.com wrote:

 This is great!
 
 At this point, what are the major differences in functionality between 
 ApproxFun and Chebfun?



[julia-users] What wrong , help ;0

2014-09-11 Thread gael . mcdon
Why are you using metaprogramming stuff instead of a dict or an array?

It's not what creates the problem, but at least with a dict, it should be 
easier for you to keep everything perfectly clear in your head.

So instead of generating symbols on the fly to @eval them, create a dict with 
p2 and the likes as keys.


Re: [julia-users] Re: What wrong , help ;0

2014-09-11 Thread gael . mcdon
BTW, if what you want to achieve is the concatenation of a few arrays, you may 
want to do it from the start instead of putting them in different variables 
first to concatenate them afterwards.


Re: [julia-users] Re: create a matrix dynamically with Julia

2014-09-11 Thread Charles Novaes de Santana
Thank you very much, Douglas, for your great suggestions!

Best,

Charles

On Thu, Sep 11, 2014 at 7:38 PM, Douglas Bates dmba...@gmail.com wrote:

 The short answer is vcat, as in

 julia A = Array(Int,(0,2))
 0x2 Array{Int64,2}

 julia vcat(A,[1,2]')
 1x2 Array{Int64,2}:
  1  2

 Note that the ' is important as it cause the column vector [1,2] to be
 reshaped into a 1 by 2 matrix.

 You may find it more effective to create the columns separately using
 push! and then use hcat to create the matrix when you are done, if this is
 feasible.  Using push! to append a new element onto the end of a vector is
 likely to be more efficient than vcat'ing matrices.

 julia c1 = Int[]; c2 = Int[]
 0-element Array{Int64,1}

 julia for i in 1:10
   push!(c1,i)
   push!(c2,abs2(i))
end

 julia hcat(c1,c2)
 10x2 Array{Int64,2}:
   11
   24
   39
   4   16
   5   25
   6   36
   7   49
   8   64
   9   81
  10  100



 On Thursday, September 11, 2014 11:54:45 AM UTC-5, Charles Santana wrote:


 Dear all,

 I would like to create dynamically a matrix with two columns and N rows
 (where N can be any number between 0 and 1000). I thought I could do it by
 using the function cat, but I am facing some problems with this.

 My code:
 A=[];
 (...)
 A=cat(1,A,[1 2]);

 Is it a good way to create a matrix without defining its dimension a
 priori?

 I was expecting that A would be a matrix 1x2, but I got the following
 error message:

 ERROR: mismatch in dimension 2
  in cat_t at abstractarray.jl:689
  in cat at abstractarray.jl:666

 I am using julia Version 0.4.0-dev+523 (2014-09-10 15:51 UTC)

 Thank you in advance for any comment,

 Charles

 --
 Um axé! :)

 --
 Charles Novaes de Santana, PhD
 http://www.imedea.uib-csic.es/~charles




-- 
Um axé! :)

--
Charles Novaes de Santana, PhD
http://www.imedea.uib-csic.es/~charles


[julia-users] Values vs. Bindings: making sense of things

2014-09-11 Thread gael . mcdon
 The binding of the argument to the function can never change, though the 
 values of that binding might.

It you be more correct to say that a method cannot change the binding of its 
arguments. You can change bindings, you just can't do it inside of a method 
because of scoping rules. It's just as you said in your second point.

 Is this how julia handles values and bindings, or it there more to this 
 picture?

You seem to have understood it correctly.


Your surprise may actually come from the fact that you read
`[1,2,3] == [1,2,3]`
while it was actually
`[1,2,3] === [1,2,3]`

The three equal signs represent a strong equality: the mathematical equality is 
not sufficient; the objects actually need to be the same, they should 
correspond to exactly the same data in memory, the same address.

This is precisely what you demonstrated.



I'm a bit more surprised with the first statement: 1 === 1. I guess Julia 
wouldn't allocate two different ojects in memory for that, maybe LLVM just 
replaces that with true directly. But I find it surprising because this kind 
of equality is only meaningful if you are comparing variables, not values.

I'm also wondering if `==` is required by `===`: would two view of the same 
array be ===-equal? Even if the first one sees the data as Int64 while the 
second one sees them as Float64?

I guess I'll have to spend 20 seconds on that tomorrow.


[julia-users] Compiled R

2014-09-11 Thread Ethan Anderes
For the past year I've been trying to get Duncan to jump to our side of the 
tracks and join in on Julia development. I haven't landed the sale, as of yet, 
but I'm still working on it. My hope is that his knowledge of R development 
might help in the stats design??


Re: [julia-users] Help needed with creating Julia package

2014-09-11 Thread Bill Hart
I guess I figured it out.

On 12 September 2014 01:12, Bill Hart goodwillh...@googlemail.com wrote:

 Yes.

 I notice that after building Nemo it is in a directory called nemo, not
 Nemo.

 At the moment Nemo.jl simply builds Nemo by including deps/build.jl, since
 this is what Cairo does.

 The code the user will be interested in is in Rings.jl and Fields.jl. How
 do they load those?

 Bill.

 On 12 September 2014 01:08, Leah Hanson astriea...@gmail.com wrote:

 Does your Nemo.jl contain

 ~~~
 module Nemo
 code goes here...
 end
 ~~~

 ?

 On Thu, Sep 11, 2014 at 5:56 PM, Bill Hart goodwillh...@googlemail.com
 wrote:

 OK, I can build Nemo. But how do I load modules from Nemo now that it is
 installed and built.

 For example using Nemo, using Rings, using Fields all fail,
 complaining that it can't find the modules.

 I must be missing a step somewhere.

 Bill.

 On 12 September 2014 00:47, Bill Hart goodwillh...@googlemail.com
 wrote:

 It's ok, I got it. Pkg.build()

 Bill.

 On 12 September 2014 00:38, Bill Hart goodwillh...@googlemail.com
 wrote:

 I had a go at making a preliminary package which should vaguely build
 on Linux when using Nemo is run from within the src/ directory.

 I checked this works on my machine at least.

 I also checked that Pkg.clone(https://github.com/wbhart/nemo.git;)
 clones the Nemo repository from within Julia. But this seems to only clone
 the repository and doesn't appear to issue using Nemo as I had expected.

 Also typing using Nemo manually says that it can't find Nemo. What
 command to users have to issue to get using Nemo to actually do 
 something?

 Bill.



 On 10 September 2014 16:26, Isaiah Norton isaiah.nor...@gmail.com
 wrote:


 This was what I thought of trying first. But I couldn't figure out
 how it worked out what GitHub repository to associate this with, or 
 whether
 it would try to create one, possibly scrubbing my existing nemo 
 repository
 on GitHub. Obviously I don't want to lose my commit history.


 For Pkg manager purposes, the association will be created later (when
 you register the package).

 It also isn't clear where Julia creates the empty git repository. In
 the current directory? Or in some subdirectory of the Julia source tree?


 Under `$HOME/.julia/v0.3` (or v0.4 if you are on git master)

 For the most part I can just run configure, make, make install for
 now and set some library paths (if I can figure out what kind of system 
 I
 am on).


 There are some macros to help with this: @osx, @linux, @unix (both),
 and @windows. There is also a variable called OS_NAME with a
 platform-specific value (:Windows, :Linux, etc.) See:

 http://docs.julialang.org/en/release-0.3/manual/calling-c-and-fortran-code/#handling-platform-variations



 On Wed, Sep 10, 2014 at 10:18 AM, Bill Hart 
 goodwillh...@googlemail.com wrote:



 On Wednesday, 10 September 2014 15:57:56 UTC+2, Isaiah wrote:

 Is there documentation somewhere explaining how to do the latter?
 Or can someone help me with doing the latter?


 You could run `Pkg.generate(Nemo)` and then copy and commit (some
 of) the resulting files in your own Nemo git tree; there aren't very 
 many.


 This was what I thought of trying first. But I couldn't figure out
 how it worked out what GitHub repository to associate this with, or 
 whether
 it would try to create one, possibly scrubbing my existing nemo 
 repository
 on GitHub. Obviously I don't want to lose my commit history.

 It also isn't clear where Julia creates the empty git repository. In
 the current directory? Or in some subdirectory of the Julia source tree?


 I can't find any documentation explaining where to put the commands
 in a Pkg to actually git clone flint, build it, install it and set up 
 paths
 for Nemo. Given the complexities of installing flint for the user, 
 I'd like
 to have the Julia package manager do this automatically if at all 
 possible.
 And I see it does seem to be possible. I just can't figure out how.


 The Pkg manager will look for a file called `MYPKG/deps/build.jl`
 and run that if it exists. That's just a Julia file, so you can do 
 whatever
 you want there (shell out, etc.).


 Perfect. For the most part I can just run configure, make, make
 install for now and set some library paths (if I can figure out what 
 kind
 of system I am on).

 Finding the Julia installation on the system in order to link
 against the gmp/mpfr might be slightly more difficult.


 One option is to use the BinDeps package which provides primitives
 for interacting with various package managers and build systems:

 https://github.com/JuliaLang/BinDeps.jl

 A very advanced and fully-developed usage example can be found in
 the Cairo package, which has Autotools, Apt, Yum, and several other 
 targets:

 https://github.com/JuliaLang/Cairo.jl/blob/master/deps/build.jl

 There are a number of other examples to draw from. Hopefully the
 above links will give you a sense of where to start. I can help out on
 Linux and Windows 

Re: [julia-users] Image acquisition

2014-09-11 Thread Kevin Squire
Thanks, Simon!  I'll try it out this evening.

Right now, reading translates the raw input (usually yuv420p, or maybe
yuv422) to RGB before handing it off. One of my hopes is that we could pass
the raw image data directly to the GPU, decode it there, and eventually
even apply filters or other processing there.

Still a ways to go, but hopefully we'll get there.

Cheers,
  Kevin

On Thursday, September 11, 2014, Simon Danisch sdani...@gmail.com wrote:

 Very nice library!!
 I made a little example for the usage of VideoIO with GLPlot.

 On my PC, its a lot faster than VideoIO.viewcam(), and you can use real
 time filterig
 https://gist.github.com/SimonDanisch/fa3993176a015215092c
 Hope you like it!

 Best,
 Simon

 Am Montag, 8. September 2014 18:06:45 UTC+2 schrieb Miguel Belbut Gaspar:

 Hi,

 Has anyone found a way to do image acquisition (from a webcam or some
 kind of digital camera) directly in Julia? Or should we communicate
 directly with some library/dll to achieve that?

 Miguel




Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread gael . mcdon
Wouldn't it be enough to put it in a local scope (let block or in a function?).

For more information, you can ask or look at the Performance tips part of the 
manual.


Re: [julia-users] Values vs. Bindings: making sense of things

2014-09-11 Thread Jameson Nash
regarding 1 === 1, this is true of any immutable isbits type. Julia
doesn't actually allocate an object for that in memory, it is simply a
value (aka a value-type), and as such it is always compared by value, never
by address.


On Thu, Sep 11, 2014 at 8:47 PM, gael.mc...@gmail.com wrote:

  The binding of the argument to the function can never change, though the
 values of that binding might.

 It you be more correct to say that a method cannot change the binding of
 its arguments. You can change bindings, you just can't do it inside of a
 method because of scoping rules. It's just as you said in your second point.

  Is this how julia handles values and bindings, or it there more to this
 picture?

 You seem to have understood it correctly.


 Your surprise may actually come from the fact that you read
 `[1,2,3] == [1,2,3]`
 while it was actually
 `[1,2,3] === [1,2,3]`

 The three equal signs represent a strong equality: the mathematical
 equality is not sufficient; the objects actually need to be the same, they
 should correspond to exactly the same data in memory, the same address.

 This is precisely what you demonstrated.



 I'm a bit more surprised with the first statement: 1 === 1. I guess Julia
 wouldn't allocate two different ojects in memory for that, maybe LLVM just
 replaces that with true directly. But I find it surprising because this
 kind of equality is only meaningful if you are comparing variables, not
 values.

 I'm also wondering if `==` is required by `===`: would two view of the
 same array be ===-equal? Even if the first one sees the data as Int64 while
 the second one sees them as Float64?

 I guess I'll have to spend 20 seconds on that tomorrow.



[julia-users] sparse matrix functions

2014-09-11 Thread i . pallikarakis-11
Hi,
I am relatively new to  Julia. I upgraded from 0.2.1 to 0.3.0 and had the 
following issue, the find function stopped working
on Julia 0.3.0 on sparse matrices. I tried to find a quick look as for why 
this is happening but din't find anything.


Example:
A=speye(Bool,10)
find(x-x==true,A)
-0-element Array{Int64,1}
find(x-x==true,full(A))
-10-element Array{Int64,1}:
 1
 12
 23
 34
 45
 56
 67
 78
 89
100

Is this a bug ?


Thank you for your help,

Ilias 


[julia-users] find function in sparse matrix

2014-09-11 Thread i . pallikarakis-11
Hi everyone,

I am new to Julia and just upgraded from 0.2.1 to 0.3.0 and found the 
following issue :
find function is no longer working on sparse matrices. For example
A=speye(Bool,10)
find(x-x==true,A)
-0-element Array{Int64,1}

find(x-x==true,full(A))
-10-element Array{Int64,1}:
   1
  12
  23
  34
  45
  56
  67
  78
  89
 100

Is this normal ?

Thank you for your help,

Ilias


Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread Christoph Ortner
On Friday, 12 September 2014 02:24:15 UTC+1, gael@gmail.com wrote:

 Wouldn't it be enough to put it in a local scope (let block or in a 
 function?).

 For more information, you can ask or look at the Performance tips part of 
 the manual.

I'd be interested in. Here is another code block:

a1 = rand(10, 10, 100, 100)
b1 = rand(10, 100, 100)
c1 = rand(10, 100, 100)
const a2 = rand(10,10,100,100)
const b2 = rand(10,100,100)
const c2 = rand(10,100,100)
@time(begin
for n = 1:10
d1 = Float64[ a1[a,b,i,j] .* b1[a,i,j] .* c1[b,i,j] for a = 1:10, b 
= 1:10, i=1:100,j=1:100 ]
end
end)
@time(begin
for n = 1:10
d2 = [ a2[a,b,i,j] .* b2[a,i,j] .* c2[b,i,j] for a = 1:10, b = 
1:10, i=1:100,j=1:100 ]
end
end)


OUTPUT:

elapsed time: 4.554876933 seconds (1039919360 bytes allocated, 25.73% gc time)
elapsed time: 0.147784029 seconds (80001120 bytes allocated, 54.91% gc time)

This is a factor-30 slow-down. I think comprehensions are wonderful to 
read, but this makes them useless, unless there is a reasonably elegant fix.



Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread Jameson Nash
You are still trying to run in global scope. Put your code in a function
before drawing conclusions.


On Fri, Sep 12, 2014 at 12:58 AM, Christoph Ortner 
christophortn...@gmail.com wrote:

 On Friday, 12 September 2014 02:24:15 UTC+1, gael@gmail.com wrote:

 Wouldn't it be enough to put it in a local scope (let block or in a
 function?).

 For more information, you can ask or look at the Performance tips part of
 the manual.

 I'd be interested in. Here is another code block:

 a1 = rand(10, 10, 100, 100)
 b1 = rand(10, 100, 100)
 c1 = rand(10, 100, 100)
 const a2 = rand(10,10,100,100)
 const b2 = rand(10,100,100)
 const c2 = rand(10,100,100)
 @time(begin
 for n = 1:10
 d1 = Float64[ a1[a,b,i,j] .* b1[a,i,j] .* c1[b,i,j] for a = 1:10,
 b = 1:10, i=1:100,j=1:100 ]
 end
 end)
 @time(begin
 for n = 1:10
 d2 = [ a2[a,b,i,j] .* b2[a,i,j] .* c2[b,i,j] for a = 1:10, b =
 1:10, i=1:100,j=1:100 ]
 end
 end)


 OUTPUT:

 elapsed time: 4.554876933 seconds (1039919360 bytes allocated, 25.73% gc time)
 elapsed time: 0.147784029 seconds (80001120 bytes allocated, 54.91% gc time)

 This is a factor-30 slow-down. I think comprehensions are wonderful to
 read, but this makes them useless, unless there is a reasonably elegant fix.




Re: [julia-users] Values vs. Bindings: making sense of things

2014-09-11 Thread John Myles White
For future reference, I'd really appreciate you not referring to my writing as 
quite erroneous when the claims made are in fact correct.

 -- John

On Sep 11, 2014, at 2:38 PM, Mohammed El-Beltagy mohammed.elbelt...@gmail.com 
wrote:

 In a recent blog by John Myles White 
 http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/
  it was suggested that Julia make strong distinction  between values and 
 binding. For example 
 a = [1, 2, 3]
 function foo!(a)
  a[1] = 10
  return
 end
 a
 
 Would give an output 
 3-element Array{Int64,1}:
  10
   2
   3
 But subsequently running 
 function bar!(a)
 a = [1, 2]
 return
 end
 a
 would give an output of 
 3-element Array{Int64,1}:
  10
   2
   3
 The reason why the variable a was not changed in the case of boo!, but 
 was changed in the case of foo! has to do with the fact values are the same 
 their binding. 
 However to illustrate that point, the examples given in the blog are quite 
 erroneous. For example 
 [1,2,3]==[1,2,3]
 would yield an out of true, whereas the blog post indicated that is should 
 be false. This the because the == operator unpacks the values in the 
 binding and does and element wise comparison. 
 A better was illustrate that problem is make use of julia's object_id 
 function. For example 
 a=[1,2,3]
 @printf(Object ID in outerscope 0x%x\n, object_id(a))
 function bar!(a)
 @printf(Object ID in \!bar and before assignment 0x%x\n, object_id(a))
 a = [1, 2]
 @printf(Object ID in \!bar after assignment 0x%x\n, object_id(a))
return
 end
 bar!(a)
 @printf(Object ID in outerscope after \!bar is 0x%x\n, object_id(a))
 a
 The output will be
 Object ID in outerscope 0xa19caeb70115d4f0
 Object ID in !bar and before assignment 0xa19caeb70115d4f0
 Object ID in !bar after assignment 0x782193112dfbbbd5
 Object ID in outerscope after !bar is 0xa19caeb70115d4f0
 Out[1]:
 3-element Array{Int64,1}:
  1
  2
  3
 This would mean the when calling a function in Julia the following is true:
 The binding of the argument to the function can never change, though the 
 values of that binding might. 
 The binding can be overridden locally in the scope of the function, but that 
 is only valid in inside the function's scope
 A modification to the above code that does not attempt to override the 
 original binding, shown below would not change the object id. 
 a=[1,2,3]
 @printf(Object ID in outerscope 0x%x\n, object_id(a))
 function bar!(a)
 @printf(Object ID in \!bar and before assignment 0x%x\n, object_id(a))
 empty!(a)
 push!(a,[1, 2]...)
 @printf(Object ID in \!bar after assignment 0x%x\n, object_id(a))
return
 end
 bar!(a)
 @printf(Object ID in outerscope after \!bar is 0x%x\n, object_id(a))
 a
 
 Is this how julia handles values and bindings, or it there more to this 
 picture?
  



Re: [julia-users] Compiled R

2014-09-11 Thread John Myles White
This article is really good. Thanks for pointing it out.

 -- John

On Sep 11, 2014, at 4:10 PM, asim Ansari asimansari...@gmail.com wrote:

 Hi
 
 This article by Duncan Temple Lang on Compiling R could be of interest. 
 Mentions Juila a few times. 
 
 Asim 
 
 http://arxiv.org/pdf/1409.3144.pdf



Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread Christoph Ortner
That did work - thank you, see code below.  To explain: this came from a 
bottleneck in a bigger code, so my problem there must be a different one.
  -- Christoph

function testtime()
a1 = rand(10, 10, 100, 100)
b1 = rand(10, 100, 100)
c1 = rand(10, 100, 100)
d1 = []
const a2 = rand(10,10,100,100)
const b2 = rand(10,100,100)
const c2 = rand(10,100,100)
d2 = []
@time(begin
for n = 1:10
d1 = [ a1[a,b,i,j] .* b1[a,i,j] .* c1[b,i,j] for a = 1:10, b = 
1:10, i=1:100,j=1:100 ]
end
end)
println(typeof(d1))
@time(begin
for n = 1:10
d2 = [ a2[a,b,i,j] .* b2[a,i,j] .* c2[b,i,j] for a = 1:10, b = 
1:10, i=1:100,j=1:100 ]
end
end)
println(typeof(d2))
end

testtime()





Re: [julia-users] Comprehension Produces Any

2014-09-11 Thread Christoph Ortner
And here the OUTPUT:

elapsed time: 0.110285914 seconds (80001120 bytes allocated, 59.36% gc time)
Array{Float64,4}
elapsed time: 0.079318859 seconds (80001120 bytes allocated, 43.25% gc time)
Array{Float64,4}