[julia-users] Re: How to stop program execution at some point

2016-11-11 Thread Davide
Actually, when executing a function in Julia REPL, quit() and exit() also exit from julia. Is there a way to stop the function but not Julia? Thanks On Monday, November 7, 2016 at 11:40:32 AM UTC+1, Tamas Papp wrote: > > See quit(), and in general exit(code). >

[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package <https://github.com/gasagna/ArraySlices.jl>. Davide On Sunday, September 25, 2016 at 8:33:54 PM UTC+1, Dan wrote: > > Nice. > It is easier when the payoffs are in vector form. My last iteration: > > i

[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package <https://github.com/gasagna/ArraySlices.jl>. Davide On Sunday, September 25, 2016 at 8:33:54 PM UTC+1, Dan wrote: > > Nice. > It is easier when the payoffs are in vector form. My last iteration: > > i

Re: [julia-users] Configuring incomplete (julia-deps error 2)

2016-09-11 Thread Davide
Thanks Tony, with cmake v. 3.6.2 the configuration passed and now the compilation is going on. Debian stable comes with cmake v.3.0.2. Best, Davide On Sunday, September 11, 2016 at 10:17:44 PM UTC+2, Tony Kelman wrote: > > There's a bug in some versions of cmake's F

Re: [julia-users] Configuring incomplete (julia-deps error 2)

2016-09-11 Thread Davide
I put the output of make (with no -j option and got with tee) in file makejulia.log, together with the files CMakeError.log and CMakeOutput.log in the following GitHub gist: https://gist.github.com/anonymous/842016eeac177a2ad634b359592fd6bb Thanks, Davide On Sunday, September 11, 2016

[julia-users] Configuring incomplete (julia-deps error 2)

2016-09-11 Thread Davide
/FindOpenSSL.cmake:298 (list): list GET given empty list Call Stack (most recent call first): CMakeLists.txt:277 (FIND_PACKAGE) -- Configuring incomplete, errors occurred! Thanks for help, Davide

[julia-users] need help from Julia/C-fu masters...

2016-09-07 Thread Davide Lasagna
ers. Any help is appreciated. Thanks, Davide

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

2016-09-05 Thread Davide Lasagna
I loved Pimp My Ride, and I also happen to love PimpMyREPL! Thanks for the package. Davide On Sunday, September 4, 2016 at 11:36:30 PM UTC+1, Kristoffer Carlsson wrote: > > Hello everyone, > > I would like to announce my REPL enhancing package PimpMyREPL. The > package aims to

[julia-users] signature of parametric "::Type" methods

2016-08-22 Thread Davide Lasagna
Hi, Why do i need to specify all the parameters in the signature of methods that take `::Type` arguments? Demo: # define some parametric type julia> immutable foo{T, N, P, S} end # this will not work, but it seems natural to omit trailing unused parameters julia> bar{T}(::Type{foo{T}}

[julia-users] suspect memory allocation in generated function

2016-08-21 Thread Davide Lasagna
Hi, I am implementing a custom array type where indexing wraps around on user-specified periodic dimensions. This makes it easier to write stencil operations, at the expenses of some performance penalty, (3x slower). The basic code can be found here

Re: [julia-users] hashing floating point zeroes

2016-07-09 Thread Davide Lasagna
ero represents "a > really small negative number" that can't be represented exactly using > floating point. > > On Saturday, July 9, 2016, Davide Lasagna > wrote: > >> Hi, >> >> I have just been bitten by a function hashing a custom type cont

[julia-users] hashing floating point zeroes

2016-07-09 Thread Davide Lasagna
Hi, I have just been bitten by a function hashing a custom type containing a vector of floats. It turns out that hashing positive and negative floating point zeros returns different hashes. Demo: julia> hash(-0.0) 0x3be7d0f7780de548 julia> hash(0.0) 0x77cfa1eef01bca90 julia> hash(0) 0x77cfa

Re: [julia-users] how to tell if a jld file contains a dataset?

2016-07-08 Thread Davide Lasagna
Thanks! On Friday, July 8, 2016 at 4:21:22 PM UTC+1, Tim Holy wrote: > > `has` or `exists` > > --Tim > > On Friday, July 8, 2016 8:01:40 AM CDT Davide Lasagna wrote: > > I have read the available documentation but I cannot seem to get it. > > > > How do

[julia-users] how to tell if a jld file contains a dataset?

2016-07-08 Thread Davide Lasagna
I have read the available documentation but I cannot seem to get it. How do I test whether an existing .jld file, opened as jldopen(filename, "r") do handle # test whether handle contains the dataset "foo" end contains a dataset, given its name as a string, e.g. "foo"? Thanks! Davide

Re: [julia-users] Re: indexing over `zip(collection1, collection2)`

2016-06-23 Thread Davide Lasagna
Yes, I meant python 2.x On Thursday, June 23, 2016 at 8:06:20 PM UTC+1, Yichao Yu wrote: > > On Thu, Jun 23, 2016 at 2:53 PM, Jussi Piitulainen > wrote: > > > > > > torstai 23. kesäkuuta 2016 21.18.22 UTC+3 Davide Lasagna kirjoitti: > >> > >> Is

Re: [julia-users] indexing over `zip(collection1, collection2)`

2016-06-23 Thread Davide Lasagna
ot; types are not indexable, AFAIK. The typical >> recommendation/idiom is to just call `collect(itr)` if you need to >> specifically index. >> >> -Jacob >> >> On Thu, Jun 23, 2016 at 2:18 PM, Davide Lasagna > > wrote: >> >>> Is there any part

[julia-users] indexing over `zip(collection1, collection2)`

2016-06-23 Thread Davide Lasagna
Is there any particular reason why `Zip` objects are iterable but not indexable? Python allows that. >From previous discussion on the topic (2014 topic at https://groups.google.com/forum/#!topic/julia-dev/5bgMvzJveWA) it seems that it has not been implemented yet. Thanks,

Re: [julia-users] define `scale!(::Float64, ::Real)` ?

2016-06-23 Thread Davide Lasagna
else scale!(out, 42) end On Thursday, June 23, 2016 at 6:42:41 PM UTC+1, Stefan Karpinski wrote: > > This method cannot be implemented since numbers are immutable. > > On Thu, Jun 23, 2016 at 1:20 PM, Davide Lasagna > wrote: > >> I have a function that operates on

[julia-users] define `scale!(::Float64, ::Real)` ?

2016-06-23 Thread Davide Lasagna
I have a function that operates on an AbstractVector object `fs`, defined like this: function foo{T}(fs::AbstractVector{T}) out = zero(T) for f in fs # do some with out and f, e.g. sum end scale!(out, 42) end This code should be generic, and the eltype `T` could be a numb

Re: [julia-users] package management

2016-05-31 Thread Davide Lasagna
Thanks! On Tuesday, May 31, 2016 at 11:24:50 PM UTC+1, Yichao Yu wrote: > > On Tue, May 31, 2016 at 6:16 PM, Davide Lasagna > wrote: > > Hi, > > > > How do package developers write code that is specific to different julia > > versions? > > > >

[julia-users] package management

2016-05-31 Thread Davide Lasagna
use case is a generated function that builds SubArrays. Between v0.4.* and v0.5, the last parameter changed so I need to have code that builds the correct code in different versions. Thanks, Davide

[julia-users] Re: What do @_inline_meta and @_propagate_inbounds_meta do?

2016-05-31 Thread Davide Lasagna
Thanks Kristoffer. AFAIU these are not supposed to be used in user code. However, the follow up question is what is a meta node? On Monday, May 30, 2016 at 5:21:02 PM UTC+1, Kristoffer Carlsson wrote: > > I believe they insert the corresponding Meta node into the AST before the > actual macros (

[julia-users] What do @_inline_meta and @_propagate_inbounds_meta do?

2016-05-30 Thread Davide Lasagna
Hi, code in abstractarray.jl (master) is filled with calls to @_inline_meta and @_propagate_inbounds_meta. Can someone explain what do these to macro do? Thanks!

[julia-users] Re: I feel that on the syntax level, Julia sacrificed too much elegancy trying to be compatible with textbook math notations

2016-05-24 Thread Davide Lasagna
Thanks Steven for the clear explanation!

Re: [julia-users] parsing error?

2016-05-22 Thread Davide Lasagna
Thanks for pointing to the page I should have read first! :) On Sunday, May 22, 2016 at 3:46:35 PM UTC+1, Joshua Ballanco wrote: > > Hi Davide, > > Looks like an issue of operator precedence: > http://docs.julialang.org/en/release-0.4/manual/mathematical-operations/#operator-prec

[julia-users] parsing error?

2016-05-22 Thread Davide Lasagna
Hi, Is this a parsing "error" worth reporting? julia> randn(3, 3)\1:3 ERROR: MethodError: no method matching /(::Int64, ::Array{Float64,2}) Closest candidates are: /(::Integer, ::Integer) /(::Real, ::Complex{T<:Real}) /(::Union{Int16,Int32,Int64,Int8}, ::BigFloat) ... [inlined code] fro

Re: [julia-users] missing subscript

2016-05-22 Thread Davide Lasagna
Thank! On Friday, May 20, 2016 at 3:03:58 PM UTC+1, Yichao Yu wrote: > > On Fri, May 20, 2016 at 9:51 AM, Davide Lasagna > wrote: > > Hi, > > > > Is there any particular reason why subscripts such as \_n are not > defined > > latex_symbols.jl? > >

[julia-users] missing subscript

2016-05-20 Thread Davide Lasagna
Hi, Is there any particular reason why subscripts such as \_n are not defined latex_symbols.jl? Cheers, Davide

[julia-users] appending `Take`s, `Zip`s & friends to a vector

2016-05-15 Thread Davide Lasagna
drop, filter, and enumerate. One could `collect` the second argument into a vector, but that would allocate memory. Thanks, Davide

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

2016-05-11 Thread Davide Lasagna
couple of cases where it would be useful, like the one I mentioned. On Tuesday, May 10, 2016 at 9:56:16 AM UTC+1, Davide Lasagna wrote: > > Hi, > > I have a custom type representing a bordered matrix (a big square matrix, > bordered by two vectors and a scalar in the bottom right

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

2016-05-11 Thread Davide Lasagna
Yes, that could be a good option, although it might just be overkill to overload indexing to access the four fields this type happens to have. On Tuesday, May 10, 2016 at 3:20:39 PM UTC+1, Eric Forgy wrote: > > Maybe you could override getindex so that A[1,1] is the interior nxn > matrix, A[1,2]

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

2016-05-10 Thread Davide Lasagna
like \_1, etc, for field/variables is not currently allowed. Worth opening an issue? On Tuesday, May 10, 2016 at 10:29:27 AM UTC+1, Milan Bouchet-Valat wrote: > > Le mardi 10 mai 2016 à 01:56 -0700, Davide Lasagna a écrit : > > Hi, > > > > I have a custom type represent

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

2016-05-10 Thread Davide Lasagna
Hi, I have a custom type representing a bordered matrix (a big square matrix, bordered by two vectors and a scalar in the bottom right corner), where the four blocks are stored in separated chunks of memory. I would like to call the fields of my type using subscripts \_1\_1, \_1\_2, ... so tha

[julia-users] Slicing arrays with slicedim

2016-05-09 Thread Davide Lasagna
Hi, on v0.4.5, why is slicedim not dropping singleton dimensions as slice does? Example: julia> A = randn(3, 4) 3x4 Array{Float64,2}: 2.31181 -1.7222-0.654665 -0.836633 -0.236305 0.389242 0.613524 -0.0398548 0.670851 -0.53761 -1.608110.117274 julia> slice(A, 1, :)

Re: [julia-users] extra constructor with optional, default value for second parameter?

2016-04-17 Thread Davide Lasagna
}, m::Integer) at essentials.jl:190 > > julia> @less Array{Int}(3) > > call{T}(::Type{Array{T}}, m::Integer) = > ccall(:jl_alloc_array_1d, Array{T,1}, (Any,Int), Array{T,1}, m) > > (or on 0.5 > julia> @which Array{Int}(3) > (::Type{Array{T,N<:Any}}){T}

[julia-users] extra constructor with optional, default value for second parameter?

2016-04-17 Thread Davide Lasagna
Hi, I am defining a type with two parameters, see code below as a demonstration. I can, of course, use the default constructor with all parameters explicitly specified. However, I would like to have an extra constructor in which I have to specify only the first parameter, and have the second

[julia-users] Re: Should `append!(a::Vector{T}, items::NTuple{N, T})` be defined in Base?

2016-04-13 Thread Davide Lasagna
Interestingly, I have just noticed a bug in append!, see https://github.com/JuliaLang/julia/issues/15868 It occurs when you try to append a vector of elements which have a different type with respect to that of the original vector and when the conversion mechanism fails. On Wednesday, April 13

[julia-users] Should `append!(a::Vector{T}, items::NTuple{N, T})` be defined in Base?

2016-04-13 Thread Davide Lasagna
Hi all, I need to extend a vector with contents from n-tuples i generate iteratively. Currently append!(a::Vector{T}, items::NTuple{N, T}) is not defined, whereas the method append!{T}(a::Array{T,1}, items::AbstractVector) exists and is defined in array.jl. Anyone finds this useful to jus

[julia-users] iterating over a vector of inhomogeneous elements

2016-04-04 Thread Davide Lasagna
seconds (5 allocations: 176 bytes) 0.001200 seconds (5 allocations: 176 bytes) i.e, when the elements of the input vector `x` are homogeneous in the first parameter only, the code is about 10 times slower. Are those if branches and type asserts so expensive? Thanks, Davide

[julia-users] Re: enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Davide Lasagna
e an extra method... On Monday, April 4, 2016 at 9:32:55 PM UTC+1, John Myles White wrote: > > Vector{Foo{T}}? > > On Monday, April 4, 2016 at 1:25:46 PM UTC-7, Davide Lasagna wrote: >> >> Hi all, >> >> Consider the following example code >> >> t

[julia-users] enforcing homogeneity of vector elements in function signature

2016-04-04 Thread Davide Lasagna
Hi all, Consider the following example code type Foo{T, N} a::NTuple{N, T} end function make_Foos(M) fs = Foo{Float64}[] for i = 1:M N = rand(1:2) f = Foo{Float64, N}(ntuple(i->0.0, N)) push!(fs, f) end fs end function bar{F<:Foo}(x::Vector{F}) p

Re: [julia-users] Different field type depending on parameter value

2016-02-19 Thread Davide Lasagna
checking that you do not really hit performance? Davide

Re: [julia-users] Different field type depending on parameter value

2016-02-19 Thread Davide Lasagna
Wouldn't you loose type stability then? It might not matter, though.

[julia-users] Re: array size

2016-02-03 Thread Davide Lasagna
d(5,5)[1,:] # Returns a 1x5 2D array > rand(5,5)[:,1] # returns a 5-element 1D array > > It's kinda consistent in its own way, but it'll change in in Julia 0.5. > There's infinity-discussion about it on github > <https://github.com/JuliaLang/julia/issues/13157>. &

[julia-users] array size

2016-02-02 Thread Davide Lasagna
Hi, Just out of curiosity. What is the fundamental reason why size(rand(5, 5), 3) is equal to 1 and does not raise an error? Davide

[julia-users] memory allocation with enumerate

2015-12-18 Thread Davide Lasagna
Consider the following piece of code, a toy model of a larger code: immutable Element{T} a::T end type Mesh{E} elsvec::Vector{E} end immutable Elements{I} els::I end elements(m::Mesh) = Elements(m.elsvec) Base.start(e::Elements) = 1 Base.next(e::Elements, i::Int) = e.els[i], i+1 Base.done(e::Ele

Re: [julia-users] Re: constructors and parametric typealias

2015-12-08 Thread Davide Lasagna
thing? Cheers On Monday, December 7, 2015 at 11:57:37 PM UTC, Stefan Karpinski wrote: > > Yes, you can overload the call operator for arbitrary types. > > On Mon, Dec 7, 2015 at 6:44 PM, Davide Lasagna > wrote: > >> Sorry to dig up this old post, but I wonder if this has b

Re: [julia-users] issue with 0.0 = -0.0

2015-12-07 Thread Davide Lasagna
Cool! Thanks

[julia-users] issue with 0.0 = -0.0

2015-12-07 Thread Davide Lasagna
I understand the reason why -0.0 == 0.0, but then this should happen also for two objects of the same type that have 0.0 and -0.0 as the value of their single field as shown below. julia> -0.0 == 0.0 true julia> type foo a::Float64 end julia> b = foo(-0.0) foo(-0.0) jul

[julia-users] Re: constructors and parametric typealias

2015-12-07 Thread Davide Lasagna
Sorry to dig up this old post, but I wonder if this has been solved/addressed in 0.4? Thanks On Friday, June 28, 2013 at 12:51:26 AM UTC+1, Kevin Squire wrote: > > Short non-answer: if declare something as a typealias with type > parameters, you can use it to match types, but (as you've found o

Re: [julia-users] C-style casts

2015-10-23 Thread Davide Lasagna
Where is this documented?

Re: [julia-users] C-style casts

2015-10-23 Thread Davide Lasagna
Where is this documented?

Re: [julia-users] permuting rows of a matrix

2015-03-11 Thread Davide Lasagna
Well, thanks Tim for pointing this out. Cheers, Davide On Wednesday, March 11, 2015 at 2:42:38 PM UTC, Tim Holy wrote: > > Good that you clarified that, but are you aware that permute! makes a copy > of > the permutation? So there's no memory savings, and it's about 4

Re: [julia-users] permuting rows of a matrix

2015-03-11 Thread Davide Lasagna
But A[p, :] makes copies, and I want it to be in place. Davide On Wednesday, March 11, 2015 at 2:02:31 PM UTC, Tim Holy wrote: > > A[p, :] > > --Tim > > On Wednesday, March 11, 2015 05:49:47 AM Davide Lasagna wrote: > > Hi, > > > > > > permute!(v,

Re: [julia-users] permuting rows of a matrix

2015-03-11 Thread Davide Lasagna
Thanks, I will have a look at this. Is there some interest to have this in base? Davide On Wednesday, March 11, 2015 at 1:38:34 PM UTC, Mauro wrote: > > Have a look at the permute! function in julia: > @less permute!([1,2], [1,2]) > > Modifying it to > > function permu

[julia-users] permuting rows of a matrix

2015-03-11 Thread Davide Lasagna
, Davide

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-08 Thread Davide Lasagna
Joachim, would you share this toolbox for polynomial optimisation? Is it on GitHub? I guess you wrote something's equivalent to yalmip or sostools. Did you compare performances? Davide

[julia-users] joinpath behaviour on absolute paths

2015-02-05 Thread Davide Lasagna
I know this is documented by what is the rationale for joinpath(path1, path2) to return path2 if path2 looks like an absolute path? Cheers, Davide

Re: [julia-users] running multiple commands

2014-11-08 Thread Davide Lasagna
) This example runs, but the three commands are executed "at the same time" as I see the two files a and b appearing at the same time in the file manager. Hence I deduce that |> cannot be used to chain all king of commands. Am I right? Davide On Saturday, November 8, 2014

[julia-users] Re: atan2 ?

2014-11-08 Thread Davide Lasagna
I opened a pull request, to change the names of the arguments so that y comes first, then x. I often use methods(func) to get the call to func right so having all argument names right is important. On Friday, November 7, 2014 8:08:01 PM UTC, Davide Lasagna wrote: > > Hi &

[julia-users] atan2 ?

2014-11-07 Thread Davide Lasagna
methods(atan2) # 9 methods for generic function "atan2": atan2(x::Float64,y::Float64) at math.jl:173 atan2(x::Float32,y::Float32) at math.jl:174 atan2(a::Float16,b::Float16) at float16.jl:144 Is this just an error in the naming of the input arguments? Davide

[julia-users] running multiple commands

2014-11-07 Thread Davide Lasagna
. Similarly if I use the ";" to create a sequence of commands, e.g. run(`mkdir $tmp; touch $file`). I could run multiple commands separately, and do the checks in julia, but there might be an easier way to achieve that. Davide

[julia-users] Re: [ANN] Dierckx.jl: 1-d and 2-d splines as in scipy.interpolate

2014-10-28 Thread Davide Lasagna
Great work! Thanks for sharing. On Tuesday, October 28, 2014 3:32:40 AM UTC, Kyle Barbary wrote: > > This is an announcement of Dierckx.jl, a Julia wrapper for the dierckx > Fortran library from netlib. This is the same library underlying the spline > classes in scipy.interpolate. > > http://gi

[julia-users] [ANN] A Julia wrapper for the Fast Artificial Neural Network C library

2014-10-27 Thread Davide Lasagna
nts, testing and suggestion are highly appreciated. Davide

Re: [julia-users] How to get a Julia code review

2014-10-26 Thread Davide Lasagna
t general case, code review reduces to unpaid labor, which is > not something most people have either the resources or incentives to > provide. So the answer, absent some other assumptions, is probably, "this > is generally not something people can do." > > > >

[julia-users] How to get a Julia code review

2014-10-25 Thread Davide Lasagna
Hi, Is there anything like getting a review of some Julia code? Cheers, Davide

Re: [julia-users] I am failing in wrapping FANN

2014-10-25 Thread Davide Lasagna
/fann_train_data.c at line 854). Question: How can I get Julia code review? Thanks, Davide On Saturday, October 25, 2014 3:43:56 PM UTC+1, Isaiah wrote: > > I missed this but it looks like you got it sorted, yes? Using > fann_create_train_array > and taking pointers to the Julia array wil

[julia-users] I am failing in wrapping FANN

2014-10-21 Thread Davide Lasagna
unable to read the same data that was written, and I am thus unable to train a network on that data. Can you please give me some advice on how to proceed further, I might just have taken the wrong way. I might have forgotten to say something here, so please ask further details. Cheers, Davide

Re: [julia-users] least squares algorithm

2014-09-26 Thread Davide Lasagna
Thanks Tim Davide On Thursday, September 25, 2014 2:35:43 PM UTC+1, Tim Holy wrote: > > Just FYI: you can easily find out the answer for yourself like this, > > julia> A = rand(5,4) > 5x4 Array{Float64,2}: > 0.248302 0.330028 0.893083 0.390297 > 0.0306052 0.29

Re: [julia-users] least squares algorithm

2014-09-25 Thread Davide Lasagna
Thank you Andreas. Sooner or later one needs to have a precise idea of what is going on behing the scenes. Having a reference to the relevant lapack function is fine. Davide

[julia-users] least squares algorithm

2014-09-25 Thread Davide Lasagna
Hi, Is there a reference to the algorithm used for solution of least-squares problems like A\b, with A \in R^{m \times n} and b \in R^m ? Documentation says it uses a decomposition to bidiagonal form, but it would be nice to have a more precise reference to that. Thanks, Davide

[julia-users] Re: unwanted behaviour in logical indexing

2014-08-18 Thread Davide Lasagna
Useful reading! Thanks! On Monday, August 18, 2014 1:36:24 PM UTC+1, Johan Sigfrids wrote: > > Maybe you are running into #5187 > <https://github.com/JuliaLang/julia/issues/5187>? > > On Monday, August 18, 2014 3:11:44 PM UTC+3, Davide Lasagna wrote: >> >>

[julia-users] unwanted behaviour in logical indexing

2014-08-18 Thread Davide Lasagna
to emit a sort of warning. Davide

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
For future reference, the Github issue is here <https://github.com/JuliaLang/julia/issues/7385>. Davide On Monday, June 23, 2014 6:35:32 PM UTC+1, Davide Lasagna wrote: > > Ok, > > I will open an issue > > Davide > > On Monday, June 23, 2014 3:49:12 PM UTC+1, I

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
Ok, I will open an issue Davide On Monday, June 23, 2014 3:49:12 PM UTC+1, Isaiah wrote: > > The problem here is that the underlying ios implementation is only valid > for files. Please open an issue. > > julia> iswritable("/foo") > false > > > On Mon

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
White wrote: > > This seems hard to know without also seeing the output of `ls -l /` >> >> — John >> >> On Jun 23, 2014, at 7:06 AM, Davide Lasagna wrote: >> >> Hi, >> >> Is this a bug? >> >> julia> iswritable("/") >> true >> >> (running from repl as normal user) >> >> Davide >> >> >> ​ >

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
davide@arcturus - ~$: ls -l / total 52 lrwxrwxrwx 1 root root 7 Jun 4 15:39 bin -> usr/bin drwxr-xr-x 3 root root 4096 Jun 13 11:06 boot drwxr-xr-x 18 root root 3260 Jun 20 11:34 dev drwxr-xr-x 89 root root 4096 Jun 18 16:36 etc drwxr-xr-x 7 root root 4096 May 27 10:11 h

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
The output is my linux root folder: /bin, /boot, On Monday, June 23, 2014 3:07:12 PM UTC+1, John Myles White wrote: > > This seems hard to know without also seeing the output of `ls -l /` > > — John > > On Jun 23, 2014, at 7:06 AM, Davide Lasagna > wrote: >

[julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
Hi, Is this a bug? julia> iswritable("/") true (running from repl as normal user) Davide

[julia-users] Re: Parametric type and typealiases

2014-06-19 Thread Davide Lasagna
00)) > FieldObj{2}(100x100 Array{Float64,2}: … > > julia> VectorField(ones(100,100)) > ERROR: no method FieldObj{3}(Array{Float64,2}) > > Typically, I try not to define inner methods as the default ones are very > useful. But in this case, it may be what you're after.

[julia-users] Parametric type and typealiases

2014-06-19 Thread Davide Lasagna
ata, default_meta()) end which works. Now, I have two questions: 1) Is there a way to avoid defining all the constructors explicitly by hand, say with an @eval block? 2) Why do I need to define these at all? What is "exactly" a typealias then? Thank you. Davide

[julia-users] Re: modules, include and export

2014-06-10 Thread Davide Lasagna
too much _s in JUlia code. Davide On Monday, June 9, 2014 10:32:23 PM UTC+1, Patrick O'Leary wrote: > > Use the "using" keyword instead of the "import" keyword, in conjunction > with your (correct) intuition about "export". > > modu

[julia-users] modules, include and export

2014-06-09 Thread Davide Lasagna
should have added an export foo to make it accessible to the outside, but the include function is making everything in file.jl visible. Thanks, Davide

[julia-users] slicing a 2d array

2014-05-20 Thread Davide Lasagna
Hi, Probably it is because I come from a numpy world, but why does slicing by column differs from slicing by row? a = ones(Float64, (10, 10)) println(typeof(a[1, :])) # this gives Array{Float64,2} ( i expected a 1d array ) println(typeof(a[:, 1])) # this gives Array{Float64,1} Davide

[julia-users] Re: Problem with Composite type definition

2014-05-20 Thread Davide Lasagna
)) end end This results in the same kind of "no method" error, like: MyType(zeros(Float64, 5), ["param"=>2.0]) Why this? Any solution? Thanks, Davide On Monday, May 19, 2014 11:55:24 PM UTC+1, Ethan Anderes wrote: > > Your right…. > > ["pa

[julia-users] Problem with Composite type definition

2014-05-19 Thread Davide Lasagna
,Float64}) while loading In[4], in expression starting on line 1" As far as I understand, by reading the documentation regarding parametric composite types, the error is raised because Dict{ASCIIString, Float64} is not a subtype of Dict{ASCIIString, Number}. What is the approach to cope with this problem? Thanks, Davide