Re: [julia-users] Any method to save the variables in workspace to file?

2014-04-02 Thread Stefan Karpinski
I don't see how multiple implementations make something better. One good, portable, open source implementation is good enough. > On Apr 3, 2014, at 12:55 AM, Tim Holy wrote: > >> On Wednesday, April 02, 2014 09:49:11 PM Ivar Nesje wrote: >> It will probably be a long time before we can really t

Re: [julia-users] Any method to save the variables in workspace to file?

2014-04-02 Thread Tim Holy
On Wednesday, April 02, 2014 09:49:11 PM Ivar Nesje wrote: > It will probably be a long time before we can really trust anything but CSV > for maximum forward compatibility. I suspect HDF5 is a rather reliable choice, even if it doesn't meet the "multiple implementations" criterion. (Of course, t

Re: [julia-users] Any method to save the variables in workspace to file?

2014-04-02 Thread Ivar Nesje
It will probably be a long time before we can really trust anything but CSV for maximum forward compatibility.

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Jameson Nash
we have a `download` command in base? cool! I have a Window's-only download command in WinRPM that uses the IE API that should merge with that (since it doesn't have any dependencies) On Wed, Apr 2, 2014 at 11:24 PM, Tim Holy wrote: > Ah, didn't realize that wasn't supported. > > I'll at least po

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Tim Holy
Ah, didn't realize that wasn't supported. I'll at least post manual installation instructions in the README. --Tim On Wednesday, April 02, 2014 11:19:55 PM Isaiah Norton wrote: > The problem is in the "download" command from utils.jl: "which" is not > available on Windows. We can probably use "w

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Isaiah Norton
The problem is in the "download" command from utils.jl: "which" is not available on Windows. We can probably use "where" instead, at least on newer versions of Windows, or fall back to try/catch. On Wed, Apr 2, 2014 at 10:58 PM, Tim Holy wrote: > OK, my theory is it's a problem with saving the

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Jameson Nash
As I indicated, I used the macro to make the code look neater. I could have expanded it (see below). But just as functions help DRY code, macros help DRY typing. Memoizing using a dict isn't much better than calling dlsym, which is also some form of dict (and may even benefit from better memory loc

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Jacques Rioux
I'll try in the morning and report On Apr 2, 2014 10:58 PM, "Tim Holy" wrote: > OK, my theory is it's a problem with saving the .zip file to tempdir(). I > just > changed it to save the zip file to the TestImages directory, and then > delete it > at the end. Can you do a Pkg.update() and try aga

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Tim Holy
OK, my theory is it's a problem with saving the .zip file to tempdir(). I just changed it to save the zip file to the TestImages directory, and then delete it at the end. Can you do a Pkg.update() and try again? --Tim On Wednesday, April 02, 2014 07:13:24 PM Jacques Rioux wrote: > I get errors

[julia-users] Re: ANN: TestImages

2014-04-02 Thread Jacques Rioux
Here it is running the pertinent lines in the REPL. It seems like the download does not work I think. julia> fname = joinpath(tempdir(), "standard_test_images.zip") "C:\\Users\\Jacques\\AppData\\Local\\Temp\\standard_test_images.zip" julia> download("http://www.ece.utk.edu/~gonzalez/ip

Re: [julia-users] Re: ANN: TestImages

2014-04-02 Thread Tim Holy
Hmm. I haven't tested it on Windows (and don't have one near me now), but I'm surprised it doesn't Just Work. The block of code starting on line 17 simply downloads and extracts a .zip file. Instead of building through Pkg (which wraps the code in a try/catch block, making it harder to debug),

[julia-users] Re: ANN: TestImages

2014-04-02 Thread Jacques Rioux
I get errors building it. julia> Pkg.build("TestImages") =[ ERROR: TestImages]== spawn: no such file or directory (ENOENT) while loading C:\Users\Jacques\.julia\v0.3\TestImages\deps\build.jl, in expression starting on line 17 ==

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Mike Innes
I agree entirely that macros and eval should be avoided if possible - so why have you used them for memoization? const func_pointers = Dict{String, Ptr{Void}}() getFuncPointerM(name) = haskey(func_pointers, name) ? func_pointers[name] : (func_pointers[name] = getFuncPointer(name)) Per

Re: [julia-users] Any method to save the variables in workspace to file?

2014-04-02 Thread Steven G. Johnson
On Wednesday, April 2, 2014 2:13:40 AM UTC-4, Ivar Nesje wrote: > > If you need long term storage, you should be using a standard format that > has multiple implementations. That would seem to rule out HDF5, then

[julia-users] Re: Will ccall play nicely with Armadillo/C++?

2014-04-02 Thread Steven G. Johnson
What does Armadillo provide that is not already built in to Julia's standard library? Calling C++ code from Julia is currently something of a pain, especially STL-heavy code.

[julia-users] Re: Strange llvm code generated

2014-04-02 Thread andrew cooke
thanks! it's just possible this will fix a performance issue of mine :o) On Wednesday, 2 April 2014 16:57:36 UTC-3, Steven G. Johnson wrote: > > Just filed this as an issue: > https://github.com/JuliaLang/julia/issues/6382 >

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Jameson Nash
A delayed macro is just a function call. Don't make you life complicated by trying to use one in place of the other. Using macros and eval can get you into a lot of trouble by helping you write brittle code. They allow you to confuse compile and run time, even though Julia does make a strong disti

Re: [julia-users] Re: orthogonalize

2014-04-02 Thread Andreas Noack Jensen
I have just tried to build Julia with MKL to check this and with MKL I get the same result as in MATLAB. However, both results span the same space. With the MKL solution named U and the OpenBLAS solution named U2 I get norm(U*U'-U2*U2') and the same is true for the pivoted QR. 2014-04-02 17:53

[julia-users] Will ccall play nicely with Armadillo/C++?

2014-04-02 Thread James Fairbanks
Dear All, Has anyone worked with C++ code that uses Armadillo for matrix computations? How well did it work? How difficult would it be? I haven't seen anyone celebrating success or bemoaning failure. I have a library from a colleague that uses Armadillo and OpenMP

[julia-users] ANN: TestImages

2014-04-02 Thread Tim Holy
It's a very simple package: it provides an easy way to load images that have become something of a standard in the image processing community. https://github.com/timholy/TestImages.jl If there are important ones I've missed, feel free to submit a PR. --Tim

Re: [julia-users] Re: orthogonalize

2014-04-02 Thread Douglas Bates
On Wednesday, April 2, 2014 10:46:10 AM UTC-5, Andreas Noack Jensen wrote: > > Maybe pivoted QR is best solution here. > It might be worthwhile trying out some other examples first. I can't reproduce the Matlab answer from qrfact(A), qrfact(A;pivot=true) or svdfact(A). That matrix does have a

Re: [julia-users] IJulia example on documentation doesn't work.

2014-04-02 Thread Ivar Nesje
Those are WARNINGS because the NumericExtensions package is not written in a way that is 100% backwards compatible with 0.2 when it extend new functions introduced in 0.3-prerelease. They are not errors and I don't think they will cause problems.

Re: [julia-users] IJulia example on documentation doesn't work.

2014-04-02 Thread vfclists
I am following the documentation at https://github.com/JuliaLang/IJulia.jl and starting it with "ipython notebook --profile julia" as stated there. After scrutinizing the documentation I realized that I had to run Pkg.add("IJulia") and some of the commands work now. After trying it again this i

Re: [julia-users] IJulia example on documentation doesn't work.

2014-04-02 Thread rahuldave mailinglists
Remember to call it as ipython notebook --profile julia On Wed, Apr 2, 2014 at 3:16 PM, Stefan Karpinski wrote: > Are you running IPython rather than IJulia? That looks like a Python error > message. > > > On Wed, Apr 2, 2014 at 3:05 PM, vfclists wrote: > >> >> >> I have just installed Julia 0

[julia-users] Re: Strange llvm code generated

2014-04-02 Thread Steven G. Johnson
Just filed this as an issue: https://github.com/JuliaLang/julia/issues/6382

Re: [julia-users] IJulia example on documentation doesn't work.

2014-04-02 Thread Stefan Karpinski
Are you running IPython rather than IJulia? That looks like a Python error message. On Wed, Apr 2, 2014 at 3:05 PM, vfclists wrote: > > > I have just installed Julia 0.2 and IPython and when I try the RDatasets > example. I get the error message below > > File "", line 1using RDatasets

[julia-users] IJulia example on documentation doesn't work.

2014-04-02 Thread vfclists
I have just installed Julia 0.2 and IPython and when I try the RDatasets example. I get the error message below File "", line 1using RDatasets ^SyntaxError: invalid syntax RDatasets is installed on my system. It is listed in the installed packages in the .ijulia/v0.2

[julia-users] Re: Strange llvm code generated

2014-04-02 Thread andrew cooke
does no-one know why 3.0 generates more complex code? the above post didn't contain the native code, but here it is for 3.0: julia> function f{T}(x::T) result::T = zero(T) for n = one(T):x result += x end result end f (generic func

[julia-users] Re: [large file] eachline memory consumption

2014-04-02 Thread Keith Campbell
Hi Krishna, I've run into similar problems, and had some luck with mmaps + pre-allocated storage. You can see an example at: http://nbviewer.ipython.org/github/catawbasam/catawbasam_sandbox/blob/master/lineread_mmap_short.ipynb That example reads in a list of 100 million floats from a 1.8 gb te

Re: [julia-users] Newest pull of Julia breaks Grid.jl?

2014-04-02 Thread Stefan Karpinski
Cross-posted in various places: https://github.com/JuliaLang/julia/issues/6378 http://stackoverflow.com/questions/22817967/newest-pull-of-julia-breaks-grid-jl On Wed, Apr 2, 2014 at 12:18 PM, Gustavo Camilo wrote: > Hi! I just pulled and compiled Version 0.3.0-prerelease+2414 (2014-04-02 > 14:

[julia-users] Newest pull of Julia breaks Grid.jl?

2014-04-02 Thread Gustavo Camilo
Hi! I just pulled and compiled Version 0.3.0-prerelease+2414 (2014-04-02 14:47 UTC) of Julia, ran Pkg.update() and removed and reinstalled Grid, and now it seems to be broken: julia> using Grid julia> InterpGrid(linspace(1,10,100),BCnil,InterpQuadratic) ERROR: type cannot be constructed in i

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Isaiah Norton
I stand corrected. On Wed, Apr 2, 2014 at 9:50 AM, Simon Danisch wrote: > Ah, the links are all the same... > Output for Mikes solution: > native: *https://gist.github.com/SimonDanisch/6270c01a6ea881877c4f > * > llvm: https://gist.gith

Re: [julia-users] Re: orthogonalize

2014-04-02 Thread Andreas Noack Jensen
Maybe pivoted QR is best solution here. 2014-04-02 11:39 GMT-04:00 Tomas Lycken : > This is what I get from Matlab R2013a > > >> A > > A = > > 1 1 0 0 0 > 1 1 0 0 0 > 1 1 0 0 0 > 1 1 0 0 0 > 1 1 0

Re: [julia-users] Re: orthogonalize

2014-04-02 Thread Tomas Lycken
This is what I get from Matlab R2013a >> A A = 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0

Re: [julia-users] Re: orthogonalize

2014-04-02 Thread Douglas Bates
On Tuesday, April 1, 2014 10:44:03 PM UTC-5, Gustavo Lacerda wrote: > > yes, I think that would be useful. > Do you know what Matlab's orth function returns for a rank deficient matrix? Suppose you ask for an orthogonal basis of the column space of a matrix like julia> hcat(fill(1.,(20,)), ey

Re: [julia-users] Construction of a Matrix from columns via array comprehension

2014-04-02 Thread Paweł Biernat
W dniu środa, 2 kwietnia 2014 15:30:58 UTC+2 użytkownik Andreas Noack Jensen napisał: > > Maybe this is what you want > > [y[:,1:2] hcat([y[:,j] for j=2:3]...)] > > Yep, this is what I was after. Thanks! What does "..." do? I couldn't find it in the documentation.

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
Ah, the links are all the same... Output for Mikes solution: native: *https://gist.github.com/SimonDanisch/6270c01a6ea881877c4f * llvm: https://gist.github.com/SimonDanisch/612e8b08d915d188c4d5 2014-04-02 15:46 GMT+02:00 Simon Danisch

[julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
@ Mike Good question. Well, I definitely would wish for a simpler solutions. But as far as I understand the situation, every video card vendor makes his own OpenGL implementation. Also, even on one computer, you can have more than one rendering context. This means, the correct function pointers ca

Re: [julia-users] Construction of a Matrix from columns via array comprehension

2014-04-02 Thread Andreas Noack Jensen
Maybe this is what you want [y[:,1:2] hcat([y[:,j] for j=2:3]...)] 2014-04-02 8:53 GMT-04:00 Paweł Biernat : > > Hi, > I am trying to construct a matrix (2d array) via the array comprehension and hcat like this > > y=[1 for i=1:3, j=1:3] > yy=hcat(y[:,1:2],[y[:,j] for j=2:3]) > > which fails wi

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Isaiah Norton
> just the pointer to getProcAddress will be inlined, but not the pointer to glGetString, right? Again, ccall evaluates the first argument at compile time (trying throw an error in getProcAddress and see what happens). The pointer *returned* by getProcAddress will be used. On Wed, Apr 2, 2014 a

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
Okay thanks, I'll take a close look at it. Hope you're both right. If it gets inlined, Isaiah's solution will be a lot nicer after all ! 2014-04-02 14:59 GMT+02:00 Mike Innes : > Ok, you're right about the @eval include - I forgot that include doesn't > remember its module like eval. > > But a

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Mike Innes
Ok, you're right about the @eval include - I forgot that include doesn't remember its module like eval. But again, check the llvm output or run a benchmark. The lowered code doesn't tell you all that much, because the ccall hasn't been compiled at that point. On 2 April 2014 13:51, Simon Danisch

[julia-users] Construction of a Matrix from columns via array comprehension

2014-04-02 Thread Paweł Biernat
Hi, I am trying to construct a matrix (2d array) via the array comprehension and hcat like this y=[1 for i=1:3, j=1:3] yy=hcat(y[:,1:2],[y[:,j] for j=2:3]) which fails with the following message ERROR: mismatch in dimension 1 in cat_t at abstractarray.jl:680 in hcat at abstractarray.jl:719 i

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
But without the eval, the include will be evaluated in the module, from where you call "load". Which means, the functions don't get exported by the OpenGL module. So I need one @eval to evaluate things inside the OpenGL module, and the other is for inlining the function ptr. (As far as I understand

[julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Mike Innes
Although, it strikes me as odd that you would need runtime evaluation to implement a library like this in the first place. Java must have OpenGL bindings, for example – how do those libraries solve this problem? Are they just really slow?

[julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Mike Innes
Ok, if you're using an include then you don't need those @evals. Your @eval include("gl4_3.jl") is definitely redundant, since include happens at run time anyway. You should benchmark it yourself to be sure (or perhaps check the llvm output) but I'm pretty sure Isaiah is right here – you can al

[julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
Hm... just the pointer to getProcAddress will be inlined, but not the pointer to glGetString, right? with Mike's solution the lowered code looks like I want to have it: $(Expr(:lambda, {:name}, {{},{{:name,Uint16,0}},{}}, :(begin # /home/s/load.jl, line 2: return top(ccall)(Ptr{Void}

Re: [julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Isaiah Norton
No: it evaluates once at compile time, and thereafter the function pointer is directly embedded. On Wed, Apr 2, 2014 at 7:16 AM, Simon Danisch wrote: > @Isaiah > If I understand the code correctly, your solution would call the > getProcAddress with every OpenGL call. > This wouldn't be very des

[julia-users] Re: Delay Macro evaluation, or how to load OpenGL function Pointers

2014-04-02 Thread Simon Danisch
@Isaiah If I understand the code correctly, your solution would call the getProcAddress with every OpenGL call. This wouldn't be very desirable, even if getProcAddress is fast... Using the native getProcAddress is a nice idea though, with which I played around as well. But I think in the end it

Re: [julia-users] [large file] eachline memory consumption

2014-04-02 Thread Tim Holy
On Wednesday, April 02, 2014 12:37:50 PM km wrote: > Yes I run out of memory and the process gets killed. I am working on files > with 200Gb in size. i hoped to parse one line at a time and save memory. This definitely should work, and so there's a bug somewhere. Can you file an issue? If it's p

Re: [julia-users] What is the Julia equivalent of the MATLAB function: nargin()

2014-04-02 Thread Ivar Nesje
No, the difference in scope is for the right side of the = sign. Default parameters is only fancy syntax for declaring multiple methods at once. function foo(x, z = a) ## calculation using x and z end is equivalent to function foo(x,z) ## calculation using x and z end foo(x) = foo(x, a) In t

[julia-users] Re: Numeric Type Parameter

2014-04-02 Thread Cristóvão Duarte Sousa
Inner constructor functions can also have type parameters but they don't have to be necessarily related to the parameter of the type itself. E.g., immutable ModInt{n} <: Integer k::Int function ModInt{T}(k::T) println("n=$n k=$k T=$T") new(mod(k,n)) end end julia> Mod

[julia-users] Re: Numeric Type Parameter

2014-04-02 Thread Cristóvão Duarte Sousa
And let me add that, as far as I know, a call as ModInt{i}(...) is always a call to a inner constructor of the type ModInt{i}. We cannot call external constructors like that. Moreover, external constructors seem be be ordinary generic functions and one can even do stuff unrelated to the type (s

Re: [julia-users] What is the Julia equivalent of the MATLAB function: nargin()

2014-04-02 Thread Oliver Lylloff
Are the default values then considered in a global scope? Not sure I fully understand the doc: http://docs.julialang.org/en/latest/manual/functions/#evaluation-scope-of-default-values function foo(x,z=1) ...# z in global scope? end function foo2(x) z=1 # Local scope ... end

[julia-users] Re: Numeric Type Parameter

2014-04-02 Thread Avik Sengupta
Works: ModInt(k) = new(mod(k,n)) Doesn't Work: >ModInt(k,n) = new{n}(mod(k,n)) For an inner constructor, the type parameter is placed on the type definition, and so you dont need to specify the type parameter in the function (constructor) definition. So for an inner constructor, you can say Ty

Re: [julia-users] [large file] eachline memory consumption

2014-04-02 Thread km
Yes I run out of memory and the process gets killed. I am working on files with 200Gb in size. i hoped to parse one line at a time and save memory. On Mon, Mar 31, 2014 at 10:57 AM, Stefan Karpinski < stefan.karpin...@gmail.com> wrote: > This isn't particularly well optimized at this point, but