[julia-users] Getting variable names of function though the AST?

2016-10-08 Thread Jon Norberg
I should have added that growthV was a function Function growthV(s,f) Return s+f+q End An i am looking to get a list containing s, f and q

[julia-users] Getting variable names of function though the AST?

2016-10-07 Thread Jon Norberg
Hi, I asked in a thread some year ago how to get the parameters and variables used in a function. I got some amazing help from the always very helpful community (Thanks Mauro and more, https://groups.google.com/forum/m/#!search/Jon$20norberg/julia-users/bV4VZxbzZyk). However, as already hinted

Re: [julia-users] Re: Introducing Knet8: beginning deep learning with 100 lines of Julia!

2016-09-21 Thread Jon Norberg
Ah yes of course, sorry :-) and thanks

Re: [julia-users] Re: Introducing Knet8: beginning deep learning with 100 lines of Julia!

2016-09-20 Thread Jon Norberg
I get "LoadError: unknown package Knet" when using Pkg.add("Knet"). I am on 0.5. Very interested in this julia native ML library, thanks for sharing

[julia-users] TensorFlow.jl help

2016-09-15 Thread Jon Norberg
I have very little experience with tensor flow but am hoping to make a simple version of the [Karpathy game](http://cs.stanford.edu/people/karpathy/reinforcejs/waterworld.html) eventually. However, Already at first attempt I get stuck with the kernel dying on me at the last line (julia 0.5 rc

[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

[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] dictchannel.jl example

2016-06-28 Thread Jon Norberg
Strangely though, if I modify the put! function as: function put!(D::DictChannel, k, v) D.d[k] = v notify(D.cond_take) Println(keys(D.d)) D end And run this I get Any[2,3,1] (I added keps in that order), i.e. This works So it seemed the function definition of keys does not

[julia-users] dictchannel.jl example

2016-06-28 Thread Jon Norberg
Strangely makning a function function keys(D::RemoteRef{DictChannel}) keys(D.d) end Gives also error: LoadError: type RemoteRef has no field d Also, for the function put! That does work the function looks like: function put!(D::DictChannel, k, v) D.d[k] = v notify(D.cond_take)

[julia-users] dictchannel.jl example

2016-06-28 Thread Jon Norberg
the dictchannel is in the julia package as an example of Channels https://github.com/JuliaLang/julia/blob/master/examples/dictchannel.jl

[julia-users] dictchannel.jl example

2016-06-28 Thread Jon Norberg
I have great use of the dictchannel.jl example. I wanted to add the method keys to it so I thought that I simply add the function: function keys(D::DictChannel) keys(D.d) end as well s add the function name in the import (I tried also without adding the "keys") : import Base: put!, wait,

Re: [julia-users] async web socket read & write?

2016-06-23 Thread Jon Norberg
Thanks, that works perfectly

[julia-users] async web socket read & write?

2016-06-22 Thread Jon Norberg
I am trying to use a websocket to provide online input to a simulation that runs on another process and update back with a given frequency. The examples I have found all wait for a read event and then immediately write back. I would like to have the ability to have separate read and write loops

[julia-users] tensor flow question

2016-05-18 Thread Jon Norberg
I am following the examples in tensor flow.jl I get all the examples to work nicely. however, when I want to change an activation function to tan or sigmoid I get an error. I suspect I am doing something wrong rather than a problem with the package so I ask here... If I do this: using

Re: [julia-users] Julia text editor on iPad?

2016-05-16 Thread Jon Norberg
I mentioned a few issues on the Jupyter group regarding iPad usability, such as kinetic scrolling and some issues mentioned above. It's working ok, but a few things are still awkward for ipad

[julia-users] recommended graphics packages for multiple curves on a single canvas

2016-02-01 Thread Jon Norberg
using Gadfly L=Layer[] push!(L,layer(x=1:10,y=rand(10),Geom.line)[]) push!(L,layer(x=1:10,y=rand(10),Geom.line)[]) push!(L,layer(x=1:10,y=rand(10),Geom.line)[]) plot(L) Only awkward thing is the empty square bracket for some reason is needed Styling colours using Themes (see gadfly

[julia-users] Remove Gadfly gridlines?

2016-02-01 Thread Jon Norberg
I have searched and tried a few things but cannot remove the background grids in Gadfly. Its probably simple and I am missing something obvious...Any suggestions would be appreciated. layer(x=E,y=wetness(E,10.0), Geom.line,Theme(default_color=a[1], line_width=2pt, grid_color=colorant"white")

Re: [julia-users] how to i get number of arguments of a function?

2016-01-27 Thread Jon Norberg
Wow, thanks a lot, That one I would never had a chance to figure out.

Re: [julia-users] how to i get number of arguments of a function?

2016-01-22 Thread Jon Norberg
Is it also possible to get a list of names of the variables used in a function? e.g. for function f(x,y) k=0.1 return x*y+k end I'd like to get a list ["k","x","y"] My first thought was to make a method f() that returns this list, but if its possible to do this otherwise and more

Re: [julia-users] Re: Linking values in composite type and array?

2016-01-12 Thread Jon Norberg
Many thanks all, I learned a lot again from this great community. Jon

[julia-users] Linking values in composite type and array?

2016-01-12 Thread Jon Norberg
I would like to create a composite type and then also create an array that has values from this type by reference. The behaviour I am looking for is like this: type c a::Float64 b::Float64 end x=c(0.1,0.2) y=c(0.3,0.4) z=[x.a,x.b,y.a,y.b] show(z) [0.1,0.2,0.3,0.4] x.a=0.5 show(z)

[julia-users] Re: make composite type from array of strings?

2015-12-17 Thread Jon Norberg
nstead? On Thursday, December 17, 2015 at 4:28:32 AM UTC+1, Steven G. Johnson wrote: > > On Wednesday, December 16, 2015 at 10:11:20 AM UTC-5, Jon Norberg wrote: >> >> Is it possible to dynamically create a composite type if I have a list of >> strings for the fieldna

[julia-users] Re: make composite type from array of strings?

2015-12-17 Thread Jon Norberg
UTC+1, Steven G. Johnson wrote: > > On Wednesday, December 16, 2015 at 10:11:20 AM UTC-5, Jon Norberg wrote: >> >> Is it possible to dynamically create a composite type if I have a list of >> strings for the fieldnames? > > > While this is possible, you should pr

[julia-users] make composite type from array of strings?

2015-12-16 Thread Jon Norberg
Is it possible to dynamically create a composite type if I have a list of strings for the fieldnames? Is it possible to do this in a function? A=[] push!(A,"X") push!(A,"Y") push!(A,"Z") function defineCompositeType(A) magic? end regards, Jon

Re: [julia-users] make composite type from array of strings?

2015-12-16 Thread Jon Norberg
Thanks for that pointer! Not a computer scientist nor even a very good coder, but I just learned a bit more how julia works internally. I did the xdump and saw the AST (learned what that is too) xdump(:(type T X; Y; Z; end)) gives Expr head: Symbol type args: Array(Any,(3,)) 1: Bool

[julia-users] jupiter server issue on OSX

2015-11-23 Thread Jon Norberg
Maybe not strictly a julia question but maybe someone can help... I just got brand new iMac. I set up everything for jupiter, julia and ijulia. can launch notebook just fine. then I change the jupiter config to serve the notebook via http. On the computer itself i can open using the ip address

[julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-18 Thread Jon Norberg
On a very practical note: I need to to do inline calculations of indexes such as D[i+1-d/2:j-3+q*5] where i,d,j and q are Int64 and d is a multiple of 2 i.e. d/2 should always be integer What is the most efficient way to use an expression as above but to avoid the Warning: indexing with non

[julia-users] Path to module in Atom IDE

2015-11-03 Thread Jon Norberg
I didn't get the above to work, including trying to set path with cd("/Users/raukhur/Documents/Github/Landscapes") However, for some reason the following did work: push!(LOAD_PATH, "/Users/raukhur/Documents/Github/Landscapes") I am fine using this, but if anyone knows what could be the cause

[julia-users] Path to module in Atom IDE

2015-11-02 Thread Jon Norberg
Dear Julia users, I just switched to atom IDE from Juno. I am puzzled by one thing. As in Juno, I first cd(myDir) to move to the directory where I have the files for the module I am developing. In Juno I could then just type using myModule to load it but in Atom I now only get LoadError:

[julia-users] Path to module in Atom IDE

2015-11-02 Thread Jon Norberg
Hm, command palette just says "no match found" and even if I type it nothing changes. Also, 1) if I have a file outside the module folder, can I load it somehow by providing a path? and 2) I quite like hydrogen, does it work the same way to load a module with Julia Client: etc?

Re: [julia-users] A grateful scientist

2015-10-26 Thread Jon Norberg
Utterly seconding that. Amazing community and beautiful language. Thanks all! Jon Norberg

[julia-users] poisson distribution?

2015-09-22 Thread Jon Norberg
I need to get random variables from poisson distributions with different lambda this is the only way I got it to work at the moment BUT its very slow! using Distributions lambda=linspace(0.1,2,100) out=zeros(Int64,100) for i=1:length(lambda) P=Poisson(lambda[i]) out[i]=rand(P) end Anyone

[julia-users] Re: poisson distribution?

2015-09-22 Thread Jon Norberg
Sorry, thought I could delete threadso deleted first postmy bad

[julia-users] Re: poisson distribution?

2015-09-22 Thread Jon Norberg
I think I had a problem in how I used the resulting data that slowed it down. Solved, Thanks

Re: [julia-users] type of single values AND array?

2015-09-21 Thread Jon Norberg
leaftype? On Monday, September 21, 2015 at 2:41:02 PM UTC+2, Yichao Yu wrote: > > On Mon, Sep 21, 2015 at 8:37 AM, Jon Norberg <jon.n...@ecology.su.se > > wrote: > > quick question: How do I define a type most effective so that I can give > it both single va

[julia-users] type of single values AND array?

2015-09-21 Thread Jon Norberg
quick question: How do I define a type most effective so that I can give it both single values, vectors and Arrays as variables? I now have: type x value::Array{Float64} end I can do x(rand(3)) as well as x(rand(3,3)) but not x(0.1) the answer is probably in the forums but I couldn't

Re: [julia-users] type of single values AND array?

2015-09-21 Thread Jon Norberg
not sure what leaf type is? I actually need more fields in the type so I do need it as some field type x value::Array{Float64} otherfield... end

Re: [julia-users] type of single values AND array?

2015-09-21 Thread Jon Norberg
Many thanks! works

Re: [julia-users] type of single values AND array?

2015-09-21 Thread Jon Norberg
type x value::Union{Array{Float64},Float64} end gives me error: type: instantiate_type: expected TypeConstructor, got function

[julia-users] Re: ANN: Immerse package, and more videos on interactive plotting

2015-09-17 Thread Jon Norberg
What does the ANN: in the title mean?

[julia-users] parallel loop with mutable types

2014-06-17 Thread Jon Norberg
I have: type parms r::Float64 K::Float64 end k=Array(parms,20) for i =1:20 k[i]=parms(1.1,2.2) end addprocs(1) nprocs() - 2 @parallel for i=1:20 k[i].r=2.0 end gives error: julia @parallel for i=1:20 k[i].r=2.0 end fatal error on 2: julia ERROR: parms not defined in deserialize at

[julia-users] Re: An appreciation of two contributors among many

2014-06-17 Thread Jon Norberg
I'll second that, great community and some very very helpful people that put a lot of effort into this. Thanks

[julia-users] Re: parallel loop with mutable types

2014-06-17 Thread Jon Norberg
Great, solve first problem, thanks. using DArray though gives julia k=DArray(parms,20) exception on 2: ERROR: no method parms((UnitRange{Int64},)) in anonymous at multi.jl:840 in run_work_thunk at multi.jl:613 in run_work_thunk at multi.jl:622 in anonymous at task.jl:6 ERROR: assertion

[julia-users] Re: parallel loop with mutable types

2014-06-17 Thread Jon Norberg
also this works but does not change values in b @parallel for i=1:20 b[i]=k[i].r*k[i].K end I tried making b=DArray{Float64,1} or b=dones(20,1) but still values in b are not updated do I need to use spawn/fetch or pmap or something like this? Sorry, not fluent in parallel programming yet, but

[julia-users] Help in Array of mutable types

2014-06-16 Thread Jon Norberg
Any hint on how to do this?: type parms r::Vector{Float64} K::Vector{Float64} end r=rand(N)*(0.05-0.001)+0.001 K=rand(N)*100+1 p=Vector{parms} p[1]=parms(r,K) p[2]=parms(r,K) etc I get error: no method setindex!(Type{Array{parms,1}}, parms, Int64) while loading In[36], in

Re: [julia-users] Help in Array of mutable types

2014-06-16 Thread Jon Norberg
:24 PM, Jon Norberg jon.n...@ecology.su.se javascript: wrote: p=Vector{parms}

[julia-users] function parameter packaging revisited

2014-05-30 Thread Jon Norberg
Hi, I am trying to find out the best (fast pretty) way to pass a bunch of parameters to a function. I checked the group posts and compiled some I found const pnames = [:a, :b, :c, :d, :e] macro unpack(ex) Expr(:block, [:($(pnames[i]) = $ex[$i]) for i = 1:length(pnames) ]...) | esc end

[julia-users] packaging parameters for functions revisited

2014-05-30 Thread Jon Norberg
There have been several posts about this, so I tried to compile what I could find to compare speed and pretty coding: http://nbviewer.ipython.org/urls/dl.dropboxusercontent.com/u/38371278/Function%20parms%20passing%20speed%20test.ipynb Best speed is assigning values or variables inside the

Re: [julia-users] packaging parameters for functions revisited

2014-05-30 Thread Jon Norberg
Do you mean using a dict to pack/unpack them? function f(x; args...) ### end where args is a dict?

[julia-users] Re: packaging parameters for functions revisited

2014-05-30 Thread Jon Norberg
I added the keyword version (not sure it is as intended though) function with_keyword(x::Float64=1.1; a::Float64=1.0,b::Float64=2.0,c::Float64=3.0,d::Float64=4.0,e::Float64=5.0) dx= a*b*c*d*e::Float64 end Results now are: (slower due to being on my macbook and couldn't change in the

Re: [julia-users] suggestion of OSX julia/ijulia setup

2014-05-18 Thread Jon Norberg
Many thanks Cameron, I'll try that setup. Did I understand that you use brew to compile julia? On Friday, May 16, 2014 4:21:19 PM UTC+2, Ethan Anderes wrote: +1 for Cameron. I use the same workflow.

[julia-users] suggestion of OSX julia/ijulia setup

2014-05-16 Thread Jon Norberg
Hi all, I have been using julia and ijulia for a while and everything worked fine. over time I get more and more issues, trying to upgrade/reinstall etc and now I can't get it to work at all anymore. As I intend to reinstall osx anyway, I was wondering if you good people have any good setup

[julia-users] Re: inserting javascript driven graphs in ijulia

2014-03-10 Thread Jon Norberg
I Will check That out, thanks

[julia-users] ijulia problem

2014-02-28 Thread Jon Norberg
Hi, anyone know how to help me with getting ijulia to run again (using mavericks osx). I have clean install latest julia. I added a soft link so captiveportal-49-129:~ jon$ which julia /usr/local/bin/julia and typing julia starts julia as expected from anywhere Starting python wight he julia

[julia-users] trouble running julia

2014-02-25 Thread Jon Norberg
I have been running julia for a while lately with ijulia and everything worked nicely. then I started building julia with brew --HEAD to keep up to date with the latest changes, worked well enough. But now something happened and nothing works, test run won't work even though julia installs

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

2014-02-14 Thread Jon Norberg
Amazing, just what I was looking for. However :-/ I did exactly s your read me, installed, and using exactly your example I get: julia y = S*x fatal error on 2: ERROR: ParallelSparseMatMul not defined Worker 2 terminated. ProcessExitedException() is it enough to just write using

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

2014-02-14 Thread Jon Norberg
Thank you On Friday, February 14, 2014 10:19:22 AM UTC+1, Amit Murthy wrote: The `using ParallelSparseMatMul` must be after any `addprocs` statements. On Fri, Feb 14, 2014 at 2:21 PM, Jon Norberg jon.n...@ecology.su.sejavascript: wrote: Amazing, just what I was looking

[julia-users] Re: distance.jl

2014-01-31 Thread Jon Norberg
yes, you are right, just saw the bug with si should be ii and jj will use sub as soon as I get 0.3. Also, I did this little script to sort the xy array before hand. just need ot figure out a smart way to constrain the loops to avoid calculating pairs of block that can't have any distance below

[julia-users] Re: distance.jl

2014-01-30 Thread Jon Norberg
I also noted that pairwise has a hard limit just above 1*1 array size output, at least it crashes julia for me. Is there a way to increase this?

[julia-users] Re: distance.jl

2014-01-30 Thread Jon Norberg
Well, I solved it for now with subsampling: using Distance n=5 a=rand(3,n) #@time r=pairwise(Euclidean(),a,a) subsample=10 m=integer(n/subsample) s=spzeros(n,n) r=zeros(m,m) threshold=0.2 for i=1:subsample-1 ii=(i-1)*m+1 for j=1:subsample-1

[julia-users] quick sparse related question

2014-01-27 Thread Jon Norberg
rand(10).*rand(10,30) but sv=sparsevec([3,5,7],[0.1,0.0,3.2],4) sv.*sprand(4,20,0.1) sprandbool(10, 1, 0.1).*sprand(10,30,0.1) rand(10).*sprand(10,30,0.1) all give Incompatible sizes Is my syntax wrong?

[julia-users] Re: nested type arrays?

2014-01-26 Thread Jon Norberg
Actually, one more question, can I in the creation of a = [ Bother(zeros( Int64,10), zeros(20)) for x in 1:2 ] also put in a vector of custom types e.g. a type of Bother?

[julia-users] Re: nested type arrays?

2014-01-26 Thread Jon Norberg
I mean like: a = [ Bother(zeros(Int64,10), ArrayOf{Bother}) for x in 1:2 ] On Sunday, January 26, 2014 1:28:49 PM UTC+1, Jon Norberg wrote: Actually, one more question, can I in the creation of a = [ Bother(zeros( Int64,10), zeros(20)) for x in 1:2 ] also put in a vector of custom types e.g

Re: [julia-users] nested type arrays?

2014-01-26 Thread Jon Norberg
Performance WILL be an issue later. So dict is a beter choice for that? Can i create them similarly?

Re: [julia-users] Natural language processing in Julia

2014-01-19 Thread Jon Norberg
Thats great, now I am starting to be able to do what I want. Any idea how one can list all properties and methods of a pyobject

Re: [julia-users] Natural language processing in Julia

2014-01-18 Thread Jon Norberg
Great. And how dose one get the text from pyobject to a julia string? Thanks very much

Re: [julia-users] Natural language processing in Julia

2014-01-16 Thread Jon Norberg
Hi Jonathan would you by any chance have some example code to share how you work with NLTK using pycall. I wish there were more julia examples scripts available for browning and learning. Thanks,

[julia-users] Re: nltk with pycall help

2014-01-08 Thread Jon Norberg
Ok, so far so good, but it doesn't accept wn.symsets(car) is there a different way to use the functions? Thanks On Tuesday, January 7, 2014 10:34:37 PM UTC, Steven G. Johnson wrote: @pyimport nltk wn = nltk.corpus[wordnet]

[julia-users] Re: Natural language processing in Julia

2014-01-07 Thread Jon Norberg
Yes, fordon to say it workshops perfectly in Python

[julia-users] Re: Natural language processing in Julia

2014-01-07 Thread Jon Norberg
Autocorrect does not work well.I meant: Forgot to say everything works in Python

[julia-users] Re: Natural language processing in Julia

2014-01-06 Thread Jon Norberg
Could anyone give me a little help in the right direction reg using nltk in julia. I do @pyimport nltk.wordnet as wn but I can's seem to figure out how to interact with e.g wn.synsets(car) thanks for help