Re: [julia-users] Re: -1 days old master

2015-02-17 Thread David P. Sanders
On 17 Feb 2015 16:07, Ivar Nesje iva...@gmail.com wrote: Nice, I'm glad my code didn't crash when given unexpected input. Maybe we should check the system clock against a online time server when you run make test. We just use the timestamp git adds when committing, so other than that, there

[julia-users] Calling C code when the required types are simply typedefs in C API

2015-02-17 Thread Zenna Tavares
I'm trying to wrap the Parma Polyhedron Library in Julia. The library itself is written in C++, I am trying to wrap the C API. Consider a snippet of an C example which uses the C API static int solve_with_generators(ppl_Constraint_System_t ppl_cs,

[julia-users] Re: [`call`/`convert` functions] I don't understand this `MethodError` (v0.4.0-dev+3353 / Win 64 bits).

2015-02-17 Thread Ismael VC
Thank you indeed the constructor confusion is one of just a few things I don't like about Julia. El martes, 17 de febrero de 2015, 12:59:00 (UTC-6), Ismael VC escribió: Why can't I create an instance of this `Bar` type with the following enforced invariants? julia versioninfo() Julia

Re: [julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Zenna Tavares
int ppl_version(const char** p) On Tuesday, February 17, 2015 at 5:38:36 PM UTC-5, Stefan Karpinski wrote: What is the signature of the ppl_version C function? On Tue, Feb 17, 2015 at 5:23 PM, Zenna Tavares zennat...@gmail.com javascript: wrote: I am attempting to wrap the Parma

[julia-users] Re: Automatic triangulation package: testing?

2015-02-17 Thread Petr Krysl
Apparently it works fine (Thanks very much, Rob!). Enjoy, and if you run into any trouble please feel free to let me know. Petr On Tuesday, February 17, 2015 at 12:20:22 PM UTC-8, Petr Krysl wrote: Hi guys, I have uploaded to Github a Julia package that wraps an automatic 2D triangulation

Re: [julia-users] Re: -1 days old master

2015-02-17 Thread Stefan Karpinski
Yes. On Feb 17, 2015, at 9:52 PM, David P. Sanders dpsand...@ciencias.unam.mx wrote: On 17 Feb 2015 16:07, Ivar Nesje iva...@gmail.com wrote: Nice, I'm glad my code didn't crash when given unexpected input. Maybe we should check the system clock against a online time server when

Re: [julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Zenna Tavares
The following solved this problem: [17:44] wat_ it looks like the array is being passed directly, although an array of ascii strings can't be passed directly in my experience [17:46] wat_ I created a function which creates an array of Ptr{UInt8} from an array of strings [17:46] wat_ convert(

Re: [julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Zenna Tavares
Indeed, thanks. On Tuesday, February 17, 2015 at 6:14:34 PM UTC-5, Stefan Karpinski wrote: Your original code gives a deprecation warning on both Julia 0.4 and 0.3 which is actually an indication of a much deeper issue: you're converting an array of arrays of bytes to a pointer, which gives

[julia-users] Re: Calling C code when the required types are simply typedefs in C API

2015-02-17 Thread Zenna Tavares
C function which return values of type *ppl_Polyhedron_t** rather On Tuesday, February 17, 2015 at 8:40:16 PM UTC-5, Zenna Tavares wrote: I'm trying to wrap the Parma Polyhedron Library in Julia. The library itself is written in C++, I am trying to wrap the C API. Consider a snippet of an C

Re: [julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Stefan Karpinski
Your original code gives a deprecation warning on both Julia 0.4 and 0.3 which is actually an indication of a much deeper issue: you're converting an array of arrays of bytes to a pointer, which gives a pointer to the data of the top-level array data and then reinterprets that pointer as a pointer

[julia-users] Julia v0.3.6

2015-02-17 Thread Elliot Saba
Hello all! The latest bugfix release of the 0.3.x Julia line has been released. Binaries are available from the usual place http://julialang.org/downloads/, and as is typical with such things, please report all issues to either the issue tracker https://github.com/JuliaLang/julia/issues, or email

Re: [julia-users] Julia on Raspberry Pi 2

2015-02-17 Thread Seth
FWIW, I'm using gcc 4.7 and got the same version error. configure: error: The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade to GCC 4.7. You may pass --disable-compiler-version-checks to configure to bypass these sanity checks. Makefile:528: recipe for target

Re: [julia-users] Julia on Raspberry Pi 2

2015-02-17 Thread Seth
Fixed it. The issue is that Make is trying to use g++. Make sure that g++ -v is reporting the correct version. If not, you'll have to apt-get install g++-4.7 and then ln -s /usr/bin/g++-4.7 /usr/bin/g++ . On Monday, February 16, 2015 at 9:32:27 PM UTC-8, Viral Shah wrote: This is annoying.

Re: [julia-users] Re: -1 days old master

2015-02-17 Thread Ivar Nesje
Definitely possible. The code is at https://github.com/JuliaLang/julia/blob/master/base/version.jl#L210

[julia-users] delay on checking EOF normal (GnuTLS.jl)?

2015-02-17 Thread Seth
I deleted my previous question because I didn't have enough info. Now I might, but it's turned into something very specific. I am running into a problem where checking for EOF on a network connection is causing a ~10 - 15-second delay. That is, function eof(s::Session) info($(now()) eof:

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread J Luis
Yes, I know that but couldn't isa be made to return also 'true' in my second example? terça-feira, 17 de Fevereiro de 2015 às 16:07:03 UTC, Tim Holy escreveu: This has nothing to do with isa. In julia, a scalar is different from a 1- element array. Matlab doesn't make that distinction,

Re: [julia-users] Variable contents corruption on output from a function.

2015-02-17 Thread Jameson Nash
You appear to be returning pointers to memory that are outliving the life of their owning object. The array out appears to point to memory owned by R (which you seem to be explicitly invalidating at the end of the loop) and you use the result of pointer([ ]), without holding a reference to [ ] in

Re: [julia-users] Pass by reference

2015-02-17 Thread Stefan Karpinski
See: http://julia.readthedocs.org/en/latest/manual/faq/#i-passed-an-argument-x-to-a-function-modified-it-inside-that-function-but-on-the-outside-the-variable-x-is-still-unchanged-why http://julia.readthedocs.org/en/latest/manual/faq/#why-does-x-y-allocate-memory-when-x-and-y-are-arrays On Tue,

Re: [julia-users] Variable contents corruption on output from a function.

2015-02-17 Thread J Luis
Thanks, yes I see what you mean. Actually I still need to write the 'transpose' part that is mentioned in the comment and that implies making a data copy. terça-feira, 17 de Fevereiro de 2015 às 16:42:10 UTC, Jameson escreveu: You appear to be returning pointers to memory that are outliving

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Jiahao Chen
In this particular use case, you can use isa(eltype(x), Float32), which will work for both scalars and arrays. Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intelligence Laboratory On Tue, Feb 17, 2015 at 9:40 AM, Abel Siqueira nepper...@gmail.com wrote:

Re: [julia-users] How to build iteratively a large Julia string

2015-02-17 Thread René Donner
Good point, printing to the the IOBuffer is the fastest option: strings = [randstring() for i in 1:100] function f1(strings) a = IOBuffer() for s in strings print(a, s) end takebuf_string(a) end function f2(strings) join(strings) end function f3(stings) buf =

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Tim Holy
You'd break the julia type system by doing so. You can define jluis_isa() to do whatever you want, however. --Tim On Tuesday, February 17, 2015 08:16:03 AM J Luis wrote: Yes, I know that but couldn't isa be made to return also 'true' in my second example? terça-feira, 17 de Fevereiro de

[julia-users] JuliaGPU, JuliaGeometry, JuliaGL

2015-02-17 Thread Simon Danisch
Hi all, I've tried to vitalize some of the Julia groups that I'm part of. Groups: JuliaGPU https://github.com/JuliaGPU, JuliaGeometry https://github.com/JuliaGeometry, JuliaGL https://github.com/JuliaGL/ The biggest change is, that I've added some gitter batches, to easily start chatting about

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Patrick O'Leary
On Tuesday, February 17, 2015 at 10:42:01 AM UTC-6, Abel Siqueira wrote: What Tim was trying to point out is that `isa` a builtin, and many things depend on it being able to differentiate a scalar from an array. However, if you, in your code, wants to ignore this, you can define a function

[julia-users] -1 days old master

2015-02-17 Thread David P. Sanders
Hi, I just did a `git pull` and compiled latest master. Apparently I am now able to travel to the future ``` 11:17 $ julia-dev _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_

Re: [julia-users] Pass by reference

2015-02-17 Thread Jiahao Chen
Please DO open a pull request with suggested edits to the documentation! Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intelligence Laboratory On Tue, Feb 17, 2015 at 11:59 AM, David Higgins daithiohuig...@gmail.com wrote: Thanks Stefan, I did actually see

[julia-users] Opening Files which don't exist yet? Does Julia's Open() function create the file?

2015-02-17 Thread Michael Bullman
Hi all, sorry if this is simple question. But I'm used to using python's open() file function which will create a file if the file does not already exist. Does this functionality exist in julia and I just messed up something? Or is this missing and I should create my textfiles before hand?

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Tim Holy
This has nothing to do with isa. In julia, a scalar is different from a 1- element array. Matlab doesn't make that distinction, because in Matlab _everything_ is an array. Which is much of why Matlab is slow for many things. --Tim On Tuesday, February 17, 2015 08:03:12 AM J Luis wrote: julia

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Stefan Karpinski
Array{Float32} is *not* an instance of a Float32 – it would be incorrect if isa([1.0f0], Float32) == true. On Tue, Feb 17, 2015 at 11:33 AM, J Luis jmfl...@gmail.com wrote: You'd break the julia type system by doing so. You can define jluis_isa() to do whatever you want, however. Hmm,

Re: [julia-users] Most effective way to build a large string?

2015-02-17 Thread Stefan Karpinski
IOBuffer is what you're looking for: buf = IOBuffer() for i = 1:100 println(buf, i) end takebuf_string(buf) # = returns everything that's been written to buf. The takebuf_string function really needs a new name. On Tue, Feb 17, 2015 at 9:06 AM, Maurice Diamantini

Re: [julia-users] Re: Values from Dict assigned to variables (symbols?) named as keys?

2015-02-17 Thread Martin Johansson
Thanks, it seems composite types is a perfect fit for most of my needs(required fields and their size will typically be known at time of type definition for the present problem). Regards, m On Monday, February 16, 2015 at 6:57:57 PM UTC+1, Tim Holy wrote: Composite types are much higher

Re: [julia-users] How to build iteratively a large Julia string

2015-02-17 Thread René Donner
You could use a = Any[] while ... push!(a, somestring) end join(a) Am 17.02.2015 um 15:28 schrieb Maurice Diamantini maurice.diamant...@gmail.com: Hi, In Ruby, String is mutable and there is the operator to accumulate a string at the end of another one. I Julia, String is

Re: [julia-users] How to build iteratively a large Julia string

2015-02-17 Thread Jameson Nash
There is an IOBuffer type that works well as a string builder On Tue, Feb 17, 2015 at 11:56 AM René Donner li...@donner.at wrote: You could use a = Any[] while ... push!(a, somestring) end join(a) Am 17.02.2015 um 15:28 schrieb Maurice Diamantini maurice.diamant...@gmail.com:

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread J Luis
Thanks, That's indeed what I was looking for. terça-feira, 17 de Fevereiro de 2015 às 17:12:19 UTC, Jiahao Chen escreveu: In this particular use case, you can use isa(eltype(x), Float32), which will work for both scalars and arrays. Thanks, Jiahao Chen Staff Research Scientist MIT

[julia-users] Re: Opening Files which don't exist yet? Does Julia's Open() function create the file?

2015-02-17 Thread Michael Bullman
OK, I think my issue was I was using open(filename, r+), but i imagine that implies it must be able to be 'read' first? Thank you! I'll try this out now, hopefully it works :) On Tuesday, February 17, 2015 at 10:57:25 AM UTC-5, Patrick O'Leary wrote: On Tuesday, February 17, 2015 at 9:51:21

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread J Luis
You'd break the julia type system by doing so. You can define jluis_isa() to do whatever you want, however. Hmm, well I guess I could but according to your first statement I would be braking the julia type sysyem :) --Tim On Tuesday, February 17, 2015 08:16:03 AM J Luis wrote:

[julia-users] Most effective way to build a large string?

2015-02-17 Thread Maurice Diamantini
Hi, In Ruby, String is mutable which allows to build large strings like this: txt = for ... txt yet another line\n end # do something with txt The Julia the (bad) way I use is to do: txt = for ... txt *= yet another line\n end # do something

[julia-users] Re: isa should be user friendlier

2015-02-17 Thread Simon Danisch
*eltype([1f0]) : Float32* should do the trick... Am Dienstag, 17. Februar 2015 17:03:12 UTC+1 schrieb J Luis: julia isa(1.0f0, Float32) true julia isa([1.0f0], Float32) false julia isa([1.0f0], Array{Float32}) true It means that to know the data type one must first test if the variable

[julia-users] Re: Convert Array{Float64,1} to Type{Float64}

2015-02-17 Thread Simon Danisch
julia v*v' 1x1 Array{Int64,2}: 14 This is an array, while w[1] is a Float64. So you need to do something like first(v*v') or (v*v')[1] Am Dienstag, 17. Februar 2015 21:04:04 UTC+1 schrieb Christian Dengler: Hello, I recently discovered Julia, and tried to convert some of my code. I ran

[julia-users] Re: [`call`/`convert` functions] I don't understand this `MethodError` (v0.4.0-dev+3353 / Win 64 bits).

2015-02-17 Thread Simon Danisch
Well, this is one of the ugly things and actually not new: Bar{Float64}(1, 8) should do the trick. The other doesn't work, because you can't construct Bar with more than two values. This happens because you did overwrite the default constructor, allowing to construct bar only with x and y. T

[julia-users] Automatic triangulation package: testing?

2015-02-17 Thread Petr Krysl
Hi guys, I have uploaded to Github a Julia package that wraps an automatic 2D triangulation tool (binary). I only have access to Windows and Linux, so I was wondering if anyone would be willing to take it for a spin on the Mac? https://github.com/PetrKryslUCSD/Targe2.jl Thanks! Petr

[julia-users] Convert Array{Float64,1} to Type{Float64}

2015-02-17 Thread Christian Dengler
Hello, I recently discovered Julia, and tried to convert some of my code. I ran into a problem, changing values in a sparse matrix. The entries i want to put in the sparse matrix result from a dot product. The error message is ERROR: `convert` has no method matching convert(::Type{Float64},

Re: [julia-users] Pass by reference

2015-02-17 Thread Stefan Karpinski
The confusion stems from this: *assignment and mutation are not the same thing.* *Assignment. *Assignment looks like `x = ...` – what's left of the `=` is a variable name. Assignment changes which object the variable `x` refers to (this is called a variable binding). It doesn't mutate any

Re: [julia-users] Start julia with REPL, loading script, and passing arguments

2015-02-17 Thread Stefan Karpinski
On Mon, Feb 16, 2015 at 3:29 AM, David van Leeuwen david.vanleeu...@gmail.com wrote: Would an option -- make sense to separate the start up files from arguments to be passed to the script/sessions. Yes, this is the right solution. I've opened two related issues:

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread Jacob Quinn
That's because the typeof(Float32) == DataType, so isa(Float32,DataType) == true. On Tue, Feb 17, 2015 at 11:48 AM, J Luis jmfl...@gmail.com wrote: In this particular use case, you can use isa(eltype(x), Float32), which will work for both scalars and arrays. Checked it now and it would be

[julia-users] [`call`/`convert` functions] I don't understand this `MethodError` (v0.4.0-dev+3353 / Win 64 bits).

2015-02-17 Thread Ismael VC
Why can't I create an instance of this `Bar` type with the following enforced invariants? julia versioninfo() Julia Version 0.4.0-dev+3353 Commit 0179028* (2015-02-14 17:08 UTC) Platform Info: System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i3 CPU M 350 @ 2.27GHz

Re: [julia-users] Re: -1 days old master

2015-02-17 Thread Jiahao Chen
I see this too. Time to buy some lottery numbers! I'm going to guess some sort of rounding logic error. Thanks, Jiahao Chen Staff Research Scientist MIT Computer Science and Artificial Intelligence Laboratory On Tue, Feb 17, 2015 at 1:13 PM, Tony Kelman t...@kelman.net wrote: I think the

[julia-users] Re: -1 days old master

2015-02-17 Thread Tony Kelman
I think the clock on Oscar's computer might be running a little fast. I noticed github saying authored just now for that commit for maybe 15-20 minutes after it had already been committed. Apparently that can confuse version_git.sh. On Tuesday, February 17, 2015 at 9:19:52 AM UTC-8, David P.

Re: [julia-users] isa should be user friendlier

2015-02-17 Thread J Luis
In this particular use case, you can use isa(eltype(x), Float32), which will work for both scalars and arrays. Checked it now and it would be good but actually it oddly does not work julia eltype([1.0f0]) Float32 julia isa(eltype([1.0f0]), Float32) false (I'' use Patrick's solution, but

Re: [julia-users] Latex Equations in iJulia (not printing)

2015-02-17 Thread Stefan Karpinski
Probably best to open an issue on the IJulia repo: https://github.com/JuliaLang/IJulia.jl/issues (after checking that a relevant issue doesn't already exist). On Tue, Feb 17, 2015 at 1:58 PM, Alex Ocampo alexocampo...@gmail.com wrote: Hi, all- I'm having trouble getting my latex equations to

[julia-users] Re: isa should be user friendlier

2015-02-17 Thread Uwe Fechner
eltype([1f0]) == Float32 is working, too. On Tuesday, February 17, 2015 at 8:39:05 PM UTC+1, Simon Danisch wrote: *eltype([1f0]) : Float32* should do the trick... Am Dienstag, 17. Februar 2015 17:03:12 UTC+1 schrieb J Luis: julia isa(1.0f0, Float32) true julia isa([1.0f0], Float32)

Re: [julia-users] Re: Convert Array{Float64,1} to Type{Float64}

2015-02-17 Thread Tim Holy
or dot(v,v) or sumabs2(v) --Tim On Tuesday, February 17, 2015 12:42:34 PM Simon Danisch wrote: julia v*v' 1x1 Array{Int64,2}: 14 This is an array, while w[1] is a Float64. So you need to do something like first(v*v') or (v*v')[1] Am Dienstag, 17. Februar 2015 21:04:04 UTC+1 schrieb

[julia-users] Trying to debug a REPL lockup

2015-02-17 Thread Seth
I'm chasing down a REPL lockup with Requests.jl: the entire REPL becomes unresponsive (to ^C intr - but not to ^Z susp) and requires killing. When I do that, I get the following: signal (15): Terminated: 15 _ZN9libunwind13DwarfFDECacheINS_17LocalAddressSpaceEE7findFDEEyy at /Users/

Re: [julia-users] Latex Equations in iJulia (not printing)

2015-02-17 Thread Steven G. Johnson
See: https://github.com/JuliaLang/JuliaBox/issues/76

[julia-users] Re: isa should be user friendlier

2015-02-17 Thread J Luis
Yes, that's the solution that Patrick O'Leary propose a couple of messages above. terça-feira, 17 de Fevereiro de 2015 às 21:06:12 UTC, Uwe Fechner escreveu: eltype([1f0]) == Float32 is working, too. On Tuesday, February 17, 2015 at 8:39:05 PM UTC+1, Simon Danisch wrote: *eltype([1f0]) :

Re: [julia-users] Re: -1 days old master

2015-02-17 Thread Ivar Nesje
Nice, I'm glad my code didn't crash when given unexpected input. Maybe we should check the system clock against a online time server when you run make test. We just use the timestamp git adds when committing, so other than that, there doesn't seem like there is much new can do.

[julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Zenna Tavares
I am attempting to wrap the Parma Polyhedron Primitive Library. It has a function 'ppl_version' which modifies a set of strings, represented as a char **. An example function which calls 'ppl_version' is as follows: get_ppl_version() { const char* p; (void) ppl_version(p); return p; }

Re: [julia-users] Very strange results ccall-ing a c function which modifies a char **

2015-02-17 Thread Stefan Karpinski
What is the signature of the ppl_version C function? On Tue, Feb 17, 2015 at 5:23 PM, Zenna Tavares zennatava...@gmail.com wrote: I am attempting to wrap the Parma Polyhedron Primitive Library. It has a function 'ppl_version' which modifies a set of strings, represented as a char **. An