[julia-users] Re: appending `Take`s, `Zip`s & friends to a vector

2016-05-15 Thread Steven G. Johnson
On Sunday, May 15, 2016 at 8:42:24 AM UTC-4, Davide Lasagna wrote: > > append!(some_int_array, repeated(1, 10)) > Yes, there should probably be a method that allows an arbitrary iterator for the second argument; currently only instances of AbstractVector are allowed. A PR would be welcome.

[julia-users] Re: appending `Take`s, `Zip`s & friends to a vector

2016-05-15 Thread Steven G. Johnson
See https://github.com/JuliaLang/julia/issues/7798

Re: [julia-users] Re: Slow reading of file

2016-05-15 Thread Milan Bouchet-Valat
Le dimanche 15 mai 2016 à 08:08 -0700, Ford Ox a écrit : > Thanks Yu and Quinn. > > Now lets go one step further. Lets say I don't want to use any > default parse function. I will make my own. > > type Buffer{T} x::T end > > function store!(b::Buffer{String}, c::Char) b.x = "$(b.x)$x" end >

[julia-users] Difficulty building latest master

2016-05-15 Thread David Gold
Something relating to OpenBLAS is going wrong when I try to build the latest master: 22736 Symbol names changed ld: warning: could not create compact unwind for _sgbtrf_64_: stack subq instruction is too different from dwarf stack size ld: warning: could not create compact unwind for

Re: [julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread Kristoffer Carlsson
It is possible but seems like something undesirable because you then don't know if an Array{T,1} or Array{T,2} will be returned by the function. This is something Julia people like to call "type instability" when the type of your returned variables depend not only on the type of the arguments

Re: [julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Thanks for the explanation!! That's exactly what I need at the moment, though I clearly know that unpredictable return type could be dangerous. Many thanks. On Sunday, May 15, 2016 at 9:07:12 PM UTC+1, Kristoffer Carlsson wrote: > > It is possible but seems like something undesirable because

[julia-users] Changing a package name

2016-05-15 Thread Rob
Does anyone have any tips on changing a packages name? I am looking to expand EEG.jl to encompass other electrophysiological techniques, and think the name Electrophysiology.jl would be more accurate. Is the general consensus to keep the old repo around and provide a warning? Or, change the

Re: [julia-users] How to change REPL mode on startup?

2016-05-15 Thread Rafael Fourquet
John, I tried your branch which works as expected, thank you. I found that there has been a PR at https://github.com/JuliaLang/julia/pull/13545 related to REPL hooks, not sure how much this overlaps with your solution. In any case, I hope to see this functionality merged.

Re: [julia-users] Julia text editor on iPad?

2016-05-15 Thread Sheehan Olver
It works on the smart keyboard for me. Otherwise, you have to press the “play” button in the toolbar. > On 15 May 2016, at 5:11 PM, Andrew Gibb wrote: > > Is there a way to do shift-enter to execute a cell using the iPad software > keyboard? Does shift enter just work

[julia-users] Immutables redeclaration

2016-05-15 Thread Ford Ox
Just from pure curiosity. x = 10 x = 100 x = x << 2 x = foo() # returns int64 Will x after any of these instruction use new memory storage (thus there will be two x variables present, until gc deletes the one with no pointer)? If yes, does it affect performance significantly?

[julia-users] Re: Changing a package name

2016-05-15 Thread Tony Kelman
Renaming an existing package can cause problems if anyone else has started using or depending on it. You can deprecate the existing name of the package by adding an upper Julia version number bound on all existing tags of the package in METADATA, so it will no longer be installable once newer

[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-15 Thread Chris Rackauckas
I work on numerical/scientific code, so my experience may be different than more traditional programming uses. Atom is great. I tried the original JunoLT, and it put me off from Julia for awhile, but I feel at home in Atom. Nice tip: there's a package for hidpi if you have a 4K screen. It

[julia-users] Re: Immutables redeclaration

2016-05-15 Thread Kristoffer Carlsson
Since these are just normal integers they will (assuming you are putting them in a function) be allocated on the stack so no gc will need to run. If x instead allocated something then the previous x would still be in memory until the gc desides to clean them up. I'm not sure about the exact

Re: [julia-users] Julia text editor on iPad?

2016-05-15 Thread Andrew Gibb
Is there a way to do shift-enter to execute a cell using the iPad software keyboard? Does shift enter just work on the hardware keyboard?

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

Re: [julia-users] LQ decomposition.

2016-05-15 Thread Stefan Karpinski
This appears to be a homework question. Just as on StackOverflow, it's not ok to ask people to do homework problems for you on julia-users. On Sun, May 15, 2016 at 7:07 AM, Rafiul Nakib wrote: > Can anyone please help me on this? >

Re: [julia-users] A Question About Structure Of Pointers

2016-05-15 Thread Yichao Yu
On Sun, May 15, 2016 at 2:29 AM, Stefan Schnell wrote: > > > Hello community, > > I am fresh at Julia language and I am fascinated about the possibilities. > At the moment I examine the possibilities to communicate with C libraries. > And here I have a question. > > I have

Re: [julia-users] Re: Immutables redeclaration

2016-05-15 Thread Stefan Karpinski
This depends entirely on context. If this code appears in a gobal scope (or in the REPL) then each return value will be separately heap allocated. If the code occurs in the middle of a function and the variables are all local and Julia's compiler can infer the type of x, then x will be stored in

[julia-users] A Question About Structure Of Pointers

2016-05-15 Thread Stefan Schnell
Hello community, I am fresh at Julia language and I am fascinated about the possibilities. At the moment I examine the possibilities to communicate with C libraries. And here I have a question. I have a structure of pointers as parameter for a C function struct connparam{ charU * name

[julia-users] Re: Attention users of HTTPClient

2016-05-15 Thread NagaMurali reddy
Hi Jonathan , Is there any way to implement multipart file upload in web applications using julia? On Wednesday, 2 September 2015 19:26:38 UTC+5:30, Jonathan Malmaud wrote: > > We are considering deprecating HTTPClient (a wrapper around libcurl) in > favor of Requests.jl (a mostly

[julia-users] LQ decomposition.

2016-05-15 Thread Rafiul Nakib
Can anyone please help me on this?

Re: [julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread Tim Holy
See reshape and vec. Best, --Tim On Sunday, May 15, 2016 09:00:33 AM chobbes...@gmail.com wrote: > Here is rookie question, which I have tried to find a similar question and > answer in the history of this group, but failed. Please bear me. > > Since Julia distinguishes between Array{Float64,1}

[julia-users] Re: Slow reading of file

2016-05-15 Thread Ford Ox
Thanks, that's awesome. Based on that I have written function, that will print out the method body right into the console (great when you operate in REPL). function functionbody(f::Function, types::Tuple) filename, line = functionloc(f, types) open(filename, "r") do f for _ in

[julia-users] Matrix multiplication performance with BitMatrix, Matrix{Bool}, Matrix{Int8}

2016-05-15 Thread Josh Day
Hi all. Suppose I have a large matrix with entries {0, 1} and I'd like to keep storage small by using a BitMatrix. Are there any tricks to squeeze better performance out of BitMatrix multiplication? I'm also curious about the performance difference between Matrix{Bool} and Matrix{Int8}.

[julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Here is rookie question, which I have tried to find a similar question and answer in the history of this group, but failed. Please bear me. Since Julia distinguishes between Array{Float64,1} and Array{Float64,2}, even there is only one column in an Array{Float64,2}. Therefore, the type of

[julia-users] Re: Slow reading of file

2016-05-15 Thread Ford Ox
Thanks Yu and Quinn. One more question. I want to further improve the reading speed, so I want to generate the new string / int already when I am reading. - I am reading char after char type IntBuffer end # can store one integer type StrBuffer end function next!(b::IntBuffer,

[julia-users] Re: Slow reading of file

2016-05-15 Thread Ford Ox
Thanks Yu and Quinn. Now lets go one step further. Lets say I don't want to use any default parse function. I will make my own. type Buffer{T} x::T end function store!(b::Buffer{String}, c::Char) b.x = "$(b.x)$x" end function store!(b::Buffer{Int}, c::Char, d::Int) b.x += (c - '0')*10^d end #d

[julia-users] How to vectorize a function which has a tuple as return value to a function which returns a tuple of matrices instead of a matrix with tuple elements?

2016-05-15 Thread Hakuna M.
e.g. for a function like this: tupleFun(a::Float64) = (a+1, a-1); if I use @vectorize_1arg Float64 tupleFun I get for: typeof( tupleFun(rand(3,3)) ) Array{Tuple{Float64,Float64},2} How can I get a function which returns: Tuple{Array{Float64,2},Array{Float64,2}} (without an explicit for loop over

[julia-users] Re: Slow reading of file

2016-05-15 Thread Kristoffer Carlsson
On Sunday, May 15, 2016 at 5:08:18 PM UTC+2, Ford Ox wrote: > > As a side note, is there anything like show_method_body(function)? I often > want to see how is function base.xy implemented, but I have to manually > search all the files which is quite exhausting. > > > There is @edit / edit

Re: [julia-users] upgrade/downgrade between Array{Float64,1} and Array{Float64,2}

2016-05-15 Thread chobbes158
Thanks for the pointer for reshape. Sorry that I failed to make my question clear enough. In fact, I wonder if there is a function which can _automatically_ recast a single-column Array{T,2} to an Array{T,1} and do nothing if this Array{T,2} has multiple rows. On Sunday, May 15, 2016 at