I have but sadly github sucks at searching, but it's not only that. I think
that all this builtins are treated wrong at several non useful levels, for
example:
julia> methods(is)
ERROR: ArgumentError: argument is not a generic function
in methods at reflection.jl:180
julia> methods(1)
You can't!
On Tue, 2016-01-05 at 10:18, Julia Tylors wrote:
> Hi,
>
> How can i override the = operator?
>
> Thanks
>
> function ={T}(x::T,y::T)
> ...
> end
>
> didn't work
>
> Thanks
And there was the error! SOLVED!
The problem was the keyword argument bIN::Array{Int64, 2} = zeros(1,1) ,
which should have been bIN::Array{Int64, 2} = zeros(Int, 1,1)
Best,
Michael
Den tirsdag den 5. januar 2016 kl. 10.33.32 UTC+1 skrev Michael Borregaard:
>
> I think maybe the issue is in
Le mardi 05 janvier 2016 à 01:18 -0800, Julia Tylors a écrit :
> Hi,
>
> How can i override the = operator?
>
> Thanks
>
> function ={T}(x::T,y::T)
> ...
> end
>
> didn't work
You can't, but maybe you can describe us what you're trying to do?
Regards
The problem is - I never call __MarginsRnd#2__ ! I have no idea where that
list of arguments may be coming from. I am sorry, but I do not even
understand why I get an automatically created __MarginsRnd#2__ method when
the MarginsRnd function only has 1 method?
Hi,
How can i override the = operator?
Thanks
function ={T}(x::T,y::T)
...
end
didn't work
Thanks
Thanks! you do need the .primary:
*julia> **typeof(f).name(4.0)*
*ERROR: MethodError: `call` has no method matching call(::TypeName,
::Float64)*
Closest candidates are:
BoundsError()
BoundsError(*::Any...*)
DivideError()
...
*julia> **typeof(f).name.primary(4.0)*
I think maybe the issue is in the definition of the keyword arguments - the
full function definition starts thus:
function MarginsRnd(SampN::Int64, rN::Vector{Int64}, cN::Vector{Int64}; wN::
Array{Float64, 2} = zeros(1,1), pflag::ASCIIString = "canfield", wflag::
ASCIIString = "sinkhorn",
Yes, you do need the .primary to make a maker. My mistake, I did not
notice the last part of your question.
julia> immutable Foo{D}
x::D
end
julia> onefoo=Foo(1)
Foo{Int64}(1)
julia> thePartYouWant(x) = typeof(x).name
thePartYouWant (generic function with 1 method)
julia> this
I've seen it mentioned (eg in
https://groups.google.com/forum/#!msg/julia-dev/eBwqLqiZSPc/N0QlPMC015EJ)
that Julia can emit DWARF info for Julia functions. This does not seem to
be working for me (see gdb below and cachegrind attached). Is there
something I need to enable, or some dependency I
I'm trying to parse a series of XML files and write selected values to an
SQLite database. My code works on smaller files, but crashes when I get to
anything above about 1 GB.
I'm using Atom with the Hydrogen plugin on Julia 0.4.2.
Any suggestions on what is going wrong or alternative
On Tuesday, January 5, 2016 at 3:23:14 AM UTC-5, Ismael Venegas Castelló
wrote:
> Why force `methods` to work with anything?
>
Because you can call anything:
julia> call(x::Char) = x+1
call (generic function with 1038 methods)
julia> 'c'()
'd'
julia> methods('c')
1-element Array{Any,1}:
Hmm, I found `set debug jit 1` but that has no effect.
http://llvm.org/docs/DebuggingJITedCode.html seems to think that it
should work with my version of gdb (7.10).
It does work in lldb though:
(lldb) bt
* thread #1: tid = 15931, 0x7671e4ca
Ordinarily that would work but my problem is that I need to do it from the
command line on a remote workstation (the data files cannot be moved from
that computer) and I can only have one terminal open in the vnc. I also
generally cannot install additional software such at atom (someone else
See https://github.com/JuliaLang/JuliaBox/issues/338 for a workaround; this
should be fixed in the next Julia 0.4.x release.
Hmm, I don't know. I know the DWARF information is there, but I'm not sure
why GDB isn't picking it up. I'll add it to my list of things to check, but
for now I don't know what the issue is.
There's some logging in gdb (I don't quite remember the option, but apropos
jit will probably tell you)
I haven't devised an easy way to define new Python classes from Julia via
PyCall.
It's possible (see how I define new IO subclasses
in https://github.com/stevengj/PyCall.jl/blob/master/src/io.jl) but it is
rather low-level at the moment, close to how you would define new Python
classes from
I considered that, but the xp_streaming_parsefile function is undefined and
I didn't see any mention of it in the source documents. If anyone knows how
to use the streaming parse, I'd be happy to give it a shot.
On Tuesday, January 5, 2016 at 10:51:22 AM UTC-5, Kenta Sato wrote:
>
> I've never
I have looked around and haven't been able to find an answer (I am sure it
is simple).
Say I have a script.jl file with a bunch of commands that I want to work
with interactively in the REPL but only want to do a few lines at a time
and I am unable to copy/paste.
Is there a way to
The Atom interface [1] works really well for that sort of thing. You
can just highlight the lines you want to run and press ctrl+enter to
execute them.
-s
[1]:https://github.com/JunoLab/atom-julia-client
On Tue, Jan 5, 2016, at 11:54 AM, Taylor Maxwell wrote:
> I have looked around and haven't
Thank you for the prompt response.
On Tuesday, January 5, 2016 at 10:18:51 AM UTC-6, Steven G. Johnson wrote:
>
> I haven't devised an easy way to define new Python classes from Julia via
> PyCall.
>
> It's possible (see how I define new IO subclasses in
>
Keno, note this may be another example of (K)ubuntu giving worse backtraces.
--Tim
On Tuesday, January 05, 2016 05:18:19 PM Keno Fischer wrote:
> Hmm, I don't know. I know the DWARF information is there, but I'm not sure
> why GDB isn't picking it up. I'll add it to my list of things to check,
I'm trying to use juliabox.org and running into issues that make it
unusable
for me. Essentially, after I do a Pkg.add operation, the kernel
can no longer connect. It seems like it's trying to execute
an unlink operation on the read-only portion of the juliabox
file system.
David Gleich
---
I'll give that a go. Thanks :)
On Tuesday, 5 January 2016 14:00:49 UTC, Keno Fischer wrote:
>
> This only works with new versions of LLVM. We're in the middle of
> transitioning to the new LLVM on master, so I think at this point, just
> putting LLVM_VER=3.7.1 in your Make.user should be
sorry, autocorrect messed that up:
`make -C deps distclean-llvm`
On Tue, Jan 5, 2016 at 9:08 AM, Isaiah Norton
wrote:
> Probably need 'make -C steps distclean-llvm' before rebuild.
>
>
> On Tuesday, January 5, 2016, Jamie Brandon
> wrote:
>
>>
Yeah, that should work.
On Tue, Jan 5, 2016 at 3:28 PM, 'Jamie Brandon' via julia-users <
julia-users@googlegroups.com> wrote:
> Ooops, MARCH=native
>
> On 5 January 2016 at 14:26, Jamie Brandon wrote:
> > Ok, so I currently have Make.user with:
> >
> > LLVM_VER=3.7.1
>
Ok, so I built successfully and versioninfo shows LLVM 3.7.1. I do get
debug info for Julia itself, but I'm still seeing nothing for my own
code. I can live without I guess - wait for Julia 0.5?
(gdb) bt
#0 jl_breakpoint (v=0x7ffdf0928018) at /home/jamie/julia/src/builtins.c:1659
#1
The notion of types as sets of values and subtyping as a subset relation is
not quite so simple as it initially sounds. The issue is that unlike the
world of mathematics, programs aren't static and fixed forever. If we just
the subset notion at face value, we'd get this sort of thing:
abstract A
I've never tried, but you may be able to use streaming XML parsing of the
LibExpat.jl package to parse such a large XML file.
See https://github.com/amitmurthy/LibExpat.jl#streaming-xml-parsing.
On Tuesday, January 5, 2016 at 11:55:52 PM UTC+9, Brandon Booth wrote:
>
> I'm trying to parse a
This only works with new versions of LLVM. We're in the middle of
transitioning to the new LLVM on master, so I think at this point, just
putting LLVM_VER=3.7.1 in your Make.user should be sufficient.
On Tue, Jan 5, 2016 at 2:50 PM, Jamie Brandon
wrote:
> I've seen it
Probably need 'make -C steps distclean-llvm' before rebuild.
On Tuesday, January 5, 2016, Jamie Brandon wrote:
> I'll give that a go. Thanks :)
>
> On Tuesday, 5 January 2016 14:00:49 UTC, Keno Fischer wrote:
>>
>> This only works with new versions of LLVM. We're in the
Ok, so I currently have Make.user with:
LLVM_VER=3.7.1
ARCH=native
and I'm building with `make debug`. Does that seem right?
On 5 January 2016 at 14:18, Keno Fischer wrote:
> However, taking another look at your backtrace, that's missing debug info in
> the
I believe you have to first create an empty array, and then assign to
each individual element.
If the outer array is small, then you can take a work-around via a tuple:
collect(([1,2], [3,4]))
-erik
On Tue, Jan 5, 2016 at 2:28 PM, Alex wrote:
> Hello,
>
> How to
Hello,
How to construct without push! equivalent vector of vectors?
a=[]
push!(a, [1,2])
push!(a, [2,3])
it gives:
# 2-element Array{Any,1}:
# [1,2]
# [2,3]
If i type
a=[[1,2],[2,3]]
it gives me a 4-element array.
You should be able to write your own method
include(filename, linerange)
and specify 3:17 to load line numbers 3-17.
Best,
--Tim
On Tuesday, January 05, 2016 09:25:40 AM Taylor Maxwell wrote:
> Ordinarily that would work but my problem is that I need to do it from the
> command line on a
Hmm, I found a problem. When running Julia it doesn't know anything about
'make'. So I added the msys2 dir where it lives to the path and moved to
next error
Tuning for julia installation at: C:\programs\julia64\usr\bin
C:/programs/julia64/usr/bin/../../Make.inc:101: *** cowardly refusing to
So I built 0.5 with llvm 3.7.1 on Windows with the aim of trying (again) to
build Cxx, but ...
any idea why it errors with (which is not true)?
Pkg.build("Cxx")
LoadError: could not spawn `make -f BuildBootstrap.Makefile
JULIA_HOME=C:/programs/julia64/usr/bin`: no such file or directory
`:` probably? May have to add the makefile magic that turns windows-style
paths into msys style paths.
On Tue, Jan 5, 2016 at 8:35 PM, J Luis wrote:
> Hmm, I found a problem. When running Julia it doesn't know anything about
> 'make'. So I added the msys2 dir where it lives
However, taking another look at your backtrace, that's missing debug info
in the runtime (rather than any generated code), so you'd have to check
whether your version of libjulia is built with debug info.
On Tue, Jan 5, 2016 at 3:14 PM, Isaiah Norton
wrote:
> sorry,
Ooops, MARCH=native
On 5 January 2016 at 14:26, Jamie Brandon wrote:
> Ok, so I currently have Make.user with:
>
> LLVM_VER=3.7.1
> ARCH=native
>
> and I'm building with `make debug`. Does that seem right?
>
> On 5 January 2016 at 14:18, Keno Fischer
I'm trying to cycle through a series of large XML files, pull out selected
values, and write them to an SQLite database. My code works for smaller
files, but crashes when I get to anything larger than about 1 GB.
I put the parsing into the following function:
function iparse(file) f =
Also as Ray pointed out, if subtypes returned a union, it would not be
returning a collection of types as the name would suggest but rather a
single type.
On Tue, Jan 5, 2016 at 9:42 AM, Stefan Karpinski
wrote:
> The notion of types as sets of values and subtyping as a
Hi Scott,
Thanks for the enthusiasm :)
> You might also want to handle the $(xxx) form of interpolation (which can
> get pretty tricky I imagine), as well as all of the \ escapes, such as \n,
> \x, \u, \U, etc.
>
`interp_parse` was written by Stefan so you can imagine it should be fairly
Hi,
It's not easy getting my old grey matter to learn new tricks, but I'm
slowly learning Julia. I doubt this is worth adding to METADATA, but I find
it useful for my work and hope others do too. If there are any ways to
improve it, please let me know.
Best regards,
Eric
>From the README:
OK, so that is the long way to do it.
I just thought that, since multiple dispatch does not work on keyword
arguments, they should by definition be the same for all methods, no?
Otherwise you end up with keyword arguments throwing an error because the
type of a different argument changing, an
Thanks for that! I figured someone else must have run into this but my
googling and searching efforts were in vain!
Is the time-frame for the next release imminent? I was hoping to use
juliabox in a class I'm starting next week, but this issue could be
problematic for many of those students to
Looks like a good start!
You might also want to handle the $(xxx) form of interpolation (which can
get pretty tricky I imagine), as well as all of the \ escapes, such as \n,
\x, \u, \U, etc.
I'd like just this, but with the Swift syntax for interpolation, i.e.
\(xxx), which doesn't have the
Presumably, it would just parse (and run?) the code within `module Foo ...
end`, and ignore anything outside of that.
On Mon, Jan 4, 2016 at 9:03 AM, Stefan Karpinski
wrote:
> What would it mean to reload a module rather than a file?
>
> On Sun, Jan 3, 2016 at 4:19 AM,
USE_LLVM_SHLIB requires the patch linked here in order to export symbols
correctly.
https://github.com/Keno/Cxx.jl/issues/62#issuecomment-88980621
Anyway, keep an eye on:
https://github.com/JuliaLang/julia/issues/9336
You can be sure that when all of this is usable in a default build, it
won't
This doesn't work because the `x::Ref` field is a pointer to the Julia
object `x`, rather than a pointer to the data
(modifying your code to print x):
julia> ccall((:sum, "test"), Void, (Ref{Problem},), p)
n = 3, res = 0
x = 0x10d569d90
...
julia> unsafe_pointer_to_objref(convert(Ptr{Void},
I'm using Julia in c++ code. I have a few doubts regarding the jl_call
function.The code is
jl_array_t *ret = (jl_array_t*)jl_call(func,args,nargs);
1. Can args contain both scalar/array values? Does it use zero based or one
based indexing?
2. Is there any data type that can hold both
Last time I tried this (~October), there were still issues with using LLVM
as a shared library, and with building LLDB using the recommended win32
thread model toolchain. See comments here:
https://github.com/Keno/Cxx.jl/issues/62#issuecomment-88979566
If you have gotten through the LLDB build
You could use another similar operator like \coloneq:
julia> ≔(var, block) = @eval $var = $block
≔ (generic function with 1 method)
julia> @show :foo ≔ "some foo"; foo
:foo ≔ "some foo" = "some foo"
"some foo"
julia> @show :foo ≔ 42; foo
:foo ≔ 42 = 42
42
julia> macro ≔(v, b)
e =
Thanks, I will edit it to Int64.
On Tue, Jan 5, 2016 at 12:50 PM, Lutfullah Tomak
wrote:
> Good you sorted out that. One thing to keep in mind, if anyone tries to
> use it on 32bit machine zeros(Int,1,1) will give an error.
Good you sorted out that. One thing to keep in mind, if anyone tries to use it
on 32bit machine zeros(Int,1,1) will give an error.
Hi, sorry I have a simple question, I have tried to RTFM.
If I have a function with multiple methods and keyword arguments, all
methods should share the same keyword args, right? How do I write this?
function foo(a::Int; test = true)
2+a
end
function foo(a::AbstractFloat #how do I continue
Thanks, I will see if I can figure it out.
On Tuesday, January 5, 2016 at 11:54:06 AM UTC-7, Tim Holy wrote:
>
> You should be able to write your own method
>
> include(filename, linerange)
>
> and specify 3:17 to load line numbers 3-17.
>
> Best,
> --Tim
>
> On Tuesday, January 05, 2016
but even if I remove those "coward" lines, it errors later with
../src/bootstrap.cpp:31:34: fatal error: clang/Sema/ScopeInfo.h: No such
file or directory
#include "clang/Sema/ScopeInfo.h"
^
compilation terminated.
BuildBootstrap.Makefile:95: recipe for target
julia> Vector[[1,2], [3, 4]]
2-element Array{Array{T,1},1}:
[1,2]
[3,4]
julia> [[1,2] [3,4]]
2x2 Array{Int64,2}:
1 3
2 4
julia> [[1,2], [3,4]]
WARNING: [a,b] concatenation is deprecated; use [a;b] instead
in depwarn at deprecated.jl:73
in oldstyle_vcat_warning at ./abstractarray.jl:29
El martes, 5 de enero de 2016, 15:08:28 (UTC-6), Jamie Brandon escribió:
>
> julia> Vector[[1,2], [3, 4]]
> 2-element Array{Array{T,1},1}:
> [1,2]
> [3,4]
>
> julia> [[1,2] [3,4]]
> 2x2 Array{Int64,2}:
> 1 3
> 2 4
>
> julia> [[1,2], [3,4]]
> WARNING: [a,b] concatenation is
Of possible interest:
https://github.com/simonster/StructsOfArrays.jl
--Tim
On Tuesday, January 05, 2016 04:41:37 AM Jamie Brandon wrote:
> Thanks :)
>
> In this case I'm not worried about compatibility with C but about reducing
> pointer hops in a tree. I suppose that allowing pointers to be
That may well help, although I note:
> While you can create a StructOfArrays of non-isbits immutables, this is
probably slower than an ordinary array, since a new object must be heap
allocated every time the StructOfArrays is indexed.
I'll try it out, and even if it doesn't work directly I may
You can have a look
at
https://github.com/tedsteiner/OpenStreetMap.jl/blob/master/src/parseMap.jl#L208-L217
for an example. Hope it helps!
On Tuesday, 5 January 2016 11:54:37 UTC-5, Brandon Booth wrote:
>
> I considered that, but the xp_streaming_parsefile function is undefined
> and I
Hi all,
Is it possible to get the NLopt package to print the objective function
values and parameter values while an NLopt optimisation routine converges?
My understanding is that the NLopt package is essentially a wrapper on the
NLopt C API, so maybe this is not possible, but I thought I'd
Can't you just print stuff in your julia objective function that you pass to
NLopt?
Sorry for a basic question. I want to have a maximum priority queue, but I
can’t figure out what to pass as the third “ord” parameter. The documentation
seems silent on this issue. That is, I want the dequeue call to return 2 rather
than 1. Is there a way I could use the system to tell me
If you want all methods to use the same keyword arguments, define each
method with the same keyword arguments. You can declare keyword arguments'
types.
function foo(a::Int; test::Bool = true)
if test
a
else
0
end
end
function foo(a::AbstractFloat; test::Bool = true)
Good point, you don't need LLDB for only Cxx.jl (I was trying to build
Gallium).
You do need BUILD_LLVM_CLANG. I haven't had much luck enabling sub-projects
in Make.user with an existing LLVM build, so my only recommendation would
be to remove the LLVM build directory.
On Tue, Jan 5, 2016 at
I have not seen any until yours. How are people making use of RQA (what
does it do best)?
On Monday, January 4, 2016 at 8:48:24 PM UTC-5, Helios De Rosario wrote:
>
> Hi all. Is anybody working on Recurrence Quantification Analysis (RQA)
> with Julia?
>
> There are libraries for RQA in other
I'm not trying to build with LLDB. Actually, I had to build with (in
Make.user)
LLVM_VER=3.7.1
adding the other settings advised in the Cxx page lead to lots of errors.
But after having build with the above, I added
override BUILD_LLVM_CLANG=1
override USE_LLVM_SHLIB=1
and advanced more
and even if I make it find that inc file
../src/bootstrap.cpp: In function 'llvm::Function*
CloneFunctionAndAdjust(CxxInstance*, llvm::Function*, llvm::FunctionT
ype*, bool, llvm::ClonedCodeInfo*, const clang::CodeGen::CGFunctionInfo&,
clang::FunctionDecl*, bool, bool*, void**)':
Thanks :)
In this case I'm not worried about compatibility with C but about reducing
pointer hops in a tree. I suppose that allowing pointers to be inlined into
arrays would require storing offsets in the array meta so the GC can find
them. I'll have to figure out something else.
On Tuesday,
A other question is if those arrays really need to be Int64. Are you planning
on using properties of Int64 that fail on Int32? Else just go with Int.
OK, thanks
On Tue, Jan 5, 2016 at 1:21 PM, Kristoffer Carlsson
wrote:
> A other question is if those arrays really need to be Int64. Are you
> planning on using properties of Int64 that fail on Int32? Else just go with
> Int.
I just came across Sumatra and I've been playing with it for a few weeks,
using it to keep track of some Julia projects. Like Diego said, everything
seems to work fine, except dependency tracking. I haven't actually looked
into the find_dependency functions for other languages, but would it be
Well, I did remove deps\build\llvm-3.7.1 but when making again I get tons
of.
Guess that it's time to stop and try again in a couple of months.
Cannot export
ZZNK4llvm14MCLOHDirective11getEmitSizeERKNS_16MachObjectWriterERKNS_11MCAsmLayoutEENK20raw_counting_ostream11current_posEv:
symbol not
Hi,
I'm trying to call the following C function from Julia using ccall
void sum(Problem *P) {
int i;
printf("n = %d, res = %g\n", P->n, P->res);
for (i = 0; i < P->n; i++) {
P->res += P->x[i];
printf("x[i] = %g, res = %g\n", P->x[i], P->res);
}
}
which takes as
Yep, that's definitely not well documented.
"ord" is an Ordering object which is used mostly in sorting, albeit often
behind the scenes. There are a couple of basic orderings (Forward,
Reverse), as well as a few that allow for different types of comparison or
sorts (e.g., permutations,
Erm... yes, I suppose I could have done that if I had any brains at all :-)
Thanks for being nice about it :-)
-Colin
On Wednesday, 6 January 2016 11:31:51 UTC+11, Kristoffer Carlsson wrote:
>
> Can't you just print stuff in your julia objective function that you pass
> to NLopt?
79 matches
Mail list logo