프로그래밍

프로그래밍/Kotlin

[Kotlin] math 패키지 사용하기

package test import kotlin.math.* // math 패키지 임포트 하기 fun main() { println(PI) //파이 값 출력 println(abs(14.2)) // 14.2의 절대값 출력 } 출력 값 : 3.14.... 14

프로그래밍/Kotlin

[Kotlin] 기본 패키지 사용하기 및 출력하기

package test fun main() { val intro: String = "Hello World!" // 문자형 (String) 변수 선언, intro라는 변수 val num: Int = 20 // 숫자형 변수 선언, num이라는 변수 println("intro: $intro, num: $num") // 변수 출력, 출력시 $ + 변수명 } 출력 값 : intro: Hello World!, num: 20

프로그래밍/HTML

[html/css] 사이드바 만들기

See the Pen ZEWWLNy by poinguinie (@poinguinie) on CodePen.

프로그래밍/Node.js

[Node.js] 파일 읽고 쓰기 (동기화/ 비동기화)

/// 파일 읽기 및 쓰기 var fs = require('fs'); //스트림 단위로 파일 읽고 쓰기 var infile = fs.createReadStream('data/output.txt',{flag: 'r'}); var outfile = fs.createWriteStream('data/output2.txt',{flag: 'w'}); infile.on('data', function(data) { console.log('읽어 들인 데이터', data); outfile.write(data); }); infile.on('end', function() { console.log('파일 읽기 종료'); outfile.end(function() { console.log('파일 쓰기 종료'); }); }); //..

프로그래밍/Node.js

[Node.js] 간단한 웹 서버 만들기

//간단한 웹 서버 만들기 var http = require('http'); //웹 서버 객체를 만듭니다. var server = http.createServer(); //웹 서버를 시작하여 3000번 포트에 대기합니다. var port = 3000; server.listen(port, function() { console.log('웹 서버가 시작되었습니다. : %d', port); }); //클라이언트 연결 이벤트 처리 server.on('connection', function(socket) { var addr = socket.address(); console.log('클라이언트가 접속했습니다. : %s, $d',addr.address,addr...

Dev.Poinguinie
'프로그래밍' 카테고리의 글 목록 (8 Page)