From 1e4bf42350a2145081224e4610312bc65566ad5c Mon Sep 17 00:00:00 2001 From: EliteTK Date: Mon, 24 Feb 2014 21:28:46 +0000 Subject: More cleanup --- .sockets.c.swp | Bin 12288 -> 0 bytes TEST | 13 ------ bfparse.c | 85 ++++++++++++++++++++++++++++++++++++++ explosm.xml | 117 ---------------------------------------------------- file | 8 ---- fuck.c | 85 -------------------------------------- google.html | 23 ----------- googleposttest.html | 6 --- input | 1 - lewisnumber.c | 8 ---- sprin | 68 ------------------------------ wsrm.output | 1 - 12 files changed, 85 insertions(+), 330 deletions(-) delete mode 100644 .sockets.c.swp delete mode 100644 TEST create mode 100644 bfparse.c delete mode 100644 explosm.xml delete mode 100644 file delete mode 100644 fuck.c delete mode 100644 google.html delete mode 100644 googleposttest.html delete mode 100644 input delete mode 100644 lewisnumber.c delete mode 100644 sprin delete mode 100644 wsrm.output diff --git a/.sockets.c.swp b/.sockets.c.swp deleted file mode 100644 index 0fceabf..0000000 Binary files a/.sockets.c.swp and /dev/null differ diff --git a/TEST b/TEST deleted file mode 100644 index 9726e8e..0000000 --- a/TEST +++ /dev/null @@ -1,13 +0,0 @@ - 1. Move the cursor to this line. - - 2. Press v and move the cursor to the fifth item below. Notice that the - text is highlighted. - - 3. Press the : character. At the bottom of the screen :'<,'> will appear. - - 4. Type w TEST , where TEST is a filename that does not exist yet. Verify - that you see :'<,'>w TEST before you press . - - 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls - to see it. Do not remove it yet! We will use it in the next lesson. - diff --git a/bfparse.c b/bfparse.c new file mode 100644 index 0000000..2ea57b5 --- /dev/null +++ b/bfparse.c @@ -0,0 +1,85 @@ +// WARNING: THIS PROGRAM PRODUCES CODE THAT ALLOWS UNRESTRICTED MEMORY ACCESS. +// USE AT YOUR OWN RISK!!!!!!!!!!!! +// This program takes input from stdin and outputs on stdout and stderr (for errors) + +#include + +#define rightAngle "++ptr;\n" // right angle bracket +#define leftAngle "--ptr;\n" // left angle bracket +#define plus "++*ptr;\n" // plus +#define minus "--*ptr;\n" // minus +#define period "putchar(*ptr);\n" // period +#define comma "*ptr = getchar();\n" // comma +#define leftSquare "while (*ptr) {\n" // left square bracket +#define rightSquare "}\n" // right square bracket + +#define indent " " + +void autoIndent(int); + +int main( int argc, char *argv[] ) { + int indentLevel = 1; + printf("// Generated with TK's \"fuck\" brainfuck to C parser.\n"); + printf("#include\n"); + printf("#include\n"); + printf("\n"); + printf("int main() {\n"); + printf(" char *ptrt;\n"); + printf(" ptrt = calloc(1000, sizeof(char));\n"); + printf(" char *ptr;\n"); + printf(" ptr = ptrt;\n"); + printf(" // The following is directly parsed\n"); + + char c; + while ( ( c = getchar() ) != EOF ) { + switch (c) { + case 62: + autoIndent(indentLevel); + printf(rightAngle); + break; + case 60: + autoIndent(indentLevel); + printf(leftAngle); + break; + case 43: + autoIndent(indentLevel); + printf(plus); + break; + case 45: + autoIndent(indentLevel); + printf(minus); + break; + case 46: + autoIndent(indentLevel); + printf(period); + break; + case 44: + autoIndent(indentLevel); + printf(comma); + break; + case 91: + autoIndent(indentLevel); + indentLevel++; + printf(leftSquare); + break; + case 93: + indentLevel--; + autoIndent(indentLevel); + printf(rightSquare); + break; + } + } + printf(" // Closing cleanup\n"); + printf(" free(ptrt);\n"); + printf(" putchar('\\n');\n"); + printf(" return 0;\n}\n"); + if (--indentLevel) + fprintf( stderr, "Incorrect number of brackets. - Error parsing file.\n"); + return 0; +} + +void autoIndent(int levels) { + int i; + for (i = 0; i < levels; i++) + printf(indent); +} diff --git a/explosm.xml b/explosm.xml deleted file mode 100644 index 0a5466c..0000000 --- a/explosm.xml +++ /dev/null @@ -1,117 +0,0 @@ -feeds.feedburner.com resolved to : 62.254.36.187 -Connected - -Data Send - -Reply received - -HTTP/1.1 200 OK -Content-Type: text/xml; charset=UTF-8 -ETag: BCNyThWsMi3twyAaFxT27j98TTI -Last-Modified: Mon, 03 Feb 2014 23:35:17 GMT -Date: Mon, 03 Feb 2014 23:44:13 GMT -Expires: Mon, 03 Feb 2014 23:44:13 GMT -Cache-Control: private, max-age=0 -X-Content-Type-Options: nosniff -X-XSS-Protection: 1; mode=block -Server: GSE -Transfer-Encoding: chunked - -104e - - - - - Explosm.net - http://www.explosm.net - Flash Animations, Daily Comics and more! - Mon, 3 Feb 2014 15:35:17 +0000 - http://wordpress.org/?v=1.5.1.3 - en - - This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use. - 02.03.2014 - http://www.explosm.net/comics/3453/ - Mon, 3 Feb 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3453/ - New Cyanide and Happiness Comic. - - - 02.02.2014 - http://www.explosm.net/comics/3452/ - Sun, 2 Feb 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3452/ - New Cyanide and Happiness Comic. - - - 02.01.2014 - http://www.explosm.net/comics/3451/ - Sat, 1 Feb 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3451/ - New Cyanide and Happiness Comic. - - - 01.31.2014 - http://www.explosm.net/comics/3450/ - Fri, 31 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3450/ - New Cyanide and Happiness Comic. - - - Short: Nice Place - http://www.explosm.net/show/episode/77/nice-place/autoplay - Thu, 30 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/show/episode/77/nice-place/autoplay - New Cyanide and Happiness Short. - - - 01.29.2014 - http://www.explosm.net/comics/3448/ - Wed, 29 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3448/ - New Cyanide and Happiness Comic. - - - 01.28.2014 - http://www.explosm.net/comics/3447/ - Tue, 28 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3447/ - New Cyanide and Happiness Comic. - - - 01.27.2014 - http://www.explosm.net/comics/3446/ - Mon, 27 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3446/ - New Cyanide and Happiness Comic. - - - 01.26.2014 - http://www.explosm.net/comics/3445/ - Sun, 26 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3445/ - New Cyanide and Happiness Comic. - - - 01.25.2014 - http://www.explosm.net/comics/3444/ - Sat, 25 Jan 2014 00:00:00 +0000 - Comics - http://www.explosm.net/comics/3444/ - New Cyanide and Happiness Comic. - - - - -0 - - diff --git a/file b/file deleted file mode 100644 index 4a71cb7..0000000 --- a/file +++ /dev/null @@ -1,8 +0,0 @@ -This is a file of file kind -wololololo -we want this file to be randomized -wololololo -there's a file, here, and there's a file there -file here file there file everywhere -we want this file to be randomized -wololololo diff --git a/fuck.c b/fuck.c deleted file mode 100644 index 2ea57b5..0000000 --- a/fuck.c +++ /dev/null @@ -1,85 +0,0 @@ -// WARNING: THIS PROGRAM PRODUCES CODE THAT ALLOWS UNRESTRICTED MEMORY ACCESS. -// USE AT YOUR OWN RISK!!!!!!!!!!!! -// This program takes input from stdin and outputs on stdout and stderr (for errors) - -#include - -#define rightAngle "++ptr;\n" // right angle bracket -#define leftAngle "--ptr;\n" // left angle bracket -#define plus "++*ptr;\n" // plus -#define minus "--*ptr;\n" // minus -#define period "putchar(*ptr);\n" // period -#define comma "*ptr = getchar();\n" // comma -#define leftSquare "while (*ptr) {\n" // left square bracket -#define rightSquare "}\n" // right square bracket - -#define indent " " - -void autoIndent(int); - -int main( int argc, char *argv[] ) { - int indentLevel = 1; - printf("// Generated with TK's \"fuck\" brainfuck to C parser.\n"); - printf("#include\n"); - printf("#include\n"); - printf("\n"); - printf("int main() {\n"); - printf(" char *ptrt;\n"); - printf(" ptrt = calloc(1000, sizeof(char));\n"); - printf(" char *ptr;\n"); - printf(" ptr = ptrt;\n"); - printf(" // The following is directly parsed\n"); - - char c; - while ( ( c = getchar() ) != EOF ) { - switch (c) { - case 62: - autoIndent(indentLevel); - printf(rightAngle); - break; - case 60: - autoIndent(indentLevel); - printf(leftAngle); - break; - case 43: - autoIndent(indentLevel); - printf(plus); - break; - case 45: - autoIndent(indentLevel); - printf(minus); - break; - case 46: - autoIndent(indentLevel); - printf(period); - break; - case 44: - autoIndent(indentLevel); - printf(comma); - break; - case 91: - autoIndent(indentLevel); - indentLevel++; - printf(leftSquare); - break; - case 93: - indentLevel--; - autoIndent(indentLevel); - printf(rightSquare); - break; - } - } - printf(" // Closing cleanup\n"); - printf(" free(ptrt);\n"); - printf(" putchar('\\n');\n"); - printf(" return 0;\n}\n"); - if (--indentLevel) - fprintf( stderr, "Incorrect number of brackets. - Error parsing file.\n"); - return 0; -} - -void autoIndent(int levels) { - int i; - for (i = 0; i < levels; i++) - printf(indent); -} diff --git a/google.html b/google.html deleted file mode 100644 index 3ccd127..0000000 --- a/google.html +++ /dev/null @@ -1,23 +0,0 @@ -Connected - -Data Send - -Reply received - -HTTP/1.1 200 OK -Date: Sun, 29 Dec 2013 17:32:10 GMT -Expires: -1 -Cache-Control: private, max-age=0 -Content-Type: text/html; charset=ISO-8859-1 -Set-Cookie: PREF=ID=de83506dae7a4d2c:FF=0:TM=1388338330:LM=1388338330:S=86KRr-U5XLrnu9cl; expires=Tue, 29-Dec-2015 17:32:10 GMT; path=/; domain=.google.com -Set-Cookie: NID=67=gCG7hCOJeDPk6gA27n9l7jibCCw_hFv7nkGxj5yZBQQ5HjwANVV6z1aYRmGnMsCJIzWRf6sWq8yCceYExpeUGkXsfOcZz8qmfA4gfyT7U45wT9Enun9701aU3tungtGT; expires=Mon, 30-Jun-2014 17:32:10 GMT; path=/; domain=.google.com; HttpOnly -P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info." -Server: gws -X-XSS-Protection: 1; mode=block -X-Frame-Options: SAMEORIGIN -Alternate-Protocol: 80:quic -Transfer-Encoding: chunked - -8000 -Google