[Pharo-project] OrderedCollections and File I/O
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection. Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn: a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: ''''' Where I want: 20 January 2013 17 January 2013 1 2 1 '' Here you can find the source code: https://github.com/arguser/Paradigmas-Final
On 1/23/13, J. P. L. MartÃn <arguser@gmail.com> wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Maybe you'll have a look at SandstoneDB http://onsmalltalk.com/sandstonedb-simple-activerecord-style-persistence-in-... I do not know where the most recent version for Pharo 1.4 is, but I'm sure somebody else can answer that. --Hannes
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
Fuel: http://rmod.lille.inria.fr/web/pier/software/Fuel Best regards, Dennis Schetinin On Wednesday, 23 January 2013 г. at 8:24, J. P. L. MartÃn wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
yep, fuel... :) On Jan 23, 2013, at 6:50 AM, Dennis Schetinin <chaetal@gmail.com> wrote:
Fuel: http://rmod.lille.inria.fr/web/pier/software/Fuel
Best regards, Dennis Schetinin
On Wednesday, 23 January 2013 г. at 8:24, J. P. L. MartÃn wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
On 23 Jan 2013, at 05:24, J. P. L. MartÃn <arguser@gmail.com> wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
Fuel is a fast binary serializer that can store almost anything. If the collection is holding clean domain level objects, you could also use XML, JSON or STON. These give you human readable textual representations. Sven Search for XML Support NeoJSON STON -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
which reminds me, we should have a dumb default serializer method on Object: Object new serializeTo: 'aFile' asFileReference cause I never figure out which Fuel class to use for serialization :) On 2013-01-23, at 08:54, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 23 Jan 2013, at 05:24, J. P. L. MartÃn <arguser@gmail.com> wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
Fuel is a fast binary serializer that can store almost anything.
If the collection is holding clean domain level objects, you could also use XML, JSON or STON. These give you human readable textual representations.
Sven
Search for XML Support NeoJSON STON
-- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill
On 1/23/13 1:24 AM, "J. P. L. MartÃn" <arguser@gmail.com> wrote:
Say I have an OrderedCollection which I want to save into a file and then recover from that file when I restart the application. How should I proceed? So far I've been doing a mess, saving the OrderedCollection on a file asString, since I'm then unable to recover it asOrderedCollection.
Another problem that I have is at the moment of showing items from that OrderedCollection on a MultiColumnListMorph where I get unwanted info from the printOn:
a Prestamo fechaPrevistaDevolucion: 20 January 2013 fechaPrestamo: 17 January 2013 id: ''1'' idSocio: ''2'' idEjemplarl: ''1'' fechaDevolucion: '''''
Where I want:
20 January 2013 17 January 2013 1 2 1 ''
Here you can find the source code: https://github.com/arguser/Paradigmas-Final
File in the attached in Pharo 1.4, Squeak or Cuis and you have a way of save / load simple Objects into the three forks. And if you speak Spanish, we have http://ar.groups.yahoo.com/group/squeakRos/ Join us and ask any question. Edgar
On Jan 23, 2013, at 10:21 AM, "Edgar J. De Cleene" <edgardec2005@gmail.com> wrote:
File in the attached in Pharo 1.4, Squeak or Cuis and you have a way of save / load simple Objects into the three forks.
And if you speak Spanish, we have http://ar.groups.yahoo.com/group/squeakRos/
Join us and ask any question.
Edgar
<ObjectCompatibleENH.1.cs>
Keep in mind that ReferenceStream is deprecated in 2.0 The nice thing about Fuel is: -> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame)) Marcus
+1 in the context of Pharo, no doubt, Fuel is THE solution Squeak has to support legacy ReferenceStream a bit longer, but even in Squeak I would inquire about Fuel 2013/1/23 Marcus Denker <marcus.denker@inria.fr>:
On Jan 23, 2013, at 10:21 AM, "Edgar J. De Cleene" <edgardec2005@gmail.com> wrote:
File in the attached in Pharo 1.4, Squeak or Cuis and you have a way of save / load simple Objects into the three forks.
And if you speak Spanish, we have http://ar.groups.yahoo.com/group/squeakRos/
Join us and ask any question.
Edgar
<ObjectCompatibleENH.1.cs>
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame))
Marcus
On 1/23/13 6:25 AM, "Marcus Denker" <marcus.denker@inria.fr> wrote:
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame))
Marcus
Yes , I know Fuel is a great advance, but he ask about simple thing. And also I said Pharo 1.4 and not Pharo 2.0. Thanks to Mariano and others , wish Fuel become Squeak citizen soon, for Cuis guess should wait longer. Edgar
Fuel works in 1.4 just fine. Doru On Wednesday, January 23, 2013, Edgar J. De Cleene wrote:
On 1/23/13 6:25 AM, "Marcus Denker" <marcus.denker@inria.fr <javascript:;>> wrote:
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame))
Marcus
Yes , I know Fuel is a great advance, but he ask about simple thing. And also I said Pharo 1.4 and not Pharo 2.0.
Thanks to Mariano and others , wish Fuel become Squeak citizen soon, for Cuis guess should wait longer.
Edgar
-- www.tudorgirba.com "Every thing has its own flow"
On Wed, Jan 23, 2013 at 6:39 AM, Edgar J. De Cleene <edgardec2005@gmail.com>wrote:
On 1/23/13 6:25 AM, "Marcus Denker" <marcus.denker@inria.fr> wrote:
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame))
Marcus
Yes , I know Fuel is a great advance, but he ask about simple thing. And also I said Pharo 1.4 and not Pharo 2.0.
Thanks to Mariano and others , wish Fuel become Squeak citizen soon, for Cuis guess should wait longer.
Edgar see new release: http://forum.world.st/ANN-Fuel-1-8-1-td4661609.html Supported and tested images: Pharo 1.1.1, 1.1.2, 1.2, 1.3, 1.4, 2.0 Squeak 4.1, 4.2, 4.3, 4.4
Edgar
-- Mariano http://marianopeck.wordpress.com
On 1/23/13 8:47 AM, "Mariano Martinez Peck" <marianopeck@gmail.com> wrote:
On Wed, Jan 23, 2013 at 6:39 AM, Edgar J. De Cleene <edgardec2005@gmail.com> wrote:
On 1/23/13 6:25 AM, "Marcus Denker" <marcus.denker@inria.fr> wrote:
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. Â Â Â Â Â Â (even the one you are sure you can't, like the Context (stack frame))
Marcus
Yes , I know Fuel is a great advance, but he ask about simple thing. And also I said Pharo 1.4 and not Pharo 2.0.
Thanks to Mariano and others , wish Fuel become Squeak citizen soon, for Cuis guess should wait longer.
Edgar see new release:Â http://forum.world.st/ANN-Fuel-1-8-1-td4661609.html Supported and tested images:Â Pharo 1.1.1, 1.1.2, 1.2, 1.3, 1.4, 2.0Â Squeak 4.1, 4.2, 4.3, 4.4Â Â
Edgar
Mariano, yo se eso. Pareciera que por tratar de ayudar a un nuevo con dos lineas de codigo estoy desconociendo tu trabajo y el de todos los demas que estan trabajando con Fuel. No hay una unica receta, mis amigos de Pharo.
Edgar
Thank you all for your help, I've used Fuel to save my data and it was really easy to do. Thanks! On Wed, Jan 23, 2013 at 9:43 AM, Edgar J. De Cleene <edgardec2005@gmail.com>wrote:
On 1/23/13 8:47 AM, "Mariano Martinez Peck" <marianopeck@gmail.com> wrote:
On Wed, Jan 23, 2013 at 6:39 AM, Edgar J. De Cleene <* edgardec2005@gmail.com*> wrote:
On 1/23/13 6:25 AM, "Marcus Denker" <*marcus.denker@inria.fr*> wrote:
Keep in mind that ReferenceStream is deprecated in 2.0
The nice thing about Fuel is:
-> Very much faster -> output more compact -> you can store *any* kind of objects. (even the one you are sure you can't, like the Context (stack frame))
Marcus
Yes , I know Fuel is a great advance, but he ask about simple thing. And also I said Pharo 1.4 and not Pharo 2.0.
Thanks to Mariano and others , wish Fuel become Squeak citizen soon, for Cuis guess should wait longer.
Edgar see new release: * http://forum.world.st/ANN-Fuel-1-8-1-td4661609.html *Supported and tested images: Pharo 1.1.1, 1.1.2, 1.2, 1.3, 1.4, 2.0 Squeak 4.1, 4.2, 4.3, 4.4
Edgar
Mariano, yo se eso. Pareciera que por tratar de ayudar a un nuevo con dos lineas de codigo estoy desconociendo tu trabajo y el de todos los demas que estan trabajando con Fuel. No hay una unica receta, mis amigos de Pharo.
Edgar
participants (11)
-
Camillo Bruni -
Dennis Schetinin -
Edgar J. De Cleene -
Esteban Lorenzano -
H. Hirzel -
J. P. L. MartÃn -
Marcus Denker -
Mariano Martinez Peck -
Nicolas Cellier -
Sven Van Caekenberghe -
Tudor Girba