Skip to content

Instantly share code, notes, and snippets.

View 201411108's full-sized avatar
💻
working

Handong Kim 201411108

💻
working
View GitHub Profile
@201411108
201411108 / reversal_list.py
Created August 14, 2021 12:42
numpy 없이 이중배열 행열 반전하기
# target_list : [][]
list(map(list, zip(*target_list)))
@201411108
201411108 / undirected_graph_input.py
Last active July 27, 2021 01:52
in acmicpc, undirected graph input methods
import sys
n, m, v = list(map(int, sys.stdin.readline().split())) # N개의 정점, M개의 간선, 시작 노드 V
graph = [[] for _ in range(n + 1)] # n + 1인 이유 -> 편의상, 문제에 주어지는 값 그대로를 사용하기 위해
"""dictionary 사용 시
graph = collections.defaultdict(list) # 단 이 경우, 노드를 조회할 때 list(graph) 형태로 해줘야 에러가 발생하지 않는다.
"""
# 양방향 그래프 일 경우
for _ in range(m):
@201411108
201411108 / bfs_queue.py
Created July 11, 2021 04:43
BFS(queue)_python
def bfs(start_v):
discovered = [start_v]
queue = deque()
queue.append(start_v)
while queue:
v = queue.popleft()
for w in graph[v]:
if w not in discovered:
discovered.append(w)
queue.append(w)
@201411108
201411108 / dfs_stack.py
Last active July 18, 2021 05:56
DFS(stack)_python
def iterative_dfs(start_v):
discovered = []
stack = [start_v]
while stack:
v = stack.pop()
if v not in discovered:
discovered.append(v)
for w in graph[v]:
stack.append(w)
@201411108
201411108 / dfs_recurvise.py
Last active July 11, 2021 04:40
DFS(recursive)_python
def recursive_dfs(v, discovered=[]):
discovered.append(v)
for w in graph[v]:
if w not in discovered:
discovered = recursive_diff(w, discovered)
return discovered
# adjacency list
graph = {
1: [2, 3, 4],
@201411108
201411108 / fix_exfat_drive.md
Created April 28, 2020 06:32 — forked from scottopell/fix_exfat_drive.md
Fix corrupted exFAT disk macOS/OSX

exFAT support on macOS seems to have some bugs because my external drives with exFAT formatting will randomly get corrupted.

Disk Utility is unable to repair this at first, but the fix is this:

  1. Use diskutil list to find the right drive id.
  2. You want the id under the IDENTIFIER column, it should look like disk1s1
  3. Run sudo fsck_exfat -d <id from above>. eg sudo fsck_exfat -d disk1s3
  4. -d is debug so you'll see all your files output as they're processed.
  5. Answer YES if it gives you the prompt Main boot region needs to be updated. Yes/No?