Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- August
- 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
February 2011
- 111 participants
- 2276 messages
Re: [Pharo-project] A new GUI visual designer
by Schwab,Wilhelm K
Craig,
You and SmartReferenceStream are effectively assuming that user==programmer; I submit it is in our interest to many ordinary users of Smalltalk applications. All that should be required is to have code that is newer than the stream, and neither user nor developer should be bothered with conversions. What you are doing on the fly should be done at the time of the layout change by the developer of the class(es) being serialized.
Bill
________________________________________
From: pharo-project-bounces(a)lists.gforge.inria.fr [pharo-project-bounces(a)lists.gforge.inria.fr] On Behalf Of Craig Latta [craig(a)netjam.org]
Sent: Friday, February 18, 2011 6:42 PM
To: pharo-project(a)lists.gforge.inria.fr
Subject: Re: [Pharo-project] A new GUI visual designer
Hi Bill--
> You are setting up some of the same mistakes that were made in
> SmartReferenceStream, only with both sides involved.
What mistakes were those?
> This is a simple problem calling for a careful solution.
I agree, and this seems a lot simpler to me than what has come before.
> What you are doing *could* be ok with the developer of both systems
> on hand to monitor it, but that will be rare.
Hm, I don't think that's true. In my use so far, this system has
reduced the number of situations requiring human intervention, not
increased them (mostly to do with missing prerequisites, out-of-date
class definitions, and class name conflicts).
> What you want are tools that make it easy to write the converters
> (which belong in the affected classes, not the serializer - another
> SmartReferenceStream oddity).
Naiad (Spoon's module system) is indeed implemented that way; there
is no "serializer".
-C
--
Craig Latta
www.netjam.org/resume
+31 06 2757 7177
+ 1 415 287 3547
Feb. 19, 2011
Re: [Pharo-project] A new GUI visual designer
by Craig Latta
Hi Bill--
> You are setting up some of the same mistakes that were made in
> SmartReferenceStream, only with both sides involved.
What mistakes were those?
> This is a simple problem calling for a careful solution.
I agree, and this seems a lot simpler to me than what has come before.
> What you are doing *could* be ok with the developer of both systems
> on hand to monitor it, but that will be rare.
Hm, I don't think that's true. In my use so far, this system has
reduced the number of situations requiring human intervention, not
increased them (mostly to do with missing prerequisites, out-of-date
class definitions, and class name conflicts).
> What you want are tools that make it easy to write the converters
> (which belong in the affected classes, not the serializer - another
> SmartReferenceStream oddity).
Naiad (Spoon's module system) is indeed implemented that way; there
is no "serializer".
-C
--
Craig Latta
www.netjam.org/resume
+31 06 2757 7177
+ 1 415 287 3547
Feb. 18, 2011
Re: [Pharo-project] minimalism (formerly case-statement-stuff)
by Craig Latta
> For developers like me, loading the code is a bit less of value than
> being able to create new code (through compiling of course).
> :)
>
> But of course for production systems, one may choose to not have
> compiler, which is perfectly fine and even helps to close some
> security gaps.
Of course. I'm referring to this inane argument y'all have been
having about whether to have case-statement support "in the image". The
entire compiler can be an optional module (with the case statement stuff
in yet another module separate from that), so the debate is moot.
-C
--
Craig Latta
www.netjam.org/resume
+31 06 2757 7177
+ 1 415 287 3547
Feb. 18, 2011
[Pharo-project] Need your point of view on FSPath * and others
by Stéphane Ducasse
Colin
I'm continuing adding comments to FS.
1- A question about
FSPath class>>* aString
^ self with: aString
I would like to deprecated FSPath class>>* and use with: since this is the message
and
What do you think?
I really prefer for static analysis point of view not to pollute numerical behavior with others.
Avoiding ad-hoc polymorphism will help us to build static checker in the future.
2- Then I was wondering if it would not be good to have validating creation methods
(FSPath * 'parent/child/') isRelative
true
(FSPath * '/parent/child/') isAbsolute
false
because the string is not checked
FSPath * '/parejhkjhhg %% ^%$%^(%$546547675 nt??child/'
I saw that there is
readFrom: aStream delimiter: aCharacter
so I created an unchecking instance creation category and I added with: and * in it.
And added comments
3- Then finally the following confuses me
(FSPath with: 'parent/child/') isRelative true
(FSPath with: '/parent/child/') isRelative true
(FSPath with: '') isRelative false
Either with: create relative path or isRelative is not consistent.
If with: creates relative path then the last one should be true
or isRelative should return false on the second one. ?
4 - about FSPath root
we have
root
"Return the relative root path"
^ self with: ''
FSPath root
returns /
and I like that
Now what about defining root as
root
^ self with: '/'
It would be more consistent. Now it breaks everything. So I did not do it :)
May be I'm tired after 4 ours teaching and 6 hours train.
Thanks for your time
Stef
Feb. 18, 2011
Re: [Pharo-project] [squeak-dev] Re: Cog VM -- Thanks and Performance / Optimization Questions
by Juan Vuletich
Igor Stasenko wrote:
> It seems that you guys (Stephane & Juan) both making same mistake. :)
>
> You trying to assign multiple different roles to Transcript at once:
> - be a stream
> - be a GUI element (can draw/update itself on a screen)..
>
I don't agree. This new Transcript is not a Stream. It is a logger, that
can log both to screen and to file. The stream like protocol is just for
compatibility. Besides, the usual mechanisms for separating view and
model are not used on pourpuse, this doesn't rely on a particular GUI.
It is more like Transcripter (i.e. the emergency evaluator).
Cheers,
Juan Vuletich
Feb. 18, 2011
[Pharo-project] New Transcript (was: [squeak-dev] Re: Cog VM -- Thanks and Performance / Optimization Questions)
by Juan Vuletich
Hi Folks,
This new version includes full Morphic integration. It was done for
Cuis, but it shouldn't be too hard to adapt for Squeak / Pharo.
Cheers,
Juan Vuletich
Juan Vuletich wrote:
> Hi Eliot,
>
> There are other problems with Transcript besides performance. It is
> easy to break the UI if called at the wrong times. In those cases, it
> is usually needed to kill Squeak from the OS. Besides, it is not
> thread safe.
>
> Instantly becoming a hero sounds cool, so this is my attempt at it :)
> I only tried this in Cuis, but I believe it should work on Squeak and
> Pharo without much trouble. After loading this code, you can evaluate
> 'Smalltalk at: #Transcript put: NewTranscript'.
>
> Some good properties of this are:
> - Very fast.
> - Thread safe!
> - Doesn't use Morphic at all. Can be used to debug Morphic itself.
> - Doesn't do delayed execution (no events, no forked processes).
> Immediate visual feedback.
> - Can show itself on Display, log to File, both, or none.
> - Can be used for headless or remote images (for example, web servers).
>
> Some possible downsides are:
> - Output only. Not a text editor. We have the Workspace and the
> Transcripter for that.
> - No seamless Morphic integration. I'll do one for Cuis, though.
>
> If no serious problems are found, I'll remove TranscriptStream from
> Cuis, and rename this class as Transcript.
>
> Cheers,
> Juan Vuletich
'From Cuis 3.0 of 31 January 2011 [latest update: #790] on 18 February 2011 at 5:34:24 pm'!
!classDefinition: #Transcript category: #'System-Support'!
Object subclass: #Transcript
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'System-Support'!
!Transcript commentStamp: '<historical>' prior: 0!
A new implementation of Transcript.
- Thread safe.
- Very fast.
- Independent of Morphic or any other UI framework.
- Immediate feedback.
- Can log to file.
- Not an editor. Only used for output.
- All protocol is on the Class side!
!classDefinition: 'Transcript class' category: nil!
Transcript class
instanceVariableNames: 'entries firstIndex lastIndex accessSemaphore unfinishedEntry logToFile showOnDisplay innerRectangle lastDisplayTime'!
!classDefinition: #TranscriptMorph category: #'Morphic-Widgets'!
BorderedMorph subclass: #TranscriptMorph
instanceVariableNames: 'form'
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Widgets'!
!DateAndTime methodsFor: 'squeak protocol' stamp: 'jmv 2/18/2011 12:57'!
printWithMsOn: aStream
"Print with millisecond resolution, no leading space, no offset."
| ps |
self printYMDOn: aStream withLeadingSpace: false.
aStream nextPut: $T.
self printHMSOn: aStream.
ps _ (self nanoSecond // 1000000) printString padded: #left to: 3 with: $0.
aStream nextPut: $..
aStream nextPutAll: ps! !
!PasteUpMorph methodsFor: 'world menu' stamp: 'jmv 2/18/2011 17:30'!
findATranscript: evt
"Locate a transcript, open it, and bring it to the front. Create one if necessary"
self
findAWindowSatisfying: [ :aWindow | aWindow model == Transcript]
orMakeOneUsing: [ TranscriptMorph openWindow ]! !
!TextModelMorph methodsFor: 'updating' stamp: 'jmv 2/18/2011 11:12'!
update: aSymbol
aSymbol ifNil: [^self].
aSymbol == #flash ifTrue: [^self flash].
aSymbol == #actualContents
ifTrue: [
"Some day, it would be nice to keep objects and update them
instead of throwing them away all the time for no good reason..."
textMorph releaseParagraph.
self formatAndStyleIfNeeded.
^self].
aSymbol == #acceptedContents ifTrue: [
model refetch.
^self].
aSymbol == #refetched ifTrue: [
self setSelection: model getSelection.
self hasUnacceptedEdits: false.
^self].
aSymbol == #initialSelection
ifTrue: [^self setSelection: model getSelection].
aSymbol == #autoSelect
ifTrue: [
self handleEdit: [
TextEditor abandonChangeText. "no replacement!!"
self editor
setSearch: model autoSelectString;
againOrSame: true ]].
aSymbol == #clearUserEdits ifTrue: [^self hasUnacceptedEdits: false].
aSymbol == #wantToChange
ifTrue: [
self canDiscardEdits ifFalse: [^self promptForCancel].
^self].
aSymbol == #codeChangedElsewhere
ifTrue: [
self hasEditingConflicts: true.
^self changed ].
aSymbol == #shoutStyle
ifTrue: [
self stylerStyled.
^self changed ].! !
!TheWorldMenu methodsFor: 'commands' stamp: 'jmv 2/18/2011 17:29'!
openTranscript
TranscriptMorph openWindow! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 16:49'!
bounds: aRectangle
innerRectangle _ aRectangle insetBy: self borderWidth! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 14:16'!
clear
| stream |
accessSemaphore critical: [
"Having at least one entry simplifies handling of the entries circular collection"
firstIndex _ 1.
lastIndex _ 1.
entries at: 1 put: 'Transcript'.
unfinishedEntry reset.
logToFile ifTrue: [
stream _ StandardFileStream forceNewFileNamed: self filename.
[
stream nextPutAll: 'Transcript log started: '.
DateAndTime now printOn: stream.
stream
lf;
nextPutAll: '------------------------------------------------------------------------';
lf
] ensure: [ stream close ]]].
self display! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 14:16'!
log: aString
self addEntry: aString.
self display! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 16:46'!
logToFile: aBoolean
"
self logToFile
"
logToFile _ aBoolean! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 16:46'!
showOnDisplay: aBoolean
"
self logToFile
"
showOnDisplay _ aBoolean! !
!Transcript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011 17:06'!
windowIsClosing
self showOnDisplay: false! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:20'!
cr
"WriteStream protocol.
In the older TranscriptStream, it added a CR character.
Now, finish the current incomplete entry."
self finishEntry! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:20'!
crtab
"WriteStream protocol.
End the current entry, and start a new one starting with a single tab character."
self cr; tab! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:21'!
endEntry
"For compatibility with old TranscriptStream. nop here"! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:21'!
flush
"For compatibility with old TranscriptStream. nop here"! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 14:17'!
nextPut: aCharacter
"WriteStream protocol.
Append aCharacter to the unfinishedEntry.
cr characters sent with this message do NOT finish the current unfinishedEntry."
unfinishedEntry nextPut: aCharacter.
self displayUnfinishedEntry! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 14:17'!
nextPutAll: aString
"WriteStream protocol.
Append aString to the unfinishedEntry.
cr characters sent with this message do NOT finish the current unfinishedEntry."
unfinishedEntry nextPutAll: aString.
self displayUnfinishedEntry! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:20'!
print: anObject
"Stream protocol"
anObject printOn: self! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:22'!
show: anObject
"Old TranscriptStream protocol."
self nextPutAll: anObject asString! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:22'!
space
"WriteStream protocol.
Append a space character to the receiver."
self nextPut: Character space! !
!Transcript class methodsFor: 'old Transcript compatibility' stamp: 'jmv 2/18/2011 11:22'!
tab
"WriteStream protocol.
Append a tab character to the receiver."
self nextPut: Character tab! !
!Transcript class methodsFor: 'private' stamp: 'jmv 2/18/2011 12:59'!
addEntry: aString
"Add a new entrie to the entries circular list. If full, a new entry will replace the oldest one."
| msg now |
logToFile ifTrue: [
now _ DateAndTime now.
msg _ String streamContents: [ :strm |
now printWithMsOn: strm.
strm
nextPutAll: ' process:';
nextPutAll: Processor activeProcess priority printString;
nextPut: $ ;
nextPutAll: Processor activeProcess hash printString;
nextPut: $ ;
nextPutAll: aString;
lf ]].
self addEntry: aString logToFile: msg! !
!Transcript class methodsFor: 'private' stamp: 'jmv 2/18/2011 12:34'!
addEntry: aString logToFile: otherString
"Add a new entrie to the entries circular list. If full, a new entry will replace the oldest one."
| stream |
accessSemaphore critical: [
"Internal circular collection"
lastIndex _ lastIndex \\ self maxEntries + 1.
firstIndex = lastIndex ifTrue: [
firstIndex _ firstIndex \\ self maxEntries + 1 ].
entries at: lastIndex put: aString.
"external file"
otherString ifNotNil: [
[
stream _ StandardFileStream fileNamed: self filename.
stream
setToEnd;
nextPutAll: otherString;
flush]
ensure: [ stream close ]
]
]! !
!Transcript class methodsFor: 'private' stamp: 'jmv 2/18/2011 14:16'!
finishEntry
| newEntry |
newEntry _ unfinishedEntry contents.
unfinishedEntry reset.
self addEntry: newEntry.
self display! !
!Transcript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:20'!
display
showOnDisplay ifTrue: [
self displayOn: Display.
lastDisplayTime _ DateAndTime now ]! !
!Transcript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 16:49'!
displayOn: aForm
"
experimentos
Transcript displayOn: Display
"
| font port count i string x y fh f bw |
bw _ self borderWidth.
aForm border: (innerRectangle outsetBy: bw) width: bw.
aForm fill: innerRectangle fillColor: Color white.
port _ BitBlt toForm: aForm.
port clipWidth: innerRectangle right.
font _ StrikeFont default.
font installOn: port foregroundColor: Color black.
fh _ font height.
count _ innerRectangle height // fh-1.
x _ innerRectangle left.
y _ innerRectangle top.
f _ firstIndex-1.
firstIndex > lastIndex ifTrue: [ f _ f - self maxEntries ].
i _ (lastIndex - count max: f) \\ self maxEntries + 1.
[
string _ entries at: i.
port displayString: string from: 1 to: string size at: x@y strikeFont: font kern: font baseKern negated.
y _ y + fh.
i = lastIndex
] whileFalse: [ i _ i \\ self maxEntries + 1 ].
string _ unfinishedEntry contents.
port displayString: string from: 1 to: string size at: x@y strikeFont: font kern: font baseKern negated.! !
!Transcript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:23'!
displayUnfinishedEntry
showOnDisplay ifTrue: [
(lastDisplayTime isNil or: [ (DateAndTime now - lastDisplayTime) totalSeconds > 1 ])
ifTrue: [ ^self display ].
self displayUnfinishedEntryOn: Display ]! !
!Transcript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:14'!
displayUnfinishedEntryOn: aForm
| font port count string x y fh |
port _ BitBlt toForm: aForm.
port clipWidth: innerRectangle right.
font _ StrikeFont default.
font installOn: port foregroundColor: Color black.
fh _ font height.
count _ innerRectangle height // fh-1.
x _ innerRectangle left.
string _ unfinishedEntry contents.
y _ ((lastIndex - firstIndex \\ self maxEntries) min: count-1) + 1 * font height + innerRectangle top.
port displayString: string from: 1 to: string size at: x@y strikeFont: font kern: font baseKern negated.! !
!Transcript class methodsFor: 'class initialization' stamp: 'jmv 2/18/2011 13:13'!
initialize
"
self initialize
"
showOnDisplay _ true.
innerRectangle _ 20@20 extent: 300@500.
logToFile _ false.
entries _ Array new: self maxEntries.
unfinishedEntry _ '' writeStream.
accessSemaphore _ Semaphore forMutualExclusion.
self clear! !
!Transcript class methodsFor: 'constants' stamp: 'jmv 2/18/2011 16:49'!
borderWidth
^1! !
!Transcript class methodsFor: 'constants' stamp: 'jmv 2/18/2011 12:33'!
filename
^'transcript.txt'! !
!Transcript class methodsFor: 'constants' stamp: 'jmv 2/18/2011 12:59'!
maxEntries
^1000! !
!TranscriptMorph methodsFor: 'drawing' stamp: 'jmv 2/18/2011 17:18'!
drawOn: aCanvas
"
Transcript
showOnDisplay: true;
bounds: bounds;
displayOn: aCanvas form.
"
Transcript
showOnDisplay: true;
bounds: (0@0 extent: bounds extent);
displayOn: form;
bounds: bounds.
aCanvas drawImage: form at: bounds origin! !
!TranscriptMorph methodsFor: 'geometry' stamp: 'jmv 2/18/2011 17:17'!
extent: aPoint
super extent: aPoint.
(form isNil or: [ form extent ~= aPoint ]) ifTrue: [
form _ Form extent: aPoint depth: Display depth ]! !
!TranscriptMorph class methodsFor: 'instance creation' stamp: 'jmv 2/18/2011 17:08'!
openWindow
"
TranscriptMorph openWindow
"
SystemWindow new
setLabel: 'Transcript';
model: Transcript;
widgetsColor: Theme current transcript;
addMorph: TranscriptMorph new frame: (0@0 extent: 1@1);
openInWorld! !
Transcript initialize!
Transcript class removeSelector: #logToFile!
TextModelMorph removeSelector: #appendEntry!
Smalltalk removeClassNamed: #TranscriptStream!
Feb. 18, 2011
Re: [Pharo-project] [squeak-dev] Re: Cog VM -- Thanks and Performance / Optimization Questions
by Igor Stasenko
It seems that you guys (Stephane & Juan) both making same mistake. :)
You trying to assign multiple different roles to Transcript at once:
- be a stream
- be a GUI element (can draw/update itself on a screen)..
Hey.. Transcript is not a swiss knife!
It is just a stream (kind of special one), but other than that.. it is
just a stream.
And what you see on a screen - it is just a view of it.
So, Juan it is cool that you have better Transcript... still it having
same deficiencies which i shown to Stephane not long ago,
and tried to convince him that Transcript is a stream, not a window. A
Transcript window is just a view of real transcript.
And i think this is quite easy to make this separation and have sound model.
On 18 February 2011 19:33, Juan Vuletich <juan(a)jvuletich.org> wrote:
> Hi Eliot,
>
> Eliot Miranda wrote:
>>
>> Hi John,
>>
>> Â Â good questions.
>>
>> On Thu, Feb 17, 2011 at 6:21 AM, John B Thiel <jbthiel(a)gmail.com
>> <mailto:jbthiel@gmail.com>> wrote:
>>
>> Â Â Cog VM -- Thanks and Performance / Optimization Questions
>>
>> Â Â ...
>> Â Â (Also, any notoriously slow subsystems? Â For example, Transcript
>> Â Â writing is glacial.)
>>
>>
>> Someone should replace the Transcript's reliance on (I think) some kind of
>> FormMorph which moved huge numbers of bits on each write. Â But this is not a
>> VM issue. Â It's a Smalltalk issue. Â Whoever did this would instantly become
>> a hero.
>
> There are other problems with Transcript besides performance. It is easy to
> break the UI if called at the wrong times. In those cases, it is usually
> needed to kill Squeak from the OS. Besides, it is not thread safe.
>
> Instantly becoming a hero sounds cool, so this is my attempt at it :) I only
> tried this in Cuis, but I believe it should work on Squeak and Pharo without
> much trouble. After loading this code, you can evaluate 'Smalltalk at:
> #Transcript put: NewTranscript'.
>
> Some good properties of this are:
> - Very fast.
> - Thread safe!
> - Doesn't use Morphic at all. Can be used to debug Morphic itself.
> - Doesn't do delayed execution (no events, no forked processes). Immediate
> visual feedback.
> - Can show itself on Display, log to File, both, or none.
> - Can be used for headless or remote images (for example, web servers).
>
> Some possible downsides are:
> - Output only. Not a text editor. We have the Workspace and the Transcripter
> for that.
> - No seamless Morphic integration. I'll do one for Cuis, though.
>
> If no serious problems are found, I'll remove TranscriptStream from Cuis,
> and rename this class as Transcript.
>
> Cheers,
> Juan Vuletich
>
> 'From Cuis 3.0 of 31 January 2011 [latest update: #790] on 18 February 2011
> at 2:36:31 pm'!
> !classDefinition: #NewTranscript category: #'System-Support'!
> Object subclass: #NewTranscript
> Â Â Â Â instanceVariableNames: ''
> Â Â Â Â classVariableNames: ''
> Â Â Â Â poolDictionaries: ''
> Â Â Â Â category: 'System-Support'!
>
> !NewTranscript commentStamp: '<historical>' prior: 0!
> A new implementation of Transcript.
> - Thread safe.
> - Very fast.
> - Independent of Morphic or any other UI framework.
> - Inmediate feedback.
> - Can log to file.
> - Not an editor. Only used for output.
> - All protocol is on the Class side!
>
> !classDefinition: 'NewTranscript class' category: nil!
> NewTranscript class
> Â Â Â Â instanceVariableNames: 'entries firstIndex lastIndex accessSemaphore
> unfinishedEntry logToFile showOnDisplay innerRectangle lastDisplayTime'!
>
> !DateAndTime methodsFor: 'squeak protocol' stamp: 'jmv 2/18/2011 12:57'!
> printWithMsOn: aStream
> Â Â Â Â "Print with millisecond resolution, no leading space, no offset."
>
> Â Â Â Â | ps |
> Â Â Â Â self printYMDOn: aStream withLeadingSpace: false.
> Â Â Â Â aStream nextPut: $T.
> Â Â Â Â self printHMSOn: aStream.
> Â Â Â Â ps _ (self nanoSecond // 1000000) printString padded: #left to: 3
> with: $0.
> Â Â Â Â aStream nextPut: $..
> Â Â Â Â aStream nextPutAll: ps! !
>
>
> !NewTranscript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011
> 14:16'!
> clear
> Â Â Â Â | stream |
> Â Â Â Â accessSemaphore critical: [
> Â Â Â Â Â Â Â Â "Having at least one entry simplifies handling of the entries
> circular collection"
> Â Â Â Â Â Â Â Â firstIndex _ 1.
> Â Â Â Â Â Â Â Â lastIndex _ 1.
> Â Â Â Â Â Â Â Â entries at: 1 put: 'Transcript'.
> Â Â Â Â Â Â Â Â unfinishedEntry reset.
>
> Â Â Â Â Â Â Â Â logToFile ifTrue: [
> Â Â Â Â Â Â Â Â Â Â Â Â stream _ StandardFileStream forceNewFileNamed: self
> filename.
> Â Â Â Â Â Â Â Â Â Â Â Â [
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stream nextPutAll: 'Transcript log started:
> '.
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â DateAndTime now printOn: stream.
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stream
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â lf;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll:
> '------------------------------------------------------------------------';
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â lf
> Â Â Â Â Â Â Â Â Â Â Â Â ] ensure: [ stream close ]]].
> Â Â Â Â self display! !
>
> !NewTranscript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011
> 14:16'!
> log: aString
> Â Â Â Â self addEntry: aString.
> Â Â Â Â self display! !
>
> !NewTranscript class methodsFor: 'preferred protocol' stamp: 'jmv 2/18/2011
> 11:49'!
> logToFile
> Â Â Â Â "
> Â Â Â Â self logToFile
> Â Â Â Â "
> Â Â Â Â logToFile _ true! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:20'!
> cr
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â In the older TranscriptStream, it added a CR character.
> Â Â Â Â Now, finish the current incomplete entry."
>
> Â Â Â Â self finishEntry! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:20'!
> crtab
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â End the current entry, and start a new one starting with a single tab
> character."
>
> Â Â Â Â self cr; tab! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:21'!
> endEntry
> Â Â Â Â "For compatibility with old TranscriptStream. nop here"! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:21'!
> flush
> Â Â Â Â "For compatibility with old TranscriptStream. nop here"! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 14:17'!
> nextPut: aCharacter
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â Append aCharacter to the unfinishedEntry.
> Â Â Â Â cr characters sent with this message do NOT finish the current
> unfinishedEntry."
>
> Â Â Â Â unfinishedEntry nextPut: aCharacter.
> Â Â Â Â self displayUnfinishedEntry! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 14:17'!
> nextPutAll: aString
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â Append aString to the unfinishedEntry.
> Â Â Â Â cr characters sent with this message do NOT finish the current
> unfinishedEntry."
>
> Â Â Â Â unfinishedEntry nextPutAll: aString.
> Â Â Â Â self displayUnfinishedEntry! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:20'!
> print: anObject
> Â Â Â Â "Stream protocol"
> Â Â Â Â anObject printOn: self! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:22'!
> show: anObject
> Â Â Â Â "Old TranscriptStream protocol."
> Â Â Â Â self nextPutAll: anObject asString! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:22'!
> space
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â Append a space character to the receiver."
>
> Â Â Â Â self nextPut: Character space! !
>
> !NewTranscript class methodsFor: 'old Transcript compatibility' stamp: 'jmv
> 2/18/2011 11:22'!
> tab
> Â Â Â Â "WriteStream protocol.
> Â Â Â Â Append a tab character to the receiver."
>
> Â Â Â Â self nextPut: Character tab! !
>
> !NewTranscript class methodsFor: 'private' stamp: 'jmv 2/18/2011 12:59'!
> addEntry: aString
> Â Â Â Â "Add a new entrie to the entries circular list. If full, a new entry
> will replace the oldest one."
> Â Â Â Â | msg now |
> Â Â Â Â logToFile ifTrue: [
> Â Â Â Â Â Â Â Â now _ DateAndTime now.
> Â Â Â Â Â Â Â Â msg _ String streamContents: [ :strm |
> Â Â Â Â Â Â Â Â Â Â Â Â now printWithMsOn: strm.
> Â Â Â Â Â Â Â Â Â Â Â Â strm
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll: ' process:';
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll: Processor activeProcess priority
> printString;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPut: $ ;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll: Processor activeProcess hash
> printString;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPut: $ ;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll: aString;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â lf ]].
>
> Â Â Â Â self addEntry: aString logToFile: msg! !
>
> !NewTranscript class methodsFor: 'private' stamp: 'jmv 2/18/2011 12:34'!
> addEntry: aString logToFile: otherString
> Â Â Â Â "Add a new entrie to the entries circular list. If full, a new entry
> will replace the oldest one."
> Â Â Â Â | stream |
> Â Â Â Â accessSemaphore critical: [
>
> Â Â Â Â Â Â Â Â "Internal circular collection"
> Â Â Â Â Â Â Â Â lastIndex _ lastIndex \\ self maxEntries + 1.
> Â Â Â Â Â Â Â Â firstIndex = lastIndex ifTrue: [
> Â Â Â Â Â Â Â Â Â Â Â Â firstIndex _ firstIndex \\ self maxEntries + 1 ].
> Â Â Â Â Â Â Â Â entries at: lastIndex put: aString.
>
> Â Â Â Â Â Â Â Â "external file"
> Â Â Â Â Â Â Â Â otherString ifNotNil: [
> Â Â Â Â Â Â Â Â Â Â Â Â [
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stream _ StandardFileStream fileNamed: self
> filename.
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â stream
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â setToEnd;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â nextPutAll: otherString;
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â flush]
> Â Â Â Â Â Â Â Â Â Â Â Â ensure: [ stream close ]
> Â Â Â Â Â Â Â Â ]
> Â Â Â Â ]! !
>
> !NewTranscript class methodsFor: 'private' stamp: 'jmv 2/18/2011 14:16'!
> finishEntry
> Â Â Â Â | newEntry |
> Â Â Â Â newEntry _ unfinishedEntry contents.
> Â Â Â Â unfinishedEntry reset.
> Â Â Â Â self addEntry: newEntry.
> Â Â Â Â self display! !
>
> !NewTranscript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:20'!
> display
> Â Â Â Â showOnDisplay ifTrue: [
> Â Â Â Â Â Â Â Â self displayOn: Display.
> Â Â Â Â Â Â Â Â lastDisplayTime _ DateAndTime now ]! !
>
> !NewTranscript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:09'!
> displayOn: aForm
> Â Â Â Â "
> Â Â Â Â experimentos
> Â Â Â Â NewTranscript displayOn: Display
> Â Â Â Â "
> Â Â Â Â | font port count i string x y fh f |
> Â Â Â Â aForm border: (innerRectangle outsetBy: 3) width: 3.
> Â Â Â Â aForm fill: innerRectangle fillColor: Color white.
> Â Â Â Â port _ BitBlt toForm: aForm.
> Â Â Â Â port clipWidth: innerRectangle right.
> Â Â Â Â font _ StrikeFont default.
> Â Â Â Â font installOn: port foregroundColor: Color black.
>
> Â Â Â Â fh _ font height.
> Â Â Â Â count _ innerRectangle height // fh-1.
> Â Â Â Â x _ innerRectangle left.
> Â Â Â Â y _ innerRectangle top.
> Â Â Â Â f _ firstIndex-1.
> Â Â Â Â firstIndex > lastIndex ifTrue: [ f _ f - self maxEntries ].
> Â Â Â Â i _ (lastIndex - count max: f) \\ self maxEntries + 1.
> Â Â Â Â [
> Â Â Â Â Â Â Â Â string _ entries at: i.
> Â Â Â Â Â Â Â Â port displayString: string from: 1 to: string size at: x@y
> strikeFont: font kern: font baseKern negated.
> Â Â Â Â Â Â Â Â y _ y + fh.
> Â Â Â Â Â Â Â Â i = lastIndex
> Â Â Â Â ] whileFalse: [ i _ i \\ self maxEntries + 1 ].
>
> Â Â Â Â string _ unfinishedEntry contents.
> Â Â Â Â port displayString: string from: 1 to: string size at: x@y
> strikeFont: font kern: font baseKern negated.! !
>
> !NewTranscript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:23'!
> displayUnfinishedEntry
> Â Â Â Â showOnDisplay ifTrue: [
> Â Â Â Â Â Â Â Â (lastDisplayTime isNil or: [ (DateAndTime now -
> lastDisplayTime) totalSeconds > 1 ])
> Â Â Â Â Â Â Â Â Â Â Â Â ifTrue: [ ^self display ].
> Â Â Â Â Â Â Â Â self displayUnfinishedEntryOn: Display ]! !
>
> !NewTranscript class methodsFor: 'displaying' stamp: 'jmv 2/18/2011 14:14'!
> displayUnfinishedEntryOn: aForm
>
> Â Â Â Â | font port count string x y fh |
> Â Â Â Â port _ BitBlt toForm: aForm.
> Â Â Â Â port clipWidth: innerRectangle right.
> Â Â Â Â font _ StrikeFont default.
> Â Â Â Â font installOn: port foregroundColor: Color black.
>
> Â Â Â Â fh _ font height.
> Â Â Â Â count _ innerRectangle height // fh-1.
> Â Â Â Â x _ innerRectangle left.
>
> Â Â Â Â string _ unfinishedEntry contents.
> Â Â Â Â y _ ((lastIndex - firstIndex \\ self maxEntries) min: count-1) + 1 *
> font height + innerRectangle top.
> Â Â Â Â port displayString: string from: 1 to: string size at: x@y
> strikeFont: font kern: font baseKern negated.! !
>
> !NewTranscript class methodsFor: 'class initialization' stamp: 'jmv
> 2/18/2011 13:13'!
> initialize
> Â Â Â Â "
> Â Â Â Â self initialize
> Â Â Â Â "
> Â Â Â Â showOnDisplay _ true.
> Â Â Â Â innerRectangle _ 20@20 extent: 300@500.
> Â Â Â Â logToFile _ false.
> Â Â Â Â entries _ Array new: self maxEntries.
> Â Â Â Â unfinishedEntry _ '' writeStream.
> Â Â Â Â accessSemaphore _ Semaphore forMutualExclusion.
> Â Â Â Â self clear! !
>
> !NewTranscript class methodsFor: 'constants' stamp: 'jmv 2/18/2011 12:33'!
> filename
> Â Â Â Â ^'transcript.txt'! !
>
> !NewTranscript class methodsFor: 'constants' stamp: 'jmv 2/18/2011 12:59'!
> maxEntries
> Â Â Â Â ^1000! !
>
> NewTranscript initialize!
>
>
>
>
--
Best regards,
Igor Stasenko AKA sig.
Feb. 18, 2011
Re: [Pharo-project] Issue 1506 in pharo: clean Object a bit....
by pharo@googlecode.com
Comment #2 on issue 1506 by DougEdmu...(a)gmail.com: clean Object a bit....
http://code.google.com/p/pharo/issues/detail?id=1506
nb for future editions of Pharo by Example:
The removal of Object >> #instanceVariableValues
will require changes to p292-293 of PBE
Feb. 18, 2011
[Pharo-project] sqInt setCompilerInitialized(sqInt newFlag)
by Stéphane Ducasse
Does anybody have an idea what is the purpose of this function in the vm?
Stef
sqInt setCompilerInitialized(sqInt newFlag) {
register struct foo * foo = &fum;
sqInt oldFlag;
oldFlag = foo->compilerInitialized;
foo->compilerInitialized = newFlag;
return oldFlag;
}
Feb. 18, 2011
Re: [Pharo-project] MNU MIMETYPE class>>forURIReturnSingleMimeTypeOrDefault:
by Stéphane Ducasse
I'm in the train so no internet access.
Tell us what should be done? It is a fix to be integrated?
> Well I find the solution in the 2797 issue. [1]
>
>
> thanks anyway
>
> [1] http://code.google.com/p/pharo/issues/detail?id=2797
>
> On Fri, Feb 18, 2011 at 11:57 AM, Diogenes Moreira <diogenes.moreira(a)gmail.com> wrote:
> Hi..
>
> that is a StandardFileStream bug or I'm loosing some thing...
> may be a versions problem..
>
> somebody can say where is implement that method.
>
>
> Best
>
Feb. 18, 2011