Re: [julia-users] julia array type?

2015-01-20 Thread Milan Bouchet-Valat
Le lundi 19 janvier 2015 à 14:20 -0800, Ivar Nesje a écrit : The problem here is a parsing ambiguity, because tuples support indexing. I believe there is an issue on github for this, but I can't figure out what to search for. That's https://github.com/JuliaLang/julia/issues/9445 It might be

[julia-users] event based simulation / protocol simulator (in julia)

2015-01-20 Thread Andreas Lobinger
Hello colleagues, i scanned the usual sources, but didn't find a clear answer. Is there any project looking at using julia to build a protocol simulator? Wishing a happy day, Andreas P.S. I'm not a protocol expert ...

Re: [julia-users] Vectorized operation inside a function doesn't change a passed variable?

2015-01-20 Thread Milan Bouchet-Valat
Le lundi 19 janvier 2015 à 21:34 -0800, AVF a écrit : I just wanted to double-check that I understand it correctly: doing a vectorized operation to a passed variable inside a function will not change the variable on the outside? More or less. `x += 10` is just syntactic sugar for `x = x + 10`:

[julia-users] workflow recommendation/tutorial

2015-01-20 Thread Tamas Papp
Hi, I am wondering what the best workflow is for iterative/exploratory programming (as opposed to, say, library development). I feel that my questions below all have solutions, it's just that I am not experienced enough in Julia to figure them out. The way I have been doing it so far: 1. open a

[julia-users] Re: simple IO question

2015-01-20 Thread tuguldur . s
perfect!

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Michael Hatherly
Hi Yuuki, could you provide me with the complete example you tried? — Mike ​ On Tuesday, 20 January 2015 16:00:53 UTC+2, Yuuki Soho wrote: I just used the workaround but now I get another error: ERROR: No metadata defined in module Main. I just copy-pasted one of the example from the

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Yuuki Soho
My file was huge, but I did a minimal one: if VERSION v0.4- using Docile macro doc_mstr(text) Base.triplequoted(text) end macro doc_str(text) text end end @doc docTells you if there are too foo items in the array. - function test(x) return

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Michael Hatherly
What version of Docile are you using? You can check with `Pkg.status()`. The current stable version is 0.3.2. Try doing `Pkg.update()` and then rerunning your file if you're not on that version. On Tuesday, 20 January 2015 16:17:07 UTC+2, Yuuki Soho wrote: My file was huge, but I did a minimal

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Yuuki Soho
I just used the workaround but now I get another error: ERROR: No metadata defined in module Main. I just copy-pasted one of the example from the doc before one of my functions. v0.3.2 On Tuesday, January 20, 2015 at 8:19:50 AM UTC+1, Michael Hatherly wrote: If anyone happens to run into a

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Michael Hatherly
No problem, glad that part’s working now. To view Docile-generated help you need to call using Lexicon, which hooks into Julia’s help system and adds the help entries generated by Docile. If you’ve not got Lexicon installed you can call Pkg.add(Lexicon) to install it. — Mike On Tuesday, 20

Re: [julia-users] Usage of @inbounds

2015-01-20 Thread Erik Schnetter
`@inbounds` applies to everything that follows. You should even be able to apply it to a module at once, or to use `begin`...`end` to apply it to several statements at once. `@fastmath` behaves in a similar manner. `@simd`, however, needs to be applied directly to a single loop. -erik On Jan

Re: [julia-users] Vectorized operation inside a function doesn't change a passed variable?

2015-01-20 Thread Jameson Nash
norm_df = input_df This line gives a new name (or label) to the DataFrame instance. It has no impact on the contents of said DataFrame. On Tue, Jan 20, 2015 at 11:19 AM AVF afl...@gmail.com wrote: Thanks, Milan. Is there a way to predict a priori when the passed variable/object will be

[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 docfoo `bar` baz -

[julia-users] Almost at 500 packages!

2015-01-20 Thread Iain Dunning
Just noticed on http://pkg.julialang.org/pulse.html that we are at 499 registered packages with at least one version tagged that are Julia 0.4-dev compatible (493 on Julia 0.3). Thanks to all the package developers for their efforts in growing the Julia package ecosystem!

[julia-users] Usage of @inbounds

2015-01-20 Thread Nils Gudat
Just a quick clarification on the @inbounds macro: I've seen it used both before and inside loops, like: @inbounds for i = 1:1000 a = x[i] b = z[i] end inbounds for i = 1:1000 @inbounds a = x[i] @inbounds b = z[i] end Would I be correct in assuming that both usages are valid and

Re: [julia-users] Vectorized operation inside a function doesn't change a passed variable?

2015-01-20 Thread AVF
Thanks, Milan. Is there a way to predict a priori when the passed variable/object will be mutated? E.g., earlier last night I was surprised that my function below was mutating the passed data frame, not just the copy created inside the function. function normalize(input_df::DataFrame,

Re: [julia-users] Usage of @inbounds

2015-01-20 Thread Jacob Quinn
That all seems correct to me. -Jacob On Tue, Jan 20, 2015 at 9:36 AM, Nils Gudat nils.gu...@gmail.com wrote: Just a quick clarification on the @inbounds macro: I've seen it used both before and inside loops, like: @inbounds for i = 1:1000 a = x[i] b = z[i] end inbounds for i =

[julia-users] Re: Google Summer of Code: Your Project Suggestions

2015-01-20 Thread cormullion
JuliaGraphics https://github.com/juliagraphics, Geometry2D https://github.com/mroughan/Geometry2D.jl, etc. would be attractive to graphics-oriented programmers...

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Yuuki Soho
I had a problem with my packages (it was even crashing on update...), I reinstalled the packages from scratch and the error is gone. I should have checked that first, sorry. That said I'm not sure it's working properly, that's what I get (I renamed the test function above test1): help? test1

[julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Gray Calhoun
Seconded. If anyone has time to just record a 5 minute screencast of working productively in Julia I think he or she would have a moderately sized but very appreciative audience. On Tuesday, January 20, 2015 at 4:45:13 AM UTC-6, Tamas Papp wrote: Hi, I am wondering what the best workflow is

[julia-users] Re: event based simulation / protocol simulator (in julia)

2015-01-20 Thread Yee Sian Ng
I'm not familiar with protocol simulators, but might SimJulia https://github.com/BenLauwens/SimJulia.jl (a package for discrete events simulation, inspired by SimPy) suit your needs? We've just had a class on it (slides here

[julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Michael Hatherly
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, 20 January 2015 19:11:26 UTC+2, andy hayden wrote: One

Re: [julia-users] Re: Almost at 500 packages!

2015-01-20 Thread Luthaf
If you do accept unfinished and very alpha package, I can submit one right now ... It won't be very usable, but I am wondering about how finished should be a package when submitted to METADATA. Viral Shah a écrit : I wonder what the 500th package will be. -viral On Tuesday, January 20,

Re: [julia-users] Re: Almost at 500 packages!

2015-01-20 Thread Stefan Karpinski
Packages registered in METADATA should be pretty usable – they should generally have some tests and those tests should pass. They should also have documentation. We haven't been very strict about enforcing all of this, but I think that going forward we ought to be. On Tue, Jan 20, 2015 at 4:08

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Mauro
Have a look at https://groups.google.com/d/msg/julia-dev/JEiH96ofclY/_amm9Cah6YAJ there are some hack-y solutions mentioned there. If I recall correctly, using a constructor instead of a function can solve the problem. On Tue, 2015-01-20 at 22:16, Keith Mason keith.ma...@conning.com wrote: I am

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Jameson Nash
My workflow is very similar. I'll add that I'll make a throwaway module (MyModuleTests) so that I can use using in the test file. Doing this at the REPL (defining a new module directly at the prompt) is also a nice way of encapsulating a chunk of code to isolate it from existing definitions

Re: [julia-users] Re: PetSc interface in Julia

2015-01-20 Thread yi lu
That is great! On Wed, Jan 21, 2015 at 4:46 AM, Steven G. Johnson stevenj@gmail.com wrote: I'm hoping to have some time to work on this over the next few days.

[julia-users] Re: comparing compilation times for matlab and julia

2015-01-20 Thread Viral Shah
With Jameson's work on static compilation and very early work towards interpreting Julia code, this will get addressed, but not in the near future. -viral On Tuesday, January 20, 2015 at 12:11:45 AM UTC+5:30, Gray Calhoun wrote: Hi Christian, you can certainly make the code-writing process

[julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Keith Mason
I am trying to make use of functions as data, where I store functions in an array and call them in a loop. All of my functions return Float64, but because I am assigning the function to a variable before calling it, Julia can't figure that out. Here's some example code: foo() = 0.0

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Erik Schnetter
I the `cfunction` necessary here? Since you already have the return type `R`, wouldn't it suffice to annotate the call with a `::R` suffix? I am thinking: immutable StableFunction{R,A} f StableFunction(f) = new(f) end call{R,A}(f::StableFunction{R,A}, x) = f(x)::R -erik On Jan 20,

[julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Viral Shah
This is pretty much the workflow a lot of people use, with a few julia restarts to deal with the issues a) and b). I often maintain a script as part of my iterative/exploratory work, so that I can easily get to the desired state when I have to restart. -viral On Tuesday, January 20, 2015 at

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Jeff Bezanson
Oh, I should also mention that the version that calls goo(foo()) takes so little time because the entire loop is probably optimized out. On Tue, Jan 20, 2015 at 5:54 PM, Jeff Bezanson jeff.bezan...@gmail.com wrote: Here is a hack that basically works by escaping through the C type system: ```

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Viral Shah
Should we capture this in the documentation somewhere? This is generally a useful set of hints for newcomers. -viral On Wednesday, January 21, 2015 at 5:38:29 AM UTC+5:30, Tim Holy wrote: Agreed there are advantages in putting ones test script into a module. There is also at least one

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Jeff Bezanson
That's surprising; I get the same speedup in 0.3 with function test2() f = CFunction{Float64,Float64}(foo) for i=1:1 r = call(f, 1.0) goo(r) end end

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Keith Mason
When I try this, I get an error: ERROR: type: test2: in apply, expected Function, got CFunction{Float64,Float64} It looks like call doesn't exist in version 0.3. I suppose I need 0.4 to make this work. It doesn't appear from the docs that call used to be named something else. On Tuesday,

Re: [julia-users] Re: Almost at 500 packages!

2015-01-20 Thread Viral Shah
Yes, METADATA packages should be pretty usable when someone downloads them. Now that we have the documentation on new documentation, packages can start including docs too. I wonder if we can set a minimum code coverage requirement, and if we can somehow also measure doc coverage for exported

[julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Ivar Nesje
Originally posted at https://github.com/JuliaLang/julia/issues/9863

Re: [julia-users] Re: workflow recommendation/tutorial

2015-01-20 Thread Tim Holy
My workflow (REPL-based, Juno in particular is probably different): - Open a file (MyModule.jl) that will consist of a single module, and contains types code - Open a 2nd file (mymodule_tests.jl) that will be the tests file for the module. Inside of this file, say `import MyModule` rather than

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Jeff Bezanson
Here is a hack that basically works by escaping through the C type system: ``` immutable CFunction{R,A} f p::Ptr{Void} CFunction(f) = new(f, cfunction(f, R, (A,))) end call{R,A}(f::CFunction{R,A}, x) = ccall(f.p, R, (A,), x) foo(x::Float64) = 0.0 goo(x::Float64) = x function

[julia-users] Peculiarly slow matrix multiplication

2015-01-20 Thread Micah McClimans
I'm running into trouble with a line of matrix multiplication going very slowly in one of my programs. The line I'm looking into is: objectivematrix=shrt*diagm(expr)*(shrt') where shrt is 12,000x600 and expr is 600 long. This line takes several HOURS to run, on a computer that can run

[julia-users] ERROR: Cannot horizonatally stack expressions of varying number of rows

2015-01-20 Thread Anonymous
horizonatally I trust y'all will get this to the right people, where it can do some good.

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Keith Mason
It is, but I created a form that forces it to not be inlined, and that still runs in just 30 ms. On Tuesday, January 20, 2015 at 4:57:00 PM UTC-6, Jeff Bezanson wrote: Oh, I should also mention that the version that calls goo(foo()) takes so little time because the entire loop is probably

Re: [julia-users] convincing Julia that a function call (via a variable) has a stable return type

2015-01-20 Thread Keith Mason
I tried that, but it was slower than my initial method of calling f(). I even tried called ccall directly, but it also didn't solve the problem of type instability (which makes me feel like I'm missing something important), and it had an additional problem of not accepting its type arguments

Re: [julia-users] ERROR: Cannot horizonatally stack expressions of varying number of rows

2015-01-20 Thread Kevin Squire
Right place, and a true statement, but without more context, it would be hard to act on or offer suggestions. Care to give an example of what you're trying to do? :-) Cheers, Kevin On Tue, Jan 20, 2015 at 9:33 PM, Anonymous espr...@gmail.com wrote: horizonatally I trust y'all will get

[julia-users] Re: Peculiarly slow matrix multiplication

2015-01-20 Thread Micah McClimans
And, as I'm sure you're aware- just as I was immediately after I posted this, that second loop is completely superfluous. On Wednesday, January 21, 2015 at 1:56:19 AM UTC-5, Micah McClimans wrote: I'm running into trouble with a line of matrix multiplication going very slowly in one of my

Re: [julia-users] ERROR: Cannot horizonatally stack expressions of varying number of rows

2015-01-20 Thread Anonymous
horizonatally should be horizontally, it's just a misspelling. On Tuesday, January 20, 2015 at 9:53:45 PM UTC-8, Kevin Squire wrote: Right place, and a true statement, but without more context, it would be hard to act on or offer suggestions. Care to give an example of what you're trying

Re: [julia-users] ERROR: Cannot horizonatally stack expressions of varying number of rows

2015-01-20 Thread Kevin Squire
Got it! A google https://www.google.com/webhp?sourceid=chrome-instantion=1espv=2ie=UTF-8#q=Cannot+horizonatally+stack+expressions+of+varying+number+of+rowsnfpr=1 search https://github.com/JuliaOpt/Convex.jl/blob/master/src/atoms/affine/stack.jl#L16 suggests that it should be reported here:

[julia-users] Re: PetSc interface in Julia

2015-01-20 Thread Viral Shah
I replied in the GSoC thread, but this is a better thread to have this discussion in. Here's what I said: Thanks to Amit's recent work on MPI.jl and ClusterManager.jl, we now have the ability to run MPI libraries and Julia's parallel libraries in the same program. Until recently, one could

[julia-users] Re: Almost at 500 packages!

2015-01-20 Thread Viral Shah
I wonder what the 500th package will be. -viral On Tuesday, January 20, 2015 at 9:02:45 PM UTC+5:30, Iain Dunning wrote: Just noticed on http://pkg.julialang.org/pulse.html that we are at 499 registered packages with at least one version tagged that are Julia 0.4-dev compatible (493 on

[julia-users] Re: PetSc interface in Julia

2015-01-20 Thread Steven G. Johnson
I'm hoping to have some time to work on this over the next few days.

[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
Thanks for that answer, that makes sense, I'll PR a mention of that on the documentation page. :) Did you see my comment here: https://github.com/JuliaLang/julia/issues/8966#issuecomment-70600813 I couldn't get a MetaDoc type working, but had a crack at it here:

Re: [julia-users] Re: 0.4 Documentation System

2015-01-20 Thread Tim Holy
Better yet would be to put such information into the documentation page http://docs.julialang.org/en/latest/manual/documentation/ --Tim On Tuesday, January 20, 2015 09:43:32 AM Michael Hatherly wrote: At the moment it’s main purpose is so that you can write literal $ characters in your