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
#include "simplesocket.h" | |
int main(int argc, char * argv[]){ | |
int port; | |
stringstream(argv[1]) >> port; | |
clientsocket * s = new clientsocket("localhost", port); | |
printf("3:%d\n", s->connect()); | |
s->write("asdf", 256); | |
s->close(); | |
} |
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
#include "simplesocket.h" | |
#include <sstream> | |
int main(int argc, char * argv[]){ | |
// continually transmit something here | |
int port; | |
stringstream(argv[1]) >> port; | |
serversocket * s = new serversocket(port, -1, true); | |
char buffer[256]; | |
while (!strcmp(buffer,"")) { |
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
0 clang 0x0000000100c539f2 main + 12919346 | |
Stack dump: | |
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.8.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name Parser.cpp -pic-level 2 -mdisable-fp-elim -masm-verbos\ | |
e -munwind-tables -target-cpu core2 -target-linker-version 136 -g -coverage-file /Users/etosch/dev/memstashed/parser.o -resource-dir /usr/bin/../lib/clang/4.2 -I . -fmodule-cache-path /var/folders/wp/rsvsklwn1l\ | |
73jm32n3_lqqb00000gr/T/clang-module-cache -Wno-write-strings -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/etosch/dev/memstashed -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackreal\ | |
ign -fblocks -fobjc-runtime=macosx-10.8.0 -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o parser.o -x c++ Parser.cpp | |
1. <eof> parser at end of file | |
2. Per-file LLVM IR generation | |
3. Parser.cpp:53:10: Generating code for declaration '<anonym |
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
(* There is a short solution to the next exercise. | |
If you find yourself getting tangled up, step back and try to look for a simpler way. *) | |
Theorem app_ass4 : forall l1 l2 l3 l4 : natlist, | |
l1 ++ (l2 ++ (l3 ++ l4)) = ((l1 ++ l2) ++ l3) ++ l4. | |
Proof. | |
intros l1 l2 l3 l4. | |
Theorem app_right : forall l1 l2 l3 : natlist, | |
l1 ++ (l2 ++ l3) = (l1 ++ l2) ++ l3. | |
Proof. |
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
(* Exercise: 4 stars, recommended (binary) | |
Consider a different, more efficient representation of natural numbers using a binary | |
rather than unary system. That is, instead of saying that each natural number is either | |
zero or the successor of a natural number, we can say that each binary number is either | |
zero, | |
twice |
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
.answer { | |
white-space : nowrap; | |
display : block; | |
} | |
label { | |
display : block; | |
padding : 2px 1em 0 0; | |
white-space : nowrap; | |
} |
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
var oldShowQuestion = sm.showQuestion; | |
var oldRegisterAndShowNextQuestion = sm.registerAndShowNextQuestion; | |
var addTimingInfo = function(q, tag) { | |
var start = document.createElement('input'); | |
start.type='text'; | |
start.id=tag+'_'+q.id; | |
start.name=tag+'_'+q.id; | |
start.form='mturk_form'; | |
start.hidden=true; | |
start.defaultValue=new Date().getTime(); |
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
.breakoff { | |
white-space : nowrap; | |
display : block; | |
position : relative; | |
top : 10px; | |
left : 20px; | |
} |
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
sm.showBreakoffNotice = function () { | |
sm.showFirstQuestion(); | |
}; | |
sm.showBreakoffNotice(); |
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
function depth | |
input : A survey block | |
output : integer indicating depth | |
begin | |
idArray <- block id as an array | |
return length(idArray) | |
end |
OlderNewer