Programming/C Win32 MFC2017. 4. 4. 20:41

음.. CString에서 제공하는 메소드는 아래뿐이네.. GetData() 나 다른것들은 상속에 의해서 다른 클래스에서 온 듯

operator LPCTSTR

GetBuffer() 

[링크 : https://msdn.microsoft.com/en-us/library/aa315043(v=vs.60).aspx]


GetString()은 누구꺼냐.. CObject의 스멜이 나긴 한다만...

(LPCTSTR)로 캐스팅하는 것과 거의 구현이 같은 GetString() 이란 메소드도 있습니다. 

[링크 : https://indidev.net/forum/viewtopic.php?f=5&t=92]


음.. 걍 void* 형으로 캐스팅?

CString str = L"английский"; //Russian Language

DWORD dwWritten=0;

WriteFile(pHandle , (void*) str, str.GetLength()*sizeof(TCHAR),&dwWritten , NULL);

[링크 : https://social.msdn.microsoft.com/.../how-to-send-unicode-characters-to-serial-port?forum=vcgeneral]


LPSTR - Long Pointer STRing

LPCSTR - LP Const STRing

LPTSTR - LP Tchar STRing

LPCTSTR - LPC Tchar STRing

LPWSTR - LP Wchar STRing

LPCWSTR - LP Const Wchar STRing

[링크 : http://pelican7.egloos.com/v/1768951]


char 형식의 좁은 문자 리터럴(예: 'a')

wchar_t 형식의 와이드 문자 리터럴(예: L'a')

char16_t 형식의 와이드 문자 리터럴(예: u'a')

char32_t 형식의 와이드 문자 리터럴(예: U'a') 

[링크 : https://msdn.microsoft.com/ko-kr/library/69ze775t.aspx]


TEXT("")과 _T("")의 차이점은

TEXT("")는 WinNT.h에서 #define했고

_T("")는 tchar.h에서 TEXT가 4글자라서 _T이렇게 2글자로 #define했다. 

[링크 : http://x108zero.blogspot.kr/2013/12/text-t-l.html]



+

tchar.h

#define __T(x)      L ## x

#define _T(x)       __T(x)


음.. L 이야 Long에 대한 prefix literal 이니...까?



'Programming > C Win32 MFC' 카테고리의 다른 글

mfc ccombobox 문자열 받아오기  (0) 2017.04.05
MFC 라디오버튼 사용하기  (0) 2017.04.05
bit field와 컴파일러별 byte align  (0) 2017.03.27
MFC CButton 마우스 클릭시 작동하기  (0) 2017.03.08
GetHttpConnection()  (0) 2017.03.03
Posted by 구차니

시리얼포트 10번 이후 열기라는 글이 있어서 보니


버그가 있어서 COM9 까진 그냥 여는데, 그 이후에는

\\.\COM%d 식으로 표현을 해야 하는데 escape 문자를 넣어주어야 하니 이렇게 미친듯이 길어진다.


hPort = CreateFile("\\\\.\\COM10", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); 

[링크 : http://stackoverflow.com/questions/11775185/open-a-com-port-in-c-with-number-higher-that-9]

Posted by 구차니

심심해서 계산을 해보니


많이 차이나는데?


소주 360ml 20~16.5도 59.4ml~72ml(알콜함량)

병맥 500ml 4.5도 22.5ml(알콜함량)


알콜양으로도 맥주 두병은 먹어야 소주 한병 될까 말까네?



아.. 큐팩은

1800ml 4.5도 81ml 이니까 소주보다 많아지는군 ㅋ

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

연휴 끝  (0) 2017.05.07
망할 실손보험 !!!  (0) 2017.04.11
대한통운 택배 스미싱?  (0) 2017.03.27
AMD 라이젠(zen) 프로세서 발표  (0) 2017.03.05
환공어묵  (0) 2017.02.23
Posted by 구차니
embeded/Cortex-M3 Ti2017. 4. 4. 11:41

이걸 샀는데 헉.. 2.54mm 간격이 아니네?!?!

아무튼.. 얘는 Serial Wire Debugger라.. JTAG 핀을 제공하지 않는다.

[링크 : http://www.devicemart.co.kr/1320869]


그림판으로 장난질.

SWD는 SWC SWD SWO 세개 이고

JTAG은 TCK TMS TDI TDO 인데

TDI를 제외한 3개의 핀은 연결이 가능한 듯 하다


데이터시트상 핀 배열은 이런데.. 

핀설명은 아래와 같음

+

[링크 : http://forum.falinux.com/zbxe/?document_srl=796669...readed_count]


+

실험을 해보니 다 필요 없고..

최소사양(?)인 SWCLK +SWDIO(I/O) 딱 두줄이면 끝..

지금까지 JTAG으로 쓴 줄 알았는데 SWD로 쓰고 있었다는거에 한번 더 깜놀..

'embeded > Cortex-M3 Ti' 카테고리의 다른 글

keil sct - 링커 스크립트  (0) 2017.12.11
lm3s 부트로더  (0) 2017.11.21
어? 의외로 RX busy는 없네?  (0) 2017.03.27
lm3s1607 uart pull up 문제  (0) 2017.03.24
ti cortex-m3 driverlib - UARTConfigSetExpClk()  (0) 2017.03.23
Posted by 구차니

그런데 미세먼지 쩖

먹어서 응원하자?!


일회용 마스크로는 어림도 없어 보이고

조만간 스포츠 마스크 하나 사야 할 듯 ㅠㅠ


그나저나.. 평속 20km도 안되네 ㅋㅋㅋ

어느 세월에 예전 25km 수준을 복구하려나 ㅠㅠ


Posted by 구차니

EF / EF-S는 플랜지 는 같고

EF-M은 짧다?


Canon's EF-M has an 18mm flange focal distance, compared to 44mm for the EF and EF-S systems. 

[링크 : http://photo.stackexchange.com/questions/27254/whats-the-difference-between-canon-ef-s-and-ef-m]



+

The flange focal distance is 17.526 millimetres (0.6900 in) for a C mount.

CS-mount has a flange focal distance of 12.50 millimetres (0.492 in)

[링크 : https://en.wikipedia.org/wiki/C_mount]


Its large diameter and relatively short flange focal distance of 44.0 mm allows mechanical adaptation of EF camera bodies to many types of non-EF lenses.

[링크 : https://en.wikipedia.org/wiki/Canon_EF_lens_mount]


M42 lens mount Flange 45.5 mm

[링크 : https://en.wikipedia.org/wiki/M42_lens_mount]


마운트 종류 엄청 많네 -_-?

[링크 : https://en.wikipedia.org/wiki/Lens_mount#List_of_lens_mounts]

'이론 관련 > 사진 광학 관련' 카테고리의 다른 글

열영상 이미지 - 컬러  (0) 2017.08.24
ir corrected lens ld low dispersion  (0) 2017.07.04
이미지 센서 - ccd cmos 비교  (0) 2016.09.22
크롭바디 EF / EF-S 렌즈 화각 테스트  (0) 2016.08.29
back focus  (0) 2016.07.22
Posted by 구차니

망할(!) 유니코드 ㅠㅠ

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 구차니