Re: [julia-users] Julia on Raspberry Pi 2

2015-02-16 Thread Viral Shah
This is annoying. I have no idea what to do about the gcc version here. Perhaps file an issue for now. Maybe it needs gcc 4.7 to get through. -viral On Monday, February 16, 2015 at 10:54:14 PM UTC+5:30, Sto Forest wrote: > > Thank you very much for your help viral, > > > *GCC *is set to the lat

Re: [julia-users] Calling functions that expect a Function type argument with a FastAnonymous function instead

2015-02-16 Thread Yakir Gagnon
I'll do both. So basically I need to (manually) add an optimize method with an argument DataType instead of the normal Function. Not too crazy. On Tuesday, February 17, 2015 at 1:31:28 PM UTC+10, Tim Holy wrote: > > The ##9215 is just a name (a gensym(), see the Metaprogramming section of > the

Re: [julia-users] Calling functions that expect a Function type argument with a FastAnonymous function instead

2015-02-16 Thread Tim Holy
The ##9215 is just a name (a gensym(), see the Metaprogramming section of the manual) for a "hidden type" that gets created. Unfortunately, currently there isn't a good alternative to modifying the call syntax of the function in Optim. You could open an issue over there to discuss it. (Of cours

[julia-users] Calling functions that expect a Function type argument with a FastAnonymous function instead

2015-02-16 Thread Yakir Gagnon
Tried to make the title as explanatory as possible... Say I have an anonymous function and I @anonize it with FastAnonymous. I then want to pass that anonized function to another function from *some other module*. That other function is expecting a Function type as one of its arguments, not t

[julia-users] Re: geting the pointer of composite type to send to C

2015-02-16 Thread J Luis
OK, I found it (actually, I remembered it). The trick is simply to do ptrptr = pointer([M]) segunda-feira, 16 de Fevereiro de 2015 às 19:31:53 UTC, J Luis escreveu: > > Hi, > > Sorry, but I'm again in troubles and needing help with pointers and > conversation with C > > On C, I have > >

[julia-users] Re: different eof() behavior between 0.3 and 0.4

2015-02-16 Thread Seth
On Monday, February 16, 2015 at 3:42:42 PM UTC-8, Seth wrote: > > > > Hi, > > I'm running into a strange issue with eof() tests (if it matters, on a > GnuTLS session.read object). > > Sorry - please disregard. The issue lies elsewhere.

[julia-users] different eof() behavior between 0.3 and 0.4

2015-02-16 Thread Seth
Hi, I'm running into a strange issue with eof() tests (if it matters, on a GnuTLS session.read object). In 0.3.5, the eof(session) call returns fairly instantly for a session on both true and false. In 0.4, there's a ~15 second delay when eof(session.read) is true. The docs say If the str

[julia-users] ANN: Meetup for the Bay area Julia users on Feb 21 evening

2015-02-16 Thread Xiaodong Qi
Dear Julia users in the Bay area, I am glad to announce a meetup session in Berkeley, California, USA on Feb 21. There are three invited speakers talking about their experiences on using Julia for optimization, statistics, parallel computing and quantum science applications. People from SQuInT

Re: [julia-users] Re: HttpServer seg fault

2015-02-16 Thread Milan Bouchet-Valat
Le lundi 16 février 2015 à 10:31 -0800, Joel Nelson a écrit : > The issue was found to be with HttParser and more specifically the > shared library libhttp-parser. In the deps.jl file under HttpParser > the @checked_lib was pointing to /usr/lib64/libhttp_parser.so. > However, our libhttp_parser.so

[julia-users] Re: "Introducing Julia" wikibook

2015-02-16 Thread Paulo Castro
It's not bad, but could be much better. We currently need contributors, since some of them gone work on other manuals/books sometime ago. If anyone here could help, we would be glad. Em quarta-feira, 11 de fevereiro de 2015 18:18:39 UTC-2, David P. Sanders escreveu: > > Just stumbled on this, w

[julia-users] geting the pointer of composite type to send to C

2015-02-16 Thread J Luis
Hi, Sorry, but I'm again in troubles and needing help with pointers and conversation with C On C, I have if (GMT_Destroy_Data (API, &M) != GMT_NOERROR) and the prototype of GMT_Destroy_Data() is (void *, void *) in Julia I need to get the pointer of that M typeof(M) = Ptr{GMT.GMT_MATRI

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Stefan Karpinski
It's exactly what Jameson said. Not really a mess – this is exactly how it would work in Scheme as well, for example. > On Feb 16, 2015, at 1:46 PM, Stepa Solntsev wrote: > > Thanks everyone, this solved it!!! > > Not sure what the reason behind this mess was though...

[julia-users] ANN: RepoHistoryBrowser.jl -- Browse a file's git history from IJulia

2015-02-16 Thread David P. Sanders
Hi, I have written a tiny (unregistered) package to browse the history of a file in a git repo using a widget in IJulia. This was mainly a learning exercise (very far away from the kind of things I usually do with Julia), but I thought it might be useful for somebody: Pkg.clone("https://github

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Stepa Solntsev
Working code: function nice() i=1 while true let j=i f=()->j produce(f) end i+=1 end end ye = Task(() -> nice()) funcs = Function[] for k in [1:2] push!(funcs,consume(ye)) end println(funcs[1]()) println(funcs[2]())

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Stepa Solntsev
Thanks everyone, this solved it!!! Not sure what the reason behind this mess was though...

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Josh Langsfeld
I'm not entirely sure why, but it works if you assign an anonymous closure to f: f = () -> j This also requires the let block. On Monday, February 16, 2015 at 1:27:56 PM UTC-5, Stepa Solntsev wrote: > > I tried, it still doesn't work. > > function nice() > i=1 > while true > let

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Jameson Nash
And the function itself needs to either not have a name or be local. Otherwise, you are creating one generic function and just changing the dispatch for () On Mon, Feb 16, 2015 at 1:27 PM Stepa Solntsev wrote: > I tried, it still doesn't work. > > function nice() > i=1 > while true >

[julia-users] Re: HttpServer seg fault

2015-02-16 Thread Joel Nelson
The issue was found to be with HttParser and more specifically the shared library libhttp-parser. In the deps.jl file under HttpParser the @checked_lib was pointing to /usr/lib64/libhttp_parser.so. However, our libhttp_parser.so in lib64 had a symbolic link to libhttp_parser.so.2.0. We figured

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Stepa Solntsev
I tried, it still doesn't work. function nice() i=1 while true let j=i f() = j produce(f) end i+=1 end end ye = Task(() -> nice()) funcs = Function[] for k in [1:2] push!(funcs,consume(ye)) end println(funcs[1]()) println(funcs[2]())

Re: [julia-users] Array of functions - gets overwritten

2015-02-16 Thread Jameson Nash
Both function closures created refer to the same variable "i". You need a let block to create a new local variable for each iteration of the whole loop. On Mon, Feb 16, 2015 at 12:57 PM Stepa Solntsev wrote: > Hi, I'd like the first call to return 1 and the second to return 2, but > both return 2

Re: [julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Tim Holy
Composite types are much higher performance but have no flexibility (you can't add new fields later). So which you choose depends on your use case. --Tim On Monday, February 16, 2015 09:38:13 AM Martin Johansson wrote: > Yes, composite types could well be the answer! I'm still trying to find out

[julia-users] Array of functions - gets overwritten

2015-02-16 Thread Stepa Solntsev
Hi, I'd like the first call to return 1 and the second to return 2, but both return 2 !!! What could be the problem? function nice() i=1 while true f() = i produce(f) i+=1 end end ye = Task(() -> nice()) funcs = Function[]

Re: [julia-users] Linked list. Julia <--> C

2015-02-16 Thread Douglas Bates
On Monday, February 16, 2015 at 10:30:36 AM UTC-6, Jameson wrote: > > Gtk.jl has a rather substantial example (I think it's in > src/GLib/glists.jl, but I'm on an iPhone) > If Fermat were alive today his famous enigmatic note would be "I have discovered a wonderful proof of this but I'm on an iP

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Martin Johansson
Yes, composite types could well be the answer! I'm still trying to find out which choices would make the transition from Matlab easiest. This (old) discussion didn't seem to recommend one over the other (of Dicts and composite types). Regards, m

Re: [julia-users] Julia on Raspberry Pi 2

2015-02-16 Thread Sto Forest
Thank you very much for your help viral, *GCC *is set to the latest version *root@pithree:/opt/julia/deps/openlibm/src# gcc --version* *gcc (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2* *Copyright (C) 2013 Free Software Foundation, Inc.* I've added the override to Make.user. I pulled the latest versio

Re: [julia-users] Linked list. Julia <--> C

2015-02-16 Thread Jameson Nash
Gtk.jl has a rather substantial example (I think it's in src/GLib/glists.jl, but I'm on an iPhone) On Mon, Feb 16, 2015 at 9:14 AM J Luis wrote: > Hi, > > Does anyone know of an example showing how to make linked lists in Julia > and interface that with C (that will modify them)? > > Thanks >

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Johan Sigfrids
Could you not use a composite type for this? It would seem more Julian to me.

[julia-users] Re: Levi-Civita symbol/tensor

2015-02-16 Thread lapeyre . math122a
I should note that a couple of routines in PermPlain are not MIT license compatible. But all the code to compute the signature of a permutation most definitely is MIT compatible. I wrote it, although the algorithm is well known. There is also this code which calls PermPlain: https://github.com/

[julia-users] Re: Levi-Civita symbol/tensor

2015-02-16 Thread lapeyre . math122a
Maybe its too late, but here is a fast implementation giving the signature of the output of randperm(n) https://github.com/jlapeyre/PermPlain.jl/blob/master/src/PermPlain.jl#L271 On Monday, February 9, 2015 at 8:41:58 PM UTC+1, Blake Johnson wrote: > > I keep writing code that needs the Levi-Ci

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Michael Hatherly
I would have to explicitly state all the variables Yes, you would. the Dict that I call the function with is longer “preserved” (correct?) as a variable Assuming this was meant to read “is no longer”, it would not be possible to pass it to additional calls. You might be able to use a compos

[julia-users] Linked list. Julia <--> C

2015-02-16 Thread J Luis
Hi, Does anyone know of an example showing how to make linked lists in Julia and interface that with C (that will modify them)? Thanks

Re: [julia-users] Re: Distance computation between two vectors versus a column in a matrix and a vector.

2015-02-16 Thread Kristoffer Carlsson
I tried with sub/slice a while ago and I think it gave me a very large performance decrease. I will try again when I get to a good computer to test it. The "`AbstractVecOrMat` with a default value for idx"-method sounds interesting though. I will try it out. Thank you. On Monday, February 16,

Re: [julia-users] Re: Distance computation between two vectors versus a column in a matrix and a vector.

2015-02-16 Thread Andreas Noack
You could Use `AbstractVecOrMat` and `idx=1` as default value, but you could also use `sub` or `slice` to avoid copying the matrix columns since *julia> **A = randn(2,2)* *2x2 Array{Float64,2}:* * -0.124018 1.3846 * * -0.259116 -1.19279* *julia> **isa(sub(A, :,1), AbstractVector{Float64})*

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Martin Johansson
Thanks, that's a good point regarding the scope and not a "side effect" I would want. If I understand the keyword part correctly, I would have to explicitly state all the variables in the function definition to be able to use them locally which, as you write, can become verbose (very verbose fo

[julia-users] Re: Distance computation between two vectors versus a column in a matrix and a vector.

2015-02-16 Thread Kristoffer Carlsson
Actually the best thing would be if I could call a function with the dist(point_1::AbstractVector{T}, point_2::AbstractVector{T}) signature because then I could just use all the stuff in the Distances.jl package On Monday, February 16, 2015 at 2:05:17 PM UTC+1, Kristoffer Carlsson wrote: > > I

[julia-users] Re: [Winston] Can marker sized be changed?

2015-02-16 Thread Ariel Keselman
scatter does the job. Just answered my own question :)

[julia-users] [Winston] Can marker sized be changed?

2015-02-16 Thread Ariel Keselman
in Matlab for e.g.: plot( , 'markersize',8) Is this feature present in Winston? Thanks!

[julia-users] Distance computation between two vectors versus a column in a matrix and a vector.

2015-02-16 Thread Kristoffer Carlsson
I am writing some code where I sometimes want to calculate the distance between two vectors and sometimes the distance between a column in a matrix and another vector. This is in a very hot spot of my program so any unnecessary copying is unacceptable. What I am currently doing is basically ha

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Sean Marshallsay
As Micheal pointed out, think very carefully about why you need this behaviour because it will leak variables into the global scope which is currently a very bad idea in Julia. On Sunday, 15 February 2015 22:46:56 UTC, Martin Johansson wrote: > > Thanks, the second solution was what I was lookin

Re: [julia-users] Julia on Raspberry Pi 2

2015-02-16 Thread Viral Shah
You can avoid the openlibm issue for now by adding override USE_SYSTEM_LIBM=1 in your Make.user. Can you also file this issue in the openlibm github repo, so that it can be fixed. Should be easy. I wonder why your build is picking up llvm 3.5.0, since ARM.inc uses 3.5.1 now. I don't know if th

[julia-users] Re: Values from Dict assigned to "variables" (symbols?) named as keys?

2015-02-16 Thread Michael Hatherly
One thing to note about using @eval as mentioned in Sean’s reply is that eval (and by extension @eval) does not evaluate expressions in a function’s scope, but rather in the global scope of the module. This might have unexpected results: julia> function f(d) for (k, v) in d

Re: [julia-users] Julia on Raspberry Pi 2

2015-02-16 Thread Sto Forest
After adding in a couple of dependencies, gfortran, cmake, compilation is getting further. There are two current problems: *openlibm* s_creall.c:(.text+0x0): multiple definition of `creal' src/s_creal.c.o:s_creal.c:(.text+0x0): first defined here collect2: error: ld returned 1 exit status Makef

[julia-users] Re: statistical accumulator

2015-02-16 Thread David van Leeuwen
Alternatively, there still is https://github.com/davidavdav/BigData.jl which has some infrastructure for storing large data on disc, and there is a stats() function that doesthe accumulation for you. ---david On Thursday, February 12, 2015 at 6:26:03 PM UTC+1, Christian Peel wrote: > > Perfect

Re: [julia-users] Start julia with REPL, loading script, and passing arguments

2015-02-16 Thread David van Leeuwen
Hello, On Sunday, February 15, 2015 at 8:31:50 PM UTC+1, Stefan Karpinski wrote: > > I'm not sure that we support this at the moment. The part that's not > supported seems to be passing command-line arguments in interactive mode. > > The command line args seem to be read all right, and seem to b