[julia-users] Re: Clearing the screen and Julia's exploratory tools (equivalent of Python's dir function)

2014-05-03 Thread Nafiul Islam
Thank you all so very much for the help. Now, I can learn more Julia without bothering everyone all the time :) On Saturday, May 3, 2014 4:09:56 AM UTC+6, Nafiul Islam wrote: > > Hi (again)! > > Hopefully a (slightly) more intelligent question this time. I've been > successfully able to run shel

[julia-users] Re: help with parallel

2014-05-03 Thread James Porter
The first one is easy to solve; function definitions aren't moved implicitly like data is, if you use: @everywhere foo(a) = sin(a) To make the definition happen on all worker processes then it works. As to the second issue I'm not sure what's wrong. Based on the description of @parallel in the

[julia-users] no context available in Debug

2014-05-03 Thread Michele Zaffalon
Hello, I am trying to use Debug.jl and when running the example in https://github.com/toivoh/Debug.jl, I get a no context available. This is on the latest executable from PPA, v0.3. By the way, in that example push does not seem to exist. Thank you, michele

Re: [julia-users] How can Julia recognise the degree of a polynomial?

2014-05-03 Thread Stefan Karpinski
Yes, sorry about that. Using tuples for large polynomials is not a good idea but it does allow the type system to reason about degrees. I'm not sure how useful having the compiler reason about degrees really is though. > On May 3, 2014, at 8:15 PM, andrew cooke wrote: > > see the discussion at

Re: [julia-users] Rename column names in a DataFrames

2014-05-03 Thread John Myles White
The function you’re looking for is now called names! DataFrames is still in a state of flux, so you should expect the documentation to lag behind. — John On May 3, 2014, at 11:24 AM, AK wrote: > Hi, > > I am starting with Julia and I have to say that I am experiencing quite some > problems

[julia-users] Rename column names in a DataFrames

2014-05-03 Thread AK
Hi, I am starting with Julia and I have to say that I am experiencing quite some problems already with the basics. How for example can I change the column names of a DataFrame? The solution provided at https://groups.google.com/forum/#!topic/julia-users/M8CUl-42x1Q : df = DataFrame(x1=rand(5)

[julia-users] Re: help with parallel

2014-05-03 Thread Ethan Anderes
There also seems to be a scope issue as well. The following throws an error that `a` is not defined. I guess it's because of the local scope but I would hope this wouldn't be a problem for @parallel: runparl = true if runparl addprocs(3) a = rand(5) x = @parallel (vcat) f

[julia-users] Re: help with parallel

2014-05-03 Thread Ethan Anderes
Maybe I spoke too soon. I don't understand why @parallel can see `a` but not foo in the following (I hope this isn't another silly mistake on my part, else I be banished)? julia> a=1 1 julia> addprocs(3) 3-element Array{Any,1}: 2 3 4 julia> x = @parallel (vcat) for k=1:3 sin

[julia-users] Re: help with parallel

2014-05-03 Thread James Porter
No problem! Rubber ducking can be an effective debugging technique, even over the internet :) On Saturday, May 3, 2014 7:34:21 PM UTC-5, Ethan Anderes wrote: > > Now I feel really silly. I had a typo: args1 was erroneously written > arg1...hence the error that the workers couldn't find arg1. >

[julia-users] Re: help with parallel

2014-05-03 Thread Ethan Anderes
Now I feel really silly. I had a typo: args1 was erroneously written arg1...hence the error that the workers couldn't find arg1. Sorry for the noise and thanks for the help (debugging as it were)!

Re: [julia-users] How can Julia recognise the degree of a polynomial?

2014-05-03 Thread andrew cooke
see the discussion at https://github.com/JuliaLang/julia/issues/5857 (search for NTuple). it seems that NTuple currently is not a contiguous block of memory, but a collection of pointers to its contents. it also seems that this will change... andrew On Saturday, 3 May 2014 18:58:09 UTC-4, A

[julia-users] Re: help with parallel

2014-05-03 Thread James Porter
Hi Ethan, Hmmm this is odd, in general you shouldn't need to explicitly send variables you read in a parallel for loop to other processors. For example: julia> addprocs(4) 4-element Array{Any,1}: 2 3 4 5 julia> args1 = 1 1 julia> @parallel (+) for i=1:10 args1 end 10 Can you provide a run

Re: [julia-users] How can Julia recognise the degree of a polynomial?

2014-05-03 Thread Andrea Pagnani
Strange behavior I define Type Polynomial according to Stefan definition and julia> a = tuple(rand(500,1)...); b = tuple(rand(500,1)...); julia> @time P1=Polynomial(a); elapsed time: 24.441438322 seconds (614490296 bytes allocated) julia> @time P2=Polynomial(b); elapsed time: 2.4303e-5 seconds

[julia-users] Re: Matlab urlread('URL','method',PARAMS), anyone knows the equivalent in Julia?

2014-05-03 Thread yuuki
I've been using HTTPClient: https://github.com/amitmurthy/HTTPClient.jl You can look in the tests for some examples: https://github.com/amitmurthy/HTTPClient.jl/blob/master/test/tests.jl

[julia-users] Re: Initialize dict of dicts with => syntax

2014-05-03 Thread thom lake
One thing that I like about {} for initializing Array{Any,1}, is the consistency with comprehension syntax. Namely, braces for Any, brackets for specific types julia> typeof({i=>2i for i = 1:10}) Dict{Any,Any} julia> typeof([i=>2i for i = 1:10]) Dict{Int64,Int64} julia> typeof({2i for i = 1:10

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread James Porter
Ahh nevermind, I think I see — declaring the "stuff" field to be the largest of the possible types and then reinterpreting the result as the correct type seems to work. Thanks! On Saturday, May 3, 2014 12:21:18 PM UTC-5, James Porter wrote: > > How would I convert manually? Right now I'm trying

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread Isaiah Norton
Can you give an example of the struct/union (shortened, perhaps) and your Julia version? On Sat, May 3, 2014 at 1:21 PM, James Porter wrote: > How would I convert manually? Right now I'm trying to use a placeholder > bitstype of the appropriate size and reinterpret it is the correct > immutable

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread James Porter
How would I convert manually? Right now I'm trying to use a placeholder bitstype of the appropriate size and reinterpret it is the correct immutable type, but I'm getting BoundsErrors in reinterpret and I'm not sure if this is the right thing to be doing. On Saturday, May 3, 2014 12:14:03 PM UT

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread Isaiah Norton
The size of a union is the size of the largest element. There is no way to access one memory range as different names/types like a C union, but you could do the down-conversion from the max type manually as needed. Also you might want to have a look at the StrPack package (not sure if it supports

Re: [julia-users] Re: I cannot call "using Requests" in win XP

2014-05-03 Thread Jameson Nash
I opened an issue on BinDeps a long time ago suggesting a less broken `ext.jl` file for packages using BinDeps: https://github.com/JuliaLang/BinDeps.jl/issues/77 On Sat, May 3, 2014 at 11:54 AM, Tony Kelman wrote: > Good call Miles, that does make things easier to figure out for users. > > I was

Re: [julia-users] Re: Matlab urlread('URL','method',PARAMS), anyone knows the equivalent in Julia?

2014-05-03 Thread Jameson Nash
Or use the builtin `download` command. it isn't very fancy, but should get the job done. I'm not sure what matlab means by PARAMS for an HTTP GET, since the GET method doesn't take arguments. presumably though, it is rewriting the url to `http://xx.xx.xx.xx:xx/?request=value' with quoting for requ

[julia-users] Re: I cannot call "using Requests" in win XP

2014-05-03 Thread Tony Kelman
Good call Miles, that does make things easier to figure out for users. I was able to reproduce the problem with Requests/GnuTLS on Windows XP (look what you made me do), it turns out to be pretty obscure and not an easy fix. Quoting from http://www.wireshark.org/lists/wireshark-dev/201404/msg00

[julia-users] Re: Question about 'dot' notation (and max/maximum)

2014-05-03 Thread Carlo Baldassi
Small hint: the easiest way I found to clarify the distinction between "max" and "maximum", and why it is necessary in the first place, is that it's the same as that between "the + function" vs "sum", or "the * function" vs "prod". (Of course, not checking the region argument in maximum is just

Re: [julia-users] Re: run(`...`) return code

2014-05-03 Thread Robert J Goedman
Thanks Steven! Rob J. Goedman goed...@icloud.com On May 3, 2014, at 8:05 AM, Steven G. Johnson wrote: > run throws an exception if there was an error, so > > run(`ls`); run(`ls`) > > will only run the second command if the first succeeds. You could use a try > ... catch ... end block

[julia-users] Re: I cannot call "using Requests" in win XP

2014-05-03 Thread Miles Lubin
Relatedly, I think it's bad practice to simply put include("../deps/deps.jl") in the module, because this gives a meaningless error message to the user when the file doesn't exist. In Gurobi.jl, for example, we have: if isfile(joinpath(Pkg.dir("Gurobi"),"deps","deps.jl")) include("../deps/

[julia-users] Re: I cannot call "using Requests" in win XP

2014-05-03 Thread Tony Kelman
Do those deps.jl files exist? What happens if you do Pkg.build("GnuTLS") or Pkg.build("Cairo") ? On Saturday, May 3, 2014 3:16:30 AM UTC-7, joanenric barcelo wrote: > > I cannot use Requests package in Win XP. I get the following message: > > OpenBLAS : Your OS does not support AVX instructions.

[julia-users] Re: run(`...`) return code

2014-05-03 Thread Steven G. Johnson
run throws an exception if there was an error, so run(`ls`); run(`ls`) will only run the second command if the first succeeds. You could use a try ... catch ... end block if you want to do something special if an error occurs. On Saturday, May 3, 2014 10:18:33 AM UTC-4, Rob J Goedman wrot

Re: [julia-users] Clearing the screen and Julia's exploratory tools (equivalent of Python's dir function)

2014-05-03 Thread Leah Hanson
If you're looking for more exploratory-type functions/tools, I have a list of them here: http://blog.leahhanson.us/julia-helps.html My blog post is missing the `whos` function, which is a more human-readable way to see everything a Package/Module exports: ~~~ julia> using DataFrames julia> whos(D

[julia-users] help with parallel

2014-05-03 Thread Ethan Anderes
I have a very simple parallel problem but I'm having a hard time executing what I want. I'm basically just filling up a large array with @parallel as follows: addprocs(10) require("functions.jl") biglist = @parallel (vcat) for k=1:procs smalllist(args1, args2,...) end smalllist (defined

[julia-users] run(`...`) return code

2014-05-03 Thread Robert J Goedman
Is there a way to express: run(`ls`) == Nothing && run(`ls`) i.e., the first command could be make, the second executing the program if make succeeds? I looked through http://blog.leahhanson.us/running-shell-commands-from-julia.html which is really nice, but does not address this. Thanks, Ro

[julia-users] Re: Matlab urlread('URL','method',PARAMS), anyone knows the equivalent in Julia?

2014-05-03 Thread joanenric barcelo
Thanks Tony for your help. However, I need to use Win XP for working reasons and I cannot manage to get it work. I have raised another post with this issue https://groups.google.com/forum/#!topic/julia-users/wPNc8T8lxX8 thanks again!! El miércoles, 30 de abril de 2014 17:57:50 UTC+1, Tony Kelma

[julia-users] I cannot call "using Requests" in win XP

2014-05-03 Thread joanenric barcelo
I cannot use Requests package in Win XP. I get the following message: OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance. _ _ _ _(_)_ | A fresh approach to technical computing