Thanks Yichao, and thank you very much for the links.
On Saturday, October 22, 2016 at 5:38:58 PM UTC+1, Yichao Yu wrote:
>
> On Sat, Oct 22, 2016 at 12:26 PM, Cristóvão Duarte Sousa
> <cri...@gmail.com > wrote:
> > Thanks, Yichao.
> >
> > Rereading my first
Thanks, Yichao.
Rereading my first question and reading your second answer I think may have
been not clear in the first one.
In the first question, I wanted to ask not about the current state but
rather about the future goal of the development.
Is your "no" about the current state or are you
I would like to get some advice on how to integrate Julia into an existing
application written in C++.
I mainly work in image processing and computer vision applications.
May traditional way of working is to do the exploratory prototyping in a
high-level language, and then, when algorithms
I can't help you at all, but I would like to ask if you pass
the cfunction() result to the C side.
I've been playing with embedding Julia and discovered I could call
a cfunction() directly from C, although I'm not sure that's a good
practice.
On the other hand, it works ok for the mean function:
r = rand(10)
test(r) = mean( t^2 for t in r )
@code_warntype test(r) # return type Float64 is inferred
On Thursday, September 22, 2016 at 7:21:36 PM UTC+1, Christoph Ortner wrote:
>
> I hope that there is something I am missing, or making a
It may have been already proposed sometimes, for some other things (and
possibly by myself), but, what about a module that simple defines
*macro ~(x,y); div(x,y); end*
? Enabling code like *4~3*.
Would it be considered idiomatic enough to use such available option?
On Tue, Apr 5, 2016 at 9:19
> For the julia example isn't matlab like concatenation using ';' being
> removed from julia?
>
No. Just the concatenation using ','
(AFAIK)
> Decisions that in my opinion were made by people who do not write
research-code:
> 1. Indexing in Julia. being 1 based and inclusive, instead of 0 based and
not including the end (like in c/python/lots of other stuff)
> 2. No simple integer-division operator.
I do not understand why this is
I don't know if it has been said here before, sorry if I'm repeating, but:
a way to represent the "concrete" syntax tree, convert it to AST and then
back would be of great use here,
see https://github.com/JuliaLang/JuliaParser.jl/issues/22 .
I actually thought a lot about that, and imagine that
t; On Fri, Feb 12, 2016 at 5:17 AM, Cristóvão Duarte Sousa
> <cris...@gmail.com> wrote:
> > I don't know if it has been said here before, sorry if I'm repeating,
> but:
> > a way to represent the "concrete" syntax tree, convert it to AST and then
> > back would
de
> file: Symbol none
> line: Int64 1
> 2: Symbol x
> typ: Any
> typ: Any
>
> -erik
>
> On Fri, Feb 12, 2016 at 10:25 AM, Cristóvão Duarte Sousa
> <cris...@gmail.com> wrote:
> > Yes, but then where such Exprs will plac
Maybe this:
type BadInt end
const badint = BadInt()
const _badint_val = 6
Base.(:+)(::BadInt, x) = _badint_val - x
badint + 5 # -5
On Wednesday, December 9, 2015 at 8:51:47 PM UTC, milktrader wrote:
>
> Ok, thanks. Can you do the following then?
>
> 1. restrict the value of Foo to an Int64?
Cedric St-Jean, thank you for the "Python Paradox" link. It was a very good
read, and linked to another article "Revenge of the
Nerds" http://www.paulgraham.com/icad.html which makes me think that Julia
is a kind of "Lisp meets Fortran".
On Tuesday, December 1, 2015 at 9:43:51 PM UTC, Cedric
f correct branch hits. If you mean to totally
>> defeat the branch prediction, I think you should use something
>> pseudorandom.
>> On Nov 6, 2015 12:27 PM, "Cristóvão Duarte Sousa" <cris...@gmail.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I've
The times for Julia code in my previous email are wrong, I wanted to write:
0.000126 seconds
0.004695 seconds (99.49 k allocations: 1.518 MB)
0.000871 seconds
On Sun, Nov 8, 2015 at 10:19 PM Cristóvão Duarte Sousa <cris...@gmail.com>
wrote:
> I agree, in fact my knowledge about branch p
Hi,
I've been wondering how Julia dispatching system would compare to the C++
virtual functions dispatch one.
Hence, I write a simple test in both Julia and C++ that measures the
calling of a function over the elements of both an array of concrete
objects and another of abstract pointers to
of Julia's dispatch – where do you
>> stick the vtable? Most of the time we get performance by avoiding dispatch
>> entirely, by pushing the dispatch up as far as possible, but there are
>> cases like what you've create here, where that doesn't work.
>>
>>
>>
which can be so-much-more-elegantly solved by
multiple dispatch in Julia.
On Fri, Nov 6, 2015 at 5:43 PM Cristóvão Duarte Sousa <cris...@gmail.com>
wrote:
>
> Around 0.000400 seconds (but sometimes 0.001000).
>
>
>
> On Fri, Nov 6, 2015 at 5:39 PM Stefan Karpinski <
Not a direct solution to your issue, but what can be done is, using
Reactive.jl and Interact.jl, display a string signal in one cell (e.g, label
= Input("qwerty")) and then in another cell push to that signal (e.g.,
push!(label,
"new text")) which will readily update the text being displayed
Thanks Simon!
I would like to highlight one reason for the importance of speedy small
(and fixed) arrays.
Having done some work in MATLAB and knowing that vectorization is almost
always the way to go in it, I got very happy when using Julia I could start
programming in the same way I think.
th no time plan for an implementation.
>
> On Thu, 2015-09-03 at 11:38, Cristóvão Duarte Sousa <cris...@gmail.com>
> wrote:
> > (This was already asked in Julia Gitter, but I'm switching to the mailing
> > list as this may better fit here than in a chat.)
> >
> > "
(This was already asked in Julia Gitter, but I'm switching to the mailing
list as this may better fit here than in a chat.)
"""
Is it possible to constraint the type of a bits type parameter? Something
like f{N::Int}(x::SomeParamType{N}) where for N::Int I want to mean that N
is an instance of
This is the same issue that prevents a fast symbolic system using Julia
dynamic dispatch: https://github.com/jcrist/Juniper.jl/issues/1 . And I
guess it is probably the reason Julia self AST representation is not using
its own dynamic dispatching system...
+1 for trying a faster run-time
Indeed, x^2 seems to be an optimization case in NumPy. See, for x^3:
Julia:
julia @timeit y = x.^3
1000 loops, best of 3: 265.99 µs per loop
Python:
In [1]: %timeit y = x**3
1000 loops, best of 3: 259 µs per loop
On Monday, March 16, 2015 at 4:08:55 PM UTC, Sisyphuss wrote:
Here is my
I usually draw with Compose.jl and then overlay the draw to an Images.jl
image with a function I'd made:
using Images, TestImages, Compose, Color
import Compose.compose
function compose(img::Image, c::Context)
width, height = size(img)
surface = Cairo.CairoARGBSurface(zeros(Uint32,
I like the static keyword to declare constant type variables.
Maybe you can say something at
https://github.com/JuliaLang/julia/issues/964 as this seems something
planed.
On Monday, December 15, 2014 9:40:50 PM UTC, Greg Plowman wrote:
Hi,
I understand using global variables can lead to
That is really nice!
But let me alert that, at least in my case (Julia 3.2), I had to add *using
Interact* so that the plot is correctly displayed.
Cheers,
Cristóvão
On Thursday, November 27, 2014 4:59:00 AM UTC, Sheehan Olver wrote:
I figured out an approach that works for animation, thanks
Hi,
I was able to do it using Interact, Reactive and Winston in IJulia.
For example, in one input cell run
using Interact, Reactive, Winston
p = Input(0.0:0.0)
function f(x)
plot(sin(5*x), sin(2π*x))
xlim(-1, 1)
ylim(-1, 1)
end
lift(f, p)
and then, in another cell, run your
interpolation
algorithm.
--Tim
On Wednesday, November 12, 2014 03:57:05 AM Cristóvão Duarte Sousa wrote:
Hi,
I would like to get the interpolated value at a non-integer point of an
image.
Using Images.jl and Grid.jl I've tried doing
using Images, TestImages, Grid
img = convert(Image
Hi,
I would like to get the interpolated value at a non-integer point of an
image.
Using Images.jl and Grid.jl I've tried doing
using Images, TestImages, Grid
img = convert(Image{Gray},testimage(mandrill)) # for example
img_bi = CoordInterpGrid((1:size(img,1), 1:size(img,2)), img.data,
Doing import.bar in the user dfined code side seems to solve the problem.
I expected that exporting bar out of the module would also solve the
problem, however, it doesn't.
On Saturday, July 26, 2014 10:01:50 PM UTC+1, Abe Schneider wrote:
I have a pattern that has come up multiple times where
Sorry, I mean import testmod.bar .
On Sunday, July 27, 2014 12:32:52 AM UTC+1, Cristóvão Duarte Sousa wrote:
Doing import.bar in the user dfined code side seems to solve the problem.
I expected that exporting bar out of the module would also solve the
problem, however, it doesn't
First, thanks for your very nice work.
Second, sorry for the little OT but, I notice IJulia output key not found:
user_variables in the first cell. I also get that but I thought it was a
problem with my system. Is anyone else also getting that?
On Friday, June 20, 2014 11:24:14 PM UTC+1,
Hi,
julia findin([0 0 1 0 1], 1)
2-element Array{Int64,1}:
3
5
On Thursday, June 19, 2014 3:32:22 PM UTC+1, paul analyst wrote:
How to Do a vector indicating the position of a particular value (eg 1) in
another
vector?
by this question: (1)? [0 0 1 01]
expected vector [3,5]
Paul
Notice also that convert(t, 4) just returns a SubString{ASCIIString} and
not a Uint64.
On Tuesday, June 17, 2014 7:37:59 PM UTC+1, Jack Holland wrote:
Does anyone have an explanation for why a type variable (e.g. Uint64) acts
differently when accessed in an array (e.g. [Uint64]) than by
I've just done measurements of algorithm inner loop times in my machine by
changing the code has shown in this commit
https://github.com/cdsousa/Comparison-Programming-Languages-Economics/commit/4f6198ad24adc146c268a1c2eeac14d5ae0f300c
.
I've found out something... see for yourself:
using
problem since it uses reference counting.
On Tue, Jun 17, 2014 at 12:21 PM, Cristóvão Duarte Sousa cri...@gmail.com
javascript: wrote:
I've just done measurements of algorithm inner loop times in my machine
by changing the code has shown in this commit
https://github.com/cdsousa/Comparison
Thanks Ivar. I see the issue is under investigation.
On Mon, Jun 16, 2014 at 11:15 AM, Ivar Nesje iva...@gmail.com wrote:
See also #964 https://github.com/JuliaLang/julia/issues/964
Ivar
kl. 11:48:47 UTC+2 mandag 16. juni 2014 skrev Cristóvão Duarte Sousa
følgende:
While I've been used
torsdag 12. juni 2014 skrev Cristóvão Duarte Sousa
følgende:
Thanks for the explanation, Keno.
I'm trying to implement a simulation of rigid body dynamics (a robot in
this case) in (almost) real time, so I'm planning to put the integration
algorithm inside a Timer which would repeat
}
Array{Any,1}
Array{Int64,1}
So, it's not the same (unless one takes care of declaring variables as
local)...
On Friday, June 13, 2014 11:44:30 AM UTC+1, Cristóvão Duarte Sousa wrote:
According to the performace tips, code must be inside functions and
variable must be local for better
Hi,
With Julia 0.3.0-prerelease+3609 (Commit 664cab5 (2014-06-10 05:18 UTC)) in
Arch Linux x86_64,
precompile() doesn't seems to effectively improve functions first call time.
For example, this code:
N = 10
A = rand(N,N)
B = rand(N,N)
function f(a, b)
c=a+b
c
end
@time precompile(f,
is relatively simple so type inference and codegen don't have to
work very hard as compared to the actual binary generation.
Maybe precompile in REPL mode should also do the final compilation, but
I hope that explanation is at least useful.
On Thu, Jun 12, 2014 at 10:47 AM, Cristóvão Duarte
I can generate the .pgf without having to setup the backend which I think
is the expected behavior. According to the docs:
Figures can also be directly compiled and saved to PDF with
plt.savefig('figure.pdf') by either switching to the backend...
So it seems its only needed to save the PDFs... You
Hi,
Were you aware that matplotlib itself has a PGF/TikZ backend
http://matplotlib.org/users/pgf.html ?
With it one does not need to use matplotlib2tikz, and one can save plots
either as PFG files, prepared to
be included in some LaTeX document, or directly as PDF.
It took me long time to
Ah, attention that both plt.rc(.. blocks in my examples are
completely optional, I just use them to better match the default LaTeX
visuals.
On Monday, May 12, 2014 1:38:54 PM UTC+1, Cristóvão Duarte Sousa wrote:
Hi,
Were you aware that matplotlib itself has a PGF/TikZ backend
http
)# but this works
println(PyPlot.matplotlib[:rcParams][axes.linewidth])
1.0
1.0
2.0
Sure, I should had report these issues in the first place but I got a
little lazy :p
On Monday, May 12, 2014 1:57:01 PM UTC+1, Steven G. Johnson wrote:
On Monday, May 12, 2014 8:38:54 AM UTC-4, Cristóvão Duarte Sousa wrote
I've wondered exactly the same. Google knows nothing about that...
On Wednesday, May 7, 2014 9:25:24 AM UTC+1, Ivar Nesje wrote:
What is
[image: Julia
Computing]http://juliacon.org/images/sponsors/juliacomputing.png
The third sponsor. It does not have a link.
Ivar
kl. 03:21:47
Hi, thanks for this package.
I've setup two repositories for using Coverage.jl with similar .travis.yml
files.
One works and do the reports well. The other gives an HTTP Parser
Exception (see [1])
when doing the report; which I can reproduce in my system doing
export TRAVIS_JOB_ID=30; julia -e
() - you are right, its a little subtle.
I'll reply here if I figure out the issue.
Thanks,
Iain
On Wednesday, May 7, 2014 9:41:34 AM UTC-4, Cristóvão Duarte Sousa wrote:
Hi, thanks for this package.
I've setup two repositories for using Coverage.jl with similar
.travis.yml files.
One
, all things Julia
does not do at the moment.
-Jake
On Friday, April 4, 2014 2:46:08 PM UTC-4, Cristóvão Duarte Sousa wrote:
Once again pythonistas feel the need for
a single high-level-high-performance language:
https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based
Friedrich,
Julia does not only use ideas from Python but also from other languages,
like Matlab, Lisp, ... (and of course it has it own state of the art,
unique and amazing techniques).
Since julia aims at technical problems, with lots of linear algebra, it
makes some sense to use * for
Indeed, `if x!=0` is so much more self-explanatory than `if bool(x)`.
Friedrich, I believe `if 5` has to work in C since C has no native
booleans (`a==b` returns an int).
On Saturday, April 5, 2014 11:59:14 PM UTC+1, Stefan Karpinski wrote:
You have a point – the bool function is meaningless
Once again pythonistas feel the need for
a single high-level-high-performance language:
https://tech.dropbox.com/2014/04/introducing-pyston-an-upcoming-jit-based-python-implementation/
I think the julian way is
y = convert(Tv, x)
On Thursday, April 3, 2014 10:11:20 AM UTC+1, Sergey Bartunov wrote:
Given the type Tv : FloatingPoint how can I automatically convert
variable x::FloatingPoint to Tv?
For me the most intuitive way is to write Tv(x), but this doesn't
work.
And let me add that, as far as I know, a call as ModInt{i}(...) is always a
call to a inner constructor of the type ModInt{i}. We cannot call external
constructors like that.
Moreover, external constructors seem be be ordinary generic functions and
one can even do stuff unrelated to the type
{3}(5.0)
n=3 k=5 T=Float64
ModInt{3}(2)
In this case, the *3* in the constructor call is referred to *n* (the type)
and not to *T*.
I had little hard time until I understood all of this :)
On Wednesday, April 2, 2014 9:52:25 AM UTC+1, Cristóvão Duarte Sousa wrote:
And let me add that, as far
.
But the question is answered: that's the julian way :)
Thanks
On Wednesday, March 19, 2014 8:59:10 PM UTC, Steven G. Johnson wrote:
On Wednesday, March 19, 2014 11:33:57 AM UTC-4, Cristóvão Duarte Sousa
wrote:
Sometimes I see myself writing one line if-elses like `if x0 x=-x end`,
which I think
not bad to put a semicolon before the end as well, but I don't know
that leaving it out has the same potential to cause trouble.
On Thursday, 20 March 2014 10:24:16 UTC+1, Cristóvão Duarte Sousa wrote:
Hum, ok.
Although the short-circuit is more or less known among several
programming languages
Hi,
Sometimes I see myself writing one line if-elses like `if x0 x=-x end`,
which I think is not very readable.
What is your advice for that?
That is ok, always put a semicolon after the condition or totally
avoid one liners?
BTW, have you Julia devs ever considered introducing a then keyword
Great approach John! I was not aware of the linear indexing of type fields,
that opens a lot of possibilities. Thanks
On Tue, Mar 11, 2014 at 3:51 PM, John Myles White
johnmyleswh...@gmail.comwrote:
For now, I suspect the easiest way to do this is to switch back and forth
between immutable
Please see https://github.com/JuliaLang/julia/issues/249
and https://github.com/JuliaLang/julia/issues/3424.
On Monday, March 10, 2014 12:24:20 PM UTC, Carlos Becker wrote:
Hello, I recently found out this:
julia b = rand((1024,1024))
julia sizeof(b)
8388608
julia @time b += 2;
How amazing! I have been about to post the very same question to this list!
So, I wouldn't say it's a stupid question at all :)
I believe this kind of packing/unpacking of several heterogeneous (in
structure, not in type) parameters appear a lot in modeling and
optimization.
This probably is a
By reading your question once again, I realised that it may be not quite
like mine.
If you are ok with using p.a, p.b, p.c, ... then the custom composite type
is the solution.
A more flexible approach (as I do) is the dictionary with symbols as keys
which would then be called by p[:a], p[:b],
For now, maybe you can do this
function f{S,T}(a::A{S}, v::T)
@assert T:S
# ...
end
On Thursday, February 27, 2014 5:39:35 AM UTC, Fil Mackay wrote:
type A{T}
end
function f{T}(a::A{T}, v::T)
end
a = A{Number}()
f(a, 3)
#no method f(A{Number}, Int64)
#while loading In[4],
Stefan, I've wondered if command literals couldn't be created with just a
new non-standard string literal, something like ccommand arg1 arg2.
The only problem I see is that then every double quote mark in the command
has to escaped (which will confuse the code though).
Even if I use the command
Hi,
I'm using Julia compiled from git in Arch linux, and in the last weeks I've
been getting almost random segmentation faults, mainly, but not only, when
running Pkg.update().
I've followed the procedures from
https://gist.github.com/staticfloat/6188418 (except for the Github issue
opening)
About block comment, you can define a macro like
macro comment(x) end
and use it to comment blocks:
@comment begin
some code
some code
end
@comment for i=1:10
some code
end
@comment function f()
some code
end
On Thursday, January 30, 2014 2:12:16 AM UTC, Rajn wrote:
Ok issue
triggering
any memory allocation.
--Tim
On Sunday, January 26, 2014 10:47:43 PM Cristóvão Duarte Sousa wrote:
BTW, I need that to compare against a column vector with 2
dimensions received from Python through SymPy.jl.
It is not a big issue, I can perfectly use [1 2 3]'.
I'm just
Hi,
I would like to do something like
f(x) = x+1
open(f.jld, w) do file
serialize(file, f)
end
then, close julia, open it again and do
open(f.jld, r) do file
f = deserialize(file)
end
f(1)
but that gives ERROR: f not defined
Is serialization supposed to be able to do this?
If yes,
69 matches
Mail list logo