[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Tomas Lycken
Another way would be to just initialize a `MersenneTwister` stream on each process, and seed them differently. Since the streams are process local, there shouldn't be any communication overhead, and streams with different seeds should be independent. // T On Wednesday, July 16, 2014 7:07:09

[julia-users] Unexpected type of result

2014-07-16 Thread Tomas Krehlik
I came across a behavior that leaves me a bit puzzled, here is example: v = mapslices(var,randn(1000, 3, 19), [1]) [v[1,1,j] for j=1:19] I would expect the resulting Vector to be Float64, not Any. Can anybody tell me if I am doing something wrong or why it should be expected to be Any? Thanx.

[julia-users] Re: Unexpected type of result

2014-07-16 Thread Tomas Lycken
Are you doing this in the REPL, or inside a function? Type inference isn't great in the global scope, at least partly because Julia can't know that the types won't change in the future, and therefore can't make as tight inferences as it would otherwise. I tried wrapping your code in a

[julia-users] question about GSL.jl package usage

2014-07-16 Thread Florian Oswald
Hi! I want to use the function interpolation suite from the GSL library. I came across the GSL.jl package which wraps the entire GSL library (which is awesome). I am stuck with setting up the interpolation object and wanted to reach out for help. my issue is described here in greater detail:

[julia-users] ways to improve performance of a non-integer power?

2014-07-16 Thread Florian Oswald
i'm looking for ways to improve the performance of ^ as in f(x) = x^1.4 I found this thread on integer powers, and it seems there are some benefits of calling system pow() functions (sometimes). https://github.com/JuliaLang/julia/issues/2741 is there anything related for non-integer powers or

[julia-users] Replacing modules that extend methods doesn't replace extensions

2014-07-16 Thread Tomas Lycken
If a I import a function explicitly into a module and extend it with new methods, Julia seems to become quite confused when I replace the module, adding more methods with exactly the same signatures as the ones already there. I have a complete gist outlining the problem

[julia-users] build-in function to find inverse of a matrix

2014-07-16 Thread Alan Chan
sorry if it's a stupid question. But I cannot find one in the online doc. Thanks

Re: [julia-users] build-in function to find inverse of a matrix

2014-07-16 Thread Mauro
It's inv, but I was struggling to find it too: http://docs.julialang.org/en/latest/stdlib/linalg/#Base.inv but note that if you want to solve a linear system Ax =b use x = A\b On Wed, 2014-07-16 at 13:39, Alan Chan szelok.c...@gmail.com wrote: sorry if it's a stupid question. But I cannot find

[julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread Tomas Lycken
`inv` will do that for you. http://docs.julialang.org/en/latest/stdlib/linalg/#Base.inv It's a little unfortunate that the help text is Matrix inverse, yet searching for that exact phrase yields no results at all. Is it possible to make documentation search be full-text for help text as well?

[julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread Hans W Borchers
But apropos does find it: julia apropos(matrix inverse) INFO: Loading help data... Base.inv(M) On Wednesday, July 16, 2014 2:59:05 PM UTC+2, Tomas Lycken wrote: `inv` will do that for you. http://docs.julialang.org/en/latest/stdlib/linalg/#Base.inv It's a little unfortunate

[julia-users] Re: Replacing modules that extend methods doesn't replace extensions

2014-07-16 Thread Tomas Lycken
I think I managed to gain some futher understanding here, but I'm really uncertain if this is correct, so I'd really appreciate if someone who actually understands what's going on would confirm or correct this: What I *think* happens, is that each time the file is included, a *new* type with

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Gray Calhoun
On Wednesday, July 16, 2014 12:07:09 AM UTC-5, James Delaney wrote: If your goal is that each call to rand(), regardless of process, sequentially pulls a number from the RNG stream, then perhaps you just need to create a MersenneTwister([seed]) object. mystream = MersenneTwister(1) ##

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Gray Calhoun
On Wednesday, July 16, 2014 2:09:41 AM UTC-5, Tomas Lycken wrote: Another way would be to just initialize a `MersenneTwister` stream on each process, and seed them differently. Since the streams are process local, there shouldn't be any communication overhead, and streams with different seeds

Re: [julia-users] Re: Replacing modules that extend methods doesn't replace extensions

2014-07-16 Thread Tim Holy
Yes, I think you've got the right idea. Really there's Qux, QuxOld, QuxOldOld, QuxOldOldOld, etc., but it's not showing you those Old parts of the name. Regarding variables of old types: yep, that's frequently a source of confusion. The example at the end of the FAQ section shows an example:

[julia-users] Re: Setting RNG seeds for parallel computing

2014-07-16 Thread Tomas Lycken
Yeah, sorry - I suspected there might be something I was missing. According to the wikipedia page about the MT http://en.wikipedia.org/wiki/Mersenne_twister one of its disadvantages is just that: It can take a long time to turn a non-random initial state—particularly an initial state with

[julia-users] Re: my first julia function

2014-07-16 Thread Dahua Lin
With the latest Julia, you can do this by sumabs2(x) Dahua On Wednesday, July 16, 2014 9:57:54 AM UTC-5, Neal Becker wrote: As a first exercise, I wanted to code magnitude squared of a complex 1-d array. Here is what I did: mag_sqr{T} (x::Array{Complex{T},1}) =

[julia-users] Re: my first julia function

2014-07-16 Thread Neal Becker
Dahua Lin wrote: With the latest Julia, you can do this by sumabs2(x) Dahua On Wednesday, July 16, 2014 9:57:54 AM UTC-5, Neal Becker wrote: As a first exercise, I wanted to code magnitude squared of a complex 1-d array. Here is what I did: mag_sqr{T} (x::Array{Complex{T},1}) =

Re: [julia-users] Re: my first julia function

2014-07-16 Thread John Myles White
To follow up on Dahua's comment: If you're interested in using the fastest code, the code that Dahua posted is the fastest since it uses several clever tricks to get the absolute best speed. If you're interested in writing a faster implementation than the one you wrote, you need to avoid

Re: [julia-users] Re: my first julia function

2014-07-16 Thread Leah Hanson
Help data is hand-written; if no one has documented a function yet, then it just tells you how many methods there are. `methods(sumabs2)` would show you the method signatures. If you want to add to the help documentation, you can edit this file:

[julia-users] Re: my first julia function

2014-07-16 Thread Matt Bauman
On Wednesday, July 16, 2014 11:28:12 AM UTC-4, Dahua Lin wrote: sumabs2(x) That's cheating! Neal, I think what you wrote will work just fine, and sumabs2 will work even better. It's a little tough to see what all is being done in its implementation because the base library is trying to eek

Re: [julia-users] Re: my first julia function

2014-07-16 Thread Tim Holy
For me at least (using v0.3.0-rc1), sumabs2 is not an exported function. Usually those do not have any associated help. You can still call it as Base.sumabs2, but non-exported functions may not have a stable interface. --Tim On Wednesday, July 16, 2014 11:36:57 AM Neal Becker wrote: Why is

Re: [julia-users] my first julia function

2014-07-16 Thread Kevin Squire
It was exported after rc1 and will be available in the next rc (hopefully with docs!). Cheers, Kevin On Wednesday, July 16, 2014, Tim Holy tim.h...@gmail.com wrote: For me at least (using v0.3.0-rc1), sumabs2 is not an exported function. Usually those do not have any associated help. You

[julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread gael . mcdon
I think that one of the main reasons it is so difficult to find is that inv should generally be avoided. As Mauro wrote, if you can, rephrase your problem so that you can use x = A\b.

[julia-users] Re: Jupyter project

2014-07-16 Thread Steven G. Johnson
On Tuesday, July 15, 2014 3:46:49 PM UTC-4, Sam L wrote: I haven't heard of it before, but if I understand correctly, the Jupyter project is about splitting the language-agnostic parts of IPython out into its own project. Looks interesting! IPython was already split into

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Jake Bolewski
Hi Ben, That character is probably defined as a unicode 6 math symbol. UTF8proc is a library that julia uses to do Unicode normalization and it currently does not support unicode 6 characters. Luckily it seems like Steven Johnson is on a quest to make every possible unicode symbol

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Steven G. Johnson
On Wednesday, July 16, 2014 3:40:31 PM UTC-4, Ben Arthur wrote: julia const ∪ = union ∪ is already defined to union in Julia. julia const ¬ = ! ERROR: syntax: invalid character ¬ The ¬ character (U+00AC) is in category Sm (math symbols), and Julia does not allow all possible math symbols

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Steven G. Johnson
On Wednesday, July 16, 2014 3:56:49 PM UTC-4, Jake Bolewski wrote: That character is probably defined as a unicode 6 math symbol. (No, ¬ has been in Unicode since at least Unicode 4, and probably earlier.)

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread j verzani
Here is a small argument: in SymPy the negation prints with that character. So to match the output I was hoping to utilize (U+00AC) as ! for input. Easy to work around, but it might be nice to have. On Wednesday, July 16, 2014 4:04:07 PM UTC-4, Steven G. Johnson wrote: On Wednesday, July

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Stefan Karpinski
Also, it gave them a chance to design a snazzy new website! The logo with sun and planets a la Galileo is just brilliant. On Wed, Jul 16, 2014 at 12:15 PM, Steven G. Johnson stevenj@gmail.com wrote: On Tuesday, July 15, 2014 3:46:49 PM UTC-4, Sam L wrote: I haven't heard of it before,

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Steven G. Johnson
On Wednesday, July 16, 2014 4:12:05 PM UTC-4, j verzani wrote: Here is a small argument: in SymPy the negation prints with that character. So to match the output I was hoping to utilize (U+00AC) as ! for input. Easy to work around, but it might be nice to have. Another argument is

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Steven G. Johnson
I wonder if we should extend utf8proc to understand the ConScript unicode http://en.wikipedia.org/wiki/ConScript_Unicode_Registryregistry too. That way we can support Klingon and Elvish identifiers in Julia. ;-)

Re: [julia-users] Re: essay on the history of programming languages

2014-07-16 Thread Pablo Zubieta
Ismael, although ASCIIString is a subtype of String, Array{ASCIIString,1} is not a subtype of Array{String,1}. As far as I understand Julia has been designed this way for practical reasons. You can read about it in the manual's section: Types. You might want to rewrite your function as

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Steven G. Johnson
It inspires Unicode envy too; they have a Unicode codepoint (♃) for their project, whereas I don't think we'll ever get the Julia logo into Unicode. On Wednesday, July 16, 2014 4:22:36 PM UTC-4, Stefan Karpinski wrote: Also, it gave them a chance to design a snazzy new website! The logo with

Re: [julia-users] Re: my first julia function

2014-07-16 Thread Ivar Nesje
@Leah Hanson Note that helpdb.jl is autogenerated from the .rst files. doc/stdlib/base.rst https://raw.githubusercontent.com/JuliaLang/julia/master/doc/stdlib/base.rst now contains the documentation, so it should be included in upcoming releases. There is a problem where some versions of

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Steven G. Johnson
On Wednesday, July 16, 2014 3:56:49 PM UTC-4, Jake Bolewski wrote: Luckily it seems like Steven Johnson is on a quest to make every possible unicode symbol available in Julia so this should be fixed soon. https://github.com/JuliaLang/julia/pull/7630

Re: [julia-users] Re: ways to improve performance of a non-integer power?

2014-07-16 Thread Stefan Karpinski
On Wed, Jul 16, 2014 at 12:39 PM, Florian Oswald florian.osw...@gmail.com wrote: do you think this log issue may be worth a mention in the performance tips section of the manual? I would have never guessed that there could be a fast/slow issue with such basic functions. Little do I know! The

[julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Jake Bolewski
On Wednesday, July 16, 2014 4:45:00 PM UTC-4, Steven G. Johnson wrote: On Wednesday, July 16, 2014 3:56:49 PM UTC-4, Jake Bolewski wrote: Luckily it seems like Steven Johnson is on a quest to make every possible unicode symbol available in Julia so this should be fixed soon.

Re: [julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Stefan Karpinski
On Wed, Jul 16, 2014 at 1:04 PM, Steven G. Johnson stevenj@gmail.com wrote: ∪ is already defined to union in Julia. Note that it also supports infix syntax: julia A = Set(1,2,3) Set{Int64}({2,3,1}) julia B = Set(2,4,5) Set{Int64}({4,2,5}) julia A ∪ B Set{Int64}({4,2,3,5,1})

Re: [julia-users] Re: Call for Unicode julia source examples

2014-07-16 Thread Stefan Karpinski
On Wed, Jul 16, 2014 at 1:12 PM, j verzani jverz...@gmail.com wrote: Here is a small argument: in SymPy the negation prints with that character. So to match the output I was hoping to utilize (U+00AC) as ! for input. Easy to work around, but it might be nice to have. On Wednesday, July 16,

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread gael . mcdon
I agree. What I meant is that since inv is avoided, it's not used nor well referenced in search engines or on this list. :)

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Spencer Russell
ஃ isn't too bad (via http://shapecatcher.com/) peace, s On Wed, Jul 16, 2014 at 4:38 PM, Steven G. Johnson stevenj@gmail.com wrote: It inspires Unicode envy too; they have a Unicode codepoint (♃) for their project, whereas I don't think we'll ever get the Julia logo into Unicode. On

[julia-users] Julia gives numerical results different by a factor of 20 (varies with different input parameters) when comparing to python

2014-07-16 Thread Andrius Popovas
Hello, I have a code for calculating some physical quantities. I had a very rough day trying to understand, why my results differ so much from what I should get. Up until I have tried the same code in Python and I got the correct result. Both codes are completely identical, but why is there a

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Stefan Karpinski
Oh, excellent. The Julia Unicode character is U+B83 – 'ஃ' – the Tamil character visarga. On Wed, Jul 16, 2014 at 2:08 PM, Spencer Russell s...@mit.edu wrote: ஃ isn't too bad (via http://shapecatcher.com/) peace, s On Wed, Jul 16, 2014 at 4:38 PM, Steven G. Johnson stevenj@gmail.com

Re: [julia-users] Re: essay on the history of programming languages

2014-07-16 Thread Ismael VC
Thanks for that Pablo! I figured it out, while reading the Multiple Dispatch PDF, I also saw this other way: function Pkg.add(pkgs::String...) Pkg.update() for pkg in pkgs Pkg.add(pkg) end end

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread Luke Stagner
The is also the alchemical symbol for oil http://www.fileformat.info/info/unicode/char/1f746/index.htm ༜

[julia-users] Re: Julia gives numerical results different by a factor of 20 (varies with different input parameters) when comparing to python

2014-07-16 Thread Ethan Anderes
Changing the line for nu=1:nu_max to for nu=0:(nu_max-1) makes julia agree with python. On Wednesday, July 16, 2014 1:55:40 PM UTC-7, Andrius Popovas wrote: Hello, I have a code for calculating some physical quantities. I had a very rough day trying to understand, why my results differ so

Re: [julia-users] Julia gives numerical results different by a factor of 20 (varies with different input parameters) when comparing to python

2014-07-16 Thread Tim Holy
In such cases I'd recommend printing the values at each step to see where they first differ. --Tim On Wednesday, July 16, 2014 01:55:40 PM Andrius Popovas wrote: Hello, I have a code for calculating some physical quantities. I had a very rough day trying to understand, why my results differ

Re: [julia-users] Re: Jupyter project

2014-07-16 Thread J Luis
And we have also, Julia the Language Predator https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcT1MtrE5eL7PDMoMJRwci9TPqfoeUWNXMStctBOEUzufAipdrvm8Q https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcT1MtrE5eL7PDMoMJRwci9TPqfoeUWNXMStctBOEUzufAipdrvm8Q Quarta-feira, 16 de Julho de

[julia-users] Re: ways to improve performance of a non-integer power?

2014-07-16 Thread Jason Riedy
And Florian Oswald writes: I would have never guessed that there could be a fast/slow issue with such basic functions. Little do I know! See also Jean-Michel Muller's text on Elementary Functions, Algorithms and Implementation and others (including, imho, Markstein's IA-64 and Elementary

[julia-users] Re: PSA: Julia 0.3-RC1 packages working well again

2014-07-16 Thread Tony Fong
It's a little late now, but I have updated Lint.jl to warn on extending a deprecated function. It parses the deprecated.jl and keeps a list. If a new function definition matches the signature of a deprecated function, it'd give a lint error. The definition of a match is more relaxed than the

Re: [julia-users] Re: ways to improve performance of a non-integer power?

2014-07-16 Thread Florian Oswald
Hi Stefan, I've got no idea about the technical implications, i.e. why julia's log is slower (on some systems?) than libm's and what's involved in bringing performance up to par. I mentioned the manual only because this is the second time that someone suggests the system-log trick to me, and it

[julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread Alan Chan
any reason of avoiding inv?

[julia-users] any packages for AI usage

2014-07-16 Thread Alan Chan
namely, different linear regression, logistical regression, gradient descent, neural network backprop, etc?

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Kevin Squire
Interesting. Can you (or did you) file an issue? Cheers, Kevin On Wed, Jul 16, 2014 at 4:36 PM, Laszlo Hars laszloh...@gmail.com wrote: I hoped that at some point Julia error messages would again appear in STDERR. No luck. Even the Release candidate 0.3.0-rc1 fails to write, e.g.

Re: [julia-users] insert! function only for item not items

2014-07-16 Thread Michael Louwrens
Thanks! Could you perhaps point me to a place where these sort of things may be documented? Trying to adopt the language has been less painful than Python was. Python however, has better documentation currently for these kind of small things. Python is also far more mature so go_figure!

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Laszlo Hars
I don't know, how to file an issue. Where can I get instructions? (The STDERR behavior may be intentional. I kept asking about it in this group, for months, but nobody was interested.) On Wednesday, July 16, 2014 6:36:23 PM UTC-6, Kevin Squire wrote: Interesting. Can you (or did you) file an

Re: [julia-users] insert! function only for item not items

2014-07-16 Thread Kevin Squire
Yep, Python documentation is quite good, and Julia's has a little ways to go. (Did you see Python's documentation 10 years ago, though? ;-) There wasn't much, if any, documentation about n:n-1 empty ranges or splicing without removal, so I just added some (

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Jameson Nash
I think the change in the STDERR behavior was intentional, once we got rid of the limitations of using libreadline. Now we can run multiple simultaneous independent REPL loops, thanks to Keno's work. Redirecting STDERR and having that propagate to the stderr stream used by the REPL was a

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Kevin Squire
Per Jameson's response and my own testing, it seems like the STDERR issues have been resolved (perhaps after rc1?): $ julia -e 'throw(DomainError())' 1 stdout.txt 2 stderr.txt $ cat stdout.txt $ cat stderr.txt ERROR: DomainError in process_options at ./client.jl:213 in _start at

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Kevin Squire
Or not. See https://github.com/JuliaLang/julia/issues/7633. On Wed, Jul 16, 2014 at 7:13 PM, Kevin Squire kevin.squ...@gmail.com wrote: Per Jameson's response and my own testing, it seems like the STDERR issues have been resolved (perhaps after rc1?): $ julia -e 'throw(DomainError())' 1

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-16 Thread Laszlo Hars
the STDERR behavior was intentional 1) It just does not seem to be logical: warning messages still get written to STDERR. Why? And what is the use of STDERR, in general? STDERR is in the documentation, without telling anything about it. 2) The REPL behavior ought to be documented, otherwise new

[julia-users] Julia idiom for something like CLOS's call-next-method

2014-07-16 Thread Markus Roberts
Most multimethod systems seem to have a way to call the next-most-general method of a function, but I'm not seeing a good way to do that in Julia. This is complicated by the fact that my sense of what's idiomatically clean in Julia isn't very well honed yet. If Julia had CLOS's

Re: [julia-users] Julia idiom for something like CLOS's call-next-method

2014-07-16 Thread Keno Fischer
Usually the answer to this is to factor your methods so this is unnecessary (e.g. by having a secondary method that does the actual work). If that doesn't work for you for some reason, there's also `invoke(bar,(Fu,),f)` which does what you want. On Wed, Jul 16, 2014 at 9:03 PM, Markus Roberts

Re: [julia-users] Julia idiom for something like CLOS's call-next-method

2014-07-16 Thread Stefan Karpinski
If you replace call-next-method() with invoke(bar,(Fu,),f) then it does what you want. The situation in Julia is a bit more complicated since you don't know which argument(s) you want to push further up the type lattice. The invoke function works by letting you specify exactly which less specific

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-16 Thread Stefan Karpinski
It's a bit of numerical computing lore that inv is bad – both for performance and for numerical accuracy. It turns out it may not be so bad http://arxiv.org/pdf/1201.6035v1.pdf after all, but everyone is still kind of wary of it and there are often better ways to solve problems where inv would be