void patmatch ( int n , int m ) { char *S, *T1, *T2; int m1, m2, *match1, *match2; int i, j, k; S = randstr(n); m1 = m - 1; T1 = randstr(m1); m2 = m; T2 = randstr(m2); printf("S = %s\n", S); printf("T = %s*%s\n", T1, T2); match1 = KMP(S,T1,n,m1); match2 = KMP(S,T2,n,m2); printf("Pattern matches at index pairs"); for (i=j=1; i<=match1[0]; ++i) { k = match1[i] + m1; if (k > match2[match2[0]]) break; while ((j <= match2[0]) && (k > match2[j])) ++j; for (k=j; k<=match2[0]; ++k) printf(" (%d,%d)", match1[i], match2[k]); } printf("\n"); free(S); free(T1); free(T2); free(match1); free(match2); }
void strmatch ( int n, int m ) { char *S, *T; int *match, i; S = randstr(n); T = randstr(m); printf("S = %s\n", S); printf("T = %s\n", T); match = KMP(S,T,n,m); printf("%d matches found at indices", match[0]); for (i=1; i<=match[0]; ++i) printf(" %d", match[i]); printf("\n"); free(S); free(T); free(match); }
void make_config(int len) { std::ofstream of("test.ini"); for (int i=0;i<len;i++) { if (rand()%8==0) { // section of<<"["<<randstr()<<"]"; } else { // keyword=value of<<randstr()<<"="<<randstr(); } if (rand()%3==0) // comment of<<";"<<randstr(); of<<"\n"; } of.close(); }
int main(void) { srand(time(NULL)); hash_set<std::string> hs_str(10, 0.8, [] (const std::string entry) -> unsigned int { unsigned int hash = 0; for(char c : entry) hash = c + (13 * hash); return hash; } ); const int s_count = 30; std::string arr[s_count]; for(int i = 0; i < s_count; ++i) { randstr(10, arr[i]); std::cout << arr[i] << std::endl; } for(std::string s : arr) { hs_str.add(s); std::cout << std::endl; hs_str.print(); std::cout << "count: " << hs_str.size() << std::endl << "capacity: " << hs_str.get_capacity() << std::endl; } }
int main(void) { size_t max = 100; size_t n = 20; char buf[strsiz]; size_t i; st_t st = st_init(max); for (i = 0; i < n; i++) { item_t t = newitem(randkey(), randstr(buf, strsiz)); st_insert(st, t); } st_sort(st, print); printf("\nThe item with key 11 is: "); print(st_search(st, 11)); printf("\nThe 4th smallest key is: "); print(st_select(st, 4)); st_delete(st, st_search(st, 11)); printf("\n delete the item with key 11.\n"); st_sort(st, print); /* delete all item */ while (!st_empty(st)) { item_t x = st_select(st, 0); printf("delete item: "); print(x); st_delete(st, st_select(st, 0)); } st_finalize(&st); return 0; }
static void test_decode_random_headers_inner(int max_len) { int i; test_decode_random_header_state st; gpr_slice_buffer output; gpr_slice merged; grpc_stream_op_buffer encops; grpc_chttp2_hpack_parser parser; grpc_chttp2_hpack_parser_init(&parser, g_mdctx); grpc_sopb_init(&encops); gpr_log(GPR_INFO, "max_len = %d", max_len); for (i = 0; i < 10000; i++) { randstr(st.key, max_len); randstr(st.value, max_len); add_sopb_headers(1, st.key, st.value); gpr_slice_buffer_init(&output); GPR_ASSERT(0 == grpc_chttp2_preencode(g_sopb.ops, &g_sopb.nops, 0, &encops)); grpc_chttp2_encode(encops.ops, encops.nops, 0, 0xdeadbeef, &g_compressor, &output); encops.nops = 0; merged = grpc_slice_merge(output.slices, output.count); gpr_slice_buffer_destroy(&output); st.got_hdr = 0; parser.on_header = chk_hdr; parser.on_header_user_data = &st; grpc_chttp2_hpack_parser_parse(&parser, GPR_SLICE_START_PTR(merged) + 9, GPR_SLICE_END_PTR(merged)); GPR_ASSERT(st.got_hdr); gpr_slice_unref(merged); } grpc_chttp2_hpack_parser_destroy(&parser); grpc_sopb_destroy(&encops); }
int main() { hattrie_t* T = hattrie_create(); const size_t n = 1000000; // how many strings const size_t m_low = 50; // minimum length of each string const size_t m_high = 500; // maximum length of each string char x[501]; size_t i, m; for (i = 0; i < n; ++i) { m = m_low + rand() % (m_high - m_low); randstr(x, m); *hattrie_get(T, x, m) = 1; } hattrie_iter_t* it; clock_t t0, t; const size_t repetitions = 100; size_t r; /* iterate in unsorted order */ fprintf(stderr, "iterating out of order ... "); t0 = clock(); for (r = 0; r < repetitions; ++r) { it = hattrie_iter_begin(T, false); while (!hattrie_iter_finished(it)) { hattrie_iter_next(it); } hattrie_iter_free(it); } t = clock(); fprintf(stderr, "finished. (%0.2f seconds)\n", (double) (t - t0) / (double) CLOCKS_PER_SEC); /* iterate in sorted order */ fprintf(stderr, "iterating in order ... "); t0 = clock(); for (r = 0; r < repetitions; ++r) { it = hattrie_iter_begin(T, true); while (!hattrie_iter_finished(it)) { hattrie_iter_next(it); } hattrie_iter_free(it); } t = clock(); fprintf(stderr, "finished. (%0.2f seconds)\n", (double) (t - t0) / (double) CLOCKS_PER_SEC); hattrie_free(T); return 0; }
void test_aa_map_arbitrary_kv_5(void) { char mem[aa_map_size]; struct aa_map *m = aa_map_create( sizeof(mem) , mem , sizeof(int64_t) , ARBITRARY_LEN , __i64_cmp , __i64_cpy , __s32_cpy_never_ever , 0 , __alloc , __dealloc ); ranctx rctx; raninit(&rctx, 0xDEADBEEF); const size_t N = 50; size_t i = 0; const char dict[] = "qwertyuiopasdfghjklzxcvbnm" "QWERTYUIOPASDFGHJKLZXCVBNM1234567890"; for(; i < N; i++ ) { int64_t k = ranval(&rctx) % 10000; size_t ln2 = 1 + ranval(&rctx) % (ARBITRARY_LEN-2); char v[ARBITRARY_LEN]; randstr(&rctx, v, ln2, dict); aa_map_alter(m, true, &k, v, __kv_5_alter); } aa_map_enum(m, 0, __kv_5_print); aa_map_filter(m, 0, __kv_5_filt_even); fprintf(stdout, "filtered\n"); aa_map_enum(m, 0, __kv_5_print); aa_map_destroy(m); }
void setup() { fprintf(stderr, "generating %zu keys ... ", n); xs = malloc(n * sizeof(char*)); size_t i; size_t m; for (i = 0; i < n; ++i) { m = m_low + rand() % (m_high - m_low); xs[i] = malloc(m + 1); randstr(xs[i], m); } T = ahtable_create(); M = str_map_create(); fprintf(stderr, "done.\n"); }
void Dict_test(int *passed, int *total) { printf("\n\nDictionary\n\n"); srand(time(NULL)); Dict dict; Dict_init(&dict); // add a new item Dict_set(&dict, "foo", 10); *passed += ASSERT_INT_EQUALS(10, Dict_get(&dict, "foo"), "sets and retrieves a new item"); *total += 1; // update an existing item Dict_set(&dict, "foo", 20); *passed += ASSERT_INT_EQUALS(20, Dict_get(&dict, "foo"), "sets and retrieves an updated item"); *total += 1; // test expansion // so we can not destroy the test pass/fail count by adding hundreds of assertions to it int expansionPasses = 0; for(int i = 0; i < 200; i++) { // get the pair to add char *key = randstr(i); int value = i; if(strcmp(key, "") == 0) { printf("invalid key found"); } // add the pair to the dict Dict_set(&dict, key, value); // verify the set worked expansionPasses += ASSERT_INT_EQUALS(value, Dict_get(&dict, key), "extended check"); } if(expansionPasses == 100) { *passed += 1; } total += 1; }
static void xclient (const char *pf) { int sfd, i; int64_t nbytes; char buf[1024] = {}; char *ubuf; char host[1024] = {}; sprintf (host, "%s%s", pf, "://127.0.0.1:18897"); randstr (buf, 1024); BUG_ON ( (sfd = xconnect (host) ) < 0); for (i = 0; i < cnt; i++) { nbytes = rand() % 1024; ubuf = ubuf_alloc (nbytes); memcpy (ubuf, buf, nbytes); BUG_ON (0 != xsend (sfd, ubuf) ); BUG_ON (0 != xrecv (sfd, &ubuf) ); DEBUG_OFF ("%d recv response", sfd); assert (memcmp (ubuf, buf, nbytes) == 0); ubuf_free (ubuf); } xclose (sfd); }
DocumentsBuilder::DocumentsBuilder() { initrand(); for (int i = 0; i < AGENT_COUNT; i++) { int len = randint(100); char* agent = (char*) malloc(len); agents[i] = randstr(agent, len); } for (int i = 0; i < PRODUCT_COUNT; i++) { int len = randint(20, 200); char* name = (char*) malloc(len); product_names[i] = randstr(name, len); } static char* domains[8] = { "com", "net", "org", "us", "biz", "vn", "info", "edu" }; for (int i = 0; i < URL_COUNT; i++) { if (rand() < (RAND_MAX / 10000)) //0.01% { urls[i] = "http://www.ouzo.com/abcdef"; //printf(urls[i]); } else { int len = randint(4, 20); char* name = (char*) malloc(len); randstr(name, len, RAND_STR_LOWER_CASE_LETTERS); int dom = randint(8); char* url = (char*) malloc(len + strlen(domains[dom]) + strlen("http://") + 1); sprintf(url, "http://%s.%s", name, domains[dom]); free(name); urls[i] = url; } //printf("%s\n", url); } for (int i = 0; i < VARIABLE_COUNT; i++) { int len = randint(2, 8); char* name = (char*) malloc(len); randstr(name, len, RAND_STR_LOWER_CASE_LETTERS); variables[i] = name; //printf("%s\n", url); } for (int i = 0; i < 100000; i++) { int len = randint(10, 25); char* name = (char*) malloc(len); randstr(name, len, RAND_STR_LOWER_CASE_LETTERS); new_country[i] = name; //printf("%s\n", url); } }
void test_aa_map_arbitrary_kv_3(void) { char mem[aa_map_size]; struct aa_map *m = aa_map_create( sizeof(mem) , mem , ARBITRARY_LEN , ARBITRARY_LEN , __s32_cmp , __s32_cpy , __s32_cpy , 0 , __alloc , __dealloc ); struct aa_map *m2 = aa_map_create( sizeof(mem) , mem , ARBITRARY_LEN , ARBITRARY_LEN , __s32_cmp , __s32_cpy , __s32_cpy , 0 , __alloc , __dealloc ); ranctx rctx; raninit(&rctx, 0xDEADBEEF); const size_t N = 1000; size_t i = 0; const char dict[] = "qwertyuiopasdfghjklzxcvbnm" "QWERTYUIOPASDFGHJKLZXCVBNM1234567890"; for(; i < N; i++ ) { size_t ln1 = 1 + ranval(&rctx) % (ARBITRARY_LEN-2); size_t ln2 = 1 + ranval(&rctx) % (ARBITRARY_LEN-2); char k[ARBITRARY_LEN]; char v[ARBITRARY_LEN]; randstr(&rctx, k, ln1, dict); randstr(&rctx, v, ln2, dict); aa_map_add(m, k, v); } aa_map_enum(m, m2, __add_to_another); __s32_cpy_n = 0; __s32_cmp_n = 0; fprintf(stdout, "\n"); char ks[] = "SOME STRING"; void *v = aa_map_find(m, ks); fprintf(stdout , "found '%s' in m: %s, cmp: %zu\n" , ks , v ? (char*)v : "no" , __s32_cmp_n ); __s32_cpy_n = 0; __s32_cmp_n = 0; v = aa_map_find(m2, ks); fprintf(stdout , "found '%s' in m2: %s, cmp: %zu\n" , ks , v ? (char*)v : "no" , __s32_cmp_n ); size_t n = 4; aa_map_filter(m2, &n, __s32_shorter); aa_map_enum(m2, 0, __s32_print); __s32_cpy_n = 0; __s32_cmp_n = 0; struct lookup_kv3_cc cc = { .m = m, .n = 0, .match = 0 }; aa_map_enum(m2, &cc, __lookup_kv_3); fprintf( stdout , "lookup in m, %zu, found %zu, avg. cmp %zu (%zu)\n" , cc.n , cc.match , __s32_cmp_n / cc.n , __s32_cmp_n ); aa_map_destroy(m); aa_map_destroy(m2); } static void __kv_4_alter(void *c, void *k, void *v, bool n) { if( n ) { __s32_cpy(v, c); } else { char *p = v; char *pe = p + ARBITRARY_LEN; for(; *p && p < pe; p++ ) { *p = tolower(*p); } } } static void __kv_4_alter_up(void *c, void *k, void *v, bool n) { if( !n ) { char *p = v; char *pe = p + ARBITRARY_LEN; for(; *p && p < pe; p++ ) { *p = toupper(*p); } } } void test_aa_map_arbitrary_kv_4(void) { char mem[aa_map_size]; struct aa_map *m = aa_map_create( sizeof(mem) , mem , ARBITRARY_LEN , ARBITRARY_LEN , __s32_cmp , __s32_cpy , __s32_cpy , 0 , __alloc , __dealloc ); ranctx rctx; raninit(&rctx, 0xDEADBEEF); const size_t N = 20; size_t i = 0; const char dict[] = "qwertyuiopasdfghjklzxcvbnm" "QWERTYUIOPASDFGHJKLZXCVBNM1234567890"; for(; i < N; i++ ) { size_t ln1 = 1 + ranval(&rctx) % (ARBITRARY_LEN-2); size_t ln2 = 1 + ranval(&rctx) % (ARBITRARY_LEN-2); char k[ARBITRARY_LEN]; char v[ARBITRARY_LEN]; randstr(&rctx, k, ln1, dict); randstr(&rctx, v, ln2, dict); aa_map_alter(m, true, k, v, __kv_4_alter); aa_map_alter(m, true, k, v, __kv_4_alter); aa_map_alter(m, false, k, v, __kv_4_alter_up); } aa_map_enum(m, 0, __s32_print); fprintf(stdout, "filtering\n"); size_t n = 8; aa_map_filter(m, &n, __s32_shorter); aa_map_enum(m, 0, __s32_print); fprintf(stdout, "wiping\n"); aa_map_filter(m, 0, 0); aa_map_enum(m, 0, __s32_print); aa_map_destroy(m); }
void StlAdvancedFeaturesExample::char_star_string_storage() { int i; // Varying length data element storage/retrieval cout<<"\nchar*/wchar_t* string storage support...\n"; if (explicit_txn) dbstl::begin_txn(0, penv); // Use Dbt to wrap any object and store them. This is rarely needed, // so this piece of code is only for test purpose. db_vector<DbstlDbt> strv(dbstrv, penv); vector<string> strsv; vector<DbstlDbt> strvdbts; strv.clear(); int strlenmax = 256, strlenmin = 64; string str; DbstlDbt dbt; rand_str_dbt rand_str_maker; dbt.set_flags(DB_DBT_USERMEM); dbt.set_data(DbstlMalloc(strlenmax + 10)); dbt.set_ulen(strlenmax + 10); for (int jj = 0; jj < 10; jj++) { rand_str_maker(dbt, str, strlenmin, strlenmax); strsv.push_back(str); strv.push_back(dbt); } cout<<"\nstrings:\n"; for (i = 0; i < 10; i++) { db_vector<DbstlDbt>::value_type_wrap elemref = strv[i]; strvdbts.push_back(elemref); printf("\n%s\n%s", (char*)(strvdbts[i].get_data()), strsv[i].c_str()); check_expr(strcmp((char*)(elemref.get_data()), strsv[i].c_str()) == 0); check_expr(strcmp((char*)(strvdbts[i].get_data()), strsv[i].c_str()) == 0); } strv.clear(); if (explicit_txn) { dbstl::commit_txn(penv); dbstl::begin_txn(0, penv); } // Use ordinary way to store strings. TCHAR cstr1[32], cstr2[32], cstr3[32]; strcpy(cstr1, "abc"); strcpy(cstr2, "defcd"); strcpy(cstr3, "edggsefcd"); typedef db_map<int, TCHAR*, ElementHolder<TCHAR*> > strmap_t; strmap_t strmap(dmdb6, penv); strmap.clear(); strmap.insert(make_pair(1, cstr1)); strmap.insert(make_pair(2, cstr2)); strmap.insert(make_pair(3, cstr3)); cout<<"\n strings in strmap:\n"; for (strmap_t::const_iterator citr = strmap.begin(); citr != strmap.end(); citr++) cout<<(*citr).second<<'\t'; cout<<strmap[1]<<strmap[2]<<strmap[3]; TCHAR cstr4[32], cstr5[32], cstr6[32]; _tcscpy(cstr4, strmap[1]); _tcscpy(cstr5, strmap[2]); _tcscpy(cstr6, strmap[3]); _tprintf(_T("%s, %s, %s"), cstr4, cstr5, cstr6); strmap_t::value_type_wrap::second_type vts = strmap[1]; using_charstr(vts); vts._DB_STL_StoreElement(); _tcscpy(cstr4, _T("hello world")); vts = cstr4; vts._DB_STL_StoreElement(); cout<<"\n\nstrmap[1]: "<<strmap[1]; check_expr(_tcscmp(strmap[1], cstr4) == 0); vts[0] = _T('H');// it is wrong to do it this way vts._DB_STL_StoreElement(); check_expr(_tcscmp(strmap[1], _T("Hello world")) == 0); TCHAR *strbase = vts._DB_STL_value(); strbase[6] = _T('W'); vts._DB_STL_StoreElement(); check_expr(_tcscmp(strmap[1], _T("Hello World")) == 0); strmap.clear(); typedef db_map<const char *, const char *, ElementHolder<const char *> > cstrpairs_t; cstrpairs_t strpairs(dmdb6, penv); strpairs["abc"] = "def"; strpairs["ghi"] = "jkl"; strpairs["mno"] = "pqrs"; strpairs["tuv"] = "wxyz"; cstrpairs_t::const_iterator ciitr; cstrpairs_t::iterator iitr; for (ciitr = strpairs.begin(), iitr = strpairs.begin(); iitr != strpairs.end(); ++iitr, ++ciitr) { cout<<"\n"<<iitr->first<<"\t"<<iitr->second; cout<<"\n"<<ciitr->first<<"\t"<<ciitr->second; check_expr(strcmp(ciitr->first, iitr->first) == 0 && strcmp(ciitr->second, iitr->second) == 0); } typedef db_map<char *, char *, ElementHolder<char *> > strpairs_t; typedef std::map<string, string> sstrpairs_t; sstrpairs_t sstrpairs2; strpairs_t strpairs2; rand_str_dbt randstr; for (i = 0; i < 100; i++) { string rdstr, rdstr2; randstr(dbt, rdstr); randstr(dbt, rdstr2); strpairs2[(char *)rdstr.c_str()] = (char *)rdstr2.c_str(); sstrpairs2[rdstr] = rdstr2; } strpairs_t::iterator itr; strpairs_t::const_iterator citr; for (itr = strpairs2.begin(); itr != strpairs2.end(); ++itr) { check_expr(strcmp(strpairs2[itr->first], itr->second) == 0); check_expr(string(itr->second) == sstrpairs2[string(itr->first)]); strpairs_t::value_type_wrap::second_type&secref = itr->second; std::reverse((char *)secref, (char *)secref + strlen(secref)); secref._DB_STL_StoreElement(); std::reverse(sstrpairs2[itr->first].begin(), sstrpairs2[itr->first].end()); } check_expr(strpairs2.size() == sstrpairs2.size()); for (citr = strpairs2.begin( ReadModifyWriteOption::no_read_modify_write(), true, BulkRetrievalOption::bulk_retrieval()); citr != strpairs2.end(); ++citr) { check_expr(strcmp(strpairs2[citr->first], citr->second) == 0); check_expr(string(citr->second) == sstrpairs2[string(citr->first)]); } if (explicit_txn) dbstl::commit_txn(penv); db_vector<const char *, ElementHolder<const char *> > csvct(10); vector<const char *> scsvct(10); const char *pconststr = "abc"; for (i = 0; i < 10; i++) { scsvct[i] = pconststr; csvct[i] = pconststr; csvct[i] = scsvct[i]; // scsvct[i] = csvct[i]; assignment won't work because scsvct // only stores pointer but do not copy the sequence, thus it // will refer to an invalid pointer when i changes. } for (i = 0; i < 10; i++) { check_expr(strcmp(csvct[i], scsvct[i]) == 0); cout<<endl<<(const char *)(csvct[i]); } db_vector<const wchar_t *, ElementHolder<const wchar_t *> > wcsvct(10); vector<const wchar_t *> wscsvct(10); const wchar_t *pconstwstr = L"abc"; for (i = 0; i < 10; i++) { wscsvct[i] = pconstwstr; wcsvct[i] = pconstwstr; wcsvct[i] = wscsvct[i]; // scsvct[i] = csvct[i]; assignment won't work because scsvct // only stores pointer but do not copy the sequence, thus it // will refer to an invalid pointer when i changes. } for (i = 0; i < 10; i++) { check_expr(wcscmp(wcsvct[i], wscsvct[i]) == 0); } } // char_star_string_storage
TEST_P_EX(LARGE_TEST, Random) { test(randstr(GetParam())); }
int main (int argc, char const* argv[]){ StudentTicket * st = new StudentTicket; char buffer[50]; /* string University; string Part; long long Id; int IssueDateYear; int IssueDateMonth; int IssueDateDay; int ExpirationDateYear; int ExpirationDateMonth; int ExpirationDateDay; string SurName; string Name; string FatherName; string Faculty; string StructuredUnit; string StudyType; string Specialization; string Group; int EntranceYear; string RectorCredentials;*/ for (int i = 5; i < 200; ++i){ st->setUniversity(randstr(5, 20, 'a', 'z')); st->setPart(randstr(5, 20, 'a', 'z')); st->setId(randint(100000000, 100010000)); st->setIssueDateYear(randint(2000, 2011)); st->setIssueDateMonth(randint(1, 12)); st->setIssueDateDay(randint(1, 28)); st->setExpirationDateYear(randint(st->getIssueDateYear() + 4, st->getIssueDateYear() + 7)); st->setExpirationDateMonth(randint(1, 12)); st->setExpirationDateDay(randint(1, 28)); st->setSurName(randstr(5, 20, 'a', 'z')); st->setName(randstr(5, 20, 'a', 'z')); st->setFatherName(randstr(5, 20, 'a', 'z')); st->setFaculty(randstr(5, 20, 'a', 'z')); st->setStructuredUnit(randstr(5, 20, 'a', 'z')); st->setStudyType(randstr(5, 20, 'a', 'z')); st->setSpecialization(randstr(5, 20, 'a', 'z')); st->setGroup(randstr(5, 20, 'a', 'z')); st->setEntranceYear(st->getIssueDateYear()); st->setRectorCredentials(randstr(5, 20, 'a', 'z')); sprintf(buffer, "./test/tests/test%d.test", i); freopen(buffer, "w", stdout); printf("%s %lld\n", st->getPart().c_str(), st->getId()); sprintf(buffer, "./data/%s_%lld", st->getPart().c_str(), st->getId()); freopen(buffer, "w", stdout); printf("%s\n", st->getUniversity().c_str()); printf("%s\n", st->getPart().c_str()); printf("%lld\n", st->getId()); printf("%d\n", st->getIssueDateYear()); printf("%d\n", st->getIssueDateMonth()); printf("%d\n", st->getIssueDateDay()); printf("%d\n", st->getExpirationDateYear()); printf("%d\n", st->getExpirationDateMonth()); printf("%d\n", st->getExpirationDateDay()); printf("%s\n", st->getSurName().c_str()); printf("%s\n", st->getName().c_str()); printf("%s\n", st->getFatherName().c_str()); printf("%s\n", st->getFaculty().c_str()); printf("%s\n", st->getStructuredUnit().c_str()); printf("%s\n", st->getStudyType().c_str()); printf("%s\n", st->getSpecialization().c_str()); printf("%s\n", st->getGroup().c_str()); printf("%d\n", st->getEntranceYear()); printf("%s\n", st->getRectorCredentials().c_str()); printf("%s\n", "0"); printf("%s\n", "0"); } for (int i = 201; i < 250; ++i){ st->setPart(randstr(5, 20, 'a', 'z')); st->setId(randint(100000000, 100010000)); sprintf(buffer, "./test/tests/test%d.test", i); freopen(buffer, "w", stdout); printf("%s %lld\n", st->getPart().c_str(), st->getId()); sprintf(buffer, "./data/%s_%lld", st->getPart().c_str(), st->getId()); } return 0; }