전체 글 194

특정 날짜로 요일 계산하는 공식

특정 날짜로 요일 계산하는 공식 Input : int year; // 년int month; // 월int day; // 일 Output : int week; // 0~6사이로 각각 일월화수목금토 를 가리킴Code : if (month == 1 || month == 2) {year--; }int a = (month + 9) % 12 + 1;int b = year % 100;int c = year / 100; // 소수점 이하 버림int week = ( ((13 * a - 1) / 5) + day + b + (b / 4) + (c / 4) - (2 * c) ) % 7;if (week < 0) {week = (week + 7) % 7}return week; example: year = 2015month = 6..

Study/Programming 2015.06.03

[크롬/Chrome] local file 문서 간 데이터 교환 오류 문제 - (SecurityError: Blocked a frame with origin)

local file을 크롬 브라우저로 보는 상황에서A 문서에서 B 문서를 띄우고 (Parent Window - Child Window) B 문서에서 A 문서의 DOM으로 접속하여 데이터를 보내려는 경우 아래와 같은 에러 메세지를 개발자콘솔창에서 볼 수 있다. Uncaught SecurityError: Blocked a frame with origin "null" from accessing a frame with origin "null". Protocols, domains, and ports must match. 실제 웹서버로 올려서 실행하는 경우에는 발생하지 않는 문제이나 개발자 테스트 중에 발생 될 수 있는 문제이며, 파이어폭스에서는 정상적으로 수행이 된다. 이는 크롬의 보안 정책이 특정 버전 이후로 ..

Study/Etc. 2015.04.09