Re: [julia-users] Serializing custom types

2015-08-05 Thread Eric Forgy
That's cool. Could this be used for sending Julia objects via HTTP POST? 
I'm sleep deprived, so this may not make much sense, but it seems like this 
could be used in combination with JSON.jl (or an extension of it). It would 
be nice to be able to parse directly to a custom Julia type.

On Wednesday, August 5, 2015 at 1:35:20 AM UTC+8, Marc Gallant wrote:
>
> That's exactly what I was looking for, thanks Tim.
>
> On Thursday, July 30, 2015 at 12:08:18 PM UTC-4, Tim Holy wrote:
>>
>> Try the JLD package? 
>>
>> --Tim 
>>
>> On Thursday, July 30, 2015 08:57:23 AM Marc Gallant wrote: 
>> > Given the following types: 
>> > 
>> > type Bar 
>> > x::Float64 
>> > y::Int 
>> > end 
>> > 
>> > 
>> > type Foo 
>> > x::Vector{Float64} 
>> > y::Bar 
>> > z::Matrix{Float64} 
>> > end 
>> > 
>> > 
>> > and the following vector: 
>> > 
>> > a = [Foo([1.1, 2.2], Bar(1.1, 4), rand(2, 2)), Foo([1.3, 2.4], 
>> Bar(-1.1, 
>> > 2), rand(2, 2))] 
>> > 
>> > 
>> > Do you have any suggestions on how would I go about serializing a? I 
>> have a 
>> > analogous situation where I do a lot of number crunching resulting in 
>> > something that resembles a, but has thousands of entries. I'd like to 
>> store 
>> > a in a file and read it in later. I've looked into the HDF5 package but 
>> I'm 
>> > having a hard time figuring out a nice way to disassemble my custom 
>> types 
>> > so they can be written, and then reconstructing them after the data is 
>> > retrieved. 
>> > 
>> > I'm using Julia 0.3.10. 
>> > 
>> > Thanks! 
>>
>>

Re: [julia-users] Serializing custom types

2015-08-04 Thread Marc Gallant
That's exactly what I was looking for, thanks Tim.

On Thursday, July 30, 2015 at 12:08:18 PM UTC-4, Tim Holy wrote:
>
> Try the JLD package? 
>
> --Tim 
>
> On Thursday, July 30, 2015 08:57:23 AM Marc Gallant wrote: 
> > Given the following types: 
> > 
> > type Bar 
> > x::Float64 
> > y::Int 
> > end 
> > 
> > 
> > type Foo 
> > x::Vector{Float64} 
> > y::Bar 
> > z::Matrix{Float64} 
> > end 
> > 
> > 
> > and the following vector: 
> > 
> > a = [Foo([1.1, 2.2], Bar(1.1, 4), rand(2, 2)), Foo([1.3, 2.4], Bar(-1.1, 
> > 2), rand(2, 2))] 
> > 
> > 
> > Do you have any suggestions on how would I go about serializing a? I 
> have a 
> > analogous situation where I do a lot of number crunching resulting in 
> > something that resembles a, but has thousands of entries. I'd like to 
> store 
> > a in a file and read it in later. I've looked into the HDF5 package but 
> I'm 
> > having a hard time figuring out a nice way to disassemble my custom 
> types 
> > so they can be written, and then reconstructing them after the data is 
> > retrieved. 
> > 
> > I'm using Julia 0.3.10. 
> > 
> > Thanks! 
>
>

Re: [julia-users] Serializing custom types

2015-07-30 Thread Tim Holy
Try the JLD package?

--Tim

On Thursday, July 30, 2015 08:57:23 AM Marc Gallant wrote:
> Given the following types:
> 
> type Bar
> x::Float64
> y::Int
> end
> 
> 
> type Foo
> x::Vector{Float64}
> y::Bar
> z::Matrix{Float64}
> end
> 
> 
> and the following vector:
> 
> a = [Foo([1.1, 2.2], Bar(1.1, 4), rand(2, 2)), Foo([1.3, 2.4], Bar(-1.1,
> 2), rand(2, 2))]
> 
> 
> Do you have any suggestions on how would I go about serializing a? I have a
> analogous situation where I do a lot of number crunching resulting in
> something that resembles a, but has thousands of entries. I'd like to store
> a in a file and read it in later. I've looked into the HDF5 package but I'm
> having a hard time figuring out a nice way to disassemble my custom types
> so they can be written, and then reconstructing them after the data is
> retrieved.
> 
> I'm using Julia 0.3.10.
> 
> Thanks!



[julia-users] Serializing custom types

2015-07-30 Thread Marc Gallant
Given the following types:

type Bar
x::Float64
y::Int
end


type Foo
x::Vector{Float64}
y::Bar
z::Matrix{Float64}
end


and the following vector:

a = [Foo([1.1, 2.2], Bar(1.1, 4), rand(2, 2)), Foo([1.3, 2.4], Bar(-1.1, 
2), rand(2, 2))]


Do you have any suggestions on how would I go about serializing a? I have a 
analogous situation where I do a lot of number crunching resulting in 
something that resembles a, but has thousands of entries. I'd like to store 
a in a file and read it in later. I've looked into the HDF5 package but I'm 
having a hard time figuring out a nice way to disassemble my custom types 
so they can be written, and then reconstructing them after the data is 
retrieved.

I'm using Julia 0.3.10.

Thanks!