반응형 분류 전체보기156 [windows] vscode에서 ctrl + / (주석)이 동작하지 않을 때 = 요약 = 한컴 입력기가 선택되어 있는 경우 ctrl + / (주석)이 동작하지 않는다. Microsoft 입력기를 선택하자 (쉽게 변경하는 단축키는 ctrl + shift) 이게 안되는 컴퓨터라면...잘 생각해보면 한글이 깔려 있을 것이다. 주석이 정상 동작 하지 않는 경우라면 아래처럼 되어 있지 않나 확인 한번 해보자 입력기를 아래처럼 바꾸자 2022. 2. 13. fifo cache의 변형 fifo 정책을 따르긴하지만 쫓겨나는 item을 알고 이후 처리가 필요하여 구현 key-value이긴하지만 key가 2개여서 pair로 묶음 Push()에 의해 쫓겨나는 item은 return됨 #include #include #include #include #include #include #include "gtest/gtest.h" using namespace std; struct PairHash { template std::size_t operator () (const std::pair &p) const { return std::hash{}(p.first) ^ std::hash{}(p.second); } }; template class FifoCache { public: explicit FifoCac.. 2022. 2. 1. ubuntu에 google test (gtest) 설치 후 간단히 test 먼저 소스 설치 sudo apt install libgtest-dev 혹시 cmake가 설치 되어 있지 않다면 cmake도 설치 sudo apt install cmake gtest 설치 cd /usr/src/gtest sudo mkdir build cd build sudo cmake .. sudo make sudo make install 간단한 code #include #include "gtest/gtest.h" using namespace std; TEST(test_name, test) { // test code } 간단히 build g++ test.cpp -lgtest -lgtest_main -lpthread 2022. 2. 1. boost를 이용한 crc 계산 ubuntu에 boost library 설치하기 sudo apt install libboost-all-dev #include #include #include #include using namespace std; using boost::crc_32_type; int main() { char testStr1[] = "12345678901234567890"; char testStr2[] = "12345678901234567891"; crc_32_type crc; printf("crc size: %d\n", sizeof(unsigned int)); crc.process_bytes(testStr1, sizeof(testStr1)); printf("testStr1 crc: %08x\n", crc.checksum().. 2022. 1. 31. 이전 1 2 3 4 5 6 7 ··· 39 다음 반응형