コード例 #1
0
ファイル: main.cpp プロジェクト: VoLuong/CS161-Intro-to-CS
int main()
{
	int day, month, year;
	cout << " Please input the day " ;
	cin >> day;
	cout <<" Please input the month ";
	cin >> month;
	cout <<" Please input the year";
	cin >> year;
	everything( month, day, year );
	return 0;
}
コード例 #2
0
ファイル: ComplexInliner.cpp プロジェクト: Mestway/Queries
void ComplexInliner::process(BooleanDAG& dag){
	// cout<<" funmap has size " << functionMap.size() << endl;
	somethingChanged = true;
	{
		DagOptim optim(dag);
		optim.process(dag);
	}
	
	computeSpecialInputs();

	expectedNFuns = 2;
	timerclass everything("everything");

	everything.start();
	int inlin = 0;
	while(somethingChanged && dag.size() < 510000 && inlin < inlineAmnt){
		somethingChanged = false;
		if(inlin!=0){ cout<<inlin<<": inside the loop dag.size()=="<<dag.size()<<endl; }

		immInline(dag);	
		//if(inlin==0){( dag.print(cout) );}
		++inlin;
	}
	
	everything.stop();
	if(inlin>1){
		cout<<" final dag.size()=="<<dag.size()<<endl;
		cout<<"inlin = "<<inlin<<endl;
		everything.print();

		unifyTime.print();
		clonetime.print();
		optAll.print();		
		optimTime.print();
	}
	/*
	for(map<string, pair<int, int> >::iterator it = sizes.begin(); it != sizes.end(); ++it){
		cout<<it->first<<" : "<< (it->second.second / it->second.first)<<"  "<<it->second.second<<"  "<<it->second.first<<endl;
	}
*/
	
	// dag.print(cout);
	{
		DagFunctionToAssertion makeAssert(dag, functionMap);
		makeAssert.process(dag);
	}

	if(inlin>1){
		cout<<" After everything: dag.size()=="<<dag.size()<<endl;	
	}
}
コード例 #3
0
ファイル: wikidiff.cpp プロジェクト: AlexGreat007/wikia
// split a string into multiple tokens, just like the monster regex in DifferenceEngine.php
void split_tokens(const char *text, std::vector<Word> &tokens)
{
	if (strlen(text) > MAX_DIFF_LINE) {
		std::string everything(text);
		tokens.push_back(Word(everything, everything));
		return;
	}
	
	const char *ptr = text;

	while (*ptr) {
		std::string body, suffix;
		char ch = *ptr;
		
		// first group has three different opportunities:
		if (ch == ' ' || ch == '\t') {
			// one or more whitespace characters (but not \n)
			while (*ptr == ' ' || *ptr == '\t') { 
				body.push_back(*ptr++);
			}
		} else if (my_istext(ch)) {
			// one or more text characters
			while (my_istext(*ptr)) {
				body.push_back(*ptr++);
			}
		} else {
			// one character, no matter what it is
			body.push_back(*ptr++);
		}

		// second group: if the first character was not \n,
		// any whitespace character that is not \n (if any)
		if (ch != '\n') {
			if (*ptr == ' ' || *ptr == '\t') {
				suffix.push_back(*ptr++);
			}
		}

		tokens.push_back(Word(body, suffix));
	 }
}
コード例 #4
0
ファイル: gov_globals.cpp プロジェクト: bitkeeper/sedna
 * -1 means that parameter was not defined through command line
 * In ths case it will be set futher in fulfill_config_parameters().
 */
namespace gov_globals
{
    int  cl_el_level                     = -1;      // Event log severity level
    char cl_lstnr_addr[U_MAX_HOSTNAME]   = {"\0",}; // Governor listen address
    int  cl_lstnr_port                   = -1;      // Governor listen port
    int  cl_ping_port                    = -1;      // Process ping port
    int  cl_ka_timeout                   = -1;      // Session keep alive timeout
    int  cl_pp_stack_depth               = -1;
}


arg_rec gov_argtable[] =
{
{"--help",              NULL,        arg_lit,  &gov_help_l,                    "0",   "\t\t\t display this help and exit"},
{"-help",               NULL,        arg_lit,  &gov_help_s,                    "0",   "\t\t\t\t display this help and exit"},
{"-version",            NULL,        arg_lit,  &gov_version,                   "0",   "\t\t\t display product version and exit"},
{"-background-mode",    " on/off",   arg_bool, &background_mode,               "on",  "\t start in the background mode (default on)"},
{"-listen-address",  " address",     arg_str,  &gov_globals::cl_lstnr_addr,    "localhost", "\t local address Sedna listens for client connections (default localhost)"},
{"-port-number",        " port",     arg_int,  &gov_globals::cl_lstnr_port,    "-1",  "\t\t socket listening port (default 5050)"},
{"-ping-port-number",   " port",     arg_int,  &gov_globals::cl_ping_port,     "-1",  "\t ping listening port (default 5151)"},
{"-el-level",           " level",    arg_int,  &gov_globals::cl_el_level,      "-1",  "\t\t event logging level (default 3):\n\t\t\t\t    0 - event logging is off\
\n\t\t\t\t    1 - log only fatal errors\n\t\t\t\t    2 - log all errors/warnings\n\t\t\t\t    3 - system operational messages\
\n\t\t\t\t    4 - log everything (+debug messages)"},
{"-alive-timeout",      " timeout",  arg_int,  &gov_globals::cl_ka_timeout,    "-1",  "\t session keep alive timeout\n\t\t\t\t (default 0 - infinite timeout)"},
{"-stack-depth",        " depth",    arg_int,  &gov_globals::cl_pp_stack_depth,"-1",  "\t\t maximum executor stack depth\n\t\t\t\t (default 4000)"}
};