[Newbies] Re: '1921' romanNumber

2016-05-13 Thread nicolas cellier
Ron Teitelbaum usmedrec.com> writes: > > Hi Joe! > > Try this: > > 'MCMXXI' romanNumber > > I would think that 1921 asRomanNumerals (or asRomanNumber) would be a cool method to write! > > I checked but don't see one :). > > Ron > 1921 printStringRoman. It's not referenced in

[Newbies] Re: How to doubble sort a collection

2015-02-13 Thread nicolas cellier
Raymond Asselin jgr.asselin at me.com writes: Thank to everybody because I learned a lot here If you're in a recent Squeak, then you can also write: ^notes sorted: #date descending , #temps descending ___ Beginners mailing list

[Newbies] Re: How to round a float?

2015-02-13 Thread nicolas cellier
Louis LaBrunda Lou at Keystone-Software.com writes: Hi Guys, On Wed, 4 Feb 2015 08:22:02 -0500, Johann Hibschman johannh at gmail.com wrote: That just looks like floating-point representation. It's as rounded as it can get! -Johann At first I thought some more parans ( were needed

[Newbies] Re: Testing = and == in workspace

2012-01-07 Thread nicolas cellier
Ben Coman btc at openInWorld.com writes: Thanks Bert. Doing that is insightful.  Interestingly the result is different with numbers.  Where strings assigned in separate executions are not identical, numbers assigned in separate executions are identical - at lower values.  For example,

[Newbies] Re: [] whileTrue: [] implementation

2011-10-05 Thread nicolas cellier
Bert Freudenberg bert at freudenbergs.de writes: On 05.10.2011, at 00:24, nicolas cellier wrote: snip... gmane is a tyrant Yes, but log(n) is still not good enough for loops that run forever. Like the Morphic main loop. Or the idle process. I don't think it's possible to emulate

[Newbies] Re: [] whileTrue: [] implementation

2011-10-04 Thread nicolas cellier
Bert Freudenberg bert at freudenbergs.de writes: On 04.10.2011, at 19:16, Erlis Vidal wrote: Thanks Bert! The byte code has the answer, I thought that the byte code will map the source code but I see that's not the case, probably to ensure some optimizations.. or to do that jump I

[Newbies] Re: Aw: Re: Float-Subclasses?

2011-07-01 Thread nicolas cellier
bblochl at arcor.de writes: That was the mail where the Smalltalk brand came in, the name of I do not want to repeat. Would have been better to bring in the Draft American National Standard for Information Systems - Programming Languages - Smalltalk? Thank you for all the many sympathic

[Newbies] Re: Float-Subclasses?

2011-06-30 Thread nicolas cellier
bb bblochl at arcor.de writes: Am 30.06.2011 11:53, schrieb Randal L. Schwartz: bb == bb bblochl at arcor.de writes: bb

[Newbies] Re: Float-Subclasses?

2011-06-30 Thread nicolas cellier
Ralph Johnson johnson at cs.uiuc.edu writes: On Wed, Jun 29, 2011 at 8:34 AM, bb bblochl at arcor.de wrote: I found that there are some Float-Subclasses: FloatD FloatE FloatQ How can I use them and what are they good for? I do not understand the use of LargeZeroInteger as well.

[Newbies] Re: asInteger bug?

2011-06-27 Thread nicolas cellier
bb bblochl at arcor.de writes: There I found a problem with asInteger: According to the x3j20 ansi standard FloatasInteger and DoubleasInteger should be equivalent to sending rounded. You can download the final draft revision for free:

[Newbies] Re: Character #asciiValue vs #charCode

2011-01-08 Thread nicolas cellier
Sean P. DeNigris sean at clipperadams.com writes: #asciiValue - could there be an ascii character with a leadingChar, or will this always be 0 for non-eastern characters? Should there be any error checking - what is the meaning of ascii value for a non-ascii char? I would simply let

[Newbies] Re: Character #asciiValue vs #charCode

2011-01-07 Thread nicolas cellier
Sean P. DeNigris sean at clipperadams.com writes: For Character, what is the difference between #asciiValue and #charCode (= #asciiValue bitAnd: 16r3F)? Thanks. Sean #asciiValue suggests the character is encoded in ASCII. But hey, it's not general ! What is the ASCII code of é ? It

[Newbies] Re: Intervalgt;gt;copyFrom:to:

2010-12-13 Thread Nicolas Cellier
Bert Freudenberg bert at freudenbergs.de writes: It would only be more efficient if it ever got used. Can't imagine a case where this would be useful. It would add complexity to the implementation though. - Bert - Speaking of complexity, beware if you ever mess with intervals of

[Newbies] Re: Translation from old basic program

2010-07-05 Thread nicolas cellier
kirand kirandev at ukr.net writes: nicolas cellier nicolas.cellier.aka.nice at gmail.com сообщил/сообщила в новостях следующее: news:loom.20100704T192902-992 at post.gmane.org... First attempt: draw directly on Display Maybe I choose wrong method (drawFrom:to

[Newbies] Re: Translation from old basic program

2010-07-04 Thread nicolas cellier
kirand kirandev at ukr.net writes: Hi! Is anybody remember basic? I am a beginner and cant understand how to make this program in Smalltalk. I found it in old magazine from 80-th years :) So, this is the program. It makes interest graphics. 10 INPUT Enter a number; N 20 DIM X(N),

[Newbies] Re: Installing Rio on Win32

2009-05-10 Thread nicolas cellier
Keith Hodges keith_hodges at yahoo.co.uk writes: Ok To find things in Universes, tip number 1. Dont bother with Universes! I got so fed up with it I re-wrote the whole thing as Sake/Packages. To install Sake/Packages: Installer upgrade install: 'Packages'. Hi Keith, While it is cool

[Newbies] Re: Installing Rio on Win32

2009-05-10 Thread nicolas cellier
Keith Hodges keith_hodges at yahoo.co.uk writes: Installer squeaksource project: 'Installer'; install: 'Installer-Core'. Installer upgrade. Keith Ah thanks, i went thru HTTPSocket httpFileIn: 'ftp.squeak.org/3.11/bob/LPF.st'. Nicolas ___

[Newbies] Re: Object references

2009-04-21 Thread nicolas cellier
Miguel Enrique Cobá Martínez miguel.coba at gmail.com writes: snip... (sorry, gmane want this) The question is. When you have an object that is referenced from many places, but only one of them is the correct according to the problem domain, how do you manage the adding, removing and

[Newbies] Re: closed and open interval

2008-11-24 Thread nicolas cellier
Randal L. Schwartz a écrit : Filip == Filip Malczak [EMAIL PROTECTED] writes: Filip You can always make subclass of Interval for example OpenedInterval , add Filip two variables: left and right.Make new methods: OpenedInterval from: aNumber to: aNumber left: aBoolean OpenedInterval from:

[Newbies] Re: Squeak-specific syntax

2008-10-29 Thread nicolas cellier
Mark Volkmann a écrit : I know that the syntax for literal and dynamic arrays is specific to Squeak. Is the @ method in the Number class for creating Point objects specific to Squeak? Is there any other syntax that is specific to Squeak? --- Mark Volkmann

[Newbies] Re: break out of do

2008-10-03 Thread Nicolas Cellier
Randal L. Schwartz merlyn at stonehenge.com writes: snip... There are more complicated ways to do it with exceptions if you need to stay within the same method. Don't do that. :) For the fun of it, see also

[Newbies] Re: writing to a stream after close

2008-10-03 Thread nicolas cellier
Mark Volkmann a écrit : Why is it that when I do a print it on all the code below, it outputs 'foobar'? Shouldn't the writing of 'bar' fail because I've closed the stream? ws := WriteStream on: ''. ws nextPutAll: 'foo'. ws close. ws nextPutAll: 'bar'. ws contents --- Mark Volkmann Close

[Newbies] Re: exception handling lingo

2008-10-01 Thread Nicolas Cellier
Mark Volkmann mark at ociweb.com writes: On Sep 30, 2008, at 1:34 PM, nicolas cellier wrote: Thanks! I think I understand all you said except for two things. 1) The ifCurtailed method. From just looking at the comment in the method and the code, I have no idea what it does

[Newbies] Re: exception handling lingo

2008-09-30 Thread nicolas cellier
Mark Volkmann a écrit : I asked this earlier, but it wasn't the first question in my email, so it may have been overlooked. In Smalltalk lingo is it correct to say signal and handle in place of Java's throw and catch? --- Mark Volkmann He, nobody answering, seems you reached some kind of

[Newbies] Re: pretty printing

2008-09-30 Thread nicolas cellier
Bert Freudenberg a écrit : snip... Well, #collect: is much more readable and concise, and might be optimized for some sorts of collections. In general it's good practice to use the most specific iteration method available rather than emulating using #do: (and always think twice, no, three

[Newbies] Re: Binary file I/O performance problems

2008-09-05 Thread nicolas cellier
nicolas cellier a écrit : Yoshiki Ohshima a écrit : At Fri, 5 Sep 2008 10:59:03 -0700, David Finlayson wrote: I re-wrote the test application to load the test file entirely into memory before parsing the data. The total time to parse the file decreased by about 50%. Now that I/O is removed

[Newbies] Re: Smalltalk is a Mystery to Me

2008-08-22 Thread nicolas cellier
[EMAIL PROTECTED] a écrit : I have had a curiosity about Smalltalk for many years so I recently downloaded and installed Squeak. That's when the trouble began. I have written applications that deal bridge hands and either display the hands on screen or save them in a couple of different

[Newbies] Re: accented characters + squeak

2008-08-21 Thread nicolas cellier
Bert Freudenberg a écrit : Am 21.08.2008 um 10:14 schrieb Hervé Darce: Have you tried running the image from http://etoys.laptop.org/src/etoys-image-and-pr.zip using that VM, as Bert suggested? That will allow you to identify if the problem is in the VM or the image. If that allows you to

[Newbies] Re: What's wrong with this statement?

2008-07-31 Thread nicolas cellier
Edgar J. De Cleene edgardec2001 at yahoo.com.ar writes: But (2 raisedTo: 128) atRandom could genetate 49572205802560219958060582892667404289 and 49572205802560219958060582892667404289 hex also is wrong print '254B42724A968401' Nah! hex is an excellent print, it is

[Newbies] Re: What's wrong with this statement?

2008-07-31 Thread nicolas cellier
johnps11 at bigpond.com writes: The issue is almost certainly in atRandom: Running 30 timesRepeat: [ | a | a:= (2 raisedTo: 57) atRandom. Transcript show: a ; show: ' ' ; show: a even ; cr ]. Gives me 30 falses. The odds of that are less than one in a billion (assuming

[Newbies] Re: What's wrong with this statement?

2008-07-31 Thread nicolas cellier
Randal L. Schwartz merlyn at stonehenge.com writes: johnps11 == johnps11 johnps11 at bigpond.com writes: johnps11 I'm not clever enough to understand PRNGs, so I'll leave it others johnps11 to work out what the answer is, although I suspect that for more johnps11 than 56 bits you need a

[Newbies] Re: Linked list structure?

2008-07-28 Thread nicolas cellier
Marcin Tustin a écrit : I am aware of LinkedList. It does not meet the criterion of accepting items whatever their protocol. You are right, current implementation of LinkedList is very specialized and restricted. Creating Links transparently would be a plus. Hey, we can use a Dictionary

[Newbies] Re: Another extension proposal - subsets

2008-07-25 Thread Nicolas Cellier
Klaus D. Witzel klaus.witzel at cobss.com writes: On Thu, 24 Jul 2008 20:09:53 +0200, Zulq Alam wrote: This is very good for small n :) combinations | combinations | combinations := (PluggableSet new: (2 raisedTo: self size)) hashBlock: [:aSet | aSet

[Newbies] Re: Another extension proposal - subsets

2008-07-25 Thread nicolas cellier
Zulq Alam me at zulq.net writes: Nicolas Cellier wrote: Zulq, the algorithm you are proposing is very simple but has major problems: 1) it is not efficient for large size n: it will do (n factorial) loops when only (2 raisedTo: n) are necessary It's better than N! because

[Newbies] Re: Another extension proposal - subsets

2008-07-25 Thread nicolas cellier
nicolas cellier ncellier at ifrance.com writes: He, press ALT-v to get versions of #combinations:atATimeDo: and thanks tk! I like bit sift solution too for it's simplicity. The problem is that it will iterate p times for creating subset of size p. #combinations:atATimeDo: does

[Newbies] Re: Another extension proposal - subsets

2008-07-25 Thread nicolas cellier
cdrick cdrick65 at gmail.com writes: I like bit sift solution too for it's simplicity. me too even if we could argue this is not self explaining...That's what Andres Valoud said here (thanks Marcin): http://blogten.blogspot.com/2005/09/very-nice-methods.html which is the exact

[Newbies] Re: Rouding Floats up to a number of decimals - Method Finder

2008-07-23 Thread nicolas cellier
cdrick a écrit : 1.2288 roundTo: 1 1 1.2288 roundTo: 0.1 1.2 1.2288 roundTo: 0.01 1.23 1.2288 roundTo: 0.001 1.229 1.2288 roundTo: 0.0001 1.2288 1.2288 roundTo: 0.05 1.25 1.2288 roundTo: 0.002 1.228 Stupid me again ;) I only tried #roundTo: with Integer. But #printShowingDecimalPlaces:

[Newbies] Re: Rouding Floats up to a number of decimals - Method Finder

2008-07-23 Thread nicolas cellier
cdrick a écrit : I couldn't find such a function. I tryed in the method finder but find nothing: MethodFinder methodFor: #(#(1.2288 3) 1.228). Do somebody know if such a method exist ? Meanwhile I did that: FloattrimAfter: aNumberOfDecimal roundAfter: | number | number := 10 raisedTo:

[Newbies] Re: How to shorten a method (using inject: into: ?)

2008-07-21 Thread nicolas cellier
Randal L. Schwartz merlyn at stonehenge.com writes: This looks even uglier. How about first gathering the testSets, then getting what you need from those: | testSets mTotal pTotal | testSets := (Forecaster testMale meiose) collect: [:strand | strand testRun ]. mTotal := (testSets

[Newbies] Re: Suspected bug when setting preferences

2008-07-17 Thread nicolas cellier
[EMAIL PROTECTED] a écrit : The attached test case fails in a new sq3.10.1-7175dev08.06.1 image. (or sq3.9.1-7075dev08.07.1.image). testPreferenceSaving PreferenceBrowser new saveSelected. Smalltalk garbageCollect. self should: [SystemNavigation default obsoleteBehaviors

[Newbies] Re: What is a weak reference

2008-07-15 Thread nicolas cellier
Bert Freudenberg a écrit : Am 15.07.2008 um 08:26 schrieb Herbert König: Hello Randal, RLS dictionary. This is how the classic dependents system works as well: the RLS dependencies are in a WeakDictionary so that when the watched object goes RLS away, the dependencies are also cleaned.

[Newbies] Re: What is a weak reference

2008-07-15 Thread nicolas cellier
Bert Freudenberg a écrit : Am 15.07.2008 um 13:23 schrieb nicolas cellier: Bert Freudenberg a écrit : The dependents are weak only for regular objects. Proper Models handle their own dependents collection in a non-weak manner. - Bert - Hmm, not really Warning: this example is stupid

[Newbies] Re: What is a weak reference

2008-07-15 Thread nicolas cellier
Randal L. Schwartz a écrit : nicolas == nicolas cellier [EMAIL PROTECTED] writes: nicolas But maybe we have just quit the beginners rails... I think the moment you mention Weak, you're already outside beginner space. :) That's the quality of our Squeak beginners. They bring really advanced

[Newbies] Re: Explorer and MessageTally [was: remembering variables]

2008-06-05 Thread nicolas cellier
Herbert König a écrit : Hello Klaus, KDW Yes, MessageTally does that for you: a tree of message sends. From the Spy KDW results, you can select a class and browse it for more details, or a KDW method and browse its senders or implementors for more details. interesting idea to use it this way!

[Newbies] Re: Collection subclasses

2008-04-03 Thread nicolas cellier
Rob Rothwell a écrit : If I create a simple object subclassed from Collection, SequenceableCollection, or ArrayedCollection called CollectionObject, with CollectionObject#initialize self halt. and execute: CollectionObject new. the halt is executed. Whereas, if I subclass

[Newbies] Re: ordinary #hash and Dictionary [was: Recap: How to empty a collection]

2008-02-21 Thread nicolas cellier
Klaus D. Witzel a écrit : Wouldn't this deserve a longer (Dictionary comment) ? You're right, the invariant is *essential* for Set and its subclasses, alas no word about it in its class comment. Please open a bug report (with severity text); current policy is that this then gets included

[Newbies] Re: ordinary #hash and Dictionary [was: Recap: How to empty a collection]

2008-02-20 Thread nicolas cellier
Klaus D. Witzel a écrit : On Wed, 20 Feb 2008 00:59:57 +0100, nicolas cellier wrote: ... I see, become: does exchange #identityHash, and that makes our IdentityDictionary work, god thanks, but there is no such provision for ordinary #hash and Dictionary... But there are sufficient

[Newbies] Re: Recap: How to empty a collection

2008-02-20 Thread nicolas cellier
Klaus D. Witzel a écrit : On Wed, 20 Feb 2008 02:01:49 +0100, nicolas cellier wrote: Some proposed an alternative based on (self removeAll: self), and started writing optimized versions of #removeAll:. No, (anOrderedCollection removeAll: anOrderedCollection) was not optimized. It had

[Newbies] Re: How to empty a collection?

2008-02-19 Thread nicolas cellier
cdrick a écrit : or again removeAll: aCollection aCollection == self ifTrue: [self removeAll: aCollection copy] ifFalse: [aCollection do: [:each | self remove: each]]. Or maybe, if aCollection == self, a warning could be raised ? What do you think ?

[Newbies] Re: How to empty a collection?

2008-02-19 Thread nicolas cellier
Klaus D. Witzel a écrit : On Tue, 19 Feb 2008 21:01:14 +0100, nicolas cellier wrote: cdrick a écrit : or again removeAll: aCollection aCollection == self ifTrue: [self removeAll: aCollection copy] ifFalse: [aCollection do: [:each | self remove: each

[Newbies] Re: How to empty a collection?

2008-02-19 Thread nicolas cellier
Klaus D. Witzel a écrit : On Tue, 19 Feb 2008 22:00:09 +0100, nicolas cellier wrote: However i can construct a test case that will not do what is expected and will not raise a notification, wanna bet? No, just let the next people who attempt to bring MappedCollection back to Squeak 3.10

[Newbies] Re: Recap: How to empty a collection

2008-02-19 Thread nicolas cellier
Blake a écrit : Well, from what I was reading, slow and smells is putting it too mildly. It sounds like it can corrupt your image, i.e., leave you with non-working objects in unexpected places. I wouldn't even mention it. Huh? Have a proof of what you wrote?

[Newbies] Re: Recap: How to empty a collection

2008-02-19 Thread nicolas cellier
Blake a écrit : On Tue, 19 Feb 2008 15:08:56 -0800, nicolas cellier [EMAIL PROTECTED] wrote: Blake a écrit : Well, from what I was reading, slow and smells is putting it too mildly. It sounds like it can corrupt your image, i.e., leave you with non-working objects in unexpected places. I

[Newbies] Re: Recap: How to empty a collection

2008-02-19 Thread nicolas cellier
Blake a écrit : On Tue, 19 Feb 2008 15:59:57 -0800, nicolas cellier [EMAIL PROTECTED] wrote: However, there are plenty of ordinary things that would have the same result: | key1 key2 dic | key1 := 'abc' copy. key2 := 'abd' copy. dic := Dictionary new. dic at: key1 put: 1. dic at: key2 put

[Newbies] Re: Beginners Digest, Vol 18, Issue 2

2007-10-04 Thread nicolas cellier
Maybe you could try with ArbitraryPrecisionFloat package (browse http://www.squeaksource.com). But you should then know the Number of bits to use in advance... Or try a package that can deal with AlgebraicNumber, maybe MathMorph would do that? In Smalltalk, ideas are programmed so fast that

[Newbies] Re: Best way to implement two-dimensional array

2007-09-04 Thread nicolas cellier
However, Classes and methods are Objects which have well defined tools to help them migrating from an image to another, even to another Smalltalk dialect. This ease code sharing. This is less clear for arbitrary objects... That's why I restrict myself to initialize these class vars in an

[Newbies] Re: Mod operator?

2007-08-11 Thread nicolas cellier
If you are interested by something closer to other languages for processing negative numbers, (AMOD, fmod, etc...), you will have a look at #quo: and #rem: Nicolas John Almberg a écrit : That works, too. Thanks. -- John On Aug 11, 2007, at 11:14 AM, Ching de la Serna wrote: try \\\

[Newbies] Re: More than 256 literals referenced.

2007-07-23 Thread nicolas cellier
Robert Stehwien a écrit : What is the source of the error produced by the following code? -- initialize table := OrderedCollection new. there are 100 entries like what is below table add: ({ #value-2. #cost--3. #step-2. #defense-3.

[Newbies] Re: More than 256 literals referenced.

2007-07-23 Thread nicolas cellier
Damned, Bert you are really fast today! Nicolas ___ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners

[Newbies] Re: Some general questions

2007-05-23 Thread nicolas cellier
Following Bert, the key used to access the dictionary could also be the instance variable 'name' of the User. So, if you now that names are unique, you can write: users := Dictionary new. names := #('Fred' 'Julia' 'Oliver' 'Martha'). names do: [:aName | | aUser | aUser

[Newbies] Re: [Q] A really silly question

2007-05-10 Thread nicolas cellier
Mathieu Suen a écrit : Yes actually I was pointing out the wrong method here is the good one but really ugly(idea is still the same): scanLitVec ... [(token == #- and: [((typeTable at: hereChar charCode ifAbsent: [#xLetter])) =

[Newbies] Re: PolygonMorph intersection

2007-05-03 Thread nicolas cellier
Sounds good. Depends how you define better. Faster code or shorter code? Maybe also add an optimistic rule first to fast up the false case: (polygonB bounds containsRect: polygonA bounds) ifFalse: [^false]. Of course, we can build degenerated examples which are hard to decide. To handle these,

Re: [Newbies] Tables for WideString?

2006-06-29 Thread nicolas cellier
Hello Alexei, you can also check at http://bugs.impara.de/view.php?id=3574 where i put another version of WideCharacterSet a few weeks ago. Nicolas Le Jeudi 29 Juin 2006 20:58, Алексей a écrit : Hello, Yoshiki. Thanks for detailed answer. It was in image 3.8 from squeak.org I fix problem

Re: [Newbies] UndefinedObject

2006-06-12 Thread nicolas cellier
Le Dimanche 11 Juin 2006 14:54, mathieu a écrit : An other things intresting is where do nil being initialized? [I know he is an old friend but it should have been born in a certain time :-) ] I think this one is so essential, that you can only find it in some bootstrap method not written in