본문 바로가기

개발 및 운영/프로그래밍31

[C++11] std::bind 로 unique_ptr 넘기기 될줄 알았죠? 안돼요...ㅠㅠ 이 글을 보면 해결책이 있을줄 알았죠? 없어요...^^ 최소한 C++ 자체 라이브러리 안에서는....ㅠㅠ 아래와 같이 따로 만들면은 됩니다! #include #include #include #include class Caller { public: virtual void run() = 0; }; template class Binder : public Caller { protected: F f_; std::size_t args_count_ = std::tuple_size::value; Tuple tuple_; public: Binder(F f, Tuple&& tuple) : f_(f), tuple_(std::move(tuple)) { std::cout 2019. 9. 4.
std::function 복사는 비싸다! 테스트코드 #include #include #include #include std::function temp_s; std::unique_ptr temp_u; void test_1() { for(int i=0; i 2019. 9. 4.
Ramdisk 활용법 (gradle, spring-boot, visual studio) 그냥 오늘 개발하면서.. spring-boot프로젝트 한번 켜고 테스트하는데 파일몇개 안되는 프로젝트인데도 40초(빌드제외)가 걸려서.. 너무 답답해서 속도를 올리기 위한 삽질을 좀 해봤습니다. 1. .gradle디렉터리를 램디스크 바꿈. https://jsty.tistory.com/180 위는 제 블로그인데요 여기서 소개한 램디스크를 썼습니다. 램디스크 생성하고 꺼질 때 자동저장되게 해서 10GB의 용량을 잡아주었습니다. (덕분에 컴퓨터끄는시간이 3분정도 더 걸립니다...ㄷㄷ) 그리고 Users/name/.gradle 파일을 복사하고 정션으로 링크해주었습니다. (오우.. 기존 파일 옮기는데만 20분이 걸렸습니다.. 용량은 7GB정도.. 윈도 탐색기복사가 넘 느려서 FastCopy란 프로그램을 썼습니다... 2019. 8. 1.
C++ istream, streambuf 간단 구현 예제 #include class input_buf : public std::streambuf { public: char read_buf_[32]; int read_pos_; int read_limit_; input_buf() { int i; for (i = 0; i < 32; i++) { if(i < 26) read_buf_[i] = 'a' + i; else read_buf_[i] = 'A' + (i - 26); } read_pos_ = 0; read_limit_ = 32; } int_type underflow() override { // 읽을 데이터가 없으면 EOF를 알린다 int_type ret = traits_type::eof(); // istream에서 더이상 버퍼에서 읽을.. 2019. 7. 19.
EJBCA Java WS API 연결 https://gist.github.com/jc-lab/773d809053184529b52a4089aab72a9e EjbcaConnector.java EjbcaConnector.java. GitHub Gist: instantly share code, notes, and snippets. gist.github.com 별건 아니구 EjbcaWS 연결할 때 인증서 검증 및 클라이언트 인증서 필요한데 Keystore파일이 아닌 KeyStore객체에서 가져오도록 한 것. 물론 좀더 수정 필요 2019. 7. 10.
C++ & AFX(MFC) 환경에서 사용자 정의 메세지 사용하면서 SendMessage으로 메세지 호출할 때 Run-Time Check Failure C++ & AFX(MFC) 환경에서 사용자 정의 메세지 사용하면서 SendMessage으로 메세지 호출할 떄... Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.위와 같은 오류가 났던 경우가 있었습니다. 이틀동안 엄청 삽질했는데... 보통 이런경우 메모리가 꼬여서 (Overflow/일부 메모리 free등) 문제가 발생했.. 2019. 6. 27.
반응형