본문 바로가기

build5

Rust 간단한 웹서버 HttpServer 올리기 제목 그대로 간단하게 Rust로 웹서버 올리기 - hello world! 찍어보기 프로젝트 생성 $ cargo new rust-actix-api Cargo.toml 에 crate 추가 [dependencies] actix-web = "3.3.2" main.rs 수정 use actix_web::{web, App, HttpResponse, HttpServer, Responder}; async fn index() -> impl Responder { HttpResponse::Ok().body("Hello world!") } async fn get_data(web::Path(id): web::Path) -> impl Responder { let data = format!("get_data {id}"); HttpR.. 2023. 4. 19.
maturin, PyO3 - Rust 를 Python 에서 사용하자 Maturin 은 Rust 기반 Python 패키지를 구축하고 게시하는 도구이다 PyO3는 Python에서 rust코드를 실행할 수 있고, 반대로 rust에서 python 코드를 실행할 수 있게 도와주는 crate이다 // python 가상환경 활성화하고, 가상환경에 maturin 설치 $ pip install maturin $ mkdir temp & cd temp // rust project 시작, 위에서 만든 temp로 이름이 지정된다. $ maturin init -b pyo3 // 아래 파일들이 생성된다. rust 파일은 src/lib.rs // Cargo.toml, pyproject.toml 의 name을 변경하면 패키지 명을 변경할 수 있다 $ ls Cargo.toml pyproject.toml.. 2023. 3. 9.
Rust 시작하기 책읽고, 공부하기 보다 먼저, rust 설치 / 환경셋팅하기 $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh // 프로젝트 폴더 만들기 $ mkdir temp & cd temp // 초기화 $ cargo init & ls // cargo 환경 활성화 $ . ~/.cargo/env // 프로젝트 생성 $ cargo new rust_test // 빌드 $ cargo build // 릴리즈 모드로 빌드 $ cargo build --release // 실행 $ cargo run // 포멧터 $ cargo fmt // docs html 문서화 - 브라우저 open $ cargo doc --open 2023. 3. 8.
Jupyter notebook with Dockerfile jupyter notebook을 docker에서 실행하기 Dockerfile # tf2.3.0 docker makefile FROM tensorflow/tensorflow:2.3.0-gpu LABEL maintainer="chan" RUN apt-get update && apt-get install -y --no-install-recommends \ ssh git vim curl && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* COPY requirements.txt /tmp/requirements.txt RUN pip3 install --upgrade pip && \ pip3 install setuptools wheel && \ pip3 install -r /.. 2020. 10. 29.
[전자정부표준프레임워크] maven 빌드 에러 eGovFramework Web Project를 생성하고 maven 빌드를 실행할 경우 아래와 같은 에러가 발생 [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Unable to locate the Javac Compiler in: C:\Program Files (x86)\Java\jre1.5.0_22\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can ch.. 2012. 7. 24.