[julia-users] Re: Help to eliminate Calendar.jl dependence

2015-08-10 Thread Jeffrey Sarnoff
timestamp questions for Tom: (a) is the most refined temporal resolution of your timestamps milliseconds (1/1_000 seconds)? (b) do you ever get multiple items that have identical timestamps? (If so, what is the most you have seen.) (c) do you want your timestamp to be an integer (best), a

[julia-users] Add a new dict with 2 different types into a new array in a structured dict

2015-08-10 Thread Ian Butterworth
How can I add a dict with 2 different field types (1D array of float and float) to an array nested in a dict that already exists? The 'allmeas' structure already exists up to this point: allmeas[measkey][manreps][num_manrep] And I'm trying to add like this:

Re: [julia-users] is @inline redundant with fn(a::Int) = do_something(a) ?

2015-08-10 Thread Stefan Karpinski
If that's all there is to a definition it's pretty likely to get inlined, but you can write arbitrarily complex expressions, so it's not quite the same. I really don't think we should make using one-liner vs longer function form significant in terms of performance. That would encourage people

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Federico Calboli
Thanks! So something like git pull git checkout release-0.4 make should work... Any idea of when 0.4 will be out as stable (I know it is out as development)? Cheers F On Monday, 10 August 2015 16:50:12 UTC+3, Scott T wrote: In fact, I imagine there will be a release-0.4 branch instead

[julia-users] 0.4 used to load fast

2015-08-10 Thread Simon Danisch
You should try julia --precompile=yes . I never took the time to search why this was done, though.

[julia-users] Re: 0.4 used to load fast

2015-08-10 Thread J Luis
Thanks. But this should be the default behavior, no? segunda-feira, 10 de Agosto de 2015 às 15:33:22 UTC+1, Simon Danisch escreveu: You should try julia --precompile=yes . I never took the time to search why this was done, though.

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Scott T
Within the next month unless something unexpected happens, I'd say - you can follow discussion on the last few milestones here. https://github.com/JuliaLang/julia/milestones/0.4.0 Cheers, Scott On Monday, 10 August 2015 17:14:41 UTC+1, Federico Calboli wrote: Thanks! So something like git

Re: [julia-users] Really need to change immutables

2015-08-10 Thread Jameson Nash
but the problem now is that *TS* is a memory owned by Julia and that will be fatal when GMT's own memory cleaning functions try to free it and - Julia crashes. getting memory ownership right is absolutely critical when writing C interop code. It is also a place where Julia gives you a large

[julia-users] Re: 0.4 used to load fast

2015-08-10 Thread Steven G. Johnson
On Monday, August 10, 2015 at 11:46:17 AM UTC-4, J Luis wrote: Thanks. But this should be the default behavior, no? Apparently it's due to a bug (affecting backtraces) that will be fixed in LLVM 3.5: https://github.com/JuliaLang/julia/commit/f98decceb6437fb160a5da2666fe7845f7f4f73c

Re: [julia-users] Really need to change immutables

2015-08-10 Thread J Luis
usually, there's is one big toplevel distinction driven by who will free the memory: if C will be freeing the memory, then you must always have the C code also allocating the memory (hopefully the library author provide some sort of new / alloc / create function, although sometimes they

Re: [julia-users] is @inline redundant with fn(a::Int) = do_something(a) ?

2015-08-10 Thread Jeffrey Sarnoff
got it On Mon, Aug 10, 2015 at 12:38 PM, Stefan Karpinski ste...@karpinski.org wrote: If that's all there is to a definition it's pretty likely to get inlined, but you can write arbitrarily complex expressions, so it's not quite the same. I really don't think we should make using one-liner vs

[julia-users] Creating a show method for type alias

2015-08-10 Thread Ben Ward
Hi, I have implemented a basic immutable type with a type alias for a vector of said type: immutable CIGAR OP::Operation Size::Int end function CIGAR(op::Char, size::Int) return CIGAR(Operation(op), size) end function convert(::Type{String}, cigar::CIGAR) return

[julia-users] Re: 0.4 used to load fast

2015-08-10 Thread Simon Danisch
Ah okay, I suspected this. I wasn't convinced though. I compared the stack traces for precompiled=yes/no for the cases that really annoyed me and it seemed precompiled=no never gave better results. Guess I haven't hit the edge cases yet. But given these findings, I would greatly prefer

Re: [julia-users] Really need to change immutables

2015-08-10 Thread J Luis
and will I not fall in the same case as the *TS* above? That is, when I do the unsafe_store will that memory be owned by the C lib (and therefore safe to be free by it)? segunda-feira, 10 de Agosto de 2015 às 21:13:39 UTC+1, Jameson escreveu: right, you can't mutate it directly, but you can

RE: [julia-users] Re: 0.4 used to load fast

2015-08-10 Thread David Anthoff
I agree. In my mind bad backtraces are a bug, certainly that is how I as a user experience them, and we wouldn’t want to make a buggy but fast behavior the default. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Tony Kelman Sent: Monday, August 10,

Re: [julia-users] Really need to change immutables

2015-08-10 Thread J Luis
... amd I am using unsafe_load() S0 = unsafe_load(unsafe_load(TTABLE.segment,1),1)# ::GMT.GMT_TEXTSEGMENT https://github.com/joa-quim/GMT.jl/blob/master/src/gmt_main.jl#L860 but if I add this line after S0.n_rows = 2 ERROR: type GMT_TEXTSEGMENT is immutable in

Re: [julia-users] Really need to change immutables

2015-08-10 Thread Jameson Nash
right, you can't mutate it directly, but you can make a new copy with the intended changes, then use unsafe_store to write those changes back into the struct. On Mon, Aug 10, 2015 at 3:56 PM J Luis jmfl...@gmail.com wrote: ... amd I am using unsafe_load() S0 =

Re: [julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Stefan Karpinski
JLD doesn't support serializing functions but Julia itself does. On Mon, Aug 10, 2015 at 3:43 PM, Andrei Zh faithlessfri...@gmail.com wrote: I'm afraid it's not quite true, and I found simple way to show it. In the next code snippet I define function `f` and serialize it to a file: julia

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Tony Kelman
You would likely need at least `make clean`, probably `make cleanall` as well when switching between release-0.3 and the forthcoming release-0.4 branch. Many of the dependency versions have changed, though not all. It will likely be more reliable to at least rebuild the dependencies that have

Re: [julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Tim Holy
On Monday, August 10, 2015 01:13:15 PM Tony Kelman wrote: Should probably use some different extension for that, .jls or something, to avoid confusion. Yes. That has been sufficiently confusing in the past, we even cover this here:

[julia-users] Re: PSA: auto-precompile your modules

2015-08-10 Thread Seth
Sorry to follow up, but I've confirmed this is the case (it was also in the original announcement; sorry for overlooking it). In any case - during this testing phase, would it be possible to make __precompile__() work only for packages that have explicitly opted in, so that dependencies that

Re: [julia-users] Embarrassingly parallel workload

2015-08-10 Thread Júlio Hoffimann
What am I doing wrong in the following code? function foo(N; parallel=false) if parallel nprocs() CPU_CORES addprocs(CPU_CORES - nprocs()) end result = SharedArray(Float64, 9, N) @parallel for i=1:N sleep(1) result[:,i] = rand(3,3)[:] end result end If I call foo(60,

[julia-users] Re: PSA: auto-precompile your modules

2015-08-10 Thread Seth
Hi, I'm running into a weird problem that I think is related to precompilation. It seems that __precompile__() will attempt to precompile all dependencies as well (that is, if you're using Foo, Foo will get precompiled). Is this true? In my case, it appears that the precompilation in

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Sisyphuss
Great! On Monday, August 10, 2015 at 10:10:36 PM UTC+2, Tony Kelman wrote: You would likely need at least `make clean`, probably `make cleanall` as well when switching between release-0.3 and the forthcoming release-0.4 branch. Many of the dependency versions have changed, though not all.

[julia-users] Re: PSA: auto-precompile your modules

2015-08-10 Thread Seth
Issue filed: https://github.com/JuliaLang/julia/issues/12545 On Monday, August 10, 2015 at 2:18:25 PM UTC-7, Seth wrote: Sorry to follow up, but I've confirmed this is the case (it was also in the original announcement; sorry for overlooking it). In any case - during this testing phase,

Re: [julia-users] Computer Vision Package

2015-08-10 Thread Andrei Zh
but I might still need a layer between Images.jl and my package because most of tracking algorithm uses only grayscale images, but still not sure about that. Based on my experience (re)implementing active appearance models, I'd say many tracking algorithms work even better with colored

Re: [julia-users] Computer Vision Package

2015-08-10 Thread Tim Holy
On Monday, August 10, 2015 01:49:08 PM Mehmet Cem Güntürkün wrote: However, for that I will need Scharr Operator. Do we have that operator in Images.jl? See http://timholy.github.io/Images.jl/function_reference.html and search for sobel (which is close). But if you want a different one, sure,

[julia-users] use === for comparison to nothing

2015-08-10 Thread Sisyphuss
I saw this in recent commits. What's the purpose of it?

Re: [julia-users] Really need to change immutables

2015-08-10 Thread Jameson Nash
My suggestion would be to mirror only the parts of those structs that are part of the public API. Then use unsafe_load / unsafe_store to read / modify / write the intended changes. The API authors were nice to put the public fields at the top so that you can do this (many libraries don't / can't

[julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Andrei Zh
I'm afraid it's not quite true, and I found simple way to show it. In the next code snippet I define function `f` and serialize it to a file: julia f(x) = x + 1 f (generic function with 1 method) julia f(5) 6 julia open(example.jld, w) do io serialize(io, f) end Then I close Julia REPL and

[julia-users] Will be in Geneva later this week

2015-08-10 Thread Keno Fischer
Hello everyone, I'll be traveling to Geneva later this week (Thu/Fri). Not sure if there's a meet-up group around, but if you're in the area, I'd love to meet up while I'm there. Keno

Re: [julia-users] julia 'stable' from git

2015-08-10 Thread Federico Calboli
I was on 0.4 but daily updates from git just broke too often… I always did make clean as a norm because it saved time in the end… Having said that, since my GCC is 4.9.x, and I understand GCC has moved to 5.x.x I might just change GCC and thus reinstall from 0… Cheers F On 10 Aug 2015, at

Re: [julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Tony Kelman
The above code wasn't using the HDF5-based JLD package/format, it was just using .jld as a file extension to store the results of serialize(). Should probably use some different extension for that, .jls or something, to avoid confusion. On Monday, August 10, 2015 at 12:45:35 PM UTC-7, Stefan

[julia-users] Re: Help to eliminate Calendar.jl dependence

2015-08-10 Thread Jeffrey Sarnoff
Hi Tom, I am writing you a timestamp function now. (a) is the most refined temporal resolution of your timestamps milliseconds (1/1_000 seconds)? (b) do you ever get multiple items that have identical timestamps? (If so, what is the most you have seen.) (c) do you want your timestamp to be an

Re: [julia-users] Really need to change immutables

2015-08-10 Thread J Luis
segunda-feira, 10 de Agosto de 2015 às 20:15:57 UTC+1, Jameson escreveu: My suggestion would be to mirror only the parts of those structs that are part of the public API. Then use unsafe_load / unsafe_store to read / modify / write the intended changes. The API authors were nice to put the

[julia-users] Re: 0.4 used to load fast

2015-08-10 Thread Tony Kelman
I commented on the commit, but I disagree with making worse backtraces the default. If you know what you're doing and want fast startup in exchange for worse backtraces, you can use --precompiled=yes (and we should probably document that more clearly), but for the sake of all of those users who

Re: [julia-users] Computer Vision Package

2015-08-10 Thread Mehmet Cem Güntürkün
Hey everyone, thanks a lot for your answers and suggestions. That seems I have too many things to learn. *@Tim* Actually using Images.jl for input, output and core data structures is a good idea because I guess it is already handling many different image formats/extensions but I might still

Re: [julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Andrei Zh
Yes, I incorrectly assumed `serialize` / `deserialize` use JLD format. But anyway, even when I saved the function into example.jls or even plain byte array (using IOBuffer and `takebuf_array`), nothing changed. Am I missing something obvious? On Monday, August 10, 2015 at 11:40:03 PM UTC+3,

Re: [julia-users] Embarrassingly parallel workload

2015-08-10 Thread Kristoffer Carlsson
Something like this? @everywhere function fill(A::SharedArray) for idx in Base.localindexes(A) A[idx] = rand() end end function fill_array(m, n) A = SharedArray(Float64, (m, n)) @sync begin for p in procs(q) @async remotecall_wait(p, fill, A)

Re: [julia-users] use === for comparison to nothing

2015-08-10 Thread Sisyphuss
On Tuesday, August 11, 2015 at 2:32:01 AM UTC+2, Yichao Yu wrote: On Mon, Aug 10, 2015 at 7:52 PM, Sisyphuss zhengw...@gmail.com javascript: wrote: I saw this in recent commits. What's the purpose of it? https://github.com/JuliaLang/julia/pull/12440 Leave a comment at

[julia-users] Collection of sparse matrices?

2015-08-10 Thread Arjun Narayanan
Hello everyone, I would like to construct an iterable collection of sparse matrices. It appears that I can do this with Array(SparseMatrixCSC, number_of_matrices). I was wondering if this would be the most sensible way of going about this problem? Does anyone see any drawback/pitfall

Re: [julia-users] use === for comparison to nothing

2015-08-10 Thread Yichao Yu
On Mon, Aug 10, 2015 at 8:51 PM, Sisyphuss zhengwend...@gmail.com wrote: On Tuesday, August 11, 2015 at 2:32:01 AM UTC+2, Yichao Yu wrote: On Mon, Aug 10, 2015 at 7:52 PM, Sisyphuss zhengw...@gmail.com wrote: I saw this in recent commits. What's the purpose of it?

[julia-users] Re: Collection of sparse matrices?

2015-08-10 Thread Kristoffer Carlsson
Hello, That looks like a very reasonable way to do it. On Tuesday, August 11, 2015 at 3:02:01 AM UTC+2, Arjun Narayanan wrote: Hello everyone, I would like to construct an iterable collection of sparse matrices. It appears that I can do this with Array(SparseMatrixCSC, number_of_matrices).

Re: [julia-users] use === for comparison to nothing

2015-08-10 Thread Yichao Yu
On Mon, Aug 10, 2015 at 7:52 PM, Sisyphuss zhengwend...@gmail.com wrote: I saw this in recent commits. What's the purpose of it? https://github.com/JuliaLang/julia/pull/12440 Leave a comment at the commit or at least include a link to it when you post it elsewhere (like this list) would be

[julia-users] Re: Collection of sparse matrices?

2015-08-10 Thread Steven G. Johnson
On Monday, August 10, 2015 at 9:02:01 PM UTC-4, Arjun Narayanan wrote: I would like to construct an iterable collection of sparse matrices. It appears that I can do this with Array(SparseMatrixCSC, number_of_matrices). That allocates an array of uninitialized entries and requires you to

[julia-users] Re: Collection of sparse matrices?

2015-08-10 Thread Steven G. Johnson
Or you can use a comprehension: SparseMatrixCSC[ mysparsematrix(i) for i = 1:n ], where mysparsematrix(i) is a function that returns your i-th sparse matrix.

[julia-users] Re: Collection of sparse matrices?

2015-08-10 Thread Arjun Narayanan
Thanks for your replies, @StevenJohnson I would most likely need to do this in a loop, so push!() seems like a nice choice. Thanks! On Monday, 10 August 2015 18:02:01 UTC-7, Arjun Narayanan wrote: Hello everyone, I would like to construct an iterable collection of sparse matrices. It

Re: [julia-users] Computer Vision Package

2015-08-10 Thread Tim Holy
On Sunday, August 09, 2015 05:26:33 PM Kevin Squire wrote: I'll second everything that Tim says, except that, for reading video, VideoIO.jl would probably be more appropriate. Definitely! It's an amazing package. --Tim

Re: [julia-users] reinterpret SubArray

2015-08-10 Thread Tim Holy
On Sunday, August 09, 2015 06:45:07 PM Sebastian Good wrote: I found myself trying to reinterpret a subarray today, and it didn't work. There are obviously plenty of cases where this makes no sense, but it would be convenient where it did. Is this on someone's roadmap? Not mine :-). If you're

[julia-users] can the REPL be safely set to use showcompact for arrays?

2015-08-10 Thread Jeffrey Sarnoff
If it is safe and would not slow down everything, I would like to put something in .juliarc that would show Arrays in the REPL using showcompact rather than the default display().

[julia-users] Re: ANN: JuliaImages organization

2015-08-10 Thread Tobias Knopp
Hi Tim, this is great! I have used the Image type a lot in the past months as it allows to carry image sizes with my 1D-5D arrays. Would be great if this could be split into a single package. I am sometimes not entirely sure if this type should be called Image because effectively it can also

[julia-users] julia 'stable' from git

2015-08-10 Thread Federico Calboli
Hi All, (assuming this is the right forum), according to the instructions here: https://github.com/JuliaLang/julia I can run the 'stable' release by cloning the git repo and then checking out the 0.3 release. Now, I presume the 0.4 release will eventually become 'stable', and so on and so

Re: [julia-users] Non-destructive assignment operator

2015-08-10 Thread Mauro
The package https://github.com/mauro3/Parameters.jl has some of the functionality you seek. For instance, for some type PhysicalPara, construct a new instance from a existing instance `pp` with two fields modified: pp2 = PhysicalPara(pp; cw=.11e-7, rw=100.) On Sun, 2015-08-02 at 15:22, Cedric

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Scott T
Hi Federico, I think that what you need is as simple as doing something like git fetch --tags git pull git checkout v0.4.0 make from within the git repo once version 0.4.0 is out. It's not quite magical, but you will probably want to push the button on the upgrade yourself instead of having

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Sisyphuss
I think `git checkout release-0.4 make` in same directory will do the work. But I'll make a new directory and build it from scratch. On Monday, August 10, 2015 at 1:07:51 PM UTC+2, Federico Calboli wrote: Hi All, (assuming this is the right forum), according to the instructions here:

Re: [julia-users] Really need to change immutables

2015-08-10 Thread Isaiah Norton
https://github.com/JuliaLang/julia/pull/12113 On Mon, Aug 10, 2015 at 8:11 AM, J Luis jmfl...@gmail.com wrote: Hi, Let me try to explain my need to fight with immutables. I made another round to my GMT wrapper (which is hopefully almost ready) and struggled again with the immutables. The

[julia-users] Re: julia 'stable' from git

2015-08-10 Thread Scott T
In fact, I imagine there will be a release-0.4 branch instead of a tag, so you will probably be able to ignore the git fetch --tags and do something more like git checkout release-0.4. Anyway, my point being that quite a lot will change in v0.4 so it's best to run the upgrade yourself (and you

[julia-users] Re: Can Julia function be serialized and sent by network?

2015-08-10 Thread Jeff Waller
My question is: does Julia's serialization produce completely self-containing code that can be run on workers? In other words, is it possible to send serialized function over network to another host / Julia process and applied there without any additional information from the first

[julia-users] Really need to change immutables

2015-08-10 Thread J Luis
Hi, Let me try to explain my need to fight with immutables. I made another round to my GMT wrapper (which is hopefully almost ready) and struggled again with the immutables. The point is that GMT API structs are deeply nested and need to be mirrored with immutables (otherwise Julia crashes).

Re: [julia-users] Really need to change immutables

2015-08-10 Thread J Luis
segunda-feira, 10 de Agosto de 2015 às 14:15:15 UTC+1, Isaiah escreveu: https://github.com/JuliaLang/julia/pull/12113 So there is hope. Thanks On Mon, Aug 10, 2015 at 8:11 AM, J Luis jmf...@gmail.com javascript: wrote: Hi, Let me try to explain my need to fight with immutables.

[julia-users] 0.4 used to load fast

2015-08-10 Thread J Luis
On Windows here. Some months ago the local build with MinGW used to start almost instantaneously. Now it takes almost 4 seconds again.