프로그래밍64 [Flutter] Font 적용하기 / Noto Sans CJK KR 공식 다운로드 1. 먼저 사용할 폰트를 다운로드한다. 나는 Noto Sans CJK KR을 사용했는데, 아래 링크에서 다운로드할 수 있다. https://www.google.com/get/noto/#/family/noto-sans-kore Google Noto Fonts When text is rendered by a computer, sometimes characters are displayed as “tofu”. They are little boxes to indicate your device doesn’t have a font to display the text. Google has been developing a font family called Noto, which aims to support all www... 2021. 8. 15. [Flutter] SharedPreferences 사용해 key-value 데이터 저장하기 적은 양의 key-value 데이터를 저장할 때 SharedPreferences를 사용할 수 있다. 웹의 캐시, 아이폰의 UserDefaults와 같은 개념이라고 한다. 그래서 앱을 종료한 후에도 저장된 값을 유지한다. 사용 방법 1. 의존성 추가 dependencies: flutter: sdk: flutter shared_preferences: ^2.0.6 // 210813 기준 최신버전 * 아래 링크에서 버전 확인 가능 https://pub.dev/packages/shared_preferences/install 2. 데이터 저장 // Get SharedPreferences final prefs = await SharedPreferences.getInstance(); // 'counter'라는 key로.. 2021. 8. 13. [알고리즘] 삽입 정렬(insertion sort) # insertion sort def insertion_sort(data): for idx1 in range(len(data) - 1): # 처음에 range(idx1 + 1, len(data) - 1)로 적었다. for idx2 in range(idx1 + 1, 0, -1): if data[idx2] < data[idx2 - 1]: # 이 부분은 swap이 아니라 data[idx2] = data[idx2 - 1]로 적었다. data[idx2], data[idx2 - 1] = data[idx2 - 1], data[idx2] else: break return data import random data = random.sample(range(100), 10) print(insertion_sort(data)).. 2021. 6. 21. [알고리즘] 버블 정렬(bubble sort) # bubble sort def bubble_sort(data): for idx1 in range(len(data) - 1): swap = False for idx2 in range(len(data) - 1 - idx1): if data[idx2] > data[idx2 + 1]: data[idx2], data[idx2 + 1] = data[idx2 + 1], data[idx2] swap = True if swap == False: break return data import random data = random.sample(range(100), 15) print(bubble_sort(data)) 2021. 6. 21. [Mac] M1 homebrew 설치 방법 - zsh: command not found 맥북 프로 m1 모델을 구입하고.. 환경 설정 중에 homebrew 설치가 되지 않아 한참 헤맸다. 나중의 나를 위해 기록.. 분명 설치를 했는데 command 창에 brew를 입력하면 아래와 같은 메시지가 출력됐다. zsh: command not found: brew /opt/homebrew 디렉토리 삭제 후 아래 방법대로 다시 설치하니 해결됐다.(명령어 순서대로 입력) 1. /opt 디렉토리로 이동 cd /opt 2. Homebrew 디렉토리를 만든다.(root 권한 필요) sudo mkdir homebrew 3. /opt/homebrew 디렉토리의 소유권을 부여(root 권한이 필요 없도록) sudo chown -R $(whoami) /opt/homebrew 4. homebrew를 다운로드하고.. 2021. 5. 19. 이전 1 2 3 4 5 6 7 8 ··· 13 다음