전체 글
-
항해 99 5기 TIL_38항해 99 2022. 2. 17. 04:05
▶ Today I Learned [캐시] 캐시(cache, 문화어: 캐쉬, 고속완충기, 고속완충기억기)는 컴퓨터 과학에서 데이터나 값을 미리 복사해 놓는 임시 장소를 가리킨다. 캐시는 캐시의 접근 시간에 비해 원래 데이터를 접근하는 시간이 오래 걸리는 경우나 값을 다시 계산하는 시간을 절약하고 싶은 경우에 사용한다. 캐시에 데이터를 미리 복사해 놓으면 계산이나 접근 시간 없이 더 빠른 속도로 데이터에 접근할 수 있다. 캐시 히트: RAM에서 찾는 데이터가 CPU내 캐시 내 있을 경우 캐시 미스: RAM에서 찾는 데이터가 CPU내 캐시 내 없을 경우 [dotenv] 로그인과 게시글, 댓글 기능이 있는 새로운 페이지를 만드는 중에 있다. require('dotenv').config(); dotenv는 무엇인..
-
항해 99 5기 TIL_37항해 99 2022. 2. 16. 02:06
▶ Today I Learned 렉시컬 환경: 식별자-변수 형태의 맵핑 데이터 구조, 자바스크립트 내 메모리이다. 모든 함수와 변수 선언들은 이곳에 저장된다. 즉, 프로그램이 실행되는 동안 함수와 변수가 존재하는 장소 호이스팅이 일어나는 것들이 해당 메모리에 저장된다고 보면 되겠다. cf) 호이스팅이란? 컴파일 단계 동안 변수와 함수가 스캔되어 렉시컬 환경에 저장되는 현상, 코드 순서상 실제 선언 전이라도 해당 변수나 함수를 사용할 수 있게 된다. cf) 변수의 호이스팅이 궁금하다면 이 링크를 참조해보자. https://yceffort.kr/2020/05/var-let-const-hoisting LexicalEnvironment = { Identifier: , Identifier: ... } 식별자는 함..
-
항해 99 5기 TIL_36항해 99 2022. 2. 15. 03:37
▶ Today I Learned [토큰 저장 방식] 로그인을 위해 JWT 방식을 사용하기로 했고 서버에서 로그인이 인증되면 토큰을 생성하여 클라이언트로 보내주게 된다. 이때 클라이언트에서는 토큰을 받아 저장해야하는데, 그 저장 방식을 고민하게 되었다. 방법은 아래와 같다. 로컬 스토리지: 브라우저에 해당 데이터 저장, 세션 스토리지와는 다르게 사용자가 지울 때 까지 브라우저에 남아있게 됨, 자동 로그인에 적절, 세션 스토리지: 브라우저에 해당 데이터 저장, 로컬 스토리지와는 다르게 브라우저 탭을 닫는 순간 지워지게 됨, 일회성 로그인에 적절 두 스토리지는 window에 위치함, 프로토콜, 호스트, 포트가 같으면 같은 스토리지를 공유, 브라우저별로, 기기별로 다르긴 하지만 보통 모바일은 2.5mb, 데스크..
-
항해 99 5기 WIL_5항해 99 2022. 2. 13. 22:10
▶ Weekly I Learned (회고) 백엔드와 프론트엔드로써의 협업은 처음이라 초반에는 막막했지만 또 잘 진행되어가는 듯 하다. 이번 일요일은 아주 푹 쉬었으며 내일부터 다시 건강한 하루를 살도록 해야지..! [CORS] Cross Origin Resource Sharing 교차출처 리소스 공유, 교차출처란 다른 출처를 의미 cf) SOP Same Origin Policy, 같은 출처에서만 리소스를 공유할 수 있다는 규칙을 가진 정책 기본적으로 브라우저는 출처가 다른 사이트와 리소스 공유하는 것을 위 원칙에 의해 막아두었다. 출처가 다른 리소스 요청을 허용하는 예외를 만들어 주어야 하는데, 이를 위해 'CORS 정책을 지킨 리소스 요청'을 하여야 한다. 즉, CORS로 이 출처의 사이트는 괜찮아, ..
-
항해 99 5기 TIL_35항해 99 2022. 2. 13. 01:16
▶ Today I Learned [조이스틱] 소요시간: 1시간 25분 + 2시간 해결여부: 미해결 https://programmers.co.kr/learn/courses/30/lessons/42860 /* 조이스틱을 좌우로 움직이는 경우의 수를 따져 경우가 더 적은 쪽을 택하기 (근데 이때 좌우의 경우는 문자열 내 A가 포함되어있는 경우만 따지면됨 아닌 경우는 다 똑같음), 그 다음 상하 움직이는 경우의 수를 따져 경우가 더 적은 쪽을 택하기 맨 처음엔 A로만 이루어져 있습니다. 첫 시작은 항상 첫번째 */ let name = "AAEE" let leftRight = 0 //AJEARAO 이거에서 거꾸로 시작하는 건 마치 // AOARAEJ와 같다 // 그렇다면 // 문자열 첫번째 문자를 제외하고 잘라낸..
-
항해 99 5기 TIL_34항해 99 2022. 2. 13. 01:15
▶ Today I Learned 조이스틱 유형: 탐욕법 소요 시간: 1시간 25분 시간 내 해결 여부: 미해결 https://programmers.co.kr/learn/courses/30/lessons/42860 /* 조이스틱을 좌우로 움직이는 경우의 수를 따져 경우가 더 적은 쪽을 택하기 (근데 이때 좌우의 경우는 문자열 내 A가 포함되어있는 경우만 따지면됨 아닌 경우는 다 똑같음), 그 다음 상하 움직이는 경우의 수를 따져 경우가 더 적은 쪽을 택하기 맨 처음엔 A로만 이루어져 있습니다. 첫 시작은 항상 첫번째 */ let name = "EERAEAA" let leftRight = 0 //AJEARAO 이거에서 거꾸로 시작하는 건 마치 // AOARAEJ와 같다 // 그렇다면 // 문자열 첫번째 문자..
-
항해 99 5기 TIL_33항해 99 2022. 2. 12. 02:04
▶ Today I Learned [Transaction] transaction: DB는 하나의 명령어로만 행동하지 않으며 추가, 업데이트, 삭제와 같은 행위 중 특정 단계에서 에러가 발생할 수 있음, 그렇게 되면 데이터 간의 불일치가 일어날 수 있음 이를 방지하기 위해 관련된 작업을 하나로 묶을 수 있으며 이 작업 단위는 성공하거나 실패해야 한다. 여기서 말하는 작업단위를 바로 트랜잭션이라고 한다. 참조 자료: https://blog.naver.com/wkdgusrhkd97 [CORS] Cross Origin Resource Sharing 교차출처 리소스 공유, 교차출처란 다른 출처를 의미 cf) SOP Same Origin Policy, 같은 출처에서만 리소스를 공유할 수 있다는 규칙을 가진 정책 기본..
-
항해 99 5기 TIL_32항해 99 2022. 2. 11. 02:02
▶ Today I Learned [신고 결과 받기] (이틀 전 풀지 못한 문제) https://programmers.co.kr/learn/courses/30/lessons/92334 소요시간: 1시간 시간 내 해결 여부: 여전히 미해결 let id_list = ["muzi", "frodo", "apeach", "neo"] let report = ["muzi frodo","apeach frodo","frodo neo","muzi neo","apeach muzi"] // ["ryan con", "ryan con", "ryan con", "ryan con"] let k = 2 // 예상 결과 result 값 [2,1,1,0] // 문자열 알파벳 소문자, 중복 아이디 x 동일 유저 신고 여려번 해도 1회로 처리..