<?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/"
	>

<channel>
	<title>苇叶舟</title>
	<atom:link href="http://weiye.info/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://weiye.info/blog</link>
	<description>波涛汹涌的江面，逆流而上的小船。</description>
	<lastBuildDate>Thu, 24 Nov 2011 01:20:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>这一年的工作</title>
		<link>http://weiye.info/blog/2011/11/thisyear/</link>
		<comments>http://weiye.info/blog/2011/11/thisyear/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 13:51:50 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[产品]]></category>
		<category><![CDATA[个性化阅读]]></category>
		<category><![CDATA[全网热文发现]]></category>
		<category><![CDATA[阅米]]></category>
		<category><![CDATA[推荐算法]]></category>
		<category><![CDATA[文本挖掘]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/2011/11/zhe_yi_nian_de_gong_zuo/</guid>
		<description><![CDATA[阅米从开始到现在做了半年了。加上之前产品的摸索阶段，来每讯有一年了。从开始学习模仿Flipboard和zite，到慢慢形成自己的特点。邀请码内测了很久, 不断的完善，用户较少，心里没有底。 现在在Q+平台上, 终于用户开始有较快的增长，活跃度也还不错，不禁有一些欣慰。当然产品还有很多需要完善的地方，推荐算法也要进一步改进。还有手机和ipad客户端，希望尽快的能够上线使用。这一年收获很多，研究了不少东西 热文发现： 从微博，RSS中发现热门的内容 按照热度排序. 按照时间衰减。 自然语言处理： 网页正文提取, 过滤广告、导航等内容，只保留文章主体。 文章标题提取, 自动去掉标题中含有的网站名称、标语等噪音。 制作缩略图,制作不同的缩略图，适用不同的版式和终端展示。 文本去重，内容相同或者相近的文章识别并只保留一篇。 文本分类，自动将内容划分到合适的分类。 来源提取，友好的文章来源展示。 关键词提取，分词并自动提取适用于展示给用户的关键词。 社会化： 接入腾讯微博、新浪微博 Q+、人人等开放平台 社会化分享 个性化算法： 用户喜好模型的建立, 用户的主动、被动行为分析。 用户模型的快速生成和更新，用于冷启动。 新闻按照用户个人喜好等排序. 微博过滤，按照时间、热门度、用户关系、用户兴趣排序 即时计算用户喜欢的文章列表。 各种个性化因子的权重优化、评价。 LDA话题模型。 计算用户间的亲密度 杂志化自动排版技术。 跨平台： 普通的Web版本, Q+版。 手机web版 未能完成的HTML5版本 即将推出的Andoroid、IPhone手机版本 即将推出的IPad客户端 语言层面： 在php, javascript之外，也写了一些Java，C++, Python 的代码。 此外还研究了HTML5, NodeJs, Objective C等等。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E8%BF%99%E4%B8%80%E5%B9%B4%E7%9A%84%E5%B7%A5%E4%BD%9C&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Fone-evaluate-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">一个评价排名算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Ffirefox-extensions-recommand%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">推荐几款好用的firefox插件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F12%2Fredis-for-store-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">用Redis来做排行榜存储</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>阅米从开始到现在做了半年了。加上之前产品的摸索阶段，来每讯有一年了。从开始学习模仿Flipboard和zite，到慢慢形成自己的特点。邀请码内测了很久, 不断的完善，用户较少，心里没有底。 现在在Q+平台上, 终于用户开始有较快的增长，活跃度也还不错，不禁有一些欣慰。当然产品还有很多需要完善的地方，推荐算法也要进一步改进。还有手机和ipad客户端，希望尽快的能够上线使用。这一年收获很多，研究了不少东西</p>
<h3>热文发现：</h3>
<ul>
<li>从微博，RSS中发现热门的内容</li>
<li>按照热度排序.</li>
<li>按照时间衰减。</li>
</ul>
<h3>自然语言处理：</h3>
<ul>
<li>网页正文提取, 过滤广告、导航等内容，只保留文章主体。</li>
<li>文章标题提取, 自动去掉标题中含有的网站名称、标语等噪音。</li>
<li>制作缩略图,制作不同的缩略图，适用不同的版式和终端展示。</li>
<li>文本去重，内容相同或者相近的文章识别并只保留一篇。</li>
<li>文本分类，自动将内容划分到合适的分类。</li>
<li>来源提取，友好的文章来源展示。</li>
<li>关键词提取，分词并自动提取适用于展示给用户的关键词。</li>
</ul>
<h3>社会化：</h3>
<ul>
<li>接入腾讯微博、新浪微博</li>
<li>Q+、人人等开放平台</li>
<li>社会化分享</li>
</ul>
<h3>个性化算法：</h3>
<ul>
<li>用户喜好模型的建立, 用户的主动、被动行为分析。</li>
<li>用户模型的快速生成和更新，用于冷启动。</li>
<li>新闻按照用户个人喜好等排序.</li>
<li>微博过滤，按照时间、热门度、用户关系、用户兴趣排序</li>
<li>即时计算用户喜欢的文章列表。</li>
<li>各种个性化因子的权重优化、评价。</li>
<li>LDA话题模型。</li>
<li>计算用户间的亲密度</li>
<li>杂志化自动排版技术。</li>
</ul>
<h3>跨平台：</h3>
<ul>
<li>普通的Web版本, Q+版。</li>
<li>手机web版</li>
<li>未能完成的HTML5版本</li>
<li>即将推出的Andoroid、IPhone手机版本</li>
<li>即将推出的IPad客户端</li>
</ul>
<h3>语言层面：</h3>
<ul>
<li>在php, javascript之外，也写了一些Java，C++, Python 的代码。</li>
<li>此外还研究了HTML5, NodeJs, Objective C等等。</li>
</ul>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E8%BF%99%E4%B8%80%E5%B9%B4%E7%9A%84%E5%B7%A5%E4%BD%9C&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Fone-evaluate-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">一个评价排名算法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Ffirefox-extensions-recommand%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">推荐几款好用的firefox插件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fproject-tools-selection%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每讯项目管理工具选型</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/11/thisyear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C 学习笔记(3)　&#8211;　实现特点</title>
		<link>http://weiye.info/blog/2011/06/objective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian/</link>
		<comments>http://weiye.info/blog/2011/06/objective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 23:15:02 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=119</guid>
		<description><![CDATA[objc的内存管理方式 　1. retain count. 对象创建的时候（new, alloc, copy）系统自动为对象指定了计数１.　当向向对象发送retain消息的时候，计数+１，当发送release消息的时候，技术-１.　如果计数为０，对象就被销毁，并发送dealloc消息。 注意手工发送retain方法的时候，retain和release必须对应上，保持平衡。 2. 还可以向对象发送autorelease消息，该对象将被放到一个NSAutorelasePool对象池中。当对象池被销毁的时候，会给其中的每个对象，发送release消息.　这些对象的计数都会-１，如果计数减为０，对象就会被销毁. 如果使用Appkit, 会在特定的时间给对象池发送销毁消息，比如当前的用户事件处理完后。 3. 垃圾回收机制。编译的时候，指定-fobjc-gc-only选项，将启用gc机制。用户不需要自己管理内存，像java一样，系统自动识别哪些对象没有指针指向了，自动释放这些内存。.　GUI程序中，gc也在事件处理完后触发。 只是目前iphone开发中还不能用这个特性. 对象初始化 objc的对象初始化包括两步 　1. 分配内存[ClassName alloc],alloc方法继承自NSObject，分配内存，并清空置０. 2. 初始化[Object init], 返回对象实例;　注意init方法有可能返回的是跟alloc取得的不同的对象. init 是个普通的方法，类可以有多个初始化方法. - &#40;id&#41; init &#123; &#160; &#160; if &#40;self = &#91;super init&#93;&#41;&#123; &#160; &#160; &#125; &#160; &#160; return &#40;self&#41;; &#125; object = &#91;&#91;ClassName alloc&#93; init&#93;; categories 作用:　给已经存在的类增加新的对象方法 用法 1. 将类的实现代码拆分到多个文件，如果很多的话 [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=Objective+C+%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%283%29%E3%80%80%26%238211%3B%E3%80%80%E5%AE%9E%E7%8E%B0%E7%89%B9%E7%82%B9&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(1) — 语法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS下的Safari的一些特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">别做正常的傻瓜</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<h3>objc的内存管理方式</h3>
<p>　1. retain count. 对象创建的时候（new, alloc, copy）系统自动为对象指定了计数１.　当向向对象发送retain消息的时候，计数+１，当发送release消息的时候，技术-１.　如果计数为０，对象就被销毁，并发送dealloc消息。 注意手工发送retain方法的时候，retain和release必须对应上，保持平衡。</p>
<p>  2. 还可以向对象发送autorelease消息，该对象将被放到一个NSAutorelasePool对象池中。当对象池被销毁的时候，会给其中的每个对象，发送release消息.　这些对象的计数都会-１，如果计数减为０，对象就会被销毁.  如果使用Appkit, 会在特定的时间给对象池发送销毁消息，比如当前的用户事件处理完后。</p>
<p>  3. 垃圾回收机制。编译的时候，指定-fobjc-gc-only选项，将启用gc机制。用户不需要自己管理内存，像java一样，系统自动识别哪些对象没有指针指向了，自动释放这些内存。.　GUI程序中，gc也在事件处理完后触发。 只是目前iphone开发中还不能用这个特性.</p>
<h3>对象初始化</h3>
<p>  objc的对象初始化包括两步<br />
　1.  分配内存[ClassName alloc],alloc方法继承自NSObject，分配内存，并清空置０.<br />
  2. 初始化[Object init], 返回对象实例;　注意init方法有可能返回的是跟alloc取得的不同的对象. init 是个普通的方法，类可以有多个初始化方法.</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span> init <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super init<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #a61390;">return</span> <span style="color: #002200;">&#40;</span>self<span style="color: #002200;">&#41;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<br />
object <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ClassName alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;</div></div>
<h3>categories</h3>
<p>作用:　给已经存在的类增加新的对象方法<br />
用法<br />
1. 将类的实现代码拆分到多个文件，如果很多的话<br />
2. 创建私有方法的前向引用<br />
3. 给对象增加非正式的协议</p>
<h3>动态特性 [待补充]</h3>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=Objective+C+%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%283%29%E3%80%80%26%238211%3B%E3%80%80%E5%AE%9E%E7%8E%B0%E7%89%B9%E7%82%B9&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(1) — 语法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS下的Safari的一些特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">别做正常的傻瓜</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/06/objective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C 学习笔记(1) &#8212; 语法</title>
		<link>http://weiye.info/blog/2011/06/object_c_xue_xi_bi_ji/</link>
		<comments>http://weiye.info/blog/2011/06/object_c_xue_xi_bi_ji/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 05:30:53 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/2011/06/object_c_xue_xi_bi_ji/</guid>
		<description><![CDATA[objective c 是在C语言上扩展出来的，C的各种语法特性仍然适用。 #import 引用头文件,比#include 好的地方在于头文件只会包含一次，不用再写#ifdef 了. NSLog Cocoa提供的函数库，统一以NS作为前缀，以示同C标准库的差别. NSLog与printf类似。 @&#8221;strings&#8221; @后接双引号字符串，代表NSString类型的字符序列，比普通的字符串有更多的用法。 main方法，同c语言一致 int main(int argc, const char * argv[]){return (0);} 面向对象. id：对象指针类型 方法调用 [shape draw] ,调用shape对象的draw方法.shape 是id类型 &#91;circle draw&#93; //带参数的调用，green是参数 &#91;circle setFillColor:green&#93; @interface 声明类接口  @interface Circle :NSObject &#123; &#160; &#160; ShapeColor fillColor; &#160; &#160; ShapeRect bounds; &#125; - &#40;void&#41; setFillColor: &#40;ShapeColor&#41; fillColor; - &#40;void&#41; [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=Objective+C+%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%281%29+%26%238212%3B+%E8%AF%AD%E6%B3%95&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS下的Safari的一些特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fsimple-php-template-engine%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">非常简单的PHP模板引擎.</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>objective c 是在C语言上扩展出来的，C的各种语法特性仍然适用。</p>
<p>#import 引用头文件,比#include 好的地方在于头文件只会包含一次，不用再写#ifdef 了. </p>
<p>NSLog Cocoa提供的函数库，统一以NS作为前缀，以示同C标准库的差别. NSLog与printf类似。</p>
<p>@&#8221;strings&#8221; @后接双引号字符串，代表NSString类型的字符序列，比普通的字符串有更多的用法。</p>
<p>main方法，同c语言一致 int main(int argc, const char * argv[]){return (0);}</p>
<p>面向对象.</p>
<p>id：对象指针类型<br />
方法调用 [shape draw] ,调用shape对象的draw方法.shape 是id类型</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span>circle draw<span style="color: #002200;">&#93;</span><br />
<span style="color: #11740a; font-style: italic;">//带参数的调用，green是参数</span><br />
<span style="color: #002200;">&#91;</span>circle setFillColor<span style="color: #002200;">:</span>green<span style="color: #002200;">&#93;</span></div></div>
<p>@interface 声明类接口 </p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a61390;">@interface</span> Circle <span style="color: #002200;">:</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/"><span style="color: #400080;">NSObject</span></a><br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; ShapeColor fillColor;<br />
&nbsp; &nbsp; ShapeRect bounds;<br />
<span style="color: #002200;">&#125;</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setFillColor<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>ShapeColor<span style="color: #002200;">&#41;</span> fillColor;<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setBounds<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>ShapeRect<span style="color: #002200;">&#41;</span> bounds;<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> draw;<br />
<span style="color: #a61390;">@end</span></div></div>
<p>@implementation 实现类</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a61390;">@implementation</span> Circle. 实现代码中省略掉了self self<span style="color: #002200;">-</span>&gt;fillColor <span style="color: #002200;">=</span> c;<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setFillColor<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span> ShapeColor <span style="color: #002200;">&#41;</span> c <br />
<span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; fillColor <span style="color: #002200;">=</span> c;<br />
<span style="color: #002200;">&#125;</span><br />
<span style="color: #a61390;">@end</span> <span style="color: #11740a; font-style: italic;">//Circle</span></div></div>
<p>创建新实例, 调用类的new方法</p>
<div class="codecolorer-container objc default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span>Circle new<span style="color: #002200;">&#93;</span></div></div>
<p>构造方法<br />
init</p>
<p>访问器 getter/setter<br />
set方法需要带上set前缀，get方法不需要，保持跟属性一致即可。<br />
@property 可以简化访问器. 声明同数据成员相同的属性，可以省去访问器方法的编写<br />
@property (选项) 类型 名字;选项包括readwrite/readonly/assign/retain/copy/atomicity等。<br />
在实现中需要用@synthesize让编译器获取实现代码<br />
之后可以用.来引用属性来读取和写入，而不需要调用方法。</p>
<p>继承/组合<br />
super 访问父类<br />
self</p>
<p>@class 声明使用的类，可以不需要#import a.h,  避免循环引用</p>
<p>静态方法, 以+开头<br />
+ (void) instance;</p>
<p>@protocol 协议，类似其他语言中的接口。　遵循协议就必须实现其中规定的方法。<br />
一个类可以同时遵循多种协议。还可以用@optional指定非必须实现的方法</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@protocol NSCoding<br />
&nbsp;<br />
- (void) encodeWithCoder: (NSCoder *) aCoder;<br />
- (id) initWithCoder: (NScoder *) aDecoder;<br />
<br />
<br />
<br />
@end<br />
<br />
@interface Car: NSObject <br />
{<br />
}<br />
<br />
@end</div></div>
<p>　</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=Objective+C+%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%281%29+%26%238212%3B+%E8%AF%AD%E6%B3%95&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">IOS下的Safari的一些特性</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Ffirefox-extensions-recommand%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">推荐几款好用的firefox插件</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/06/object_c_xue_xi_bi_ji/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>新的一天</title>
		<link>http://weiye.info/blog/2011/03/xin_de_yi_tian/</link>
		<comments>http://weiye.info/blog/2011/03/xin_de_yi_tian/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 23:38:06 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[杂乱]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/2011/03/xin_de_yi_tian/</guid>
		<description><![CDATA[太阳每天都是新的。早上起来，看着太阳，深吸一口新鲜空气，微笑着张开双臂，拥抱着这美好的新一天。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 SNS、SCM、IOS、敏捷开发、推荐算法&#8230; Facebook 豆瓣 新浪微博 Twitter 向文章付费
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E6%96%B0%E7%9A%84%E4%B8%80%E5%A4%A9&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fssh-by-expect%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用expect命令快速ssh到另一台主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Finternet-big-things-2011%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">回想这一年的互联网</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Finfo-extract-tech%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">信息提取技术</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>太阳每天都是新的。早上起来，看着太阳，深吸一口新鲜空气，微笑着张开双臂，拥抱着这美好的新一天。</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E6%96%B0%E7%9A%84%E4%B8%80%E5%A4%A9&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fssh-by-expect%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用expect命令快速ssh到另一台主机</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Finternet-big-things-2011%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">回想这一年的互联网</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fhi-everybody%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F03%2Fxin_de_yi_tian%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Hi, Everybody!</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/03/xin_de_yi_tian/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IOS下的Safari的一些特性</title>
		<link>http://weiye.info/blog/2011/02/ios_xia_de_safari_te_xing/</link>
		<comments>http://weiye.info/blog/2011/02/ios_xia_de_safari_te_xing/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 07:08:56 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[杂乱]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=114</guid>
		<description><![CDATA[1. viewport iOS Sarari 浏览器允许网页 Head 里存在一个 Viewport 声明，用来规范浏览器对此页面的缩放特性，完整的声明如下： &#60;meta name=&#34;viewport&#34; content=&#34;width=device-width, &#160;initial-scale=1, minimum-scale=1, maximum-scale=2, user-scalable=no&#34; /&#62; Viewport 里目前有五个可以设置的属性，它们各自的作用如下： width：设置 viewport 的宽度，即 iPhone 最初模拟 PC 浏览器的宽度，之后 iPhone/iPad 会这个宽度展现的页面同比缩放到 iPhone/iPad 屏幕上。设置 width=device-width 后就不会再进行缩放了，因为宽度正好和 iPhone/iPad 的宽度相同（前提是没有设置缩放比例）。 minimum-scale 和 maximum-scale：是控制用户允许设置的最大/最小缩放比例的。 user-scalable：标识是否允许对页面进行缩放，取值有两个 yes 和 no。设置为 no 则不允许进行页面缩放了。 initial-scale：设置页面的初始化缩放比例。 通过控制这个，将网页的主体内容扩展到整个界面，能够给用户更好的阅读体验。 2. 横竖屏切换。 Mobile Safari for iPad 可以直接在 link 或者 style [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=IOS%E4%B8%8B%E7%9A%84Safari%E7%9A%84%E4%B8%80%E4%BA%9B%E7%89%B9%E6%80%A7&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(1) — 语法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fhi-everybody%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Hi, Everybody!</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>1. viewport</p>
<p>iOS Sarari 浏览器允许网页 Head 里存在一个 Viewport 声明，用来规范浏览器对此页面的缩放特性，完整的声明如下：</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,<br />
&nbsp;initial-scale=1, minimum-scale=1, <br />
maximum-scale=2, user-scalable=no&quot; /&gt;</div></div>
<p>Viewport 里目前有五个可以设置的属性，它们各自的作用如下：</p>
<ul>
<li>width：设置 viewport 的宽度，即 iPhone 最初模拟 PC 浏览器的宽度，之后 iPhone/iPad 会这个宽度展现的页面同比缩放到 iPhone/iPad 屏幕上。设置 width=device-width 后就不会再进行缩放了，因为宽度正好和 iPhone/iPad 的宽度相同（前提是没有设置缩放比例）。</li>
<li>minimum-scale 和 maximum-scale：是控制用户允许设置的最大/最小缩放比例的。</li>
<li>user-scalable：标识是否允许对页面进行缩放，取值有两个 yes 和 no。设置为 no 则不允许进行页面缩放了。</li>
<li>initial-scale：设置页面的初始化缩放比例。</li>
</ul>
<p>通过控制这个，将网页的主体内容扩展到整个界面，能够给用户更好的阅读体验。</p>
<p>2. 横竖屏切换。</p>
<p>Mobile Safari for iPad 可以直接在 link 或者 style 标签的 media 属性里声明该样式是竖屏的还是横屏的。可以利用来在横竖屏下面做一些不同的内容布局。</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/* 竖屏时使用的样式 */<br />
&lt;style media=&quot;all and (orientation:portrait)&quot; type=&quot;text/css&quot;&gt;<br />
#landscape { display: none; }<br />
&lt;/style&gt;<br />
&nbsp;<br />
/* 横屏时使用的样式 */<br />
&lt;style media=&quot;all and (orientation:landscape)&quot; type=&quot;text/css&quot;&gt;<br />
#portrait { display: none; }<br />
&lt;/style&gt;</div></div>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=IOS%E4%B8%8B%E7%9A%84Safari%E7%9A%84%E4%B8%80%E4%BA%9B%E7%89%B9%E6%80%A7&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobject_c_xue_xi_bi_ji%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Objective C 学习笔记(1) — 语法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Fmusic-learning%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fios_xia_de_safari_te_xing%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">学点音乐</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/02/ios_xia_de_safari_te_xing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>读《中国近代史》</title>
		<link>http://weiye.info/blog/2011/02/chinese-recent-history/</link>
		<comments>http://weiye.info/blog/2011/02/chinese-recent-history/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 03:58:50 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[读书]]></category>
		<category><![CDATA[历史，近代]]></category>
		<category><![CDATA[徐中约]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=111</guid>
		<description><![CDATA[中国近代这一百多年，跟春秋战国时期，魏晋南北朝时期,属于中国历史上最为波澜壮阔的宏大社会变革期，都需要仔细的去了解和品味。 之前听说了徐中约教授的饮誉中外的《中国近代史》,这本书讲了自清初到二十世纪九十年代初的大约400年的历史，书中的史料非常详尽, 讲述了很多教科书上不曾提到或者一笔带过的重大事件。这本书总共42章，但是大陆出版的像广电总局审电影似的了剪掉了非常多的史料，最后只剩下29章。推荐看看香港中文大学出版的那个版本。 我们在课本上学习的历史，往往将单一的历史事件割裂开来，对于事件的起因和后续的影响简单的带过。事实上历史是连续的。这本书中从清初开始讲起，是为了说明中国近代史并不是被鸦片战争的炮声突然轰开的，它有着之前深刻的社会背景,此前的200多年，西方的很多传教士进入了中国,已经将很多的先进技术带入了中国，只是中国并不重视，只是作为玩具和观赏艺术来对待。之前的西方国家也不敢小瞧这个巨大的国度，只是在后续的几次交锋中逐步摸清了中国虚弱的本质。 鸦片战争之后，中国先从经济军事、政治制度、思想文化上学习西方.二次鸦片战争之后开始了30年的以慈禧，奕訢、曾国藩、李鸿章等人领导的“中学为体，西学为用”的洋务运动，学习制造西方的现代船炮，打造了一支亚洲领先的北洋海军。然而中日甲午海战的惨败宣告仅仅学习经济军事是不够的。之后又开始了政治制度的学习，康有为梁启超学习英国和日本的君主立宪制度，孙中山学习美国的民主共和制度。最终戌变法失败了，辛亥革命成功了但却面临之后的多次复辟混乱,最终导致了军阀割据。说明中国还没有为这暂新的制度做好准备。强烈的挫败感和危机感，使得中国人又开始从思想文化上学习西方,陈独秀，胡适，鲁迅等领导的新文化运动，主张学习西方的科学和民主，矛头直指传统的儒家思想。运动动摇了封建思想的统治地位，大大解放了人民的思想。不过很多人带有非常偏激的情绪，主张摈弃中国民族文化，全盘西化，对中国传统思想文化,价值观念造成了相当大的破坏。不过建立起现代中国的社会基础已经准备好了。 北伐战争的胜利，使得中国重新统一了。但是国民党政府没有抓住历史的契机，进行土地改革，改善民生。而是忙于奔命处理内部不和，通货膨胀，与共产党内战和日本侵略等问题。最终赢得了抗日战争之后，却失去了民心的支持，逃往了台湾。中国也真正完成了三民主义中的民族革命。 对于新中国的历史，几乎还没有其他书籍做过系统的整理,历史课本就不用提了。看了这本书之后，相信对于大跃进，对于文革，对于改革开放,对于许多的历史人物，等等都会有更深刻的理解。例如中苏的交恶，文化大革命的发起，林彪的叛乱，80年代的通货膨胀。不能说太细了，不然我的博客要被墙了。 对于很多的历史人物和事件，我们需要更全面的去评价他们的成败得失。 对于中日甲午海战之后的百日维新戊戌变法，往往都说它是失败的，是一部悲剧。但是它对宪政，对民主起了很大的宣传作用，点燃了许多中国民众心中等政治火炬，大大加速了帝制的灭亡。 有一些人说孙中山又没有打过仗，辛亥革命发生的时候，孙中山甚至都不在国内，甚至都不一定知道有这回事。完全是个投机者。读了这段历史会发现，孙中山为了达到最后的目的，有时候真的有些不择手段。但是他的思想和远见，着实具有深刻的指导意义。他学习西方又不唯西方，而是结合中国社会背景，提出的三民主义和五权宪法，直到现在都有现实的价值。可惜我们现在也只是实现了民族主义，民权主义和民生主义还远未达到。五权宪法在孟德斯鸠的立法、司法、行政三权之外加上了考试权和监察权。科举考试是中国古代的非常重要和先进的一项人才选拔制度，后来出现问题不是考试制度的问题而是所考的内容出现了重大问题，变成了无用的八股文。监察权相信也是因为中国历史上贪污腐败横行而独立出来的，不过如果立法和司法真能够独立的话，相信监察权也许就不需要单独提出了。 喜欢看这段历史的童鞋，不妨去新浪爱问http://ishare.iask.sina.com.cn/上搜索下徐中约，中国近代史 42章,相信不少。徐中约的这本书提供了丰富的史料让我们了解这段历史，不过更多的体现在外交和国际关系层面上。社会和文化层面上，不知道你们有没有什么更详尽的书推荐. 中国每次的大变革时期，都是思想文化最开放的时期，为之后辉煌灿烂的文明打下坚实的思想文化和政治制度的基础，比如战国之后的秦汉，南北朝之后的隋唐。希望这一次也一样。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 SNS、SCM、IOS、敏捷开发、推荐算法&#8230; Facebook 豆瓣 新浪微博 Twitter 向文章付费
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E8%AF%BB%E3%80%8A%E4%B8%AD%E5%9B%BD%E8%BF%91%E4%BB%A3%E5%8F%B2%E3%80%8B&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="3"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="这一年的工作" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/23/11355199.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">这一年的工作</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Hi, Everybody!" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fhi-everybody%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Hi, Everybody!</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="flipboard简单分析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fflipboard-implement-research%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">flipboard简单分析</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="3" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>中国近代这一百多年，跟春秋战国时期，魏晋南北朝时期,属于中国历史上最为波澜壮阔的宏大社会变革期，都需要仔细的去了解和品味。<br />
之前听说了徐中约教授的饮誉中外的《中国近代史》,这本书讲了自清初到二十世纪九十年代初的大约400年的历史，书中的史料非常详尽, 讲述了很多教科书上不曾提到或者一笔带过的重大事件。这本书总共42章，但是大陆出版的像广电总局审电影似的了剪掉了非常多的史料，最后只剩下29章。推荐看看香港中文大学出版的那个版本。</p>
<p>我们在课本上学习的历史，往往将单一的历史事件割裂开来，对于事件的起因和后续的影响简单的带过。事实上历史是连续的。这本书中从清初开始讲起，是为了说明中国近代史并不是被鸦片战争的炮声突然轰开的，它有着之前深刻的社会背景,此前的200多年，西方的很多传教士进入了中国,已经将很多的先进技术带入了中国，只是中国并不重视，只是作为玩具和观赏艺术来对待。之前的西方国家也不敢小瞧这个巨大的国度，只是在后续的几次交锋中逐步摸清了中国虚弱的本质。</p>
<p>鸦片战争之后，中国先从经济军事、政治制度、思想文化上学习西方.二次鸦片战争之后开始了30年的以慈禧，奕訢、曾国藩、李鸿章等人领导的“中学为体，西学为用”的洋务运动，学习制造西方的现代船炮，打造了一支亚洲领先的北洋海军。然而中日甲午海战的惨败宣告仅仅学习经济军事是不够的。之后又开始了政治制度的学习，康有为梁启超学习英国和日本的君主立宪制度，孙中山学习美国的民主共和制度。最终戌变法失败了，辛亥革命成功了但却面临之后的多次复辟混乱,最终导致了军阀割据。说明中国还没有为这暂新的制度做好准备。强烈的挫败感和危机感，使得中国人又开始从思想文化上学习西方,陈独秀，胡适，鲁迅等领导的新文化运动，主张学习西方的科学和民主，矛头直指传统的儒家思想。运动动摇了封建思想的统治地位，大大解放了人民的思想。不过很多人带有非常偏激的情绪，主张摈弃中国民族文化，全盘西化，对中国传统思想文化,价值观念造成了相当大的破坏。不过建立起现代中国的社会基础已经准备好了。</p>
<p>北伐战争的胜利，使得中国重新统一了。但是国民党政府没有抓住历史的契机，进行土地改革，改善民生。而是忙于奔命处理内部不和，通货膨胀，与共产党内战和日本侵略等问题。最终赢得了抗日战争之后，却失去了民心的支持，逃往了台湾。中国也真正完成了三民主义中的民族革命。</p>
<p>对于新中国的历史，几乎还没有其他书籍做过系统的整理,历史课本就不用提了。看了这本书之后，相信对于大跃进，对于文革，对于改革开放,对于许多的历史人物，等等都会有更深刻的理解。例如中苏的交恶，文化大革命的发起，林彪的叛乱，80年代的通货膨胀。不能说太细了，不然我的博客要被墙了。</p>
<p>对于很多的历史人物和事件，我们需要更全面的去评价他们的成败得失。</p>
<p>对于中日甲午海战之后的百日维新戊戌变法，往往都说它是失败的，是一部悲剧。但是它对宪政，对民主起了很大的宣传作用，点燃了许多中国民众心中等政治火炬，大大加速了帝制的灭亡。</p>
<p>有一些人说孙中山又没有打过仗，辛亥革命发生的时候，孙中山甚至都不在国内，甚至都不一定知道有这回事。完全是个投机者。读了这段历史会发现，孙中山为了达到最后的目的，有时候真的有些不择手段。但是他的思想和远见，着实具有深刻的指导意义。他学习西方又不唯西方，而是结合中国社会背景，提出的三民主义和五权宪法，直到现在都有现实的价值。可惜我们现在也只是实现了民族主义，民权主义和民生主义还远未达到。五权宪法在孟德斯鸠的立法、司法、行政三权之外加上了考试权和监察权。科举考试是中国古代的非常重要和先进的一项人才选拔制度，后来出现问题不是考试制度的问题而是所考的内容出现了重大问题，变成了无用的八股文。监察权相信也是因为中国历史上贪污腐败横行而独立出来的，不过如果立法和司法真能够独立的话，相信监察权也许就不需要单独提出了。</p>
<p>喜欢看这段历史的童鞋，不妨去新浪爱问http://ishare.iask.sina.com.cn/上搜索下徐中约，中国近代史 42章,相信不少。徐中约的这本书提供了丰富的史料让我们了解这段历史，不过更多的体现在外交和国际关系层面上。社会和文化层面上，不知道你们有没有什么更详尽的书推荐.</p>
<p>中国每次的大变革时期，都是思想文化最开放的时期，为之后辉煌灿烂的文明打下坚实的思想文化和政治制度的基础，比如战国之后的秦汉，南北朝之后的隋唐。希望这一次也一样。</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E8%AF%BB%E3%80%8A%E4%B8%AD%E5%9B%BD%E8%BF%91%E4%BB%A3%E5%8F%B2%E3%80%8B&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="2"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="这一年的工作" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/23/11355199.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">这一年的工作</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="设想的小额电子支付方式" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fsmall-electronic-paymen-style%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">设想的小额电子支付方式</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="2" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/02/chinese-recent-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>构建我们的离线Web应用</title>
		<link>http://weiye.info/blog/2011/01/offline-web-application/</link>
		<comments>http://weiye.info/blog/2011/01/offline-web-application/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 03:10:52 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[产品]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[离线应用]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[webapp]]></category>
		<category><![CDATA[本地存储]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=108</guid>
		<description><![CDATA[公司希望为我们的Web站点，开发一个html5版本，拓展到Pad端，给使用高级浏览器的用户一个更加完善的用户体验。其中一个重要的功能就是支持离线应用。 利用html5构建一个离线应用，主要依赖于三个新的特性 1. 离线资源缓存： 可以在一个manifest文件中指明离线应用工作所需的资源文件。缓存的文件可以在manifest文件本身发生变化的时候更新，或者检测window.applicationCache.status，然后调用window.applicationCache.update()更新缓存。 2. 在线状态检测： html5支持通过navigator.onLine获取当前的在线状态。html5还提供在线和离线事件机制.针对在线状态，我们可以做出不同的处理 3. 本地数据存储： html5提供了LocalStorage和WebDatabase(WebSQL/indexedDB)两种存储机制。前者提供key/value存储方式，后者提供关系数据库存储功能。 离线资源缓存 要使用离线缓存功能，需要在编写manifest文件，并指定使用的manifest. &#160; &#160; &#60;doctype html5&#62; &#160; &#160; &#60;html manifest=&#34;demo.manifest&#34;&#62; &#160; &#160; ... &#160; &#160; &#60;/html&#62; manifest文件格式. 首行必须是 CACHE MANIFEST。其后，每一行列出一个需要缓存的资源文件名。 可根据需要列出在线访问的白名单。白名单中的所有资源不会被缓存，在使用时将直接在线访问。声明白名单使用 NETWORK：标识符。 如果在白名单后还要补充需要缓存的资源，可以使用 CACHE：标识符。 如果要声明某 URI 不能访问时的替补 URI，可以使用 FALLBACK：标识符。其后的每一行包含两个 URI，当第一个 URI 不可访问时，浏览器将尝试使用第二个 URI。 注释要另起一行，以 # 号开头。 文件示例 &#160;CACHE MANIFEST &#160;demo.html &#160;demo.css &#160;demo.js &#160;NETWORK: &#160;demo.php [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E6%9E%84%E5%BB%BA%E6%88%91%E4%BB%AC%E7%9A%84%E7%A6%BB%E7%BA%BFWeb%E5%BA%94%E7%94%A8&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fflipboard-implement-research%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">flipboard简单分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F12%2Fredis-for-store-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">用Redis来做排行榜存储</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fpost-wordpress-by-vim%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用Vim发表WordPress日志</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>
    公司希望为我们的Web站点，开发一个html5版本，拓展到Pad端，给使用高级浏览器的用户一个更加完善的用户体验。其中一个重要的功能就是支持离线应用。</p>
<p>
    利用html5构建一个离线应用，主要依赖于三个新的特性
    </p>
<dl>
<dt>1. 离线资源缓存：</dt>
<dd>可以在一个manifest文件中指明离线应用工作所需的资源文件。缓存的文件可以在<b>manifest文件本身</b>发生变化的时候更新，或者检测window.applicationCache.status，然后调用window.applicationCache.update()更新缓存。</dd>
<dt>2. 在线状态检测：</dt>
<dd>html5支持通过navigator.onLine获取当前的在线状态。html5还提供在线和离线事件机制.针对在线状态，我们可以做出不同的处理</dd>
<dt>3. 本地数据存储：</dt>
<dd> html5提供了LocalStorage和WebDatabase(WebSQL/indexedDB)两种存储机制。前者提供key/value存储方式，后者提供关系数据库存储功能。</dd>
</dl>
<h3>离线资源缓存</h3>
<p>要使用离线缓存功能，需要在编写manifest文件，并指定使用的manifest.</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &lt;doctype html5<span style="color: #00AA00;">&gt;</span><br />
&nbsp; &nbsp; &lt;html manifest<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;demo.manifest&quot;</span><span style="color: #00AA00;">&gt;</span><br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; &lt;/html<span style="color: #00AA00;">&gt;</span></div></div>
<p>manifest文件格式.</p>
<ul>
<li> 首行必须是 CACHE MANIFEST。其后，每一行列出一个需要缓存的资源文件名。</li>
<li> 可根据需要列出在线访问的白名单。白名单中的所有资源不会被缓存，在使用时将直接在线访问。声明白名单使用 NETWORK：标识符。</li>
<li> 如果在白名单后还要补充需要缓存的资源，可以使用 CACHE：标识符。 </li>
<li> 如果要声明某 URI 不能访问时的替补 URI，可以使用 FALLBACK：标识符。其后的每一行包含两个 URI，当第一个 URI 不可访问时，浏览器将尝试使用第二个 URI。 </li>
<li> 注释要另起一行，以 # 号开头。 </li>
</ul>
<p> 文件示例</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;CACHE MANIFEST<br />
&nbsp;demo<span style="color: #6666ff;">.html</span><br />
&nbsp;demo<span style="color: #6666ff;">.css</span><br />
&nbsp;demo.js<br />
<br />
&nbsp;NETWORK<span style="color: #00AA00;">:</span><br />
&nbsp;demo.php<br />
<br />
&nbsp;CACHE<span style="color: #00AA00;">:</span><br />
&nbsp;demo2.css<br />
<br />
&nbsp;FALLBACK<span style="color: #00AA00;">:</span><br />
&nbsp;/files/ /default.html</div></div>
<h3>在线状态检测</h3>
<p>    上面提到过，目前html5提供了两种检测是否在线的方式</p>
<dl>
<dt>检测 navigator.onLine </dt>
<dt>侦听document的online和offline事件</dt>
</dl>
<h3>本地数据存储</h3>
<p>通常我们用cookie来存储数据，但是cookie存储的数据量太小.而且每次发起http请求都要带上，增加了数据的传输量.html5新引入了两种key/value存储方式，提供比较大规模，性能更高安全性更好的存储方式。 localStorage 和 sessionStorage<br />
sessionStorage只在本次浏览器会话中保存，浏览器关闭之后存储就被丢弃。localStoage则可以比较长期的保存。但是使用方式都一样，非常简单.<br />
直接</p>
<div class="codecolorer-container javascript default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">localStorage.<span style="color: #660066;">key1</span> <span style="color: #339933;">=</span> val1<span style="color: #339933;">;</span><br />
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span> localStorage.<span style="color: #660066;">key1</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>另一种方式是关系数据库存储，不过虽然chrome提供了websql特性。但是貌似html5工作组停止了这个标准的制定工作，转而支持另一种indexedDb的标准。但是indexedDB目前还没有浏览器实现。我的理解，前者基于Sqlite的Sql来操作数据，后者可能更像是ORM的方式,数据操作更加优雅更加对象化。所以可能暂时这个功能得不到大范围使用。</p>
<h3>问题</h3>
<p>利用离线资源缓存，我们就可以能够访问读到应用了。然后利用状态检测和数据存储功能，我们就可以在离线的时候，将用户的操作保存起来，等到在线的时候，再将它们发布到服务器上。做了一些demo后发现，已经能实现一些简单的应用了, 还有一些问题需要解决，包括。</p>
<ol>
<li> manifest文件不支持通配符，因此我们的一些通过动态生成的文件，比如合并压缩的js和css文件，不太好缓存。以及很多根据ID通过ajax生成的数据也不容易缓存。</li>
<li>一些离线状态下的操作，比如发表的评论和执行的转发操作。即时能够通过在线的时候同步，但是也可能面对失去了时效性之类的问题。而且下次再次离线上来的时候，还没能够同步到服务器的这些离线操作内容不容易呈现出来。</li>
<li>如何在线上的内容更新的时候，通知客户端更新缓存。动态生成manifest文件，可能导致所有的内容都更新。</li>
<li>httpCache和offlineCache的内容无法共享，导致的客户端存储空间浪费。</li>
</ol>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E6%9E%84%E5%BB%BA%E6%88%91%E4%BB%AC%E7%9A%84%E7%A6%BB%E7%BA%BFWeb%E5%BA%94%E7%94%A8&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fflipboard-implement-research%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">flipboard简单分析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F12%2Fredis-for-store-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">用Redis来做排行榜存储</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fproject-tools-selection%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Foffline-web-application%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每讯项目管理工具选型</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/01/offline-web-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SCRUM方式项目开发</title>
		<link>http://weiye.info/blog/2011/01/scrum%e4%bd%bf%e7%94%a8/</link>
		<comments>http://weiye.info/blog/2011/01/scrum%e4%bd%bf%e7%94%a8/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 16:40:37 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[产品]]></category>
		<category><![CDATA[任务条]]></category>
		<category><![CDATA[燃尽图]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[xp]]></category>
		<category><![CDATA[敏捷开发]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=100</guid>
		<description><![CDATA[看到同事写的一片博客，项目开发中的小纸条，想想在他的带动下，这一年也试验了很多敏捷开发的方式。包括一开始使用的燃尽图，封闭开发期间推行的单元测试，现在使用的任务小纸条。应该说效果还是非常明显的，虽然不是在所有的项目中都采用了，但是在我们团队多人配合的周期在三周以上的大点的项目中，基本都是采用了。 使用燃尽图的时候，产品的理想开发周期应该在三周左右。我们一开始将任务拆分出来，粒度在半天左右的。列出开发计划，每一天完成多少个功能点。需求不明确的，要尽快跟产品人员沟通确认。在白纸上或者白板上，以功能点个数为纵轴，开发工作日为横轴的坐标上，标出每天的剩余的未完成功能点数，连成曲线。然后每天标出实际的剩余功能点数，汇出另外一条曲线。如果发现实际曲线高于计划曲线，说明项目进度慢于预期，那么项目将可能面临延期的风险。如果实际曲线低于计划曲线，并且差距越来越大，说明项目可能能够提前完成。理想的情况应该是两条曲线基本吻合，否则要么是我们的估计出现了偏差，要么是项目中出现了意外情况。根据曲线的偏离情况，可能需要及时的做出调整，保证项目的正常完成。项目中团队每天下班前需要碰一下，报告完成的功能点数。 根据项目的情况，我们可以在几个关键的功能点上标明项目的里程碑，重点关注几个里程碑的开发进度。相对完整的功能块及时提交给测试人员。使得他们能够提前介入测试，缩短项目周期。 任务条的部分我们是上一个项目开始使用的，详细情况参见同事的文章。 燃尽图和小纸条都属与scrum开发方式的组成部分。它要求我们一开始就将任务能够拆分的足够细致。开发过程中发现曲线偏离过大的，及时的做出风险提示，并尽快找到原因，作出修正。每天团队有短暂的会议来相互沟通，跟踪进度。测试能够尽快进入。实现产品需求的快速迭代。 这些技术应该說还是不难使用的，最关键的地方还是一开始的功能拆分，需要完全理解产品的需求，不明确的尽快沟通。任务需要拆分的足够细致，并分配到具体的人，才能做好开发的时间评估。这个工作要一整天甚至更多的时间。之后需要每天通过短暂的会议沟通，坚持绘制曲线和移动小纸条。需要注意的是任务的完成需要以能够提交给QA测试为标准，而不是差不多完成了。說差不多完成了的时候，往往还需要一半的时间来做到真正的完成。 至于单元测试的东西，改天我再写一写当初我们的经历。 最后感兴趣的朋友我推荐一本书 硝烟中的Scrum和xp 网上可以免费下载。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 SNS、SCM、IOS、敏捷开发、推荐算法&#8230; Facebook 豆瓣 新浪微博 Twitter 向文章付费
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=SCRUM%E6%96%B9%E5%BC%8F%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25e4%25bd%25bf%25e7%2594%25a8%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fproject-tools-selection%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每讯项目管理工具选型</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fsmall-electronic-paymen-style%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">设想的小额电子支付方式</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">yield的简单理解</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>看到同事写的一片博客，<a href="http://yinwm.com/2011/01/cards-in-a-simple-scrum-project/">项目开发中的小纸条</a>，想想在他的带动下，这一年也试验了很多敏捷开发的方式。包括一开始使用的燃尽图，封闭开发期间推行的单元测试，现在使用的任务小纸条。应该说效果还是非常明显的，虽然不是在所有的项目中都采用了，但是在我们团队多人配合的周期在三周以上的大点的项目中，基本都是采用了。</p>
<p><img class="aligncenter size-full wp-image-104" src="http://weiye.info/blog/wp-content/uploads/2011/01/scrum_and_xp1.png" alt="" width="426" height="279" /></p>
<p>使用燃尽图的时候，产品的理想开发周期应该在三周左右。我们一开始将任务拆分出来，粒度在半天左右的。列出开发计划，每一天完成多少个功能点。需求不明确的，要尽快跟产品人员沟通确认。在白纸上或者白板上，以功能点个数为纵轴，开发工作日为横轴的坐标上，标出每天的剩余的未完成功能点数，连成曲线。然后每天标出实际的剩余功能点数，汇出另外一条曲线。如果发现实际曲线高于计划曲线，说明项目进度慢于预期，那么项目将可能面临延期的风险。如果实际曲线低于计划曲线，并且差距越来越大，说明项目可能能够提前完成。理想的情况应该是两条曲线基本吻合，否则要么是我们的估计出现了偏差，要么是项目中出现了意外情况。根据曲线的偏离情况，可能需要及时的做出调整，保证项目的正常完成。项目中团队每天下班前需要碰一下，报告完成的功能点数。<br />
根据项目的情况，我们可以在几个关键的功能点上标明项目的里程碑，重点关注几个里程碑的开发进度。相对完整的功能块及时提交给测试人员。使得他们能够提前介入测试，缩短项目周期。<br />
任务条的部分我们是上一个项目开始使用的，详细情况参见同事的文章。</p>
<p>燃尽图和小纸条都属与scrum开发方式的组成部分。它要求我们一开始就将任务能够拆分的足够细致。开发过程中发现曲线偏离过大的，及时的做出风险提示，并尽快找到原因，作出修正。每天团队有短暂的会议来相互沟通，跟踪进度。测试能够尽快进入。实现产品需求的快速迭代。</p>
<p>这些技术应该說还是不难使用的，最关键的地方还是一开始的功能拆分，需要完全理解产品的需求，不明确的尽快沟通。任务需要拆分的足够细致，并分配到具体的人，才能做好开发的时间评估。这个工作要一整天甚至更多的时间。之后需要每天通过短暂的会议沟通，坚持绘制曲线和移动小纸条。需要注意的是任务的完成需要以能够提交给QA测试为标准，而不是差不多完成了。說差不多完成了的时候，往往还需要一半的时间来做到真正的完成。</p>
<p>至于单元测试的东西，改天我再写一写当初我们的经历。<br />
最后感兴趣的朋友我推荐一本书<br />
硝烟中的Scrum和xp 网上可以免费下载。</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=SCRUM%E6%96%B9%E5%BC%8F%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%8F%91&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25e4%25bd%25bf%25e7%2594%25a8%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fsmall-electronic-paymen-style%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">设想的小额电子支付方式</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F08%2Fproject-tools-selection%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每讯项目管理工具选型</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F02%2Fchinese-recent-history%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fscrum%25E4%25BD%25BF%25E7%2594%25A8%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">读《中国近代史》</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/01/scrum%e4%bd%bf%e7%94%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>别做正常的傻瓜</title>
		<link>http://weiye.info/blog/2011/01/book-not-abnormal-foolish/</link>
		<comments>http://weiye.info/blog/2011/01/book-not-abnormal-foolish/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 15:30:09 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[读书]]></category>
		<category><![CDATA[交易]]></category>
		<category><![CDATA[行为决策学]]></category>
		<category><![CDATA[选择]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=99</guid>
		<description><![CDATA[最近跟同事们吃饭的时候，经常问他们一些有意思的问题,当然得到的答案有时候也很有意思。 这里列一些问题。 1.假如你患有一种病，除了在5年之内有1/1000的可能突然死亡之外，没有其他症状。 如果有一家公司开发出了一种能够治愈你并且没有其他副作用的药，你愿意花钱买么，最多愿意出多少钱？ 又比如这家公司开发出了一种药物，这种药物有1/1000的可能导致5年内突然死亡，并无其他毒副作用。现在他们 要花钱找人试验这种新药，公司最少给你多少钱你才愿意尝试么？ 2. 阿Q之前听到了内幕消息说，一只股票行情看好。于是阿Q10块钱买了这支股票10000股.今天一看，现在跌到了5块钱。假如股票交易不用支付任何成本。阿Q很生气，打开电脑准备抛掉，鼠标悬在售出的按钮上的时候，阿Q很犹豫，因为内幕消息大多比较准确。是你的话你选择抛售还是持有？ 正在犹豫的时候,一个电话打过来了，阿Q去接了个电话。他们家里的猫不小心踩到了鼠标上。按下了抛出按钮。阿Q发现之后，你觉得他是应该在买回来还是不买回来？ 3.假如你期待一场音乐会很久了，虽然门票比较贵，1000块钱。但是你还是狠心买了一张门票，晚上正准备出门的时候,发现门票丢了。你会去再买一张么? 假如你白天并没有买这张门票，晚上要出门的时候，发现丢掉了一张1000块钱的电话卡，你还会去买音乐会的门票么？ 4.假如你现在在一家商场，想买一辆摩托车，价格5000块钱。正打算买的时候，你的朋友告诉你，一公里外的另一家商场,同样的摩托车只卖4950元。你会到另一家商场去买么。假如你买的不是摩托车。而是自行车，价格300块钱，同样的你朋友告诉你，一公里外的另一家商场，同样的自行车只卖250元，你会到另一家商场买么？ 5. 假如你要从巴黎飞往上海，你很想要在飞机上睡一觉，但是你平常都要吃一种药物才睡的着。你在巴黎找到这种药后发现,巴黎的这种药需要200元一片，而在上海要卖500元. 你会买一片么？ 同样的情况，如果在上海这种药只卖2块钱，巴黎卖200块钱，你还会买么？ 6. 假如你是一家公司的总裁，你们正在做一个项目，已经忙碌了9个月投入了,500万元，再有一个月投入50万元就完成了。这个时候一份比较准确的调查报告显示，你们的产品投放到市场上面，不考虑已有投入的情况下，有10%的可能盈利2500万元，有90%的可能亏损500万元。那么你会选择坚持这个项目么？ 这些问题都来自一本书《别做正常的傻瓜》,作者奚恺元. 书中还有很多其他的有趣问题。虽然有些问题仔细想想，也其实存在一些漏洞。向大家强烈推荐这本书。书中通过这些生活化的例子展示, 很多人在生活中的所作出的选择和决定，虽然符合在大多数人的正常思维，但其实不是理性的,他们是“正常的傻瓜”。书里面具体分析为何人们会作出不理性的选择，原因包括心理账户，交易偏见，沉没成本误区，过于自信，和适应性偏见,损失规避,忽视未得收益等方面。 同时也在教我们如何才能做出理智的选择,脱离正常的傻瓜行列。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 SNS、SCM、IOS、敏捷开发、推荐算法&#8230; Facebook 豆瓣 新浪微博 Twitter 向文章付费
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E5%88%AB%E5%81%9A%E6%AD%A3%E5%B8%B8%E7%9A%84%E5%82%BB%E7%93%9C&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Fmusic-learning%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">学点音乐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fpost-wordpress-by-vim%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">使用Vim发表WordPress日志</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif"/>
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Finternet-big-things-2011%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">回想这一年的互联网</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近跟同事们吃饭的时候，经常问他们一些有意思的问题,当然得到的答案有时候也很有意思。<br />
这里列一些问题。</p>
<p>1.假如你患有一种病，除了在5年之内有1/1000的可能突然死亡之外，没有其他症状。<br />
如果有一家公司开发出了一种能够治愈你并且没有其他副作用的药，你愿意花钱买么，最多愿意出多少钱？<br />
又比如这家公司开发出了一种药物，这种药物有1/1000的可能导致5年内突然死亡，并无其他毒副作用。现在他们<br />
要花钱找人试验这种新药，公司最少给你多少钱你才愿意尝试么？</p>
<p>2. 阿Q之前听到了内幕消息说，一只股票行情看好。于是阿Q10块钱买了这支股票10000股.今天一看，现在跌到了5块钱。假如股票交易不用支付任何成本。阿Q很生气，打开电脑准备抛掉，鼠标悬在售出的按钮上的时候，阿Q很犹豫，因为内幕消息大多比较准确。是你的话你选择抛售还是持有？<br />
正在犹豫的时候,一个电话打过来了，阿Q去接了个电话。他们家里的猫不小心踩到了鼠标上。按下了抛出按钮。阿Q发现之后，你觉得他是应该在买回来还是不买回来？</p>
<p>3.假如你期待一场音乐会很久了，虽然门票比较贵，1000块钱。但是你还是狠心买了一张门票，晚上正准备出门的时候,发现门票丢了。你会去再买一张么?<br />
假如你白天并没有买这张门票，晚上要出门的时候，发现丢掉了一张1000块钱的电话卡，你还会去买音乐会的门票么？</p>
<p>4.假如你现在在一家商场，想买一辆摩托车，价格5000块钱。正打算买的时候，你的朋友告诉你，一公里外的另一家商场,同样的摩托车只卖4950元。你会到另一家商场去买么。假如你买的不是摩托车。而是自行车，价格300块钱，同样的你朋友告诉你，一公里外的另一家商场，同样的自行车只卖250元，你会到另一家商场买么？</p>
<p>5. 假如你要从巴黎飞往上海，你很想要在飞机上睡一觉，但是你平常都要吃一种药物才睡的着。你在巴黎找到这种药后发现,巴黎的这种药需要200元一片，而在上海要卖500元. 你会买一片么？<br />
同样的情况，如果在上海这种药只卖2块钱，巴黎卖200块钱，你还会买么？</p>
<p>6. 假如你是一家公司的总裁，你们正在做一个项目，已经忙碌了9个月投入了,500万元，再有一个月投入50万元就完成了。这个时候一份比较准确的调查报告显示，你们的产品投放到市场上面，不考虑已有投入的情况下，有10%的可能盈利2500万元，有90%的可能亏损500万元。那么你会选择坚持这个项目么？</p>
<p>这些问题都来自一本书《别做正常的傻瓜》,作者奚恺元.  书中还有很多其他的有趣问题。虽然有些问题仔细想想，也其实存在一些漏洞。向大家强烈推荐这本书。书中通过这些生活化的例子展示, 很多人在生活中的所作出的选择和决定，虽然符合在大多数人的正常思维，但其实不是理性的,他们是“正常的傻瓜”。书里面具体分析为何人们会作出不理性的选择，原因包括心理账户，交易偏见，沉没成本误区，过于自信，和适应性偏见,损失规避,忽视未得收益等方面。 同时也在教我们如何才能做出理智的选择,脱离正常的傻瓜行列。</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=%E5%88%AB%E5%81%9A%E6%AD%A3%E5%B8%B8%E7%9A%84%E5%82%BB%E7%93%9C&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F10%2Fmusic-learning%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">学点音乐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fyuemee%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">这一年的工作</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F09%2Fsimple-php-template-engine%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">非常简单的PHP模板引擎.</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fgit-auth-gitolite%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fbook-not-abnormal-foolish%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">git 的企业级授权工具 gitolite</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/01/book-not-abnormal-foolish/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>yield的简单理解</title>
		<link>http://weiye.info/blog/2011/01/python-yield/</link>
		<comments>http://weiye.info/blog/2011/01/python-yield/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 13:30:18 +0000</pubDate>
		<dc:creator>reedboat</dc:creator>
				<category><![CDATA[编程]]></category>
		<category><![CDATA[interator]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[yield]]></category>

		<guid isPermaLink="false">http://weiye.info/blog/?p=96</guid>
		<description><![CDATA[python中的yield关键字，之前没有仔细看。今天看了一下。我的理解是这样的, yield将一个函数打断成了多段,形成了一个迭代器(简单的理解成一个数组，数组中的每个元素是一段代码)。每次调用该迭代器的next()或者send()方法的时候，执行这个函数的下一段，然后保存函数执行中的各个变量的值和当前的控制流程，等待下次执行next()或者send()的时候恢复。 例如 下面定义的add函数 def add&#40;a&#41;: &#160; print a &#160; a=a+1 &#160; yield &#160; print a c=add&#40;10&#41; c.next&#40;&#41; 调用add函数的时候，并不执行add函数中的代码。而是返回一个迭代器 . （ c=add(10) ）c就是一个迭代器。调用c.next()方法的时候，才开始执行add函数的内容。第一次调用的时候执行到yield这一行中止了，输出a的值10。下一次调用c.next()才输出11。 yield 后面还可以跟一个参数，当调用next()方法的时候，就会返回这个值，外界也可以得到。如果用send(msg)方法，那么yield就直接返回msg值。 def add&#40;a&#41;: &#160; b = yield 1 &#160; a = a+b &#160; print a c = add&#40;10&#41; c.next&#40;&#41; 上面的这个例子。 第二次执行的时候，如果用c.next(), 那么b=1,c.next()的返回值也是1，输出内容是11。 如果使用c.send(5), 那么b=5,输出内容将是15。 yield这种使用方式，改变的通常的编写程序的思路，在循环递归中的用法就比较复杂了，还需要慢慢体会。 关于作者 reedboat, 每讯网, 研发经理 执着的技术人，完美的追求者。 PHP、JS职业攻城师。 SNS、SCM、IOS、敏捷开发、推荐算法&#8230; [...]
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;"><div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div><div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"/></a><div style="text-align:left;line-height:23px;margin-right:226px"><div style="padding:5px 10px"><div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div><div style="clear:left">执着的技术人，完美的追求者。
PHP、JS职业攻城师。
SNS、SCM、IOS、敏捷开发、推荐算法...</div></div></div></div><div style="text-align:right;border-top:1px dotted #ccc;padding:10px;"><div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div><div><a target="_blank" href="http://42qu.com/reedboat/pay?title=yield%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div></div></div>
	<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="3"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="这一年的工作" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F11%2Fthisyear%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/11/23/11355199.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">这一年的工作</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Objective C 学习笔记(3)　–　实现特点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F06%2Fobjective_c_xue_xi_bi_ji_3_-_shi_xian_te_dian%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Objective C 学习笔记(3)　–　实现特点</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="用Redis来做排行榜存储" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fweiye.info%2Fblog%2F2010%2F12%2Fredis-for-store-rank%2F&from=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/images/blogWidget/wordpress_default.gif" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用Redis来做排行榜存储</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="3" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>python中的yield关键字，之前没有仔细看。今天看了一下。我的理解是这样的, yield将一个函数打断成了多段,形成了一个迭代器(简单的理解成一个数组，数组中的每个元素是一段代码)。每次调用该迭代器的next()或者send()方法的时候，执行这个函数的下一段，然后保存函数执行中的各个变量的值和当前的控制流程，等待下次执行next()或者send()的时候恢复。</p>
<p>例如 下面定义的add函数</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> add<span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>:<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> a<br />
&nbsp; a=a+<span style="color: #ff4500;">1</span><br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">yield</span><br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> a<br />
<br />
c=add<span style="color: black;">&#40;</span><span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span><br />
c.<span style="color: black;">next</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></div>
<p>调用add函数的时候，并不执行add函数中的代码。而是返回一个迭代器 . （ c=add(10) ）c就是一个迭代器。调用c.next()方法的时候，才开始执行add函数的内容。第一次调用的时候执行到yield这一行中止了，输出a的值10。下一次调用c.next()才输出11。</p>
<p>yield 后面还可以跟一个参数，当调用next()方法的时候，就会返回这个值，外界也可以得到。如果用send(msg)方法，那么yield就直接返回msg值。</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">def</span> add<span style="color: black;">&#40;</span>a<span style="color: black;">&#41;</span>:<br />
&nbsp; b = <span style="color: #ff7700;font-weight:bold;">yield</span> <span style="color: #ff4500;">1</span><br />
&nbsp; a = a+b<br />
&nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> a<br />
<br />
c = add<span style="color: black;">&#40;</span><span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span><br />
c.<span style="color: black;">next</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></div>
<p>上面的这个例子。<br />
第二次执行的时候，如果用c.next(), 那么b=1,c.next()的返回值也是1，输出内容是11。<br />
如果使用c.send(5), 那么b=5,输出内容将是15。</p>
<p>yield这种使用方式，改变的通常的编写程序的思路，在循环递归中的用法就比较复杂了，还需要慢慢体会。</p>
<div id="qu42" style="border:1px solid #ccc;font-size:14px;margin:27px auto;">
<div style="padding:7px 10px;border-bottom:1px dotted #ccc">关于作者</div>
<div style="height:129px;overflow:hidden"><a target="_blank" href="http://42qu.com/reedboat" style="color:#000;text-decoration:none;float:right;"><img src="http://p4.42qu.us/219/894/23422.jpg" style="padding:3px;width:219px;height:123px;margin:0;background:transparent;border:0;border-left:1px dotted #ccc"></a>
<div style="text-align:left;line-height:23px;margin-right:226px">
<div style="padding:5px 10px">
<div style="overflow:hidden;margin:2px 0;float:left;font-size: 14px;"><a target="_blank" href="http://42qu.com/reedboat" style="text-decoration:none;">reedboat</a>, 每讯网, 研发经理</div>
<div style="clear:left">执着的技术人，完美的追求者。<br />
PHP、JS职业攻城师。<br />
SNS、SCM、IOS、敏捷开发、推荐算法&#8230;</div>
</div>
</div>
</div>
<div style="text-align:right;border-top:1px dotted #ccc;padding:10px;">
<div style="float:left;"><a target="_blank" href="http://reedboat.42qu.com/link/1439" style="margin-right:7px;text-decoration:none;">Facebook</a> <a target="_blank" href="http://reedboat.42qu.com/link/1438" style="margin-right:7px;text-decoration:none;">豆瓣</a> <a target="_blank" href="http://reedboat.42qu.com/link/1436" style="margin-right:7px;text-decoration:none;">新浪微博</a> <a target="_blank" href="http://reedboat.42qu.com/link/1437" style="margin-right:7px;text-decoration:none;">Twitter</a> </div>
<div><a target="_blank" href="http://42qu.com/reedboat/pay?title=yield%E7%9A%84%E7%AE%80%E5%8D%95%E7%90%86%E8%A7%A3&#038;url=http%3A%2F%2Fweiye.info%2Fblog%2F2011%2F01%2Fpython-yield%2F&#038;rel=blog" style="text-decoration:none;margin-right:17px">向文章付费</a></div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://weiye.info/blog/2011/01/python-yield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

