본문 바로가기

Language & Library31

create-react-app 쓰지 않고 webpack으로 React 앱 만들기 (2) 기본 소스 코드 작성 (Hello React & Webpack) JS 파일을 load 할 페이지 생성 (./index.html) ./dist/app.js이 webpack의 결과물이다. 해당 파일을 load하는 소스 코드 html에 react를 랜더링하는 소스(./client.jsx) const React = require('react'); const ReactDom = require('react-dom'); const { hot } = require('react-hot-loader/root'); const HelloReact = require('./HelloReact'); const Hot = hot(HelloReact); ReactDom.render(, document.querySelector('#ro.. 2020. 3. 10.
create-react-app 쓰지 않고 webpack으로 React 앱 만들기 (1) # 목표 # create-react-app을 사용하지 않고 React 앱을 만들어보자 webpack으로 하나의 js 파일로 만들어보자 webpack-hot-loader & reactwebpack-dev-server 로 수정사항 바로 확인해보자 # 패키지 설치 # npm init npm i react react-dom npm i 옵션을 통하여 설치 시 package.json에 기본 의존성 패키지(dependencies)로 추가된다. { ... "dependencies": { "react": "^16.13.0", "react-dom": "^16.13.0" }, ... } react : react의 기본 패키지 react-dom : react 코드를 랜더링하기 위한 패키지 npm i -D @babel/core.. 2020. 3. 9.
[C++] memory safety한 mysql_real_escape_string 래핑 함수 동적 할당을 이용한 mysql_real_escape_string 래핑 함수 char* Convert(const char* str) { // 모든 문자열이 escape 문자가 추가될 수 있으니 x2, 널문자를 위한 +1 int size = sizeof(str) * 2 + 1; char *convert = new char[size]; std::string ret = ""; memset(convert, 0x00, size); mysql_real_escape_string(db, convert, str, sizeof(str)); ret = convert; delete [] convert; return ret.c_str(); } 메모리를 할당할때는 Memory Safety 한지 확인이 필요하다!!! 생각 없이 so.. 2020. 3. 5.
[Python] virtualenv 활성화 방법 (git bash, cmd, bash, window, linux, mac) 사전 조건 python 2.7 이상 python 3.4 이상 virtualenv 설치 (window / linux 공용) virtualenv 모듈을 설치해 준다. pip install virtualenv virtualenv로 가상화 환경 구축 다음 명령어를 사용하면 venv라는 디렉토리에 가상화 환경을 구축하는데 python3를 base virtual으로 사용하는 모듈이 세팅 된다. virtualenv venv --python=python3 virtualenv로 python 가상환경 활성화 Linux/mac 환경 Windows 환경 (CMD) Windows 환경 (git bash) 활성화 명령어 source venv/bin/activate venv\Scripts\activate source venv/Sc.. 2020. 2. 25.
[C++] python의 join 함수 간단하게 구현 Python의 join 함수 l = ['a', 'b', 'c'] str = ",".join(l) print(str) // a,b,c C++에서 join 함수 구현 #include #include #include #include #include using namespace std; int main() { std::vector kbList; kbList.push_back("KB1234"); kbList.push_back("test1"); kbList.push_back("test2"); std::ostringstream imploded; std::copy(kbList.begin(), kbList.end(), std::ostream_iterator(imploded, ",")); std::cout 2019. 8. 14.
[MS-WSUSSS] 기본적인 통신 기본 통신 Web Service : SOAP 1.1 or SOAP 1.2를 통한 HTTP/HTTPS를 이용 Contents Download Service : HTTP를 이용 Web Service URI Web Service Location Server Sync Web Service http://:/ServerSyncWebService/ServerSyncWebService.asmx DSS Authoriztion Web Service http://:/dssauthWebService/dssauthWebService.asmx Reporting Web Service http://:/ReportingWebService/ReportingWebService.asmx Server Sync Web Service : 업데이.. 2019. 7. 15.
[MS-WSUSSS] 소개 Windows 서버 업데이트 서비스(WSUS) 프로토콜이란? Client 단말(End Point)의 소프트웨어 업데이트를 중앙에서 배포할 수 있도록 제공해주는 프로토콜 이다. 기본적인 구성은 아래와 같다. (WUSP는 업데이트서버와 클라이언트 사이의 프로토콜이다.) [MS 업데이트 서버] ---{WSUS Protocol}--- [업데이트 동기화 서버] ---{WUSP Protocol}--- [Client 단말] WSUS 프로토콜의 구성 업데이트 서비스(Web Service) : SOAP를 통한 HTTP/HTTPS 를 사용한다. 콘텐츠 다운로드 서비스 : BITS(Background Intelligent Transfer Service)를 사용, 간단한 HTTPS GET 요청으로 다운로드 가능하다. USS .. 2019. 7. 15.