Re: [julia-users] Re: home page content

2014-12-10 Thread John Myles White
As always in Julia (and OSS in general), I think the problem is that there's no labor supply to do most "nice" things for the community. Everybody would love to see weekly updates. Not many people have both the time and desire to do the work. -- John On Dec 10, 2014, at 10:41 AM, Tamas Papp

Re: [julia-users] Re: home page content

2014-12-09 Thread John Myles White
+1 for emulating the Rust site -- John On Dec 9, 2014, at 4:46 PM, Joey Huchette wrote: > I think the [Rust website](http://www.rust-lang.org/) is pretty fantastic, in > terms of both design and content. Having the code examples runnable and > editable (via JuliaBox) would be a killer featur

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-08 Thread John Myles White
I've met Malcolm and like him quite a lot. I didn't realize he was writing this specific book. -- John On Dec 8, 2014, at 4:42 PM, Avik Sengupta wrote: > Yes, Malcom runs the London Julia user group. > > On Monday, 8 December 2014 23:25:43 UTC, cdm wrote: > > see also: > > http://datascie

Re: [julia-users] [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
to the > I/O)? > > --Tim > > On Monday, December 08, 2014 09:14:35 AM John Myles White wrote: >> Yes, this is how I've been doing things so far. >> >> -- John >> >> On Dec 8, 2014, at 9:12 AM, Tim Holy wrote: >>> My suspicion is you sh

Re: [julia-users] Re: [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
y skipping M rows at the start). -- John On Dec 8, 2014, at 9:24 AM, Simon Byrne wrote: > > On Monday, 8 December 2014 17:04:10 UTC, John Myles White wrote: > * This package and the current DataFrames code both support specifying the > types of all columns before parsing

Re: [julia-users] [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
(compared to the > I/O)? > > --Tim > > On Monday, December 08, 2014 09:14:35 AM John Myles White wrote: >> Yes, this is how I've been doing things so far. >> >> -- John >> >> On Dec 8, 2014, at 9:12 AM, Tim Holy wrote: >>> My suspicion

Re: [julia-users] [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
than any other alternative, because we have a really fast transpose > now. > > The only disadvantage I see is taking twice as much memory as would be > minimally needed. (This can be fixed once we have row-major arrays.) > > --Tim > > On Monday, December 08, 2014 08:38:06 AM Joh

Re: [julia-users] Re: [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
string to data type > (e.g. strip out currency symbols, fix funny formatting, etc.) > * be able to specify a "end of data" rule, other than end-of-file or number > of lines (e.g. stop on an empty line) > > s > > On Monday, 8 December 2014 05:35:02 UTC, John Myles Wh

Re: [julia-users] [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
the code is > nicely documented. > > On Mon, Dec 8, 2014 at 12:35 AM, John Myles White > wrote: > Over the last month or so, I've been slowly working on a new library that > defines an abstract toolkit for writing CSV parsers. The goal is to provide > an abstract interfac

Re: [julia-users] [WIP] CSVReaders.jl

2014-12-08 Thread John Myles White
t; > On Mon, Dec 8, 2014 at 12:35 AM, John Myles White > wrote: > Over the last month or so, I've been slowly working on a new library that > defines an abstract toolkit for writing CSV parsers. The goal is to provide > an abstract interface that users can implement in order t

[julia-users] [WIP] CSVReaders.jl

2014-12-07 Thread John Myles White
Over the last month or so, I've been slowly working on a new library that defines an abstract toolkit for writing CSV parsers. The goal is to provide an abstract interface that users can implement in order to provide functions for reading data into their preferred data structures from CSV files.

Re: [julia-users] Missing newline in file output?

2014-12-07 Thread John Myles White
What platform are you on? What's the hex dump of the file that gets created? Are perhaps Unix newlines being used, but you're using something like Notepad? -- John On Dec 7, 2014, at 7:37 PM, Greg Plowman wrote: > Hi > > Are newlines missing from the following output to file? Or am I missing

Re: [julia-users] Struggling with generic functions.

2014-12-07 Thread John Myles White
MCMC.jl? > > Regards, > Rob J. Goedman > goed...@mac.com > > > > > >> On Dec 5, 2014, at 5:04 PM, John Myles White >> wrote: >> >> StatsBase is meant to occupy that sort of role, but there's enough >> disagreement that we haven't moved a

Re: [julia-users] Lot of allocations in Array assignement

2014-12-07 Thread John Myles White
It might be useful to put a bit about Julia being lexically scoped into the manual and refer to the Wikipedia article on scope. — John > On Dec 7, 2014, at 9:05 AM, Milan Bouchet-Valat wrote: > > Le dimanche 07 décembre 2014 à 08:31 -0800, remi.ber...@gmail.com a > écrit : >> >> >> Hey guys

Re: [julia-users] Set of Rational{Int} raises InexactError()

2014-12-06 Thread John Myles White
I see this on Julia 0.4-dev, but not on Julia 0.3.3. — John On Dec 6, 2014, at 1:34 PM, remi.ber...@gmail.com wrote: > Hi guys, > > While trying to insert elements of type Rational{Int} into a Set, I ran into > an issue with an InexactError exception. > It happens with some elements. For exam

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-06 Thread John Myles White
I finally updated METADATA to point to the fixed version of BloomFilters. — John On Dec 6, 2014, at 9:23 AM, Stefan Karpinski wrote: > On Sat, Dec 6, 2014 at 12:14 PM, David Koslicki wrote: > > Implementing your own Bloom filter really shouldn't be too hard. > Alternatively, it might not be

Re: [julia-users] Avoiding allocation when writing to arrays of immutables

2014-12-05 Thread John Myles White
I think this might be a problem with Julia 0.3. I see it on Julia 0.3, but not on the development branch for Julia 0.4. — John On Dec 5, 2014, at 6:27 PM, Will Dobbie wrote: > Hi, > > I have a program which copies elements between two arrays of immutables in a > tight loop. The sizes of the

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread John Myles White
he space of possible inputs > (e.g. the hash is represented with fewer bits than the input data is), which > is typically the case, then you can use the Pigeonhole Principle to prove > what John wrote: > > https://en.wikipedia.org/wiki/Pigeonhole_principle > > On Friday, Dece

Re: [julia-users] Struggling with generic functions.

2014-12-05 Thread John Myles White
xedModel, GLM uses LmMod and GlmMod, > Stan and Jags use Stanmodel and Jagsmodel (I could rename them to StanModel > and JagsModel). Is it reasonable to make Model an abstract type? > > Rob > > >> On Dec 2, 2014, at 4:37 PM, John Myles White >> wrote: >&

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread John Myles White
This function is impossible to write in generality since hash functions aren't one-to-one. -- John On Dec 5, 2014, at 4:32 PM, David Koslicki wrote: > Hello, > > Is there a built in function that will undo hash()? > > i.e. I am looking for a function "dehash()" such that > dehash(hash("ACTG

Re: [julia-users] Documentation in the source code

2014-12-05 Thread John Myles White
Documentation is undergoing a shift as 0.4 will be the first release with built-in documentation tools. Check the GitHub issues for details about the upcoming @doc macro. -- John On Dec 5, 2014, at 10:40 AM, Petr Krysl wrote: > Hello, > > Does anyone know how the document functions and typ

Re: [julia-users] How should one think about cost of multiple dispatch?

2014-12-05 Thread John Myles White
I think you'll want an answer from Stefan, Jeff, Keno, Jameson or Viral to get a better review, but my sense is that multiple dispatch is primarily costly at compile time and pays close to zero cost at run-time. Within a function body, if the types of variables don't change, then the choice of w

Re: [julia-users] julia literals for bittypes

2014-12-05 Thread John Myles White
0x03 — John On Dec 5, 2014, at 3:17 AM, Francesco wrote: > When I write: > > julia> x = 3 > > I assign to x a Int64 by default. > > julia> typeof(x) > Int64 > > Let say that 3 should be Uint8, then I write: > julia> x = convert(Uint8, 3) > > Is there a more idiomatic way of doing it? > Ma

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-04 Thread John Myles White
f date > pretty quickly. > > Then again, I figured if I helped review, I could perhaps help push things in > a good direction and help make it as timely as possible. > > -Jacob > > On Thu, Dec 4, 2014 at 8:35 PM, John Myles White > wrote: > I hate to say it, but

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-04 Thread John Myles White
I hate to say it, but Packt's handling of its Julia publications is rather troubling. I received a request to review this book and told them I wasn't free, but the truth is that I would prefer that they not pubilsh this kind of book at all right now. The blurb refers to several things that may n

Re: [julia-users] Re: Why doesn't @sprintf evaluate its format string?

2014-12-02 Thread John Myles White
I think both of the problems you're hitting are the same core problem: @sprintf is a macro, so its behavior is surprising when you think in terms of the run-time behaviors that control function evaluation. In particular, your line continuation problem wouldn't be fixed by having line continuati

Re: [julia-users] Struggling with generic functions.

2014-12-02 Thread John Myles White
There's no clean solution to this. In general, I'd argue that we should stop exporting so many names and encourage people to use qualified names much more often than we do right now. But for important abstractions, we can put them into StatsBase, which all stats packages should be derived from.

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

2014-12-02 Thread John Myles White
http://en.wikipedia.org/wiki/Associative_array -- John On Dec 2, 2014, at 9:50 AM, Ivar Nesje wrote: > It's not the obvious choice to me either, but it is in the docs, and has been > since I read it the first time 1.5 years ago. > > kl. 16:10:34 UTC+1 tirsdag 2. desember 2014 skrev David van

Re: [julia-users] A question about allocation when the data is over 512

2014-12-01 Thread John Myles White
,3],i) > > end > > T=zeros(Int64,513) > > y=0.0 > > for i=1:513 > > @time T[i]=B[2,3][i] > > @time y=T[i]^2+2*T[i]+sqrt(T[i]) > > println(T[i]) > > end > > for i=1:513 > > @time x=B[2,3][i] >

Re: [julia-users] A question about allocation when the data is over 512

2014-12-01 Thread John Myles White
ll!(cell(5,5),Int64[]) > > for i=1:513 > push!(B[2,3],i) > end > > T=zeros(Int64,513) > > for i=1:513 > @time T[i]=B[2,3][i] > println(T[i]) > end > end > > > 在 2014年12月1日星期一UTC-6下午7时24分31秒,John Myles White写道: > Did you run this insid

Re: [julia-users] Interpolation in Julia

2014-12-01 Thread John Myles White
Hi Pileas, Please don’t use the word “must” on this mailing list. It’s somewhat offensive when you behave as if you can order other people around. If something is that important to you, _you_ should be doing the work, not insisting that someone else do it. — John On Dec 1, 2014, at 6:22 PM,

Re: [julia-users] A question about allocation when the data is over 512

2014-12-01 Thread John Myles White
Did you run this inside a function? If not, your results are not going to be useful indicators of how code will perform inside a function. Inside of a function body, I see 0 bytes being allocated. -- John On Dec 1, 2014, at 4:53 PM, Yijing Wu wrote: > Hi all, I found a strange problem about

Re: [julia-users] Re: Article on `@simd`

2014-12-01 Thread John Myles White
This is great. Thanks, Jacob. -- John On Dec 1, 2014, at 8:32 AM, Jacob Quinn wrote: > For all the vectorization fans out there, I stumbled across this LLVM blog > post: http://blog.llvm.org/2014/11/loop-vectorization-diagnostics-and.html > > -Jacob > > On Wed, Oct 29, 2014 at 3:48 AM, Uwe

Re: [julia-users] How to best convert array of Uint8's to long hex string

2014-11-30 Thread John Myles White
This should help a bit, although there's probably some room for improvement by replacing the hex(byte, 2) calls with something that doesn't allocate an intermediate string object: function bytes2hex(bytes::Vector{Uint8}) io = IOBuffer() for byte in bytes write(io,

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

2014-11-30 Thread John Myles White
This isn't documented because it's not meant to be an official part of Julia. At present, Julia's parser is written in Scheme. That command lets you use the Scheme implementation that Julia uses internally. -- John On Nov 30, 2014, at 7:45 PM, Matt Gushee wrote: > On Sun, Nov 30, 2014 at 3:2

Re: [julia-users] Lua Jit out performed Julia for my stock prediction engine use case

2014-11-30 Thread John Myles White
Hi Joseph, Have you read http://julia.readthedocs.org/en/release-0.3/manual/performance-tips/ ? I didn't read your code in detail, but a superficial read suggests that your code has a lot of type-instability, which is a showstopper for Julia. -- John On Nov 30, 2014, at 4:58 PM, Joseph Ellsw

Re: [julia-users] in-place array operations

2014-11-30 Thread John Myles White
Hi Deniz, If you time things in the global scope, you will come to incorrect conclusions about performance. If you want to do performance comparisons, you need to do them inside of a function body to get meaningful results. — John On Nov 30, 2014, at 9:24 AM, Deniz Yuret wrote: > I am tryin

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

2014-11-29 Thread John Myles White
I think the partially modified copy of an immutable problem has been worked on a bit by Keno in the past. — John On Nov 24, 2014, at 3:34 PM, Eric Davies wrote: > On Friday, 21 November 2014 09:44:27 UTC-6, Steven G. Johnson wrote: > > On Thursday, November 20, 2014 5:37:22 PM UTC-5, Eric Da

Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread John Myles White
see people giving themselves fun projects to learn Julia. — John On Nov 29, 2014, at 5:53 PM, Matt Gushee wrote: > Hi, John-- > > On Saturday, November 29, 2014 6:15:36 PM UTC-7, John Myles White wrote: > Isn’t this library already a wrapper for Hiredis: > https://github.com/ma

Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread John Myles White
Isn’t this library already a wrapper for Hiredis: https://github.com/markmo/HiRedis.jl ? — John On Nov 29, 2014, at 5:14 PM, Matt Gushee wrote: > Hi, Avik-- > > On Saturday, November 29, 2014 4:13:18 PM UTC-7, Avik Sengupta wrote: > > Thanks, that looks good. There was another effort at a

Re: [julia-users] Floating-point array types

2014-11-29 Thread John Myles White
Nope. The problem is correctness, not speed. You can’t allow type relationships beween containers because the relationship can only be safe for either writing data or reading data, but never for both. — John On Nov 29, 2014, at 3:55 PM, K Leo wrote: > I remember somewhere it mentioned that t

Re: [julia-users] Floating-point array types

2014-11-29 Thread John Myles White
Look up covariance, contravariance and invariance on Wikipedia. -- John > On Nov 29, 2014, at 12:38 PM, Petr Krysl wrote: > > Newbie-type question: > > This is true: > Float64 <: FloatingPoint > > This is false: > Array{Float64} <: Array{FloatingPoint} > > Why? I'm perhaps not referring he

Re: [julia-users] why extra lines around some latex symbols in emacs?

2014-11-29 Thread John Myles White
Almost blind speculation, but could this be a font issue? — John On Nov 29, 2014, at 10:17 AM, Tracy Wadleigh wrote: > I'm starting to write my code using the same symbols that I would write them > on paper, making use of the latex->unicode support in julia-mode. However, > some symbols seem

Re: [julia-users] Different type columns in Matrix

2014-11-28 Thread John Myles White
There is no matrix in Julia that satisfies the constraint that one column is all integers, another column is all integers and the last is all floats, because all matrices in Julia have a homogeneous type. There are several possible solutions: (1) Use Array{Any} and then enforce your constaints

Re: [julia-users] Multiple lines statement?

2014-11-28 Thread John Myles White
Not to my knowledge, but you can do 2 + 3 This also has the virtue of being a bit easier to read, since you wouldn’t think that you were talking about +3, which is a valid expression in isolation. — John On Nov 28, 2014, at 9:36 PM, Gabriel Mihalache wrote: > Hello! Is there a Julia equival

Re: [julia-users] Running code a second time is actually slower???

2014-11-28 Thread John Myles White
I don’t know. I can’t reproduce your results. Here’s what I see with Julia 0.4: julia> A=rand(5000,5000); julia> B=rand(5000,5000); julia> for i=1:10 @time A*B; end elapsed time: 8.034742507 seconds (226166452 bytes allocated) elapsed time: 7.823044437 seconds (20112 bytes allocated)

Re: [julia-users] Running code a second time is actually slower???

2014-11-28 Thread John Myles White
Is this in the global scope? If not, are you just timing the GC ops required to clean up the results of your first step? — John On Nov 28, 2014, at 3:34 PM, Carlos Baptista wrote: > In Julia, when running code for a second time, it should complete faster > because on the first run Julia is

Re: [julia-users] Re: Is Dict{ASCIIString, Any} not a superset of Dict{ASCIIString, Float64}?

2014-11-26 Thread John Myles White
All types do have Any as a parent. It is clear that many people are confused about what covariance, contravariance and invariance mean in computer science. As such, I very strongly encourage everyone who isn't sure that they understand Julia's type system to read through the wikipedia article o

Re: [julia-users] Memory allocation issue

2014-11-26 Thread John Myles White
Yes, the global scope is scarcely optimized and doesn't provide useful information about performance. -- John On Nov 26, 2014, at 10:33 AM, Colin Lea wrote: > That was in global scope. Should that matter? > > >> On Nov 26, 2014, at 1:30 PM, John Myles White >> wrote: >> >> ? >

Re: [julia-users] Memory allocation issue

2014-11-26 Thread John Myles White
Are these functions? Or are you timing expressions in the global scope? -- John On Nov 26, 2014, at 10:28 AM, Colin Lea wrote: > Thanks to you both! However, there is still another odd issue. > > These two functions should be the same, but take very different amounts of > time/memory. Both

Re: [julia-users] Re: Constant attributes of Composite Type

2014-11-26 Thread John Myles White
Vector{MyType} is a type, not a value. Did you mean Array(MyType, 1)? — John On Nov 26, 2014, at 8:38 AM, Robert Gates wrote: > OK thanks John, I ended up doing a bit differently but it works fine. Sorry > to keep asking, but now I have another problem I can't seem to wrap my head > around:

Re: [julia-users] Re: Constant attributes of Composite Type

2014-11-25 Thread John Myles White
Hi Robert. That's kind of right. Julia doesn't define functions using syntax like you've used, but here's some Julia code that would work: abstract MyAbstractType immutable MyType <: MyAbstractType end constant_attributes(x::MyAbstractType) = 3, 2, 5 x = MyType() constant_attributes(x) Whe

Re: [julia-users] Constant attributes of Composite Type

2014-11-25 Thread John Myles White
Hi Robert, I think the solution to your problem is to stop working with the fields of types and instead focus on functions. A class method then just becomes a constant function that takes in an object of type T. Hope that helps. - John On Nov 25, 2014, at 1:00 PM, Robert Gates wrote: > Hi

Re: [julia-users] Re: Neuro-Dynamic Programming in Julia

2014-11-25 Thread John Myles White
Sounds like a cool project. Are the state space representations that RL-Glue uses easy to work with? — John On Nov 24, 2014, at 10:09 PM, wild...@gmail.com wrote: > Reinforcement learning (RL) isn't covered much in Julia packages. There is a > collection of RL algorithms over MDP in package:

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.

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] 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] 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] 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] 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
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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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
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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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: 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] -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] 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] 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

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