Re: [julia-users] help with @generated function call please?

2016-10-15 Thread Florian Oswald
Yes I think you are right about that. Using a comprehension is just as good for my case. But part of me would like to just finally understand that part of Julia! Ok will have to wait for the next opportunity. :-) Thanks anyway. Florian On Saturday, 15 October 2016, Erik Schnetter

Re: [julia-users] help with @generated function call please?

2016-10-15 Thread Erik Schnetter
A generated function is only useful if you perform a non-trivial calculation based on the argument types. You don't do that here, so I wonder whether simply using the Cartesian indexing macros by themselves would be sufficient. Note also that you don't need to write `$N` in your code; using `N`

[julia-users] help with @generated function call please?

2016-10-14 Thread Florian Oswald
hi all, I want to evaluate a function at each index of an array. There is a N dimensional function, and I want to map it onto an N-dimensional array: fpoly(x::Array{Real,5}) = x[1] + x[2]^2 + x[3] + x[4]^2 + x[5] want to do a = rand(2,2,2,2,2); b = similar(a) for i1 in indices(a,1) for i2

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
That makes sense. I should have seen that. Thank you!

Re: [julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Yichao Yu
On Fri, Oct 7, 2016 at 4:05 PM, Chris Stook wrote: > Calling objects of type T is only valid if N arguments are provided. What > is the correct syntax for this? > > immutable T{N} > t :: NTuple{N,Any} > end > > (x::T)(args...) = error("wrong number of arguments")

[julia-users] help with syntax for Function-like objects for parametric types

2016-10-07 Thread Chris Stook
Calling objects of type T is only valid if N arguments are provided. What is the correct syntax for this? immutable T{N} t :: NTuple{N,Any} end (x::T)(args...) = error("wrong number of arguments") function {N}(x::T{N})(args::Varargs{Any,N}) print("do stuff here") end syntax: invalid

[julia-users] help understanding different ways of wrapping functions

2016-09-27 Thread K leo
I tested a few different ways of wrapping functions. It looks different ways of wrapping has slightly different costs. But the most confusing to me is that putting everything inline looks much faster than wrapping things up. I would understand this in other languages, but I thought Julia

[julia-users] help understanding memory allocation results

2016-09-26 Thread K leo
I did a memory allocation analysis with "julia --track-allocation=user", and got a strange result about a statement (below). Can anyone help me understand what that means? The function is pretty short and is called from within a loop with "i". - function M_CPB(i::Int, strsys::StrSys;

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-09-21 Thread Luke Stagner
You have no idea how happy this make me. I was able to get it running fairly quickly on linux. This is what I did ``` shell> export JL_IDL_TYPE=CALLABLE julia> push!(Libdl.DL_LOAD_PATH, "/path/to/idl/idl84/bin/bin.linux.x86_64") 1-element Array{String,1}:

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-09-21 Thread Bob Nnamtrop
Yes, sorry for the delay, I have uploaded some code to github. See: https://github.com/BobPortmann/IDLCall.jl.git. I have added some notes there to get you started. No doubt they are too short and you may have to look into the code to get things working. I do want to polish this up, so please

[julia-users] Help: Printing method in julia

2016-09-21 Thread Weicheng Zhu
Hi all, I have a few simple questions to ask. 1) What function is invoked when I type x in the following example? I tried print(x) and show(x), both don't seem to print x in this way. julia> x = rand(5,2); julia> x 5×2 Array{Float64,2}: 0.923288 0.0157897 0.439387 0.50823

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-09-21 Thread Luke Stagner
Are you still planning on releasing your IDL wrapper? I would still very much like to use it. -Luke On Friday, August 5, 2016 at 10:19:16 AM UTC-7, Bob Nnamtrop wrote: > > I have written a (pretty) complete wrapper for IDL (years ago actually), > but have not uploaded to github. I'll try to do

[julia-users] Help on building Julia with Intel MKL on Windows?

2016-09-11 Thread Zhong Pan
Anybody knows how to build Julia with Intel MKL on Windows? I found the article below but it is for Linux. https://software.intel.com/en-us/articles/julia-with-intel-mkl-for-improved-performance Thanks!

[julia-users] Help: how to improve the function performance

2016-09-07 Thread Weicheng Zhu
Hi there, I write a function to calculate the distance for each row of a two dimensional array and I compared it with the `pairwise` function in the Distance module. Does anyone can help me to find out the reason why my function is slower than the pairwise function? I only keep the triangle

[julia-users] [HELP] Doubts in Julia Language with Strings.. I've condensed my doubts into one Simple Program

2016-08-24 Thread Rishabh Raghunath
*Hello Julia Users !!..* I have asked this question before in the forum but am still a bit unclear on how to do the below.. I have condensed a few of my doubts in the question below. Being from a C background where strings are just character Arrays, manipulating individual characters using

[julia-users] Help with a Julia Program.. Many doubts condensed in one question.

2016-08-24 Thread Rishabh Raghunath
*Hello Julia Users !!..* I have asked this question before in the forum but am still a bit unclear on how to do the below.. I have condensed a few of my doubts in the question below. Being from a C background where strings are nothing bot character Arrays, manipulating individual characters

[julia-users] Help wanted! Make sure the new testset PR *doesn't* break everything horribly!

2016-08-23 Thread Katie H
Hi everyone, I've been working on improvements to Base Julia's test system, so that we can use testsets and have pretty printing and parallelism and all kinds of wonderful things that start with p. As you can see, the base tests pass! However, I know lots of package maintainers use testsets. I

[julia-users] help with deepcopy_internal

2016-08-23 Thread Chris Stook
I created this simple example to try to understand deepcopy_internal. type SelfReferential obj::SelfReferential SelfReferential() = (x = new(); x.obj = x) end function deepcopy_internal(sr::SelfReferential, oidd::ObjectIdDict) # if haskey(oidd,sr) #return oidd[sr] # else new_obj =

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
I created [1] to make specific note of this issue. Bill. [1] https://github.com/JuliaLang/julia/issues/18084

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
On Wednesday, 17 August 2016 20:22:56 UTC+2, Kristoffer Carlsson wrote: > > See pr 8134. I dont think you have any worse cache locality than with your > original tuple. You are right. I just have more memory usage. The heap will in fact have better cache locality. I'll just have exp

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
See pr 8134. I dont think you have any worse cache locality than with your original tuple.

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
I basically extended the heap_s struct to also include the exp field. This uses twice the memory, but gets rid of the massive number of heap allocations. Unfortunately I lose the cache efficiency of the original solution, so it's still about 20-50% slower than it should be. It'll have to do for

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
Just make a new type instead of the tuple and directly set the fields of it?

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
Wowsers! That's one hell of a serious issue. On 17 August 2016 at 18:33, Kristoffer Carlsson wrote: > Immutables and tuples that contain references to heap allocated objects > are currently themselves allocated on the heap. There is an issue about it. > >

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
Immutables and tuples that contain references to heap allocated objects are currently themselves allocated on the heap. There is an issue about it.

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
Wait, I understand why heap_s would be allocated on the heap. But why would a tuple involving a heap_s need to be allocated on the heap assuming the heap_s already exists? The tuple should just have the NTuple and one pointer (to a heap_s) at the machine level. This is clearly the problem, but I

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
Unless heap_s is a bitstype then the tuple will be allocated on the heap. But you are saying it is getting allocated twice?

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
It's very, very hard to produce working code that illustrates a problem when working on a very large system like ours. There's nearly 1000 lines of code just to set up the data! If you want to take a look, it's here, though I'm not sure how enlightening it will be:

[julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
As always, it is very helpful if there is some code that is actually runnable in the post that contains the problem. It is easier to run Julia code in Julia than in your brain :)

Re: [julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread 'Bill Hart' via julia-users
N = 1 in the case I'm profiling/timing. It's typically < 10 in applications, usually much less. Bil. On 17 August 2016 at 17:50, Kristoffer Carlsson wrote: > What is N typically?

[julia-users] Help needed with excessive memory allocation for Tuples

2016-08-17 Thread Kristoffer Carlsson
What is N typically?

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
Yes, absolutely, thanks so much! marți, 16 august 2016, 10:58:39 UTC+2, Mauro a scris: > > On Tue, 2016-08-16 at 10:29, Adrian Salceanu > wrote: > > Oh, I see - I thought "global" meant "not explicitly enclosed in a > module". > > But then yes, I get your point since

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Mauro
On Tue, 2016-08-16 at 10:29, Adrian Salceanu wrote: > Oh, I see - I thought "global" meant "not explicitly enclosed in a module". > But then yes, I get your point since that's automatically included in > "Main" which is just a module like any other. Maybe have another

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
Oh, I see - I thought "global" meant "not explicitly enclosed in a module". But then yes, I get your point since that's automatically included in "Main" which is just a module like any other. marți, 16 august 2016, 10:18:57 UTC+2, Mauro a scris: > > On Tue, 2016-08-16 at 09:00, Adrian Salceanu

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Mauro
On Tue, 2016-08-16 at 09:00, Adrian Salceanu wrote: > Yichao, many thanks for taking so much time to help me through this, that's > very kind. > >> It has nothing to do with "compiling" a module. I'm just saying it's not > the right API. > I understand your point now,

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-16 Thread Adrian Salceanu
Yichao, many thanks for taking so much time to help me through this, that's very kind. > It has nothing to do with "compiling" a module. I'm just saying it's not the right API. I understand your point now, it makes sense. would that still be in the global scope? > > Yes. Bummer! Then it

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Yichao Yu
On Tue, Aug 16, 2016 at 4:37 AM, Adrian Salceanu wrote: > > I was thinking about having the module itself defined in the controller > for example (or some other standalone .jl source file), completely outside > the templating engine itself, and then referencing the

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Ah, of course! I don't know why I missed that, I was stuck looking for something that would be line aware, in the line of quote blocks. luni, 15 august 2016, 23:02:58 UTC+2, Stefan Karpinski a scris: > > On Mon, Aug 15, 2016 at 4:53 PM, Adrian Salceanu > wrote: > >> >>

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
> Not sure what do you mean by `mixin`. all of `include_string`, `eval` and `include` works in the scope of current module, none of them will see anything in the scope of the function that calls them. Right. So if I execute "eval()" and "include_string()" within a module other than Main

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Stefan Karpinski
On Mon, Aug 15, 2016 at 4:53 PM, Adrian Salceanu wrote: > > > parse() supports this by allowing you to parse expression by expression > within the string > > I searched the docs (on the website and using Dash) but I could not find > that - is it undocumented or

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
> And you can and should know that after the parsing. Say there's this line of template code: <% if lang == "en" %> How would I know that "lang" is the name of one of the vars, without rolling my own julia-like parser? > I highly doubt you want to allow embedding arbitrary julia code

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Thank you very much Yichao I'm afraid then that I don't fully understand the consequences of all the steps in this workflow. Let me see if I get things right (sorry if some of my questions are dumb or seem obvious and thanks for your patience). > Unless the user only do that once at compile

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Yichao Yu
> This means that: > > a. I do not know the variables beforehand, they are user inputed as part > of the template. > And you can and should know that after the parsing. > > b. also, it's not an issue of "This is indeed one of the strengths of > Julia, and it requires neither string

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Yichao Yu
On Sun, Aug 14, 2016 at 11:33 PM, Adrian Salceanu wrote: > Huhm... so re > > > defining globals > > According to the API docs: > > *include_string**(code::AbstractString**[**, filename**]**)* > > Like include, except reads code from the given string rather than from a

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Yichao Yu
On Sun, Aug 14, 2016 at 11:13 PM, Adrian Salceanu wrote: > Thanks > > Maybe I wasn't clear enough - otherwise, can you please elaborate, I'm > definitely still poking around, any clarifications would be highly > appreciated. > > > creating a new module > -> the module

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Here is the code for the examples: https://github.com/essenciary/ejl/blob/master/2.jl luni, 15 august 2016, 10:20:18 UTC+2, Adrian Salceanu a scris: > > Erik, thank you very much. > > In a few lines, here is the use case (for a standard MVC web app): > > 1. the user defines some template code

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Chris, thans very much for the suggestion. I checked it, but there's the issue of not knowing the number and the names of the variables beforehand. Per the docs: d = Dict{Symbol,Any}(:a=>5.0,:b=>2,:c=>"Hi!") @materialize a, b, c = d a == 5.0 #true b == 2 #true c == "Hi!" #true This line

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-15 Thread Adrian Salceanu
Erik, thank you very much. In a few lines, here is the use case (for a standard MVC web app): 1. the user defines some template code which is stored in a view file. Think HTML with embedded Julia code for interpolating variables, if/else, loops, etc. A very basic example would look like

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Chris Rackauckas
Any issues with @materialize? It seems like it does exactly what you're asking for... On Sunday, August 14, 2016 at 3:13:37 AM UTC-7, Adrian Salceanu wrote: > > Variables contained in a module and then parsed Julia code included within > a function using include_string(). > > Any obvious

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Erik Schnetter
Adrian Can you give more details for how the variables would be used? If the variables are declared in a function, then there must be code that uses them; how would this code know which variables exist? Is there e.g. a globally known list of variables that will be provided? Or will the variables

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Huhm... so re > defining globals According to the API docs: *include_string**(code::AbstractString**[**, filename**]**)* Like include, except reads code from the given string rather than from a file. Since there is no file path involved, no path processing or fetching from node 1 is done.

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Thanks Maybe I wasn't clear enough - otherwise, can you please elaborate, I'm definitely still poking around, any clarifications would be highly appreciated. > creating a new module -> the module is available at compile time (the users of the templating system will place the vars in there,

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Yichao Yu
On Sun, Aug 14, 2016 at 6:13 PM, Adrian Salceanu wrote: > Variables contained in a module and then parsed Julia code included within > a function using include_string(). > > Any obvious performance issues with this approach? > Everything about it? Literally every

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Variables contained in a module and then parsed Julia code included within a function using include_string(). Any obvious performance issues with this approach? duminică, 14 august 2016, 12:11:06 UTC+2, Adrian Salceanu a scris: > > OK, actually, that's not nearly half as bad. Variables

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
OK, actually, that's not nearly half as bad. Variables contained in a module include("src/Ejl_str.jl") using Ejl module _ couñtry = "España" lang = "en" end function render_template() tpl_data = ejl""" <% if _.lang == "en" :> Hello from me, ... <: else :> Hola <: end %> %= _.couñtry

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Uh, that's nice! Thanks, I'll give it a try. sâmbătă, 13 august 2016, 18:42:04 UTC+2, Daniel O'Malley a scris: > > The populateexpression function from MetaProgTools might be helpful. For > example, you could do something like: > > julia> q = :(x + y + 3) > :(x + y + 3) > > julia>

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-14 Thread Adrian Salceanu
Thanks Yes, I've thought about a few ways to mitigate some of these issues: 1. in the app I can setup a module (like Render) and evaluate into this module exclusively. Hence, another approach might be to have some helper methods that setup the variables in the module and then eval the

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Daniel O'Malley
The populateexpression function from MetaProgTools might be helpful. For example, you could do something like: julia> q = :(x + y + 3) :(x + y + 3) julia> eval(MetaProgTools.populateexpression(q, Dict("x"=>1, "y"=>2))) 6 On Saturday, August 13, 2016 at 3:07:38 AM UTC-6, Adrian Salceanu wrote:

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On Sat, Aug 13, 2016 at 8:06 PM, Adrian Salceanu wrote: > That's pretty difficult as my goal is to use embedded Julia as the > templating language. Similar to Ruby's ERB, ex: http://www.stuartellis.eu/ > articles/erb/ > > So say in the template I have something like >

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
That's pretty difficult as my goal is to use embedded Julia as the templating language. Similar to Ruby's ERB, ex: http://www.stuartellis.eu/articles/erb/ So say in the template I have something like <% if foo == "bar" %> Bar <% else %> Baz <% end %> The idea is to use Julia itself to parse

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On Sat, Aug 13, 2016 at 7:13 PM, Adrian Salceanu wrote: > Thanks > > It's for a templating engine. The user creates the document (a string) > which contains interpolated variables placeholders and markup. When the > template is rendered, the placeholders must be

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Thanks It's for a templating engine. The user creates the document (a string) which contains interpolated variables placeholders and markup. When the template is rendered, the placeholders must be replaced with the corresponding values from the dict. The lines in the template are eval-ed and

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On 8/13/16, Adrian Salceanu wrote: > Thanks, but I don't know what the dict contains, it is user defined. Your code above seems to suggest that you have some known keys and unknown keys. In which case it makes sense to pop the known keys manually and possibly handle

Re: [julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Yichao Yu
On 8/13/16, Adrian Salceanu wrote: > Hi, > > This seems to be a recurring question per my googlings, but still I could > not find a satisfactory answer. > > I'm looking for a generic way of doing this: > > render_template(template_content, Dict(:greeting => "Hello",

[julia-users] Help please: how to expand dictionary into (local ?) variables with the same name as the keys and the corresponding values

2016-08-13 Thread Adrian Salceanu
Hi, This seems to be a recurring question per my googlings, but still I could not find a satisfactory answer. I'm looking for a generic way of doing this: render_template(template_content, Dict(:greeting => "Hello", :greeted => "World", :other => Dict("foo" => 1))) where function

[julia-users] [HELP] I am a beginner and I need some guidance in writing Optimised Code in Julia rather than writing Julia Programs in C Style.

2016-08-09 Thread Kristoffer Carlsson
A few things. Instead of "a=push!(a,(2*((4*g*g)-g)))" you can just do push!(a, ...) and that will modify the existing a so that is has the last element appended. There is no need to assign the result to a again. I think the way you read a user input and then use parse to get the Int for it is

[julia-users] [HELP] I am a beginner and I need some guidance in writing Optimised Code in Julia rather than writing Julia Programs in C Style.

2016-08-08 Thread Rishabh Raghunath
Hello Guys.. I am a beginner in Julia Programming Language !! and I absolutely love it !! If you can .. Can you evaluate my code and point out the things I could implement better.. Being good at C.. I feel I am bringing the C style into my Julia Program. I want it to be optimised for Julia

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-08-05 Thread Luke Stagner
This is awesome. I would love to take a look at what you did and how you did it. Once 0.5 is released I think Julia would be in a mature enough state to promote it to the IDL community. Unless I am mistaken I do not think there are many major breaking changes that are planned. -Luke On

Re: [julia-users] help with ccall- pointers-to-pointers

2016-08-05 Thread vavasis
Dear Fengyang and Yichao, I think my code is fully operational at this point. Thanks for the help! Cholmod/sqpr have their own memory management routines, so I used cholmod_l_free to free E. And the reason that my wrapper did not find the permutation inside of return variable E is because E

Re: [julia-users] Help creating an IDL wrapper using Clang.jl

2016-08-05 Thread Bob Nnamtrop
I have written a (pretty) complete wrapper for IDL (years ago actually), but have not uploaded to github. I'll try to do that this weekend (and put an update here). I wrote it for my own use and have been waiting for Julia to mature to promote it to the IDL community. I originally wrote it for

Re: [julia-users] help with ccall- pointers-to-pointers

2016-08-04 Thread Fengyang Wang
Generally, pointers returned from ccalls should be freed with the free function from the same library. From the documentation of Libc.free: Call free from the C standard library. Only use this on memory obtained from > malloc, not on pointers retrieved from other C libraries. Ptr objects >

Re: [julia-users] help with ccall- pointers-to-pointers

2016-08-04 Thread vavasis
Yichao, That's great, thanks very much! It's almost working now (revised code below). I still have two issues, which are perhaps best answered by someone familiar with SPQR. First, although the comments in the SPQR package say that E is "column permutation", in fact I am getting back a

Re: [julia-users] help with ccall- pointers-to-pointers

2016-08-04 Thread Yichao Yu
On Fri, Aug 5, 2016 at 10:47 AM, wrote: > In an earlier post, I asked how to use spqr (C language subroutines that > are part of the Julia base) to obtain the R factor of a sparse QR > factorization. Based on the lack of response, I assume that this has not > been tried

[julia-users] help with ccall- pointers-to-pointers

2016-08-04 Thread vavasis
In an earlier post, I asked how to use spqr (C language subroutines that are part of the Julia base) to obtain the R factor of a sparse QR factorization. Based on the lack of response, I assume that this has not been tried before. So now I'm requesting help on how to use ccall, which I have

[julia-users] Help creating an IDL wrapper using Clang.jl

2016-08-04 Thread Luke Stagner
Its possible to call IDL from C code (Callable IDL) so I figured I could do the same from Julia. I have been trying to use Clang.jl to automatically create the wrapper but I am running into some issues. This project is a bit above my

[julia-users] Help with `promote_op` in v0.5

2016-07-29 Thread j verzani
The test for the Polynomials package are now failing in v0.5. Before ``` p1 = Poly([1, 2]) p = [p, p] # 2-element Array{Polynomials.Poly{Float64},1}: p + 3 # 2-element Array{Polynomials.Poly{Float64},1}: ``` But now, `p+3` is an `Array{Any,1}`. I think the solution is related to how

[julia-users] help with integrating websockets and protobuf

2016-07-25 Thread Jon Norberg
Anyone have any experiences with protobuf/web Sockets?

[julia-users] help with integrating websockets and protobuf

2016-07-22 Thread Jon Norberg
just to check that there is no problem in the formats, the following does send a ljulia-protobuf formatted message to the html-client but somewhat indirectly msg = read(client) iob = PipeBuffer(); write(iob,msg) test = readproto(iob,com())

[julia-users] help with integrating websockets and protobuf

2016-07-22 Thread Jon Norberg
Dear julia community. I can't figure out whats wrong here. I have a web socket implementation that works just fine without using protobuf on the julsa/websocket side (in fact, the html-client does send a protobuf array which just gets sent back without unpacking and packing on the julia web

Re: [julia-users] Help Julia win a performance comparison!

2016-07-21 Thread Tom Breloff
I had the same thought. Could just make a new AbstractArray which keeps a larger array and tracks the current usage. I bet it's 10 lines of code to make it generic. On Thursday, July 21, 2016, Christoph Ortner wrote: > > feels like one may want a little auxiliary

[julia-users] Help Julia win a performance comparison!

2016-07-20 Thread Chris Rackauckas
Hey, there's a performance comparison on Code Review . I gave it a go and with help from @TotalVerb via Gitter, I got Julia really close to being

[julia-users] Help catting

2016-07-17 Thread J Luis
Hi, need help reshaping an output from C that comes out in N (columns) vectors into a 2-D matrix julia> C = pointer_to_array(DS.data, 2) 2-element Array{Ptr{Float64},1}: Ptr{Float64} @0x1bf17360 Ptr{Float64} @0x1bf17970 and julia> pointer_to_array(C[1], DS.n_rows) 186-element

Re: [julia-users] Help on functions in a package

2016-07-15 Thread Yichao Yu
On Fri, Jul 15, 2016 at 1:18 PM, Phil_n wrote: > How do I invoke help on a certain function in a package? That is I would > like an explanatory text of how to use a certain function in a package. > > For example: I would like to know how to use the function

[julia-users] Help on functions in a package

2016-07-15 Thread Phil_n
How do I invoke help on a certain function in a package? That is I would like an explanatory text of how to use a certain function in a package. For example: I would like to know how to use the function rotationmatrix in package Quaternions

[julia-users] Help on channels

2016-07-05 Thread Jon Norberg
A=RemoteRef(()->Channel{Int64}(10), 1) Works but Put!(A,1,1) gives LoadError: MethodError: `put!` has no method matching put!(::Channel{Int64}, ::Int64, ::Int64) Closest candidates are: put!(::Channel{T}, ::Any) put!(!Matched::Base.RemoteValue, ::Any...)

[julia-users] Help with a macro

2016-06-21 Thread Kristoffer Carlsson
Using @eval in a macro is generally the wrong thing to do. A macro should simply transform an expression to another expression. If you give an example function body and what you want the macro to transform it to it would be easier to visualize what you want to do.

[julia-users] Help with a macro

2016-06-21 Thread Mosè Giordano
Hi all, in Measurements.jl , an uncertainty propagation library, I added a macro to propagate uncertainty for an arbitrary function. Here you can see some examples of use of the macro:

[julia-users] Help creating user-defined types and constructors

2016-06-04 Thread Christopher Fisher
I was wondering if someone would be willing to help me with creating user-defined types. I've been using Julia for about two years now but I am new to the idea of creating custom types. I'm trying to create a population of agents/individuals in a simple epidemiological simulation. I would like

[julia-users] Help! Problem with repeated calling of a function that creates SharedArray.

2016-04-30 Thread Richard Tsai
Can someone tell me what's wrong with the following code. - When I run it, either the last for loop would just hang there or I would get an error message such as run=12 > 100 > LoadError: SystemError: shm_open() failed for > /jl024406KYMveTGtI7BVrX6waGws: Too many open files > while

[julia-users] Help with parallel computing for optimization.

2016-04-11 Thread Nsep
Hello World, I am relatively new with Julia. I wrote an optimization model (MIP) that I need to run many, many time for sensitivity analysis. I am working on a cluster that uses SLURM. I wrote my model as a Julia Module. Basically, the process that I want to do is to have a file with all the

[julia-users] Help with MXNet AssertionError: get_batch_size(opts.eval_data) == batch_size

2016-04-11 Thread kleinsplash
$ julia G3DB_cnn.jl (128,128,1,800) (128,128,1,200) INFO: Start training on [GPU0] INFO: Initializing parameters... INFO: Creating KVStore... INFO: Start training... INFO: == Epoch 001 == INFO: ## Training summary INFO: accuracy = 0.5638 INFO: time = 1.9078 seconds

[julia-users] Help with convoluted types and Vararg

2016-04-05 Thread Seth
Hi all, I have the following on 0.4.6-pre+18: z = [Pair((+,1,5,7), 3), Pair((-,6,5,3,5,8), 1)] type Foo x::Array{Pair{Tuple{Function, Vararg{Int}}, Int}} end and I'm getting julia> Foo(z) ERROR: MethodError: `convert` has no method matching

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread Tim Holy
It's a common and useful pattern to have different constructors for the same type. If that's all you need, then yes, julia has what you want. I would guess that most people wouldn't call this "inheritance," though. Like several other modern languages, Julia may be moving more in the direction

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread Tomas Lycken
I've recently experimented with a macro that solves a related problem (although for different reasons). Basically it allows you to solve the same problems you could solve using polymorphism, but by easing the burden of composition. It might be helpful here too.

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread Mauro
On Wed, 2016-03-23 at 16:48, kunal singh wrote: > *the code works!!* > I know that number== basic > But the adding methods to number makes it ,from execution point of view , > an inherited class But those methods can be called through basic as well as number and basic are

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread kunal singh
And also @Mauro, Aren't the methods here ,that is, the constructors linked to their respective types On Wednesday, March 23, 2016 at 9:24:01 PM UTC+5:30, kunal singh wrote: > > > > On Wednesday, March 23, 2016 at 9:18:06 PM UTC+5:30, kunal singh wrote: >> >> *the code works!!* >> I know that

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread kunal singh
On Wednesday, March 23, 2016 at 9:18:06 PM UTC+5:30, kunal singh wrote: > > *the code works!!* > I know that number== basic > But the adding methods to number makes it ,from execution point of view , > an inherited class > > On Wednesday, March 23, 2016 at 7:25:16 PM UTC+5:30, Stefan Karpinski

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread kunal singh
Is there any other method to inherit methods of a composite type ? On Wednesday, March 23, 2016 at 9:18:06 PM UTC+5:30, kunal singh wrote: > > *the code works!!* > I know that number== basic > But the adding methods to number makes it ,from execution point of view , > an inherited class > > On

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread kunal singh
*the code works!!* I know that number== basic But the adding methods to number makes it ,from execution point of view , an inherited class On Wednesday, March 23, 2016 at 7:25:16 PM UTC+5:30, Stefan Karpinski wrote: > > Doing > > typealias B Union{A} > > makes B the same as A. Is this code

Re: [julia-users] Help needed regarding INERITANCE

2016-03-23 Thread Mauro
> I wrote a sample code which explains how inheritance can be done in Julia > Let me explain what the code is about > There is a Base Class : basic > it contains two functions A and B > > Then there is number class which inherits from basic > and number has its own Function C > So number has in

  1   2   3   4   5   >