From joseph.alotta at gmail.com Tue Apr 5 22:45:36 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue Apr 5 23:16:44 2016 Subject: [Newbies] Need a local tutor for Squeak Message-ID: <1459896336969-4888503.post@n4.nabble.com> I need a local person to help me with Squeak Smalltalk. I like in the Western suburbs of Chicago, in Downers Grove. I want someone to show me all the things I am missing and to help me use the tools more effectively. I am thinking we could meet at a coffee shop once a week for an hour. I would pay for each lesson, $70. Sincerely, Joe Alotta joseph.alotta@gmail.com -- View this message in context: http://forum.world.st/Need-a-local-tutor-for-Squeak-tp4888503.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. From jelena at misticnabica.hr Tue Apr 5 23:16:49 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Tue Apr 5 23:16:53 2016 Subject: [Newbies] Need a local tutor for Squeak Message-ID: From joseph.alotta at gmail.com Thu Apr 14 01:46:03 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu Apr 14 01:46:08 2016 Subject: [Newbies] f(x, y) or Table Message-ID: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> Greetings, I find a lot of my data needs two indices, f(x,y) instead of one, f(x). f(x) would be implemented easily with a Dictionary, but how do you implement f(x,y)? I guess this is another way of asking is there a Table object or a Tuple object, of even a graphics object Screen that has x,y coordinates with a value? Sincerely, Joe. From jelena at misticnabica.hr Thu Apr 14 01:46:13 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Thu Apr 14 01:46:24 2016 Subject: [Newbies] f(x, y) or Table Message-ID: From joseph.alotta at gmail.com Thu Apr 14 01:18:20 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu Apr 14 01:50:25 2016 Subject: [Newbies] Re: f(x, y) or Table In-Reply-To: References: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> Message-ID: <95879CDA-8BC8-4E9A-8D9A-68E0AECF91C3@gmail.com> ???? > On Apr 13, 2016, at 8:15 PM, jelena [via Smalltalk] wrote: > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/f-x-y-or-Table-tp4889801p4889802.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/f-x-y-or-Table-tp4889801p4889803.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160413/3ff9cb9d/attachment.htm From lewis at mail.msen.com Thu Apr 14 04:01:44 2016 From: lewis at mail.msen.com (David T. Lewis) Date: Thu Apr 14 04:01:46 2016 Subject: [Newbies] f(x, y) or Table In-Reply-To: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> References: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> Message-ID: <20160414040144.GA99348@shell.msen.com> Represent your data as objects. If you are thinking of using a dictionary to map key -> value, and you have z := f(x,y) as a function that maps x,y to z, then make x,y be an object, and let that be the key in your dictionary pointing to value z. So define a class that represents x and y. If you have a good data model, you can represent it with objects. If you can not represent it with objects, then you probably can not represent in in a relational database either, so revisit the data model. Note that an index in the database sense is not the same thing as the x,y that you are asking about. if you think in terms of tables in a database, then x and y might be parameters in a select statement and the tables might or might not have indices to make the query run more efficiently. Dave On Wed, Apr 13, 2016 at 08:46:03PM -0500, Joseph Alotta wrote: > Greetings, > > I find a lot of my data needs two indices, f(x,y) instead of one, f(x). > > f(x) would be implemented easily with a Dictionary, > > but how do you implement f(x,y)? > > > I guess this is another way of asking is there a Table object or a Tuple object, > > of even a graphics object Screen that has x,y coordinates with a value? > > > Sincerely, > > Joe. > > > > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From ron at usmedrec.com Thu Apr 14 16:26:22 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Thu Apr 14 16:26:23 2016 Subject: [Newbies] f(x, y) or Table In-Reply-To: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> References: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> Message-ID: <04bf01d1966a$62503b20$26f0b160$@usmedrec.com> Hi Joseph, | aPoint aDictionary | aPoint := Point x: 1 y: 2. aDictionary := Dictionary new. aDictionary at: aPoint put: 'Success!'. ^aDictionary at: aPoint Everything in Smalltalk is an object. You can use a number or string as your dictionary key but you can also use more complex objects like a Point. The object matching is implemented in #=. If the objects match then the value will be returned. All the best, Ron Teitelbaum > -----Original Message----- > From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- > bounces@lists.squeakfoundation.org] On Behalf Of Joseph Alotta > Sent: Wednesday, April 13, 2016 9:46 PM > To: beginners@lists.squeakfoundation.org > Subject: [Newbies] f(x, y) or Table > > Greetings, > > I find a lot of my data needs two indices, f(x,y) instead of one, f(x). > > f(x) would be implemented easily with a Dictionary, > > but how do you implement f(x,y)? > > > I guess this is another way of asking is there a Table object or a Tuple object, > > of even a graphics object Screen that has x,y coordinates with a value? > > > Sincerely, > > Joe. > > > > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Fri Apr 15 01:38:31 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri Apr 15 02:10:43 2016 Subject: [Newbies] Re: f(x, y) or Table In-Reply-To: <04bf01d1966a$62503b20$26f0b160$@usmedrec.com> References: <2B572F1E-952C-4757-9454-EC4B298D0076@gmail.com> <04bf01d1966a$62503b20$26f0b160$@usmedrec.com> Message-ID: <28D880CF-8ABC-4630-85AD-3351DC688904@gmail.com> thank you. > On Apr 14, 2016, at 10:54 AM, Ron Teitelbaum [via Smalltalk] wrote: > > Hi Joseph, > > | aPoint aDictionary | > > aPoint := Point x: 1 y: 2. > aDictionary := Dictionary new. > aDictionary at: aPoint put: 'Success!'. > ^aDictionary at: aPoint > > Everything in Smalltalk is an object. You can use a number or string as > your dictionary key but you can also use more complex objects like a Point. > > The object matching is implemented in #=. If the objects match then the > value will be returned. > > All the best, > > Ron Teitelbaum > > > -----Original Message----- > > From: [hidden email] [mailto:beginners- > > [hidden email]] On Behalf Of Joseph Alotta > > Sent: Wednesday, April 13, 2016 9:46 PM > > To: [hidden email] > > Subject: [Newbies] f(x, y) or Table > > > > Greetings, > > > > I find a lot of my data needs two indices, f(x,y) instead of one, f(x). > > > > f(x) would be implemented easily with a Dictionary, > > > > but how do you implement f(x,y)? > > > > > > I guess this is another way of asking is there a Table object or a Tuple > object, > > > > > of even a graphics object Screen that has x,y coordinates with a value? > > > > > > Sincerely, > > > > Joe. > > > > > > > > > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/f-x-y-or-Table-tp4889801p4890068.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/f-x-y-or-Table-tp4889801p4890103.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160414/1b42d0ba/attachment.htm From jelena at misticnabica.hr Fri Apr 15 02:10:52 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Fri Apr 15 02:11:00 2016 Subject: [Newbies] Re: f(x, y) or Table Message-ID: <0CCF9D65AB16468EA28445D9F2C8F8EA.MAI@server2.totohost.hr> From joseph.alotta at gmail.com Wed Apr 20 15:19:14 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 15:19:28 2016 Subject: [Newbies] debugging by using a global variable? Message-ID: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> Greetings, My code has some complex parts and I think it would be good to pull parts of it out and practice with it in a workspace window. For example, I have an Array of Transaction objects, that is a instance variable. It is mostly populated from reading a file. What would be the best method to extract this array? Assign it to a global variable? Sincerely, Joe. From jelena at misticnabica.hr Wed Apr 20 15:19:24 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Wed Apr 20 15:19:40 2016 Subject: [Newbies] debugging by using a global variable? Message-ID: <84C0F5779B794BBA842AB65A72274CF3.MAI@server2.totohost.hr> From joseph.alotta at gmail.com Wed Apr 20 15:42:44 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 15:43:11 2016 Subject: [Newbies] Help!! screenshot bounced Message-ID: I would like to send the list a screenshot of my problem, but it bounced. What is the appropriate way of sharing a screenshot? Sincerely, Joe. From bert at freudenbergs.de Wed Apr 20 15:50:33 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Wed Apr 20 15:50:46 2016 Subject: [Newbies] Help!! screenshot bounced In-Reply-To: References: Message-ID: On 20.04.2016, at 17:42, Joseph Alotta wrote: > > I would like to send the list a screenshot of my problem, but it bounced. What is the appropriate way of sharing a screenshot? Upload your screenshot somewhere and send the URL to the list. - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/3ecd74cd/smime.bin From bert at freudenbergs.de Wed Apr 20 16:26:15 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Wed Apr 20 16:26:31 2016 Subject: [Newbies] debugging by using a global variable? In-Reply-To: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> References: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> Message-ID: > On 20.04.2016, at 17:19, Joseph Alotta wrote: > > Greetings, > > My code has some complex parts and I think it would be good to pull parts of it out and practice with it in a workspace window. > > For example, I have an Array of Transaction objects, that is a instance variable. It is mostly populated from reading a file. > > What would be the best method to extract this array? > > Assign it to a global variable? That?s one way to do it. You can also drag that instance variable from the inspector to the workspace, which will create a variable reference. In the latest trunk image this should work seamlessly: If you drop an Array, the workspace variable will be named something like ?array12345? and be bound to that Array. In the stable release image, you have to first enable the workspace?s ?accept dropped morphs? flag from its menu button. It will create a variable named ?transfer12345? and put the morph in it. You will have to refer to the Array as ?transfer12345 passenger?. - Bert - -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/3b54b54b/smime.bin From joseph.alotta at gmail.com Wed Apr 20 19:31:17 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 19:31:22 2016 Subject: [Newbies] Help! can't see inside a Bag Message-ID: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> Help! I have a data structure as the screenshot below shows. There is a Bag with Transaction objects. I can?t see inside the Transaction objects? Why is there a Dictionary? I can see the beginning of the transaction data, but I can?t the the whole line? When I explore, it opens a window on Integer 1. Where are all the 1s coming from? Sincerely, Joe. here is the link: https://www.flickr.com/photos/jalotta/26480315621/ From joseph.alotta at gmail.com Wed Apr 20 19:00:09 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 19:33:00 2016 Subject: [Newbies] Re: debugging by using a global variable? In-Reply-To: References: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> Message-ID: <6CF22969-3DA4-4335-A8F0-59A07FE8285E@gmail.com> bert, thanks. I heard something ding when I dragged it, but nothing happened. I couldn?t find the item on the menus. Sincerely, Joe. > On Apr 20, 2016, at 10:53 AM, Bert Freudenberg [via Smalltalk] wrote: > > > > On 20.04.2016, at 17:19, Joseph Alotta <[hidden email]> wrote: > > > > Greetings, > > > > My code has some complex parts and I think it would be good to pull parts of it out and practice with it in a workspace window. > > > > For example, I have an Array of Transaction objects, that is a instance variable. It is mostly populated from reading a file. > > > > What would be the best method to extract this array? > > > > Assign it to a global variable? > That?s one way to do it. > > You can also drag that instance variable from the inspector to the workspace, which will create a variable reference. > > In the latest trunk image this should work seamlessly: If you drop an Array, the workspace variable will be named something like ?array12345? and be bound to that Array. > > In the stable release image, you have to first enable the workspace?s ?accept dropped morphs? flag from its menu button. It will create a variable named ?transfer12345? and put the morph in it. You will have to refer to the Array as ?transfer12345 passenger?. > > - Bert - > > > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > smime.p7s (5K) Download Attachment > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/debugging-by-using-a-global-variable-tp4891014p4891032.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/debugging-by-using-a-global-variable-tp4891014p4891050.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/de63ddc2/attachment-0001.htm From joseph.alotta at gmail.com Wed Apr 20 19:00:19 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 19:33:11 2016 Subject: [Newbies] Re: Help!! screenshot bounced In-Reply-To: References: Message-ID: <5A0620C7-E882-465A-9E1A-D137B0DCA706@gmail.com> okay, i did, but it shouldn?t be this hard. > On Apr 20, 2016, at 10:18 AM, Bert Freudenberg [via Smalltalk] wrote: > > On 20.04.2016, at 17:42, Joseph Alotta <[hidden email]> wrote: > > > > I would like to send the list a screenshot of my problem, but it bounced. What is the appropriate way of sharing a screenshot? > > Upload your screenshot somewhere and send the URL to the list. > > - Bert - > > > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > smime.p7s (5K) Download Attachment > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Help-screenshot-bounced-tp4891019p4891022.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Help-screenshot-bounced-tp4891019p4891051.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/93e8dbbc/attachment.htm From cunningham.cb at gmail.com Wed Apr 20 20:15:45 2016 From: cunningham.cb at gmail.com (Chris Cunningham) Date: Wed Apr 20 20:15:47 2016 Subject: [Newbies] Help! can't see inside a Bag In-Reply-To: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> References: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> Message-ID: HI Joe, A Bag is a structure to hold multiple, possibly repeating, objects in it. One of the benefits is to know how many times an object is inside of the bag - how many times it repeats. Bag is implemented with a Dictionary it in - the key is the objects that you put into the bag, and the value is the count of how many times it was put into the bag (hence all of the 1's that you see - they were probably just added once to the bag). The explorer is optimized to make Dictionary navigation fast and convenient for normal Dictionaries - you can see and select the key, and get to see the details of the values in the dictionary. It is not optimized for looking at the dictionary in the Bag, where you care about the key (and mostly not about the value - at least for your use case). To explore the values in the Bag, I would suggest one of two ways of getting at the data: 1> send #asSet to the bag, and explore that 2> send #keys to the dictionary, and explore that Either should work. One more thing to think about - if you aren't going to have multiples of your Transaction objects (or don't care to know that you have multiple of them) in your Bag, you might want to consider using a Set instead. Thanks, cbc On Wed, Apr 20, 2016 at 12:31 PM, Joseph Alotta wrote: > Help! > > > I have a data structure as the screenshot below shows. > > There is a Bag with Transaction objects. > > I can?t see inside the Transaction objects? > > Why is there a Dictionary? > > I can see the beginning of the transaction data, but I can?t the the whole > line? > > When I explore, it opens a window on Integer 1. Where are all the 1s > coming from? > > > Sincerely, > > Joe. > > > here is the link: https://www.flickr.com/photos/jalotta/26480315621/ > > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/7995c616/attachment.htm From joseph.alotta at gmail.com Wed Apr 20 21:25:04 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Wed Apr 20 21:57:56 2016 Subject: [Newbies] Re: Help! can't see inside a Bag In-Reply-To: References: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> Message-ID: There is a possibility of duplicates. For example, if I go to Starbucks buy a coffee, then buy a second cup. There would be two transactions same amount, same day. What about OrderedCollection? How do I send #asSet to the bag, give that the bag is an instance variable in my larger object? > On Apr 20, 2016, at 2:43 PM, cbc [via Smalltalk] wrote: > > HI Joe, > A Bag is a structure to hold multiple, possibly repeating, objects in it. One of the benefits is to know how many times an object is inside of the bag - how many times it repeats. > > Bag is implemented with a Dictionary it in - the key is the objects that you put into the bag, and the value is the count of how many times it was put into the bag (hence all of the 1's that you see - they were probably just added once to the bag). > > The explorer is optimized to make Dictionary navigation fast and convenient for normal Dictionaries - you can see and select the key, and get to see the details of the values in the dictionary. > It is not optimized for looking at the dictionary in the Bag, where you care about the key (and mostly not about the value - at least for your use case). > > To explore the values in the Bag, I would suggest one of two ways of getting at the data: > 1> send #asSet to the bag, and explore that > 2> send #keys to the dictionary, and explore that > Either should work. > > One more thing to think about - if you aren't going to have multiples of your Transaction objects (or don't care to know that you have multiple of them) in your Bag, you might want to consider using a Set instead. > > Thanks, > cbc > > On Wed, Apr 20, 2016 at 12:31 PM, Joseph Alotta <[hidden email]> wrote: > Help! > > > I have a data structure as the screenshot below shows. > > There is a Bag with Transaction objects. > > I can?t see inside the Transaction objects? > > Why is there a Dictionary? > > I can see the beginning of the transaction data, but I can?t the the whole line? > > When I explore, it opens a window on Integer 1. Where are all the 1s coming from? > > > Sincerely, > > Joe. > > > here is the link: https://www.flickr.com/photos/jalotta/26480315621/ > > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891054.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891076.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/1f73ab08/attachment.htm From cunningham.cb at gmail.com Wed Apr 20 22:27:21 2016 From: cunningham.cb at gmail.com (Chris Cunningham) Date: Wed Apr 20 22:27:23 2016 Subject: [Newbies] Re: Help! can't see inside a Bag In-Reply-To: References: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 17273 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/1cebafa6/image-0001.png From jelena at misticnabica.hr Wed Apr 20 22:27:32 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Wed Apr 20 22:27:39 2016 Subject: [Newbies] Re: Help! can't see inside a Bag Message-ID: <586124D248EE4A8B85E52893CA71FF9F.MAI@server2.totohost.hr> From joseph.alotta at gmail.com Wed Apr 20 23:38:02 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu Apr 21 00:10:55 2016 Subject: [Newbies] Re: Help! can't see inside a Bag In-Reply-To: References: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> Message-ID: <6772450F-4A20-4DA4-95F7-3EB53263D9D0@gmail.com> How did you put the screen shot in your email? Sent from my iPhone > On Apr 20, 2016, at 4:54 PM, cbc [via Smalltalk] wrote: > > > >> On Wed, Apr 20, 2016 at 2:25 PM, Joseph Alotta <[hidden email]> wrote: >> There is a possibility of duplicates. For example, if I go to Starbucks buy a coffee, then buy a second cup. There would be two transactions same amount, same day. >> >> What about OrderedCollection? > OrderedCollection would also work, especially if you want to see what order they happened in. If you just care about counting the times it happened, Bag might be better. > >> How do I send #asSet to the bag, give that the bag is an instance variable in my larger object? > In the explorer (right where you tried exploring the dictionary value in the bag), select the bag variable. > Then, down int eh bottom pane, type in > self asSet > and explore that. > >> >> >> >> >> > On Apr 20, 2016, at 2:43 PM, cbc [via Smalltalk] <[hidden email]> wrote: >> > >> > HI Joe, >> > A Bag is a structure to hold multiple, possibly repeating, objects in it. One of the benefits is to know how many times an object is inside of the bag - how many times it repeats. >> > >> > Bag is implemented with a Dictionary it in - the key is the objects that you put into the bag, and the value is the count of how many times it was put into the bag (hence all of the 1's that you see - they were probably just added once to the bag). >> > >> > The explorer is optimized to make Dictionary navigation fast and convenient for normal Dictionaries - you can see and select the key, and get to see the details of the values in the dictionary. >> > It is not optimized for looking at the dictionary in the Bag, where you care about the key (and mostly not about the value - at least for your use case). >> > >> > To explore the values in the Bag, I would suggest one of two ways of getting at the data: >> > 1> send #asSet to the bag, and explore that >> > 2> send #keys to the dictionary, and explore that >> > Either should work. >> > >> > One more thing to think about - if you aren't going to have multiples of your Transaction objects (or don't care to know that you have multiple of them) in your Bag, you might want to consider using a Set instead. >> > >> > Thanks, >> > cbc >> > >> > On Wed, Apr 20, 2016 at 12:31 PM, Joseph Alotta <[hidden email]> wrote: >> >> > Help! >> > >> > >> > I have a data structure as the screenshot below shows. >> > >> > There is a Bag with Transaction objects. >> > >> > I can?t see inside the Transaction objects? >> > >> > Why is there a Dictionary? >> > >> > I can see the beginning of the transaction data, but I can?t the the whole line? >> > >> > When I explore, it opens a window on Integer 1. Where are all the 1s coming from? >> > >> > >> > Sincerely, >> > >> > Joe. >> > >> > >> > here is the link: https://www.flickr.com/photos/jalotta/26480315621/ >> > >> > >> > >> > _______________________________________________ >> > Beginners mailing list >> > [hidden email] >> >> > http://lists.squeakfoundation.org/mailman/listinfo/beginners >> > >> > >> > _______________________________________________ >> > Beginners mailing list >> > [hidden email] >> > http://lists.squeakfoundation.org/mailman/listinfo/beginners >> > >> > >> > If you reply to this email, your message will be added to the discussion below: >> > http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891054.html >> > To start a new topic under Squeak - Beginners, email [hidden email] >> > To unsubscribe from Squeak - Beginners, click here. >> > NAML >> >> View this message in context: Re: Help! can't see inside a Bag >> Sent from the Squeak - Beginners mailing list archive at Nabble.com. >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891078.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891087.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160420/6810bc57/attachment.htm From bert at freudenbergs.de Thu Apr 21 08:20:58 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Thu Apr 21 08:21:03 2016 Subject: [Newbies] Re: Help! can't see inside a Bag In-Reply-To: <6772450F-4A20-4DA4-95F7-3EB53263D9D0@gmail.com> References: <0D407D8E-6A8B-4093-B5DF-A44F89BDFDE5@gmail.com> <6772450F-4A20-4DA4-95F7-3EB53263D9D0@gmail.com> Message-ID: <12444BB5-5614-4163-91E7-D4B680209C7C@freudenbergs.de> You can include a screenshot, there just is a size limit :) If you crop the shot to the relevant part, and compress it as PNG, it usually fits. It's also polite to shorten the quoted emails to the relevant sections (which cuts down on size too). - Bert - > On 21.04.2016, at 01:38, Joseph Alotta wrote: > > How did you put the screen shot in your email? > > Sent from my iPhone > >> On Apr 20, 2016, at 4:54 PM, cbc [via Smalltalk] <[hidden email]> wrote: >> >> >> >>> On Wed, Apr 20, 2016 at 2:25 PM, Joseph Alotta <[hidden email]> wrote: >>> There is a possibility of duplicates. For example, if I go to Starbucks buy a coffee, then buy a second cup. There would be two transactions same amount, same day. >>> >>> What about OrderedCollection? >>> >> OrderedCollection would also work, especially if you want to see what order they happened in. If you just care about counting the times it happened, Bag might be better. >> >>> How do I send #asSet to the bag, give that the bag is an instance variable in my larger object? >>> >> In the explorer (right where you tried exploring the dictionary value in the bag), select the bag variable. >> Then, down int eh bottom pane, type in >> self asSet >> and explore that. >> >>> >>> >>> >>> >>> > On Apr 20, 2016, at 2:43 PM, cbc [via Smalltalk] <[hidden email]> wrote: >>> > >>> > HI Joe, >>> > A Bag is a structure to hold multiple, possibly repeating, objects in it. One of the benefits is to know how many times an object is inside of the bag - how many times it repeats. >>> > >>> > Bag is implemented with a Dictionary it in - the key is the objects that you put into the bag, and the value is the count of how many times it was put into the bag (hence all of the 1's that you see - they were probably just added once to the bag). >>> > >>> > The explorer is optimized to make Dictionary navigation fast and convenient for normal Dictionaries - you can see and select the key, and get to see the details of the values in the dictionary. >>> > It is not optimized for looking at the dictionary in the Bag, where you care about the key (and mostly not about the value - at least for your use case). >>> > >>> > To explore the values in the Bag, I would suggest one of two ways of getting at the data: >>> > 1> send #asSet to the bag, and explore that >>> > 2> send #keys to the dictionary, and explore that >>> > Either should work. >>> > >>> > One more thing to think about - if you aren't going to have multiples of your Transaction objects (or don't care to know that you have multiple of them) in your Bag, you might want to consider using a Set instead. >>> > >>> > Thanks, >>> > cbc >>> > >>> > On Wed, Apr 20, 2016 at 12:31 PM, Joseph Alotta <[hidden email]> wrote: >>> >>> > Help! >>> > >>> > >>> > I have a data structure as the screenshot below shows. >>> > >>> > There is a Bag with Transaction objects. >>> > >>> > I can?t see inside the Transaction objects? >>> > >>> > Why is there a Dictionary? >>> > >>> > I can see the beginning of the transaction data, but I can?t the the whole line? >>> > >>> > When I explore, it opens a window on Integer 1. Where are all the 1s coming from? >>> > >>> > >>> > Sincerely, >>> > >>> > Joe. >>> > >>> > >>> > here is the link: https://www.flickr.com/photos/jalotta/26480315621/ >>> > >>> > >>> > >>> > _______________________________________________ >>> > Beginners mailing list >>> > [hidden email] >>> >>> > http://lists.squeakfoundation.org/mailman/listinfo/beginners >>> > >>> > >>> > _______________________________________________ >>> > Beginners mailing list >>> > [hidden email] >>> > http://lists.squeakfoundation.org/mailman/listinfo/beginners >>> > >>> > >>> > If you reply to this email, your message will be added to the discussion below: >>> > http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891054.html >>> > To start a new topic under Squeak - Beginners, email [hidden email] >>> > To unsubscribe from Squeak - Beginners, click here. >>> > NAML >>> View this message in context: Re: Help! can't see inside a Bag >>> Sent from the Squeak - Beginners mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> Beginners mailing list >>> [hidden email] >>> http://lists.squeakfoundation.org/mailman/listinfo/beginners >>> >> >> >> _______________________________________________ >> Beginners mailing list >> [hidden email] >> http://lists.squeakfoundation.org/mailman/listinfo/beginners >> >> >> If you reply to this email, your message will be added to the discussion below: >> http://forum.world.st/Help-can-t-see-inside-a-Bag-tp4891049p4891078.html >> To start a new topic under Squeak - Beginners, email [hidden email] >> To unsubscribe from Squeak - Beginners, click here. >> NAML > > View this message in context: Re: Help! can't see inside a Bag > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160421/59fb5e84/attachment-0001.htm From bert at freudenbergs.de Thu Apr 21 08:29:04 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Thu Apr 21 08:29:08 2016 Subject: [Newbies] Re: Help!! screenshot bounced In-Reply-To: <5A0620C7-E882-465A-9E1A-D137B0DCA706@gmail.com> References: <5A0620C7-E882-465A-9E1A-D137B0DCA706@gmail.com> Message-ID: <4F762491-FB4D-404C-BAA2-1AB93F885322@freudenbergs.de> If you do this more often, you don't have to do it manually. E.g. when I press my keyboard shortcut for screenshot, it saves the file to a Dropbox folder and puts its public URL in the clipboard. Then I paste the URL into my mail. So it's press key - select screen region - press another key, which for me is even quicker than attaching the file to the email. - Bert - > On 20.04.2016, at 21:00, Joseph Alotta wrote: > > okay, i did, but it shouldn?t be this hard. > > > > On Apr 20, 2016, at 10:18 AM, Bert Freudenberg [via Smalltalk] <[hidden email]> wrote: > > > > On 20.04.2016, at 17:42, Joseph Alotta <[hidden email]> wrote: > > > > > > I would like to send the list a screenshot of my problem, but it bounced. What is the appropriate way of sharing a screenshot? > > > > Upload your screenshot somewhere and send the URL to the list. > > > > - Bert - > > > > > > > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > smime.p7s (5K) Download Attachment > > > > > > If you reply to this email, your message will be added to the discussion below: > > http://forum.world.st/Help-screenshot-bounced-tp4891019p4891022.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > View this message in context: Re: Help!! screenshot bounced > Sent from the Squeak - Beginners mailing list archive at Nabble.com. > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160421/e3581fc8/attachment.htm From bert at freudenbergs.de Thu Apr 21 14:30:44 2016 From: bert at freudenbergs.de (Bert Freudenberg) Date: Thu Apr 21 14:30:49 2016 Subject: [Newbies] Re: debugging by using a global variable? In-Reply-To: <6CF22969-3DA4-4335-A8F0-59A07FE8285E@gmail.com> References: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> <6CF22969-3DA4-4335-A8F0-59A07FE8285E@gmail.com> Message-ID: <0157CDF2-F15D-436D-B71B-4C47EC962CEF@freudenbergs.de> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4207 bytes Desc: not available Url : http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160421/a1dc3530/smime-0001.bin From joseph.alotta at gmail.com Thu Apr 21 22:00:23 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu Apr 21 22:33:23 2016 Subject: [Newbies] Re: debugging by using a global variable? In-Reply-To: <0157CDF2-F15D-436D-B71B-4C47EC962CEF@freudenbergs.de> References: <3A47B764-47C3-4263-AEBD-1064A72DE913@gmail.com> <6CF22969-3DA4-4335-A8F0-59A07FE8285E@gmail.com> <0157CDF2-F15D-436D-B71B-4C47EC962CEF@freudenbergs.de> Message-ID: <0DA0CC00-2E15-4428-A229-37382E6A6A5F@gmail.com> Thank you. I found the menu now. Wow! There is a lot of other interesting things there. Sincerely, Joe. > On Apr 21, 2016, at 8:58 AM, Bert Freudenberg [via Smalltalk] wrote: > > The menu item is behind the blue button in the workspace?s title bar: > > > > - Bert - > >> On 20.04.2016, at 21:00, Joseph Alotta <[hidden email]> wrote: >> >> bert, >> >> thanks. I heard something ding when I dragged it, but nothing happened. I couldn?t find the item on the menus. >> >> Sincerely, >> >> Joe. >> >> >> > On Apr 20, 2016, at 10:53 AM, Bert Freudenberg [via Smalltalk] <[hidden email]> wrote: >> > >> > >> > > On 20.04.2016, at 17:19, Joseph Alotta <[hidden email]> wrote: >> > > >> > > Greetings, >> > > >> > > My code has some complex parts and I think it would be good to pull parts of it out and practice with it in a workspace window. >> > > >> > > For example, I have an Array of Transaction objects, that is a instance variable. It is mostly populated from reading a file. >> > > >> > > What would be the best method to extract this array? >> > > >> > > Assign it to a global variable? >> > That?s one way to do it. >> > >> > You can also drag that instance variable from the inspector to the workspace, which will create a variable reference. >> > >> > In the latest trunk image this should work seamlessly: If you drop an Array, the workspace variable will be named something like ?array12345? and be bound to that Array. >> > >> > In the stable release image, you have to first enable the workspace?s ?accept dropped morphs? flag from its menu button. It will create a variable named ?transfer12345? and put the morph in it. You will have to refer to the Array as ?transfer12345 passenger?. >> > >> > - Bert - >> > > > > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > smime.p7s (5K) Download Attachment > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/debugging-by-using-a-global-variable-tp4891014p4891186.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/debugging-by-using-a-global-variable-tp4891014p4891234.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160421/8015210d/attachment.htm From jelena at misticnabica.hr Thu Apr 21 22:33:27 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Thu Apr 21 22:33:37 2016 Subject: [Newbies] Re: debugging by using a global variable? Message-ID: <1BD755BF488B4139A4C357634AEF9564.MAI@server2.totohost.hr> From dave at lab6.com Mon Apr 25 04:54:15 2016 From: dave at lab6.com (Dave Crossland) Date: Mon Apr 25 04:54:57 2016 Subject: [Newbies] siliconsqueak? Message-ID: Hi What happened to siliconsqueak.org? :) http://web.archive.org/web/20160213013044/http://siliconsqueak.org/ Cheers Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160425/e665a2be/attachment.htm From joseph.alotta at gmail.com Mon Apr 25 15:16:33 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon Apr 25 15:16:38 2016 Subject: [Newbies] go to the end of a loop Message-ID: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> Greetings, I have this code: ****** read "read the category file into the dictionary the first item is the category, the rest of the line are payees office expense|home depot|staples|costco groceries|natures best|jewel|trader joes|fresh thyme " | f line | f := FileStream oldFileNamed: myfile. [(line := f nextLine) notNil] whileTrue: [ | array cat payees | array := line findTokens: $| escapedBy: Character tab . cat := array first. payees := array reject: [ :i | i = cat ]. "rest of the line" payees do: [ :p | mydict at: (p withBlanksCondensed) put: (cat withBlanksCondensed)]. ]. f close. ********* I am getting some blank lines in the data file. Lines with just a Character cr. I was wondering how to handle that. In other languages, there is a break for the loop, to go to the end. I can do: (line size < 2) ifTrue: [ f nextLine.]. But that would interfere with the notNil idiom at the end of the file. So where do I put this. Is there a common way to jump to the end? Sincerely, Joe. From jelena at misticnabica.hr Mon Apr 25 15:16:43 2016 From: jelena at misticnabica.hr (jelena@misticnabica.hr) Date: Mon Apr 25 15:16:55 2016 Subject: [Newbies] go to the end of a loop Message-ID: <0B1C4DEF324A4680A07D90ECC5C946C2.MAI@server2.totohost.hr> From Lou at Keystone-Software.com Mon Apr 25 15:39:26 2016 From: Lou at Keystone-Software.com (Louis LaBrunda) Date: Mon Apr 25 15:39:41 2016 Subject: [Newbies] go to the end of a loop References: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> Message-ID: Hi Joe, Better than checking for #nextLine answering nil, I think you can send the file stream #atEnd to see if there is any more data. You would then use a #whileFalse: and move the #nextLine call into the second block of the whileFalse:. Then test for empty lines with something like: (line size < 2) ifFalse: [...putting all the code that does the work on a line with data in here...]. Lou PS. If this is not a school project, we can be of more help, we just don't like doing students projects for them as they learn more with just a few hints and not real code. On Mon, 25 Apr 2016 10:16:33 -0500, Joseph Alotta wrote: >Greetings, > >I have this code: > >****** > >read > "read the category file into the dictionary > the first item is the category, the rest of the line are payees > > office expense|home depot|staples|costco > groceries|natures best|jewel|trader joes|fresh thyme > " > >| f line | >f := FileStream oldFileNamed: myfile. > >[(line := f nextLine) notNil] whileTrue: [ | array cat payees | > > array := line findTokens: $| escapedBy: Character tab . > > cat := array first. > payees := array reject: [ :i | i = cat ]. "rest of the line" > > payees do: [ :p | mydict at: (p withBlanksCondensed) put: (cat withBlanksCondensed)]. > ]. > > >f close. > >********* > >I am getting some blank lines in the data file. Lines with just a Character cr. I was wondering how to handle that. In other languages, there is a break for the loop, to go to the end. I can do: > >(line size < 2) ifTrue: [ f nextLine.]. > >But that would interfere with the notNil idiom at the end of the file. So where do I put this. Is there a common way to jump to the end? > > >Sincerely, > > >Joe. -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon From falink at free.fr Mon Apr 25 16:02:32 2016 From: falink at free.fr (Frits) Date: Mon Apr 25 16:02:35 2016 Subject: [Newbies] Please unsubscribe Message-ID: Please unsubscribe Mr F. Alink from all lists. We could't find the unsubscribe link in the thread. We are sorry to inform you that Mr Alink is deceased. Thank you for your help. Alink family From joseph.alotta at gmail.com Mon Apr 25 16:59:44 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Mon Apr 25 17:33:12 2016 Subject: [Newbies] Re: go to the end of a loop In-Reply-To: References: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> Message-ID: <8A97CF94-DBA5-4E97-AF92-E3E846587CC6@gmail.com> Hi Louis, This is not a school project. I was looking for a local tutor but could find none. So this is me doing this instead of working crossword puzzles or sudukos. So your advice would be: (f atEnd) whileFalse: [ line := f nextLine (line size < 2) ifFalse: [ ?process line?]. ]. Sincerely, Joe. > On Apr 25, 2016, at 10:06 AM, Louis LaBrunda [via Smalltalk] wrote: > > Hi Joe, > > Better than checking for #nextLine answering nil, I think you can send the file stream #atEnd > to see if there is any more data. You would then use a #whileFalse: and move the #nextLine > call into the second block of the whileFalse:. Then test for empty lines with something like: > (line size < 2) ifFalse: [...putting all the code that does the work on a line with data in > here...]. > > Lou > > PS. If this is not a school project, we can be of more help, we just don't like doing > students projects for them as they learn more with just a few hints and not real code. > > On Mon, 25 Apr 2016 10:16:33 -0500, Joseph Alotta <[hidden email]> wrote: > > >Greetings, > > > >I have this code: > > > >****** > > > >read > > "read the category file into the dictionary > > the first item is the category, the rest of the line are payees > > > > office expense|home depot|staples|costco > > groceries|natures best|jewel|trader joes|fresh thyme > > " > > > >| f line | > >f := FileStream oldFileNamed: myfile. > > > >[(line := f nextLine) notNil] whileTrue: [ | array cat payees | > > > > array := line findTokens: $| escapedBy: Character tab . > > > > cat := array first. > > payees := array reject: [ :i | i = cat ]. "rest of the line" > > > > payees do: [ :p | mydict at: (p withBlanksCondensed) put: (cat withBlanksCondensed)]. > > ]. > > > > > >f close. > > > >********* > > > >I am getting some blank lines in the data file. Lines with just a Character cr. I was wondering how to handle that. In other languages, there is a break for the loop, to go to the end. I can do: > > > >(line size < 2) ifTrue: [ f nextLine.]. > > > >But that would interfere with the notNil idiom at the end of the file. So where do I put this. Is there a common way to jump to the end? > > > > > >Sincerely, > > > > > >Joe. > -- > Louis LaBrunda > Keystone Software Corp. > SkypeMe callto://PhotonDemon > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > If you reply to this email, your message will be added to the discussion below: > http://forum.world.st/go-to-the-end-of-a-loop-tp4891930p4891939.html > To start a new topic under Squeak - Beginners, email ml-node+s1294792n107673h12@n4.nabble.com > To unsubscribe from Squeak - Beginners, click here. > NAML -- View this message in context: http://forum.world.st/go-to-the-end-of-a-loop-tp4891930p4891963.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160425/fd2e30e6/attachment-0001.htm From cunningham.cb at gmail.com Mon Apr 25 17:57:35 2016 From: cunningham.cb at gmail.com (Chris Cunningham) Date: Mon Apr 25 17:57:37 2016 Subject: [Newbies] Re: go to the end of a loop In-Reply-To: <8A97CF94-DBA5-4E97-AF92-E3E846587CC6@gmail.com> References: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> <8A97CF94-DBA5-4E97-AF92-E3E846587CC6@gmail.com> Message-ID: Yes, except #whileFalse: only works against blocks. So: [f atEnd] whileFalse: [ On Mon, Apr 25, 2016 at 9:59 AM, Joseph Alotta wrote: > Hi Louis, > > This is not a school project. I was looking for a local tutor but could > find none. So this is me doing this instead of working crossword puzzles > or sudukos. > > So your advice would be: > > (f atEnd) whileFalse: [ > line := f nextLine > > (line size < 2) ifFalse: [ ?process line?]. > > ]. > > > Sincerely, > > Joe. > > > > > > > On Apr 25, 2016, at 10:06 AM, Louis LaBrunda [via Smalltalk] <[hidden > email] > wrote: > > > > Hi Joe, > > > > Better than checking for #nextLine answering nil, I think you can send > the file stream #atEnd > > to see if there is any more data. You would then use a #whileFalse: and > move the #nextLine > > call into the second block of the whileFalse:. Then test for empty > lines with something like: > > (line size < 2) ifFalse: [...putting all the code that does the work on > a line with data in > > here...]. > > > > Lou > > > > PS. If this is not a school project, we can be of more help, we just > don't like doing > > students projects for them as they learn more with just a few hints and > not real code. > > > > On Mon, 25 Apr 2016 10:16:33 -0500, Joseph Alotta <[hidden email]> > wrote: > > > > >Greetings, > > > > > >I have this code: > > > > > >****** > > > > > >read > > > "read the category file into the dictionary > > > the first item is the category, the rest of the line are payees > > > > > > office expense|home depot|staples|costco > > > groceries|natures best|jewel|trader joes|fresh thyme > > > " > > > > > >| f line | > > >f := FileStream oldFileNamed: myfile. > > > > > >[(line := f nextLine) notNil] whileTrue: [ | array cat payees | > > > > > > array := line findTokens: $| escapedBy: Character > tab . > > > > > > cat := array first. > > > payees := array reject: [ :i | i = cat ]. "rest of the line" > > > > > > payees do: [ :p | mydict at: (p withBlanksCondensed) put: (cat > withBlanksCondensed)]. > > > ]. > > > > > > > > >f close. > > > > > >********* > > > > > >I am getting some blank lines in the data file. Lines with just a > Character cr. I was wondering how to handle that. In other languages, > there is a break for the loop, to go to the end. I can do: > > > > > >(line size < 2) ifTrue: [ f nextLine.]. > > > > > >But that would interfere with the notNil idiom at the end of the file. > So where do I put this. Is there a common way to jump to the end? > > > > > > > > >Sincerely, > > > > > > > > >Joe. > > -- > > Louis LaBrunda > > Keystone Software Corp. > > SkypeMe callto://PhotonDemon > > > > _______________________________________________ > > Beginners mailing list > > [hidden email] > > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > > > > > If you reply to this email, your message will be added to the discussion > below: > > http://forum.world.st/go-to-the-end-of-a-loop-tp4891930p4891939.html > > To start a new topic under Squeak - Beginners, email [hidden email] > > > To unsubscribe from Squeak - Beginners, click here. > > NAML > > > ------------------------------ > View this message in context: Re: go to the end of a loop > > Sent from the Squeak - Beginners mailing list archive > at Nabble.com. > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160425/c70b3ab0/attachment.htm From rebmekop at gmail.com Tue Apr 26 13:21:17 2016 From: rebmekop at gmail.com (=?UTF-8?B?QmFsw6F6cyBLw7NzaQ==?=) Date: Tue Apr 26 13:21:41 2016 Subject: [Newbies] Re: go to the end of a loop In-Reply-To: References: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> <8A97CF94-DBA5-4E97-AF92-E3E846587CC6@gmail.com> Message-ID: Hi Joseph! Here is my take on your problem: categoriesByPayees *:=* Dictionary new. FileStream readOnlyFileNamed: 'payees-by-categories.txt' do: [ :file | " With #readOnlyFileNamed:do: you don't have to worry about closing the file, it ensures that #close is sent to the file, even if you leave the block through an Exception. " [ file atEnd ] whileFalse: [ | parts | parts *:=* (file nextLine findTokens: $| escapedBy: Character tab) collect: #withBlanksCondensed. " We collect the parts #withBlanksCondensed, so we don't have to call it repeatedly in the loop. You can use unary selectors in place of blocks with one argument. You may look at the implementation of Collection >> #collect: and Symbol >> #value: to find out why. I'm not sure what you really want is #findTokens:escapedBy:, it cuts the string along | characters if they are not preceded by a tab." parts size > 1 ifTrue: [ " We skip blank lines or categories without at least one payee. " | category | category *:=* parts first. parts allButFirstDo: [ :payee | (categoriesByPayees at: payee ifAbsentPut: [ OrderedCollection new ]) add: category " Your implementation only remembers the last category encountered for a payee. We can collect all the categories. " ] ] ] ]? Cheers, Bal?zs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160426/a6fe0549/attachment-0001.htm From joseph.alotta at gmail.com Tue Apr 26 15:54:26 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Tue Apr 26 16:28:12 2016 Subject: [Newbies] Re: go to the end of a loop In-Reply-To: References: <956F5E84-894F-4D76-8E09-EA081FB37B09@gmail.com> <8A97CF94-DBA5-4E97-AF92-E3E846587CC6@gmail.com> Message-ID: <3CB512AE-323D-450B-B05A-EF982BDE51B1@gmail.com> thank you. i will studying this. sincerely, Joe. > On Apr 26, 2016, at 7:48 AM, Bal?zs K?si [via Smalltalk] wrote: > > categoriesByPayees := Dictionary new. > FileStream readOnlyFileNamed: 'payees-by-categories.txt' do: [ :file | > " With #readOnlyFileNamed:do: you don't have to worry about closing the file, > it ensures that #close is sent to the file, even if you leave the block through an Exception. " > [ file atEnd ] whileFalse: [ > | parts | > parts := (file nextLine findTokens: $| escapedBy: Character tab) > collect: #withBlanksCondensed. > " We collect the parts #withBlanksCondensed, so we don't have to call it repeatedly in the loop. > You can use unary selectors in place of blocks with one argument. You may look at the implementation > of Collection >> #collect: and Symbol >> #value: to find out why. I'm not sure what you really want is > #findTokens:escapedBy:, it cuts the string along | characters if they are not preceded by a tab." > parts size > 1 ifTrue: [ > " We skip blank lines or categories without at least one payee. " > | category | > category := parts first. > parts allButFirstDo: [ :payee | > (categoriesByPayees > at: payee > ifAbsentPut: [ OrderedCollection new ]) add: category > " Your implementation only remembers the last category encountered for a payee. > We can collect all the categories. " ] ] ] ]? -- View this message in context: http://forum.world.st/go-to-the-end-of-a-loop-tp4891930p4892297.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160426/2f9dcd05/attachment.htm From jecel at merlintec.com Tue Apr 26 21:56:14 2016 From: jecel at merlintec.com (Jecel Assumpcao Jr.) Date: Tue Apr 26 21:56:28 2016 Subject: [Newbies] Re: siliconsqueak? In-Reply-To: References: Message-ID: <20160426215624.0E3425DA7F028@bart0109.email.locaweb.com.br> Dave Crossland asked on Mon, 25 Apr 2016 00:54:15 -0400 > What happened to?siliconsqueak.org? :)? > http://web.archive.org/web/20160213013044/http://siliconsqueak.org/ I supplied most of the content of a previous version of that site (sadly archive.org is not good at saving pages in Pier, a content management system that runs on top of Seaside, which is a web application system that runs on top of Squeak): http://web.archive.org/web/20130524172457/http://www.siliconsqueak.org/ Though this text is rather outdated, it is still the best description of SiliconSqueak so far: http://www.merlintec.com/download/jecel_phd_deposited.pdf The corresponding Prezi presentation is (but don't expect it to be understandable without a narration): > https://prezi.com/yhw-a3i0rnri/adaptive-compilation-for-an-object-oriented-and-reconfigurab/ I think this is a very advanced topic rather than a begginers one. -- Jecel From dave at lab6.com Tue Apr 26 22:03:36 2016 From: dave at lab6.com (Dave Crossland) Date: Tue Apr 26 22:04:18 2016 Subject: [Newbies] Re: siliconsqueak? In-Reply-To: <20160426215624.0E3425DA7F028@bart0109.email.locaweb.com.br> References: <20160426215624.0E3425DA7F028@bart0109.email.locaweb.com.br> Message-ID: On 26 April 2016 at 17:56, Jecel Assumpcao Jr. wrote: > I think this is a very advanced topic rather than a begginers one. > hahaha but beginners may be interested in history :) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160426/c96ae3e5/attachment.htm From jecel at merlintec.com Wed Apr 27 01:11:04 2016 From: jecel at merlintec.com (Jecel Assumpcao Jr.) Date: Wed Apr 27 01:11:17 2016 Subject: [Newbies] Re: siliconsqueak? In-Reply-To: References: <20160426215624.0E3425DA7F028@bart0109.email.locaweb.com.br> Message-ID: <20160427011112.602A8A7D97DD1@bart0181.email.locaweb.com.br> Dave Crossland wrote on Tue, 26 Apr 2016 18:03:36 -0400 > On 26 April 2016 at 17:56, Jecel Assumpcao Jr. wrote: > > > I think this is a very advanced topic rather than a begginers one. > > > hahaha but beginners may be interested in history :) I would be happy to answer any questions about the history of Squeak, Etoys, Smalltalk and related systems. And I have stuff to say about the future as well. My point was that SiliconSqueak, the hardware implementation of the Squeak virtual machine, would be an advanced topic even for the main squeak-dev list and probably would only be of interest to the vm-dev list. Having said that, I gave a presentation about it at the SqueakFest 2009 in Brazil where the audience was mostly non technical teachers. Except for a couple of slides with technical details, the rest of the talk was probably something they could understand. -- Jecel From joseph.alotta at gmail.com Thu Apr 28 22:15:05 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Thu Apr 28 22:15:10 2016 Subject: [Newbies] conceptual design help Message-ID: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> Greetings, I am writing a program to consolidate all my personal finances for tax time next year. (This is not a school project.) There are transaction files from several banks and credit card companies. Each has a similar format, CSV, but they vary in many ways, order of items, extra notes, pipe delimited or tabs, etc. I want to read them and load them into a collection of transaction objects. 1. Should I have a FileReader object? 2. Should it have subclasses like FileReaderAmericanExpress, FileReaderJPMorgan ? 3. Or should it have different methods like loadAmericanExpresFile, loadJPMorganFile ? 4. Is a Collection of Transaction objects, the structure that you would load the files into? The rest of the project would be to do data checking on the files, to make sure there are no duplicates or missing dates. Then write reports that I can give to my accountant. I would appreciate some design help? Sincerely, Joe. From overcomer.man at gmail.com Thu Apr 28 22:42:15 2016 From: overcomer.man at gmail.com (Kirk Fraser) Date: Thu Apr 28 22:42:18 2016 Subject: [Newbies] conceptual design help In-Reply-To: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> References: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> Message-ID: Joe, My suggestion is to use fewer object classes and more methods. Play with it until you know what you are doing, then objects, instance variables, and methods come more naturally without as much need for prior design. You can refactor or reorganize fairly quickly once you master the application and tools available. Sometimes it is necessary to write new versions of an application as you learn more about what you need. Included in this advice is a suggestion to keep working your software over and over in Smalltalk and not abstract it on paper too much which can waste time. A design embedded in software is a lot closer to working than a design on paper (or CRC cards). But occasionally a few notes on paper can help when going from one version to a new one. Kirk On Thu, Apr 28, 2016 at 3:15 PM, Joseph Alotta wrote: > Greetings, > > I am writing a program to consolidate all my personal finances for tax > time next year. (This is not a school project.) > > There are transaction files from several banks and credit card companies. > Each has a similar format, CSV, but they vary in many ways, order of items, > extra notes, pipe delimited or tabs, etc. I want to read them and load > them into a collection of transaction objects. > > 1. Should I have a FileReader object? > > 2. Should it have subclasses like FileReaderAmericanExpress, > FileReaderJPMorgan ? > > 3. Or should it have different methods like loadAmericanExpresFile, > loadJPMorganFile ? > > 4. Is a Collection of Transaction objects, the structure that you would > load the files into? > > The rest of the project would be to do data checking on the files, to make > sure there are no duplicates or missing dates. Then write reports that I > can give to my accountant. > > I would appreciate some design help? > > Sincerely, > > Joe._______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160428/9658e379/attachment-0001.htm From Lou at Keystone-Software.com Thu Apr 28 23:30:34 2016 From: Lou at Keystone-Software.com (Louis LaBrunda) Date: Thu Apr 28 23:30:41 2016 Subject: [Newbies] conceptual design help References: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> Message-ID: Hi Joe, I agree with Kirt's suggestions in general. See more below. On Thu, 28 Apr 2016 17:15:05 -0500, Joseph Alotta wrote: >Greetings, >I am writing a program to consolidate all my personal finances for tax time next year. (This is not a school project.) >There are transaction files from several banks and credit card companies. Each has a similar format, CSV, but they vary in many ways, order of items, extra notes, pipe delimited or tabs, etc. I want to read them and load them into a collection of transaction objects. >1. Should I have a FileReader object? >2. Should it have subclasses like FileReaderAmericanExpress, FileReaderJPMorgan ? No. I would with the object you want to hold the information and work out from there. An object or your main program object should read the files and instantiate the objects (same class) that gets the data. >3. Or should it have different methods like loadAmericanExpresFile, loadJPMorganFile ? Yes. Use different methods to read and parse the files and instantiate the objects. Depending upon how close (similar) the files are you could have a method with a few parameters (three or four at most) that handles more than one file. >4. Is a Collection of Transaction objects, the structure that you would load the files into? Yes. An ordered or sorted collection would be good so you could sort by date/time if that is helpful. >The rest of the project would be to do data checking on the files, to make sure there are no duplicates or missing dates. Then write reports that I can give to my accountant. Sounds good. >I would appreciate some design help? >Sincerely, >Joe. Lou -- Louis LaBrunda Keystone Software Corp. SkypeMe callto://PhotonDemon From ron at usmedrec.com Fri Apr 29 00:11:16 2016 From: ron at usmedrec.com (Ron Teitelbaum) Date: Fri Apr 29 00:11:08 2016 Subject: [Newbies] conceptual design help In-Reply-To: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> References: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> Message-ID: <0abc01d1a1ab$a6269140$f273b3c0$@usmedrec.com> Hi Joe, Depending on how many different structures you have you may want to consider having some external configuration object. My first thought when reading your description was that there are only so many ways to parse, and so many different types of data. Having a collection of parser objects that handle specific translations seems clean. Once you have an idea of what types of translations you need you could trigger those operations by building your collection of parser objects from an external config file. In that way you read the parameters in (could be a file in the JPMorgan directory) conf.xml or parse.conf something like that, and then use that to set up your parser. The parser is then written to be generic and reusable. It would allow you to write methods once and then reuse them for files you haven't seen yet by creating a new config file for your format. You could even have a config file generator that asks you questions and shows you the results from a current sample data file. :) fieldSeperator: #comma. fieldDelimited: #doubleQuote. nameSeperator: #comma. nameFormat: 'title, first, [mi], last, [suffix]'. balance: #USD. fieldOrder: 'id, name, balance'. ... One other thought is if there is a way for the system to determine what format to use (this is a JPMorgan file) then instead of an external config file you could just store the different configs internally and match for the right config collection and error if one doesn't exist (asking the user to create one using your config builder method). if you can't match then having a file in a JPMorgan directory seems simple enough. In general thinking of the setup step as a collection of generic parser configuration objects instead of a different parsing method for each file, simplifies everything. Of course back to my original point, writing 3 parser methods will go faster if there are not that many formats. There is always a trade off when you consider building a framework or just hacking some code that works :). All the best, Ron Teitelbaum > From: Joseph Alotta > Sent: Thursday, April 28, 2016 6:15 PM > > Greetings, > > I am writing a program to consolidate all my personal finances for tax time > next year. (This is not a school project.) > > There are transaction files from several banks and credit card companies. > Each has a similar format, CSV, but they vary in many ways, order of items, > extra notes, pipe delimited or tabs, etc. I want to read them and load them > into a collection of transaction objects. > > 1. Should I have a FileReader object? > > 2. Should it have subclasses like FileReaderAmericanExpress, > FileReaderJPMorgan ? > > 3. Or should it have different methods like loadAmericanExpresFile, > loadJPMorganFile ? > > 4. Is a Collection of Transaction objects, the structure that you would load > the files into? > > The rest of the project would be to do data checking on the files, to make > sure there are no duplicates or missing dates. Then write reports that I can > give to my accountant. > > I would appreciate some design help? > > Sincerely, > > Joe._______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners From joseph.alotta at gmail.com Fri Apr 29 14:28:12 2016 From: joseph.alotta at gmail.com (Joseph Alotta) Date: Fri Apr 29 15:02:34 2016 Subject: [Newbies] Re: conceptual design help In-Reply-To: <0abc01d1a1ab$a6269140$f273b3c0$@usmedrec.com> References: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> <0abc01d1a1ab$a6269140$f273b3c0$@usmedrec.com> Message-ID: Thanks for all the help. I like the idea of having the code sense the format of the data and acting accordingly. For separators, I could count the number of each kind of separators in the file and compare it to the number of lines. Say 3 or more separators per line. Then I can parse by columns and look for the dominant data type. For a column that is 60% matching a date type, I can assume it is a date column and the mismatches are headers. The amount should be numeric. The payee should be mostly letters, etc. One issue I have is knowing what to call the object that does this. It would not be a Transaction, because this is a function of many Transactions. FileLoader? FileAnalyzer? Also, at this point I should be looking for missing dates and duplicates. Duplicates are troublesome, since everytime I download the file, it starts from the beginning of the year again. I keep downloading them because I think they will only keep data for 6 months or so. Also duplicate transactions are valid. Suppose I go into a coffee shop and buy a cup of coffee, then go back the same day, same store for a refill. Your thoughts? Sincerely, Joe. -- View this message in context: http://forum.world.st/conceptual-design-help-tp4892763p4892966.html Sent from the Squeak - Beginners mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160429/e6941512/attachment.htm From offray at riseup.net Fri Apr 29 15:59:53 2016 From: offray at riseup.net (=?UTF-8?Q?Offray_Vladimir_Luna_C=c3=a1rdenas?=) Date: Fri Apr 29 16:00:32 2016 Subject: [Newbies] Re: conceptual design help In-Reply-To: References: <3A535698-3A42-48D4-A7F2-3DAF7E29F7C3@gmail.com> <0abc01d1a1ab$a6269140$f273b3c0$@usmedrec.com> Message-ID: <572384F9.8070004@riseup.net> Hi Joseph, I'm making some data visualizations and despite of not having an advice on conceptual design, I share part of the practical problem of having to work with CSV values in a Smalltalk environment and some times with a lot of records (my recent project works with 270k of them). The visualization I did was documented broadly at [1], but essentially I create a "PublishedMedInfo class >> loadDataFromCSV: aFile usingDelimiter: aCharacter" method that fill out my domain objects that came from an excel (and then CSV) file. [1] http://mutabit.com/offray/blog/en/entry/sdv-infomed For my recent project [2] I'm using a SQLite bridge between Pharo and the imported data from CVS. In that way I'm delegating storage and querying (including duplicates) to a small but potent database back-end, while using objects to model "higher" concerns of my domain. I know some worries about objects-database mismatch impedance, but working with data and its visualization/reporting lets you to build bridges leveraging the former to the database and the last to objects, while using the strengths of each one in their own place. [2] https://twitter.com/offrayLC/status/725314838696701957 So my practical advice is to explore this kinds of combination early in your design. May be a quick hands on mockup could let you know if it works for you. In my case it has and I'm implementing it sooner in my projects. Cheers, Offray Ps: Long time without writing, but I have been reading constantly. Nice to be "back" :-) On 29/04/16 09:28, Joseph Alotta wrote: > Thanks for all the help. > > I like the idea of having the code sense the format of the data and > acting accordingly. > > For separators, I could count the number of each kind of separators in > the file and compare it to the number of lines. Say 3 or more > separators per line. > > Then I can parse by columns and look for the dominant data type. For > a column that is 60% matching a date type, I can assume it is a date > column and the mismatches are headers. > > The amount should be numeric. > > The payee should be mostly letters, etc. > > One issue I have is knowing what to call the object that does this. > It would not be a Transaction, because this is a function of many > Transactions. > > FileLoader? FileAnalyzer? > > Also, at this point I should be looking for missing dates and duplicates. > > Duplicates are troublesome, since everytime I download the file, it > starts from the beginning of the year again. I keep downloading them > because I think they will only keep data for 6 months or so. > > Also duplicate transactions are valid. Suppose I go into a coffee > shop and buy a cup of coffee, then go back the same day, same store > for a refill. > > Your thoughts? > > Sincerely, > > Joe. > > > > ------------------------------------------------------------------------ > View this message in context: Re: conceptual design help > > Sent from the Squeak - Beginners mailing list archive > at Nabble.com. > > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20160429/d3a94956/attachment.htm