Re: [julia-users] Writing Type-Stable Code in Julia - type stable version not that fast in 0.4

2015-01-26 Thread Jason Merrill
Looking at code_llvm(sumofsins2, (Int,)), it looks like sin(3.4) used to be constant collapsed [1], but is now recomputed each time through the loop. [1] That's the 0xBFD05AC910FF4C6C in the LLVM code in John's post reinterpret(Float64, 0xBFD05AC910FF4C6C) == -0.2555411020268312 == sin(3.4) On M

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Robert Feldt
Ok, thanks. The finalizer is called and often work but sometimes there is a malloc error. Ok, I need to check the rest of the code. Might be in rest of LightXML or in my code, I guess. Thanks, Robert Den tisdag 27 januari 2015 kl. 04:12:36 UTC+1 skrev Isaiah: > > I'm not sure where the malloc

Re: [julia-users] Writing Type-Stable Code in Julia - type stable version not that fast in 0.4

2015-01-26 Thread Mauro
This is a performance regression, also for 0.3.5. My timings for 0.3.5: julia> @time [sumofsins1(100_000) for i in 1:100]; elapsed time: 0.446675737 seconds (320109932 bytes allocated, 21.32% gc time) julia> @time [sumofsins2(100_000) for i in 1:100]; elapsed time: 0.115537618 seconds (896 byte

[julia-users] Re: emacs shell not working with julia in docker container

2015-01-26 Thread Christian Groll
Perfect, it works. Thanks a lot! I now run a shell in emacs, run a docker container in the shell, and julia in the container, and I connect to it with M-x ess-remote. However, I also guess that using emacs tramp should be a better approach, as the ESS manual says: The recommended way to acces

[julia-users] Writing Type-Stable Code in Julia - type stable version not that fast in 0.4

2015-01-26 Thread Kuba Roth
Hi there, Recently I run into this very interesting post: http://www.johnmyleswhite.com/notebook/2013/12/06/writing-type-stable-code-in-julia/ Surprisingly, when tested both examples against the latest 0.4 build - the speed difference of the type-stable version is only 2-3 times faster then unst

Re: [julia-users] simple I/O question

2015-01-26 Thread Kyle Barbary
This is the other thread: https://groups.google.com/forum/#!searchin/julia-users/simple$20IO/julia-users/MRjELN0Zzlk/TM57aTp9w6wJ On Mon, Jan 26, 2015 at 9:39 PM, alex codoreanu wrote: > Hi Kyle, > > I have the same issue but I can't find the solution you found in a > different thread. Would you

Re: [julia-users] simple I/O question

2015-01-26 Thread alex codoreanu
Hi Kyle, I have the same issue but I can't find the solution you found in a different thread. Would you mind sharing the link or answering your own original question? Thanks! On Tuesday, January 20, 2015 at 4:36:42 AM UTC+11, Kyle Barbary wrote: > > Oops, just noticed this already got answere

Re: [julia-users] SAVE THE DATE: JuliaCon 2015, June 24 - 28

2015-01-26 Thread Jiahao Chen
*five months

[julia-users] Julia Docker images

2015-01-26 Thread Eric Forgy
I would like that. When deploying to the cloud, I plan to use Docker.

[julia-users] Julia Docker images

2015-01-26 Thread Viral Shah
I am just wondering, whether it is a good idea to have official docker images for Julia on our downloads page. JuliaBox uses it, and I believe it should be straightforward to build these. Would people find these useful? What all would you like to see in them? Just Base Julia, IJulia, a few pack

[julia-users] SAVE THE DATE: JuliaCon 2015, June 24 - 28

2015-01-26 Thread Jiahao Chen
On behalf of the organizing committee, it is my pleasure to announce that JuliaCon 2015 will be held at the MIT Stata Center during the dates of Wednesday, June 24 through Sunday, June 28. More details forthcoming. We look forward to seeing you in Cambridge, Massachusetts six months from now, s

[julia-users] I cannot fine the code for Garch in mean

2015-01-26 Thread Jung Soo Park
Is there any way I can have the code for "Garch in Mean" or GarchM please Thank you..

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Isaiah Norton
I'm not sure where the malloc error is coming from, exactly, but you need to call "finalizer", not "finalize". Also it should be run on the XMLNode rather than the XMLElement. The following example might help (at least, it doesn't crash!) julia> n = new_textnode("s") s julia> finalizer(n, z::XMLN

[julia-users] Re: Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Konstantin Markov
This works for Julia 0.3.5: julia> ll = Vector{Int}[[1,2],[1,2,3],[7]] 3-element Array{Array{Int64,1},1}: [1,2] [1,2,3] [7] sort(ll, by=length) 3-element Array{Array{Int64,1},1}: [7] [1,2] [1,2,3] On Tuesday, January 27, 2015 at 2:02:10 AM UTC+9, Wai Yip Tung wrote: > > I'm tryi

Re: [julia-users] Re: Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Wai Yip Tung
Thank you. sort has a `by` parameter and it works well sort(ll,by=length) My question is does Julia support this in general? In Python the `key` argument is supported in many methods that deal with sorting and ordering. Wai Yip On Monday, January 26, 2015 at 12:08:45 PM UTC-8, Mauro wrote: >

Re: [julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread John Lapeyre
To be more clear: First I think the ideas in this thread will be used in Julia projects in interesting ways we aren't even thinking of--- it's well suited for all of them. At the moment, I'm only interested in implementing a pattern and rule based system something like Mathematica. An example of w

[julia-users] Re: emacs shell not working with julia in docker container

2015-01-26 Thread Kirill Ignatiev
On Monday, 26 January 2015 08:26:24 UTC-5, Christian Groll wrote: > > I did set up Julia in a docker container. When I run it from the shell > everything works just fine. However, when I start the shell inside of > emacs, I can run the docker container and start Julia, but it somehow > messes wi

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andreas Noack
That is not a large matrix. I'd densify it and use eigvals(Hermitian, vl, vu) on it, where vl and vu are the bounds on the eigenvalues. E.g. julia> A = complex(randn(1681,1681), randn(1681, 1681));A = A + A'; julia> eigvals(Hermitian(A), 5.0, 10.0) 31-element Array{Float64,1}: 5.26302 5.422

[julia-users] Re: Looking for suggsetions to speed up function calls that have @cpp ccall()

2015-01-26 Thread Roy Wang
Thanks guys, I think that was it. On Monday, 26 January 2015 16:59:54 UTC-5, Ivar Nesje wrote: > > Did you time your function twice? The first time you call a function it > needs to be compiled, and for very small tests, that process will dominate.

Re: [julia-users] Looking for suggsetions to speed up function calls that have @cpp ccall()

2015-01-26 Thread Stefan Karpinski
That would certainly explain it – the @cpp version probably needs to do a fair amount of LLVM code generation, whereas `ccall` is built into the language. On Mon, Jan 26, 2015 at 4:59 PM, Ivar Nesje wrote: > Did you time your function twice? The first time you call a function it > needs to be co

[julia-users] Looking for suggsetions to speed up function calls that have @cpp ccall()

2015-01-26 Thread Ivar Nesje
Did you time your function twice? The first time you call a function it needs to be compiled, and for very small tests, that process will dominate.

[julia-users] Looking for suggsetions to speed up function calls that have @cpp ccall()

2015-01-26 Thread Roy Wang
Hey everyone, I'm trying to use @cpp ccall() to call myfunc() in a custom shared library I wrote in C++, and I noticed there is some overhead if I put the @cpp ccall inside a function. The relevant portion of my Julia code: # mypath is a constant string type that specifies the path of my custom

Re: [julia-users] Enums in Julia

2015-01-26 Thread Reid Atcheson
Ok now that you have put it there, the comments in the documentation make more sense to me. It looks like both yours and mine are essentially equivalent, but yours is simpler. I was aiming for the following behavior with my implementation: - different enum types won't typecheck (can't do "if e1

Re: [julia-users] Enums in Julia

2015-01-26 Thread Stefan Karpinski
We definitely need a standard solution to this in Base Julia. We may have enough example use cases at this point to know what it needs to look like. Relevant issue: https://github.com/JuliaLang/julia/issues/3080 On Mon, Jan 26, 2015 at 3:11 PM, Mauro wrote: > There is a FAQ entry on this which

Re: [julia-users] Enums in Julia

2015-01-26 Thread Mauro
There is a FAQ entry on this which suggests not to use types each of elements of the enum (if I recall correctly). I recently did a enum like this: export nonstiff, mildlystiff, stiff abstract Enum immutable Stiff <: Enum val::Int function Stiff(i::Integer) @assert 0<=i<=2

Re: [julia-users] Re: Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Mauro
This should work: help?> sort Base.sort(A, dim, [alg=,] [by=,] [lt=,] [rev=false]) Sort a multidimensional array "A" along the given dimension. julia> sort(Vector{Int}[[1,2], [1,2,3]], lt=(x,y)->(length(x)>length(y)) ) 2-element Array{Array{Int64,1},1}: [1,2,3] [1,2] Note, Josh's trick

Re: [julia-users] module reflection & introspection

2015-01-26 Thread Tamas Papp
OK, but I still don't know how to unintern a symbol. This is not mentioned in the manual. On Mon, Jan 26 2015, Jameson Nash wrote: > `quote ... end` (or `:(...)` for shorthand) can be used to create > expression objects that are equivalent when eval'd to executing the > expression directly. from

Re: [julia-users] module reflection & introspection

2015-01-26 Thread Jameson Nash
`quote ... end` (or `:(...)` for shorthand) can be used to create expression objects that are equivalent when eval'd to executing the expression directly. from there, you can explore the resulting Expr tree with dump() and Meta.show_sexpr() to observe the correct expression tree. you can convert s

[julia-users] Re: poly2mask in Julia?

2015-01-26 Thread Andrei Zh
@Andreas: do you refer to this thread: https://groups.google.com/forum/#!topic/julia-users/Kwy2Zh-i4ks Yes, it's an option. I was looking for something specifically designed for this purpose, but seems like Scikit Image and some others keep exactly the approach you've described [1], so I assu

Re: [julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread lapeyre . math122a
On Monday, January 26, 2015 at 7:20:54 PM UTC+1, Francesco Bonazzi wrote: > > > > > A Mathematica parser could be used as an optional addition, such as what > Mathics is to SymPy. > > Anyways, there are various options for Julia: > >- use Expr and operate on them, this is similar to how Maxi

[julia-users] Enums in Julia

2015-01-26 Thread Reid Atcheson
Hey all. I have frequently been in the position of wanting enumerations in Julia. I have finally settled on the implementation linked below which lets me refer to flags in a named way and only specify their underlying numbering once. Is this the best way, or are there better ways I haven't figur

Re: [julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread lapeyre . math122a
(My posts are not appearing where I want. Hope this one does!) On Monday, January 26, 2015 at 6:57:48 PM UTC+1, James Crist wrote: > > Maybe the parser could be useful if rewritten in Julia: > > > Side tracking a bit, but one of the reasons I use SymPy instead of > something like Maxima is that

julia-users@googlegroups.com

2015-01-26 Thread Matt Bauman
If I understand correctly, this may improve soon: https://github.com/JuliaLang/julia/pull/9913#issuecomment-71341494 On Monday, January 26, 2015 at 12:53:33 PM UTC-5, Ivar Nesje wrote: > > You need to use > > (&)([true,true], [true,false],[false,true]) > > I think this is because & is used as a

[julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread lapeyre . math122a
> Maybe the parser could be useful if rewritten in Julia: > http://www.cs.berkeley.edu/~fateman/lisp/mma4max/parser.lisp > Another option is to rewrite it in Scheme, which is what Julia's parser is written in. I have hacked the mma4max parser some for a previous project, and I looked at the Ju

[julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread lapeyre . math122a
Hi Francesco, > It is an open source Wolfram Mathematica interpreter written in Python, > and uses SymPy as a callback for math algorithms. > > You may try it from your browser: > http://www.mathics.net/ > I looked at it, but didn't get a chance to use it. > If you wish to try sympy out,

Re: [julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread Francesco Bonazzi
On Monday, January 26, 2015 at 6:57:48 PM UTC+1, James Crist wrote: > > > Side tracking a bit, but one of the reasons I use SymPy instead of > something like Maxima is that it meshes seamlessly into the language > infrastructure. By writing a parser and creating another system means that > it c

Re: [julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread James Crist
> > Maybe the parser could be useful if rewritten in Julia: Side tracking a bit, but one of the reasons I use SymPy instead of something like Maxima is that it meshes seamlessly into the language infrastructure. By writing a parser and creating another system means that it can't use julia's ecosy

julia-users@googlegroups.com

2015-01-26 Thread Ivar Nesje
You need to use (&)([true,true], [true,false],[false,true]) I think this is because & is used as a special character in ccall. I have seen this raised a few times, but I don't know what to search for to find the previous discussions. Regards Ivar mandag 26. januar 2015 15.33.06 UTC+1 skrev

[julia-users] Re: Creating an array of arrays

2015-01-26 Thread Ivar Nesje
This behaviour is intended and as I understand it a relic from Matlab (where you can't have arrays of arrays). It is the basis for a convenient array construction from a range (eg, [1:5] gives [1,2,3,4,5] instead of an array with a Range object), so there are more to it than you might think. Th

[julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread Francesco Bonazzi
On Monday, January 26, 2015 at 6:11:33 PM UTC+1, lapeyre@gmail.com wrote: > > > Another resource is Richard Fateman's mma4max > , which I see has > updates since I last built it. It aims more or less to implement mma in > common lisp. In

[julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread Francesco Bonazzi
On Monday, January 26, 2015 at 6:11:33 PM UTC+1, lapeyre@gmail.com wrote: > > I found that I can progress most quickly modeling on Mathematica. The > design is fairly simple and consistent. Of course the documentation is > vague in some places, but so far, it is not a problem. Of course, e

[julia-users] Caching of code generated by macros

2015-01-26 Thread Jan Niklas Hasse
Hi! I've just tried the Match.jl package and it works just as expected. But now my program needs 10 extra seconds to start, even if the code using the @match macro is untouched. Is there anyway to cache the generated code? If I understand the docs correctly this only works if I move the code us

[julia-users] Re: Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Joshua Adelman
On Monday, January 26, 2015 at 12:09:40 PM UTC-5, Joshua Adelman wrote: > > > > On Monday, January 26, 2015 at 12:02:10 PM UTC-5, Wai Yip Tung wrote: >> >> I'm trying to construct a list of list and do some operation on it. In >> Python I would do >> >> In [7]: ll = [[1,2],[1,2,3],[7]] >> >> Say

[julia-users] serialization of an object with circular references

2015-01-26 Thread Levi Boyles
Hi, I'm running Julia 0.3.5 and I have some tree structures with nodes pointing to both parents and children. I want to serialize/deserialize these to/from file storage, but the serialize function gives a long string of errors (longer than the length of my shell output buffer), so I'm guessing

[julia-users] Re: ANN: Symbolic computation with Julia

2015-01-26 Thread lapeyre . math122a
Hello Jim, Thanks for the long response. I looked at the papers; I think they are worth studying. I found that I can progress most quickly modeling on Mathematica. The design is fairly simple and consistent. Of course the documentation is vague in some places, but so far, it is not a problem. Of

[julia-users] Re: Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Joshua Adelman
On Monday, January 26, 2015 at 12:02:10 PM UTC-5, Wai Yip Tung wrote: > > I'm trying to construct a list of list and do some operation on it. In > Python I would do > > In [7]: ll = [[1,2],[1,2,3],[7]] > > Say I want to sort them by the length of the list, many function accepts a > `key` parame

[julia-users] Question about list of list; equivalent to Python's key paramater?

2015-01-26 Thread Wai Yip Tung
I'm trying to construct a list of list and do some operation on it. In Python I would do In [7]: ll = [[1,2],[1,2,3],[7]] Say I want to sort them by the length of the list, many function accepts a `key` parameter. In this case I want the `key` to be `len`. In [8]: max(ll, key=len) Out[8]: [1,

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
The matrix is 1681x1681 with 8240 non-zero entries (i.e. 0.29% non-zero). I'm not sure how this relates to your second comment though :) On Monday, January 26, 2015 at 5:48:37 PM UTC+1, Andreas Noack wrote: > > How large is the matrix and what is the sparsity? > > You might be able to get closer

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Robert Feldt
I fixed the typo (should be finalizer and not finalize) and also had to import xmlFreeNode from the c lib but when I run I get: julia(56167,0x7fff7924c300) malloc: *** error for object 0x7f9a33b159c0: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug so t

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andreas Noack
How large is the matrix and what is the sparsity? You might be able to get closer to what you want by using shifts in eigs. Then you'll get the values closest to the value of the shift. 2015-01-26 11:41 GMT-05:00 Andrei Berceanu : > Indeed it seems to work with complex matrices as well. What wou

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
Also, does eigs return the corresponding eigenvectors as well? //A On Monday, January 26, 2015 at 5:41:44 PM UTC+1, Andrei Berceanu wrote: > > Indeed it seems to work with complex matrices as well. What would be very > useful for me is the ability to get eigenvalues within a certain interval, >

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Robert Feldt
Actually this diff better shows the proposed changes: https://github.com/robertfeldt/LightXML.jl/commit/238fbb5c41629e254088dfe7553a53c72bd5dffa Will test and see if it helps. /Robert Den måndag 26 januari 2015 kl. 17:36:47 UTC+1 skrev Robert Feldt: > > Ok, great. I'm not used to explicit mem m

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
Indeed it seems to work with complex matrices as well. What would be very useful for me is the ability to get eigenvalues within a certain interval, emin to emax. I dont see this in the capabilities of eigs. //A On Monday, January 26, 2015 at 4:21:58 PM UTC+1, Andreas Noack wrote: > > Yes. Ther

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

2015-01-26 Thread Mike Innes
Jewel.jl handles all the code analysis/eval related stuff. I don't know ESS that well but it shouldn't be hard to make use of it if someone wants to. In a nutshell it's basically as simple as calling `eval(Base, :(foo() = 1))`, but there's a few other things to think about like making sure Julia r

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Robert Feldt
Ok, great. I'm not used to explicit mem management from Julia so appreciate feedback on proposed solution: function free(xelem::XMLElement) ccall(xmlFreeNode, Void, (Ptr{Void},), xelem.node.ptr) xelem.node.ptr = nullptr end since XMLElement type has a node::XMLNode attribute and the XMLNode

[julia-users] Re: workflow recommendation/tutorial

2015-01-26 Thread David van Leeuwen
Hi, Everyone seems to agree on the same workflow, so I'll just mention my workflow as an alternative. Pros: - don't need any Julia REPL restarts - don't need to prepend module name in (interactive) code. - variables, data structures etc all are retained during development. Cons: - in te

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

2015-01-26 Thread Tamas Papp
Where is the API for this functionality exposed, so that eg ESS could make use of it? For example, how would one eval or define new functions into a module in the REPL? Best, Tamas On Mon, Jan 26 2015, Mike Innes wrote: > It's not an inherent feature of Julia, no, just a tooling thing. Juno, f

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Stefan Karpinski
On Mon, Jan 26, 2015 at 10:44 AM, Yuuki Soho wrote: > Julia is now 5x faster than matlab. Win.

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

2015-01-26 Thread Mike Innes
It's not an inherent feature of Julia, no, just a tooling thing. Juno, for example, will allow you to eval directly into modules just fine, including defining new functions, replacing them, evalling `include`s, and replacing the module wholesale in order to get around type redefinition issues and #

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Yuuki Soho
Omg, I forgot to remove it! I should proof-read my code more carefully before posting... Julia is now 5x faster than matlab.

Re: [julia-users] Call overloading and @code_... macros

2015-01-26 Thread Jameson Nash
Maybe llvm has now turned on code relocation on MachO? If so, I just need to flip a switch in the code to fix this. On Mon, Jan 26, 2015 at 3:30 AM Luthaf wrote: > I am using the latest master, on OS X 10.9, with LLVM svn > > julia> versioninfo() > Julia Version 0.4.0-dev+2914 > Commit 4c3e03b (2

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andreas Noack
Yes. There is some extra output including convergence information and the Ritz vectors. It should probably be explained in the manual, but the first argument is the values. You can avoid the vectors with ritzvec=false, so something like eigs(A, ritzvec = false)[1] should give you the largest (in

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
Besides, the help of eigs says "using Lanczos or Arnoldi iterations for real symmetric or general nonsymmetric matrices respectively". Mine is hermitian, i.e. complex and symmetric. On Monday, January 26, 2015 at 4:02:16 PM UTC+1, Andrei Berceanu wrote: > > That seems to return a lot of things b

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
That seems to return a lot of things besides the eigenvalues. On Monday, January 26, 2015 at 3:43:01 PM UTC+1, Andreas Noack wrote: > > You can use eigs. Usually, you only ask for a few of the values, but in > theory, you could get all of them, but it could take some time to compute > them. > >

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

2015-01-26 Thread Tamas Papp
So the only the global name space is for "tinkering" (iterative, interactive development), and modules are for more-or-less stable code --- is this correct? Is this an inherent feature of the architecture of Julia, or can one expect this to change as issues (especially #265) are resolved? Best,

Re: [julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Isaiah Norton
The underlying XMLNode needs to be freed using xmlFreeNode from libxml2: http://xmlsoft.org/html/libxml-tree.html#xmlFreeNode I don't think this is wrapped yet, but it should be straightforward to add -- ideally, called via a finalizer so that the objects are freed automatically when Julia decide

Re: [julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andreas Noack
You can use eigs. Usually, you only ask for a few of the values, but in theory, you could get all of them, but it could take some time to compute them. 2015-01-26 9:40 GMT-05:00 Andrei Berceanu : > Is there any Julia function for computing the eigenvalues of a large, > sparse, hermitian matrix M?

[julia-users] eigenvalues of sparse matrix

2015-01-26 Thread Andrei Berceanu
Is there any Julia function for computing the eigenvalues of a large, sparse, hermitian matrix M? I have tried eig(M) and eigvals(M) and got the "no method" error. //A

julia-users@googlegroups.com

2015-01-26 Thread Patrick O'Leary
Using JuliaParser.jl as a reference, it loks like & is in the class unary_and_binary_ops, as well as syntactic_binary_ops. The | operator is not in either of these classes. At least one reason for the difference in lowering to the AST is that & is also an addressof-like operator in the context

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

2015-01-26 Thread Tim Holy
You can redefine a function like this: function MyModule.myfunction(args...) stuff end Two caveats: - myfunction has to already exist in MyModule for this to work---you can't add new names to an already-closed module. - Anything that has already been compiled and uses myfunction won't "hea

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Tim Holy
What's that `thp` loop doing? Does your julia loop do 50x the work of the matlab code? --Tim On Monday, January 26, 2015 05:10:47 AM Yuuki Soho wrote: >1. That's my matlab code, I was hoping to be able to write it with loops >in Julia, because sometimes these vectorize operations can bec

[julia-users] Creating an array of arrays

2015-01-26 Thread Michael Partheil
Dear all, just a short question about something I found quite a bit confusing: I want to create an Array of Array of Int, so I wrote: julia> [[1,2], [3,4]] 4-element Array{Int64,1}: 1 2 3 4 As you can see this turns into an Array of Ints instead, i.e. the inner brackets are ignored. It

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

2015-01-26 Thread Tamas Papp
Thanks to everyone for the replies. So do I understand the following correctly: if I separate my functions and runtime code (eg MyModule and MyModuleRun), and then want to redefine a single function in the first, then I have to reload the whole module again? Julia seemed so ideal for exploratory

[julia-users] emacs shell not working with julia in docker container

2015-01-26 Thread Christian Groll
I did set up Julia in a docker container. When I run it from the shell everything works just fine. However, when I start the shell inside of emacs, I can run the docker container and start Julia, but it somehow messes with the output:

[julia-users] module reflection & introspection

2015-01-26 Thread Tamas Papp
Suppose I have a trivial module module Foo x = 1 end so names(Foo) now includes a Symbol that is === to symbol("x"). I have two questions: 1. How can I intern symbols into a module programatically, possibly from outside the module? symbol("Foo.y") does not work (using 3.5). 2. Similarly, how ca

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Yuuki Soho
1. That's my matlab code, I was hoping to be able to write it with loops in Julia, because sometimes these vectorize operations can become a real headache, but it's maybe hopeless to try to beat these highly optimized libraries. function alpha = testSum(A,B,C,D,E,idx

[julia-users] Freeing XMLElement from LightXML.jl? (Mem leak problem)

2015-01-26 Thread Robert Feldt
Hi, Does anyone now how to free up the memory in a XMLElement object in LightXML.jl? LightXML.jl has a free(xdoc::XMLDocument) but no corresponding free(xelem::XMLElement). There are functions related to free in clib.jl in the package but no docs that I can find on how to use it. I tried to cr

Re: [julia-users] Re: gpu computing tutorial

2015-01-26 Thread Tim Holy
Not exactly what you're asking for, but code in the test/ folder is also often a frequent source of inspiration, since it shows how to use the code. --Tim On Sunday, January 25, 2015 11:32:20 PM tuguldu...@gmail.com wrote: > yes, I saw those. What I am looking for is source code that implemented

julia-users@googlegroups.com

2015-01-26 Thread Gabriel Mitchell
Here are two statements, one written with chained binary operations the other in prefix notation >>[true,true] | [true,false] | [false,true] 2-element Array{Bool,1}: true true >>|([true,true], [true,false],[false,true]) 2-element Array{Bool,1}: true true Now I can also do the first for & a

Re: [julia-users] Re: Question on using sparse matrices

2015-01-26 Thread Marc Williams
I'm not very familiar with using sparse matrices but thought it might be worth a go. seems unlikely to be worth it. Thanks for your advice. Marc

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Milan Bouchet-Valat
Le lundi 26 janvier 2015 à 03:07 -0800, Yuuki Soho a écrit : > Coming back to my original problem, I did a simplified version of it, > > which is about 10x slower than a vectorized matlab version. Have I > missed anything here ? Your code looks fine to me, at least it doesn't seem to suffer from t

Re: [julia-users] Re: Strange performance behavior

2015-01-26 Thread Yuuki Soho
Coming back to my original problem, I did a simplified version of it, which is about 10x slower than a vectorized matlab version. Have I missed anything here ? A = ones(50,40,40); B = ones(50,100)/2; C = ones(40,100)/3; D = ones(40,100)/4; E = ones(100,100)/5; idx = int([100:-1:1]);

[julia-users] Re: poly2mask in Julia?

2015-01-26 Thread Andreas Lobinger
Hello colleagues, i think you could do (if i get the upper description correctly) just setup a grid of points and feed it through something like inpolygon - might be not the optimized case, but should work. There have been questions about that here (i know, because i posted code) before. But i

Re: [julia-users] Call overloading and @code_... macros

2015-01-26 Thread Luthaf
I am using the latest master, on OS X 10.9, with LLVM svn julia> versioninfo() Julia Version 0.4.0-dev+2914 Commit 4c3e03b (2015-01-26 06:17 UTC) Platform Info: System: Darwin (x86_64-apple-darwin13.4.0) CPU: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz WORD_SIZE: 64 BLAS: libopenblas (USE64B