[julia-users] OptionTypes.jl

2014-07-31 Thread John Myles White
At JuliaCon, I described the idea of using Option types instead of NAtype to make it easier to write type-stable code that interacts with NA’s. To help facilitate a debate about the utility of this approach, I just wrote up a minimal package that implements Option types: https://github.com/john

Re: [julia-users] Loading packages is very slow...

2014-07-30 Thread John Myles White
For example, I used to have a base/userimg.jl file that read as follows: Base.require("Distributions.jl") Base.require("Optim.jl") Base.require("DataFrames.jl") Base.require("Gadfly.jl”) — John On Jul 30, 2014, at 9:13 PM, Ivar Nesje wrote: > If you compile Julia yourself, you can use the und

Re: [julia-users] Optim.jl line search problems

2014-07-30 Thread John Myles White
enough about line search methods to have an > intuition about that, but if it is the case, maybe the line search routine > should throw a more informative error? > > -Thom > > On Wednesday, July 30, 2014 3:44:51 PM UTC-5, John Myles White wrote: > Would be useful to understand

Re: [julia-users] Counting instances from an array that fulfill some inequality statements

2014-07-30 Thread John Myles White
Wed, Jul 30, 2014 at 5:12 PM, wrote: > I'm a bit stuck on this one. Could I get one more hint about a way I could > get the same thing done without using the illegal indexing? > > On Wednesday, July 30, 2014 5:46:58 PM UTC-4, John Myles White wrote: > Yeah, it’s the combina

Re: [julia-users] Counting instances from an array that fulfill some inequality statements

2014-07-30 Thread John Myles White
utputarray[i+1] >= 0 > count += 1 > end > > Factoring in that Julia begins indexing from 1. > > On Wednesday, July 30, 2014 4:41:43 PM UTC-4, John Myles White wrote: > This pseudocode almost works. Just replace Int64[1:len(outputarray)] with > 1:lengt

Re: [julia-users] Fast method dispatch depending on constant parameter value

2014-07-30 Thread John Myles White
I think you should assume you have to perform branching at run-time whenever you want to condition behavior on values (like -1 vs. +1) rather than on types (like Float64 vs. Int64). So I think it’s going to be very difficult to achieve the goal you have in mind. — John On Jul 30, 2014, at 3:0

Re: [julia-users] Optim.jl line search problems

2014-07-30 Thread John Myles White
Would be useful to understand exactly what goes wrong if we want to fix this problem. I’m mostly used to errors caused by inaccurate gradients, so I don’t have an intuition for the cause of this problem. — John On Jul 30, 2014, at 10:45 AM, Thomas Covert wrote: > No, I haven't tried that yet

Re: [julia-users] Counting instances from an array that fulfill some inequality statements

2014-07-30 Thread John Myles White
This pseudocode almost works. Just replace Int64[1:len(outputarray)] with 1:length(outputarray). There’s also a bug in your core logic, but I’ll leave fixing that as an exercise to the reader. — John On Jul 30, 2014, at 1:03 PM, yaoismyh...@gmail.com wrote: > Hi guys, > > I asked this in a

Re: [julia-users] Re: [newb] confused about constructors

2014-07-30 Thread John Myles White
espace after the name of the > function. I may find it hard to love a language where the addition of > whitespace produces ambiguity. (Not to mention, I always put whitespace > between > name of function and args) > > John Myles White wrote: > >> Hi Neal, >> >

Re: [julia-users] [newb] confused about constructors

2014-07-30 Thread John Myles White
One typo in my code: > FIR{S, T}(in::Vector{S}, coef::Vector{T}) = FIR{S, T}(zeros(S, size(in)), > coef) should be > FIR{S, T}(in::Vector{S}, coef::Vector{T}) = FIR{S, T}(in, coef) — John On Jul 30, 2014, at 8:11 AM, John Myles White wrote: > Hi Neal, > > I think rewr

Re: [julia-users] [newb] confused about constructors

2014-07-30 Thread John Myles White
Hi Neal, I think rewriting your code to follow a little bit more conventional Julia style will help you to see where you’ve gone wrong: type FIR{S, T} in::Vector{S} coef::Vector{T} function FIR(in::Vector{S}, coef::Vector{T}) new(zeros(S, size(in)), coef) end end FIR{S, T}(i

Re: [julia-users] Numerical types and machine word size

2014-07-29 Thread John Myles White
I think you're assuming people's beliefs about programming languages are simpler to modify than they've proven to be in our experience. Here's an experiment you could try to see if I'm right: over the course of six months, reply to every e-mail you see on julia-users that derives from a misunde

Re: [julia-users] Numerical types and machine word size

2014-07-29 Thread John Myles White
On Jul 29, 2014, at 3:45 PM, Júlio Hoffimann wrote: > 2014-07-29 19:32 GMT-03:00 John Myles White : > I think the confusion is that Julio assumes Int is used for brevity, when it > is actually used for cross-platform compability. > > -- John > > Yes, I assumed the In

Re: [julia-users] Numerical types and machine word size

2014-07-29 Thread John Myles White
I think the confusion is that Julio assumes Int is used for brevity, when it is actually used for cross-platform compability. -- John On Jul 29, 2014, at 3:29 PM, Stefan Karpinski wrote: > Float would always be Float64. > >> On Jul 29, 2014, at 6:25 PM, Júlio Hoffimann >> wrote: >> >> I'

Re: [julia-users] Roadmap for 0.4?

2014-07-29 Thread John Myles White
Might we see the changes to the type system that are required to get higher-order functions to specialize on input functions? -- John On Jul 29, 2014, at 9:49 AM, Stefan Karpinski wrote: > There is no official roadmap for 0.4 yet – just a collection of ideas in > various people's heads and s

Re: [julia-users] array doubling

2014-07-29 Thread John Myles White
gt; repeat(A, inner = Int[], outer = Int[]) > i.e isn't the comma in the wrong position? > > On Tuesday, July 29, 2014 4:06:22 PM UTC+2, John Myles White wrote: > repeat([1, 2, 3], inner = [2]) > > On Jul 29, 2014, at 7:03 AM, Andrei Berceanu wrote: >

Re: [julia-users] array doubling

2014-07-29 Thread John Myles White
repeat([1, 2, 3], inner = [2]) On Jul 29, 2014, at 7:03 AM, Andrei Berceanu wrote: > Whats the easiest way of going from an array > [1,2,3] -> [1,1,2,2,3,3] > i.e. repeating all elements 2 (or more generally, n) times? > > A

Re: [julia-users] Strategy for large data frames using DataFrames.jl

2014-07-28 Thread John Myles White
The DataStream functionality was moved out of the main DataFrames code because it's not sufficiently robust. We need to update the docs. Have you tried append! on DataFrame objects? It should resolve some of the problems you're facing when using vcat/rbind caused by having to do more and more c

Re: [julia-users] Is it possible to plot the cumulative distribution function using Gadfly?

2014-07-28 Thread John Myles White
I'm not aware of any such function. Are you talking about the ecdf() function that comes with base R? -- John On Jul 28, 2014, at 2:05 PM, Darf Ferrara wrote: > I'm looking for something like ecdf() in ggplot2.

Re: [julia-users] Correlation sparse array is very slow.

2014-07-28 Thread John Myles White
I think a correlation matrix can have arbitrary rank, but might be wrong. -- John On Jul 28, 2014, at 9:36 AM, Stefan Karpinski wrote: > Does this computation not always return a rank-1 matrix? > > > On Mon, Jul 28, 2014 at 12:33 PM, John Myles White > wrote: > But how

Re: [julia-users] Re: Correlation sparse array is very slow.

2014-07-28 Thread John Myles White
But how would you know the rank of the correlation matrix in advance? -- John On Jul 28, 2014, at 9:25 AM, Stefan Karpinski wrote: > This is the sort of thing that just begs for a custom representation of a > rank-1 matrix, which fortunately, isn't terribly hard to implement in Julia. > > >

Re: [julia-users] Semi-OT: Finding optimal k in k-means

2014-07-28 Thread John Myles White
Art wrapped FLANN, which should make things much easier. — John On Jul 28, 2014, at 8:19 AM, Dahua Lin wrote: > We should probably incorporate (approximate) nearest neighbor search into > Clustering.jl at some point. > > Dahua > > > On Monday, July 28, 2014 10:09:59

Re: [julia-users] Semi-OT: Finding optimal k in k-means

2014-07-28 Thread John Myles White
FWIW, there’s a KD-tree implementation in NearestNeighbors.jl — John On Jul 28, 2014, at 7:27 AM, Jacob Quinn wrote: > This probably isn't very helpful currently, but I've been meaning to try to > do a `kd-tree` implementation that allows for fast clustering for up to 7-10 > dimensions. (the

Re: [julia-users] Re: Function to tighten types?

2014-07-27 Thread John Myles White
type > return el_type > end > > # Example use case > mat = {1.0 2; 3 4.0} > el_type = infer_eltype(mat) > tight_mat = convert(Array{el_type}, mat) > @test eltype(tight_mat) == Real > @test size(tight_mat) == size(mat) > @test isequal(tight_mat, mat) > ``` > > Hop

[julia-users] Function to tighten types?

2014-07-27 Thread John Myles White
Do we have a function that will take in an Array{Any}, compute the typejoin of its elements and convert the Array to the tightest possible type? — John

Re: [julia-users] Re: Finding multiple local minima in Julia

2014-07-27 Thread John Myles White
Is CUTEst.jl easier to get working these days? The issue I opened in March seems to still be open. — John On Jul 27, 2014, at 6:40 AM, Tim Holy wrote: > A package of test functions sounds worthwhile. There's also CUTEst.jl: > https://github.com/lpoo/CUTEst.jl > > --Tim > > On Sunday, July 2

Re: [julia-users] Finding multiple local minima in Julia

2014-07-27 Thread John Myles White
Re. (3), I’d like to move the optimization problems we use for testing out of Optim into a separate package. Having a nice test suite would be a big gain for JuliaOpt. — John On Jul 27, 2014, at 6:25 AM, Hans W Borchers wrote: > Ken: > > (1) Thanks for pointing out this approach and for imp

Re: [julia-users] Extend a Dict

2014-07-26 Thread John Myles White
You don’t push to Dict’s because they’re not ordered. You can add a entry using indexing: dc = Dict{UTF8String, Int64}() dc["A."] = 2 — John On Jul 26, 2014, at 5:09 PM, Ben Ward wrote: > Is it possible to extend a dict with a key value pair? > > I don't see a method to do it in the standar

Re: [julia-users] Question Regarding Issue Tracker

2014-07-26 Thread John Myles White
aily builds and > will be incorporated into the next "Current Release"? > > Thank you agian for the quick response and the help. > > Regards, > Don > > On Saturday, July 26, 2014 12:10:20 PM UTC-4, John Myles White wrote: > If you look carefully at the issue

Re: [julia-users] Question Regarding Issue Tracker

2014-07-26 Thread John Myles White
If you look carefully at the issue where the “merged” icon occurs, you’ll see that a patch was merged that solved the issue. This is a new way that GitHub has recently started visualizing events inside of an issue comment thread. — John On Jul 26, 2014, at 9:07 AM, Donald Lacombe wrote: > De

Re: [julia-users] Array of types that contain Arrays--how?

2014-07-25 Thread John Myles White
You have to construct the contained objects explicitly. An Array without initialization just contains junk memory for all types. bs = Array(B, npop) for i in 1:npop bs[i] = B() end -- John On Jul 25, 2014, at 5:36 PM, Ross Boylan wrote: > I think I've narrowed down my previous problem. I

Re: [julia-users] Whitespace bug?

2014-07-25 Thread John Myles White
This is an interesting case. You need semicolons to get this to work on a single line: function bounds(p::Vector); [min(p), max(p)]; end The preferred way to do this, by the way, is with the one-liner special syntax: bounds(p::Vector) = [min(p), max(p)] -- John On Jul 25, 2014, at 11:21 AM,

Re: [julia-users] Disable assertions?

2014-07-25 Thread John Myles White
I'd be in favor of having both assert and enforce. -- John On Jul 25, 2014, at 7:08 AM, Magnus Lie Hetland wrote: > Ah, right. Yeah, I did look for those in the Julia code, but couldn't find > them. I see now that they're in repl.c, where they affect jl_compileropts. > > Well, there are two

Re: [julia-users] Get dependencies (of a particular version) of a package?

2014-07-25 Thread John Myles White
I'd be in favor of adding the feature to Julia. -- John On Jul 25, 2014, at 6:38 AM, Iain Dunning wrote: > Someone could add the feature to Julia itself, and I guess its in there sorta > in that it needs that knowledge to resolve dependencies, but I think making > "nice" output probably is b

Re: [julia-users] string array concatenates with a string not working?

2014-07-24 Thread John Myles White
Arrays of strings aren’t part of a vector space. There’s no reason you should be able to multiply them by a scalar. — John On Jul 24, 2014, at 8:45 PM, cnbiz850 wrote: > Well, * works with numerics > > julia> A = [1:5] > 5-element Array{Int64,1}: > 1 > 2 > 3 > 4 > 5 > julia> A *3 > 5-element

Re: [julia-users] Re: what is the easiest way to convert array type?

2014-07-24 Thread John Myles White
Vector{String} is semantically equivalent to Array{String, 1}. It's just more readable. Also worth noting that you basically never want to work with Vector{String}. You almost certainly want Vector{UTF8String}. -- John On Jul 24, 2014, at 7:47 PM, cnbiz850 wrote: > Thanks. Didn't know abou

Re: [julia-users] Disable assertions?

2014-07-24 Thread John Myles White
I'd love to have this functionality, but it's worth noting that some code (e.g. Optim) has assert being used for error handling right now. So there'd need to be a period where people transition away from using assertions for error-handling rather than for testing. -- John On Jul 24, 2014, at

Re: [julia-users] How to append tuples of floats to a Float64 array?

2014-07-24 Thread John Myles White
4,1},Float64,Float64,Float64,Float64) > > I am using 0.2.1. > > On Thursday, July 24, 2014 2:13:58 PM UTC-4, John Myles White wrote: > You must splat if you use push! > > You must _not_ splat if you use append! > > -- John > > On Jul 24, 2014, at 11:10 AM, y

Re: [julia-users] How to append tuples of floats to a Float64 array?

2014-07-24 Thread John Myles White
4) > Do I need to use a different sort of array? > > On Thursday, July 24, 2014 12:48:15 PM UTC-4, Jameson wrote: > Yes > > Or use append! instead of push! > > > On Thursday, July 24, 2014, wrote: > Ah, is ... equivalent to the * in Python? > > On Thursday

Re: [julia-users] Re: Help needed, running slow

2014-07-24 Thread John Myles White
I believe the main problem with the global scope isn't that it's called the global scope (rather than the scope of a let block), but that the scope is never terminated during a REPL session, preventing end-to-end analysis of types. -- John On Jul 24, 2014, at 7:14 AM, Arnaud Amiel wrote: > I

Re: [julia-users] How to append tuples of floats to a Float64 array?

2014-07-24 Thread John Myles White
You need to splat the tuple first: push!(tuplestorage,newtuple...) -- John On Jul 24, 2014, at 9:38 AM, yaoismyh...@gmail.com wrote: > Hi, > Translating some of my code from Python, I am trying to find a means of > concatenating and appending tuples to an array. > > In Python, I was able to

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread John Myles White
I think the difficulty here is that the people who are worst affected by these kinds of performance changes may be people who also might not know that they should opt in to using Lint/TypeCheck. To get the proper effect from those tools, you probably need to impose them from above by default rat

Re: [julia-users] Re: Help needed, running slow

2014-07-23 Thread John Myles White
Why not view this as a learning opportunity to discover that changes you perceive to be minor are, in fact, not minor -- but are instead substantive changes to the semantics of your program? -- John On Jul 23, 2014, at 9:38 AM, Arnaud Amiel wrote: > As suggested by a few of you, I put everyt

Re: [julia-users] Re: How to overcome versioning issues?

2014-07-22 Thread John Myles White
FWIW, the mean of the min and max is called the midrange. — John On Jul 22, 2014, at 8:17 AM, Spencer Russell wrote: > Hi Elliot, > > The median isn't the mean of the min and max (though that was fun to say). > > Wikipedia says it well: > > "the median is the numerical value separating the

Re: [julia-users] Re: build-in function to find inverse of a matrix

2014-07-21 Thread John Myles White
There's one complication here, which is that a single ? already changes the mode of the REPL into help mode. So this would have to be a mode only triggerable from inside of help mode. -- John On Jul 21, 2014, at 6:47 PM, Ethan Anderes wrote: > +1. For some reason my fingers always get tied u

Re: [julia-users] Re: [ANN] MultivariateStats

2014-07-19 Thread John Myles White
t;> >> These have been working quite successfully for some packages, such as >> Distributions, DataStructures, and Graphs, etc. >> >> Dahua >> >> >> >> On Saturday, July 19, 2014 5:26:36 PM UTC-5, John Myles White wrote: >> I su

Re: [julia-users] Re: [ANN] MultivariateStats

2014-07-19 Thread John Myles White
I suppose one very effective solution to creating a coherent ML organization is to do all the work yourself. :) -- John On Jul 19, 2014, at 1:40 PM, Dahua Lin wrote: > Linear Least Square and Ridge Regression are also included now. (see > http://multivariatestatsjl.readthedocs.org/en/latest/

Re: [julia-users] essay on the history of programming languages

2014-07-19 Thread John Myles White
FWIW, shared memory parallelism is going to improve in Julia in the future. -- John On Jul 19, 2014, at 9:40 AM, Tracy Wadleigh wrote: > A more robust path to shared memory parallelism. SharedArray is still not a > first-class Julia citizen. And, even if it were, memory safety would still be

Re: [julia-users] [ANN] MultivariateStats

2014-07-18 Thread John Myles White
; On Friday, July 18, 2014 9:11:08 PM UTC-5, John Myles White wrote: > This is really great, Dahua. We should probably deprecate MultivariateStats, > which was always pretty unreliable. > > -- John > > On Jul 18, 2014, at 9:13 PM, Dahua Lin wrote: > >>

Re: [julia-users] [ANN] MultivariateStats

2014-07-18 Thread John Myles White
This is really great, Dahua. We should probably deprecate MultivariateStats, which was always pretty unreliable. -- John On Jul 18, 2014, at 9:13 PM, Dahua Lin wrote: > Recently, I developed a new package for Julia (under JuliaStats): > MultivariateStats, for multivariate statistical analysi

Re: [julia-users] Background Knowledge needed to Start working with/learning Julia?

2014-07-18 Thread John Myles White
This might seem like just a reframing of the situation, rather than an answer, but I personally don't think there's any background knowledge you need to get started using Julia. What you need is a willingness to figure out what's going on by doing some digging through the manual, the general web

Re: [julia-users] Re: my first julia function

2014-07-16 Thread John Myles White
To follow up on Dahua's comment: If you're interested in using the fastest code, the code that Dahua posted is the fastest since it uses several clever tricks to get the absolute best speed. If you're interested in writing a faster implementation than the one you wrote, you need to avoid alloca

Re: [julia-users] [newb] Trouble with compound Boolean expressions

2014-07-15 Thread John Myles White
I think you want something more like a >= 0 && b >= 0 && c >= 0 Also, you probably don't want to use global variables for code where performance matters. You should pass a, b and c to gen() as parameters gen(a, b, c). -- John On Jul 15, 2014, at 6:31 PM, yaoismyh...@gmail.com wrote: > Hi, >

Re: [julia-users] Efficient linear transformation (A*x and A*X)

2014-07-14 Thread John Myles White
Basic linear algebra is done by BLAS and LAPACK, so I don't think these issues cause performance problems. -- John On Jul 14, 2014, at 6:55 PM, Andrei Zh wrote: > Linear transformation is super-frequent operation in scientific computations, > so I'd like to know how to perform it in a most e

Re: [julia-users] expr indexing in dataframes?

2014-07-14 Thread John Myles White
Why not just use straight indexing like below? df[Bool[ismatch(r"a", x) for x in df[:Column]], :] -- John On Jul 14, 2014, at 9:32 AM, Andrew G wrote: > vec = map(x -> ismatch(r"regex_expression", x), df[:column]) > vec = convert(DataArray{Bool}, vec) > subset(df, results) >

Re: [julia-users] Sort error, How to find reserved word in big text ?

2014-07-13 Thread John Myles White
parse isn’t a cure for anything. parse interprets inputs under the assumption that they are valid Julia code. Your data isn’t valid Julia code, so you should not use parse. — John On Jul 13, 2014, at 12:01 AM, Paul Analyst wrote: > At first I did and it was a problem with the "Inf". I realiz

Re: [julia-users] essay on the history of programming languages

2014-07-12 Thread John Myles White
I loved this two-part essay. Highly recommend it to anyone who hasn’t read it. — John On Jul 12, 2014, at 7:55 PM, Stefan Karpinski wrote: > Graydon Hoare (original author of Rust) wrote a truly lovely essay in two > parts about the history of programming languages, the predominance of > two

Re: [julia-users] how use find ?

2014-07-12 Thread John Myles White
On Jul 12, 2014, at 1:04 PM, J Luis wrote: > That is also true but a much more rare case, typemax(Int32) is still a quite > high number for an array size and before an Int64 is needed changes are non > negligible that a memory requested failed because a big contigous chunk of > memory was not

Re: [julia-users] how use find ?

2014-07-12 Thread John Myles White
I’m really confused. Do you want the indices to be 32-bit integers instead of 64-bit integers? Isn’t that equivalent to asking for your code to be broken anytime your vector has more than typemax(Int32) elements? — John On Jul 12, 2014, at 12:43 PM, J Luis wrote: > > julia> find(x->x>5,a) >

Re: [julia-users] Re: New Julia tutorial from SciPy now online

2014-07-12 Thread John Myles White
Maybe we should have Learning and Teaching separately? Or maybe Teaching should be under a section about people using Julia? — John On Jul 12, 2014, at 9:35 AM, Stefan Karpinski wrote: > Well, originally, it was actually teaching in the sense of places where > people have used Julia in teach

Re: [julia-users] Re: Contributing an external package

2014-07-10 Thread John Myles White
I'd use a package like Distributions.jl as your example rather than SGD.jl, which is really, really rough around the edges. -- John On Jul 10, 2014, at 8:32 AM, Eric Chiang wrote: > Yeah I have. > > Beyond just the actual technical requirements, I was wondering more generally > about best p

Re: [julia-users] New Julia tutorial from SciPy now online

2014-07-10 Thread John Myles White
This is a really great tutorial. -- John On Jul 10, 2014, at 5:54 AM, David P. Sanders wrote: > Many thanks to all those who suffered my inane questions and helped this to > take shape, in particular: > > - Jeff, who persuaded me to try out Julia > - Alonso & Luis, who convinced me that it w

Re: [julia-users] weird behaviour dynamic function declarations

2014-07-10 Thread John Myles White
I think you're hitting this issue: https://github.com/JuliaLang/julia/issues/265 -- John On Jul 10, 2014, at 1:31 AM, Johannes Degn wrote: > > > Im not sure if this is a bug or if I am a bug. Maybe someone can explain this > to me: > > I am running julia Version 0.3.0-prerelease+3649 on li

Re: [julia-users] Interest in a Julia <-> Stan interface?

2014-07-09 Thread John Myles White
to Mamba.jl - > http://mambajl.readthedocs.org/en/latest/intro.html#the-mamba-package ). > > Regards, > Rob J. Goedman > goed...@icloud.com > > > > > On Jul 9, 2014, at 8:45 AM, John Myles White wrote: > >> I’m not sure I understand how a C++ FFI af

Re: [julia-users] Interest in a Julia <-> Stan interface?

2014-07-09 Thread John Myles White
gt; Julia's v0.3-prerelease (as it uses the new DataFrames). > > Finally, a significant part of the value of CmdStan/Stan is the Stan team & > community. Even with a mature C++ FFI, I would like to remain as > 'interchangeable' with both Stan and CmdStan as possib

Re: [julia-users] Ideomatic way to write a function that works with a collection of any Number (any subtype of type)

2014-07-08 Thread John Myles White
What you're doing isn't a workaround: it's the correct way to do this in the current version of Julia. There may be shorthand in the future, but this is the right approach today. -- John On Jul 8, 2014, at 2:01 PM, Andrei Zh wrote: > Here's another question about code style. Let's say I want

Re: [julia-users] Passing parameters to 'optimize'

2014-07-08 Thread John Myles White
no method optimize(Function, Int64) > > I am running Version 0.3.0-prerelease+3884 (2014-06-25 10:41 UTC) and have > updated all packages. > > Thanks for your help > Mathieu > > On Tuesday, July 8, 2014 2:48:24 PM UTC-4, John Myles White wrote: > This should work, exce

Re: [julia-users] Passing parameters to 'optimize'

2014-07-08 Thread John Myles White
This should work, except that you're not providing any initial values for x. Is your problem one-dimensional or multi-dimensional? -- John On Jul 8, 2014, at 11:44 AM, Mathieu Taschereau-Dumouchel wrote: > I am trying to optimize a simple function that takes a parameter as an > argument. So

Re: [julia-users] Julia meetup in Japan: JuliaTokyo

2014-07-07 Thread John Myles White
This is a pretty impressive range of different talks for a single event. Very cool. — John On Jul 6, 2014, at 5:35 PM, Sorami Hisamoto wrote: > Last week's JuliaTokyo meetup in Japan ended in great success! > > Around 40 people attended, 6 main talks and 4 lightning talks. > > Here's the li

Re: [julia-users] Re: Interest in a Julia <-> Stan interface?

2014-07-07 Thread John Myles White
This is really nice to have. I'll definitely be using it for some of my work. Now that Keno's been working on a C++ FFI, we might even be able to avoid using CmdStan. -- John On Jul 7, 2014, at 4:40 PM, Viral Shah wrote: > It is great to have a Stan interface. I personally do not do MCMC stu

Re: [julia-users] PEG Parser

2014-07-06 Thread John Myles White
Thanks for looking into this, Abe. That’s too bad that the CSV parser is much slower than the hand-crafted one. PEG seems like a great tool for tasks where maximum performance isn’t as important. — John On Jul 4, 2014, at 11:09 AM, Abe Schneider wrote: > I got sidetracked by a couple of othe

Re: [julia-users] Re: 100 Julia exercises

2014-07-06 Thread John Myles White
I think anonymous function usage and list comprehensions are separate issues. Anonymous functions are not type-specialized, so they’re basically always slow. I avoid them in any code that’s not one-off. List comprehensions are type-specialized, but the inference for them isn’t super robust, esp

Re: [julia-users] GLM DataFrameRegressionModel gives InexactError()

2014-07-05 Thread John Myles White
Not really sure. Can you try printing out each of the columns to see where the error is? Maybe the problem is with our new code for printing shorthand rather than eps() when p is very small. (That’s just total speculation, though.) — John On Jul 4, 2014, at 1:04 PM, Florian Oswald wrote: > H

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-05 Thread John Myles White
Real is the abstract type that all real numbers derive from. Int is a subtype of Real, for example. Int is a platform-specific alias for either Int32 or Int64, whichever is native to your machine/OS combination. So a type like immutable Foo x::Int end is quite efficient, whereas a typ

Re: [julia-users] GA implementation slow in Julia compared to other languages

2014-07-05 Thread John Myles White
One big problem is the use of “Real”. You almost certainly should be using Float64 instead. — John On Jul 5, 2014, at 11:46 AM, Michael Louwrens wrote: > https://github.com/Mike43110/GA-Spherical-Jl/tree/master > > Here is my basic implementation of a GA in Julia. > > Using similar code in

Re: [julia-users] e == 2.718

2014-07-04 Thread John Myles White
This seems like a temporary bug. My most recent build doesn’t behave like this. Hopefully that means it’s been fixed already. — John On Jul 4, 2014, at 1:29 PM, james.dillon.dela...@gmail.com wrote: > Hi All, > > Is there a reason why the irrational constant e seems to be rounded to three >

Re: [julia-users] Re: ANN: GraphLayout.jl

2014-07-04 Thread John Myles White
This is really cool. I’ve wanted to do this for a while, but never had time. — John On Jul 4, 2014, at 11:39 AM, Iain Dunning wrote: > Oh and I forgot, link to the repository: > https://github.com/IainNZ/GraphLayout.jl > > On Friday, July 4, 2014 2:39:32 PM UTC-4, Iain Dunning wrote: > I wan

Re: [julia-users] Help: K-Means Clustering Algorithm

2014-07-03 Thread John Myles White
Hi Paulo, Rather than implement k-means from scratch, I'd encourage you to use the implementation in the Clustering.jl package. -- John On Jul 3, 2014, at 2:51 PM, Paulo Castro wrote: > Hi guys, > > I'm trying to implement the K-Means Clustering Algorithm, but I'm having some > problems. T

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

2014-07-03 Thread John Myles White
not operations on a ring. > > > On Thu, Jul 3, 2014 at 11:13 PM, John Myles White > wrote: > That is true, but the convention exists nonetheless. Consider, for example, > this branch of the combinatorics literature: > http://en.wikipedia.org/wiki/Square-free_word > --

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

2014-07-03 Thread John Myles White
, a monoid is > enough. It is true that in a ring, "+" is a commutative operator, and "*" no > commutative required, however, a ring is far beyond what needed to do a > string concatenation job. > > > On Thu, Jul 3, 2014 at 10:59 PM, John Myles White > wrot

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

2014-07-03 Thread John Myles White
This is just the standard convention in mathematics. See just about any textbook on abstract algebra for a discussion of the reasons. I think it's safe to say that `+` will never be string concatenation, so it's better to focus energy on other proposals. -- John On Jul 3, 2014, at 7:57 AM, yi

Re: [julia-users] Re: Decreasing range, should it work?

2014-07-03 Thread John Myles White
Sadly, R does not. 1:0 expands to c(1, 0). This is something that has burned a lot of people in my experience. I imagine this is inherited from S. — John On Jul 3, 2014, at 2:05 AM, Tobias Knopp wrote: > Just as a side note (I entirely agree with Stefan), Matlab behaves the same > as Julia:

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

2014-07-02 Thread John Myles White
performance you should use IOBuffer for > repeated string concatenation, example..." > > Also a more instructive error on "hello"+"world" would make since. > > On Wednesday, 2 July 2014 20:48:26 UTC+1, John Myles White wrote: > String concatenation is not comm

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

2014-07-02 Thread John Myles White
String concatenation is not commutative. Addition is generally used for commutative operations. So if you're a mathematician, using addition for string concatentation seems very wrong. -- John On Jul 2, 2014, at 12:45 PM, Ivar Nesje wrote: > Not everybody is convinced there is a good reason.

Re: [julia-users] metaprogramming nested functions

2014-07-02 Thread John Myles White
What would that macro do? Right now, I’d guess that it would just take its input out of quotes. — John On Jul 2, 2014, at 7:41 AM, Bryan A. Knowles wrote: > What of we had a macro version of parse? Eg, > ```julia > function foo() > foo2(x) = println(x) > foo2(1) >

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread John Myles White
of a > string or symbol to result in a call to a nested function? > > On Wednesday, July 2, 2014 1:17:07 AM UTC-4, John Myles White wrote: > eval always happens in the global scope > > — John > > On Jul 1, 2014, at 10:15 PM, Cameron Smith wrote: > >> Can anyon

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread John Myles White
eval always happens in the global scope — John On Jul 1, 2014, at 10:15 PM, Cameron Smith wrote: > Can anyone explain what I am misunderstanding about scope such that > > julia> function foo() >foo2(x) = println(x) >foo2(1); eval(parse("foo2(2)")); >end > foo (

Re: [julia-users] Type instability?

2014-06-30 Thread John Myles White
Hey Spencer, A function is defined to be "type stable" if the return types depend only on the input types. -- John On Jun 30, 2014, at 9:51 AM, Tim Holy wrote: > In your definition I think you meant "type stability," not "type > instability." > To be completely explicit, a function is type

Re: [julia-users] Re: orthogonalize

2014-06-30 Thread John Myles White
Please don’t post code whose copyright status is not 100% certain. If you are even vaguely unsure, you are putting the community in needless danger. As a minimal example, it may be illegal for you to have written the e-mail you just wrote. — John On Jun 30, 2014, at 7:07 AM, 'Stéphane Laurent

Re: [julia-users] Julia simple

2014-06-24 Thread John Myles White
(1) Are you including compilation time in your timings? (2) Your MyCounter type isn't very similar to your other examples, since the i::Integer field has type-uncertainty, whereas the other examples don't. -- John On Jun 24, 2014, at 2:26 PM, JuliaFan wrote: > Why do these three loops perfor

Re: [julia-users] How do I create a function signature for a 2x2 matrix?

2014-06-24 Thread John Myles White
(1) The size of arrays isn’t part of their type signature, so you can’t use multiple dispatch to do this. You’ll end up overwriting the existing Array multiplication function. (2) You’d want to do something like *{S <: Number, T <: Number}(a::Array{S, 2},b::Array{T,1}) to indicate that you’re a

Re: [julia-users] Assign one array to another, and they stick to each other forever ?

2014-06-23 Thread John Myles White
The fast answer is that you want a copy of A, produced using copy(A). Somebody else will probably fill in more details of the why. -- John On Jun 23, 2014, at 9:42 AM, JuliaLover wrote: > Hi, > I have a problem that when I assign value of one array to another they stick > to each other whene

Re: [julia-users] writable root directory?

2014-06-23 Thread John Myles White
142 > drwxr-xr-x 24 root root 4096 jun 11 09:16 . > > shell> whoami > tlycken > `tlycken` is a sudoer, but if I start the REPL as `sudo julia`, `;whoami` > returns `root`, so I don't think that's the problem. > > // T > > On Monday, June 23, 2014 4:07

Re: [julia-users] writable root directory?

2014-06-23 Thread John Myles White
Even with -l? — John On Jun 23, 2014, at 7:14 AM, Davide Lasagna wrote: > The output is my linux root folder: /bin, /boot, > > On Monday, June 23, 2014 3:07:12 PM UTC+1, John Myles White wrote: > This seems hard to know without also seeing the output of `ls -l /` > &g

Re: [julia-users] writable root directory?

2014-06-23 Thread John Myles White
This seems hard to know without also seeing the output of `ls -l /` — John On Jun 23, 2014, at 7:06 AM, Davide Lasagna wrote: > Hi, > > Is this a bug? > > julia> iswritable("/") > true > > (running from repl as normal user) > > Davide

Re: [julia-users] Optim/DualNumbers question (maybe a math question?)

2014-06-22 Thread John Myles White
Maybe. Did someone create a pull request? — John On Jun 22, 2014, at 5:22 PM, Thomas Covert wrote: > did this code ever find its way into DualNumbers.jl? I do anticipate its > going to be quite helpful. > > -Thom > > > > > On Fri, Jun 6, 2014 at 10:32 AM, Thomas Covert wrote: > Haven't

Re: [julia-users] problem with Multinomial Distribution

2014-06-19 Thread John Myles White
Multinomial() doesn't work because there's no reasonable default we could assume. Did you want 3 dimensions? 100 dimensions? Arguably none of the defaults should exist, but we haven't pushed on that yet. Maybe we should start removing all the default distributions. The other errors you noticed

Re: [julia-users] When does inlining occur?

2014-06-18 Thread John Myles White
I think the code that controls inlining is mostly here: https://github.com/JuliaLang/julia/blob/master/base/inference.jl But you'll want to get a response from someone who really understands it. -- John On Jun 18, 2014, at 1:30 PM, Sam L wrote: > Apologies if this is in the manual. I must ha

Re: [julia-users] Re: Benchmarking study: C++ < Fortran < Numba < Julia < Java < Matlab < the rest

2014-06-17 Thread John Myles White
Sounds like we need to rerun these benchmarks after the new GC branch gets updated. -- John On Jun 17, 2014, at 9:31 AM, Stefan Karpinski wrote: > That definitely smells like a GC issue. Python doesn't have this particular > problem since it uses reference counting. > > > On Tue, Jun 17, 2

Re: [julia-users] repeat()'s docstring: maybe some clarification needed?

2014-06-17 Thread John Myles White
repeat(A,inner=[1,1],outer=[1,1,2]) > 2x2x2 Array{Int64,3}: > [:, :, 1] = > 1 2 > 3 4 > > [:, :, 2] = > 1 2 > 3 4 > > > Is there a limit on how a docstring can be? Could we add more examples? > > On Thursday, June 12, 20

<    1   2   3   4   5   6   7   8   9   10   >