<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Waiting for the wind</title>
	<atom:link href="http://cotton5415.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cotton5415.wordpress.com</link>
	<description>programming memo in different platforms</description>
	<lastBuildDate>Thu, 29 Dec 2011 04:48:31 +0000</lastBuildDate>
	<language>zh-tw</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cotton5415.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Waiting for the wind</title>
		<link>http://cotton5415.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cotton5415.wordpress.com/osd.xml" title="Waiting for the wind" />
	<atom:link rel='hub' href='http://cotton5415.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Grab Screen from Mac OS X Lion(10.7)</title>
		<link>http://cotton5415.wordpress.com/2011/12/29/grab-screen-from-mac-os-x-lion10-7/</link>
		<comments>http://cotton5415.wordpress.com/2011/12/29/grab-screen-from-mac-os-x-lion10-7/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 03:37:43 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>
		<category><![CDATA[10.7 capture]]></category>
		<category><![CDATA[10.7 grab]]></category>
		<category><![CDATA[cotton5415 10.7 capture]]></category>
		<category><![CDATA[cotton5415 10.7 screen capture]]></category>
		<category><![CDATA[cotton5415 lion]]></category>
		<category><![CDATA[cotton5415 Lion capture]]></category>
		<category><![CDATA[cotton5415 Mac OS X]]></category>
		<category><![CDATA[grab]]></category>
		<category><![CDATA[Lion capture]]></category>
		<category><![CDATA[Lion grab]]></category>
		<category><![CDATA[Mac OS X capture.]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=563</guid>
		<description><![CDATA[Mac OS X Lion seams disable OpenGL screen. So, glReadPixel can&#8217;t get screen shot. The solution to grab the screen: CGImageRef image = CGDisplayCreateImage(kCGDirectMainDisplay);<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=563&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Mac OS X Lion seams disable OpenGL screen. So, glReadPixel can&#8217;t get screen shot.<br />
The solution to grab the screen:<br />
CGImageRef image = CGDisplayCreateImage(kCGDirectMainDisplay);</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/563/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/563/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/563/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=563&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/12/29/grab-screen-from-mac-os-x-lion10-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>iOS 5 storyboard tutorial reference.</title>
		<link>http://cotton5415.wordpress.com/2011/11/11/ios-5-storyboard-tutorial-reference/</link>
		<comments>http://cotton5415.wordpress.com/2011/11/11/ios-5-storyboard-tutorial-reference/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 04:37:16 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>
		<category><![CDATA[cotton5415]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iOS 5]]></category>
		<category><![CDATA[storyboard]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=559</guid>
		<description><![CDATA[http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=559&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/559/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/559/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/559/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=559&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/11/11/ios-5-storyboard-tutorial-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>cow, 改什麼storyboard&#8230;..xib 沒得用了。maintain 很麻煩。</title>
		<link>http://cotton5415.wordpress.com/2011/10/17/cow-%e6%94%b9%e4%bb%80%e9%ba%bcstoryboard-xib-%e6%b2%92%e5%be%97%e7%94%a8%e4%ba%86%e3%80%82maintain-%e5%be%88%e9%ba%bb%e7%85%a9%e3%80%82/</link>
		<comments>http://cotton5415.wordpress.com/2011/10/17/cow-%e6%94%b9%e4%bb%80%e9%ba%bcstoryboard-xib-%e6%b2%92%e5%be%97%e7%94%a8%e4%ba%86%e3%80%82maintain-%e5%be%88%e9%ba%bb%e7%85%a9%e3%80%82/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 06:21:00 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>
		<category><![CDATA[cotton5415]]></category>
		<category><![CDATA[ib]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iOS 5]]></category>
		<category><![CDATA[storyboard]]></category>
		<category><![CDATA[xib]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=557</guid>
		<description><![CDATA[http://chrislee.kr/wp/2011/07/24/mainwindow-xib-absence-in-xcode-4-2-beta-4-with-ios-5-sdk/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=557&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://chrislee.kr/wp/2011/07/24/mainwindow-xib-absence-in-xcode-4-2-beta-4-with-ios-5-sdk/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/557/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/557/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/557/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=557&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/10/17/cow-%e6%94%b9%e4%bb%80%e9%ba%bcstoryboard-xib-%e6%b2%92%e5%be%97%e7%94%a8%e4%ba%86%e3%80%82maintain-%e5%be%88%e9%ba%bb%e7%85%a9%e3%80%82/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>TCP 常見問題 1 : 如何知道對方不正常斷線？</title>
		<link>http://cotton5415.wordpress.com/2011/07/13/tcp-%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-1-%e5%a6%82%e4%bd%95%e7%9f%a5%e9%81%93%e5%b0%8d%e6%96%b9%e4%b8%8d%e6%ad%a3%e5%b8%b8%e6%96%b7%e7%b7%9a%ef%bc%9f/</link>
		<comments>http://cotton5415.wordpress.com/2011/07/13/tcp-%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-1-%e5%a6%82%e4%bd%95%e7%9f%a5%e9%81%93%e5%b0%8d%e6%96%b9%e4%b8%8d%e6%ad%a3%e5%b8%b8%e6%96%b7%e7%b7%9a%ef%bc%9f/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 08:08:31 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=544</guid>
		<description><![CDATA[問題: Peer A &#38; 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 *)&#38;optval, sizeof(optval)) optval = 10 ; // seconds setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (const S8 *)&#38;optval, sizeof(optval)) optval 設定成 timeout 的時間。這個timeout發生的時候， tcp 會送一個 SYN 給對方。 http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/programming.html#setsockopt<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=544&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>問題:  Peer A &amp; Peer B 已經建立連線。但是Peer B突然電源線被拉掉，也沒電池撐著，或是突然B端的網路線被拉掉。這時候Peer A 的應用程式也沒有對B進行資料的收送。等到下次要搜送資料的時候，卻卡在send recv or read/write 當中。怎辦？<br />
解法；利用 tcp keep alive.在socket 建立的時候 加上<br />
int optval = 1 ;<br />
setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, (const S8 *)&amp;optval, sizeof(optval))<br />
optval = 10 ; // seconds<br />
setsockopt(sockfd, IPPROTO_TCP, TCP_KEEPALIVE, (const S8 *)&amp;optval, sizeof(optval))<br />
optval 設定成 timeout 的時間。這個timeout發生的時候， tcp 會送一個 SYN 給對方。</p>
<p>http://tldp.org/HOWTO/TCP-Keepalive-HOWTO/programming.html#setsockopt</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/544/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/544/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/544/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=544&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/07/13/tcp-%e5%b8%b8%e8%a6%8b%e5%95%8f%e9%a1%8c-1-%e5%a6%82%e4%bd%95%e7%9f%a5%e9%81%93%e5%b0%8d%e6%96%b9%e4%b8%8d%e6%ad%a3%e5%b8%b8%e6%96%b7%e7%b7%9a%ef%bc%9f/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>windows mysql reset root</title>
		<link>http://cotton5415.wordpress.com/2011/04/28/windows-mysql-reset-root/</link>
		<comments>http://cotton5415.wordpress.com/2011/04/28/windows-mysql-reset-root/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 15:57:50 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[mysql's Road]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[Win32's Road]]></category>
		<category><![CDATA[mysql root]]></category>
		<category><![CDATA[mysql windows]]></category>
		<category><![CDATA[windows mysql]]></category>
		<category><![CDATA[windows mysql root]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=539</guid>
		<description><![CDATA[http://dev.mysql.com/doc/mysql-windows-excerpt/5.0/en/resetting-permissions-windows.html 1. stop mysql service. 2. edit a file abcd.sql UPDATE mysql.user SET Password=PASSWORD(&#8216;MyNewPass&#8217;) WHERE User=&#8217;root&#8217;; FLUSH PRIVILEGES; 3. mysqld.exe &#8211;console &#8211;init-file=abcd.sql 4. new root password = MyNewPass<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=539&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://dev.mysql.com/doc/mysql-windows-excerpt/5.0/en/resetting-permissions-windows.html</p>
<p>1. stop mysql service.<br />
2. edit a file abcd.sql<br />
UPDATE mysql.user SET Password=PASSWORD(&#8216;MyNewPass&#8217;) WHERE User=&#8217;root&#8217;;<br />
FLUSH PRIVILEGES;<br />
3. mysqld.exe &#8211;console &#8211;init-file=abcd.sql<br />
4. new root password = MyNewPass</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/539/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/539/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/539/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=539&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/04/28/windows-mysql-reset-root/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>VC++ MFC using STL, operator new: ono of the 5 overloads</title>
		<link>http://cotton5415.wordpress.com/2011/04/28/vc-mfc-using-stl-operator-new-ono-of-the-5-overloads/</link>
		<comments>http://cotton5415.wordpress.com/2011/04/28/vc-mfc-using-stl-operator-new-ono-of-the-5-overloads/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 03:13:45 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[Win32's Road]]></category>
		<category><![CDATA[MFC STL]]></category>
		<category><![CDATA[MFC STL operator new]]></category>
		<category><![CDATA[VC++ MFC STL]]></category>
		<category><![CDATA[VC++ STL]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=527</guid>
		<description><![CDATA[http://social.msdn.microsoft.com/Forums/zh-CN/visualcpluszhchs/thread/b93ed7fe-c328-4901-bd3a-7e742e499775/ http://support.microsoft.com/kb/317799<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=527&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://social.msdn.microsoft.com/Forums/zh-CN/visualcpluszhchs/thread/b93ed7fe-c328-4901-bd3a-7e742e499775/</p>
<p>http://support.microsoft.com/kb/317799</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/527/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/527/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/527/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=527&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/04/28/vc-mfc-using-stl-operator-new-ono-of-the-5-overloads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>Power Point VBA Runtime Error</title>
		<link>http://cotton5415.wordpress.com/2011/04/07/power-point-vba-runtime-error/</link>
		<comments>http://cotton5415.wordpress.com/2011/04/07/power-point-vba-runtime-error/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 06:57:18 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[power point com]]></category>
		<category><![CDATA[power point VBA]]></category>
		<category><![CDATA[ppt]]></category>
		<category><![CDATA[runtime error]]></category>
		<category><![CDATA[vc run time error.]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=525</guid>
		<description><![CDATA[http://blogs.msdn.com/b/larryosterman/archive/2005/08/25/456344.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=525&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://blogs.msdn.com/b/larryosterman/archive/2005/08/25/456344.aspx</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/525/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/525/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/525/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=525&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/04/07/power-point-vba-runtime-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>to minimize Javascript codes</title>
		<link>http://cotton5415.wordpress.com/2011/04/01/to-minimize-javascript-codes/</link>
		<comments>http://cotton5415.wordpress.com/2011/04/01/to-minimize-javascript-codes/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 10:02:22 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[minimize javascript]]></category>
		<category><![CDATA[minimize js]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=517</guid>
		<description><![CDATA[1.YUI Compressor (from Yahoo) 2.JSMin (by Douglas Crockford) 3.ShrinkSafe (from Dojo library) 4.Packer (by Dean Edwards)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=517&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1.YUI Compressor (from Yahoo)<br />
2.JSMin (by Douglas Crockford)<br />
3.ShrinkSafe  (from Dojo library)<br />
4.Packer (by Dean Edwards)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/517/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=517&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/04/01/to-minimize-javascript-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>386 ppc to universal binary</title>
		<link>http://cotton5415.wordpress.com/2011/03/29/386-ppc-to-universal-binary/</link>
		<comments>http://cotton5415.wordpress.com/2011/03/29/386-ppc-to-universal-binary/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 05:54:13 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[MAC OS X's Road]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=522</guid>
		<description><![CDATA[LIPO(1) LIPO(1) NAME lipo &#8211; create or operate on universal files SYNOPSIS lipo [-info] [-detailed_info] [-arch arch_type input_file] &#8230; [ input_file] &#8230; [-arch_blank arch_type] [-create] [-thin arch_type] [-replace arch_type filename] &#8230; [-remove arch_type] &#8230; [-extract arch_type] &#8230; [-extract_family arch_type] &#8230; [-verify_arch arch_type ...] [-output output_file] [-segalign arch_type value] &#8230;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=522&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>LIPO(1)                                                                                                     LIPO(1)</p>
<p>NAME<br />
       lipo &#8211; create or operate on universal files</p>
<p>SYNOPSIS<br />
       lipo  [-info]  [-detailed_info] [-arch arch_type input_file] &#8230;  [ input_file] &#8230;  [-arch_blank arch_type]<br />
       [-create] [-thin arch_type] [-replace arch_type filename] &#8230;  [-remove arch_type] &#8230;  [-extract arch_type]<br />
       &#8230;   [-extract_family  arch_type]  &#8230;   [-verify_arch  arch_type  ...]   [-output  output_file] [-segalign<br />
       arch_type value] &#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=522&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/03/29/386-ppc-to-universal-binary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone serial port communication</title>
		<link>http://cotton5415.wordpress.com/2011/03/17/iphone-serial-port-communication/</link>
		<comments>http://cotton5415.wordpress.com/2011/03/17/iphone-serial-port-communication/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 01:53:14 +0000</pubDate>
		<dc:creator>cotton5415</dc:creator>
				<category><![CDATA[iPhone's Road]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[rs232]]></category>
		<category><![CDATA[serial port]]></category>

		<guid isPermaLink="false">http://cotton5415.wordpress.com/?p=509</guid>
		<description><![CDATA[http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial Requirement: 1.Jailbroken Iphone with BSD Subsystem installed (Search the web for jailbreak tutorials) 2.Iphone development toolchain for Mac OSX, Linux, Windows (Cygwin) or other OS. I use this http://code.google.com/p/winchain/ in Windows. 3.Sparkfun Ipod connector or breakout board see http://www.sparkfun.com/commerce/product_info.php?products_id=633 or http://www.sparkfun.com/commerce/product_info.php?products_id=8295 4.PC USB UART &#8211; optional, but used in this tutorial. You will need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=509&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://devdot.wikispaces.com/Iphone+Serial+Port+Tutorial</p>
<p>Requirement:<br />
1.Jailbroken Iphone with BSD Subsystem installed (Search the web for jailbreak tutorials)<br />
2.Iphone development toolchain for Mac OSX, Linux, Windows (Cygwin) or other OS. I use this http://code.google.com/p/winchain/ in Windows.<br />
3.Sparkfun Ipod connector or breakout board see http://www.sparkfun.com/commerce/product_info.php?products_id=633 or http://www.sparkfun.com/commerce/product_info.php?products_id=8295<br />
4.PC USB UART &#8211; optional, but used in this tutorial. You will need either a 3.3V level UART for PC (see http://www.sparkfun.com/commerce/product_info.php?products_id=718) or you will need an old style 12V level serial cable with a level converter like this one http://www.compsys1.com/workbench/On_top_of_the_Bench/Max233_Adapter/max233_adapter.html (see warning below)<br />
5.A soldering iron will help you out <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
6.Microsoft Visual Studio &#8211; optional, but used in the source code examples for the PC serial port communication.</p>
<p>WARNING! Do not try to use a 12V level RS232 port for this without a level converter to ~3V, it will severely damage your Iphone or render it non-functional.</p>
<p>Hardware:<br />
The Dock Port<br />
In the Ipod/Iphone dock port, the pins we are concerned with are as follows<br />
Pin 1<br />
 Ground<br />
Pin 18<br />
 3.3V Power (+)<br />
Pin 12<br />
 TX also known as Serial Transmit<br />
Pin 13<br />
 RX also known as Serial Receive</p>
<p>To see a full description of all of the pins in the dock connector, see here: http://pinouts.ru/Devices/ipod_pinout.shtml</p>
<p>Connections: iPhone/iPod Touch RX should connect to TX of the connected device, TX to RX of the connected device, and Ground to the Ground of the connected device. If your device can be powered by a low amperage, 3.3V power source you may chose to connect PIN 18 as well and power your device directly from the iPhone/iPod Touch.</p>
<p>Sample Codes:<br />
<pre class="brush: plain;">
#include &lt;stdio.h&gt;   /* Standard input/output definitions */
#include &lt;string.h&gt;  /* String function definitions */
#include &lt;unistd.h&gt;  /* UNIX standard function definitions */
#include &lt;fcntl.h&gt;   /* File control definitions */
#include &lt;errno.h&gt;   /* Error number definitions */
#include &lt;termios.h&gt; /* POSIX terminal control definitions */
 
static struct termios gOriginalTTYAttrs;
 
static int OpenSerialPort()
{
    int        fileDescriptor = -1;
    int        handshake;
    struct termios  options;
 
    // Open the serial port read/write, with no controlling terminal, and don't wait for a connection.
    // The O_NONBLOCK flag also causes subsequent I/O on the device to be non-blocking.
    // See open(2) (&quot;man 2 open&quot;) for details.
 
    fileDescriptor = open(&quot;/dev/tty.iap&quot;, O_RDWR | O_NOCTTY | O_NONBLOCK);
    if (fileDescriptor == -1)
    {
        printf(&quot;Error opening serial port %s - %s(%d).\n&quot;,
               &quot;/dev/tty.iap&quot;, strerror(errno), errno);
        goto error;
    }
 
    // Note that open() follows POSIX semantics: multiple open() calls to the same file will succeed
    // unless the TIOCEXCL ioctl is issued. This will prevent additional opens except by root-owned
    // processes.
    // See tty(4) (&quot;man 4 tty&quot;) and ioctl(2) (&quot;man 2 ioctl&quot;) for details.
 
    if (ioctl(fileDescriptor, TIOCEXCL) == -1)
    {
        printf(&quot;Error setting TIOCEXCL on %s - %s(%d).\n&quot;,
            &quot;/dev/tty.iap&quot;, strerror(errno), errno);
        goto error;
    }
 
    // Now that the device is open, clear the O_NONBLOCK flag so subsequent I/O will block.
    // See fcntl(2) (&quot;man 2 fcntl&quot;) for details.
 
    if (fcntl(fileDescriptor, F_SETFL, 0) == -1)
    {
        printf(&quot;Error clearing O_NONBLOCK %s - %s(%d).\n&quot;,
            &quot;/dev/tty.iap&quot;, strerror(errno), errno);
        goto error;
    }
 
    // Get the current options and save them so we can restore the default settings later.
    if (tcgetattr(fileDescriptor, &amp;gOriginalTTYAttrs) == -1)
    {
        printf(&quot;Error getting tty attributes %s - %s(%d).\n&quot;,
            &quot;/dev/tty.iap&quot;, strerror(errno), errno);
        goto error;
    }
 
    // The serial port attributes such as timeouts and baud rate are set by modifying the termios
    // structure and then calling tcsetattr() to cause the changes to take effect. Note that the
    // changes will not become effective without the tcsetattr() call.
    // See tcsetattr(4) (&quot;man 4 tcsetattr&quot;) for details.
 
    options = gOriginalTTYAttrs;
 
    // Print the current input and output baud rates.
    // See tcsetattr(4) (&quot;man 4 tcsetattr&quot;) for details.
 
    printf(&quot;Current input baud rate is %d\n&quot;, (int) cfgetispeed(&amp;options));
    printf(&quot;Current output baud rate is %d\n&quot;, (int) cfgetospeed(&amp;options));
 
    // Set raw input (non-canonical) mode, with reads blocking until either a single character
    // has been received or a one second timeout expires.
    // See tcsetattr(4) (&quot;man 4 tcsetattr&quot;) and termios(4) (&quot;man 4 termios&quot;) for details.
 
    cfmakeraw(&amp;options);
    options.c_cc[VMIN] = 1;
    options.c_cc[VTIME] = 10;
 
    // The baud rate, word length, and handshake options can be set as follows:
 
    cfsetspeed(&amp;options, B19200);    // Set 19200 baud
    options.c_cflag |= (CS8);  // RTS flow control of input
 
 
    printf(&quot;Input baud rate changed to %d\n&quot;, (int) cfgetispeed(&amp;options));
    printf(&quot;Output baud rate changed to %d\n&quot;, (int) cfgetospeed(&amp;options));
 
    // Cause the new options to take effect immediately.
    if (tcsetattr(fileDescriptor, TCSANOW, &amp;options) == -1)
    {
        printf(&quot;Error setting tty attributes %s - %s(%d).\n&quot;,
            &quot;/dev/tty.iap&quot;, strerror(errno), errno);
        goto error;
    }
    // Success
    return fileDescriptor;
 
    // Failure &quot;/dev/tty.iap&quot;
error:
    if (fileDescriptor != -1)
    {
        close(fileDescriptor);
    }
 
    return -1;
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cotton5415.wordpress.com/509/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cotton5415.wordpress.com/509/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cotton5415.wordpress.com/509/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cotton5415.wordpress.com&amp;blog=519078&amp;post=509&amp;subd=cotton5415&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cotton5415.wordpress.com/2011/03/17/iphone-serial-port-communication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71da272929c09048cf22cdcfc6d4bf10?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">cotton5415</media:title>
		</media:content>
	</item>
	</channel>
</rss>
