This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
HostWindowProxy new | |
instVarNamed: #windowHandle put: 1; | |
windowPosition: 0 @ 0; | |
windowSize: 800 @ 600; | |
windowTitle: 'Screencast' |
| scriptMethod sourceString sourceStringWithBracketsStripped | | |
scriptMethod := CLASS_HERE compiledMethodAt: #METHOD_HERE. | |
sourceString := scriptMethod methodNode body asString. | |
sourceStringWithBracketsStripped := sourceString copyFrom: 3 to: sourceString size - 2. | |
sourceStringWithBracketsStripped. |
SHWorkspace allInstances first codeTextMorph textMorph selection asString |
SystemWindow allInstancesDo:[:win| win setLabel: (win labelString reverse)] |
OSProcess thisOSProcess stdOut | |
nextPutAll: 'Welcome to the simple Smalltalk REPL'; | |
nextPut: Character lf; nextPut: $>; flush. | |
[ |input| | |
[ input := OSProcess readFromStdIn. | |
input size > 0 ifTrue: [ | |
OSProcess thisOSProcess stdOut | |
nextPutAll: ((Compiler evaluate: input) asString; | |
nextPut: Character lf; nextPut: $>; flush | |
] |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#define STR(x) #x | |
#define STR1(x) STR(x) | |
#define DEBUGME(a) OutputDebugStringA( "[DEBUG| " __FUNCTION__ ":" STR1(__LINE__) "] " a "\n") |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
use std::rt::io::File; | |
use std::rt::io::buffered::BufferedReader; | |
[...] | |
let s:~str = ~"file.txt"; | |
let mut strings:~[~str] = ~[]; | |
let path = PosixPath::new(s); | |
let mut rdr = BufferedReader::new(File::open(&path).unwrap()); |
# Threat model | |
## Attacker categories | |
### Security adversary | |
Wants to read messages he is not supposed to. | |
able to control communication channels and read/modify packets | |
### Consensus adversary |