<?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>Web Development Notes &#187; Project Manament</title>
	<atom:link href="http://blog.eood.cn/category/project-manament/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eood.cn</link>
	<description>PHP, Drupal, Erlang, MySQL, Java, MongoDB, Linux, vim, ssh, screen etc</description>
	<lastBuildDate>Sat, 31 Dec 2011 12:49:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WEB Development Rookie &#8211; NodeJS</title>
		<link>http://blog.eood.cn/web-development-rookie-nodejs</link>
		<comments>http://blog.eood.cn/web-development-rookie-nodejs#comments</comments>
		<pubDate>Sat, 16 Apr 2011 11:21:03 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[NodeJS]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/web-development-rookie-nodejs</guid>
		<description><![CDATA[The nodejs growing very fast recently. New library or framework added to nodejs  almost everyday, since it is very easy to build a nodejs based module and javascript is used very widely. I have done the A/B testing of nodeJS vs Erlang mochiweb, Erlang misultin, Nginx static page on my poor VM machine, and got [...]]]></description>
			<content:encoded><![CDATA[<p>The nodejs growing very fast recently. New library or framework added to nodejs  almost everyday, since it is very easy to build a nodejs based module and javascript is used very widely.</p>
<p>I have done the A/B testing of nodeJS vs Erlang mochiweb, Erlang misultin, Nginx static page on my poor VM machine, and got the following result:</p>
<p><em>Nodejs helloworld:                     724 qps</em></p>
<p><em>Erlang mochiweb helloworld:     430 qps</em></p>
<p><em>Erlang misultin helloworld:         690 qps</em></p>
<p><em>Nginx static page:                    1045 qps</em></p>
<p>You can see that nodeJS is bloody fast thanks to the good performance of V8 <span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">JavaScript engine.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">Talk about server side javascript, you should say Rhino, but nodejs is 20x faster than Rhino. NodeJS is stable, and not seen a bug of the code, like Nginx. You can build asynchronous system based on nodeJS and drop Tornado. What is important is that you can reuse your code both on client side and server side.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">NodeJS is good at heavy IO usage, but not heavy CPU usage. And you should not change your current web system to nodeJS since it is too young.You can build your JSON interface by NodeJS, construct JSON from data fetched from database or remote web service, output the JSON format result. </span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">Nodejs library:</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/isaacs/npm">npm</a><span> </span>— A node package manager that uses CommonJS-compatible package.json files, written in asynchronous JavaScript.</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/visionmedia/express/tree/master">Express</a><span> </span>— A robust feature rich web development framework<span> </span><strong>inspired by Sinatra</strong></span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/tautologistics/nodemachine">nodemachine</a><span> </span>— A port of WebMachine to Node.js</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="http://senchalabs.github.com/connect/">Connect</a><span style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;"> </span></span></span><span style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;"><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;">— A  middleware framework for node</span></span></span><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="http://senchalabs.github.com/connect/"><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><br />
</span></span></a></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/LearnBoost/Socket.IO">Socket.io</a><span> </span>— WebSocket-compatible server and client with fallback for legacy browsers</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/felixge/node-mysql">node-mysql</a><span> </span>— A node.js module implementing the MySQL protocol</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span style="font-family: helvetica,arial,freesans,clean,sans-serif; font-size: 14px; line-height: 19px;"><a style="margin: 0px; padding: 0px; line-height: 1.4em; color: #4183c4; text-decoration: none; outline-style: none;" href="https://github.com/igo/redis2json/">redis2json</a><span> </span>— Easily loads data from Redis into structured JS object</span></span></p>
<p><span style="border-collapse: separate; color: #000000; font-family: arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><span style="line-height: 15px;">See more:</span></span></p>
<p><a href="https://github.com/joyent/node/wiki/modules">https://github.com/joyent/node/wiki/modules</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/web-development-rookie-nodejs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>增强沟通技巧和提高开发效率</title>
		<link>http://blog.eood.cn/improve_communication_skills_and_development_efficiency</link>
		<comments>http://blog.eood.cn/improve_communication_skills_and_development_efficiency#comments</comments>
		<pubDate>Fri, 24 Dec 2010 14:58:48 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Project Manament]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1482</guid>
		<description><![CDATA[时常回顾team的开发过程, 虽然总体还算非常顺利, 但是仍然有很多可以改进的地方, 找出其中的问题可以大大提高开发的效率。 项目开发中遇到的问题，或许也是很多团队遇到的问题： 通常一个feature需要比计划更多的时间来完成； 孤立看一个feature，很难估计相关联的任务量，所以通常一个看起来简单的特性需要更多的时间来完成。Bug产生和解决的反复会延长估计的时间。将一个feature放到整个项目中还需要考虑到context的分析的工作量。 不能孤立的分析一个feature, 一个feature的增加，可能需要对之前很多feature的修改，一个feature的变化，可能需要对之前更多的feature进行改进。 有些时候程序员的效率会比平时低； 这常发生在task频繁切换的时候，假如一个任务正在进行，又增加了另一个任务，同一个人做的情况下就会遇到task的切换，很多时间浪费在环境的分析回忆上。 文档过多或者过少； 文档过多会浪费很多时间在写文档上，这是敏捷开发的大忌，但是完全不写文档很难做到协同开发，即使是自己写的代码时间久了也会忘记细节。 会议不能有效解决问题； 会议需要进行日程计划，每次例会需要所有人了解议题，提前熟悉相关内容，否则复制的问题沟通会很困难。 PM认为问题很简单，而开发团队认为很难解决。 应该把问题分离到程序解决和业务流程解决两部分，有时候单纯用自动化的方式不比人工流程效率高。其实难题往往通过第三种方式来解决，需要花更多的时间在问题分析上。 程序员和非程序员思维有很大区别(实际参与编码的程序员)： 程序员会考虑一个feature是不是会失败，而非程序员想的是一个feature是不是会成功，可以加上去。所以往往后者会不断的添加feature，前者会经常说实现这个很难，实现那个几乎没可能。 项目的开发，解决所有问题其实都是在一个现有的堆栈上进行的，这基于先前的开发经验或者网上能找到的参考的经验。也许问题是很简单，但是假如这方面的经验非常缺少，就会导致更大的开发风险，更大的难度。 非程序员往往从问题难度本身来看待开发的难度，而程序员则会根据经验来看待问题，比如现有技术堆栈和现有经验。 总之 项目的开发过程其实是ROI的控制和对细小任务风险的评估的过程，只有所有人能高效沟通，正确不断评估风险，正确审视投入产出比，才能真正做到开发的高效率。 转载请保留原文链接 http://blog.eood.cn/improve_communication_skills_and_development_efficiency]]></description>
			<content:encoded><![CDATA[<blockquote><p>时常回顾team的开发过程, 虽然总体还算非常顺利, 但是仍然有很多可以改进的地方, 找出其中的问题可以大大提高开发的效率。</p></blockquote>
<p><img class="alignright size-medium wp-image-1487" title="DSC8510" src="http://blog.eood.cn/wp-content/uploads/2010/12/DSC8510-300x199.jpg" alt="" width="300" height="199" /></p>
<h4 style="text-align: left;">项目开发中遇到的问题，或许也是很多团队遇到的问题：</h4>
<h4>通常一个feature需要比计划更多的时间来完成；</h4>
<p>孤立看一个feature，很难估计相关联的任务量，所以通常一个看起来简单的特性需要更多的时间来完成。Bug产生和解决的反复会延长估计的时间。将一个feature放到整个项目中还需要考虑到context的分析的工作量。</p>
<p>不能孤立的分析一个feature, 一个feature的增加，可能需要对之前很多feature的修改，一个feature的变化，可能需要对之前更多的feature进行改进。</p>
<h4>有些时候程序员的效率会比平时低；</h4>
<p>这常发生在task频繁切换的时候，假如一个任务正在进行，又增加了另一个任务，同一个人做的情况下就会遇到task的切换，很多时间浪费在环境的分析回忆上。</p>
<h4>文档过多或者过少；</h4>
<p>文档过多会浪费很多时间在写文档上，这是敏捷开发的大忌，但是完全不写文档很难做到协同开发，即使是自己写的代码时间久了也会忘记细节。</p>
<h4>会议不能有效解决问题；</h4>
<p>会议需要进行日程计划，每次例会需要所有人了解议题，提前熟悉相关内容，否则复制的问题沟通会很困难。</p>
<h4>PM认为问题很简单，而开发团队认为很难解决。</h4>
<p>应该把问题分离到程序解决和业务流程解决两部分，有时候单纯用自动化的方式不比人工流程效率高。其实难题往往通过第三种方式来解决，需要花更多的时间在问题分析上。</p>
<h4>程序员和非程序员思维有很大区别(实际参与编码的程序员)：</h4>
<p>程序员会考虑一个feature是不是会失败，而非程序员想的是一个feature是不是会成功，可以加上去。所以往往后者会不断的添加feature，前者会经常说实现这个很难，实现那个几乎没可能。</p>
<p>项目的开发，解决所有问题其实都是在一个现有的堆栈上进行的，这基于先前的开发经验或者网上能找到的参考的经验。也许问题是很简单，但是假如这方面的经验非常缺少，就会导致更大的开发风险，更大的难度。</p>
<p>非程序员往往从问题难度本身来看待开发的难度，而程序员则会根据经验来看待问题，比如现有技术堆栈和现有经验。</p>
<h4>总之</h4>
<p>项目的开发过程其实是ROI的控制和对细小任务风险的评估的过程，只有所有人能高效沟通，正确不断评估风险，正确审视投入产出比，才能真正做到开发的高效率。</p>
<p>转载请保留原文链接 <a href="http://blog.eood.cn/improve_communication_skills_and_development_efficiency">http://blog.eood.cn/improve_communication_skills_and_development_efficiency</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/improve_communication_skills_and_development_efficiency/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>互联网产品交互设计需要遵循的几个原则</title>
		<link>http://blog.eood.cn/project_design_pattens</link>
		<comments>http://blog.eood.cn/project_design_pattens#comments</comments>
		<pubDate>Sun, 19 Dec 2010 03:48:52 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/project_design_pattens</guid>
		<description><![CDATA[互联网产品的设计不同于桌面程序，也不同于移动设备之上的程序。需要遵循几个最基本的原则： 清晰易懂：给人的第一感觉要干净，清楚易懂，没有累赘的元素。 一致性：减少元素数量，多进行重用，切忌重新设计相同功能的元素。同一功能最好只设一个入口。 易用性：适合用户每天重复使用。 快速：快速有效的操作，减少等待。 减少选择：减少让用户选择A或B这样的操作。 有效：有效的设计是用户注意不到的设计，而是其中表达的内容。不应该让用户的精力放在设计本身。 转载请注明来自：http://blog.eood.cn &#160;]]></description>
			<content:encoded><![CDATA[<p>互联网产品的设计不同于桌面程序，也不同于移动设备之上的程序。需要遵循几个最基本的原则：<img style="float: right;" src="http://blog.eood.cn/wp-content/uploads/2010/12/FireShot-capture-015-Ohloh-the-open-source-network-www_ohloh_net.png" alt="" width="383" height="176" /></p>
<p><strong>清晰易懂：</strong>给人的第一感觉要干净，清楚易懂，没有累赘的元素。</p>
<p><strong>一致性：</strong>减少元素数量，多进行重用，切忌重新设计相同功能的元素。同一功能最好只设一个入口。</p>
<p><strong>易用性：</strong>适合用户每天重复使用。</p>
<p><strong>快速：</strong>快速有效的操作，减少等待。</p>
<p><strong>减少选择：</strong>减少让用户选择A或B这样的操作。</p>
<p><strong>有效：</strong>有效的设计是用户注意不到的设计，而是其中表达的内容。不应该让用户的精力放在设计本身。</p>
<p>转载请注明来自：<a href="http://blog.eood.cn">http://blog.eood.cn</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/project_design_pattens/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workflow in Drupal</title>
		<link>http://blog.eood.cn/workflow-in-drupal</link>
		<comments>http://blog.eood.cn/workflow-in-drupal#comments</comments>
		<pubDate>Tue, 19 Oct 2010 10:03:07 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[Actions]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Triggers]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1256</guid>
		<description><![CDATA[Workflow is the essential feature of complex modern system. Lots of automate process can be implemented if the workflow states defines.And it contributed to the ACL system. Think of the following situations: 1. The Draft news should only be shown to moderator. After moderation, the state changed to open. And open news should be shown [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="size-full wp-image-1258    aligncenter" title="workflow_drupal" src="http://blog.eood.cn/wp-content/uploads/2010/10/workflow_drupal.gif" alt="" width="460" height="208" /></p>
<p>Workflow is the essential feature of complex modern system. Lots of automate process can be implemented if the workflow states defines.And it contributed to the ACL system.<br />
<strong>Think of the following situations:</strong><br />
1. The Draft news should only be shown to moderator. After moderation, the state changed to open. And open news should be shown to All automatically.<br />
2. In the open state, some field shows to all, and some hidden, only can be seen by some roles.<br />
3. In the Draft state, some fields such as title can not be edited, but other fields can be edited.<br />
4. The job can be processed just after money access. Automatically change the state of the job. (By Trigger)<br />
5. The payment process<br />
6. Automatically hide the article after open 1 weeks.<br />
In Drupal, workflow module always work together with Actions*, Triggers*, VBO*. Triggers can be assigned to the workflow changes. Do something automatically when the workflow changes. Triggers fire the Actions* we defined.</p>
<p><strong>How to define Actions</strong>, please see our other articles.</p>
<p><strong>Important feature or bug of workflow module of Drupal:</strong><br />
When a new CCK field added to a content type. The workflow of this state should be saved again, or the field will not be constrained by Workflow.</p>
<p>Change the workflow programmingly in one line:</p>
<pre><span style="color: #4444ff;">&lt;</span>?<span style="color: #2040a0;">php</span>
    <span style="color: #2040a0;">workflow_execute_transition</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">node_load</span><span style="color: #4444ff;">(</span>$<span style="color: #2040a0;">nid</span><span style="color: #4444ff;">)</span>, <span style="color: #ff0000;">21</span>, '<span style="color: #2040a0;">Test</span> <span style="color: #2040a0;">comment</span> ',<span style="color: #2040a0;">TRUE</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
?<span style="color: #4444ff;">&gt;</span></pre>
<p>You can change the workflow state by Trigger*, by cron and conditions, by xmlrpc, etc.<br />
<script type="text/javascript"><!--
google_ad_client = "pub-5744751471423663";
google_ad_slot = "7076368164";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/workflow-in-drupal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>服务器端PHP多进程编程实战</title>
		<link>http://blog.eood.cn/server-side-php-progress-program-best-practice</link>
		<comments>http://blog.eood.cn/server-side-php-progress-program-best-practice#comments</comments>
		<pubDate>Fri, 02 Jul 2010 14:28:08 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Project Manament]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1164</guid>
		<description><![CDATA[最近比较PHP跟python, Erlang 的特性，发现PHP有很多人们不常用到的特性。用PHP CLI可以实现很多不错的应用。比如做爬虫, 长期运行的计算脚本, 完全可以取代其他语言来做 服务器的运维。这对于熟悉PHP的人来说如虎添翼。 为什么PHP多进程很好? 网游服务器大部分都使用多线程而不是多进程的原因也在于进程比线程更加稳定。而且多线程适合现在多核服务器的应用场景，更能发挥多核运算的能力。进程的维护可以用很多操作系统级别的工具。Message Queue解决了多大部分线程通信问题。所以PHP多进程很适合做服务器端的计算密集型的应用。 据一家越南IT公司介绍，他们成功的把PHP后台多进程用在法律文件的分发、处理银行账户的金额这样的企业级的应用上。 使用后台PHP 进程可以不影响服务器同时处理网页的请求。这种后台进程一旦发生失败很容易查处原因进行恢复或者补救,所以健壮性更高。不同的进程相互隔离，更加高效，可以统一调度各个服务进程。 PHP 是目前应用最广泛的WEB开发语言，所以用PHP来做服务器端的应用可以降低成本。可以用现有人员、现有配置、甚至做到代码重用。 什么样的场景更适合用PHP后台多进程呢？比如邮件的分发、远程服务的调用、数据的聚合、计划任务、计算结果的缓存这些不需要立即返回的地方。 PHP单进程在某些地方完全可以达到目的，而且更加容易实现，不用考虑进程的同步问题，不用考虑数据的共享问题。 PHP CLI (SAPI SERVER API)命令行接口可以用来做CRON计划任务, 图形界面程序 (使用GTK库)。 PHP CLI 例子: php -f test.php php -r &#8220;echo time();&#8221; php -R as python style PHP读取命令行参数: #!/usr/bin/php -q &#60;?php echo &#8220;Test Arguments:\n&#8221;; echo $_SERVER["argc"].&#8221;\n&#8221;; echo $_SERVER["argv"][0].&#8221;\n&#8221;; ?&#62; PHP命令行接口标准输入输出: #!/usr/bin/php -q &#60;?php [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #000000;">最近比较PHP跟python, Erlang 的特性，发现PHP有很多人们不常用到的特性。用PHP CLI可以实现很多不错的应用。比如做爬虫, 长期运行的计算脚本, 完全可以取代其他语言来做 服务器的运维。这对于熟悉PHP的人来说如虎添翼。<br />
</span></p>
<p><span style="color: #000000;">为什么PHP多进程很好? 网游服务器大部分都使用多线程而不是多进程的原因也在于进程比线程更加稳定。而且多线程适合现在多核服务器的应用场景，更能发挥多核运算的能力。进程的维护可以用很多操作系统级别的工具。Message Queue解决了多大部分线程通信问题。所以PHP多进程很适合做服务器端的计算密集型的应用。</span></p>
<p><span style="color: #000000;">据一家越南IT公司介绍，他们成功的把PHP后台多进程用在法律文件的分发、处理银行账户的金额这样的企业级的应用上。</span></p>
<p><span style="color: #000000;">使用后台PHP 进程可以不影响服务器同时处理网页的请求。这种后台进程一旦发生失败很容易查处原因进行恢复或者补救,所以健壮性更高。不同的进程相互隔离，更加高效，可以统一调度各个服务进程。</span></p>
<p><span style="color: #000000;">PHP 是目前应用最广泛的WEB开发语言，所以用PHP来做服务器端的应用可以降低成本。可以用现有人员、现有配置、甚至做到代码重用。</span></p>
<p><span style="color: #000000;">什么样的场景更适合用PHP后台多进程呢？比如邮件的分发、远程服务的调用、数据的聚合、计划任务、计算结果的缓存这些不需要立即返回的地方。</span></p>
<p><span style="color: #000000;">PHP单进程在某些地方完全可以达到目的，而且更加容易实现，不用考虑进程的同步问题，不用考虑数据的共享问题。</span></p>
<p><span style="color: #000000;">PHP CLI (SAPI SERVER API)命令行接口可以用来做CRON计划任务, 图形界面程序 (使用GTK库)。</span></p>
<p><span style="color: #000000;">PHP CLI 例子:<br />
php -f test.php<br />
php -r &#8220;echo time();&#8221;<br />
php -R as python style</span></p>
<p><span style="color: #000000;">PHP读取命令行参数:<br />
#!/usr/bin/php -q<br />
&lt;?php<br />
echo &#8220;Test Arguments:\n&#8221;;<br />
echo $_SERVER["argc"].&#8221;\n&#8221;;<br />
echo $_SERVER["argv"][0].&#8221;\n&#8221;;<br />
?&gt;</span></p>
<p><span style="color: #000000;">PHP命令行接口标准输入输出:<br />
#!/usr/bin/php -q<br />
&lt;?php<br />
/* Define STDIN in case if it is not already defined by PHP for some reason */<br />
if(!defined(&#8220;STDIN&#8221;)) {<br />
define(&#8220;STDIN&#8221;, fopen(&#8216;php://stdin&#8217;,'r&#8217;))<br />
}</p>
<p>echo &#8220;Hello! What is your name (enter below):\n&#8221;;<br />
$strName = fread(STDIN, 80); // Read up to 80 characters or a newline<br />
echo &#8216;Hello &#8216; , $strName , &#8220;\n&#8221;;<br />
?&gt;</span></p>
<p><span style="color: #000000;">CRONJOB可以定时运行某些任务，但要防止重复运行。开始时创建一个锁文件, 结束时删除。或者用ps命令来处理。</span></p>
<p><span style="color: #000000;">任务队列可以用Mysql来实现，或者KEY/VALUE数据库，或者消息队列来实现。</span></p>
<p><span style="color: #000000;">进程控制相关函数:<br />
Process Control Extensions<br />
pcntl_fork()<br />
posix_setsid()<br />
posix_kill<br />
pcntl_wait<br />
pcntl_signal</p>
<p>o SIGHUP<br />
o SIGTERM; system shutdown, kill<br />
o SIGINT; sent by Ctrl+c<br />
o SIGKILL (uncatchable); unresponsive, kill -9<br />
o SIGCHLD; child status change<br />
o SIGSTP; sent by Ctrl+z<br />
o SIGCONT; resume from stop, fg</span></p>
<p><span style="color: #000000;">PHP不能对某些错误抛出异常，如何提高PHP多进程应用的容错性？<br />
可以监控进程，依赖进程失败后报告<br />
用CRONJOB实现监控进程<br />
将被监控进程PID写成文件<br />
定时检查PID文件是否存在 检查ps -o pid=&lt;pid&gt; 或者file_exists(&#8216;/proc/&lt;pid&gt;&#8217;)<br />
如果线程不存在 重启进程。</span></p>
<p><span style="color: #000000;">回顾以前用JAVA或者Python做的服务器端的服务都可以用PHP来实现。单一语言更容易维护。以往人们对于WEB语言的认识很片面，例如多线程、事 务这些东西都可以改变方式来达到同样的目的。</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/server-side-php-progress-program-best-practice/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>项目迭代:Erlang代码热替换以及Mnesia表结构修改</title>
		<link>http://blog.eood.cn/erlang_code_swap_mnesia_transform_table</link>
		<comments>http://blog.eood.cn/erlang_code_swap_mnesia_transform_table#comments</comments>
		<pubDate>Mon, 14 Jun 2010 03:49:16 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Mnesia]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1135</guid>
		<description><![CDATA[引言 项目进行中不可避免的两件事就是： 对代码的升级,修改 对存储结构的升级,修改 Erlang在设计之初就对此两件事进行了考虑,完全实现热升级。 Erlang的代码热替换特性 最近在做Live chat的项目, 基于Ejabberd开发。Ejabberd的模块管理显示了Erlang的代码热替换的特性。可以在不重启Ejabberd服务器的情况下进行模块级别代码的升级或者修改。并且Ejabberd管理界面提供了模块升级或修改的管理功能。假如需要升级某个模块，只需要将编译好的文件替换原来的文件,进入管理后台,进行升级操作。 对于PHP之类非编译类的语言,我们在需要修改代码的时候,可以直接将旧代码替换为新代码实现平滑升级,但是对于JAVA、C++之类的项目则需要停机更新。Erlang的这个特性是编译型语言的一大改进。 Mnesia如何修改现有的表结构 Mnesia是Erlang内置的分布式数据库。可以用内置函数进行数据库的操作或者用QLC进行数据CURD。我们都会经常遇到项目功能的升级,需求的增长,不可避免需要对原有的数据结构进行修改。 Mnesia提供了transform table的功能。假如不需要保留原有数据可以进行如下的数据库表的结构更新： 对于PHP/java 项目,一遍表结构都是自己设计,可以直接修改Mysql的表结构,同时对涉及代码进行更新。对于不同的PHP开发框架来说,有不同的流程,有些PHP开发框架内置了ORM特性,数据结构的修改很容易。假如没有类似特性则需要review所有的相关代码,进行修改。好在当今框架泛滥,找到合适的开发框架很简单。Python的Dojango框架由于受到Raise的影响对持续迭代开发做了很多考虑。 在此提及Drupal数据库表结构的更新,Drupal中一般用CCK做为字段管理工具。他有一个特性既是会自动的将多个相同类型的字段合并为一张新表, 但是假如此类型的字段只有一个则会存储在content表中。假如深入做Drupal开发,需要直接用SQL操作数据,不了解此特性会出很多错。]]></description>
			<content:encoded><![CDATA[<h3>引言</h3>
<p>项目进行中不可避免的两件事就是：</p>
<li>对代码的升级,修改</li>
<li>对存储结构的升级,修改</li>
<p>Erlang在设计之初就对此两件事进行了考虑,完全实现热升级。</p>
<h3>Erlang的代码热替换特性</h3>
<p>最近在做Live chat的项目, 基于Ejabberd开发。Ejabberd的模块管理显示了Erlang的代码热替换的特性。可以在不重启Ejabberd服务器的情况下进行模块级别代码的升级或者修改。并且Ejabberd管理界面提供了模块升级或修改的管理功能。假如需要升级某个模块，只需要将编译好的文件替换原来的文件,进入管理后台,进行升级操作。<br />
<img class="size-full wp-image-1136 alignnone" title="ejabberd" src="http://blog.eood.cn/wp-content/uploads/2010/06/ejabberd.png" alt="" width="418" height="426" /><br />
对于PHP之类非编译类的语言,我们在需要修改代码的时候,可以直接将旧代码替换为新代码实现平滑升级,但是对于JAVA、C++之类的项目则需要停机更新。Erlang的这个特性是编译型语言的一大改进。</p>
<h3>Mnesia如何修改现有的表结构</h3>
<p>Mnesia是Erlang内置的分布式数据库。可以用内置函数进行数据库的操作或者用QLC进行数据CURD。我们都会经常遇到项目功能的升级,需求的增长,不可避免需要对原有的数据结构进行修改。</p>
<p>Mnesia提供了transform table的功能。假如不需要保留原有数据可以进行如下的数据库表的结构更新：<br />
<img class="size-full wp-image-1137 alignnone" title="mnesia_transform_table" src="http://blog.eood.cn/wp-content/uploads/2010/06/er.gif" alt="" width="625" height="145" /><br />
对于PHP/java 项目,一遍表结构都是自己设计,可以直接修改Mysql的表结构,同时对涉及代码进行更新。对于不同的PHP开发框架来说,有不同的流程,有些PHP开发框架内置了ORM特性,数据结构的修改很容易。假如没有类似特性则需要review所有的相关代码,进行修改。好在当今框架泛滥,找到合适的开发框架很简单。Python的Dojango框架由于受到Raise的影响对持续迭代开发做了很多考虑。</p>
<blockquote><p>在此提及Drupal数据库表结构的更新,Drupal中一般用CCK做为字段管理工具。他有一个特性既是会自动的将多个相同类型的字段合并为一张新表, 但是假如此类型的字段只有一个则会存储在content表中。假如深入做Drupal开发,需要直接用SQL操作数据,不了解此特性会出很多错。</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/erlang_code_swap_mnesia_transform_table/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何提高敏捷开发效率</title>
		<link>http://blog.eood.cn/promote_develop_efficiency</link>
		<comments>http://blog.eood.cn/promote_develop_efficiency#comments</comments>
		<pubDate>Sun, 18 Apr 2010 02:49:14 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Life & Work]]></category>
		<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[效率]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1033</guid>
		<description><![CDATA[1. 尽可能分离前端和服务。例如Drupal PHP来做前端，JAVA/PYTHON/&#8230;来做服务。 2. 准确的估计功能工作量，避免造成资源分配不合理，相互之间不理解。 3. 单元测试，性能测试，功能测试，稳定性测试分离。 4. 测试环境的速度改善。]]></description>
			<content:encoded><![CDATA[<p>1. 尽可能分离前端和服务。例如Drupal PHP来做前端，JAVA/PYTHON/&#8230;来做服务。</p>
<p>2. 准确的估计功能工作量，避免造成资源分配不合理，相互之间不理解。</p>
<p>3. 单元测试，性能测试，功能测试，稳定性测试分离。</p>
<p>4. 测试环境的速度改善。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/promote_develop_efficiency/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>敏捷过程方法</title>
		<link>http://blog.eood.cn/%e6%95%8f%e6%8d%b7%e8%bf%87%e7%a8%8b%e6%96%b9%e6%b3%95</link>
		<comments>http://blog.eood.cn/%e6%95%8f%e6%8d%b7%e8%bf%87%e7%a8%8b%e6%96%b9%e6%b3%95#comments</comments>
		<pubDate>Fri, 05 Mar 2010 14:06:58 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[敏捷]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=891</guid>
		<description><![CDATA[1.Sometimes it&#8217;s worth spending time finding the best possible approach. Sometimes it&#8217;s enough to find an approach that works. 2.不要过度折腾性能 3.总结现代model和patten并且广泛使用 4.松散的技术堆栈进行强约束，紧凑的技术堆栈进行弱约束 5.所有的开源软件都有bug,必须重新测试]]></description>
			<content:encoded><![CDATA[<p>1.Sometimes it&#8217;s worth spending time finding the best possible approach. Sometimes it&#8217;s enough to find an approach that works.</p>
<p>2.不要过度折腾性能</p>
<p>3.总结现代model和patten并且广泛使用</p>
<p>4.松散的技术堆栈进行强约束，紧凑的技术堆栈进行弱约束</p>
<p>5.所有的开源软件都有bug,必须重新测试</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/%e6%95%8f%e6%8d%b7%e8%bf%87%e7%a8%8b%e6%96%b9%e6%b3%95/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Something about agility development</title>
		<link>http://blog.eood.cn/somethingaboutagilitydevelopment</link>
		<comments>http://blog.eood.cn/somethingaboutagilitydevelopment#comments</comments>
		<pubDate>Thu, 14 Jan 2010 19:17:16 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[agility development]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/articles/405</guid>
		<description><![CDATA[We will not publish new features before holiday or afternoon, because there is not enough time to do testing. Rodemap is very important, wrong rodemap may cause endless problems. We will not fare about bugs, find them and correct them but not conceal. Every thing has a reason. Focus to the current problem when do [...]]]></description>
			<content:encoded><![CDATA[<p>We will not publish new features before holiday or afternoon, because there is not enough time to do testing.<br />
Rodemap is very important, wrong rodemap may cause endless problems.<br />
We will not fare about bugs, find them and correct them but not conceal. Every thing has a reason.<br />
Focus to the current problem when do testing.<br />
Separte different feature into different modules.</p>
<p>Question: How to edit the svn file muti-person?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/somethingaboutagilitydevelopment/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Missing arrow symbol of XML (xml_parse_into_struct)</title>
		<link>http://blog.eood.cn/missingarrowsymbolofxml%28xml_parse_into_struct%29</link>
		<comments>http://blog.eood.cn/missingarrowsymbolofxml%28xml_parse_into_struct%29#comments</comments>
		<pubDate>Fri, 04 Dec 2009 01:14:56 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Project Manament]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/articles/379</guid>
		<description><![CDATA[When relate to the following codes: $p = xml_parser_create(); xml_parse_into_struct($p, $xml, $vals, $index); xml_parser_free($p); The arrow symbol are missing, this is Bug of libxml2 with php, when using PHP = 2.6.32. This is due to an intentional change in the behaviour of libxml2 after version 2.6.32. Some sites suggest reverting to libxml2-2.6.30 &#8211; while this [...]]]></description>
			<content:encoded><![CDATA[<p>When relate to the following codes:</p>
<p> $p = xml_parser_create();<br />
 xml_parse_into_struct($p, $xml, $vals, $index);<br />
 xml_parser_free($p); </p>
<p>The arrow symbol are missing, this is Bug of libxml2 with php,</p>
<p>when using PHP <= 5.2.6 with libxml2 >= 2.6.32.</p>
<p>This is due to an intentional change in the behaviour of libxml2 after version 2.6.32. Some sites suggest reverting to libxml2-2.6.30 &#8211; while this works as a temporary solution, it is no longer necessary or advisable.</p>
<p>PHP 5.2.7 or higher works with the new behaviour of libxml2 ( see: http://bugs.php.net/bug.php?id=45996 ). Simply upgrading PHP corrects the problem.</p>
<p>Now replace these special characters with HTML Entity. And can be rightly treated by libxml2.</p>
<p>Do the following repacement before parser the xml can resolve this problem:</p>
<p> $xml =str_replace(&#8220;&lt;&#8221;,&#8221;&#60;&#8221;,$xml);<br />
 $xml =str_replace(&#8220;&gt;&#8221;,&#8221;&#62;&#8221;,$xml);<br />
 $xml =str_replace(&#8220;&amp;&#8221;,&#8221;&#38;&#8221;,$xml); </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eood.cn/missingarrowsymbolofxml%28xml_parse_into_struct%29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.249 seconds. -->
<!-- File not cached! Super Cache Couldn't write to: wp-content/cache/wp-cache-4cc6c766590459f59d502aa9aad99b73.html -->

