Torsten Bergmann uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-tbn.7.mcz
==================== Summary ====================
Name: Help-Squeak-Project-tbn.7
Author: tbn
Time: 1 October 2010, 12:59:33.88 am
UUID: a8ff9bb9-dd2c-9e43-a49e-c088c05f1cd8
Ancestors: Help-Squeak-Project-sd.6
reorder books
=============== Diff against Help-Squeak-Project-sd.6 ===============
Item was added:
+ ----- Method: SqueakHelp classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(SqueakProjectHelp SqueakToolsHelp SqueakTutorials)!
Item was changed:
----- Method: SqueakProjectHelp classSide>>bookName (in category 'accessing') -----
bookName
+ ^'The Project'!
- ^'Squeak Project'!
Item was added:
+ ----- Method: SqueakTutorials classSide>>introduction (in category 'pages') -----
+ introduction
+ "This method was automatically generated. Edit it using:"
+ "SqueakTutorials edit: #introduction"
+ ^HelpTopic
+ title: 'Introduction'
+ contents:
+ 'Here you will some short tutorials on how to use Squeak for daily tasks. Feel free to add your own.!!' readStream nextChunkText!
Item was added:
+ ----- Method: SqueakTutorials classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(introduction)!
Torsten Bergmann uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-tbn.7.mcz
==================== Summary ====================
Name: Help-Squeak-Project-tbn.7
Author: tbn
Time: 1 October 2010, 12:59:33.88 am
UUID: a8ff9bb9-dd2c-9e43-a49e-c088c05f1cd8
Ancestors: Help-Squeak-Project-sd.6
reorder books
=============== Diff against Help-Squeak-Project-sd.6 ===============
Item was added:
+ ----- Method: SqueakHelp classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(SqueakProjectHelp SqueakToolsHelp SqueakTutorials)!
Item was changed:
----- Method: SqueakProjectHelp classSide>>bookName (in category 'accessing') -----
bookName
+ ^'The Project'!
- ^'Squeak Project'!
Item was added:
+ ----- Method: SqueakTutorials classSide>>introduction (in category 'pages') -----
+ introduction
+ "This method was automatically generated. Edit it using:"
+ "SqueakTutorials edit: #introduction"
+ ^HelpTopic
+ title: 'Introduction'
+ contents:
+ 'Here you will some short tutorials on how to use Squeak for daily tasks. Feel free to add your own.!!' readStream nextChunkText!
Item was added:
+ ----- Method: SqueakTutorials classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(introduction)!
Torsten Bergmann uploaded a new version of Help-Squeak-Project to project The Trunk:
http://source.squeak.org/trunk/Help-Squeak-Project-tbn.7.mcz
==================== Summary ====================
Name: Help-Squeak-Project-tbn.7
Author: tbn
Time: 1 October 2010, 12:59:33.88 am
UUID: a8ff9bb9-dd2c-9e43-a49e-c088c05f1cd8
Ancestors: Help-Squeak-Project-sd.6
reorder books
=============== Diff against Help-Squeak-Project-sd.6 ===============
Item was added:
+ ----- Method: SqueakHelp classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(SqueakProjectHelp SqueakToolsHelp SqueakTutorials)!
Item was changed:
----- Method: SqueakProjectHelp classSide>>bookName (in category 'accessing') -----
bookName
+ ^'The Project'!
- ^'Squeak Project'!
Item was added:
+ ----- Method: SqueakTutorials classSide>>introduction (in category 'pages') -----
+ introduction
+ "This method was automatically generated. Edit it using:"
+ "SqueakTutorials edit: #introduction"
+ ^HelpTopic
+ title: 'Introduction'
+ contents:
+ 'Here you will some short tutorials on how to use Squeak for daily tasks. Feel free to add your own.!!' readStream nextChunkText!
Item was added:
+ ----- Method: SqueakTutorials classSide>>pages (in category 'accessing') -----
+ pages
+ ^#(introduction)!
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.54.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.54
Author: tbn
Time: 1 October 2010, 12:36:23.197 am
UUID: 71f0e5f3-45ac-744d-8166-3a8f08b5b806
Ancestors: HelpSystem-Core-tbn.53
"Implementation" should be placed before "API Documentation" in "HelpOnHelp" book. We can use the new feature from http://code.google.com/p/pharo/issues/detail?id=3022
=============== Diff against HelpSystem-Core-tbn.53 ===============
Item was changed:
----- Method: HelpOnHelp classSide>>pages (in category 'accessing') -----
pages
+ ^#(introduction HelpHowToHelpTopics HelpAPIDocumentation)!
- ^#(introduction)!
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.54.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.54
Author: tbn
Time: 1 October 2010, 12:36:23.197 am
UUID: 71f0e5f3-45ac-744d-8166-3a8f08b5b806
Ancestors: HelpSystem-Core-tbn.53
"Implementation" should be placed before "API Documentation" in "HelpOnHelp" book. We can use the new feature from http://code.google.com/p/pharo/issues/detail?id=3022
=============== Diff against HelpSystem-Core-tbn.53 ===============
Item was changed:
----- Method: HelpOnHelp classSide>>pages (in category 'accessing') -----
pages
+ ^#(introduction HelpHowToHelpTopics HelpAPIDocumentation)!
- ^#(introduction)!
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.54.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.54
Author: tbn
Time: 1 October 2010, 12:36:23.197 am
UUID: 71f0e5f3-45ac-744d-8166-3a8f08b5b806
Ancestors: HelpSystem-Core-tbn.53
"Implementation" should be placed before "API Documentation" in "HelpOnHelp" book. We can use the new feature from http://code.google.com/p/pharo/issues/detail?id=3022
=============== Diff against HelpSystem-Core-tbn.53 ===============
Item was changed:
----- Method: HelpOnHelp classSide>>pages (in category 'accessing') -----
pages
+ ^#(introduction HelpHowToHelpTopics HelpAPIDocumentation)!
- ^#(introduction)!
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.53.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.53
Author: tbn
Time: 1 October 2010, 12:11:03.269 am
UUID: cffd5e9f-f4db-224d-b40d-7fdab1718a39
Ancestors: HelpSystem-Core-tbn.52
Custom help books are now able to define where subbooks should be placed/displayed
See also http://code.google.com/p/pharo/issues/detail?id=3022 and thanx to Enrico Spinielli for the idea and initial implementation.
=============== Diff against HelpSystem-Core-tbn.52 ===============
Item was changed:
----- Method: CustomHelpHelpBuilder>>createTopicFrom: (in category 'private') -----
createTopicFrom: aDescription
+ "Create a topic from a description stored on a class.
+ aDescription can specify (via #pages) the name of a class and not
+ only a selector. This allows for hierarchies with 'subtrees in the middle'"
- "Create a topic from a description stored on a class"
+ |topic page pageClasses |
- |topic page method pragma |
topic := HelpTopic named: aDescription bookName.
topic key: aDescription key.
+ topic icon: aDescription icon.
+ pageClasses := Set new.
+ aDescription pages do: [:pageSelectorOrClass|
+ page:= (Smalltalk hasClassNamed: pageSelectorOrClass asString)
+ ifFalse: [aDescription perform: pageSelectorOrClass]
+ ifTrue: [pageClasses add: (Smalltalk classNamed: pageSelectorOrClass asString).
+ (Smalltalk classNamed: pageSelectorOrClass asString) asHelpTopic].
- topic icon: aDescription icon.
- aDescription pages do: [:pageSelector|
- page := aDescription perform: pageSelector.
topic addSubtopic: page.
].
+ ((aDescription subclasses asSet)
+ removeAllFoundIn: pageClasses;
+ yourself) do: [:subclass | topic subtopics add: subclass asHelpTopic ].
- aDescription subclasses do: [:subclass |
- topic subtopics add: subclass asHelpTopic ].
^topic!
Item was changed:
----- Method: HelpHowToHelpTopicsFromCode classSide>>pages (in category 'accessing') -----
pages
+ ^#(overview step1 step2 step3 step4 step5 step6 step7)!
- ^#(overview step1 step2 step3 step4 step5)!
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step6 (in category 'pages') -----
+ step6
+ ^HelpTopic
+ title: 'Step 6 - Add more structure'
+ contents:
+ 'STEP 6 - ADD MORE STRUCTURE
+
+ If you add a new subclass to your custom help class and repeating step 2 to 4 you can
+ profide new substructures (subbooks) since the help books are mapped to the
+ class hierarchy. Example:
+
+ MyAppHelp subclass: #MyAppTutorial
+ instanceVariableNames: ''''
+ classVariableNames: ''''
+ poolDictionaries: ''''
+ category: ''MyApp-Help''
+
+ then implement a #bookName, the pages and a #pages method as before on this new
+ class and reopen the help browser.
+ '
+ !
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step7 (in category 'pages') -----
+ step7
+ ^HelpTopic
+ title: 'Step 7 - Tips and Tricks'
+ contents:
+ 'STEP 7 - TIPS AND TRICKS
+
+ Tip1:
+ If you implement the #pages method you can also
+ use the name of a custom help class that should be
+ integrated between the specific pages:
+
+ #pages
+ ^(firstPage MyAppTutorial secondPage)
+
+ Tip2:
+ You can easily edit the help contents of a page by
+ using the #edit: message. For our example just evaluate:
+
+ MyAppHelp edit: #firstPage
+
+ This will open a workspace with the help contents and
+ when you accept it it will be saved back to the help
+ method defining the topic.
+
+
+ '
+ !
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.53.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.53
Author: tbn
Time: 1 October 2010, 12:11:03.269 am
UUID: cffd5e9f-f4db-224d-b40d-7fdab1718a39
Ancestors: HelpSystem-Core-tbn.52
Custom help books are now able to define where subbooks should be placed/displayed
See also http://code.google.com/p/pharo/issues/detail?id=3022 and thanx to Enrico Spinielli for the idea and initial implementation.
=============== Diff against HelpSystem-Core-tbn.52 ===============
Item was changed:
----- Method: CustomHelpHelpBuilder>>createTopicFrom: (in category 'private') -----
createTopicFrom: aDescription
+ "Create a topic from a description stored on a class.
+ aDescription can specify (via #pages) the name of a class and not
+ only a selector. This allows for hierarchies with 'subtrees in the middle'"
- "Create a topic from a description stored on a class"
+ |topic page pageClasses |
- |topic page method pragma |
topic := HelpTopic named: aDescription bookName.
topic key: aDescription key.
+ topic icon: aDescription icon.
+ pageClasses := Set new.
+ aDescription pages do: [:pageSelectorOrClass|
+ page:= (Smalltalk hasClassNamed: pageSelectorOrClass asString)
+ ifFalse: [aDescription perform: pageSelectorOrClass]
+ ifTrue: [pageClasses add: (Smalltalk classNamed: pageSelectorOrClass asString).
+ (Smalltalk classNamed: pageSelectorOrClass asString) asHelpTopic].
- topic icon: aDescription icon.
- aDescription pages do: [:pageSelector|
- page := aDescription perform: pageSelector.
topic addSubtopic: page.
].
+ ((aDescription subclasses asSet)
+ removeAllFoundIn: pageClasses;
+ yourself) do: [:subclass | topic subtopics add: subclass asHelpTopic ].
- aDescription subclasses do: [:subclass |
- topic subtopics add: subclass asHelpTopic ].
^topic!
Item was changed:
----- Method: HelpHowToHelpTopicsFromCode classSide>>pages (in category 'accessing') -----
pages
+ ^#(overview step1 step2 step3 step4 step5 step6 step7)!
- ^#(overview step1 step2 step3 step4 step5)!
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step6 (in category 'pages') -----
+ step6
+ ^HelpTopic
+ title: 'Step 6 - Add more structure'
+ contents:
+ 'STEP 6 - ADD MORE STRUCTURE
+
+ If you add a new subclass to your custom help class and repeating step 2 to 4 you can
+ profide new substructures (subbooks) since the help books are mapped to the
+ class hierarchy. Example:
+
+ MyAppHelp subclass: #MyAppTutorial
+ instanceVariableNames: ''''
+ classVariableNames: ''''
+ poolDictionaries: ''''
+ category: ''MyApp-Help''
+
+ then implement a #bookName, the pages and a #pages method as before on this new
+ class and reopen the help browser.
+ '
+ !
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step7 (in category 'pages') -----
+ step7
+ ^HelpTopic
+ title: 'Step 7 - Tips and Tricks'
+ contents:
+ 'STEP 7 - TIPS AND TRICKS
+
+ Tip1:
+ If you implement the #pages method you can also
+ use the name of a custom help class that should be
+ integrated between the specific pages:
+
+ #pages
+ ^(firstPage MyAppTutorial secondPage)
+
+ Tip2:
+ You can easily edit the help contents of a page by
+ using the #edit: message. For our example just evaluate:
+
+ MyAppHelp edit: #firstPage
+
+ This will open a workspace with the help contents and
+ when you accept it it will be saved back to the help
+ method defining the topic.
+
+
+ '
+ !
Torsten Bergmann uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-tbn.53.mcz
==================== Summary ====================
Name: HelpSystem-Core-tbn.53
Author: tbn
Time: 1 October 2010, 12:11:03.269 am
UUID: cffd5e9f-f4db-224d-b40d-7fdab1718a39
Ancestors: HelpSystem-Core-tbn.52
Custom help books are now able to define where subbooks should be placed/displayed
See also http://code.google.com/p/pharo/issues/detail?id=3022 and thanx to Enrico Spinielli for the idea and initial implementation.
=============== Diff against HelpSystem-Core-tbn.52 ===============
Item was changed:
----- Method: CustomHelpHelpBuilder>>createTopicFrom: (in category 'private') -----
createTopicFrom: aDescription
+ "Create a topic from a description stored on a class.
+ aDescription can specify (via #pages) the name of a class and not
+ only a selector. This allows for hierarchies with 'subtrees in the middle'"
- "Create a topic from a description stored on a class"
+ |topic page pageClasses |
- |topic page method pragma |
topic := HelpTopic named: aDescription bookName.
topic key: aDescription key.
+ topic icon: aDescription icon.
+ pageClasses := Set new.
+ aDescription pages do: [:pageSelectorOrClass|
+ page:= (Smalltalk hasClassNamed: pageSelectorOrClass asString)
+ ifFalse: [aDescription perform: pageSelectorOrClass]
+ ifTrue: [pageClasses add: (Smalltalk classNamed: pageSelectorOrClass asString).
+ (Smalltalk classNamed: pageSelectorOrClass asString) asHelpTopic].
- topic icon: aDescription icon.
- aDescription pages do: [:pageSelector|
- page := aDescription perform: pageSelector.
topic addSubtopic: page.
].
+ ((aDescription subclasses asSet)
+ removeAllFoundIn: pageClasses;
+ yourself) do: [:subclass | topic subtopics add: subclass asHelpTopic ].
- aDescription subclasses do: [:subclass |
- topic subtopics add: subclass asHelpTopic ].
^topic!
Item was changed:
----- Method: HelpHowToHelpTopicsFromCode classSide>>pages (in category 'accessing') -----
pages
+ ^#(overview step1 step2 step3 step4 step5 step6 step7)!
- ^#(overview step1 step2 step3 step4 step5)!
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step6 (in category 'pages') -----
+ step6
+ ^HelpTopic
+ title: 'Step 6 - Add more structure'
+ contents:
+ 'STEP 6 - ADD MORE STRUCTURE
+
+ If you add a new subclass to your custom help class and repeating step 2 to 4 you can
+ profide new substructures (subbooks) since the help books are mapped to the
+ class hierarchy. Example:
+
+ MyAppHelp subclass: #MyAppTutorial
+ instanceVariableNames: ''''
+ classVariableNames: ''''
+ poolDictionaries: ''''
+ category: ''MyApp-Help''
+
+ then implement a #bookName, the pages and a #pages method as before on this new
+ class and reopen the help browser.
+ '
+ !
Item was added:
+ ----- Method: HelpHowToHelpTopicsFromCode classSide>>step7 (in category 'pages') -----
+ step7
+ ^HelpTopic
+ title: 'Step 7 - Tips and Tricks'
+ contents:
+ 'STEP 7 - TIPS AND TRICKS
+
+ Tip1:
+ If you implement the #pages method you can also
+ use the name of a custom help class that should be
+ integrated between the specific pages:
+
+ #pages
+ ^(firstPage MyAppTutorial secondPage)
+
+ Tip2:
+ You can easily edit the help contents of a page by
+ using the #edit: message. For our example just evaluate:
+
+ MyAppHelp edit: #firstPage
+
+ This will open a workspace with the help contents and
+ when you accept it it will be saved back to the help
+ method defining the topic.
+
+
+ '
+ !
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.385.mcz
==================== Summary ====================
Name: Collections-nice.385
Author: nice
Time: 30 September 2010, 11:46:29.277 pm
UUID: 4d54da08-721a-4a4d-8387-914046189879
Ancestors: Collections-ul.384
Improve comment of Heap. Please feel free to improve me.
As the class comment did start with a bit misleading comparison against SortedCollection, provides an optional #fullySort operation to fully sort the Heap and restore comparison ground - hope I didn't spoil announced O(n log n) efficiency.
Of course, #fullySort has no interest for priority queues, but a Heap could be of more general use.
=============== Diff against Collections-ul.384 ===============
Item was changed:
SequenceableCollection subclass: #Heap
instanceVariableNames: 'array tally sortBlock indexUpdateBlock'
classVariableNames: ''
poolDictionaries: ''
category: 'Collections-Sequenceable'!
+ !Heap commentStamp: 'nice 9/30/2010 23:22' prior: 0!
+ Class Heap implements a special data structure commonly referred to as 'heap' [ http://en.wikipedia.org/wiki/Heap_%28data_structure%29 ]
+ A Heap is a kind of binary tree stored in a linear array - see details after the instance variables description.
- !Heap commentStamp: '<historical>' prior: 0!
- Class Heap implements a special data structure commonly referred to as 'heap'. Heaps are more efficient than SortedCollections if:
- a) Elements are only removed at the beginning
- b) Elements are added with arbitrary sort order.
- The sort time for a heap is O(n log n) in all cases.
+ Heaps are good at handling priority queues because:
+ 1) greatest priority element according to the sort block will be stored in first position and thus accessed in O(1) operations
+ 2) worse time for inserting or removing an element is in O(log n) operations, where n is the size of the Heap
+ Insertion/Removal times are more efficient than above upper bound, provided that:
+ a) Elements are only removed at the beginning
+ b) Elements are added with arbitrary sort order.
+ 3) there is no need to fully sort the Heap, which makes it more efficient than a SortedCollection
+
+ The heap can be fully sorted by sending the message #fullySort.
+ Worse time for fully sorting the Heap is in O(n log n) operations, but this is rarely used a feature.
+ Remind that the Heap does not fully sort the collection if you don't ask.
+ Thus don't expect #do: and other iterators to enumerate elements according to the sortBlock order.
+
Instance variables:
array <Array> The data repository
tally <Integer> The number of elements in the heap
sortBlock <Block|nil> A two-argument block defining the sort order,
or nil in which case the default sort order is
[:element1 :element2| element1 <= element2]
indexUpdateBlock <Block|nil>
A two-argument block of the form [:data :index | ... ]
which allows an application object to keep track of its
index within the heap. Useful for quick heap update
when object's sort value changes (for example, when an
object in a priority queue has its priority increased
by an external event, you don't want to have to search
through the whole heap to find the index before fixing
+ the heap). No update occurs if nil.
+
+ The Heap can be viewed as a binary tree (every node in the tree has at most two children).
+ The root is stored in first slot of internal array.
+ The children are stored in next two slots.
+ The children of children in next four slots.
+ etc...
+ For a node A of index i (1 based), the two children B1 and B2 are thus stored in indices (2*i) and (2*i+1).
+ Of course, the children indices must be less than the tally otherwise they are considered inexistent.
+
+ The Heap does arrange to preserve the following invariant:
+ For any children B of a node A, A is sorted before B, in other words, (self sort: A before: B) = true
+ This implies that the root is always the first element according to sort order.
+
+ !
- the heap). No update occurs if nil.!
Item was added:
+ ----- Method: Heap>>fullySort (in category 'accessing') -----
+ fullySort
+ "Fully sort the heap.
+ This method preserves the heap invariants and can thus be sent safely"
+ self privateReverseSort.
+ 1 to: tally // 2 do: [:i | array swap: i with: 1 + tally - i]!
Item was added:
+ ----- Method: Heap>>privateReverseSort (in category 'private') -----
+ privateReverseSort
+ "Arrange to have the array sorted in reverse order.
+ WARNING: this method breaks the heap invariants. It's up to the sender to restore them afterwards."
+ | oldTally |
+ oldTally := tally.
+ [tally > 1] whileTrue:
+ [array swap: 1 with: tally.
+ tally := tally - 1.
+ self downHeapSingle: 1].
+ tally := oldTally!