본문 바로가기

분류 전체보기

(68)
백준: 10718번 We love kriii (node.js) https://www.acmicpc.net/problem/10718 10718번: We love kriii ACM-ICPC 인터넷 예선, Regional, 그리고 World Finals까지 이미 2회씩 진출해버린 kriii는 미련을 버리지 못하고 왠지 모르게 올해에도 파주 World Finals 준비 캠프에 참여했다. 대회를 뜰 줄 모르는 지박 www.acmicpc.net 정답 출력화면 강한친구 대한육군 강한친구 대한육군 오답노트 //Correct Answer console.log("강한친구 대한육군\n강한친구 대한육군"); //Wrong Answer :\n 다음 스페이스를 두면 출력오류 console.log("강한친구 대한육군\n 강한친구 대한육군");
백준: 2557번 헬로월드도 못하는 바보... 드디어 해결 오답노트: 느낌표를 빼먹어서 오답... 정답: console.log ("Hello World!"); 드디어 ㅠㅠ 첫 정답 ㅠㅠ
EJS 사용해서 할일을 입력하면 li에 추가되는 todolist 만들기 app.js const express = require("express"); //기본 const bodyParser = require("body-parser"); //기본 - 인풋값을 js언어로 파싱해줌 const req = require("express/lib/request"); //이건 어디서 왔지? var items = ["Eat Yogurt", "Eat Probiotics", "Set a daily goal"]; // items가 add.post 안에 있으니까 그 밖에 있는 res.render에서 undefine 되어서 밖으로빼줌 // 요거트먹기, 유산균 먹기는 매일 기본적으로 할일이라서 기본값으로 지정, 밑에서 li와 연결 const app = express(); //기본 app.~ 는 다 ex..
JavaScript Date format https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date How to format a JavaScript date In JavaScript, how can I format a date object to print as 10-Aug-2010? stackoverflow.com var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; var today = new Date(); console.log(today.toLocaleDateString("en-US")); // 9/17/2016 console.log(today.toLocaleDateStr..
The first EJS templates :var today=new Date(); today.getday() views folder > list.ejs ToDo List Todo List app.js const express = require("express") const bodyParser = require("body-parser") const app = express(); app.set('view engine', 'ejs'); app.get("/", function (req, res) { var today = new Date() var currentDay = today.getDay(); var day = ""; switch (currentDay) { case 0: day = "Sunday"; break; case 1: day = "Monday"; break; case 2: day = "Tuesday"; br..
Bootstrap : 만들고 싶은 홈페이지 템플릿 가져오기 https://getbootstrap.com/docs/5.1/examples/ Examples Quickly get a project started with any of our examples ranging from using parts of the framework to custom components and layouts. getbootstrap.com 1. bootstrap 공식 홈에서 example 메뉴 2. 내가 만들고 싶은 페이지를 고른다. 3. 우클릭- 페이지소스보기 (또는 ctrl U) 전체 복사 4. 내 index.html에 붙여넣기 5. 주석 부분을 찾아서 boot strap cdn 복붙 6. style sheet 재설정하기: 공식홈 example에서 고른 페이지 소스보기에서 를 찾아서..
The MailChimp API - Newsletter App.1: before start Challenge: 1. CD to where you want to create your new project e.g. Desktop 2. Create new project folder called Newsletter-Signup 3. Insice Newsletter-Signup, Create a new app.js file, a signup.html file, success.html and failure.html files. 4. initialise npm with default options. 5. Install body-parser, express and request npm modules to the new project. 6. Require the newly installed modules in..
Node.js : Calculator만들기 Hyper 사용하여 1. 바탕화면에 Calculator2 폴더 만들기 2. 그 폴더로 디렉토리 변경 3. 그 폴더에 index.html, calculator2.js 파일 만들기 4. 숫자 창 2개와 버튼 1개 만들기 (style 상관없음) 5. h1으로 Calculator라고 제목 달아주기 6. 버튼을 누르면 더하기가 실행되도록 프로그래밍 응용. 1. 더하기, 빼기, 나누기, 곱하기 버튼을 만들어 각각 버튼을 만들면 연산이 실행되게 프로그래밍 2. 부트스트랩을 사용하여 예쁘게 꾸며보세요.