Dev/C, C++

    빠른 localtime

    원본: https://github.com/lmk/fast_localtimefastkst_localtime고성능 KST(한국 표준시, UTC+9) 전용 localtime 구현개요fastkst_localtime은 한국 표준시(KST, UTC+9) 변환에 최적화된 고성능 시간 변환 라이브러리입니다. 표준 localtime() 함수가 가진 성능 오버헤드를 제거하고, 64-bit 시간 값을 안전하게 처리할 수 있도록 설계되었습니다.glibc/time 소스를 참조하여 구현되었습니다.주요 특징1. 고성능KST 타임존 변환에 특화되어 표준 localtime() 함수보다 빠른 성능 제공Linux 커널에서 발생하는 시스템 콜, timezone 조회, mutex 락 등의 오버헤드 제거직접적인 시간 계산으로 최소한의 연산만 ..

    vscode 에서 원격 디버깅

    목적 - vscode를 사용해서 g++을 원격으로 디버깅하는 방법을 설명하고자 한다.방법 먼저 ssh로 접속이 가능하도록 설정 한다. (여기 까지는 공개된 방법이 많이 있습니다) code.visualstudio.com/docs/remote/ssh 작업 영역을 설정한다. 디버깅은 작업영역을 설정해야 가능 합니다. launch.json 파일에 추가한다. Run { "name": "process1 run", "type": "cppdbg", "request": "launch", "program": "/home/newtype/vscode_debug/process1", "cwd": "${workspaceFolder}", "MIMode": "gdb", "miDebuggerPath": "/usr/bin/gdb", "s..

    FindMSSQL

    github에 올린 내용 정리해서 올립니다.https://github.com/lmk/FindMSSQL FindMSSQLFind all MSSQL Server같은 네트워크망에 설치된 MSSQL의 정보를 조회 합니다.Visual Studio 2015 MFC 기반에서 코딩해 봤습니다.EnveromentVirsual Studio 2015MFC (v140)How to use함수 원형은 아래와 같습니다.3번째 파라미터를 생략하면 같은 네트워크망의 모든 서버를 검색합니다. (Broadcast)bool GetMSSQLInfo(CString &info, int timeout_sec, CString ip = _T(""));How to implementMSSQL을 설치하면 SQL Server Browser가 함께 설치됩니다..

    Simple Http Server

    SimpleHttpServer 자세한 소스는 github을 참고하세요. https://github.com/lmk/SimpleHttpServer very simple http server default port: 8080 modify source here support: linux g++ 4.9.2 How to use block server HttpServer httpServer; httpServer.Init(5, NULL); httpServer.Run(); non-block NBHttpServer* httpServer = NBHttpServer::getInstance(); httpServer->Init(5); httpServer->Start(); sleep(60); httpServer->Stop();

    OpenSSL 을 사용한 RSA

    RSA 프로젝트를 진행하면서, github에 정리한 내용입니다. https://github.com/lmk/HowToUseOpenSSL/blob/master/RAS.md RSA 생성 PEM public 키로 RSA 생성하기 unsigned char *key = "PEM 형식의 public 키"; BIO *bio = BIO_new_mem_buf(key, -1); RSA *rsa = PEM_read_bio_RSA_PUBKEY(bio, &rsa, NULL, NULL);PEM private 키로 RSA 생성하기 unsigned char *key = "PEM 형식의 private 키"; BIO *bio = BIO_new_mem_buf(key, -1); RSA *rsa = PEM_read_bio_RSAPrivateK..

    Visual Leak Detector 를 사용하여 Leak을 감지하는 방법.

    Visual Leak Detector 를 사용하여 Leak을 감지하는 방법.사용조건Visual Studio 2008/2010/2012/2013/2015사용방법 (VS2010 기준으로 설명합니다.)홈페이지에서 VLD를 다운받아 설치합니다.https://vld.codeplex.com/releases/view/619330Visual Sutdio 설정을 합니다.VS를 실행하고, 적용할 솔루션을 엽니다.VS를 실행해서 보기 > 다른 창 > Property Manager 창을 엽니다.Property Manager 창에서 아무 프로젝트에서든 선택하고 적용하고자 하는 구성에서 "Microsfot.Cpp.x64.user"를 더블클릭 합니다.속성 페이지가 열리면, 왼쪽 메뉴 트리에서 VC++ Directorys > Inc..