Re: [julia-users] How to determine which functions to overload, or, who is at the bottom of the function chain?

2016-10-17 Thread colintbowers
I hadn't thought of using the debugger to step through and see where a function call ends up. That is a great idea. Thanks, Colin On Tuesday, 18 October 2016 02:01:43 UTC+11, Patrick Belliveau wrote: > > I would add the general comment that in julia 0.5 you can use Gallium to > step into a

[julia-users] How to determine which functions to overload, or, who is at the bottom of the function chain?

2016-10-15 Thread colintbowers
Hi all, Twice now I've thought I had overloaded the appropriate functions for a new type, only to observe apparent inconsistencies in the way the new type behaves. Of course, there were no inconsistencies. Instead, the observed behaviour stemmed from overloading a function that is not at the

Re: [julia-users] different Eigenvalue results Julia vs Matlab

2016-09-10 Thread colintbowers
This question pops up on StackOverflow fairly frequently, although usually in relation to Mathematica, which uses a totally different normalisation to most other languages. I was surprised by your question actually, since I thought Matlab and Julia used *exactly* the same normalisation, but

Re: [julia-users] Parsing ASCIIString to Bool

2016-06-30 Thread colintbowers
Okay, cool. Thanks for responding. Cheers, Colin On Thursday, 30 June 2016 16:00:20 UTC+10, Jacob Quinn wrote: > > This was just fixed on master: > https://github.com/JuliaLang/julia/pull/17078 > > On Thu, Jun 30, 2016 at 1:43 AM, > wrote: > >> Hi all, >> >> I was just

[julia-users] Re: Parsing ASCIIString to Bool

2016-06-29 Thread colintbowers
ps I'm on v0.4. Maybe this doesn't happen in v0.5... ? On Thursday, 30 June 2016 15:43:40 UTC+10, colint...@gmail.com wrote: > > Hi all, > > I was just wondering if the following is expected behaviour: > > julia> parse("true") > true > > julia> typeof(parse("true")) > Bool > > julia> parse(Bool,

[julia-users] Parsing ASCIIString to Bool

2016-06-29 Thread colintbowers
Hi all, I was just wondering if the following is expected behaviour: julia> parse("true") true julia> typeof(parse("true")) Bool julia> parse(Bool, "true") ERROR: InexactError() in convert at ./bool.jl:6 in tryparse_internal at parse.jl:84 in tryparse_internal at parse.jl:136 in parse at

Re: [julia-users] I can enter the same keyword argument twice, and the second over-rules the first.

2016-06-14 Thread colintbowers
I see your point, but the counter argument is that it makes it fairly easy to introduce a bug into your code, ie typing out a couple of keyword arguments, mind still on the previous entry, and you accidentally type in the same name twice - I know it can happen, because it is exactly how I

Re: [julia-users] I can enter the same keyword argument twice, and the second over-rules the first.

2016-06-14 Thread colintbowers
Thanks, I think I'll file an issue later today. It may be deliberate behaviour, but maybe not... On Sunday, 12 June 2016 19:05:39 UTC+10, Milan Bouchet-Valat wrote: > > Le samedi 11 juin 2016 à 19:46 -0700, colint...@gmail.com a > écrit : > > I can enter the same keyword argument twice, and

[julia-users] I can enter the same keyword argument twice, and the second over-rules the first.

2016-06-11 Thread colintbowers
I can enter the same keyword argument twice, and the second entry is the one that gets used. A short example follows: f(x::Int ; kw::Int=0) = x * kw f(2) f(2, kw=3) #evaluates to 6 f(2, kw=3, kw=4) #evaluates to 8 Is this desired behaviour or is it a bug? Based on a quick scan, I can't quite

[julia-users] Re: How to build a range of -Inf to Inf

2016-06-03 Thread colintbowers
Very true. For boring reasons, I actually prefer it that way for my own work (I want errors if the types don't exactly match as it means other parts of my code are doing something unexpected - I like cheap redundant error checks). But I agree that for general use it should work as you suggest.

[julia-users] Re: How to build a range of -Inf to Inf

2016-06-02 Thread colintbowers
For those interested, I just hacked together the following implementation of what I was after. I've extended in, filter, and replace to the new type: #Type BasicInterval #My own extremely simple interval type that denotes all elements between start and stop immutable BasicInterval{T}

Re: [julia-users] How to build a range of -Inf to Inf

2016-06-02 Thread colintbowers
Thanks for responding. I've posted a response to both you and Tom in response to Tom's post. In short, it sounds like my definition of Range is poor/wrong and I should just implement my own custom type. Cheers and thanks, Colin On Friday, 3 June 2016 12:54:57 UTC+10, Yichao Yu wrote: > > On

Re: [julia-users] How to build a range of -Inf to Inf

2016-06-02 Thread colintbowers
Looking at your and Yichao's responses, I think my definition of Range is poor/wrong. I just wanted a type that denoted every element of the same type between the start and stop point (inclusive). So e.g. an input of (0.0, 1.0) would denote the set of every Float64 between 0.0 and 1.0, and (4,

[julia-users] How to build a range of -Inf to Inf

2016-06-02 Thread colintbowers
Hi all, Is there any way to build a range that corresponds to the mathematical set (-Inf, Inf)? I had a look at the source code in range.jl (which is very readable!) and it doesn't appear that any of the Range types is suitable to this task, e.g. StepRange doesn't take Float64 inputs,

[julia-users] Re: Using push! with vector-elements of a matrix ?

2016-02-26 Thread colintbowers
Almost exactly this question just popped up on StackOverflow the other day. Follow link for an explanation about what is happening under the hood: http://stackoverflow.com/questions/35623326/assignment-to-multidimensional-array-in-julia On Friday, 26 February 2016 13:50:32 UTC+11, Ilya Orson

[julia-users] Re: Anonymous functions now faster? Need for functors?

2016-02-01 Thread colintbowers
Great news! I've been keenly looking forward to this one. A big thanks to all the devs involved. I've updated a few StackOverflow questions on this topic with links to the issues page. Cheers, Colin On Sunday, 31 January 2016 23:35:39 UTC+11, Ben Ward wrote: > > Hi, > > I just saw this

[julia-users] Re: Printing objective function values and parameter values as NLopt optimisation routine converges

2016-01-06 Thread colintbowers
Actually, I spoke to soon. While your suggestion is very effective for convergence routines that call the objective function once at each step, it can lead to some pretty confusing results if the objective function is called multiple times at each step. For example, some of the routines for

[julia-users] Printing objective function values and parameter values as NLopt optimisation routine converges

2016-01-05 Thread colintbowers
Hi all, Is it possible to get the NLopt package to print the objective function values and parameter values while an NLopt optimisation routine converges? My understanding is that the NLopt package is essentially a wrapper on the NLopt C API, so maybe this is not possible, but I thought I'd

[julia-users] Re: Printing objective function values and parameter values as NLopt optimisation routine converges

2016-01-05 Thread colintbowers
Erm... yes, I suppose I could have done that if I had any brains at all :-) Thanks for being nice about it :-) -Colin On Wednesday, 6 January 2016 11:31:51 UTC+11, Kristoffer Carlsson wrote: > > Can't you just print stuff in your julia objective function that you pass > to NLopt?

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread colintbowers
Hi Andrew, The issue is being tracked here: https://github.com/JuliaLang/julia/issues/6984, and the current milestone is v0.5. My understanding is that the syntax being proposed is not the same as the one you used above, but that triangular dispatch will nonetheless be possible as a special

[julia-users] Re: Deprecation warnings using julia on Atom

2015-11-01 Thread colintbowers
The problem magically fixed itself today. I was running a Pkg.checkout() on "Distributions" to move to the master branch there to get rid of deprecation warnings generated by qq.jl. In the process, I ran a Pkg.update(), and re-compiled other pre-compiled packages. Problem gone. At this stage

Re: [julia-users] Deprecation warnings using julia on Atom

2015-10-28 Thread colintbowers
Here's the latest commit on my local Atom.jl: colin@colin:~/.julia/v0.4/Atom$ git log commit e2d2bd6d4be24acfe72f8e3d91291b424af70512 Merge: 2d78ca1 72a050a Author: Mike J Innes Date: Sat Sep 19 10:13:45 2015 +0100 Merge pull request #9 from ssfrr/depwarn-0_4

Re: [julia-users] Deprecation warnings using julia on Atom

2015-10-28 Thread colintbowers
One other potential useful piece of information. I've tried installing packages ink and julia-client both using the Atom package manager, and by following the instructions here: https://github.com/JunoLab/atom-julia-client/tree/master/docs#developer-install but it doesn't make a difference.

[julia-users] Re: Deprecation warnings using julia on Atom

2015-10-27 Thread colintbowers
I suppose I could clone the master branch. Is that a bad idea? On Wednesday, 28 October 2015 11:30:43 UTC+11, colint...@gmail.com wrote: > > Thanks for responding. > > Pkg.checkout("Atom") gives me the error: > > ERROR: Atom is not a git repo > in checkout at pkg/entry.jl:203 > in anonymous at

[julia-users] Re: Deprecation warnings using julia on Atom

2015-10-27 Thread colintbowers
Thanks for responding. Pkg.checkout("Atom") gives me the error: ERROR: Atom is not a git repo in checkout at pkg/entry.jl:203 in anonymous at pkg/dir.jl:31 in cd at file.jl:22 in cd at pkg/dir.jl:31 in checkout at pkg.jl:37 (I originally did try using Pkg.checkout as per the instructions,

[julia-users] Deprecation warnings using julia on Atom

2015-10-27 Thread colintbowers
Hi all, I'm using Julia v0.4 with the Atom package, on Atom 1.0 with the packages ink, julia-client, and language-julia (and I'm really enjoying this as an IDE solution). I can toggle the Julia console in Atom, and enter code directly into it without any errors or warnings. However, as soon

Re: [julia-users] Deprecation warnings using julia on Atom

2015-10-27 Thread colintbowers
Done. Precompilation occurred at the REPL, and I didn't have to do it within Atom. Verified packages are all on Master. Unfortunately, I'm still getting all of the original deprecation warnings when evaluating from the editor in Atom. I'm happy to pursue this further, but am equally happy to

[julia-users] Re: Creating a show method for type alias

2015-08-11 Thread colintbowers
Does the following work? function Base.show(io::IO, ::Type{CIGARString}) #your code here end On Tuesday, 11 August 2015 03:07:15 UTC+10, Ben Ward wrote: Hi, I have implemented a basic immutable type with a type alias for a vector of said type: immutable CIGAR OP::Operation

Re: [julia-users] Garbage collection outside the global scope

2015-08-06 Thread colintbowers
On Thursday, 6 August 2015 22:34:26 UTC+10, Andrew B. Martin wrote: Thanks for the comment, Colin. Instead, the RAM usage counter ramped up to the upper limit I had set using a conditional if statement, and then when it hit that ... I'm curious; can you give a code sample of the

Re: [julia-users] Garbage collection outside the global scope

2015-08-05 Thread colintbowers
Hi Andrew, No answer here, just some behaviour that might be of interest to you (everything I write pertains to v0.3. I've no experience with v0.4 and I understand some fairly large changes have occurred in garbage collection). I faced the problem in my work of reading in lots of data from the

[julia-users] Re: Time series current state of the art

2015-07-23 Thread colintbowers
in v0.4, just check my github page: https://github.com/colintbowers Be aware though, most of these are still actively being developed, and there are a few bugs here and there that I'm aware of but haven't fixed or documented yet. I'll sort them out before adding them to the official package list

[julia-users] Re: Loop comprehensions unable to do type inferences (in local scope)

2015-07-02 Thread colintbowers
I didn't know you could do that. That is a very satisfactory solution, thank you. -Colin On Friday, 3 July 2015 00:39:53 UTC+10, Tom Breloff wrote: I can't comment on exactly why the return argument isn't inferred, but I'm pretty sure that's a feature that is still actively being worked on

[julia-users] Loop comprehensions unable to do type inferences (in local scope)

2015-07-01 Thread colintbowers
Hi all, I'm on Julia v0.3.10 on Ubuntu 14.04 LTS. The following loop comprehension correctly infers the type: function g() x = randn(3, 2) inds = rand(1:3, 3, 4) y = [ mean(sub(x, 1:size(x, 1), k)[sub(inds, 1:size(inds, 1), j)]) for k = 1:size(x, 2), j = 1:size(inds, 2) ]

[julia-users] Re: How to insert new row/ egsisitng vector into array ?

2015-06-28 Thread colintbowers
vector. The source is here (https://github.com/colintbowers/SortedStructures.jl), although I'm still tinkering with it at the moment so it should in no way be treated as stable. The only downside is if you are performing lots of matrix operations, then each time you'll need to convert from

[julia-users] Converting a string to a custom type results in a function that is not type stable

2015-06-24 Thread colintbowers
Hi all, I've got an issue I don't really like in one of my modules, and I was wondering the best thing (if anything) to do about it. The module if for dependent bootstraps, but the problem is more of a project design issue. I have a type for each bootstrap method, e.g. `StationaryBootstrap`,

[julia-users] Re: When are function arguments going to be inlined?

2015-06-23 Thread colintbowers
Yes, this proves to be an issue for me sometimes too. I asked a StackOverflow question on this topic a few months ago and got a very interesting response, as well as some interesting links. See here:

[julia-users] Re: Julia computing problem in a loop

2015-06-17 Thread colintbowers
Hi Jim, A couple of points: 1) Maybe I'm missing something, but you appear to be calculating the same inverse twice on every iteration of your loop. That is, inv(Om_e[(j-1)*nvar+1:j*nvar,:]) gets called twice. 2) As Mauro points out, memory allocation is currently triggered when slicing into

[julia-users] Re: Index into an array with an IntSet

2015-06-15 Thread colintbowers
Ah, I understand. Thanks for responding and pointing me to the appropriate pull request. So currently if we want to index with an IntSet, the best thing to do is probably just convert the IntSet to a Vector{Int} using something like: [ i for i in myIntSet ] yes? Cheers, Colin On Monday,

[julia-users] Index into an array with an IntSet

2015-06-14 Thread colintbowers
Hi all, In v0.3.x, I can't seem to do the following (I get a no method exists error): randn(10)[IntSet(2, 3, 4)] Is this possible in v0.4? If not, is there a reason why I shouldn't want the ability to do this? Cheers, Colin

[julia-users] Re: Why Julia is not faster than Matlab ?

2015-06-13 Thread colintbowers
Given the wording of your question, it seems highly likely that you are user4905479 from StackOverflow (see http://stackoverflow.com/questions/30728371/why-julia-is-not-faster-than-matlab). As you were advised there, you will need to post your code if you want to progress your understanding.

Re: [julia-users] Preferred way to structure a module

2015-05-18 Thread colintbowers
Just wanted to say thanks for responding, and if you do encounter that thread again in your travels, I'd be very grateful if you could post a link (but please don't waste time searching for it on my behalf). Cheers, Colin On Monday, 18 May 2015 18:22:06 UTC+10, Mauro wrote: For my own

[julia-users] Preferred way to structure a module

2015-05-18 Thread colintbowers
Hi all, I'm just writing with a broad question about how to structure a module in Julia. For my own modules, I've tended to follow the example of the Distributions and Distances package, where each distribution (or distance) is its own type, and then there is a small number of generic

[julia-users] New packages in time-series statistics

2015-04-23 Thread colintbowers
Hi all, I've written three new packages for Julia, and am interested in getting some feedback/comments from the community as well as determining whether there is sufficient interest to register them officially. The packages are: [DependentBootstrap](https://github.com/colintbowers

[julia-users] Re: New packages in time-series statistics

2015-04-23 Thread colintbowers
interested in getting some feedback/comments from the community as well as determining whether there is sufficient interest to register them officially. The packages are: [DependentBootstrap]( https://github.com/colintbowers/DependentBootstrap.jl) [KernelStat](https://github.com/colintbowers

[julia-users] Re: Holt-Winters D-E Smoothing in Julia

2015-04-10 Thread colintbowers
Great! If you decide to open source it when done then please feel free to post a link into this thread or start a new thread on julia-stats as I for one would definitely be interested. Cheers, Colin On Saturday, 11 April 2015 05:58:51 UTC+10, Philip Tellis wrote: Thanks Colin, we're

[julia-users] Re: Calling a function via a reference to a function allocates a lot of memory as compared to directly calling

2015-03-26 Thread colintbowers
Lots of useful answers here. This is an issue for me a lot too. Here are two StackOverflow links that provide some more interesting reading: http://stackoverflow.com/questions/26173635/performance-penalty-using-anonymous-function-in-julia

[julia-users] Re: Time type

2015-03-15 Thread colintbowers
Just thought I'd add my voice here that I can think of several use cases for this in high-frequency finance, although it would need millisecond precision (at the least). Cheers, -Colin On Saturday, 14 March 2015 00:06:28 UTC+11, David Anthoff wrote: Hi, is there a Time datatype,

[julia-users] Efficient method for altering just date, or just time, portion of DateTime

2015-02-22 Thread colintbowers
Hi all, Given x::DateTime I frequently find myself wanting to either: 1) alter the Year, Month, and Day portion of x, while leaving the Hour, Minute, Second, and Milliseond portion unchanged, or, 2) alter the Hour, Minute, Second, and Millisecond portion of x, while leaving the Year, Month,

Re: [julia-users] Working around current limitations of functions as variables and anonymous functions

2015-02-20 Thread colintbowers
Thanks for responding Tim. I'll do some searches on those key-words you mentioned. For anyone else reading, in the meantime I ran across this StackOverflow question http://stackoverflow.com/questions/26173635/performance-penalty-using-anonymous-function-in-julia which also contains some

[julia-users] Working around current limitations of functions as variables and anonymous functions

2015-02-18 Thread colintbowers
Hi all, Using Julia v0.3.x, there appears to be a significant performance hit when using functions as variables or using anonymous functions. I asked a StackOverflow question about it here

[julia-users] Re: Allocate a Vector

2015-02-04 Thread colintbowers
I think the issue has already come up [here](https://github.com/JuliaLang/julia/issues/3427) and the discussion [here](https://github.com/JuliaLang/julia/issues/1470) is also related. As others have mentioned, this should be possible in v0.4 but isn't possible in v0.3.x. Personally, on v0.3 at

Re: [julia-users] Re: I cannot fine the code for Garch in mean

2015-01-27 Thread colintbowers
Hi Jase, You probably already know this, but just in case: Julia has several different options as far as optimization packages are concerned. The Optim package is probably the most popular of those that are implemented purely in Julia. But the NLopt library (implemented in C) is also a

[julia-users] Best way to remove an observation from a TimeArray

2014-12-08 Thread colintbowers
Hi all, The TimeArray type in the TimeSeries package is immutable. I think I can see why this makes sense. However, I think this means that if the array I have in the values field is of dimension greater than 1 (let's say it is a matrix), then the only way I can remove an observation from my

[julia-users] Unexpected behaviour with workspace()

2014-11-22 Thread colintbowers
Hi all, I'm observing the following behaviour with workspace() on julia v0.3.0+6 on Ubuntu 14.04 julia eval(parse(1+1)) 2 julia workspace() julia eval(parse(1+1)) ERROR: eval not defined Is this a bug or do I actually have no understanding of what workspace() is supposed to do? I searched

Re: [julia-users] Unexpected behaviour with workspace()

2014-11-22 Thread colintbowers
Done. Issue #9119. Cheers, Colin On Sunday, November 23, 2014 5:08:50 PM UTC+11, Stefan Karpinski wrote: That seems like a bug – if you would file an issue, that would be great. On Sat, Nov 22, 2014 at 11:37 PM, colint...@gmail.com javascript: wrote: Hi all, I'm observing the

[julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2014-09-27 Thread colintbowers
No, I don't think it has debugging a la the Matlab IDE or R-Studio (yet). My understanding is that for now the Debug package is all that is available. Personally I make do with sending blocks of code to a console in Sublime-IJulia (you can do this with shift+enter, just like in R-Studio).

[julia-users] Re: a good IDE for Julia ? (Julia Studio does not work with Julia v 0.3.0)

2014-09-20 Thread colintbowers
My favourite of the IDE options is the Sublime-IJulia package: https://github.com/quinnj/Sublime-IJulia Cheers, Colin On Friday, September 19, 2014 9:25:14 PM UTC+10, Ján Dolinský wrote: Thanks a lot for the tip. I'll compile from the source then. Regards, Jan Dňa piatok, 19. septembra