망할(!) 유니코드 ㅠㅠ

sqlite의 내용이 utf-8일텐데 아무튼.. 이걸 받아서 print 하니

죄다 u'\u' 이런식으로 유니코드 문자열을 알려주는 접두와 16진수로만 출력이 된다

그래서 이걸 정상적으로 출력하는걸 찾아보는데

간편하게 출력하는건 없고.. 파이썬 print 함수의 특징으로 봐야 하려나?


튜플,리스트 단위로 출력하면 escape 된 채로

항목 하나만 출력하면 정상적으로 한글로 나온다.

도대체 머야?!


아무튼 아래와 같이 하면 정상출력되긴 한다.( u' ' 접두는 붙는다.)

print repr(a).decode("unicode-escape") 

[링크 : http://stackoverflow.com/.../python-print-unicode-strings-in-arrays-as-characters-not-code-points]

'Programming > python(파이썬)' 카테고리의 다른 글

python + openCV 공부 시작  (0) 2019.04.30
pypy  (0) 2018.04.04
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
Posted by 구차니

튜플은 (1,2,3) 식으로 출력되고

리스트는 [1,2,3] 식으로 출력된다.


다만 내용적으로는 리스트는 순서가 변할수 있으며(순서가 의미가 없다)

튜플은 순서를 바꿀수 없다(즉, 순서에 의미가 있다)


4.6.5. Tuples

Tuples are immutable sequences, typically used to store collections of heterogeneous data (such as the 2-tuples produced by the enumerate() built-in). Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a set or dict instance). 

[링크 : https://docs.python.org/3/library/stdtypes.html#tuples]


4.6.4. Lists

Lists are mutable sequences, typically used to store collections of homogeneous items (where the precise degree of similarity will vary by application). 

[링크 : https://docs.python.org/3/library/stdtypes.html#lists]

'Programming > python(파이썬)' 카테고리의 다른 글

pypy  (0) 2018.04.04
파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
python smtplib의 신비..?  (0) 2016.12.30
Posted by 구차니


type(변수명) 


참 쉽네...

[링크 : http://chouingchou.tistory.com/53]

'Programming > python(파이썬)' 카테고리의 다른 글

파이썬 print가 희한하네..  (0) 2017.04.02
파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
python sqlite3  (0) 2017.03.30
python smtplib의 신비..?  (0) 2016.12.30
python이 인기라는데..  (0) 2014.03.19
Posted by 구차니

ansi sql을 지원할줄 알았는데 그게 아니었나..

. 으로 시작하는 명령어들로 구성되어 있네


sqlite> .help

.backup ?DB? FILE      Backup DB (default "main") to FILE

.bail on|off           Stop after hitting an error.  Default OFF

.clone NEWDB           Clone data into NEWDB from the existing database

.databases             List names and files of attached databases

.dump ?TABLE? ...      Dump the database in an SQL text format

                         If TABLE specified, only dump tables matching

                         LIKE pattern TABLE.

.echo on|off           Turn command echo on or off

.eqp on|off            Enable or disable automatic EXPLAIN QUERY PLAN

.exit                  Exit this program

.explain ?on|off?      Turn output mode suitable for EXPLAIN on or off.

                         With no args, it turns EXPLAIN on.

.fullschema            Show schema and the content of sqlite_stat tables

.headers on|off        Turn display of headers on or off

.help                  Show this message

.import FILE TABLE     Import data from FILE into TABLE

.indices ?TABLE?       Show names of all indices

                         If TABLE specified, only show indices for tables

                         matching LIKE pattern TABLE.

.load FILE ?ENTRY?     Load an extension library

.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout

.mode MODE ?TABLE?     Set output mode where MODE is one of:

                         csv      Comma-separated values

                         column   Left-aligned columns.  (See .width)

                         html     HTML <table> code

                         insert   SQL insert statements for TABLE

                         line     One value per line

                         list     Values delimited by .separator string

                         tabs     Tab-separated values

                         tcl      TCL list elements

.nullvalue STRING      Use STRING in place of NULL values

.once FILENAME         Output for the next SQL command only to FILENAME

.open ?FILENAME?       Close existing database and reopen FILENAME

.output ?FILENAME?     Send output to FILENAME or stdout

.print STRING...       Print literal STRING

.prompt MAIN CONTINUE  Replace the standard prompts

.quit                  Exit this program

.read FILENAME         Execute SQL in FILENAME

.restore ?DB? FILE     Restore content of DB (default "main") from FILE

.save FILE             Write in-memory database into FILE

.schema ?TABLE?        Show the CREATE statements

                         If TABLE specified, only show tables matching

                         LIKE pattern TABLE.

.separator STRING ?NL? Change separator used by output mode and .import

                         NL is the end-of-line mark for CSV

.shell CMD ARGS...     Run CMD ARGS... in a system shell

.show                  Show the current values for various settings

.stats on|off          Turn stats on or off

.system CMD ARGS...    Run CMD ARGS... in a system shell

.tables ?TABLE?        List names of tables

                         If TABLE specified, only list tables matching

                         LIKE pattern TABLE.

.timeout MS            Try opening locked tables for MS milliseconds

.timer on|off          Turn SQL timer on or off

.trace FILE|off        Output each SQL statement as it is run

.vfsname ?AUX?         Print the name of the VFS stack

.width NUM1 NUM2 ...   Set column widths for "column" mode

                         Negative values right-justify 


sql 명령은 그냥 직접 치면 된다.

[링크 : http://blog.simplism.kr/?p=2329]

'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
라즈베리 sqlite 버전  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니

sqlite 2.8은 당연하지만(!) 3.x 대의 파일을 열수 없다.

$ sqlite -version

2.8.17


$ sqlite3 -version

3.8.7.1 2014-10-29 13:59:56 3b7b72c4685aa5cf5e675c2c47ebec10d9704221 


sqlite 3.x 대의 db를 열려고 하니 에러가 발생! ㅠㅠ

$ file *

sqlite.udb: SQLite 3.x database 


$ sqlite sqlite.udb

Unable to open database "sqlite.udb": file is encrypted or is not a database


'프로그램 사용 > sqlite' 카테고리의 다른 글

sqlite primary key  (0) 2019.03.12
sqlite dateime  (0) 2018.11.27
sqlite3 도움말  (0) 2017.04.02
sqlite 브라우저 / 윈도우용  (0) 2017.03.23
sqlite  (0) 2013.07.19
Posted by 구차니
분류가 모호한 글2017. 4. 1. 18:08

등산하는 분들 하나씩 달고 다니는

딸깍하고 걸리는 후크가 원래 명칭이

비너가 아니라 카라비너 인 듯


[링크 : http://krdic.naver.com/detail.nhn?docid=38498400]




'분류가 모호한 글' 카테고리의 다른 글

럭스블럭 luxblock  (0) 2017.05.25
미세먼지 보는 사이트  (0) 2017.04.19
샘플 pcb 5만원!  (0) 2017.02.24
크롬 주소표시줄 한글 강제 인코딩 관련  (0) 2017.01.02
NVD - National Vulnerability Database  (0) 2016.02.01
Posted by 구차니
개소리 왈왈/컴퓨터2017. 3. 31. 09:13

아놔.. 실험을 좀 더 해봐야 알겠지만

kitkat 설정중 절전모드에서 

CPU 성능을 제한하면


GPS 어플이 죽는다!!! (화면을 끄던 백그라운드로 가던)

솔찍히 CPU 성능 제한으로 전력소비가 그리 크진 않았던 걸로 기억을 하는데

자전거 탈때만 CPU 성능 제한을 풀어야 하나..


powersave 2.66W

>> kernl -j4 2.67W

>> kernl -j2 2.86W


performance 2.77W

>> kernel -j4 6.3W 

2016/10/01 - [embeded/odroid] - odroid u3 전력소모량 체크


Posted by 구차니

python에서 sqlite 파일을 접속해서 조작하는 방법


$ sudo apt-get install python-sqlite

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

  libsqlite0

Suggested packages:

  python-sqlite-dbg

The following NEW packages will be installed:

  libsqlite0 python-sqlite

0 upgraded, 2 newly installed, 0 to remove and 7 not upgraded.

Need to get 141 kB of archives.

After this operation, 519 kB of additional disk space will be used.

Do you want to continue? [Y/n]

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libsqlite0 armhf 2.8.17-12 [119 kB]

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main python-sqlite armhf 1.0.1-11 [21.3 kB]

Fetched 141 kB in 1s (95.8 kB/s)

Selecting previously unselected package libsqlite0.

(Reading database ... 137326 files and directories currently installed.)

Preparing to unpack .../libsqlite0_2.8.17-12_armhf.deb ...

Unpacking libsqlite0 (2.8.17-12) ...

Selecting previously unselected package python-sqlite.

Preparing to unpack .../python-sqlite_1.0.1-11_armhf.deb ...

Unpacking python-sqlite (1.0.1-11) ...

Setting up libsqlite0 (2.8.17-12) ...

Setting up python-sqlite (1.0.1-11) ...

Processing triggers for libc-bin (2.19-18+deb8u7) ...


pi@raspberrypi:~ $ cd src

pi@raspberrypi:~/src $ ll

total 2060

drwxr-xr-x  2 pi pi    4096 Mar 30 14:40 .

drwxr-xr-x 30 pi pi    4096 Mar 30 14:34 ..

-rw-r--r--  1 pi pi 2099200 Mar 29 12:29 sqlite.udb


pi@raspberrypi:~/src $ python

Python 2.7.9 (default, Sep 17 2016, 20:26:04)

[GCC 4.9.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import sqlite3

>>> conn = sqlite3.connect('sqlite.udb')

>>> c = conn.cursor()

>>> c.execute("select * from tbl_recv")

<sqlite3.Cursor object at 0x769eaa20> 


데이터가 유니코드로 나오나..

# we can also implement a custom text_factory ...

# here we implement one that will ignore Unicode characters that cannot be

# decoded from UTF-8

con.text_factory = lambda x: unicode(x, "utf-8", "ignore") 


[링크 : https://docs.python.org/2/library/sqlite3.html]

'Programming > python(파이썬)' 카테고리의 다른 글

파이썬 리스트(list)와 튜플(tuple)  (0) 2017.04.02
파이썬 type 확인하기  (0) 2017.04.02
python smtplib의 신비..?  (0) 2016.12.30
python이 인기라는데..  (0) 2014.03.19
python2 vs python3  (0) 2013.01.02
Posted by 구차니

아부지가 또 이상한데 삘 받으신거 같은데...

일단 검색해보니..


텔레컨버터랑은 다르게, 렌즈와 바디 사이에 달리는거라 이런저런 제약이 잇고

기본적으로 L렌즈에 대응하는 단렌즈용 이라는 게 기본

* 대응렌즈 : 초점 거리 135mm 이상의 단초점 렌즈 (구매전 꼭 대응렌즈 전체를 확인하시기 바랍니다.) 


*1 Extender EF1.4 × III 사용시 AF 속도가 약 절반으로 느려질 수 있습니다.

*2 EOS-1v/HS, EOS-3, EOS-1Ds Mark III, EOS-1Ds Mark II/1Ds/1D Mark IV/1D Mark III/1D Mark II N/1D Mark II/1D를 사용하는 경우에만 중앙측거점에서만 AF가 가능합니다. 기타 EOS에서는 수동 초점입니다.

*3 멀티 포인트 측거의 EOS에 장착시, 중앙측거점만 AF 촬영이 가능합니다.

*4 손떨림 보정 가능한 카메라는 EOS-1V/HS, EOS-1Ds Mark III, EOS-1Ds Mark II/1Ds/1D Mark IV/1D Mark III/1D Mark II N/1D Mark II/1D, EOS 5D Mark II, EOS 5D, EOS 7D, EOS 60D, EOS 50D, EOS 40D, EOS 30D, EOS 20D, EOS 20Da, EOS 10D, EOS D60/D30, EOS 550D, EOS 500D, EOS 450D, EOS 400D, EOS 350D, EOS 300D, EOS D6000/D2000, EOS * DCS1 / 3입니다. 

[링크 : http://www.canon-ci.co.kr/product/EXT._EF1.4XIII/EF-lens/Extenders/content/NPAB796728]


*1 Extender EF2 × III 사용시 AF 속도가 약 1/4로 느려질 수 있습니다. 

[링크 : http://www.canon-ci.co.kr/product/EXT._EF2X_III/EF-lens/Extenders/content/NPAB796727]


그리고 카메라 기종과 모델에 따라 렌즈가 밝아야 AF가 되거나

AF가 되어도 AF 속도가 1/4로 떨어지거나

아예 AF자체가 불가능 하게 되는 경우도 존재하는 듯..

[링크 : http://support-kr.canon-ci.co.kr/contents/KR/KR/8201703800.html]

'하드웨어 > 캡쳐보드 카메라' 카테고리의 다른 글

Magewell Pro Capture SDI  (0) 2017.11.30
카메라 삼각대 나사 규격  (0) 2017.06.15
camera link에 대한 고찰 + grabber(캡쳐장비)  (0) 2017.03.10
M72 마운트?  (0) 2017.03.10
동영상 소프트웨어 IS 보정  (0) 2017.02.20
Posted by 구차니
개소리 왈왈/자전거2017. 3. 30. 10:58

저번 주말에 10km도 엉덩이 아파서 못탔는데

6월에 타려면 미리 열심히 연습해야 할지도 ㅠㅠ




Posted by 구차니