Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
October 2009
- 86 participants
- 1118 messages
Re: [Pharo-project] Abstract classes
by Alexandre Bergel
> What would be your isAbstract be useful for?
To know whether it is wise to instantiate a class or not
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Oct. 28, 2009
Re: [Pharo-project] Linux FFI question: library given function name?
by Schwab,Wilhelm K
That seems to work. I found a similar looking script that did not. So far, it's sending me to a static library that I have yet to associate with anything that FFI can load, but it's progress.
Thanks,
Bill
________________________________
From: pharo-project-bounces(a)lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Hernán Morales Durand
Sent: Wednesday, October 28, 2009 9:53 AM
To: Pharo-project(a)lists.gforge.inria.fr
Subject: Re: [Pharo-project] Linux FFI question: library given function name?
http://www.linuxselfhelp.com/HOWTO/Program-Library-HOWTO/miscellaneous.html
2009/10/27 Schwab,Wilhelm K <bschwab(a)anest.ufl.edu<mailto:bschwab@anest.ufl.edu>>
Hello all,
In the short term, I'm looking for where I might find syslog() and friends, but a fishing lesson would be even better. How does one figure out in which library a named function lives?
Bill
_______________________________________________
Pharo-project mailing list
Pharo-project(a)lists.gforge.inria.fr<mailto:Pharo-project@lists.gforge.inria.fr>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 28, 2009
Re: [Pharo-project] Shared directories: The bug is quicker than the eye
by Schwab,Wilhelm K
Dave,
I'm not a fully trained penguin herder yet, so I have to ask a dumb question: is the idea to connect to the same file that went wrong and get an error condition after the fact, or are you hoping that opening and flushing will cause an error by itself? I suspect the problem is very real, and more "random" than that could hope to uncover.
Bill
-----Original Message-----
From: pharo-project-bounces(a)lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of David T. Lewis
Sent: Sunday, October 25, 2009 3:27 PM
To: Pharo-project(a)lists.gforge.inria.fr; johnmci(a)smalltalkconsulting.com
Subject: Re: [Pharo-project] Shared directories: The bug is quicker than the eye
I don't know if this helps, but for purposes of debugging here is a way to get at the error code from a flush(). No doubt I wrote the primitive by accident, not noticing that there was already a primitiveFileFlush in the FilePlugin.
aStream := FileStream readOnlyFileNamed: 'foo.tmp'.
result := OSProcess accessor flushExternalStream: aStream fileID.
errorString := OSProcess accessor primErrorMessageAt: result.
Dave
On Fri, Oct 23, 2009 at 11:57:06AM -0700, John M McIntosh wrote:
> If you invoke the flush primitive then it does this on unix/linux/mac-
> osx/iPhone
> http://developer.apple.com/mac/library/documentation/Darwin/Reference/
> ManPages/man3/fflush.3.html
> &
> http://developer.apple.com/mac/library/documentation/Darwin/Reference/
> ManPages/man2/write.2.html#//apple_ref/doc/man/2/write
>
> sqInt sqFileFlush(SQFile *f) {
> /* Return the length of the given file. */
>
> if (!sqFileValid(f)) return interpreterProxy->success(false);
> fflush(getFile(f));
> return 1;
> }
>
> On windows it does
> http://msdn.microsoft.com/en-us/library/aa364439(VS.85).aspx
>
> sqInt sqFileFlush(SQFile *f) {
> if (!sqFileValid(f)) FAIL();
> /* note: ignores the return value in case of read-only access */
> FlushFileBuffers(FILE_HANDLE(f));
> return 1;
> }
>
> I'll note the api doesn't actually check for errors, give feedback or
> whatever.
> *cough* it could be failing and give you a clue, but you would need to
> resort to FFI to do the file system calls to get the data to
> visualize, or build your own VM with that returns the result.
>
>
>
> On 2009-10-22, at 5:31 PM, Schwab,Wilhelm K wrote:
>
> > Hello all,
> >
> > I'm not sure what to make of this one. I just spent a couple of
> > hours trying to find the "leak" in an algorithm of mine. It was
> > reading roughly 1200 records, claiming to have processed all of
> > them, and yet writing only about 450 rows into an output text file.
> > One clue should have been that the number of output rows was
> > somewhat random; I did not fully appreciate that until I worked
> > around the problme.
> >
> > I tried an explicit #flush - no help. I looked for logic errors and
> > found none. The file was being written to a Windows hosted share
> > mounted by CIFS (which I am learning to view with contempt) from
> > Ubuntu 9.04. You can see where this is going: writing the file
> > locally gave the expected result.
> >
> > Any ideas on how one might further isolate the problem? My trust in
> > Windows is well known<g>; I have never liked shared directories; I
> > _really_ do not like CIFS as compared (reliability wise) to SMBFS;
> > the network between me and the server is in question too (long
> > story). All of that said, file support in Squeak, and hence so far
> > inherited by Pharo, is not the best code I have seen to date, so it
> > is easy to suspect too. Can one argue that since it worked locally,
> > Pharo is not the problem?
> >
> > The little bit that I know of cifs is not encouraging. It sounds as
> > though things moved from an easily killed process into the kernel
> > which shows an almost Windows-like unwillingness to shut down when
> > it cannot see servers. I have found numerous reports of problems
> > copying large files over cifs, and I have enountered them too.
> >
> > Bill
> >
_______________________________________________
Pharo-project mailing list
Pharo-project(a)lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 28, 2009
Re: [Pharo-project] Hashed collection improvements: Some code
by Stéphane Ducasse
Martin
are these changes related to the graphs you sent?
I will have a look after my hospital check.
Andres? Nicolas?
Any feedback?
Martin I imagine that I can package the changes :)
Stef
On Oct 24, 2009, at 4:01 AM, Martin McClure wrote:
> OK, here's a filein that improves Pharo hashed collection
> performance quite a bit. Large collections are much faster, and
> small ones are pretty much the same speed as before. There are
> basically two fairly simple changes; the basic structure and
> algorithms of the collections is unchanged. The changes:
>
> 1. Spread identity hash values.
> 2. Make table sizes prime.
>
>
> File it into PharoCore-1.0-10491rc1.image. It'll take a minute or
> two since it has to rehash the world halfway through. I don't know
> how to make another kind of packaging that can do that, so I'll
> leave that to someone else.
>
> After the filein, there are some test failures, most of which do not
> seem to be *directly* related. I'm hoping someone that knows the
> affected tests can take a look and comment:
>
>
> Unexpectedly pass ObjectFinalizerTests>>#testFinalizationOfEquals
> Not clear why, but this does not seem to be a problem :-)
>
> Fails HostWindowTests>>#testOne
> But this test fails in the core image on Linux; HostWindows do not
> seem to be implemented for Linux.
>
> Error on FontTest>>#testMultistringFont
> Japanese StrikeFonts have nil characterToGlyphMap,
> #createCharacterToGlyphMap answers nil,
> not immediately clear how this is supposed to be initialized for
> fonts
> with codepoints > 255.
>
> PackageInfoTest>>testKernelPackage
> because some method in kernel package for Object is not in Object.
> I've changed #hash, so that's probably it.
>
> Regards,
>
> -Martin
> 'From Pharo1.0rc1 of 19 October 2009 [Latest update: #10491] on 23
> October 2009 at 5:54:55 pm'!
>
> !ProtoObject methodsFor: 'comparing' stamp: 'MartinMcClure
> 10/22/2009 22:30'!
> identityHashTEMP
> "Answer a SmallInteger whose value is related to the receiver's
> identity.
> This method must not be overridden, except by SmallInteger.
> Primitive. Fails if the receiver is a SmallInteger. Essential.
> See Object documentation whatIsAPrimitive.
>
> Do not override."
>
> ^self primIdentityHash bitShift: 18! !
>
>
> !Object methodsFor: 'comparing' stamp: 'MartinMcClure 10/22/2009
> 22:46'!
> hashTEMP
> "Answer a SmallInteger whose value is related to the receiver's
> identity.
> May be overridden, and should be overridden in any classes that
> define = "
>
> ^ self primIdentityHash bitShift: 18! !
>
>
> !ProtoObject methodsFor: 'comparing' stamp: 'MartinMcClure
> 10/22/2009 21:13'!
> primIdentityHash
> "Answer a SmallInteger whose value is related to the receiver's
> identity.
> This method must not be overridden, except by SmallInteger.
> Primitive. Fails if the receiver is a SmallInteger. Essential.
> See Object documentation whatIsAPrimitive.
>
> Do not override."
>
> <primitive: 75>
> self primitiveFailed! !
>
>
> !SmallInteger methodsFor: 'comparing' stamp: 'MartinMcClure
> 10/23/2009 17:53'!
> primIdentityHash
> "Senders of primIdentityHash do it because they expect to get an
> answer from 1-4095.
> So they should not send this to SmallIntegers, but should use
> #identityHash"
>
> "^self shouldNotImplement"
>
> "...OK, only here for the sake of FixedIdentitySet, which may not
> need it since it is probably not used for Integers.
> And FixedIdentitySet itself may not be needed now that IdentitySets
> are faster."
>
> ^self! !
>
>
> !IdentityDictionary methodsFor: 'private' stamp: 'MartinMcClure
> 10/23/2009 14:55'!
> scanFor: anObject
> "Scan the key array for the first slot containing either a nil
> (indicating an empty slot) or an element that matches anObject.
> Answer the index of that slot or zero if no slot is found. This
> method will be overridden in various subclasses that have different
> interpretations for matching elements."
> | finish hash start element |
> finish := array size.
> start := (anObject identityHash \\ finish) + 1.
>
> "Search from (hash mod size) to the end."
> start to: finish do:
> [:index | ((element := array at: index) == nil or: [element key ==
> anObject])
> ifTrue: [^ index ]].
>
> "Search from 1 to where we started."
> 1 to: start-1 do:
> [:index | ((element := array at: index) == nil or: [element key ==
> anObject])
> ifTrue: [^ index ]].
>
> ^ 0 "No match AND no empty slot"! !
>
>
> !IdentitySet methodsFor: 'private' stamp: 'MartinMcClure 10/23/2009
> 14:57'!
> scanFor: anObject
> "Scan the key array for the first slot containing either a nil
> (indicating an empty slot) or an element that matches anObject.
> Answer the index of that slot or zero if no slot is found. This
> method will be overridden in various subclasses that have different
> interpretations for matching elements."
> | finish hash start element |
> finish := array size.
> start := (anObject identityHash \\ finish) + 1.
>
> "Search from (hash mod size) to the end."
> start to: finish do:
> [:index | ((element := array at: index) == nil or: [element ==
> anObject])
> ifTrue: [^ index ]].
>
> "Search from 1 to where we started."
> 1 to: start-1 do:
> [:index | ((element := array at: index) == nil or: [element ==
> anObject])
> ifTrue: [^ index ]].
>
> ^ 0 "No match AND no empty slot"! !
>
>
> !MethodDictionary methodsFor: 'private' stamp: 'MartinMcClure
> 10/22/2009 21:24'!
> scanFor: anObject
> "Scan the key array for the first slot containing either a nil
> (indicating an empty slot) or an element that matches anObject.
> Answer the index of that slot or zero if no slot is found. This
> method will be overridden in various subclasses that have different
> interpretations for matching elements."
> | element start finish |
> finish := array size.
> start := (anObject primIdentityHash \\ finish) + 1.
>
> "Search from (hash mod size) to the end."
> start to: finish do:
> [:index | ((element := self basicAt: index) == nil or: [element ==
> anObject])
> ifTrue: [^ index ]].
>
> "Search from 1 to where we started."
> 1 to: start-1 do:
> [:index | ((element := self basicAt: index) == nil or: [element ==
> anObject])
> ifTrue: [^ index ]].
>
> ^ 0 "No match AND no empty slot"! !
>
>
> !WeakIdentityKeyDictionary methodsFor: 'private' stamp:
> 'MartinMcClure 10/23/2009 14:54'!
> scanFor: anObject
> "ar 10/21/2000: The method has been copied to this location to
> indicate that whenever #scanFor: changes #scanForNil: must be
> changed in the receiver as well."
> "Scan the key array for the first slot containing either a nil
> (indicating an empty slot) or an element that matches anObject.
> Answer the index of that slot or zero if no slot is found. This
> method will be overridden in various subclasses that have different
> interpretations for matching elements."
> | element start finish hash |
> finish := array size.
> start := (anObject identityHash \\ finish) + 1.
>
> "Search from (hash mod size) to the end."
> start to: finish do:
> [:index | ((element := array at: index) == nil or: [element key ==
> anObject])
> ifTrue: [^ index ]].
>
> "Search from 1 to where we started."
> 1 to: start-1 do:
> [:index | ((element := array at: index) == nil or: [element key ==
> anObject])
> ifTrue: [^ index ]].
>
> ^ 0 "No match AND no empty slot"! !
>
> !WeakIdentityKeyDictionary methodsFor: 'private' stamp:
> 'MartinMcClure 10/23/2009 14:54'!
> scanForNil: anObject
> "Private. Scan the key array for the first slot containing nil
> (indicating an empty slot). Answer the index of that slot."
> | start finish hash |
> finish := array size.
> start := (anObject identityHash \\ array size) + 1.
>
> "Search from (hash mod size) to the end."
> start to: finish do:
> [:index | (array at: index) == nil ifTrue: [^ index ]].
>
> "Search from 1 to where we started."
> 1 to: start-1 do:
> [:index | (array at: index) == nil ifTrue: [^ index ]].
>
> ^ 0 "No match AND no empty slot"! !
>
>
>
>
>
>
>
> "---------------------Do surgery and rehash before
> continuing--------------------------"!
>
> | dict method |
> dict := ProtoObject methodDictionary.
> method := dict at: #identityHashTEMP.
> dict at: #identityHash put: method.
> dict := Object methodDictionary.
> method := dict at: #hashTEMP.
> dict at: #identityHash put: method.
>
> Set rehashAllSets.!
>
> "---------- Life should be... better now :-)
> -----------------------------"!
>
>
>
> !ProtoObject methodsFor: 'comparing' stamp: 'MartinMcClure
> 10/22/2009 22:30'!
> identityHash
> "Answer a SmallInteger whose value is related to the receiver's
> identity.
> This method must not be overridden, except by SmallInteger.
> Primitive. Fails if the receiver is a SmallInteger. Essential.
> See Object documentation whatIsAPrimitive.
>
> Do not override."
>
> ^self primIdentityHash bitShift: 18! !
>
>
> !Object methodsFor: 'comparing' stamp: 'MartinMcClure 10/22/2009
> 22:46'!
> hash
> "Answer a SmallInteger whose value is related to the receiver's
> identity.
> May be overridden, and should be overridden in any classes that
> define = "
>
> ^ self primIdentityHash bitShift: 18! !
>
>
> !FixedIdentitySet methodsFor: 'private' stamp: 'MartinMcClure
> 10/23/2009 14:49'!
> indexOf: anObject
> anObject isNil ifTrue: [self error: 'This class collection cannot
> handle nil as an element'].
> ^ (anObject primIdentityHash bitAnd: self basicSize - 1) + 1! !
>
>
> !Set class methodsFor: 'sizing' stamp: 'MartinMcClure 10/23/2009
> 09:44'!
> goodPrimes
> "Answer a sorted array of prime numbers less than one hundred million
> that make good hash table sizes. Should be expanded to more numbers
> if folks
> want to make larger collections.
> Need to check with Andres' book when I get back to work to see if I
> remembered
> it right :-)
>
> Generated with this code:
>
> | prevPrime primes goodPrimes |
> goodPrimes := OrderedCollection new.
> primes := Integer largePrimesUpTo: 100000000.
> goodPrimes add: 5.
> prevPrime := 5.
> primes do:
> [:prime | prime > (prevPrime * 4 // 3) ifTrue:
> [| lowByte | lowByte := prime bitAnd: 16rFF.
> (lowByte > 10 and: [lowByte < 245]) ifTrue:
> [goodPrimes add: prime.
> prevPrime := prime]]].
> ^goodPrimes asArray printString"
>
> ^#(5 11 17 23 31 43 59 79 107 149 199 269 359 479 641 857 1151 1549
> 2069 2767 3691 4931 6577 8779 11717 15629 20849 27799 37087 49451
> 65951 87943 117259 156347 208463 277961 370619 494167 658897 878539
> 1171393 1561883 2082527 2776727 3702313 4936423 6581909 8775947
> 11701267 15601723 20802317 27736427 36981911 49309219 65745677
> 87660917)!
> ]style[(10 311 405 337)f2b,f2,f1,f2! !
>
> !Set class methodsFor: 'sizing' stamp: 'MartinMcClure 10/23/2009
> 10:14'!
> goodPrimeAtLeast: lowerLimit
> "Answer the next good prime >= lowerlimit.
> If lowerLimit is larger than the largest known good prime,
> just make it odd."
>
> | primes low mid high prime |
> primes := self goodPrimes.
> low := 1.
> high := primes size.
> lowerLimit > (primes at: high) ifTrue:
> [^lowerLimit even
> ifTrue: [lowerLimit + 1]
> ifFalse: [lowerLimit]].
> [mid := high - low // 2 + low.
> prime := primes at: mid.
> prime < lowerLimit
> ifTrue: [low := mid]
> ifFalse: [high := mid].
> high - low <= 1 ifTrue:
> [^primes at: high].
> prime == lowerLimit ifTrue:
> [^prime]] repeat
>
> !
> ]style[(28 158 411)f2b,f2,f1! !
>
> !Set methodsFor: 'private' stamp: 'MartinMcClure 10/23/2009 10:25'!
> growSize
> "Answer what my next higher table size should be"
> ^ self class goodPrimeAtLeast: array size * 2! !
>
>
> !Set methodsFor: 'private' stamp: 'MartinMcClure 10/23/2009 10:25'!
> grow
> "Grow the elements array and reinsert the old elements"
> | oldElements |
> oldElements := array.
> array := Array new: self growSize.
> tally := 0.
> oldElements do:
> [:each | each == nil ifFalse: [self noCheckAdd: each]]! !
>
>
> !Set class methodsFor: 'instance creation' stamp: 'MartinMcClure
> 10/23/2009 10:19'!
> sizeFor: nElements
> "Large enough size to hold nElements with some slop (see fullCheck)"
> nElements <= 0 ifTrue: [^ 5].
> ^ self goodPrimeAtLeast: (nElements+1*4//3)! !
>
>
>
> !WeakSet methodsFor: 'private' stamp: 'MartinMcClure 10/23/2009
> 10:26'!
> grow
> "Grow the elements array if needed.
> Since WeakSets just nil their slots, alot of the occupied (in the
> eyes of the set) slots are usually empty. Doubling size if unneeded
> can lead to BAD performance, therefore we see if reassigning the
> <live> elements to a Set of similiar size leads to a sufficiently
> (50% used here) empty set first.
> and reinsert the old elements"
> |oldTally|
> oldTally := tally.
> self growTo: array size.
> oldTally >> 1 < tally ifTrue: [
> self growTo: self growSize]! !
>
>
> !MethodPragmaTest methodsFor: 'testing-primitives' stamp:
> 'MartinMcClure 10/23/2009 12:37'!
> testPrimitiveIndexed2
> "This test useses the #identityHash primitive."
>
> self compile: '<primitive: 75> ^ #idHash' selector: #idHash.
> self assert: self idHash = self primIdentityHash.! !
>
>
> !SmallInteger reorganize!
> ('arithmetic' * + - / // \\ gcd: quo:)
> ('bit manipulation' bitAnd: bitOr: bitShift: bitXor: hashMultiply
> highBit highBitOfMagnitude lowBit)
> ('comparing' < <= = > >= hash identityHash primIdentityHash ~=)
> ('converting' as31BitSmallInt asFloat)
> ('copying' clone deepCopy shallowCopy veryDeepCopyWith:)
> ('printing' decimalDigitLength destinationBuffer:
> numberOfDigitsInBase: printOn:base: printOn:base:nDigits:
> printString printStringBase: printStringBase:nDigits: threeDigitName)
> ('system primitives' asOop digitAt: digitAt:put: digitLength
> instVarAt: nextInstance nextObject)
> ('testing' even isLarge odd)
> ('private' fromString:radix: highBitOfPositiveReceiver)
> !
>
>
> !Set class reorganize!
> ('initialization' quickRehashAllSets rehashAllSets)
> ('sizing' goodPrimeAtLeast: goodPrimes)
> ('instance creation' new new: newFrom: sizeFor:)
> !
>
> ProtoObject removeSelector: #identityHashTEMP!
> Object removeSelector: #hashTEMP!
>
> !ProtoObject reorganize!
> ('apply primitives' tryNamedPrimitive tryNamedPrimitive:
> tryNamedPrimitive:with: tryNamedPrimitive:with:with:
> tryNamedPrimitive:with:with:with:
> tryNamedPrimitive:with:with:with:with:
> tryNamedPrimitive:with:with:with:with:with:
> tryNamedPrimitive:with:with:with:with:with:with:
> tryNamedPrimitive:with:with:with:with:with:with:with:
> tryPrimitive:withArgs:)
> ('closure-prims' privGetInstVar: privRemoteReturnTo:
> privSetInHolder: privSetInstVar:put: privStoreIn:instVar:)
> ('comparing' == identityHash primIdentityHash ~~)
> ('debugging' doOnlyOnce: flag: rearmOneShot withArgs:executeMethod:)
> ('initialize-release' initialize)
> ('method execution' executeMethod: with:executeMethod:
> with:with:executeMethod: with:with:with:executeMethod:
> with:with:with:with:executeMethod:)
> ('objects from disk' rehash)
> ('system primitives' become: cannotInterpret: doesNotUnderstand:
> nextInstance nextObject)
> ('testing' ifNil: ifNil:ifNotNil: ifNotNil: ifNotNil:ifNil:
> isInMemory isNil pointsTo:)
> !
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 28, 2009
Re: [Pharo-project] Abstract classes
by Lukas Renggli
>> As Mariano writes, most applications implement a message #isAbstract
>> themselves with the exact semantics they require. I don't think a
>> generic message in Behavior is really useful, especially if it is not
>> used by the core system.
>
> In that case, we could have isAbstractClass or something else. I feel
> this information is important.
What would be your isAbstract be useful for?
- SUnit will still have to implement its own #isAbstract to decide if
a class should be runnable or just provide test templates.
- Pier will still have to implement its own #isAbstract to decide if a
class should show up in the GUI.
- Magritte will still have to implement its own #isAbstract to decide
if an arbitrary class can be instantiated from the GUI.
- ...
>> Â If the class
>> contains any method that sends #subclassResponsibility, the we
>> consider the class as abstract.
>
> I am not sure what "contains" means in that context. But apparently,
> the definition you gave is not sufficient. The presence of
> subclassResponsibility need to be checked in the methods obtained from
> superclasses. (the code I gave in my previous email does not satisfy
> this although).
contains = (I assume) in the set of understood selectors (that
includes superclasses)
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
Oct. 28, 2009
Re: [Pharo-project] Hashed collection changes, the performance graphs
by Stéphane Ducasse
Martin
so what you are saying is that we can gain speed. And that these
changes are beneficial for simple default.
> The test code, a variant of the test from the HashTable SqueakSource
> wiki, is at the bottom of this message. Basically, it adds a bunch
> of instances of Object to a Dictionary and sees how much time it
> takes to look them up again.
>
> From the graphs in the previous message, you can see that
> performance for sizes > 4000 is greatly improved. For size = 10000,
> #at: is 1000 times faster, 2-3 microseconds vs. >2 milliseconds. At
> size=10000, #at:put: is about 200 times faster, ~10 microseconds vs.
> >2 milliseconds, and the large spikes for growing the collection are
> 21 milliseconds vs. > 4 seconds, again a factor of about 200.
>
> Performance for dictionary sizes < 4000 is essentially the same as
> before, so these collections can serve as general-purpose
> collections over a wide range of sizes. I've attached the graphs for
> sizes <4000 to this message so you can see that more clearly than on
> the previous graphs.
>
> These results should hold for any object that inherits #hash from
> Object, in other words uses its identity hash as its equality hash.
> Other objects with better hashes did not have as serious a problem,
> but will probably show increased performance as well due to using
> prime table sizes.
>
> These changes are in Set, so should improve Set's subclasses as
> well. IdentityDictionary, IdentitySet, and WeakIdentityKeyDictionary
> did not have as serious a problem, but should see some improvement.
> MethodDictionaries have been left alone on the assumption that the
> VM depends on the hashing of those.
So where are these changes :)
Should we integrate them?
Andres and other hash freaks what are your point of view?
> Since there are still only 4K possible values of identity hash,
> collisions are inevitable in large collections, and the number of
> collisions will grow linearly with collection size. So how well does
> the spread hash / prime table size do at even larger sizes? I ran
> the same test at sizes of one million. As expected, access was quite
> a bit slower than it had been at 10000. Time for #at: was ~250
> microseconds, and #at:put: was about the same. Note, however, that
> this is still ten times faster than Dictionary previously was at a
> size of 10000; 100 times larger yet 10 times faster.
>
> I had a lot of fun doing this. This is better results than I
> expected, for a fairly minor (though deep) code change.
So where are these changes :)
Should we integrate them?
Andres and other hash freaks what are your point of view?
> | test ord |
> Transcript cr.
> test := Dictionary new.
> [ test size >= 10000] whileFalse: [
> ord := OrderedCollection new: 100.
> Transcript show:
> [
> 100 timesRepeat: [
> test at: ( ord add: Object new ) put: nil ].
> ] timeToRun asString.
> Transcript tab;
> show: test size asString;
> tab.
> Transcript show:
> [
> 1000 timesRepeat: [
> ord do: [ :each | test at: each ] ]
> ] timeToRun asString.
> Transcript tab; show:
> [
> 1000 timesRepeat: [
> ord do: [ :each | ] ]
> ] timeToRun asString.
> Transcript cr ]
>
> <
> SmallDictPerformanceGraphs1
> .png>_______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 28, 2009
Re: [Pharo-project] Starting out: db and gui recommendation
by Stéphane Ducasse
> Thanks for all the responses. They have caused me to rethink a
> couple of things already.
>
> Sqlite is a holdover from thinking about a .Net version of this
> app. I just need to persist my data. Something like Magma should be
> fine. I had been looking at Sqlite as an embedded database since I
> didn't need (or don't want to make the user manage) a database server.
>
> I ran the UIThemes examples and I like the look. But I might just
> use the browser and a local Seaside server to give me a chance to
> learn more about web programming. It doesn't have to be a desktop
> app but my wife, who is has a problem to be solved and is my
> customer, says she would not put the data on the web. I will
> consider if some of the less personal data could be web-based (and
> then more universally accessible) and some data restricted to local
> storage. A hybrid if you will.
but you do not have to put them on the web for using seaside :)
What I do not for my too large comix collection is that I save the
information in xml files on my hardisc and the system automatically
load the latest files
and save a new one. You can attach action to classes when the system
starts or quits.
> I have to admit that I stretched a little bit when I said "I am a
> Java & .Net application programmer", "was" is almost more correct
> now. Like so many, I do more project management now and really miss
> the coding. I've been reading "The Passionate Programmer" and I'm
> following his advice to learn something very different from what I
> know now.
>
> Thanks again. Now off to review some of the things you have brought
> to my attention.
>
> Rick
>
>
> On Thu, Oct 22, 2009 at 9:30 PM, Rick Morrison <rick(a)m45.us> wrote:
> I am a Java & .Net application programmer who has flirted with
> Smalltalk for a long time without doing the
>
> Thanks for any help,
> Rick
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Oct. 28, 2009
Re: [Pharo-project] Starting out: db and gui recommendation
by Stéphane Ducasse
>
> mariano
> it would be nice if you could start to write something on it.
> May be we could turn that into a chapter for the pharo v 2 book?
>
> Yes! I have no problem to do it. Right now, I will translate one of
> the Pharo By Example (1) chapters to Spanish. So, I will be familiar
> PBE and the .tex of it.
>
> Our website has a lot of documentation, so, I think I can get stuff
> from there as an start.
>
> What do you think?
go write first and after we discuss :)
it would be nice to have a little story:
ok dear reader let us imagine that you collect books and you want to
store them in a DB...
> who is the one that is leading PBE2 ?
oscar and me :)
Stef
Oct. 28, 2009
Re: [Pharo-project] issue 496: Morph>>heading
by Laval Jannik
On Oct 28, 2009, at 16:26 , Miguel Enrique Cobá Martinez wrote:
> El mié, 28-10-2009 a las 07:03 +0100, Laval Jannik escribió:
>> So,
>>
>> Is anyone use the rotation in pharo-Core ?
>> If not, I will remove it.
>> And I will try to put it in another package, which will be loaded
>> after.
>>
>
> Remove it, please, is not a core feature.
I like this answer :)
I will do this stuff with pleasure :)
Cheers,
Jannik
Oct. 28, 2009
Re: [Pharo-project] issue 496: Morph>>heading
by Miguel Enrique Cobá Martinez
El mié, 28-10-2009 a las 07:03 +0100, Laval Jannik escribió:
> So,
>
> Is anyone use the rotation in pharo-Core ?
> If not, I will remove it.
> And I will try to put it in another package, which will be loaded after.
>
Remove it, please, is not a core feature.
> Jannik
>
>
> On Oct 26, 2009, at 19:11 , Stéphane Ducasse wrote:
>
> > jannik
> >
> > you ask the right question
> > And this is ugly. Now we could think about possible usecases.
> > If we build a image processing system: we need it but in that case we
> > can copy it.
> >
> > Stef
> >
> >
> >> Yes, Marcus is right.
> >>
> >> But are there some behaviors that we want to keep and integrate in
> >> Core ?
> >> For example, the Rotate functionality in the halo.
> >>
> >> Cheers,
> >> Jannik
> >>
> >>
> >> On Oct 26, 2009, at 16:22 , Marcus Denker wrote:
> >>
> >>>
> >>>>
> >>>>> However, it would be a good idea to put all the interesting eToy
> >>>>> stuff in an external package so that those who want to load that
> >>>>> stuff, are able to do it.
> >>>>
> >>>>
> >>>>
> >>>> Because, make an external package of it needs a big work...
> >>>>
> >>>> I don't think so.
> >>>
> >>> Etoy is more complex than you think. It would be (nearly)
> >>> impossible.
> >>>
> >>>
> >>>> You just need to create the package. And then, instead of removing
> >>>> code, you move it to that package. What can be a lot of work is to
> >>>> keep that package up to date and working, but that's not Pharo
> >>>> responsibility.
> >>>>
> >>> Nope. Etoy is programed in a way that makes things like this *a
> >>> lot* of work.
> >>>
> >>>
> >>> Marcus
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Pharo-project mailing list
> >>> Pharo-project(a)lists.gforge.inria.fr
> >>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> Pharo-project(a)lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
--
Miguel Cobá
http://miguel.leugim.com.mx
Oct. 28, 2009