Programming/C Win32 MFC2017. 5. 29. 09:07



system(""); 

win32에서도 지원 (유닉스 계열 전용이 아니었군)

[링크 : http://rockdrumy.tistory.com/483]


다만, system()에서 실행되는 동안 멈추는 단점이 있다.

[링크 : https://msdn.microsoft.com/en-us/library/277bwbdz.aspx]


그리고 얘.. 공백 문자 경로 해결을 못하겠네?

[링크 : https://stackoverflow.com/.../how-to-overcome-spaces-in-the-path-while-passing-to-system]

[링크 : https://stackoverflow.com/.../c-system-not-working-when-there-are-spaces-in-two-different-parameters]



WinExec(cmd, SW_SHOW); 

독립된 프로세스로 구동함.

공백문자 문제 없음(따옴표 하나로 해결)


ShellExecute(NULL, _T("open"), _T("cmd"), NULL, NULL, SW_SHOW); 

얘도 독립된 프로세스로 구동



STARTUPINFO StartupInfo = {0};

PROCESS_INFORMATION ProcessInformation;

BOOL ret;

ret = CreateProcess(_T("c:\\windows\\system32\\cmd.exe"),NULL,NULL,NULL,FALSE,0,NULL,NULL,&StartupInfo, &ProcessInformation);

if(!ret) return ;

WaitForSingleObject(ProcessInformation.hProcess, INFINITE); 

독립된 프로세스 이나 종료대기

STARTUPINFO 구조체 초기화 안해주면 오류남


+

[링크 : http://mafa.tistory.com/entry/WinExec-프로세서에서-외부-프로세스-실행하기]

[링크 : http://karfn84.tistory.com/entry/MFC-프로그램-안에서-외부-파일을-실행시키기...CreateProcess]

[링크 : http://zodd.tistory.com/322]


얘는 종료시키는 애

[링크 : https://stackoverflow.com/questions/13193719/kill-process-started-with-shellexecuteex]

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

mfc 파일 경로 얻기  (0) 2017.05.30
MFC CHttpConnection timetout 설정  (0) 2017.05.29
cstring 'null' append 문제?  (0) 2017.05.18
MFC 시간측정(msec)  (0) 2017.04.18
MFC 다이얼로그 자세히(접기)  (0) 2017.04.14
Posted by 구차니
Programming/web 관련2017. 5. 26. 13:16

html에서 form을 쓰려니 table이 기본인데 너무 귀찮아서 찾다 보니 이런게 있네?!

대충이라도 이제 만들어 봐야지 ㅠㅠ

그런데.. IE9에서 IE5로 해도 뜨는거 보니.. 원래 있던 기능인듯?

HTML5에서 추가된게 아닌가 보네..(하위 속성만 추가된 듯?)


fieldset은 박스를 쳐주고

legend 는 박스의 제목


<!DOCTYPE html>

<html>

<body>


<form>

 <fieldset>

  <legend>Personalia:</legend>

  Name: <input type="text"><br>

  Email: <input type="text"><br>

  Date of birth: <input type="text">

 </fieldset>

</form>


</body>

</html>


[링크 : https://www.w3schools.com/tags/tag_legend.asp]

[링크 : https://www.w3schools.com/tags/tag_fieldset.asp]

'Programming > web 관련' 카테고리의 다른 글

eclipse php sftp  (0) 2017.10.03
aptana studio 설치  (0) 2017.10.03
웹 페이지용 이미지 DB에 저장하기  (0) 2017.04.21
http digest  (0) 2017.03.03
http header  (0) 2017.03.02
Posted by 구차니

c에서 toString()이랑은 다르구만? (응?)



Syntax

number.toString(radix)

Parameter Values

ParameterDescription
radixOptional. Which base to use for representing a numeric value. Must be an integer between 2 and 36.
  • 2 - The number will show as a binary value
  • 8 - The number will show as an octal value
  • 16 - The number will show as an hexadecimal value

[링크 : https://www.w3schools.com/jsref/jsref_tostring_number.asp]

[링크 : http://mwultong.blogspot.com/2007/04/16-hex-2-10-javascript.html]

'Programming > javascript & HTML' 카테고리의 다른 글

jquery 복수 속성 선택하기  (0) 2018.08.30
jqeury 예제 그리고 자바스크립트 익명함수  (0) 2017.06.10
div slide 애니메이션  (0) 2017.01.14
div margin: 0 -200px 0 auto  (0) 2016.01.21
semantic element / HTML5  (0) 2016.01.21
Posted by 구차니

'Programming > 데이터베이스' 카테고리의 다른 글

데이터베이스 1:n 관계 구현  (0) 2016.02.29
CRUD  (0) 2014.05.17
데이터베이스 - 키 관련  (0) 2014.04.28
카티젼 프로덕트, join  (0) 2014.04.26
database 1:N 구성?  (0) 2014.04.15
Posted by 구차니
Programming/C Win32 MFC2017. 5. 18. 20:32

솔찍히 무슨 문제가 있을지 모르겠지만

구조상으로는 CString이니까 null 로 끝나도록 하니

되도록이면 null을 추가하는건 안좋지 않을까 싶은데

msdn 문서는 안보이네


[링크 : http://stackoverflow.com/questions/5042894/is-a-cstring-always-null-terminated]

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

MFC CHttpConnection timetout 설정  (0) 2017.05.29
win32 외부 프로그램 실행  (0) 2017.05.29
MFC 시간측정(msec)  (0) 2017.04.18
MFC 다이얼로그 자세히(접기)  (0) 2017.04.14
mfc ccombobox 문자열 받아오기  (0) 2017.04.05
Posted by 구차니
Programming/php2017. 4. 26. 19:36




mysql_real_escape_string — Escapes special characters in a string for use in an SQL statement

[링크 : http://php.net/manual/en/function.mysql-real-escape-string.php]


addslashes() 와 str_replace() 함수를 사용할 수도 있습니다. addslashes() 는 데이터베이스 질의 등에서 처리할 필요가 있는 문자 앞에 백슬래시를 붙인 문자열을 반환합니다.

[링크 : http://blog.habonyphp.com/entry/php-SQL-인젝션-공격]


시스템 자원을 낭비할 수도 있는 Prepared statement를 굳이 소규모 시스템에서도 사용하는 이유는 무엇일까? 그것은 바로 Prepared statement를 사용함으로써 어느 정도의 SQL Injection에 대한 방어 효과가 있기 때문이다. 즉, Prepared statement를 사용하면 프로그램을 개발하는 입장에서 조금 더 손쉽게 웹 프로그램의 안정성을 높일 수 있는 효과가 있다.

[링크 : http://idchowto.com/?p=16398]


[링크 : https://opentutorials.org/module/411/3962]

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

캐시 제어  (0) 2017.07.23
php session_destroy  (0) 2017.06.10
망할 php define()  (0) 2017.04.25
php hidef?  (0) 2017.04.24
php static과 변수 유효범위  (0) 2017.04.15
Posted by 구차니
Programming/php2017. 4. 25. 11:09

define()은 함수임...


이게 왜 중요하냐면.. 안쓰면서 정의된 수 많은 define() 들이

페이지 로드할때 마다 cpu를 냠냠냠 해버림...


괜히 hidef 같은걸 쓰는게 아니었군..


+

회사에서 특정 루틴을 테스트 하는데

20번에 2600ms 걸리던게

한 1/3쯤 안쓰고 있길래 죄다 주석처리 해버렸더니 1400ms로 확줄어 듬

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

php session_destroy  (0) 2017.06.10
sql injection 방어  (0) 2017.04.26
php hidef?  (0) 2017.04.24
php static과 변수 유효범위  (0) 2017.04.15
php 상수 선언 - define  (0) 2017.04.15
Posted by 구차니
Programming/php2017. 4. 24. 13:32

define()은 함수라서 시간이 좀 걸리기에

이걸 빠르게 해주기 위한 패키지로 검색이 걸려 나와서 보는데

php 5.4 이후에도 쓸 수 있도록

2017-07-12일날 릴리즈 된 0.1.13 버전이 있는데

ini 파일에 변수를 선언해두면 php에서 성능 패널티 없이 쓸 수 있는 듯?


Description

Allow definition of user defined constants in simple ini files, which are then processed like internal constants, without any of the usual performance penalties.

[링크 : https://pecl.php.net/package/hidef]


[링크 : http://qiita.com/Hiraku/items/bb0cb665d830f7cd37ff]


+

PECL 확장인가.. APC 관련해서도 존재하네


define() is notoriously slow. Since the main benefit of APC is to increase the performance of scripts/applications, this mechanism is provided to streamline the process of mass constant definition. However, this function does not perform as well as anticipated.

For a better-performing solution, try the » hidef extension from PECL.

[링크 : http://php.net/manual/en/function.apc-define-constants.php]

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

sql injection 방어  (0) 2017.04.26
망할 php define()  (0) 2017.04.25
php static과 변수 유효범위  (0) 2017.04.15
php 상수 선언 - define  (0) 2017.04.15
php 세션주의사항(?)  (0) 2017.04.13
Posted by 구차니
Programming/web 관련2017. 4. 21. 15:35

db에 blob으로 저장하고

echo나 print로 (php) 출력하고

html header에서 content 타입을 image/jpeg 식으로 지정해주면

받는 쪽에서 이미지로 해석을 해서 뿌려준다... 라는 개념


[링크 : http://blog.naver.com/oralol/220389355544] PHP

[링크 : http://xx707xx.tistory.com/47] JSP


multi-part html

어디서 본건가 했더니 smtp 관련해서 메일 보낼때 헤더 멀티파트 헤더 붙여서

인코딩 바꾸거나 이미지 삽입하는거 였네..

물론 HTML을 보여주는 웹 브라우저에서는 지원이 많지 않고

메일 클라이언트쪽에서는 지원 하는 듯?

[링크 : http://stackoverflow.com/...multiple-php-header-content-types-on-the-same-page-is-this-possib]




예전에 구글에서 검색을 POST가 아닌 GET으로 받는 이유가

캐시에 유리하기 때문이라고 했는데.. 이 방식이 얼마나 유용한진 모르겠다.(cpu 성능이 낮을때)

그리고 저사양일때 이런 방식을 사용하면 오히려 더 cpu에 부하가 걸릴려나?

DB에서 받아오는 대용량 데이터는 포인터나 직접 접근이 아니니

일일이 cpu가 메모리에서 메모리로 복사해서 넘겨줘야 할테니?

'Programming > web 관련' 카테고리의 다른 글

aptana studio 설치  (0) 2017.10.03
HTML fieldset / legend  (0) 2017.05.26
http digest  (0) 2017.03.03
http header  (0) 2017.03.02
HTTP GET / POST 차이 (telnet)  (0) 2017.02.06
Posted by 구차니
Programming/C Win32 MFC2017. 4. 18. 09:39

여러가지 함수들이 있는데 msec 단위라면 이정도로 충분할 듯

typedef long clock_t;

#define CLOCKS_PER_SEC  1000 

_Check_return_ _CRTIMP clock_t __cdecl clock(void);


[링크 : http://ohpotato.tistory.com/30]


다른건 lib 링크해주고 별별 이상한걸 include 해야 하니 귀찮...

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

win32 외부 프로그램 실행  (0) 2017.05.29
cstring 'null' append 문제?  (0) 2017.05.18
MFC 다이얼로그 자세히(접기)  (0) 2017.04.14
mfc ccombobox 문자열 받아오기  (0) 2017.04.05
MFC 라디오버튼 사용하기  (0) 2017.04.05
Posted by 구차니