Re: [julia-users] Wishlist

2014-02-10 Thread Tim Holy
Hi Yakir, On Sunday, February 09, 2014 09:14:01 PM Yakir Gagnon wrote: >2. regionprops >3. tformarray For at least these two algorithms (and perhaps others), the only reason you need to have them in Matlab is because looping is so dang slow (for anything other than very specific circums

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Tim Holy
It's not an exported interface, and many of us hope it will change drastically in the future, but this works: julia> type MyType Base.Cartesian.@nexprs 5 i->a_i::Int end julia> MyType.names (:a_1,:a_2,:a_3,:a_4,:a_5) julia> MyType.types (Int64,Int64,Int64,Int64,Int64) --Tim O

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Fil Mackay
> > It's not an exported interface, and many of us hope it will change > drastically > in the future, but this works: > > julia> type MyType > Base.Cartesian.@nexprs 5 i->a_i::Int >end > > julia> MyType.names > (:a_1,:a_2,:a_3,:a_4,:a_5) > > julia> MyType.types > (Int64,I

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Carlos Becker
Hi Tobias, I want to be able to return different types from ccall(), according to what happens inside my C/C++ code, without the need for telling julia what I want to return, its size, etc. Argument passing gets complicated in such cases, and I believe returning julia objects directly is neater.

Re: [julia-users] Vector division mystery

2014-02-10 Thread Fil Mackay
Thanks for the clear answers guys - makes sense now.. On Wednesday, February 5, 2014 6:16:42 PM UTC+11, Andreas Noack Jensen wrote: > > I different framing of Kevin's answer could be that it solves your systems > of equations: three systems of one equation in three variables > > julia> x=a/b >

Re: [julia-users] Some generic quiestions.

2014-02-10 Thread Mauro
I'm not much of an expert but here my answers. Maybe someone more knowledgeable could check/comment on the answers? > a) Is there an equivalent to Python's doctest.testmod() in > Julia? http://docs.python.org/2/library/doctest.html[1] No. Julia comes with a rudimentary tasting framework: Base.

[julia-users] Julia vs Dylan

2014-02-10 Thread Gour
Hello, while reading different stuff about Julia I did stumble upon its Wikipedia page (http://en.wikipedia.org/wiki/Julia_%28programming_language%29) where there is table comparing Julia with Common Lisp, Fortress and Dylan. I'm not interested neither for Lisp nor for Fortress (which anyway seem

Re: [julia-users] Some generic quiestions.

2014-02-10 Thread Ivar Nesje
a) Because Julia does not (yet) have an equivalent to the python docstrings, we do not have an equivalent to the doctest module. We have however a Sphinx extension that we use for our manual and standard library documentation that contains a rudimentary

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Tim Holy
On Monday, February 10, 2014 03:16:18 AM Fil Mackay wrote: > Is there an equivalent that allows a for loop iterator to construct the > type.. Base.Cartesian.@forexprs perhaps? :) Base.Cartesian is a slightly-enhanced version of the original Cartesian.jl package; the README there is (in my persona

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Tobias Knopp
Carlos, So if I understand you correctly you have some C functions. Ontop of that you put a C wrapper that dispatches different Julia objects based on some internal state. If this is the case it would be much cleaner if you would make this state accessible via ccalls and do the dispatching on t

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Carlos Becker
Hi Tobias, it may be better to look at an example. For instance, to train my SQB classifier: model = SQBMatrixTrain( featureMatrix, labelVector, maxIters, options ) where featureMatrix and labelVector are matrices (2-dimensional) and vectors (1-dimensional), maxIters is a uint32 and options a st

Re: [julia-users] Wishlist

2014-02-10 Thread Billou Bielour
Interp1 should be in base imo, it's such a basic function, I have some code where I use it more than sum. Having all more advanced interpolations in a nice package is fine though. Otherwise some image processing related functions might be in Image.jl, but there's still some missing stuff in ther

[julia-users] Re: Howto: Julia x[I] = [] ?? vs Matlab x(I) = []

2014-02-10 Thread RecentConvert
I ran into this same problem recently as well. This is a hard Matlab habit to break and none of the solutions is intuitive. My solution involves preallocating a boolean array and then looping through the actual data checking which values I need to keep. At the end I use the boolean array to fil

[julia-users] CUDA package and multiple GPUs

2014-02-10 Thread oliver . mirus
First of all thank you very much to the Julia and package developers. I really enjoy this programming language! So far I have successfully used Julia's CUDA package on my workstation containing a single CUDA device. However, I would like to use the CUDA cluster of my university, where a single

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Tobias Knopp
Am Montag, 10. Februar 2014 14:17:02 UTC+1 schrieb Carlos Becker: > > > model = SQBMatrixTrain( featureMatrix, labelVector, maxIters, options ) > Is this the function declaration of the C function or is this how you want your Julia API to look like? If its the C signature and model is a pointer

Re: [julia-users] Re: Howto: Julia x[I] = [] ?? vs Matlab x(I) = []

2014-02-10 Thread Tim Holy
On Sunday, February 09, 2014 09:22:55 PM Jason Pries wrote: > but this isn't ideal since (I assume) it involves allocating > additional memory for A[!I,!J] as an intermediate step. In Matlab, it allocates new memory for the array, too: >> format debug >> A = zeros(5,3) A = Structure address =

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Carlos Becker
Hi Tobias, model = SQBMatrixTrain( featureMatrix, labelVector, maxIters, options ) That is how the matlab call looks like, so it is very transparent. That is how I want the Julia call look like, and I think that it is better to pass Julia objects directly to ccall() in those cases. It also offer

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Tobias Knopp
Fair enough, if you wrap the C-API in C++ this can get quite neat. And having myself pushed the documentation of the Julia C-API I definately think that Julia's CAPI is quite good. My intention at that time was, however, embedding Julia in C, in which case the C-API is definately required. So,

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Carlos Becker
Hi Tobias, thanks for you support! I am still working on it, but when I have something ready for pushing I will let you know. I have two specific questions now: 1) I think that there would be a few issues with the lack of julia's exported symbols (non-DLLEXPORTed symbols in julia.h) The ones r

[julia-users] Re: Parallel mode

2014-02-10 Thread Bob Cowdery
Thanks. I found the SharedArray. Its a pattern I've used before in a DIY way and works well. With this and UDP I think I've enough to figure out a design and start looking at performance. -- bob On Sunday, February 9, 2014 8:11:04 PM UTC, Bob Cowdery wrote: > > Hi > > Reading the docs it seems

Re: [julia-users] Re: Howto: Julia x[I] = [] ?? vs Matlab x(I) = []

2014-02-10 Thread Steven G. Johnson
On Thursday, November 29, 2012 3:24:50 PM UTC-5, Jeff Bezanson wrote: > > We have del(x, i) and del(x, i:j). We could add del(x, I) where I is a > vector, but we can't do it any faster than > for i in I del(x,i) end Why can't it be done faster? Presumably you could move all of the non-delete

Re: [julia-users] Some generic quiestions.

2014-02-10 Thread Kevin Squire
> > d) Does my module has to have the same name as the file ie: > (Matematicas.jl > > / module Matematicas)? > > No, there is no relation between file-name and module. Also a module > can be spread over several files which are then included, see again > http://docs.julialang.org/en/latest/manual/m

Re: [julia-users] Re: Howto: Julia x[I] = [] ?? vs Matlab x(I) = []

2014-02-10 Thread Steven G. Johnson
On Monday, February 10, 2014 1:42:56 PM UTC-5, Steven G. Johnson wrote: > > > > On Thursday, November 29, 2012 3:24:50 PM UTC-5, Jeff Bezanson wrote: >> >> We have del(x, i) and del(x, i:j). We could add del(x, I) where I is a >> vector, but we can't do it any faster than >> for i in I del(x,i)

Re: [julia-users] Re: Howto: Julia x[I] = [] ?? vs Matlab x(I) = []

2014-02-10 Thread Kevin Squire
On Mon, Feb 10, 2014 at 10:45 AM, Steven G. Johnson wrote: > On Monday, February 10, 2014 1:42:56 PM UTC-5, Steven G. Johnson wrote: >> >> On Thursday, November 29, 2012 3:24:50 PM UTC-5, Jeff Bezanson wrote: >>> >>> We have del(x, i) and del(x, i:j). We could add del(x, I) where I is a >>> vector

[julia-users] HttpServer images

2014-02-10 Thread Marcus Appelros
Trying to setup a server that makes files in a folder available for download. Html files can be loaded by the server and accessed (+javascript interaction) via localhost:8000, the html file displaying a image works when viewed directly in firefox, the image is in the same folder (named html) a

Re: [julia-users] Re: Returning julia objects with ccall

2014-02-10 Thread Tobias Knopp
Am Montag, 10. Februar 2014 18:27:03 UTC+1 schrieb Carlos Becker: > > 1) I think that there would be a few issues with the lack of julia's > exported symbols (non-DLLEXPORTed symbols in julia.h) >The ones related to arrays and basic types are exported now, but others > are not, and therefore

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Madeleine Udell
I'm having trouble using MKL in julia. I changed Make.inc so that USE_MKL = 1, but when I make and run julia, I find that Base.libblas_name = "libopenblas". Is this expected? I would have thought it would be eg "libmkl_core". Andreas, I found your wrappers for MKL in this PR

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Andreas Noack Jensen
Hi Madeleine When compiling julia with MKL you'll have to do make cleanall as well as rebuild ARPACK and Suitesparse, i.e. make -C distclean-arpack and make -C distclean-suitesparse. It is also easier to create a Make.user there you set USE_MKL=1 and MKLROOT to the location of your MKL library fil

Re: [julia-users] what scopes does isdefined() look in?

2014-02-10 Thread Bill Janssen
My concern is that there seem to be a lot of special-case things about scoping and evaluation, which makes actual use of homoiconicity rather painful/difficult, and produces unexpected results for some classes of programs. Perhaps David Moon's idea of Contexts would address this. But they hav

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Madeleine Udell
Thanks, Andreas. I've tried to follow your directions, but am still getting Base.libblas_name = "libopenblas". Details follow: I've created a file Make.mkl and replaced Make.inc with Make.mkl in the Makefile. In Make.inc, I've set USE_MKL=1 and I've set the MKLROOT for my install location, expor

[julia-users] Re: Windows batch file improvement

2014-02-10 Thread Laszlo Hars
It is harder with julia-0.3.0-prerelease. I tried the win64 version in Windows 7. (Other Windows versions should be similar, but I cannot test them.) We still need a batch file. I named it Julia.bat. It contains (with my test setup path) only 2 lines ~ @"c:\t\Julia 0.3.0-prerelease\bin\juli

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Andreas Noack Jensen
You shouldn't touch Make.inc. If you create a Make.user then Make.inc will automatically include the variables set in that file, so recover Make.inc as it is on master and make a Make.user with the lines USE_MKL=1 MKLROOT=/opt/intel/mkl and try make cleanall;make -j 60 again. 2014-02-10 21:53 G

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Madeleine Udell
fantastic, thank you. I now see Base.libblas_name="libmkl_rt", and am able to run the following test successfully: transa = 'N'::Base.LinAlg.BlasChar # multiply by A, not A' matdescra = "GXXF" # G = general, X = ignored, F = one-based indexing m,n = 50,100 A = sprand(m,n,.01) y = zeros(m) x = rand

Re: [julia-users] what scopes does isdefined() look in?

2014-02-10 Thread Stefan Karpinski
It's completely consistent – nothing ever reifies or reflects on local scopes. It just may not be what you're used to coming from Lisp or Scheme (or other dynamic languages). On Mon, Feb 10, 2014 at 3:10 PM, Bill Janssen wrote: > My concern is that there seem to be a lot of special-case things a

[julia-users] reduce() behavior question

2014-02-10 Thread N. Saphra
The following code doesn't behave as I'd expect: julia> reduce((x,y) -> (x * int(y)), 1, ["1", "2", "3"]) ERROR: no method *(ASCIIString,Int64) in anonymous at none:1 in r_pairwise at reduce.jl:135 in reduce at reduce.jl:183 I was expecting reduce() to take my op and do something like *(*(*(1,

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Andreas Noack Jensen
You are welcome. Good to hear that it worked. 2014-02-10 22:35 GMT+01:00 Madeleine Udell : > fantastic, thank you. I now see Base.libblas_name="libmkl_rt", and am able > to run the following test successfully: > > transa = 'N'::Base.LinAlg.BlasChar # multiply by A, not A' > matdescra = "GXXF" #

Re: [julia-users] HttpServer images

2014-02-10 Thread John Myles White
Can you control the HTTP request return MIME type? At one point I believe (but am not sure) that HttpServer always returned HTML as the MIME type. -- John On Feb 10, 2014, at 11:06 AM, Marcus Appelros wrote: > Trying to setup a server that makes files in a folder available for download. > >

[julia-users] reduce() behavior question

2014-02-10 Thread Ivar Nesje
Currently it is much faster to write a explicit loop, than to use theese functions. In the 0.3-prerelease version we have a new function foldl and foldr to do what you want. See the latest docs http://docs.julialang.org/en/latest/stdlib/base/#Base.reduce

[julia-users] Re: reduce() behavior question

2014-02-10 Thread Steven G. Johnson
On Monday, February 10, 2014 4:50:41 PM UTC-5, N. Saphra wrote: > > The following code doesn't behave as I'd expect: > > julia> reduce((x,y) -> (x * int(y)), 1, ["1", "2", "3"]) > ERROR: no method *(ASCIIString,Int64) > in anonymous at none:1 > in r_pairwise at reduce.jl:135 > in reduce at red

[julia-users] Re: reduce() behavior question

2014-02-10 Thread Ivar Nesje
If you use the 0.2 version of Julia, you can just copy the foldl function from the source in https://github.com/JuliaLang/julia/blob/427c114a9f357cf96e3c9ac94bedceb64371d62f/base/reduce.jl#L74-85. Just be aware that you will get errors when you upgrade to 0.3 because you suddenly extend a Base

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Madeleine Udell
It looks like only 6 threads are being used when I use mkl from julia. If I do blas_set_num_threads(n), then using top, I see julia is running at min(n,6)*100% cpu. Any idea why this would be, or how to get mkl to use more threads? I'm not sure if this is an issue in julia or with my installation o

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Jake Bolewski
Are those hyper-threaded "cores"? If so, check Intel MKL's documentation on hyper-threading. -Best Jake On Monday, February 10, 2014 6:38:50 PM UTC-5, Madeleine Udell wrote: > > It looks like only 6 threads are being used when I use mkl from julia. > If I do blas_set_num_threads(n), then usin

[julia-users] Iterate through rows/columns

2014-02-10 Thread Spencer Russell
Often I'm using matrices as collections of vectors, for example each column of the matrix is a vector. If I want to iterate through the vectors, I find myself doing: for i in 1:size(mat, 2) # do stuff with mat[:, i] end Is there a way to treat the matrix as an iterable, something like for v

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Fil Mackay
Nice one.. is there a @nexprs that can take a compile-time iterable, and map function that produces a child expression for each item? Kind of like replacing $N with "1:5" rather than one value at a time. That's what I'm really looking for.. On Monday, February 10, 2014 11:42:31 PM UTC+11, Tim

Re: [julia-users] Iterate through rows/columns

2014-02-10 Thread John Myles White
Personally, I always use your first option: for i in 1:size(mat, 2) # do stuff with mat[:, i] end -- John On Feb 10, 2014, at 6:18 PM, Spencer Russell wrote: > for i in 1:size(mat, 2) > # do stuff with mat[:, i] > end >

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Tim Holy
On Monday, February 10, 2014 06:19:03 PM Fil Mackay wrote: > Nice one.. is there a @nexprs that can take a compile-time iterable, and > map function that produces a child expression for each item? Kind of like > replacing $N with "1:5" rather than one value at a time. That's what I'm > really looki

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Fil Mackay
I just implemented an "itexprs" and it gives: @eval begin type Test1 @itexprs 3:5 i->a_i::Int end end names(Test1) 5-element Array{Symbol,1}: :a_3 :a_4 :a_5 Is this not useful, in that I can now pass in any iterator not just a 1:N.. doesn't the above allow you to avoid coll

[julia-users] Re: Iterate through rows/columns

2014-02-10 Thread Spencer Russell
Just realized the mapslices isn't really equivalent, as it assumes each iteration of the do block will return something. Perhaps there's something like an "iterslices"? Trying to use a function that returns nothing in mapslices throws an error: julia> m = [1 2 3; 4 5 6; 7 8 9; 10 11 12]' 3x4 Arra

[julia-users] two-hop ssh tunneling

2014-02-10 Thread James Porter
I have the following situation: I have direct ssh access to a login node. From the login node, I have ssh access to the actual compute nodes that I want to spawn workers on. I don't have access to these nodes directly from my machine. I usually do a two-hop ssh into workers via something like t

[julia-users] Re: Some generic quiestions.

2014-02-10 Thread Ismael VC
Ok, Thanks guys :) I'm going to run some tests!

Re: [julia-users] Julia vs Dylan

2014-02-10 Thread Stefan Karpinski
We were never directly influenced by Dylan. As far as I know, neither Jeff nor Viral nor I have done any Dylan programming. Any linguistic similarities are due to common influences (e.g. Lisp, Pascal, Algol), convergent design, or coincidence. I'm not sure what the reasons were for Dylan choosing m

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Tim Holy
Yes, that's fine. I thought you meant in combination with generating multiple types of different names. --Tim On Tuesday, February 11, 2014 01:57:08 PM Fil Mackay wrote: > I just implemented an "itexprs" and it gives: > > @eval begin > type Test1 > @itexprs 3:5 i->a_i::Int > end

Re: [julia-users] Dynamically generated types

2014-02-10 Thread Fil Mackay
OK - would this be a valuable tool to have around? Or does it reduce to something simpler that I'm not aware of? The idea of replacing the "i" in the anonymous function seems a bit creepy..? function _itexprs(it) Expr(:escape, Expr(:block, eval(it)...)) end macro itexprs(it) _itexprs(it)

Re: [julia-users] Julia vs Dylan

2014-02-10 Thread Stefan Karpinski
s/incredibly/highly/g – I got a little overly enthusiastic with my adjectives. On Mon, Feb 10, 2014 at 10:20 PM, Stefan Karpinski wrote: > We were never directly influenced by Dylan. As far as I know, neither Jeff > nor Viral nor I have done any Dylan programming. Any linguistic > similarities a

Re: [julia-users] what scopes does isdefined() look in?

2014-02-10 Thread Jeff Bezanson
Building expressions and calling eval() and such are really just there as an escape hatch; you're not supposed to do lots of programming via eval(). If you look at the history of lisp, originally it was all about dynamic scope and building expressions, but it became clear that this was not an effic

Re: [julia-users] two-hop ssh tunneling

2014-02-10 Thread Amit Murthy
Yes, the worker is launched on the machines specified in the machinefile (or addprocs). The tunnel is only used to connect to the worker. Writing your own cluster manager to start the worker, which is then connected to via a ssh tunnel should work. On Tue, Feb 11, 2014 at 8:40 AM, James Porter

[julia-users] abstraction question

2014-02-10 Thread Jameson Nash
I can't figure this out, so I'm hoping someone will be able to help suggest a better way to parametrize this code, or solve my dilemma. I've made a somewhat complicate type hierarchy, and now I need to extract some information from it. The problem is, given z (or an instance thereof), I can't seem

Re: [julia-users] abstraction question

2014-02-10 Thread Stefan Karpinski
Did you mean for S to be T or vice versa? On Mon, Feb 10, 2014 at 11:26 PM, Jameson Nash wrote: > I can't figure this out, so I'm hoping someone will be able to help > suggest a better way to parametrize this code, or solve my dilemma. > I've made a somewhat complicate type hierarchy, and now I

Re: [julia-users] abstraction question

2014-02-10 Thread Isaiah Norton
z.parameters[1].parameters[1] ? On Mon, Feb 10, 2014 at 11:26 PM, Jameson Nash wrote: > I can't figure this out, so I'm hoping someone will be able to help > suggest a better way to parametrize this code, or solve my dilemma. > I've made a somewhat complicate type hierarchy, and now I need to

Re: [julia-users] abstraction question

2014-02-10 Thread Jameson Nash
> Did you mean for S to be T or vice versa? Yes. I was trying to disambiguate them, but failed. > z.parameters[1].parameters[1] Tried that, but it caused other problems: https://github.com/JuliaLang/julia/issues/5752 On Mon, Feb 10, 2014 at 11:35 PM, Isaiah Norton wrote: > z.parameters[1].parame

Re: [julia-users] Re: Parallel sparse matrix vector multiplication

2014-02-10 Thread Madeleine Udell
Jake, thanks for the reference; I have 32 hyperthreaded cores, so there's definitely something else going on to limit me to 6 in addition to not exploiting hyperthreading. Perhaps I need to call something like omp_set_num_threads()? But there do

[julia-users] Re: Some generic quiestions.

2014-02-10 Thread Ismael VC
I did it like this, outside of module Matematicas: https://github.com/Ismael-VC/Club_TESCI/blob/master/CODIGO/julia_code/Matematicas.jl to emulate Python's construct: if __name__ == '__main__': pass Running from the command line works: ismaelvc@toybox ~/T/C/C/julia_code (master)> julia Mat

[julia-users] Re: Some generic quiestions.

2014-02-10 Thread Ismael VC
Hey I'm also getting used to git/github, is this a good bug report, can't I reference the file Matematicas.jl or commit hash in better way when opening issues? https://github.com/Ismael-VC/Club_TESCI/issues/1 Wrapping the import/using/require/include code inside another enclosing moduleonly wo

[julia-users] traits and generic programming in julia

2014-02-10 Thread Menyoung Lee
Hi, I'm a new scientific user and Julia is an exciting prospect. I read through the manual on types and methods, but got confused about how I can define a new abstract type (= trait according to some of the literature) abstract AbsType and write methods for it such as function func2(x::AbsTy

Re: [julia-users] HttpServer images

2014-02-10 Thread Marcus Appelros
Yeah found a whole file of MIME types: https://github.com/JuliaLang/HttpCommon.jl/blob/master/src/mimetypes.jl type Response status::Int headers::Headers data::HttpData finished::Bool end Response(s::Int, h::Headers, d::HttpData) = Response(s, h, d, false) Response(s::Int, h::Hea