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
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo "usage: $0 <file>" | |
exit 1 | |
fi | |
name=test$RANDOM@test$RANDOM.fr | |
pass=$RANDOM | |
file="$1" | |
out=$(mktemp) |
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; | |
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
import java.lang.reflect.*; | |
import java.beans.*; | |
public class FluentInterface<T> implements InvocationHandler { | |
Object obj; | |
public FluentInterface(Object obj) { | |
this.obj = obj; | |
} |
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
# Download Pharo 2.0 + VM | |
```bash | |
wget -O - get.pharo.org/20+vm | bash | |
``` | |
# Download Pharo 3.0 + VM | |
```bash | |
wget -O - get.pharo.org/30+vm | bash |
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
#Install npm | |
sudo apt-get install npm | |
#Ensure the lastest version of npm is installed | |
sudo npm install -g npm | |
#Install docpad 6.30 | |
npm install -g docpad@6.30 |
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
|diag| | |
diag := ESDiagramRenderer new. | |
(diag scatterplot) | |
models: ((0 to: 5e4) select:#isPrime); | |
y: [ :p |(p* (p cos))]; | |
x: [ :p |(p* (p sin))]; | |
preferredAxisMinX:(-50000); | |
preferredAxisMinY:(-50000); | |
smallObjects. | |
diag 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
| 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 |
OlderNewer