전체 글
-
Python 요약#1computing 2012. 10. 25. 11:24
python 요약#1 Variable and Data Types 특징: High-level, Interpreted, Object-orientedi = 123f = 12.3b = Truecase-sensitive Whitespace and Statements statement 구분은 whitespace로Comment # single comment“”” multi line comment “””Math Operations +, -, *, /, %, **(exponentiation) Strings “string”‘string’“string with \’escape\’”“string”[0] == s string methods len(“string”)str(23)“string”.upper()“STRING”.lowe..
-
NSString, trimiOS/Mac 2011. 5. 26. 13:54
우째 이런 기본적인 것이 없을까나.. NSString에 카테고리로 trim 관련 메소드를 추가해봤습니다. NSString_Trim.h @interface NSString(Trim) - (NSString *)ltrim; - (NSString *)rtrim; - (NSString *)trim; @end NSString_Trim.m @implementation NSString(Trim) - (NSString *)ltrim { NSCharacterSet *cs = [NSCharacterSet whitespaceAndNewlineCharacterSet]; NSUInteger len = [self length]; int i; for (i=0; i < len; i++) { unichar c = [self charac..
-
NSURL 메소드 샘플iOS/Mac 2011. 5. 20. 19:55
url 에 대해 http://www.foobar.com/test/depth1/depth2/xxx.php?parm1=xxx¶m2=yyy NSURL 조회 메소드 결과 absoluteString:http://www.foobar.com/test/depth1/depth2/xxx.php?parm1=xxx¶m2=yyy absoluteURL:http://www.foobar.com/test/depth1/depth2/xxx.php?parm1=xxx¶m2=yyy baseURL:(null) fragment:(null) host:www.foobar.com lastPathComponent:xxx.php parameterString:(null) password:(null) path:/test/depth1/de..
-
패킷캡쳐하는 법iOS/Mac 2011. 4. 22. 17:53
맥개발 중에 실제 송수신되는 네트워크 패킷을 보고싶을 때,패킷 캡쳐 프로그램을 이용하거나 명령어로 할 수도 있다.맥용앱은 CocoaPacketAnalyzer나 WireShark같은 것을 사용한다. UNIX기반 시스템에서 tcpdump명령어만 있으면 다 사용할 수 있다. 터미널을 열고, sudo tcpdump -nn -vv -A -s 0 -i en0 -w lan.pcap 하면 현재 디렉토리에 lan.pcap이란 이름으로 패킷이 기록된다. 감시하는 장치는 en0 첫번째 네트워크 어댑터. localhost로 가는걸 보고 싶을 때는 lo0 tcpdump 문법으로 특정 ip 특정 프로토콜, 특정 포트 등을 다양하게 조합하여 필터링할 수 있다. 패킷 캡쳐후 패킷을 볼 때는 WireShark같은 프로그램을 이용한다...