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
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
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
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,
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
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
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
bb bblochl at arcor.de writes:
Am 30.06.2011 11:53, schrieb Randal L. Schwartz:
bb == bb bblochl at arcor.de writes:
bb
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.
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:
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
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
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
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
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),
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
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
___
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
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:
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
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
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
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
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
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
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
[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
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
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
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
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
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
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
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
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
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
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:
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:
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
[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
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.
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
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
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!
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
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
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
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
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 ?
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
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
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?
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
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
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
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
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 \\\
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.
Damned, Bert you are really fast today!
Nicolas
___
Beginners mailing list
Beginners@lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
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
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])) =
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,
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
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
64 matches
Mail list logo