일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- apt clean
- vim 괄호 비활성화
- url reference
- git commit message
- linux prompt color
- 프로그래머스 구명보트
- gnuplot csv
- VirtualBox
- linux bash
- python3
- csv x range
- vim 찾아 바꾸기
- 프로그래머스
- Leetcode 70
- vi/vim commands
- 프로그래머스 실패율
- Leetcode 121
- 걸쳐서 그림 넣기
- LaTeX figure
- Climbing Stairs
- vim set noshowmatch
- vi/vim 명령어
- tensorflow model load
- latex 첨자
- Resolution Changing
- 프로그래머스 체육복
- without nohup.out
- vim 치환
- apt autoremove
- Python Imaging Library
- Today
- Total
목록분류 전체보기 (19)
기억노트
Code def solution(N, stages): answer = [] n = len(stages) for i in range(1, N + 1): cnt = stages.count(i) rate = cnt / n if n != 0 else 0 answer.append([i, rate]) n -= cnt answer.sort(key = lambda x:x[1], reverse = True) answer = [i[0] for i in answer] return answer Result 정확성 테스트 테스트 1 〉 통과 (0.01ms, 10.2MB) 테스트 2 〉 통과 (0.14ms, 10.3MB) 테스트 3 〉 통과 (70.61ms, 10.5MB) 테스트 4 〉 통과 (379.54ms, 10.9MB) 테..
Code def solution(people, limit): answer = 0 people.sort() start = 0 end = len(people) - 1 while start
~/.vimrc에 set noshowmatch를 추가해주어도 매칭되는 괄호에 계속 하이라이팅이 되어있어서 찾아보니 다음 코드로 비활성화 시킬 수 있었다. let g:loaded_matchparen=1
Code from collections import Counter def solution(n, lost, reserve): arr = [1] * (n+2) for x in reserve: arr[x] += 1 for x in lost: arr[x] -= 1 for i in range(len(arr)): if arr[i] == 0: if arr[i-1] == 2: arr[i] += 1 arr[i-1] -= 1 elif arr[i+1] ==2: arr[i] += 1 arr[i+1] -= 1 arr.pop(0) arr.pop() return len(arr) - Counter(arr)[0] Result 정확성 테스트 테스트 1 〉 통과 (0.02ms, 10.3MB) 테스트 2 〉 통과 (0.04ms, 10.2M..
Code def solution(prices): n = len(prices) answer = [] for i in range(n): sec = 0 for j in range(i+1, n): sec += 1 if prices[i] > prices[j]: break answer.append(sec) return answer Result 정확성 테스트 테스트 1 〉 통과 (0.01ms, 10.2MB) 테스트 2 〉 통과 (0.05ms, 10.2MB) 테스트 3 〉 통과 (0.97ms, 10.3MB) 테스트 4 〉 통과 (0.60ms, 10.3MB) 테스트 5 〉 통과 (0.85ms, 10.3MB) 테스트 6 〉 통과 (0.02ms, 10.3MB) 테스트 7 〉 통과 (0.37ms, 10.3MB) 테스트 8 〉..
Code def solution(bridge_length, weight, truck_weights): answer = 0 bridge = [0] * bridge_length while truck_weights: if bridge: bridge.pop(0) if sum(bridge) + truck_weights[0]
Code class Solution: def climbStairs(self, n: int) -> int: d = [0] * 46 d[1] = 1 d[2] = 2 for i in range(3, n+1): d[i] = d[i-1] + d[i-2] return d[n] Result Runtime: 41 ms Memory Usage: 14.5 MB
Code class Solution: def maxProfit(self, prices: List[int]) -> int: minv = prices[0] res = 0 for x in prices[1:]: minv = min(minv, x) res = max(x - minv, res) return res Result Runtime: 1088 ms Memory Usage: 25.2 MB
set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'preservim/nerdtree' Plugin 'nathanaelkane/vim-indent-guides' Plugin 'frazrepo/vim-rainbow' Plugin 'Valloric/YouCompleteMe' Plugin 'tpope/vim-fugitive' Plugin 'git://git.wincent.com/command-t.git' Plugin 'file:///home/gmarik/path/to/plugin' Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} call vundle#end() filet..
Visio 에서 JPG 로 저장할 때 설정할 수 있는 항목이 많은데, 이를 기본 설정으로 저장하면 글자나 그림이 깨지는 경우가 많았다. 이것저것 설정 바꿔가면서 저장해봤는데 경험상 품질 : 100%, 해상도 : 프린터, 크기 : 원본 으로 설정하는 것이 글자나 그림이 가장 깨지지 않았다.
라즈베리파이 3에 darknet 설치하기 $ git clone https://github.com/AlexeyAB/darknet (darknet에는 pjreddie 버전과 alexey 버전이 있는데 yolo 논문의 저자가 만든 버전이 pjreddie 라고 한다. 먼저 pjreddie 버전을 설치해서 코드를 돌려보았는데, segmentation fault 떠서 삭제하고 alexey 버전으로 다시 설치했다.) $ cd darknet darknet 디렉토리로 들어간 다음, $ wget https://pjreddie.com/media/files/yolov3-tiny.weights 로 yolo v3 tiny 의 weight 파일을 설치한다. 그 다음 make $ make (나는 pi 에서 openCV 없이 돌릴 예..
Tensorflow 에서 저장한 모델을 불러오기 할 때 발생한 에러이다. 구체적으로는 TeachableMachine 에서 학습시킨 모델을 python 코드 내의 모델 불러오는 부분에서 발생한 에러이다. 한참을 헤매다가 tensorflow 를 삭제하고 설치하는 과정을 몇 번 반복하니 tensorflow가 최신 버전일 때는 오류가 발생하지 않지만 버전이 낮을 경우에 저 에러가 발생한 다는 것을 깨달았다. 2020년 4월 기준으로 python2.7 버전에서는 tensorflow1.15 버전에서, python3.x 버전에서는 tensorflow2.1.0 버전에서 오류없이 모델을 불러왔다.
패키지 설치나 update / upgrade 중 제목과 같은 오류가 발생했을 때는 autoremove 로 패키지를 삭제하고, clean 으로 깨끗이 한 다음, update 와 upgrade 를 진행한 다음 원하는 패키지를 설치한다. $ sudo apt autoremove $ sudo clean $ sudo apt update $ sudo apt upgrade
PIL 은 Python Imaging Library 의 약자이다. Python 에서 PIL을 import 할 때 에러가 나는 경우가 있는데, 'ImportError: No module named PIL' 은 PIL 이 python 에 설치되어 있지 않아 발생하는 오류이다. 그러므로 PIL 을 설치해주면 해결할 수 있다. PIL 은 라이브러리 이름이 PIL 이 아니라서 $ sudo pip install pillow image 위의 pillow 와 image 라이브러리를 설치해야한다.
위와 같은 에러일 경우, PC 부팅화면에서 F2, F10, F11, F12, Delete 키 등을 눌러 BIOS 창에 진입한 후, Virtualization 옵션을 활성화 해주면 해결 가능하다.
nohup nohup : no hangup 을 줄여 쓴 명령어 hang up (프로세스 중단) 을 무시하고 명령어를 실행시켜주는 명령어 $ nohup 실행 명령어 예시) $ nohup python3 code.py nohup 으로 명령어를 실행하면 'nohup.out' 이라는 출력 파일이 생성된다. 이 파일에는 해당 명령어가 실행되는 모든 출력이 저장된다. 출력(nohup.out) 없이 nohup 실행하기 nohup 으로 실행할 때 만들어지는 nohup.out 을 만들고 싶지 않을 때는 다음과 같은 방법을 사용할 수 있다. $ nohup 실행 명령어 1> /dev/null 2>&1 & 예시) $ nohup python3 code.py 1> /dev/null 2>&1 &