반응형

전체 글 310

Modbus protocol

수업을 보는 방법 https://youtube.com/playlist?list=PLz--ENLG_8TPJsTDyihX9_fdpLPFdd1xl 🚌 모드버스 프로토콜 www.youtube.com RS485 TCP RTU Over TCP 수업 목록 RS485의 이해(1/2) RS485의 이해(2/2) 마스터 슬레이브 존재의 이유, 드라이버란 시리얼통신 프로그램 만들기 모드버스 검증 툴 사용 이유 및 사용 방법 모드버스 검증 툴을 통한 개념이해(1/2) 모드버스 검증 툴을 통한 개념이해(2/2) 모드버스 패킷 분석 CRC란? CRC 구하는 프로그램 구현 모드버스 TCP 모드버스 RTU Over TCP

[Nvidia] GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC

Env. Docker pytorch/pytorch:1.10.0-cuda11.3-cudnn8-devel ※ 참고 실제 나의 상황에서는 docker root 권한으로 실행되어 sudo를 제외하고 명령을 실행함. 문제 상황 $ sudo apt-get update 위 명령어를 실행하였을 때, 아래와 같은 오류가 발생하였다. W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC E: The..

Development/Docker 2022.05.23

[Docker] docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled 문제 상황 Docker를 실행함에 있어 아래와 같은 오류가 발생하였다. docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. ERRO[0000] error waiting for container: context canceled nvidia-smi를 실행시켜 보았지만, gpus는 정상적으로 잡혀 구글링을 통하여 해..

Development/Docker 2022.05.23

[이코테 2021] 5장 그래프 탐색 알고리즘 [실전문제] 미로 탈출

나의 풀이 n, m = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int,input()))) from collections import deque dr = [0, -1, 0, 1] dc = [1, 0, -1, 0] def bfs(r, c): q = deque() q.append([r,c]) while q: r, c = q.popleft() for i in range(4): nr = r + dr[i] nc = c + dc[i] if 0 = m: continue # 벽인 경우 무시 if graph[nx][ny] == 0: continue # 해당 노드를 처음 방문하는 경우에만 최단 거리 기록 if graph[nx..

[이코테 2021] 5장 그래프 탐색 알고리즘 [실전문제] 음료수 얼려 먹기

나의 풀이 n, m = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int, input()))) def dfs(r, c): if r =n or c = m: return False else: if world[r][c] == 0: world[r][c] = 1 dfs(r-1, c) dfs(r+1, c) dfs(r, c-1) dfs(r, c+1) return True else: return False cnt = 0 for r in range(n): for c in range(m): if dfs(r, c): cnt += 1 print(cnt) 답안 예시 # N, M을 공백을 기준으로 ..

[이코테 2021] 4장 구현 [실전문제] 게임 개발

나의 풀이 n, m = map(int, input().split()) a, b, d = map(int, input().split()) world = [] for _ in range(n): world.append(list(map(int, input().split()))) def turn_left(): global d if d == 0: d = 3 else: d -= 1 def visited(): global world world[a][b] = 2 cnt = 1 turn_cnt = 0 left_types = [[0,-1], [-1,0], [0,1], [1,0]] back_types = [[1,0], [0,-1], [-1,0], [0,1]] visited() while True: tmp_a, tmp_b = a..

[이코테 2021] 4장 구현 [실전문제] 왕실의 나이트

나의 풀이 position = input() r = int(position[1]) c = ord(position[0]) - ord('a') + 1 move_types = [[2,1], [2,-1], [-2,1], [-2,-1], [1,2], [-1,2], [1,-2], [-1,-2]] cnt = 0 for m in move_types: tmp_r = r + m[0] tmp_c = c + m[1] if 0 < tmp_r < 9 and 0 < tmp_c < 9: cnt += 1 print(cnt) 답안 예시 # 현재 나이트의 위치 입력받기 input_data = input() row = int(input_data[1]) column = int(ord(input_data[0])) - int(ord('a')) ..

[TensorRT] Keras, Tensorflow Model을 TensorRT로 변환(TF-TRT Inference)

※ 본 글은 아래의 예제을 test하며, 작성한 글입니다. https://github.com/tensorflow/tensorrt/blob/master/tftrt/examples/image_classification/NGC-TFv2-TF-TRT-inference-from-Keras-saved-model.ipynb GitHub - tensorflow/tensorrt: TensorFlow/TensorRT integration TensorFlow/TensorRT integration. Contribute to tensorflow/tensorrt development by creating an account on GitHub. github.com 1. Env. 아래의 Docker를 사용하였습니다. (colab과 ..

[이코테 2021] 3장 그리디 [실전문제] 1이 될 때까지

나의 풀이 n, k = map(int, input().split()) cnt = 0 while n != 1: if n % k == 0: n //= k cnt += 1 else: n -= 1 cnt += 1 print(cnt) 답안 예시 # N, K을 공백을 기준으로 구분하여 입력 받기 n, k = map(int, input().split()) result = 0 // N이 K 이상이라면 K로 계속 나누기 while n >= k: # N이 K로 나누어 떨어지지 않는다면 N에서 1씩 빼기 while n % k != 0: n -= 1 result += 1 # K로 나누기 n //= k result += 1 # 마지막으로 남은 수에 대하여 1씩 빼기 while n > 1: n -= 1 result += 1 pr..

[이코테 2021] 3장 그리디 [실전문제] 숫자 카드 게임

나의풀이 n, m = map(int, input().split()) arr = [] min_arr = [] for _ in range(n): tmp = list(map(int, input().split())) min_arr.append(min(tmp)) arr.append(tmp) print(max(min_arr)) 답안 예시 # N, M을 공백을 기준으로 구분하여 입력 받기 n, m = map(int, input().split()) result = 0 # 한 줄씩 입력 받아 확인하기 for i in range(n): data = list(map(int, input().split())) # 현재 줄에서 '가장 작은 수' 찾기 min_value = min(data) # '가장 작은 수'들 중에서 가장 큰 ..

[이코테 2021] 3장 그리디 [실전문제] 큰 수의 법칙

나의 풀이 n, m, k = map(int, input().split()) arr = list(map(int, input().split())) arr.sort(reverse=True) num = m // (k+1) result = (arr[0]*k + arr[1])*num + arr[0]*(m%(k+1)) print(result) 답안 예시 # N, M, K를 공백을 기준으로 구분하여 입력 받기 n, m, k = map(int, input().split()) # N개의 수를 공백을 기준으로 구분하여 입력 받기 data = list(map(int, input().split())) data.sort() # 입력 받은 수들 정렬하기 first = data[n - 1] # 가장 큰 수 second = data[..

[이코테 2021] 3장 그리디 [예제 3-1] 거스름돈

나의 풀이 n = int(input()) coins = [500, 100, 50, 10] count = 0 for c in coins: if n//c > 0: count += n//c n = n%c print(count) # / : 나누기 # // : 몫 # % : 나머지 답안 예시 n = 1260 count = 0 # 큰 단위의 화폐부터 차례대로 확인하기 coin_types = [500, 100, 50, 10] for coin in coin_types: count += n // coin # 해당 화폐로 거슬러 줄 수 있는 동전의 개수 세기 n %= coin print(count)

반응형