Seems that Any[...] is not exactly equal to {...} in Julia 0.4. What is the
best way to rewrite {a b;c d} ?
julia> {1 [1,2];[1,2,3] 4}
WARNING: deprecated syntax "{a b; c d}".
Use "Any[a b; c d]" instead.
2x2 Array{Any,2}:
1 [1,2]
[1,2,3] 4
julia> Any[1 [1,2];[1,2,3] 4]
ERRO
For example, in Julia 0.3, I can use below function definition:
julia> f(::(Int...))="This is an Int tuple."
julia> f((1,2))
"This is an Int tuple."
julia> f((1,2,3))
"This is an Int tuple."
How to define a function with unlimited tuple length in Julia 0.4?
Great, looking forward the next version!!
My Julia is 0.3.9 so far.
On Wednesday, June 17, 2015 at 3:14:24 PM UTC+2, Seth wrote:
>
>
>
> On Wednesday, June 17, 2015 at 8:04:11 AM UTC-5, Jerry Xiong wrote:
>>
>> Today I spend many time to find a bug in my cod
Today I spend many time to find a bug in my code. It is turn out that I
mistakenly wrote sum(X,2) as sum(X.2). No any error information is reported
and Julia regarded X.2 as X*0.2. The comma "," is quite close to dot "." in
the keyboard and looks quite similar in some fonts. As there is no any
pril 26, 2015 at 10:22:34 AM UTC+2, Jerry Xiong wrote:
>
> Yes. I tried it, and it indeed went into an infinite recursion.
>
> On Sunday, April 26, 2015 at 10:06:57 AM UTC+2, Mauro wrote:
>>
>> > Thank you! For this question, invoke indeed a good solution :)
>> >
generic function. So above gets you into an infinite recursion.
>
> > On Sunday, April 26, 2015 at 8:40:06 AM UTC+2, Sam L wrote:
> >>
> >> See ?invoke.
> >>
> >> display(X::Vector)=length(X)>10?print("Too long to show."):
> >>
(X::Vector)=length(X)>10?print("Too long to show."):
> invoke(display, (Any,), X)
>
> On Saturday, April 25, 2015 at 10:41:39 PM UTC-7, Jerry Xiong wrote:
>>
>> For example, if I want to overload the Base.display(::Vector) to repress
>> the display when t
For example, if I want to overload the Base.display(::Vector) to repress
the display when the vector is too long, I coded as below:
julia> import Base.display
julia> display(X::Vector)=length(X)>10?print("Too long to show."):Base.
display(X)
display (generic function with 17 methods)
julia> disp
Hi, I am a computational biologist and I do my majority of jobs using Julia
right now. So far biojulia is not so practical but you can using BioPython
package. It is quite convenient and painless to call python package so far.
R packages are also necessary for bioinformatics. However, as I known
I notice that the logical operations in Julia have a different precedence
order from R and Matlab. & and | have higher precedence than .<, .>, etc.
For example, X.>0 & X.<1 will be parse as X .> (0 & X) .< 1 rather than
(X.>0) & (X.<1). I think there must be a reason for this anti-intuition
des
ct("foo"=>1, "bar"=>2)
> x≀:foo+2 #3
>
> In this case ≀: would pretend to be the operator you wanted.
>
> Thanks,
>
> Jiahao Chen
> Staff Research Scientist
> MIT Computer Science and Artificial Intelligence Laboratory
>
> On Wed, Apr 1, 2015 a
I sometimes miss the concise way to fetch the element in a dictionary, such
as dict$key in R and dict.key in Matlab. In Julia, I have to use
dict["key"] or dict[:key]. Although they are logically identical, the
concise way has both typing and visual conveniences. I can regard dict.key1
and dict
Many thanks!
On Monday, March 9, 2015 at 10:24:42 PM UTC+1, Steven G. Johnson wrote:
>
>
>
> On Monday, March 9, 2015 at 5:24:22 PM UTC-4, Steven G. Johnson wrote:
>>
>> On Monday, March 9, 2015 at 5:18:52 PM UTC-4, Steven G. Johnson wrote:
>>>
>>> Yes, I should probably define a "pycall" method f
My Julia version is :
Julia Version 0.3.6
Commit 0c24dca* (2015-02-17 22:12 UTC)
Platform Info:
System: Linux (x86_64-redhat-linux)
CPU: Intel(R) Xeon(R) CPU E7- 4830 @ 2.13GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
LAPACK: libopenblas
LIBM: lib
When I ran below codes:
using PyCall
@pyimport pylab as plb
cmap1=plb.get_cmap("jet")
pycall(cmap1,PyAny,0.5)
Every thing goes fine, output result
(0.4901960784313725,1.0,0.4775458570524984,1.0)
However, after I loaded PyPlot:
require("PyPlot")
cmap2=plb.get_cmap("jet")
pycall(cmap2,PyAny,0.5)
A
gt;
> > N = 1
> > @time concat1(N);
> > @time concat2(N);
> >
> > With N = 10, concat2 is almost instantaneous, and I couldn't be
> > bothered to wait for concat1 to finish.
> >
> > David.
> >
> > > On Thursday, Fe
0
> println(concat1(N))
> println(concat2(N))
>
> N = 1
> @time concat1(N);
> @time concat2(N);
>
> With N = 10, concat2 is almost instantaneous, and I couldn't be
> bothered to wait for concat1 to finish.
>
> David.
>
>
>>
>> On Thursd
I'll work in Berlin in this May. I work in computational biology. Right now
I almost do all my job in Julia instead Matlab. I'd happy to share if the
date is availble for me :)
Jerry
On Wednesday, February 25, 2015 at 2:35:13 PM UTC+1, David Higgins wrote:
>
> Hi all,
>
> I'm based at the Techn
Considering below code:
str="abc"
str*="def"
Is the new string "def" just be appended after the memory space of "abc",
or both strings were copied to a new momory space? Is str*="def" equal to
str=str*"def" and str="$(str)def" in speed and memory level? Is below code
in O(n) or in O(n^2) speed?
str="abc"
str*="def"
Is the new string "def" just be appended after the memory space of "abc",
or both strings were copied to a new momory space? Is str=str*"def" equal
to str*="def" in speed and memory level? Is below code O(n) or O(n^2)?
s=""
for i=1:1
end
Many thanks! We have two solutions now :)
The BinomialTest Package seems cool, hope that it can be more powerful
than, meanwhile as easy-understandable as, matlab statistics toolbox.
I want to calculate the 95% confidential intervals of the parameter p of a
binomial distribution, for a given x and n. I known that in MATLAT, it
could be got in the 2nd output of binofit(x,n,0.95)
Is there any way to do it in Julia, using Distributions.jl or any python
package?
22 matches
Mail list logo