[julia-users] Re: JuliaBox disconnects after several hours of use (or non-use)

2015-11-22 Thread Patrick Kofod Mogensen
I know this is not a solution to the problem, but what do you mean by "lost code" ? Couldn't you just copy the text in the browser to a local editor? On Monday, November 23, 2015 at 6:09:45 AM UTC+1, Thomas Moore wrote: > > I've been really enjoying using JuliaBox for some simulations related to

[julia-users] JuliaBox disconnects after several hours of use (or non-use)

2015-11-22 Thread Thomas Moore
I've been really enjoying using JuliaBox for some simulations related to my PhD work. The fact that I can work on my code *anywhere* - in the office, the library, at home - with no worries about which version of Julia I'm using is fantastic! However, I've noticed that JuliaBox often disconnect

Re: [julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-22 Thread Eric Forgy
Can you provide a link to the issue when ready? I am interested in following it as I will have similar questions soon. Thanks On Monday, November 23, 2015 at 11:36:07 AM UTC+8, Andre Bieler wrote: > > I ll open an issue on this. >

Re: [julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-22 Thread Andre Bieler
So I did a more fair comparison. (file attached) Doing the same decomposition and re-assembly as for the hdf5 version. It is about a factor of 2 faster than the hdf5 version now. Tim, is this about what you would expect? (I thought it should be even faster than this) I ll open an issue on this.

[julia-users] Simple Quesiton about svd() function

2015-11-22 Thread Michael Bullman
Hi All, I have a pretty easy question about how/why the svd() behaves how it does. Why are my U and V matrices always a factor of -1 from the textbook examples? I'm just getting my feet wet with all this, so I wanted to check what the function returns vs what the textbook says the answers wou

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread feza
Why not use foo{I<:Integer}(u::UnitRange{I}) = 1 On Sunday, November 22, 2015 at 7:38:29 AM UTC-5, andrew cooke wrote: > > > Out of my depth here - no idea if this is a bug or me... > > julia> foo{I<:Integer,U<:UnitRange{I}}(u::U) = 1 > ERROR: TypeError: UnitRange: in T, expected T<:Real, got Uni

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread colintbowers
Hi Andrew, The issue is being tracked here: https://github.com/JuliaLang/julia/issues/6984, and the current milestone is v0.5. My understanding is that the syntax being proposed is not the same as the one you used above, but that triangular dispatch will nonetheless be possible as a special ca

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-11-22 Thread Michele Zaffalon
Thank you, I should have checked the issues list first. On Fri, Nov 20, 2015 at 4:13 PM, Milan Bouchet-Valat wrote: > Le vendredi 20 novembre 2015 à 04:54 -0800, Michele Zaffalon a écrit : > > Should `linspace` act as an array for `repeat`? > Yes, the signature of repeat() is clearly too strict.

[julia-users] Parallel @sync @async

2015-11-22 Thread digxx
As you could see, the reduction operator can be omitted if it is not needed. In that case, the loop executes asynchronously, i.e. it spawns independent tasks on all available workers and returns an array of RemoteRef (page 399) immediately without waiting for completion. The caller can wait for t

Re: [julia-users] type conversion

2015-11-22 Thread Milan Bouchet-Valat
Le dimanche 22 novembre 2015 à 14:08 -0800, Martin Kuzma a écrit : > > > Hi, i am new to Julia and i am little bit confused about type > conversion. > In the docs is written following: > > When appended to a variable in a statement context, the :: operator > means something a bit different: it

Re: [julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-22 Thread Tim Holy
I can replicate this, and it's awe-inspiring just how bad it is: Using HDF5: 0.07s Using the serializer: 6.3s Robert, this was with `julia -p 2` (you won't see this if you don't have multiple processes). In a sense it's not a fair comparison: you're effectively creating a custom serialize

[julia-users] type conversion

2015-11-22 Thread Martin Kuzma
Hi, i am new to Julia and i am little bit confused about type conversion. In the docs is written following: When appended to a *variable* in a statement context, the :: operator means something a bit different: it declares the variable to always have the specified type, like a type declaratio

[julia-users] indexpids

2015-11-22 Thread digxx
Im not quite sure what deeper purpose the function indexpids has. As far as I noticed when calling remotecall(p,f,arg) then in the function f indexpids always returns p-1 Is that correct or are there applications where its not as clear?

Re: [julia-users] Concatenation without splatting

2015-11-22 Thread Mauro
In ODE.jl, I've used vcat_nosplat(y) = eltype(y[1])[el[1] for el in y] # Does vcat(y...) without the splatting I think the eltype might not be needed. There may be better ways though. On Sun, 2015-11-22 at 14:04, Cedric St-Jean wrote: > I have a big vector of vectors. Is there any way to vcat

Re: [julia-users] Re: Better alternative to find all permutations?

2015-11-22 Thread Dan
If we are already at this, it would be cool to have versions with Gray ordering. Something like: for (i1,i2) in permutations(vector,indices=true,Gray=true) theperm[[i1,i2]] = theperm[[i2,i1]] @show theperm end would go over all permutations. The syntax would be different and t

Re: [julia-users] Assigning variables

2015-11-22 Thread Stefan Karpinski
Not really. An array is much better for this. On Sun, Nov 22, 2015 at 2:28 PM, digxx wrote: > Manually I can do: > arr1=... > arr2=... > arr3=... > and so on > If I have a loop over i can i construct in each loop a new variable > symbolically like this: > arr*string(i)=... ? > >

[julia-users] Assigning variables

2015-11-22 Thread digxx
Manually I can do: arr1=... arr2=... arr3=... and so on If I have a loop over i can i construct in each loop a new variable symbolically like this: arr*string(i)=... ?

Re: [julia-users] ObjectIdDict

2015-11-22 Thread Stefan Karpinski
Yes, Set is implemented using a hash table. ObjectIdDict is for situations where you want to hash based on object identity (===) rather than equality (isequal). On Sunday, November 22, 2015, Leonardo wrote: > Of course I can use Dict (ObjectIdDict is a sort of Dict), adding entries > as previous

Re: [julia-users] ObjectIdDict

2015-11-22 Thread Leonardo
Of course I can use Dict (ObjectIdDict is a sort of Dict), adding entries as previously written. Set is even better, but elements of Set are accessed with hash? E.g. "hello" in s of your example is executed in constant or linear time? Thanks Leonardo P.S. for my clarification: what is reccomen

Re: [julia-users] Re: Better alternative to find all permutations?

2015-11-22 Thread Tamas Papp
Also, "unique" permutations require a notion of equality, and which is hard to define in general (classic essay is [1], about Common Lisp, but applies to Julia mutatis mutandis). At least Julia has bits types for numbers, which makes life a bit easier. Whether one picks is, isequal, or == for comp

Re: [julia-users] Re: Better alternative to find all permutations?

2015-11-22 Thread Ratan Sur
I think julia more than other languages has a tendency to stick with mathematical consistency over some user preferences, which is good. For that reason, I would be in favor of permutations remaining as is but having multiset_permutations renamed to something more intuitive, like uniqueperms, or un

[julia-users] Re: passing data by remotecall_fetch slower than writing & loading from disk

2015-11-22 Thread Robert Gates
what were your timings? i get: size(particles) = (30,) size(particles) = (30,) 0.060457 seconds (300.58 k allocations: 48.089 MB) (30,) (30,) 0.57 seconds (27 allocations: 912 bytes) On Thursday, November 19, 2015 at 10:11:47 PM UTC+1, Andre Bieler wrote: > > I have

Re: [julia-users] ObjectIdDict

2015-11-22 Thread Tim Holy
Why can't you use Set or Dict? julia> s = Set{ASCIIString}() Set{ASCIIString}() julia> push!(s, "hello") Set(ASCIIString["hello"]) julia> push!(s, "world") Set(ASCIIString["hello","world"]) julia> "hello" in s true julia> "nope" in s false --Tim On Sunday, November 22, 2015 09:58:31 AM Leona

[julia-users] ObjectIdDict

2015-11-22 Thread Leonardo
Hello, I'm looking for an Hash table in Julia (or Hash Set, how is called in other programming languages), to efficiently check existence of an element in set, but I haven't found it. I've found ObjectIdDict as alternative, defined as: ObjectIdDict <: Dict{Any,Any} where key and value are equals,

Re: [julia-users] Re: What is the best way to get two by two tables in Julia?

2015-11-22 Thread Milan Bouchet-Valat
As I noted just a few days ago, I have written a small package to compute frequency tables from arbitrary arrays, with an optimized method for pooled data arrays : https://github.com/nalimilan/FreqTables.jl I've just pushed a fiw so it should now work on 0.4 (but not with 0.3). We could easily ad

Re: [julia-users] DataFrames : Apply a function by rows

2015-11-22 Thread Fred
Ok, I hope that exchange could contribute to bring news ideas to improve DataFrames although there are other way to do it, like convert a DataFrame or a row into array. Thank you for your help ! Le dimanche 22 novembre 2015 15:48:37 UTC+1, tshort a écrit : > > Contributions/pull requests from fo

Re: [julia-users] Calling "super" methods

2015-11-22 Thread andrew cooke
ok (i thought there might be something more succinct, but i guess multimethods mean it's not simple). thanks. andrew On Sunday, 22 November 2015 11:24:57 UTC-3, Yichao Yu wrote: > > > Can I do this, or do I need to pull the function out into a separate > name? > > invoke > > > > > Thanks, > >

Re: [julia-users] Calling "super" methods

2015-11-22 Thread Tim Holy
Currently you can use `invoke`, although its future is uncertain: https://github.com/JuliaLang/julia/pull/13123 --Tim On Sunday, November 22, 2015 06:10:38 AM andrew cooke wrote: > In OO programming it's quite common to delegate work to a supertype from > within a method. The syntax might be so

Re: [julia-users] DataFrames : Apply a function by rows

2015-11-22 Thread Tom Short
Contributions/pull requests from folks that need that are welcome. I don't have that need. For row operations, I can generally get by with loops or `@byrow!` in DataFramesMeta. On Nov 22, 2015 8:23 AM, "Fred" wrote: > Yes, it is a good solution, but it means that DataFrames cannot be used to > do

Re: [julia-users] Calling "super" methods

2015-11-22 Thread Yichao Yu
> Can I do this, or do I need to pull the function out into a separate name? invoke > > Thanks, > Andrew >

[julia-users] Calling "super" methods

2015-11-22 Thread andrew cooke
In OO programming it's quite common to delegate work to a supertype from within a method. The syntax might be something like: class Foo { method bar(...) { ... super.bar(...) ... } } I'd like to do the same in Julia, but don't know how to. For example, I may h

Re: [julia-users] Re: split a utf-8 string

2015-11-22 Thread Steven G. Johnson
See https://github.com/JuliaLang/julia/issues/14099 for further discussion.

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread andrew cooke
a! ok, thanks. On Sunday, 22 November 2015 10:40:04 UTC-3, Simon Danisch wrote: > > As far as I know, triangular dispatch hasn't hit the shores yet > (especially not in 0.4). > This sort of works, because I is actually a global variable in Base (I:: > UniformScaling{Int64}) > Try some other

Re: [julia-users] Re: split a utf-8 string

2015-11-22 Thread Steven G. Johnson
I agree that this is a documentation bug, but there is an easy way to split on any isspace character: julia> const spaces = filter(isspace, Char(0):Char(0x10)); julia> split("Time flies like an arrow.(光陰矢の如し)", spaces) 5-element Array{SubString{UTF8String},1}: "Time" "flies"

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread Simon Danisch
As far as I know, triangular dispatch hasn't hit the shores yet (especially not in 0.4). This sort of works, because I is actually a global variable in Base (I:: UniformScaling{Int64}) Try some other name, and it will tell you that the variable is undefined, as expected. Best, Simon Am Sonntag,

Re: [julia-users] DataFrames : Apply a function by rows

2015-11-22 Thread Fred
Yes, it is a good solution, but it means that DataFrames cannot be used to do some calculations by rows, it is a severe limitation. An equivalent of colwise() whould be very usefull. Le dimanche 22 novembre 2015 14:11:21 UTC+1, tshort a écrit : > > I'd convert the whole DataFrame to a matrix an

Re: [julia-users] Re: Define an objective function type

2015-11-22 Thread Zheng Wendell
I was waiting for someone others to comment on it. But since no one did it, I'll try it. Your solution is just fine for personal use. But imagine that you are making an application working on ObjectiveFunction. For your clients to profit from your application, they should inherit a concrete type f

Re: [julia-users] DataFrames : Apply a function by rows

2015-11-22 Thread Tom Short
I'd convert the whole DataFrame to a matrix and use a loop over rows. On Nov 22, 2015 2:54 AM, "Fred" wrote: > In my last example, the function mean() is not well chosen. In fact, what > I would like to calculate is a statistical test line by lline, like TTest, > or Wilcoxon. This is why I need t

[julia-users] Concatenation without splatting

2015-11-22 Thread Cedric St-Jean
I have a big vector of vectors. Is there any way to vcat/hcat them without splatting? arr_of_arr = Vector[[1],[2,3],[4,5]] vcat(arr_of_arr...) I'm asking because splatting big arrays is a performance issue (and IIRC it blows the stack at some point).

[julia-users] Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread andrew cooke
Out of my depth here - no idea if this is a bug or me... julia> foo{I<:Integer,U<:UnitRange{I}}(u::U) = 1 ERROR: TypeError: UnitRange: in T, expected T<:Real, got UniformScaling{ Int64} Version 0.4.1-pre+22 (2015-11-01 00:06 UTC) Thanks, Andrew

Re: [julia-users] Writing CSV

2015-11-22 Thread Milan Bouchet-Valat
Le samedi 21 novembre 2015 à 11:05 -0800, digxx a écrit : > Though this is not a big issue since I can convert the strings to > double as I want IDL still tells me the following OK, so this is actually an issue in the interaction between Julia -produced CSV and how IDL interprets it. Note that CSV

Re: [julia-users] Re: split a utf-8 string

2015-11-22 Thread Dan
`split` already has hooks for using other splitters. To achieve the UTF8 space splitting functionality, one can leverage the `isspace` function and add some decorations. For example: type FuncSplitter pred::Function end function Base.search(s::AbstractString, splt::FuncSplitter, start::In

[julia-users] Re: export @enum type should also export its values

2015-11-22 Thread Sisyphuss
I plan to add a sentence to the doc: If ``FRUIT`` is defined in a module ``Food``, its instances should be refered as ``Food.apple`` for example instead of ``FRUIT.apple``. But I don't know how to do it. Maybe someone could do it instead of me. On Sunday, November 22, 2015 at 12:21:53 PM UTC+1

Re: [julia-users] Re: split a utf-8 string

2015-11-22 Thread Pontus Stenetorp
On 22 November 2015 at 01:46, wrote: > > On Sunday, November 22, 2015 at 10:02:03 AM UTC+10, James Gilbert wrote: >> >> The spaces in your string are '\u3000' the ideographic space. >> isspace('\u3000') returns true, and split(s) is supposed to split on all >> space characters, so I think this mi

[julia-users] Re: What is the best way to get two by two tables in Julia?

2015-11-22 Thread Dan
Hi Arin, It would be helpful to have more details about the input (a dataframe?) and output (a two-by-two table or a table indexed by categories?). Some code to give context to the question would be even more help (possibly in another language, such as R). Having said this, here is a starting p

[julia-users] Re: export @enum type should also export its values

2015-11-22 Thread Sisyphuss
Sorry, just found that one can use `tmp.orange` to refer the value. On Sunday, November 22, 2015 at 12:12:56 PM UTC+1, Sisyphuss wrote: > > Let's see this example: > ``` > module tmp > > export FRUIT, f, apple > > @enum FRUIT apple=1 orange=2 kiwi=3 > > f(x::FRUIT) = "I'm a FRUIT with value: $(I

[julia-users] export @enum type should also export its values

2015-11-22 Thread Sisyphuss
Let's see this example: ``` module tmp export FRUIT, f, apple @enum FRUIT apple=1 orange=2 kiwi=3 f(x::FRUIT) = "I'm a FRUIT with value: $(Int(x))" end ``` f(apple) works fine f(orange) doesn't work f(FRUIT.apple) doesn't work either. An enumerate type is of no use, if can't use its values.