This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Run this in Pharo 11" | |
"Load Cormas without UI" | |
Metacello new | |
onConflictUseLoaded; | |
onWarningLog; | |
repository: 'github://cormas/cormas:v0.5'; | |
baseline: 'Cormas'; | |
load: #Core. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prices := #(13 2 13 15 10 8 6.5 14 12 13 8). "prix en euro" | |
"----------------------" | |
sum := 0. | |
prices do: [ :each | | |
sum := sum + each ]. | |
sum. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url := 'http://192.168.27.64:8080/shot.jpg'. | |
client := ZnClient new | |
url: url; | |
yourself. | |
imagePresenter := SpImagePresenter new. | |
imagePresenter autoScale: true. | |
imagePresenter open. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositoryName := 'DataFrame'. | |
oldVersionTag := 'v1.0'. | |
newVersionTag := 'v2.0'. | |
repository := (IceRepository registry detect: [ :repo | | |
repo isValid and: [ repo name = repositoryName ] ]). | |
oldCommit := (repository tags detect: [ :tag | tag name = oldVersionTag ]) commit. | |
newCommit := (repository tags detect: [ :tag | tag name = newVersionTag ]) commit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numberOfPoints := 10000. | |
scale := 30. | |
pointExtent := 2@2. | |
color1 := Color fromString: '3288BD'. | |
color2 := Color fromString: 'D53E4F'. | |
mu1 := #(1 0) asPMVector. | |
mu2 := #(-1.5 -1) asPMVector. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"In Pharo 7" | |
methods := Smalltalk image allClasses flatCollect: [ :aClass | | |
aClass methods ]. | |
signatures := methods collect: [ :method | method name ]. | |
fileReference := '/Users/oleks/Documents/Data/Methods/signatures7.ston' asFileReference. | |
fileReference writeStreamDo: [ :stream | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Metacello new | |
baseline: 'DataFrame'; | |
repository: 'github://PolyMathOrg/DataFrame/src'; | |
load. | |
covidDataFile := '/Users/oleks/Documents/Data/COVID-19-geographic-disbtribution-worldwide-2020-03-17.csv' asFileReference. | |
"The date format is not understood by Pharo by default. | |
So we read CSV with all values as strings (without type inference) | |
and then manually convert dates and numbers" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rules for migrating from PetitParser to PetitParser2 | |
# Source: https://kursjan.github.io/petitparser2/migration.html + Cyril Ferlicot (https://ferlicot.fr/) | |
PPParser => PP2Node | |
asParser => asPParser | |
PPCompositeParser => PP2CompositeNode | |
isPetitFailure => isPetit2Failure | |
PPCompositeParserTest => PP2CompositeNodeTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i | |
me | |
my | |
myself | |
we | |
our | |
ours | |
ourselves | |
you | |
your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datasetBuilder := NGDatasetBuilder new. | |
trainMethods := datasetBuilder loadTrainMethodsTable. | |
validMethods := datasetBuilder loadValidMethodsTable. | |
testMethods := datasetBuilder loadTestMethodsTable. | |
model := NGModel new. | |
model trainOn: trainMethods. | |
model probabilityOfSequence: #(self initialize). |
NewerOlder