Skip to content

Instantly share code, notes, and snippets.

aTrait := TAsyncStream. "Paint a tree of classes which use a specified trait. Click to list all the methods. Click with Modifier (command on mac, and ctrl on windows and linux) only to filter out the methods overriden by that class."
notInterestedForNow := 'Async'.
classesFilter := GtSearchImageClassesFilter new
select: [ :class | class usesTrait: aTrait ].
classes := classesFilter result toArray wait asSet.
superClasses := classes flatCollect: [ :class | class allSuperclasses ].
stencilForNodes := [ :class |
| element |
element := BrLabel new
text: class name;
Object subclass: #ClassCollectionThatMightApplyReification
instanceVariableNames: 'classMethodsEndingWithClass instanceMethodsEndingWithClass'
classVariableNames: ''
package: 'KILearningMOOC'!
!ClassCollectionThatMightApplyReification commentStamp: '<historical>' prior: 0!
I hold a class collection that I guess applies Reification pattern based on the use of a method selector that ends with "Class".
This is part of my learning note of [1.6] Reification and delegation - Advanced Object-Oriented Design MOOC.
Ref. https://www.youtube.com/watch?v=eVxnBjySbx8&list=PL2okA_2qDJ-k9qaQomNEoAo_sA2LsE2Y3&index=8!
Object subclass: #ItemHolder
instanceVariableNames: 'items'
classVariableNames: ''
package: 'KICodingExerciseForGToolkit'!
!ItemHolder commentStamp: '<historical>' prior: 0!
I have items slot holding an Interval and implement two custom views. gtItemsView: just forwards to self items to render with a selector #gtItemsFor:. gtItemsWithFilterView: is my result of the coding exercise to introduce a menu dropdown button to filter out the elements the items.!
!ItemHolder methodsFor: 'initialization' stamp: 'GlamorousAuthor 6/11/2025 00:22'!
initialize
(LePage named: 'How to setup an environment for experiment')
addSnippet: (LeTextSnippet new
string: '# 1. Load a package';
addSnippet: (LeTextSnippet new
string: 'The file is compiled as a package and currently uploaded to gist, not as a Github repo. Download and manually import it.';
yourself);
addSnippet: (LePharoSnippet new
code: 's := ZnClient new
get: ''https://gist.githubusercontent.com/iriyak/ecd5231cd8d67172270082bc7d53f2a6/raw/ad6b9971592072ed3ed75903aaf3b076d1261e15/KIExtensionsForGToolkit4P3.st''.
CodeImporter evaluateString: s';
P3ClientLoginPane subclass: #P3ClientLoginPane2
instanceVariableNames: 'name'
classVariableNames: ''
package: 'KIExtensionsForGToolkit4P3'!
!P3ClientLoginPane2 methodsFor: 'as yet unclassified' stamp: 'GlamorousAuthor 5/27/2025 22:04'!
nameDescription
<magritteDescription>
^ MAStringDescription new
priority: 100;
'From Pharo11.0.0 of 7 March 2024 [Build information: Pharo-11.0.0+build.726.sha.aece1b5473acf3830a0e082c1bc3a15d4ff3522b (64 Bit)] on 24 May 2025 at 10:24:50.586 pm'!
!Behavior methodsFor: '*KIExtensionsForGt' stamp: 'GlamorousAuthor 5/24/2025 20:22'!
gtMyOverviewFor: aView
<gtClassView>
^ aView explicit
title: 'Overview';
tooltip: 'Overview';
priority: 1;
disableAsync;
gtViewAllP3ClientsIn: composite
"
Remarks
1. 'composite columnedList' creates a GtPhlowColumnedListView.
2. The view collects P3Clients by 'self allInstances'. So not performant.
3. Start/stop button doesn't trigger refreshing this custom view.
4. Start/stop fails while user/password/database is left as blank.
"
keyword := 'phlow'.
databases := LeDatabasesRegistry uniqueInstance defaultLogicalDatabase databases.
found := OrderedCollection new.
databases
do: [ :database |
| asyncPages |
asyncPages := database asyncPagesForWord: keyword.
(asyncPages asyncSimilarCopy
do: [ :page | found add: page -> database databaseName ]) wait ].
gtMyOverviewFor: aView
<gtClassView>
^ aView explicit
title: 'MyOverView';
tooltip: 'MyOverView';
priority: 1;
disableAsync;
stencil: [ | left right contentBuilder labelBuilder className |
contentBuilder := [ BlElement new
layout: BlLinearLayout vertical;
var req = require("request");
req.get({
url: "https://holidays-jp.github.io/api/v1/2021/date.json",
headers: { "content-type": "application/json" }
}, (error, response, body) => { gen(body) });
function gen(body) {
var arr1 = [];
arr1.push('LOCK TABLES `c_holiday` WRITE;\n');