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
grammar doge; | |
word: (‘a’..’z’ | ‘A’ .. ‘Z’)+; | |
thedoge: ‘much’ word | |
| ‘much’ word ‘such’ word | |
| ‘much’ word ‘such’ word ‘wow’ word* | |
; | |
start: thedoge ‘!’ ; |
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
(ns narcissismquotient.core) | |
(defn is-a-me-reference? | |
"assumes lowercase and trimmed input" | |
[word] | |
(cond | |
(= word "i") true | |
(= word "me") true | |
(.startsWith word "my") true | |
(.startsWith word "mine") true |
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.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.BadPaddingException; | |
import javax.crypto.Cipher; |
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://askubuntu.com/questions/347591/how-do-i-control-the-vmem-when-forking-as-im-getting-different-results-on-10-0 |
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
mike@boontoo12:~$ java -Xmx512m -Xms512m -jar forker.jar 10000000 20 Xmx512m Xms512m | |
output of "top": | |
20697 mike 20 0 1405m 54m 8488 S 5 1.4 0:00.18 java | |
20669 mike 20 0 1405m 54m 8492 S 5 1.4 0:00.18 java | |
20691 mike 20 0 1405m 54m 8492 S 5 1.4 0:00.17 java | |
20658 mike 20 0 1405m 54m 8492 S 5 1.4 0:00.17 java |
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
mike@boontoo10:~$ java -Xmx512m -Xms512m -jar forker.jar 10000000 20 Xmx512m Xms512m | |
"top" looks like this: | |
1928 mike 20 0 694m 54m 8624 S 6 5.4 0:00.18 java | |
1933 mike 20 0 694m 54m 8648 S 6 5.4 0:00.18 java | |
1935 mike 20 0 694m 54m 8648 S 6 5.4 0:00.18 java | |
1939 mike 20 0 694m 54m 8648 S 5 5.4 0:00.16 java |
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
package com.satoricode.forker; | |
import java.io.IOException; | |
import java.io.InputStream; | |
public class ForkRunner implements Runnable { | |
private String stackCommand; | |
private int arraySize; |
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
package com.satoricode.forker; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ForkIt { | |
public static void main(String[] args) throws InterruptedException { | |
int arraySize = Integer.parseInt(args[0]); |