<?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>Drupal Developer &#187; Programming</title>
	<atom:link href="http://blog.eood.cn/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.eood.cn</link>
	<description>A decathlon Drupal developer &#38; programmer</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:55:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Drupal: Show different links to different roles</title>
		<link>http://blog.eood.cn/drupal-show-different-links-to-different-roles</link>
		<comments>http://blog.eood.cn/drupal-show-different-links-to-different-roles#comments</comments>
		<pubDate>Thu, 29 Jul 2010 14:55:41 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1208</guid>
		<description><![CDATA[Example: 1. Add menu classify Merchant 2. Add the function in template.php function YOURTHEMENAME_preprocess_page(&#38;$vars) { global $user; if (in_array(&#8216;Merchant&#8217;, $user-&#62;roles)) { $vars['nav_links'] = menu_navigation_links(&#8220;menu-merchant&#8221;); } elseif (in_array(&#8216;Operator&#8217;, $user-&#62;roles)) { } } 3. Add the code in page.tpl.php &#60;?php print theme(&#8216;links&#8217;, $nav_links, array(&#8216;id&#8217; =&#62; &#8216;features-menu&#8217;, &#8216;class&#8217; =&#62; &#8216;links primary-links&#8217;)) ?&#62;]]></description>
		<wfw:commentRss>http://blog.eood.cn/drupal-show-different-links-to-different-roles/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Tips of linux uses and 1 tip of Jquery</title>
		<link>http://blog.eood.cn/2-tips-of-linux-uses-and-1-tip-of-jquery</link>
		<comments>http://blog.eood.cn/2-tips-of-linux-uses-and-1-tip-of-jquery#comments</comments>
		<pubDate>Sun, 11 Jul 2010 08:53:35 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rar]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1166</guid>
		<description><![CDATA[Install rar in linux: $ cd /tmp $ wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz $ tar -zxvf rarlinux-3.6.0.tar.gz $ cd rar $ ./unrar # cp rar unrar /bin Determing filetype: file xxxx How to count the top items in txt files? awk &#8216;{ print $1}&#8217; /path/to/input.txt sort&#124; uniq -c &#124; sort -nr &#62; /path/to/top-get-ips.txt Detect the checkbox value and [...]]]></description>
		<wfw:commentRss>http://blog.eood.cn/2-tips-of-linux-uses-and-1-tip-of-jquery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to show custom menu links to special roles in Drupal</title>
		<link>http://blog.eood.cn/how-to-show-custom-menu-links-to-special-roles-in-drupal</link>
		<comments>http://blog.eood.cn/how-to-show-custom-menu-links-to-special-roles-in-drupal#comments</comments>
		<pubDate>Wed, 07 Jul 2010 14:46:48 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1168</guid>
		<description><![CDATA[1. Create new menu root for example *merchant* 2. Override function hook_preprocess_page(&#38;$vars) in templete.php and add the following code: global $user; if (in_array(&#8216;Merchant&#8217;, $user-&#62;roles)) { $vars['nav_links'] = menu_navigation_links(&#8220;menu-merchant&#8221;); } elseif (in_array(&#8216;&#8230;&#8217;, $user-&#62;roles)) { &#8230; } 3. Add the following code in your tpl file: &#60;?php print theme(&#8216;links&#8217;, $nav_links) ?&#62; That is all.]]></description>
		<wfw:commentRss>http://blog.eood.cn/how-to-show-custom-menu-links-to-special-roles-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>
		<wfw:commentRss>http://blog.eood.cn/server-side-php-progress-program-best-practice/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Erlang redis library</title>
		<link>http://blog.eood.cn/erlang-redis-library</link>
		<comments>http://blog.eood.cn/erlang-redis-library#comments</comments>
		<pubDate>Wed, 23 Jun 2010 10:56:24 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1161</guid>
		<description><![CDATA[Installation: cd /mnt/bruce/redis/erl-redis git clone git://github.com/litaocheng/erl-redis cd erl-redis make make install Usage: {ok, Pid}= redis_client:start(&#8220;127.0.0.1&#8243;, 6379, &#8220;&#8221;), Redis = redis_client:handler(Pid), Redis:set(&#8220;track:visitor:&#8221;++Visitor++&#8221;:operator&#8221;, Operator), Redis:incr(&#8220;track:visitor:chated&#8221;), Redis:incr(&#8220;track:chat_number:group:&#8221;++Gid), Redis:incr(&#8220;track:chat_number:operator:&#8221;++Operator), redis_client:stop(Redis),]]></description>
		<wfw:commentRss>http://blog.eood.cn/erlang-redis-library/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows linux development environment settings</title>
		<link>http://blog.eood.cn/windows-linux-development-environment-settings</link>
		<comments>http://blog.eood.cn/windows-linux-development-environment-settings#comments</comments>
		<pubDate>Fri, 04 Jun 2010 13:32:09 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[VM]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1118</guid>
		<description><![CDATA[Install VMware under windows as the development environment. IP settings: VMware provides:bridge,Host Only and NAT 3 ways. I think NAT is the best way to go: 1. VMware network adapter chosing NAT. 2. Edit=>virtual network editing=>NAT，NAT gateway ip address is 192.168.X.2 3. Under windows ipconfig to see the ip address of VMnet8, is 192.168.X.1 4. [...]]]></description>
		<wfw:commentRss>http://blog.eood.cn/windows-linux-development-environment-settings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTTPCLIENT in Erlang</title>
		<link>http://blog.eood.cn/httpclient-in-erlang</link>
		<comments>http://blog.eood.cn/httpclient-in-erlang#comments</comments>
		<pubDate>Wed, 26 May 2010 14:23:15 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1096</guid>
		<description><![CDATA[inets:start(). http:request(post, {&#34;http://example.com/xmlrpc&#34;, [], &#34;application/x-www-form-urlencoded&#34;, &#34;get_groups&#34; }, [], [] ). inets:start(). http:request(get, {&#34;http://blog.eood.cn&#34;, []}, [], []).]]></description>
		<wfw:commentRss>http://blog.eood.cn/httpclient-in-erlang/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XMLRPC example in PHP</title>
		<link>http://blog.eood.cn/xmlrpc-example-in-php</link>
		<comments>http://blog.eood.cn/xmlrpc-example-in-php#comments</comments>
		<pubDate>Wed, 26 May 2010 14:22:33 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xmlrpc]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1094</guid>
		<description><![CDATA[$param=array(&#8220;user&#8221;=&#62;&#8221;test_user&#8221;,&#8221;host&#8221;=&#62;&#8221;example.com&#8221;,&#8221;password&#8221;=&#62;&#8221;some_password&#8221;); $request = xmlrpc_encode_request(&#8216;check_password&#8217;, $param, (array(&#8216;encoding&#8217; =&#62; &#8216;utf-8&#8242;))); $context = stream_context_create(array(&#8216;http&#8217; =&#62; array( &#8216;method&#8217; =&#62; &#8220;POST&#8221;, &#8216;header&#8217; =&#62; &#8220;Content-Type: text/xml\r\n&#8221; . &#8220;Content-Length: &#8220;.strlen($request), &#8216;content&#8217; =&#62; $request ))); $file = file_get_contents(&#8220;http://127.0.0.1:1234/RPC2&#8243;, false, $context); $response = xmlrpc_decode($file); if (xmlrpc_is_fault($response)) { print_r(&#8220;error&#8221;); } else { print_r($response); }]]></description>
		<wfw:commentRss>http://blog.eood.cn/xmlrpc-example-in-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erlang xmlrpc example</title>
		<link>http://blog.eood.cn/erlang-xmlrpc-example</link>
		<comments>http://blog.eood.cn/erlang-xmlrpc-example#comments</comments>
		<pubDate>Wed, 26 May 2010 14:21:52 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Erlang]]></category>
		<category><![CDATA[xmlrpc]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1092</guid>
		<description><![CDATA[Library: xmlrpc-1.13 But this library does not support domain, only support IP address, so do the following hacking: send(Socket, URI, Header, Payload) -&#62; [Host,_URI] = URI, Request = ["POST ", _URI, " HTTP/1.1\r\n", "Host: ", Host,"\r\n", "Content-Length: ", integer_to_list(lists:flatlength(Payload)), "\r\n", "User-Agent: Erlang XML-RPC Client 1.13\r\n", "Content-Type: text/xml\r\n", Header, "\r\n", Payload], gen_tcp:send(Socket, Request). Then you can [...]]]></description>
		<wfw:commentRss>http://blog.eood.cn/erlang-xmlrpc-example/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get timestamp in Erlang</title>
		<link>http://blog.eood.cn/get-timestamp-in-erlang</link>
		<comments>http://blog.eood.cn/get-timestamp-in-erlang#comments</comments>
		<pubDate>Wed, 26 May 2010 14:19:49 +0000</pubDate>
		<dc:creator>Bruce Dou</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">http://blog.eood.cn/?p=1086</guid>
		<description><![CDATA[timestamp() -&#62; {Mega,Sec,Micro} = erlang:now(), (Mega*1000000+Sec)*1000000+Micro.]]></description>
		<wfw:commentRss>http://blog.eood.cn/get-timestamp-in-erlang/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
