PROGRAMMING
-
Chrome에서 Web Security 무시하는 방법PROGRAMMING/Web Programming 2021. 3. 25. 14:58
client 코드 작성 중 server 측에서 allow-cross-origin 이슈를 접하는 등, 다양한 web security 정책에 막혀 개발이 원활하게 진행되지 못할 때가 있다. chrome에서는 실행 시 command option을 넣으면 web security를 무시할 수 있다. 1. (Windows 기준) 시작 -> 실행 2. 아래 command 실행 chrome.exe --disable-web-security --user-data-dir="D:/"
-
유용한 git command 모음PROGRAMMING/Git 2021. 3. 25. 08:33
Basic // initialize project $ git init // download project $ git clone GIT_ADDRESS.git // stage a file $ git add FILE_NAME // stage all files from current folder $ git add . // commit to local storage $ git commit // commit to local storage by one line $ git commit -m "COMMIT MESSAGE" // push commits to remote storage $ git push origin master // save the current changes temporarily $ git stash A..
-
Algorithm 문제 해결에 Python을 사용해야 하는 이유 10가지PROGRAMMING/Python 2021. 3. 14. 21:58
Algorithm 문제 해결에 Python을 사용해야 하는 이유 10가지를 정리해 보았다. Integer limit이 없다. Permutation, combination 함수가 제공된다. from itertools import permutations from itertools import combination List, String에서 slicing이 유용하다. for-else 구문 (for문에 한 번도 걸리지 않을 때) for i in data: if i > 10: break else: print('All items are lower than 10.') Multiple return values return a, b, c Chained comparision if a < b < c: Swapping var..
-
baekjoon 3190 : 뱀(snake)PROGRAMMING/Algorithm 2017. 8. 5. 04:44
오랜만에 알고리즘 문제 푸려니 너무 힘들었다.. 백준 기준 정답률 17%의 삼성 SW역량시험에 출제되었던 문제. 특정 class를 만들어 Queue를 이용하는 idea까진 생각해 냈지만, 문제에 대한 이해도가 부족했던 것 같다. 나에게 있어서 문제의 요지는 다음과 같았다. 1. 방향 설정을 간단하게 하기 처음에 east west 난리를 쳤다가 코드가 점점 길어졌다. L로 계속 돌면 반시계, D면 시계방향이라는 것을 뒤늦게 깨닫고 순환성을 이용하여 마침내 방향이 숫자가 될 수 있었다. 역시 수학을 잘 해야해.. 2. queue에 무엇을 넣을 것인지? ★★★ 머리와 꼬리만 알면 된다고 생각했는데 몸통도 알아야 한다. 그래서 뱀 전체를 queue에 넣었다. 꼬리는 queue의 head이므로 꼬리가 없어질 때마..
-
git을 이용한 깃허브(github) 연동하기PROGRAMMING/Git 2017. 8. 3. 23:39
깃허브! 정말 좋은 소스 공유 사이트인데 사용법이 헷갈려서 정리 겸 포스팅하려고 한다. * git 다운로드https://rogerdudler.github.io/git-guide/index.ko.html정말 애용하는 사이트. 설치부터 사용법까지 알아보기 쉽게 나와있다. * git bash 사용법깃허브 로컬 저장소로 사용하고 싶은 폴더에서 shift를 누른 채로 오른쪽 버튼을 클릭하고git bash here 을 선택하면 명령창이 나온다. * 자주 사용하는 명령어들로컬 저장소를 init해주기 - 처음에 꼭 필요!!git init 기존의 프로젝트 다운받기git clone https://깃허브주소.git 파일 추가하기git add 파일이름여러개의 파일 -> git add -f * 로컬 저장소에 commit (HE..
-
파이썬을 이용한 사인 그래프 그리기 - Generating a Synthetic Sine Wave with PythonPROGRAMMING/Python 2017. 3. 21. 08:44
import numpy as np import matplotlib.pyplot as plt import matplotlib # properties SIG_AMPLITUDE = 10 SIG_OFFSET = 2 SIG_PERIOD = 100 NOISE_AMPLITUDE = 3 N_SAMPLES = 5 * SIG_PERIOD INSTRUMENT_RANGE = 9 # construct a sine wave times = np.arange(N_SAMPLES).astype(float) signal = SIG_AMPLITUDE * np.sin(2 * np.pi * times / SIG_PERIOD) + SIG_OFFSET # and mix it with some random noise noise = NOISE_AMP..