Re: [julia-users] Re: `findmin` with arbitrary comparison operator?

2015-12-02 Thread Josh Langsfeld
That's true; my_tuples[findmin(map(score_func, my_tuples))[2]] is a fair bit uglier than just interesting the map. On Tuesday, December 1, 2015 at 9:45:54 PM UTC-5, Erik Schnetter wrote: > > One of the tuple entries is the number by which I'd like to sort, so the > score_func is trivial.

Re: [julia-users] newbie in julia type performance

2015-12-02 Thread Yichao Yu
On Tue, Dec 1, 2015 at 11:07 PM, Jorge Johnson wrote: > Hi, > I made my first julia function. > I build two functional identical functions, the first one using types and > the second one without types. > > I was expecting the typed function to be more efficient in time

Re: [julia-users] getindex for a real number

2015-12-02 Thread Tim Holy
On Wednesday, December 02, 2015 05:11:32 AM Seth wrote: > This is great. I assume it catches "for i in n" where n is a scalar, also, > right? > > I could see requiring this by default in all my packages. Might be better as a test dependency, since it works by "breaking" methods in Base. If you

[julia-users] newbie in julia type performance

2015-12-02 Thread Jorge Johnson
Hi, I made my first julia function. I build two functional identical functions, the first one using types and the second one without types. I was expecting the typed function to be more efficient in time and memory than the untyped one. however, I was surprised. The untyped function runs very

[julia-users] Collections

2015-12-02 Thread joaonunocarv
Hello, I would like to ask why Julia doesn’t have a Collections library/module inside the standard library? Best regards, Joao Carvalho

Re: [julia-users] Collections

2015-12-02 Thread Spencer Russell
Can you clarify what problem you’re trying to solve? Julia has several collection types and various operations on them, so it’s possible that the functionality you’re looking for exists under a different name. -s > On Dec 1, 2015, at 4:33 PM, joaonunoc...@gmail.com wrote: > > Hello, > > >

[julia-users] Re: timing question on 'read' binary..

2015-12-02 Thread Rajn
Stefan, I have a function which loads the data structure, loads the actual data file and defines frame numbers, determines PACKSIZE etc. But to test the performance I did not use the function for but as in global scope. Tom, I will look up your suggestion. Thanks On Wednesday, December 2,

Re: [julia-users] Re: File downloading and caching best practices?

2015-12-02 Thread Tony Kelman
Regarding question 1, the most widely tested option is probably BinDeps.download_cmd. That is similar to Base.download but with an additional more reliable fallback on Windows to calling PowerShell. You could also look into LibCURL.jl or Requests.jl, which use BinDeps to ensure the binary

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Forrest Curo
Yes. I never would have thought of that, but it works. Thank you for writing one extremely useful julia package, and documenting it clearly for anyone sufficiently familiar with julia and python to follow; please add something like the following prominently for the benefit of people less familiar

Re: [julia-users] newbie in julia type performance

2015-12-02 Thread Spencer Russell
Did you run each one before timing them, to make sure you’re not timing the compilation? -s > On Dec 1, 2015, at 11:07 PM, Jorge Johnson wrote: > > Hi, > I made my first julia function. > I build two functional identical functions, the first one using types and the >

Re: [julia-users] Collections

2015-12-02 Thread Cedric St-Jean
There used to be a lot more functionality packaged with Julia, but there has been a concerted effort to spin them off. It makes development easier - contributing to a package is much less intimidating than contributing to base Julia. For collections, the package is part of "JuliaLang", which

Re: [julia-users] Collections

2015-12-02 Thread Steven G. Johnson
Actually, there is a built-in Collections module in the standard library (called "Collections"). See: http://docs.julialang.org/en/release-0.4/stdlib/collections/ And if the built-in types (Array, Set, Dict, Collections.PriorityQueue) aren't enough, check out

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread cormullion
I'm using [ColorSchemes.jl](https://github.com/cormullion/ColorSchemes.jl) for my own purposes, but I'm happy to rename it if someone else wants the name.

Re: [julia-users] Re: timing question on 'read' binary..

2015-12-02 Thread Stefan Karpinski
My point was that if that loop you posted is run in global scope, it's likely to be slow. http://docs.julialang.org/en/release-0.4/manual/performance-tips/ On Wed, Dec 2, 2015 at 11:04 AM, Rajn wrote: > Stefan, > I have a function which loads the data structure, loads the

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Forrest Curo
Um, better to add the part about methods, that you need the concluding '()' so that julia will recognize a method as a function. It is simply very difficult to explain anything whatsoever you have written, whether softwear or poetry or anything else, to anyone who lacks the familiarity you've

Re: [julia-users] getindex for a real number

2015-12-02 Thread Cedric St-Jean
There's also x = [1 2; 3 4] x[:,[1]] # returns 2D array x[:, 1] # returns 1D array x[1, :] # AFAIK, returns 2D under Julia 0.4 and 1D under 0.5 I like the 0.5 behaviour a lot better. On Wednesday, December 2, 2015 at 12:21:34 PM UTC-5, Tim Holy wrote: > > Glen, that's a great list of bugs. Have

[julia-users] Re: Julia career advice question (x-post r/julia)

2015-12-02 Thread Antonio Suriano
> >> Finally, have you read about the Python Paradox >> ? That was written 10 years ago. >> If it was written today, it would be called The Julia Paradox. >> > I don't think so. Scala and Rust probably would fit better the Python Paradox nowadays.

Re: [julia-users] Re: Julia career advice question (x-post r/julia)

2015-12-02 Thread Stefan Karpinski
On Wed, Dec 2, 2015 at 1:16 PM, Antonio Suriano wrote: > > >>> Finally, have you read about the Python Paradox >>> ? That was written 10 years ago. >>> If it was written today, it would be called The Julia Paradox. >>> >> > I don't

[julia-users] Re: newbie in julia type performance

2015-12-02 Thread Steven G. Johnson
I feel like we need an "anti-tip" in the "Performance Tips" section, explaining that f(x::Int) = x+1 is no faster than f(x) = x +1, and is less useful because it is less generic. This has got to be the most common confusion about Julia performance, and is very natural for people coming from

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Steven G. Johnson
I've updated the manual to explicitly mention o[:method](...) as well as o[:attribute], in case it was not clear that methods and attributes are treated the same way.

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Steven G. Johnson
On Wednesday, December 2, 2015 at 11:33:52 AM UTC-5, Forrest Curo wrote: > > Yes. I never would have thought of that, but it works. > > Thank you for writing one extremely useful julia package, and documenting > it clearly for anyone sufficiently familiar with julia > and python to follow;

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Steven G. Johnson
On Wednesday, December 2, 2015 at 11:33:52 AM UTC-5, Forrest Curo wrote: > > and 'object.method' as 'object[:method]()' > In Python, you still have to do object.method() if you want to *call* the method --- object.method returns the callable method object, not the result of calling the

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread Stefan Karpinski
I'm still pretty unclear on what makes a color scheme a novelty. On Wed, Dec 2, 2015 at 1:22 PM, wrote: > I'm using [ColorSchemes.jl](https://github.com/cormullion/ColorSchemes.jl) > for my own purposes, but I'm happy to rename it if someone else wants the > name.

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread Randy Zwitch
On Wednesday, December 2, 2015 at 3:12:36 AM UTC-5, Tomas Lycken wrote: > > Also, the naming discussion here is not *only* on naming; it's also on > the possibility of including *more things *in the package. I would be all > for having a package like Palettes.jl, which would include both >

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread Stefan Karpinski
Parkinson's law of triviality On Wed, Dec 2, 2015 at 2:26 PM, Randy Zwitch wrote: > On Wednesday, December 2, 2015 at 3:12:36 AM UTC-5, Tomas Lycken wrote: >> >> Also, the naming discussion here is not

[julia-users] Re: Parallel @sync @async

2015-12-02 Thread digxx
Any idea anyone? :-(

[julia-users] Re: File downloading and caching best practices?

2015-12-02 Thread Mohammed El-Beltagy
I don't think your package directory is good place for file caching. It would be better to put your caches in the system's temporary directory, for Mac (also check echo $TMPDIR) and Linux that is at "/tmp" for windows it is at "C:\Users\\AppData\Local\Temp" (check *ECHO %Temp%*) On Tuesday,

[julia-users] Re: Parallel @sync @async

2015-12-02 Thread Ismael VC
You can use `vcat` to reduce it to an array: julia> r = @parallel vcat for i=1:10 a[rand(1:end)] end; julia> typeof(r), size(r) (Array{Float64,1},(10,)) Is this what you are after? El domingo, 22 de noviembre de 2015, 17:17:46 (UTC-6), digxx escribió: > > As you could

Re: [julia-users] getindex for a real number

2015-12-02 Thread Eric Forgy
Some more improvements... julia> n = 5 5 julia> for i = n println(i) end 5 julia> using strict julia> for i = n println(i) end ERROR: MethodError: `start` has no method matching start(::Type{Number}) in start at C:\Users\Eric

[julia-users] Re: hex to bit notation

2015-12-02 Thread Martin Somers
Thanks Dan - I figured there was an easier way of doing this :) M

[julia-users] parsing a string into several floats

2015-12-02 Thread Gabor
Let ss="10.0 20.0 30.0 90. 90. 90" With Julia 3.x I could do this: v = float64(split(ss)) With Julia 4.0 I had to change the code to: v = [parse(Float64,s) for s=split(ss)] Please advise, is there a more compact solution?

Re: [julia-users] Re: File downloading and caching best practices?

2015-12-02 Thread Milan Bouchet-Valat
Le mercredi 02 décembre 2015 à 00:47 -0800, Mohammed El-Beltagy a écrit : > I don't think your package directory is good place for file caching. > It would be better to put your caches in the system's temporary > directory, for Mac (also check echo $TMPDIR) and Linux that is at > "/tmp" for

Re: [julia-users] Re: File downloading and caching best practices?

2015-12-02 Thread Mike Innes
For the download step, just run `curl -O $url` or something similar. The `download` function in Base tries to use some API call on Windows, but since the Julia distribution includes Curl anyway you can just use that safely on all platforms. On Wed, 2 Dec 2015 at 09:48 Milan Bouchet-Valat

[julia-users] Re: Interactive graph visualization in Julia

2015-12-02 Thread Martin Somers
> > Hi Weijian > you pretty much can do something like that at the moment with stock julia - at the back end of that chart is some javascript - if you refactor it to load a json file, you then can use julia to generate the json object - when you make changes to the julia file you can

[julia-users] Re: Julia career advice question (x-post r/julia)

2015-12-02 Thread Cristóvão Duarte Sousa
Cedric St-Jean, thank you for the "Python Paradox" link. It was a very good read, and linked to another article "Revenge of the Nerds" http://www.paulgraham.com/icad.html which makes me think that Julia is a kind of "Lisp meets Fortran". On Tuesday, December 1, 2015 at 9:43:51 PM UTC, Cedric

[julia-users] hex to bit notation

2015-12-02 Thread Martin Somers
Just wondering I have a 32 bit hex number as following - 0xa7f6d92a82c8d8f2 How do I acccertain the 29th bit Functions bin and bits all return an ascii string bin(0xa7f1d92a82c8d8fe) "1010011100011101100100101010101011001000110110001110" what is the most

[julia-users] Re: parsing a string into several floats

2015-12-02 Thread Eric Forgy
For what it's worth, the second one looks fine (I'd say "better", i.e. more clear) to me. It is pretty concise already :) On Wednesday, December 2, 2015 at 6:41:37 PM UTC+8, Gabor wrote: > > Let ss="10.0 20.0 30.0 90. 90. 90" > > With Julia 3.x I could do this: > v = float64(split(ss)) > > With

Re: [julia-users] Proposal: NoveltyColors.jl

2015-12-02 Thread Tomas Lycken
Also, the naming discussion here is not *only* on naming; it's also on the possibility of including *more things *in the package. I would be all for having a package like Palettes.jl, which would include both NoveltyColors.jl and other palettes, but that's not in conflict with the current

Re: [julia-users] Best method for inputting logic as a variable in a function

2015-12-02 Thread Tomas Lycken
Martin Fowler published a (rather long) blog post on the topic of refactoring code into data, which I think is a nice addition in this thread even though you already have a working solution: http://martinfowler.com/articles/refactoring-adaptive-model.html His solution to this problem would

Re: [julia-users] getindex for a real number

2015-12-02 Thread Tim Holy
Seems like this has the makings of a nice package for debugging. Best, --Tim On Wednesday, December 02, 2015 01:49:22 AM Eric Forgy wrote: > Some more improvements... > > julia> n = 5 > 5 > > julia> for i = n >println(i) >end > 5 > > julia> using strict > > julia> for i = n >

Re: [julia-users] parsing a string into several floats

2015-12-02 Thread Gabor
Milan: This is the solution for me. So float64(split(ss)) is deprecated but float(split(ss)) is not. Eric: I also see the logic, but similar code occurs at many places. I prefer as little eye clutter as possible. On Wednesday, December 2, 2015 at 11:48:41 AM UTC+1, Milan Bouchet-Valat wrote: >

Re: [julia-users] Re: File downloading and caching best practices?

2015-12-02 Thread Tony Kelman
No, please don't shell out to curl on windows. That will be going away, it's only present as a side effect of being bundled with git. We don't use bundled git any more.

Re: [julia-users] getindex for a real number

2015-12-02 Thread Seth
This is great. I assume it catches "for i in n" where n is a scalar, also, right? I could see requiring this by default in all my packages. On Wednesday, December 2, 2015 at 1:49:22 AM UTC-8, Eric Forgy wrote: > > Some more improvements... > > julia> n = 5 > 5 > > julia> for i = n >

Re: [julia-users] getindex for a real number

2015-12-02 Thread Steven G. Johnson
On Tuesday, December 1, 2015 at 9:38:46 PM UTC-5, Eric Forgy wrote: > > Then again, I wish Julia had a "strict" mode. In strict mode, the language > would be more pure mathematically, e.g. scalars have no indices, the > transpose of a vector is a covector, etc. > Not all vectors represent

[julia-users] Re: bit masking julia

2015-12-02 Thread Steven G. Johnson
On Wednesday, December 2, 2015 at 8:45:40 AM UTC-5, Martin Somers wrote: > > in julia I get > > (0xabcdef1234>> 32) & 0x >> 0x > > how can I remove the leading zeros for formating purposes > You can use @printf for C-like printf formatting strings. Or you can

[julia-users] bit masking julia

2015-12-02 Thread Martin Somers
just wondering in C you might get the first series of bytes as follows (0x>> 32) & 0x >> result in 0x (0x>> 0) & 0x >> result in 0x how can this be achieve in julia in julia I get (0xabcdef1234>> 32) & 0x >>

Re: [julia-users] Re: PyCall Usage

2015-12-02 Thread Steven G. Johnson
On Wednesday, December 2, 2015 at 12:30:43 AM UTC-5, Forrest Curo wrote: > > I gather that msg[:type] would work if I could receive one in the first > place -- but julia doesn't recognize the mido method "port.iter_pending" in > any notation I've found so far > port[:iter_pending]() Please

Re: [julia-users] 3D image matrix

2015-12-02 Thread Rivo Sarmento
ImageView.view(img) works also, thanks! This is a Polarimetric SAR image from San Andreas Fault, CA. Em terça-feira, 1 de dezembro de 2015 23:08:59 UTC-3, Benjamin Deonovic escreveu: > > So whats the image of? > > On Tuesday, December 1, 2015 at 4:50:51 PM UTC-6, Rivo Sarmento wrote: >> >>

Re: [julia-users] timing question on 'read' binary..

2015-12-02 Thread Stefan Karpinski
Are you doing this in global scope? On Wed, Dec 2, 2015 at 12:56 AM, Rajn wrote: > I am reading a binary file with a structure. Matlab takes long and I > wanted to run Julia for speed improvement. > It reads camera frames, each with certain bytesize and each frame >

Re: [julia-users] getindex for a real number

2015-12-02 Thread Glen O
On Wednesday, 2 December 2015 11:38:50 UTC+10, Tim Holy wrote: > > Conversely, there are many people who seem to want Julia to treat scalars > and > 1-vectors indistinguishably (ala Matlab). > Sure, but it should be one way or the other, not half way between. In Matlab, scalars are literally

[julia-users] using strict (was: getindex for a real number)

2015-12-02 Thread Eric Forgy
Hi, In this post , I was a little surprised to see Numbers treated in some sense as containers with partially implemented container operations, etc. Glen posted a great comment highlighting some issues: On Wednesday, 2

[julia-users] How to upload file and also specify data options with Requests.jl?

2015-12-02 Thread Ismael VC
Hello everyone! I've been trying/learning how to wrap HPE Haven OnDemand API with Julia: HavenOnDemand.jl. but I havent figured out how to send multipart data, plus other parameters, it seems to me that one can only do one or the other: "Main

[julia-users] Re: How to upload file and also specify data options with Requests.jl?

2015-12-02 Thread Ismael VC
Curl: curl -X POST --form "apikey=" --form "file=@myscan.pdf" --form "mode=document_photo" https://api.idolondemand.com/1/api/async/ocrdocument/v1 HTML: Multipart Form Example https://api.idolondemand.com/1/api/sync/ocrdocument/v1;