Hmmm, good to know. Thank you.
The rationale for doing so is to provide a shortcut for the elements of a
variable `children`. Specifically, for a grammar, I might have a rule like:
```
@grammar foo begin
number = r[0-9]+ { parseint(children[1]) }
end
```
What I would like to have instead,
Thanks, Jameson--it's nice to have a response from someone who actually
works on the compiler.
Cheers,
Kevin
On Fri, Mar 6, 2015 at 8:09 PM, Jameson Nash vtjn...@gmail.com wrote:
I'd put together one version of a gist of how this could work in the past,
and Jeff's mentioned a similar
ele...: I did not know about this sys.modules thing. Good to know.
Josh ele...:
Agreed. I don't think pollution happens until the using modX call
happens. So, I don't really understand why we can't have scope-level
using commands.
And yes, maybe Julia *should* use a different keyword than
Afaik there are only a couple of ways to deal with this issue:
1) Define all types beforehand, as you mention
2) Define an abstract type ahead of time that your future type is a subtype
of.
For example:
abstract AbstractBar
type foo end
f(arg1::foo, arg2::AbstractBar)
yadda yadda
end
nargout can be emulated by (ab)using the iteration protocol on a
custom return type that will be accessed through tuple
assignment/destructuring.
Take this example:
tpl = (1,2)
a,b = tpl
the second line will call start(), done() and next() on tpl to extract
the two numbers.
So, for your use
You are right, I had defined it earlier and apparently the redefinition
restriction does not apply to empty immutables. Anyway, this should work:
macro deftype(name)
esc(:(immutable $name end))
end
On Fri, Mar 6, 2015 at 8:19 PM, Kaj Wiik kaj.w...@gmail.com wrote:
Thanks for the reply!
Hi Robert,
You're using Julia v0.4, right? This is actually a bug introduced
recently, by https://github.com/JuliaLang/julia/commit/42b3d905 (which
itself was trying to fix a deprecation warning). It should be an easy
fix--are you up for it? If not, could you submit a bug report?
Cheers,
This is essentially the method used by Python (as I believe I understand
it, import is the worst documented thing in Python). Python puts a
reference to all modules into sys.modules, no matter where they are
imported. And sys.modules is always the first thing searched before path.
So all
I'd put together one version of a gist of how this could work in the past,
and Jeff's mentioned a similar draft idea he had in an early design
document. In the end, however, I think this just ends up falling in the
category of features that just aren't actually desirable to have. It adds
On Fri, Mar 6, 2015 at 11:43 AM, J Luis jmfl...@gmail.com wrote:
Is there any fundamental reason why the nargout mechanism cannot (or is
very hard) to implement?
Because if not I really think it would be very very handy to have it.
While we can workaround the nargin concept with the multiple
On 7 March 2015 at 01:57, Steven G. Johnson stevenj@gmail.com wrote:
Is there any reason why blas_set_num_threads(1) would not be sufficient to
disable additional cores?
Given the code [1], I would say no. I do however always have `export
OPENBLAS_NUM_THREADS=1` in my `.bashrc`, since I
Thanks for the reply!
Hmm, well my intention was to build the definition piecewise inserting the
fields after this line without end, now I see that it will not work.
Perhaps I should make a template and push! fields to ex.args[3].args?
In fact your suggestion does not work in my Julia:
julia
Should be fixed now, thanks
On Friday, March 6, 2015 at 8:52:39 PM UTC-5, Kevin Squire wrote:
Hi Robert,
You're using Julia v0.4, right? This is actually a bug introduced
recently, by https://github.com/JuliaLang/julia/commit/42b3d905 (which
itself was trying to fix a deprecation
Hi,
I've run into a weird problem: When making a new package with
Pkg.generate(name, license)
the first non-empty Git commit writes my name with commas between every
character:
authors: R, o, b, e, r, t
My Git user name has been specified as
git config --global user.name Robert
I've tried
It depends a little bit on what you mean by better:
- Using the first one will cause specialized functions to be compiled for each
version
- Using the second one will use generic fallback code every time you access b
Consequently, the first should give faster performance at runtime, but have a
That was the perfect resource, thank you Tim Holy!
Here's a question about a specific situation:
Suppose I have a type that has two String variables, but at construction,
these might not be the same type of Strings (e.g. one might be ASCIIString,
the other SubString{ASCIIString}). Which
ok so now im doing import PyPlot, but have some problems with the latex
axis labels
this used to work before
ax[:set_xlabel](L$\kappa$)
while now it gives
@L_str not defined
so i tried
ax[:set_xlabel](PyPlot.L$\kappa$)
which gives
syntax: invalid interpolation syntax: \
On Friday, March 6,
Missing an `end` in both expressions.
julia macro deftype(name)
ex1 = :(immutable $name end)
end
julia @deftype foo
julia foo()
On Thu, Mar 5, 2015 at 5:02 AM, Kaj Wiik kaj.w...@gmail.com wrote:
I have been trying to write a macro that would generate fields in a
Hello colleague,
On Friday, March 6, 2015 at 2:05:19 PM UTC+1, Andrei Berceanu wrote:
Hi guys,
when I do
using Gadfly, PyPlot
i get
Warning: using PyPlot.plot in module Main conflicts with an existing
identifier.
And other warning of the same type. How can I solve this?
I
My pull has been merged: https://github.com/JuliaStats/HypothesisTests.jl
On Thursday, March 5, 2015 at 8:32:32 AM UTC-6, Benjamin Deonovic wrote:
I implemented the chisquare test in julia. I made a pull request in the
HypothesisTests package. It hasn't been pulled yet, but probably will be
Hi guys,
when I do
using Gadfly, PyPlot
i get
Warning: using PyPlot.plot in module Main conflicts with an existing identifier.
And other warning of the same type. How can I solve this?
I'm trying to create a set of variables (_1, _2, ...) from items within a
list in a macro. I have a (much) condensed version of the code:
macro testfn()
quote
i = 1
value = [1, 2, 3]
$(Expr(:(=), Expr(:symbol, Expr(:string, _, :i)), :value))
println(_1)
To get rid of name clashed you could e.g. also say
import Gadfly
using PyPlot
Like this plot will refer to PyPlot.plot, and you can use Gadfly.plot
anytime you need Gadfly's plot.
You can find more info here:
http://docs.julialang.org/en/release-0.3/manual/modules/#summary-of-module-usage
For my numerics class at MIT http://math.mit.edu/~stevenj/18.335/, I used
the following notebook to talk about cache effects and matrix
multiplication:
http://nbviewer.ipython.org/url/math.mit.edu/~stevenj/18.335/Matrix-multiplication-experiments.ipynb
It includes some code to benchmark
On Friday, March 6, 2015 at 9:42:34 AM UTC-5, Andrei Berceanu wrote:
ok so now im doing import PyPlot, but have some problems with the latex
axis labels
you could try
using LaTeXStrings
to pull in the L_str macro separately from PyPlot. (I'm not sure if there
is any nice syntax
On Thursday, March 5, 2015 at 4:58:10 PM UTC-5, Sheehan Olver wrote:
Hmm, maybe I’m posing the wrong problem then… I wanted a fast way to
calculate the null space of a sparse matrix, where the basis spanning the
null space is also sparse. And the dimension of the vector space is in the
Mybe you're looking for this pattern:
type Foo{T : String}
a::T
b::T
end
Foo(a::String, b::String) = Foo(promote(a,b)...)
If you don't know promote, here's an excerpt from help()
julia help(promote)
Base.promote(xs...)
Convert all arguments to their common promotion type (if
On Thursday, March 5, 2015 at 12:51:07 PM UTC-5, Iain Dunning wrote:
I don't think anything in JuliaOpt other than NLOpt is going to play
nicely with that non-convex L2 norm constraint.
Actually, I would tend to transform the problem to eliminate the equality
constraint:
min |Lx|_1 /
My story is similar. I have no reservations recommending Julia to
colleagues what-so-ever.
I write optimization software for a living, and I've used the basic parts
of Matlab or Python + addons in past, but always got so annoyed that I
switched back and forth between them for different
It seems to work fine on 0.4. On my dual core i5:
julia peakflops()
6.3990880531633675e10
julia blas_set_num_threads(1)
julia peakflops()
3.2582507660855206e10
-viral
On Friday, March 6, 2015 at 10:27:46 PM UTC+5:30, Steven G. Johnson wrote:
For my numerics class at MIT
Now that DistributedArrays.jl is a package - some of these things are much
easier to experiment with.
-viral
On Friday, March 6, 2015 at 2:47:05 AM UTC+5:30, Andreas Noack wrote:
I hope so. It is something we really want to do but I cannot promise when
we'll do it.
2015-03-04 17:01
I am using juliabox (v0.3.6)
On Saturday, March 7, 2015 at 12:10:16 AM UTC+5:30, Ivar Nesje wrote:
It works for me in the standard OSX terminal with a recent 0.4 version.
What kind of system (and julia version) are you on? (versioninfo() tells us
everything we need).
fredag 6. mars 2015
I think if they are julia job postings they're fine. General data science
job postings not so much. I think the right policy to follow here is the
LLVM mailing list. People are allowed to advertise their compiler jobs
where they need people with strong LLVM skills, but general job offerings
It works for me in the julia 0.3.6 REPL (on linux), but it does not seem to
work on IJulia.
Seems like a sane policy to me. If it gets out of hand (we should be so
lucky), then we can make a julia-jobs list and people post there. I'm also
personally excited about this particular job posting :-)
On Fri, Mar 6, 2015 at 1:50 PM, Keno Fischer kfisc...@college.harvard.edu
wrote:
I think if
I don't think the backspace character will be interpreted as you want it by
a web browser. It doesn't really make sense in a stored format like HTML.
fredag 6. mars 2015 19.46.28 UTC+1 skrev DP følgende:
I am using juliabox (v0.3.6)
On Saturday, March 7, 2015 at 12:10:16 AM UTC+5:30, Ivar
It works for me in the standard OSX terminal with a recent 0.4 version.
What kind of system (and julia version) are you on? (versioninfo() tells us
everything we need).
fredag 6. mars 2015 19.27.48 UTC+1 skrev DP følgende:
print(123,char(0x08),567)
println()
print(123,char(0x09),567)
Are job posting part of a dev mailing list?
On Friday, March 6, 2015 at 1:35:26 PM UTC-5, Tim wrote:
(Apologies for cross-posting.)
We seek candidates with expertise in Julia and/or high-performance
computing
to develop software for a broad community of users of an imaging facility
at
print(123,char(0x08),567)
println()
print(123,char(0x09),567)
123567
123 567
As per ASCII Characters,
ht horizontal tab
bs backspace
Why backspace is not working?
Am I doing something wrong?
(Apologies for cross-posting.)
We seek candidates with expertise in Julia and/or high-performance computing
to develop software for a broad community of users of an imaging facility at
Washington University in St. Louis. Challenges include working with big data
(multi-terabyte multidimensional
May be some issue with IJulia-Juliabox !!
On Saturday, March 7, 2015 at 12:22:56 AM UTC+5:30, Pablo Zubieta wrote:
It works for me in the julia 0.3.6 REPL (on linux), but it does not seem
to work on IJulia.
Hello,
I just included a Julia interface to the University of Florida Sparse
Matrix Collection in Matrix Depot
(https://github.com/weijianzhang/MatrixDepot.jl).
Here is the
documentation:
http://matrixdepotjl.readthedocs.org/en/latest/ufsparse.html#ufsparse
Please let me know if you have
I'll take it in the opposite direction of uniformity, and point out that
another useful approach is to pass the optional output in as an argument:
function myfunction!(output2, input1, input2, ...)
# do some calculations
if !isa(output2, Nothing)
for i = 1:n
Le jeudi 05 mars 2015 à 11:59 -0800, Pooya a écrit :
Thanks for this clear explanation. If I do the following, is my
function type still unstable? How do you compare the following
solution to yours in terms of efficiency, style, etc?
function compute_outputs(..., output2Flag)
# do some
So then your results would indicate that putting 'using MyModule' inside a
function *could* actually bring the exported names into only the local
scope *if* the module had already been constructed in the global scope. I
know I've seen some people discuss name pollution by 'using' too many
We should probably decide what's the most idiomatic solution, and
document it to ensure consistency. What do other people think?
Is there any fundamental reason why the nargout mechanism cannot (or is
very hard) to implement?
Because if not I really think it would be very very handy to
Hi Andreas,
Yes, you are right. I am using MAT.jl to read matrices.
That's a nice idea. Thanks a lot. But I think
Base.SparseMatrix.CHOLMOD.Sparse is
only available for Julia v0.4. I will change to this reader when Julia v0.4
is released.
Best,
Weijian
On Friday, 6 March 2015 20:35:43
Hi,
What is the equivalent in Julia for numpy.atleast_2d and numpy.atleast_3d?
Or how would you add a ghost dimension to an array in Julia without calling
reshape(X, m, n, 1) explicitly?
-Júlio
Hi Weijian
This is a great functionality. It seems that you are using MAT.jl to read
in the sparse matrices. You could consider using the the MatrixMarket
reader in Base e.g.
A = sparse(Base.SparseMatrix.CHOLMOD.Sparse(matrix.mtx))
It will also have the benefit of using the Symmetric matrix
Oh. That is right. Sounds good.
2015-03-06 16:43 GMT-05:00 Weijian Zhang zweiji...@gmail.com:
Hi Andreas,
Yes, you are right. I am using MAT.jl to read matrices.
That's a nice idea. Thanks a lot. But I think Base.SparseMatrix.CHOLMOD.Sparse
is
only available for Julia v0.4. I will change
you can't do what you are proposing, by design. a macro cannot do anything
that you cannot express directly, it simply allows you to express it more
succinctly by templating the redundant parts.
if you want a set or numbered list, use a set or number list. variables
are bad at that sort of task.
If I have a function that uses two types as argument do I have to declare
both types before defining the function?
I think an example will make my question clearer.
Say I want the following structure of a package:
#Package.jl
module Package
export f, g
include(foo.jl)
include(bar.jl)
end
atleast_2d{T}(A::Union(Array{T,0},Array{T,1})) = reshape(A, size(A,1), 1)
atleast_2d{T}(A) = A
but in general I'm not sure why you'd need such a function. size(A,2) returns
1 even if A is one-dimensional, and A[3,1] works as well.
Best,
--Tim
On Friday, March 06, 2015 01:41:28 PM Júlio
Good point Tim, will check my code to see if I can drop this distinction
between 2 and 3 dimensions.
Thanks.
-Júlio
Hi all,
why not use meetup? I sure got the feeling it'a the go-to platform for this
sort of thing.
Good thinking on those julia best practices. I do have the feeling I'm not
doing things the best way (i.e. I specify function parameter types almost all
the time, despite knowing I don't have
On Thursday, 5 March 2015 18:49:24 UTC+1, Stefan Karpinski wrote:
It's the people who are desperately unhappy with what they currently use
that might really benefit – and those people do exist.
*raises his hand*
That is exactly me. For years I have wanted a language for scientific
I can send you some thoughts over email, but this is not Julia related, so
I won't post here. Christoph
57 matches
Mail list logo