[julia-users] Re: Dictionary Key Type Question

2014-02-08 Thread Steven G. Johnson
On Friday, February 7, 2014 8:39:41 PM UTC-5, Michael Schnall-Levin wrote: similarly if i do: d = Dict{Int32, Int32}() d[convert(Int32, 3)] = 5 get(d, 3, 0) ---output 0 This seems like a bug to me; if you have Dict{K,V}, Julia should automatically convert the key value to K in

[julia-users] Continuous data flow similar to Simulink/LabView

2014-02-08 Thread Rick Graham
Does Julia have or plan to include the ability to process a continuous stream of data (think DSP operations on data from a device/port/pipe/etc.). Are there possibilities for a graphical GUI with connected functional nodes, etc.?

[julia-users] Windows batch file improvement

2014-02-08 Thread Laszlo Hars
When I run Julia programs (*.jl files) via the supplied julia.bat, any error message pops up in a command window, which gets immediately closed, so there is no chance I can read it. An extra line in the batch file solves the program: if errorlevel 1 pause That is, the julia.bat could look like

Re: [julia-users] Continuous data flow similar to Simulink/LabView

2014-02-08 Thread Tim Holy
This kind of thing seems to be coming up almost daily on the mailing list... I think everything is in place to build this kind of functionality. As far as interacting with the device goes, you can always continuously poll the device. But presumably your device supports DMA, and presumably you'd

[julia-users] Returning julia objects with ccall

2014-02-08 Thread Carlos Becker
Hello everyone, I just got started with Julia, and I wanted to try to wrap a C/C++ library to Julia to check whether it would work out for my purposes. I tried out many ways of passing arrays and other objects from C back to Julia. So far it seems that it takes a lot of extra code if I want

Re: [julia-users] Re: Dictionary Key Type Question

2014-02-08 Thread Mauro
According to the help, usual Dicts use the `isequal` function. There is also the ObjectIdDict which uses the === (I think): julia st1 = asdf asdf julia st2 = asdf asdf julia stt = st1 asdf julia st1==st2, st1===st2, isequal(st1, st2) (true,false,true) julia st1==stt, st1===stt, isequal(st1,

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

2014-02-08 Thread Jeff Bezanson
This is a totally reasonable thing to do. You just have to be careful that objects are rooted across other object allocations; passing julia objects around as Ptr{Void} hides them from the GC. If Any is used as the return type of the ccall, the result will be treated as a julia reference and you

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

2014-02-08 Thread Carlos Becker
Hi Jeff, thanks for the quick reply. If Any is used as the return type of the ccall, the result will be treated as a julia reference and you can skip unsafe_pointer_to_objref. If returning Any, would the GC take care of it? A variant of this is to allocate the array in julia, and pass

[julia-users] Re: Packages Moved to JuliaStats

2014-02-08 Thread Dahua Lin
Thanks, John. I would also want to note that MLBase.jl is going to be moved to JuliaStats too, which is going to provide basic support of machine learning. All these moves are for the purpose of coordinating the efforts of developing machine learning tools (see

[julia-users] Re: Multiple plots in one (pdf) file?

2014-02-08 Thread Peter Simon
I wrote the (admittedly primitive) attached savefigppt() function to save multiple PyPlot images to a Powerpoint-compatible .pptx file (works on both Windows and Linux). When adding an image to a file, if the file already exists then the image will be added to a new page appended at the end.

[julia-users] Turning off scientific notation?

2014-02-08 Thread Randy Zwitch
I'm trying to use the time() function within string interpolation, but it's not producing the desired result: julia time() 1.391893797590157e9 julia $(time()) 1.391893808023869e9 How do I get the float representation?

[julia-users] Re: Dictionary Key Type Question

2014-02-08 Thread Felix
I don't know if is a bug because your created a Dict from Integer keys to Integer values and inserted a value 1 with key 3 of type Int64, then another with 3 of type Int32 value 5 if your say julia d[3] 1 julia d[int32(3)] 5 maybe Dict has to do more check to see if the values for keys are

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

2014-02-08 Thread Carlos Becker
To formulate my question a bit more specifically (about the last part of my email) Suppose I want to call jl_new_struct() to instantiate a 'type', I need to provide the type, so I guess I have to pass the right jl_datatype_t *, which might be found with jl_get_global(). Now, jl_get_global()

[julia-users] Re: ARPACKException(-3)

2014-02-08 Thread Micah McClimans
All right, thank you all very much for the help. On Wednesday, February 5, 2014 5:39:49 PM UTC-5, Micah McClimans wrote: Julia is returning an ARPACKException(-3) with the following line: (pVals,pVecs)=eigs(covariance;nev=sigComponents,sigma=1,which=LM,tol=0.0 ,ritzvec=true,maxiter=1000)

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

2014-02-08 Thread Steven G. Johnson
On Saturday, February 8, 2014 2:21:36 PM UTC-5, Carlos Becker wrote: I tried out many ways of passing arrays and other objects from C back to Julia. So far it seems that it takes a lot of extra code if I want to return, for example, a simple double-array or an array of types (eg structs)

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

2014-02-08 Thread Carlos Becker
Hi Steven, I tried that before, I know it is possible, but if the size is unknown to julia, it must be returned as another variable, which makes coding more difficult if many of such return arrays are needed. That is why I think it would be interesting to see the julia-api side of it, to see

[julia-users] Why does ones(Float32, 10, 1) create a two column vector? (v0.3)

2014-02-08 Thread Jay Kickliter
I just wasted several hours on this. I kept getting errors when I tried to use this to create some filter coefficients: julia b = ones(Float32, filtlen, 1) 10x1 Array{Float32,2}: 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 I finally realized that two in Array{Float32,2}.

Re: [julia-users] Why does ones(Float32, 10, 1) create a two column vector? (v0.3)

2014-02-08 Thread Keno Fischer
It's not a two-column vector, it's a rank-2 tensor i.e. a matrix, the number of arguments to ones gives the number of dimensions, e.g. ones(T,10) will give a 1 dimensional vector of 10 elements, ones(T,10,1) gives a 10x1 matrix, ones(T,10,10) gives a 10x10 matrix, ones(T,10,1,1) gives a 10x1x1 3