Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Henri Girard
Thanks, I use IJulia I delete it Le 24/05/2016 00:33, Andre Bieler a écrit : delete the readline if you run this in a notebook or in the julia REPL. leave it if you run it as a script.

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-23 Thread Jeffrey Sarnoff
unearthed the solution Nesting Macros ``` macro sameAction(a, b) quote @macroWithVeryLongName($a, $b) end end ``` (makes sense, pleased to see the obvious done right

Re: [julia-users] why does Julia have both map and broadcast?

2016-05-23 Thread Tony Kelman
I can see some situations where getting a matrix instead of a vector because one of the inputs was unexpectedly transposed, then sending the output to backslash or similar wouldn't trigger an error, just give a meaningless and unexpected result that would be really difficult to debug. On Sunda

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-23 Thread Jeffrey Sarnoff
I'm sure there is a way to pass macro arguments through to another macro that takes the same arguments macro sameAction(a,b) @macroWithVeryLongName(a,b) # I know this does not work end What fancy footsteps are required? On Tuesday, May 24, 2016 at 1:09:10 AM UTC-4, Ford Ox wrote: > > With f

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-23 Thread Ford Ox
With function you could do: someverylongfunctionname() = 5 foo = someverylongfunctionname foo() Idk why the same thing doesn't work for macros :( @someverylongmacroname() = :(5) @foo = @someverylongmacroname @foo() Dne úterý 24. května 2016 6:58:22 UTC+2 Jeffrey Sarnoff napsal(a): > > I have a

[julia-users] Re: methods list

2016-05-23 Thread Ford Ox
Okay, now I am really angry on myself. Sorry guys Dne úterý 24. května 2016 0:42:43 UTC+2 Steven G. Johnson napsal(a): > > > > On Monday, May 23, 2016 at 2:17:47 PM UTC-4, Ford Ox wrote: >> >> Thanks to both of you. >> I always try to find these kind of things in documentation before I post >> he

[julia-users] Re: How to make a macro that is a synonym for another macro?

2016-05-23 Thread Ford Ox
With function you could do: someverylongfunctionname() = 5 foo = someverylongfunctionname foo() Idk why nothing this doesn't work for macros @someverylongmacroname() = :(5) @foo = @someverylongmacroname @foo() ^^ both of these don't work :( Dne úterý 24. května 2016 6:58:22 UTC+2 Jeffrey Sarn

[julia-users] How to make a macro that is a synonym for another macro?

2016-05-23 Thread Jeffrey Sarnoff
I have a macro, macroWithVeryLongName(a,b), and I want a macro that does the same thing that uses a short name for convenience, sameAction(a,b).

[julia-users] Re: vector assignment performance

2016-05-23 Thread vavasis
Just to follow up on this thread in case anyone else is interested, I found that the Einsum.jl package is quite close to what I need for my FEM application. It is lacking a couple of features, so I added them to the package and have submitted a pull request. Hopefully the author of Einsum.jl

[julia-users] Re: how to reload macro def

2016-05-23 Thread vavasis
Cedric, I encountered this issue in the following context: the macro is defined inside a module. I test it from the REPL using the macroexpand function. When macroexpand bombs or else gives me the wrong expansion, I edit the file with the macro definition and reload the module via include. H

[julia-users] Re: how to reload macro def

2016-05-23 Thread Cedric St-Jean
Maybe you already know this, but macros are applied at parsing time (or right after parsing - not sure). This means that if you have # In Macro.jl macro macmac(x) ... end # In Fun.jl function foo(x) macmac(something) end Then whenever you've changed Macro.jl, you need to reload both Macro.

[julia-users] My Julia window Close Down

2016-05-23 Thread Tony Kelman
The solver is probably crashing. Run julia inside a cmd window to see what the exit message is.

[julia-users] Re: Pkg.update for packages that changed repository (git remote)

2016-05-23 Thread Tony Kelman
Yeah Pkg.update should be all for users.

[julia-users] ANN: ThinPlateSplines.jl

2016-05-23 Thread Alireza Nejati
https://github.com/anj1/ThinPlateSplines.jl

[julia-users] Re: Let's Bridge the IRC and Gitter

2016-05-23 Thread Chris Rackauckas
The bot worked really well today. Answered questions from people on IRC without a hitch. I say we keep it. On Sunday, May 22, 2016 at 10:08:26 PM UTC-7, Lyndon White wrote: > > Alright for purpose of testing, > I have created an instance of gitter-irc-bot >

[julia-users] Re: methods list

2016-05-23 Thread Steven G. Johnson
On Monday, May 23, 2016 at 2:17:47 PM UTC-4, Ford Ox wrote: > > Thanks to both of you. > I always try to find these kind of things in documentation before I post > here - respectively I was looking into reflection and introspection, but > didn't find any mention of this function. >> >> >>> See

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
delete the readline if you run this in a notebook or in the julia REPL. leave it if you run it as a script.

[julia-users] Re: how to reload macro def

2016-05-23 Thread Kaj Wiik
Maybe workspace()? help?> workspace search: workspace workspace() Replace the top-level module (Main) with a new one, providing a clean workspace. The previous Main module is made available as LastMain. A previously- loaded package can be accessed using a statement such as using LastM

[julia-users] how to reload macro def

2016-05-23 Thread vavasis
First, thanks to Matt Baumann for answering my previous post so quickly! Next question: it seems that for developing and debugging a macro, the usual REPL cycle of edit/include/edit/include does not work., I find that using 'include' to reload the macro definition defined inside a module does

[julia-users] Re: how to check if a string is a legal variable name?

2016-05-23 Thread Matt Bauman
There's Base.isidentifier. Be aware that it's not documented or exported, though. julia> Base.isidentifier("1gh") false julia> Base.isidentifier("a_b1") true On Monday, May 23, 2016 at 3:17:55 PM UTC-4, vav...@uwaterloo.ca wrote: > > A macro I'm writing needs a function to check whether a str

Re: [julia-users] Keyword chaining

2016-05-23 Thread Stefan Karpinski
No, that doesn't really make sense in Julia. Java and C don't have such a feature either. What's happening there is that the `else` clause takes a single expression, which can be a for loop. On Mon, May 23, 2016 at 2:06 PM, Ford Ox wrote: > Yep that is exactly what I mean under keyword chaining:

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Henri Girard
I delete readline ? Because plot doesn't dislay Thanks Henri Le 23/05/2016 20:41, Andre Bieler a écrit : Oh now I see... Neat. But you then need to have different ranges for the x variable. using Plots x = linspace(-2, 2, 100) xh = linspace(0, 2, 50) xk = linspace(-2, 0, 50) f = sqrt(comple

[julia-users] how to check if a string is a legal variable name?

2016-05-23 Thread vavasis
A macro I'm writing needs a function to check whether a string is a legal variable name: islegalvariablename("a_b1") => true islegalvariablename("1gh") => false I suppose this functionality must already be available somewhere? Thanks, Steve Vavasis

[julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
Oh now I see... Neat. But you then need to have different ranges for the x variable. using Plots x = linspace(-2, 2, 100) xh = linspace(0, 2, 50) xk = linspace(-2, 0, 50) f = sqrt(complex(4 .- x.^2)) g = -sqrt(complex(4 .- x.^2)) h = sqrt(complex(-xh.^2 .+ 2 * xh)) k = -sqrt(complex(-xk.^2 .-

[julia-users] Re: Plots problem ?

2016-05-23 Thread Henri Girard
Thats what I want yin/yang, can't I get rid of the line on zéro ? Thanks your model works. using Plots x=linspace(-2,2,100) f(x) = sqrt(complex(4.-x.^2)) g(x) = -sqrt(complex(4.-x.^2)) h(x) = sqrt(complex(-x.^2.+2*x)) k(x) = -sqrt(complex(-x.^2.-2*x)) plot([real(f(x)),real(h(x)), real(g(x)),r

[julia-users] Re: methods list

2016-05-23 Thread Ford Ox
Thanks to both of you. I always try to find these kind of things in documentation before I post here - respectively I was looking into reflection and introspection, but didn't find any mention of this function. Dne pondělí 23. května 2016 20:06:30 UTC+2 Kristoffer Carlsson napsal(a): > > > help

Re: [julia-users] Re: github missing Create Pull Request button

2016-05-23 Thread Keno Fischer
I filed this bug with github some years ago (having to refresh to see the button), but then it stopped happening for me. I suspect there's a race condition somewhere. On Mon, May 23, 2016 at 2:05 PM, Kristoffer Carlsson wrote: > Note that you don't need "the green button". You can just select you

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Andre Bieler
Not exactly sure what you want to do. But you take the square root of negative numbers, which then is a complex number. I dont think you can give plot a complex number to plot? The following code works, maybe you can work your way from there... ```julia using Plots x=linspace(-2,2,100) f(x) = sq

Re: [julia-users] Keyword chaining

2016-05-23 Thread Ford Ox
Yep that is exactly what I mean under keyword chaining: If multiple control flow keywords are on the same line, they need only one end keyword to end their block. For example in java / c you can do if(...) else for(...){ ... } Dne pondělí 23. května 2016 20:00:07 UTC+2 Isaiah napsal(a): > > A

[julia-users] Re: methods list

2016-05-23 Thread Kristoffer Carlsson
help?> methodswith search: methodswith methodswith(typ[, module or function][, showparents]) Return an array of methods with an argument of type typ. If optional showparents is true, also return arguments with a parent type of typ, excluding type Any. The optional second argument restr

Re: [julia-users] methods list

2016-05-23 Thread Isaiah Norton
julia> methodswith(Foo) On Mon, May 23, 2016 at 2:03 PM, Ford Ox wrote: > Is there any function that will print out all methods available for > concrete type? > > type Foo end > method1(f::Foo) = ... > method2(x::Int, f::Foo) = ... > methods(Foo) > > Foo has three methods: >> > method1(...) >> >

Re: [julia-users] Re: github missing Create Pull Request button

2016-05-23 Thread Kristoffer Carlsson
Note that you don't need "the green button". You can just select your branch from your fork and press "New Pull Request" next to it. On Monday, May 23, 2016 at 7:55:24 PM UTC+2, Cedric St-Jean wrote: > > Sorry, I don't know what kind of example I could bring except for a > screenshot with a miss

Re: [julia-users] Keyword chaining

2016-05-23 Thread Stefan Karpinski
I assumed that the missing `end` keyword was somehow part of the "keyword chaining".. On Mon, May 23, 2016 at 2:00 PM, Isaiah Norton wrote: > Also, the given example is already valid syntax... (simply missing a final > `end`) > > On Mon, May 23, 2016 at 1:51 PM, Stefan Karpinski > wrote: > >> W

[julia-users] methods list

2016-05-23 Thread Ford Ox
Is there any function that will print out all methods available for concrete type? type Foo end method1(f::Foo) = ... method2(x::Int, f::Foo) = ... methods(Foo) Foo has three methods: > method1(...) > method2(...) > methods(...) >

Re: [julia-users] Re: Plots problem ?

2016-05-23 Thread Henri Girard
Always the same problem f and g works but h and after give this error. I notice if I change x -4,4 I have got the same error Le 23/05/2016 19:02, Eric Forgy a écrit : Try x.^2. On Tuesday, May 24, 2016 at 12:48:49 AM UTC+8, Henri Girard wrote: Hi, I don't know why this plot doesn't wor

[julia-users] ANN: Transit.jl

2016-05-23 Thread Ben Kamphaus
Russ Olsen and I have made a Julia package ( https://github.com/russolsen/Transit.jl ) available that supports encoding and decoding values in the Transit format ( https://github.com/cognitect/transit-format ). Examples of use can be found at the project repository. The rationale for Transit c

Re: [julia-users] Keyword chaining

2016-05-23 Thread Stefan Karpinski
What is "keyword chaining"? Can you provide examples of languages that do something like this? On Mon, May 23, 2016 at 1:43 PM, Ford Ox wrote: > Why is there no keyword chaining in julia? > > for x in 1:30, y in 1:30 > if x == 5 && y == 5 > dosomething() > else let obj = array[y,

Re: [julia-users] Keyword chaining

2016-05-23 Thread Isaiah Norton
Also, the given example is already valid syntax... (simply missing a final `end`) On Mon, May 23, 2016 at 1:51 PM, Stefan Karpinski wrote: > What is "keyword chaining"? Can you provide examples of languages that do > something like this? > > On Mon, May 23, 2016 at 1:43 PM, Ford Ox wrote: > >>

Re: [julia-users] Re: github missing Create Pull Request button

2016-05-23 Thread Cedric St-Jean
Sorry, I don't know what kind of example I could bring except for a screenshot with a missing Create Pull Request button. In any case, I hadn't realized that github was having issues, the green button reappeared for me and I could make the PR. On Mon, May 23, 2016 at 1:21 PM, Andreas Lobinger wr

[julia-users] Keyword chaining

2016-05-23 Thread Ford Ox
Why is there no keyword chaining in julia? for x in 1:30, y in 1:30 if x == 5 && y == 5 dosomething() else let obj = array[y, x] # Chained keywords here if obj == FOO dosomethingelse() end end end

[julia-users] My Julia window Close Down

2016-05-23 Thread tannirind
When I include this optimization problem in julia with include("file name.jl") my julia window automatically close.Have you any idea about this ? Thank you for your time. # In this cell we introduce binary decision u to the economic dispatch problem (function solve_ed) function solve_uc (g_max

[julia-users] Re: github missing Create Pull Request button

2016-05-23 Thread Andreas Lobinger
Example? (i had today some intermediate github problems with connectivity and functions) On Monday, May 23, 2016 at 7:06:44 PM UTC+2, Cedric St-Jean wrote: > > I'm up to my 15th pull request or so, and almost every time I do > Pkg.submit("PackageName"), the opened webpage is missing the green "C

[julia-users] github missing Create Pull Request button

2016-05-23 Thread Cedric St-Jean
I'm up to my 15th pull request or so, and almost every time I do Pkg.submit("PackageName"), the opened webpage is missing the green "Create Pull Request" button. I have to refresh to make it appear, then I can go through, but today it just refuses to cooperate. I have googled the land far and w

[julia-users] Re: Plots problem ?

2016-05-23 Thread Eric Forgy
Try x.^2. On Tuesday, May 24, 2016 at 12:48:49 AM UTC+8, Henri Girard wrote: > > Hi, > I don't know why this plot doesn't work ? > It tells me the domain is wrong ? > I don't understand why ? > Any help ? > Regards > Henri > > > using Plots > x=linspace(-2,2) > f(x) = sqrt(4-x^2) > g(x) = -sqrt(

[julia-users] Plots problem ?

2016-05-23 Thread Henri Girard
Hi, I don't know why this plot doesn't work ? It tells me the domain is wrong ? I don't understand why ? Any help ? Regards Henri using Plots x=linspace(-2,2) f(x) = sqrt(4-x^2) g(x) = -sqrt(4-x^2) h(x) = sqrt(-x^2+2*x) k(x) = -sqrt(-x^2-2*x) plot([g,f,h,k],-2,2,aspect_ratio=1)

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread Chris Rackauckas
But it is consistent. If you type 2+2 in the REPL you get 4, and if you put the same code in a loop it won't display 4 anymore. This is highlighted in the documentation. Julia just treats plots like any other type. I think it's just a documentation issue. Somehow it should be noted in the spots

Re: [julia-users] Re: static compilation

2016-05-23 Thread Yichao Yu
On Mon, May 23, 2016 at 12:09 PM, Ján Adamčák wrote: > Thanks Yichao Yu, > > Can you tell me which macro did you mean and where to place it? You need -DJULIA_ENABLE_THREADING=1 when compiling the C/C++ code if julia is built with threading enabled (which is the default now). > > Thanks > > Dňa 2

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread David Parks
My argument here is really for consistency. The beauty of a REPL, for a new user, is being able to hack through a few lines of code, see how they work in practice, and then use them confidently. It really speeds learning a new package, understanding a language feature, or just coding something

Re: [julia-users] Limit of symbolic parameters gives different results

2016-05-23 Thread Sreenath Chalil Madathil
I used SymPy package to get this solution. -oo is the wrong answer. The one that matlab gives is the correct answer. On Wednesday, May 18, 2016 at 5:35:05 AM UTC-6, Stefan Karpinski wrote: > > I think a little more context is required. What package are you using? > Standard Julia doesn't do symb

[julia-users] Re: Limit of symbolic parameters gives different results

2016-05-23 Thread Sreenath Chalil Madathil
I used SymPy package to get this solution. -oo is the wrong answer. The one that matlab gives is the correct answer. On Wednesday, May 18, 2016 at 5:49:24 AM UTC-6, j verzani wrote: > > I'm assuming this is using the `SymPy` package. I can confim your -oo > answer, but have no sense if it is cor

Re: [julia-users] Re: static compilation

2016-05-23 Thread Ján Adamčák
Thanks Yichao Yu, Can you tell me which macro did you mean and where to place it? Thanks Dňa 23.5.2016 17:37 používateľ "Yichao Yu" napísal: > > On May 23, 2016 10:30 AM, "Ján Adamčák" wrote: > > > > Thanks @Jameson, > > > > Another error I'm getting while compiling c example is > > > > C://Us

Re: [julia-users] Re: linreg strangely picky about inputs

2016-05-23 Thread Andreas Noack
I haven't timed it but I think the final array allocation could make a difference if you make a lot of regressions of moderate size. I don't share your view that the output is ugly. Since the function only allows for simple regression anyway, I think it is natural to save the two parameters in sepa

[julia-users] Re: linreg strangely picky about inputs

2016-05-23 Thread Gabriel Gellner
Okay so I have completely hand coded the cov/var calculation to avoid any overhead, and now I get around the 20x speedup you mentioned. I really don't see any significant benefit of returning a tuple, allocating the 2 element array has an insignificant overhead even for flot64 vectors of size 1

[julia-users] Re: linreg strangely picky about inputs

2016-05-23 Thread Eric Forgy
20x speedup sounds pretty good to me. I was going to say, "Come on! You can do better than that!" but was afraid the sarcasm wouldn't come across as intended :) Nice work and hope to see more from you. I'm sure I can learn a lot :) On Monday, May 23, 2016 at 11:37:45 PM UTC+8, Gabriel Gellner w

Re: [julia-users] Re: static compilation

2016-05-23 Thread Yichao Yu
On May 23, 2016 10:30 AM, "Ján Adamčák" wrote: > > Thanks @Jameson, > > Another error I'm getting while compiling c example is > > C://Users//Adam//AppData//Local//Julia-0.5.0-dev//start_func.c:111: undefined reference to `__imp_jl_tls_states' > collect2.exe: error: ld returned 1 exit status > > T

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread Chris Rackauckas
I still think the Julia way matches better to reality. You can go up to a kid and ask "can you draw me a cow?", and they draw it, and later ask "can you show me the cow?" and they'll show it to you. If you're standing right there (i.e. using the iterative REPL at its highest scope) you'll see it

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread Tom Breloff
When I think of the verb "plot", I think "contruct a visualization of the input data". This does not necessarily include building/opening a GUI window, which is just one method of using that visualization. I understand that in your mind: "But I would never want to do anything else with it!" But th

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread NotSoRecentConvert
Looks like we're interpreting the same sentence to mean different things. When I use plot as a verb I mean to create and show a visual representation of the data. It's like if I were to ask you to draw something. I don't mean imagine drawing it and then physically drawing when I ask you to show

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread Chris Rackauckas
But it does plot it, and use *display()* to display it. And I didn't know the REPL doesn't let you edit plots. It works just fine (i.e. like MATLAB) in Juno. On Monday, May 23, 2016 at 7:37:34 AM UTC-7, NotSoRecentConvert wrote: > > I agree with Dave. Having come from working with Matlab myself

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread Chris Rackauckas
But it does plot it, and use *display()* to display it. And I didn't know the REPL did that itself didn't let you edit plots. It works just fine (i.e. like MATLAB) in Juno. On Monday, May 23, 2016 at 7:37:34 AM UTC-7, NotSoRecentConvert wrote: > > I agree with Dave. Having come from working with

Re: [julia-users] Suppressing plot windows by default - is this purposeful?

2016-05-23 Thread NotSoRecentConvert
I agree with Dave. Having come from working with Matlab myself I liked that I could interactively build up plots from the REPL. My experience in plotting with Julia is only with PyPlot but I found it frustrating and time consuming to figure out why it behaved differently in different situations

Re: [julia-users] Re: static compilation

2016-05-23 Thread Ján Adamčák
Thanks @Jameson, Another error I'm getting while compiling c example is C://Users//Adam//AppData//Local//Julia-0.5.0-dev//start_func.c:111: undefined reference to `__imp_jl_tls_states' collect2.exe: error: ld returned 1 exit status This error is caused by JL_GC_PUSH1(&x); Is there some workar

[julia-users] Re: linreg strangely picky about inputs

2016-05-23 Thread Andreas Noack
Almost, but return a tuple instead of an array to avoid array allocation. Tight now, cov allocates temporary arrays for the demeaned vectors but that should probably be changed later anyway. On Monday, May 23, 2016 at 2:50:34 AM UTC-4, Gabriel Gellner wrote: > > So I am not able to get such a dr

[julia-users] Re: Pkg.update for packages that changed repository (git remote)

2016-05-23 Thread Andreas Lobinger
On Sunday, May 22, 2016 at 11:06:49 PM UTC+2, Tony Kelman wrote: > > URLs in metadata need to be manually updated when repos are moved. It > doesn't need to be done right away because github puts in place a redirect, > but that redirect can be interfered with. > > What problems did you have with

[julia-users] Re: Gaston package up-and-running in Windows 8/10 with gnuplot utility v5.0 (!!)

2016-05-23 Thread Андрей Логунов
Thanks, Milan. But currently I'm not inclined to work through the terminological jungle for the lack of time. I duplicated my message at the issues section of the authors Github page. Anyway, thank you for the lead... понедельник, 23 мая 2016 г., 15:19:41 UTC+10 пользователь Андрей Логунов напи

Re: [julia-users] Gaston package up-and-running in Windows 8/10 with gnuplot utility v5.0 (!!)

2016-05-23 Thread Milan Bouchet-Valat
Le dimanche 22 mai 2016 à 22:19 -0700, Андрей Логунов a écrit : > I've got a Gaston package version up-and-running with Julia 0.4.5 > under Windows 8/10 with gnuplot utility v5.0. And it does run in > Linux/Ubuntu 16.4, too. > A short instruction in the Gaston.jl file.  Just do not know, how to > "

[julia-users] Re: "using PyPlot" generates many deprecations - how to proceed?

2016-05-23 Thread Tony Kelman
Step 1 on these is see if the new syntax is supported yet in Compat.jl, if not then it needs to be added there first. Compat.jl lets you use the newer not-deprecated 0.5 syntax on 0.3 and 0.4. Once there's a tagged version of Compat.jl that supports the syntax you want to use in another package,

Re: [julia-users] "using PyPlot" generates many deprecations - how to proceed?

2016-05-23 Thread Mauro
I'm not sure I understand you question 100%. As Julia evolves towards a stable 1.0 version, bits of the language which change in a backward incompatible way are deprecated over two release cycles: in one release the old syntax will still work but generate the warning, in the following release the

[julia-users] "using PyPlot" generates many deprecations - how to proceed?

2016-05-23 Thread Colin Beckingham
Currently in the latest v 0.5 Julia on openSUSE calling for using PyPlot generates a long list of deprecations from PyPlot and dependencies. After the recompile PyPlot works fine, so not a blocker, just inconvenient. Packages involved are Compat, Conda, BinDeps, URIParser, PyCall, Latexstrings,