Re: [julia-users] Re: Sumatra

2015-08-15 Thread Diego Tapias
Currently all works. Just to get a complete functionality is needed to
implement the function find_dependencies() for Julia which is a Python
function which looks for the packages and their version installed in Julia.

Have you already tried sumatra?

2015-05-25 6:27 GMT-05:00 Magnus Lie Hetland m...@idi.ntnu.no:

 I haven't tried, but I've been looking for something along these lines,
 and might have a look at it. What have you tried, and what did not wor?-)



[julia-users] Averaging vectors of different length

2015-08-06 Thread Diego Tapias
Hello,

I am trying to average together several vectors of slightly different
lengths (difference might be one or two elements).

For example, a, b, c might be:

a = ones(10)*2.
b = ones(11)*5.
c = ones(12)*4.

I want to make a new vector d that contains the averages of all their
values considering that for the 11th element I just have to
average the b and c’s values, and for the 12th value I only
want c’s value.

Is there an easy way to do this? Consider I want to do this for n vectors
with n a big number (let’s say at least 100).
​


[julia-users] Sumatra

2015-05-22 Thread Diego Tapias
I am just curious whether someone currently uses Sumatra
https://pythonhosted.org/Sumatra/ for managing and keeping track of
scentific projects, of course, written in julia.

I just tried it but without good results.




​


[julia-users] Dynamics Arrays

2015-04-07 Thread Diego Tapias
Hello,

as far as I understand the Arrays that we often use when working with julia
are dynamic arrays since they support the operations of adding or removing
elements (through push!/unshift! and pop!/shift! methods).

In view of this, I am wondering about what is the most primitive Array type
in julia. Looking the source code at
https://github.com/JuliaLang/julia/blob/master/base/array.jl is not evident
for me the answer.

Thanks in advance.

PS: I am thinking in terms of Array and ArrayList in Java.


Re: [julia-users] savefig error

2015-04-02 Thread Diego Tapias
Ok, thank you!
Sorry for my grammar, I often type very fast and don't check it.
I see your point but it's confusing for me that the same syntax worked a
few days ago. Do you know if this is a new feature of matplotlib?

2015-04-01 23:57 GMT-06:00 René Donner li...@donner.at:

 The following works:

   using PyPlot
   a = plot(sin(linspace(-3,3)))
   savefig(test.png)

 savefig only seems to work on the current figure.

 The error message you are seeing comes from the fact that that
 myimage[:savefig] tells julia to index myimage with :savefig, and
 this syntax is just sugar for getindex(myimage,:savefig).




 Am 02.04.2015 um 03:20 schrieb Diego Tapias dandrove...@gmail.com:

  Hello,
 
  I have got the same error in versions with the command savefig of
 matplotlib. The same code worked a few days ago . This is what I got for
 this command myimage[:savefig](bla.pdf):
 
  ERROR: LoadError: LoadError: KeyError: savefig not found
   in getindex at /home/maquinadt/.julia/v0.4/PyCall/src/PyCall.jl:252
   in getindex at /home/maquinadt/.julia/v0.4/PyCall/src/PyCall.jl:257
 
 
  Any help would be appreciated.
 
  PS: It happens the same for both versions 0.3 and 0.4.
 




[julia-users] savefig error

2015-04-01 Thread Diego Tapias
Hello,

I have got the same error in versions with the command savefig of
matplotlib. The same code worked a few days ago . This is what I got for
this command myimage[:savefig](bla.pdf):

ERROR: LoadError: LoadError: KeyError: savefig not found in getindex at
/home/maquinadt/.julia/v0.4/PyCall/src/PyCall.jl:252 in getindex at
/home/maquinadt/.julia/v0.4/PyCall/src/PyCall.jl:257

Any help would be appreciated.

PS: It happens the same for both versions 0.3 and 0.4.
​


[julia-users] Array as function

2015-03-11 Thread Diego Tapias
Quick question: what does this mean

julia Array(Int,1)
 1-element Array{Int64,1}:
 139838919411184

?

And another question:

Is this just used for initializing an array?

Thanks.
​


Re: [julia-users] Re: Array as function

2015-03-11 Thread Diego Tapias
Hey Phil,

thanks for taking the time to explain. It makes sense now.

Best.
Diego

2015-03-11 18:20 GMT-06:00 Phil Tomson philtom...@gmail.com:



 On Wednesday, March 11, 2015 at 4:49:06 PM UTC-7, Diego Tapias wrote:

 Quick question: what does this mean

 julia Array(Int,1)
  1-element Array{Int64,1}:
  139838919411184

 ?

 And another question:

 Is this just used for initializing an array?


 Typically you would use something like:

 my_array =  Array(Int,1)

 This preallocates space for your array and gives it a type. (it's an array
 with only one entry)

 The array isn't initialized at that point, the space is just allocated,
 that's why you see:

 139838919411184

 in your single entry array.

 If you wanted to initialize it, you could do:

 my_array = zeros(Int,1)

 ​




[julia-users] create directory from a julia script

2015-03-04 Thread Diego Tapias
Is there a way to create a directory from a julia script? I am thinking in
something like os.mkdirs(dir) of Python.
​


Re: [julia-users] Re: create directory from a julia script

2015-03-04 Thread Diego Tapias
Thanks Jack.

2015-03-04 14:02 GMT-06:00 Jack Minardi j...@minardi.org:

 help? mkdir

 INFO: Loading help data...

 Base.mkdir(path[, mode])


Make a new directory with name path and permissions mode.

mode defaults to 0o777, modified by the current file creation

mask.


 On Wednesday, March 4, 2015 at 2:39:18 PM UTC-5, Diego Tapias wrote:

 Is there a way to create a directory from a julia script? I am thinking
 in something like os.mkdirs(dir) of Python.
 ​




Re: [julia-users] using Docile

2015-02-06 Thread Diego Tapias
Hi Michael,I updated to the last version and the problem is fixed. Thank
you!

By the way, using Docile is not needed to generate documentation in
julia0.4-dev .



2015-02-05 23:49 GMT-06:00 Michael Hatherly michaelhathe...@gmail.com:

 Hi Diego,

 ERROR: UndefVarError: @repl not defined

 Are you using julia 0.4-dev here? If so could you try updating julia also,
 since @repl is quite new.

 — Mike
 ​


 On Friday, 6 February 2015 01:59:26 UTC+2, Diego Tapias wrote:

 No problem while installing. But I’ve got the following error when ask
 for foo:

 ?foo

 ERROR: UndefVarError: @repl not defined
 ​

 2015-02-05 17:37 GMT-06:00 Tom Short tshort...@gmail.com:

 Try installing Lexicon and load it then repeat your example.


 On Thursday, February 5, 2015, Diego Tapias dandr...@gmail.com wrote:

 Hi guys,

 I didn’t have problems installing Docile, however when I try to use it
 literally nothing happens. Before continue reading, my julia version is
 0.4.0-dev.

 Consider the following code :

 filename test.jl

 using Docile

 export foo

 @doc This function is not important -

 function foo()

 end

 Now I type in Julia console:

 include(“test.jl”)

 ?foo

 foo (generic function with 1 method)

 And nothing about documentation.

 ​





[julia-users] using Docile

2015-02-05 Thread Diego Tapias
Hi guys,

I didn’t have problems installing Docile, however when I try to use it
literally nothing happens. Before continue reading, my julia version is
0.4.0-dev.

Consider the following code :

filename test.jl

using Docile

export foo

@doc This function is not important -

function foo()

end

Now I type in Julia console:

include(“test.jl”)

?foo

foo (generic function with 1 method)

And nothing about documentation.

​


Re: [julia-users] using Docile

2015-02-05 Thread Diego Tapias
No problem while installing. But I’ve got the following error when ask for
foo:

?foo

ERROR: UndefVarError: @repl not defined
​

2015-02-05 17:37 GMT-06:00 Tom Short tshort.rli...@gmail.com:

 Try installing Lexicon and load it then repeat your example.


 On Thursday, February 5, 2015, Diego Tapias dandrove...@gmail.com wrote:

 Hi guys,

 I didn’t have problems installing Docile, however when I try to use it
 literally nothing happens. Before continue reading, my julia version is
 0.4.0-dev.

 Consider the following code :

 filename test.jl

 using Docile

 export foo

 @doc This function is not important -

 function foo()

 end

 Now I type in Julia console:

 include(“test.jl”)

 ?foo

 foo (generic function with 1 method)

 And nothing about documentation.

 ​




Re: [julia-users] Help with the findin method

2015-02-01 Thread Diego Tapias
Thank you so much Jiahao!
I see my guess was correct.
What a nice group.

2015-01-31 16:50 GMT-06:00 Jiahao Chen jia...@mit.edu:
 Your custom particles type is not iterable, i.e. does not have start, next
 and done methods defined. See the manual for details of the iterable
 interface.

 Note that Julia numbers are iterable, so the following works:

 julia findin([1,2,3], 2)
 1-element Array{Int64,1}:
  2

 Thanks,

 Jiahao Chen
 Staff Research Scientist
 MIT Computer Science and Artificial Intelligence Laboratory


[julia-users] Help with the findin method

2015-01-31 Thread Diego Tapias
Hello,

For a Molecular Dynamics simulation I have created a composite type
named Particle. After that, I constructed an Array consisted of
Particle elements.  I  want to get the index of a specific element
within the Array, however when trying it I get the following error:

`start` has no method matching start(::Particle{Float64})

I believe the error is related to the fact I have not defined how to
iterate over an Array of Particle types. I don't know how I can do
that.

Any help will be appreciated. For concreteness, I put a simple code:


type Particle{T:Float64}
r::T
v::T
end

p  = Particle(1.0,1.0)
particles = [p]

for i in 1:10
p = Particle(rand(),rand())
push!(particles,p)
end

k = findin(particles, particles[3]) # I expect k = 3

`start` has no method matching start(::Particle{Float64})




Re: [julia-users] Help with the findin method

2015-01-31 Thread Diego Tapias
Oh, I see. Thanks Jiahao.

Could you please tell me a bit more about the error message?, it is
not evident for me what it means.

2015-01-31 13:24 GMT-06:00 Jiahao Chen jia...@mit.edu:
 We could have a new function. We have separate functions for
 push!([1,2,3],4,5,6) and append!([1,2,3],[4,5,6]).

 Thanks,

 Jiahao Chen
 Staff Research Scientist
 MIT Computer Science and Artificial Intelligence Laboratory

 On Sat, Jan 31, 2015 at 1:57 PM, Milan Bouchet-Valat nalimi...@club.fr
 wrote:

 Le samedi 31 janvier 2015 à 13:08 -0500, Jiahao Chen a écrit :
  k = findin(particles, particles[3])
 
  findin requires both arguments to be collections.
  Try  findin(particles, [particles[3]]) instead.
 Maybe we should add a version accepting a single element too? Any reason
 not to?


 Regards




[julia-users] Convention for naming types and functions

2015-01-29 Thread Diego Tapias
Hello,

can you please help me with the convention for naming created types
and functions?

Diego.


Re: [julia-users] Convention for naming types and functions

2015-01-29 Thread Diego Tapias
Thank you Stefan and Tom, that's what I needed.

2015-01-29 12:05 GMT-06:00 Tom Short tshort.rli...@gmail.com:
 http://julia.readthedocs.org/en/latest/manual/style-guide/#use-naming-conventions-consistent-with-julia-s-base

 On Thu, Jan 29, 2015 at 12:56 PM, Diego Tapias dandrove...@gmail.com
 wrote:

 Hello,

 can you please help me with the convention for naming created types
 and functions?

 Diego.




Re: [julia-users] Re: PathPatch object in julia with PyPlot

2014-09-24 Thread Diego Tapias
Thanks Steven...
I will take your advice into account!


2014-09-24 13:33 GMT-05:00 Steven G. Johnson stevenj@gmail.com:

 (Please don't double-post questions.)



[julia-users] Backend for PyPlot

2014-09-23 Thread Diego Tapias
For the command:

using PyPlot

I got a warning and then a error:

/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/__init__.py:1282:
 UserWarning:  This call to matplotlib.use() has no effect

because the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.

  warnings.warn(_use_error_msg)

ERROR: PyError (PyImport_ImportModule) type 'exceptions.ImportError'
ImportError('No module named _backend_gdk',)
  File 
/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/pyplot.py,
line 108, in module
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File 
/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/backends/__init__.py,
line 32, in pylab_setup
globals(),locals(),[backend_name],0)
  File 
/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/backends/backend_gtkagg.py,
line 14, in module
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
FigureCanvasGTK,\
  File 
/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/backends/backend_gtk.py,
line 36, in module
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
  File 
/usr/local/lib/python2.7/dist-packages/matplotlib-1.5.x-py2.7-linux-x86_64.egg/matplotlib/backends/backend_gdk.py,
line 33, in module
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array

 in pyerr_check at /home/maquinadt/.julia/v0.4/PyCall/src/exception.jl:58
 in pyimport at /home/maquinadt/.julia/v0.4/PyCall/src/PyCall.jl:85
 in include at ./boot.jl:246
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:51
while loading /home/maquinadt/.julia/v0.4/PyPlot/src/PyPlot.jl, in
expression starting on line 108

To fix that, I choose the backend before importing pyplot:

using PyCall

pygui(:qt)

and then

using PyPlot

But I don’t want to repeat this code whenever I start a julia session. Can
you please help me to fix this permanently?

I’m working with the julia version 0.4.0-dev+728, and matplotlib version:
1.5.x .

Thanks.
​


[julia-users] PathPatch object in julia with PyPlot

2014-09-23 Thread Diego Tapias
I share a question I did in the stackoverflow forum.

http://stackoverflow.com/questions/26001119/pathpatch-object-in-julia-with-pyplot

Any comments are welcome.
Thank you.


[julia-users] Re: PathPatch object in julia with PyPlot

2014-09-23 Thread Diego Tapias
I have advanced on my question, but I’m stuck trying to change the
properties of a PyObject.

Consider the following code:

using PyCall

@pyimport matplotlib.patches as patch
circle=patch.pymember(“Circle”)

But when I try circle[:set_radius](1.0) or set!(circle, radius, 1.0) I got
an error. Any ideas?
​

2014-09-23 12:27 GMT-05:00 Diego Tapias dandrove...@gmail.com:

 I share a question I did in the stackoverflow forum.


 http://stackoverflow.com/questions/26001119/pathpatch-object-in-julia-with-pyplot

 Any comments are welcome.
 Thank you.




[julia-users] How to append two arrays?

2014-09-09 Thread Diego Tapias
Consider the arrays given by

v = [1.,2.,3.]

w = [2.,4.,6.]

As you know both are arrays of dimension 1. I want to form the matrix with
its columns given by v and w. How can I do that (I tried with “cat” but it
didn’t worh)? How can it be generalized for n arrrays.

Thanks in advance
​


Re: [julia-users] How to append two arrays?

2014-09-09 Thread Diego Tapias
yay! That's what I wanted.
Thank you guys

2014-09-09 17:33 GMT-05:00 Keno Fischer kfisc...@college.harvard.edu:

 If I understand correctly, you want hcat:

 julia hcat(v,w)
 3x2 Array{Float64,2}:
  1.0  2.0
  2.0  4.0
  3.0  6.0

 The general version of that is `cat`.

 On Tue, Sep 9, 2014 at 6:31 PM, Diego Tapias dandrove...@gmail.com
 wrote:
  Thanks for answering!, but what if I want to form a matrix of dimension 2
  and not an array of dimension 1.
 
  2014-09-09 17:27 GMT-05:00 Stefan Karpinski ste...@karpinski.org:
 
  append!(v,w) – it modifies and returns v.
 
 
  On Wed, Sep 10, 2014 at 12:25 AM, Diego Tapias dandrove...@gmail.com
  wrote:
 
  Consider the arrays given by
 
  v = [1.,2.,3.]
 
  w = [2.,4.,6.]
 
  As you know both are arrays of dimension 1. I want to form the matrix
  with its columns given by v and w. How can I do that (I tried with
 “cat” but
  it didn’t worh)? How can it be generalized for n arrrays.
 
  Thanks in advance
 
 
 



[julia-users] Discrete sine transform

2014-09-09 Thread Diego Tapias
Can please anyone help me with the use of the method FFTW.r2r?, I need to
do a discrete sine transform over the elements of an array. Particularly I
need the transform RODFT00 (option of the method). I read what the manual
says but it is a little bit confused for me.


Thanks in advance.


Re: [julia-users] Julia with LightTable

2014-07-21 Thread Diego Tapias
Your guess was right @Keno, my version of Julia was very old. I updated to
the version 0.3.0 -rc1 and the problem was fixed.
Thanks for the help.


2014-07-21 2:19 GMT-05:00 Keno Fischer kfisc...@college.harvard.edu:

 Your version of julia may be too old. How did you install julia?

 On Sun, Jul 20, 2014 at 4:12 PM, Diego Tapias dandrove...@gmail.com
 wrote:
  I have got the following error whenever I try to run a Julia Script with
 the
  editor LightTable:
 
  Couldn't connect to Julia
 
  ERROR: REPLCompletions not defined
   in anonymous at no file
   in include at boot.jl:238
   in include_from_node1 at loading.jl:114
   in include at boot.jl:238
   in include_from_node1 at loading.jl:114
   in reload_path at loading.jl:140
   in _require at loading.jl:58
   in require at loading.jl:43
   in include at boot.jl:238
   in include_from_node1 at loading.jl:114
   in process_options at client.jl:303
   in _start at client.jl:389
  at /home/diego/.julia/v0.2/Jewel/src/completions.jl:106
  at /home/diego/.julia/v0.2/Jewel/src/Jewel.jl:9
  at /opt/LightTable/plugins/Jewel/jl/init.jl:20
 
 
  I have cloned the repositories Jewel, Jupiter-LT and June-LT from the
  sources and put them into the folder /opt/LightTable/plugins/ where it is
  supposed they should be.



[julia-users] Julia with LightTable

2014-07-20 Thread Diego Tapias
I have got the following error whenever I try to run a Julia Script with 
the editor LightTable:

Couldn't connect to Julia

ERROR: REPLCompletions not defined
 in anonymous at no file
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in reload_path at loading.jl:140
 in _require at loading.jl:58
 in require at loading.jl:43
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in process_options at client.jl:303
 in _start at client.jl:389
at /home/diego/.julia/v0.2/Jewel/src/completions.jl:106
at /home/diego/.julia/v0.2/Jewel/src/Jewel.jl:9
at /opt/LightTable/plugins/Jewel/jl/init.jl:20


I have cloned the repositories Jewel, Jupiter-LT and June-LT from the 
sources and put them into the folder /opt/LightTable/plugins/ where it is 
supposed they should be.


Re: [julia-users] Re: Julia with LightTable

2014-07-20 Thread Diego Tapias
Thank you @Joshua. That's what I got (I have followed the instructions of
the one-more-minute repo).

;; User behaviors
;; -
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You
can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically
gain
;; whatever logic the behavior imparts. To see a list of user-level
behaviors,
;; start typing a word related to the functionality you want in between the
square
;; brackets (e.g. theme).

{:+ {
 ;; The app tag is kind of like global scope. You assign behaviors that
affect
 ;; all of Light Table here
 :app [(:lt.objs.style/set-skin dark)]

 ;; The editor tag is applied to all editors
 :editor [:lt.objs.editor/no-wrap
  (:lt.objs.style/set-theme june)]

 ;; Here we can add behaviors to just clojure editors
 :editor.clojure [(:lt.plugins.clojure/print-length 1000)]}

 ;; You can use the subtract key to remove behavior that may get added by
 ;; another diff
 :- {:app [(:lt.objs.langs.julia/julia-path /usr/bin/julia)]}}


2014-07-20 19:11 GMT-05:00 Joshua Job nanite1...@gmail.com:

 Can you post the contents of your user behaviors file? You can get to it
 via ctrl+space and then typing user behaviors, you should see an option
 to edit them. You have to specify the path to julia there, or have it on
 your path. More details can be found at
 https://github.com/one-more-minute/Jupiter-LT/wiki/Installing-%26-Upgrading


 On Sunday, July 20, 2014 4:12:23 PM UTC-7, Diego Tapias wrote:

 I have got the following error whenever I try to run a Julia Script with
 the editor LightTable:

 Couldn't connect to Julia

 ERROR: REPLCompletions not defined
  in anonymous at no file
  in include at boot.jl:238
  in include_from_node1 at loading.jl:114
  in include at boot.jl:238
  in include_from_node1 at loading.jl:114
  in reload_path at loading.jl:140
  in _require at loading.jl:58
  in require at loading.jl:43
  in include at boot.jl:238
  in include_from_node1 at loading.jl:114
  in process_options at client.jl:303
  in _start at client.jl:389
 at /home/diego/.julia/v0.2/Jewel/src/completions.jl:106
 at /home/diego/.julia/v0.2/Jewel/src/Jewel.jl:9
 at /opt/LightTable/plugins/Jewel/jl/init.jl:20


 I have cloned the repositories Jewel, Jupiter-LT and June-LT from the
 sources and put them into the folder /opt/LightTable/plugins/ where it is
 supposed they should be.