Re: [julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Christof Stocker
To follow up with a question on this "multiple dispatch is resolved at runtime" statement: I was under the impression, that if the Julia JIT compiler is able to infer the concrete types of the variables involved in a method call, that it will select the appropriate method at compile time. Am

Re: [julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Tomas Lycken
There's also the complication that "run time" and "compile time" are much easier to define in C++ than in Julia... // T On Wednesday, December 23, 2015 at 2:21:07 PM UTC+1, Stefan Karpinski wrote: > > That's correct. Semantically, multiple dispatch is resolved at run time, > but in practice,

Re: [julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Stefan Karpinski
That's correct. Semantically, multiple dispatch is resolved at run time, but in practice, Julia is able to resolve a lot of calls completely statically. Even more so than C++ because instead of generating a single method body for an abstract type and using virtual dispatch to call methods on

Re: [julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Spencer Russell
Instead of using "compile-time" and "run-time", is it fair to say that overloading selects a method based on the type of the expression (what you see in the code in front of you), whereas dispatch selects a method based on the type of the value (which might be a sub-type of the expression type)?

Re: [julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Stefan Karpinski
Which is precisely why in Julia there is semantically no such distinction. On Wed, Dec 23, 2015 at 8:36 AM, Tomas Lycken wrote: > There's also the complication that "run time" and "compile time" are much > easier to define in C++ than in Julia... > > // T > > On

[julia-users] How to organise (float) data in Julia?

2015-12-23 Thread jcalliess
In Matlab everything is a matrix. Hence, I am used to organise a collection of vectors in a matrix. Translated to Julia, if I have a collection of vectors x1... xn, I would store it in a matrix X = [x1 ... xn]. Is this the philosophy one should adhere to in Julia too? Or would it be better

[julia-users] Re: How to organise (float) data in Julia?

2015-12-23 Thread jcalliess
Kind of all of the above. Mainly for nonparametric machine learning at the moment. ATM I maintain X as a matrix of input vectors and F = [f1,...,fn] a matrix of outputs (i.e. a row vector in most cases, but sometimes a dxN matrix with d >1). The sample of the function f: x |-> f(x) is

[julia-users] Re: How to organise (float) data in Julia?

2015-12-23 Thread Steven G. Johnson
The choice of the most appropriate data structure depends a lot on what you plan to do with the data. How are you going to use the vectors? Is the number of vectors fixed or does it grow/shrink often at runtime? Are you going to do linear-algebra operations on the set of vectors (e.g.

[julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread Ismael Venegas Castelló
I have found this ones at Gist: * https://gist.github.com/search?l=julia=.juliarc.jl=searchresults=%E2%9C%93 This one is aslo in my .juilarc.jl nowadays ...a total life saver! XD "https://xkcd.com/303; nethack() = run(`telnet nethack.alt.org`) El miércoles, 23 de diciembre de 2015, 14:38:44

[julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread cdm
there is this message over on julia-dev: https://groups.google.com/d/msg/julia-dev/8qzfy2Za9qc/k_4fXNt_szIJ

Re: [julia-users] What is @d?

2015-12-23 Thread Tony Kelman
May be grep-able, but doesn't change the point that a single letter macro name is not the greatest for readability.

Re: [julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread Stefan Karpinski
Mine's empty. I just take anything I want in .juliarc.jl and put it directly in base. j/k On Wed, Dec 23, 2015 at 6:53 PM, cdm wrote: > > there is this message over on julia-dev: > > > https://groups.google.com/d/msg/julia-dev/8qzfy2Za9qc/k_4fXNt_szIJ > >

[julia-users] What is @d?

2015-12-23 Thread Eric Forgy
Hi, I'm spending some quality time with Blink.jl trying to understand how it works and came across a macro @d. As you can imagine, it is difficult to search for this macro definition :D Any ideas? Best regards, Eric

Re: [julia-users] What is @d?

2015-12-23 Thread Stefan Karpinski
grep -RP '^\s*macro\s+d\s*\(' assuming GNU grep with PCRE mode support On Wed, Dec 23, 2015 at 10:47 PM, Eric Forgy wrote: > Hi, > > I'm spending some quality time with Blink.jl trying to understand how it > works and came across a macro @d. As you can imagine, it is

Re: [julia-users] What is @d?

2015-12-23 Thread Eric Forgy
Hi Stefan, I'm a poor Windows/Matlab guy and haven't been on a *nux box since 2002 :) The command didn't work for me from Julia Shell mode, from Windows Command Prompt or even from my Git Bash :D On Thursday, December 24, 2015 at 12:23:46 PM UTC+8, Stefan Karpinski wrote: > > grep -RP

[julia-users] A trivial multiplication and Julia is giving wrong output. Why ?

2015-12-23 Thread Ümit Özden
Folks, I am using Julia 0.4.1 on Windows10. I did the following trivial multiplication and Julia is giving wrong output ? Is there any problem with my installation of Julia ? ` In [2] 1234567*12345678 Out[2]: -1272282078 The correct output should be: 15241566651426 Thank

[julia-users] What's in your .juliarc.jl file?

2015-12-23 Thread SundaraRaman R
I'm a newbie to Julia and just today learnt that there's a .juliarc.jl initialization file. So I'm curious what sorts of things people use it for. Some DDG-ing and Googling only returned this gist: https://gist.github.com/Ismael-VC/6db0c310eaf04d0b0a1b in which at least the `separator()`

Re: [julia-users] A trivial multiplication and Julia is giving wrong output. Why ?

2015-12-23 Thread Stuart Brorson
Julia is assuming your inputs are 32 bit integers. The result of multiplying them is larger than 2^32-1. Therefore, the integer multiplication is performed modulo 2^32, which is what the hardware does naturally. Try doing typeof(1234567) to see what type Julia thinks your numbers are. Read

[julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread cdm
related question; perhaps with responses that are similarly helpful: what Julia-related contents can be found in your .bashrc ? (maybe only Julia version paths, but i would not be surprised at more ...) curious ... ~ cdm

Re: [julia-users] A trivial multiplication and Julia is giving wrong output. Why ?

2015-12-23 Thread Spencer Russell
Hi Ümit, You're hitting integer overflow: http://docs.julialang.org/en/release-0.4/manual/faq/#why-does-julia-use-native-machine-integer-arithmetic Each of your operands can fit in an Int32, but the product can't. See the linked info for some strategies for dealing with this. -s On Wed, Dec

[julia-users] A trivial multiplication and Julia is giving wrong output. Why ?

2015-12-23 Thread Kristoffer Carlsson
Int on 32 bit system defaults to int32 so you will overflow the resulting 32 bit integer. Use Int64(123..) * Int64(123..) if you want to explicitly use int64s.

Re: [julia-users] What's in your .juliarc.jl file?

2015-12-23 Thread Tom Breloff
I have this: using Plots plotly() default(legend=false, size=(1000,1000)) On Wednesday, December 23, 2015, Ismael Venegas Castelló < ismael.vc1...@gmail.com> wrote: > I have found this ones at Gist: > > * > https://gist.github.com/search?l=julia=.juliarc.jl=searchresults=%E2%9C%93 > > This one

Re: [julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread Christian Peel
To enable a per-directory startup file, I use the following code (which came from this list) if chomp(readall(`pwd`)) != ENV["HOME"] if isfile("juliarc.jl") require("juliarc.jl") end end On Wed, Dec 23, 2015 at 9:53 PM, Ethan Anderes wrote: > I can’t

[julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread Ethan Anderes
I can’t live without this… function paste() include_string(clipboard()); end Entering paste() at the REPL prompt evaluates whatever you just copied. I find it extremely useful when copy-and-pasting largish blocks of code while prototyping…especially since, without it, the evaluations can

Re: [julia-users] What is @d?

2015-12-23 Thread Eric Forgy
Cool! Thanks Greg. I am also using Atom and happy to learn new tricks :) On Thursday, December 24, 2015 at 1:33:04 PM UTC+8, Greg Plowman wrote: > > Hi Eric, > > I too am a long suffering Windows user. > > I find the Atom editor to be useful here: > From the menu bar, Find->Find in Project > I

Re: [julia-users] What is @d?

2015-12-23 Thread 'Greg Plowman' via julia-users
Hi Eric, I too am a long suffering Windows user. I find the Atom editor to be useful here: >From the menu bar, Find->Find in Project I typed "macro d(" 1 result found in 1 file for macro d( v0.4\Lazy\src\macros.jl 241 macro d(xs...) And here's the macro: macro d(xs...) @cond if VERSION

Re: [julia-users] How to change the character at a specific position of a string?

2015-12-23 Thread Tomas Lycken
If/when you need the result, you can use join to get a string. For example: julia> as = collect("") 4-element Array{Char,1}: 'a' 'a' 'a' 'a' julia> as[2] = 'b' 'b' julia> as 4-element Array{Char,1}: 'a' 'b' 'a' 'a' julia> join(as) "abaa" // T On Tuesday, December 22, 2015 at

[julia-users] what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Neal Becker
Is there a difference?

[julia-users] Re: what's the difference btwn multiple dispatch and c++ overloading?

2015-12-23 Thread Eric Forgy
Try this? http://stackoverflow.com/questions/1801216/what-is-the-difference-between-multiple-dispatch-and-method-overloading On Wednesday, December 23, 2015 at 8:50:08 PM UTC+8, Neal Becker wrote: > > Is there a difference? > >

[julia-users] Re: Help needed with understanding types and arguments re: methods(Complex)

2015-12-23 Thread kleinsplash
Thanks guys! that makes a lot more sense.. On Tuesday, 22 December 2015 14:49:19 UTC+2, kleinsplash wrote: > > Hi, > > > I am working through a tutorial and have come across this line: > > > call{T<:Real}(::Type{Complex{T<:Real}}, re::T<:Real, im::T<:Real) at > complex.jl:4 > > when running: