[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package . 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: > > is_nash_equilibrium(po) = >

[julia-users] Re: Broadcast slices

2016-09-25 Thread Davide Lasagna
Hi Brandon, you might find some inspiration from this package . 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: > > is_nash_equilibrium(po) = >

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

2016-09-07 Thread Davide Lasagna
Hi, I am working on adding a new feature to the Sundials.jl package. I want to be able to pass the right-hand-side jacobian to the solver as Julia callback and avoid expensive calculation of the jacobian using the internal finite-difference

[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 be the for the

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

[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
epresents "a > really small negative number" that can't be represented exactly using > floating point. > > On Saturday, July 9, 2016, Davide Lasagna <lasagn...@gmail.com > > wrote: > >> Hi, >> >> I have just been bitten by a function hashing

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

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 <j1pi...@gmail.com > > wrote: > > > > > > torstai 23. kesäkuuta 2016 21.18.22 UTC+3 Davide Lasagna kirjoitti: &

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

2016-06-23 Thread Davide Lasagna
>> Most "iterator" 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 <lasagn...@gmail.com

[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 <lasagn...@gmail.com > > wrote: > >> I

[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

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 <lasagn...@gmail.com > > wrote: > > Hi, > > > > How do package developers write code that is specific to different julia &g

[julia-users] package management

2016-05-31 Thread Davide Lasagna
Hi, How do package developers write code that is specific to different julia versions? For example, is anything like this: if VERSION < v"0.5-dev" f(x) = code_that_runs_on_v0.4() else f(x) = code_that_runs_on_v0.5() end recommended or is there a better way? My use case is a

[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
ator-precedence > > That is, since `\` is higher precedence than `:`, your initial line is > being parsed as `(randn(3, 3)\1):3`, so the error seems to be correct. > > Cheers, > Josh > > On May 22, 2016 at 17:31:36, Davide Lasagna (lasagn...@gmail.com > ) wrote: > > Hi,

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

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 <lasagn...@gmail.com > > wrote: > > Hi, > > > > Is there any particular reason why subscripts such as \_n are not > defined > &

[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
Hi, shouldn't this be allowed? append!(some_int_array, repeated(1, 10)) ERROR: MethodError: `append!` has no method matching append!(::Array{Int64,1}, ::Base.Take{Base.Repeated{Int64}}) Closest candidates are: append!{T}(::Array{T,1}, ::AbstractArray{T,1}) The same with zip, drop,

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

2016-05-11 Thread Davide Lasagna
a 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,

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 repres

[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

[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
: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}

[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

[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

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

2016-04-04 Thread Davide Lasagna
Hi all, Look at the following code: using Benchmarks const Nf = 1_000_000 immutable PolygonalFace{T, N} points::NTuple{N, UInt32} area::T end @inline area(p::PolygonalFace) = p.area function make_abstract_faces(Nf) faces = PolygonalFace{Float64}[] for i = 1:Nf N =

[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})

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

2016-02-19 Thread Davide Lasagna
Cool trick, thanks. I had a similar problem and ended up defining methods with the Val{} argument for dispatch on different values. I was not entirely happy with it, though, because of all the extra typing of parenthesis. Will try adding an inlined calling method. How in practice would you go

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
,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>. > > On Tuesday,

[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

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 <lasagn...@gmail.com > > wrote: > >> Sorry to dig up this old

[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

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

2015-12-07 Thread Davide Lasagna
Cool! Thanks

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?

[julia-users] permuting rows of a matrix

2015-03-11 Thread Davide Lasagna
Hi, permute!(v, p) permutes the elements of v according to the permutation vector p. Is there any equivalent built in function for permuting rows of a matrix? Given the memory layout of julia matrices it should not be too difficult to have a similar function for matrices as well. Thanks,

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

2015-03-11 Thread Davide Lasagna
-of-place copy. --Tim On Wednesday, March 11, 2015 07:09:38 AM Davide Lasagna wrote: 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

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

2015-03-11 Thread Davide Lasagna
, Davide Lasagna lasagn...@gmail.com javascript: wrote: Hi, permute!(v, p) permutes the elements of v according to the permutation vector p. Is there any equivalent built in function for permuting rows of a matrix? Given the memory layout of julia matrices it should

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, p) permutes the elements of v according

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

[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 The documentation

Re: [julia-users] running multiple commands

2014-11-08 Thread Davide Lasagna
, 2014 at 9:03 PM, Davide Lasagna lasagn...@gmail.com javascript: wrote: Hi, just wondering why I cannot chain these kind of multiple commands in julia. Example: the command run(`mkdir $tmp touch $file`) creates the directories $tmp, touch and $file, while I only want the second part

[julia-users] running multiple commands

2014-11-07 Thread Davide Lasagna
Hi, just wondering why I cannot chain these kind of multiple commands in julia. Example: the command run(`mkdir $tmp touch $file`) creates the directories $tmp, touch and $file, while I only want the second part after to run if first command is successful. Similarly if I use the ; to

[julia-users] atan2 ?

2014-11-07 Thread Davide Lasagna
Hi The documentation for atan2 says: atan2(*y*, *x*) Compute the inverse tangent of y/x, using the signs of both x and y to determine the quadrant of the return value. Ok, so far so good: atan2(0, 1) = 0 and atan2(1, 0) = pi/2. It works, However, listing the methods of atan2 shows

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

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

2014-10-27 Thread Davide Lasagna
Hi all, I have created a Julia wrapper for the Fast Artificial Neural Networks C library (http://leenissen.dk/fann/wp/) http://leenissen.dk/fann/wp/, in the hope it will be useful for someone else. You can find it in this https://github.com/gasagna/FANN Github repo. Any comments, testing and

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

2014-10-26 Thread Davide Lasagna
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. -- John On Oct 25, 2014, at 11:33 AM, Davide Lasagna lasagn...@gmail.com javascript: wrote: Hi

[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

[julia-users] I am failing in wrapping FANN

2014-10-21 Thread Davide Lasagna
Hi all, I am currently working on Neural Networks and I wanted to wrap the FANN C library http://leenissen.dk/fann/wp/ using Julia. I just started my work so things are spread around in bits and pieces. I have first wrapped the library using Clang.jl to automatically generate the Julia

Re: [julia-users] least squares algorithm

2014-09-26 Thread Davide Lasagna
) and then look at the function definition. --Tim On Thursday, September 25, 2014 06:12:39 AM Davide Lasagna wrote: 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

[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

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] unwanted behaviour in logical indexing

2014-08-18 Thread Davide Lasagna
Hi all, Is this a bug or a feature? julia idx = [1:10] 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 julia idx .!= 2 idx .!= 8 10-element BitArray{1}: true false true true true true true true true true which appears wrong to me. However, by wrapping

[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: Hi all, Is this a bug or a feature? julia

[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

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 lasagn...@gmail.com javascript: wrote: Hi

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
15:51 tmp drwxr-xr-x 9 root root 4096 Jun 13 11:05 usr drwxr-xr-x 12 root root 4096 Jun 13 11:05 var On Monday, June 23, 2014 3:16:04 PM UTC+1, John Myles White wrote: Even with -l? — John On Jun 23, 2014, at 7:14 AM, Davide Lasagna lasagn...@gmail.com javascript: wrote

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
as `sudo julia`, `;whoami` returns `root`, so I don't think that's the problem. // T On Monday, June 23, 2014 4:07:12 PM UTC+2, 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 lasagn

Re: [julia-users] writable root directory?

2014-06-23 Thread Davide Lasagna
, 2014, at 7:06 AM, Davide Lasagna lasagn...@gmail.com 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
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, Isaiah wrote: The problem here

[julia-users] Parametric type and typealiases

2014-06-19 Thread Davide Lasagna
HI, Coming from the Python world is a big step, especially when dealing with parametric types and their constructors. But Julia looks so promising and it is so fun to code with that i do not give up. I have an issue, though. Say I define the following parametric type: type FieldObj{R}

[julia-users] Re: Parametric type and typealiases

2014-06-19 Thread Davide Lasagna
{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. On Thursday, June 19, 2014 1:14:40 PM UTC-4, Davide Lasagna wrote: HI, Coming from the Python world is a big step, especially when dealing

[julia-users] modules, include and export

2014-06-09 Thread Davide Lasagna
Hi all, I have a question about modules and I am probably missing something. Say that in file.jl I define functions foo and bar. I then create a file MyModule.jl where I include file.jl as: module MyModule include(file.jl) end At this point, in the REPL, doing import MyModule will give me

[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] Problem with Composite type definition

2014-05-19 Thread Davide Lasagna
Hi, I am starting with julia and stumbled upon this issue. Say I want to define this composite type type MyType data::Array{Float64, 1} meta::Dict{ASCIIString, Number} N::Int64 end where the data field will store some floats, meta will be a dict of metadata (from a simulation), and N