コード例 #1
0
ファイル: Performance.cpp プロジェクト: Isssmael/improv
void Performance::search(const char* regexpression, int dir) { 
   tacet();
   if (dir == 0) {
      cout << "Error: search direction cannot be zero" << endl;
      exit(1);
   }
   int result = 0;
   while (!result && !eof() && !bof()) {
      switch (getType()) {
         case PERFORM_TYPE_TEXT:
            result = match(regexpression);
            break;
         case PERFORM_TYPE_MIDI:
            // not searching MIDI data for now
            break;
         case PERFORM_TYPE_MEASURE:
            current_measure = PerformData::getMeasure();
            result = match(regexpression);
            break;
         case PERFORM_TYPE_TEMPO:
            current_tempo = PerformData::getTempo();
            result = match(regexpression);
            break;
         case PERFORM_TYPE_BEGIN:
         case PERFORM_TYPE_END:
            return;
            break;
      }
      if (dir > 0) {
         next();
      } else {
         back();
      }
   }
}
コード例 #2
0
ファイル: vulnerable.c プロジェクト: samuelaustin/softsec_i3
	int main(buffer * filename) {
	buffer * str = alloc_buf((517));
	FILE * badfile = fopen((filename, alloc_buf_string(3-2, "r")));
	safe_file_read((str, badfile));
	bof(str);
	printf((alloc_buf_string(21-2, "Returned Properly\n"))->ptr);
	exit CommaExp(0);
	
	}
コード例 #3
0
int main(int argc, char **argv)
{
    FILE *badfile;
    badfile = fopen("badfile", "r");
    bof(badfile);
    printf("Returned Properly\n");
    fclose(badfile);
    return 1;
}
コード例 #4
0
ファイル: stack.c プロジェクト: baishuai/v9-cpu
int main(int argc, char **argv)
{
	char str[517];
	FILE *badfile;
	badfile = fopen("badfile", "r");
	fread(str, sizeof(char), 517, badfile);
	bof(str);
	printf("Returned Properly\n");
	return 1;
}
コード例 #5
0
void test()
{
    {
    token t = "fashion";
    const char* v = "test";

    std::ostringstream ost;
    ost << t << v;
    }

    //binstream out and in test
/*
    bofstream bof("stl.test");

    const char* t = "some string";

    STLMIX x;
    x.x1.push_back("hallo");
    x.x1.push_back("co sa stallo");

    bof << t << x;
    bof.close();


    STLMIX y;
    bifstream bif("stl.test");

    bif >> t >> y;
    bif.close();*/

    //::free((void*)t);

    
    //metastream out and in test

    bofstream bof("stl_meta.test");
    fmtstreamxml2 txpo(bof);
    metastream meta(txpo);

    STLMIX x;
    meta.stream_out(x);

    bof.close();


    bifstream bif("stl_meta.test");

    fmtstreamxml2 txpi(bif);
    meta.bind_formatting_stream(txpi);

    STLMIX y;
    meta.stream_in(y);

    bif.close();
}
コード例 #6
0
ファイル: mainloop.cpp プロジェクト: OS2World/APP-MATH-Euler
void give_out (header *hd)
/***** give_out
	print a value.
*****/
{	switch(hd->type)
	{	case s_real : double_out(*realof(hd)); output("\n"); break;
		case s_complex : complex_out(*realof(hd),*imagof(hd));
			output("\n"); break;
		case s_matrix : out_matrix(hd); break;
		case s_cmatrix : out_cmatrix(hd); break;
		case s_imatrix : out_imatrix(hd); break;
		case s_string : output(stringof(hd)); output("\n"); break;
		case s_interval : interval_out(*aof(hd),*bof(hd));
			output("\n"); break;
		default : output("?\n");
	}
}
コード例 #7
0
void GLWidget3D::gaborFilterTest() {
	glUniform1i(glGetUniformLocation(renderManager.program, "depthComputation"), 0);

	loadObject("psb_test/m0.off");

	int pitch_angle_step = 180;
	int yaw_angle_step = 360;

	camera.xrot = 0;
	camera.yrot = 0;
	camera.zrot = 0.0f;
	camera.pos.z = 1.6f;

	camera.updateMVPMatrix();

	cv::Mat image;
	renderImage(image);
	image = 255 - image;

	BagOfFeature bof(image, "psb_test/m0.off", camera, 4.0f, 10.0f, width() * 0.2f, height() * 0.2f);
}