Mac OS X Lion seams disable OpenGL screen. So, glReadPixel can’t get screen shot.
The solution to grab the screen:
CGImageRef image = CGDisplayCreateImage(kCGDirectMainDisplay);
「MAC OS X’s Road」分類文章彙整
the programming experience on MAC OS X Tiger after platform.
Grab Screen from Mac OS X Lion(10.7)
發文作者 cotton5415 於 十二月 29, 2011
發表於 MAC OS X's Road | 已加上的標籤: 10.7 capture, 10.7 grab, cotton5415 10.7 capture, cotton5415 10.7 screen capture, cotton5415 lion, cotton5415 Lion capture, cotton5415 Mac OS X, grab, Lion capture, Lion grab, Mac OS X capture. | 張貼留言 »
iOS 5 storyboard tutorial reference.
發文作者 cotton5415 於 十一月 11, 2011
http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html
發表於 MAC OS X's Road | 已加上的標籤: cotton5415, iOS, iOS 5, storyboard | 張貼留言 »
cow, 改什麼storyboard…..xib 沒得用了。maintain 很麻煩。
發文作者 cotton5415 於 十月 17, 2011
http://chrislee.kr/wp/2011/07/24/mainwindow-xib-absence-in-xcode-4-2-beta-4-with-ios-5-sdk/
發表於 MAC OS X's Road | 已加上的標籤: cotton5415, ib, iOS, iOS 5, storyboard, xib | 張貼留言 »
TCP 常見問題 1 : 如何知道對方不正常斷線?
發文作者 cotton5415 於 七月 13, 2011
問題: Peer A & Peer B 已經建立連線。但是Peer B突然電源線被拉掉,也沒電池撐著,或是突然B端的網路線被拉掉。這時候Peer A 的應用程式也沒有對B進行資料的收送。等到下次要搜送資料的時候,卻卡在send recv or read/write 當中。怎辦?
解法;利用 tcp keep alive.在socket 建立的時候 加上
int optval = 1 ;
setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (const S8 *)&optval, sizeof(optval))
optval = 10 ; // seconds
setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (const S8 *)&optval, sizeof(optval))
optval 設定成 timeout 的時間。這個timeout發生的時候, tcp 會送一個 SYN 給對方。
http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/programming.html#setsockopt
發表於 MAC OS X's Road | 張貼留言 »
Power Point VBA Runtime Error
發文作者 cotton5415 於 四月 7, 2011
http://blogs.msdn.com/b/larryosterman/archive/2005/08/25/456344.aspx
發表於 MAC OS X's Road | 已加上的標籤: com, power point com, power point VBA, ppt, runtime error, vc run time error. | 張貼留言 »
to minimize Javascript codes
發文作者 cotton5415 於 四月 1, 2011
1.YUI Compressor (from Yahoo)
2.JSMin (by Douglas Crockford)
3.ShrinkSafe (from Dojo library)
4.Packer (by Dean Edwards)
發表於 MAC OS X's Road | 已加上的標籤: javascript, minimize javascript, minimize js | 張貼留言 »
386 ppc to universal binary
發文作者 cotton5415 於 三月 29, 2011
LIPO(1) LIPO(1)
NAME
lipo – create or operate on universal files
SYNOPSIS
lipo [-info] [-detailed_info] [-arch arch_type input_file] … [ input_file] … [-arch_blank arch_type]
[-create] [-thin arch_type] [-replace arch_type filename] … [-remove arch_type] … [-extract arch_type]
… [-extract_family arch_type] … [-verify_arch arch_type ...] [-output output_file] [-segalign
arch_type value] …
發表於 MAC OS X's Road | 張貼留言 »
web browser sink document event
發文作者 cotton5415 於 三月 6, 2011
http://support.microsoft.com/kb/246247
發表於 MAC OS X's Road | 已加上的標籤: web programming | 張貼留言 »
install ldid
發文作者 cotton5415 於 十一月 17, 2010
get binary from
http://svn.telesphoreo.org/trunk/data/ldid/ldid-1.0.610.tgz
% tar -zxf ldid-1.0.610.tgz
% cd ldid-1.0.610
% g++ -I . -o util/ldid{,.cpp} -x c util/{lookup2,sha1}.c
% sudo cp -a util/ldid /usr/bin
發表於 iPhone's Road, MAC OS X's Road | 已加上的標籤: iOS, iPhone, ldid, mac os x | 張貼留言 »
mac/iphone/obj-c programming note
發文作者 cotton5415 於 八月 21, 2010
Every method or function whose name includes “new”, “alloc”, “Create” or “copy” requires a balancing release/free
發表於 iPhone's Road, MAC OS X's Road | 張貼留言 »