Re: [julia-users] Access history entries

2014-08-10 Thread Tobias Knopp
Thanks Stefan. Will have a look at repl.jl then. When I posted the original question I did not really get how the history provider works :-) Am Sonntag, 10. August 2014 04:38:52 UTC+2 schrieb Stefan Karpinski: Unfortunately, this is kind of awkward right now. There's this history provider

[julia-users] Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hello All, I have a C function called mycfunc that takes a callback function pointer (cbfunc) and a void pointer (cbdata) as arguments. mycfunc calls the callback function (cbfunc) passing the void pointer (cbdata) as its argument. I'm trying to figure out how to pass a Julia type as the void

[julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
I forgot to mention that I'm trying to accomplish this with arrays right now. I can pass a Julia array to C and access it there, but I can't figure out how to convert it back to a Julia array from a C void pointer when calling back to Julia from C. On Sunday, August 10, 2014 1:57:18 AM UTC-5,

Re: [julia-users] function like read.clipboard?

2014-08-10 Thread KK Sasa
I have tried this. The clipboard is more basic than Xclipboard. If, for example, I copy a data matrix from excel, julia should have one function to store the same data matrix. Maybe I should write a script on my own all the time?

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Kevin Squire
Hi Gerry, pointer_to_array is probably what you're looking for. See http://julia.readthedocs.org/en/latest/manual/calling-c-and-fortran-code/#accessing-data-through-a-pointer for more information. Cheers, Kevin On Sun, Aug 10, 2014 at 1:17 AM, Gerry Weaver gerben...@gmail.com wrote: I

[julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread paul analyst
How to divide DArray vertically and not horizontally? I need 2 columns with 512 rows ... Paul julia addprocs(2) 2-element Array{Any,1}: 2 3 julia julia remotecall_fetch(2, whos) From worker 2: Base Module From worker 2: Core

Re: [julia-users] function like read.clipboard?

2014-08-10 Thread Kevin Squire
Just as an aside, XClipboard will only work on Linux (and even there, it isn't really that useful, as the X Windows clipboard is pretty limited in the information it passes). Cheers, Kevin On Sun, Aug 10, 2014 at 1:42 AM, KK Sasa genwei...@gmail.com wrote: I have tried this. The clipboard

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hi Kevin, I found the pointer_to_array function, but I'm having some trouble figuring how to call it correctly. I assume it has something to do with the pointer being a void pointer. I've been searching for something that might give me a clue how to do this, but I haven't found anything very

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hi, I think I see whats going on. If the pointer that is being passed to pointer_to_array is void, then you get a array of void pointers. In my case the original array was an array of strings, so... arr = pointer_to_array(cbdata, 4, true) println(bytestring(convert(Ptr{Uint8}, val[1]))) Is

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hi, Nope. False alarm. The scoping thing got me again. I had a val variable declared later in the file. Back to the drawing board ;) Thanks, Gerry On Sunday, August 10, 2014 4:59:00 AM UTC-5, Gerry Weaver wrote: Hi, I think I see whats going on. If the pointer that is being passed to

[julia-users] DArray. What is wrong ? ERROR: no method +(DArray{Float64,2,Array{Float64,2}}, Array{Int64,1}) in sum at tuple.jl:118

2014-08-10 Thread paul analyst
What is wrong? Why dd array is of type Any ? ulia addprocs(4) 4-element Array{Any,1}: 2 3 4 5 julia D=readcsv(v4dane.txt); julia d=distribute(D) 2888x4 DArray{Float64,2,Array{Float64,2}}: julia d 2888x4 DArray{Float64,2,Array{Float64,2}}: 0.0 0.0 0.00.0 0.0 50.0 0.0

Re: [julia-users] simply parallel , please help

2014-08-10 Thread paul analyst
Unfortunately i have some trouble : https://groups.google.com/forum/#!topic/julia-users/oCs_ygdzqJo Paul W dniu środa, 6 sierpnia 2014 16:17:45 UTC+2 użytkownik Stefan Karpinski napisał: You currently have to use a DArray and multiple processes to do anything in parallel. On Wed, Aug 6,

[julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread gael . mcdon
From my understanding, Julia being row major, it makes little sense to split your arrays vertically. If your algorithm makes use of a complete row instead of a complete column, you'd better either implement an alternative row-major array object or (far far more simply), work with the transpose

Re: [julia-users] function like read.clipboard?

2014-08-10 Thread Stefan Karpinski
Sorry, it wasn't clear what kind of functionality you were expecting from your email. If you just want basic text copying the clipboard function is fine. I don't know of any cross-platform advanced copy-and-paste support, but such an effort would certainly be possible and welcomed – and

Re: [julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread Paul Analyst
Thx Gael Is it one way ? I have next proceses optimized for cols ... Paul W dniu 2014-08-10 15:32, gael.mc...@gmail.com pisze: From my understanding, Julia being row major, it makes little sense to split your arrays vertically. If your algorithm makes use of a complete row instead of a

[julia-users] Packages that wrap commercial libraries

2014-08-10 Thread Jay Kickliter
I've been working on a package that wraps the DSP portion of IPP. I'd like to publish it soon, but I'm sure there are plenty consequences I haven't though of yet. Here are two questions I do have: 1. On OS X, the dylibs need to be modified using install_name_tool. Should I copy the ones

Re: [julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread Kevin Squire
Actually, Julia uses column major ordering of arrays. Cheers, Kevin On Sunday, August 10, 2014, Paul Analyst paul.anal...@mail.com wrote: Thx Gael Is it one way ? I have next proceses optimized for cols ... Paul W dniu 2014-08-10 15:32, gael.mc...@gmail.com pisze: From my understanding,

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Kevin Squire
Hi Gerry, I think I see whats going on. If the pointer that is being passed to pointer_to_array is void, then you get a array of void pointers. In my case the original array was an array of strings, so... arr = pointer_to_array(cbdata, 4, true) println(bytestring(convert(Ptr{Uint8},

Re: [julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread Paul Analyst
.. and beter is distributed set by columns.. Is any idea ? Paul W dniu 2014-08-10 17:20, Kevin Squire pisze: Actually, Julia uses column major ordering of arrays. Cheers, Kevin On Sunday, August 10, 2014, Paul Analyst paul.anal...@mail.com mailto:paul.anal...@mail.com wrote: Thx Gael

[julia-users] Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
I am currently using Ubuntu 14.04 and the Julia Nightlies PPA. Recently, I updated to the 0.3.0-rc2 versions and I get the following error when trying to add a package: signal (4): Illegal instruction _mapreduce at ./reduce.jl:168 prune_versions at ./pkg/query.jl:141 prune_dependencies at

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Patrick O'Leary
It appears that the system image is being built with instructions that your processor doesn't support. I believe as a quick fix you can remove the file sys.so though I'm not sure where that is put on the system in the binary package. What processor does this system have? On Sunday, August 10,

[julia-users] Clustering.jl updated

2014-08-10 Thread Dahua Lin
I did some cleanup, reimplement some algorithms, and setup sphinx doc for the Clustering.jl package. Please check it out: http://clusteringjl.readthedocs.org/en/latest/ Best, Dahua

[julia-users] Re: Packages that wrap commercial libraries

2014-08-10 Thread Tony Kelman
There are some examples of this in JuliaOpt - CPLEX.jl, Gurobi.jl, Mosek.jl - have a look at their documentation and how they handle BinDeps on various platforms. I think you'd have to contact Travis and set up a custom VM with the commercial library preloaded, I'm not aware of any examples of

Re: [julia-users] Re: Error using Pkg.add

2014-08-10 Thread Elliot Saba
You can always find the system image by running the following julia command: filter( x - contains(x, sys.), Sys.dllist()) That being said, we try to compile with a conservative set of CPU instructions to avoid this problem. What is your CPU hardware, and are you running inside of a virtual

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
My processor is an AMD Turion X2. I was using the 0.3.0-rc1 version without a problem.

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
Is it safe to remove the sys.so file?

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Tony Kelman
Yes, though removing it will make Julia take a bit longer to start. You can rename it to something if you want to keep a backup copy. On Sunday, August 10, 2014 11:44:15 AM UTC-7, Pablo Zubieta wrote: Is it safe to remove the sys.so file?

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
I renamed the file, but it does not sort out the problem.

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Tony Kelman
Could you post an issue on github, including the output of versioninfo() ? Unless Elliot or Patrick have any better ideas. On Sunday, August 10, 2014 11:57:03 AM UTC-7, Pablo Zubieta wrote: I renamed the file, but it does not sort out the problem.

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
I forgot to mention, I am not running a VM.

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Patrick O'Leary
On Sunday, August 10, 2014 2:01:20 PM UTC-5, Tony Kelman wrote: Could you post an issue on github, including the output of versioninfo() ? Unless Elliot or Patrick have any better ideas. Nope. Turion 64 x2 appears to support up through SSE3, so the conservative settings from the binary

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hi Kevin, It probably would, but in this case the C function takes a void pointer argument and passes that to the Julia callback function. Unfortunately, I can't change the type of the argument. I was hoping that there was a way to convert that void pointer back to an array, but it isn't

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
I can't see an sse3 flag in /proc/cpuinfo. Here it is anyway. processor: 0 vendor_id: AuthenticAMD cpu family: 17 model: 3 model name: AMD Turion(tm) X2 Dual-Core Mobile RM-70 stepping: 1 microcode: 0x232 cpu MHz: 500.000 cache size: 512 KB physical

[julia-users] Dispatch on an abstract composite type with a concrete type field.

2014-08-10 Thread thom lake
Not sure if the title and/or nomenclature are correct, but I need to write a function that dispatches on the specific type inner type while ignoring the outer type. An example is probably worth a thousand words: This is the closest thing I can get that compiles but errors at runtime. abstract

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Patrick O'Leary
On Sunday, August 10, 2014 2:32:03 PM UTC-5, Pablo Zubieta wrote: Should I still open an issue? Yes, please. You should include that output in the issue.

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Stefan Karpinski
This is absolutely possible. You can take any pointer and turn it into an array. The only concern is garbage collection and making sure that Julia knows whether it should free the memory or not. On Aug 10, 2014, at 3:31 PM, Gerry Weaver gerben...@gmail.com wrote: Hi Kevin, It probably

Re: [julia-users] Dispatch on an abstract composite type with a concrete type field.

2014-08-10 Thread Keno Fischer
You need to declare the type parameter on Foo: type Foo1{B:Bar} : Foo{B} bar::B end On Sun, Aug 10, 2014 at 3:37 PM, thom lake thom.l.l...@gmail.com wrote: Not sure if the title and/or nomenclature are correct, but I need to write a function that dispatches on the specific type inner type

[julia-users] Re: Clustering.jl updated

2014-08-10 Thread Iain Dunning
Very nice work! Somewhat related package: if anyone is looking for a package to do some maintenance on rather than starting from scratch then Resampling.jl could be a good one (https://github.com/johnmyleswhite/Resampling.jl) On Sunday, August 10, 2014 12:58:48 PM UTC-4, Dahua Lin wrote: I

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Kevin Squire
More specifically, you can at least do the following: function my_callback(_cbdata::Ptr{Void}) cbdata = reinterpret(Ptr{Ptr{Uint8}}, _cbdata) # equivalent to casting arr = pointer_to_array(cbdata, 4) # arr of length 4 println(bytestring(arr[1])) nothing end cbfunc =

Re: [julia-users] Re: Clustering.jl updated

2014-08-10 Thread John Myles White
I have the impression that some of the code in Resampling.jl is effectively replaced by MLBase.jl. Is that right? — John On Aug 10, 2014, at 1:01 PM, Iain Dunning iaindunn...@gmail.com wrote: Very nice work! Somewhat related package: if anyone is looking for a package to do some

Re: [julia-users] Dispatch on an abstract composite type with a concrete type field.

2014-08-10 Thread thom lake
Awesome. Thanks. On Sunday, August 10, 2014 2:55:05 PM UTC-5, Keno Fischer wrote: You need to declare the type parameter on Foo: type Foo1{B:Bar} : Foo{B} bar::B end On Sun, Aug 10, 2014 at 3:37 PM, thom lake thom@gmail.com javascript: wrote: Not sure if the title and/or

Re: [julia-users] Re: Clustering.jl updated

2014-08-10 Thread Dahua Lin
Yes, they seem partly overlap. It might be a good idea to merge, but I don't have time working on this recently though. If someone can take the lead on this, it would be really appreciated. Dahua On Sunday, August 10, 2014 4:02:43 PM UTC-4, John Myles White wrote: I have the impression

[julia-users] Re: Error using Pkg.add

2014-08-10 Thread Pablo Zubieta
Done! Here is the link to the issue https://github.com/JuliaLang/julia/issues/7946 .

[julia-users] Re: Packages that wrap commercial libraries

2014-08-10 Thread Jay Kickliter
Thanks. I hadn't realized they were using externally managed libraries. From what I've seen so far, they rely on the user to ensure the libraries are locatable. On Sunday, August 10, 2014 11:44:32 AM UTC-6, Tony Kelman wrote: There are some examples of this in JuliaOpt - CPLEX.jl, Gurobi.jl,

Re: [julia-users] How to divide DArray vertically and not horizontally?

2014-08-10 Thread gael . mcdon
Sorry, I obviously meant *column* major (as fortran, not C) which makes horizontal splitting sensible as the data is naturally contiguous in memory. While vertical splitting would require at least two extra copies of the data.

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hi Kevin, I had already tried something similar to what you propose, but neither version works. Hence my confusion. println in either case just prints garbage. It does compile though. I was hoping to be able to hide some of this C callback complexity from the api user. It's beginning to look

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Kevin Squire
Okay, no worries! On Sun, Aug 10, 2014 at 2:38 PM, Gerry Weaver gerben...@gmail.com wrote: Hi Kevin, I had already tried something similar to what you propose, but neither version works. Hence my confusion. println in either case just prints garbage. It does compile though. I was hoping to

[julia-users] rand(x::Int32) doesn't exist, omission or intentional?

2014-08-10 Thread Jeff Waller
Seems like the intention is to cover many possibilities. This would be the typical rand but with type Int32 not Int64 for example. *julia **rand(2)* *2-element Array{Float64,1}:* * 0.690068* * 0.137219* *julia **rand(int32(2))* *ERROR: `rand` has no method matching rand(::Int32)* Is

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Gerry Weaver
Hello All, I felt like I should summarize my experience on this for the benefit of others. I also didn't want to leave a negative impression regarding the Julia language. Julia is by far the best and most interesting high level language that I have ever used. It makes all of the things I love

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Kevin Squire
Thanks Gerry! As a point of reference, I'm working on wrapping ffmpeg/libav right now. One of the things that I do is pass a pointer to a Julia object as a void pointer (using `pointer_to_objref` here: https://github.com/kmsquire/AV.jl/blob/kms/io_refactor/src/avio.jl#L209-L211). This is then

Re: [julia-users] Re: Passing Julia types as C void pointers and converting back to Julia types

2014-08-10 Thread Stefan Karpinski
This C interface stuff is definitely sometimes a bit tricky and awkward here and there. I think we're mostly winning in that the advanced features are doable at all, but improvements are certainly possible and and good ideas would be most welcomed. Glad that you're enjoying the rest of the

[julia-users] calculating limit of a function

2014-08-10 Thread Zahirul ALAM
Is there way of calculating limit of a function? I have tried SymPy Package. But it unfortunately doesnot compute limit for bessel function. r= Sym(r) limit(besselj(1, r)/r, r, 0) returns the following error: `besselj` has no method matching besselj(::Int64, ::Sym) while loading In[27], in