﻿<?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>奋斗足迹&#124;崔玉松 &#187; Study &amp; Reading</title>
	<atom:link href="http://fendou.org/category/study-reading/feed/" rel="self" type="application/rss+xml" />
	<link>http://fendou.org</link>
	<description>为家人，为自己，为生活~~</description>
	<lastBuildDate>Fri, 24 Feb 2012 15:21:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>淘宝Fourinone介绍及与Hadoop的性能PK</title>
		<link>http://fendou.org/2012/02/24/taobao-fourinone-vs-hadoop/</link>
		<comments>http://fendou.org/2012/02/24/taobao-fourinone-vs-hadoop/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 15:19:58 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[编程技术]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=871</guid>
		<description><![CDATA[FourInOne（中文名字“四不像”）是一个四合一分布式计算框架，在写这个框架之前，我对分布式计算进行了长时间的思考，也看了老外写的其他开源框架,当我们把复杂的hadoop当作一门学科学习时，似乎忘记了我们想解决问题的初衷：我们仅仅是想写个程序把几台甚至更多的机器一起用起来计算，把更多的cpu和内存利用上，来解决我们数量大和计算复杂的问题，当然这个过程中要考虑到分布式的协同和故障处理。如果仅仅是为了实现这个简单的初衷，为什么一切会那么复杂，我觉的自己可以写一个更简单的东西，它不需要过度设计，只需要看上去更酷一点，更小巧一点，功能更强一点。于是我将自己对分布式的理解融入到这个框架中，考虑到底层实现技术的相似性，我将Hadoop,Zookeeper,MQ,分布式缓存四大主要的分布式计算功能合为一个框架内，对复杂的分布式计算应用进行了大量简化和归纳。 fourinone-1.11.09 hadoop-0.21.0 体积 82K 71M 依赖关系 就一个jar,没有依赖 约12项jar包依赖 配置 就一个配置文件 较多配置文件和复杂属性 集群搭建 简单，每台机器放一个jar和配置文件 复杂，需要linux操作基础和ssh等复杂配置，还需要较多配置文件配置 计算模式 提供两种计算模式：包工头和工人直接交互方式，包工头和工人通过消息中枢方式交互，后者不需要工人节点可直接访问 计算更多倾向于文件数据的并行读取，而非计算过程的设计。JobTracke 跟TaskTracker直接交互， 查询NameNode后，TaskTracker直接从Datanode获取数据。 并行模式 N*N，支持单机并行，也支持多机并行，多机多实例并行 1*N，不支持单机并行，只支持多机单实例并行 内存方式 支持内存方式设计和开发应用，并内置完整的分布式缓存功能 以hdfs文件方式进行数据处理，内存方式计算支持很弱 文件方式 自带文件适配器处理io Hdfs处理文件io 计算数据要求 任意数据格式和任意数据来源，包括来自数据库，分布式文件，分布式缓存等 Hdfs内的文件数据，多倾向于带换行符的数据 调度角色 包工头，可以有多个，支持链式处理，也支持大包工头对小包工头的调度 JobTracke，通常与NameNode一起 任务执行角色 农民工，框架支持设计多种类型的工人用于拆分或者合并任务 TaskTracker，通常与Datanode一起 中间结果数据保存 手工仓库，或者其他任意数据库存储设备 Hdfs中间结果文件 拆分策略 自由设计，框架提供链式处理对于大的业务场景进行环节拆分数据的存储和计算拆分根据业务场景自定义 以64m为拆分进行存储，以行为拆分进行计算 实现map接口，按行处理数据进行计算 合并策略 自由设计，框架提供农民工节点之间的合并接口，可以互相交互设计合并策略，也可以通过包工头进行合并 TaskTracker不透明，较少提供程序控制，合并策略设计复杂 实现reduce接口进行中间数据合并逻辑实现 内存耗用 无需要制定JVM内存，按默认即可，根据计算要求考虑是否增加JVM内存 需要制定JVM内存，每个进程默认1G，常常namenode，jobtracker等启动3个进程，耗用3G内存 监控 框架提供多环节链式处理设计支持监控过程，通过可编程的监控方式，给于业务开发方最大灵活的监控需求实现，为追求高性能不输出大量系统监控log 输出较多的系统监控log，如map和reduce百分比等，但是会牺牲性能，业务监控需要自己实现 打包部署 脚本工具...  <a href="http://fendou.org/2012/02/24/taobao-fourinone-vs-hadoop/" class="more-link" title="Read 淘宝Fourinone介绍及与Hadoop的性能PK">Read more &#187;</a><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%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">五个最佳的Hadoop项目</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%2Ffendou.org%2F2011%2F09%2F17%2Ftaobao-project%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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%2Ffendou.org%2F2012%2F01%2F17%2Ftf-idf%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">TF-IDF及文本相似性度量</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%2Ffendou.org%2F2009%2F06%2F06%2Fdip%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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><a href="http://baike.baidu.com/view/6402003.html">FourInOne</a>（中文名字“四不像”）是一个四合一分布式计算框架，在写这个框架之前，我对分布式计算进行了长时间的思考，也看了老外写的其他开源框架,当我们把复杂的hadoop当作一门学科学习时，似乎忘记了我们想解决问题的初衷：我们仅仅是想写个程序把几台甚至更多的机器一起用起来计算，把更多的cpu和内存利用上，来解决我们数量大和计算复杂的问题，当然这个过程中要考虑到分布式的协同和故障处理。如果仅仅是为了实现这个简单的初衷，为什么一切会那么复杂，我觉的自己可以写一个更简单的东西，它不需要过度设计，只需要看上去更酷一点，更小巧一点，功能更强一点。于是我将自己对分布式的理解融入到这个框架中，考虑到底层实现技术的相似性，我将Hadoop,Zookeeper,MQ,分布式缓存四大主要的分布式计算功能合为一个框架内，对复杂的分布式计算应用进行了大量简化和归纳。</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
<td>fourinone-1.11.09</td>
<td>hadoop-0.21.0</td>
</tr>
<tr>
<td>体积</td>
<td>82K</td>
<td>71M</td>
</tr>
<tr>
<td>依赖关系</td>
<td>就一个jar,没有依赖</td>
<td>约12项jar包依赖</td>
</tr>
<tr>
<td>配置</td>
<td>就一个配置文件</td>
<td>较多配置文件和复杂属性</td>
</tr>
<tr>
<td>集群搭建</td>
<td>简单，每台机器放一个jar和配置文件</td>
<td>复杂，需要linux操作基础和ssh等复杂配置，还需要较多配置文件配置</td>
</tr>
<tr>
<td>计算模式</td>
<td>提供两种计算模式：包工头和工人直接交互方式，包工头和工人通过消息中枢方式交互，后者不需要工人节点可直接访问</td>
<td>计算更多倾向于文件数据的并行读取，而非计算过程的设计。JobTracke 跟TaskTracker直接交互， 查询NameNode后，TaskTracker直接从Datanode获取数据。</td>
</tr>
<tr>
<td>并行模式</td>
<td>N*N，支持单机并行，也支持多机并行，多机多实例并行</td>
<td>1*N，不支持单机并行，只支持多机单实例并行</td>
</tr>
<tr>
<td>内存方式</td>
<td>支持内存方式设计和开发应用，并内置完整的分布式缓存功能</td>
<td>以hdfs文件方式进行数据处理，内存方式计算支持很弱</td>
</tr>
<tr>
<td>文件方式</td>
<td>自带文件适配器处理io</td>
<td>Hdfs处理文件io</td>
</tr>
<tr>
<td>计算数据要求</td>
<td>任意数据格式和任意数据来源，包括来自数据库，分布式文件，分布式缓存等</td>
<td>Hdfs内的文件数据，多倾向于带换行符的数据</td>
</tr>
<tr>
<td>调度角色</td>
<td>包工头，可以有多个，支持链式处理，也支持大包工头对小包工头的调度</td>
<td>JobTracke，通常与NameNode一起</td>
</tr>
<tr>
<td>任务执行角色</td>
<td>农民工，框架支持设计多种类型的工人用于拆分或者合并任务</td>
<td>TaskTracker，通常与Datanode一起</td>
</tr>
<tr>
<td>中间结果数据保存</td>
<td>手工仓库，或者其他任意数据库存储设备</td>
<td>Hdfs中间结果文件</td>
</tr>
<tr>
<td>拆分策略</td>
<td>自由设计，框架提供链式处理对于大的业务场景进行环节拆分数据的存储和计算拆分根据业务场景自定义</td>
<td>以64m为拆分进行存储，以行为拆分进行计算</p>
<p>实现map接口，按行处理数据进行计算</td>
</tr>
<tr>
<td>合并策略</td>
<td>自由设计，框架提供农民工节点之间的合并接口，可以互相交互设计合并策略，也可以通过包工头进行合并</td>
<td>TaskTracker不透明，较少提供程序控制，合并策略设计复杂</p>
<p>实现reduce接口进行中间数据合并逻辑实现</td>
</tr>
<tr>
<td>内存耗用</td>
<td>无需要制定JVM内存，按默认即可，根据计算要求考虑是否增加JVM内存</td>
<td>需要制定JVM内存，每个进程默认1G，常常namenode，jobtracker等启动3个进程，耗用3G内存</td>
</tr>
<tr>
<td>监控</td>
<td>框架提供多环节链式处理设计支持监控过程，通过可编程的监控方式，给于业务开发方最大灵活的监控需求实现，为追求高性能不输出大量系统监控log</td>
<td>输出较多的系统监控log，如map和reduce百分比等，但是会牺牲性能，业务监控需要自己实现</td>
</tr>
<tr>
<td>打包部署</td>
<td>脚本工具</td>
<td>上传jar包到jobtracker机器</td>
</tr>
<tr>
<td>平台支撑</td>
<td>支持跨平台，windows支持良好</td>
<td>多倾向于支持linux，Windows支持不佳，需要模拟linux环境，并且建议只用于开发学习</td>
</tr>
<tr>
<td>其他</td>
<td>协同一致性、分布式缓存、通讯队列等跟分布式计算关系密切的功能支持</td>
<td>不支持</td>
</tr>
<tr>
<td>总结：</td>
<td>Hadoop并不是为了追求一个并行计算的框架而设计，提供快捷和灵活的计算方式去服务各种计算场景， 它更多的是一个分布式文件系统，提供文件数据的存储和查询，它的map/reduce更倾向于提供并行计算方式进行文件数据查询。而fourinone相反。</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Fourinone和hadoop运行wordcount的对比测试（平均4核4g配置，输入数据为文件）：</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td></td>
<td>fourinone-1.11.09(n*4)</td>
<td>fourinone-1.11.09(n*1)</td>
<td>hadoop-0.21.0(n*1)</td>
</tr>
<tr>
<td>3台机器*256M</td>
<td>4s</td>
<td>12s</td>
<td>72s</td>
</tr>
<tr>
<td>3台机器*512M</td>
<td>7s</td>
<td>30s</td>
<td>140s</td>
</tr>
<tr>
<td>3台机器*1G</td>
<td>14s</td>
<td>50s</td>
<td>279s</td>
</tr>
<tr>
<td>19台机器*1G</td>
<td>21s</td>
<td>60s</td>
<td>289s</td>
</tr>
<tr>
<td>10台机器*2G</td>
<td>29s</td>
<td></td>
<td></td>
</tr>
<tr>
<td>5台机器*4G</td>
<td>60s</td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>说明：Fourinone可以充分利用单机并行能力，4核计算机可以4个并行实例计算，hadoop目前只能N*1；另外，可以由上图看出，如果要完成20g的数据，实际上fourinone只需要使用5台机器用60秒完成，比使用19台机器完成19g的hadoop节省了14台机器，并提前了200多秒</p>
<p>相关分布式框架(jar格式)及demo代码下载：</p>
<p><a href="http://download.csdn.net/detail/fourinone/3557912">http://download.csdn.net/detail/fourinone/3557912</a></p>
<p><a href="http://www.skycn.com/soft/68321.html">http://www.skycn.com/soft/68321.html</a></p>
<p>&nbsp;</p>
<blockquote><p>作者介绍：<br />
Stone.Peng<br />
资深IT技术人士<br />
现在淘宝网任高级专家，从事互联网核心技术研究<br />
之前在金蝶总体架构部任SOA架构师，负责设计ESB</p></blockquote>
<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%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">五个最佳的Hadoop项目</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%2Ffendou.org%2F2011%2F09%2F17%2Ftaobao-project%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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%2Ffendou.org%2F2012%2F01%2F17%2Ftf-idf%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">TF-IDF及文本相似性度量</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%2Ffendou.org%2F2009%2F06%2F06%2Fdip%2F&from=http%3A%2F%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%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://fendou.org/2012/02/24/taobao-fourinone-vs-hadoop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>五个最佳的Hadoop项目</title>
		<link>http://fendou.org/2011/06/08/%e4%ba%94%e4%b8%aa%e6%9c%80%e4%bd%b3%e7%9a%84hadoop%e9%a1%b9%e7%9b%ae/</link>
		<comments>http://fendou.org/2011/06/08/%e4%ba%94%e4%b8%aa%e6%9c%80%e4%bd%b3%e7%9a%84hadoop%e9%a1%b9%e7%9b%ae/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 01:48:13 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Excellence Article]]></category>
		<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[Hadoop]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=835</guid>
		<description><![CDATA[本文来自SD Times高级编辑Alex Handy同学。他列出了当前使用Hadoop的项目中他认为最成功的五个。下面是这五个列表。 原文链接：The top five most powerful Hadoop projects 1.Cascading：Cascading是基于Hadoop集群之上的数据处理API。它通过实现了丰富的功能化API，使你不需要接触MapReduce任务就能使用分布式计算能力，其核心概念是基于管道和流的数据处理。 2.Mahout：Mahout是一个基于Hadoop实现各种机器学习与数据挖掘算法库。被用来提供推荐服务。 3.Hive：Hive由Facebook出品，它为Hadoop提供了一种类似于SQL的操作接口。 4.Avro：Avro是一个基于二进制数据传输高性能的中间件。Avro通过将数据进行序列化，以使得大批量数据交互过程更方便。 5.Storm：Storm由BackType Technology出口，其口号是“实时的Hadoop系统”。 &#160;<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%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">淘宝Fourinone介绍及与Hadoop的性能PK</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%2Ffendou.org%2F2010%2F01%2F06%2Fhtml-refactoring-one%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML重构的一些最佳实践</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%2Ffendou.org%2F2009%2F04%2F12%2Fphp-study-ppt%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于PHP最佳实践方法的两个PPT</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%2Ffendou.org%2F2010%2F05%2F13%2Fgoogle-app-engine-colloction%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google App Engine项目收集</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%2Ffendou.org%2F2011%2F09%2F17%2Ftaobao-project%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%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>本文来自SD Times高级编辑<a href="http://www.sdtimes.com/about/AlexHandy" target="_blank">Alex Handy</a>同学。他列出了当前使用Hadoop的项目中他认为最成功的五个。下面是这五个列表。</p>
<p>原文链接：<a href="http://www.sdtimes.com/content/article.aspx?ArticleID=35596" target="_blank">The top five most powerful Hadoop projects</a></p>
<a href="http://blog.nosqlfan.com/wp-content/uploads/2011/06/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7-2011-06-02-%E4%B8%8B%E5%8D%8807.51.29.jpg" target="_blank"><img title="屏幕快照 2011-06-02 下午07.51.29" src="http://blog.nosqlfan.com/wp-content/uploads/2011/06/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7-2011-06-02-%E4%B8%8B%E5%8D%8807.51.29.jpg" alt="" width="639" height="351" /></a>
<ul>
<li>1.<strong><a href="http://www.cascading.org/" target="_blank">Cascading</a>：</strong>Cascading是基于Hadoop集群之上的数据处理API。它通过实现了丰富的功能化API，使你不需要接触MapReduce任务就能使用分布式计算能力，其核心概念是基于管道和流的数据处理。</li>
<li>2.<strong><a href="http://mahout.apache.org/" target="_blank">Mahout</a>：</strong>Mahout是一个基于Hadoop实现各种机器学习与数据挖掘算法库。被用来提供推荐服务。</li>
<li>3.<strong><a href="http://wiki.apache.org/hadoop/Hive" target="_blank">Hive</a>：</strong>Hive由Facebook出品，它为Hadoop提供了一种类似于SQL的操作接口。</li>
<li>4.<strong><a href="http://avro.apache.org/" target="_blank">Avro</a>：</strong>Avro是一个基于二进制数据传输高性能的中间件。Avro通过将数据进行序列化，以使得大批量数据交互过程更方便。</li>
<li>5.<strong><a href="http://tech.backtype.com/preview-of-storm-the-hadoop-of-realtime-proce" target="_blank">Storm</a>：</strong>Storm由BackType Technology出口，其口号是“实时的Hadoop系统”。</li>
</ul>
<p>&nbsp;</p>
<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%2Ffendou.org%2F2012%2F02%2F24%2Ftaobao-fourinone-vs-hadoop%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">淘宝Fourinone介绍及与Hadoop的性能PK</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%2Ffendou.org%2F2010%2F01%2F06%2Fhtml-refactoring-one%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">HTML重构的一些最佳实践</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%2Ffendou.org%2F2009%2F04%2F12%2Fphp-study-ppt%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于PHP最佳实践方法的两个PPT</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%2Ffendou.org%2F2010%2F05%2F13%2Fgoogle-app-engine-colloction%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Google App Engine项目收集</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%2Ffendou.org%2F2011%2F09%2F17%2Ftaobao-project%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2F%25E4%25BA%2594%25E4%25B8%25AA%25E6%259C%2580%25E4%25BD%25B3%25E7%259A%2584hadoop%25E9%25A1%25B9%25E7%259B%25AE%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://fendou.org/2011/06/08/%e4%ba%94%e4%b8%aa%e6%9c%80%e4%bd%b3%e7%9a%84hadoop%e9%a1%b9%e7%9b%ae/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hive使用笔记</title>
		<link>http://fendou.org/2011/06/08/hive%e4%bd%bf%e7%94%a8%e7%ac%94%e8%ae%b0/</link>
		<comments>http://fendou.org/2011/06/08/hive%e4%bd%bf%e7%94%a8%e7%ac%94%e8%ae%b0/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 01:45:04 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Excellence Article]]></category>
		<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=832</guid>
		<description><![CDATA[Hive是为提供简单的数据操作而设计的下一代分布式数据仓库。它提供了简单的类似SQL的语法的HiveQL语言进行数据查询。同时，HiveQL语言能力不足时，它也能允许使用传统的map/reduce进行复杂数据分析。 Hive是搭建在Hadoop平台之上的。Hive并不是一个真正的数据库，它的元数据需要存储在其他数据库中(例如mysql)。。Hadoop平台提供了HDFS分布式存储系统和map/reduce分布式计算系统，而Hive在这两个系统之上，使得用户只需使用熟悉SQL语言就能进行分布式计算，而map/reduce编程往往是相当复杂的。Hive在少量数据运算或是短时间内的重复查询上，是不能和Oracle那样的数据库相比的。它的查询量通常相当大，一个大的job运行几个小时算是正常的。 数据类型 。HiveQL只支持以下几种基本数据类型TINYINT, SMALLINT, INT, BIGINT, DOUBLE, STRING。 支持的复杂数据类型有Structs, Maps, Arrays。 创建表。 Hive不同于其他数据库，它只有一个默认数据库”default” ，所有的table都保持在里面。 CREATE TABLE user(id BIGINT, name STRING); 可以指定将表创建到外部hdfs文件系统中。 CREATE EXTERNAL TABLE foo(id INT) STORED AS TEXTFILE LOCALTION &#8216;/user/foo/foo_data&#8217;; 将数据文件导入到Hive表中。 LOAD DATA [LOCAL] INPATH &#8216;/data/userdata&#8217; [OVERWRITE] INTO TABLE user; 使用LOCAL选项将使用本地文件系统 ，否则将使用hdfs文件系统。使用OVERWRITE选项将删除原来table中的数据，否则将新数据添加到文件末尾。 Load data导入数据将仅仅将文件拷贝到hive管理的目录下，并用table的元数据去解释这个文件。所以必须保证数据文件的结构必须和table的结构一 致，否则可以load data成功但是数据解释不正确。特别注意fields分隔符和lines分隔符要和Table一致。我使用自定义分隔符导入数据，一直没有成功。不管我 怎么指定，Hive总是使用默认的分隔符来解释我的文件（默认使用001(ctrl-A)分隔列，012(\n)分隔行 ）。问题未解决。 查询语句。 这里列出一些和标准SQL不同的地方。 不能使用select count(*)；需要指定count的列下标，select count(1)...  <a href="http://fendou.org/2011/06/08/hive%e4%bd%bf%e7%94%a8%e7%ac%94%e8%ae%b0/" class="more-link" title="Read Hive使用笔记">Read more &#187;</a><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%2Ffendou.org%2F2010%2F05%2F28%2Fmysql-variable-params-comment%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql存储过程学习笔记--变量、参数、注释</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%2Ffendou.org%2F2010%2F05%2F28%2Fphp-mysql-procedure%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP中操作mysql执行存储过程</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%2Ffendou.org%2F2009%2F01%2F20%2Fmysql-heap%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">mysql内存表heap使用总结</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%2Ffendou.org%2F2011%2F11%2F16%2Fmysql-union-order-by-problem%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql中union和order by的问题及优先级</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%2Ffendou.org%2F2011%2F05%2F06%2Fmysql-5-1-56-innodb-plugin%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MySQL 5.1.56 使用 InnoDB Plugin</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>Hive是为提供简单的数据操作而设计的下一代分布式数据仓库。它提供了简单的类似SQL的语法的HiveQL语言进行数据查询。同时，HiveQL语言能力不足时，它也能允许使用传统的map/reduce进行复杂数据分析。</p>
<p>Hive是搭建在Hadoop平台之上的。Hive并不是一个真正的数据库，它的元数据需要存储在其他数据库中(例如mysql)。。Hadoop平台提供了HDFS分布式存储系统和map/reduce分布式计算系统，而Hive在这两个系统之上，使得用户只需使用熟悉SQL语言就能进行分布式计算，而map/reduce编程往往是相当复杂的。Hive在少量数据运算或是短时间内的重复查询上，是不能和Oracle那样的数据库相比的。它的查询量通常相当大，一个大的job运行几个小时算是正常的。</p>
<p>数据类型 。HiveQL只支持以下几种基本数据类型TINYINT, SMALLINT, INT, BIGINT, DOUBLE, STRING。</p>
<p>支持的复杂数据类型有Structs, Maps, Arrays。</p>
<p>创建表。 Hive不同于其他数据库，它只有一个默认数据库”default” ，所有的table都保持在里面。</p>
<p>CREATE TABLE user(id BIGINT, name STRING);</p>
<p>可以指定将表创建到外部hdfs文件系统中。</p>
<p>CREATE EXTERNAL TABLE foo(id INT)</p>
<p>STORED AS TEXTFILE LOCALTION &#8216;/user/foo/foo_data&#8217;;</p>
<p>将数据文件导入到Hive表中。</p>
<p>LOAD DATA [LOCAL] INPATH &#8216;/data/userdata&#8217; [OVERWRITE] INTO TABLE user;</p>
<p>使用LOCAL选项将使用本地文件系统 ，否则将使用hdfs文件系统。使用OVERWRITE选项将删除原来table中的数据，否则将新数据添加到文件末尾。</p>
<p>Load data导入数据将仅仅将文件拷贝到hive管理的目录下，并用table的元数据去解释这个文件。所以必须保证数据文件的结构必须和table的结构一 致，否则可以load data成功但是数据解释不正确。特别注意fields分隔符和lines分隔符要和Table一致。我使用自定义分隔符导入数据，一直没有成功。不管我 怎么指定，Hive总是使用默认的分隔符来解释我的文件（默认使用001(ctrl-A)分隔列，012(\n)分隔行 ）。问题未解决。</p>
<p>查询语句。 这里列出一些和标准SQL不同的地方。</p>
<p>不能使用select count(*)；需要指定count的列下标，select count(1) 。</p>
<p>不能使用CREATE TABLE newtable SELECT * FROM user；必须事先Create table，再用INSERT向其中写入数据。</p>
<p>排序关键字是SORT BY。</p>
<p>LIMIT关键字只能跟一个数字，即从第一条记录开始选出若干条。</p>
<p>INSERT语句变换很大，不能直接插入一条记录。插入的数据必须用SELECT子查询获取或者从某个文件导入。我还没细看。</p>
<p>> SELECT * FROM user LIMIT 10;</p>
<p>> INSERT OVERWRITE TABLE foo SELECT DESTIN(id) FROM user;</p>
<p>> SELECT M.id FROM user M JOIN foo S ON M.id = S.id;</p>
<p>> SELECT id FROM user GROUP BY id;</p>
<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%2Ffendou.org%2F2010%2F05%2F28%2Fmysql-variable-params-comment%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql存储过程学习笔记--变量、参数、注释</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%2Ffendou.org%2F2010%2F05%2F28%2Fphp-mysql-procedure%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">PHP中操作mysql执行存储过程</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%2Ffendou.org%2F2009%2F01%2F20%2Fmysql-heap%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">mysql内存表heap使用总结</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%2Ffendou.org%2F2011%2F11%2F16%2Fmysql-union-order-by-problem%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql中union和order by的问题及优先级</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%2Ffendou.org%2F2011%2F05%2F06%2Fmysql-5-1-56-innodb-plugin%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F06%2F08%2Fhive%25E4%25BD%25BF%25E7%2594%25A8%25E7%25AC%2594%25E8%25AE%25B0%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MySQL 5.1.56 使用 InnoDB Plugin</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://fendou.org/2011/06/08/hive%e4%bd%bf%e7%94%a8%e7%ac%94%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>提问的智慧</title>
		<link>http://fendou.org/2011/03/13/question/</link>
		<comments>http://fendou.org/2011/03/13/question/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 07:20:55 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[常识]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=810</guid>
		<description><![CDATA[IT技术这个行业混久了，作为一路走到现在的人，很多事情看不习惯，很多新手非常的浮躁，总是问，学什么赚钱，我要是知道学什么赚钱，我自己就去了，还轮到你么？再说不管什么行业，只要你处于金字塔的中上层，钱都不会少的。钱不是目的，他只是提升的自己的一个过程。新手遇到问题，劈头就问怎么解决，怎么办？甚至问题都不想清楚就问，我非常讨厌这样的提问方式。国内产出文章质量比较高的社区之一 &#8212;啄木鸟社区为想做程序员这个行当的人树立了很好的榜样，建议新人去看看，你不一定要学Python，但是其中的一些精髓是值得每个程序员学习的。 提问的智慧 全文在此，图如下：<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="什么是IP多播？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F01%2F10%2F%25E4%25BB%2580%25E4%25B9%2588%25E6%2598%25AFip%25E5%25A4%259A%25E6%2592%25AD%25EF%25BC%259F%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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;">什么是IP多播？</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%2Ffendou.org%2F2008%2F09%2F21%2Fson%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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>
                <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%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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/2012/01/20/14185012.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="使用Firefox+foxyProxy+SSH翻山越岭" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F01%2F19%2Ffirefox-foxyproxy-ssh%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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/2012/01/20/14184853.png" 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;">使用Firefox+foxyProxy+SSH翻山越岭</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="Linode VPS 主机评分" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2011%2F01%2F28%2Flinode-vps-bench%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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;">Linode VPS 主机评分</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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>IT技术这个行业混久了，作为一路走到现在的人，很多事情看不习惯，很多新手非常的浮躁，总是问，学什么赚钱，我要是知道学什么赚钱，我自己就去了，还轮到你么？再说不管什么行业，只要你处于金字塔的中上层，钱都不会少的。钱不是目的，他只是提升的自己的一个过程。新手遇到问题，劈头就问怎么解决，怎么办？甚至问题都不想清楚就问，我非常讨厌这样的提问方式。国内产出文章质量比较高的社区之一 &#8212;<a href="http://wiki.woodpecker.org.cn/">啄木鸟社区</a>为想做程序员这个行当的人树立了很好的榜样，建议新人去看看，你不一定要学Python，但是其中的一些精髓是值得每个程序员学习的。<br />
<a href="http://bbs.csdn.net/IndexPage/SmartQuestion.aspx">提问的智慧</a> 全文在此，图如下：<br />
<img src="http://pic.yupoo.com/cuimuxi_v/AUIHLBPK/ap16y.jpg" alt="提问的智慧" /></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="什么是IP多播？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F01%2F10%2F%25E4%25BB%2580%25E4%25B9%2588%25E6%2598%25AFip%25E5%25A4%259A%25E6%2592%25AD%25EF%25BC%259F%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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;">什么是IP多播？</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%2Ffendou.org%2F2008%2F09%2F21%2Fson%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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>
                <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%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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/2012/01/20/14185012.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="使用Firefox+foxyProxy+SSH翻山越岭" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F01%2F19%2Ffirefox-foxyproxy-ssh%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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/2012/01/20/14184853.png" 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;">使用Firefox+foxyProxy+SSH翻山越岭</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="Linode VPS 主机评分" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2011%2F01%2F28%2Flinode-vps-bench%2F&from=http%3A%2F%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%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;">Linode VPS 主机评分</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://fendou.org/2011/03/13/question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>《Rework》</title>
		<link>http://fendou.org/2010/12/16/rework/</link>
		<comments>http://fendou.org/2010/12/16/rework/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 13:58:23 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[读书笔记]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=767</guid>
		<description><![CDATA[这本书是近来难得一见的好书，认识字的都应该去读几遍，中文最近也出版了，各大售书网站都可以买到，打完折二十几块钱，非常物有所值，尽管英文版我已经读过，依然忍不住买一本中译本收藏，虽然中译本的名字我觉得很恶俗，这本书和商业思维没有太多的关系，中译本的作者自作聪明的加上这个小标题，有点恶心，另外将rework翻译成“重来”个人觉得也有点欠妥当，还不如不翻译，意思可能会更明确一点。虽然中译本有这样那样的问题，整体来说翻译的不错，不喜欢英文的可以买来看看，鼎力推荐&#8212;&#8212;我本人不会有任何好处 那来的从错误中学习 中国人常说的一句话是：失败是成功他妈。作者引用哈佛商学院的报告证明，失败的创业者再次创业并不比从未创业的人成功的概率更高。有一类人非常明白这个道理，他们有个名字叫VC（风险投资人），VC非常喜欢那些已经或者曾经创业并且干得不错的人，换句话说这些人往往能从VC那里以比较小的代价（损失较小的股份或者少费周折）搞到很多很多的钱用于再次创业或者公司发展 。 何必壮大 这个观点有点意思，几乎所有的企业家都想将自己企业做大，富士康的员工超过百万，而作者觉得大未必是最优的，我非常认同作者的观点，我身边就有很多的公司每年几个亿的业务却只有10个左右的员工。公司越大责任就越大，不仅要自己赚钱还要照顾好这些员工，是一个有责任的企业家应该做到的，而不是压榨。如果你不能，那么就尽量提高效率，少招几个人吧，与人与己都是好事。 工作狂 引用里面的几句话：工作狂实际取得的成就并不比正常人高，他们自诩为完美主义者，但这仅仅代表他们浪费了大量的时间去关注次要的细节，而不是推动下一项任务。真正的英雄是早已想出办法、搞定一切，然后回家了。 Start making Something 我们身边总有这样的人在叹息“XXX我早就想到了，只是没有下手，如果当初我干了，现在也亿万富翁了”，这个观点很可笑，你大脑中有创意跟你实际去创建这样的事情一点关系也没有，在你人生中最有意义的使你做了什么，而不是你想过什么、说过什么或者计划过什么 没有时间不是借口 当你拥有某种极其强烈的渴望时，你就能挤出时间来，不管你身上是否还背负着其他的责任，事实上大部分的渴望不是那么强烈，于是他们总是拿没有时间来做借口进行自我保护。如果我不是这样，我今天已经做出了好几个开源作品了。 =====未完待续======<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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/2012/01/20/14185011.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;">代码格式规范的List</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="UDP hole punching 翻译" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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;">UDP hole punching 翻译</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="Zend Framework学习笔记（一）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F03%2F09%2Fzend-framework-study-one%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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;">Zend Framework学习笔记（一）</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="N-Gram学习笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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/2012/01/20/14184909.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;">N-Gram学习笔记</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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[<a href="http://book.douban.com/subject/3889178/"><img class="alignleft" title="rework" src="http://img3.douban.com/lpic/s4242326.jpg" alt="rework" width="294" height="450" /></a>这本书是近来难得一见的好书，认识字的都应该去读几遍，中文最近也出版了，各大售书网站都可以买到，打完折二十几块钱，非常物有所值，尽管英文版我已经读过，依然忍不住买一本中译本收藏，虽然中译本的名字我觉得很恶俗，这本书和商业思维没有太多的关系，中译本的作者自作聪明的加上这个小标题，有点恶心，另外将rework翻译成“重来”个人觉得也有点欠妥当，还不如不翻译，意思可能会更明确一点。虽然中译本有这样那样的问题，整体来说翻译的不错，不喜欢英文的可以买来看看，鼎力推荐&#8212;&#8212;我本人不会有任何好处 <img src='http://fendou.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
<ol>
<li>那来的从错误中学习</li>
<p>中国人常说的一句话是：失败是成功他妈。作者引用哈佛商学院的报告证明，失败的创业者再次创业并不比从未创业的人成功的概率更高。有一类人非常明白这个道理，他们有个名字叫VC（风险投资人），VC非常喜欢那些已经或者曾经创业并且干得不错的人，换句话说这些人往往能从VC那里以比较小的代价（损失较小的股份或者少费周折）搞到很多很多的钱用于再次创业或者公司发展 。</p>
<li>何必壮大</li>
<p>这个观点有点意思，几乎所有的企业家都想将自己企业做大，富士康的员工超过百万，而作者觉得大未必是最优的，我非常认同作者的观点，我身边就有很多的公司每年几个亿的业务却只有10个左右的员工。公司越大责任就越大，不仅要自己赚钱还要照顾好这些员工，是一个有责任的企业家应该做到的，而不是压榨。如果你不能，那么就尽量提高效率，少招几个人吧，与人与己都是好事。</p>
<li>工作狂</li>
<p>引用里面的几句话：工作狂实际取得的成就并不比正常人高，他们自诩为完美主义者，但这仅仅代表他们浪费了大量的时间去关注次要的细节，而不是推动下一项任务。真正的英雄是早已想出办法、搞定一切，然后回家了。</p>
<li>Start making Something</li>
<p>我们身边总有这样的人在叹息“XXX我早就想到了，只是没有下手，如果当初我干了，现在也亿万富翁了”，这个观点很可笑，你大脑中有创意跟你实际去创建这样的事情一点关系也没有，在你人生中最有意义的使你做了什么，而不是你想过什么、说过什么或者计划过什么</p>
<li>没有时间不是借口</li>
<p>当你拥有某种极其强烈的渴望时，你就能挤出时间来，不管你身上是否还背负着其他的责任，事实上大部分的渴望不是那么强烈，于是他们总是拿没有时间来做借口进行自我保护。如果我不是这样，我今天已经做出了好几个开源作品了。
</ol>
<p>=====未完待续======</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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/2012/01/20/14185011.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;">代码格式规范的List</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="UDP hole punching 翻译" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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;">UDP hole punching 翻译</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="Zend Framework学习笔记（一）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F03%2F09%2Fzend-framework-study-one%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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;">Zend Framework学习笔记（一）</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="N-Gram学习笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%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/2012/01/20/14184909.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;">N-Gram学习笔记</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://fendou.org/2010/12/16/rework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>代码调优法则&#8211;编程珠玑笔记</title>
		<link>http://fendou.org/2010/08/18/programming-pearls/</link>
		<comments>http://fendou.org/2010/08/18/programming-pearls/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 14:34:11 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[常识]]></category>
		<category><![CDATA[编程技术]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=725</guid>
		<description><![CDATA[1、空间换时间法则 这个东西，稍微有点程序经验的人应该都接触过，比如在设计数据时候冗余了部分数据，避免关联表查询，减少开销，实际上也减少了查询时间，所谓空间换时间。还比如，我们将一个有点开销的计算结果存储起来，避免下次再次运算，减少时间消耗，再如，CPU的设计，设置了高速缓存，一级缓存，二级缓存，主存（通常所说的内存），其实一个硬盘和一个CPU也可以干活，只是干得不怎么样，因为硬盘和CPU之间速度实在是差别太大了，如是就有人想把可能要用到的数据预先加载到高速缓存或者主存中，慢慢形成了今天的个人计算机架构。 2、以时间换空间法则 这个其实也是天天在用的一个法则，只是一般技术人员看到“压缩”二字的时候，没联想到那么多，压缩就是最典型的拿时间换空间的例子，就是不断的重复前面已经存储过的存储地址，用来避免存取真实的数据。 3、循环法则 大部分稍微有点经验的人不会在同一个函数中循环两次同样的变量，但是仅限于同一个函数，假如在一个函数里调用了另外一个函数，那么就不一定了，很多人为了看似解耦的一个操作，在两个函数对同一个变量做了多次的循环。循环法则有几个比较经典细则： 第一、将代码移除循环，这是最容易想到的，当然，可以移除的条件是，每次循环都执行同样的某次操作。 第二、合并测试条件，高效的内循环应该包含尽量少的测试条件，最好只有一个，因此，程序员尽量用一些退出条件来模拟循环的其他退出条件。 第三、哨兵法则，在数据结构边界上放一个哨兵以减少测试是否已经搜索结束的开销。 第四、展开循环，展开循环可以减少修改循环下标的开销，对于避免管道延迟，减少分支以及增加指令级的并行性也有很大帮助。 第五、删除赋值，赋值的开销实际上在整个程序的执行过程中占的开销可以忽略不计，但假如你要在一个循环十万次的循环中赋值，那么开销就不能不计了，尽可能的在循环中减少赋值吧。 第六，消除无条件分支，快速的循环中不应该包含无条件分支，通过旋转循环，在底部加上一个条件分支，能够消除循环结束处的无条件分支。 第七、循环合并，如果你不小心做了傻事，那么合并两个对同一个变量循环操作吧 4、逻辑法则 利用等价的代数表达式。如果逻辑表达式的求值开销太大就将其替换为开销较小的等价代数表达式。 短路单调函数。如果我们想测试几个变量的单调非递减函数是否超过了某个特定的阈值，那么一旦达到这个阈值就不在需要计算任何变量了。 对测试机条件重新排序。在组织逻辑测试的时候，应该是降低开销的，经常成功的测试放在高开销的，很少成功的测试前面。 5、过程法则 打破函数层次。对于（非递归地）调用自身的函数，通常可以通过将其改写为内联版本并固定传入的变量来缩短其运行时间。 并行性。在底层硬件条件下，我们构建的程序应该尽可能多的挖掘并行性。 6、表达式法则 编译时初始化。在程序执行前，应该尽可能多的变量初始化。 利用等价的代数表达式。如果表达式的求值开销过大，就将其替换为开销更小的等价的代数表达式，比如换一种算法 消除公共子表达式。如果两次对同一个表达式求值，其所有变量都没有任何改动，那么我们可以用下面方法避免二次求值：存储第一次的计算结果并用其取代第二次求值。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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%2Ffendou.org%2F2009%2F06%2F08%2Fthree-rules%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <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%2Ffendou.org%2F2009%2F06%2F06%2Fdip%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="TF-IDF及文本相似性度量" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2012%2F01%2F17%2Ftf-idf%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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/2012/01/20/14184750.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;">TF-IDF及文本相似性度量</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%2Ffendou.org%2F2010%2F04%2F18%2Fclass-design%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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/2012/01/20/14185011.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;">代码格式规范的List</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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、空间换时间法则</p>
<p>这个东西，稍微有点程序经验的人应该都接触过，比如在设计数据时候冗余了部分数据，避免关联表查询，减少开销，实际上也减少了查询时间，所谓空间换时间。还比如，我们将一个有点开销的计算结果存储起来，避免下次再次运算，减少时间消耗，再如，CPU的设计，设置了高速缓存，一级缓存，二级缓存，主存（通常所说的内存），其实一个硬盘和一个CPU也可以干活，只是干得不怎么样，因为硬盘和CPU之间速度实在是差别太大了，如是就有人想把可能要用到的数据预先加载到高速缓存或者主存中，慢慢形成了今天的个人计算机架构。</p>
<p>2、以时间换空间法则</p>
<p>这个其实也是天天在用的一个法则，只是一般技术人员看到“压缩”二字的时候，没联想到那么多，压缩就是最典型的拿时间换空间的例子，就是不断的重复前面已经存储过的存储地址，用来避免存取真实的数据。</p>
<p>3、循环法则</p>
<p>大部分稍微有点经验的人不会在同一个函数中循环两次同样的变量，但是仅限于同一个函数，假如在一个函数里调用了另外一个函数，那么就不一定了，很多人为了看似解耦的一个操作，在两个函数对同一个变量做了多次的循环。循环法则有几个比较经典细则：<br />
第一、将代码移除循环，这是最容易想到的，当然，可以移除的条件是，每次循环都执行同样的某次操作。<br />
第二、合并测试条件，高效的内循环应该包含尽量少的测试条件，最好只有一个，因此，程序员尽量用一些退出条件来模拟循环的其他退出条件。<br />
第三、哨兵法则，在数据结构边界上放一个哨兵以减少测试是否已经搜索结束的开销。<br />
第四、展开循环，展开循环可以减少修改循环下标的开销，对于避免管道延迟，减少分支以及增加指令级的并行性也有很大帮助。<br />
第五、删除赋值，赋值的开销实际上在整个程序的执行过程中占的开销可以忽略不计，但假如你要在一个循环十万次的循环中赋值，那么开销就不能不计了，尽可能的在循环中减少赋值吧。<br />
第六，消除无条件分支，快速的循环中不应该包含无条件分支，通过旋转循环，在底部加上一个条件分支，能够消除循环结束处的无条件分支。<br />
第七、循环合并，如果你不小心做了傻事，那么合并两个对同一个变量循环操作吧</p>
<p>4、逻辑法则<br />
利用等价的代数表达式。如果逻辑表达式的求值开销太大就将其替换为开销较小的等价代数表达式。<br />
短路单调函数。如果我们想测试几个变量的单调非递减函数是否超过了某个特定的阈值，那么一旦达到这个阈值就不在需要计算任何变量了。<br />
对测试机条件重新排序。在组织逻辑测试的时候，应该是降低开销的，经常成功的测试放在高开销的，很少成功的测试前面。</p>
<p>5、过程法则<br />
打破函数层次。对于（非递归地）调用自身的函数，通常可以通过将其改写为内联版本并固定传入的变量来缩短其运行时间。<br />
并行性。在底层硬件条件下，我们构建的程序应该尽可能多的挖掘并行性。</p>
<p>6、表达式法则<br />
编译时初始化。在程序执行前，应该尽可能多的变量初始化。<br />
利用等价的代数表达式。如果表达式的求值开销过大，就将其替换为开销更小的等价的代数表达式，比如换一种算法<br />
消除公共子表达式。如果两次对同一个表达式求值，其所有变量都没有任何改动，那么我们可以用下面方法避免二次求值：存储第一次的计算结果并用其取代第二次求值。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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%2Ffendou.org%2F2009%2F06%2F08%2Fthree-rules%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <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%2Ffendou.org%2F2009%2F06%2F06%2Fdip%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="TF-IDF及文本相似性度量" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2012%2F01%2F17%2Ftf-idf%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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/2012/01/20/14184750.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;">TF-IDF及文本相似性度量</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%2Ffendou.org%2F2010%2F04%2F18%2Fclass-design%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%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/2012/01/20/14185011.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;">代码格式规范的List</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://fendou.org/2010/08/18/programming-pearls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UDP hole punching 翻译</title>
		<link>http://fendou.org/2010/08/08/udp-hole-punching/</link>
		<comments>http://fendou.org/2010/08/08/udp-hole-punching/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 02:30:37 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[UDP]]></category>
		<category><![CDATA[常识]]></category>
		<category><![CDATA[读书笔记]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=720</guid>
		<description><![CDATA[3.3. UDP hole punching  UDP打洞技术 The third technique, and the one of primary interest in this document, is widely known as “UDP Hole Punching.” UDP hole punching relies on the properties of common firewalls and cone NATs to allow appropriately designed peer-to-peer applications to “punch holes” through the middlebox and establish direct connectivity with each other,...  <a href="http://fendou.org/2010/08/08/udp-hole-punching/" class="more-link" title="Read UDP hole punching 翻译">Read more &#187;</a><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="TCP和UDP的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F12%2F03%2Ftcp_udp%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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;">TCP和UDP的区别</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="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14185011.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;">代码格式规范的List</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="《Rework》" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14184989.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;">《Rework》</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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14184899.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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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="5" 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><strong>3.3. UDP hole punching  UDP打洞技术</strong><br />
The third technique, and the one of primary interest in this document, is widely known as “UDP Hole Punching.” UDP hole punching relies on the properties of common firewalls and cone NATs to allow appropriately designed peer-to-peer applications to “punch holes” through the middlebox and establish direct connectivity with each other, even when both communicating hosts may lie behind middleboxes. This technique was mentioned briefly in section 5.1 of <a href="http://rfc.net/rfc3027.html" target="_blank"><span style="text-decoration: underline;"><span style="color: #0000ff;">RFC 3027 [NAT-PROT]</span></span></a>, and has been informally described elsewhere on the Internet [KEGEL] and used in some recent protocols [TEREDO, ICE]. As the name implies, unfortunately, this technique works reliably only with UDP.</p>
<p>第三种技术，也是这篇文章主要要研究的，就是非常有名的“UDP打洞技术”，UDP打洞技术依赖于由公共防火墙和cone NAT，允许适当的有计划的端对端应用程序通过NAT“打洞”，即使当双方的主机都处于NAT之后。这种技术在 <a href="http://rfc.net/rfc3027.html" target="_blank"><span style="text-decoration: underline;"><span style="color: #0000ff;">RFC3027</span></span></a><a href="http://rfc.net/rfc3027.html" target="_blank"><span style="text-decoration: underline;"><span style="color: #0000ff;">的5.1节[NAT PROT]</span></span></a> 中进行了重点介绍，并且在Internet[KEGEL]中进行了非正式的描叙，还应用到了最新的一些协议，例如[TEREDO,ICE]协议中。不过，我们要注意的是，“术”如其名，UDP打洞技术的可靠性全都要依赖于UDP。</p>
<p>We will consider two specific scenarios, and how applications can be designed to handle both of them gracefully. In the first situation, representing the common case, two clients desiring direct peer-to- peer communication reside behind two different NATs. In the second, the two clients actually reside behind the same NAT, but do not necessarily know that they do.</p>
<p>这里将考虑两种典型场景，来介绍连接的双方应用程序如何按照计划的进行通信的，第一种场景，我们假设两个客户端都处于不同的NAT之后；第二种场景，我们假设两个客户端都处于同一个NAT之后，但是它们彼此都不知道(他们在同一个NAT中)。</p>
<p><strong>3.3.1</strong><strong>. Peers behind different NATs </strong><strong>处于不同</strong><strong>NAT</strong><strong>之后的客户端通信</strong></p>
<p>Suppose clients A and B both have private IP addresses and lie behind different network address translators. The peer-to-peer application running on clients A and B and on server S each use UDP port 1234.? A and B have each initiated UDP communication sessions with server S, causing NAT A to assign its own public UDP port 62000 for A&#8217;s session with S, and causing NAT B to assign its port 31000 to B&#8217;s session with S, respectively.</p>
<p>我们假设 Client A 和 Client B 都拥有自己的私有IP地址，并且都处在不同的NAT之后，端对端的程序运行于 CLIENT A,CLIENT B,S之间，并且它们都开放了UDP端口1234。 CLIENT A和CLIENT B首先分别与S建立通信会话，这时NAT A把它自己的UDP端口62000分配给CLIENT A与S的会话，NAT B也把自己的UDP端口31000分配给CLIENT B与S的会话。如下图所示：</p>
<p>Now suppose that client A wants to establish a UDP communication session directly with client B.? If A simply starts sending UDP messages to B&#8217;s public address, 138.76.29.7:31000, then NAT B will typically discard these incoming messages (unless it is a full cone NAT), because the source address and port number does not match those of S, with which the original outgoing session was established. Similarly, if B simply starts sending UDP messages to A&#8217;s public address, then NAT A will typically discard these messages.</p>
<p>假如这个时候 CLIENT A 想与 CLIENT B建立一条UDP通信直连，如果 CLIENT A只是简单的发送一个UDP信息到CLIENT B的公网地址138.76.29.7:31000的话，NAT B会不加考虑的将这个信息丢弃（除非NAT B是一个 full cone NAT），因为 这个UDP信息中所包含的地址信息，与CLIENT B和服务器S建立连接时存储在NAT B中的服务器S的地址信息不符。同样的，CLIENT B如果做同样的事情，发送的UDP信息也会被 NAT A 丢弃。</p>
<p>Suppose A starts sending UDP messages to B&#8217;s public address, however, and simultaneously relays a request through server S to B, asking B to start sending UDP messages to A&#8217;s public address.? A&#8217;s outgoing messages directed to B&#8217;s public address (138.76.29.7:31000) cause NAT A to open up a new communication session between A&#8217;s private address and B&#8217;s public address. At the same time, B&#8217;s messages to A&#8217;s public address (155.99.25.11:62000) cause NAT B to open up a new communication session between B&#8217;s private address and A&#8217;s public address. Once the new UDP sessions have been opened up in each direction, client A and B can communicate with each other directly without further burden on the “introduction” server S.</p>
<p>假如 CLIENT A 开始发送一个 UDP 信息到 CLIENT B 的公网地址上，与此同时，他又通过S中转发送了一个邀请信息给CLIENT B，请求CLIENT B也给CLIENT A发送一个UDP信息到 CLIENT A的公网地址上。这时CLIENT A向CLIENT B的公网IP(138.76.29.7:31000)发送的信息导致 NAT A 打开一个处于 CLIENT A的私有地址和CLIENT B的公网地址之间的新的通信会话，与此同时，NAT B 也打开了一个处于CLIENT B的私有地址和CLIENT A的公网地址(155.99.25.11:62000)之间的新的通信会话。一旦这个新的UDP会话各自向对方打开了，CLIENT A和CLIENT B之间就可以直接通信，而无需S来牵线搭桥了。(这就是所谓的打洞技术)！</p>
<p>The UDP hole punching technique has several useful properties. Once a direct peer-to-peer UDP connection has been established between two clients behind middleboxes, either party on that connection can in turn take over the role of “introducer” and help the other party establish peer-to-peer connections with additional peers, minimizing the load on the initial introduction server S. The application does not need to attempt to detect explicitly what kind of middlebox it is behind, if any [STUN], since the procedure above will establish peer- to-peer communication channels equally well if either or both clients do not happen to be behind a middlebox.? The hole punching technique even works automatically with multiple NATs, where one or both clients are removed from the public Internet via two or more levels of address translation.</p>
<p>UDP打洞技术有很多实用的地方：第一，一旦这种处于NAT之后的端对端的直连建立之后，连接的双方可以轮流担任 对方的“媒人”，把对方介绍给其他的客户端，这样就极大的降低了服务器S的工作量；第二，应用程序不用关心这个NAT是属于cone还是symmetric，即便要，如果连接的双方有一方或者双方都恰好不处于NAT之后，基于上叙的步骤，他们之间还是可以建立很好的通信通道；第三，打洞技术能够自动运作在多重NAT之后，不论连接的双方经过多少层NAT才到达Internet，都可以进行通信。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="TCP和UDP的区别" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F12%2F03%2Ftcp_udp%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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;">TCP和UDP的区别</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="代码格式规范的List" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14185011.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;">代码格式规范的List</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="《Rework》" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14184989.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;">《Rework》</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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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/2012/01/20/14184899.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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%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="5" 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://fendou.org/2010/08/08/udp-hole-punching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>N-Gram学习笔记</title>
		<link>http://fendou.org/2010/07/23/n-gram-study-case/</link>
		<comments>http://fendou.org/2010/07/23/n-gram-study-case/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 02:24:06 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[算法]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=706</guid>
		<description><![CDATA[统计语言模型 假设一个句子S可以表示为一个序列S=w1w2…wn，语言模型就是要求句子S的概率P(S)： 这个概率的计算量太大，解决问题的方法是将所有历史w1w2…wi-1按照某个规则映射到等价类S(w1w2…wi-1)，等价类的数目远远小于不同历史的数目，即假定： N-Gram模型 当两个历史的最近的N-1个词（或字）相同时，映射两个历史到同一个等价类，在此情况下的模型称之为N-Gram模型。 N-Gram模型被称为一阶马尔科夫链。 N的值不能太大，否则计算仍然太大。 根据最大似然估计，语言模型的参数： 其中，C(w1w2…wi)表示w1w2…wi在训练数据中出现的次数 平滑技术的引入 传统的估计方法对于随机变量£的N次独立观察的样本容量N有如下要求： N&#62;&#62;K 其中K为随机变量能够取到的值的个数。 实际语言模型中往往无法满足这个要求。 例如：词性标注问题，共有140个可能的标记，考虑当前词前后两个词的影响的三阶模型。 K=140*140*140=2,744,000 给定一个10万词左右的人工标注训练集，即 N=100,00，可见训练数据显得非常不足。 假设k泛指某一事件，N(k)表示事件k观察到的频数，极大似然法使用相对频数作为对事件k的概率估计： p(k)=N(k)/N 在语言模型中，训练语料中大量的事件N(k)=0，这显然没有反映真实情况。我们把这个问题称为数据稀疏问题。 这种零值的概率估计会导致语言模型算法的失败，例如：概率值作为乘数会使结果为0，而且不能做log运算。 计数等价类 根据对称性原理，事件除了出现次数之外不应具有细节特征，即所有具有相同计数r=N(k)的事件k（事件出现的次数称为事件的计数）应当具有相同的概率估计值，这些计数相同的事件称为计数等价，将它们组成的一个等价类记为计数等价类Gr。 对于计数为r的计数等价类，定义nr为等价类中成员的个数，pr为等价类中事件的概率，R是最大可能出现的计数次数，则 交叉检验 交叉检验就是把训练样本分为m份，其中一份作为保留部分，其余m-1份作为训练部分。训练部分作为训练集估计概率pr，保留部分作为测试集进行测试。 我们使用Cr表示保留部分中计数为r的计数等价类的观察个数。对于保留部分使用最大似然法对进行概率pr进行估计，即使对数似然函数最大化： 使用拉格朗日乘子解决约束条件下的最大值问题，即： 对pr求偏导，得到交叉检验估计： 如果测试部分也作为保留部分的话，就是典型的极大似然估计： 留一估计 留一方法是交叉检验方法的扩展，基本思想是将给定N个样本分为N-1个样本作为训练部分，另外一个样本作为保留部分。这个过程持续N次，使每个样本都被用作过保留样本。 优点：充分利用了给定样本，对于N中的每个观察，留一法都模拟了一遍没有被观察到的情形。 对于留一方法，pr的极大似然估计为： Turing-Good公式 因为nRpR与1相比一般可以忽略，留一估计公式可以近似为： 留一估计可以利用计数r=1的事件来模拟未现事件，对于未现事件有如下估计： 这个公式就是著名的Turing-Good公式。 空等价类 留一估计中要求么个nr均不为0，在实际问题中当r=5时，这个要求通常都不能满足，即计数等价类G1,…,GR中存在空的等价类。这时按照出现次数进行排序： 对应的出现r(l)次的事件的个数记为nr(l)，在进行留一估计时，使用下一个非空的等价类Gr(l+1)代替可能为空的等价类Gr(l)+1，留一估计公式变为： 式中对空的等价类没有估计概率，因为空等价类并没有对应任何有效事件。 Turing-Good估计的优缺点和适用范围 缺点：( 1 )无法保证概率估计的“有序性”，即出现次数多的事件的概率大于出现次数少的事件的概率。(2)pr与r/N不能很好地近似，好的估计应当保证pr&#60;=r/N。 优点：其它平滑技术的基础。 适用范围：对0&#60;r&#60;6的小计数事件进行估计。 约束留一估计 单调性约束：pr-1&#60;=pr；折扣约束：p&#60;=r/N。 约束留一估计：让计数估计r*=pr•N处于距其最近的绝对频数之间： 在这个约束下，单调性约束自然满足。 计算方法：计算m时检查每个pr是否满足约束，不然就用约束的上下界进行裁剪，然后重新计算m，一直迭代下去直到所有pr满足约束。 折扣模型...  <a href="http://fendou.org/2010/07/23/n-gram-study-case/" class="more-link" title="Read N-Gram学习笔记">Read more &#187;</a><table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="linux mail命令学习" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F07%2F16%2Flinux-mail%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">linux mail命令学习</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="linux进程管理笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F08%2F02%2Flinux-process-note%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">linux进程管理笔记</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="Linux 不是 Windows" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F03%2F08%2Flinux-%25E4%25B8%258D%25E6%2598%25AF-windows%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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/2012/01/20/14185147.png" 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;">Linux 不是 Windows</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="That is why i love linux" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F01%2F09%2Fthat-is-why-i-love-linux%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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/09/14/12129728.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;">That is why i love linux</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="Linux网络管理中的几个小工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F04%2F11%2Flinux-network-manage-tools%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">Linux网络管理中的几个小工具</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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><strong>统计语言模型</strong></p>
<p>假设一个句子S可以表示为一个序列S=w1w2…wn，语言模型就是要求句子S的概率P(S)：<br />
<img class="alignnone" title="字句" src="http://pic.yupoo.com/cuimuxi/554529ac6496/small.jpg" alt="" width="240" height="50" /></p>
<p>这个概率的计算量太大，解决问题的方法是将所有历史w1w2…wi-1按照某个规则映射到等价类S(w1w2…wi-1)，等价类的数目远远小于不同历史的数目，即假定：<br />
<img class="alignnone" title="等价类公式" src="http://pic.yupoo.com/cuimuxi/602409ac6496/small.jpg" alt="" width="240" height="19" /><br />
N-Gram模型</p>
<div>当两个历史的最近的N-1个词（或字）相同时，映射两个历史到同一个等价类，在此情况下的模型称之为N-Gram模型。</div>
<div>N-Gram模型被称为一阶马尔科夫链。 N的值不能太大，否则计算仍然太大。</div>
<div>根据最大似然估计，语言模型的参数：</div>
<div><img class="alignnone" title="n-gram" src="http://pic.yupoo.com/cuimuxi/706369ac6496/small.jpg" alt="" width="240" height="38" /></div>
<p>其中，C(w1w2…wi)表示w1w2…wi在训练数据中出现的次数</p>
<p><strong>平滑技术的引入</strong></p>
<div>传统的估计方法对于随机变量£的N次独立观察的样本容量N有如下要求：</div>
<p>N&gt;&gt;K</p>
<p>其中K为随机变量能够取到的值的个数。</p>
<div>实际语言模型中往往无法满足这个要求。</div>
<div>例如：词性标注问题，共有140个可能的标记，考虑当前词前后两个词的影响的三阶模型。</div>
<p>K=140*140*140=2,744,000</p>
<p>给定一个10万词左右的人工标注训练集，即</p>
<p>N=100,00，可见训练数据显得非常不足。</p>
<div>假设k泛指某一事件，N(k)表示事件k观察到的频数，极大似然法使用相对频数作为对事件k的概率估计：</div>
<p>p(k)=N(k)/N</p>
<div>在语言模型中，训练语料中大量的事件N(k)=0，这显然没有反映真实情况。我们把这个问题称为<span style="text-decoration: underline;">数据稀疏</span>问题。</div>
<div>这种零值的概率估计会导致语言模型算法的失败，例如：概率值作为乘数会使结果为0，而且不能做log运算。</div>
<div><strong>计数等价类</strong></div>
<div><strong><br />
</strong></div>
<div>
<div>根据对称性原理，事件除了出现次数之外不应具有细节特征，即所有具有相同计数r=N(k)的事件k（事件出现的次数称为事件的计数）应当具有相同的概率估计值，这些计数相同的事件称为<span style="text-decoration: underline;">计数等价</span>，将它们组成的一个等价类记为<span style="text-decoration: underline;">计数等价类</span>Gr。</div>
</div>
<div>对于计数为r的计数等价类，定义nr为等价类中成员的个数，pr为等价类中事件的概率，R是最大可能出现的计数次数，则<br />
<img class="alignnone" title="计数等价类" src="http://pic.yupoo.com/cuimuxi/414059ac6496/small.jpg" alt="" width="240" height="45" /></div>
<div><strong>交叉检验</strong></div>
<div><strong><br />
</strong></div>
<div>
<div><span style="text-decoration: underline;">交叉检验</span>就是把训练样本分为m份，其中一份作为保留部分，其余m-1份作为训练部分。训练部分作为训练集估计概率pr，保留部分作为测试集进行测试。</div>
</div>
<div>我们使用Cr表示保留部分中计数为r的计数等价类的观察个数。对于保留部分使用最大似然法对进行概率pr进行估计，即使对数似然函数最大化：<br />
<img class="alignnone" title="交叉等价" src="http://pic.yupoo.com/cuimuxi/539939ac6497/small.jpg" alt="" width="240" height="35" /></div>
<div>使用拉格朗日乘子解决约束条件下的最大值问题，即：</div>
<div><img title="拉格朗日乘子" src="http://pic.yupoo.com/cuimuxi/342769ac6497/small.jpg" alt="" width="240" height="32" /></div>
<div>对pr求偏导，得到交叉检验估计：</div>
<div><img class="alignnone" title="语料部分大小" src="http://pic.yupoo.com/cuimuxi/303439ac6497/small.jpg" alt="" width="240" height="29" /></div>
<div>如果测试部分也作为保留部分的话，就是典型的极大似然估计：<br />
<img class="alignnone" title="极大似然估计" src="http://pic.yupoo.com/cuimuxi/931339ac6497/small.jpg" alt="" width="240" height="32" /></div>
<div><strong>留一估计</strong></div>
<div><strong><br />
</strong></div>
<div>
<div>留一方法是交叉检验方法的扩展，基本思想是将给定N个样本分为N-1个样本作为训练部分，另外一个样本作为保留部分。这个过程持续N次，使每个样本都被用作过保留样本。</div>
<div><span style="text-decoration: underline;">优点：</span>充分利用了给定样本，对于N中的每个观察，留一法都模拟了一遍没有被观察到的情形。</div>
</div>
<div>对于留一方法，pr的极大似然估计为：<br />
<img class="alignnone" title="留一估计" src="http://pic.yupoo.com/cuimuxi/139929ac6498/small.jpg" alt="" width="240" height="28" /></div>
<div><strong>Turing-Good公式</strong></div>
<div><strong><br />
</strong></div>
<div>
<div>因为nRpR与1相比一般可以忽略，留一估计公式可以近似为：</div>
<div><img class="alignnone" title="留一估计公式可以近似" src="http://pic.yupoo.com/cuimuxi/864729ac6498/small.jpg" alt="" width="240" height="42" /></div>
<div>留一估计可以利用计数r=1的事件来模拟未现事件，对于未现事件有如下估计：</div>
<div><img class="alignnone" title="Turing-Good公式" src="http://pic.yupoo.com/cuimuxi/679389ac6498/thumb.jpg" alt="" width="100" height="54" /></div>
<p>这个公式就是著名的Turing-Good公式。</p>
<p><strong>空等价类</strong></p>
<div>留一估计中要求么个nr均不为0，在实际问题中当r=5时，这个要求通常都不能满足，即计数等价类G1,…,GR中存在空的等价类。这时按照出现次数进行排序：</div>
<div><img class="alignnone" title="空的等价类" src="http://pic.yupoo.com/cuimuxi/292789ac6499/medium.jpg" alt="" width="500" height="30" /></div>
<div>对应的出现r(l)次的事件的个数记为nr(l)，在进行留一估计时，使用下一个非空的等价类Gr(l+1)代替可能为空的等价类Gr(l)+1，留一估计公式变为：<br />
<img class="alignnone" title="留一公式变形" src="http://pic.yupoo.com/cuimuxi/421729ac6499/small.jpg" alt="" width="240" height="56" /><br />
式中对空的等价类没有估计概率，因为空等价类并没有对应任何有效事件。</div>
<div><strong>Turing-Good估计的优缺点和适用范围</strong></div>
<div>
<div>缺点：( 1 )无法保证概率估计的“有序性”，即出现次数多的事件的概率大于出现次数少的事件的概率。(2)pr与r/N不能很好地近似，好的估计应当保证pr&lt;=r/N。</div>
<div>优点：其它平滑技术的基础。</div>
<div>适用范围：对0&lt;r&lt;6的小计数事件进行估计。</div>
<div><strong>约束留一估计</strong></div>
<div>
<div>单调性约束：pr-1&lt;=pr；折扣约束：p&lt;=r/N。</div>
<div>约束留一估计：让计数估计r*=pr•N处于距其最近的绝对频数之间：</div>
<div><img class="alignnone" title="约束留一估计" src="http://pic.yupoo.com/cuimuxi/553009ac6499/small.jpg" alt="" width="240" height="55" /><br />
在这个约束下，单调性约束自然满足。</div>
<div>计算方法：计算m时检查每个pr是否满足约束，不然就用约束的上下界进行裁剪，然后重新计算m，一直迭代下去直到所有pr满足约束。</div>
</div>
</div>
</div>
<div><strong>折扣模型</strong></div>
<div>
<div>Katz指出Turing-Good公式实质是对模型中观察到的事件进行折扣，将折扣得来的概率摊到所n0个未现事件中。在这个思想的指导下，估计公式可以下成如下形式：</div>
<div><img title="折扣函数" src="http://pic.yupoo.com/cuimuxi/468889ac6499/small.jpg" alt="" width="240" height="100" /></div>
<div>其中，dr是对计数为r的事件的计数的一个折扣函数。</div>
</div>
<div><strong>绝对折扣模型</strong></div>
<div>
<div>若折扣函数定义为：dr=b，其中b为一个大于0的常数。那么未现事件的总概率为：</div>
<div><img class="alignnone" src="http://pic.yupoo.com/cuimuxi/710789ac6499/medium.jpg" alt="" width="500" height="59" /></div>
<div>对应绝对折扣模型的估计公式为：</div>
<div><img class="alignnone" title="绝对折扣模型" src="http://pic.yupoo.com/cuimuxi/358379ac6499/small.jpg" alt="" width="240" height="124" /></div>
<div><strong>线性折扣模型</strong></div>
<div>
<div>若折扣函数定义为：dr=a·r，其中a为一个大于0的常数。那么未现事件的总概率为：</div>
<div><img class="alignnone" title="未现事件的总概率" src="http://pic.yupoo.com/cuimuxi/474649ac649a/small.jpg" alt="" width="240" height="41" /></div>
<div>对应线性折扣模型的估计公式为：</div>
<div><img class="alignnone" title="线性折扣模型的估计公式" src="http://pic.yupoo.com/cuimuxi/801729ac649a/small.jpg" alt="" width="240" height="107" /></div>
<div>若a=n1/N，则n0p0=n1/N，与Turing-Good估计相同。</div>
<div><strong><br />
</strong></div>
<div><strong>删除插值法（Deleted Interpolation）</strong></div>
<div>
<div>其基本思想是，由于N-Gram比N+1-Gram出现的可能性大的多，所以使用N-Gram估计N+1-Gram的概率，例如trigram的计算公式如下：</div>
<div><img class="alignnone" title="trigram的计算公式" src="http://pic.yupoo.com/cuimuxi/149039ac649a/medium.jpg" alt="" width="500" height="31" /></div>
<p>其中，<img class="alignnone" title="语言模型" src="http://pic.yupoo.com/cuimuxi/996879ac649a/small.jpg" alt="" width="240" height="53" /></p>
<div>参数l的确定：将训练数据分为两部分，一部分用于估计f(wi| w1w2…wi-1)，一部分用于计算参数l，求使语言模型的困惑度最小的l。</div>
</div>
</div>
</div>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="linux mail命令学习" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F07%2F16%2Flinux-mail%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">linux mail命令学习</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="linux进程管理笔记" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F08%2F02%2Flinux-process-note%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">linux进程管理笔记</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="Linux 不是 Windows" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F03%2F08%2Flinux-%25E4%25B8%258D%25E6%2598%25AF-windows%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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/2012/01/20/14185147.png" 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;">Linux 不是 Windows</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="That is why i love linux" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F01%2F09%2Fthat-is-why-i-love-linux%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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/09/14/12129728.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;">That is why i love linux</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="Linux网络管理中的几个小工具" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F04%2F11%2Flinux-network-manage-tools%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F07%2F23%2Fn-gram-study-case%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;">Linux网络管理中的几个小工具</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" 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://fendou.org/2010/07/23/n-gram-study-case/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>代码格式规范的List</title>
		<link>http://fendou.org/2010/02/08/code-block-format-list/</link>
		<comments>http://fendou.org/2010/02/08/code-block-format-list/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 02:13:26 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[常识]]></category>
		<category><![CDATA[读书笔记]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=655</guid>
		<description><![CDATA[《代码大全》是本好书啊，推荐所有有志于改善自己的程序，或者在编码上寻找进一步提高的人应该仔细研究研究。以下是摘抄自《代码大全》第二版中谈到关于怎样的代码格式更适合人类阅读，更能令人愉悦的Check List。对照List进行自检和反省，令人欣慰的是List中80%以上我都做到了，在我的上一个项目中做得比较失败，由于时间的原因，很多注释没有加上，逻辑也不够清晰。在重构中解决，借此反省。 一般问题： 格式化主要是为了展现代码的逻辑结构吗？ 2、你的布局方案能统一运行吗？ 3、 你的布局方案能让代码易于维护吗？ 4、你的布局方案是否有利于代码的可读性？ 控制结构的布局 1、你的代码中避免begin-end 或对｛｝的双重缩进了吗？ 2、相邻的块之间用空行分割了吗？ 3、对复杂表达式格式化时考虑到可读性吗？ 4、对只有一条语句的块布局始终如一吗？ 5、case语句与其他控制结构的格式化保持一致了吗？ 6、对goto语句格式化是否让其显眼了呢？ 还好目前PHP只有5.3以上版本才会有goto 单条语句的布局： 1、为逻辑表达式、数组下标和子程序参数的可读性使用了空格了吗？ 2、不完整的语句在行末似乎以明显又错的方式结束吗？ 3、后续行按照标准数码缩进了吗？ 4、每行顶多只有一条语句吗？ 这一点是团队中比较头痛的问题，很多人不按照这个规则来做，结果它成了一种风气 5、所写的每个语句都没有副作用吗？ 6、每行顶多只声明一个数据吗？ 注释布局： 1、注释与其所注释的代码所尽量相同吗？ 2、注释风格便于维护吗？ 子程序的布局： 1、你对每个子程序的参数格式化方式便于看懂、修改、注释吗？ 2、采用空行分割子程序各部分了吗？ 4、文件中子程序用空行清楚分开了吗？ 5、在没有更好的组织形式的场合，所有子程序都按字母排列了吗？ 这一点我没有做到，没有做到是没有想到这一点，以后编码注意了……<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="UDP hole punching 翻译" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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;">UDP hole punching 翻译</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="《Rework》" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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/2012/01/20/14184989.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;">《Rework》</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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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>
                <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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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>
                <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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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/2012/01/20/14184899.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>
        </tr>
    
    <tr>
        <td colspan="5" 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://www.douban.com/subject/1477390/"><img style="float:left;padding:0 20px 20px 0;border:0" src="http://t.douban.com/mpic/s1495029.jpg" alt="" /></a> 《代码大全》是本好书啊，推荐所有有志于改善自己的程序，或者在编码上寻找进一步提高的人应该仔细研究研究。以下是摘抄自《代码大全》第二版中谈到关于怎样的代码格式更适合人类阅读，更能令人愉悦的Check List。对照List进行自检和反省，令人欣慰的是List中80%以上我都做到了，在我的上一个项目中做得比较失败，由于时间的原因，很多注释没有加上，逻辑也不够清晰。在重构中解决，借此反省。<br />
<strong>一般问题：</strong><br />
格式化主要是为了展现代码的逻辑结构吗？<br />
2、你的布局方案能统一运行吗？<br />
3、 你的布局方案能让代码易于维护吗？<br />
4、你的布局方案是否有利于代码的可读性？<br />
<strong>控制结构的布局</strong><br />
1、你的代码中避免begin-end 或对｛｝的双重缩进了吗？<br />
2、相邻的块之间用空行分割了吗？<br />
3、对复杂表达式格式化时考虑到可读性吗？<br />
4、对只有一条语句的块布局始终如一吗？<br />
5、case语句与其他控制结构的格式化保持一致了吗？<br />
6、对goto语句格式化是否让其显眼了呢？<br />
<span style="color: #ff0000;">还好目前PHP只有5.3以上版本才会有goto</span><br />
<strong>单条语句的布局：</strong></p>
<p>1、为逻辑表达式、数组下标和子程序参数的可读性使用了空格了吗？<br />
2、不完整的语句在行末似乎以明显又错的方式结束吗？<br />
3、后续行按照标准数码缩进了吗？<br />
4、每行顶多只有一条语句吗？<br />
<span style="color: #ff0000;">这一点是团队中比较头痛的问题，很多人不按照这个规则来做，结果它成了一种风气</span><br />
5、所写的每个语句都没有副作用吗？<br />
6、每行顶多只声明一个数据吗？<br />
<strong>注释布局：</strong><br />
1、注释与其所注释的代码所尽量相同吗？<br />
2、注释风格便于维护吗？<br />
<strong>子程序的布局：</strong><br />
1、你对每个子程序的参数格式化方式便于看懂、修改、注释吗？<br />
2、采用空行分割子程序各部分了吗？<br />
4、文件中子程序用空行清楚分开了吗？<br />
5、在没有更好的组织形式的场合，所有子程序都按字母排列了吗？<br />
<span style="color: #ff0000;">这一点我没有做到，没有做到是没有想到这一点，以后编码注意了……</span></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="UDP hole punching 翻译" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F08%2F08%2Fudp-hole-punching%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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;">UDP hole punching 翻译</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="《Rework》" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2010%2F12%2F16%2Frework%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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/2012/01/20/14184989.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;">《Rework》</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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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>
                <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%2Ffendou.org%2F2010%2F03%2F15%2Fdatabase-hierarchy-structures%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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>
                <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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F02%2F08%2Fcode-block-format-list%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/2012/01/20/14184899.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>
        </tr>
    
    <tr>
        <td colspan="5" 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://fendou.org/2010/02/08/code-block-format-list/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>程序语言评估标准</title>
		<link>http://fendou.org/2010/01/18/programming-language-baseline/</link>
		<comments>http://fendou.org/2010/01/18/programming-language-baseline/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 08:08:51 +0000</pubDate>
		<dc:creator>崔玉松</dc:creator>
				<category><![CDATA[Study & Reading]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[常识]]></category>

		<guid isPermaLink="false">http://fendou.org/?p=645</guid>
		<description><![CDATA[1、可读性。判断一个语言的优劣的一个最重要的标准是用它写的程序要好读，好懂。 一种语言的整体简单性极大的影响着他的可读性。一种具有大量基本结构的语言较只有少量基本结构的语言要难学得多，当然，过少也会非常难学，汇编就是如此。 2、正交性。正交性是指使用该语言中一组相对少量的基本结构，经过相对少的组合步骤，可以构成该语言的控制结构与数据接哦股。而且，它的基本结构的任何组合都是合法和有意义的。 3、控制语句。在20世纪50年代和60年代，一批程序设计语言由于缺乏控制语句，导致很差的可读性。随后的语言都兴起了结构化程序设计的革命。尤其是人们普遍意识到滥用goto会降低程序设计的可读性。 4、数据类型和数据结构。在程序设计语言中给出定义数据类型和数据结构的合理机制，是语言可读性的又一个重要辅助。 5、可写性。可写性是程序设计语言的在应用领域产生程序的难以程度的一种度量。大多数影响可读性的语言特征可以影响可写性。 6、支持抽象。抽象指的是以合法的省略许多细节的方式，来定义并且使用复杂结构或复杂运算的能力。 7、表达性。语言的表达性可以指语言中几种不同特征。一种是具有一些功能很强的运算符。一种是程序语言具有相对方便，非繁琐的方式来说明运算。 8、可靠性。如果一个程序在任何条件下的运行都能 达到他的说明标准。我们称这饿程序是可靠的。 9.代价。第一是训练程序员使用这种语言的代价。第二是使用这种语言来编写程序的代价。第三是编译程序的代价。第四是程序运行的代价。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="Top 10 Concepts That Every Software Engineer Should Know" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F09%2F02%2Ftop-10-concepts-that-every-software-engineer-should-know%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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/2012/01/20/14185352.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;">Top 10 Concepts That Every Software Engineer Should Know</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="表单及URL攻击的几种方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F07%2F15%2Fform-and-url-attack-methods%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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;">表单及URL攻击的几种方法</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="PHP是可扩展的语言" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F06%2F07%2Fscaling-php%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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;">PHP是可扩展的语言</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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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/2012/01/20/14184899.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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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="5" 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://www.douban.com/subject/3119946/"><img style="float:left;padding:0 20px 20px 0;border:0" src="http://t.douban.com/mpic/s3395369.jpg" alt="" /></a>1、可读性。判断一个语言的优劣的一个最重要的标准是用它写的程序要好读，好懂。<br />
一种语言的整体简单性极大的影响着他的可读性。一种具有大量基本结构的语言较只有少量基本结构的语言要难学得多，当然，过少也会非常难学，汇编就是如此。<br />
2、正交性。正交性是指使用该语言中一组相对少量的基本结构，经过相对少的组合步骤，可以构成该语言的控制结构与数据接哦股。而且，它的基本结构的任何组合都是合法和有意义的。<br />
3、控制语句。在20世纪50年代和60年代，一批程序设计语言由于缺乏控制语句，导致很差的可读性。随后的语言都兴起了结构化程序设计的革命。尤其是人们普遍意识到滥用goto会降低程序设计的可读性。<br />
4、数据类型和数据结构。在程序设计语言中给出定义数据类型和数据结构的合理机制，是语言可读性的又一个重要辅助。<br />
5、可写性。可写性是程序设计语言的在应用领域产生程序的难以程度的一种度量。大多数影响可读性的语言特征可以影响可写性。<br />
6、支持抽象。抽象指的是以合法的省略许多细节的方式，来定义并且使用复杂结构或复杂运算的能力。<br />
7、表达性。语言的表达性可以指语言中几种不同特征。一种是具有一些功能很强的运算符。一种是程序语言具有相对方便，非繁琐的方式来说明运算。<br />
8、可靠性。如果一个程序在任何条件下的运行都能 达到他的说明标准。我们称这饿程序是可靠的。<br />
9.代价。第一是训练程序员使用这种语言的代价。第二是使用这种语言来编写程序的代价。第三是编译程序的代价。第四是程序运行的代价。<br />
<span style="color: #000000;"><br />
</span></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><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="Top 10 Concepts That Every Software Engineer Should Know" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2008%2F09%2F02%2Ftop-10-concepts-that-every-software-engineer-should-know%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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/2012/01/20/14185352.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;">Top 10 Concepts That Every Software Engineer Should Know</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="表单及URL攻击的几种方法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F07%2F15%2Fform-and-url-attack-methods%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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;">表单及URL攻击的几种方法</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="PHP是可扩展的语言" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ffendou.org%2F2009%2F06%2F07%2Fscaling-php%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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;">PHP是可扩展的语言</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%2Ffendou.org%2F2011%2F03%2F13%2Fquestion%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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/2012/01/20/14184899.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%2Ffendou.org%2F2010%2F08%2F18%2Fprogramming-pearls%2F&from=http%3A%2F%2Ffendou.org%2F2010%2F01%2F18%2Fprogramming-language-baseline%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="5" 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://fendou.org/2010/01/18/programming-language-baseline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

