[julia-users] Re: Doctest?

2016-01-06 Thread andy hayden
In Base it's done (in the function's docstring) with fenced code blocks with jldoctest language: ```jldoctest julia> code goes here output here ``` I don't think there's support yet outside on Base, but it's on at least one roadmap (coming soon). On Saturday, 2 January 2016 02:48:23 UTC-8, Joh

[julia-users] Re: Questions about ranges

2015-10-22 Thread andy hayden
> I don't really understand why you can't just use the StepRange for everything You could. However, you can be more efficient by having special types (e.g. with UnitRange you don't need to check the steps). > `findin(::UnitRange, ::UnitRange)` returns another UnitRange This seems good. > `fi

[julia-users] Re: Markdown.parse question

2015-10-13 Thread andy hayden
Whether it renders as $ or $$ is inferred from the position, if it's inline it uses $ if it's a block $$. julia> Markdown.latex(Markdown.parse("""\$\\sin(x)\$""")) "\$\$\\sin(x)\$\$" julia> Markdown.latex(Markdown.parse("""inline \$\\sin(x)\$""")) "inline \$\\sin(x)\$\n" https://github.com/Ju

[julia-users] Re: Ambiguous methods warning method

2015-10-07 Thread andy hayden
see https://github.com/JuliaStats/DataArrays.jl/issues/168 On Wednesday, 7 October 2015 08:03:12 UTC-7, cormu...@mac.com wrote: > > Assuming this is the correct behavior, is there a way to get a better user > experience: > >_ >_ _ _(_)_ | A fresh approach to

[julia-users] Re: Couldnt connect to Julia @doc not defined

2015-09-20 Thread andy hayden
Sorry about that. I didn't think it would break anything. Thanks for reverting. Best, Andy On Sunday, 20 September 2015 03:14:28 UTC-7, Michael Hatherly wrote: > > Tracked down to this, https://github.com/JuliaLang/Compat.jl/pull/126, > Compat.jl change. > > — Mike > > On Sunday, 20 September 2

[julia-users] Re: META: What are the chances of moving this forum?

2015-09-11 Thread andy hayden
allegedly you can host multiple sites on the same machine, which may cut down costs. https://meta.discourse.org/t/multisite-configuration-with-docker/14084 On Friday, 11 September 2015 23:12:22 UTC-7, Nils Gudat wrote: > > I'll have two weeks off at the beginning of October, during which I'd be

[julia-users] Re: conditional REQUIRE entries

2015-04-07 Thread andy hayden
I think for the moment you either need to include it in the REQUIRE file, or not and make the user to install gpu-related bits themselves. IMO This is not ideal... Another example is Markdown: you have to include that in the REQUIRE, even though Base.Markdown is included in 0.4. This means you

Re: [julia-users] Re: Factorization of big integers is taking too long

2015-03-20 Thread Andy Hayden
Hans, it would be interesting to see how your Pollard Rho example compares on the pooling bigint branch https://github.com/JuliaLang/julia/pull/10084. It ought to allocate far less memory... On 20 March 2015 at 00:01, Hans W Borchers wrote: > As Bill noted, it is known that Pollard Rho does not

Re: [julia-users] Re: dict comprehension syntax in 0.4

2015-03-16 Thread andy hayden
I think this comment still stands https://github.com/JuliaLang/julia/pull/8521#discussion_r18476175 Dict comprehension syntax has not been deprecated yet, since we don't have > an efficient replacement. It will be Dict( i => f(x) for i = 1:10 ). > However the old syntax at least has to keep wor

Re: [julia-users] Re: Factorization of big integers is taking too long

2015-03-15 Thread andy hayden
Perhaps this (factor of large big int) is a good perf/test case for https://github.com/JuliaLang/julia/pull/10084 On Sunday, 15 March 2015 06:54:51 UTC-7, Tim Holy wrote: > > I don't know the algorithm, but my point is that > c = a*b > will, for a BigInt, allocate memory. Because Numbers ar

Re: [julia-users] Re: RFC Display of markdown sections in terminal

2015-01-24 Thread andy hayden
etter one? On Thursday, 22 January 2015 22:18:32 UTC-8, andy hayden wrote: > > left-align seems to be the consensus, so I've updated the PR. Thanks! > > julia> Markdown.parse("# Title") > Title > === > > julia> Markdown.parse("## Sec

Re: [julia-users] Re: RFC Display of markdown sections in terminal

2015-01-22 Thread andy hayden
sday, 21 January 2015 10:39:17 UTC-8, Stefan Karpinski wrote: > > Agree. Left-aligning seems better. > > On Wed, Jan 21, 2015 at 1:35 PM, Tony Kelman > wrote: > >> +1 for left-aligning >> >> >> On Tuesday, January 20, 2015 at 11:37:43 AM UTC-8, andy ha

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread andy hayden
ote: > > At the moment it’s main purpose is so that you can write literal $ > characters in your docstrings without > worrying about inadvertent string interpolation. Quite handy if you’re > writing latex in your docstrings. > > — Mike > ​ > > > On Tuesday, 2

[julia-users] RFC Display of markdown sections in terminal

2015-01-20 Thread andy hayden
I posted a PR about this, but would like to gauge thoughts on what formatting for headings (purely in the REPL e.g. in help messages - elsewhere e.g. in html, they are rendered differently). I tentatively put: julia> Base.Markdown.parse("#Title")

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread andy hayden
One thing that seems unclear, at least to me, is the distinction (if any) between doc"...", md"..." (md isn't exported in Base) and "..." (just a string). It doesn't seem that it matters which we use e.g. the following are equivalent: @doc "foo `bar` baz" -> function foo() end @doc doc"foo `ba

Re: [julia-users] Re: ANN: JLTest (An xUnit like testing framework)

2015-01-05 Thread andy hayden
This looks great! Is it possible to do further improve do notation with something like: using JLTest testcase("Mytest Tests") do # testcase name is optional #Some code x = 0 #Function to be called before each test (optional) setUp() do x += 1 end #Function to be

Re: [julia-users] Re: Parametric types of parametric types?

2014-07-21 Thread Andy Hayden
; kind of chained type parameters that you want is not possible right now . > See https://github.com/JuliaLang/julia/issues/3766 for some discussion. > > Hope that helps > > Regards > - > Avik > > > On Monday, 21 July 2014 20:16:15 UTC+1, andy hayden wrote: >> >>

[julia-users] Parametric types of parametric types?

2014-07-21 Thread andy hayden
I was wondering if there anyone had any rules of thumb for when to create parametric types of a parametric types (if this is even possible?). To give a concrete example, I was messing around to describe/implement elliptic curve point addition: # ring of integers mod P immutable Z{P} <: PAdicInt

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-02 Thread andy hayden
Using a single BitArray increases performance by 10x! I've pushed that to github. It also feels a much neater solution. I still can't work out how to strip out the dictionary in solve.. On Tuesday, 1 July 2014 17:28:06 UTC-7, andy hayden wrote: > > It could be what quinnj'

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Andy Hayden
> > On Tuesday, July 1, 2014 7:58:44 PM UTC-4, andy hayden wrote: >> >> Ha, I had exactly the same issue (I pushed a perf update with a commented >> out impl), I assumed it was something (very) wrong in my understanding of >> control flow! >> >> I

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
? > > > On Tuesday, July 1, 2014 6:59:02 PM UTC-4, andy hayden wrote: >> >> I was using Cbc. >> >> SolveModel is a copy and paste job from JuMP (from the last release >> rather than master) so may not work with JuMP from master - I couldn't get >

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Andy Hayden
a >> Vector{*}, as well as those other globals >> elapsed time: 1.373703078 seconds (191864592 bytes allocated, 4.91% gc >> time) >> >> >> >> >> >> >> >> >> On Tuesday, July 1, 2014 6:27:15 PM UTC-4, andy hayden wrote: >>> >>&

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
g this, but I'm not sure how you are measuring that > 20% slower - can you be more specific? > > On Tuesday, July 1, 2014 1:37:00 PM UTC-4, andy hayden wrote: >> >> I recently ported Norvig's Solve Every Sudoku Puzzle >> <http://norvig.com/sudoku.html> to Ju

[julia-users] A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
I recently ported Norvig's Solve Every Sudoku Puzzle to Julia: https://github.com/hayd/Sudoku.jl Some simple benchmarks suggest my Julia implementation solves around 20% slower* than the Python version, and 3 times faster than the implementation on JuMP (vendoriz