[julia-users] list kw args

2016-07-05 Thread Leonardo
There is a way to list all keyword arguments defined by a function f? (a sort of reflection?) e.g.; *having*function f(i::Int; a::AbstractString=0, b::Float64=0.0) ... end *how to return a, b from f?* Many thanks in advance Leonardo

Re: [julia-users] More on Macros

2016-07-05 Thread Rangarajan Krishnamoorthy
That was very helpful. Thanks for your patience. -Rangarajan On Wednesday, July 6, 2016 at 9:39:56 AM UTC+5:30, Isaiah wrote: > > Is there a clear language spec for macros, or is it still evolving? I >> understand that relying on implementation to learn a language feature can >> be risky. >> >

Re: [julia-users] More on Macros

2016-07-05 Thread Isaiah Norton
> > Is there a clear language spec for macros, or is it still evolving? I > understand that relying on implementation to learn a language feature can > be risky. > There is no formal spec that I am aware of. However, I don't remember any substantive changes except for this one in 0.5-dev:

[julia-users] Re: Master list of constants

2016-07-05 Thread mmh
On v0.5 this gives: ERROR: UndefVarError: @MIME not defined in eval(::Module, ::Any) at .\boot.jl:234 in macro expansion; at .\REPL[4]:2 [inlined] in anonymous at .\:? in eval(::Module, ::Any) at .\boot.jl:234 in macro expansion at .\REPL.jl:92 [inlined] in

Re: [julia-users] R code to Julia Performance issues with pmap

2016-07-05 Thread Stefan Karpinski
Similar question and answer: http://stackoverflow.com/questions/38075163/julia-uses-only-20-30-of-my-cpu-what-should-i-do/38075939 . On Tue, Jul 5, 2016 at 11:26 AM, wrote: > I am a complete newcomer to Julia and trying to port some of my R code to > it; > Basically I have

Re: [julia-users] Re: MYSQL/MARIADB Big INSERT

2016-07-05 Thread Andrey Stepnov
Hi Palli! Thanks for reply. Here is code with transactions example: mysql_query(con, "SET autocommit = 0") mysql_query(con, "START TRANSACTION;") mysql_stmt_prepare( con, """ INSERT INTO srss_api_production.pga_data

Re: [julia-users] Re: Master list of constants

2016-07-05 Thread Stefan Karpinski
The master list is basically this: https://github.com/JuliaLang/julia/blob/7b3f5296c54d0362ab90c2299b4c9255aca171a8/base/irrationals.jl#L127-L131 On Tue, Jul 5, 2016 at 9:42 AM, esproff wrote: > Ok great! Thanks Kenta and Lyndon for your quick responses! > > > On Tuesday,

[julia-users] Calling a Julia function from C++ that takes a Julia callback function as an argument

2016-07-05 Thread Jeff
Hi all, I'd like to call a Julia function from C++. This Julia function takes another Julia function as an argument (a callback function). I'd like to write this callback function entirely in C++ too, and pass it directly to Julia, without declaring a global name for it in Julia's name

[julia-users] R code to Julia Performance issues with pmap

2016-07-05 Thread jascisen
I am a complete newcomer to Julia and trying to port some of my R code to it; Basically I have rewritten the following R code in Julia: library(parallel) eps_1<-rnorm(100) eps_2<-rnorm(100) large_matrix<-ifelse(cbind(eps_1,eps_2)>0,1,0) matrix_to_compare =

[julia-users] Help on channels

2016-07-05 Thread Jon Norberg
A=RemoteRef(()->Channel{Int64}(10), 1) Works but Put!(A,1,1) gives LoadError: MethodError: `put!` has no method matching put!(::Channel{Int64}, ::Int64, ::Int64) Closest candidates are: put!(::Channel{T}, ::Any) put!(!Matched::Base.RemoteValue, ::Any...)

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Thanks, Tim. The reason I can't run specific lines from the test file is that the test needs to call module B first to get something which will be passed as argument to a function in module A and it is this function that I'm testing. Here is what it looks like: Module A: module A import B

Re: [julia-users] Re: Converting from ColorTypes to Tuple

2016-07-05 Thread Tim Holy
Well, you've just written that convenience function yourself :-). It's not more complicated than that. The reason there isn't an exported function is because the general case is not quite as simple as it may seem. For example, BGR and RGB both mean "RGB colors," but with different internal

[julia-users] Re: Is empty map result type going to be fixed?

2016-07-05 Thread Jussi Piitulainen
Thanks for the very current information. Seems the fate of empty comprehensions was uncertain a month ago. I'm again not sure how or whether it has been resolved, but otherwise there is a lot there that I really look forward to. The empty map type in your example seems to be what I would like

Re: [julia-users] Re: How can I find the common elements of two matrix(or arrays)?

2016-07-05 Thread siyu song
Good to know this method. Thanks a lot. 在 2016年7月6日星期三 UTC+9上午1:45:21,Cedric St-Jean写道: > > In Julia, if speed isn't too important, this gives the same results: > > a, b = [-1,-2,-3], [-3,-4,-5,-2] > inter = intersect(a, b) > (Int[findfirst(a, x) for x in inter], Int[findfirst(b, x) for x in

[julia-users] Re: Converting from ColorTypes to Tuple

2016-07-05 Thread Islam Badreldin
Forgot to add `using ColorTypes` to the top of the minimal example. -Islam On Tuesday, July 5, 2016 at 12:55:37 PM UTC-4, Islam Badreldin wrote: > Hello, > > I was experimenting with plotting using PyPlot and I wanted to create line > plots with custom colors. I wanted to use a color palette

[julia-users] Re: Fun Fact: Julia is space sensitive (in some sense)

2016-07-05 Thread FANG Colin
Agree. It is very hard to spot the issue if it is combined with the bug that error message sometimes cannot get the line number right.

Re: [julia-users] Re: How can I find the common elements of two matrix(or arrays)?

2016-07-05 Thread Cedric St-Jean
In Julia, if speed isn't too important, this gives the same results: a, b = [-1,-2,-3], [-3,-4,-5,-2] inter = intersect(a, b) (Int[findfirst(a, x) for x in inter], Int[findfirst(b, x) for x in inter]) And it should be a good deal faster than the MATLABism. Other functions you might find useful:

[julia-users] Re: VS code extension

2016-07-05 Thread FANG Colin
Thank you. I used to use https://github.com/Mike43110/julia.vscode which unfortunately doesn't provide the command for mark selection as comments.

[julia-users] Re: How can I find the common elements of two matrix(or arrays)?

2016-07-05 Thread siyu song
Thanks, Fred, for your answer. But in fact I want to know the index of the common elements of two integer vectors(Elements are all different in each vectors). For example, v1 = [1,2,3] and v2[3,4,5,2]. So the answer should be common_index1 = [2,3], common_index2 = [1,4]. I use a function as

[julia-users] How do I plot into an ITerm2 window?

2016-07-05 Thread Erik Schnetter
How do I plot directly into an ITerm2 window? ITerm2 (an OS X equivalent of xterm) supports displaying graphics right in the terminal window. I've heard that the "TerminalExtensions" package helps support this. My question is now -- how do I use this? Is there e.g. a backend for the "Plots"

Re: [julia-users] More on Macros

2016-07-05 Thread Isaiah Norton
Anonymous functions are a bit incomplete / not-fully-integrated in 0.4, and I think this falls out as a consequence. You can simulate the result you want with: julia> function returnMacro() eval(parse(""" macro myMacro(anexpr) parse(anexpr) end

Re: [julia-users] More on Macros

2016-07-05 Thread Tom Breloff
I think you're confused about several things. First, yes a Void is expected, because that's what a macro definition will yield. - It is almost always a bad idea to call "eval(parse(...))". You'd probably doing something wrong if you ever feel the need to do that. - "Parse time" is not always

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread Tim Holy
Ah. Can't you just run specific lines from that test file? You could even copy it and then delete the irrelevant lines using an editor, if you need to run many tests. --Tim On Tuesday, July 5, 2016 7:03:07 AM CDT chobbes...@gmail.com wrote: > Tim, Thanks. > > The problem is this: I wrote a

Re: [julia-users] Re: MYSQL/MARIADB Big INSERT

2016-07-05 Thread Páll Haraldsson
On Tuesday, July 5, 2016 at 7:07:09 AM UTC, Andrey Stepnov wrote: > > Hi Ivar! > > There is no documentation about transactions for MySQL.jl. I understand > that it wrap C libs but it's not clear how to call transaction mechanism > from julia. > I do not know for sure about MySQL, as I'm a

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Tim, Thanks. The problem is this: I wrote a module A and made a test to test module A. But both of module A and the test itself need to call another module B frequently. I want to see how A is calling B and don't care how the test is calling B. That's why I want to separate the profiling of

[julia-users] Re: Julia community stewards

2016-07-05 Thread Chris Rackauckas
I think in general we need some active mods for IRC/Gitter. Some people with the ability to edit something to get rid of accidental mentions (sorry @parallel) and ban spammers. It's not too bad, and most issues are dealt with people being reasonable, but I can see future moderation needed.

[julia-users] Re: What is the recommended way to update Julia in OS X with Julia.app?

2016-07-05 Thread Garret Linn
Many thanks worked fine and then a Pkg.update() and all was good GL On Monday, July 4, 2016 at 4:18:34 PM UTC-4, Garret Linn wrote: > > Hi > > Julia noob here > > What is the proper way to update Julia in OS X with Julia.app? > > I would like to update without having to re-install all

[julia-users] Re: Master list of constants

2016-07-05 Thread esproff
Ok great! Thanks Kenta and Lyndon for your quick responses! On Tuesday, July 5, 2016 at 4:23:47 AM UTC-7, Lyndon White wrote: > > You can use the `names` function to search a module for all constants it > defines. > By evaluating the names to get the values, then checking if they are >

Re: [julia-users] Question on Macros

2016-07-05 Thread Isaiah Norton
> > I am new to Julia, but have a background in Lisp and other languages. I > found it interesting that Julia supports Macros similar to Lisp. A few > questions: > Welcome. You may be interested in this recent talk: https://www.youtube.com/watch?v=dK3zRXhrFZY > 1) Julia uses "@" operator as a

Re: [julia-users] Question on Macros

2016-07-05 Thread Tom Breloff
You ask why the "@" symbol is needed, and then point out that you can have a macro and function of the same name, and that might lead to subtle mistakes. I think you just answered your own question! Macros are called at parse time, and it's valuable to have a clear syntax to distinguish from

[julia-users] Question on Macros

2016-07-05 Thread Rangarajan Krishnamoorthy
Hi, I am new to Julia, but have a background in Lisp and other languages. I found it interesting that Julia supports Macros similar to Lisp. A few questions: 1) Julia uses "@" operator as a prefix to a macro call. Why is this needed at all? Why not call it like a normal function without the

[julia-users] Re: What is the recommended way to update Julia in OS X with Julia.app?

2016-07-05 Thread specter119
I install julia by home-cask , i think all package will be stored at ~/.julia by default. And re-install julia.app has nothing to do with all packages. I this this will help you. 在 2016年7月5日星期二 UTC+8上午4:18:34,Garret Linn写道: Hi > > Julia noob here > > What is the

Re: [julia-users] Re: How to profile a module?

2016-07-05 Thread Tim Holy
I don't know what "profiling a module" means. You profile running code, wherever that code happens to live---and that's all there is to say. To profile the code in a module, you just have to write code that exercises the functions in the module. The meaning of the numbers is described here:

[julia-users] Re: How to profile a module?

2016-07-05 Thread chobbes158
Bump up. On Monday, July 4, 2016 at 4:33:53 PM UTC+1, chobb...@gmail.com wrote: > > I want to profile a module which is tested by a test. Following the > documentation ( > http://docs.julialang.org/en/release-0.4/manual/profile/#options-for-controlling-the-display-of-profile-results), > > I

[julia-users] Re: Master list of constants

2016-07-05 Thread Lyndon White
You can use the `names` function to search a module for all constants it defines. By evaluating the names to get the values, then checking if they are Irrational (formerly known as MathConst?) By doing this, I conclude that the ASCII name for the Euler-Mascheroni constant (γ) is eulergamma

[julia-users] Re: Master list of constants

2016-07-05 Thread Kenta Sato
eulergamma is the ASCII alias for γ. julia> γ γ = 0.5772156649015... julia> eulergamma γ = 0.5772156649015... julia> γ === eulergamma true If you are interested in generating the list of constants, you can use this script:

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
train a neural net with these data. On Tue, Jul 5, 2016 at 12:43 PM, Andre Bieler wrote: > Can you tell me what you will be doing with this tree after everything is > set up correctly?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Can you tell me what you will be doing with this tree after everything is set up correctly?

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
the objective is to get 100 (leafs) vectors (which are not equal in length) of data from child and root. initial data is in the root then the data is divided between childs (the size of each vector may varies from 1 child to another) each child share it's data with its own leaf (the size of each

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Andre Bieler
Ahmed, is it necessary that the data is stored in all 3 levels? (root has data, child has data, leaf has data) Is it not good enough if the data is stored in the leafs only? Maybe you can explain what your "end goal" is?

[julia-users] Re: How can I find the common elements of two matrix(or arrays)?

2016-07-05 Thread Fred
julia> a=[1,3,5,7] 4-element Array{Int64,1}: 1 3 5 7 julia> b=[2,3,5,6,7] 5-element Array{Int64,1}: 2 3 5 6 7 julia> intersect(a,b) 3-element Array{Int64,1}: 3 5 7 julia> union(a,b) 6-element Array{Int64,1}: 1 3 5 7 2 6 Le lundi 4 juillet 2016 04:18:10 UTC+2, siyu song a

[julia-users] Re: FENS16

2016-07-05 Thread Eric Forgy
To save other curious onlookers a few seconds of Googling, here is a link :) http://forum2016.fens.org

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
But l have encountered a problem when distributing data from root to child then to leafs. l'm looking for something like this: *level 0root : *data= rand(1) # generate 1 random values *level 1 10 child * for each child attribute a certain number of generated values ,

Re: [julia-users] Re: How to make a tree datastructure with vector data in JULIA ?

2016-07-05 Thread Ahmed Mazari
hello, l fixed the problem by adding a function called data_node() as follows : function data_node(node) println("data : ", node.data) println("index ", node.index) end for i in 1:nChildren for k in 1:root.child[i].nchild data_node(root.child[i].child[k]) end end On Monday, July

[julia-users] Re: FENS16

2016-07-05 Thread Roger Herikstad
Sorry the late reply, but I'm actually at FENS. I'm presenting a poster this afternoon (5th July; poster board F020), where the analysis was all done in Julia. Stop by if you're interested. On Sunday, July 3, 2016 at 2:39:09 AM UTC+2, Alexander Morley wrote: > > Hey, > > Are their any Julia

Re: [julia-users] best practices for using Julia to generate+save Julia source code

2016-07-05 Thread Jeffrey Sarnoff
typo -- Mauro On Tuesday, July 5, 2016 at 3:26:13 AM UTC-4, Jeffrey Sarnoff wrote: > > Hi Mauio, > Using another parameter is ok if it solves things in a way that precludes > wanting other synthetic parameters for each sort of Both that is of interest > e.g `( (size,digits), (size,bits),

Re: [julia-users] best practices for using Julia to generate+save Julia source code

2016-07-05 Thread Jeffrey Sarnoff
Hi Mauio, Using another parameter is ok if it solves things in a way that precludes wanting other synthetic parameters for each sort of Both that is of interest e.g `( (size,digits), (size,bits), (bits, digits), (size, internal precision) ... (internal precision, digits) )`. otoh, it is

Re: [julia-users] Re: MYSQL/MARIADB Big INSERT

2016-07-05 Thread Andrey Stepnov
Hi Ivar! There is no documentation about transactions for MySQL.jl. I understand that it wrap C libs but it's not clear how to call transaction mechanism from julia. I will be glad if you can provide very short explanation or example. Thank you! Andrey On Tuesday, July 5, 2016 at 4:24:05

Re: [julia-users] best practices for using Julia to generate+save Julia source code

2016-07-05 Thread Mauro
What about: immutable fromClibWithCfinalizer{ sizeofThisType, digitsofSignificand, Both } exponent ::NTuple{ Both, UInt32 ) ... end function fromClibWithCfinalizer( _ ) Both = fn( sizeofThisType, digitsOfSignificand ) fromClibWithCfinalizer{sizeofThisType, digitsOfSignificand, Both}(_)

[julia-users] Re: What is the recommended way to update Julia in OS X with Julia.app?

2016-07-05 Thread Josef Heinen
You can simply replace the existing Julia.app. The packages are installed in a separate folder $HOME/.julia. On Monday, July 4, 2016 at 10:18:34 PM UTC+2, Garret Linn wrote: > > Hi > > Julia noob here > > What is the proper way to update Julia in OS X with Julia.app? > > I would like to update