Re: [julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2016-09-03 Thread Andrew Dabrowski
But what about nested pattern matching, or destructuring, isn't that much easier in Mathematica than Julia? For example defining a function of two lists by f[{w_,x_}, {y_,z_}]:=x y/(w+z). I remember reading the Julia manifesto a few years ago, where the stated goal was to create a single compu

[julia-users] ESS: library ref

2014-10-20 Thread Andrew Dabrowski
In the ESS wiki page for Julia (https://github.com/emacs-ess/ESS/wiki/Julia) it says: To look up for a topic [sic] in julia standard library reference: C-c C-d > C-r. > But when I try that I get "Sorry, not implemented for dialect Julia". An I doing something wrong or has that feature simpl

Re: [julia-users] env.jl error during make

2014-10-01 Thread Andrew Dabrowski
f that doesn't fix it, then this > may be a bug on your system due to checking conversions between integer > types. Are you on a 32-bit system, by any chance? > > On Wed, Oct 1, 2014 at 12:48 PM, Andrew Dabrowski > wrote: > >> I keep getting this

[julia-users] env.jl error during make

2014-10-01 Thread Andrew Dabrowski
I keep getting this error when trying to compile the latest pull (0.4)/ . . . env.jl error during bootstrap: LoadError(at "sysimg.jl" line 98: LoadError(at "env.jl" line 133: InexactError())) make[1]: *** [/home/dabrowsa/lang/julia/julia/usr/lib/julia/sys0.o] Error 1 make: *** [release] Error 2

Re: [julia-users] sum( itr, dims )

2014-08-28 Thread Andrew Dabrowski
imensions 1 and 3. > > --Tim > > On Wednesday, August 27, 2014 03:02:09 PM Andrew Dabrowski wrote: > > OK, thanks. I find the phrase "over the given dimensions" ambiguous - > > isn't it actually summing over the dimensions _not_ given? > > > > On

Re: [julia-users] sum( itr, dims )

2014-08-27 Thread Andrew Dabrowski
rally, sum(A, dims::Integer...) works, as does as sum(A, > (dims::Integer...), ). > > -- John > > On Aug 27, 2014, at 2:44 PM, Andrew Dabrowski > wrote: > > In the doc for the Standard library I see: > > sum(*A*, *dims*) > > Sum elements of an array over the given dimensions. > > In exactly what form should "dims" be given? > > > >

[julia-users] sum( itr, dims )

2014-08-27 Thread Andrew Dabrowski
In the doc for the Standard library I see: sum(*A*, *dims*) Sum elements of an array over the given dimensions. In exactly what form should "dims" be given?

Re: [julia-users] sizehint for new array

2014-05-18 Thread Andrew Dabrowski
y ) 1 by 1? I gather from what you said that the latter is not necessary. On Sunday, May 18, 2014 7:19:36 AM UTC-4, Tim Holy wrote: > > On Saturday, May 17, 2014 02:04:49 PM Andrew Dabrowski wrote: > > But is it wrong to use it the way I suggested? > > Not wrong, but whether it

[julia-users] sizehint( set, n ) returns Dict

2014-05-18 Thread Andrew Dabrowski
Any particular reason that when s is a Set, sizehint( s, n ) returns s.dict rather than s?

Re: [julia-users] sizehint for new array

2014-05-17 Thread Andrew Dabrowski
le to push! at least 10^5 elements without it having to re- > allocate and copy the data I've already added. > > --Tim > > On Saturday, May 17, 2014 09:29:49 AM Andrew Dabrowski wrote: > > What's the proper way to use sizehint when defining a new array? Is it >

[julia-users] sizehint for new array

2014-05-17 Thread Andrew Dabrowski
What's the proper way to use sizehint when defining a new array? Is it newarray = sizehint( f( oldarray ), n ), or do you have to already have the new variable defined before using sizehint?

Re: [julia-users] for x=xs ?

2014-05-13 Thread Andrew Dabrowski
the = form, which is why older code like this > uses = but decided that writing `for x = xs` was really confusing, so we > added `for x in xs` as an alternate syntax. These days I only use the = > form when the right hand side is a range. > > > On Tue, May 13, 2014 at 4:35

[julia-users] for x=xs ?

2014-05-13 Thread Andrew Dabrowski
So I'm looking at base/set.jl, and I'm almost immediately puzzled by some syntax. union!(s::Set, xs) = (for x=xs; push!(s,x); end; s) What is xs? I might have expected union!(s::Set, xs...) = (for x in xs; push!(s,x); end; s) but "for x=xs" I don't get. Can someone explain how this syntax wo

Re: [julia-users] map and map! on Sets

2014-05-13 Thread Andrew Dabrowski
So this would involve adding a map method to base/set.jl? On Tuesday, May 13, 2014 3:03:47 PM UTC-4, Kevin Squire wrote: > > Andrew, I'll reiterate that a pull request would be very welcome. I think > you would find the Set functionality rather self contained, and the map > function implementati

Re: [julia-users] Re: references in sets

2014-05-13 Thread Andrew Dabrowski
he caller's local scope is bound to. >> There's a post somewhere about why this is a good thing somewhere that I >> wrote a while ago; I'll see if I can dig it up. >> >> On May 13, 2014, at 1:42 PM, Andrew Dabrowski wrote: >> >> Thanks ever

[julia-users] Re: references in sets

2014-05-13 Thread Andrew Dabrowski
Thanks everybody, but I'm still confused about something. Suppose I want to make my own ! function: how do I go about it? julia> type testtype v::Bool end julia> t1 = testtype( true ) testtype(true) julia> t2 = testtype( false ) testtype(false) julia> function testchange!( t::testtype, b::Bo

[julia-users] Re: map and map! on Sets

2014-05-13 Thread Andrew Dabrowski
Given that set replacement is a fundamental mathematical operation (e.g. it's an axiom of ZFC) I tend to regard an implementation of map as slightly broken if map( , ) doesn't return a set. I realize though that unordered collections are unnatural from a computer's point of view. I take the

Re: [julia-users] references in sets

2014-05-12 Thread Andrew Dabrowski
So it is OO 101, thanks. Note that to a programming naif the difference between x.a = new and x = new isn't very perspicuous, but in the first the value of x is modified (old pointer maintained?) while in the second it is replaced (new pointer?). Is there a rule of thumb I can memorize

Re: [julia-users] map and map! on Sets

2014-05-12 Thread Andrew Dabrowski
On Monday, May 12, 2014 7:09:12 PM UTC-4, Kevin Squire wrote: > > `map` seems to work for me: > > julia> a = Set([1,2,3]) > Set{Int64}({2,3,1}) > > julia> map(x->2x, a) > 3-element Array{Any,1}: > 4 > 6 > 2 > > Can you give an example where it doesn't? > The problem is that it returns an ar

[julia-users] map and map! on Sets

2014-05-12 Thread Andrew Dabrowski
I see that map and map! do not play nice with Sets. Are there plans to improve the situation, or should I learn to live with it?

[julia-users] references in sets

2014-05-12 Thread Andrew Dabrowski
This is probably OO 101, but I'm puzzled by how references work in sets. Here's a minimal example. julia> type testtype v::Bool end julia> t1 = testtype( true ) testtype(true) julia> t2 = testtype( false ) testtype(false) julia> tset = Set{testtype}({t1,t2}) Set{testtype}({testtype(true),test

Re: [julia-users] exited with code 35072

2014-04-18 Thread Andrew Dabrowski
Ahh, thanks, that's a good clue, I'll fool around with memory allocation... The error code is via the batch scheduler, but seems to be just passed on from Julia.

Re: [julia-users] exited with code 35072

2014-04-18 Thread Andrew Dabrowski
I'm experimenting with GAs. I'm using a Dict to keep tabs on the population and fitness, and I wanted to try using a parallel algorithm to initially populate the Dict. function pAddQGen( n::Int, dct::Dict{ Array{Int,1}, Float64 }, len::Int=4000 , lim::Int=5 ) lst = [ randOrthGen( len, lim,

[julia-users] exited with code 35072

2014-04-18 Thread Andrew Dabrowski
What does "code 35072" mean? I'm experimenting with parallel processes on a mainframe, and my test job with a short execution time and small data set ran fine, when I tried the same program with a large data set and long execution time I got the error "exited with code 35072".

[julia-users] Re: emacs IJulia notebook?

2014-04-16 Thread Andrew Dabrowski
I'm trying iPython 2.0, but now I'm getting this error: https://github.com/tkf/emacs-ipython-notebook/issues/137 That seems to still be an open issue with iPython 2. I get the same error whether I use stable emacs 24 or a bleeding edge version.

[julia-users] Re: emacs IJulia notebook?

2014-04-15 Thread Andrew Dabrowski
Here's what I've got: ein 20140317 websocket 20140104 ipython 1.2.1 IJulia must be up to date since I only installed a couple of weeks ago. Anything else I should check? IJulia does in fact work fine with the web browser interface.

[julia-users] Re: Is it wrong to think of Julia as a Lisp that uses m-expressions?

2014-04-10 Thread Andrew Dabrowski
I'm neither a Julia nor even a competent programmer, but since no one else has responded I'll take a shot at it. I think that might be fair description of Mathematica, but not of Julia. Julia is very much a multi-paradigm language, it's not pure enough in any sense to be considered a member of

[julia-users] linalg build error

2014-04-10 Thread Andrew Dabrowski
On the latest pull I'm getting this build error: $ make CC src/jltypes.o CC src/gf.o FLISP src/julia_flisp.boot FLISP src/julia_flisp.boot.inc CC src/ast.o CC src/builtins.o CC src/module.o CC src/codegen.o CC src/interpreter.o CC src/alloc.o CC src/dll

[julia-users] Re: emacs IJulia notebook?

2014-04-10 Thread Andrew Dabrowski
I tried both the ein and ipython emacs packages but wasn't able to connect Julia (Python works fine). If you'd like I could try it again and post the error messages. On Thursday, April 10, 2014 11:15:04 AM UTC-4, Stefan Karpinski wrote: > > Does anyone have any experience using Emacs IPython >

Re: [julia-users] minimum( ) = Inf ?

2014-04-01 Thread Andrew Dabrowski
You seem to be saying they're defined on Iterable{T} whenever < is defined on TxT. The docs on maximum and minimum are a little sketchy, maybe that should be clarified. I suppose eventually you might want to add an optional ordering that defaults to <. But type stability is a perfectly good

Re: [julia-users] minimum( ) = Inf ?

2014-04-01 Thread Andrew Dabrowski
I had assumed that minimum only worked when T <: Real. A finite collection of elements of an arbitrary type need not have a max or min in any natural sense. On Tuesday, April 1, 2014 12:33:39 PM UTC-4, Stefan Karpinski wrote: > > Type stability is the main concern and consistency is the other.

[julia-users] minimum( ) = Inf ?

2014-04-01 Thread Andrew Dabrowski
This was probably discussed and settled long ago, in which case just point me to the thread. Why not define minimum( empty ) = Inf whenever empty is an iterable with no elements?

[julia-users] Re: [ANN] Julia + Light Table!

2014-03-31 Thread Andrew Dabrowski
Issue added. I notice you removed the suggestion that Jewel could be used from a git clone. Is there no way to make that work in LT? > >

[julia-users] Re: [ANN] Julia + Light Table!

2014-03-30 Thread Andrew Dabrowski
That's great, I've been meaning to have a serious look at LT for a long time. Just got it going and seems very nice. Two hiccups so far: 1. Apparently you must restart LT after adding a new plugin. 2. When run in terminal Winston redraws to the same window, but in LT it seems to create a new

Re: [julia-users] julia crashes: integer division error

2014-03-29 Thread Andrew Dabrowski
Ah, that's the problem, I was using emacs Shell, it works OK on a normal terminal like xfce4-terminal. On 03/29/2014 09:41 PM, Keno Fischer wrote: What kind of terminal emulator are you using? On Sat, Mar 29, 2014 at 9:40 PM, Andrew Dabrowski mailto:unhandya...@gmail.com>

[julia-users] julia crashes: integer division error

2014-03-29 Thread Andrew Dabrowski
Just pulled latest on git hoping to try out the new repl, but ran into this: $ ./julia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type "help()" to list help topics

[julia-users] Re: Array{ASCIIString,1} becomes Array{Union(ASCIIString,UTF8String),1}

2014-03-29 Thread Andrew Dabrowski
Thanks for the links! Evidently type-widening in comprehensions was recognized over a year ago and the fix was to add explicit comprehension typing. julia> test = ASCIIString[ randBinStr(3) for i=1:0 ] seems to do the trick.

[julia-users] Re: Array{ASCIIString,1} becomes Array{Union(ASCIIString,UTF8String),1}

2014-03-29 Thread Andrew Dabrowski
Not at all sure this is the right way to do it... function randBinStr( len::Int ) res = repeat( "0", len ) replace( res, r"(.)", x -> ( rand() < 0.5 ? "0" : "1" ) ) end On Saturday, March 29, 2014 9:49:59 AM UTC-4, andrew cooke wrote: > > can you post randBinStr? don't have an explanat

[julia-users] Array{ASCIIString,1} becomes Array{Union(ASCIIString,UTF8String),1}

2014-03-29 Thread Andrew Dabrowski
My function randBinStr produces a random string of 0s and 1s of given length. julia> typeof( randBinStr(5) ) ASCIIString (constructor with 1 method) julia> test = [ randBinStr(5) for i=1:2 ] 2-element Array{Union(ASCIIString,UTF8String),1}: "01110" "00011" julia> map( typeof, test ) 2-elem

Re: [julia-users] print formatting: right justification

2014-03-27 Thread Andrew Dabrowski
to be broadcasting or something? This has > come up before but never phrased quite that way – maybe this is the first > time that idea clicked for me. > > > On Mar 27, 2014, at 11:22 PM, Andrew Dabrowski > > > > wrote: > > > > > > > > Thanks - I really should have been able to figure that out. I guess I > need sleep. :) > > >

Re: [julia-users] print formatting: right justification

2014-03-27 Thread Andrew Dabrowski
Thanks - I really should have been able to figure that out. I guess I need sleep. :)

[julia-users] print formatting: right justification

2014-03-27 Thread Andrew Dabrowski
j ulia> test = [ "1", "21", "321" ] 3-element Array{ASCIIString,1}: "1" "21" "321" I'd like to print this out as 1 21 321 julia> print( test ) 1 21 321 julia> @printf( "%3s", test ) 1 21 321 Maybe I just don't understand the formatting commands: according to what I read, "%3s

Re: [julia-users] Re: Not fun

2014-03-21 Thread Andrew Dabrowski
On Friday, March 21, 2014 11:37:33 AM UTC-4, Stefan Karpinski wrote: > > Getting back to your original example, I would counter that you never > really want to just do something like "replace the 16th character of this > string" in isolation. How did you figure out the index 16? What you really

[julia-users] make failure: gcc version

2014-03-19 Thread Andrew Dabrowski
I'm trying to build the latest git pull on gentoo amd64 with gcc-4.7.3-t1 installed. Unfortunately make seems to think I have gcc-4.5.4. $ make CXXLD libpcrecpp.la g++: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/../../../../lib64/crti.o: No such file or directory g++: error: /usr/lib/gcc/