text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: benchmark/0016.endl/ofstream_endl.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_legacy.h>
#include<fast_io_driver/timer.h>
int main()
{
fast_io::timer tm(u8"ofstream_endl");
fast_io::filebuf_file fbf(u8"ofstream_endl.txt",fast_io::open_mode::out);
std::ostream fout(fbf.fb);
//PLEASE N... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "benchmark/0016.endl/ofstream_endl.cc", "license": "mit", "size": 481} |
### File: benchmark/0016.endl/u8c_file_unlocked.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_legacy.h>
#include<fast_io_driver/timer.h>
using namespace fast_io::io;
int main()
{
fast_io::timer tm(u8"u8c_file_unlocked");
fast_io::u8c_file_unlocked cf(u8"filebuf_file.txt",fast_io::open_mode::out)... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "benchmark/0016.endl/u8c_file_unlocked.cc", "license": "mit", "size": 343} |
### File: benchmark/0016.endl/u8native_file.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/timer.h>
using namespace fast_io::io;
int main()
{
fast_io::timer tm(u8"u8obuf_file");
fast_io::u8native_file nf(u8"u8native_file.txt",fast_io::open_mode::out);
// native_file does not hold a buffer ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "benchmark/0016.endl/u8native_file.cc", "license": "mit", "size": 563} |
### File: benchmark/0016.endl/u8obuf_file.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/timer.h>
using namespace fast_io::io;
int main()
{
fast_io::timer tm(u8"u8obuf_file");
fast_io::u8obuf_file obf(u8"u8obuf_file.txt");
for(std::size_t i{};i!=10000000;++i)
print(obf,u8"Hello World\n"... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "benchmark/0016.endl/u8obuf_file.cc", "license": "mit", "size": 280} |
### File: examples/0000.compile/compile.cc
#include<fast_io.h>
int main(){}
/*
g++ -o compile compile.cc -Ofast -std=c++20 -s -flto -march=native -I../../include
*/ | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0000.compile/compile.cc", "license": "mit", "size": 126} |
### File: examples/0000.compile/compile_hosted.cc
#include<fast_io_hosted.h>
int main(){}
/*
g++ -o compile_hosted compile_hosted.cc -Ofast -std=c++20 -s -flto -march=native -I../../include
*/
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0000.compile/compile_hosted.cc", "license": "mit", "size": 148} |
### File: examples/0001.helloworld/helloworld.cc
#include<fast_io.h>
// Basic functions like print and scan are in namespace fast_io::io
// The namespace is introduced to avoid conflict with std::print
// It's encouraged to directly be 'using'
using namespace fast_io::io;
int main()
{
print("Hello World\n");
}
/*
T... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld.cc", "license": "mit", "size": 307} |
### File: examples/0001.helloworld/helloworld_android_remote_dbg.cc
#include<fast_io.h>
#include<android/log.h>
using namespace fast_io::io;
int main()
{
print(fast_io::dbg(ANDROID_LOG_FATAL,"fast_io"),
std::source_location::current(),"\n",
utc(fast_io::posix_clock_gettime(fast_io::posix_clock_id::realtime)),"\... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld_android_remote_dbg.cc", "license": "mit", "size": 386} |
### File: examples/0001.helloworld/helloworld_box.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
print(fast_io::box(),"Hello World\n");
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld_box.cc", "license": "mit", "size": 109} |
### File: examples/0001.helloworld/helloworld_dbg.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
print(fast_io::dbg(),"Hello World remote debugger from fast_io\n");//it will use remote debugger if you have one.
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld_dbg.cc", "license": "mit", "size": 184} |
### File: examples/0001.helloworld/helloworld_out.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
print(fast_io::out(),"Hello World\n");
}
/*
This outputs to file descriptor 1 on non-windows systems. STDOUT_HANDLE on windows or Wine or ReactOS.
*/ | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld_out.cc", "license": "mit", "size": 217} |
### File: examples/0001.helloworld/helloworld_out_buf_mutex.cc
#include<fast_io.h>
using namespace fast_io::io;
fast_io::out_buf_type_mutex globalstdout{fast_io::out()};
int main()
{
print(globalstdout,"Hello World\n");
}
/*
This creates a global object that can avoid CRT. but being thread-safe and full buffer.
*/ | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0001.helloworld/helloworld_out_buf_mutex.cc", "license": "mit", "size": 259} |
### File: examples/0002.a+b/a+b.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
std::size_t a,b;
scan(a,b);
println(a+b);
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0002.a+b/a+b.cc", "license": "mit", "size": 114} |
### File: examples/0002.a+b/base36_a+b.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
std::size_t a,b;
scan(base_get<36>(a),base_get<36>(b));
println(base<36>(a+b));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0002.a+b/base36_a+b.cc", "license": "mit", "size": 183} |
### File: examples/0002.a+b/hex_a+b.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
std::size_t a,b;
scan(hex_get(a),hex_get(b));
println(hex(a+b)," ",hexupper(a+b));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0002.a+b/hex_a+b.cc", "license": "mit", "size": 186} |
### File: examples/0003.manipulators/0x2a.cc
#include<string>
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
println(
fast_io::concatln(middle(hex<true>(42),8,'-'),"\t",addrvw(42)),
middle(hex<true>(42),8,'-'),"\t",addrvw(42));
}
/*
D:\hg\fast_io\examples\0003.manipu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/0x2a.cc", "license": "mit", "size": 1201} |
### File: examples/0003.manipulators/0x2a_0x.cc
#include<string>
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
println(
fast_io::concatln(middle(hex0x(42),8,'-'),"\t",addrvw(42)),
middle(hex0xupper(42),8,'-'),"\t",addrvw(42),"\n",
middle(base<36,true>(42),11,'-'));
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/0x2a_0x.cc", "license": "mit", "size": 1274} |
### File: examples/0003.manipulators/0x2a_0x_imbue.cc
#include<fast_io.h>
#include<fast_io_i18n.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
fast_io::native_l10n loc(u8"");
println(imbue(loc,fast_io::c_stdout()),
middle(hex0x(420000U),11,'-'),"\t",addrvw(420000U),"\n",
middle(hex0x... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/0x2a_0x_imbue.cc", "license": "mit", "size": 1466} |
### File: examples/0003.manipulators/0x2a_0x_imbue_for_fout.cc
#include<fast_io.h>
#include<fast_io_i18n.h>
#include<fast_io_legacy.h>
#include<fstream>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
fast_io::native_l10n loc(u8"");
std::ofstream fout("ofstream.txt");
fast_io::filebuf_io_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/0x2a_0x_imbue_for_fout.cc", "license": "mit", "size": 1601} |
### File: examples/0003.manipulators/0x2a_custom.cc
#include<string>
#include<fast_io.h>
namespace fast_io::manipulators
{
/*
fast_io::manipulators allow user to add their custom manipulators
*/
template<typename T>
inline constexpr auto hex_middle_8(T const &t)
{
return middle(hex<true>(t),8,'-');
}
}
using name... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/0x2a_custom.cc", "license": "mit", "size": 1433} |
### File: examples/0003.manipulators/boolalpha.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
println(true," ",boolalpha(true));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/boolalpha.cc", "license": "mit", "size": 136} |
### File: examples/0003.manipulators/chvw.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
println('a'," ",chvw('a'));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/chvw.cc", "license": "mit", "size": 129} |
### File: examples/0003.manipulators/cond.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
println(fast_io::mnp::cond(true,"hello","world"),"\n",
fast_io::mnp::cond(false,"hello","world"));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/cond.cc", "license": "mit", "size": 171} |
### File: examples/0003.manipulators/os_c_str.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
constexpr char const* ptr{"Hello\0World\n"};
println("Hello\0World\n",
ptr,"\n",
os_c_str(ptr),"\n",
os_c_str(ptr,4),"\n",
os_c_str(ptr,10));
}
/*
$ g++ -v
Using bui... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/os_c_str.cc", "license": "mit", "size": 975} |
### File: examples/0003.manipulators/pointer.cc
#include<fast_io.h>
#include<memory>
class dummy_class
{
public:
void dummy_method() noexcept{}
};
struct A
{
virtual void f() noexcept {}
};
struct B
{
virtual void g() noexcept {}
};
struct C : A, B {};
using namespace fast_io::io;
int main()
{
using namespace ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/pointer.cc", "license": "mit", "size": 1294} |
### File: examples/0003.manipulators/rgvw.cc
#include <string>
#include <string_view>
#include <deque>
#include <set>
#include <unordered_set>
#include <fast_io.h>
#include <fast_io_dsal/vector.h>
int main()
{
using namespace fast_io::io;
using namespace fast_io::mnp;
using namespace std::literals;
fast_io::vecto... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/rgvw.cc", "license": "mit", "size": 515} |
### File: examples/0003.manipulators/width.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
println(left("hello",20));
println(middle("hello",20));
println(right("hello",20));
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/width.cc", "license": "mit", "size": 187} |
### File: examples/0003.manipulators/width_runtime.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
using namespace fast_io::mnp;
scalar_placement place1 = scalar_placement::left;
scalar_placement place2 = scalar_placement::middle;
scalar_placement place3 = scalar_placement::right;
scalar_plac... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0003.manipulators/width_runtime.cc", "license": "mit", "size": 761} |
### File: examples/0004.time/posix_clock_gettime.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
fast_io::posix_tzset();
fast_io::unix_timestamp tsp{fast_io::posix_clock_gettime(fast_io::posix_clock_id::realtime)};
println("Unix Timestamp:",tsp,"\n"
"utc:",utc(tsp),"\n"
"local:",local(tsp),"\... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0004.time/posix_clock_gettime.cc", "license": "mit", "size": 316} |
### File: examples/0004.time/timezone.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
println(fast_io::native_local_timezone{}());
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0004.time/timezone.cc", "license": "mit", "size": 111} |
### File: examples/0005.sha/compile_time.cc
#include<array>
#include<string_view>
#include<fast_io.h>
#include<fast_io_crypto.h>
constexpr auto evaluate_sha512() noexcept
{
using fast_io::mnp::hash_digest;
std::array<char8_t,print_reserve_size(fast_io::io_reserve_type<char8_t,decltype(hash_digest(fast_io::sha512_co... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/compile_time.cc", "license": "mit", "size": 2245} |
### File: examples/0005.sha/crc32.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_crypto.h>
/*
This is just for demo purpose. You should avoid crc32 families in general because it is not even a crypto hash function.
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/crc32.cc", "license": "mit", "size": 798} |
### File: examples/0005.sha/cryptopp_md5.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/cryptopp_driver.h>
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include<cryptopp/md5.h>
/*
This is just for demo purpose. You should avoid md5 in general because it is insecure.
Need to install CryptoPP fir... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/cryptopp_md5.cc", "license": "mit", "size": 918} |
### File: examples/0005.sha/cryptopp_sha256.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/cryptopp_driver.h>
#include<cryptopp/sha.h>
/*
Need to install CryptoPP first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(arg... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/cryptopp_sha256.cc", "license": "mit", "size": 787} |
### File: examples/0005.sha/cryptopp_sha512.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/cryptopp_driver.h>
#include<cryptopp/sha.h>
/*
Need to install CryptoPP first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(arg... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/cryptopp_sha512.cc", "license": "mit", "size": 787} |
### File: examples/0005.sha/md5.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_crypto.h>
/*
This is just for demo purpose. You should avoid md5 in general because it is insecure.
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/md5.cc", "license": "mit", "size": 758} |
### File: examples/0005.sha/native_hash_file.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_hosted_crypto.h>
using namespace fast_io::io;
int main(int argc,char** argv)
try
{
using namespace fast_io::mnp;
if(argc!=3)
{
if(argv==0)
{
return 1;
}
perr("Usage: ",os_c_str(*argv)," <hash... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/native_hash_file.cc", "license": "mit", "size": 838} |
### File: examples/0005.sha/ossl_evp.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_hosted_crypto.h>
using namespace fast_io::io;
int main(int argc,char** argv)
try
{
using namespace fast_io::mnp;
if(argc!=3)
{
if(argv==0)
{
return 1;
}
perr("Usage: ",os_c_str(*argv)," <hash algorit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/ossl_evp.cc", "license": "mit", "size": 840} |
### File: examples/0005.sha/ossl_md5.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/openssl_driver.h>
/*
This is just for demo purpose. You should avoid md5 in general because it is insecure.
Need to install OpenSSL first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/ossl_md5.cc", "license": "mit", "size": 815} |
### File: examples/0005.sha/ossl_sha1.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/openssl_driver.h>
/*
This is just for demo purpose. You should avoid sha1 in general because it is insecure.
Need to install OpenSSL first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/ossl_sha1.cc", "license": "mit", "size": 817} |
### File: examples/0005.sha/ossl_sha256.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/openssl_driver.h>
/*
Need to install OpenSSL first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(argc==0)
{
return 1;
}
pe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/ossl_sha256.cc", "license": "mit", "size": 731} |
### File: examples/0005.sha/ossl_sha512.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_driver/openssl_driver.h>
/*
Need to install OpenSSL first
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(argc==0)
{
return 1;
}
pe... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/ossl_sha512.cc", "license": "mit", "size": 731} |
### File: examples/0005.sha/sha1.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_crypto.h>
/*
This is just for demo purpose. You should avoid sha1 in general because it is insecure.
fast_io's own implementation. No need to install anything.
Probably need -march=native to enable sha intrinsics
*/
u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/sha1.cc", "license": "mit", "size": 876} |
### File: examples/0005.sha/sha256.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_crypto.h>
/*
fast_io's own implementation. No need to install anything.
Probably need -march=native to enable sha intrinsics
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/sha256.cc", "license": "mit", "size": 790} |
### File: examples/0005.sha/sha512.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<fast_io_crypto.h>
/*
fast_io's own implementation. No need to install anything.
*/
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc!=2)
{
if(argc==0)
{
return 1;... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0005.sha/sha512.cc", "license": "mit", "size": 739} |
### File: examples/0006.file_io/count_all_spaces_in_file.cc
#include<algorithm>
#include<fast_io.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc!=2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",fast_io::mnp::os_c_str(*argv)," <file>\n");
return 1;
}
fast_io::native_file_loader ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0006.file_io/count_all_spaces_in_file.cc", "license": "mit", "size": 425} |
### File: examples/0006.file_io/file_loader.cc
#include<fast_io.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc!=2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",fast_io::mnp::os_c_str(*argv)," <file>\n");
return 1;
}
fast_io::native_file_loader loader(::fast_io::mnp::os_c_str(... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0006.file_io/file_loader.cc", "license": "mit", "size": 498} |
### File: examples/0006.file_io/file_loader_extra.cc
#include<fast_io.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc!=2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",fast_io::mnp::os_c_str(*argv)," <file>\n");
return 1;
}
//fill 100 zero bytes after the end of the file. Some l... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0006.file_io/file_loader_extra.cc", "license": "mit", "size": 665} |
### File: examples/0006.file_io/ibuf_file.cc
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc!=2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",fast_io::mnp::os_c_str(*argv)," <file>\n");
return 1;
}
fast_io::ibuf_file ibf(fast_io::mnp... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0006.file_io/ibuf_file.cc", "license": "mit", "size": 373} |
### File: examples/0006.file_io/utf8_to_utf16.cc
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
#ifdef __cpp_exceptions
try
#endif
{
using namespace fast_io::mnp;
if(argc!=3)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",os_c_str(*argv)," <input ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0006.file_io/utf8_to_utf16.cc", "license": "mit", "size": 964} |
### File: examples/0007.legacy/c_file.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
fast_io::c_file cfl("c_file.txt",fast_io::open_mode::out);
/*
c_file will construct a FILE* directly through syscalls.
*/
print(cfl,"Hello World from fast_io::c_file\n");
/*
Just for demo purpose
This is dangerou... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/c_file.cc", "license": "mit", "size": 445} |
### File: examples/0007.legacy/construct_fp_from_syscall.cc
#include<fast_io_legacy.h>
using namespace fast_io::io;
int main()
{
/*
This is an example to explain how fast_io's files work with each other, and how you could use fast_io with existing FILE* or fstream apis
*/
#if (defined(_WIN32)&&!defined(__WINE__)) &&... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/construct_fp_from_syscall.cc", "license": "mit", "size": 2647} |
### File: examples/0007.legacy/construct_fstream_from_syscall.cc
#include<fast_io_legacy.h>
#include<fstream>
using namespace fast_io::io;
int main()
{
/*
This is an example to explain how fast_io's files work with each other, and how you could use fast_io with existing FILE* or fstream apis
*/
#if (defined(_WIN32) ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/construct_fstream_from_syscall.cc", "license": "mit", "size": 3876} |
### File: examples/0007.legacy/construct_fstream_from_syscall_l10n.cc
#include<fast_io_legacy.h>
#include<fstream>
#include<fast_io_i18n.h>
using namespace fast_io::io;
int main()
{
/*
This is an example to explain how fast_io's files work with each other, and how you could use fast_io with existing FILE* or fstream... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/construct_fstream_from_syscall_l10n.cc", "license": "mit", "size": 4607} |
### File: examples/0007.legacy/filebuf_file.cc
#include<fast_io_legacy.h>
using namespace fast_io::io;
int main()
{
fast_io::filebuf_file fbf("filebuf_file.txt",fast_io::open_mode::out);
/*
filebuf_file will construct a std::filebuf directly through syscalls.
*/
std::ofstream fout;
*fout.rdbuf()=std::move(*fbf.fb... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/filebuf_file.cc", "license": "mit", "size": 568} |
### File: examples/0007.legacy/filebuf_file_ostream.cc
#include<fast_io_legacy.h>
using namespace fast_io::io;
int main()
{
fast_io::filebuf_file fbf(u8"filebuf_file_ostream.txt",fast_io::open_mode::out);
/*
filebuf_file will construct a std::filebuf directly through syscalls.
*/
std::ostream fout(fbf.fb); //make ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/filebuf_file_ostream.cc", "license": "mit", "size": 418} |
### File: examples/0007.legacy/get_file_descriptor_from_std_cout.cc
#include<iostream>
#include<fast_io_legacy.h>
/*
C++ iostream is a holy crap. You cannot access FILE* inside std::cout because of the OO garbage.
See an old blog: https://www.ginac.de/~kreckel/fileno/
Also see wiki in fast_io to understand how C++ s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/get_file_descriptor_from_std_cout.cc", "license": "mit", "size": 1873} |
### File: examples/0007.legacy/text.cc
#include<fast_io.h>
using namespace fast_io::io;
int main()
{
/*
Usually, at OS native API level, things like file stream are not implemented.
Microsoft DOS implements LF->CRLF at FILE* level.
Windows implement LF->CRLF at file descriptor level, but not on Win32 or NT level. It... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0007.legacy/text.cc", "license": "mit", "size": 2259} |
### File: examples/0008.openssl/bio.cc
#include<fast_io.h>
#include<fast_io_driver/openssl_driver.h>
using namespace fast_io::io;
int main()
{
fast_io::bio_file bf("bio.txt",fast_io::open_mode::out);
print(bf,"Hello World to bio from fast_io\n");
BIO_printf(bf.bio,"hello %s\n","world from openssl bio");
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0008.openssl/bio.cc", "license": "mit", "size": 275} |
### File: examples/0008.openssl/construct_bio_from_syscall.cc
#include<fast_io.h>
#include<fast_io_driver/openssl_driver.h>
using namespace fast_io::io;
int main()
{
/*
This is an example to explain how fast_io's files work with each other, and how you could use fast_io with existing FILE* or fstream apis
*/
#if (de... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0008.openssl/construct_bio_from_syscall.cc", "license": "mit", "size": 2656} |
### File: examples/0009.filesystem/add_utf8_bom_to_all_cplusplus_files.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<string_view>
#include<array>
#include<algorithm>
#include<cstring>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/add_utf8_bom_to_all_cplusplus_files.cc", "license": "mit", "size": 968} |
### File: examples/0009.filesystem/binary_to_text.cc
#include<fast_io_device.h>
#include<fast_io.h>
#include<string_view>
using namespace fast_io::io;
int main(int argc,char const** argv)
try
{
if(argc<3)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",fast_io::mnp::os_c_str(*argv)," <source directory> <dest... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/binary_to_text.cc", "license": "mit", "size": 844} |
### File: examples/0009.filesystem/count_lines_in_cpp_files.cc
#include<string_view>
#include<fast_io.h>
#include<fast_io_device.h>
#include<algorithm>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",::fast_io::mnp::os_c_str(*argv)," <d... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/count_lines_in_cpp_files.cc", "license": "mit", "size": 797} |
### File: examples/0009.filesystem/count_rust_files.cc
#include<string_view>
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",::fast_io::mnp::os_c_str(*argv)," <dir>\n");
return 1;
}
usi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/count_rust_files.cc", "license": "mit", "size": 1732} |
### File: examples/0009.filesystem/gcc_symlink_install.cc
#include<string>
#include<fast_io.h>
#include<fast_io_device.h>
#include<string_view>
#include<vector>
#include<algorithm>
#include<ranges>
using namespace fast_io::io;
int main(int argc,char const** argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/gcc_symlink_install.cc", "license": "mit", "size": 1458} |
### File: examples/0009.filesystem/gccx86canadianfix.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<string_view>
#include<algorithm>
#include<functional>
using namespace fast_io::io;
int main(int argc,char **argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage:",fast_io::mnp::os_c_str(... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/gccx86canadianfix.cc", "license": "mit", "size": 3631} |
### File: examples/0009.filesystem/rename_all_files_uppercase_to_lowercase.cc
#include<string>
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",::fast_io::mnp::os_c_str(*argv)," <directory>\n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/rename_all_files_uppercase_to_lowercase.cc", "license": "mit", "size": 840} |
### File: examples/0009.filesystem/text_to_binary.cc
#include<fast_io_device.h>
#include<fast_io.h>
#include<string_view>
using namespace fast_io::io;
int main(int argc,char const** argv)
try
{
if(argc<3)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",::fast_io::mnp::os_c_str(*argv)," <source directory> <de... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/text_to_binary.cc", "license": "mit", "size": 801} |
### File: examples/0009.filesystem/update_wow_toc.cc
#include<string_view>
#include<fast_io.h>
#include<fast_io_device.h>
#include<algorithm>
#include<functional>
using namespace fast_io::io;
int main(int argc, char **argv)
{
using namespace ::fast_io::mnp;
if(argc<3)
{
if(argc==0)
{
return 1;
}
perr("U... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0009.filesystem/update_wow_toc.cc", "license": "mit", "size": 1342} |
### File: examples/0010.status/status.cc
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main()
{
fast_io::obuf_file obf("a.txt");
println(status(obf.handle));
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0010.status/status.cc", "license": "mit", "size": 159} |
### File: examples/0011.qt/construct_qtextstream_from_syscall.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
#include<QtCore/QTextStream>
using namespace fast_io::io;
int main()
{
/*
This is an example to explain how fast_io's files work with each other, and how you could use fast_io with existing FILE* or fst... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/construct_qtextstream_from_syscall.cc", "license": "mit", "size": 2729} |
### File: examples/0011.qt/qfile.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
using namespace fast_io::io;
int main()
{
fast_io::qt_file file("a.txt",fast_io::open_mode::out);
print(file,"Hello World",20," die\n");
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/qfile.cc", "license": "mit", "size": 196} |
### File: examples/0011.qt/qstring.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
using namespace fast_io::io;
int main()
{
QString qstr="Hello QString\n";
print(qstr);
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/qstring.cc", "license": "mit", "size": 145} |
### File: examples/0011.qt/qstring_concat.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
using namespace fast_io::io;
int main()
{
QString qstr=fast_io::u16concat_qt_qstring(u"Hello QString\n",24.43624362634,u"124124");
print(qstr);
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/qstring_concat.cc", "license": "mit", "size": 202} |
### File: examples/0011.qt/qstring_get.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
using namespace fast_io::io;
int main()
{
QString qstr;
scan(fast_io::mnp::strlike_get(qstr));
println(qstr);
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/qstring_get.cc", "license": "mit", "size": 167} |
### File: examples/0011.qt/qvariant.cc
#include<fast_io.h>
#include<fast_io_driver/qt.h>
#include<QtCore/QVariant>
using namespace fast_io::io;
int main()
{
QVariant var=4.503;
println("var:",var);
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0011.qt/qvariant.cc", "license": "mit", "size": 167} |
### File: examples/0012.transmit/transmit.cc
#include<cstdio>
#include<fast_io.h>
int main()
{
transmit(fast_io::c_stdout(),fast_io::c_stdin());
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0012.transmit/transmit.cc", "license": "mit", "size": 106} |
### File: examples/0013.graph/shortest_path/dijkstra.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<queue>
#include<vector>
struct node
{
std::size_t to,weight;
};
using namespace fast_io::io;
int main()
{
fast_io::ibuf_file ibf("graph.txt");
std::size_t m,n;
scan(ibf,m,n);
std::vector<std::vector<... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/shortest_path/dijkstra.cc", "license": "mit", "size": 1046} |
### File: examples/0013.graph/shortest_path/dijkstra_optimize.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<queue>
#include<vector>
struct node
{
std::size_t to,weight;
};
using namespace fast_io::io;
int main()
{
fast_io::ibuf_file ibf("graph.txt");
std::size_t m,n;
scan(ibf,m,n);
std::vector<std... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/shortest_path/dijkstra_optimize.cc", "license": "mit", "size": 1133} |
### File: examples/0013.graph/shortest_path/generate_graph.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
using namespace fast_io::io;
int main()
{
fast_io::u8obuf_file obf(u8"graph.txt");
constexpr std::size_t m{600000};
constexpr std::size_t n{50000};
println(obf,m,u8" ",n);
fast_io::ibuf_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/shortest_path/generate_graph.cc", "license": "mit", "size": 517} |
### File: examples/0013.graph/shortest_path/spfa.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<queue>
#include<vector>
struct node
{
std::size_t to,weight;
};
using namespace fast_io::io;
int main()
{
fast_io::ibuf_file ibf("graph.txt");
std::size_t m,n;
scan(ibf,m,n);
std::vector<std::vector<node... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/shortest_path/spfa.cc", "license": "mit", "size": 1014} |
### File: examples/0013.graph/shortest_path/spfa_optimize.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<queue>
#include<vector>
struct node
{
std::size_t to,weight;
};
using namespace fast_io::io;
int main()
{
fast_io::ibuf_file ibf("graph.txt");
std::size_t m,n;
scan(ibf,m,n);
std::vector<std::ve... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/shortest_path/spfa_optimize.cc", "license": "mit", "size": 1101} |
### File: examples/0013.graph/strongly_connected_component/gabow.cc
/*
Referenced from:
https://blog.csdn.net/pi9nc/article/details/11978989
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
struct gabow_ctx
{
std::vector<std::vector<std::size_t>> graph;
std::vector<std::size_t> order... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/gabow.cc", "license": "mit", "size": 1955} |
### File: examples/0013.graph/strongly_connected_component/gabow_non_recursive.cc
/*
Referenced from:
https://blog.csdn.net/pi9nc/article/details/11978989
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
/*
Recursive one will overflow the stack. We need to write non_recursive version... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/gabow_non_recursive.cc", "license": "mit", "size": 2592} |
### File: examples/0013.graph/strongly_connected_component/gabow_non_recursive_iterator.cc
/*
Referenced from:
https://blog.csdn.net/pi9nc/article/details/11978989
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
/*
Recursive one will overflow the stack. We need to write non_recursiv... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/gabow_non_recursive_iterator.cc", "license": "mit", "size": 263... |
### File: examples/0013.graph/strongly_connected_component/generate_graph.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
using namespace fast_io::io;
int main()
{
fast_io::u8obuf_file obf(u8"directed_graph.txt");
constexpr std::size_t m{600000};
constexpr std::size_t n{50000};
println(obf,m,u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/generate_graph.cc", "license": "mit", "size": 434} |
### File: examples/0013.graph/strongly_connected_component/tarjan.cc
/*
Referenced from:
https://www.cnblogs.com/Mr94Kevin/p/9651975.html
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
struct tarjan_ctx
{
std::vector<std::vector<std::size_t>> graph;
std::vector<std::size_t> dfn,low... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/tarjan.cc", "license": "mit", "size": 1969} |
### File: examples/0013.graph/strongly_connected_component/tarjan_non_recursive.cc
/*
Referenced from:
https://www.cnblogs.com/Mr94Kevin/p/9651975.html
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
struct tarjan_ctx
{
struct tarjan_dfs_stack_content
{
std::size_t from{};
std::si... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/tarjan_non_recursive.cc", "license": "mit", "size": 2564} |
### File: examples/0013.graph/strongly_connected_component/tarjan_non_recursive_iterator.cc
/*
Referenced from:
https://www.cnblogs.com/Mr94Kevin/p/9651975.html
*/
#include<fast_io.h>
#include<fast_io_device.h>
#include<vector>
#include<stack>
struct tarjan_ctx
{
struct tarjan_dfs_stack_content
{
std::size_t from{};... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/strongly_connected_component/tarjan_non_recursive_iterator.cc", "license": "mit", "size": 26... |
### File: examples/0013.graph/topological_sorting/generate_graph.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
using namespace fast_io::io;
int main()
{
fast_io::u8obuf_file obf(u8"directed_graph.txt");
constexpr std::size_t m{1000000};
constexpr std::size_t n{500000};
println(obf,m,u8" ",n)... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/topological_sorting/generate_graph.cc", "license": "mit", "size": 436} |
### File: examples/0013.graph/topological_sorting/topsort.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<queue>
using namespace fast_io::io;
int main()
{
fast_io::u8ibuf_file ibf(u8"directed_graph.txt");
std::size_t m,n;
scan(ibf,m,n);
std::vector<std::vector<std::size_t>> graph(n);
std::vector<std:... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0013.graph/topological_sorting/topsort.cc", "license": "mit", "size": 837} |
### File: examples/0014.random/generate_error_domain.cc
#include<fast_io.h>
#include<random>
using namespace fast_io::io;
int main()
{
fast_io::ibuf_white_hole_engine eng;
std::uniform_int_distribution<std::uint16_t> u16distr(0,UINT16_MAX);
std::uniform_int_distribution<std::uint32_t> u32distr(0,UINT32_MAX);
st... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/generate_error_domain.cc", "license": "mit", "size": 669} |
### File: examples/0014.random/kana.cc
#include<string>
#include<fast_io.h>
#include<random>
#include<array>
#include<string_view>
using namespace fast_io::io;
int main()
{
constexpr std::array hiragana{
u8"あ",u8"い",u8"う",u8"え",u8"お",
u8"か",u8"き",u8"く",u8"け",u8"こ",
u8"さ",u8"し",u8"す",u8"せ",u8"そ",
u8"た",u8"ち",u8"... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/kana.cc", "license": "mit", "size": 5540} |
### File: examples/0014.random/name.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
#include<fast_io_dsal/vector.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
std::size_t n{100};
if(1<argc)
{
n=fast_io::to<std::size_t>(fast_io::mnp::os_c_str(argv[1]));
}
fast_io::u8ibuf_f... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/name.cc", "license": "mit", "size": 923} |
### File: examples/0014.random/password.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
using namespace fast_io::io;
int main(int argc,char** argv)
{
std::size_t n{100};
if(1<argc)
{
n=fast_io::to<std::size_t>(fast_io::mnp::os_c_str(argv[1]));
}
fast_io::u8obuf_file obf(u"password.txt");
f... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/password.cc", "license": "mit", "size": 715} |
### File: examples/0014.random/pin.cc
#include<fast_io.h>
#include<fast_io_device.h>
#include<random>
using namespace fast_io::io;
int main(int argc,char** argv)
{
std::size_t n{100};
if(1<argc)
{
n=fast_io::to<std::size_t>(fast_io::mnp::os_c_str(argv[1]));
}
fast_io::u8obuf_file obf(u"pin.txt");
fast_io::ib... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/pin.cc", "license": "mit", "size": 555} |
### File: examples/0014.random/sexratio.cc
#include<random>
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",os_c_str(*argv)," N\n");
return 1;
}
constexpr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/sexratio.cc", "license": "mit", "size": 1350} |
### File: examples/0014.random/sexratio_with_artificial_womb.cc
#include<random>
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc<2)
{
if(argc==0)
{
return 1;
}
perr("Usage: ",os_c_str(*argv)," N\n");
re... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/sexratio_with_artificial_womb.cc", "license": "mit", "size": 1722} |
### File: examples/0014.random/stop_born_child_until_boy.cc
//This is an emulation on how many times you can keep born a child to be a boy without abortion.
#include<random>
#include<fast_io.h>
#include<map>
using namespace fast_io::io;
int main(int argc,char** argv)
{
using namespace fast_io::mnp;
if(argc<2)
{
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0014.random/stop_born_child_until_boy.cc", "license": "mit", "size": 1359} |
### File: examples/0015.match/ipv4.cc
#include<fast_io.h>
#include<fast_io_device.h>
using namespace fast_io::io;
int main()
{
char8_t a,b,c,d;
scan(a,".",b,".",c,".",d);
println(a,".",b,".",c,".",d);
} | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "vincent_personan/fast_io", "path": "examples/0015.match/ipv4.cc", "license": "mit", "size": 172} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.