[julia-users] julia in Sublime without IJulia functionality

2014-10-12 Thread Michael Borregaard
Hi, I use Sublime, and am curious about Julia. I have installed the Sublime-IJulia package, and it works (OS X). But I find the notebook 'I' framework confusing, slow and clumsy. My mistake, I know, I am sure it works well for most people, but I prefer a workflow with a separate script and

[julia-users] track progress to 0.5

2015-11-04 Thread Michael Borregaard
I am using Julia 0.4, compiling from the release-0.4 branch on github. Considering using 'master' instead, but - is there somewhere that lists the planned and implemented changes to the dev version at once?

[julia-users] force recompilation of package at update

2015-11-04 Thread Michael Borregaard
Hi, when I load a package that has been updated, it usually recompiles for a long time (e.g. Gadfly). I would like this time to be at the time of updating (where I am not actively working in Julia) rather than at 'using', where I am actively working. Is there a setting to automatically

[julia-users] rownames in data matrices

2015-09-08 Thread Michael Borregaard
Hi, I am learning julia, and thought I would practice by migrating some of my code from R. I run into the problem that the data structures in julia does not seem to offer row names? I looked here in the forum and found a 2 year old discussion, that seems to end of the, IMHO slightly imprecise

[julia-users] Strange behaviour when adding floating numbers

2015-09-03 Thread Michael Borregaard
Hi, in the Julia documentation, I fell over this strange behaviour: julia> 1.1 + 0.1 1.2002 I understand that this may make sense in the context of how floating numbers are implemented inside Julia - but I cannot think of a single situation in which the user would want this

[julia-users] Re: Strange behaviour when adding floating numbers

2015-09-03 Thread Michael Borregaard
skrev Michael Borregaard: > > Hi, > in the Julia documentation, I fell over this strange behaviour: > > julia> 1.1 + 0.1 > 1.2002 > > I understand that this may make sense in the context of how floating > numbers are implemented inside Julia - but I cannot

[julia-users] return 2D (or nD) array from function

2015-09-15 Thread Michael Borregaard
Hi, I am trying to migrate from R to julia. I am trying to wrap my head around: In R, there are the apply functions - when used with, e.g. a function that returns a 1d array of constant length, they will return a 2d array with the results. In julia, using map() will return a Array{Array{T, 1},

[julia-users] constrain arguments in function

2015-09-15 Thread Michael Borregaard
Is there a way in julia to restrict the values of arguments to a function, eg to the contents of a certain vector? So, e.g. method in the function function foo(x, method::String) ... would be constrained to either "spearman", "pearson" or "kendall"? Thanks

[julia-users] fixing aspect ratio in Compose.jl

2015-09-28 Thread Michael Borregaard
Hi, does anyone know how to fix the aspect ratio in a compose canvas? Gadfly can do it with ```coords.Cartesian(fixed = true)```, which uses Compose, but how to do it for that? thanks, M

[julia-users] Strange behaviour on type dependency of function

2016-01-04 Thread Michael Borregaard
Hi, I have a function MarginsRnd. When I try to use the function, it complains that the types are not correct - but I do not see why. Restarting Julia and reloading the function does not work. The problem seems to be in a strangely defined method. When I run whos() I get: whos()

[julia-users] Re: Strange behaviour on type dependency of function

2016-01-05 Thread Michael Borregaard
And there was the error! SOLVED! The problem was the keyword argument bIN::Array{Int64, 2} = zeros(1,1) , which should have been bIN::Array{Int64, 2} = zeros(Int, 1,1) Best, Michael Den tirsdag den 5. januar 2016 kl. 10.33.32 UTC+1 skrev Michael Borregaard: > > I think maybe the

[julia-users] Re: Strange behaviour on type dependency of function

2016-01-05 Thread Michael Borregaard
The problem is - I never call __MarginsRnd#2__ ! I have no idea where that list of arguments may be coming from. I am sorry, but I do not even understand why I get an automatically created __MarginsRnd#2__ method when the MarginsRnd function only has 1 method?

[julia-users] Re: Strange behaviour on type dependency of function

2016-01-05 Thread Michael Borregaard
inkhorn", cflag::ASCIIString = "descend", bIN::Array{Int64, 2} = zeros(1,1), doA = true) Den tirsdag den 5. januar 2016 kl. 09.59.35 UTC+1 skrev Michael Borregaard: > > The problem is - I never call __MarginsRnd#2__ ! I have no idea where that > list of arguments m

[julia-users] Re: multiple methods with keyword arguments?

2016-01-05 Thread Michael Borregaard
oo(1.0,false) > 100.0 > foo(1.0,"grue") > ERROR > > > > On Tuesday, January 5, 2016 at 4:30:14 PM UTC-5, Michael Borregaard wrote: >> >> Hi, sorry I have a simple question, I have tried to RTFM. >> >> If I have a function with multiple method

[julia-users] multiple methods with keyword arguments?

2016-01-05 Thread Michael Borregaard
Hi, sorry I have a simple question, I have tried to RTFM. If I have a function with multiple methods and keyword arguments, all methods should share the same keyword args, right? How do I write this? function foo(a::Int; test = true) 2+a end function foo(a::AbstractFloat #how do I continue

[julia-users] Re: ANN: DC.jl - automagical linked plots in your IJulia Notebook

2016-06-08 Thread Michael Borregaard
Love it, thanks.

[julia-users] How do I find out which package is causing problems running Pkg.update()

2016-06-07 Thread Michael Borregaard
Hi, I cannot Pkg.update(), I get the error message: ERROR: ASTInterpreter can't be installed because it has no versions that support 0.4.5 of julia. You may need to update METADATA by running `Pkg.update()` in error at error.jl:22 in resolve at

[julia-users] Re: Compose.jl animation

2016-06-11 Thread Michael Borregaard
It is not a full answer, but you should check ctxpromise() for the size. I think the distribution is because the canvas is not square and you use relative positions to specify circle centers. You can set the size parameters in the context call. Sorry I realise this is really useless in terms of

[julia-users] polynomial terms in formula specification

2016-06-24 Thread Michael Borregaard
Sorry for asking a question that should be super-basic, but I have looked all over the internet for this for an hour now: How does one specify polynomial terms in glm models? In R, I would: y ~ x + I(x^2) Thanks! Michael

Re: [julia-users] if .. else on a whole array

2016-02-11 Thread Michael Borregaard
Note that both of these versions will return an array, allowing for type stability Den torsdag den 11. februar 2016 kl. 09.40.27 UTC+1 skrev Michael Borregaard: > > If you are worried about maintaining two versions, that can be solved > simply: > function foo(x::Vector{bar}) >

Re: [julia-users] if .. else on a whole array

2016-02-11 Thread Michael Borregaard
If you are worried about maintaining two versions, that can be solved simply: function foo(x::Vector{bar}) #the main code of your function end function foo(x::bar) foo([x]) end Den onsdag den 10. februar 2016 kl. 13.15.30 UTC+1 skrev Ferran Mazzanti: > > Thanks Mauro... > > using two

Re: [julia-users] if .. else on a whole array

2016-02-11 Thread Michael Borregaard
Really sorry, just saw this is identical to Mauro's suggestion :-/ Michael Den torsdag den 11. februar 2016 kl. 11.39.12 UTC+1 skrev Michael Borregaard: > > Thanks for clarifying that! > So do you suggest > [code] > function foo(x::bar) > #the function body > e

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

2016-02-12 Thread Michael Borregaard
Maybe a good time to repost this link: https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation

[julia-users] Re: Packaging Julia project for Open Respoducable Science

2016-02-11 Thread Michael Borregaard
In terms of scientific reproducibility, I do not think that saving a click-and-run package is necessarily the best way to further that. What about unstated assumptions in your code, or (shiver) bugs? IMHO, submitting human-readable (i.e. annotated) source code is a stronger way to ensure

Re: [julia-users] Adding the same functionality / variables into many functions

2016-02-25 Thread Michael Borregaard
I am relieved to hear you what not use it in practice, I was trying really hard to grasp the utility of it :-) It is a very elegant piece of code, though. Den torsdag den 25. februar 2016 kl. 01.18.16 UTC+1 skrev Tom Breloff: > > I think he was just referring to the fact that it's "one more

Re: [julia-users] Re: Ambiguous method definitions

2016-04-20 Thread Michael Borregaard
There are many cases where it is convenient to be able to give 0 kwargs. Is it not better to test for isempty(a) when the behavior is undefined for 0 arguments?

[julia-users] convert array elements

2016-05-12 Thread Michael Borregaard
I am trying to convert from R to Julia, as i really like Julia and the nice development going on here. But there are certain operations that are a lot more complicated to do in Julia, even though they are mainstay (I will do the several times every day). But I am in doubt if I just don't know

Re: [julia-users] Re: Lack of an explicit return in Julia, heartache or happiness?

2016-05-25 Thread Michael Borregaard
To me, the suggested change seems to conflict intuitively with julia syntax. When using Julia at the REPL all expressions return a value, which is confusing at first when coming from othe languages but quickly becomes a feature. That a function also returns the value of the last statement seems

Re: [julia-users] Array of Strings

2016-08-12 Thread Michael Borregaard
So in answer to your question you would write function hello_array{T<:AbstractString}(dat::Vector{T}) map(println, dat) end

[julia-users] Re: polynomial terms in formula specification

2016-06-27 Thread Michael Borregaard
Thanks for responding, both, it is particularly great to get an answer from the father of mixed models in R and julia! I do have to say I find the functionality slightly disappointing, though. I had done what was in the suggested solution, but thought of it as an unpleasant workaround. Can

Re: [julia-users] R code to Julia Performance issues with pmap

2016-07-06 Thread Michael Borregaard
I am not seeing your speed-up in R? elapsed is less time, but user significantly more, and it is the sum that counts. When executing in parallel the language needs to copy the data to the workers. If the matrices are large, that takes longer than the speedup of the parallel execution. See what

Re: [julia-users] precompiling all packages

2016-08-09 Thread Michael Borregaard
AFAIK none of these threads provided an easy and clear resolution. The latest I could find () ended up with a reques to define a `Pkg.precompile()` function, but I have not seen that anything new has happened since.

[julia-users] Re: JupyterLab

2016-08-16 Thread Michael Borregaard
I could get a Julia 'console' working, which is like an IPython console, i.e. no graphics or markdown. It had an option to change kernel (for the notebook I assume) but I couldn't get it to work straight away. Other people might, or it will be working soon. In the presentation they stressed

[julia-users] When can the broadcast dot (in 0.5) be used?

2016-08-18 Thread Michael Borregaard
I have a hard time figuring out what functions and types accept the broadcast dot in 0.5. E.g., is(1, 2)# false is.([1, 2], 2) # Bool[false, true] is("a", "b")#false is.("["a","b"], "b")#MethodError: no method matching size(::String) Can anyone give me

[julia-users] Re: When can the broadcast dot (in 0.5) be used?

2016-08-18 Thread Michael Borregaard
Please ignore the erroneous first " in the last code line.

Re: [julia-users] "Namespaces" for accessing fields of composite types

2016-09-05 Thread Michael Borregaard
> For a toy example like this, this is reasonable advice. I know you were not after advice, but wanted to suggest a design change to Julia. I thought Yichao Yu gave a nice response to that, and I am looking forward to see the developments he promises. I just thought I would point out an

Re: [julia-users] Re: How to shuffle the order of matrix by rows

2016-09-08 Thread Michael Borregaard
I would just using StatsBase function shufflerows(a::AbstractMatrix) n = size(a, 1) ord = sample(1:n, n, replace = false) a[ord,:] end a = rand(5,5) shufflerows(a)

Re: [julia-users] "Namespaces" for accessing fields of composite types

2016-09-01 Thread Michael Borregaard
To do something like this in Julia, there are several possibilities, depending what you want to achieve. You could abstract Cat # we decide hat cat will always have an age variable type Tiger <: Cat age::Int end meow(c::Cat) = println(c.age) # then you can tigre = Tiger(5) meow(tigre)

[julia-users] Re: Maps in Julia?

2016-09-09 Thread Michael Borregaard
You can open esri shapefiles with shapefiles.jl. There is a plotting function for shapefiles in plotrecipes.jl. You can layer shapefiles to create vector maps. I am happy to help out if you want to use this.

Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Michael Borregaard
Thanks for the prompt response, I will go with that then :-) I actually thought later that I may avoid some of the clutter in approach 2 by adding another level of indirection: abstract AbstractFoo type FooData bar baz #... several other fields end type FoobarData barbaz bazbaz

Re: [julia-users] code design question – best ideomatic way to define nested types?

2016-09-13 Thread Michael Borregaard
Thanks for the enlightening discussion. The emerging consensus is to use example #2, but perhaps use macros to make the syntax easier to read and maintain. Alternatively, it looks like my idea with having a FoobarData object as a field would do the job (but would require

[julia-users] julia installation broken

2016-09-16 Thread Michael Borregaard
Hi, Is this the right forum for troubleshooting / issues with my julia install? I have kept having problems with packages giving error on precompile, rendering julia unusable. I then reinstalled julia-0.5-rc4, and removed my .julia folder from my home dir to do a fresh install. Now, Julia

[julia-users] code design question – best ideomatic way to define nested types?

2016-09-12 Thread Michael Borregaard
Hi, I am defining a set of types to hold scientific data, and trying to get the best out of Julia's type system. The types in my example are 'nested' in the sense that each type will hold progressively more information and thus allow the user to do progressively more. Like this: type Foo

[julia-users] Re: Slow Performance Compared to MATLAB

2016-09-13 Thread Michael Borregaard
That is a pretty massive script to ask people to look at for performance :-) Try profiling it and identify the most expensive code and post that, that will be much easier to give feedback on.

[julia-users] Re: Workflow question - reloading modules

2016-09-13 Thread Michael Borregaard
Maybe this is useful: https://github.com/JunoLab/atom-julia-client/blob/master/manual/workflow.md

Re: [julia-users] Is there a way to use values in a DataFrame directly in computation?

2016-10-05 Thread Michael Borregaard
This is good news, and I am holding my breath for this to be succesful! As someone from a data-rich science (Ecology), a really good way of interacting directly with data is the make-or-break for whether I will be able to persuade my colleagues to make the shift to julia.

[julia-users] Re: Maps in Julia?

2016-09-22 Thread Michael Borregaard
Yeesian, this looks really promising! It will be great to follow the progress of this.

[julia-users] Re: JupyterLab

2016-08-23 Thread Michael Borregaard
They have updated to 0.2. It works fine for me, I just had to get used to that to start a julia notebook, I have to first open a new Notebook that opens with the Python2 kernel, and the 'switch kernel'.

[julia-users] Re: Which data structure do you suggest for handling this data?

2016-10-26 Thread Michael Borregaard
That depends a lot on what analyses you want to do with it afterwards - you could have an array (of species) of an array (of points) of tuples (the x and y), which is the most straigthforward thing. For must uses I would probably use a sparse Boolean matrix, e.g. visits = [sparse([1,4,8],

Re: [julia-users] Re: so many plotting packages

2016-10-29 Thread Michael Borregaard
Independent approaches and a large number of largely experimental packages is the nature of open source development, yes, and may provide lots of creative new solutions. But to keep a technical language useful and attractive I think it is a very big advantage if there are defined standards,

Re: [julia-users] Question: Forcing readtable to create string type on import

2016-11-03 Thread Michael Borregaard
The result of CSV should be a DataFrame by default. What return type do you get?

[julia-users] Re: Cost of @view and reshape

2016-10-30 Thread Michael Borregaard
You can reshape the view. This should be cheap.

Re: [julia-users] Re: Julia and the Tower of Babel

2016-10-09 Thread Michael Borregaard
Great to see this brought up here, and to read the constructive and thought-provoking responses from members of the Julia community. I feel this is highly important and I have thougt a lot about it recently, as I am writing an invited guest editorial for a leading ecological journal about how