Re: [julia-users] How to print a StatsBase.CoefTable / other table object to latex?

2014-09-20 Thread John Myles White
I’m not aware of any methods to do this, but it shouldn’t be too hard. — John On Sep 19, 2014, at 3:19 AM, Florian Oswald wrote: > just wondering if anyone has a way to print for example a GLM regression > output table to tex? I think I'm looking for something like > [http://cran.r-project.o

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
What would @data([NA]) even mean? — John On Sep 24, 2014, at 7:12 AM, muraveill wrote: > It looks like a bug that @data([NA]) throws an error, should an issue be > filed ?

Re: [julia-users] DataArray Concatenation

2014-09-24 Thread John Myles White
Here’s a supported way to do this operation. — John julia> using DataArrays julia> a=@data([NA,3,5,7,NA,3,7]) 7-element DataArray{Int64,1}: NA 3 5 7 NA 3 7 julia> b = copy(a) 7-element DataArray{Int64,1}: NA 3 5 7 NA 3 7 julia> pop!(b) 7 julia> unshift!(

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
Naivete isn’t a big deal. Just try to be very precise. Any literal in Julia should produce a value V of type T. What’s the type T that @data([NA]) would produce? — John On Sep 24, 2014, at 7:22 AM, muraveill wrote: > To my naive view, a data array with cells containing ony value NA. Well, it

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
hat is added to it, right ? > Then DataArray{Any,1}. Just as @data(["asdf" NA; NA 1.4]). > > On Wednesday, 24 September 2014 16:25:17 UTC+2, John Myles White wrote: > Naivete isn’t a big deal. Just try to be very precise. Any literal in Julia > should produce a value V of

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
eady in the file (as text), like in R one should be > able to decide what string will be converted to NA (by default, "NA"), and > what is converted to NaN (default "NaN"). > > Maybe the OP wanted to use NaN instead. > > On Wednesday, 24 September 2014 16:32

Re: [julia-users] congratulations to Indian dost

2014-09-24 Thread John Myles White
I think this is the flight to Mars that India just finsihed. — John On Sep 24, 2014, at 8:04 AM, Stefan Karpinski wrote: > I have no idea what this is about. Can you clarify? > > On Wed, Sep 24, 2014 at 3:47 AM, K Leo wrote: > for the wonderful achievement with Mangalyaan! > > With a budget

Re: [julia-users] congratulations to Indian dost

2014-09-24 Thread John Myles White
Not that I’m aware of. I’d say the thread is probably off-topic. — John On Sep 24, 2014, at 8:10 AM, Stefan Karpinski wrote: > Is there any evidence that Julia was used to accomplish that? > > On Wed, Sep 24, 2014 at 11:05 AM, John Myles White > wrote: > I think this is the

Re: [julia-users] congratulations to Indian dost

2014-09-24 Thread John Myles White
cameras from saving > images to disk. So we were flying blind. We tried rolling back to an earlier > version, but recent changes to Pkg meant that `pin` wasn't working either. So > we hit the planet." > > "Next time, don't run master." > > --Tim

Re: [julia-users] Re: DataArray Concatenation

2014-09-24 Thread John Myles White
Would be great to submit a pull request implementing the missing funtionality. -- John On Sep 24, 2014, at 6:06 PM, Li Zhang wrote: > i tried methods in base for Dequeues, but it seems some of them are not > implemented for DataArray. > For example: > > a=@data([NA,3,5,7,NA,3,7]) > b=copy(a[

Re: [julia-users] Re: Pretty Printing of Results

2014-09-24 Thread John Myles White
There is no Row column. That's just a printing convention. -- John On Sep 24, 2014, at 7:20 PM, Donald Lacombe wrote: > Jason, > > I appreciate the kind words and advice but the code I'm using is from > StatsBase and there is another version in Mixed Models that looks nice as > well. It's a

Re: [julia-users] Re: DataArray Concatenation

2014-09-25 Thread John Myles White
Thanks, but these days I'd say Simon Kornblith deserves the credit for what's good about DataArrays. -- John On Sep 25, 2014, at 8:11 AM, Li Zhang wrote: > I would very much like to contribute, but i am not sure if i had time, some > projects are keeping me busy. would to look at it when i h

[julia-users] PSA: Choosing between Julia 0.3 vs Julia 0.4

2014-09-25 Thread John Myles White
I just wanted to suggest that almost everyone on this mailing list should be using Julia 0.3, not Julia 0.4. Julia 0.4 changes dramatically from day to day and is probably not safe for most use cases. I'd suggest the following criterion: "are you reading the comment threads for the majority of

Re: [julia-users] Re: PSA: Choosing between Julia 0.3 vs Julia 0.4

2014-09-25 Thread John Myles White
41 UTC-5, John Myles White escribió: > I just wanted to suggest that almost everyone on this mailing list should be > using Julia 0.3, not Julia 0.4. Julia 0.4 changes dramatically from day to > day and is probably not safe for most use cases. > > I'd suggest the followi

Re: [julia-users] Re: PSA: Choosing between Julia 0.3 vs Julia 0.4

2014-09-26 Thread John Myles White
Hans, The tone of your e-mail is a little odd in my opinion. It seems to imply distrust and even possibly anger for a project that would be substantially better served by participating actively in the issue discussions that Tim Holy discussed. I don't think anyone who's following 0.4's progress

Re: [julia-users] Re: PSA: Choosing between Julia 0.3 vs Julia 0.4

2014-09-26 Thread John Myles White
ere announced? Seems a bit > early to worry about that kind of problem a couple of months after the last > significant release of Julia. If 0.4 isn't out by 2020 we can start to worry. > > > On Sep 26, 2014, at 10:12 AM, John Myles White > wrote: > >> Hans, >

Re: [julia-users] Function Argument Passing

2014-09-26 Thread John Myles White
I also tried to write an additional explanation for this recently in case the manual isn't sufficient: http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/ -- John On Sep 26, 2014, at 2:01 PM, Stefan Karpinski wrote: > x is a variable, not a valu

Re: [julia-users] Function Argument Passing

2014-09-27 Thread John Myles White
Matlab’s semantics are called copy-on-write. I suspect you couldn’t implement those semantics without several months of work on a new Array type. — John On Sep 27, 2014, at 1:52 PM, Stephan Buchert wrote: > Thanks for the kind explanations and references that I had missed, seems > clear to m

Re: [julia-users] DataFrames: convert categorical variables to dummy ones?

2014-10-01 Thread John Myles White
Currently, the way to do this is via the GLM package (or at least its strategy for generating design matrices), which handles indicators for you. Lots of improvements are possible, but we need better categorical data support at a lower level before we can work on the improvements: https://githu

[julia-users] Re: parse.(Int64, x)

2016-06-15 Thread John Myles White
I would be careful combining element-wise function application with partial function application. Why not use map instead? On Wednesday, June 15, 2016 at 3:47:05 PM UTC-7, David Anthoff wrote: > > I just tried to use the new dot syntax for vectorising function calls in > order to convert an arra

[julia-users] Re: Is passing a function as an argument discouraged?

2016-06-17 Thread John Myles White
Specialization of higher-order functions should be much improved in Julia 0.5. On Friday, June 17, 2016 at 1:10:24 PM UTC-7, Douglas Bates wrote: > > I am writing a simulation function that loops over simulating a data set > and fitting multiple statistical models to the data. The exact form of

[julia-users] Re: A naive benchmark

2016-07-01 Thread John Myles White
See the top of http://docs.julialang.org/en/release-0.4/manual/performance-tips/ On Friday, July 1, 2016 at 7:16:10 AM UTC-7, baillot maxime wrote: > > Hello everyone, > > I am working on a Julia code which is a brutal copy of a Matlab code and > found out that the Julia code is slower. > >

Re: [julia-users] When Julia v1.0 will be released?

2016-07-07 Thread John Myles White
> > For industry, it probably means something similar. I really hope people in industry won't act on this date, as it is not nearly firm enough to bet a business on. We already have people writing blog posts about how using Julia for their startup turned out to be a mistake; we really don't n

[julia-users] Re: A story on unchecked integer operations

2016-07-13 Thread John Myles White
This seems more like a use case for static analysis that checked operations to me. The problem IIUC isn't about the usage of high-performance code that is unsafe, but rather that the system was nominally tested, but tested in an imperfect way that didn't cover the failure cases. If you were rewr

[julia-users] Re: How to make a variable length tuple with inferred type

2016-08-02 Thread John Myles White
This example should clarify where you're confused: julia> typeof(ntuple(x -> 1, 1)) Tuple{Int64} julia> typeof(ntuple(x -> 1, 2)) Tuple{Int64,Int64} On Tuesday, August 2, 2016 at 2:34:27 PM UTC-5, mmh wrote: > > Care to explain in more depth? If the function is type stable i.e. it > retu

[julia-users] Re: object properties variable

2016-08-15 Thread John Myles White
getfield(foo, :bar) You can iterate over the fieldnames(foo) to print things. I would avoid a potentially wasteful conversion to a dictionary since it doesn't buy you anything in terms of expressive power. --John On Monday, August 15, 2016 at 8:38:04 PM UTC-7, Lewis Lehe wrote: > > Hi I was

[julia-users] Re: Distributions.jl : generating samples from stable distributions

2016-08-19 Thread John Myles White
This is extremely difficult to do right, which is why we don't support it yet. --John On Friday, August 19, 2016 at 9:26:19 AM UTC-7, Mirmu wrote: > > I am looking for generating samples from the stable Levy family with > Distributions.jl, but I cannot find it. > https://en.wikipedia.org/wiki/S

[julia-users] Re: Distributions.jl : generating samples from stable distributions

2016-08-19 Thread John Myles White
Unfortunately the R package is GPL, so we can't use it as a template for a Julia implementation. But RCall will let you call that package from Julia to get draws from those distributions, so you should be able to do what you suggested pretty easily. --John On Friday, August 19, 2016 at 1:44:06

Re: [julia-users] Is the master algorithm on the roadmap?

2016-09-02 Thread John Myles White
> > May I also point out to the My settings button on your top right corner > > My topic email subscriptions > Unsubscribe from this thread, which would've > spared you the message. I'm sorry, but this kind of attitude is totally unacceptable, Kevin. I've tolerated your misuse of the mailing

[julia-users] Re: whole arrays pass by reference while matrix columns by value?

2016-09-07 Thread John Myles White
Everything is pass by sharing. But array indexing by slices creates copies. 0.5 has better support for creating views. --John On Wednesday, September 7, 2016 at 5:00:00 PM UTC-7, Alexandros Fakos wrote: > > Hi, > > a=rand(10,2) > b=rand(10) > sort!(b) modifies b > but sort!(a[:,1]) does not mod

Re: [julia-users] Missing rand(distribution, generator)

2014-10-01 Thread John Myles White
Hi Andrew, It sounds like you've got a lot of interesting ideas for improving Distributions.jl. Please read through the existing codebase when you've got some time and submit pull requests for any functionality you'd like to see changed. In regard to your main question, I don't believe we supp

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

2014-10-02 Thread John Myles White
FWIW, I think going after the "data analyst" community is a losing bet for Julia until a few more years have passed. The R community contains very few developers, so most of the R community couldn't possibly benefit from a young language that needs develepors, not users. It's a bad relationship

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

2014-10-02 Thread John Myles White
> On Thu, Oct 2, 2014 at 11:28 PM, John Myles White > wrote: >> FWIW, I think going after the "data analyst" community is a losing bet for >> Julia until a few more years have passed. The R community contains very few >> developers, so most of the R community coul

Re: [julia-users] Re: problem with a macro generating a type with inner constructor

2014-10-02 Thread John Myles White
me too -- John On Oct 2, 2014, at 8:03 AM, Stefan Karpinski wrote: > I'm in favor of merging that branch and seeing how it goes :-) > > >> On Oct 2, 2014, at 10:58 AM, David Moon wrote: >> >> This would not have happened with my suggested reworking of macro hygiene, I >> think. I am not

Re: [julia-users] Re: copy assignment opeartion on existing and valid destination arrays

2014-10-02 Thread John Myles White
Why not use copy! -- John On Oct 2, 2014, at 3:24 PM, Roy Wang wrote: > > This kind of routine is what I'm talking about... > > # copy assignment for vectors > function copyassignment!(a::Vector,b::Vector) > @assert length(a) == length(b) > for n=1:length(a) > a[n]=b[n]; >

Re: [julia-users] Re: ANN: revamped Images based on Color, FixedPointNumbers

2014-10-03 Thread John Myles White
These are very good points, but I think many of us think that Julia is generally too young to provide guarantees of backwards compatibility until 1.0 lands. Many people have tried very hard to handle these things with deprecation periods, but there are sometimes situations where that's not possi

Re: [julia-users] problem with dataframes.Index when loading JLD dataset

2014-10-06 Thread John Myles White
Index is a data structure like a hash table that maps column names to column indices. It's defined in DataFrames. -- John On Oct 6, 2014, at 8:38 AM, Florian Oswald wrote: > Hi all, > > I'm currently trying to work out why I get an error when trying to load a > dict with several dataframes

Re: [julia-users] names tuples or equivalent

2014-10-06 Thread John Myles White
I think you're underselling (1), which provides the compiler with exactly the kind of information it needs to generate extremely efficient code while also providing names. -- John On Oct 6, 2014, at 8:44 AM, Tamas Papp wrote: > Hi, > > AFAIK tuples are the recommended way to return multiple

Re: [julia-users] Re: Not fun

2014-10-06 Thread John Myles White
Indexing into strings is a either a slow or a dangerous way to live one's life. -- John On Oct 6, 2014, at 9:05 AM, Daniel Høegh wrote: > Would it not make sense to define replace for Int's and ranges like this? > replace(s::String, index::Int, r) = string(s[1:index-1]) * string(r) * > string

Re: [julia-users] Re: Not fun

2014-10-06 Thread John Myles White
It's dangerous because strings aren't arrays of bytes: they're sequences of codepoints. So you can't safely modify a string (which is part of the reason they're immutable) without rewriting the whole string and you can't find a character in a sequence without reading the whole sequence. Another

Re: [julia-users] Not fun

2014-10-06 Thread John Myles White
FWIW, I actually think strings shouldn't define indexing at all: they should only define iteration. -- John On Oct 6, 2014, at 10:10 AM, John Myles White wrote: > It's dangerous because strings aren't arrays of bytes: they're sequences of > codepoints. So you ca

Re: [julia-users] Not fun

2014-10-06 Thread John Myles White
If you know you're only dealing with ASCII, I think you're much better operating on an array of Uint8. -- John On Oct 6, 2014, at 10:35 AM, Stefan Karpinski wrote: > On Mon, Oct 6, 2014 at 1:11 PM, John Myles White > wrote: > FWIW, I actually think strings shouldn'

Re: [julia-users] names tuples or equivalent

2014-10-06 Thread John Myles White
issues, 3 is cumbersome. > > So I am still interested in what the lightweight alternative is. So let > me clarify the question: if I don't want to use composite types, what is > the idiomatic way to do a lightweight named list? Tuples of tuples, or a > Dict? > > Best, > >

Re: [julia-users] Re: returning an #undef

2014-10-09 Thread John Myles White
On julia-dev, I've been asking questions to help me flesh out a formal policy for representing NULL-ness as it occurs in many common situations. I think a full FAQ entry will need to be a whole section of the manual (i.e. the section on Nullable{T}), covering things like missing values in statis

Re: [julia-users] Re: returning an #undef

2014-10-09 Thread John Myles White
014, at 8:44 AM, Tim Holy wrote: > On Thursday, October 09, 2014 08:19:19 AM John Myles White wrote: >> And the use of things like an EmptyTree type in DataStructures.jl means that >> absence is also being represented in a type-unstable way in some packages. >> (https://github.

Re: [julia-users] Re: returning an #undef

2014-10-09 Thread John Myles White
When you add a new node in this representation, do you reshape to a vector, resize the vector, then reshape to a matrix again? -- John On Oct 9, 2014, at 8:55 AM, Stefan Karpinski wrote: > The self-link-is-null-link solution only works when the structure is acyclic > (or more specifically wh

Re: [julia-users] Re: error of std function

2014-10-09 Thread John Myles White
I’d suggest slices for consistency with the function mapslices. — John On Oct 9, 2014, at 6:15 PM, Tim Holy wrote: > Would be great to have it clarified in the manual. > > I think I've brought this up before, and if there was a consensus I don't > recall it. In my opinion, the various usages

Re: [julia-users] Re: error of std function

2014-10-09 Thread John Myles White
Good point. I suppose you do slicing along axes. — John On Oct 9, 2014, at 7:29 PM, Stefan Karpinski wrote: > Well, I might argue that the slices are along the axes rather than them being > the same thing. > > >> On Oct 9, 2014, at 10:05 PM, John Myles White >> w

Re: [julia-users] Re: Adding new column to dataframe

2014-10-12 Thread John Myles White
Use something like this: julia> using DataFrames julia> DataArray(Int, 10) 10-element DataArray{Int64,1}: NA NA NA NA NA NA NA NA NA NA — John On Oct 12, 2014, at 12:05 PM, Westley Hennigh wrote: > Suppose that I want to create a new column of integers, default them all to > "not

Re: [julia-users] Re: Create a dataframe from a dictionary

2014-10-19 Thread John Myles White
There’s a deeper conceptual problem here: what format is the data stored in? There are two coherent formats involving Dict’s that can be converted: Dict{Vector} and Vector{Dict}. Dict{Vector} looks something like this in 0.4 notation: input Dict( :a => [1, 2], :b => [2, 3] ) Th

Re: [julia-users] DimensionalityReudction PCA error

2014-10-19 Thread John Myles White
That package is abandoned. Use MultivariateStats instead. — John On Oct 19, 2014, at 9:36 AM, Stefan Karpinski wrote: > Looks like the package doesn't support Julia past 0.3.0, which is odd because > 0.3.1 is a bug-fix release. Unfortunately, John is not going to be able to > answer questio

[julia-users] Terminating loops early based on user input

2014-10-22 Thread John Myles White
I've started trying to write code that would allow me to take an existing while-loop or for-loop and augment it with the ability for a user to pause the computation and terminate it early. This is really useful in Optim, where you might want to stop optimizing as soon as the solution hits a poin

Re: [julia-users] Re: Learning to Type?

2014-10-22 Thread John Myles White
The clean way to get that effect is via parametric types. -- John On Oct 22, 2014, at 9:08 AM, Cedric St-Jean wrote: > Somewhat OT: since the JIT compiles a different function for each argument > type combination, couldn't it compile a different type object for every field > type combination

Re: [julia-users] Re: Terminating loops early based on user input

2014-10-22 Thread John Myles White
I didn't know that disable_sigint existed. I'll experiment with it today. -- John On Oct 22, 2014, at 9:09 AM, Steven G. Johnson wrote: > Couldn't you use InterruptExceptions here (ctrl-c handlers), disabling sigint > during the loop body so that the exception only occurs when you are ready?

Re: [julia-users] Re: Learning to Type?

2014-10-22 Thread John Myles White
#x27;t know anything about > the type of `.field` and moreover that type can change through the course of > a single function body. For immutables, of course, the value of a field can't > change, nevermind its type, so you could implicitly make the type of any > field part of the

Re: [julia-users] join(("1"," ")) removes the space in the end

2014-10-22 Thread John Myles White
I suspect Daniel may have thought that join adds "joining" spaces by default: julia> length(join(("1"," "))) 2 julia> length(join(("1"," "), " ")) 3 -- John On Oct 22, 2014, at 11:05 AM, Stefan Karpinski wrote: > The space shouldn't be and isn't removed: > > julia> join(("1"," ")) > "1 " >

Re: [julia-users] -1^2

2014-10-22 Thread John Myles White
-1^2 == -(1^2) -- John On Oct 22, 2014, at 2:39 PM, nikolai.mar...@icloud.com wrote: > Could someone please explain to me how julia handles ^ operator. I'm confused > by this: > > > > > > > > > > $ julia >_ >_ _ _(_)_ | A fresh approach to technical comp

Re: [julia-users] Re: 0.4 Roadmap for DataFrames, DataArrays, etc...

2014-10-22 Thread John Myles White
7, 2014 8:00:04 AM UTC+5:30, John Myles White wrote: > I am hoping that the 0.4 release of Julia will coincide with a major cleanup > of the Data* world. I wrote up a very high level overview of my goals here: > https://gist.github.com/johnmyleswhite/ad5305ecaa9de01e317e > > There’

Re: [julia-users] Book: Seven More Languages in Seven Weeks

2014-10-23 Thread John Myles White
This is a good idea. Please submit a pull request that adds link to that section. -- John On Oct 23, 2014, at 6:05 AM, Ivo Balbaert wrote: > Hi, > > Within some weeks the Pragmatic Programmers will publish the book: "Seven > More Languages in Seven Weeks" > by Bruce Tate, Fred Daoud, Jack

Re: [julia-users] Re: Benchmarks for Julia 0.3x ???

2014-10-23 Thread John Myles White
FWIW, I think some of us are pretty burnt out with benchmarks and the politics involved with their "validity". -- John > On Oct 23, 2014, at 12:57 PM, Tony Kelman wrote: > > There's an open pull request on the website repository - > https://github.com/JuliaLang/julialang.github.com/pull/132

Re: [julia-users] Re: Accessing values outside functions vs. passing them to the function

2014-10-24 Thread John Myles White
Using globals is also potentially bad style since it means that your functions aren't interpretable without additional context. -- John > On Oct 24, 2014, at 10:36 AM, Johan Sigfrids wrote: > > Operating on global variables in Julia is generally slower so you should > definitely pass the arr

Re: [julia-users] Questions regarding Julia (pycall and Julia types).

2014-10-25 Thread John Myles White
I’m very conservative about recommeinding Julia these days. I’d say that, as a beginner to programming, you may find Julia to be a difficult ride. I think you’ll find Julia quite easy to learn after you’ve already mastered Python. — John On Oct 24, 2014, at 9:41 AM, rtemp...@gmail.com wrote:

Re: [julia-users] Naive question about data frames -- What are they used for?

2014-10-25 Thread John Myles White
Have you ever used a database? A DataFrame is just a database that’s stored in memory. — John On Oct 25, 2014, at 5:37 AM, Daniel Carrera wrote: > Hello, > > This is a fairly naive question. I have observed for the last two years that > many people really like data frames. R users obviously

Re: [julia-users] Naive question about data frames -- What are they used for?

2014-10-25 Thread John Myles White
lve the same > types of problems as something like MySQL. I thought data frames were used in > more science-related contexts. > > Cheers, > Daniel. > > > On 25 October 2014 17:27, John Myles White wrote: > Have you ever used a database? A DataFrame is just a database t

Re: [julia-users] How to get a Julia code review

2014-10-25 Thread John Myles White
I think you can sometimes get code review by posting a Gist to the list. This happens a lot if you have a particular small section of code whose performance confuses. If you write library code you want to share with others and people are excited about the idea behind the library, you'll basical

Re: [julia-users] Re: Naive question about data frames -- What are they used for?

2014-10-25 Thread John Myles White
FWIW, I don’t think overhead is the right concept here: DataFrames and Arrays are almost almost totally dissimilar data structures. (DataFrames are arguably much more like Dict’s than Array’s.) If Arrays are appropriate, use those. DataFrames are designed for use in cases where Arrays are clear

Re: [julia-users] Learning to Type?

2014-10-26 Thread John Myles White
I’ve often wished we had a Julia reading list that provided useful references for people wanting to learn about the big ideas involved in Julia. For understanding mutable vs. immutable types, I found this very helpful: * http://cr.openjdk.java.net/~jrose/values/values-0.html It takes several re

Re: [julia-users] Learning to Type?

2014-10-26 Thread John Myles White
Funny, I had thought you were the person who sent that post to the mailing list long ago. — John On Oct 26, 2014, at 8:29 AM, Stefan Karpinski wrote: > On Sun, Oct 26, 2014 at 11:08 AM, John Myles White > wrote: > For understanding mutable vs. immutable types, I found this ver

Re: [julia-users] Confusion about dimensions

2014-10-26 Thread John Myles White
size(m, 1) — counts _over_ rows sum(m, 1) — sums _over_ rows So no mixup, just a different perspective than you’re taking right now. My best advice: discard everything you know about R while using Julia. If you’ve used Matlab, that will be much more useful as an analogy for how Julia works.

Re: [julia-users] Performance issue? Next permutation algorithm faster in Matlab.

2014-10-27 Thread John Myles White
I think this was being done as a learning exercise, not an attempt to generate production code. That said, reading Julia's Base code is a great way to learn Julia. -- John On Oct 27, 2014, at 9:27 AM, Stefan Karpinski wrote: > Speaking of which, what's wrong with the standard library functio

Re: [julia-users] Re: ERROR: no method getindex(Array{Any,1},ASCIIString)

2014-10-27 Thread John Myles White
What Iain meant is that Julia Studio (except on Windows) doesn't support a modern version of Julia. -- John On Oct 27, 2014, at 9:26 PM, Uwe Fechner wrote: > I still don't understand your sentence. Perhaps you mean: > "The read-evaluate-print loop (REPL) doesn't even come close to recent >

Re: [julia-users] Redirect stdout to /dev/null or similar

2014-10-28 Thread John Myles White
Can you give an example? The default DataFrames printing should only render a few rows, although it will render all columns by default. -- John On Oct 28, 2014, at 1:08 PM, Frank Davidson wrote: > Hi, > > Julia newbie here... How would I stop output of a command to the REPL > display? Can I

Re: [julia-users] Questions regarding Julia (pycall and Julia types).

2014-10-28 Thread John Myles White
x of the entire scipy system if I will be switching to > julia later. > > The lack of tutorials for data science in julia is the main factor I'm > pondering now. > > On Saturday, October 25, 2014 11:13:43 AM UTC-4, John Myles White wrote: > I’m very conservative abou

Re: [julia-users] Convert DataArray to DataFrame

2014-10-29 Thread John Myles White
This is actually broken right now. One way to do this is found in the pull request here: https://github.com/JuliaStats/DataFrames.jl/pull/632/files But we should probably follow Simon's suggestion in that thread and change the definition of convert to apply to AbstractMatrix. -- John On Oct

Re: [julia-users] List comprehension returning 'Any' type when used inside function

2014-10-29 Thread John Myles White
My personal style rule: never use a list comprehension that's untyped. This will solve your problems: A = ASCIIString[fun(i) for i = 1:3]] -- John On Oct 29, 2014, at 10:45 AM, Zenna Tavares wrote: > As shown in the following example, I am getting differently typed arrays > depending on whe

Re: [julia-users] Re: List comprehension returning 'Any' type when used inside function

2014-10-29 Thread John Myles White
I'm pretty sure this sort of thing always works since type declarations on variables behave like convert calls: julia> function foo() a::Int64 = 0x01 return a end foo (generic function with 1 method) julia> foo() 1 -- John On Oct 29, 2014, at 10:50 AM, Zenna Tavares wrot

Re: [julia-users] Re: List comprehension returning 'Any' type when used inside function

2014-10-29 Thread John Myles White
ing} = [fun(i) for i = 1:3] > convert(Array{ASCIIString},A) > end > > I thought maybe it was a weird REPL thing, but it's not. > > On Wednesday, October 29, 2014 1:52:01 PM UTC-4, John Myles White wrote: > I'm pretty sure this sort of thing always works since type decla

Re: [julia-users] Re: List comprehension returning 'Any' type when used inside function

2014-10-29 Thread John Myles White
gt; give different results > > function makestring(fun) > A::Array{ASCIIString} = [fun(i) for i = 1:3] > end > > > function makestring(fun) > A::Array{ASCIIString} = [fun(i) for i = 1:3] > convert(Array{ASCIIString},A) > end > > I thought maybe it was a weird

Re: [julia-users] STREAM port in Julia

2014-11-01 Thread John Myles White
This is already possible. You just need to apply const: const size = 5_000_000 — John On Nov 1, 2014, at 10:22 AM, Kapil wrote: > Can we have a local variable name same as a global variable name and refer to > them using something like scope resolution operator like in C. > > I am thinking

Re: [julia-users] Julia looking for old gfortran after upgrade

2014-11-01 Thread John Myles White
Maybe you needed a deps clean? — John On Nov 1, 2014, at 5:06 PM, Sean Garborg wrote: > I upgraded OSX from Mavericks to Yosemite and ran 'brew upgrade' which > brought a new version of gcc and friends. I'm not sure which action was to > blame, but Julia kept looking for > '/usr/local/lib/g

Re: [julia-users] Trigonometric functions at infinity

2014-11-04 Thread John Myles White
My personal preference is for code to never raise warnings if you might ever use it in a system that has more than 10 lines of code. So I'm personally a believer in either returning NaN without a warning (which seems a little risky) or maintaining the current behavior, which seems wisest to me.

Re: [julia-users] How Julia do math operations

2014-11-04 Thread John Myles White
Hi Neil, Julie does math the same way that all computers do math. You're probably coming from another language where a lot of effort is invested into pretending that computers offer a closer approximation to abstract mathematics than they actually do. Those systems have been lying to you. Put

Re: [julia-users] Full blown GUI programming with Julia+JS

2014-11-05 Thread John Myles White
This is really awesome. I'm really consistently amazed at how cool the projects that Shashi works on are. -- John On Nov 5, 2014, at 9:16 AM, Viral Shah wrote: > See @shashi's https://github.com/dcjones/Compose.jl/pull/89 > > Teaser: > > This back-end lets us draw Compose and Gadfly graphi

Re: [julia-users] Re: what's the best way to do R table() in julia? (why does StatsBase.count(x,k) need k?)

2014-11-09 Thread John Myles White
FWIW, I think the best way to move forward with NamedArrays is to replace NamedArrays with a parametric type Named{T} that wraps around other AbstractArray types. That gives you both named Array and named DataArray objects for the same cost. -- John On Nov 9, 2014, at 5:49 PM, Tim Holy wrote

Re: [julia-users] no zero() for DateTime?

2014-11-10 Thread John Myles White
Yes, the use of zero is an anachronism from a design in which zero was used to have a default value for arbitrary types. -- John On Nov 10, 2014, at 8:22 AM, Ivar Nesje wrote: > Basically this is an issue with DataFrames using a function in base for a > different purpose than its documented

Re: [julia-users] Array/tuple issues

2014-11-12 Thread John Myles White
Unfinished FAQ about dots: https://github.com/JuliaLang/julia/pull/8065#issuecomment-52747406 -- John On Nov 12, 2014, at 9:14 AM, Robert DJ wrote: > Thanks a lot - this really cleared some thing in my head! > > Using the dims argument as "dims..." had not occurred to me. Can you explain >

Re: [julia-users] try/catch by exception type

2014-11-17 Thread John Myles White
I don't believe this is possible in Julia right now. Which is ok in this case, since working with a KeyError is a very un-Julian way to check for key existence. You'll want to use haskey instead. -- John On Nov 17, 2014, at 2:49 PM, Luthaf wrote: > Hello ! > > Is there a way to catch an exc

Re: [julia-users] try/catch by exception type

2014-11-17 Thread John Myles White
Yes, we are civilized after all. -- John On Nov 17, 2014, at 2:53 PM, Luthaf wrote: > Ok, thank you ! > > So the way to go is "better ask for permission than for forgiveness" ! > > John Myles White a écrit : >> >> I don't believe this is possible

Re: [julia-users] Array with Substrings not subtype of Array with Strings?

2014-11-19 Thread John Myles White
Hi Frederick, You'll want to read a bit more about what invariance means in computer science: http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science) In particular, Array{S} <: Array{T} is false for all types S and T with S != T in Julia. This isn't an inconsistency -- it'

Re: [julia-users] ijulia clickable help directs to 404

2014-11-19 Thread John Myles White
I think the most robust way to fix this would be to embed the SHA1 of the code source being used. -- John On Nov 19, 2014, at 6:04 PM, Peter Brady wrote: > I'm using julia v0.3.2 via the fedora package manager and am running into > problems with the very cool source code links when using `me

Re: [julia-users] Significant rounding error in Julia: N * (1/1) == N + 1

2014-11-19 Thread John Myles White
This does not happen on my machine. Can you give more details about your setup? To be clear, 1/1 is a floating point number, which means that the whole idea of doing == is dangerous. A safer comparison is the distance between the values. I get the following: julia> abs(44100.0 - 44099.0 * (1/1)

Re: [julia-users] Significant rounding error in Julia: N * (1/1) == N + 1

2014-11-19 Thread John Myles White
while merely hoping they will work out seems like a very risky heuristic. -- John On Nov 20, 2014, at 12:08 AM, Steven G. Johnson wrote: > > > On Wednesday, November 19, 2014 6:04:54 PM UTC-5, John Myles White wrote: > This does not happen on my machine. Can you give more details ab

Re: [julia-users] keys of nested dictionary?

2014-11-20 Thread John Myles White
my_dict.keys isn't giving you the keys of your dictionary. It's giving you the internal structure of a data structure. Try keys(my_dict). As we sometimes say, Julia isn't a dot-oriented language. Dots only give you access to the fields of structs. -- John On Nov 20, 2014, at 10:35 AM, Kristi

Re: [julia-users] Passing by reference

2014-11-20 Thread John Myles White
input[:] -- John On Nov 20, 2014, at 12:51 PM, mfjon...@hotmail.com wrote: > Dear list, > > My caller function sends several input arguments (i.e. vectors and matrices) > to a function, but not all changes are visible once the function completes. > It took a while to figure out the problem,

Re: [julia-users] Passing by reference

2014-11-20 Thread John Myles White
I wrote about it once to try to help people who find this confusing: http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/ -- John On Nov 20, 2014, at 5:48 PM, Peter Simon wrote: > I've seen this technique suggested several times in the news group,

Re: [julia-users] Passing by reference

2014-11-20 Thread John Myles White
> > --Peter > > On Thursday, November 20, 2014 9:51:02 AM UTC-8, John Myles White wrote: > I wrote about it once to try to help people who find this confusing: > http://www.johnmyleswhite.com/notebook/2014/09/06/values-vs-bindings-the-map-is-not-the-territory/ > > -- John

Re: [julia-users] InPlace function writting into a subarray

2014-11-21 Thread John Myles White
X[:, 3] doesn't produce a SubArray. It produces a brand new array. -- John On Nov 21, 2014, at 10:30 AM, Ján Dolinský wrote: > Hello, > > I wanted an inplace function to write a result into a subarray as follows: > > X = zeros(10,5) > fill!(X[:,3], 0.1) > > The X[:,3] is however not updated.

Re: [julia-users] Typeclass implementation

2014-11-21 Thread John Myles White
This sounds a bit like a mix of two problems: (1) A lack of interfaces: - a) A lack of formal interfaces, which will hopefully be addressed by something like Traits.jl at some point. (https://github.com/JuliaLang/julia/issues/6975) - b) A lack of documentation for informal interfaces, such a

Re: [julia-users] Efficiency of julia compiler on a simple program (from a julia newbie)

2014-11-22 Thread John Myles White
Yes, this is one of the most surprising things about Julia. Perhaps the time has come to put a warning about this right at the start of a REPL session. — John On Nov 22, 2014, at 4:50 AM, Viral Shah wrote: > Try putting everything in a function. > > http://julia.readthedocs.org/en/latest/man

Re: [julia-users] Solving a Bellman equation with Julia through function iteration: what I do wrong?

2014-11-23 Thread John Myles White
Did you try running any of the individual lines? There’s a very obvious bug where you refer to kgrid(i). — John On Nov 23, 2014, at 3:39 PM, Pileas wrote: > OK, I have the following model in which I try to solve the Bellman equation > through function iteration. However somewhere I am wrong.

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