Programming/C Win32 MFC2017. 4. 14. 14:55

워드를 보면 이런 기능이 있는데





어떻게 구현하는거지? 고민을 했거늘...

결론은 이렇게 쉬운거였나...


karaofdec 11-04-01 09:28  

네...GetWindowRect로 해결 했습니다. 

아래와 같이 하니 상하 크기만 줄어드는 효과를 낼 수 있네요... 

CRect dialog_rc; 

this->GetWindowRect(dialog_rc); 

dialog_rc.bottom += 100; 

dialog_rc.right += 100; 

MoveWindow(dialog_rc); 

[링크 : http://www.tipssoft.com/bulletin/tb.php/QnA/19829]


+

다이얼로그에다가 직접 노가다로 이것저것 넣었다 뺏다 하는거 보다는

이렇게 창 크기를 변경하는게 유용할 듯?



+

생각난김에 동적 컨트롤 추가

[링크 : http://yowon009.tistory.com/418]

[링크 : http://www.tipssoft.com/bulletin/tb.php/update/804] << 요거

    [링크 : http://www.tipssoft.com/bulletin/tb.php/QnA/13289]


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

cstring 'null' append 문제?  (0) 2017.05.18
MFC 시간측정(msec)  (0) 2017.04.18
mfc ccombobox 문자열 받아오기  (0) 2017.04.05
MFC 라디오버튼 사용하기  (0) 2017.04.05
mfc cstring 문자열 관련(유니코드)  (0) 2017.04.04
Posted by 구차니

나 같은 프로그래머야 손쉽게

특정 메모리 번지에 값을 쓰면 하드웨어가 제어되는데

이게 하드웨어적으로 어떻게 처리되는지가 궁금해서 찾다가 든 생각


어짜피 CPU 내부 레지스터는 플립플롭이고 값이 변화하지 않는 이상 + 전기가 공급되는 이상

회로에 입력으로 쓰일수 있는 값이 지속적으로 나오고 있으니

레지스터는 하드웨어 플립플롭이고

cpu의 메모리 디코더를 통해 해당 플립플롭으로 값을 쓸수 있도록

메모리 번지와 하드웨어 어드레스 매칭을 통해 cpu에서 저장할 공간을 해당 플립플롭을 연결해주면

하드웨어 - 소프트웨어 연결이 끝! 일려나?


다만 DRAM의 경우 읽으면 다시 리프레시 하거나 해줘야 하니

이런식으로 쓰긴 힘들거 같고.. 그래픽 카드 값은 넓은 범위의 메모리를 쓰는 녀석들은

DMA 등을 통해 자기 자신의 메모리가 건드려지게 되면 내부적으로 트리거 되서 작동하도록 되어 있으려나?



결론은.. 현 구조의 CPU 에서는 레지스터는 필수불가결한 존재?


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

'이론 관련 > 컴퓨터 관련' 카테고리의 다른 글

GPS DOP  (0) 2017.06.14
DDR3 ZQ calibration  (0) 2017.04.27
CMT SMT?  (0) 2017.03.06
db shading  (0) 2016.05.08
h.264 헤더  (0) 2016.02.02
Posted by 구차니
이론 관련/전기 전자2017. 4. 14. 09:41

AND OR NOT

NAND NOR XOR


기호에 동그라미는 NOT 입력이나 NOT 출력


[링크 : http://www.ktword.co.kr/abbr_view.php?nav=2&id=735]



AND / OR / NOT 게이트 회로

AND/OR는 다이오드와 저항만 있으면되고

NOT은 TR이 있어야 하는 군...


[링크 : http://jht0620.tistory.com/37]



각종 회로기호 모음

[링크 : http://forum.falinux.com/zbxe/index.php?document_srl=550845]


버퍼(NOT에 동그라미 뺸거)

[링크 : http://bunrint10103.tistory.com/entry/BUFFER-게이트]


버퍼 사용 이유 - 팬아웃(fan out)

[링크 : http://blog.daum.net/trts1004/12108898]


FET 기호 - 꼭 스위치 같네...

ATmega128 / GPIO 회로에서 좌상단


'이론 관련 > 전기 전자' 카테고리의 다른 글

배터리 방전율 관련  (0) 2017.07.04
LVCMOS, LVTTL  (0) 2017.05.24
크리스탈 정밀도 - PPM  (0) 2016.11.23
자전거 속도계 센서 - 리드 스위치  (0) 2016.11.23
27MHz에 1Mohm 저항을 왜 달까?  (2) 2016.10.26
Posted by 구차니
Programming/php2017. 4. 13. 18:55

php에서 세션은 /tmp에 파일로 저장되는데(리눅스 기준)

/tmp는 누구나 접근이 가능한 곳이라 보안상의 문제가 되기에

세션변수로 패스워드를 저장하면 안된다고 한다.


[링크 : http://blog.habonyphp.com/entry/php-세션-데이터-보안의-중요성]


그리고 /tmp는 파일로 저장하기에 세션변수를 많이 쓰면 file i/o로 부하가 많이 걸릴수 있다.

[링크 : http://jonnung.github.io/php/2016/12/17/php-session-start-inefficient/]


그래서 memcached 라던가 sqlite 등의 DB에 세션을 저장하는 거였나...

$ sudo apt-cache search memcache

php5-memcache - memcache extension module for PHP5

php5-memcached - memcached extension module for PHP5, uses libmemcached

memcached - high-performance memory object caching system

memcachedb - Persistent storage engine using the memcache protocol 

[링크 : http://php.net/manual/en/book.memcached.php]



+

원래 찾으려고 했던 내용...

걍 global로 지정해서 저장하던가 아니면 class로 해서 변수 저장하던가.. 인가?

[링크 : http://blog.naver.com/mikong22/220835017565]

'Programming > php' 카테고리의 다른 글

php static과 변수 유효범위  (0) 2017.04.15
php 상수 선언 - define  (0) 2017.04.15
php mvc 구현(+ PDO)  (2) 2017.04.07
php mysql 자동증가값 받기  (0) 2017.03.14
php zend guard ?  (2) 2017.03.14
Posted by 구차니

혹시나 해서 먼가 잘못한게 있나 onenote 깔아봐도

선택해서 옮기거나 축소 확대 하는 기능은

갤럭시 노트 3 이후 버전의 S 노트 밖에 없네


확실히 노트 2용 S노트는 벡터가 아니라 픽셀 단위로 삭제 되고

노트3용 부터 벡터로 그려서 확대 축소가 가능한 듯

그나마 아쉬운대로 윈도우 필기장 비슷하게 쓰는 중


단, 노트 2에서는 갤럭시 앱스에 들어가서 S 노트를 설치해야 한다.




찾아보니 PC 버전도 있네?

S노트 자체는 삼성계정과 에버노트 정도(한번 깐적이 있어서...)는 동기화 되는거 같은데..

[링크 : http://www.samsung.com/sec/galaxy/apps/s-note/]


+

에버노트는 이동은 되는데 크기 조절은 안된다.

'개소리 왈왈 > 모바일 생활' 카테고리의 다른 글

smardi gam.r 분해  (0) 2017.04.25
노트2 S펜 / 2710p 펜  (2) 2017.04.14
노트2는 ART 미지원?  (0) 2017.04.11
skt용 갤럭시 노트2 3g 만 사용하기  (0) 2017.03.26
라이트닝 - USB 어댑터 분해  (0) 2017.03.25
Posted by 구차니
개소리 왈왈/블로그2017. 4. 13. 08:58

집에 가서 한번

핸드폰으로 한번

회사에서 한번

이제.. 남은건 아이패드 하나인가 -_-


그런데...

이거 보안설정 된건 오래전부터 알고 있는데

왜 갑자기 이게 뜨는거야?




Posted by 구차니

wiki 식으로 리비전을 계속 올리면서 저장을 하게 되면...

고민을 해보니 대용량의 경우 엄청나게 용량을 쳐묵쳐묵 하게 되는데

(wiki 페이지 하나가 400kb 넘어가는데 그걸 하루 한번 1년 한다고 하면..)

내용 자체를 compress 해서 넣고 decompress 해서 사용하면 조금 느려도 괜찮으려나 싶었지만

sql 문을 통해 검색이 안될거 같아서 포기..


그러다가 찾은게.. db 자체를 압축하는 건데

라즈베리 버전에서는 활성화가 안되어있는지 안뜬다.

COMPACT랑 REDUNDANT만 뜨는 상태..


[링크 : http://stackoverflow.com/questions/8228950/compressing-text-before-storing-it-in-the-database]


[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-row-format-dynamic.html]

[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-row-format-antelope.html]


+

phpmyadmin 에서 sql을 통해 실행해도 나온다.



SET GLOBAL innodb_file_per_table=1;

SET GLOBAL innodb_file_format=Barracuda; 

[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-compression-usage.html]


기본값은 antelope 이고 barracuda는 신규 포맷


[링크 : https://dev.mysql.com/doc/refman/5.6/en/innodb-file-format.html]

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

db varchar 와 char  (0) 2017.05.09
db에 mac / ip 저장하기(자료형)  (0) 2017.05.09
mysql view  (0) 2017.03.14
db designer  (0) 2017.03.14
데이터베이스 구조 버전관리  (0) 2017.02.13
Posted by 구차니
프로그램 사용/apache2017. 4. 12. 09:43

에러로그 설정하고 보는데 먼소리인지 모르겠다 ㅠㅠ

일단 규칙은 아래와 같이 들어온 주소를 index.php?url="어쩌구" 식으로 바꾸어 주는건데

문제는 ^(.+)$ ...

처음부터 끝까지 내용이 없던 머던 상관없는데 이걸 $1로 치환하라 인데

Options -MultiViews

RewriteEngine On

Options -Indexes

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L] 


현재 읽혀 있는 경로에서 달라지는 내용만을 적용대상으로 삼는건가?

/var/www/html/arch/test/index.php 에서 있는 파일은 웹상으로 접속하면

http://localhost/arch/test 인데, 이 파일에서 링크된 다른 경로

arch/test/board는 이전 주소를 기본으로 볼때 board가 하나 추가 된 셈이니

test 이후의 board만 들어가서 rewrite rule에 적용을 받는건가?

 [perdir /var/www/html/arch/test/] add path info postfix: /var/www/html/arch/test/board -> /var/www/html/arch/test/board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/board/ -> board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'board/', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] rewrite 'board/' -> 'index.php?url=board/', referer: http://localhost/arch/test/board/

 split uri=index.php?url=board/ -> uri=index.php, args=url=board/, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] add per-dir prefix: index.php -> /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip document_root prefix: /var/www/html/arch/test/index.php -> /arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] internal redirect with /arch/test/index.php [INTERNAL REDIRECT], referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/index.php -> index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'index.php', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/index.php, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] strip per-dir prefix: /var/www/html/arch/test/public/css/style.css -> public/css/style.css, referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] applying pattern '^(.+)$' to uri 'public/css/style.css', referer: http://localhost/arch/test/board/

 [perdir /var/www/html/arch/test/] pass through /var/www/html/arch/test/public/css/style.css, referer: http://localhost/arch/test/board/ 


[링크 : http://webskills.kr/archives/515]


+

QSA는 Cond를 지난 결과에 덧 붙인다라는 의미..

음.. 경로의 마법은 저 Cond와 QSA인가?

[링크 : http://soul0.tistory.com/208]


+

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request, if this has already been determined by the server at the time REQUEST_FILENAME is referenced. Otherwise, such as when used in virtual host context, the same value as REQUEST_URI. Depending on the value of AcceptPathInfo, the server may have only used some leading components of the REQUEST_URI to map the request to a file.


REQUEST_URI

The path component of the requested URI, such as "/index.html". This notably excludes the query string which is available as its own variable named QUERY_STRING.

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


Filename should give you the complete local path, where request uri will be exactly what was requested (should also include the GET parameters). From the manual:

REQUEST_URI

The resource requested in the HTTP request line. (In the example above, this would be "/index.html".)

REQUEST_FILENAME

The full local filesystem path to the file or script matching the request. 

[링크 : http://www.miva.com/...-htaccess-what-s-the-difference-between-request_filename-and-request_uri]

Posted by 구차니
프로그램 사용/apache2017. 4. 12. 09:30

테스트를 해보니.. apache 전역 환경설정에서 해야 하고

로컬 .htaccess에 설정하면 에러가 발생한다.

[Wed Apr 12 09:14:03.530865 2017] [core:alert] [pid 30981] [client 0.0.0.0:3628] /var/www/html/arch/test/.htaccess: LogLevel not allowed here 


아파치 2.4 이후

LogLevel alert rewrite:trace3

[링크 : http://httpd.apache.org/docs/current/mod/mod_rewrite.html]


아파치 2.2 이전

RewriteEngine on

RewriteLog /path/to/log

RewriteLogLevel 5 

[링크 : https://wiki.apache.org/httpd/RewriteLog]



그나저나 한 페이지 로딩할때 이미지나 css 등 개별파일들 전부 적용되서 로그가 남는구나 ㄷㄷ

Posted by 구차니

간단요약.

COM3의 경우 윈도우에서 시리얼 마우스로 자동 탐지를 하는데

USB to RS232 등을 COM3로 사용시

M이나 B를 인식하면서 마우스 클릭하거나 이상하게 이동하는 문제가 발생을 한다.


시리얼 마우스 서비스를 종료하거나

해당 포트를 열거하지 않도록 함으로서 해결 가능


[링크 : http://stackoverflow.com/questions/9226082/device-misdetected-as-serial-mouse]

[링크 : http://www.taltech.com/support/entry/windows_2000_nt_serial_mice_and_missing_com_port]

[링크 : http://www.sealevel.com/.../How-to-fix-crazy-mouse-syndrome-with-USB-serial-adapters.html]

'모종의 음모 > Win32 시리얼' 카테고리의 다른 글

MFC 시리얼 포트 관련  (0) 2017.05.17
mfc readfile timeout 설정  (0) 2017.04.06
mfc win32 시리얼  (0) 2017.04.05
시리얼 baudrate 목록  (0) 2017.04.05
win32 시리얼 포트 목록 얻기  (0) 2017.04.05
Posted by 구차니