프로그래밍 193

c++ 문자열을 배열로 변환(explode) 방법

php 의 explode 와 같이 문자열을 특정 구분자로 배열로 변환해 보겠습니다. #include #include #include #include #include #include #include #include #include std::string exec(const char* cmd) { char buffer[128]; std::string result = ""; FILE* pipe = popen(cmd, "r"); if (!pipe) throw std::runtime_error("popen() failed!"); try { while (fgets(buffer, sizeof buffer, pipe) != NULL) { result += buffer; } } catch (...) { pclose(pip..

프로그래밍/C++ 2021.12.08

c++ system 함수 output 변수에 담아 전달 방법

사용자 정의함수 먼저 선언해야 한다. cpp.cpp #include #include #include #include #include #include std::string exec(const char* cmd) { char buffer[128]; std::string result = ""; FILE* pipe = popen(cmd, "r"); if (!pipe) throw std::runtime_error("popen() failed!"); try { while (fgets(buffer, sizeof buffer, pipe) != NULL) { result += buffer; } } catch (...) { pclose(pipe); throw; } pclose(pipe); return result; } i..

프로그래밍/C++ 2021.12.08

JavaScript 에서 C# 클래스 호출하는 방법

JavaScript 에서 C# 클래스 호출하는 방법 JavaScript 바인딩(JSB)을 사용하면 JavaScript및 .Net. 현재 사용할 수 있는 두 가지 고유한 구현, 즉 Async버전과 이전 Sync버전이 있습니다. Async개체 바인딩 JavaScript CefSharp.BindObjectAsync의 방법은 호출되는 Javascript객체를 결합 할 수 있습니다. CefSharp.BindObjectAsync 는 바인딩된 개체를 사용할 수 있을 때 해결 되는 Promise 반환 합니다. 객체는 전역 컨텍스트(window객체의 속성)에서 생성됩니다. CefSharp.BindObjectAsync매개변수 없이 호출하면 등록된 모든 객체가 바인딩됩니다. 간단한 워크플로는 다음과 같습니다. 1. 자바스크..

프로그래밍/c# 2021.11.26

인텔리제이(intellij) 스프링 부트(spring boot) vue.js 연동 8080 포트 방법

인텔리제이(intellij) 스프링 부트(spring boot) vue.js 연동 8080 포트 방법 보통 백엔드서버 8081 프론트엔드 8081 두개의 서버를 가동하지만 본 문서에서는 백엔드 서버 8080 으로 연동하는 방법을 사용하고자 한다. 필요사항 intellij spring boot vue.js 백엔드 (spring boot) 설정 build.gradle plugins { id 'org.springframework.boot' version '2.5.6' id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' id "com.github.node-gradle.node" version "3.1.1" id 'war' } group..

프로그래밍/vue 2021.11.23

스프링 부트 + vue.js gradle build 과정에서 npm build 자동으로 수행되도록

plugins { id "com.github.node-gradle.node" version "3.1.1" } node { download = true version = "14.6.0" npmVersion = "6.14.7" distBaseUrl = "https://nodejs.org/dist" npmInstallCommand = "install" workDir = file("${project.projectDir}/.gradle/nodejs") npmWorkDir = file("${project.projectDir}/.gradle/npm") nodeProjectDir = file('./front') } task setUp(type: NpmTask) { description = "Install Node.js..

Vue.js 처음하는 설치 및 샘플예제

spring boot port 8080 vue port localhost:8081 vue cli 설치 $ npm install -g @vue/cli vue 설치 $ vue create front vue.config.js 파일 추가 (front 프로젝트 root 폴더) http-common.js 파일 추가 (http 통신에 관련된 사항 기술 src 폴더) Vue router 추가 (다중 페이지 처리) axios 추가 (http 통신 처리) vue.config.js module.exports = { outputDir: "../src/main/resources/static", indexPath: "../static/index.html", devServer: { proxy: "http://localhost:80..

프로그래밍/vue 2021.11.23

스프링부트(spring boot) mysql 연동시 log4j2 설정 gradle intellij

스프링 부트 사용시 기본 로그 spring-boot-starter-logging 제거해야 합니다. all { exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' } build.gradle 에 log4j2 와 쿼리로그를 볼수 있도록 추가하겠습니다. build.gradle log4j2 추가 implementation 'org.springframework.boot:spring-boot-starter-log4j2' build.gradle 쿼리로그 추가 implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16' build.gradle 전체 plugins ..