[julia-users] Re: Help Keeping Up With Changes to Julia

2014-11-04 Thread James Porter
In general it's not recommended to use the latest nightly (version 0.4) (which is under rapid development and likely to break things quite often) right now. I would recommend switching to the latest 0.3 release (0.3.2 I believe), which if you have a git clone of the Julia repo you can get by

[julia-users] Re: base case for the reduce operator?

2014-11-04 Thread James Porter
To get an empty list of polynomials, you can type `Poly[]`. I wouldn't recommend changing the behavior of the built in reduce function though, that would definitely be confusing for anyone else who later wants to work with your module (and who will reasonably expect Base.reduce to return a

[julia-users] Re: Nonuniform arrays

2014-09-03 Thread James Porter
I think this sort of thing is usually called a ragged array, you might find more use cases, examples, etc., googling for that term. +1 on having a package for this, Array{Array{T}} often feels very awkward. On Tuesday, September 2, 2014 9:03:56 AM UTC-7, Reid Atcheson wrote: A common

[julia-users] ANN: Gumbo.jl (HTML parsing library)

2014-06-19 Thread James Porter
Hi All— A while back I was working on a webcrawler and I realized we didn't have a Julia HTML parser. I also wanted to learn how to wrap C libraries, so I started working on a wrapper around google's gumbo https://github.com/google/gumbo-parser library for parsing HTML. The result, Gumbo.jl,

[julia-users] Re: How to read and change the content of web pages to the vector ?

2014-06-09 Thread James Porter
I suppose I should mention that I have a prototype wrapper of Google's gumbo HTML parsing library in the works: https://github.com/porterjamesj/GumboParser.jl It's not on METADATA and I wouldn't consider the API stable, but everything seems to work pretty well so far. If you really want to use

[julia-users] Re: [julia-dev] Re: JuliaCon Question Thread

2014-06-03 Thread James Porter
for this? How many people are interested in this? Gustavo On Wed, May 14, 2014 at 11:51 AM, James Porter porterjam...@gmail.com wrote: Hey all— As far as Patrick's question goes— It is true that a lot of the talks at the conference are going to be about fairly advanced topics

[julia-users] Re: iterating over a dictionary

2014-05-18 Thread James Porter
iterating over a dictionary yields (key, value) tuples: julia proportionmap([1,1,2,2,3]) [2=0.4,3=0.2,1=0.4] julia for (k,v) in proportionmap([1,1,2,2,3]) println(k) end 2 3 1 julia —James On Sunday, May 18, 2014 7:26:39 PM UTC-5, Jason Solack wrote: Hello everyone! I'm

[julia-users] Re: JuliaCon Question Thread

2014-05-14 Thread James Porter
Hey all— As far as Patrick's question goes— It is true that a lot of the talks at the conference are going to be about fairly advanced topics (Julia internals, a prototype Julia typechecker, etc.). That said there will also be a number of talks that deal with using Julia to solve some sort of

[julia-users] Re: Optimal pmap usage

2014-05-06 Thread James Porter
The Julia garbage collector does not know about or manage memory you allocate in external C calls, if you free that memory yourself in your C code you should see your memory usage improve dramatically. On Tuesday, May 6, 2014 1:33:30 PM UTC-5, Gustavo Camilo wrote: Hi all, I have a related

[julia-users] Re: 1st JuliaConference: June 26th-28th, Chicago

2014-05-06 Thread James Porter
All— Registration and more details on JuliaCon are now available at juliacon.org Hope to see many of you there! On Thursday, April 3, 2014 9:42:37 AM UTC-5, Hunter Owens wrote: Hey Folks- Just a quick save-the-date announcement for the first ever Julia Conference http://juliacon.org that

[julia-users] Re: help with parallel

2014-05-05 Thread James Porter
I have no authority to speak on this but my impression is this is because functions are a bit special. Data is pretty straightforward to serialize and send over the wire, but a generic function in Julia is not just an ordinary object. Defining functions has global side-effects such as

[julia-users] Re: help with parallel

2014-05-05 Thread James Porter
I would recommend just calling addprocs at the very beginning. If you know your code needs to use multiple processors, may as well say so right away. On Monday, May 5, 2014 7:25:22 PM UTC-5, Ethan Anderes wrote: Thanks James: That's basically the solution that I've got implemented now.

[julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread James Porter
Hi all— I am fooling around with wrapping a C library which declares a struct in a similar manner to: typedef struct Thing { //other non-union fields here . . . union { A a; B b; C c; } stuff; } Where A, B, and C are all other structs defined in this

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread James Porter
(not sure if it supports unions). On Sat, May 3, 2014 at 2:25 AM, James Porter porter...@gmail.comjavascript: wrote: Hi all— I am fooling around with wrapping a C library which declares a struct in a similar manner to: typedef struct Thing { //other non-union fields here

Re: [julia-users] wrapping a C struct with unions of other structs

2014-05-03 Thread James Porter
Ahh nevermind, I think I see — declaring the stuff field to be the largest of the possible types and then reinterpreting the result as the correct type seems to work. Thanks! On Saturday, May 3, 2014 12:21:18 PM UTC-5, James Porter wrote: How would I convert manually? Right now I'm trying

[julia-users] Re: help with parallel

2014-05-03 Thread James Porter
Hi Ethan, Hmmm this is odd, in general you shouldn't need to explicitly send variables you read in a parallel for loop to other processors. For example: julia addprocs(4) 4-element Array{Any,1}: 2 3 4 5 julia args1 = 1 1 julia @parallel (+) for i=1:10 args1 end 10 Can you provide a

[julia-users] Re: help with parallel

2014-05-03 Thread James Porter
No problem! Rubber ducking can be an effective debugging technique, even over the internet :) On Saturday, May 3, 2014 7:34:21 PM UTC-5, Ethan Anderes wrote: Now I feel really silly. I had a typo: args1 was erroneously written arg1...hence the error that the workers couldn't find arg1.

[julia-users] Re: emacs IJulia notebook?

2014-04-16 Thread James Porter
I would recommend installing IPython 2.0 (the latest version), Pkg.checkout(IJulia) to get the latest there (two weeks can mean fairly out of date, Julia-land moves quickly for the moment), and upgrading your emacs packages to the latest, and seeing if that helps (or at the very least gives a

[julia-users] Re: Should 10x1 Array{Float64,2} be the same than 10-element Array{Float64,1}

2014-04-16 Thread James Porter
Hi joanenric— Julia makes a distinction between column vectors (10-element Array{Float64,1}) and row vectors (10x1 Array{Float64,2}). You can see this reflected in how they print: julia [1,2,3] 3-element Array{Int64,1}: 1 2 3 # column vector julia [1 2 3] 1x3 Array{Int64,2}: 1 2 3 #

[julia-users] Re: emacs IJulia notebook?

2014-04-15 Thread James Porter
Are you on the latest versions of IPython, IJulia, and all the relevant emacs packages (websocket, ein, etc.)? I had to upgrade a few things to get it to work. Does IJulia work fine with the browser interface? On Thursday, April 10, 2014 3:26:12 PM UTC-5, Andrew Dabrowski wrote: OK, I just

[julia-users] Re: Packing and unpacking parameters

2014-03-10 Thread James Porter
I've struggled with this exact problem in python in the past (e.g. https://stackoverflow.com/questions/16182898/unpacking-parameters-for-a-simulation). It's exacerbated by the fact that interfaces to solvers, optimizers, etc. often require the parameters be passed in as a vector, so using

Re: [julia-users] Composite Types With Initialized Fields

2013-12-22 Thread James Porter
If you want a constant field its probable that you would be better served by type parameter. On Sunday, December 22, 2013 3:14:15 PM UTC-6, Marcus Urban wrote: So, does this also mean that it is not possible to have constant fields inside a composite type? On Sun, Dec 22, 2013 at 5:26