[julia-users] Re: Stumped by a subtyping issue

2016-11-01 Thread Eric Davies
},1} is not an abstract type at all; in fact, it is a > concrete type describing a 1-dimensional array in which each entry is an > object of type Array{T,1} for some value of T." > > > > > > > On Monday, October 31, 2016 at 7:43:58 PM UTC-4, Eric Davies wrote: >

[julia-users] Stumped by a subtyping issue

2016-10-31 Thread Eric Davies
I am getting confusing behaviour with some complex type aliases while using Cxx.jl and I was hoping someone could point out what is going on. These are the aliases: typealias CppAWSErrorType{C, I<:Integer} CppTemplate{CppBaseType{Symbol( "Aws::Client::AWSError")}, Tuple{CppEnum{C, I}}}

[julia-users] Re: How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-11 Thread Eric Davies
What worked: function bloop(size; write_size=10) data = Array{UInt8}("f" ^ size) println("start") (pout, pin, p) = readandwrite(`cat -`) println("read") read_task = @async read(pout) for chunk in chunks(data, write_size) println("write") write(pin,

Re: [julia-users] How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-07 Thread Eric Davies
Thanks, I will try both of those. I had tried making smaller pieces before but I'll try with `Base.process_events(false)`.

[julia-users] How does one read and write a sizeable amount of data (megabytes) from a process?

2016-10-07 Thread Eric Davies
I'm trying to write a bunch of data to a process, then read out the result. Replaced the process here with `cat -` because that's close enough. function bloop(size) data = "f" ^ size print("start") (pout, pin, p) = readandwrite(`cat -`) print("write") write(pin,

Re: [julia-users] Re: Fixing JavaCall for 0.5: generating methods which call ccall

2016-06-30 Thread Eric Davies
ile time, and hence in >>> this case we define a separate method for each input type, rather than use >>> dynamic dispatch. This code works correctly in 0.4 (and 0.3), but fails >>> with an UndefRefError in 0.5. >>> >>> Any ideas? >>> >>> Tha

[julia-users] Fixing JavaCall for 0.5: generating methods which call ccall

2016-06-24 Thread Eric Davies
I have an intuition that this should be possible because the ccall depends on the input types, but I can't figure out how to make it work. I've tried a few things and they all seem to result in an UndefVarError or UndefRefError. I want to turn this: for (x, y, z) in [ (:jboolean,

[julia-users] Re: JuliaCon 2016: Keynote speakers

2016-04-09 Thread Eric Davies
Holy s**t! I'm very excited! On Friday, 8 April 2016 20:43:09 UTC-5, Andreas Noack wrote: > > JuliaCon 2016 > June 21 - 25, 2016 > Massachusetts Institute of Technology, Cambridge, Massachusetts, USA. > http://juliacon.org/ > > On behalf of the JuliaCon 2016 committee, I am happy to announce the

[julia-users] Re: New Database Package -- Postgres

2016-02-24 Thread Eric Davies
Nice to see an alternate approach. This should satisfy people who don't need the full async and minimal allocation of the upcoming DBAPI PostgreSQL.jl and want a simpler and more intuitive interface. I also like how you've handled types at the connection level. On Friday, 19 February 2016

Re: [julia-users] VirtualArrays.jl

2016-01-18 Thread Eric Davies
On Friday, 15 January 2016 17:14:26 UTC-6, Yichao Yu wrote: > > FYI, don't call eval in functions > What's wrong with calling eval in functions when you're evaluating expressions without side-effects?

Re: [julia-users] VirtualArrays.jl

2016-01-18 Thread Eric Davies
It's gone now :) https://github.com/invenia/VirtualArrays.jl/pull/2#event-518201512 On Monday, 18 January 2016 09:47:15 UTC-6, Yichao Yu wrote: > > On Mon, Jan 18, 2016 at 10:42 AM, Eric Davies <iam...@gmail.com > > wrote: > > > > > > On Friday, 15 Janua

[julia-users] Re: Overwriting Functions

2015-12-05 Thread Eric Davies
This took a while to show up and may have been missed. On Saturday, 28 November 2015 12:19:29 UTC-5, Curtis Vogt wrote: > > I've been working on a package Mocking.jl > which allows developers to > temporarily overwrite a method in order to facilitate

[julia-users] PSA: There are timezones now!

2015-08-22 Thread Eric Davies
Here they are! https://github.com/quinnj/TimeZones.jl IMO it's better than pytz, which is exciting. All credit goes to Curtis Vogt @omus.

[julia-users] Re: MATLAB MEX embedding signal handling segfault

2015-08-04 Thread Eric Davies
. On Tuesday, 3 March 2015 23:18:04 UTC-6, Eric Davies wrote: Hi all, I'm attempting to embed julia in a MATLAB MEX file. Everything is going great, but MATLAB will sometimes segfault after having run some code calling Julia.* I believe I have narrowed it down to this issue: http

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-05-30 Thread Eric Davies
. I think this is a perfectly good API. True that in general functions are better than structs, but I don't see any benefit here. On Fri, May 29, 2015 at 5:29 PM, Isaiah Norton isaiah.nor...@gmail.com wrote: On Fri, May 29, 2015 at 3:49 PM, Eric Davies iam...@gmail.com wrote: It seems like

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-05-29 Thread Eric Davies
02:51:19 PM Eric Davies wrote: It appears as if that did not solve the problem, though I verified that it did what was intended. This is unfortunate. I'll continue looking at this for a day or two but I'm not confident I can find a solution alone. Here is a minimal set of code

[julia-users] Re: MATLAB MEX embedding signal handling segfault

2015-03-13 Thread Eric Davies
...@gmail.com wrote: On Friday, March 6, 2015 at 1:41:17 AM UTC+10, Eric Davies wrote: I thought I'd post the various errors I get on crash in case any of them sparks a thought. One of a number of things happens each time; they are now in files error1 to error5 in the gist: https

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-03-05 Thread Eric Davies
On Thursday, 5 March 2015 03:28:17 UTC-6, ele...@gmail.com wrote: On Thursday, March 5, 2015 at 3:24:28 PM UTC+10, Eric Davies wrote: On Wednesday, 4 March 2015 20:15:31 UTC-6, ele...@gmail.com wrote: On Thursday, March 5, 2015 at 10:16:30 AM UTC+10, Eric Davies wrote: I don't

[julia-users] Re: MATLAB MEX embedding signal handling segfault

2015-03-05 Thread Eric Davies
I thought I'd post the various errors I get on crash in case any of them sparks a thought. One of a number of things happens each time; they are now in files error1 to error5 in the gist: https://gist.github.com/iamed2/e883c6b0b8ff4220d946 In errors 4 and 5 I can no longer see the lines I type

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-03-04 Thread Eric Davies
https://groups.google.com/d/msg/julia-users/dP_J5KilsEs/4CIERQ14vdgJ. We should collaborate on a single solution (and it sounds like you're farther along and perhaps more invested). I'm happy to pitch in if code gets posted somewhere. --Tim On Tuesday, March 03, 2015 09:18:04 PM Eric

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-03-04 Thread Eric Davies
I don't have Matlab so I can't try anything, but as a general comment I would say that if Julia is going to support embedding in the same process it has to cooperate with its host on usage of shared resources like signals. If Julia is simply initialized, runs some code, shuts down and

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-03-04 Thread Eric Davies
On Wednesday, 4 March 2015 20:15:31 UTC-6, ele...@gmail.com wrote: On Thursday, March 5, 2015 at 10:16:30 AM UTC+10, Eric Davies wrote: I don't have Matlab so I can't try anything, but as a general comment I would say that if Julia is going to support embedding in the same process

Re: [julia-users] MATLAB MEX embedding signal handling segfault

2015-03-04 Thread Eric Davies
, 2015 09:18:04 PM Eric Davies wrote: Hi all, I'm attempting to embed julia in a MATLAB MEX file. Everything is going great, but MATLAB will sometimes segfault after having run some code calling Julia.* I believe I have narrowed it down to this issue: http://ubuntuforums.org

[julia-users] MATLAB MEX embedding signal handling segfault

2015-03-03 Thread Eric Davies
Hi all, I'm attempting to embed julia in a MATLAB MEX file. Everything is going great, but MATLAB will sometimes segfault after having run some code calling Julia.* I believe I have narrowed it down to this issue: http://ubuntuforums.org/showthread.php?t=2093057 . Basically, I believe Julia

Re: [julia-users] Re: Revision release notes

2014-12-26 Thread Eric Davies
getting backported, you can compare the commit list via https://github.com/JuliaLang/julia/compare/v0.3.0...v0.3.1 or similar url's. On Thursday, December 25, 2014 10:14:59 PM UTC-8, Eric Davies wrote: Are there release notes for 0.3.1+? Looking at NEWS.md, it seems that only 0.3.0 appears.

[julia-users] Revision release notes

2014-12-25 Thread Eric Davies
Are there release notes for 0.3.1+? Looking at NEWS.md, it seems that only 0.3.0 appears.

[julia-users] Re: Mutate C struct represented as Julia immutable

2014-11-24 Thread Eric Davies
On Friday, 21 November 2014 09:44:27 UTC-6, Steven G. Johnson wrote: On Thursday, November 20, 2014 5:37:22 PM UTC-5, Eric Davies wrote: (For context, I'm working on this issue: https://github.com/JuliaOpt/ECOS.jl/issues/12 and dealing with these structs: https://github.com/JuliaOpt

[julia-users] Mutate C struct represented as Julia immutable

2014-11-20 Thread Eric Davies
(For context, I'm working on this issue: https://github.com/JuliaOpt/ECOS.jl/issues/12 and dealing with these structs: https://github.com/JuliaOpt/ECOS.jl/blob/master/src/types.jl#L124-L216 ) I have a C struct used in a 3rd-party C library mirrored as an immutable in Julia. A pointer to the C

[julia-users] Help with simple BinDeps build.jl

2014-09-28 Thread Eric Davies
Build script, error output, and versioninfo(): https://gist.github.com/iamed2/8a4454c4a04fbf03a22f I'm trying to set up a very simple BinDeps build script so that my package will finally actually load through the package evaluator (sorry Iain for my complacency) but I'm having trouble. The

Re: [julia-users] Help with simple BinDeps build.jl

2014-09-28 Thread Eric Davies
On Sun, Sep 28, 2014 at 11:37 AM, Isaiah Norton isaiah.nor...@gmail.com wrote: The script fails because BinDeps is looking for a shared library called `ply.so` (or .dll, etc.) to satisfy the `library_dependency`. You are installing a python package, so this condition cannot be met. I'm not

Re: [julia-users] How do I declare a baremodule in a macro?

2014-07-03 Thread Eric Davies
(name::Symbol), Expr(:begin)) end On Thu, Jul 3, 2014 at 12:00 AM, Eric Davies iam...@gmail.com javascript: wrote: Hi all, I'm working on a multipass configuration file package and I'm having difficulty executing my ideas (I'm not great at the metaprogramming stuff yet). I want

Re: [julia-users] Re: Why is string concatenation done with * not +

2014-07-03 Thread Eric Davies
I think the '+' is not as prevalent as you might think. MATLAB: ['foo' 'bar'] R: paste('foo', 'bar', sep=) Python/C++/Ruby: foo + bar Perl/PHP: foo . bar C: strcat(bufcontainingfoo, bar) Mathematica: foo bar People coming from MATLAB and R (probably a very large portion of those trying Julia)

Re: [julia-users] How do I declare a baremodule in a macro?

2014-07-03 Thread Eric Davies
::Symbol), Expr(:begin)) end On Thu, Jul 3, 2014 at 12:00 AM, Eric Davies iam...@gmail.com javascript: wrote: Hi all, I'm working on a multipass configuration file package and I'm having difficulty executing my ideas (I'm not great at the metaprogramming stuff yet). I want to create

[julia-users] How do I declare a baremodule in a macro?

2014-07-02 Thread Eric Davies
Hi all, I'm working on a multipass configuration file package and I'm having difficulty executing my ideas (I'm not great at the metaprogramming stuff yet). I want to create a baremodule in a macro and have it available to the scope containing the macro. I want to be able to pass the name of

[julia-users] Re: find if a pointer is NULL

2014-06-15 Thread Eric Davies
It seems like the method is gone. It exists for Uint64 integers but no others. You can get the behaviour you want using convert(Ptr{*type*}, *integer*). It should probably be added back, either calling the existing pointer method or by calling convert. On Saturday, 14 June 2014 21:39:24

Re: [julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread Eric Davies
I'm considering trying out a alternative IntSet implementation using a space-optimized van Emde Boas tree. In that case, the space would scale linearly as you add elements, and could give reasonable out-of-memory errors should that situation arise. The limits in that case would be the limits

Re: [julia-users] Help getting started with Julia's Graphs package

2014-02-24 Thread Eric Davies
Those are for plotting (graphing as in data visualization). The OP is asking about graphs, the data structures. On Monday, 24 February 2014 02:15:50 UTC-6, RecentConvert wrote: From what I've seen on the Google group it seems like most people use an external package like Winston, PyPlot, or

Re: [julia-users] Re: Julia as a General Purpose Language

2014-02-21 Thread Eric Davies
https://github.com/iamed2/PostgreSQL.jl My PostgreSQL package is in a dev state but I'm using it for an internal project. It uses DBI.jl https://github.com/JuliaDB/DBI.jl at the JuliaDB group and implements most of the interface. Contributions are welcome and desired! Our goal is that all of

[julia-users] Re: Julia as a General Purpose Language

2014-02-19 Thread Eric Davies
A lot is relative. Since Julia has such a small core, there will be fewer changes than many other fledgling languages (I'm looking at you, Rust). You're more likely to see new features and refinement of behaviour in edge cases than breaking changes. That said, it is rough around some edges and

[julia-users] Re: Re: Use an array as the index for selecting an element from another array

2014-02-18 Thread Eric Davies
FYI: julia function test_index() a = rand(100,100); pos = [1,1]; s = 0.0 for i = 1:1 s += a[pos[1], pos[2]] end end test_index (generic function with 1 method) julia function test_tuple() a =

[julia-users] Re: Function, Macro or something else? (Need help with refactoring code)

2014-02-14 Thread Eric Davies
function get_stuff(endpoint, options) #URI encode values for all keys in Dict encodeURI(options) #Build query string query_str = Requests.format_query_str(options) #Build oauth_header oauth_header_val = oauthheader(GET, endpoint, options) return

[julia-users] Re: Function, Macro or something else? (Need help with refactoring code)

2014-02-14 Thread Eric Davies
, 2014 1:08:39 PM UTC-5, Eric Davies wrote: function get_stuff(endpoint, options) #URI encode values for all keys in Dict encodeURI(options) #Build query string query_str = Requests.format_query_str(options) #Build oauth_header oauth_header_val = oauthheader

[julia-users] Re: Different error messages for sqrt(-1) and sqrt(-1.0)

2014-02-13 Thread Eric Davies
It seems to return the more verbose error on every type but Int64 (and Complex). On Thursday, 13 February 2014 20:42:59 UTC-6, Paulo Castro wrote: Have you already noticed that error messages (on julia 0.3.0-prerelease+1419) for sqrt(-1) and sqrt(-1.0) are different? Here: julia sqrt(-1)

Re: [julia-users] Re: Some doubts about Julia

2014-02-12 Thread Eric Davies
It looks like there's a reason for that, and it relates to the different way cuBLAS handles memory. See more info here: http://stackoverflow.com/a/18820210/931700 You can try linking with the thunking library and see if there is still any improvement. On Wednesday, 12 February 2014 13:02:41

[julia-users] Re: Julia and SQL Server

2014-02-11 Thread Eric Davies
If you need something to use, ODBC.jl is your best/only bet. We are also developing a standard database interface and implementations of that interface (currently SQLite3, MySQL and PostgreSQL are in progress) at https://github.com/JuliaDB . None of us have any specific plans for an SQL Server

Re: [julia-users] Is there a literal way to make a Symbol separated with space? Ex. [ :test TEST ]

2014-02-07 Thread Eric Davies
Ismael mentioned that in his original post. He is looking for a way to do that but with a literal syntax (no intermediate string+functioncall). On Friday, 7 February 2014 12:06:56 UTC-6, Joosep Pata wrote: julia symbol(test test) :test test On 07 Feb 2014, at 18:25, Ismael VC

[julia-users] Re: problem with open(f::SubString)

2014-02-01 Thread Eric Davies
Please forgive me if I'm giving too much obvious info; I'm not aware of your background and I want to answer this as completely as possible. This has to do with how Julia stirngs are converted to C strings. C strings are just pointers to an array of bytes where the null byte '\0' denotes the

[julia-users] Re: Help understanding failure on require

2014-01-31 Thread Eric Davies
You have an extra ')' near the end of these two lines: HIm = V(width,x,V0,a)*Im[i] -0.5*(Im[i+1]) -2.0*Im[i] + Im[i-1])/dx2; HR = V(width,x,V0,a)*R[i] -0.5*(R[i+1]) -2.0*R[i] + R[i-1])/dx2; Tip: those semicolons are not necessary :) On Friday, 31 January 2014 15:25:41 UTC-6, Comer Duncan

Re: [julia-users] Matlab versus Julia for loop timing

2014-01-30 Thread Eric Davies
This is true for modern MATLAB versions as well. On Thursday, 30 January 2014 15:17:26 UTC-6, Stefan Karpinski wrote: Yes, there is definitely going to be some time spent on JIT the first time, so to get a real timing, you need to measure the second time running it. On Thu, Jan 30, 2014

Re: [julia-users] Re: performances in solving systems of linear equations

2014-01-17 Thread Eric Davies
: If you look at the bytes allocated, it seems that Andrea did that. What version of Julia are you running, Andrea? Kevin On Fri, Jan 17, 2014 at 11:31 AM, Eric Davies iam...@gmail.comjavascript: wrote: Running once before will cause compilation of the called functions for the given types

Re: [julia-users] OT: entering Unicode characters

2014-01-17 Thread Eric Davies
Sublime Text (2 and 3) has a package called UnicodeMath which has similar functionality. and covers much of unicode by default. Has functionality to add symbols and to add synonyms to existing names. P.S.: \upSigma produces Σ and \sum produces ∑ (different). On Friday, 17 January 2014 14:29:39

[julia-users] Re: Can I write a macro that defines a function?

2014-01-16 Thread Eric Davies
Thanks guys. I used Andy's solution as it was easier to read and I was doing this in a whole quoted block.

[julia-users] Can I write a macro that defines a function?

2014-01-14 Thread Eric Davies
julia macro bar(num) :(foo(x) = $num) end julia @bar 5 foo#27 (generic function with 1 method) julia foo ERROR: foo not defined It appears that variable/function definitions in macros are mangled somehow. Is there any way to define a function or set a variable in a macro (s.t.

Re: [julia-users] Re: Style Guideline

2014-01-01 Thread Eric Davies
PEP8 has recently updated to allow for other preferences: Some teams strongly prefer a longer line length. For code maintained exclusively or primarily by a team that can reach agreement on this issue, it is okay to increase the nominal line length from 80 to 100 characters (effectively