View max_coroutine.py
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
#!/usr/bin/env python3 | |
def max_coroutine(initial_value): | |
max_value = initial_value | |
while True: | |
next_value = (yield max_value) | |
max_value = max(next_value, max_value) | |
def main(): | |
L = [1, 2, 0, 7, 5, 9, 13, 10, 8] | |
src_it = iter(L) |
View myParser.py
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
#! usr/bin/python | |
import sys | |
def parse(filename): | |
print "parsing", filename | |
def main(): | |
parse(sys.argv[1]) | |
if __name__ == '__main__': |
View quine.c
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 <stdio.h> | |
int main() | |
{ | |
char n='\n',b='\\',q='"'; | |
char *fmt="#include <stdio.h>%cint main()%c{%cchar n='%cn',b='%c%c',q='%c';%cchar *fmt=%c%s%c;%cprintf(fmt,n,n,n,b,b,b,q,n,q,fmt,q,n,n,n);%c}%c"; | |
printf(fmt,n,n,n,b,b,b,q,n,q,fmt,q,n,n,n); | |
} |