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
| sharedPackageCacheDirectory | | |
"Never apply to PharoLauncher itself" | |
(SmalltalkImage current imageName includesSubstring: 'Launcher') ifTrue: [ ^self ]. | |
"ask if script should be applied" | |
(UIManager default confirm: 'Apply init script from ', StartupPreferencesLoader preferencesGeneralFolder fullName,' to image') ifFalse: [^self ]. | |
"Use a shared package cache to store Monticello MCS files for all images" | |
sharedPackageCacheDirectory := (StartupPreferencesLoader preferencesGeneralFolder fullName, 'commonpackage-cache') asFileReference | |
ensureCreateDirectory; |
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
(ZnEasy getJpeg: 'http://www.gravatar.com/avatar/', | |
(ZnDigestAuthenticator md5Hash: 'serge.stinckwich@gmail.com'),'?s=70' | |
) asMorph openInWorld |
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
| b tab | | |
tab := RTTabTable new input: (ZnEasy get: 'http://earthquake.usgs.gov/earthquakes/feed/v0.1/summary/2.5_month.csv') entity string usingDelimiter: $,. | |
tab removeFirstRow. | |
tab replaceEmptyValuesWith: '0' inColumns: #(2 3 4 5). | |
tab convertColumnsAsFloat: #(2 3 4 5). | |
b := RTMapLocationBuilder new. | |
b shape circle | |
size: [ :v| (2 raisedTo: v) / 2 ]; | |
color: (Color red alpha: 0.3). | |
tab values do: [ :row | b addPoint: row second @ row third value: row fifth ]. |
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
|array b| | |
array := (NeoCSVReader on: (ZnEasy get: 'http://kathy.cartodb.com/api/v2/sql?format=csv&q=SELECT+*+FROM+aviation_accidents_in_2014') entity string readStream) | |
skipHeader; | |
upToEnd. | |
b := RTMapLocationBuilder new. | |
b shape circle | |
size: [ :v| v]; | |
color: (Color red alpha: 0.3). | |
array do: [ :row | |fatalities| |
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
|tab ds b lb | | |
tab := RTTabTable new input: 'http://senegalouvert.org/data/core/Population-Senegal/r/Population%20Senegal.csv' asUrl retrieveContents usingDelimiter: $,. | |
tab removeFirstRow. | |
tab convertColumnsAsFloat: #(1 2 3 4). | |
b := RTGrapher new. | |
ds := RTDataSet new. | |
ds interaction popup. | |
ds points: tab values. | |
ds dotShape color: (Color blue alpha: 0.3). |
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
Gofer new | |
url: 'http://www.smalltalkhub.com/mc/SergeStinckwich/SciSmalltalk/main'; | |
package: 'ConfigurationOfSciSmalltalk'; | |
load. | |
(Smalltalk at: #ConfigurationOfSciSmalltalk) loadDevelopment. | |
pi := (1 asArbitraryPrecisionFloatNumBits: 129) pi. | |
str := (String new: 32) writeStream. | |
pi absPrintExactlyOn: str base: 10. | |
str contents |
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
"http://www.informatik.uni-bremen.de/agbkb/lehre/extratreffen/Santiago102007Interval.pdf" | |
f := [ :x : y| | |
((333.75 - (x raisedTo:2))* (y raisedTo: 6)) + ((x raisedTo: 2) * | |
((11* (x raisedTo: 2) * (y raisedTo: 2)) - (121 * (y raisedTo: 4)) - 2)) | |
+ (5.5 * (y raisedTo: 8)) + (x/(2*y)) | |
]. | |
f value: 77617 value: 33096. "1.1726039400531787" |
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
"Smalltalk version of http://solog.co/47/10-scala-one-liners-to-impress-your-friends/ " | |
"1. Multiple Each Item in a List by 2" | |
(1 to: 10) * 2. | |
"2. Sum a List of Numbers" | |
"Version 1" | |
(1 to:1000) reduce:[:a :b|a+b]. | |
"Version 2" | |
(1 to:1000) 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
############################################################## | |
japanino.name=Gakken Japanino(学研 大人の科学 ジャパニーノ) | |
japanino.upload.protocol=stk500 | |
japanino.upload.maximum_size=14336 | |
japanino.upload.speed=19200 | |
japanino.bootloader.low_fuses=0xe2 | |
japanino.bootloader.high_fuses=0xdd |
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
class Exo3 { | |
public static boolean isAnAnagram(String c1, String c2){ | |
int [] counts = new int[26]; | |
int l1 = c1.length(); | |
int l2 = c2.length(); | |
if (c1.equals(c2)) return true; | |
if (l1 != l2) return false; | |
OlderNewer