Maybe send specific argument to the file then instead of checking argument
length and use the actual argument values to run code. Or define a global value
before including the file and check if it is defined and valued desirably so
that in included file some extra codes will run.
Hi Ian,
Its definitely safe to have it on 0.4. Are you putting it in /REQUIRE or
> /test/REQUIRE? You probably want to put it in the latter. (Apologies if I'm
> telling you something you already know!)
>
In "/REQUIRE" - this is for EasyPkg
(https://github.com/oschulz/EasyPkg.jl), so it's a spe
Thanks for replying.
It was solved by installing bash through Cygwin. It is working now.
On Thursday, December 17, 2015 at 11:02:52 PM UTC+5:30, Tony Kelman wrote:
>
> I suspect the remote ssh workers are not set up to work on Windows. It's
> trying to spawn `sh` which won't exist on Windows (tho
Hi all,
I set a Julia cluster on Windows 7 machines.
Julia Version 0.4.2
However, using the Image package on all node gives error.
My code is :
addprocs(["user@x.x.x.x"],tunnel = true, dir = "C:\\Julia-0.4.2\\bin",
exename = "julia")
@everywhere using Images
@spawnat 2 load"image.bmp")
I
That's because in the case of expressions, we are interested in the AST,
show representation is just an abstraction of that, there is also dump and
xdump:
julia> ex = :(:($x))
:($(Expr(:quote, :($(Expr(:$, :x))
julia> Meta.show_sexpr(ex); println()
(:quote, (:$, :x))
julia> dump(ex)
Expr
Notice all those messages about ImageMagick not being installed? E.g.,
WARNING: FileIO.NotInstalledError(:ImageMagick,"")
You can fix your problem by installing it.
If you try your code first in a single process, FileIO will prompt you to
install ImageMagick. This doesn't work in a multiprocess
Is the following code considered bad form in Julia?
immutable Foo
func::Function
end
foo = Foo(x->x^2)
foo.func(3)
This mimics the behavior of OOP since just like in OOP the internal method
cannot be changed (since the type is immutable). Sometimes it really does
make the most sense to attach
On Mon, Jan 18, 2016 at 10:08 AM, Anonymous wrote:
> Is the following code considered bad form in Julia?
Yes.
>
> immutable Foo
> func::Function
> end
>
> foo = Foo(x->x^2)
> foo.func(3)
>
> This mimics the behavior of OOP since just like in OOP the internal method
> cannot be changed (since the
If you revise the macro as Stefan suggests, would you post the revision as
a response here?
On Thursday, January 14, 2016 at 8:09:23 AM UTC-5,
richard@maths.ox.ac.uk wrote:
>
> This macro:
>
> macro clenshaw(x, c...)
> bk1,bk2 = :(zero(t)),:(zero(t))
> N = length(c)
> for k = N:-
On Friday, 15 January 2016 17:14:26 UTC-6, Yichao Yu wrote:
>
> FYI, don't call eval in functions
>
What's wrong with calling eval in functions when you're evaluating
expressions without side-effects?
And where do your interests lie?
On Sunday, January 17, 2016 at 4:11:37 PM UTC-5, Patrick Kofod Mogensen
wrote:
>
> What do you study?
>
> On Sunday, January 17, 2016 at 8:47:05 PM UTC+1, noufal n wrote:
>>
>> I'm a student and i wish to study and contribute to julia community. As a
>> part my p
wow that is crazy complicated
On Mon, Jan 18, 2016 at 10:42 AM, Eric Davies wrote:
>
>
> On Friday, 15 January 2016 17:14:26 UTC-6, Yichao Yu wrote:
>>
>> FYI, don't call eval in functions
>
>
> What's wrong with calling eval in functions when you're evaluating
> expressions without side-effects?
Orders of magnitude slower
No
On January 18, 2016 at 17:08:46, Anonymous (espr...@gmail.com) wrote:
This mimics the behavior of OOP since just like in OOP the internal method
cannot be changed (since the type is immutable). Sometimes it really does make
the most sense to attach a function to an instance of a type...
I don’t
On Mon, Jan 18, 2016 at 11:01 AM, Joshua Ballanco wrote:
> On January 18, 2016 at 17:08:46, Anonymous (espr...@gmail.com) wrote:
>
>
> This mimics the behavior of OOP since just like in OOP the internal method
> cannot be changed (since the type is immutable). Sometimes it really does
> make the
This was cross-posted on Stack Overflow and answered
there:
http://stackoverflow.com/questions/34755454/how-to-run-a-function-in-parallel-with-julia-language/34772735
Charles, I believe the community preference is that you choose one medium
or the other, and do not cross post questions like thi
I also wanted to do what you're doing when I started with Julia. I came
from Java, so I'm used to the foo.func() syntax.
Here is a good way to do what I think you want with very similar syntax.
immutable Foo
end
func(::Foo, x) = x^2
foo = Foo()
func(foo, 3.)
You can also encapsulate parameters w
This came up as I was trying to define a sphere manifold type which can
have distinct metric structures put on it, here is how I have to do it in
Julia:
abstract Manifold
abstract Metric
immutable Metric1 <: Metric
end
immutable Metric2 <: Metric
end
immutable Sphere{T<:Metric} <: Manifold
d
Erik,
The array declaration line in the Fortran code is something like
integer,parameter:: fp_kind = kind(0.d0)
real(fp_kind):: v1(3,-n:n)
Does this appear to use any Fortran 90-specific features?
I also tried declaring the type as Float64, then doing
pointer_to_array(v1,3) gives me a 3x1
I think in this case it does make sense to attach a function to an
object. (This is different from the OO discussion above, which is
about attaching a function to a type.)
immutable Sphere <: Manifold
dim::Int
metric::Function
end
sphere::Sphere
sphere.metric = ... implementation ...
sphe
Chris
This array does not use Fortran 90 features; you're fine. Note that
the array indices will be different in Julia -- -n:n will be 1:(2*n+1)
instead.
What is "n" in your setup? You should declare the array size as
3*(2*n+1) in Julia, or as 2d-array via 3, 2*n+1.
-erik
On Mon, Jan 18, 2016 a
On Monday, January 18, 2016 at 11:54:49 AM UTC-5, Anonymous wrote:
>
> As you can see, I have to define a whole other type tree just so my metric
> function can distinguish between sphere manifolds depending on what metric
> structure I want it to have. It would be both simpler and make more sen
This is usually not what you want to do.
On Sunday, January 17, 2016, Steve Kelly wrote:
> It has always been this way because of multiple dispatch. However you can
> do something like:
>
> type Wallet
> dotTest::Function
> end
>
> Which might have ambiguous performance impact.
> On Jan 17, 20
It's gone now
:) https://github.com/invenia/VirtualArrays.jl/pull/2#event-518201512
On Monday, 18 January 2016 09:47:15 UTC-6, Yichao Yu wrote:
>
> On Mon, Jan 18, 2016 at 10:42 AM, Eric Davies > wrote:
> >
> >
> > On Friday, 15 January 2016 17:14:26 UTC-6, Yichao Yu wrote:
> >>
> >> FYI, d
this is a good solution, although it prevents the user from defining their
own custom metric.
On Monday, January 18, 2016 at 9:33:05 AM UTC-8, Matt Bauman wrote:
>
> On Monday, January 18, 2016 at 11:54:49 AM UTC-5, Anonymous wrote:
>>
>> As you can see, I have to define a whole other type tree j
Steve,
afaik, depending upon the hash implementation, the only advantage might be
moderately faster lookup but the cost in generality often would outweigh
that.
On Thursday, January 14, 2016 at 10:44:01 PM UTC-5, vav...@uwaterloo.ca
wrote:
>
> Could I ask what would be an application of this c
I wrote the Julia scripts below that just test the performance of the
matrix multiplication in four cases (A' stands for A transpose, and B'
stands for B transpose):
1. A x B
2. A' x B
3. A x B'
4. A' x B'
I ran these scripts multiplying two 1,000 x 1,000 matrices 20 times, i.e.:
I am a new user to Julia. I was wondering if you guys know a mechanism
where I can run a Julia script from the web. My goal is for the user to go
to a website pass in inputs and based on those inputs I run the script on
the web and display the result.
Hey guys, I am new to Julia. I was wondering if there is a way to run a
Julia script on the backend of a web page? My goal is for the users of the
web page to pass in parameters as inputs to the Julia script and then run
the script on the web and display the results. I am totally new to Julia
a
Does anyone knows what this message below can mean ? Apparently the same
code runs with a previous version of Julia, 0.4.0 i think. Now i am running
the latest 0.4.3
The line error in MyNetworkcns.jl is fake as that is simply the last line
of the file itself
Thanks
Fabrizio
ERROR: LoadError
Thanks Erik. n, in this case, is zero, so I'm expecting a 3x1 array.
On Monday, January 18, 2016 at 12:26:33 PM UTC-5, Erik Schnetter wrote:
>
> Chris
>
> This array does not use Fortran 90 features; you're fine. Note that
> the array indices will be different in Julia -- -n:n will be 1:(2*n+1)
#
#IMPLEMENTATION CODE:
#
module Y
export modify
"""
A LOT OF CODE HERE, REMOVED FOR SIMPLICITY
"""
function _modify(expr)
is_lambda,f,args,body = decompose_function(expr)
if is_lambda
quote
($(args...)) -> $(transform(body))
end
else
quote
function $(
Hi,
Suppose I want to fill the columns of a matrix which size I don't know
beforehand:
A = zeros(3,0)
for i=1:n
A = [A [1,2,3]]
end
Is there a memory efficient way of doing that in Julia?
I understand that the above syntax is allocating 3*i entries at iteration i
which gives 3*(1+2+...+n) =
There are many ways to do something like that, and if your users will
accept to log in with google accounts, I believe the easiest one may be
running everything on JuliaBox.org
This is how well it can be done. Snapshot:
https://jiahao.github.io/julia-blog/2014/06/09/the-colors-of-chemistry.htm
Hi,
first of all, I am new to Julia (and Fortran). I tried to follow OP's
example and call Fortran from Julia. First, I was using the Intel Fortran
compiler and tried to compile the following .f90 file (saved as f90tojl.f90)
module m
contains
integer function five()
five = 5
end fun
Yes, I will rely on the classical hcat() approach...
A = []
for i=1:n
push!(A, [1,2,3])
end
A = hcat(A...)
Thank you.
2016-01-18 11:42 GMT-08:00 Júlio Hoffimann :
> Hi,
>
> Suppose I want to fill the columns of a matrix which size I don't know
> beforehand:
>
> A = zeros(3,0)
> for i=1:n
>
Hi Fabrizio,
You didn't really provide enough information for anyone to help you here.
Your best bet would be to provide a short snippet of code which has the
problem.
Cheers,
Kevin
On Mon, Jan 18, 2016 at 10:39 AM, Fabrizio Lacalandra <
fabrizio.lacalan...@gmail.com> wrote:
> Does anyone kn
As long as each row has a fixed, known size, you could do
a = []
for i=1:n
append!(a, [1,2,3])
end
A = reshape(a, 3, n)
The 1-D array grows as needed, and reshape still points to the original
data, so no copying is done.
Cheers,
Kevin
On Mon, Jan 18, 2016 at 12:48 PM, Júlio Hoffimann wr
That is a good catch Kevin, thanks!
2016-01-18 12:53 GMT-08:00 Kevin Squire :
> As long as each row has a fixed, known size, you could do
>
> a = []
> for i=1:n
> append!(a, [1,2,3])
> end
> A = reshape(a, 3, n)
>
> The 1-D array grows as needed, and reshape still points to the original
> dat
Hello all, I had a question concerning a best practice in a particular case
of multiple dispatch which is as follows.
Let's say I have a function with two different methods.
function my_func(fcn1::Function,fcn2::Function, passedIn::Float64)
x = 0.0
y = 1.0
z = 2.0
val1 = fcn(x, y, passedIn)
Define the second function like this:
```
my_func(fcn1::Function, passedIn::Float64) = my_func(fcn1,
default_fcn, passedIn)
```
-erik
On Mon, Jan 18, 2016 at 4:02 PM, Christopher Alexander
wrote:
> Hello all, I had a question concerning a best practice in a particular case
> of multiple dispatc
Thanks for the response! As a follow-up, what would I do in a situation
where the passed-in second function (fcn2) and the default function take a
different number of arguments?
Thanks!
Chris
On Monday, January 18, 2016 at 4:06:41 PM UTC-5, Erik Schnetter wrote:
>
> Define the second function
Thanks for the tips. I guess this is a sign of destiny: time for me to look
deep into PortAudio.
On Sunday, 17 January 2016 22:01:04 UTC, STAR0SS wrote:
>
> When dealing with small packages you often need to look at the code,
> because the documentation is sometimes lacking.
>
> AudioIO.jl uses
my_func(fcn1::Function, passedIn::Float64) =
my_func(fcn1, (y, z, passedin)->default_fcn(0.0, y, z, passedin),
passedIn)
You could achieve the same effect in one definition if you put fcn2 as a
keyword argument. Also check out FastAnonymous.jl if performance matters.
On Monday, January 18,
We're missing your `decompose_function` so I couldn't run it, but from the
last time I worked with function-definition macros, I believe the correct
way to write it should be to add `esc` to the arguments so that it doesn't
apply hygiene, this way:
function $(esc(f))($(map(esc, args)...))
Unfo
I can't reproduce this at the REPL or if I put your loop in a function. (I can
replicate your result---in my case a factor of 3---if I run your scripts.) But
since you're also measuring JIT-compiling time, I'm not sure how seriously to
take that (and it's kinda irrelevant anyway, since you never
I think you need to specify the path that points to the module, not just the
module name.
Hi Kevin,
thanks, the code is way too complicated but i think i have isolated the
issue that seems not pure julia but of JuMP. Try to involve the developers
cheers,
Fabrizio
On Monday, January 18, 2016 at 7:39:39 PM UTC+1, Fabrizio Lacalandra wrote:
>
> Does anyone knows what this message below
I'm trying to execute an anonymous function on a worker from within a
module:
getCores(pid) = remotecall_fetch(pid, ()->CPU_CORES)
module Banana
export getCores2
getCores2(pid) = remotecall_fetch(pid, ()->CPU_CORES)
end
Firstly, is using anonymous function,()->CPU_CORES, as above a go
Am I missing something, or why isn't there this solution:
@enum Metric RIEMANNIAN LORENTZIAN # ...
immutable Sphere{Matric}
dim::Int
end
function metric(s::Sphere{RIEMANNIAN})
end
function metric(s::Sphere{LORENTZIAN})
end
Am Montag, 18. Januar 2016 16:08:38 UTC+1 schrieb Anonymous:
>
> Is
An alternative would be to interact with the sound card using sox (
http://sox.sourceforge.net/). In the past, I used sox from Octave to record
and play audio simultaneously. Let me know if you'd like to see the code; I
can probably dig it out of my old backups.
-- mb
On Sun, Jan 17, 2016 at 1:30
I discovered this with matrices that were not random, but this simple test
illustrates the problem: julia aborts when it tries to diagonalize a
705x705 matrix
mat = rand(704,704)
mat = mat' + mat
e = eigfact(mat)
@show "done 704"
mat = rand(705,705)
mat = mat' + mat
e = eigfact(mat)
@show "don
I am trying to use the python MNE library in Julia.
When I call the python function it returns a `Dict{Any,Any}` instead of a
type `info`, when I pass this variable back to another python function I
get the error
ERROR: PyError (:PyObject_Call)
> TypeError("info must be an instance of Info, n
Hi Steven,
This seems to be a problem with specific machines--I don't run into it, for
example.
Are you on a Mac? If so, check out
https://github.com/JuliaLang/julia/issues/14507 and
https://github.com/staticfloat/homebrew-julia/issues/194 and see if they're
the same issue. If they are, can you
Chris
In this case, you could write an auxiliary third function that takes
an additional Bool parameter. Both your functions call the third
function with this Bool parameter.
An alternative solution is to make this a Val{Bool} parameter, which
would likely specialize the functions at build time.
AudioIO is going to be going deprecated soon in favor of a family of packages
that are each a bit more focused and simpler to interface with. They’re not
quite release-ready but have been making a lot of progress lately, and I wanted
folks to know what’s coming before you sink a bunch of time in
Yes, it looks like the same thing. If I do norm(zeros(129,129)) on my
machine, I also get an Abort. Also eigfact(zeros(129,129)).
My machine is a Mac:
versioninfo()
Julia Version 0.4.2
Commit bb73f34 (2015-12-06 21:47 UTC)
Platform Info:
System: Darwin (x86_64-apple-darwin13.4.0)
CPU: Intel
On Monday, January 18, 2016 at 6:03:15 PM UTC-5, Rob wrote:
>
> I am trying to use the python MNE library in Julia.
>
> When I call the python function it returns a `Dict{Any,Any}` instead of a
> type `info`, when I pass this variable back to another python function I
> get the error
>
You ca
Thanks Tim for the quick reply.
I rewrote the same four cases as functions, ran them once for the JIT
compilation and now the results are consistent (and pretty good) - I also
kept the code from the old case a' x b' at the end and you can see how much
slower it is on my computer (but now I under
The issue is that there is no cross section of metrics, one from each
manifold, which can all be grouped under the heading of RIEMANNIAN, same
with LORENTZIAN, etc. Each manifold will have its own set of idiosyncratic
metrics, and the user might require the functionality of being able to
custo
In this case you can try:
abstract Metric
immutable Sphere{M <: Metric}
dim::Int
end
immutable Riemannian <: Metric end
function metric(s::Sphere{Riemannian}) = ...
immutable Lorentzian <: Metric end
function metric(s::Sphere{Lorentzian}) = ...
In fact, you don't need to declare "Metric";
Yes I am starting to see that - Julia has math-like syntax.
I asked the question on SO and got an answer to use `MacroTools.jl`
So now its just `@> wallet dotTest!(5)`
I am loving the macro system. This is what we need to proceed with
language development.
I am coming from the Scala world, an
Code
x = [0.0 0.2 0.4 1.0 1.6 1.8 2.0 2.6 2.8 3.0 3.8 4.8 5.0 5.2 6.0 6.2 7.4
7.6 7.8 8.6 8.8 9.0 9.2 9.4 10.0 10.6 10.8 11.2 11.6 11.8 12.2 12.4];
y = [-0.183 -0.131 0.027 0.3 0.579 0.853 0.935 1.133 1.269 1.102 1.092
1.143 0.811 0.91 0.417 0.46 -0.516 -0.334 -0.504 -0.946 -0.916 -0.975
-1.
Code:
x = [0.0 0.2 0.4 1.0 1.6 1.8 2.0 2.6 2.8 3.0 3.8 4.8 5.0 5.2 6.0 6.2 7.4
7.6 7.8 8.6 8.8 9.0 9.2 9.4 10.0 10.6 10.8 11.2 11.6 11.8 12.2 12.4];
y = [-0.183 -0.131 0.027 0.3 0.579 0.853 0.935 1.133 1.269 1.102 1.092
1.143 0.811 0.91 0.417 0.46 -0.516 -0.334 -0.504 -0.946 -0.916 -0.975
-1
What happens, what error do you get?
On Monday, January 18, 2016 at 9:40:37 PM UTC-5, jmarcell...@ufpi.edu.br
wrote:
>
>
>
> Code:
>
> x = [0.0 0.2 0.4 1.0 1.6 1.8 2.0 2.6 2.8 3.0 3.8 4.8 5.0 5.2 6.0 6.2 7.4
> 7.6 7.8 8.6 8.8 9.0 9.2 9.4 10.0 10.6 10.8 11.2 11.6 11.8 12.2 12.4];
> y = [-0.183 -
Any updates on Julia for the Phi? I know that MKL automatic offload works,
but am looking for the whole thing. I do research in stochastic dynamical
systems (easy to parallelize) and have a 5110 working, so I am ready to
test it once Julia has it!
Jeffrey,
Your interpretation is that the original poster wanted to read or write
dictionary entries that had already been found via previous hashing and
searching without again hashing the key (presumably in order to attain
higher performance). That was also my guess. I am interested in this
Hi all,
I've been playing with Cxx.jl (https://github.com/Keno/Cxx.jl) for a couple
of months and I'd like to share my work to everyone, in particular for
those who might interested in developing Julia wrappers for C++ libraries.
In most of playing with Cxx, I have been developing Julia package
Hi Tim,
Thanks for replying.
All nodes have the package 'Images' and 'ImageMagick' installed and working
in them. I am able to load images on all nodes locally.
This issue occurs when including the Image package on a remote system only.
A lot of warning appear at the time Images are loaded
Th
69 matches
Mail list logo