전체 글 321

[자료구조와 함께 배우는 알고리즘 입문 - C언어 편] 2장 기본 자료구조 연습문제 Q1 답안 p.74

Q1. 실습 2-5는 키의 최댓값을 구하는 프로그램으로, 이 프로그램을 수정하여 키의 최솟값을 구하는 프로그램을 작성하세요. 최솟값을 구하는 과정은 아래와 같은 함수로 구현하세요. int minof(const int a[], int n); 코드) #include #include int minof(const int a[], int n) { int i=1; int min = a[0]; for(i; i a[i]) min = a[i]; } return min; } int main(void) { int i; int *height; int people_number; printf("사람 수 : "); scanf("%d", &people_number); height = calloc(people_number, sizeo..

Algorithm/Do it 2019.10.09

단계별로 풀기 8단계 수학1 - 손익분기점(1712번 문제) Python 답안

와나 런타임 에러 너무 많이 나서 찾아봤다.. 런타임 에러나는 내 코드) fix_co, var_co, pro_co = raw_input().split(" ") fixed_cost = int(fix_co) variable_cost = int(var_co) profit = int(pro_co) selling_cnt = fixed_cost / (profit - variable_cost) + 1 if selling_cnt = profit: print -1 else: print int(fixed_cost / (profit - variable_cost)) + 1 * 런타임 에러나는 이유가 variable_cost 변수가 profit 변수보다 크거나 같을 때 체크 안하면 난다네,, 세상 개발자 고수들 넘 많아.. 또..

Algorithm/Baekjoon 2019.10.08

linux CPU 정보 및 사용량 확인 명령어

CPU 정보 확인 $ cat /proc/cpuinfo 물리 CPU 개수 확인 $ grep "physical id" /proc/cpuinfo | sort -u | wc -l 논리 코어 개수 확인 $ grep -c processor /proc/cpuinfo CPU 당 코어 개수 확인 $ grep "cpu cores" /proc/cpuinfo | tail -1 process 별 CPU 사용량 확인 $ top CPU 코어별 사용량 확인 $ top 1 thread별 CPU 사용량 확인 $ top -H 출처 http://sarghis.com/blog/1136/ http://blog.naver.com/PostView.nhn?blogId=anbv3&logNo=130116624489

Linux 2019.09.27

쉘 스크립트 if문

기본 문법 if [ 조건식 ]; then 수행문 fi 예제 #! /bin/bash A=1 B=2 if [ A == B ]; then echo "A and B are the same." fi AND 조건문법 if [ 조건식1 ] && [ 조건식2 ]; then 수행문 fi OR 조건문법 if [ 조건식1 ] || [ 조건식2 ]; then 수행문 fi 조건문 -z : 문자열의 길이가 0이면 참 -n : 문자열의 길이가 0이 아니면 참 -eq : 값이 같으면 참 -ne : 값이 다르면 참 -gt : 값1 > 값2 -ge : 값1 >= 값2 -lt : 값1

Programming/Shell 2019.09.27

Angular7 ag-Grid 도입

오늘은 ag-Grid에 대해서 알아보겠습니다. https://www.ag-grid.com/ ag-Grid에는 community 버전과 enterprise 버전이 있습니다. 제가 사용할 버전은 community 버전! (1) 모듈 설치 npm install --save ag-grid-community ag-grid-angular (2) src/app/app.module.ts 파일에 모듈 등록 import { AgGridModule } from 'ag-grid-angular'; imports: [ ..., AgGridModule.withComponents([]) ] (3) src/style.css 파일에 스타일 등록 @import "~ag-grid-community/dist/styles/ag-grid.css..

SVN을 Git으로 옮기기

변경할 SVN 주소 = svn://${IP 주소}/${svn 저장소} ex) svn://127.0.0.1/svnserver (1) SVN 소스를 git으로 clone! git svn clone ${SVN 저장소 주소} --no-metadata * --no-metadata : Subversion의 메타데이터 저장하지 않겠다는 뜻 아이디와 비밀번호가 존재한다면 --username ${user_id} 추가하고 비밀번호 입력 ex) git svn clone svn://127.0.0.1/svnserver --no-metadata --username (2) clone 받은 'svnserver' 폴더 내 .git/refs/remotes/origin/tags가 존재한다면! cp -rf .git/refs/remotes/..

기타 2019.09.25