[julia-users] Why does Julia include an older version of git in it?

2015-11-28 Thread Arin Basu
Hi All, As I wrote earlier, yesterday I offered a workshop on introducing Julia at my university. After the workshop, one of the attendees asked me this question: " It turns out that Julia version 0.4.1 has git packaged with it: *shell> **which git*

[julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread Aleksandr Mikheev
Oh, really thank you, Eric. Now I see. One additional question, if possible. If I use something like this: type A A1::Int64 A2::Int64 end I can expect that one element of type A will occupy 128 (2*64) bits. But will happen in this situation? type A{T<:Integer} A1::T A2::T

[julia-users] Re: Understanding immutable type memory allocation

2015-11-28 Thread Kristoffer Carlsson
Accessing a field (assuming that the field is concrete) should have zero memory allocation no matter if you have a type or an immutable. The advantage with immutabe is that (under the hood) you don't need to dereference a pointer and the compiler can do other optimizations. Calling a function

Re: [julia-users] Efficiently constructing a sparse matrix

2015-11-28 Thread Christoph Ortner
Is this essentially as efficient as preallocating the correct size to begin with? Christoph On Wednesday, 25 November 2015 16:48:16 UTC, Tim Holy wrote: > > I = Int[] > J = Int[] > V = Float64[] > > while have_more_entries_to_add() > i, j, v = get_next_entry() > push!(I, i);

[julia-users] Understanding immutable type memory allocation

2015-11-28 Thread Nitin Arora
Consider the following immutable type: immutable SCpow{T<:AbstractFloat} pow1au::T powMin::T powMax::T peff::T powModCoffs :: Vector{T} degfac::T end now lets say, its defined inside a module called "FROST". I then define a variable "SCpower" of the type "SCpow" which has the

[julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread Aleksandr Mikheev
Oh, really thank you, Eric. Now I see. One additional question, if possible. If I use something like this: type A > A1::Int64 > A2::Int64 > end I can expect that one element of type A will occupy 128 (2*64) bits. But will happen in this situation? type A{T<:Integer} A1::T

[julia-users] Re: Julia Workshop at the ANZ Statistics Conference 2015, Christchurch

2015-11-28 Thread Arin Basu
Greetings Scott, Great to hear from you. I too was pleasantly surprised too at the turnout, and the audience was excellent. We had great discussions throughout the day (I originally planned between 9 AM - 3 PM, but we ended up at 5 PM). We had an excellent audience -- the members of course

Re: [julia-users] Re: Precompilation and functions with keyword arguments

2015-11-28 Thread Tim Holy
Nice detective work, Dan! Quite helpful. Best, --Tim On Wednesday, November 25, 2015 02:08:47 PM Dan wrote: > Further investigation suggests recompilation is happening. This raises > questions: > 1) why is there recompilation? > 2) why are the memory allocations associated not reported? > 3) is

[julia-users] Some questions about types, and removing elements.

2015-11-28 Thread Aleksandr Mikheev
Hi all. I have 3 questions. 1. I still don't understand what exactly parametric types do. I mean what is the reason to use type A{Int64} > A1::Int64 > A2::Int64 > end instead of type A > A1::Int64 > A2::Int64 > end ? Or am I misunderstanding something? 2. How should I use types like

[julia-users] Some questions about types and removing elements.

2015-11-28 Thread Aleksandr Mikheev
Hi all. I have 3 questions. 1. I still don't understand what exactly parametric types do. I mean what is the reason to use type A{Int64} > A1::Int64 > A2::Int64 > end instead of type A > A1::Int64 > A2::Int64 > end ? Or am I misunderstanding something? 2. How should I use types like

[julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread bernhard
I find the totalsizeof Module very helpful for such things: https://gist.github.com/avitale/0070b629b89350b39c21#file-totalsize-jl But in this case I am actually a little bit confused by the output of the code below. There is barely and difference between UInt8 and Int128 Maybe there are some

Re: [julia-users] Efficiently constructing a sparse matrix

2015-11-28 Thread Tim Holy
No, if you know the size to begin with, better to allocate to that size and use a standard for loop to set up the values. --Tim On Saturday, November 28, 2015 12:17:03 AM Christoph Ortner wrote: > Is this essentially as efficient as preallocating the correct size to begin > with? > Christoph >

Re: [julia-users] Some questions about types, and removing elements.

2015-11-28 Thread Yichao Yu
On Sat, Nov 28, 2015 at 3:37 AM, Aleksandr Mikheev wrote: > > > Hi all. I have 3 questions. > > > 1. I still don't understand what exactly parametric types do. I mean what is > the reason to use > >> type A{Int64} >> A1::Int64 >> A2::Int64 >> end > > > instead of > >> type

[julia-users] Re: Why does Julia include an older version of git in it?

2015-11-28 Thread Sisyphuss
Related: https://groups.google.com/forum/?fromgroups=#!topic/julia-users/LBb08MDWu4U On Saturday, November 28, 2015 at 10:28:29 AM UTC+1, Arin Basu wrote: > > Hi All, > > As I wrote earlier, yesterday I offered a workshop on introducing Julia at > my university. After the workshop, one of the

[julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread Eric Forgy
Hi Aleksandr, 1. I still don't understand what exactly parametric types do. I mean what is the reason to use type A{Int64} A1::Int64 A2::Int64 end instead of type A > A1::Int64 > A2::Int64 > end ? On Saturday, November 28, 2015 at 4:38:41 PM UTC+8, Aleksandr Mikheev wrote: > > Hi all. I

[julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread Eric Forgy
Hi Aleksandr, Some comments below... On Saturday, November 28, 2015 at 4:38:41 PM UTC+8, Aleksandr Mikheev wrote: > > 1. I still don't understand what exactly parametric types do. I mean what > is the reason to use > > type A{Int64} > A1::Int64 > A2::Int64 > end > > > instead of > >

Re: [julia-users] Re: Some questions about types and removing elements.

2015-11-28 Thread Tim Holy
If you use `type` then it gets stored by reference, if you use `immutable` it gets packed as you are expecting. --Tim On Saturday, November 28, 2015 02:24:24 AM bernhard wrote: > I find the totalsizeof Module very helpful for such things: >

Re: [julia-users] Understanding immutable type memory allocation

2015-11-28 Thread Tim Holy
Yes to all. The only time you'd get allocations from those operations is if julia can't infer the type, and you've defined SCpow correctly to prevent that from being a problem. --Tim On Saturday, November 28, 2015 12:16:36 AM Nitin Arora wrote: > Consider the following immutable type: > >

[julia-users] Automatic differentiation of mapping from R^N to R^N?

2015-11-28 Thread Patrick Kofod Mogensen
So I have a map from a set of strategies of players to the best response of each player given the original strategies (a discrete probability distribution for each player). I want to find the jacobian of this mapping, because I need to calculate the spectral radius of it. I am using finite

[julia-users] equivalent of fseek?

2015-11-28 Thread Rajn
Is there an fseek in Julia which returns to an offset from the beginning of the buffer during a binary file read? Would seekstart followed by seek or skip work? I understand that stream is not the same as file in read()? Thanks

[julia-users] Funny object wrapper in Julia

2015-11-28 Thread Olli Väinölä
Hello! I've been using Julia for a half a year at the moment and I really like it. In the past I've been using mainly Python, C++ and JavaScript in which objects are necessary. This morning me and my friend Jukka started tinkering with Julia: we were wondering can you use JavaScript syntax.

[julia-users] slow wordcount

2015-11-28 Thread Attila Zséder
Hi, i'm new to Julia and wrote a baseline implementation of word count, that counts words, and writes them to stdout sorted by counts (highest first), and when tie, using alphabetical order. My code is here: https://github.com/juditacs/wordcount/blob/master/julia/wordcount.jl Half of the time is

[julia-users] Sampling from GIG

2015-11-28 Thread lmescheder
Hi, I've started using Julia for some machine learning tasks and love it so far. Currently I need to sample from a generalized inverse Gaussian distribution [1], where p=1. However, it seems the Distribution is not implemented in the Distributions.jl package. Does anyone know if there exists an

[julia-users] Where does all the time go?

2015-11-28 Thread Thomas Hatch
First off, Julia is fantastic! I am just trying to figure out out something odd I am seeing with the time() function. if I write this code in julia: tic() start = time() sleep(1) done = time() toc() println(done - start) I get this output elapsed time: 1.092225041 seconds

[julia-users] Overwriting Functions

2015-11-28 Thread Curtis Vogt
I've been working on a package Mocking.jl which allows developers to temporarily overwrite a method in order to facilitate testing. I've got everything working pretty well with the exception of the creation of a new macro which is suppose to ensure that

[julia-users] Need help building Julia on Ubuntu 14.04

2015-11-28 Thread Ajay Kumar
Dear all I am trying to build Julia with more than one processor on my PC. I am working on an Ubuntu 14.04 OS by using VMWare. I am following the instructions as mentioned in https://github.com/JuliaLang/julia I am not sure of what they mean by saying be sure to configure your system with the

[julia-users] slow sort with string secondary keys

2015-11-28 Thread Attila Zséder
Hi, i'm new to Julia and wrote a baseline implementation of word count, that counts words, and writes them to stdout sorted by counts (highest first), and when tie, using alphabetical order. My code is here: https://github.com/juditacs/wordcount/blob/master/julia/wordcount.jl Half of the time

Re: [julia-users] Re: Why does Julia include an older version of git in it?

2015-11-28 Thread Keno Fischer
Git 1.8.5.6 was released in 2014 so it's not that old. I suppose the versions wasn't bumped further because there weren't any problems with it, as the package manager can't rely on newer git features anyway (because we support systems with older git versions installed by the user). It should be

[julia-users] Re: Where does all the time go?

2015-11-28 Thread Seth
Probably has to do with global scope. Try putting it in a function: julia> function f() tic() start = time() sleep(1) done = time() toc() println(done - start) end f (generic function with 1 method) julia> f() elapsed time: 1.003258943 seconds

[julia-users] Re: Automatic differentiation of mapping from R^N to R^N?

2015-11-28 Thread Kristoffer Carlsson
https://github.com/JuliaDiff/ForwardDiff.jl does this. I use it all the time to compute jacobians of R^N -> R^N functions (the jacobian of the residual equations in non linear material modeling). On Saturday, November 28, 2015 at 5:41:55 PM UTC+1, Patrick Kofod Mogensen wrote: > > So I have a

[julia-users] Re: Where does all the time go?

2015-11-28 Thread Cedric St-Jean
Also - run it more than once. On the first call to `sleep`, julia has to compile it, because julia is JIT'ed. On Saturday, November 28, 2015 at 12:34:25 PM UTC-5, Seth wrote: > > Probably has to do with global scope. Try putting it in a function: > > julia> function f() >tic() >

Re: [julia-users] Understanding immutable type memory allocation

2015-11-28 Thread Yichao Yu
On Sat, Nov 28, 2015 at 4:03 PM, Nitin Arora wrote: > Thanks Kris and Tim. I assume the nested immutable type reference is also > efficient then? > > Also, I still am confused about type argument behavior because according to > the documentation: > > "An object with an

Re: [julia-users] Understanding immutable type memory allocation

2015-11-28 Thread Milan Bouchet-Valat
Le samedi 28 novembre 2015 à 16:40 -0500, Yichao Yu a écrit : > On Sat, Nov 28, 2015 at 4:03 PM, Nitin Arora > wrote: > > Thanks Kris and Tim. I assume the nested immutable type reference > > is also efficient then? > > > > Also, I still am confused about type argument

[julia-users] Re: Where does all the time go?

2015-11-28 Thread Kristoffer Carlsson
On second call I get: elapsed time: 1.003745561 seconds

Re: [julia-users] slow sort with string secondary keys

2015-11-28 Thread Tim Holy
AbstractString is, as the name suggests, an abstract type. That's bad news for performance, see the FAQ. Try using a concrete type like ASCIIString or UTF8String. --Tim On Wednesday, November 25, 2015 06:26:08 AM Attila Zséder wrote: > Hi, > > i'm new to Julia and wrote a baseline

Re: [julia-users] CUDArt gc

2015-11-28 Thread Tim Holy
Are you sure you're not being fooled by asynchronous operations? launch doesn't wait for the kernel to finish before returning. Since gc is a slow call, you're presumably just giving the GPU time to catch up on its queue, which creates the opportunity to schedule more operations. In other

Re: [julia-users] Understanding immutable type memory allocation

2015-11-28 Thread Nitin Arora
Thanks Kris and Tim. I assume the nested immutable type reference is also efficient then? Also, I still am confused about type argument behavior because according to the documentation: "An object with an immutable type is passed around (both in assignment statements and in function calls) by

[julia-users] Re: Automatic differentiation of mapping from R^N to R^N?

2015-11-28 Thread Patrick Kofod Mogensen
Thanks for the hint, I will have to look at bit closer at this. I can run my function, say phi(), on a vector, say P, and get the proper best response out. But when I try to use ForwardDiff.Jacobian, I get ERROR: InexactError() in setindex! at array.jl:313 in copy! at abstractarray.jl:307 in

[julia-users] Re: Automatic differentiation of mapping from R^N to R^N?

2015-11-28 Thread Kristoffer Carlsson
You are most likely trying to copy a "gradient number" into a vector that only takes Floats or something. If you initialize your vector with zeros(10) or something, you should instead initialize it like zeros(eltype(x), 10) where x is your input vector.

[julia-users] Re: Need help building Julia on Ubuntu 14.04

2015-11-28 Thread Waldir Pimenta
To be fair, it's quite easy to miss. Are there objections to include it explicitly (as a command) before the git checkout command? On Saturday, November 28, 2015 at 9:58:59 PM UTC, ele...@gmail.com wrote: > > > > On Sunday, November 29, 2015 at 3:19:28 AM UTC+10, Ajay Kumar wrote: >> >> Dear all

[julia-users] Re: tip for using Julia on OS X

2015-11-28 Thread David P. Sanders
El sábado, 28 de noviembre de 2015, 15:00:50 (UTC-6), Kevin Owens escribió: > > tl;dr: how to make a symbolic link in OS X. > > So, if you don't want to build Julia from source, you can download the > .app on OS X. For me, this doesn't work well because it opens Terminal when > I double click

[julia-users] slow wordcount

2015-11-28 Thread Lampkld
Maybe it's the lambda? These are slow in julia right now.