Re: [Newbies] collection enumeration
2006/8/23, stéphane ducasse [EMAIL PROTECTED]: but is a not the fastest one? because you nearly only call primitives? I did not check. Cedric did you benchmark a and c. even if large dictionaries degenerate in Squeak. not yet but I will when some spare time ;) Though it probably depends on the kind of collection used... to benchmark, you'll use Time milisecondsToRun: [...] this is what I do ... but I don't know if there are other options... anyway, I'm not realy concerned by performance issue ;) but I like to know ;) ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] collection enumeration
On 24.08.2006, at 13:58, cdrick wrote: to benchmark, you'll use Time milisecondsToRun: [...] this is what I do ... but I don't know if there are other options... There is #bench: [100 factorial] bench -- '7888.82223555289 per second.' smime.p7s Description: S/MIME cryptographic signature ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] collection enumeration
cdrick a écrit : This can be fast if collection is an array and if you say 1 to: collection do: [:index | ... instead of creating an interval. The compiler cheats for to:do: on a SmallInteger and doesn't create the block. But I would only use this if the profiler showed it was a real improvement. Almost always I would use option C. same here or the method Bert has given.. #withIndexDo: It's strange that we have #withIndexDo: and #keysAndValuesDo: doing the same things on SequenceableCollection. For me #keysAndValuesDo: take more sense in a dictionary. (?) Math ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] Making cultural simulations in Squeak with Kedama
I tried using first the SqueakAtenex.image from the Extremadura project, because it's what my students and me used the last semester, but remaking the Epidemic example I found that there is a problem with the Kedama menu translation of Kedama in that image. In the english version you can see four options in the viewer of the Kedama Turtle: kedama turtle, scripts, kedama turtle breed and kedama turtle color. In the Atenex image you can see four also in that viewer, but one of them is repeated (kedama turtle) and kedama turtle breed is absent. It seems that kedama turtle breed was translated as tortuga kedama (kedama turtle), so adding a turtle is possible, but not increasing the amount of turtles in a breed (at lest not as is explained in the documentation). I think the Kedama in SqueakLand Squeak has been updated from the one in the Extramadura version, So I tried then the Squeak3.8-6665full.image but Kedama is not available from the object catalog. Trying to update from server says that no updates are available from server and using the Squeak Map I can`t find Kedama either. ¿How can I find/install the Kedama if its not available in the object catalog of an image? Kedama is, as much as I know, not available for 3.8. (maybe there is an old version somewhere). Then I tried Squeak3.9g-7054.image and Squeak3.9b-7051.image installed from squeakland directly (without using any deb repository for Ubuntu) and Kedama is there and I can reproduce the Epidemic simulation example, but anytime I tried to open a *.pr project I get some error messages about MessageNotUnderstood: SmallIntegerremoveKey:ifAbsent: and other one about fonts. I can made the pr files run (after getting a lot of that messages with the Abandon window), but some of them can't run in with the go button for example (I need to locate the proper scripts and make them ticking). In 3.9, we put some effort into merging all changes from squeakland and extramadura into the standard Squeak release. Sadly 3.9 brakes backwards compatibility for project loading (.pr files)... this is unfortunate, and I don't know if this will ever get fixed. A problem is a bit that both the squeakland and extramadura people did not join the 3.9 effort in any way, so all the eToy things are very likely not much tested. Marcus smime.p7s Description: S/MIME cryptographic signature ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
RE: [Newbies] HTTPSocket class - getting to the instance
Hi Andy, Take a look at the method: HTTPSocket class httpGetDocument: url args: args accept: mimeType request: requestString Go about half way down after it has parsed the URL. Start at: HTTPSocket new. You too can get an instance of HTTPSocket but issuing new. Hope that helps! Happy coding. Ron Teitelbaum From: [EMAIL PROTECTED] Sent: Thursday, August 24, 2006 11:59 AM First, Smalltalk is just amazing! I am so impressed with what it is possible to do - with practically no knowledge! Second. Due to my lack of knowledge I am now stuck ;-) I am still working on the problem of building a Smalltalk version of Wget. I have used the HTTPClient as my basic object and that is doing most of what I want. However, I can't get to the HTTP Headers. I noticed that HTTPSocket does seem to offer the headers but this is where I get stuck. The creation methods of HTTPSocket (i.e. telling it which url to go to) seem to only exist on the class side. But the methods for getting to headers etc only exist in the instance. I can't work out how to create an instance of the socket and tell it which url to go to. All the construction methods just seem to return the class. Obviously I am missing something pretty basic. Could someone please enlighten me? TVM AB ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Re: [Newbies] HTTPSocket class - getting to the instance
The ugly details are found in HttpSocket's class side method;httpGetDocument: url args: args accept: mimeType request: requestStringIts a little ugly - an HttpRequest class should bundle up a lot of that complexity in a nice data structure that represents the structure of a request.But there it is.On Aug 24, 2006, at 8:58 AM, [EMAIL PROTECTED] wrote:First, Smalltalk is just amazing! I am so impressed with what it is possible to do - with practically no knowledge! Second. Due to my lack of knowledge I am now stuck ;-) I am still working on the problem of building a Smalltalk version of Wget. I have used the HTTPClient as my basic object and that is doing most of what I want. However, I can't get to the HTTP Headers. I noticed that HTTPSocket does seem to offer the headers but this is where I get stuck. The creation methods of HTTPSocket (i.e. telling it which url to go to) seem to only exist on the class side. But the methods for getting to headers etc only exist in the instance. I can't work out how to create an instance of the socket and tell it which url to go to. All the construction methods just seem to return the class. Obviously I am missing something pretty basic. Could someone please enlighten me? TVM AB___Beginners mailing listBeginners@lists.squeakfoundation.orghttp://lists.squeakfoundation.org/mailman/listinfo/beginners ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
AW: [Newbies] Making cultural simulations in Squeak with Kedama
Hallo Offray! I can send you an image which contains kedama and odeco. I didn't know where I've found this. The version of squeak is 3.6. If it is interesting for you give me please a ftp-adress where I can uploade. If your eMail can recieve more the 10 MB I could send you the image directly. Please give me a fast response because my holiday begins in 5 hours an then I haven't access to my computer. Cheers Frank -Original Message- From: [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 17:53:23 To:beginners@lists.squeakfoundation.org Subject: [Newbies] Making cultural simulations in Squeak with Kedama Hi all :) . I have sended this message more that 10 days ago and I have no answer from the Squeakland mailing list. I'm trying to use Squeak/Kedama for my thesis but the time of response in the list makes me wonder if this in the right choice considering the few time I have for it and the fact that I'm still a beginner with Squeak. So I send the message again to this list, hoping for the answer. I hope that this will be the right place (you will see also some other previous discussion, about the subject, so you can get the context). - I'm having problems with Kedama inside Squeak. I don't know if this is the proper place to put this concerns but the issue was discuss in this thread, so I thought that it was (please if this is not the place point me in the right direction) I tried using first the SqueakAtenex.image from the Extremadura project, because it's what my students and me used the last semester, but remaking the Epidemic example I found that there is a problem with the Kedama menu translation of Kedama in that image. In the english version you can see four options in the viewer of the Kedama Turtle: kedama turtle, scripts, kedama turtle breed and kedama turtle color. In the Atenex image you can see four also in that viewer, but one of them is repeated (kedama turtle) and kedama turtle breed is absent. It seems that kedama turtle breed was translated as tortuga kedama (kedama turtle), so adding a turtle is possible, but not increasing the amount of turtles in a breed (at lest not as is explained in the documentation). So I tried then the Squeak3.8-6665full.image but Kedama is not available from the object catalog. Trying to update from server says that no updates are available from server and using the Squeak Map I can`t find Kedama either. ¿How can I find/install the Kedama if its not available in the object catalog of an image? Then I tried Squeak3.9g-7054.image and Squeak3.9b-7051.image installed from squeakland directly (without using any deb repository for Ubuntu) and Kedama is there and I can reproduce the Epidemic simulation example, but anytime I tried to open a *.pr project I get some error messages about MessageNotUnderstood: SmallIntegerremoveKey:ifAbsent: and other one about fonts. I can made the pr files run (after getting a lot of that messages with the Abandon window), but some of them can't run in with the go button for example (I need to locate the proper scripts and make them ticking). ¿There is a image and changes file with Kedama working out of the box, or there is another way to overcome the problems I show you? I'm obsessed and passionated with Kedama and multiagents systems. My master thesis is on collective problem solving and I think that Kedama/Squeak is the way to go not only in my classroom with the students as I showed in the SqueakFest, but also in my thesis, so if you can help me with quick answers, I will be a lot thankful, Cheers from Colombia, Offray Yoshiki Ohshima escribió: Offray, ¿Do you think is feasible to implement the same model in Kedama? If yes, My feeling is, yes, it looks feasible. ¿Where is the best way to start implementing it? You can drop a Sketch onto a KedamaWorld to fill the world with turtles. Then, you create 5 patch variables each of which represents a trait in your example. You add properties that is called something like origX and origY, and write scripts to save and restore the turtles' positions into these. To cache the traits value, turtles should have 5 properties to save the values in the patch variables as well (See the example of ForestFire on the web.) To initialize the patch variables, the ForestFire example should be helpful. It initializes the map of forest with 1 or 0 value. In this example, the initial values are in the range of 0 to 9 (or 1-10), but can be done in a similar manner. At each step, the turtles first cache the values in patch variables to the own properties. Then, they move around and compare the values in the cache with the values in neighboring patch variables, and modify the cached values. At last, they return to the original position, and write back the cached values into the patch variables. The modification made to the cached values is the core of the program, and it may require some amount of
Re: AW: [Newbies] Making cultural simulations in Squeak with Kedama
Hi Frank, Thanks for your quick answer. You can send me the image to this gmail address of a friend: [EMAIL PROTECTED] I will probe the simulations on this version and I will post my progress/problems in this list. Thanks a lot, Offray Frank Urbach escribió: Hallo Offray! I can send you an image which contains kedama and odeco. I didn't know where I've found this. The version of squeak is 3.6. If it is interesting for you give me please a ftp-adress where I can uploade. If your eMail can recieve more the 10 MB I could send you the image directly. Please give me a fast response because my holiday begins in 5 hours an then I haven't access to my computer. Cheers Frank -Original Message- From: [EMAIL PROTECTED] Date: Thu, 24 Aug 2006 17:53:23 To:beginners@lists.squeakfoundation.org Subject: [Newbies] Making cultural simulations in Squeak with Kedama Hi all :) . I have sended this message more that 10 days ago and I have no answer from the Squeakland mailing list. I'm trying to use Squeak/Kedama for my thesis but the time of response in the list makes me wonder if this in the right choice considering the few time I have for it and the fact that I'm still a beginner with Squeak. So I send the message again to this list, hoping for the answer. I hope that this will be the right place (you will see also some other previous discussion, about the subject, so you can get the context). - I'm having problems with Kedama inside Squeak. I don't know if this is the proper place to put this concerns but the issue was discuss in this thread, so I thought that it was (please if this is not the place point me in the right direction) I tried using first the SqueakAtenex.image from the Extremadura project, because it's what my students and me used the last semester, but remaking the Epidemic example I found that there is a problem with the Kedama menu translation of Kedama in that image. In the english version you can see four options in the viewer of the Kedama Turtle: kedama turtle, scripts, kedama turtle breed and kedama turtle color. In the Atenex image you can see four also in that viewer, but one of them is repeated (kedama turtle) and kedama turtle breed is absent. It seems that kedama turtle breed was translated as tortuga kedama (kedama turtle), so adding a turtle is possible, but not increasing the amount of turtles in a breed (at lest not as is explained in the documentation). So I tried then the Squeak3.8-6665full.image but Kedama is not available from the object catalog. Trying to update from server says that no updates are available from server and using the Squeak Map I can`t find Kedama either. ¿How can I find/install the Kedama if its not available in the object catalog of an image? Then I tried Squeak3.9g-7054.image and Squeak3.9b-7051.image installed from squeakland directly (without using any deb repository for Ubuntu) and Kedama is there and I can reproduce the Epidemic simulation example, but anytime I tried to open a *.pr project I get some error messages about MessageNotUnderstood: SmallIntegerremoveKey:ifAbsent: and other one about fonts. I can made the pr files run (after getting a lot of that messages with the Abandon window), but some of them can't run in with the go button for example (I need to locate the proper scripts and make them ticking). ¿There is a image and changes file with Kedama working out of the box, or there is another way to overcome the problems I show you? I'm obsessed and passionated with Kedama and multiagents systems. My master thesis is on collective problem solving and I think that Kedama/Squeak is the way to go not only in my classroom with the students as I showed in the SqueakFest, but also in my thesis, so if you can help me with quick answers, I will be a lot thankful, Cheers from Colombia, Offray Yoshiki Ohshima escribió: Offray, ¿Do you think is feasible to implement the same model in Kedama? If yes, My feeling is, yes, it looks feasible. ¿Where is the best way to start implementing it? You can drop a Sketch onto a KedamaWorld to fill the world with turtles. Then, you create 5 patch variables each of which represents a trait in your example. You add properties that is called something like origX and origY, and write scripts to save and restore the turtles' positions into these. To cache the traits value, turtles should have 5 properties to save the values in the patch variables as well (See the example of ForestFire on the web.) To initialize the patch variables, the ForestFire example should be helpful. It initializes the map of forest with 1 or 0 value. In this example, the initial values are in the range of 0 to 9 (or 1-10), but can be done in a similar manner. At each step, the turtles first cache the values in patch variables to the own properties. Then, they move around and compare the values in the cache with the values in
Re: [Newbies] diffing running images between machines?
That's great! I will be doing that instead. Thanks for that pointer. -bakki On 8/24/06, cdrick [EMAIL PROTECTED] wrote: Hi 2006/8/24, Bakki Kudva [EMAIL PROTECTED]: Hi, I have been developing on 3 machines and I shuttle the images back and forth as follows. I do that too but I try to avoid it ... Even if it's handy, rather than using the same image everywhere, it's better to publish your code in monticello package for instance. Monticello is nice for that because it allows to assemble in packages your code (new classes and extension in existing ones provided they are in a category prefixed by *name-. name here is the name of your monticello package). Once you have monticello packages (*.mcz) for your projects and extensions, you can publish them on the net on squeaksource (or on your own server if you have one) Hope that helps 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