본문 바로가기
728x90
반응형

Programming44

[Node.js_생활코딩] 동적인 web page 만들기 main.js var http = require('http'); var fs = require('fs'); var url = require('url'); var app = http.createServer(function(request,response){ var _url = request.url; var queryData = url.parse(_url, true).query; var title = queryData.id; if(_url == '/'){ title = 'Welcome'; } if(_url == '/favicon.ico'){ return response.writeHead(404); } response.writeHead(200); var template = ` WEB HTML CSS JavaSc.. 2021. 2. 16.
[Node.js] 커스텀 모듈 작성 1. 커스텀 모듈 js작성 : cal.js function plus(a,b){ return a+b; } function minus(a,b){ return a-b; } function multiplication(a,b){ return a*b; } function division(a,b){ return a/b; } // 현재 소스를 모듈로 export module.exports = { plus: plus, minus: minus, mult: multiplication, divi: division } 2. 모듈 불러와서 사용하는 js 작성 : useModule.js // require() : 현재 실행하는 폴더 내에 cal.js 모듈 사용 var cal = require('./cal'); console.log.. 2021. 2. 16.
[Node.js] Express framework 설치 및 실행, 800A138F 오류 1. Express framework 설치 (cmd) 작업 폴더로 이동 -> npm install express 2. hello-express.js 작성 (Visual Studio Code) hello-express.js 작성 var express = require('express'); var app = express(); app.get('/', function(req, res) { res.send('Hello World!'); }); app.listen(3000, function() { console.log('Example app listening on port 3000!'); }); 3. cmd 창에서 확인 해당 폴더 -> node hello-express.js [ ERROR ] cmd 창에서 "no.. 2021. 2. 16.
[Node.js]간단한 예제 실행 1. Visual Studio Code를 이용해서 간단한 코드 작성 작업할 폴더 생성 -> hello.js 파일 생성 // Load HTTP module var http = require("http"); // Create HTTP server and listen on port 8000 for requests http.createServer(function(request, response) { // Set the response HTTP header with HTTP status and Content type response.writeHead(200, {'Content-Type': 'text/plain'}); // Send the response body "Hello World" response.end('.. 2021. 2. 16.
[Node.js]Node.js 설치 및 확인 1. Node.js 다운로드 및 설치 ( 특별히 변경할 것 x ) https://nodejs.org/ko/download/ 다운로드 | Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 2. 설치 확인 cmd 창에서 다음으로 확인 2021. 2. 16.
03. Data Type #R #DataType #기본데이터 #특수데이터 #numeric #charcter #logical #complex #NULL #NA #Nan #Inf #-Inf #mode #is #as ​ ​ ​ 1. 기본 데이터 타입 1) 숫자형(numeric) : 숫자로 되어있고 정수형, 실수형을 의미 100 이면 실수형 100L 이면 정수형 2) 문자열(character) : 하나 혹은 둘 이상의 문자 집합 "홍길동" '최길동' '홍' 3) 논리형(logical) : TRUE(T), FALSE(F) 4) 복소수형(complex) : 4-3i ​ 2. 특수 데이터 타입 1) NULL : 객체가 존재하지 않음을 지칭하는 객체 2) NA : Not Available 결측치 표현시에 사용 -> 데이터 전처리 과정에서 이상.. 2020. 5. 28.
02. vector #R #vector #선형저장공간 #& #&& ​ 1. vector - 연속적인 저장공간 (선형) - 1차원 자료구조 - R의 여러가지 자료구조 중 대표적 - 저장공간 안에 모두 같은 데이터 타입이 저장됨 - 함수를 이용해서 vector 생성 ​ 2. c() : combine의 약자 입력 : c(10,20,30) 결과 : 10 20 30 ​ 입력 : c(TRUE, 20, 3.14) 결과 : 1.0 20 3.14 ​ 입력 : c(TRUE,FALSE) & c(TRUE, TRUE) 결과 : TRUE FALSE ​ 입력 : c(TRUE,FALSE) && c(TRUE, TRUE) 결과 : TRUE -> 맨 앞의 벡터만 연산하고 나머지는 안함( &, &&에서 스칼라와 벡터의 차이점! ) ​ 입력 : c(TRUE,F.. 2020. 5. 27.
01. Operator (연산자) #R #Operator #연산자 #비교연산자 #논리연산자 ​ var1 = 100 var2 = 3 ​ 1. 몫 구하기 : %/% 입력 : var1%/%var2 결과 : 33 ​ 2. 나머지 구하기 : %% 입력 : var1%%var2 결과 : 1 ​ 3. 비교연산자 입력 : var1 ​== var2 결과 : FALSE(F) ​ 입력 : var1 != var2 결과 : TRUE(T) ​ 4. 논리연산자(AND 연산) ※스칼라 연산에서는 &와 &&, | 와 || 의 차이가 없다 !! 벡터 연산에서는 차이가 있다!! 1) &, && : 양쪽 값이 TRUE이면 결과가 TRUE 2) |,|| : 하나라도 TRUE이면 결과가 TRUE ​ 입력 : TRUE & TRUE 결과 : TRUE ​ 입력 : TRUE & FAL.. 2020. 5. 27.
00. R 개요 #R #alignment #cat() #seq() ​ 1. 변수에 값을 할당하는 방법 var1 =​ 100 var2 ​ var3 ​ 2. 여러개의 값을 동시에 출력하는 방법 : cat() 사용 ​ 입력 : cat(var1,var2) 결과 : 100 200 ​ 입력 : cat("결과값은 : ", var1) 결과 : 결과값은 : 100 ​ ※ print("결과값은 : " + var1)에서 + 연산을 문자, 숫자 연결을 위해 사용할 수 없다. R은 숫자연산에만 + 사용이 가능하다 ​ 3. 순서, 순열의 집합을 표현할 때 : seq() 사용 mySeq = seq(100) 일 때, 1부터 100까지 1씩 증가하는 숫자의 집합 mySeq = seq(5,100) 일 때, 5부터 100까지 1씩 증가하는 숫자의 집합 .. 2020. 5. 27.
통계분석_성별/혼인/피부/가격/재사용 등 In [30]: import tensorflow as tf C:\python\envs\cpu_env\lib\site-packages\tensorflow\python\framework\dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\python\envs\cpu_env\lib\site-packages\tensorflow\pytho.. 2020. 5. 24.
728x90
반응형