Re: [julia-users] Create matrix from a comprehension with row/col-returning function?

2014-08-14 Thread Ivar Nesje
hcat([f(i) for i = 1:n]...) Or use vcat for adding rows.

Re: [julia-users] Gibbs sampling 10x slower than c++

2014-08-14 Thread Andrew Wrigley
Excellent, thanks. Replacing `@inbounds a = dot(W[:,n], state)` with the following gave a ~5x improvement: a::Float64 = 0 for k in 1:N @inbounds a += W[k, n] * state[k] end The ::Float64 annotation was necessary or it was really slow. Why does

Re: [julia-users] Gibbs sampling 10x slower than c++

2014-08-14 Thread Tobias Knopp
Regarding the need for annotation. There is a good reason for this and its that the type should be kept stable during calculations. `a = 0` will set a to be an Int with value 0. Later it is updated with Float64 values and therefore the performance loss. You can solve this in different variants a

Re: [julia-users] Gibbs sampling 10x slower than c++

2014-08-14 Thread Ivar Nesje
I have not heard it explicitly from the developers, but it seems obvious to me that implementing slicing as a view into the original array, is hard to do right, while a copy is simple. They probably wanted to do the simple thing first, and then solve the harder problem when things settle down.

Re: [julia-users] Proposal for inargs

2014-08-14 Thread Tim Holy
For any algorithm that accepts AbstractArrays, can't you just just define immutable ReadOnlyArray{T,N,AT<:AbstractArray} <: AbstractArray{T,N} data::AT end ReadOnlyArray{AT<:AbstractArray}(A::AT) = ReadOnlyArray{eltype(A),ndims(A),typeof(A)}(A) and then define the pass-through methods you wa

Re: [julia-users] Gadfly, draw, and font embedding.

2014-08-14 Thread Tim Holy
On Wednesday, August 13, 2014 08:59:52 PM Lee Streeter wrote: > It looks like pgf is a suitable solution. Thanks for that. > > I might bug the Gadfly repo on this matter as well. In general, for issues specific to a particular package, that's usually the best place to do it. --Tim

Re: [julia-users] Proposal for inargs

2014-08-14 Thread Tobias Knopp
I second that I knew a lot more people doing scientific computing with Matlab/Python. And of those few that use C++ only a minority knows (and cares) how to write const aware code... To your solution, Tim: I think Steve wants to hide this in the function so that regular arrays can be passed. In

Re: [julia-users] Proposal for inargs

2014-08-14 Thread Tim Holy
I think mine is the same as his: he suggested implementing a function fn like this: function fn(a::AbstractArray{Int,1}) a = readonly(a) ... end which does that wrapping inside the function itself. I was just pointing out that you need only one new type to wrap any AbstractArray, not on

Re: [julia-users] Proposal for inargs

2014-08-14 Thread Tobias Knopp
Ah yes, this looks like a good solution (if one cares about the read property of arrays...) Am Donnerstag, 14. August 2014 12:44:47 UTC+2 schrieb Tim Holy: > > I think mine is the same as his: he suggested implementing a function fn > like > this: > > function fn(a::AbstractArray{Int,1}) >

[julia-users] Re: Proposal for inargs

2014-08-14 Thread Simon Danisch
At some point, I put some thinking into this. In my ideal world this should be solved by a library, which supplies meta informations for all known Julia functions. With that you could recursively determine if a function actually intents to alter some of its arguments. Together with an IDE, you co

[julia-users] Re: Clipping Algorithm

2014-08-14 Thread Simon Danisch
I'd be a huge fan, of a OpenCL accelerated geometry package, which works flawlessly with OpenGL. After all, these kind of algorithms quickly get slow on big meshes, and you normally want to view them in OpenGL anyways. No one really has this open source and integrated into a bigger framework. May

[julia-users] Re: Running example code in packages

2014-08-14 Thread Júlio Hoffimann
Anyone? The problem is that I have some resource files (i.e. *.jpg) and they live under the src/ directory of the package. Whenever I run ImageQuilting.example(), the paths to the images aren't correct. Is there any variable that stores the root directory for a package? Júlio. 2014-08-13 11:11

[julia-users] Re: Running example code in packages

2014-08-14 Thread Ivar Nesje
dirname(@__FILE__ ) kl. 13:55:37 UTC+2 torsdag 14. august 2014 skrev Júlio Hoffimann følgende: > > Anyone? > > The problem is that I have some resource files (i.e. *.jpg) and they live > under the src/ directory

[julia-users] Re: Running example code in packages

2014-08-14 Thread Simon Danisch
I do this via Pkg.dir()*"/MyPackage". If there is any better solution, I'd be quite curious to know! This looks like a cool package! =) I just implemented an OpenGL image viewer, which theoretically can tile images very easily, as OpenGL does the tiling for you. If you're interested take a look a

[julia-users] Re: Clipping Algorithm

2014-08-14 Thread Andreas Lobinger
Hello colleague, i wiser man/programmer once wrote: *Premature optimization is the root of all evil.*We started talking about the prospect to have *some* CG alorithms available in julia, so jumping to OpenCL seems fast for me. On Thursday, August 14, 2014 1:32:38 PM UTC+2, Simon Danisch wrote

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-14 Thread Jacob Quinn
The videos for the Optimization Session from JuliaCon 2014 have been posted. Enjoy! http://julialang.org/blog/2014/08/juliacon-opt-session/ -Jacob On Tue, Aug 12, 2014 at 7:01 AM, Jacob Quinn wrote: > Yes, very sorry Pontus. Luckily I used your trick for the youtube and blog > post, and then

Re: [julia-users] Create matrix from a comprehension with row/col-returning function?

2014-08-14 Thread Brendan O'Connor
hcat and vcat will do the trick. Thanks! -Brendan

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-14 Thread Spencer Russell
Thanks for all the hard work on these! The videos so far have come out awesome and the presenters are really easy to understand. Good capture at the event, good post work, and good projection by the presenters. The JuliaCon organizers put a HUGE amount of work into making a great conference, so I'

[julia-users] Re: Clipping Algorithm

2014-08-14 Thread Simon Danisch
Please excuse me for my OpenCL lobbying, but I pretty much came to Julia, to have these kind of algorithms as fast as possible :) These considerations won't necessarily slow down the development of any Julia algorithm, as the implementation is rather orthogonal - which is why I don't see any ha

[julia-users] Re: Running example code in packages

2014-08-14 Thread Simon Danisch
Thanks Ivar, that looks nicer! Seems like I've been overlooking this for quite some time Am Mittwoch, 13. August 2014 16:11:43 UTC+2 schrieb Júlio Hoffimann: > > Hi all, > > I've just adapted my code to respect Julia package management standards: > https://github.com/juliohm/ImageQuilting.jl

Re: [julia-users] pkg.julialang.org updated for 0.3/0.4, new permalinks/badges

2014-08-14 Thread Tim Holy
Because julia 0.2 is shipped with some Linux distros that are expected to be supported for several more years, there may be some people running 0.2 for some time. To make sure that future developments don't break 0.2 support (and without PkgEvaluator how will I know? :) ), I took the time to "fr

Re: [julia-users] Re: Clipping Algorithm

2014-08-14 Thread Tim Holy
On Thursday, August 14, 2014 06:38:29 AM Simon Danisch wrote: > I'm not talking theoretically about this, but I mention this because this > is the reason why I can't use two very nice packages (namely Color.jl and > Meshes.jl), without a lot of unnecessary conversions. The latest version of Colo

[julia-users] Fully Typed Function As Argument Type

2014-08-14 Thread Chris Kellendonk
I'm new to the language so I may have missed something. But is there a way to make sure a function passed as an argument is of a specific type including it's arguments? It doesn't look like from the design of the language this could be supported but I'm curious. For example I would like to be a

Re: [julia-users] Fully Typed Function As Argument Type

2014-08-14 Thread John Myles White
Not possible in the current versions of Julia. Maybe one day. There are bunch of us who’d like to have this functionality, but it’s a non-trivial addition of complexity to the compiler. — John On Aug 14, 2014, at 4:59 AM, Chris Kellendonk wrote: > I'm new to the language so I may have missed

[julia-users] pdf of a multivariate distribution

2014-08-14 Thread pamjervis
Hi all, I am getting an error when I try to obtain the probability density evaluated at z1[1,;]: julia> pdf(MvNormal(zhat11,F11),z1[1,:]) MethodError(logpdf,(GenericMvNormal{PDMat} distribution Dim: 27 Zeromean: false μ: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Re: [julia-users] pdf of a multivariate distribution

2014-08-14 Thread John Myles White
In Julia, anything with a description like 1x27 Array{Any,2} is a matrix, not a vector. Also, it's not the right kind of vector because it has no numeric type restriction. It needs to be a vector of Float64 values, like you'd get from doing something like: [1.0, 2.0, 3.0] -- John On Aug 14,

Re: [julia-users] Re: Clipping Algorithm

2014-08-14 Thread Steve Kelly
I implemented the Greiner-Hormann algorithm for clipping and Hormann-Agathos algorithm for point-in-polygon here: https://github.com/sjkelly/PolygonClipping.jl I made a specialized implementation for generating infill for 3D printing paths. I am currently working on merging this package with Geome

Re: [julia-users] Re: Clipping Algorithm

2014-08-14 Thread Steve Kelly
"I'm not talking theoretically about this, but I mention this because this is the reason why I can't use two very nice packages (namely Color.jl and Meshes.jl), without a lot of unnecessary conversions." I've been hacking on Meshes.jl the past few days. I will file an issue for this and try to fix

[julia-users] Re: Clipping Algorithm

2014-08-14 Thread Simon Danisch
Awesom work, thanks Tim! I actually just hacked into Meshes.jl as well, trying to use your obj importer. There are some more things missing, to make them work nicely with OpenGL. But this now becomes completely off-topic. I'll file an issue! Am Freitag, 9. Mai 2014 23:13:06 UTC+2 schrieb Steve

Re: [julia-users] pdf of a multivariate distribution

2014-08-14 Thread pamjervis
Thanks a lot John for your answer! I'm starting in Julia so I'm still in the learning curve... Do you know how I can convert Array{Float64, 2} to Array{Float64, 1}? Thanks again! Pam. On Thursday, August 14, 2014 5:15:01 PM UTC+1, John Myles White wrote: > > In Julia, anything with a descripti

Re: [julia-users] pdf of a multivariate distribution

2014-08-14 Thread John Myles White
The vec() function would work. But it might be worth reviewing your code again. You should be storing your data such that you have a matrix of N samples (each of dimensionality D) stored as a DxN matrix. Call this matrix X. Then you access samples as X[:, j]. If you do this, your data structure

[julia-users] table of UTF8 operator symbols

2014-08-14 Thread Douglas Bates
It may be due to a "because it's there" syndrome but I feel that code is easier to understand when I use ≠ instead of !=. Now I am trying to remember the UTF8 symbols and TeX-like names for == and ===. I know there is a table of these somewhere but perfunctory searches of docs.julialang.org/e

[julia-users] Re: table of UTF8 operator symbols

2014-08-14 Thread Steven G. Johnson
On Thursday, August 14, 2014 12:58:40 PM UTC-4, Douglas Bates wrote: > > It may be due to a "because it's there" syndrome but I feel that code is > easier to understand when I use ≠ instead of !=. Now I am trying to > remember the UTF8 symbols and TeX-like names for == and ===. > I don't think

[julia-users] unsure about an error message from ccall

2014-08-14 Thread Douglas Bates
I'm getting an error from ccall when the first argument is a tuple of a symbol and a string. julia> libwsmp "/home/bates/.julia/v0.4/WSMP/deps/usr/lib/libwsmp" julia> ccall((:wkktord_,libwsmp),Void,(Ptr{Cint},Ptr{Cint},Ptr{Cint},Ptr{Cint},Ptr{Cint}, Ptr{Cint},P

[julia-users] unsure about an error message from ccall

2014-08-14 Thread Ivar Nesje
Does it help to declare libwsmp as const?

[julia-users] We have typed functions, don't we?

2014-08-14 Thread Rafael Fourquet
Hi Julia users, As this is my first post, I must say I'm extremely impressed by julia, met 2 weeks ago. For many months I've meant to clean-up a C++/python lib of mine, for public consumption. I couldn't help but procrastinate, as the maintenance cost is so high a tax (eg. too clever hacks, big

[julia-users] Re: unsure about an error message from ccall

2014-08-14 Thread Douglas Bates
On Thursday, August 14, 2014 2:06:06 PM UTC-5, Ivar Nesje wrote: > > Does it help to declare libwsmp as const? Now the problem seems to have cured itself. I'm not sure what I am doing differently.

[julia-users] Stabilizer LLVM Plugin

2014-08-14 Thread John Myles White
I just heard a talk about this (somewhat out-of-date) LLVM plugin for doing performance testing in a way that randomizes over possible memory layouts: https://github.com/ccurtsinger/stabilizer If the plugin gets updated for a newer version of LLVM it might be a fun project to try using this for

Re: [julia-users] Typo in local variable name not detected

2014-08-14 Thread Carlos Becker
Hi all. I have been busy and not following the julia development news. are there any news wrt this topic? What I find dangerous is mistakenly referencing a global variable from a local context, when that is not intended. To me it seems worth adding a qualifier to specify that whatever is not

[julia-users] Re: ANN: Docile.jl Package Documentation (again)

2014-08-14 Thread Michael Hatherly
I’ve added some new functionality in the form of @doc docstrings for: - methods - functions - globals - macros - types - modules The YAML metadata has been replaced with a Dict{Symbol, Any}, resulting in quite a large improvement in load times. Documentation can also be

[julia-users] Re: ANN: Docile.jl Package Documentation (again)

2014-08-14 Thread Iain Dunning
I'll try to give this ago, its a nice idea. I've don't believe I've ever worked on a project that actually used "docstrings" in a formalized way (to, i.e. generate HTML documentation), but I can see how it'd be very useful for some Julia packages. Cheers, Iain On Thursday, August 14, 2014 5:01

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-14 Thread cdm
can we look forward to June 2015 for the second ever great JuliaCon ... ? if so, where shall we plan on going to? ~ cdm

Re: [julia-users] Proposal for inargs

2014-08-14 Thread gael . mcdon
>One nit: can you really support your assertion that C++ and Fortran are the >two major languages of scientific computing? In my world, Matlab is used by >about 20x (maybe 50x) as many people as C++. I suspect there's a major divide >depending on field. Science is a big place. It's just as you

Re: [julia-users] Typo in local variable name not detected

2014-08-14 Thread Ethan Anderes
It's funny, this issue is by far my biggest source of bugs when coding in Julia. I find myself often prototyping things with commands in the global REPL scope, then wrapping everything into a function once I get it working. Then I forget to pass a variable as an argument to the function and the

Re: [julia-users] Typo in local variable name not detected

2014-08-14 Thread John Myles White
I think Lint.jl might handle this already: https://github.com/tonyhffong/Lint.jl -- John On Aug 14, 2014, at 2:39 PM, Ethan Anderes wrote: > It's funny, this issue is by far my biggest source of bugs when coding in > Julia. I find myself often prototyping things with commands in the global >

[julia-users] Return value of "try error() end"

2014-08-14 Thread samoconnor
I have a question about the return value of "try expr end". julia> try 1 == 1 end true julia> try 1 == 0 end false julia> try error() end false I like that "try expr end" returns false if expr throws an error. Is this a documented feature of "try"? For exception handling, it's great being able

[julia-users] Re: table of UTF8 operator symbols

2014-08-14 Thread Tony Kelman
This doesn't entirely help with whether or not the substitution is implemented in Julia yet, but for the purposes of writing papers in Latex I'm a frequent user of http://detexify.kirelabs.org/classify.html when I can't remember the code for a symbol. On Thursday, August 14, 2014 10:17:38 AM U

[julia-users] Re: table of UTF8 operator symbols

2014-08-14 Thread Tony Kelman
And apparently there's a unicode version, http://shapecatcher.com/ On Thursday, August 14, 2014 4:00:49 PM UTC-7, Tony Kelman wrote: > > This doesn't entirely help with whether or not the substitution is > implemented in Julia yet, but for the purposes of writing papers in Latex > I'm a frequen

Re: [julia-users] Typo in local variable name not detected

2014-08-14 Thread Ethan Anderes
Thanks for the link John. I has a quick glance and it looks like it will do what I want when I want to analyze a file with a bunch of function definitions. It would be nice, however, to get a macro which analyzes all the functions called in a line of code at runtime. E.g. `@lint x = foo(1.1)

Re: [julia-users] R interface/Rif -- does it still work?

2014-08-14 Thread lgautier
Rif in its master repository on github is working with Julia 0.3. The moment I get the central MANIFEST to register this it will be available to all with the default package utilities. L. On Thursday, February 6, 2014 2:33:04 PM UTC-5, John Myles White wrote: > > I would guess that Rif is out

[julia-users] Possibility for an MPI-based cluster manager for use on Cray systems?

2014-08-14 Thread Joshua Job
Hello all, I recently acquired an account under a project at ORNL's Titan supercomputer, and had hoped to deploy some Julia codes I had written and used on my University's HPC cluster but I'm having some trouble. Titan only allows one to start processes on other computers via the "aprun" comman

[julia-users] Re: Possibility for an MPI-based cluster manager for use on Cray systems?

2014-08-14 Thread Viral Shah
Do look at ClusterManager.jl, which has support for Sun GridEngine. It may be possible to add aprun support much the same way, without too much effort. MPI.jl is a package that helps processes in the cluster talk over MPI, instead of the default socket based communication that Julia uses. -vira

Re: [julia-users] JuliaCon Opening Session Videos Posted!

2014-08-14 Thread Viral Shah
We have started work on the second JuliaCon - but have yet to decide on a venue. Given that we would like it to accommodate more people this time, we are seriously considering Boston where we have a lot of support on the ground. Of course, this is purely speculative at this point. -viral On Fr

[julia-users] 0.3.0 Release Candidate 4 released

2014-08-14 Thread Elliot Saba
Mac and Ubuntu binaries are up, Windows not yet. Barring any significant problems cropping up over the next few days, this RC is expected to be promoted to 0.3.0-final. Happy coding, -E

[julia-users] Re: 0.3.0 Release Candidate 4 released

2014-08-14 Thread KK Sasa
A very basic question: How to update without losing packages? Just re-install?

Re: [julia-users] Re: 0.3.0 Release Candidate 4 released

2014-08-14 Thread Elliot Saba
Your packages should remain untouched through upgrades on minor versions. (E.g. if you were on a 0.3.0 prerelease version before, upgrading to 0.3.0-rc4 or even 0.3.0-final should not affect your packages) If you are on 0.2.1, your packages will probably need to be reinstalled, as Julia separates

[julia-users] How to save sparse in HDF5? ERROR: no method write(HDF5File, ASCIIString, SparseMatrixCSC{Int64,Int64})

2014-08-14 Thread paul analyst
How to save sparse in HDF5? julia> D=sparse(I,J,V); julia> h5write("D.h5","D", D); ERROR: no method write(HDF5File, ASCIIString, SparseMatrixCSC{Int64,Int64}) in h5write at C:\Users\SAMSUNG2\.julia\v0.3\HDF5\src\plain.jl:527 Paul

[julia-users] moving from v0.3 to v0.4

2014-08-14 Thread Andreas Lobinger
Hello colleagues, i just updated julia (which means, i built) and ended up in a v0.4. A Pkg.update() then leads to julia> Pkg.update() INFO: Initializing package repository /home/lobi/.julia/v0.4 INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl INFO: Updating METADATA... INFO:

[julia-users] Re: moving from v0.3 to v0.4

2014-08-14 Thread Andreas Lobinger
Looks like, that's my smallest problem...

[julia-users] moving from v0.3 to v0.4

2014-08-14 Thread Ivar Nesje
I think you should be able to just copy the REQUIRES file from v0.3 to v0.4, and run Pkg.update().

[julia-users] Re: moving from v0.3 to v0.4

2014-08-14 Thread Tobias Knopp
Yes this is intended in order to allow having different versions being installed in parallel. But indeed it might be good to ask the user if he wants to migrate the packages. Am Freitag, 15. August 2014 08:47:07 UTC+2 schrieb Andreas Lobinger: > > Looks like, that's my smallest problem... > >