assorted-commits Mailing List for Assorted projects (Page 43)
Brought to you by:
yangzhang
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(9) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(86) |
Feb
(265) |
Mar
(96) |
Apr
(47) |
May
(136) |
Jun
(28) |
Jul
(57) |
Aug
(42) |
Sep
(20) |
Oct
(67) |
Nov
(37) |
Dec
(34) |
2009 |
Jan
(39) |
Feb
(85) |
Mar
(96) |
Apr
(24) |
May
(82) |
Jun
(13) |
Jul
(10) |
Aug
(8) |
Sep
(2) |
Oct
(20) |
Nov
(31) |
Dec
(17) |
2010 |
Jan
(16) |
Feb
(11) |
Mar
(17) |
Apr
(53) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(6) |
Sep
(11) |
Oct
(4) |
Nov
(17) |
Dec
(17) |
2011 |
Jan
(3) |
Feb
(19) |
Mar
(5) |
Apr
(17) |
May
(3) |
Jun
(4) |
Jul
(14) |
Aug
(3) |
Sep
(2) |
Oct
(1) |
Nov
(3) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
(7) |
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(5) |
Sep
(2) |
Oct
(3) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(9) |
Apr
(5) |
May
|
Jun
(2) |
Jul
(1) |
Aug
(10) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
(3) |
Mar
(3) |
Apr
(1) |
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yan...@us...> - 2008-06-04 01:24:36
|
Revision: 852 http://assorted.svn.sourceforge.net/assorted/?rev=852&view=rev Author: yangzhang Date: 2008-06-03 18:24:44 -0700 (Tue, 03 Jun 2008) Log Message: ----------- added typedef test Added Paths: ----------- sandbox/trunk/src/cc/typedefs.cc Added: sandbox/trunk/src/cc/typedefs.cc =================================================================== --- sandbox/trunk/src/cc/typedefs.cc (rev 0) +++ sandbox/trunk/src/cc/typedefs.cc 2008-06-04 01:24:44 UTC (rev 852) @@ -0,0 +1,17 @@ +#include <map> +#include <string> + +using namespace std; + +template<typename T> +class C { + typedef map<string, T*> mymap; + + // This doesn't work: + // typedef mymap::iterator iterator; + + // You need to specify typename! + typedef typename mymap::iterator iterator; +}; + +int main() { return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 17:32:43
|
Revision: 851 http://assorted.svn.sourceforge.net/assorted/?rev=851&view=rev Author: yangzhang Date: 2008-06-03 10:32:50 -0700 (Tue, 03 Jun 2008) Log Message: ----------- added ex6 Added Paths: ----------- sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/Makefile sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.l sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.y Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/Makefile (from rev 848, sandbox/trunk/src/flex-bison/lex-yacc-howto/ex5/Makefile) =================================================================== --- sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/Makefile (rev 0) +++ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/Makefile 2008-06-03 17:32:50 UTC (rev 851) @@ -0,0 +1,13 @@ +all: ex6 + +%: %.tab.c %.yy.c + gcc -Wall -o $@ $^ + +%.yy.c: %.l %.tab.h + flex -o $@ $< + +%.tab.c: %.y + bison -d $< + +%.tab.h: %.y + bison -d $< Added: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.l =================================================================== --- sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.l (rev 0) +++ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.l 2008-06-03 17:32:50 UTC (rev 851) @@ -0,0 +1,22 @@ +%{ +// Note that this ordering is important; #define YYSTYPE must come before the +// #include "ex6.tab.h"! +#define YYSTYPE char * +#include "ex6.tab.h" +%} + +%option nounput + +%% + +zone return ZONETOK; +file return FILETOK; +[a-zA-Z][a-zA-Z0-9]* yylval=strdup(yytext); return WORD; +[a-zA-Z0-9\/.-]+ yylval=strdup(yytext); return FILENAME; +\" return QUOTE; +\{ return OBRACE; +\} return EBRACE; +; return SEMICOLON; +\n /* ignore EOL */; +[ \t]+ /* ignore whitespace */; +%% Added: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.y =================================================================== --- sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.y (rev 0) +++ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex6/ex6.y 2008-06-03 17:32:50 UTC (rev 851) @@ -0,0 +1,81 @@ +%{ +#include <stdio.h> +#include <string.h> + +#define YYSTYPE char * + +int yylex(void); + +void yyerror(const char *str) +{ + fprintf(stderr,"error: %s\n",str); +} + +int yywrap() +{ + return 1; +} + +%} + +%token SEMICOLON ZONETOK OBRACE EBRACE QUOTE FILENAME WORD FILETOK + +%% + +commands: + | + commands command SEMICOLON + ; + + +command: + zone_set + ; + +zone_set: + ZONETOK quotedname zonecontent + { + printf("Complete zone for '%s' found\n",$2); + } + ; + +zonecontent: + OBRACE zonestatements EBRACE + +quotedname: + QUOTE FILENAME QUOTE + { + $$=$2; + } + +zonestatements: + | + zonestatements zonestatement SEMICOLON + ; + +zonestatement: + statements + | + FILETOK quotedname + { + printf("A zonefile name '%s' was encountered\n", $2); + } + ; + +block: + OBRACE zonestatements EBRACE SEMICOLON + ; + +statements: + | statements statement + ; + +statement: WORD | block | quotedname + +%% + +int main() +{ + yyparse(); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 02:04:03
|
Revision: 850 http://assorted.svn.sourceforge.net/assorted/?rev=850&view=rev Author: yangzhang Date: 2008-06-02 19:04:08 -0700 (Mon, 02 Jun 2008) Log Message: ----------- updated to actually work Modified Paths: -------------- sandbox/trunk/src/flex-bison/calc/calc.lex sandbox/trunk/src/flex-bison/calc/calc.y Modified: sandbox/trunk/src/flex-bison/calc/calc.lex =================================================================== --- sandbox/trunk/src/flex-bison/calc/calc.lex 2008-06-03 01:55:57 UTC (rev 849) +++ sandbox/trunk/src/flex-bison/calc/calc.lex 2008-06-03 02:04:08 UTC (rev 850) @@ -4,8 +4,7 @@ %{ #include "heading.h" #include "tok.h" -int yyerror(char *s); -int yylineno = 1; +int yyerror(const char *s); %} digit [0-9] @@ -22,3 +21,8 @@ . { std::cerr << "SCANNER "; yyerror(""); exit(1); } +%% + +/* +vim:noet:sw=8:ts=8 +*/ Modified: sandbox/trunk/src/flex-bison/calc/calc.y =================================================================== --- sandbox/trunk/src/flex-bison/calc/calc.y 2008-06-03 01:55:57 UTC (rev 849) +++ sandbox/trunk/src/flex-bison/calc/calc.y 2008-06-03 02:04:08 UTC (rev 850) @@ -3,7 +3,7 @@ %{ #include "heading.h" -int yyerror(char *s); +int yyerror(const char *s); int yylex(void); %} @@ -42,7 +42,7 @@ exit(1); } -int yyerror(char *s) +int yyerror(const char *s) { return yyerror(string(s)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 01:55:55
|
Revision: 849 http://assorted.svn.sourceforge.net/assorted/?rev=849&view=rev Author: yangzhang Date: 2008-06-02 18:55:57 -0700 (Mon, 02 Jun 2008) Log Message: ----------- added url note Added Paths: ----------- sandbox/trunk/src/flex-bison/lex-yacc-howto/url Added: sandbox/trunk/src/flex-bison/lex-yacc-howto/url =================================================================== --- sandbox/trunk/src/flex-bison/lex-yacc-howto/url (rev 0) +++ sandbox/trunk/src/flex-bison/lex-yacc-howto/url 2008-06-03 01:55:57 UTC (rev 849) @@ -0,0 +1 @@ +http://tldp.org/HOWTO/Lex-YACC-HOWTO-4.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 01:55:06
|
Revision: 848 http://assorted.svn.sourceforge.net/assorted/?rev=848&view=rev Author: yangzhang Date: 2008-06-02 18:55:13 -0700 (Mon, 02 Jun 2008) Log Message: ----------- reorganized flex/bison files Added Paths: ----------- sandbox/trunk/src/flex-bison/calc/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex1/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex2/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex3/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex4/ sandbox/trunk/src/flex-bison/lex-yacc-howto/ex5/ Removed Paths: ------------- sandbox/trunk/src/bison/ sandbox/trunk/src/flex-bison/ex1/ sandbox/trunk/src/flex-bison/ex2/ sandbox/trunk/src/flex-bison/ex3/ sandbox/trunk/src/flex-bison/ex4/ sandbox/trunk/src/flex-bison/ex5/ Copied: sandbox/trunk/src/flex-bison/calc (from rev 845, sandbox/trunk/src/bison/calc) Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex1 (from rev 847, sandbox/trunk/src/flex-bison/ex1) Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex2 (from rev 847, sandbox/trunk/src/flex-bison/ex2) Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex3 (from rev 847, sandbox/trunk/src/flex-bison/ex3) Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex4 (from rev 847, sandbox/trunk/src/flex-bison/ex4) Copied: sandbox/trunk/src/flex-bison/lex-yacc-howto/ex5 (from rev 847, sandbox/trunk/src/flex-bison/ex5) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 01:51:14
|
Revision: 847 http://assorted.svn.sourceforge.net/assorted/?rev=847&view=rev Author: yangzhang Date: 2008-06-02 18:51:23 -0700 (Mon, 02 Jun 2008) Log Message: ----------- renamed flex to flex-bison Added Paths: ----------- sandbox/trunk/src/flex-bison/ Removed Paths: ------------- sandbox/trunk/src/flex/ Copied: sandbox/trunk/src/flex-bison (from rev 846, sandbox/trunk/src/flex) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-03 01:50:44
|
Revision: 846 http://assorted.svn.sourceforge.net/assorted/?rev=846&view=rev Author: yangzhang Date: 2008-06-02 18:50:46 -0700 (Mon, 02 Jun 2008) Log Message: ----------- going through flex/bison tutorial Added Paths: ----------- sandbox/trunk/src/flex/ sandbox/trunk/src/flex/ex1/ sandbox/trunk/src/flex/ex1/Makefile sandbox/trunk/src/flex/ex1/ex1.l sandbox/trunk/src/flex/ex2/ sandbox/trunk/src/flex/ex2/ex2.l sandbox/trunk/src/flex/ex3/ sandbox/trunk/src/flex/ex3/ex3.l sandbox/trunk/src/flex/ex4/ sandbox/trunk/src/flex/ex4/Makefile sandbox/trunk/src/flex/ex4/ex4.l sandbox/trunk/src/flex/ex4/ex4.y sandbox/trunk/src/flex/ex5/ sandbox/trunk/src/flex/ex5/Makefile sandbox/trunk/src/flex/ex5/ex5.l sandbox/trunk/src/flex/ex5/ex5.y Added: sandbox/trunk/src/flex/ex1/Makefile =================================================================== --- sandbox/trunk/src/flex/ex1/Makefile (rev 0) +++ sandbox/trunk/src/flex/ex1/Makefile 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,8 @@ +all: ex1 + +%: %.yy.c + gcc -Wall -o $@ $< -ll + # libl contains a `main` function. + +%.yy.c: %.l + flex -o $@ $< Added: sandbox/trunk/src/flex/ex1/ex1.l =================================================================== --- sandbox/trunk/src/flex/ex1/ex1.l (rev 0) +++ sandbox/trunk/src/flex/ex1/ex1.l 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,8 @@ +%{ +#include <stdio.h> +%} + +%% +stop printf("Stop command received\n"); +start printf("Start command received\n"); +%% Added: sandbox/trunk/src/flex/ex2/ex2.l =================================================================== --- sandbox/trunk/src/flex/ex2/ex2.l (rev 0) +++ sandbox/trunk/src/flex/ex2/ex2.l 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,8 @@ +%{ +#include <stdio.h> +%} + +%% +[0123456789]+ printf("NUMBER\n"); +[a-zA-Z][a-zA-Z0-9]* printf("WORD\n"); +%% Added: sandbox/trunk/src/flex/ex3/ex3.l =================================================================== --- sandbox/trunk/src/flex/ex3/ex3.l (rev 0) +++ sandbox/trunk/src/flex/ex3/ex3.l 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,14 @@ +%{ +#include <stdio.h> +%} + +%% +[a-zA-Z][a-zA-Z0-9]* printf("WORD "); +[a-zA-Z0-9\/.-]+ printf("FILENAME "); +\" printf("QUOTE "); +\{ printf("OBRACE "); +\} printf("EBRACE "); +; printf("SEMICOLON "); +\n printf("\n"); +[ \t]+ /* ignore whitespace */; +%% Added: sandbox/trunk/src/flex/ex4/Makefile =================================================================== --- sandbox/trunk/src/flex/ex4/Makefile (rev 0) +++ sandbox/trunk/src/flex/ex4/Makefile 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,13 @@ +all: ex4 + +%: %.tab.c %.yy.c + gcc -Wall -o $@ $^ + +%.yy.c: %.l %.tab.h + flex -o $@ $< + +%.tab.c: %.y + bison -d $< + +%.tab.h: %.y + bison -d $< Added: sandbox/trunk/src/flex/ex4/ex4.l =================================================================== --- sandbox/trunk/src/flex/ex4/ex4.l (rev 0) +++ sandbox/trunk/src/flex/ex4/ex4.l 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,14 @@ +%{ +#include <stdio.h> +#include "ex4.tab.h" +%} +%option nounput +%% +[0-9]+ return NUMBER; +heat return TOKHEAT; +on|off return STATE; +target return TOKTARGET; +temperature return TOKTEMPERATURE; +\n /* ignore end of line */; +[ \t]+ /* ignore whitespace */; +%% Added: sandbox/trunk/src/flex/ex4/ex4.y =================================================================== --- sandbox/trunk/src/flex/ex4/ex4.y (rev 0) +++ sandbox/trunk/src/flex/ex4/ex4.y 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,53 @@ +%{ +#include <stdio.h> +#include <string.h> + +int yylex(void); + +void yyerror(const char *str) +{ + fprintf(stderr,"error: %s\n",str); +} + +int yywrap() +{ + return 1; +} + +%} + +%token NUMBER TOKHEAT STATE TOKTARGET TOKTEMPERATURE + +%% + +commands: /* empty */ + | commands command + ; + +command: + heat_switch + | + target_set + ; + +heat_switch: + TOKHEAT STATE + { + printf("\tHeat turned on or off\n"); + } + ; + +target_set: + TOKTARGET TOKTEMPERATURE NUMBER + { + printf("\tTemperature set\n"); + } + ; + +%% + +int main() +{ + yyparse(); + return 0; +} Added: sandbox/trunk/src/flex/ex5/Makefile =================================================================== --- sandbox/trunk/src/flex/ex5/Makefile (rev 0) +++ sandbox/trunk/src/flex/ex5/Makefile 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,13 @@ +all: ex5 + +%: %.tab.c %.yy.c + gcc -Wall -o $@ $^ + +%.yy.c: %.l %.tab.h + flex -o $@ $< + +%.tab.c: %.y + bison -d $< + +%.tab.h: %.y + bison -d $< Added: sandbox/trunk/src/flex/ex5/ex5.l =================================================================== --- sandbox/trunk/src/flex/ex5/ex5.l (rev 0) +++ sandbox/trunk/src/flex/ex5/ex5.l 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,14 @@ +%{ +#include <stdio.h> +#include "ex5.tab.h" +%} +%option nounput +%% +[0-9]+ yylval=atoi(yytext); return NUMBER; +heat return TOKHEAT; +on|off yylval=!strcmp(yytext,"on"); return STATE; +target return TOKTARGET; +temperature return TOKTEMPERATURE; +\n /* ignore end of line */; +[ \t]+ /* ignore whitespace */; +%% Added: sandbox/trunk/src/flex/ex5/ex5.y =================================================================== --- sandbox/trunk/src/flex/ex5/ex5.y (rev 0) +++ sandbox/trunk/src/flex/ex5/ex5.y 2008-06-03 01:50:46 UTC (rev 846) @@ -0,0 +1,53 @@ +%{ +#include <stdio.h> +#include <string.h> + +int yylex(void); + +void yyerror(const char *str) +{ + fprintf(stderr,"error: %s\n",str); +} + +int yywrap() +{ + return 1; +} + +%} + +%token NUMBER TOKHEAT STATE TOKTARGET TOKTEMPERATURE + +%% + +commands: /* empty */ + | commands command + ; + +command: + heat_switch + | + target_set + ; + +heat_switch: + TOKHEAT STATE + { + printf("\tHeat turned %s\n", $2 ? "on" : "off"); + } + ; + +target_set: + TOKTARGET TOKTEMPERATURE NUMBER + { + printf("\tTemperature set to %d\n", $3); + } + ; + +%% + +int main() +{ + yyparse(); + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 20:37:48
|
Revision: 845 http://assorted.svn.sourceforge.net/assorted/?rev=845&view=rev Author: yangzhang Date: 2008-06-02 13:37:15 -0700 (Mon, 02 Jun 2008) Log Message: ----------- playing with bison Added Paths: ----------- sandbox/trunk/src/bison/ sandbox/trunk/src/bison/calc/ sandbox/trunk/src/bison/calc/Makefile sandbox/trunk/src/bison/calc/calc.lex sandbox/trunk/src/bison/calc/calc.y sandbox/trunk/src/bison/calc/heading.h sandbox/trunk/src/bison/calc/main.cc sandbox/trunk/src/bison/calc/url Added: sandbox/trunk/src/bison/calc/Makefile =================================================================== --- sandbox/trunk/src/bison/calc/Makefile (rev 0) +++ sandbox/trunk/src/bison/calc/Makefile 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1,34 @@ +# Makefile + +OBJS = bison.o lex.o main.o + +CC = g++ +CFLAGS = -g -Wall -ansi -pedantic + +calc: $(OBJS) + $(CC) $(CFLAGS) $(OBJS) -o calc -lfl + +lex.o: lex.c + $(CC) $(CFLAGS) -c lex.c -o lex.o + +lex.c: calc.lex + flex calc.lex + cp lex.yy.c lex.c + +bison.o: bison.c + $(CC) $(CFLAGS) -c bison.c -o bison.o + +bison.c: calc.y + bison -d -v calc.y + cp calc.tab.c bison.c + cmp -s calc.tab.h tok.h || cp calc.tab.h tok.h + +main.o: main.cc + $(CC) $(CFLAGS) -c main.cc -o main.o + +lex.o yac.o main.o : heading.h +lex.o main.o : tok.h + +clean: + rm -f *.o *~ lex.c lex.yy.c bison.c tok.h calc.tab.c calc.tab.h calc.output calc + Added: sandbox/trunk/src/bison/calc/calc.lex =================================================================== --- sandbox/trunk/src/bison/calc/calc.lex (rev 0) +++ sandbox/trunk/src/bison/calc/calc.lex 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1,24 @@ +/* Mini Calculator */ +/* calc.lex */ + +%{ +#include "heading.h" +#include "tok.h" +int yyerror(char *s); +int yylineno = 1; +%} + +digit [0-9] +int_const {digit}+ + +%% + +{int_const} { yylval.int_val = atoi(yytext); return INTEGER_LITERAL; } +"+" { yylval.op_val = new std::string(yytext); return PLUS; } +"*" { yylval.op_val = new std::string(yytext); return MULT; } + +[ \t]* {} +[\n] { yylineno++; } + +. { std::cerr << "SCANNER "; yyerror(""); exit(1); } + Added: sandbox/trunk/src/bison/calc/calc.y =================================================================== --- sandbox/trunk/src/bison/calc/calc.y (rev 0) +++ sandbox/trunk/src/bison/calc/calc.y 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1,50 @@ +/* Mini Calculator */ +/* calc.y */ + +%{ +#include "heading.h" +int yyerror(char *s); +int yylex(void); +%} + +%union{ + int int_val; + string* op_val; +} + +%start input + +%token <int_val> INTEGER_LITERAL +%type <int_val> exp +%left PLUS +%left MULT + +%% + +input: /* empty */ + | exp { cout << "Result: " << $1 << endl; } + ; + +exp: INTEGER_LITERAL { $$ = $1; } + | exp PLUS exp { $$ = $1 + $3; } + | exp MULT exp { $$ = $1 * $3; } + ; + +%% + +int yyerror(string s) +{ + extern int yylineno; // defined and maintained in lex.c + extern char *yytext; // defined and maintained in lex.c + + cerr << "ERROR: " << s << " at symbol \"" << yytext; + cerr << "\" on line " << yylineno << endl; + exit(1); +} + +int yyerror(char *s) +{ + return yyerror(string(s)); +} + + Added: sandbox/trunk/src/bison/calc/heading.h =================================================================== --- sandbox/trunk/src/bison/calc/heading.h (rev 0) +++ sandbox/trunk/src/bison/calc/heading.h 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1,10 @@ +/* heading.h */ + +#define YY_NO_UNPUT + +using namespace std; + +#include <iostream> +#include <stdio.h> +#include <string> + Added: sandbox/trunk/src/bison/calc/main.cc =================================================================== --- sandbox/trunk/src/bison/calc/main.cc (rev 0) +++ sandbox/trunk/src/bison/calc/main.cc 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1,20 @@ +/* main.cc */ + +#include "heading.h" + +// prototype of bison-generated parser function +int yyparse(); + +int main(int argc, char **argv) +{ + if ((argc > 1) && (freopen(argv[1], "r", stdin) == NULL)) + { + cerr << argv[0] << ": File " << argv[1] << " cannot be opened.\n"; + exit( 1 ); + } + + yyparse(); + + return 0; +} + Added: sandbox/trunk/src/bison/calc/url =================================================================== --- sandbox/trunk/src/bison/calc/url (rev 0) +++ sandbox/trunk/src/bison/calc/url 2008-06-02 20:37:15 UTC (rev 845) @@ -0,0 +1 @@ +http://www.cs.ucr.edu/~lgao/teaching/bison.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:36:19
|
Revision: 844 http://assorted.svn.sourceforge.net/assorted/?rev=844&view=rev Author: yangzhang Date: 2008-06-01 17:36:25 -0700 (Sun, 01 Jun 2008) Log Message: ----------- giving up on pidgin-facebook Removed Paths: ------------- pidgin-facebook/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:26:06
|
Revision: 843 http://assorted.svn.sourceforge.net/assorted/?rev=843&view=rev Author: yangzhang Date: 2008-06-01 17:26:13 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added stuff to sandbox Added Paths: ----------- sandbox/trunk/src/cc/stringsplitting.cc sandbox/trunk/src/hs/BlockingIo.hs sandbox/trunk/src/hs/Introspection.hs sandbox/trunk/src/hs/Signals.hs sandbox/trunk/src/hs/ThreadPool.hs sandbox/trunk/src/py/af/sockcancel.py sandbox/trunk/src/scala/SetsIntersectionBug.scala Added: sandbox/trunk/src/cc/stringsplitting.cc =================================================================== --- sandbox/trunk/src/cc/stringsplitting.cc (rev 0) +++ sandbox/trunk/src/cc/stringsplitting.cc 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,26 @@ +// Simple string splitter. How does this work? istream_iterator<T> reads +// objects of type T in from the given istream and yields them as an iterator. + +#include <string> +#include <iostream> +#include <sstream> +#include <iterator> +#include <vector> +using namespace std; + +std::vector<std::string> split(const std::string& s) +{ + std::istringstream is(s); + return std::vector<string>(std::istream_iterator<std::string>(is), + std::istream_iterator<std::string>()); +} + +int main() { + vector<string> words = split(string("hello world")); + for (vector<string>::const_iterator word = words.begin(); + word != words.end(); + word++) { + cout << *word << endl; + } + return 0; +} Added: sandbox/trunk/src/hs/BlockingIo.hs =================================================================== --- sandbox/trunk/src/hs/BlockingIo.hs (rev 0) +++ sandbox/trunk/src/hs/BlockingIo.hs 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,28 @@ +module Main where + +-- Simple demo of the interaction between blocking IO and lightweight +-- threads. Haskell is smart and creates real threads on demand. + +import Control.Concurrent +import Network.FTP.Client + +main = do +-- installHandler + tid <- myThreadId + forkIO $ watchdog tid + beta + +watchdog tid = do + threadDelay 1000000 + putStrLn "killing" + killThread tid + +beta = do + enableFTPDebugging + h <- easyConnectFTP "1.1.1.1" -- "ftp.kernel.org" + loginAnon h + cwd h "/pub/linux/kernel/Historic" + nlst h Nothing >>= putStrLn . unlines + getbinary h "linux-0.01.tar.gz.sign" >>= putStrLn . fst + dir h Nothing >>= putStrLn . unlines + quit h Added: sandbox/trunk/src/hs/Introspection.hs =================================================================== --- sandbox/trunk/src/hs/Introspection.hs (rev 0) +++ sandbox/trunk/src/hs/Introspection.hs 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,9 @@ +module Main where + +import Data.Generics.Text + +data T a = B (T a) (T a) | L a + +-- http://www.defmacro.org/ramblings/haskell-web.html + +main = print (gshow (L 3)) \ No newline at end of file Added: sandbox/trunk/src/hs/Signals.hs =================================================================== --- sandbox/trunk/src/hs/Signals.hs (rev 0) +++ sandbox/trunk/src/hs/Signals.hs 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,29 @@ +module Main where + +-- summary: signals are handled in separate threads and don't +-- interrupt syscalls + +import Control.Concurrent +import System.IO +import System.Process +import System.Posix.Signals + +hGetContents' h = do + c <- hGetContents h + length c `seq` return c + +main = do + let handler = do + tid <- myThreadId + putStrLn $ "handling in " ++ show tid + tid <- myThreadId + putStrLn $ "thread " ++ show tid + installHandler sigUSR1 (Catch handler) Nothing + putStrLn "spawning" + (inp,out,err,pid) <- runInteractiveCommand "echo hello; sleep 5; echo world; exit 1" + putStrLn "reading" + res <- hGetContents' out + putStrLn "waiting" + status <- waitForProcess pid + putStrLn $ "exited with " ++ show status + putStrLn $ "read " ++ res Added: sandbox/trunk/src/hs/ThreadPool.hs =================================================================== --- sandbox/trunk/src/hs/ThreadPool.hs (rev 0) +++ sandbox/trunk/src/hs/ThreadPool.hs 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,42 @@ +module Main where + +import Control.Monad +import Control.Concurrent +import Control.Exception as E +import Control.Concurrent.STM + +type Work = IO () + +type SendWork = Work -> STM () + +spawnWorkers :: Int -> IO (SendWork,IO ()) +spawnWorkers i | i <= 0 = error "Need positive number of workers" + | otherwise = do + + workChan <- atomically newTChan + runCount <- atomically (newTVar i) + + let stop = atomically (writeTVar runCount . pred =<< readTVar runCount) + die e = do id <- myThreadId + print ("Thread "++show id++" died with exception "++show e) + stop + work = do mJob <- atomically (readTChan workChan) + case mJob of Nothing -> stop + Just job -> E.catch job die >> work + replicateM_ i (forkIO work) + + let stopCommand = do atomically (replicateM_ i (writeTChan workChan Nothing)) + atomically (do running <- readTVar runCount + when (running>0) retry) + + return (writeTChan workChan . Just,stopCommand) + +printJob i = do threadDelay (1000 * i) + id <- myThreadId + print ("printJob took "++show i++" ms in thread "++show id) + +demo = do + (submit,stop) <- spawnWorkers 4 + mapM_ (atomically . submit . printJob) (take 40 (cycle [100,200,300,400])) + atomically $ submit (error "Boom") + stop Added: sandbox/trunk/src/py/af/sockcancel.py =================================================================== --- sandbox/trunk/src/py/af/sockcancel.py (rev 0) +++ sandbox/trunk/src/py/af/sockcancel.py 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# vim:et:sw=2:ts=2 + +""" +Shows that socket.read_some()'s cancel-handling is broken. +""" + +from __future__ import generators + +import af +import afx.all as afx + +@af.task +def main(argv): + s = yield af.socket.connect('localhost',9876) + u = afx.socket_unpickler(s) + while True: + res = yield u.read() | af.timeout(1) + print res + +afx.run_main() Property changes on: sandbox/trunk/src/py/af/sockcancel.py ___________________________________________________________________ Name: svn:executable + * Added: sandbox/trunk/src/scala/SetsIntersectionBug.scala =================================================================== --- sandbox/trunk/src/scala/SetsIntersectionBug.scala (rev 0) +++ sandbox/trunk/src/scala/SetsIntersectionBug.scala 2008-06-02 00:26:13 UTC (rev 843) @@ -0,0 +1,8 @@ +import scala.collection.mutable._ +object SetsIntersectionBug extends Application { + val m1,m2 = new HashMap[Int,Int] + // This yields a build error, which seems like a compiler bug, since this + // works in the REPL. + val s = m1.keySet ** m2.keySet + println(s) +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:19:34
|
Revision: 842 http://assorted.svn.sourceforge.net/assorted/?rev=842&view=rev Author: yangzhang Date: 2008-06-01 17:19:41 -0700 (Sun, 01 Jun 2008) Log Message: ----------- somehow this tags file got updated Modified Paths: -------------- configs/trunk/src/vim/doc/tags Modified: configs/trunk/src/vim/doc/tags =================================================================== --- configs/trunk/src/vim/doc/tags 2008-06-02 00:19:27 UTC (rev 841) +++ configs/trunk/src/vim/doc/tags 2008-06-02 00:19:41 UTC (rev 842) @@ -1,312 +1,53 @@ +'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'* +'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'* +'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'* +'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'* +'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'* +'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'* +'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'* +'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'* +'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'* +'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'* +'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'* +'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'* +'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'* +'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'* +'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'* +'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'* +'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'* +'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'* +'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'* +'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'* +'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'* +'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'* +'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'* +'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'* +'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'* :MatchDebug matchit.txt /*:MatchDebug* -Alph latexhelp.txt /*Alph* -Alt-C latex-suite.txt /*Alt-C* -Alt-L latex-suite.txt /*Alt-L* -Alt-M latex-suite.txt /*Alt-M* -BibTeX latexhelp.txt /*BibTeX* -IMAP_PutTextWithMovement latex-suite.txt /*IMAP_PutTextWithMovement* -Imap_DeleteEmptyPlaceHolders latex-suite.txt /*Imap_DeleteEmptyPlaceHolders* -Imap_PlaceHolderEnd latex-suite.txt /*Imap_PlaceHolderEnd* -Imap_PlaceHolderStart latex-suite.txt /*Imap_PlaceHolderStart* -Imap_StickyPlaceHolders latex-suite.txt /*Imap_StickyPlaceHolders* -Imap_UsePlaceHolders latex-suite.txt /*Imap_UsePlaceHolders* -LaTeX latexhelp.txt /*LaTeX* +:TlistAddFiles taglist.txt /*:TlistAddFiles* +:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive* +:TlistClose taglist.txt /*:TlistClose* +:TlistDebug taglist.txt /*:TlistDebug* +:TlistHighlightTag taglist.txt /*:TlistHighlightTag* +:TlistLock taglist.txt /*:TlistLock* +:TlistMessages taglist.txt /*:TlistMessages* +:TlistOpen taglist.txt /*:TlistOpen* +:TlistSessionLoad taglist.txt /*:TlistSessionLoad* +:TlistSessionSave taglist.txt /*:TlistSessionSave* +:TlistShowPrototype taglist.txt /*:TlistShowPrototype* +:TlistShowTag taglist.txt /*:TlistShowTag* +:TlistToggle taglist.txt /*:TlistToggle* +:TlistUndebug taglist.txt /*:TlistUndebug* +:TlistUnlock taglist.txt /*:TlistUnlock* +:TlistUpdate taglist.txt /*:TlistUpdate* MatchError matchit.txt /*MatchError* -Plug_IMAP_DeleteAndJumBack latex-suite.txt /*Plug_IMAP_DeleteAndJumBack* -Plug_IMAP_DeleteAndJumpForward latex-suite.txt /*Plug_IMAP_DeleteAndJumpForward* -Plug_IMAP_JumpBack latex-suite.txt /*Plug_IMAP_JumpBack* -Plug_IMAP_JumpForward latex-suite.txt /*Plug_IMAP_JumpForward* -Plug_Tex_LeftRight latex-suite.txt /*Plug_Tex_LeftRight* -Plug_Tex_MathBF latex-suite.txt /*Plug_Tex_MathBF* -Plug_Tex_MathCal latex-suite.txt /*Plug_Tex_MathCal* -Roman latexhelp.txt /*Roman* -TClearCiteHist latex-suite.txt /*TClearCiteHist* -TLook latex-suite.txt /*TLook* -TLookAll latex-suite.txt /*TLookAll* -TLookBib latex-suite.txt /*TLookBib* -TMacro latex-suite.txt /*TMacro* -TMacroDelete latex-suite.txt /*TMacroDelete* -TMacroEdit latex-suite.txt /*TMacroEdit* -TMacroNew latex-suite.txt /*TMacroNew* -TPackage latex-suite.txt /*TPackage* -TPackageUpdate latex-suite.txt /*TPackageUpdate* -TPackageUpdateAll latex-suite.txt /*TPackageUpdateAll* -TPartComp latex-suite.txt /*TPartComp* -TPartView latex-suite.txt /*TPartView* -TSection latex-suite.txt /*TSection* -TSectionAdvanced latex-suite.txt /*TSectionAdvanced* -TTemplate latex-suite.txt /*TTemplate* -Tex_AutoFolding latex-suite.txt /*Tex_AutoFolding* -Tex_BIBINPUTS latex-suite.txt /*Tex_BIBINPUTS* -Tex_CatchVisMapErrors latex-suite.txt /*Tex_CatchVisMapErrors* -Tex_Com_name latex-suite.txt /*Tex_Com_name* -Tex_CompileRule_format latex-suite.txt /*Tex_CompileRule_format* -Tex_Debug latex-suite.txt /*Tex_Debug* -Tex_DefaultTargetFormat latex-suite.txt /*Tex_DefaultTargetFormat* -Tex_Diacritics latex-suite.txt /*Tex_Diacritics* -Tex_Env_name latex-suite.txt /*Tex_Env_name* -Tex_EnvironmentMaps latex-suite.txt /*Tex_EnvironmentMaps* -Tex_EnvironmentMenus latex-suite.txt /*Tex_EnvironmentMenus* -Tex_ExplorerHeight latex-suite.txt /*Tex_ExplorerHeight* -Tex_Folding latex-suite.txt /*Tex_Folding* -Tex_FontMaps latex-suite.txt /*Tex_FontMaps* -Tex_FontMenus latex-suite.txt /*Tex_FontMenus* -Tex_HotKeyMappings latex-suite.txt /*Tex_HotKeyMappings* -Tex_IgnoreLevel latex-suite.txt /*Tex_IgnoreLevel* -Tex_IgnoredWarnings latex-suite.txt /*Tex_IgnoredWarnings* -Tex_ImageDir latex-suite.txt /*Tex_ImageDir* -Tex_Leader latex-suite.txt /*Tex_Leader* -Tex_Leader2 latex-suite.txt /*Tex_Leader2* -Tex_MainFileExpression latex-suite.txt /*Tex_MainFileExpression* -Tex_MainMenuLocation latex-suite.txt /*Tex_MainMenuLocation* -Tex_MathMenus latex-suite.txt /*Tex_MathMenus* -Tex_Menus latex-suite.txt /*Tex_Menus* -Tex_MultipleCompileFormats latex-suite.txt /*Tex_MultipleCompileFormats* -Tex_NestElementMenus latex-suite.txt /*Tex_NestElementMenus* -Tex_NestPackagesMenu latex-suite.txt /*Tex_NestPackagesMenu* -Tex_PackagesMenu latex-suite.txt /*Tex_PackagesMenu* -Tex_PromptedCommands latex-suite.txt /*Tex_PromptedCommands* -Tex_PromptedEnvironments latex-suite.txt /*Tex_PromptedEnvironments* -Tex_RememberCiteSearch latex-suite.txt /*Tex_RememberCiteSearch* -Tex_SectionMaps latex-suite.txt /*Tex_SectionMaps* -Tex_SectionMenus latex-suite.txt /*Tex_SectionMenus* -Tex_SmartKeyBS latex-suite.txt /*Tex_SmartKeyBS* -Tex_SmartKeyQuote latex-suite.txt /*Tex_SmartKeyQuote* -Tex_TEXINPUTS latex-suite.txt /*Tex_TEXINPUTS* -Tex_UseMakefile latex-suite.txt /*Tex_UseMakefile* -Tex_UseMenuWizard latex-suite.txt /*Tex_UseMenuWizard* -Tex_UsePython latex-suite.txt /*Tex_UsePython* -Tex_UseUtfMenus latex-suite.txt /*Tex_UseUtfMenus* -Tex_ViewRule_format latex-suite.txt /*Tex_ViewRule_format* -Tex_ViewerCwindowHeight latex-suite.txt /*Tex_ViewerCwindowHeight* -Tex_ViewerPreviewHeight latex-suite.txt /*Tex_ViewerPreviewHeight* -Tshortcuts latex-suite.txt /*Tshortcuts* +Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()* +Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()* +Tlist_Set_App() taglist.txt /*Tlist_Set_App()* +Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()* [% matchit.txt /*[%* -\Alph latexhelp.txt /*\\Alph* -\Huge latexhelp.txt /*\\Huge* -\LARGE latexhelp.txt /*\\LARGE* -\Large latexhelp.txt /*\\Large* -\Roman latexhelp.txt /*\\Roman* -\\ latexhelp.txt /*\\\\* -\\\\ latexhelp.txt /*\\\\\\\\* -\addcontentsline latexhelp.txt /*\\addcontentsline* -\address latexhelp.txt /*\\address* -\addtocontents latexhelp.txt /*\\addtocontents* -\addtocounter latexhelp.txt /*\\addtocounter* -\addtolength latexhelp.txt /*\\addtolength* -\addvspace latexhelp.txt /*\\addvspace* -\alph latexhelp.txt /*\\alph* -\and latexhelp.txt /*\\and* -\appendix latexhelp.txt /*\\appendix* -\arabic latexhelp.txt /*\\arabic* -\author latexhelp.txt /*\\author* -\begin latexhelp.txt /*\\begin* -\bfseries latexhelp.txt /*\\bfseries* -\bibitem latexhelp.txt /*\\bibitem* -\bibliography latexhelp.txt /*\\bibliography* -\bibliographystyle latexhelp.txt /*\\bibliographystyle* -\bigskip latexhelp.txt /*\\bigskip* -\cc latexhelp.txt /*\\cc* -\cdots latexhelp.txt /*\\cdots* -\centering latexhelp.txt /*\\centering* -\chapter latexhelp.txt /*\\chapter* -\circle latexhelp.txt /*\\circle* -\cite latexhelp.txt /*\\cite* -\cleardoublepage latexhelp.txt /*\\cleardoublepage* -\clearpage latexhelp.txt /*\\clearpage* -\cline latexhelp.txt /*\\cline* -\closing latexhelp.txt /*\\closing* -\dashbox latexhelp.txt /*\\dashbox* -\date latexhelp.txt /*\\date* -\ddots latexhelp.txt /*\\ddots* -\depth latexhelp.txt /*\\depth* -\documentclass latexhelp.txt /*\\documentclass* -\dotfill latexhelp.txt /*\\dotfill* -\emph latexhelp.txt /*\\emph* -\end latexhelp.txt /*\\end* -\enlargethispage latexhelp.txt /*\\enlargethispage* -\fbox latexhelp.txt /*\\fbox* -\flushbottom latexhelp.txt /*\\flushbottom* -\fnsymbol latexhelp.txt /*\\fnsymbol* -\fontencoding latexhelp.txt /*\\fontencoding* -\fontfamily latexhelp.txt /*\\fontfamily* -\fontseries latexhelp.txt /*\\fontseries* -\fontshape latexhelp.txt /*\\fontshape* -\fontsize latexhelp.txt /*\\fontsize* -\footnote latexhelp.txt /*\\footnote* -\footnotemark latexhelp.txt /*\\footnotemark* -\footnotesize latexhelp.txt /*\\footnotesize* -\footnotetext latexhelp.txt /*\\footnotetext* -\frac latexhelp.txt /*\\frac* -\frame latexhelp.txt /*\\frame* -\framebox latexhelp.txt /*\\framebox* -\fussy latexhelp.txt /*\\fussy* -\height latexhelp.txt /*\\height* -\hfill latexhelp.txt /*\\hfill* -\hline latexhelp.txt /*\\hline* -\hrulefill latexhelp.txt /*\\hrulefill* -\hspace latexhelp.txt /*\\hspace* -\huge latexhelp.txt /*\\huge* -\hyphenation latexhelp.txt /*\\hyphenation* -\include latexhelp.txt /*\\include* -\includeonly latexhelp.txt /*\\includeonly* -\indent latexhelp.txt /*\\indent* -\input latexhelp.txt /*\\input* -\item latexhelp.txt /*\\item* -\itshape latexhelp.txt /*\\itshape* -\kill latexhelp.txt /*\\kill* -\label latexhelp.txt /*\\label* -\large latexhelp.txt /*\\large* -\ldots latexhelp.txt /*\\ldots* -\lefteqn latexhelp.txt /*\\lefteqn* -\letter latexhelp.txt /*\\letter* -\line latexhelp.txt /*\\line* -\linebreak latexhelp.txt /*\\linebreak* -\linethickness latexhelp.txt /*\\linethickness* -\listoffigures latexhelp.txt /*\\listoffigures* -\listoftables latexhelp.txt /*\\listoftables* -\location latexhelp.txt /*\\location* -\lrbox latexhelp.txt /*\\lrbox* -\makebox latexhelp.txt /*\\makebox* -\makelabels latexhelp.txt /*\\makelabels* -\maketitle latexhelp.txt /*\\maketitle* -\marginpar latexhelp.txt /*\\marginpar* -\markboth latexhelp.txt /*\\markboth* -\markright latexhelp.txt /*\\markright* -\mathbf latexhelp.txt /*\\mathbf* -\mathcal latexhelp.txt /*\\mathcal* -\mathit latexhelp.txt /*\\mathit* -\mathnormal latexhelp.txt /*\\mathnormal* -\mathrm latexhelp.txt /*\\mathrm* -\mathsf latexhelp.txt /*\\mathsf* -\mathtt latexhelp.txt /*\\mathtt* -\mathversion latexhelp.txt /*\\mathversion* -\mbox latexhelp.txt /*\\mbox* -\mdseries latexhelp.txt /*\\mdseries* -\medskip latexhelp.txt /*\\medskip* -\multicolumn latexhelp.txt /*\\multicolumn* -\multiput latexhelp.txt /*\\multiput* -\name latexhelp.txt /*\\name* -\newcommand latexhelp.txt /*\\newcommand* -\newcounter latexhelp.txt /*\\newcounter* -\newenvironment latexhelp.txt /*\\newenvironment* -\newfont latexhelp.txt /*\\newfont* -\newlength latexhelp.txt /*\\newlength* -\newline latexhelp.txt /*\\newline* -\newpage latexhelp.txt /*\\newpage* -\newsavebox latexhelp.txt /*\\newsavebox* -\newtheorem latexhelp.txt /*\\newtheorem* -\nocite latexhelp.txt /*\\nocite* -\nofiles latexhelp.txt /*\\nofiles* -\noindent latexhelp.txt /*\\noindent* -\nolinebreak latexhelp.txt /*\\nolinebreak* -\nonumber latexhelp.txt /*\\nonumber* -\nopagebreak latexhelp.txt /*\\nopagebreak* -\normalfont latexhelp.txt /*\\normalfont* -\normalsize latexhelp.txt /*\\normalsize* -\onecolumn latexhelp.txt /*\\onecolumn* -\opening latexhelp.txt /*\\opening* -\oval latexhelp.txt /*\\oval* -\overbrace latexhelp.txt /*\\overbrace* -\overline latexhelp.txt /*\\overline* -\pagebreak latexhelp.txt /*\\pagebreak* -\pagenumbering latexhelp.txt /*\\pagenumbering* -\pageref latexhelp.txt /*\\pageref* -\pagestyle latexhelp.txt /*\\pagestyle* -\par latexhelp.txt /*\\par* -\paragraph latexhelp.txt /*\\paragraph* -\parbox latexhelp.txt /*\\parbox* -\part latexhelp.txt /*\\part* -\picture-framebox latexhelp.txt /*\\picture-framebox* -\ps latexhelp.txt /*\\ps* -\pushtabs latexhelp.txt /*\\pushtabs* -\put latexhelp.txt /*\\put* -\raggedbottom latexhelp.txt /*\\raggedbottom* -\raggedleft latexhelp.txt /*\\raggedleft* -\raggedright latexhelp.txt /*\\raggedright* -\raisebox latexhelp.txt /*\\raisebox* -\ref latexhelp.txt /*\\ref* -\refstepcounter latexhelp.txt /*\\refstepcounter* -\renewcommand latexhelp.txt /*\\renewcommand* -\renewenvironment latexhelp.txt /*\\renewenvironment* -\reversemarginpar latexhelp.txt /*\\reversemarginpar* -\rmfamily latexhelp.txt /*\\rmfamily* -\roman latexhelp.txt /*\\roman* -\rule latexhelp.txt /*\\rule* -\savebox latexhelp.txt /*\\savebox* -\sbox latexhelp.txt /*\\sbox* -\scriptsize latexhelp.txt /*\\scriptsize* -\scshape latexhelp.txt /*\\scshape* -\section latexhelp.txt /*\\section* -\selectfont latexhelp.txt /*\\selectfont* -\setcounter latexhelp.txt /*\\setcounter* -\setlength latexhelp.txt /*\\setlength* -\settodepth latexhelp.txt /*\\settodepth* -\settoheight latexhelp.txt /*\\settoheight* -\settowidth latexhelp.txt /*\\settowidth* -\sffamily latexhelp.txt /*\\sffamily* -\shortstack latexhelp.txt /*\\shortstack* -\signature latexhelp.txt /*\\signature* -\sloppy latexhelp.txt /*\\sloppy* -\slshape latexhelp.txt /*\\slshape* -\small latexhelp.txt /*\\small* -\smallskip latexhelp.txt /*\\smallskip* -\space latexhelp.txt /*\\space* -\sqrt latexhelp.txt /*\\sqrt* -\startbreaks latexhelp.txt /*\\startbreaks* -\stepcounter latexhelp.txt /*\\stepcounter* -\stopbreaks latexhelp.txt /*\\stopbreaks* -\subparagraph latexhelp.txt /*\\subparagraph* -\subsection latexhelp.txt /*\\subsection* -\subsubsection latexhelp.txt /*\\subsubsection* -\symbol latexhelp.txt /*\\symbol* -\table latexhelp.txt /*\\table* -\tableofcontents latexhelp.txt /*\\tableofcontents* -\telephone latexhelp.txt /*\\telephone* -\textbf latexhelp.txt /*\\textbf* -\textit latexhelp.txt /*\\textit* -\textmd latexhelp.txt /*\\textmd* -\textnormal latexhelp.txt /*\\textnormal* -\textrm latexhelp.txt /*\\textrm* -\textsc latexhelp.txt /*\\textsc* -\textsf latexhelp.txt /*\\textsf* -\textsl latexhelp.txt /*\\textsl* -\texttt latexhelp.txt /*\\texttt* -\textup latexhelp.txt /*\\textup* -\thanks latexhelp.txt /*\\thanks* -\thebibliography latexhelp.txt /*\\thebibliography* -\thispagestyle latexhelp.txt /*\\thispagestyle* -\tiny latexhelp.txt /*\\tiny* -\title latexhelp.txt /*\\title* -\totalheight latexhelp.txt /*\\totalheight* -\ttfamily latexhelp.txt /*\\ttfamily* -\twocolumn latexhelp.txt /*\\twocolumn* -\typein latexhelp.txt /*\\typein* -\typeout latexhelp.txt /*\\typeout* -\underbrace latexhelp.txt /*\\underbrace* -\underline latexhelp.txt /*\\underline* -\upshape latexhelp.txt /*\\upshape* -\usebox latexhelp.txt /*\\usebox* -\usecounter latexhelp.txt /*\\usecounter* -\usefont latexhelp.txt /*\\usefont* -\usepackage latexhelp.txt /*\\usepackage* -\value latexhelp.txt /*\\value* -\vdots latexhelp.txt /*\\vdots* -\vector latexhelp.txt /*\\vector* -\verb latexhelp.txt /*\\verb* -\vfill latexhelp.txt /*\\vfill* -\vline latexhelp.txt /*\\vline* -\vspace latexhelp.txt /*\\vspace* -\width latexhelp.txt /*\\width* ]% matchit.txt /*]%* -adding-bib-options latex-suite.txt /*adding-bib-options* -alph latexhelp.txt /*alph* and haskell.txt /*and* -arabic latexhelp.txt /*arabic* -array latexhelp.txt /*array* -article-class latexhelp.txt /*article-class* -auc-tex-mappings latex-suite.txt /*auc-tex-mappings* -automatic-package-detection latex-suite.txt /*automatic-package-detection* b:match_col matchit.txt /*b:match_col* b:match_debug matchit.txt /*b:match_debug* b:match_ignorecase matchit.txt /*b:match_ignorecase* @@ -320,429 +61,12 @@ b:match_wholeBR matchit.txt /*b:match_wholeBR* b:match_word matchit.txt /*b:match_word* b:match_words matchit.txt /*b:match_words* -bibtex latexhelp.txt /*bibtex* -bibtex-bindings latex-suite.txt /*bibtex-bindings* -book-class latexhelp.txt /*book-class* -bracketing-macros latex-suite.txt /*bracketing-macros* -center latexhelp.txt /*center* -cite-search-caching latex-suite.txt /*cite-search-caching* -compiler-customization latex-suite.txt /*compiler-customization* -compiler-dependency latex-suite.txt /*compiler-dependency* -compiler-output-customization latex-suite.txt /*compiler-output-customization* -compiler-rules latex-suite.txt /*compiler-rules* -compiling-multiple latex-suite.txt /*compiling-multiple* -completion-window-preferences latex-suite.txt /*completion-window-preferences* -custom-macros-menu latex-suite.txt /*custom-macros-menu* -custom-packages latex-suite.txt /*custom-packages* -customize-alt-key-maps latex-suite.txt /*customize-alt-key-maps* -customize-imap-maps latex-suite.txt /*customize-imap-maps* -customizing-folding latex-suite.txt /*customizing-folding* -customizing-latex-completion latex-suite.txt /*customizing-latex-completion* -customizing-latex-suite latex-suite.txt /*customizing-latex-suite* -customizing-macros latex-suite.txt /*customizing-macros* -customizing-menus latex-suite.txt /*customizing-menus* -customizing-packages latex-suite.txt /*customizing-packages* -customizing-place-holders latex-suite.txt /*customizing-place-holders* -customizing-smart-keys latex-suite.txt /*customizing-smart-keys* -customizing-what-to-fold latex-suite.txt /*customizing-what-to-fold* -default-folding latex-suite.txt /*default-folding* -description latexhelp.txt /*description* -diacritic-mappings latex-suite.txt /*diacritic-mappings* -displaymath latexhelp.txt /*displaymath* -draft latexhelp.txt /*draft* -empty latexhelp.txt /*empty* -enabling-searching latex-suite.txt /*enabling-searching* -enumerate latexhelp.txt /*enumerate* -environment-mappings latex-suite.txt /*environment-mappings* -eqnarray latexhelp.txt /*eqnarray* -equation latexhelp.txt /*equation* -figure latexhelp.txt /*figure* -final latexhelp.txt /*final* -fleqn latexhelp.txt /*fleqn* -flushleft latexhelp.txt /*flushleft* -flushright latexhelp.txt /*flushright* -font-lowlevelcommands latexhelp.txt /*font-lowlevelcommands* -font-maps latex-suite.txt /*font-maps* -font-size latexhelp.txt /*font-size* -font-styles latexhelp.txt /*font-styles* -forward-searching latex-suite.txt /*forward-searching* g% matchit.txt /*g%* ghci.vim haskell.txt /*ghci.vim* -greek-letter-mappings latex-suite.txt /*greek-letter-mappings* haskell-Intro haskell.txt /*haskell-Intro* haskell-Overview haskell.txt /*haskell-Overview* haskell.vim haskell.txt /*haskell.vim* -headings latexhelp.txt /*headings* hugs.vim haskell.txt /*hugs.vim* -hyph- latexhelp.txt /*hyph-* -im_1 imaps.txt /*im_1* -imaps-usage imaps.txt /*imaps-usage* -imaps.txt imaps.txt /*imaps.txt* -imaps.txt-toc imaps.txt /*imaps.txt-toc* -insert-mode-environment-mappings latex-suite.txt /*insert-mode-environment-mappings* -inserting-packages latex-suite.txt /*inserting-packages* -inverse-searching latex-suite.txt /*inverse-searching* -itemize latexhelp.txt /*itemize* -landscape latexhelp.txt /*landscape* -latex latexhelp.txt /*latex* -latex-boxes latexhelp.txt /*latex-boxes* -latex-breaking latexhelp.txt /*latex-breaking* -latex-classes latexhelp.txt /*latex-classes* -latex-command-maps latex-suite.txt /*latex-command-maps* -latex-commands latexhelp.txt /*latex-commands* -latex-compiling latex-suite.txt /*latex-compiling* -latex-completion latex-suite.txt /*latex-completion* -latex-completion-cite latex-suite.txt /*latex-completion-cite* -latex-counters latexhelp.txt /*latex-counters* -latex-definitions latexhelp.txt /*latex-definitions* -latex-environments latexhelp.txt /*latex-environments* -latex-folding latex-suite.txt /*latex-folding* -latex-footnotes latexhelp.txt /*latex-footnotes* -latex-hor-space latexhelp.txt /*latex-hor-space* -latex-inputing latexhelp.txt /*latex-inputing* -latex-layout latexhelp.txt /*latex-layout* -latex-lenghts latexhelp.txt /*latex-lenghts* -latex-letters latexhelp.txt /*latex-letters* -latex-macros latex-suite.txt /*latex-macros* -latex-margin-notes latexhelp.txt /*latex-margin-notes* -latex-master-file latex-suite.txt /*latex-master-file* -latex-math latexhelp.txt /*latex-math* -latex-modes latexhelp.txt /*latex-modes* -latex-package-scanning latex-suite.txt /*latex-package-scanning* -latex-packages latex-suite.txt /*latex-packages* -latex-page-styles latexhelp.txt /*latex-page-styles* -latex-paragraphs latexhelp.txt /*latex-paragraphs* -latex-parameters latexhelp.txt /*latex-parameters* -latex-references latexhelp.txt /*latex-references* -latex-sectioning latexhelp.txt /*latex-sectioning* -latex-spaces-boxes latexhelp.txt /*latex-spaces-boxes* -latex-special latexhelp.txt /*latex-special* -latex-start-end latexhelp.txt /*latex-start-end* -latex-suite-commands latex-suite.txt /*latex-suite-commands* -latex-suite-commands-maps latex-suite.txt /*latex-suite-commands-maps* -latex-suite-credits latex-suite.txt /*latex-suite-credits* -latex-suite-maintainer latex-suite.txt /*latex-suite-maintainer* -latex-suite-maps latex-suite.txt /*latex-suite-maps* -latex-suite-templates latex-suite.txt /*latex-suite-templates* -latex-suite.txt latex-suite.txt /*latex-suite.txt* -latex-suite.txt-toc latex-suite.txt /*latex-suite.txt-toc* -latex-terminal latexhelp.txt /*latex-terminal* -latex-toc latexhelp.txt /*latex-toc* -latex-typefaces latexhelp.txt /*latex-typefaces* -latex-ver-space latexhelp.txt /*latex-ver-space* -latex-viewing latex-suite.txt /*latex-viewing* -latexhelp.txt latexhelp.txt /*latexhelp.txt* -leqno latexhelp.txt /*leqno* -letter-class latexhelp.txt /*letter-class* -list latexhelp.txt /*list* -lr-mode latexhelp.txt /*lr-mode* -ls-completion-custom latex-suite.txt /*ls-completion-custom* -ls-completion-ref latex-suite.txt /*ls-completion-ref* -ls-completion-usage latex-suite.txt /*ls-completion-usage* -ls-filename-completion latex-suite.txt /*ls-filename-completion* -ls-general-purpose-settings latex-suite.txt /*ls-general-purpose-settings* -ls-imap-f5 latex-suite.txt /*ls-imap-f5* -ls-imap-f7 latex-suite.txt /*ls-imap-f7* -ls-imap-s-f7 latex-suite.txt /*ls-imap-s-f7* -ls-imaps-syntax latex-suite.txt /*ls-imaps-syntax* -ls-new-macros latex-suite.txt /*ls-new-macros* -ls-set-grepprg latex-suite.txt /*ls-set-grepprg* -ls-vmap-f5 latex-suite.txt /*ls-vmap-f5* -ls-vmap-f7 latex-suite.txt /*ls-vmap-f7* -ls_1 latex-suite.txt /*ls_1* -ls_10 latex-suite.txt /*ls_10* -ls_10_1 latex-suite.txt /*ls_10_1* -ls_10_10 latex-suite.txt /*ls_10_10* -ls_10_10_1 latex-suite.txt /*ls_10_10_1* -ls_10_1_1 latex-suite.txt /*ls_10_1_1* -ls_10_1_2 latex-suite.txt /*ls_10_1_2* -ls_10_2 latex-suite.txt /*ls_10_2* -ls_10_2_1 latex-suite.txt /*ls_10_2_1* -ls_10_2_2 latex-suite.txt /*ls_10_2_2* -ls_10_2_3 latex-suite.txt /*ls_10_2_3* -ls_10_2_4 latex-suite.txt /*ls_10_2_4* -ls_10_3 latex-suite.txt /*ls_10_3* -ls_10_3_1 latex-suite.txt /*ls_10_3_1* -ls_10_3_10 latex-suite.txt /*ls_10_3_10* -ls_10_3_2 latex-suite.txt /*ls_10_3_2* -ls_10_3_3 latex-suite.txt /*ls_10_3_3* -ls_10_3_4 latex-suite.txt /*ls_10_3_4* -ls_10_3_5 latex-suite.txt /*ls_10_3_5* -ls_10_3_6 latex-suite.txt /*ls_10_3_6* -ls_10_3_7 latex-suite.txt /*ls_10_3_7* -ls_10_3_8 latex-suite.txt /*ls_10_3_8* -ls_10_3_9 latex-suite.txt /*ls_10_3_9* -ls_10_4 latex-suite.txt /*ls_10_4* -ls_10_4_1 latex-suite.txt /*ls_10_4_1* -ls_10_4_2 latex-suite.txt /*ls_10_4_2* -ls_10_5 latex-suite.txt /*ls_10_5* -ls_10_5_1 latex-suite.txt /*ls_10_5_1* -ls_10_5_2 latex-suite.txt /*ls_10_5_2* -ls_10_5_3 latex-suite.txt /*ls_10_5_3* -ls_10_6 latex-suite.txt /*ls_10_6* -ls_10_6_1 latex-suite.txt /*ls_10_6_1* -ls_10_6_2 latex-suite.txt /*ls_10_6_2* -ls_10_6_3 latex-suite.txt /*ls_10_6_3* -ls_10_6_4 latex-suite.txt /*ls_10_6_4* -ls_10_6_5 latex-suite.txt /*ls_10_6_5* -ls_10_6_6 latex-suite.txt /*ls_10_6_6* -ls_10_6_7 latex-suite.txt /*ls_10_6_7* -ls_10_7 latex-suite.txt /*ls_10_7* -ls_10_7_1 latex-suite.txt /*ls_10_7_1* -ls_10_8 latex-suite.txt /*ls_10_8* -ls_10_8_1 latex-suite.txt /*ls_10_8_1* -ls_10_8_2 latex-suite.txt /*ls_10_8_2* -ls_10_8_3 latex-suite.txt /*ls_10_8_3* -ls_10_8_4 latex-suite.txt /*ls_10_8_4* -ls_10_8_5 latex-suite.txt /*ls_10_8_5* -ls_10_8_6 latex-suite.txt /*ls_10_8_6* -ls_10_8_7 latex-suite.txt /*ls_10_8_7* -ls_10_9 latex-suite.txt /*ls_10_9* -ls_10_9_1 latex-suite.txt /*ls_10_9_1* -ls_10_9_2 latex-suite.txt /*ls_10_9_2* -ls_11 latex-suite.txt /*ls_11* -ls_2 latex-suite.txt /*ls_2* -ls_3 latex-suite.txt /*ls_3* -ls_3_1 latex-suite.txt /*ls_3_1* -ls_3_10 latex-suite.txt /*ls_3_10* -ls_3_10_1 latex-suite.txt /*ls_3_10_1* -ls_3_10_2 latex-suite.txt /*ls_3_10_2* -ls_3_10_3 latex-suite.txt /*ls_3_10_3* -ls_3_11 latex-suite.txt /*ls_3_11* -ls_3_12 latex-suite.txt /*ls_3_12* -ls_3_12_1 latex-suite.txt /*ls_3_12_1* -ls_3_12_2 latex-suite.txt /*ls_3_12_2* -ls_3_1_1 latex-suite.txt /*ls_3_1_1* -ls_3_1_1_1 latex-suite.txt /*ls_3_1_1_1* -ls_3_1_1_2 latex-suite.txt /*ls_3_1_1_2* -ls_3_1_1_3 latex-suite.txt /*ls_3_1_1_3* -ls_3_1_1_4 latex-suite.txt /*ls_3_1_1_4* -ls_3_1_2 latex-suite.txt /*ls_3_1_2* -ls_3_1_3 latex-suite.txt /*ls_3_1_3* -ls_3_2 latex-suite.txt /*ls_3_2* -ls_3_3 latex-suite.txt /*ls_3_3* -ls_3_4 latex-suite.txt /*ls_3_4* -ls_3_5 latex-suite.txt /*ls_3_5* -ls_3_6 latex-suite.txt /*ls_3_6* -ls_3_7 latex-suite.txt /*ls_3_7* -ls_3_8 latex-suite.txt /*ls_3_8* -ls_3_8_1 latex-suite.txt /*ls_3_8_1* -ls_3_9 latex-suite.txt /*ls_3_9* -ls_4 latex-suite.txt /*ls_4* -ls_4_1 latex-suite.txt /*ls_4_1* -ls_4_2 latex-suite.txt /*ls_4_2* -ls_4_3 latex-suite.txt /*ls_4_3* -ls_4_3_1 latex-suite.txt /*ls_4_3_1* -ls_4_4 latex-suite.txt /*ls_4_4* -ls_4_4_1 latex-suite.txt /*ls_4_4_1* -ls_4_4_2 latex-suite.txt /*ls_4_4_2* -ls_5 latex-suite.txt /*ls_5* -ls_5_1 latex-suite.txt /*ls_5_1* -ls_5_2 latex-suite.txt /*ls_5_2* -ls_5_3 latex-suite.txt /*ls_5_3* -ls_5_3_1 latex-suite.txt /*ls_5_3_1* -ls_5_4 latex-suite.txt /*ls_5_4* -ls_5_5 latex-suite.txt /*ls_5_5* -ls_6 latex-suite.txt /*ls_6* -ls_6_1 latex-suite.txt /*ls_6_1* -ls_6_2 latex-suite.txt /*ls_6_2* -ls_6_3 latex-suite.txt /*ls_6_3* -ls_6_4 latex-suite.txt /*ls_6_4* -ls_6_5 latex-suite.txt /*ls_6_5* -ls_6_6 latex-suite.txt /*ls_6_6* -ls_7 latex-suite.txt /*ls_7* -ls_7_1 latex-suite.txt /*ls_7_1* -ls_7_2 latex-suite.txt /*ls_7_2* -ls_8 latex-suite.txt /*ls_8* -ls_8_1 latex-suite.txt /*ls_8_1* -ls_8_2 latex-suite.txt /*ls_8_2* -ls_9 latex-suite.txt /*ls_9* -ls_9_1 latex-suite.txt /*ls_9_1* -ls_9_1_1 latex-suite.txt /*ls_9_1_1* -ls_9_1_2 latex-suite.txt /*ls_9_1_2* -ls_9_2 latex-suite.txt /*ls_9_2* -ls_9_2_1 latex-suite.txt /*ls_9_2_1* -ls_9_2_10 latex-suite.txt /*ls_9_2_10* -ls_9_2_11 latex-suite.txt /*ls_9_2_11* -ls_9_2_12 latex-suite.txt /*ls_9_2_12* -ls_9_2_13 latex-suite.txt /*ls_9_2_13* -ls_9_2_14 latex-suite.txt /*ls_9_2_14* -ls_9_2_15 latex-suite.txt /*ls_9_2_15* -ls_9_2_16 latex-suite.txt /*ls_9_2_16* -ls_9_2_2 latex-suite.txt /*ls_9_2_2* -ls_9_2_3 latex-suite.txt /*ls_9_2_3* -ls_9_2_4 latex-suite.txt /*ls_9_2_4* -ls_9_2_5 latex-suite.txt /*ls_9_2_5* -ls_9_2_6 latex-suite.txt /*ls_9_2_6* -ls_9_2_7 latex-suite.txt /*ls_9_2_7* -ls_9_2_8 latex-suite.txt /*ls_9_2_8* -ls_9_2_9 latex-suite.txt /*ls_9_2_9* -ls_a_bA latex-suite.txt /*ls_a_bA* -ls_a_bB latex-suite.txt /*ls_a_bB* -ls_a_bC latex-suite.txt /*ls_a_bC* -ls_a_bD latex-suite.txt /*ls_a_bD* -ls_a_bE latex-suite.txt /*ls_a_bE* -ls_a_bF latex-suite.txt /*ls_a_bF* -ls_a_bG latex-suite.txt /*ls_a_bG* -ls_a_bH latex-suite.txt /*ls_a_bH* -ls_a_bI latex-suite.txt /*ls_a_bI* -ls_a_bJ latex-suite.txt /*ls_a_bJ* -ls_a_bK latex-suite.txt /*ls_a_bK* -ls_a_bL latex-suite.txt /*ls_a_bL* -ls_a_bM latex-suite.txt /*ls_a_bM* -ls_a_bN latex-suite.txt /*ls_a_bN* -ls_a_bO latex-suite.txt /*ls_a_bO* -ls_a_bP latex-suite.txt /*ls_a_bP* -ls_a_bQ latex-suite.txt /*ls_a_bQ* -ls_a_bR latex-suite.txt /*ls_a_bR* -ls_a_bS latex-suite.txt /*ls_a_bS* -ls_a_bT latex-suite.txt /*ls_a_bT* -ls_a_bU latex-suite.txt /*ls_a_bU* -ls_a_bV latex-suite.txt /*ls_a_bV* -ls_a_bW latex-suite.txt /*ls_a_bW* -ls_a_bX latex-suite.txt /*ls_a_bX* -ls_a_bY latex-suite.txt /*ls_a_bY* -ls_a_bZ latex-suite.txt /*ls_a_bZ* -ls_a_bc latex-suite.txt /*ls_a_bc* -ls_a_bd latex-suite.txt /*ls_a_bd* -ls_a_be latex-suite.txt /*ls_a_be* -ls_a_bf latex-suite.txt /*ls_a_bf* -ls_a_bg latex-suite.txt /*ls_a_bg* -ls_a_bh latex-suite.txt /*ls_a_bh* -ls_a_bi latex-suite.txt /*ls_a_bi* -ls_a_bj latex-suite.txt /*ls_a_bj* -ls_a_bk latex-suite.txt /*ls_a_bk* -ls_a_bl latex-suite.txt /*ls_a_bl* -ls_a_bm latex-suite.txt /*ls_a_bm* -ls_a_bn latex-suite.txt /*ls_a_bn* -ls_a_bo latex-suite.txt /*ls_a_bo* -ls_a_bp latex-suite.txt /*ls_a_bp* -ls_a_bq latex-suite.txt /*ls_a_bq* -ls_a_br latex-suite.txt /*ls_a_br* -ls_a_bs latex-suite.txt /*ls_a_bs* -ls_a_bt latex-suite.txt /*ls_a_bt* -ls_a_bu latex-suite.txt /*ls_a_bu* -ls_a_bv latex-suite.txt /*ls_a_bv* -ls_a_bw latex-suite.txt /*ls_a_bw* -ls_a_bx latex-suite.txt /*ls_a_bx* -ls_a_by latex-suite.txt /*ls_a_by* -ls_a_bz latex-suite.txt /*ls_a_bz* -ls_a_cA latex-suite.txt /*ls_a_cA* -ls_a_cB latex-suite.txt /*ls_a_cB* -ls_a_cC latex-suite.txt /*ls_a_cC* -ls_a_cD latex-suite.txt /*ls_a_cD* -ls_a_cE latex-suite.txt /*ls_a_cE* -ls_a_cF latex-suite.txt /*ls_a_cF* -ls_a_cG latex-suite.txt /*ls_a_cG* -ls_a_cH latex-suite.txt /*ls_a_cH* -ls_a_cI latex-suite.txt /*ls_a_cI* -ls_a_cJ latex-suite.txt /*ls_a_cJ* -ls_a_cK latex-suite.txt /*ls_a_cK* -ls_a_cL latex-suite.txt /*ls_a_cL* -ls_a_cM latex-suite.txt /*ls_a_cM* -ls_a_cN latex-suite.txt /*ls_a_cN* -ls_a_cO latex-suite.txt /*ls_a_cO* -ls_a_cP latex-suite.txt /*ls_a_cP* -ls_a_cQ latex-suite.txt /*ls_a_cQ* -ls_a_cR latex-suite.txt /*ls_a_cR* -ls_a_cS latex-suite.txt /*ls_a_cS* -ls_a_cT latex-suite.txt /*ls_a_cT* -ls_a_cU latex-suite.txt /*ls_a_cU* -ls_a_cV latex-suite.txt /*ls_a_cV* -ls_a_cW latex-suite.txt /*ls_a_cW* -ls_a_cX latex-suite.txt /*ls_a_cX* -ls_a_cY latex-suite.txt /*ls_a_cY* -ls_a_cZ latex-suite.txt /*ls_a_cZ* -ls_a_ca latex-suite.txt /*ls_a_ca* -ls_a_cb latex-suite.txt /*ls_a_cb* -ls_a_cc latex-suite.txt /*ls_a_cc* -ls_a_cd latex-suite.txt /*ls_a_cd* -ls_a_ce latex-suite.txt /*ls_a_ce* -ls_a_cf latex-suite.txt /*ls_a_cf* -ls_a_cg latex-suite.txt /*ls_a_cg* -ls_a_ch latex-suite.txt /*ls_a_ch* -ls_a_ci latex-suite.txt /*ls_a_ci* -ls_a_cj latex-suite.txt /*ls_a_cj* -ls_a_ck latex-suite.txt /*ls_a_ck* -ls_a_cl latex-suite.txt /*ls_a_cl* -ls_a_cm latex-suite.txt /*ls_a_cm* -ls_a_cn latex-suite.txt /*ls_a_cn* -ls_a_co latex-suite.txt /*ls_a_co* -ls_a_cp latex-suite.txt /*ls_a_cp* -ls_a_cq latex-suite.txt /*ls_a_cq* -ls_a_cr latex-suite.txt /*ls_a_cr* -ls_a_cs latex-suite.txt /*ls_a_cs* -ls_a_ct latex-suite.txt /*ls_a_ct* -ls_a_cu latex-suite.txt /*ls_a_cu* -ls_a_cv latex-suite.txt /*ls_a_cv* -ls_a_cw latex-suite.txt /*ls_a_cw* -ls_a_cx latex-suite.txt /*ls_a_cx* -ls_a_cy latex-suite.txt /*ls_a_cy* -ls_a_cz latex-suite.txt /*ls_a_cz* -ls_a_dA latex-suite.txt /*ls_a_dA* -ls_a_dB latex-suite.txt /*ls_a_dB* -ls_a_dC latex-suite.txt /*ls_a_dC* -ls_a_dD latex-suite.txt /*ls_a_dD* -ls_a_dE latex-suite.txt /*ls_a_dE* -ls_a_dF latex-suite.txt /*ls_a_dF* -ls_a_dG latex-suite.txt /*ls_a_dG* -ls_a_dH latex-suite.txt /*ls_a_dH* -ls_a_dI latex-suite.txt /*ls_a_dI* -ls_a_dJ latex-suite.txt /*ls_a_dJ* -ls_a_dK latex-suite.txt /*ls_a_dK* -ls_a_dL latex-suite.txt /*ls_a_dL* -ls_a_dM latex-suite.txt /*ls_a_dM* -ls_a_dN latex-suite.txt /*ls_a_dN* -ls_a_dO latex-suite.txt /*ls_a_dO* -ls_a_dP latex-suite.txt /*ls_a_dP* -ls_a_dQ latex-suite.txt /*ls_a_dQ* -ls_a_dR latex-suite.txt /*ls_a_dR* -ls_a_dS latex-suite.txt /*ls_a_dS* -ls_a_dT latex-suite.txt /*ls_a_dT* -ls_a_dU latex-suite.txt /*ls_a_dU* -ls_a_dV latex-suite.txt /*ls_a_dV* -ls_a_dW latex-suite.txt /*ls_a_dW* -ls_a_dX latex-suite.txt /*ls_a_dX* -ls_a_dY latex-suite.txt /*ls_a_dY* -ls_a_dZ latex-suite.txt /*ls_a_dZ* -ls_a_da latex-suite.txt /*ls_a_da* -ls_a_db latex-suite.txt /*ls_a_db* -ls_a_dc latex-suite.txt /*ls_a_dc* -ls_a_dd latex-suite.txt /*ls_a_dd* -ls_a_de latex-suite.txt /*ls_a_de* -ls_a_df latex-suite.txt /*ls_a_df* -ls_a_dg latex-suite.txt /*ls_a_dg* -ls_a_dh latex-suite.txt /*ls_a_dh* -ls_a_di latex-suite.txt /*ls_a_di* -ls_a_dj latex-suite.txt /*ls_a_dj* -ls_a_dk latex-suite.txt /*ls_a_dk* -ls_a_dl latex-suite.txt /*ls_a_dl* -ls_a_dm latex-suite.txt /*ls_a_dm* -ls_a_dn latex-suite.txt /*ls_a_dn* -ls_a_do latex-suite.txt /*ls_a_do* -ls_a_dp latex-suite.txt /*ls_a_dp* -ls_a_dq latex-suite.txt /*ls_a_dq* -ls_a_dr latex-suite.txt /*ls_a_dr* -ls_a_ds latex-suite.txt /*ls_a_ds* -ls_a_dt latex-suite.txt /*ls_a_dt* -ls_a_du latex-suite.txt /*ls_a_du* -ls_a_dv latex-suite.txt /*ls_a_dv* -ls_a_dw latex-suite.txt /*ls_a_dw* -ls_a_dx latex-suite.txt /*ls_a_dx* -ls_a_dy latex-suite.txt /*ls_a_dy* -ls_a_dz latex-suite.txt /*ls_a_dz* -ls_a_ea latex-suite.txt /*ls_a_ea* -ls_a_eb latex-suite.txt /*ls_a_eb* -ls_a_ec latex-suite.txt /*ls_a_ec* -ls_a_ed latex-suite.txt /*ls_a_ed* -ls_a_ee latex-suite.txt /*ls_a_ee* -ls_a_ef latex-suite.txt /*ls_a_ef* -ls_a_eg latex-suite.txt /*ls_a_eg* -ls_a_eh latex-suite.txt /*ls_a_eh* -ls_u_1 latex-suite.txt /*ls_u_1* -ls_u_2 latex-suite.txt /*ls_u_2* -ls_u_3 latex-suite.txt /*ls_u_3* -ls_u_4 latex-suite.txt /*ls_u_4* matchit matchit.txt /*matchit* matchit-% matchit.txt /*matchit-%* matchit-\1 matchit.txt /*matchit-\\1* @@ -768,39 +92,10 @@ matchit-v_% matchit.txt /*matchit-v_%* matchit.txt matchit.txt /*matchit.txt* matchit.vim matchit.txt /*matchit.vim* -math, latexhelp.txt /*math,* -math-misc latexhelp.txt /*math-misc* -math-mode latexhelp.txt /*math-mode* -math-spacing latexhelp.txt /*math-spacing* -math-symbols latexhelp.txt /*math-symbols* -math: latexhelp.txt /*math:* -math; latexhelp.txt /*math;* -matn! latexhelp.txt /*matn!* -minipage latexhelp.txt /*minipage* -normal-mode-environment-mappings latex-suite.txt /*normal-mode-environment-mappings* -notitlepage latexhelp.txt /*notitlepage* o_[% matchit.txt /*o_[%* o_]% matchit.txt /*o_]%* o_g% matchit.txt /*o_g%* -onecolumn latexhelp.txt /*onecolumn* -oneside latexhelp.txt /*oneside* -openany latexhelp.txt /*openany* -openbib latexhelp.txt /*openbib* -openright latexhelp.txt /*openright* -otl-plugin otl.txt /*otl-plugin* otl2html vo_readme.txt /*otl2html* -otluser.txt otl.txt /*otluser.txt* -outliner otl.txt /*outliner* -overriding-macros latex-suite.txt /*overriding-macros* -package-actions latex-suite.txt /*package-actions* -paragraph-mode latexhelp.txt /*paragraph-mode* -part-compiling latex-suite.txt /*part-compiling* -picture latexhelp.txt /*picture* -picture-makebox latexhelp.txt /*picture-makebox* -place-holder latex-suite.txt /*place-holder* -place-holders latex-suite.txt /*place-holders* -plain latexhelp.txt /*plain* -pre-lengths latexhelp.txt /*pre-lengths* project project.txt /*project* project-adding-mappings project.txt /*project-adding-mappings* project-example project.txt /*project-example* @@ -813,110 +108,57 @@ project-syntax project.txt /*project-syntax* project-tips project.txt /*project-tips* project.txt project.txt /*project.txt* -quotation latexhelp.txt /*quotation* -quote-l latexhelp.txt /*quote-l* -recommended-settings latex-suite.txt /*recommended-settings* -remapping-latex-suite-keys latex-suite.txt /*remapping-latex-suite-keys* -report-class latexhelp.txt /*report-class* -roman latexhelp.txt /*roman* -rqno latexhelp.txt /*rqno* -section-mappings latex-suite.txt /*section-mappings* -slides-class latexhelp.txt /*slides-class* -smart-backspace latex-suite.txt /*smart-backspace* -smart-keys latex-suite.txt /*smart-keys* -sub-sup latexhelp.txt /*sub-sup* -subscripts latexhelp.txt /*subscripts* -superscripts latexhelp.txt /*superscripts* -supporting-packages latex-suite.txt /*supporting-packages* -tab' latexhelp.txt /*tab'* -tab+ latexhelp.txt /*tab+* -tab- latexhelp.txt /*tab-* -tab< latexhelp.txt /*tab<* -tab= latexhelp.txt /*tab=* -tab> latexhelp.txt /*tab>* -tab` latexhelp.txt /*tab`* -taba latexhelp.txt /*taba* -tabbing latexhelp.txt /*tabbing* -tabular latexhelp.txt /*tabular* -theorem latexhelp.txt /*theorem* -titlepage latexhelp.txt /*titlepage* -tvo otl.txt /*tvo* -tvo-- otl.txt /*tvo--* -tvo-<C-CR> otl.txt /*tvo-<C-CR>* -tvo-<C-RightMouse> otl.txt /*tvo-<C-RightMouse>* -tvo-<C-T> otl.txt /*tvo-<C-T>* -tvo-<C-]> otl.txt /*tvo-<C-]>* -tvo-<LocalLeader>1 otl.txt /*tvo-<LocalLeader>1* -tvo-<LocalLeader>2 otl.txt /*tvo-<LocalLeader>2* -tvo-<LocalLeader>3 otl.txt /*tvo-<LocalLeader>3* -tvo-<LocalLeader>4 otl.txt /*tvo-<LocalLeader>4* -tvo-<LocalLeader>5 otl.txt /*tvo-<LocalLeader>5* -tvo-<LocalLeader>6 otl.txt /*tvo-<LocalLeader>6* -tvo-<LocalLeader>7 otl.txt /*tvo-<LocalLeader>7* -tvo-<LocalLeader>8 otl.txt /*tvo-<LocalLeader>8* -tvo-<LocalLeader>9 otl.txt /*tvo-<LocalLeader>9* -tvo-<LocalLeader>< otl.txt /*tvo-<LocalLeader><* -tvo-<LocalLeader>> otl.txt /*tvo-<LocalLeader>>* -tvo-<LocalLeader>C otl.txt /*tvo-<LocalLeader>C* -tvo-<LocalLeader>D otl.txt /*tvo-<LocalLeader>D* -tvo-<LocalLeader>F otl.txt /*tvo-<LocalLeader>F* -tvo-<LocalLeader>H otl.txt /*tvo-<LocalLeader>H* -tvo-<LocalLeader>O otl.txt /*tvo-<LocalLeader>O* -tvo-<LocalLeader>P otl.txt /*tvo-<LocalLeader>P* -tvo-<LocalLeader>T otl.txt /*tvo-<LocalLeader>T* -tvo-<LocalLeader>[ otl.txt /*tvo-<LocalLeader>[* -tvo-<LocalLeader>] otl.txt /*tvo-<LocalLeader>]* -tvo-<LocalLeader>a otl.txt /*tvo-<LocalLeader>a* -tvo-<LocalLeader>b otl.txt /*tvo-<LocalLeader>b* -tvo-<LocalLeader>d otl.txt /*tvo-<LocalLeader>d* -tvo-<LocalLeader>f otl.txt /*tvo-<LocalLeader>f* -tvo-<LocalLeader>h otl.txt /*tvo-<LocalLeader>h* -tvo-<LocalLeader>j otl.txt /*tvo-<LocalLeader>j* -tvo-<LocalLeader>k otl.txt /*tvo-<LocalLeader>k* -tvo-<LocalLeader>o otl.txt /*tvo-<LocalLeader>o* -tvo-<LocalLeader>p otl.txt /*tvo-<LocalLeader>p* -tvo-<LocalLeader>t otl.txt /*tvo-<LocalLeader>t* -tvo-<LocalLeader>u otl.txt /*tvo-<LocalLeader>u* -tvo-<LocalLeader>w otl.txt /*tvo-<LocalLeader>w* -tvo-<LocalLeader>y otl.txt /*tvo-<LocalLeader>y* -tvo-<M-Down> otl.txt /*tvo-<M-Down>* -tvo-<M-S-Down> otl.txt /*tvo-<M-S-Down>* -tvo-<M-S-Left> otl.txt /*tvo-<M-S-Left>* -tvo-<M-S-Right> otl.txt /*tvo-<M-S-Right>* -tvo-<M-S-Up> otl.txt /*tvo-<M-S-Up>* -tvo-<M-S-kMinus> otl.txt /*tvo-<M-S-kMinus>* -tvo-<M-S-kPlus> otl.txt /*tvo-<M-S-kPlus>* -tvo-<M-Up> otl.txt /*tvo-<M-Up>* -tvo-<Shift-Tab> otl.txt /*tvo-<Shift-Tab>* -tvo-<Tab> otl.txt /*tvo-<Tab>* -tvo-= otl.txt /*tvo-=* -tvo-J otl.txt /*tvo-J* -tvo-O otl.txt /*tvo-O* -tvo-commands otl.txt /*tvo-commands* -tvo-folding otl.txt /*tvo-folding* -tvo-g<C-]> otl.txt /*tvo-g<C-]>* -tvo-g<LeftMouse> otl.txt /*tvo-g<LeftMouse>* -tvo-g<RightMouse> otl.txt /*tvo-g<RightMouse>* -tvo-intro otl.txt /*tvo-intro* -tvo-macros otl.txt /*tvo-macros* -tvo-mappings otl.txt /*tvo-mappings* -tvo-mouse otl.txt /*tvo-mouse* -tvo-o otl.txt /*tvo-o* -tvo-outlines otl.txt /*tvo-outlines* -tvo-settings otl.txt /*tvo-settings* -tvo-toolbar otl.txt /*tvo-toolbar* -tvo-word-compatibility otl.txt /*tvo-word-compatibility* -twocolumn latexhelp.txt /*twocolumn* -twoside latexhelp.txt /*twoside* +ps_color.txt ps_color.txt /*ps_color.txt* +ps_colour ps_color.txt /*ps_colour* +psc ps_color.txt /*psc* +psc-about-background ps_color.txt /*psc-about-background* +psc-change-background ps_color.txt /*psc-change-background* +psc-contents ps_color.txt /*psc-contents* +psc-cterm ps_color.txt /*psc-cterm* +psc-cterm-color-table ps_color.txt /*psc-cterm-color-table* +psc-cterm-incompatible ps_color.txt /*psc-cterm-incompatible* +psc-cterm-nt ps_color.txt /*psc-cterm-nt* +psc-cterm-others ps_color.txt /*psc-cterm-others* +psc-cterm-xterm ps_color.txt /*psc-cterm-xterm* +psc-faq ps_color.txt /*psc-faq* +psc-faq-ffothers ps_color.txt /*psc-faq-ffothers* +psc-features ps_color.txt /*psc-features* +psc-options ps_color.txt /*psc-options* +psc-overview ps_color.txt /*psc-overview* +psc-release-notes ps_color.txt /*psc-release-notes* +psc-tips ps_color.txt /*psc-tips* +psc-todo ps_color.txt /*psc-todo* +psc-usage ps_color.txt /*psc-usage* +psc_cterm_style ps_color.txt /*psc_cterm_style* +psc_cterm_transparent ps_color.txt /*psc_cterm_transparent* +psc_fontface ps_color.txt /*psc_fontface* +psc_inversed_todo ps_color.txt /*psc_inversed_todo* +psc_statement_different_from_type ps_color.txt /*psc_statement_different_from_type* +psc_style ps_color.txt /*psc_style* +psc_use_default_for_cterm ps_color.txt /*psc_use_default_for_cterm* +pscolor ps_color.txt /*pscolor* +taglist-commands taglist.txt /*taglist-commands* +taglist-debug taglist.txt /*taglist-debug* +taglist-extend taglist.txt /*taglist-extend* +taglist-faq taglist.txt /*taglist-faq* +taglist-functions taglist.txt /*taglist-functions* +taglist-install taglist.txt /*taglist-install* +taglist-internet taglist.txt /*taglist-internet* +taglist-intro taglist.txt /*taglist-intro* +taglist-keys taglist.txt /*taglist-keys* +taglist-license taglist.txt /*taglist-license* +taglist-menu taglist.txt /*taglist-menu* +taglist-options taglist.txt /*taglist-options* +taglist-requirements taglist.txt /*taglist-requirements* +taglist-session taglist.txt /*taglist-session* +taglist-todo taglist.txt /*taglist-todo* +taglist-using taglist.txt /*taglist-using* +taglist.txt taglist.txt /*taglist.txt* v_[% matchit.txt /*v_[%* v_]% matchit.txt /*v_]%* v_a% matchit.txt /*v_a%* v_g% matchit.txt /*v_g%* -verbatim latexhelp.txt /*verbatim* -verse latexhelp.txt /*verse* -viewer-customization latex-suite.txt /*viewer-customization* vimoutliner vo_readme.txt /*vimoutliner* -visual-mode-environment-mapings latex-suite.txt /*visual-mode-environment-mapings* vo vo_readme.txt /*vo* vo-activities vo_readme.txt /*vo-activities* vo-advanced vo_readme.txt /*vo-advanced* @@ -946,4 +188,3 @@ vo-updating vo_readme.txt /*vo-updating* vo-version vo_readme.txt /*vo-version* vo_readme.txt vo_readme.txt /*vo_readme.txt* -why-IMAP latex-suite.txt /*why-IMAP* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:19:20
|
Revision: 841 http://assorted.svn.sourceforge.net/assorted/?rev=841&view=rev Author: yangzhang Date: 2008-06-01 17:19:27 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added some problem retries Added Paths: ----------- problems/topcoder/BinaryCode/BinaryCode2.cc problems/topcoder/Bonuses/Bonuses2.cc Added: problems/topcoder/BinaryCode/BinaryCode2.cc =================================================================== --- problems/topcoder/BinaryCode/BinaryCode2.cc (rev 0) +++ problems/topcoder/BinaryCode/BinaryCode2.cc 2008-06-02 00:19:27 UTC (rev 841) @@ -0,0 +1,340 @@ +// vim:et:sw=2:ts=2 + +// TODO +// - strip out all comments +// - trim the unused includes/macros/typedefs/code + +// $BEGINREUSE$ +#include <algorithm> +#include <cassert> +#include <cctype> +#include <cmath> +#include <cstdio> +#include <cstdlib> +#include <deque> +#include <functional> +#include <iostream> +#include <map> +#include <queue> +#include <set> +#include <sstream> +#include <stack> +#include <string> +#include <vector> +using namespace std; + +#define dd(x) cout << #x << " = " << x << endl +#define len length() +#define sz size() +#define pb(x) push_back((x)); +#define all(A) (A).begin(), (A).end() +#define rall(A) (A).rbegin(), (A).rend() +#define each(it,xs) for (typeof(xs.begin()) it = xs.begin(); it != xs.end(); it++) +#define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) +#define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) +#define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } +#define trace(x) { cout << __FILE__ << ":" << __LINE__ << ": "; pp(x); x; } +#define ping cout << "ping" << endl; +#define pong cout << "pong" << endl; + +// CHOOSE +//int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; +//int dx[] = {1,1,1,0,0,-1,-1,-1}, dy[] = {1,0,-1,1,-1,1,0,-1}; + +typedef vector<int> vi; +typedef vector<string> vs; +typedef vector<bool> vb; +typedef vector<vi> vvi; +typedef vector<vs> vvs; +typedef vector<vb> vvb; +typedef long long ll; +#define vec(x) vector< x > +typedef string str; + +template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } +template<typename T> inline void rev(T xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T xs, U x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T x) { stringstream s; s << x; return s.str(); } +inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } +inline int powl(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void print(const T & x) { cout << x << endl; } +#define pp(x) cout << #x << ' ' << x << endl; + +inline ll gcd(ll a, ll b) { + if (a < 0 && b < 0) return gcd(-a,-b); + if (a == 0) return b; + if (b == 0) return a; + if (a > b) return gcd(b, a); + if (!(b % a)) return a; + return gcd(a, b % a); +} + +// TODO merge the following two pieces of code together + +template <typename T> +inline ostream& operator << (ostream& os, const set<T> & xs) { + bounds(i,xs) os << i ? ", " : "{ " << xs[i]; + return os << " }"; +} + +template <typename T> +inline ostream& operator << (ostream& os, const vector<T> & xs) { + bounds(i,xs) os << i ? ", " : "{ " << xs[i]; + return os << " }"; +} + +template<class S,class T> +inline ostream & operator << (ostream & os, const pair<S,T> & a) { + os << "(" << a.first << ", " << a.second << ")"; + return os; +} + +vs split( const string & s, const string & delim = " " ) { + vs res; + string t; + each(c,s) { + if ( delim.find( *c ) != string::npos ) { + if ( !t.empty() ) { + res.pb( t ); + t = ""; + } + } else { + t += *c; + } + } + if ( ! t.empty() ) { + res.push_back(t); + } + return res; +} + +vi ints( const str & s, const str & delim = " " ) { + vs ss = split( s, delim ); + vi is; + each(s,ss) is.push_back( atoi( s->c_str() ) ); + return is; +} + +string vi2str( const vi xs ) { + string s(xs.sz, '\0'); + bounds(i,xs) s[i] = xs[i] + '0'; + return s; +} + +// following is needed for 'main' +#define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) +// $ENDREUSE$ + + + + + + + +// BEGIN CUT HERE +template<typename T> void print( T a ) { + cerr << a; +} +void print( long long a ) { + cerr << a << "L"; +} +void print( string a ) { + cerr << '"' << a << '"'; +} +template<typename T> void print( vector<T> a ) { + cerr << "{"; + bounds(i,a) { + if ( i != 0 ) cerr << ", "; + print( a[i] ); + } + cerr << "}" << endl; +} +template<typename T> void eq( int n, T have, T need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +template<typename T> void eq( int n, vector<T> have, vector<T> need ) { + if( have.size() != need.size() ) { + cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + for( size_t i= 0; i < have.size(); i++ ) { + if( have[i] != need[i] ) { + cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + } + cerr << "Case " << n << " passed." << endl; +} +void eq( int n, string have, string need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +// END CUT HERE + + + + + + + + + + + + + +// asdf +class BinaryCode { + public: + vector <string> decode(string message) { +#if 0 + vector <string> res(2); + string & msg = message; + for (int init = 0; init <= 1; init++) { + bool bad = false; + vi xs(msg.sz); + xs[0] = init; + if (msg.sz > 1) { + int x = msg[0] - '0'; + xs[1] = x - xs[0]; + + for (int i = 2; i < xs.sz; i++) { + int x = msg[i-1] - '0'; + xs[i] = x - xs[i-1] - xs[i-2]; + pp(i); + pp(x); + pp(xs[i]); + pp(xs[i-1]); + pp(xs[i-2]); + if (xs[i] != 0 && xs[i] != 1) event(bad = true); + cout << endl; + } + if (msg[msg.sz - 1] - '0' != xs[xs.sz - 1] + xs[xs.sz - 2]) { + event(bad = true); + } + } else { + if (msg[0] - '0' != xs[0]) event(bad = true); + } + + ping; + res[init] = bad ? string("NONE") : vi2str(xs); + pong; + } + return res; +#endif +#if 0 + vector <string> res(2); + string& msg = message; + for (int init = 0; init < 2; init++) { + vi xs(msg.sz); + bool bad = false; + int ln = msg.sz; + xs[0] = init; + for (int i = 1; i < msg.sz; i++) { + int m = msg[i-1] - '0'; + int x = xs[i] = m - xs[i-1] - (i-2>=0 ? xs[i-2] : 0); + if (x != 0 && x != 1) bad = true; + } + if (msg[ln - 1] - '0' != xs[ln-1] + (ln > 1 ? xs[ln-2] : 0)) + bad = true; + res[init] = bad ? string("NONE") : vi2str(xs); + } + return res; +#endif + vector<string> res(2); + string & msg = message; + for (int init = 0; init < 2; init++) { + int ln = msg.sz; + vi xs(ln); + xs[0] = init; + bool bad = false; + for (int i = 1; i < ln; i++) { + int m = msg[i-1] - '0'; + xs[i] = m - xs[i-1] - (i-2>=0 ? xs[i-2] : 0); + if (xs[i] != 0 && xs[i] != 1) bad = true; + } + if (msg[ln-1] - '0' != xs[ln-1] + xs[ln-2]) + bad = true; + res[init] = bad ? string("NONE") : vi2str(xs); + } + return res; + } +}; + + + + + + + +// BEGIN CUT HERE +int main() { + { + string retrunValueARRAY[] = { "011100011", "NONE" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(0, theObject.decode("123210122"),retrunValue); + } + { + string retrunValueARRAY[] = { "01", "10" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(1, theObject.decode("11"),retrunValue); + } + { + string retrunValueARRAY[] = { "NONE", "11001" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(2, theObject.decode("22111"),retrunValue); + } + { + string retrunValueARRAY[] = { "NONE", "NONE" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(3, theObject.decode("123210120"),retrunValue); + } + { + string retrunValueARRAY[] = { "NONE", "NONE" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(4, theObject.decode("3"),retrunValue); + } + { + string retrunValueARRAY[] = { "01101001101101001101001001001101001", "10110010110110010110010010010110010" }; + vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + BinaryCode theObject; + eq(5, theObject.decode("12221112222221112221111111112221111"),retrunValue); + } +#ifdef WIN32 + cin.get(); +#endif + return 0; +} +// END CUT HERE Added: problems/topcoder/Bonuses/Bonuses2.cc =================================================================== --- problems/topcoder/Bonuses/Bonuses2.cc (rev 0) +++ problems/topcoder/Bonuses/Bonuses2.cc 2008-06-02 00:19:27 UTC (rev 841) @@ -0,0 +1,325 @@ +// vim:et:sw=2:ts=2 + +// TODO +// - strip out all comments +// - trim the unused includes/macros/typedefs/code + +// $BEGINREUSE$ +#include <algorithm> +#include <cassert> +#include <cctype> +#include <cmath> +#include <cstdio> +#include <cstdlib> +#include <deque> +#include <functional> +#include <iostream> +#include <map> +#include <queue> +#include <set> +#include <sstream> +#include <stack> +#include <string> +#include <utility> +#include <vector> +using namespace std; + +#define dd(x) cout << #x << " = " << x << endl +#define len length() +#define sz size() +#define pb(x) push_back((x)); +#define all(A) (A).begin(), (A).end() +#define rall(A) (A).rbegin(), (A).rend() +#define each(it,xs) for (typeof(xs.begin()) it = xs.begin(); it != xs.end(); it++) +#define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) +#define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) +#define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } +#define trace(x) { \ + typeof(x) __x = x; \ + cout << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << __x << endl; \ + __x; \ +} +#define ping cout << "ping" << endl; +#define pong cout << "pong" << endl; + +// CHOOSE +//int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; +//int dx[] = {1,1,1,0,0,-1,-1,-1}, dy[] = {1,0,-1,1,-1,1,0,-1}; + +typedef vector<int> vi; +typedef vector<string> vs; +typedef vector<bool> vb; +typedef vector<vi> vvi; +typedef vector<vs> vvs; +typedef vector<vb> vvb; +typedef long long ll; +#define vec(x...) vector< x > +typedef string str; + +template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } +template<typename T> inline void rev(T & xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T & xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T & xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T & xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T & xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T & xs, U & x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T & xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T & xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T & xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T & xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T & x) { stringstream s; s << x; return s.str(); } +// pow, powl, powf are std +inline double powd(double a, double b) { return std::pow(a, b); } +inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } +inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void pl(const T & x) { cout << x << endl; } +template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } +#define pp(x) cout << #x << " = " << x << endl; + +inline ll gcd(ll a, ll b) { + if (a < 0 && b < 0) return gcd(-a,-b); + if (a == 0) return b; + if (b == 0) return a; + if (a > b) return gcd(b, a); + if (!(b % a)) return a; + return gcd(a, b % a); +} + +// TODO merge the following two pieces of code together + +template <typename T> +inline ostream& operator << (ostream& os, const set<T> & xs) { + os << "{ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " }"; +} + +template <typename T> +inline ostream& operator << (ostream& os, const vector<T> & xs) { + os << "[ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " ]"; +} + +template<class S,class T> +inline ostream & operator << (ostream & os, const pair<S,T> & a) { + os << "(" << a.first << ", " << a.second << ")"; + return os; +} + +vs split( const string & s, const string & delim = " " ) { + vs res; + string t; + each(c,s) { + if ( delim.find( *c ) != string::npos ) { + if ( !t.empty() ) { + res.pb( t ); + t = ""; + } + } else { + t += *c; + } + } + if ( ! t.empty() ) { + res.push_back(t); + } + return res; +} + +vs splitstr( const str & s, const str & glue = " " ) { + vs res; + str::size_type i = 0; + str::size_type ln = glue.sz; + while (true) { + str::size_type pos = s.find(glue, i); + res.push_back(string(s, i, pos)); + if (pos == str::npos) break; + i = pos + ln; + } + return res; +} + +vi ints( const str & s, const str & delim = " " ) { + vs ss = split( s, delim ); + vi is; + each(s,ss) is.push_back( atoi( s->c_str() ) ); + return is; +} + +string vi2str( const vi xs ) { + string s(xs.sz, '\0'); + bounds(i,xs) s[i] = xs[i] + '0'; + return s; +} + +template<typename T, typename U> inline U realfact(T x) { + ll f = 1; + range(i,1,x+1) f *= i; + return f; +} + +template<typename T> inline ll factl(T x) { return realfact<T,ll>(x); } +template<typename T> inline int facti(T x) { return realfact<T,int>(x); } + +ll perms(ll n, ll r) { + assert(n >= r); + ll p = 1; + for (ll i = n; i > n-r; i--) p *= i; + return p; +} + +ll combs(ll n, ll k) { + return perms(n,k) / factl(k); +} + +// following is needed for 'main' +#define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) +// $ENDREUSE$ + + + + + + + +// BEGIN CUT HERE +template<typename T> void print( T a ) { + cerr << a; +} +void print( long long a ) { + cerr << a << "L"; +} +void print( string a ) { + cerr << '"' << a << '"'; +} +template<typename T> void print( vector<T> a ) { + cerr << "{"; + bounds(i,a) { + if ( i != 0 ) cerr << ", "; + print( a[i] ); + } + cerr << "}" << endl; +} +template<typename T> void eq( int n, T have, T need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +template<typename T> void eq( int n, vector<T> have, vector<T> need ) { + if( have.size() != need.size() ) { + cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + for( size_t i= 0; i < have.size(); i++ ) { + if( have[i] != need[i] ) { + cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + } + cerr << "Case " << n << " passed." << endl; +} +void eq( int n, string have, string need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +// END CUT HERE + + + + + + + + + + + + + +// asdf +class Bonuses { + public: + vector <int> getDivision(vector <int> points) { +#if 0 + vector <int> res(points.size()); + int sum = 0; + int n = points.size(); + int rem = 100; + for (int i = 0; i < n; i++) sum += points[i]; + vector< pair<int,int> > a(n); + vector<int> p(n); + for (int i = 0; i < n; i++) { + a[i] = make_pair( -points[i], i ); + p[i] = 100 * points[i] / sum; + rem -= p[i]; + } + std::sort(a.begin(), a.end()); + //pp(a); + for (int i = 0; i < n; i++) { + if (rem == 0) break; + p[a[i].second]++; + rem--; + } + for (int i = 0; i < n; i++) + res[i] = p[i]; + return res; +#endif + } +}; + + + + + + + +// BEGIN CUT HERE +int main() { + { + int pointsARRAY[] = {1,2,3,4,5}; + vector <int> points( pointsARRAY, pointsARRAY+ARRSIZE(pointsARRAY) ); + int retrunValueARRAY[] = { 6, 13, 20, 27, 34 }; + vector <int> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + Bonuses theObject; + eq(0, theObject.getDivision(points),retrunValue); + } + { + int pointsARRAY[] = {5,5,5,5,5,5}; + vector <int> points( pointsARRAY, pointsARRAY+ARRSIZE(pointsARRAY) ); + int retrunValueARRAY[] = { 17, 17, 17, 17, 16, 16 }; + vector <int> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + Bonuses theObject; + eq(1, theObject.getDivision(points),retrunValue); + } + { + int pointsARRAY[] = {485, 324, 263, 143, 470, 292, 304, 188, 100, 254, 296, + 255, 360, 231, 311, 275, 93, 463, 115, 366, 197, 470}; + vector <int> points( pointsARRAY, pointsARRAY+ARRSIZE(pointsARRAY) ); + int retrunValueARRAY[] = { 8, 6, 4, 2, 8, 5, 5, 3, 1, 4, 5, 4, 6, 3, 5, 4, 1, 8, 1, 6, 3, 8 }; + vector <int> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); + Bonuses theObject; + eq(2, theObject.getDivision(points),retrunValue); + } +#ifdef WIN32 + cin.get(); +#endif + return 0; +} +// END CUT HERE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:18:54
|
Revision: 840 http://assorted.svn.sourceforge.net/assorted/?rev=840&view=rev Author: yangzhang Date: 2008-06-01 17:18:59 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added some new problems Added Paths: ----------- problems/topcoder/ImageDithering/ problems/topcoder/ImageDithering/ImageDithering.cc problems/topcoder/RectangularGrid/ problems/topcoder/RectangularGrid/RectangularGrid.cc problems/topcoder/Time/ problems/topcoder/Time/Time.cc Added: problems/topcoder/ImageDithering/ImageDithering.cc =================================================================== --- problems/topcoder/ImageDithering/ImageDithering.cc (rev 0) +++ problems/topcoder/ImageDithering/ImageDithering.cc 2008-06-02 00:18:59 UTC (rev 840) @@ -0,0 +1,332 @@ +// vim:et:sw=2:ts=2 + +// TODO +// - strip out all comments +// - trim the unused includes/macros/typedefs/code + +// $BEGINREUSE$ +#include <algorithm> +#include <cassert> +#include <cctype> +#include <cmath> +#include <cstdio> +#include <cstdlib> +#include <deque> +#include <functional> +#include <iostream> +#include <map> +#include <queue> +#include <set> +#include <sstream> +#include <stack> +#include <string> +#include <utility> +#include <vector> +using namespace std; + +#define dd(x) cout << #x << " = " << x << endl +#define len length() +#define sz size() +#define pb(x) push_back((x)); +#define all(A) (A).begin(), (A).end() +#define rall(A) (A).rbegin(), (A).rend() +#define each(it,xs) for (typeof(xs.begin()) it = xs.begin(); it != xs.end(); it++) +#define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) +#define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) +#define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } +#define trace(x) { \ + typeof(x) __x = x; \ + cout << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << __x << endl; \ + __x; \ +} +#define ping cout << "ping" << endl; +#define pong cout << "pong" << endl; + +// CHOOSE +//int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; +//int dx[] = {1,1,1,0,0,-1,-1,-1}, dy[] = {1,0,-1,1,-1,1,0,-1}; + +typedef vector<int> vi; +typedef vector<string> vs; +typedef vector<bool> vb; +typedef vector<vi> vvi; +typedef vector<vs> vvs; +typedef vector<vb> vvb; +typedef long long ll; +#define vec(x...) vector< x > +typedef string str; + +template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } +template<typename T> inline void rev(T & xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T & xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T & xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T & xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T & xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T & xs, U & x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T & xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T & xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T & xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T & xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T & x) { stringstream s; s << x; return s.str(); } +// pow, powl, powf are std +inline double powd(double a, double b) { return std::pow(a, b); } +inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } +inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void pl(const T & x) { cout << x << endl; } +template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } +#define pp(x) cout << #x << " = " << x << endl; + +inline ll gcd(ll a, ll b) { + if (a < 0 && b < 0) return gcd(-a,-b); + if (a == 0) return b; + if (b == 0) return a; + if (a > b) return gcd(b, a); + if (!(b % a)) return a; + return gcd(a, b % a); +} + +// TODO merge the following two pieces of code together + +template <typename T> +inline ostream& operator << (ostream& os, const set<T> & xs) { + os << "{ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " }"; +} + +template <typename T> +inline ostream& operator << (ostream& os, const vector<T> & xs) { + os << "[ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " ]"; +} + +template<class S,class T> +inline ostream & operator << (ostream & os, const pair<S,T> & a) { + os << "(" << a.first << ", " << a.second << ")"; + return os; +} + +vs split( const string & s, const string & delim = " " ) { + vs res; + string t; + each(c,s) { + if ( delim.find( *c ) != string::npos ) { + if ( !t.empty() ) { + res.pb( t ); + t = ""; + } + } else { + t += *c; + } + } + if ( ! t.empty() ) { + res.push_back(t); + } + return res; +} + +vs splitstr( const str & s, const str & glue = " " ) { + vs res; + str::size_type i = 0; + str::size_type ln = glue.sz; + while (true) { + str::size_type pos = s.find(glue, i); + res.push_back(string(s, i, pos)); + if (pos == str::npos) break; + i = pos + ln; + } + return res; +} + +vi ints( const str & s, const str & delim = " " ) { + vs ss = split( s, delim ); + vi is; + each(s,ss) is.push_back( atoi( s->c_str() ) ); + return is; +} + +string vi2str( const vi xs ) { + string s(xs.sz, '\0'); + bounds(i,xs) s[i] = xs[i] + '0'; + return s; +} + +template<typename T, typename U> inline U realfact(T x) { + ll f = 1; + range(i,1,x+1) f *= i; + return f; +} + +template<typename T> inline ll factl(T x) { return realfact<T,ll>(x); } +template<typename T> inline int facti(T x) { return realfact<T,int>(x); } + +ll perms(ll n, ll r) { + assert(n >= r); + ll p = 1; + for (ll i = n; i > n-r; i--) p *= i; + return p; +} + +ll combs(ll n, ll k) { + return perms(n,k) / factl(k); +} + +// following is needed for 'main' +#define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) +// $ENDREUSE$ + + + + + + + +// BEGIN CUT HERE +template<typename T> void print( T a ) { + cerr << a; +} +void print( long long a ) { + cerr << a << "L"; +} +void print( string a ) { + cerr << '"' << a << '"'; +} +template<typename T> void print( vector<T> a ) { + cerr << "{"; + bounds(i,a) { + if ( i != 0 ) cerr << ", "; + print( a[i] ); + } + cerr << "}" << endl; +} +template<typename T> void eq( int n, T have, T need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +template<typename T> void eq( int n, vector<T> have, vector<T> need ) { + if( have.size() != need.size() ) { + cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + for( size_t i= 0; i < have.size(); i++ ) { + if( have[i] != need[i] ) { + cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + } + cerr << "Case " << n << " passed." << endl; +} +void eq( int n, string have, string need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +// END CUT HERE + + + + + + + + + + + + + +// asdf +class ImageDithering { + public: + int count(string dithered, vector <string> screen) { + int res=0; + bounds(i,screen) { + bounds(j,screen[i]) { + if (dithered.find(screen[i][j]) != str::npos) { + res++; + } + } + } + return res; + } +}; + + + + + + + +// BEGIN CUT HERE +int main() { + { + string screenARRAY[] = {"AAAAAAAA", + "ABWBWBWA", + "AWBWBWBA", + "ABWBWBWA", + "AWBWBWBA", + "AAAAAAAA"}; + vector <string> screen( screenARRAY, screenARRAY+ARRSIZE(screenARRAY) ); + ImageDithering theObject; + eq(0, theObject.count("BW", screen),24); + } + { + string screenARRAY[] = {"BBBBBBBB", + "BBWBWBWB", + "BWBWBWBB", + "BBWBWBWB", + "BWBWBWBB", + "BBBBBBBB"}; + vector <string> screen( screenARRAY, screenARRAY+ARRSIZE(screenARRAY) ); + ImageDithering theObject; + eq(1, theObject.count("BW", screen),48); + } + { + string screenARRAY[] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX", + "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"}; + vector <string> screen( screenARRAY, screenARRAY+ARRSIZE(screenARRAY) ); + ImageDithering theObject; + eq(2, theObject.count("ACEGIKMOQSUWY", screen),150); + } + { + string screenARRAY[] = {"BBBBBBB", + "BBBBBBB", + "BBBBBBB"}; + vector <string> screen( screenARRAY, screenARRAY+ARRSIZE(screenARRAY) ); + ImageDithering theObject; + eq(3, theObject.count("CA", screen),0); + } + { + string screenARRAY[] = {"ACBD"}; + vector <string> screen( screenARRAY, screenARRAY+ARRSIZE(screenARRAY) ); + ImageDithering theObject; + eq(4, theObject.count("DCBA", screen),4); + } +#ifdef WIN32 + cin.get(); +#endif + return 0; +} +// END CUT HERE Added: problems/topcoder/RectangularGrid/RectangularGrid.cc =================================================================== --- problems/topcoder/RectangularGrid/RectangularGrid.cc (rev 0) +++ problems/topcoder/RectangularGrid/RectangularGrid.cc 2008-06-02 00:18:59 UTC (rev 840) @@ -0,0 +1,309 @@ +// vim:et:sw=2:ts=2 + +// TODO +// - strip out all comments +// - trim the unused includes/macros/typedefs/code + +// $BEGINREUSE$ +#include <algorithm> +#include <cassert> +#include <cctype> +#include <cmath> +#include <cstdio> +#include <cstdlib> +#include <deque> +#include <functional> +#include <iostream> +#include <map> +#include <queue> +#include <set> +#include <sstream> +#include <stack> +#include <string> +#include <utility> +#include <vector> +using namespace std; + +#define dd(x) cout << #x << " = " << x << endl +#define len length() +#define sz size() +#define pb(x) push_back((x)); +#define all(A) (A).begin(), (A).end() +#define rall(A) (A).rbegin(), (A).rend() +#define each(it,xs) for (typeof(xs.begin()) it = xs.begin(); it != xs.end(); it++) +#define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) +#define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) +#define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } +#define trace(x) { \ + typeof(x) __x = x; \ + cout << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << __x << endl; \ + __x; \ +} +#define ping cout << "ping" << endl; +#define pong cout << "pong" << endl; + +// CHOOSE +//int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; +//int dx[] = {1,1,1,0,0,-1,-1,-1}, dy[] = {1,0,-1,1,-1,1,0,-1}; + +typedef vector<int> vi; +typedef vector<string> vs; +typedef vector<bool> vb; +typedef vector<vi> vvi; +typedef vector<vs> vvs; +typedef vector<vb> vvb; +typedef long long ll; +#define vec(x...) vector< x > +typedef string str; + +template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } +template<typename T> inline void rev(T & xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T & xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T & xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T & xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T & xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T & xs, U & x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T & xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T & xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T & xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T & xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T & x) { stringstream s; s << x; return s.str(); } +// pow, powl, powf are std +inline double powd(double a, double b) { return std::pow(a, b); } +inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } +inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void pl(const T & x) { cout << x << endl; } +template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } +#define pp(x) cout << #x << " = " << (x) << endl; + +inline ll gcd(ll a, ll b) { + if (a < 0 && b < 0) return gcd(-a,-b); + if (a == 0) return b; + if (b == 0) return a; + if (a > b) return gcd(b, a); + if (!(b % a)) return a; + return gcd(a, b % a); +} + +// TODO merge the following two pieces of code together + +template <typename T> +inline ostream& operator << (ostream& os, const set<T> & xs) { + os << "{ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " }"; +} + +template <typename T> +inline ostream& operator << (ostream& os, const vector<T> & xs) { + os << "[ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " ]"; +} + +template<class S,class T> +inline ostream & operator << (ostream & os, const pair<S,T> & a) { + os << "(" << a.first << ", " << a.second << ")"; + return os; +} + +vs split( const string & s, const string & delim = " " ) { + vs res; + string t; + each(c,s) { + if ( delim.find( *c ) != string::npos ) { + if ( !t.empty() ) { + res.pb( t ); + t = ""; + } + } else { + t += *c; + } + } + if ( ! t.empty() ) { + res.push_back(t); + } + return res; +} + +vs splitstr( const str & s, const str & glue = " " ) { + vs res; + str::size_type i = 0; + str::size_type ln = glue.sz; + while (true) { + str::size_type pos = s.find(glue, i); + res.push_back(string(s, i, pos)); + if (pos == str::npos) break; + i = pos + ln; + } + return res; +} + +vi ints( const str & s, const str & delim = " " ) { + vs ss = split( s, delim ); + vi is; + each(s,ss) is.push_back( atoi( s->c_str() ) ); + return is; +} + +string vi2str( const vi xs ) { + string s(xs.sz, '\0'); + bounds(i,xs) s[i] = xs[i] + '0'; + return s; +} + +template<typename T, typename U> inline U realfact(T x) { + ll f = 1; + range(i,1,x+1) f *= i; + return f; +} + +template<typename T> inline ll factl(T x) { return realfact<T,ll>(x); } +template<typename T> inline int facti(T x) { return realfact<T,int>(x); } + +ll perms(ll n, ll r) { + assert(n >= r); + ll p = 1; + for (ll i = n; i > n-r; i--) p *= i; + return p; +} + +ll combs(ll n, ll k) { + return perms(n,k) / factl(k); +} + +// following is needed for 'main' +#define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) +// $ENDREUSE$ + + + + + + + +// BEGIN CUT HERE +template<typename T> void print( T a ) { + cerr << a; +} +void print( long long a ) { + cerr << a << "L"; +} +void print( string a ) { + cerr << '"' << a << '"'; +} +template<typename T> void print( vector<T> a ) { + cerr << "{"; + bounds(i,a) { + if ( i != 0 ) cerr << ", "; + print( a[i] ); + } + cerr << "}" << endl; +} +template<typename T> void eq( int n, T have, T need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +template<typename T> void eq( int n, vector<T> have, vector<T> need ) { + if( have.size() != need.size() ) { + cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + for( size_t i= 0; i < have.size(); i++ ) { + if( have[i] != need[i] ) { + cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + } + cerr << "Case " << n << " passed." << endl; +} +void eq( int n, string have, string need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +// END CUT HERE + + + + + + + + + + + + + +// asdf +class RectangularGrid { + public: + long long countRectangles(int width, int height) { + long long res = 0; + pp(width); + range(i,1,width + 1) { + range(j,1,height + 1) { + res += i==j ? 0 : (width - i + 1) * (height - j + 1); // (width - i) * (height - j); + //pp(i); + //pp(j); + //pp(i==j?0:i*j); + //cout<<endl; + } + } + //if (width==5) exit(0); + return res; + } +}; + + + + + + + +// BEGIN CUT HERE +int main() { + { + RectangularGrid theObject; + eq<long long>(0, theObject.countRectangles(3, 3),22L); + } + { + RectangularGrid theObject; + eq<long long>(1, theObject.countRectangles(5, 2),31L); + } + { + RectangularGrid theObject; + eq<long long>(2, theObject.countRectangles(10, 10),2640L); + } + { + RectangularGrid theObject; + eq<long long>(3, theObject.countRectangles(1, 1),0L); + } + { + RectangularGrid theObject; + eq<long long>(4, theObject.countRectangles(592, 964),81508708664LL); + } +#ifdef WIN32 + cin.get(); +#endif + return 0; +} +// END CUT HERE Added: problems/topcoder/Time/Time.cc =================================================================== --- problems/topcoder/Time/Time.cc (rev 0) +++ problems/topcoder/Time/Time.cc 2008-06-02 00:18:59 UTC (rev 840) @@ -0,0 +1,299 @@ +// vim:et:sw=2:ts=2 + +// TODO +// - strip out all comments +// - trim the unused includes/macros/typedefs/code + +// $BEGINREUSE$ +#include <algorithm> +#include <cassert> +#include <cctype> +#include <cmath> +#include <cstdio> +#include <cstdlib> +#include <deque> +#include <functional> +#include <iostream> +#include <map> +#include <queue> +#include <set> +#include <sstream> +#include <stack> +#include <string> +#include <utility> +#include <vector> +using namespace std; + +#define dd(x) cout << #x << " = " << x << endl +#define len length() +#define sz size() +#define pb(x) push_back((x)); +#define all(A) (A).begin(), (A).end() +#define rall(A) (A).rbegin(), (A).rend() +#define each(it,xs) for (typeof(xs.begin()) it = xs.begin(); it != xs.end(); it++) +#define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) +#define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) +#define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } +#define trace(x) { \ + typeof(x) __x = x; \ + cout << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << __x << endl; \ + __x; \ +} +#define ping cout << "ping" << endl; +#define pong cout << "pong" << endl; + +// CHOOSE +//int dx[] = {1,0,-1,0}, dy[] = {0,1,0,-1}; +//int dx[] = {1,1,1,0,0,-1,-1,-1}, dy[] = {1,0,-1,1,-1,1,0,-1}; + +typedef vector<int> vi; +typedef vector<string> vs; +typedef vector<bool> vb; +typedef vector<vi> vvi; +typedef vector<vs> vvs; +typedef vector<vb> vvb; +typedef long long ll; +#define vec(x...) vector< x > +typedef string str; + +template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } +template<typename T> inline void rev(T & xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T & xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T & xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T & xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T & xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T & xs, U & x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T & xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T & xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T & xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T & xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T & x) { stringstream s; s << x; return s.str(); } +// pow, powl, powf are std +inline double powd(double a, double b) { return std::pow(a, b); } +inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } +inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void pl(const T & x) { cout << x << endl; } +template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } +#define pp(x) cout << #x << " = " << x << endl; + +inline ll gcd(ll a, ll b) { + if (a < 0 && b < 0) return gcd(-a,-b); + if (a == 0) return b; + if (b == 0) return a; + if (a > b) return gcd(b, a); + if (!(b % a)) return a; + return gcd(a, b % a); +} + +// TODO merge the following two pieces of code together + +template <typename T> +inline ostream& operator << (ostream& os, const set<T> & xs) { + os << "{ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " }"; +} + +template <typename T> +inline ostream& operator << (ostream& os, const vector<T> & xs) { + os << "[ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " ]"; +} + +template<class S,class T> +inline ostream & operator << (ostream & os, const pair<S,T> & a) { + os << "(" << a.first << ", " << a.second << ")"; + return os; +} + +vs split( const string & s, const string & delim = " " ) { + vs res; + string t; + each(c,s) { + if ( delim.find( *c ) != string::npos ) { + if ( !t.empty() ) { + res.pb( t ); + t = ""; + } + } else { + t += *c; + } + } + if ( ! t.empty() ) { + res.push_back(t); + } + return res; +} + +vs splitstr( const str & s, const str & glue = " " ) { + vs res; + str::size_type i = 0; + str::size_type ln = glue.sz; + while (true) { + str::size_type pos = s.find(glue, i); + res.push_back(string(s, i, pos)); + if (pos == str::npos) break; + i = pos + ln; + } + return res; +} + +vi ints( const str & s, const str & delim = " " ) { + vs ss = split( s, delim ); + vi is; + each(s,ss) is.push_back( atoi( s->c_str() ) ); + return is; +} + +string vi2str( const vi xs ) { + string s(xs.sz, '\0'); + bounds(i,xs) s[i] = xs[i] + '0'; + return s; +} + +template<typename T, typename U> inline U realfact(T x) { + ll f = 1; + range(i,1,x+1) f *= i; + return f; +} + +template<typename T> inline ll factl(T x) { return realfact<T,ll>(x); } +template<typename T> inline int facti(T x) { return realfact<T,int>(x); } + +ll perms(ll n, ll r) { + assert(n >= r); + ll p = 1; + for (ll i = n; i > n-r; i--) p *= i; + return p; +} + +ll combs(ll n, ll k) { + return perms(n,k) / factl(k); +} + +// following is needed for 'main' +#define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) +// $ENDREUSE$ + + + + + + + +// BEGIN CUT HERE +template<typename T> void print( T a ) { + cerr << a; +} +void print( long long a ) { + cerr << a << "L"; +} +void print( string a ) { + cerr << '"' << a << '"'; +} +template<typename T> void print( vector<T> a ) { + cerr << "{"; + bounds(i,a) { + if ( i != 0 ) cerr << ", "; + print( a[i] ); + } + cerr << "}" << endl; +} +template<typename T> void eq( int n, T have, T need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +template<typename T> void eq( int n, vector<T> have, vector<T> need ) { + if( have.size() != need.size() ) { + cerr << "Case " << n << " failed: returned " << have.size() << " elements; expected " << need.size() << " elements." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + for( size_t i= 0; i < have.size(); i++ ) { + if( have[i] != need[i] ) { + cerr << "Case " << n << " failed. Expected and returned array differ in position " << i << "." << endl; + cerr << " have: "; print( have ); + cerr << " need: "; print( need ); + return; + } + } + cerr << "Case " << n << " passed." << endl; +} +void eq( int n, string have, string need ) { + if ( have == need ) { + cerr << "Case " << n << " passed." << endl; + } else { + cerr << "Case " << n << " failed: expected "; + print( need ); + cerr << " received "; + print( have ); + cerr << "." << endl; + } +} +// END CUT HERE + + + + + + + + + + + + + +// asdf +class Time { + public: + string whatTime(int seconds) { + int s = seconds % 60; + int minutes = seconds / 60; + int m = minutes % 60; + int h = minutes / 60; + stringstream ss; + ss << h << ":" << m << ":" << s; + return ss.str(); + } +}; + + + + + + + +// BEGIN CUT HERE +int main() { + { + Time theObject; + eq(0, theObject.whatTime(0),"0:0:0"); + } + { + Time theObject; + eq(1, theObject.whatTime(3661),"1:1:1"); + } + { + Time theObject; + eq(2, theObject.whatTime(5436),"1:30:36"); + } + { + Time theObject; + eq(3, theObject.whatTime(86399),"23:59:59"); + } +#ifdef WIN32 + cin.get(); +#endif + return 0; +} +// END CUT HERE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:18:36
|
Revision: 839 http://assorted.svn.sourceforge.net/assorted/?rev=839&view=rev Author: yangzhang Date: 2008-06-01 17:18:43 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added refs Modified Paths: -------------- bib/trunk/yang.bib Modified: bib/trunk/yang.bib =================================================================== --- bib/trunk/yang.bib 2008-06-02 00:18:05 UTC (rev 838) +++ bib/trunk/yang.bib 2008-06-02 00:18:43 UTC (rev 839) @@ -20,4 +20,41 @@ number = "MIT-CSAIL-TR-2008-003", month = "January", year = "2008" -} \ No newline at end of file +} + +@article{aries-tods92, + author = {C. Mohan and + Donald J. Haderle and + Bruce G. Lindsay and + Hamid Pirahesh and + Peter M. Schwarz}, + title = {ARIES: A Transaction Recovery Method Supporting Fine-Granularity + Locking and Partial Rollbacks Using Write-Ahead Logging}, + journal = {ACM Trans. Database Syst.}, + volume = {17}, + number = {1}, + year = {1992}, + pages = {94-162}, + ee = {http://doi.acm.org/10.1145/128765.128770, db/journals/tods/MohanHLPS92.html}, + bibsource = {DBLP, http://dblp.uni-trier.de} +} + +@inproceedings{harbor-vldb06, + author = {Edmond Lau and Samuel Madden}, + title = {An integrated approach to recovery and high availability in an updatable, distributed data warehouse}, + booktitle = {VLDB '06: Proceedings of the 32nd international conference on Very large data bases}, + year = {2006}, + pages = {703--714}, + location = {Seoul, Korea}, + publisher = {VLDB Endowment}, +} + +@inproceedings{harp-sosp91, + author = "Barbara Liskov and Sanjay Ghemawat and Robert Gruber and Paul Johnson and Liuba Shrira and Michael Williams", + title = "Replication in the {Harp} file system", + booktitle = "Proceedings of 13th {ACM} Symposium on Operating Systems Principles", + publisher = "Association for Computing Machinery SIGOPS", + pages = "226--38", + year = "1991", + url = "citeseer.ist.psu.edu/liskov91replication.html" +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:17:59
|
Revision: 838 http://assorted.svn.sourceforge.net/assorted/?rev=838&view=rev Author: yangzhang Date: 2008-06-01 17:18:05 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added GFS Modified Paths: -------------- assorted-site/trunk/index.txt Modified: assorted-site/trunk/index.txt =================================================================== --- assorted-site/trunk/index.txt 2008-06-02 00:17:43 UTC (rev 837) +++ assorted-site/trunk/index.txt 2008-06-02 00:18:05 UTC (rev 838) @@ -56,6 +56,8 @@ ratings on [Rotten Tomatoes](http://rottentomatoes.com/), sort the movies by score, and aggregate the show times for those movies based on the schedule (done) + - Google File Search: a simple web frontend to Google Web Search for finding + files in web directory listings (done) - Configuration resources and desktop tools - [Vim syntax file for JavaFX](http://www.vim.org/scripts/script.php?script_id=1943) (done) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:17:37
|
Revision: 837 http://assorted.svn.sourceforge.net/assorted/?rev=837&view=rev Author: yangzhang Date: 2008-06-01 17:17:43 -0700 (Sun, 01 Jun 2008) Log Message: ----------- renamed thesis Added Paths: ----------- personal-site/trunk/static/icedb-msthesis08.pdf Removed Paths: ------------- personal-site/trunk/static/icedb-thesis.pdf Copied: personal-site/trunk/static/icedb-msthesis08.pdf (from rev 821, personal-site/trunk/static/icedb-thesis.pdf) =================================================================== (Binary files differ) Deleted: personal-site/trunk/static/icedb-thesis.pdf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:17:18
|
Revision: 836 http://assorted.svn.sourceforge.net/assorted/?rev=836&view=rev Author: yangzhang Date: 2008-06-01 17:17:24 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added webdb papers Modified Paths: -------------- personal-site/trunk/src/index.txt Modified: personal-site/trunk/src/index.txt =================================================================== --- personal-site/trunk/src/index.txt 2008-06-02 00:16:49 UTC (rev 835) +++ personal-site/trunk/src/index.txt 2008-06-02 00:17:24 UTC (rev 836) @@ -139,15 +139,17 @@ ------ <!-- TODO: mirror papers. --> -<!-- TODO: sigcomm --> -<!-- TODO: webtables --> +- Michael Cafarella, Alon Halevy, Daisy Wang, Eugene Wu, Yang Zhang. + _WebTables: Exploring the Power of Tables on the Web_. VLDB 2008. <!-- + [PDF](papers/webtables-vldb08.pdf) --> + - Michael Cafarella, Nodira Khoussainova, Daisy Wang, Eugene Wu, Yang Zhang, Alon Halevy. _Uncovering the Relational Web_. WebDB 2008. <!-- - [PDF](papers/webdb08.pdf) --> + [PDF](papers/relweb-webdb08.pdf) --> - Yang Zhang. _ICEDB: Intermittently-Connected Continuous Query Processing_. - MS Thesis, January 2008. [PDF](icedb-thesis.pdf) + MS Thesis, January 2008. [PDF](icedb-msthesis08.pdf) - Yang Zhang, Bret Hull, Hari Balakrishnan, Samuel Madden. _ICEDB: Intermittently-Connected Continuous Query Processing_. ICDE 2007. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:17:03
|
Revision: 835 http://assorted.svn.sourceforge.net/assorted/?rev=835&view=rev Author: yangzhang Date: 2008-06-01 17:16:49 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added a bunch of sandbox stuff Added Paths: ----------- sandbox/trunk/src/c/euclid.c sandbox/trunk/src/c/hello.c sandbox/trunk/src/cc/hello.cc sandbox/trunk/src/cc/privacy.cc sandbox/trunk/src/java/ClassLoadingThread.java Added: sandbox/trunk/src/c/euclid.c =================================================================== --- sandbox/trunk/src/c/euclid.c (rev 0) +++ sandbox/trunk/src/c/euclid.c 2008-06-02 00:16:49 UTC (rev 835) @@ -0,0 +1,3 @@ +#include <stdio.h> +int gcd(int a, int b) { return ( b != 0 ? gcd(b, a % b) : a ); } +int main() { printf("%d %d\n", gcd(6,4), gcd(4,6)); return 0; } Added: sandbox/trunk/src/c/hello.c =================================================================== --- sandbox/trunk/src/c/hello.c (rev 0) +++ sandbox/trunk/src/c/hello.c 2008-06-02 00:16:49 UTC (rev 835) @@ -0,0 +1,8 @@ +#include <stdio.h> + +int +main() +{ + printf("hello, world!\n"); + return 0; +} Added: sandbox/trunk/src/cc/hello.cc =================================================================== --- sandbox/trunk/src/cc/hello.cc (rev 0) +++ sandbox/trunk/src/cc/hello.cc 2008-06-02 00:16:49 UTC (rev 835) @@ -0,0 +1,15 @@ +// A simple hello world application. +// +// Try compiling this on a 64-bit machine for a 32-bit target with `g++ -m32 +// hello.cc`. + +#include <iostream> + +using namespace std; + +int +main() +{ + cout << "hello, world!" << endl; + return 0; +} Added: sandbox/trunk/src/cc/privacy.cc =================================================================== --- sandbox/trunk/src/cc/privacy.cc (rev 0) +++ sandbox/trunk/src/cc/privacy.cc 2008-06-02 00:16:49 UTC (rev 835) @@ -0,0 +1,29 @@ +/** + * Is there any way at all to allow another class (such as testing) to peer + * into the protected state of an instance of c (that isn't `this`)? + * + * Probably not, since that would be asking for nothing short of + */ + +#include <stdlib.h> + +#define check(x) if (!(x)) { exit(1); } + +class c { + public: c() : x(0) {} + protected: int x; +}; + +class tester : public c { + public: + void test(c& c) { + if (c.x != 0) exit(1); + } +}; + +int main() { + c c; + tester t; + t.test(c); + return 0; +} Added: sandbox/trunk/src/java/ClassLoadingThread.java =================================================================== --- sandbox/trunk/src/java/ClassLoadingThread.java (rev 0) +++ sandbox/trunk/src/java/ClassLoadingThread.java 2008-06-02 00:16:49 UTC (rev 835) @@ -0,0 +1,27 @@ +// From http://www.drmaciver.com/2008/04/object-main-extends-application-considered-harmful/: +// +// Because the initialization of the Main$ class depends on the construction of +// the Main object, Main$ will not be fully initialized until the constructor +// has exited. The JVM semantics guarantee that class loading is single +// threaded and that other threads cannot access the class until it has +// finished loading. Hence the observed problem. +// +// However, I (Yang) couldn't repro this! XXX + +public class ClassLoadingThread { + static { + System.out.println("hello"); + final ClassLoadingThread x = new ClassLoadingThread(); + Runnable r = new Runnable() { + public void run() { + synchronized(x) { x.notify(); } + } + }; + new Thread(r).start(); + try { synchronized(x) { x.wait(); } } + catch (Exception ex) { throw new RuntimeException(ex); } + } + public static void main(String[] args) { + System.out.println("world"); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:14:17
|
Revision: 834 http://assorted.svn.sourceforge.net/assorted/?rev=834&view=rev Author: yangzhang Date: 2008-06-01 17:14:26 -0700 (Sun, 01 Jun 2008) Log Message: ----------- added pairs demo Added Paths: ----------- sandbox/trunk/src/cc/pairs.cc Added: sandbox/trunk/src/cc/pairs.cc =================================================================== --- sandbox/trunk/src/cc/pairs.cc (rev 0) +++ sandbox/trunk/src/cc/pairs.cc 2008-06-02 00:14:26 UTC (rev 834) @@ -0,0 +1,21 @@ +#include <algorithm> +#include <iostream> +#include <utility> +#include <vector> + +using namespace std; + +int +main() +{ + vector< pair< int, const char* > > ps(3); + ps[0] = make_pair(3,"third"); + ps[1] = make_pair(2,"second"); + ps[2] = make_pair(1,"first"); + sort(ps.begin(), ps.end()); + for (int i = 0; i < ps.size(); i++) { + cout << ps[i].second << " "; + } + cout << endl; + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:13:56
|
Revision: 833 http://assorted.svn.sourceforge.net/assorted/?rev=833&view=rev Author: yangzhang Date: 2008-06-01 17:14:03 -0700 (Sun, 01 Jun 2008) Log Message: ----------- fixed sigpipe bug in reconf Modified Paths: -------------- shell-tools/trunk/src/bash-commons/bashrc.bash Modified: shell-tools/trunk/src/bash-commons/bashrc.bash =================================================================== --- shell-tools/trunk/src/bash-commons/bashrc.bash 2008-06-02 00:13:50 UTC (rev 832) +++ shell-tools/trunk/src/bash-commons/bashrc.bash 2008-06-02 00:14:03 UTC (rev 833) @@ -539,7 +539,7 @@ function reconf() { svn -q up - if svn status | grep -q '^C' + if svn status | quiet grep '^C' then return 1 fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:13:42
|
Revision: 832 http://assorted.svn.sourceforge.net/assorted/?rev=832&view=rev Author: yangzhang Date: 2008-06-01 17:13:50 -0700 (Sun, 01 Jun 2008) Log Message: ----------- small macro bug Modified Paths: -------------- configs/trunk/src/topcoder/template.cpp Modified: configs/trunk/src/topcoder/template.cpp =================================================================== --- configs/trunk/src/topcoder/template.cpp 2008-06-02 00:13:06 UTC (rev 831) +++ configs/trunk/src/topcoder/template.cpp 2008-06-02 00:13:50 UTC (rev 832) @@ -74,7 +74,7 @@ inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } template<typename T> inline void pl(const T & x) { cout << x << endl; } template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } -#define pp(x) cout << #x << " = " << x << endl; +#define pp(x) cout << #x << " = " << (x) << endl; inline ll gcd(ll a, ll b) { if (a < 0 && b < 0) return gcd(-a,-b); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-06-02 00:13:16
|
Revision: 831 http://assorted.svn.sourceforge.net/assorted/?rev=831&view=rev Author: yangzhang Date: 2008-06-01 17:13:06 -0700 (Sun, 01 Jun 2008) Log Message: ----------- switched license Modified Paths: -------------- mailing-list-filter/trunk/publish.bash Modified: mailing-list-filter/trunk/publish.bash =================================================================== --- mailing-list-filter/trunk/publish.bash 2008-05-25 02:30:24 UTC (rev 830) +++ mailing-list-filter/trunk/publish.bash 2008-06-02 00:13:06 UTC (rev 831) @@ -2,7 +2,7 @@ fullname='Mailing List Filter' version=0.1 -license=psf +license=gpl websrcs=( README ) rels=( pypi: ) . assorted.bash "$@" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-25 02:30:22
|
Revision: 830 http://assorted.svn.sourceforge.net/assorted/?rev=830&view=rev Author: yangzhang Date: 2008-05-24 19:30:24 -0700 (Sat, 24 May 2008) Log Message: ----------- added google file search Added Paths: ----------- google-file-search/ google-file-search/trunk/ google-file-search/trunk/README google-file-search/trunk/src/ google-file-search/trunk/src/gfs.php Added: google-file-search/trunk/README =================================================================== --- google-file-search/trunk/README (rev 0) +++ google-file-search/trunk/README 2008-05-25 02:30:24 UTC (rev 830) @@ -0,0 +1,2 @@ +A simple web frontend to Google for finding files in web directory listings, +especially media files (mp3s). Added: google-file-search/trunk/src/gfs.php =================================================================== --- google-file-search/trunk/src/gfs.php (rev 0) +++ google-file-search/trunk/src/gfs.php 2008-05-25 02:30:24 UTC (rev 830) @@ -0,0 +1,22 @@ +<?php +if ($_POST['query']) { + $query = urlencode( + 'intitle:"index of" +"last modified" +"parent directory" ' . + '+(mp3|wma|ogg) -inurl:htm -inurl:html -inurl:php -inurl:asp ' . + //'-site:openpirate.com ' . + $_POST['query'] + ); + header('Location: http://www.google.com/search?q=' . $query); + exit; +} +?> +<html> +<head> +<title>Google File Search</title> +</head> +<body> +<form method="post" action="gfs.php"> +<input name="query" style="width: 100%" /> +</form> +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-16 19:51:24
|
Revision: 829 http://assorted.svn.sourceforge.net/assorted/?rev=829&view=rev Author: yangzhang Date: 2008-05-16 12:51:10 -0700 (Fri, 16 May 2008) Log Message: ----------- added neutral color scheme Added Paths: ----------- configs/trunk/src/vim/colors/ps_color.vim Added: configs/trunk/src/vim/colors/ps_color.vim =================================================================== --- configs/trunk/src/vim/colors/ps_color.vim (rev 0) +++ configs/trunk/src/vim/colors/ps_color.vim 2008-05-16 19:51:10 UTC (rev 829) @@ -0,0 +1,538 @@ +" Vim colour file --- PSC +" Maintainer: Pan, Shi Zhu <Go to the following URL for my email> +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 +" Last Change: 23 Oct 2006 +" Version: 3.00 +" +" Please prepend [VIM] in the title when writing e-mail to me, or it will +" be automatically treated as spam and removed. +" +" See the help document for all details, the help document will be +" installed after the script has been sourced once, do not open the +" script when you source it for the first time. +" + +" Initializations: {{{1 +" + +" without user_commands, all these are not possible +if !has("user_commands") + finish +end + +" Init the option to the default value if not defined by user. +function! s:init_option(var, value) + if !exists("g:psc_".a:var) + execute "let s:".a:var." = ".a:value + else + let s:{a:var} = g:psc_{a:var} + endif +endfunction +command! -nargs=+ InitOpt call s:init_option(<f-args>) + +" give highlight setting to multiple highlight groups, maximum 20 +function! s:multi_hi(setting, ...) + let l:idx = a:0 + while l:idx > 0 + let l:hlgroup = a:{l:idx} + execute "highlight ".l:hlgroup." ".a:setting + let l:idx = l:idx - 1 + endwhile +endfunction +command! -nargs=+ MultiHi call s:multi_hi(<f-args>) + +InitOpt style 'cool' +InitOpt cterm_transparent 0 +InitOpt inversed_todo 0 +InitOpt use_default_for_cterm 0 +InitOpt statement_different_from_type 0 + +if !has("gui_running") + call s:init_option("cterm_style", "'".s:style."'") + + if s:use_default_for_cterm==1 | let s:cterm_style = 'default' + elseif s:use_default_for_cterm==2 | let s:cterm_style = 'defdark' + endif +endif + + +InitOpt other_style 0 + +" WJMc had changed a version of this, however, it will messed up some features +" when the psc_style being other values than 'warm' and 'cool'. The psc_style +" is designed to accept any colorscheme name, such as 'desert'. The following +" code follows the basic principle of WJMc's code. +if &background=='light' + if has("gui_running") + if s:style=='warm' || s:style=='default' + " nothing to do + elseif s:style=='cool' + let s:style = 'warm' + elseif s:style=='defdark' + let s:style = 'default' + else + let s:other_style = 1 + endif + else + if s:cterm_style=='cool' || s:cterm_style=='defdark' || s:cterm_style=='warm' + let s:cterm_style='default' + elseif s:cterm_style=='default' + " nothing to do + else + let s:other_style = 1 + endif + endif +elseif &background=='dark' + if s:style=='warm' + let s:style = 'cool' + elseif s:style=='default' + let s:style = 'defdark' + elseif s:style=='cool' || s:style=='defdark' + " nothing to do + else + let s:other_style = 1 + endif + let s:cterm_style = s:style +else + echo "unrecognized background=" &background ", ps_color halt.\n" + finish +endif + +" This should be after the style mangling +if s:style == 'warm' + InitOpt fontface 'mixed' +else + InitOpt fontface 'plain' +endif + + +" === Traditional Color Scheme script starts here. === +highlight clear + +if exists("syntax_on") + syntax reset +endif + +let s:color_name = expand("<sfile>:t:r") + +if s:other_style==0 + let g:colors_name = s:color_name + " Go from console version to gui, the color scheme should be sourced again + execute "autocmd TermChanged * if g:colors_name == '".s:color_name."' | " + \."colo ".s:color_name." | endif" +else + execute "runtime colors/".s:style.".vim" +endif + +" Command to go different schemes easier. +" This is a multi-purpose command, might be a poor design. +" WJMc had a change for this, but the 'reloaded' style and other colorscheme +" cannot be launched that way. +execute "command! -nargs=1 Colo if '".s:color_name."'!=\"<args>\" |". + \'let g:psc_style = "<args>"| endif |'. + \'if g:psc_style=="warm" | set background=light | endif |'. + \'if g:psc_style=="cool" | set background=dark | endif |'. + \'colo '.s:color_name + +" Give control to 'reloaded' scheme if possible +if s:style == 'reloaded' + finish +endif + +" }}}1 + +" Relevant Help: +" :h highlight-groups +" :h psc-cterm-color-table +" :ru syntax/hitest.vim +" +" Hard coded Colors Comment: +" #aabbcc = Red aa, Green bb, Blue cc +" we must use hard-coded colours to get more 'tender' colours +" + + +" GUI: +" +" I don't want to abuse folding, but here folding is used to avoid confusion. +if s:style=='warm' + " Warm style for gui here {{{2 + " LIGHT COLOR DEFINE START + + highlight Normal guifg=#000000 guibg=#e0e0e0 + highlight Search guifg=NONE guibg=#f8f8f8 + highlight Visual guifg=NONE guibg=#a6caf0 + highlight Cursor guifg=#f0f0f0 guibg=#008000 + " The idea of CursorIM is pretty good, however, the feature is still buggy + " in the current version (Vim 7.0). + " The following line will be kept commented until the bug fixed. + " + " highlight CursorIM guifg=#f0f0f0 guibg=#800080 + highlight Special guifg=#907000 guibg=NONE + highlight Comment guifg=#606000 guibg=NONE + highlight Number guifg=#907000 guibg=NONE + highlight Constant guifg=#007068 guibg=NONE + highlight StatusLine guifg=fg guibg=#a6caf0 + highlight LineNr guifg=#686868 guibg=NONE + highlight Question guifg=fg guibg=#d0d090 + highlight PreProc guifg=#009030 guibg=NONE + if s:statement_different_from_type==1 + highlight Statement guifg=#4020a0 guibg=NONE + else + highlight Statement guifg=#2060a8 guibg=NONE + endif + highlight Type guifg=#0850a0 guibg=NONE + if s:inversed_todo==1 + highlight Todo guifg=#e0e090 guibg=#000080 + else + highlight Todo guifg=#800000 guibg=#e0e090 + endif + " NOTE THIS IS IN THE WARM SECTION + highlight Error guifg=#c03000 guibg=NONE + highlight Identifier guifg=#a030a0 guibg=NONE + highlight ModeMsg guifg=fg guibg=#b0b0e0 + highlight VisualNOS guifg=fg guibg=#b0b0e0 + highlight SpecialKey guifg=#1050a0 guibg=NONE + highlight NonText guifg=#002090 guibg=#d0d0d0 + highlight Directory guifg=#a030a0 guibg=NONE + highlight ErrorMsg guifg=fg guibg=#f0b090 + highlight MoreMsg guifg=#489000 guibg=NONE + highlight Title guifg=#a030a0 guibg=NONE + highlight WarningMsg guifg=#b02000 guibg=NONE + highlight WildMenu guifg=fg guibg=#d0d090 + highlight Folded guifg=NONE guibg=#b0e0b0 + highlight FoldColumn guifg=fg guibg=#90e090 + highlight DiffAdd guifg=NONE guibg=#b0b0e0 + highlight DiffChange guifg=NONE guibg=#e0b0e0 + highlight DiffDelete guifg=#002090 guibg=#d0d0d0 + highlight DiffText guifg=NONE guibg=#c0e080 + highlight SignColumn guifg=fg guibg=#90e090 + highlight IncSearch guifg=#f0f0f0 guibg=#806060 + highlight StatusLineNC guifg=fg guibg=#c0c0c0 + highlight VertSplit guifg=fg guibg=#c0c0c0 + highlight Underlined guifg=#6a5acd guibg=NONE gui=underline + highlight Ignore guifg=bg guibg=NONE + " NOTE THIS IS IN THE WARM SECTION + if v:version >= 700 + if has('spell') + highlight SpellBad guifg=NONE guibg=NONE guisp=#c03000 + highlight SpellCap guifg=NONE guibg=NONE guisp=#2060a8 + highlight SpellRare guifg=NONE guibg=NONE guisp=#a030a0 + highlight SpellLocal guifg=NONE guibg=NONE guisp=#007068 + endif + highlight Pmenu guifg=fg guibg=#e0b0e0 + highlight PmenuSel guifg=#f0f0f0 guibg=#806060 + highlight PmenuSbar guifg=fg guibg=#c0c0c0 + highlight PmenuThumb guifg=fg guibg=#c0e080 + highlight TabLine guifg=fg guibg=#c0c0c0 gui=underline + highlight TabLineFill guifg=fg guibg=#c0c0c0 gui=underline + highlight TabLineSel guifg=fg guibg=NONE + highlight CursorColumn guifg=NONE guibg=#f0b090 + highlight CursorLine guifg=NONE guibg=NONE gui=underline + highlight MatchParen guifg=NONE guibg=#c0e080 + endif + + " LIGHT COLOR DEFINE END + " }}}2 +elseif s:style=='cool' + " Cool style for gui here {{{2 + " DARK COLOR DEFINE START + + highlight Normal guifg=#d0d0d0 guibg=#202020 + highlight Comment guifg=#d0d090 guibg=NONE + highlight Constant guifg=#80c0e0 guibg=NONE + highlight Number guifg=#e0c060 guibg=NONE + highlight Identifier guifg=#f0c0f0 guibg=NONE + if s:statement_different_from_type==1 + highlight Statement guifg=#98a8f0 guibg=NONE + else + highlight Statement guifg=#c0d8f8 guibg=NONE + endif + highlight PreProc guifg=#60f080 guibg=NONE + highlight Type guifg=#b0d0f0 guibg=NONE + highlight Special guifg=#e0c060 guibg=NONE + highlight Error guifg=#f08060 guibg=NONE + if s:inversed_todo==1 + highlight Todo guifg=#d0d090 guibg=#000080 + else + highlight Todo guifg=#800000 guibg=#d0d090 + endif + highlight Search guifg=NONE guibg=#800000 + highlight Visual guifg=#000000 guibg=#a6caf0 + highlight Cursor guifg=#000000 guibg=#00f000 + " NOTE THIS IS IN THE COOL SECTION + " highlight CursorIM guifg=#000000 guibg=#f000f0 + highlight StatusLine guifg=#000000 guibg=#a6caf0 + highlight LineNr guifg=#b0b0b0 guibg=NONE + highlight Question guifg=#000000 guibg=#d0d090 + highlight ModeMsg guifg=fg guibg=#000080 + highlight VisualNOS guifg=fg guibg=#000080 + highlight SpecialKey guifg=#b0d0f0 guibg=NONE + highlight NonText guifg=#6080f0 guibg=#101010 + highlight Directory guifg=#80c0e0 guibg=NONE + highlight ErrorMsg guifg=#d0d090 guibg=#800000 + highlight MoreMsg guifg=#c0e080 guibg=NONE + highlight Title guifg=#f0c0f0 guibg=NONE + highlight WarningMsg guifg=#f08060 guibg=NONE + highlight WildMenu guifg=#000000 guibg=#d0d090 + highlight Folded guifg=NONE guibg=#004000 + highlight FoldColumn guifg=#e0e0e0 guibg=#008000 + highlight DiffAdd guifg=NONE guibg=#000080 + highlight DiffChange guifg=NONE guibg=#800080 + highlight DiffDelete guifg=#6080f0 guibg=#202020 + highlight DiffText guifg=#000000 guibg=#c0e080 + highlight SignColumn guifg=#e0e0e0 guibg=#008000 + highlight IncSearch guifg=#000000 guibg=#d0d0d0 + highlight StatusLineNC guifg=#000000 guibg=#c0c0c0 + highlight VertSplit guifg=#000000 guibg=#c0c0c0 + highlight Underlined guifg=#80a0ff guibg=NONE gui=underline + highlight Ignore guifg=#000000 guibg=NONE + " NOTE THIS IS IN THE COOL SECTION + if v:version >= 700 + if has('spell') + highlight SpellBad guifg=NONE guibg=NONE guisp=#f08060 + highlight SpellCap guifg=NONE guibg=NONE guisp=#6080f0 + highlight SpellRare guifg=NONE guibg=NONE guisp=#f0c0f0 + highlight SpellLocal guifg=NONE guibg=NONE guisp=#c0d8f8 + endif + highlight Pmenu guifg=fg guibg=#800080 + highlight PmenuSel guifg=#000000 guibg=#d0d0d0 + highlight PmenuSbar guifg=fg guibg=#000080 + highlight PmenuThumb guifg=fg guibg=#008000 + highlight TabLine guifg=fg guibg=#008000 gui=underline + highlight TabLineFill guifg=fg guibg=#008000 gui=underline + highlight TabLineSel guifg=fg guibg=NONE + highlight CursorColumn guifg=NONE guibg=#800000 + highlight CursorLine guifg=NONE guibg=NONE gui=underline + highlight MatchParen guifg=NONE guibg=#800080 + endif + + " DARK COLOR DEFINE END + " }}}2 +elseif s:style=='defdark' + highlight Normal guifg=#f0f0f0 guibg=#000000 +endif + +" Take NT gui for example, If you want to use a console font such as +" Lucida_Console with font size larger than 14, the font looks already thick, +" and the bold font for that will be too thick, you may not want it be bold. +" The following code does this. +" +" All of the bold font may be disabled, since continuously switching between +" bold and plain font hurts consistency and will inevitably fatigue your eye! + +" Maximum 20 parameters for vim script function +" +MultiHi gui=NONE ModeMsg Search Cursor Special Comment Constant Number LineNr Question PreProc Statement Type Todo Error Identifier Normal + +MultiHi gui=NONE VisualNOS SpecialKey NonText Directory ErrorMsg MoreMsg Title WarningMsg WildMenu Folded FoldColumn DiffAdd DiffChange DiffDelete DiffText SignColumn + +" Vim 7 added stuffs +if v:version >= 700 + MultiHi gui=NONE Ignore PmenuSel PmenuSel PmenuSbar PmenuThumb TabLine TabLineFill TabLineSel + + " the gui=undercurl guisp could only support in Vim 7 + if has('spell') + MultiHi gui=undercurl SpellBad SpellCap SpellRare SpellLocal + endif + if s:style=="cool" || s:style=="warm" + MultiHi gui=underline TabLine TabLineFill Underlined CursorLine + else + MultiHi gui=underline TabLine Underlined + endif +endif + +" For reversed stuffs +MultiHi gui=NONE IncSearch StatusLine StatusLineNC VertSplit Visual + +if s:style=="cool" || s:style=="warm" + if s:fontface=="mixed" + MultiHi gui=bold IncSearch StatusLine StatusLineNC VertSplit Visual + endif +else + if s:fontface=="mixed" + hi StatusLine gui=bold,reverse + else + hi StatusLine gui=reverse + endif + MultiHi gui=reverse IncSearch StatusLineNC VertSplit Visual +endif + +" Enable the bold style +if s:fontface=="mixed" + MultiHi gui=bold Question DiffText Statement Type MoreMsg ModeMsg NonText Title VisualNOS DiffDelete TabLineSel +endif + + + + +" Color Term: + +" It's not quite possible to support 'cool' and 'warm' simultaneously, since +" we cannot expect a terminal to have more than 16 color names. +" + +" I assume Vim will never go to cterm mode when has("gui_running") returns 1, +" Please enlighten me if I am wrong. +" +if !has('gui_running') + " cterm settings {{{1 + if s:cterm_style=='cool' + + if s:cterm_transparent + highlight Normal ctermfg=LightGrey ctermbg=NONE + highlight Special ctermfg=Yellow ctermbg=NONE + highlight Comment ctermfg=DarkYellow ctermbg=NONE + highlight Constant ctermfg=Blue ctermbg=NONE + highlight Number ctermfg=Yellow ctermbg=NONE + highlight LineNr ctermfg=DarkGrey ctermbg=NONE + highlight PreProc ctermfg=Green ctermbg=NONE + highlight Statement ctermfg=Cyan ctermbg=NONE + highlight Type ctermfg=Cyan ctermbg=NONE + highlight Error ctermfg=Red ctermbg=NONE + highlight Identifier ctermfg=Magenta ctermbg=NONE + highlight SpecialKey ctermfg=Cyan ctermbg=NONE + highlight NonText ctermfg=Blue ctermbg=NONE + highlight Directory ctermfg=Blue ctermbg=NONE + highlight MoreMsg ctermfg=Green ctermbg=NONE + highlight Title ctermfg=Magenta ctermbg=NONE + highlight WarningMsg ctermfg=Red ctermbg=NONE + highlight DiffDelete ctermfg=Blue ctermbg=NONE + else + highlight Normal ctermfg=LightGrey ctermbg=Black + highlight Special ctermfg=Yellow ctermbg=bg + highlight Comment ctermfg=DarkYellow ctermbg=bg + highlight Constant ctermfg=Blue ctermbg=bg + highlight Number ctermfg=Yellow ctermbg=bg + highlight LineNr ctermfg=DarkGrey ctermbg=bg + highlight PreProc ctermfg=Green ctermbg=bg + highlight Statement ctermfg=Cyan ctermbg=bg + highlight Type ctermfg=Cyan ctermbg=bg + highlight Error ctermfg=Red ctermbg=bg + highlight Identifier ctermfg=Magenta ctermbg=bg + highlight SpecialKey ctermfg=Cyan ctermbg=bg + highlight NonText ctermfg=Blue ctermbg=bg + highlight Directory ctermfg=Blue ctermbg=bg + highlight MoreMsg ctermfg=Green ctermbg=bg + highlight Title ctermfg=Magenta ctermbg=bg + highlight WarningMsg ctermfg=Red ctermbg=bg + highlight DiffDelete ctermfg=Blue ctermbg=bg + endif + highlight Search ctermfg=NONE ctermbg=DarkRed + highlight Visual ctermfg=Black ctermbg=DarkCyan + highlight Cursor ctermfg=Black ctermbg=Green + highlight StatusLine ctermfg=Black ctermbg=DarkCyan + highlight Question ctermfg=Black ctermbg=DarkYellow + if s:inversed_todo==0 + highlight Todo ctermfg=DarkRed ctermbg=DarkYellow + else + highlight Todo ctermfg=DarkYellow ctermbg=DarkBlue + endif + highlight Folded ctermfg=White ctermbg=DarkGreen + highlight ModeMsg ctermfg=Grey ctermbg=DarkBlue + highlight VisualNOS ctermfg=Grey ctermbg=DarkBlue + highlight ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed + highlight WildMenu ctermfg=Black ctermbg=DarkYellow + highlight FoldColumn ctermfg=White ctermbg=DarkGreen + highlight SignColumn ctermfg=White ctermbg=DarkGreen + highlight DiffText ctermfg=Black ctermbg=DarkYellow + + if v:version >= 700 + if has('spell') + highlight SpellBad ctermfg=NONE ctermbg=DarkRed + highlight SpellCap ctermfg=NONE ctermbg=DarkBlue + highlight SpellRare ctermfg=NONE ctermbg=DarkMagenta + highlight SpellLocal ctermfg=NONE ctermbg=DarkGreen + endif + highlight Pmenu ctermfg=fg ctermbg=DarkMagenta + highlight PmenuSel ctermfg=Black ctermbg=fg + highlight PmenuSbar ctermfg=fg ctermbg=DarkBlue + highlight PmenuThumb ctermfg=fg ctermbg=DarkGreen + highlight TabLine ctermfg=fg ctermbg=DarkGreen cterm=underline + highlight TabLineFill ctermfg=fg ctermbg=DarkGreen cterm=underline + highlight CursorColumn ctermfg=NONE ctermbg=DarkRed + if s:cterm_transparent + highlight TabLineSel ctermfg=fg ctermbg=NONE + highlight CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + else + highlight TabLineSel ctermfg=fg ctermbg=bg + highlight CursorLine ctermfg=NONE ctermbg=bg cterm=underline + endif + highlight MatchParen ctermfg=NONE ctermbg=DarkMagenta + endif + if &t_Co==8 + " 8 colour terminal support, this assumes 16 colour is available through + " setting the 'bold' attribute, will get bright foreground colour. + " However, the bright background color is not available for 8-color terms. + " + " You can manually set t_Co=16 in your .vimrc to see if your terminal + " supports 16 colours, + MultiHi cterm=none DiffText Visual Cursor Comment Todo StatusLine Question DiffChange ModeMsg VisualNOS ErrorMsg WildMenu DiffAdd Folded DiffDelete Normal PmenuThumb + MultiHi cterm=bold Search Special Constant Number LineNr PreProc Statement Type Error Identifier SpecialKey NonText MoreMsg Title WarningMsg FoldColumn SignColumn Directory DiffDelete + + else + " Background > 7 is only available with 16 or more colors + + " Only use the s:fontface option when there is 16-colour(or more) + " terminal support + + MultiHi cterm=none WarningMsg Search Visual Cursor Special Comment Constant Number LineNr PreProc Todo Error Identifier Folded SpecialKey Directory ErrorMsg Normal PmenuThumb + MultiHi cterm=none WildMenu FoldColumn SignColumn DiffAdd DiffChange Question StatusLine DiffText + MultiHi cterm=reverse IncSearch StatusLineNC VertSplit + + " Well, well, bold font with color 0-7 is not possible. + " So, the Question, StatusLine, DiffText cannot act as expected. + + call s:multi_hi("cterm=".((s:fontface=="plain") ? "none" : "bold"), "Statement", "Type", "MoreMsg", "ModeMsg", "NonText", "Title", "VisualNOS", "DiffDelete", "TabLineSel") + + endif + + elseif s:cterm_style=='defdark' + highlight Normal ctermfg=LightGrey ctermbg=NONE + endif + " }}}1 +endif + + +" Term: +" For console with only 4 colours (term, not cterm), we'll use the default. +" ... +" The default colorscheme is good enough for terms with no more than 4 colours +" + + +" Links: +" +if (s:style=='cool') || (s:style == 'warm') + " COLOR LINKS DEFINE START + + highlight link String Constant + " Character must be different from strings because in many languages + " (especially C, C++) a 'char' variable is scalar while 'string' is pointer, + " mistaken a 'char' for a 'string' will cause disaster! + highlight link Character Number + highlight link SpecialChar LineNr + highlight link Tag Identifier + " The following are not standard hi links, + " these are used by DrChip + highlight link Warning MoreMsg + highlight link Notice Constant + " these are used by Calendar + highlight link CalToday PreProc + " these are used by TagList + highlight link MyTagListTagName IncSearch + highlight link MyTagListTagScope Constant + + " COLOR LINKS DEFINE END +endif + + +" Clean: +" these clean stuffs are proved to have problem, so I removed them. +delcommand InitOpt +delcommand MultiHi +" delfunction init_option +" delfunction multi_hi + +" vim:et:nosta:sw=2:ts=8: +" vim600:fdm=marker:fdl=1: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yan...@us...> - 2008-05-16 00:40:10
|
Revision: 828 http://assorted.svn.sourceforge.net/assorted/?rev=828&view=rev Author: yangzhang Date: 2008-05-15 17:40:14 -0700 (Thu, 15 May 2008) Log Message: ----------- updated the c++ template Modified Paths: -------------- configs/trunk/src/topcoder/template.cpp Modified: configs/trunk/src/topcoder/template.cpp =================================================================== --- configs/trunk/src/topcoder/template.cpp 2008-05-16 00:40:06 UTC (rev 827) +++ configs/trunk/src/topcoder/template.cpp 2008-05-16 00:40:14 UTC (rev 828) @@ -20,6 +20,7 @@ #include <sstream> #include <stack> #include <string> +#include <utility> #include <vector> using namespace std; @@ -33,7 +34,11 @@ #define bounds(i,xs) for (typeof((xs).size()) i = 0; i < (xs).size(); i++) #define range(i,l,h) for (typeof(l) i = (l); i < (h); i++) #define event(x) { cout << __FILE__ << ":" << __LINE__ << ": " << #x << endl; x; } -#define trace(x) { cout << __FILE__ << ":" << __LINE__ << ": "; pp(x); x; } +#define trace(x) { \ + typeof(x) __x = x; \ + cout << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << __x << endl; \ + __x; \ +} #define ping cout << "ping" << endl; #define pong cout << "pong" << endl; @@ -48,25 +53,28 @@ typedef vector<vs> vvs; typedef vector<vb> vvb; typedef long long ll; -#define vec(x) vector< x > +#define vec(x...) vector< x > typedef string str; template<typename T> inline T mod(T a, T b) { return (a % b + b) % b; } -template<typename T> inline void rev(T xs) { std::reverse(all(xs)); } -template<typename T> inline void sort(T xs) { std::sort(all(xs)); } -template<typename T> inline void ssort(T xs) { std::stable_sort(all(xs)); } -template<typename T> inline void unique(T xs) { std::unique(all(xs)); } -template<typename T> inline void uniq(T xs) { xs.erase( std::unique(all(xs)), xs.end() ); } -template<typename T, typename U> inline void fill(T xs, U x) { std::fill(all(xs), x); } -template<typename T, typename U> inline U minim(const T xs) { return *std::min_element(all(xs)); } -template<typename T, typename U> inline U maxim(const T xs) { return *std::max_element(all(xs)); } -template<typename T> inline void nextp(T xs) { return std::next_permutation(all(xs)); } -template<typename T> inline void prevp(T xs) { return std::prev_permutation(all(xs)); } -template<typename T> inline string tos(T x) { stringstream s; s << x; return s.str(); } +template<typename T> inline void rev(T & xs) { std::reverse(all(xs)); } +template<typename T> inline void sort(T & xs) { std::sort(all(xs)); } +template<typename T> inline void ssort(T & xs) { std::stable_sort(all(xs)); } +template<typename T> inline void unique(T & xs) { std::unique(all(xs)); } +template<typename T> inline void uniq(T & xs) { xs.erase( std::unique(all(xs)), xs.end() ); } +template<typename T, typename U> inline void fill(T & xs, U & x) { std::fill(all(xs), x); } +template<typename T, typename U> inline U minim(const T & xs) { return *std::min_element(all(xs)); } +template<typename T, typename U> inline U maxim(const T & xs) { return *std::max_element(all(xs)); } +template<typename T> inline void nextp(T & xs) { return std::next_permutation(all(xs)); } +template<typename T> inline void prevp(T & xs) { return std::prev_permutation(all(xs)); } +template<typename T> inline string tos(T & x) { stringstream s; s << x; return s.str(); } +// pow, powl, powf are std +inline double powd(double a, double b) { return std::pow(a, b); } inline int powi(int a, int b) { return int( std::pow(double(a), double(b)) ); } -inline int powl(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } -template<typename T> inline void print(const T & x) { cout << x << endl; } -#define pp(x) cout << #x << ' ' << x << endl; +inline int powll(ll a, ll b) { return ll( std::pow(double(a), double(b)) ); } +template<typename T> inline void pl(const T & x) { cout << x << endl; } +template<typename T, typename U> inline pair<T,U> mkpair(T t, U u) { return make_pair(t,u); } +#define pp(x) cout << #x << " = " << x << endl; inline ll gcd(ll a, ll b) { if (a < 0 && b < 0) return gcd(-a,-b); @@ -81,14 +89,16 @@ template <typename T> inline ostream& operator << (ostream& os, const set<T> & xs) { - bounds(i,xs) os << i ? ", " : "{ " << xs[i]; + os << "{ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; return os << " }"; } template <typename T> inline ostream& operator << (ostream& os, const vector<T> & xs) { - bounds(i,xs) os << i ? ", " : "{ " << xs[i]; - return os << " }"; + os << "[ "; + bounds(i,xs) os << (i ? ", " : "") << xs[i]; + return os << " ]"; } template<class S,class T> @@ -116,6 +126,19 @@ return res; } +vs splitstr( const str & s, const str & glue = " " ) { + vs res; + str::size_type i = 0; + str::size_type ln = glue.sz; + while (true) { + str::size_type pos = s.find(glue, i); + res.push_back(string(s, i, pos)); + if (pos == str::npos) break; + i = pos + ln; + } + return res; +} + vi ints( const str & s, const str & delim = " " ) { vs ss = split( s, delim ); vi is; @@ -129,6 +152,26 @@ return s; } +template<typename T, typename U> inline U realfact(T x) { + ll f = 1; + range(i,1,x+1) f *= i; + return f; +} + +template<typename T> inline ll factl(T x) { return realfact<T,ll>(x); } +template<typename T> inline int facti(T x) { return realfact<T,int>(x); } + +ll perms(ll n, ll r) { + assert(n >= r); + ll p = 1; + for (ll i = n; i > n-r; i--) p *= i; + return p; +} + +ll combs(ll n, ll k) { + return perms(n,k) / factl(k); +} + // following is needed for 'main' #define ARRSIZE(x) (sizeof(x)/sizeof(x[0])) // $ENDREUSE$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |