글

2021의 게시물 표시

유니코드 한글 분석

  초성 LIST_OF_ONSET = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'] 중성 LIST_OF_NUCLEUS = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ'] 종성 LIST_OF_CODA = [' ', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ', 'ㄾ', 'ㄿ', 'ㅀ', 'ㅁ', 'ㅂ', 'ㅄ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'] 한글 OFFSET OFFSET = 0xAC00 조합 @staticmethod def compos...

Raspberry Pi - visual studio code Remote.SSH

  code.visualstudio.com/docs/remote/ssh#_getting-started   Developing on Remote Machines using SSH and Visual Studio Code Developing on Remote Machines or VMs using Visual Studio Code Remote Development and SSH code.visualstudio.com Raspberry Pi 사용시 터미널로 접속하면서 Remote.SSH 를 사용하려고 시도하면 오류가 발생한다.    Remote.SSH: Remote Server Listen On Socket 을 체크한다.

Sqlite - SQLITE_BUSY 처리 방식

  여러 프로세스가 트랜젝션을 동시에 수행하려는 경우 busy 오류가 발생할 수 있다. busy 해결 방식 중 하나는 busy_timeout 시간을 설정하여 해당 시간 내에서는 계속 시도하도록 하는 것이다. PRAGMA 설정으로 busy_timeout 을 설정할 수 있다.   #PRAGMA busy_timeout=500   https://www.sqlite.org/pragma.html#pragma_busy_timeout   Pragma statements supported by SQLite If the result is a general expression, not a just the name of a source table column, then the name of the result is a copy of the expression text. www.sqlite.org   PRAGMA busy_timeout; PRAGMA busy_timeout =  milliseconds ; Query or change the setting of the  busy timeout . This pragma is an alternative to the  sqlite3_busy_timeout()  C-language interface which is made available as a pragma for use with language bindings that do not provide direct access to  sqlite3_busy_timeout() . Each database connection can only have a single  busy handler . This PRAGMA sets the busy handler for the process, possibly overwriting any previously set busy handler.   https:...

GDB - Attach Process

  Attach Process $ gdb --pid [PID]   Continue (gdb) c   Backtrace (gdb) bt   Inquire about existing threads (gdb) info threads

Ubuntu Gnome Desktop 애니메이션 효과 중지하기

  중지 $ gsettings set org.gnome.desktop.interface enable-animations false   복원 $ gsettings reset org.gnome.desktop.interface enable-animations

/bin/sh^M: bad interpreter

  스크립트를 위도우에서 생성하고 리눅스에서 실행할 때 발생   바이너리 모드로 스크립트를 편집 $ vi run.sh -b   모든 ^M 문자를 제거

윈도우에서 cgo 라이브러리 사용하기 (github.com/pebbe/zmq4)

  윈도우 환경에서 c 라이브러리를 빌드하고 cgo 를 사용하여 go 에서 사용하는 경우가 있다.    c 라이브러리의 빌드는 직접할 수도 있지만 vcpkg 에 라이브러리가 등록되어 있다면 vcpkg 를 사용하는 것이 편하다.   빌드된 라이브러리는 vcpkg/installed/x64-windows 의 include, lib, bin 에 위치한다.   cgo 는 gcc 를 사용하기 때문에 윈도우에서 gcc 를 사용할 수 있는 환경이 필요하고   앞서 빌드한 라이브러리는 해당 환경에 옮겨져야 한다.    윈도우에서 gcc 를 사용할 수 있는 라이브러리로는 mingw 가 있고   mingw 가 참조하고 있는 include, lib, bin 에 라이브러리를 옮겨야 하는 것이다.    그리고 실행시점에는 dll 을 참조할 수 있어야하는데 실행파일과 동일한 위치에 dll 을 복사하거나   윈도우 환경변수의 Path 에 dll 의 위치를 넣어줘야 한다.     github.com/pebbe/zmq4 를 예제로 과정을 정리해보자.   zmq4 는 libzmq 를 사용한다. 따라서 우선 vcpkg 로 zeromq 를 설치한다.    vcpkg/installed/x64-windows 폴더의 include, lib, bin 폴더에 각각    zmq.h, libzmq-mt-4_3_3.lib, libzmq-mt-4_3_3.dll 이 생성된다.    윈도우 환경변수 Path 에 vcpkg/installed/x64-windows/bin 폴더를 추가한다.    mingw 라이브러리로는 TDM-GCC 를 사용했다. 설치후 폴더를 확인해보면    x86_64-w64-mingw32 폴더를 찾을 수 있고 해당 폴더에서 include, lib, bin 폴더를 확인할 수...

vcpkg windows, linux 사용 방식

  별도의 폴더를 만들어서 사용한다.   windows 에서는 vcpkg_windows 로 폴더를 만들어서 환경변수에 VCPKG_ROOT 로 등록한다.  linux 에서는 vcpkg_linux 로 폴더를 만들어서 환경변수에 VCPKG_ROOT 로 등록한다. 

Skia Canvas drawString u8"90°"

  skia canvas 에서 특수 문자를 랜더링 하는 경우 String literal 에 prefix 를 붙여서 입력한다. 

flutter package 에 example app 추가 방식

  # example 프로젝트를 생성 $ flutter create example   # example 프로젝트가 window 를 지원하도록 설정 $ flutter config --enable-windows-desktop $ flutter create --platforms=windows .   # example 프로젝트가 상위 package 를 참조하도록 yaml 를 수정 package:   path: ../   # configuration 수정 Edit Configuration -> add configuation -> select main.dart

sqlite 서로 다른 두 database 에서 동일한 구조의 table 데이터 합치기 (ATTACH)

  $ sqlite3.exe sqlite> attach database "c:\a.db" as a; sqlite> attach database "c:\b.db" as b; sqlite> .databases sqlite> INSERT INTO a.table SELECT * FROM b.table; sqlite> .quit

vcpkg - install specific library version

이미지
  - 라이브러리 버전이 업데이트 된 vcpkg commit 목록을 확인 $ vcpkg x-history proj4 - vcpkg/ports/proj4 폴더 checkout $ git checkout a901b1e082d0387e25bc06ce548c189841e6f1f0 -- ports/proj4   - 설치되어 있는 라이브러리 삭제 후 재설치 $ vcpkg install proj4