Hi
I was wandering if there is an existing way to have in an image workspaces opened from existing text files...
what is usually do in my image is having several renamed worspace with code snippets, tests, and others differents stuffs...
I'd like to automate the save on a file and the reading from it when opening...
say I decide to use a previous image... but the workspace elements are updated to the last ones...
is there a way to do that ? (hope you see what I mean ;))
Thanks
Cédrick
maybe I need to precise what I'd like
I'd like to open a workspace or another "text editor" from a file... like open a workspace on the content of a file... in file list...
but after command+s on the browser save in the file (actually, I don't see what this command is doing in the usual workspace)... and opening the image with a worspace on file load the last saved file (and eventually changes on it) but not a previous one...
does it seem possible and/or useful to you ?
Thanks
Cédrick
It is possible but I have an alternative suggestion: put the code that is now in the workspace in methods and test cases, kept on classes. Then you can use file-outs or Monticello packages to have them versioned with the rest of your code. More in detail:
The only reason for which I use workspaces is for snippets of code that I need for a couple of hours. Anything which extends that period of time I turn into methods, so that they get saved with the rest of my code. It frequently happens that these methods turn into 'class methods' in a protocol 'examples' (PS: I fo not know how much of a newbie you are -- don't hesitate to tell me that I'm talking chinese here!).
For the methods that you use to test things, turn them into unit tests. Testing is a very good ractice (I am glad you do already). By turning the pieces of code into unit tests you (1) will be able to run them all by themself instead of selecting and executing them manually one by one, and (2) you can again save them with the rest of your code. So, if you have some code like the following in your workspace:
"Test whether + does what I think it does" 3 + 4 "should give 7"
You can: - create a class 'PlusTest', subclass of TestCase. - in class PlusTest, create a protocol called 'testing'. - convert your workspace test in a unit test by putting it in a method whose name starts with 'test' testAddition self assert: (3 + 4 = 7). - open the TestRunner tool - find your class in the list and you can execute your tests.
On 18 May 2006, at 12:43, cdrick wrote:
maybe I need to precise what I'd like
I'd like to open a workspace or another "text editor" from a file... like open a workspace on the content of a file... in file list...
but after command+s on the browser save in the file (actually, I don't see what this command is doing in the usual workspace)... and opening the image with a worspace on file load the last saved file (and eventually changes on it) but not a previous one...
does it seem possible and/or useful to you ?
Thanks
Cédrick _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Hi Cédrick,
I have seen and used a number of Persistent Workspaces see: http://www.google.com/search?hl=en&lr=&safe=off&q=smalltalk+%22p... rkspace%22
I didnt install it but, if this is the VW workpsace, I believe it is good: http://www.totallyobjects.com/vwfree.htm
But like Roels answer I have not found them to be very valuable. I know some people that love them but mostly everyone keeps some kind of scratch class to play in that includes class side methods for saving code. Once you get used to Monticello or some other form of code repository changing and saving code in classes is just as easy. I really like the idea of making the scratch class a test class, it's a good suggestion from Roel.
Also I use a Microsoft product (I know I know, but this one is a nice program) called OneNote. It's a really nice way to organize a bunch of stuff, grab snippets off a web page, organize items, and share them with others. It even takes screen shots in a really nice way. I'd been looking for a way to consolidate research and organize ideas. I tried a bunch of products but this one really made sense and now I'd be lost without it. Also I have to admit I have some Smalltalk code snippets in there too!
http://office.microsoft.com/en-us/FX010858031033.aspx
I hope that helps!
Happy Coding,
Ron Teitelbaum President / Principal Software Engineer US Medical Record Specialists Ron@USMedRec.com
-----Original Message----- From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- bounces@lists.squeakfoundation.org] On Behalf Of Roel Wuyts Sent: Thursday, May 18, 2006 7:41 AM To: A friendly place to get answers to even the most basic questions aboutSqueak. Subject: Re: [Newbies] Re: workspace on:file
It is possible but I have an alternative suggestion: put the code that is now in the workspace in methods and test cases, kept on classes. Then you can use file-outs or Monticello packages to have them versioned with the rest of your code. More in detail:
The only reason for which I use workspaces is for snippets of code that I need for a couple of hours. Anything which extends that period of time I turn into methods, so that they get saved with the rest of my code. It frequently happens that these methods turn into 'class methods' in a protocol 'examples' (PS: I fo not know how much of a newbie you are -- don't hesitate to tell me that I'm talking chinese here!).
For the methods that you use to test things, turn them into unit tests. Testing is a very good ractice (I am glad you do already). By turning the pieces of code into unit tests you (1) will be able to run them all by themself instead of selecting and executing them manually one by one, and (2) you can again save them with the rest of your code. So, if you have some code like the following in your workspace:
"Test whether + does what I think it does" 3 + 4 "should give 7"
You can:
- create a class 'PlusTest', subclass of TestCase.
- in class PlusTest, create a protocol called 'testing'.
- convert your workspace test in a unit test by putting it in a
method whose name starts with 'test' testAddition self assert: (3 + 4 = 7).
- open the TestRunner tool
- find your class in the list and you can execute your tests.
On 18 May 2006, at 12:43, cdrick wrote:
maybe I need to precise what I'd like
I'd like to open a workspace or another "text editor" from a file... like open a workspace on the content of a file... in file list...
but after command+s on the browser save in the file (actually, I don't see what this command is doing in the usual workspace)... and opening the image with a worspace on file load the last saved file (and eventually changes on it) but not a previous one...
does it seem possible and/or useful to you ?
Thanks
Cédrick _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Hi Ron and thanks too ;)
I didn't install it but, if this is the VW workpsace, I believe it is good: http://www.totallyobjects.com/vwfree.htm
looks interesting.. :) but I need to port it to squeak...and the morph system... don't know if this is complicated I think I'll have a look at FileList2 and try to open a directory with my text files stored in a directory with the image...
But like Roel's answer I have not found them to be very valuable. I know
some people that love them but mostly everyone keeps some kind of scratch class to play in that includes class side methods for saving code. Once you get used to Monticello or some other form of code repository changing and saving code in classes is just as easy. I really like the idea of making the scratch class a test class, it's a good suggestion from Roel.
I will try to do that...
Also I use a Microsoft product (I know I know, but this one is a nice
I use Linux here ... :s
_______________________________________________
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
I have something that do what I need (inspired by the snapshot you posted Ron)
I modified a FileList2 so as to open a directory called workspaces or whatever else in my image directory...
this fileList is only displaying a file list on the left and content on the right...
pressing alt+s save in the file :)
so I think I ll use that to keep a track of all my comments and code snippets ;)
Yet, I need to adapt it a bit more to fullfill my needs (add it in the open menu, creation of the directory when not existing...) ;)
Thanks for your advices ;)
Cédrick
Hi Roel ;)
Anything which extends that period
of time I turn into methods, so that they get saved with the rest of my code. It frequently happens that these methods turn into 'class methods' in a protocol 'examples' (PS: I fo not know how much of a newbie you are -- don't hesitate to tell me that I'm talking chinese here!).
I think I'm newbie level 2 or 3 lol I 'm ok with most of concepts and the squeak environement but I still need practise...and in general Im a newbie in programming...but anyway, you didn't talk chinese here ;)
For the methods that you use to test things, turn them into unit
tests. Testing is a very good ractice (I am glad you do already).
actually, I put two kind of stuff in workspace, tests of functionnlaities I try to obtain... and also documentation on thinks I discover ... like for instance, I need to manipulate XML file, so I have a worspace for my XML experiments... same for connecting a postgres database... etc etc ... It's more a reminder of what I did and what were the results... It could be done in an external text file but I find it handly to direclty write in workspace (except when I need to use a previous image...)
By
turning the pieces of code into unit tests you (1) will be able to run them all by themself instead of selecting and executing them manually one by one, and (2) you can again save them with the rest of your code. So, if you have some code like the following in your workspace:
"Test whether + does what I think it does" 3 + 4 "should give 7"
You can:
- create a class 'PlusTest', subclass of TestCase.
- in class PlusTest, create a protocol called 'testing'.
- convert your workspace test in a unit test by putting it in a
method whose name starts with 'test' testAddition self assert: (3 + 4 = 7).
- open the TestRunner tool
- find your class in the list and you can execute your tests.
Thanks for this tip thats true that I can make tests with some code tries... I thought unit test had to be associated with a given application but I can also do tests for my experiments ...
Thanks Roel ;)
[snipped some things]
actually, I put two kind of stuff in workspace, tests of functionnlaities I try to obtain... and also documentation on thinks I discover ... like for instance, I need to manipulate XML file, so I have a worspace for my XML experiments... same for connecting a postgres database... etc etc ... It's more a reminder of what I did and what were the results... It could be done in an external text file but I find it handly to direclty write in workspace (except when I need to use a previous image...)
For these I create separate classes. For one, it means that your code stays inside your development environment: from time to time, when I do senders of a method, it turns out I already used the method I'd like to find information on. Code in workspaces, and even worse, in external text file do not do this for me. Matter of opinion, I guess.
Thanks for this tip thats true that I can make tests with some code tries... I thought unit test had to be associated with a given application but I can also do tests for my experiments ...
indeed.
BTW: Which cdrik are you ? Since you give the impression that you know me...
For these I create separate classes. For one, it means that your code stays inside your development environment: from time to time, when I do senders of a method, it turns out I already used the method I'd like to find information on.
very cool :) I'll use that too (for senders :) ) ... so for monticello, I create some classes that store methods with useful code snippets... I ll rememeber ;)
That is (was) a problem for me too. How do I recover some code (more hacking) I made to adapt some tools (browser, buttons, menus) ?... not that it is important but it'is interesting to recover to see what I did with... Now I place methods I add (or change) in a category where the name is prefixed by *.... so as I can save it with Monticello without wasting the original.
Code in workspaces, and even worse, in
external text file do not do this for me. Matter of opinion, I guess.
It's not really code but more commented texts (notes) on different topics, a kind of personnal help (how-to)
I think it'll help me... ;)
I think I found a good compromise... I tweaked a bit the FileList2 to open a directory called workspaces where I store my text files I want to keep. Only two panes with files list in this directory (left) and content (right)... texts can still be excuted and alt+s saves the file :).
actually I find this little tool very useful after using it a bit... I really like the fact we can acces all and change to adapt ! just by rewriting 5 methods I have the tool I needed (to take notes while using squeak) :)
thanks squeak and thanks all for sharing your good practises ;)
BTW: Which cdrik are you ? Since you give the impression that you know me...
I was at Bruxells (student volonteer) so I know you a bit and I saw you in Paris too (Smalltalk party) :)
see you cédrick
I think I found a good compromise... I tweaked a bit the FileList2 to open a directory called workspaces where I store my text files I want to keep. Only two panes with files list in this directory (left) and content (right)... texts can still be excuted and alt+s saves the file :).
I'm pretty happy with this text file reader except that I have an encoding problem... with carriage return If I modify the text file on linux or windows (with an external editor), when I open them with squeak, all cariage returns are replaced by a square... I suppose it's an encoding problem... but I don't know where and how to solve that... so that I can edit this files directly with a text editor in linux (and windows and others) in a way that remain compatible inside squeak...
do you have an idea on where I have to pay attention to the encoding ?
Thanks
Cédrick
beginners@lists.squeakfoundation.org