Re: [julia-users] Re: Nullable{Date}

2016-02-09 Thread Michael Landis
and concise (thought that was the point), but we get leapDay = isleapyear (yr)? Nullable {Date} (Date (yr, 2:29)): Nullable {Date} () if ! isnull( leapDay ) doy = dayofyear( get(leapDay) ) On Tue, Feb 9, 2016 at 8:22 PM, Michael Landis <darkskyanar...@gmail.com> wrote: > # wishful

Re: [julia-users] Re: Nullable{Date}

2016-02-09 Thread Michael Landis
# wishful thinking... using Dates; leapDay = isleapyear(yr) ? Date(yr,2,29) : nothing if ! leapDay dow = dayofyear( leapDay ) ... clean and concise (thought that was the point), but we get leapDay = isleapyear(yr) ? Nullable{Date}( Date(yr,2,29) : Nullable{Date}() if ! isnull( leapDay )

[julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
I'm so confused I thought this would be cool: isLeapYr(yr::Int64) = yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0) LeapDay(yr) = isLeapYr(yr) ? Date(yr,2,29) : Nullable{Date}() lp15 = LeapDay(2015) --> Nullable{Date}() lp16 = LeapDay(2016) --> 2016-02-29 no surprises there, but when I

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Michael Landis
Why can't there be a base type upon which all others are based (perhaps by default)? The base class could handle the Nullable situation and everything else would magically inherit that capability. Making a union of a NULL and the actual type is pretty painful for the programmer. Weren't we

Re: [julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
rik > > On Mon, Feb 8, 2016 at 10:08 PM, Michael Landis > <darkskyanar...@gmail.com> wrote: > > I'm so confused > > > > I thought this would be cool: > > isLeapYr(yr::Int64) = yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0) > > LeapDay(y

Re: [julia-users] Nullable{Date}

2016-02-08 Thread Michael Landis
le(Date(yr,2,29)) : Nullable{Date}() > > so that the return value is always a Nullable{Date}. > > -erik > > On Mon, Feb 8, 2016 at 10:08 PM, Michael Landis > <darkskyanar...@gmail.com> wrote: > > I'm so confused > > > > I thought this would be cool: >

Re: [julia-users] Re: Nullable{Date}

2016-02-08 Thread Michael Landis
gt; > > On Monday, February 8, 2016 at 10:08:25 PM UTC-5, Michael Landis wrote: >> >> I'm so confused >> >> I thought this would be cool: >> isLeapYr(yr::Int64) = yr % 400 == 0 || (yr % 4 == 0 && yr % 100 != 0) >> LeapDay(yr) = isLeapYr(yr) ?

Re: [julia-users] Queue{ByteString} acting strangely

2016-02-04 Thread Michael Landis
, 2016 at 5:43 PM, Michael Landis <darksky...@gmail.com > > wrote: > > so ... what's the syntax for creating an empty Queue{ByteString}? > > > > qbs = Queue{ByteString}([])# also produces convert errors > > I think the document tells you exactl

[julia-users] Queue{ByteString} acting strangely

2016-02-04 Thread Michael Landis
DataStructures.Queue is doing strange things for me. Can someone please post proper syntax for forward declarations of an empty Queue{ByteString} and maybe an in-line instantiation (if different) so I can be sure that I am getting the declarations right? When I do: using DataStructures; qbs =

Re: [julia-users] Queue{ByteString} acting strangely

2016-02-04 Thread Michael Landis
assuming that you know more than I do (a likely circumstance), how do you explain... qbs = Queue{ByteString}("1234") # ok typeof(qbs) # --> DataStructures.Queue{ByteString} length(qbs) # --> 4, presumably the result of

Re: [julia-users] Re: how to undefine variable in composite types

2016-02-04 Thread Michael Landis
ct? What happens to other objects that > retain references to those objects? > > On Thu, Feb 4, 2016 at 4:35 PM, Michael Landis <darksky...@gmail.com > > wrote: > >> if you added a field, the existing objects could still be valid. If you >> killed a

Re: [julia-users] Re: how to undefine variable in composite types

2016-02-04 Thread Michael Landis
> On Thu, Feb 4, 2016 at 1:46 PM, Michael Landis <darksky...@gmail.com > > wrote: > >> I think it would be nice to be able to undefine a type, so restarting the >> environment is not required when adding or deleting an attribute from a >> type description. Not bein

Re: [julia-users] Queue{ByteString} acting strangely

2016-02-04 Thread Michael Landis
so ... what's the syntax for creating an empty Queue{ByteString}? qbs = Queue{ByteString}([])# also produces convert errors >

Re: [julia-users] Queue{ByteString} acting strangely

2016-02-04 Thread Michael Landis
of Julia it was not possible to do Queue{ByteString}() or > Vector{ByteString}(). > > On Thu, Feb 4, 2016 at 5:56 PM, Michael Landis <darksky...@gmail.com > > wrote: > >> ah, Queue's don't need to be typed, the type is a parameter to the >> constructor. Parens, not braces.

[julia-users] Re: how to undefine variable in composite types

2016-02-04 Thread Michael Landis
I think it would be nice to be able to undefine a type, so restarting the environment is not required when adding or deleting an attribute from a type description. Not being able to update a type definition without restarting the environment is a royal pain in the ass. On Saturday, March 8,

Re: [julia-users] Re: recommended graphics packages for multiple curves on a single canvas

2016-02-03 Thread Michael Landis
; faster to ask for help. > > On Mon, Feb 1, 2016 at 4:48 AM, Michael Landis <darksky...@gmail.com > > wrote: > >> Gadfly already working. I will look at Breloff's Plots too. Thanks. >> >> >> >

[julia-users] Re: recommended graphics packages for multiple curves on a single canvas

2016-02-01 Thread Michael Landis
Gadfly already working. I will look at Breloff's Plots too. Thanks.

[julia-users] recommended graphics packages for multiple curves on a single canvas

2016-01-31 Thread Michael Landis
Can anyone recommend a graphics capable of plotting multiple curves on a single canvas. Python's pyplot/matplotlib multi-curve capabilities appear to be unavailable within Julia (maybe I'm doing it wrong).

[julia-users] unix timestamp to DateTime & divexact errors

2016-01-29 Thread Michael Landis
Is there a language convention for converting/comparing unix timestamps (e.g. file modify dates) and DateTimes? When I do: fs = stat( "X.csv" ); ms = now() - fs.mtime; typeof(ms) --> Base.Dates.Millisecond, even though now() is a DateTime # you would think that creating a DateTime, would make

[julia-users] Re: unix timestamp to DateTime & divexact errors

2016-01-29 Thread Michael Landis
# Even after dt = trunc(dt,Second); I am still seeing divexact errors... On Friday, January 29, 2016 at 12:44:35 PM UTC-8, Michael Landis wrote: > > Is there a language convention for converting/comparing unix timestamps > (e.g. file modify dates) and DateTimes? > > When I

[julia-users] Re: DateTime business days, Wall Street days, ...

2016-01-28 Thread Michael Landis
Wow, I will give that a try. Thank you! On Thursday, January 28, 2016 at 6:52:38 AM UTC-8, Michael Landis wrote: > > Maybe I'm missing something, but the one thing I want from DateTime is the > ability to determine whether a day has elapsed since a file modify date, > but not jus

[julia-users] Re: Julia Vector declare/load confusion

2016-01-28 Thread Michael Landis
. On Wednesday, January 27, 2016 at 10:26:09 PM UTC-8, Michael Landis wrote: > > I am trying to compute some historical means and volatilities with Julia, > but I've been having some difficulty getting the declarations and/or > assignments right... > > When I try a declar

Re: [julia-users] Re: DateTime business days, Wall Street days, ...

2016-01-28 Thread Michael Landis
at 10:16 AM, Michael Landis <darksky...@gmail.com > > wrote: > >> Wow, I will give that a try. Thank you! >> >> On Thursday, January 28, 2016 at 6:52:38 AM UTC-8, Michael Landis wrote: >>> >>> Maybe I'm missing something, but the one thing I want from Date

[julia-users] DateTime business days, Wall Street days, ...

2016-01-28 Thread Michael Landis
Maybe I'm missing something, but the one thing I want from DateTime is the ability to determine whether a day has elapsed since a file modify date, but not just a calendar day... at least a business day (i.e. Saturdays and Sundays don't count), but even better if a calendar could skip past

[julia-users] Julia Vector declare/load confusion

2016-01-27 Thread Michael Landis
I am trying to compute some historical means and volatilities with Julia, but I've been having some difficulty getting the declarations and/or assignments right... When I try a declaration, like either of these: adjCloseMuVec::Vector{Float32}; # or...

[julia-users] Re: Julia Vector declare/load confusion

2016-01-27 Thread Michael Landis
Correction: a fixed size Vector of Float32 On Wednesday, January 27, 2016 at 10:26:09 PM UTC-8, Michael Landis wrote: > > I am trying to compute some historical means and volatilities with Julia, > but I've been having some difficulty getting the declarations and/or > assig

[julia-users] why does in(x,y) not follow the usual syntax of built-ins?

2015-01-11 Thread Michael Landis
Most Julia built-ins are defined so that the first argument is the (Smalltalk style) message receiver, but in(x,y) reverses the apparent standard, testing whether x is in y (the message receiver). append(x,y) appends y to x (the message receiver); push(x,y) pushes y onto x (the message

[julia-users] why does in(x,y) not follow the usual semantics of built-ins?

2015-01-11 Thread Michael Landis
Most Julia built-ins are defined so that the first argument is the (Smalltalk style) message receiver, but in(x,y) reverses the apparent standard, testing whether x is in y (the message receiver). append(x,y) appends y to x (the message receiver); push(x,y) pushes y onto x (the message

[julia-users] Re: why does in(x,y) not follow the usual semantics of built-ins?

2015-01-11 Thread Michael Landis
in [1,2,3])? On Sunday, January 11, 2015 at 4:00:37 PM UTC-5, Michael Landis wrote: Most Julia built-ins are defined so that the first argument is the (Smalltalk style) message receiver, but in(x,y) reverses the apparent standard, testing whether x is in y (the message receiver). append(x,y