<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[Claymore's blog]]></title>
<link><![CDATA[http://claymore.phpme.info/]]></link>
<description><![CDATA[Ajax,C,C++,Java,语言,PHP,脚本,Python,Unix,Linux,Web,开发,Windows,技术,新闻,读物,操作系统,杂项,资源,流程,方法,程序,设计,编程,工具,语言,网络,安全,职场,生涯,轶事,趣闻]]></description>
<language>zh-cn</language>
<copyright><![CDATA[PhpMe_Blog Alpha 1.062]]></copyright>
<webMaster><![CDATA[389961817@qq.com]]></webMaster>
<generator><![CDATA[2010-09-04]]></generator>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_496.html]]></link>
<title><![CDATA[Zend_Cache 遇到 __PHP_Incomplete_Class]]></title>
<author>claymore</author>
<category><![CDATA[ Cache Memcache Memcached ]]></category>
<pubDate>2010-05-27</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_496.html]]></guid>
<description><![CDATA[<div class="cnt" id="blog_text">
<div>当使用Zend_Cache缓存非字符串数据时,  要求设置Zend_Cache自动序列化, 但是有时候从cache中load出来的数据是__PHP_Incomplete_Class对象.</div>
<div>这个问题其实很简单, 序列化一个对象时,要求它的类已经被定义,  如果没有定义,就出现返回__PHP_Incomplete_Class的情况, 所以只要定义了被缓存对象的类就可以了.</div>
<div>当然出现这种情况还有另外一种可能,就是已经设置了序列化时的回调函数, 而这个回调函数在从cache中load数据时还没有执行结束,  所以它就返回了一个叫未完成的类,呵呵</div>
</div>
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_495.html]]></link>
<title><![CDATA[PHP程序提速方法]]></title>
<author>claymore</author>
<category><![CDATA[ 加速 优化 ]]></category>
<pubDate>2010-05-27</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_495.html]]></guid>
<description><![CDATA[<div class="cnt" id="blog_text">
<div class="line874">php程序提速方法</div>
<ol type="1">
    <li>php加速工具 eaccelerator  对php代码有3-5倍的提升,它的原理是将php的编译结果缓存起来，下次只要php的内容没有发生变化，则直接读取缓存的内容,省去了每次编译脚本所 花的时间</li>
    <li>apache的mod_gzip模块对静态页面的压缩功能</li>
    <li>使用php的ob_gzhandler的压缩输出页面功能,适用于php动态页面</li>
    <li>缓存功能可以使用php自带的apc缓存系统</li>
    <li>共享内存功能Shared Memory Functions</li>
    <li>ICE for php功能，性能比SOAP及XML-RPC有数量级的提高,ice是基于tcp/ip的直接通信</li>
    <li>memcache,分布式内存缓存系统，如果要做分布式系统这个很有用处</li>
    <li>
    <div class="line891"><a href="http://work.chinalabs.com/mywiki/ZendCache" class="nonexistent" target="_blank">ZendCache</a>是一个php脚本高 速Cache，它可以将刚执行的php脚本文件的编译结果存放在Web服务器的内存中，如果下一次有人再请求此页，它就可以很快将其送出。免去了每次用户 请求php文件，服务器都编译一次脚本所花的时间。同时，免取了从磁盘上查找、读取php文件所花的时间。所以可以大大提高服务器的相应速度。不过<a href="http://work.chinalabs.com/mywiki/ZendCache" class="nonexistent" target="_blank">ZendCache</a>是 收费的，功能与eaccelerator类似。</div>
    </li>
    <li>Zend Optimizer用优化代码的方法来提高PHP  4.0应用程序的执行速度。实现的原理是对那些在被最终执行之前由运行编译器(Run-Time  Compiler)产生的代码进行优化。一般情况下，执行使用Zend  Optimizer的PHP程序比不使用的要快40%到100%。这意味着网站的访问者可以更快的浏览网页，从而完成更多的事务，创造更好的客户满意度。 更快的反应同时也意味着可以节省硬件投资，并增强网站所提供的服务。所以，使用Zend Optimizer，就等于提高了电子商务的盈利能力。Zend   Optimizer能给PHP用户带来很多益处，特别是那些运营网站的人。快速运行PHP程序可以显著降低服务器的CPU负载，并可以减少一半的反应时 间，也就是从访问者点击链接到服务器开始读取页面之间的时间。</li>
</ol>
</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_494.html]]></link>
<title><![CDATA[游戏中的基础碰撞检测算法]]></title>
<author>claymore</author>
<category><![CDATA[ 游戏 碰撞 算法 ]]></category>
<pubDate>2010-04-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_494.html]]></guid>
<description><![CDATA[在游戏中，经常需要进行碰撞检测的实现，例如判断前面是否有障碍以及判断子弹是否击中飞机，都是检测两个物体是否发生碰撞，然后根据检测的结果做出不同的处理。<br />
<br />
进行碰撞检测的物体可能有些的形状和复杂，这些需要进行组合碰撞检测，就是将复杂的物体处理成一个一个的基本形状的组合，然后分别进行不同的检测。<br />
<br />
下面简单介绍一下两种最基本的形状进行碰撞的时候进行的处理。<br />
<br />
<strong>1、矩形和矩形进行碰撞</strong><br />
<br />
一般规则的物体碰撞都可以处理成矩形碰撞，实现的原理就是检测两个矩形是否重叠。我们假设矩形1的参数是：左上角的坐标是(x1,y1)，宽度是w1，高度是h1；矩形2的参数是：左上角的坐标是(x2,y2)，宽度是w2，高度是h2。<br />
<br />
在检测时，数学上可以处理成比较中心点的坐标在x和y方向上的距离和宽度的关系。即两个矩形中心点在x方向的距离的绝对值小于等于矩形宽度和的二分之一，同时y方向的距离的绝对值小于等于矩形高度和的二分之一。下面是数学表达式：<br />
<br />
x方向：| (x1 + w1 / 2) &ndash; (x2 + w2/2) | &lt; |(w1 + w2) / 2|<br />
<br />
y方向：| (y1 + h1 / 2) &ndash; (y2 + h2/2) | &lt; |(h1 + h2) / 2|<br />
<br />
在程序中，只需要将上面的条件转换成代码就可以实现了。]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_493.html]]></link>
<title><![CDATA[ETS named_table]]></title>
<author>claymore</author>
<category><![CDATA[ ETS named_table ]]></category>
<pubDate>2010-04-07</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_493.html]]></guid>
<description><![CDATA[<div class="function">
<h3 id="new/2"><span style="font-family: Arial;">new(Name, Options) -&gt; tid() |  atom()</span></h3>
<ul class="type">
    <li><span style="font-family: Arial;"><code>Name = atom()</code></span></li>
    <li><span style="font-family: Arial;"><code>Options  = [Option]</code></span></li>
    <li><span style="font-family: Arial;"><code>&nbsp;Option = Type | Access | named_table |  {keypos,Pos} | {heir,pid(),HeirData} | {heir,none} |  {write_concurrency,bool()}</code></span></li>
    <li><span style="font-family: Arial;"><code>&nbsp;&nbsp;Type = set |  ordered_set | bag | duplicate_bag</code></span></li>
    <li><span style="font-family: Arial;"><code>&nbsp;&nbsp;Access =  public | protected | private</code></span></li>
    <li><span style="font-family: Arial;"><code>&nbsp;&nbsp;Pos = int()</code></span></li>
    <li><span style="font-family: Arial;"><code>&nbsp;&nbsp;HeirData = term()</code></span></li>
</ul>
<div class="description">
<div><span style="font-family: Arial;">Creates a new table and returns a table  identifier which can be used in subsequent operations. The table  identifier can be sent to other processes so that a table can be shared  between different processes within a node.</span></div>
<div><span style="font-family: Arial;">The parameter <code>Options</code>  is a list of atoms which specifies table type, access rights, key  position and if the table is named or not. If one or more options are  left out, the default values are used. This means that not specifying  any options (<code>[]</code>) is the same as specifying <code>[set,protected,{keypos,1},{heir,none},{write_concurrency,false}]</code>.</span></div>
<ul>
    <li>
    </div></div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_492.html]]></link>
<title><![CDATA[xmerl_scan]]></title>
<author>claymore</author>
<category><![CDATA[ xmerl_scan ]]></category>
<pubDate>2010-04-03</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_492.html]]></guid>
<description><![CDATA[<center> <a href="http://www.ericsson.com/technology/opensource/erlang"  "_blank"="" target=" "><br />
</a> </center><center>
<div><b><font size="6">xmerl_scan</font></b></div>
</center>
<div><b><font size="4"> 模块 <font size="-2">MODULE</font></font></b></div>
<div>xmerl_scan <br />
&nbsp;</div>
<div><b><font size="4"> 模块摘要 <font size="-2">MODULE SUMMARY</font></font></b></div>
<div>This module is the interface to the XML parser, it handles XML 1.0. <br />
&nbsp;</div>
<div><b><font size="4"> 描述 <font size="-2">DESCRIPTION</font></font></b></div>
<div>
<div>This module is the interface to the XML parser, it handles XML 1.0. The XML parser is activated through xmerl_scan:string/[1,2] or xmerl_scan:file/[1,2]. It returns records of the type defined in xmerl.hrl. 参考：<a target="_top" href="http://erldoc.cn/lib/xmerl-1.2/doc/html/xmerl_examples.html" target="_blank">tutorial</a>  on customization functions.</div>
</div>
<div><b><font size="4"> <br />
<br />
数据类型 <font size="-2">DATA TYPES</font></font></b></div>
<div><dl><dt> global_state() </dt><dd>   The global state of the scanner, represented by the #xmerl_scanner{}  record. <br />
</dd><dt> option_list() </dt><dd>  Options allow to customize the behaviour of the scanner. 参考：<a target="_top" href="http://erldoc.cn/lib/xmerl-1.2/doc/html/xmerl_examples.html" target="_blank">tutorial</a>  on customization functions. <br />
Possible options are:  <dl><dt> {acc_fun, Fun} </dt><dd> Call back function to accumulate contents of entity.<br />
</dd><dt> {continuation_fun, Fun} | {continuation_fun, Fun, ContinuationState} </dt><dd> Call back function to decide what to do if the scanner runs into EOF before the document is complete.<br />
</dd><dt> {event_fun, Fun} | {event_fun, Fun, EventState} </dt><dd> Call back function to handle scanner events.<br />
</dd><dt> {fetch_fun, Fun} | {fetch_fun, Fun, FetchState} </dt><dd> Call back function to fetch an external resource.<br />
</dd><dt> {hook_fun, Fun} | {hook_fun, Fun, HookState} </dt><dd> Call back function to process the document entities once identified.<br />
</dd><dt> {close_fun, Fun} </dt><dd> Called when document has been completely parsed.<br />
</dd><dt> {rules, ReadFun, WriteFun, RulesState} | {rules, Rules} </dt><dd> Handles storing of scanner information when parsing.<br />
</dd><dt> {user_state, UserState} </dt><dd> Global state variable accessible from all customization functions<br />
</dd><dt> {fetch_path, PathList} </dt><dd> PathList is a list of directories to search when fetching files. If the file in question is not in the fetch_path, the URI will be used as a file name.<br />
</dd><dt> {space, Flag} </dt><dd> 'preserve' (default) to preserve spaces, 'normalize' to accumulate consecutive whitespace and replace it with one space.<br />
</dd><dt> {line, Line} </dt><dd> To specify starting line for scanning in document which contains fragments of XML.<br />
</dd><dt> {namespace_conformant, Flag} </dt><dd> Controls whether to behave as a namespace conformant XML parser, 'false' (default) to not otherwise 'true'.<br />
</dd><dt> {validation, Flag} </dt><dd> Controls whether to process as a validating XML parser: 'off' (default) no validation, or validation 'dtd' by DTD or 'schema' by XML Schema. 'false' and 'true' options are obsolete (i.e. they may be removed in a future release), if used 'false' equals 'off' and 'true' equals 'dtd'.<br />
</dd><dt> {schemaLocation, [{Namespace,Link}|...]} </dt><dd> Tells explicitly which XML Schema documents to use to validate the XML document. Used together with the {validation,schema} option.<br />
</dd><dt> {quiet, Flag} </dt><dd> Set to 'true' if xmerl should behave quietly and not output any information to standard output (default 'false').<br />
</dd><dt> {doctype_DTD, DTD} </dt><dd> Allows to specify DTD name when it isn't available in the XML document. This option has effect only together with {validation,'dtd' option.<br />
</dd><dt> {xmlbase, Dir} </dt><dd> XML Base directory. If using string/1 default is current directory. If using file/1 default is directory of given file.<br />
</dd><dt> {encoding, Enc} </dt><dd> Set default character set used (default UTF-8). This character set is used only if not explicitly given by the XML declaration. <br />
</dd></dl>   </dd></dl></div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_1_491.html]]></link>
<title><![CDATA[广州·工作·理想]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2010-03-31</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_1_491.html]]></guid>
<description><![CDATA[最近上班都很累，感觉很空虚，每天做着同样的事情。<br />
<br />
我不想就这样帮别人打一辈子的工，要是这样的生活持续下去真是生不如死。<br />
<br />
我现在最缺乏的是一个想法，一个好的想法，一个可以让我放弃一切努力去实现的想法。<br />
<br />
我每天都在思考这个问题，我到底能做什么，我到底该做什么，然后接着怎么办。<br />
<br />
每天工作的时候，休息的时候。<br />
<br />
我是不是一直浪费自己的青春、浪费自己的时间和生命。<br />
<br />
努力地学习，努力地工作，不过一切都是那么的空虚，没有激情，缺少点什么。<br />
<br />
<br />
一直都是在为别人做，我什么时候能帮自己做一会，努力为自己的愿望和理想而做？<br />
<br />
<br />
自从看来公司上班以后，以前的自信一下消失不见了，原来自己来这里之后，自己成了一个新人，一个什么都不会的新人，做什么事都小心翼翼的新人。<br />
<br />
<br />
我不要这样，我要有自己的自信，我有自己的自信，以前的自信，我要把它找回来。<br />
<br />
我要努力，为了自己，为了对得起自己。<br />
<br />
为了自己，努力，加油！<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_490.html]]></link>
<title><![CDATA[MySQL分钟数据类型的区别]]></title>
<author>claymore</author>
<category><![CDATA[ 数据类型 区别 ]]></category>
<pubDate>2010-03-31</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_490.html]]></guid>
<description><![CDATA[<span style="color: rgb(255, 0, 0);"><strong>char、varchar、text、ntext、 bigint、int、smallint、tinyint和bit的区别及数据库的数据类型</strong></span><span id="Content2773296"><font size="6"><br />
</font></span><br />
Varchar  对每个英文(ASCII)字符都占用2个字节，对一个汉字也只占用两个字节<br />
char  对英文(ASCII)字符占用1个字节，对一个汉字占用2个字节Varchar  的类型不以空格填满，比如varchar(100)，但它的值只是&quot;qian&quot;,则它的值就是&quot;qian&quot;而char  不一样，比如char(100),它的值是&quot;qian&quot;，而实际上它在数据库中是&quot;qian  &quot;(qian后共有96个空格，就是把它填满为100个字节)。<br />
由于char是以固定长度的，所以它的速度会比varchar快得多!但程序处 理起来要麻烦一点，要用trim之类的函数把两边的空格去掉!<br />
ntext<br />
可变长度 Unicode 数据的最大长度为  230 - 1 (1,073,741,823) 个字符。存储大小是所输入字符个数的两倍（以字节为单位）。ntext 在 SQL-92  中的同义词是 national text。<br />
text<br />
服务器代码页中的可变长度非 Unicode 数据的最大长度为 231-1  (2,147,483,647) 个字符。当服务器代码页使用双字节字符时，存储量仍是 2,147,483,647 字节。存储大小可能小于  2,147,483,647 字节（取决于字符串）。<br />
bigint：从-2^63(-9223372036854775808)到 2^63-1(9223372036854775807)的整型数据，存储大小为 8 个字节。]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_489.html]]></link>
<title><![CDATA[Erlang OTP 之 Application]]></title>
<author>claymore</author>
<category><![CDATA[ OTP Application ]]></category>
<pubDate>2010-03-30</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_489.html]]></guid>
<description><![CDATA[<div id="content">
<h1>application</h1>
<h2 class="modsummary">Generic  OTP application functions</h2>
<div class="description">
<div>In OTP, <em>application</em>  denotes a component implementing some specific functionality, that can  be started and stopped as a unit, and which can be re-used in other  systems as well. This module interfaces the <em>application controller</em>,  a process started at every Erlang runtime system, and contains  functions for controlling applications (for example starting and  stopping applications), and functions to access information about  applications (for example configuration parameters).</div>
<div>An  application is defined by an <em>application specification</em>. The  specification is normally located in an <em>application resource file</em>  called <code>Application.app</code>, where <code>Application</code> is  the name of the application. Refer to <a class="seealso" href="file:///D:/backup/%E6%A1%8C%E9%9D%A2%E5%B7%A5%E5%85%B7%E5%AD%98%E6%94%BE%E5%A4%B9/ErlangAPI%E6%89%8B%E5%86%8C/kernel/app.html" target="_blank">app(4)</a> for more information about the application  specification.</div>
<div>This module can also be viewed as a behaviour for  an application implemented according to the OTP design principles as a  supervision tree. The definition of how to start and stop the tree  should be located in an <em>application callback module</em> exporting a  pre-defined set of functions.</div>
<div>Refer to <a class="seealso" href="file:///D:/backup/%E6%A1%8C%E9%9D%A2%E5%B7%A5%E5%85%B7%E5%AD%98%E6%94%BE%E5%A4%B9/ErlangAPI%E6%89%8B%E5%86%8C/doc/design_principles/des_princ.html" target="_blank">OTP Design Principles</a> for more information about  applications and behaviours.</div>
</div>
<div class="functions">
<h4>Functions</h4>
<hr />
<div class="function">
<h3 id="get_all_env/0">get_all_env() -&gt; Env</h3>
<h3 id="get_all_env/1">get_all_env(Application) -&gt; Env</h3>
<ul class="type">
    <li><code>Application = atom()</code></li>
    <li><code>Env =  [{Par,Val}]</code></li>
    <li><code>&nbsp;Par = atom()</code></li>
    <li><code>&nbsp;Val  = term()</code></li>
</ul>
<div class="description">
</div></div></div></div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_488.html]]></link>
<title><![CDATA[Erlang OTP 自定义behaviour]]></title>
<author>claymore</author>
<category><![CDATA[ OTP 自定义 behaviour ]]></category>
<pubDate>2010-03-30</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_488.html]]></guid>
<description><![CDATA[为什么要使用behaviour，如果您对erlang有所了解的话，就明白其中的好处。 <br />
可以做到代码通用，可以减少错误，可以使用很多成熟的久经考验的模式，可以减轻无谓的重复劳动等等。。 <br />
有些时候，你可能需要定义自己的behaviour，这可不仅仅是OTP的权力。 <br />
自己定义behaviour非常简单，仅仅需要几步。 <br />
下面是一个例子： <br />
<br />
<br />
<div class="dp-highlighter">
<div class="bar">
<div class="tools">Erlang 代码 <hide height="15" width="14" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="always" quality="high" flashvars="clipboard=-module(my_behaviour).%0A%0A-export(%5Bbehaviour_info%2F1%5D).%0Abehaviour_info(callbacks)%20-%3E%0A%20%20%20%20%5B%7Binit%2C1%7D%2C%0A%20%20%20%20%20%7Bhandle%2C%202%7D%5D%3B%0Abehaviour_info(_Other)%20-%3E%0A%20%20%20%20undefined.%0A%0A-export(%5Bstart%2F1%2C%20stop%2F0%5D).%0Astart(Mod)%20-%3E%0A%20%20%20%20State%20%3D%20Mod%3Ainit(0)%2C%0A%20%20%20%20%7Bok%2C%20State2%7D%20%3D%20Mod%3Ahandle(add%2C%20%20State)%2C%0A%20%20%20%20io%3Aformat(%22state%20%3A~p~n%22%2C%20%5BState2%5D).%0Astop()%20-%3E%0A%20%20%20%20stop.%0A" src="http://erlangdisplay.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf"></hide></div>
</div>
<ol start="1" class="dp-default">
    <li><span><span>-module(my_behaviour).&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;</span></li>
    <li><span>-export([behaviour_info/<span class="number">1</span><span>]).&nbsp;&nbsp;</span></span></li>
    <li><span>behaviour_info(callbacks)&nbsp;-&gt;&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;[{init,<span class="number">1</span><span>},&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{handle,&nbsp;<span class="number">2</span><span>}];&nbsp;&nbsp;</span></span></li>
    <li><span>behaviour_info(_Other)&nbsp;-&gt;&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;undefined.&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;</span></li>
    <li><span>-export([start/<span class="number">1</span><span>,&nbsp;stop/</span><span class="number">0</span><span>]).&nbsp;&nbsp;</span></span></li>
    <li><span>start(Mod)&nbsp;-&gt;&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;State&nbsp;=&nbsp;Mod:init(<span class="number">0</span><span>),&nbsp;&nbsp;</span></span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;{ok,&nbsp;State2}&nbsp;=&nbsp;Mod:handle(add,&nbsp;&nbsp;State),&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;io:format(<span class="string">&quot;state&nbsp;:~p~n&quot;</span><span>,&nbsp;[State2]).&nbsp;&nbsp;</span></span></li>
    <li><span>stop()&nbsp;-&gt;&nbsp;&nbsp;</span></li>
    <li><span>&nbsp;&nbsp;&nbsp;&nbsp;stop.&nbsp;&nbsp;</span></li>
</ol>
</div>
<pre class="erlang" name="code" style="display: none;">
-module(my_behaviour).

-export([behaviour_info/1]).
behaviour_info(callbacks) -&gt;
    [{init,1},
     {handle, 2}];
behaviour_info(_Other) -&gt;
    undefined.

-export([start/1, stop/0]).
start(Mod) -&gt;
    State = Mod:init(0),
    {ok, State2} = Mod:handle(add,  State),
    io:format(&quot;state :~p~n&quot;, [State2]).
stop() -&gt;
    stop.
</pre>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_487.html]]></link>
<title><![CDATA[Erlang四大behaviour之三-gen_event]]></title>
<author>claymore</author>
<category><![CDATA[ behaviour gen_event ]]></category>
<pubDate>2010-03-30</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_487.html]]></guid>
<description><![CDATA[<h3>1. 事件处理规则</h3>
<div>在OTP中，事件管理器是一个事件可以发送到的命名对象，一个事件可以是一个错误、一个警告、或者一些要写入日志的信息</div>
<div>在事件管理器中，有0个、一个或者多个事件处理器被安装，当事件管理器被一个事件通知时，这个事件将被安装在事件管理器中的事件处理器处理，</div>
<div>事件管理器用一个进程实现，事件处理器用回调模块实现。事件管理器本质上维护一个{Module,  State}列表，每一个Module为一个事件处理器，而State为事件处理器的内部状态。<br />
<br />
&nbsp;</div>
<h3>2. 例子</h3>
<div>事件处理器的回调模块把错误信息写入终端<br />
&nbsp;</div>
<div class="wp_syntax">
<div class="code">
<pre style="font-family: monospace;" class="erlang"><span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">module</span><span style="color: rgb(16, 154, 184);">(</span>terminal_logger<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">behaviour</span><span style="color: rgb(16, 154, 184);">(</span>gen_event<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>init<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(107, 184, 16);">,</span> handle_event<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">2</span><span style="color: rgb(107, 184, 16);">,</span> terminate<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">2</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">init</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">_Args</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(16, 154, 184);">{</span>ok<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">handle_event</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">ErrorMsg</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">State</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(255, 78, 24);">io</span>:<span style="color: rgb(255, 60, 0);">format</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(255, 120, 0);">&quot;***Error*** ~p~n&quot;</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(69, 179, 230);">ErrorMsg</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">,</span>
    <span style="color: rgb(16, 154, 184);">{</span>ok<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">State</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">terminate</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">_Args</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">_State</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(0, 102, 0);">ok</span><span style="color: rgb(107, 184, 16);">.</span></pre>
</div>
</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_486.html]]></link>
<title><![CDATA[Erlang四大behaviour之四 - Supervisor]]></title>
<author>claymore</author>
<category><![CDATA[ behaviour Supervisor ]]></category>
<pubDate>2010-03-30</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_486.html]]></guid>
<description><![CDATA[<h3>1. 监督规则</h3>
<div>一个监督者负责启动、停止、监控他的子进程。监督者的一个基本概念就是当必要的时候重启子进程保证它们的存活</div>
<div>哪个子进程要重启和被监控是由一个子规程列表决定的，子进程按照列表中指定的顺序启动，并按相反的顺序终止<br />
<br />
&nbsp;</div>
<h3>2. 实例</h3>
<div>监督者的回调模块<br />
&nbsp;</div>
<div class="wp_syntax">
<div class="code">
<pre style="font-family: monospace;" class="erlang"><span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">module</span><span style="color: rgb(16, 154, 184);">(</span>ch_sup<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">behaviour</span><span style="color: rgb(16, 154, 184);">(</span>supervisor<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>start_link<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">0</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>init<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">start_link</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(255, 78, 24);">supervisor</span>:<span style="color: rgb(255, 60, 0);">start_link</span><span style="color: rgb(16, 154, 184);">(</span>ch_sup<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">init</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">_Args</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(16, 154, 184);">{</span>ok<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(16, 154, 184);">{</span>one_for_one<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(255, 150, 0);">60</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">,</span>
          <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">{</span>ch3<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span>ch3<span style="color: rgb(107, 184, 16);">,</span> start_link<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">,</span>
            permanent<span style="color: rgb(107, 184, 16);">,</span> brutal_kill<span style="color: rgb(107, 184, 16);">,</span> worker<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span>ch3<span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">.</span></pre>
</div>
</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_485.html]]></link>
<title><![CDATA[erl -s make all -s c q]]></title>
<author>claymore</author>
<category><![CDATA[ 编译 ]]></category>
<pubDate>2010-03-29</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_485.html]]></guid>
<description><![CDATA[对<br />
erl -s make all -s c q<br />
的解释<br />
<br />
<br />
<div><b><font size="6">make</font></b></div>
<div><b><font size="5">A Make Utility for Erlang</font></b></div>
<div>
<div>The module <code>make</code> provides a set of  functions similar to the UNIX type <code>Make</code> functions.</div>
</div>
<div><b><font size="3">Functions</font></b></div>
<hr />
<div>
<div id="all/0"><b><font size="4">all() -&gt; up_to_date | error</font></b></div>
<div id="all/1"><b><font size="4">all(Options)  -&gt; up_to_date | error</font></b></div>
<ul>
    <li><code>Options =  [Option]</code></li>
    <li><code>&nbsp;Option = noexec | load | netload |  &lt;compiler option&gt;</code></li>
</ul>
<div>
<div>This  function first looks in the current working directory for a file named <code>Emakefile</code>  (see below) specifying the set of modules to compile and the compile  options to use. If no such file is found, the set of modules to compile  defaults to all modules in the current working directory.</div>
<div>Traversing  the set of modules, it then recompiles every module for which at least  one of the following conditions apply:</div>
<ul>
    <li>there is no object  file, or</li>
    <li>the source file has been modified since it was last  compiled, or,</li>
    <li>an include file has been modified since the  source file was last compiled.</li>
</ul>
<div>As a side effect, the  function prints the name of each module it tries to compile. If  compilation fails for a module, the make procedure stops and <code>error</code>  is returned.</div>
</div></div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_35_484.html]]></link>
<title><![CDATA[erlang四大behaviour之二 - gen_fsm]]></title>
<author>claymore</author>
<category><![CDATA[ gen_fsm behaviour ]]></category>
<pubDate>2010-03-27</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_35_484.html]]></guid>
<description><![CDATA[<div>今天介绍erlang的一个非常重要的behaviour，就是gen_fsm-有限状态机，有限状态机的作用非常之多，比如文本解析，模式匹配、 游戏逻辑等等方面的处理都是它的强项，所以这个behaviour非常之重要</div>
<h3>1. 有限状态机</h3>
<div>有限状态机可以用下面这个公式来表达<br />
&nbsp;</div>
<div class="wp_syntax">
<div class="code">
<pre style="font-family: monospace;" class="ini">
<span style="font-family: Arial;"><strong><span style="color: rgb(255, 0, 0);">State(S) x Event(E) -&gt; Actions(A), State(S')</span></strong></span></pre>
</div>
</div>
<div><br />
表示的就是在S状态时如果有事件E发生，那么执行动作A后把状态调整到S&rsquo;。<br />
<div class="MsoNormal"><span style="color: rgb(255, 0, 0);">对于一个用<span lang="EN-US">gen_fsm</span>行为实现的状态机来说，状态转变规则被写为符合如下规定的一系列<span lang="EN-US">Erlang</span>函数：</span></div>
<div class="MsoNormal"><span style="color: rgb(255, 0, 0);"><span lang="EN-US"> StateName( Event,  StateData ) -&gt;</span></span></div>
<div class="MsoNormal"><span style="color: rgb(255, 0, 0);"><span lang="EN-US"> .. code for  actions here &hellip;</span></span></div>
<div class="MsoNormal"><span style="color: rgb(255, 0, 0);"><span lang="EN-US"> { next_state,  StateName&rsquo;, StateData&rsquo; }</span></span></div>
</div>
<h3><br />
<br />
2. 一个例子</h3>
<div>erlang手册中用这个例子来解释的：开锁问题，有一个密码锁的门，它就可以看作一个状态机，初始状态门是锁着的，任何时候有人按一个密码键就会 产生一个事件，这个键值和前面的按键组合后与密码相比较，看是否正确，如果输入的密码顺序是对的，那么将门打开30秒，如果输入密码不完全，则等待下次按 钮按下，如果输入密码顺序是错的，则重新开始等待按键按下。<br />
<br />
&nbsp;</div>
<div class="wp_syntax">
<div class="code">
<pre style="font-family: monospace;" class="erlang"><span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">module</span><span style="color: rgb(16, 154, 184);">(</span>code_lock<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">behaviour</span><span style="color: rgb(16, 154, 184);">(</span>gen_fsm<span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>start_link<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>button<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(1, 78, 164);">-</span><span style="color: rgb(84, 0, 179);">export</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">[</span>init<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">1</span><span style="color: rgb(107, 184, 16);">,</span> locked<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">2</span><span style="color: rgb(107, 184, 16);">,</span> open<span style="color: rgb(1, 78, 164);">/</span><span style="color: rgb(255, 150, 0);">2</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">start_link</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(255, 78, 24);">gen_fsm</span>:<span style="color: rgb(255, 60, 0);">start_link</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">{</span>local<span style="color: rgb(107, 184, 16);">,</span> code_lock<span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">,</span> code_lock<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">button</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">Digit</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(255, 78, 24);">gen_fsm</span>:<span style="color: rgb(255, 60, 0);">send_event</span><span style="color: rgb(16, 154, 184);">(</span>code_lock<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span>button<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Digit</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">init</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(16, 154, 184);">{</span>ok<span style="color: rgb(107, 184, 16);">,</span> locked<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">locked</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">{</span>button<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Digit</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(69, 179, 230);">SoFar</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(24, 104, 149);">case</span> <span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(69, 179, 230);">Digit</span>|SoFar<span style="color: rgb(16, 154, 184);">]</span> <span style="color: rgb(24, 104, 149);">of</span>
        <span style="color: rgb(69, 179, 230);">Code</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
            <span style="color: rgb(255, 60, 0);">do_unlock</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">,</span>
            <span style="color: rgb(16, 154, 184);">{</span>next_state<span style="color: rgb(107, 184, 16);">,</span> open<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(255, 150, 0);">3000</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">;</span>
        <span style="color: rgb(69, 179, 230);">Incomplete</span> <span style="color: rgb(24, 104, 149);">when</span> <span style="color: rgb(255, 60, 0);">length</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">Incomplete</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(1, 78, 164);">&lt;</span><span style="color: rgb(255, 60, 0);">length</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
            <span style="color: rgb(16, 154, 184);">{</span>next_state<span style="color: rgb(107, 184, 16);">,</span> locked<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(69, 179, 230);">Incomplete</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">;</span>
        <span style="color: rgb(69, 179, 230);">_Wrong</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
            <span style="color: rgb(16, 154, 184);">{</span>next_state<span style="color: rgb(107, 184, 16);">,</span> locked<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(16, 154, 184);">{</span><span style="color: rgb(16, 154, 184);">[</span><span style="color: rgb(16, 154, 184);">]</span><span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">Code</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(16, 154, 184);">}</span>
    <span style="color: rgb(24, 104, 149);">end</span><span style="color: rgb(107, 184, 16);">.</span>
<span style="color: rgb(255, 60, 0);">open</span><span style="color: rgb(16, 154, 184);">(</span>timeout<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">State</span><span style="color: rgb(16, 154, 184);">)</span> <span style="color: rgb(107, 184, 16);">-&gt;</span>
    <span style="color: rgb(255, 60, 0);">do_lock</span><span style="color: rgb(16, 154, 184);">(</span><span style="color: rgb(16, 154, 184);">)</span><span style="color: rgb(107, 184, 16);">,</span>
    <span style="color: rgb(16, 154, 184);">{</span>next_state<span style="color: rgb(107, 184, 16);">,</span> locked<span style="color: rgb(107, 184, 16);">,</span> <span style="color: rgb(69, 179, 230);">State</span><span style="color: rgb(16, 154, 184);">}</span><span style="color: rgb(107, 184, 16);">.</span></pre>
</div>
</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_483.html]]></link>
<title><![CDATA[erl启动参数说明]]></title>
<author>claymore</author>
<category><![CDATA[ 参数 说明 erl ]]></category>
<pubDate>2010-03-27</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_483.html]]></guid>
<description><![CDATA[最近被一个问题困扰，先把错误提示发出来：<br />
kernel-poll not supported; &quot;K&quot; parameter ignored<br />
{error_logger,{{2010,3,27},{9,23,16}},&quot;Protocol: ~p: register error: ~p~n&quot;,[&quot;inet_tcp&quot;,{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1},{net_kernel,start_protos,4},{net_kernel,start_protos,3},{net_kernel,init_node,2},{net_kernel,init,1},{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}]}<br />
{error_logger,{{2010,3,27},{9,23,16}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,&lt;0.20.0&gt;},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6},{proc_lib,init_p_do_apply,3}]}},{ancestors,[net_sup,kernel_sup,&lt;0.9.0&gt;]},{messages,[]},{links,[#Port&lt;0.65&gt;,&lt;0.17.0&gt;]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,377},{stack_size,24},{reductions,454}],[]]}<br />
{error_logger,{{2010,3,27},{9,23,16}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfa,{net_kernel,start_link,[['xge@127.0.0.1',longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}<br />
{error_logger,{{2010,3,27},{9,23,16}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfa,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}<br />
{error_logger,{{2010,3,27},{9,23,16}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}<br />
{&quot;Kernel pid terminated&quot;,application_controller,&quot;{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}&quot;}<br />
<br />
Crash dump was written to: erl_crash.dump<br />
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})<br />
<br />
Crash dump was written to: erl_crash.dump<br />
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})<br />
<br />
<br />
Abnormal termination<br />
<br />
<br />
<br />
<br />
百思不得其解，接着在运行程序的bat文件上下功夫，该BAT文件的内容是：<br />
cd ebin<br />
start werl +P 102400 +K true +S 2 -smp -name xge@127.0.0.1 -setcookie xge -config elog -s xge start<br />
<br />
<br />
我想启动SHELL的命令行参数有很大关系，所以参看了下DOC文档，如下，使用到的参数高亮一下。<br />
<br />
<br />
<br />
<strong><span style="color: rgb(255, 0, 0);">(最后找到问题的原因在于数据库无法连接，因为创建的用户无法对未授权的数据库进行操作。可是错误太怪了，这样的错误真的不好确定出错的原因！)</span></strong><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<center>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_482.html]]></link>
<title><![CDATA[Erlang中的错误处理]]></title>
<author>claymore</author>
<category><![CDATA[ 错误 Error ]]></category>
<pubDate>2010-03-27</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_482.html]]></guid>
<description><![CDATA[erlang中错误大体分为四种： <br />
<br />
&nbsp;&nbsp; 1. 编译错误 <br />
&nbsp;&nbsp; 2. 逻辑错误 <br />
&nbsp;&nbsp; 3. 运行时错误 <br />
&nbsp;&nbsp; 4. 用户代码生成的错误 <br />
<br />
编译错误，主要是编译器检测出的代码语法错误 <br />
逻辑错误，是指程序没有完成预期的工作，属于开发人员的问题 <br />
运行时错误，是指erlang运行时抛出的错误，比如对非数据类型执行算术运算，erlang运行时会捕获异常，并抛出。在erlang中，这类 异常的类型为error <br />
用户自定义错误，是指通过exit/1或者throw/1生成 <br />
<br />
我们把运行时错误以及用户抛出的错误称为异常(exception)，他们具有三种类型：throw, error, exit。 <br />
error型异常，通过erlang:error/1, 2生成，也可以使用早期的erlang:fault/1, 2 <br />
throw型异常，通过throw/1生成 <br />
exit型异常，通过exit/1生成 <br />
<br />
在erlang中，进程内的异常可以通过try, catch来进行捕获处理。 <br />
推荐使用try，其为新添加的语法。进程间的异常可以通过监督树(supervisor tree)，监控进程(monitor)来实现。 <br />
<br />
badarg&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 参数错误，参数格式或类型错误 <br />
badarith&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 算术表达式错误，算术表达式中含有错误的参数 <br />
{badmatch,V}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 模式匹配错误，V指具体的发生匹配错误的数值 <br />
function_clause&nbsp; 函数子句错误，没有找到匹配的函数子句 <br />
{case_clause,V} case&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 匹配错误，没有找到匹配的case pattern <br />
if_clause if&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 子句错误，没有找到为ture的if子句 <br />
{try_clause,V} &nbsp; &nbsp;&nbsp; try匹配错误，执行try时，没有找到匹配的pattern <br />
undef&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 函数未定义错误 <br />
{badfun,F}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 函数错误 <br />
{badarity,F}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 函数参数个数错误 <br />
timeout_value&nbsp;&nbsp;&nbsp;&nbsp; 超时参数错误，在receive..  after语法中，after对应的超时数据错误（应为不小于0的integer或infinity <br />
noproc Process&nbsp; 错误，Process不存在 <br />
{nocatch,V}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; throw未被catch <br />
system_limit&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 系统限制错误，某些性能或数据达到系统极限 <br />
<br />
try 语法 <br />
<br />
<br />
<br />
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_36_481.html]]></link>
<title><![CDATA[Memcache的安装和使用]]></title>
<author>claymore</author>
<category><![CDATA[ Memcache 安装 使用 ]]></category>
<pubDate>2010-03-26</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_36_481.html]]></guid>
<description><![CDATA[<div>
<div><span style="font-family: Arial;">很多phper不知道如何在Windows下搭建Memcache的开发调试环境，最近个人也在研究Memcache，记录下自己安装搭建 的过程。<br />
其实我开始研究Memcache的时候并不知道居然还有memcached for  Win32这个鸟东西，害得我在CnetOS下折腾1天才搞定，今天突然发现Windows下的Memcache进行开发调试完全没有问题，所以写篇 Memcache的文档分享给大家。<br />
<br />
<br />
</span></div>
<div><span style="font-family: Arial;"><strong>Windows下的Memcache安装</strong>：<br />
1. 下载</span><a target=" "_blank"" href="http://jehiah.cz/projects/memcached-win32"><span style="font-family: Arial;">memcache</span></a><span style="font-family: Arial;">的windows稳定版，解压放某个盘下 面，比如在c:\memcached<br />
2. 在终端（也即cmd命令界面）下输入 &lsquo;c:\memcached\memcached.exe -d  install&rsquo; 安装<br />
3. 再输入： &lsquo;c:\memcached\memcached.exe -d start&rsquo; 启动。NOTE:  以后memcached将作为windows的一个服务每次开机时自动启动。这样服务器端已经安装完毕了。<br />
4.下载</span><a target=" "_blank"" href="http://pecl4win.php.net/list.php"><span style="font-family: Arial;">php_memcache.dll</span></a><span style="font-family: Arial;">，请自己查找对应的php 版本的文件<br />
5. 在C:\winnt\php.ini 加入一行 &lsquo;extension=php_memcache.dll&rsquo;<br />
6.重新启 动Apache，然后查看一下phpinfo，如果有memcache，那么就说明安装成功！<br />
<br />
<br />
</span></div>
</div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_35_480.html]]></link>
<title><![CDATA[Cannot load */modules/mod_dav_svn.so into server: \xd5\xd2\...]]></title>
<author>claymore</author>
<category><![CDATA[ SVN Error ]]></category>
<pubDate>2010-03-26</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_35_480.html]]></guid>
<description><![CDATA[按照TortoiseSVN的帮助文档安装SVN服务器，结果出现了<br />
httpd.exe: Syntax error on line 561 of D:/ENV/Apache2.2/conf/httpd.conf: Cannot load D:/ENV/Apache2.2/modules/mod_dav_svn.so into server: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3&nbsp; <br />
这样的错误。<br />
<br />
<br />
其实不是.so文件的错，只是复制到Apache/bin下的DLL文件少了，将Subversion的所有DLL文件复制过去就行了。<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_479.html]]></link>
<title><![CDATA[Using native MySQL driver in Erlang]]></title>
<author>claymore</author>
<category><![CDATA[ Error ]]></category>
<pubDate>2010-03-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_479.html]]></guid>
<description><![CDATA[<div><span style="font-family: Arial;">When I added</span></div>
<div><span style="font-family: Arial;">&nbsp;</span></div>
<div><strong><span style="font-family: Arial;">Result1 = mysql:fetch(p1, &lt;&lt;&quot;SELECT * FROM cdb_forums  LIMIT 10&quot;&gt;&gt;),</span></strong><span style="font-family: Arial;"><br />
<br />
</span></div>
<div><span style="font-family: Arial;">it crashed.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div>
<div>The actual error here is:</div>
<divre>no function clause matching <br />
<strong><br />
mysql:fetch(p1,&lt;&lt;&quot;SELECT * FROM cdb_forums LIMIT 10&quot;&gt;&gt;)</strong><br />
<div>This error means the function is there and exported, but doesn't take  the type of argument you're passing in. The mysql driver code says that  mysql:fetch/2 takes an iolist() -- you've  passed it a binary which is not a valid iolist(). Doing:</div>
</divre>
</div>
<divre><strong>mysql:fetch(p1,[&lt;&lt;&quot;SELECT * FROM cdb_forums LIMIT 10&quot;&gt;&gt;])<br />
%% or<br />
mysql:fetch(p1,&quot;SELECT * FROM cdb_forums LIMIT 10&quot;)</strong><br />
<div>instead should work as those are valid iolists.</div>
</divre>
<br />
</span></div>
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_478.html]]></link>
<title><![CDATA[ETS的match函数的使用]]></title>
<author>claymore</author>
<category><![CDATA[ ETS match 使用 ]]></category>
<pubDate>2010-03-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_478.html]]></guid>
<description><![CDATA[<div id="match/2"><b><font size="4">match(Tab, Pattern) -&gt; [Match]</font></b></div>
<ul>
    <li><code>Tab = tid() | atom()</code></li>
    <li><code>Pattern  = tuple()</code></li>
    <li><code>Match = [term()]</code></li>
</ul>
<div>Matches the objects in the table <code>Tab</code>  against the pattern <code>Pattern</code>.</div>
<div>A pattern is a term  that may contain:</div>
<ul>
    <li>bound parts (Erlang terms),</li>
    <li><code>'_'</code>  which matches any Erlang term, and</li>
    <li>pattern variables: <code>'$N'</code>  where <code>N</code>=0,1,...</li>
</ul>
<div>The function returns a list  with one element for each matching object, where each element is an  ordered list of pattern variable bindings. An example:</div>
<br />
<pre sh_sourcecode="">
6&gt; <code>ets:match(T, '$1').</code>           % Matches every object in the table [[{rufsen,dog,7}],[{brunte,horse,5}],[{ludde,dog,5}]] 
7&gt; <code>ets:match(T, {'_',dog,'$1'}).</code> %[[7],[5]] 
8&gt; <code>ets:match(T, {'_',cow,'$1'}).</code> %[]


最主要的是注意Patern是什么东西，参数以及返回值的类型。
此外match的&ldquo;重载函数&rdquo;有几个，注意参数的类型以及使用。
</pre>
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_477.html]]></link>
<title><![CDATA[Erlang开源项目URL]]></title>
<author>claymore</author>
<category><![CDATA[ 开源 ]]></category>
<pubDate>2010-03-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_477.html]]></guid>
<description><![CDATA[<div>1、ejabberd是的Jabber / XMPP协议的即时通讯服务器，持牌GPLv2许可下（自由和开放源码）  ，写的爱尔朗/检察官办公室。在其它特性中， ejabberd是跨平台，容错， clusterable和模块化。<br />
开发语言： ErLang <br />
项目主页： <a href="http://www.ejabberd.im/" target="_blank">http://www.ejabberd.im/</a> <br />
文档地址： <a href="http://www.process-one.net/docs/ejabberd/guide_en.html" target="_blank">http://www.process-one.net/docs/ejabberd/guide_en.html</a>  <br />
下载地址： <a href="http://www.process-one.net/en/ejabberd/downloads/" target="_blank">http://www.process-one.net/en/ejabberd/downloads/</a><br />
<br />
&nbsp;</div>
<div>2、CouchDB是一个&quot;面向文档&quot;的数据库，采用 ErLang 语言开发，文档的格式是一个JSON字符串（也可包含二进制附件）。  底层结构是由一个&quot;存储&quot;(storeage) ，以及多个&quot;视图索引&quot;(view indexs)。 &quot;储存&quot;用来储存文件,  &quot;视图索引&quot;用于查询处理。<br />
CouchDB落实到最底层的数据结构就是两类B+Tree 。<br />
CouchDB  能够适应非常广泛的应用场景，在某些偶尔连接网络的应用中，我们可以用CouchDB暂存数据，随后进行同步。也可以在Cloud环境中，作为大型的分布  式的数据存储。CouchDB提供了基于 HTTP的API的访问方式，这样，保证了所有的常见的语言都可以使用CouchDB。<br />
开发语言： ErLang <br />
项目主页： <a href="http://incubator.apache.org/couchdb/" target="_blank">http://incubator.apache.org/couchdb/</a>  <br />
文档地址： <a href="http://incubator.apache.org/couchdb/docs/index.html" target="_blank">http://incubator.apache.org/couchdb/docs/index.html</a>  <br />
下载地址： <a href="http://incubator.apache.org/couchdb/downloads.html" target="_blank">http://incubator.apache.org/couchdb/downloads.html</a><br />
<br />
&nbsp;</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_109_476.html]]></link>
<title><![CDATA[ErlIDE的ISO-8859-1编码问题 ]]></title>
<author>claymore</author>
<category><![CDATA[ Erlang 编码 ErlIDE ]]></category>
<pubDate>2010-03-23</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_109_476.html]]></guid>
<description><![CDATA[在ErlIDE中编辑Erlang代码时，如果源文件中包含有中文，那么在保存文件时会报&ldquo;some character can not mapped using &quot;iso-8859-1&quot; character encoding...&rdquo;错误，用以下方法设置可解决该问题：<br />
<br />
1. 从MyEclipse的主菜单项中选择Window-&gt;Preferences（我用的是MyEclipse，如果是Eclipse请选择对应的 Preferences菜单项）；<br />
2. 在&ldquo;type filter text&rdquo;的输入框中输入&ldquo;Content Types&rdquo;；<br />
3. 输入完后，MyEclipse会自动进行查找，然后会在右边显示出Content Types的属性；<br />
4. 点击右边的Text，选择Text下的子项节点&ldquo;Erlang source file&rdquo;，设置Default encoding值为&ldquo;UTF-8&rdquo;然后点击&ldquo;Update&rdquo;按钮，即可解决该问题。<br />
<br />
但随之而来的也有许多问题，比如MyEclipse 的函数列表显示不正常，或者函数定位不准，郁闷，Erlang已经发展了好些年头了，但还是无法找到一个像样的IDE。<br />
<br />
昨天把 ErlIDE升级到0.4.2.9版本，发现已经基本解决了UTF-8编码下函数列表显示不正常的问题，终于能有一个看上去还算可用的IDE环境，还是要提醒大家，对于这种还在0.X版本下的项目，需要随时关注版本升级。<br />
<br />
笔者想起来最近被Erlang的IDE环境整得够郁闷的，几乎把网上能找到的IDE都试了一下，但都不尽如人意，有个华人做的erlybird，是运行在netbeans上的，但在我的机子上运行无法正确完成 Indexed，以至于每次启动时都要重新Indexed一遍，和作者联系了一次，也没有下文，最后放弃了。网上的大部分前辈都说ErlIDE运行不太稳定，希望0.4.X以上版本可以解决这些基本的问题，毕竟IDE这东西，可以使用不太方便一点（当然要比记事本强多多才行，要不还能叫IDE吗！），但不能在稳定性上打折扣，要不噼里啪啦写了一大堆代码给IDE崩溃给整完了，那可比用记事本写代码还要郁闷的。不过还好，至少我还没在我的机子上发现 ErlIDE崩溃的情况发生！]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_1_475.html]]></link>
<title><![CDATA[在广州，这几天]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2010-03-21</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_1_475.html]]></guid>
<description><![CDATA[到广州上班。<br />
<br />
兴高采烈的，上班后发现公司做项目已经不用PHP，换成ERLANG了，我这个PHP程序员焦头烂额地开始在别人后面学习新的程序语言。<br />
<br />
<br />
在OOP流行的今天，这种COP的顺序型程序设计语言语法看起来真的很难懂，我还得转变编程思维以及熟悉这种晦涩的程序语法，不过公司叫你做什么你就做什么，你没有办法，况且学习这种东西对自己也是很有好处的。唯一讨厌的就是慢了别人一步，别人都开始用ERLANG做项目了，就我一个人上班的时候在那看书学习，说实话心里不太好受，我一直都是一个争强好胜的人，做技术的话不想比别人差，感觉心里很别扭。于是只有好好努力早点学会和别人在一条线上同步。<br />
<br />
无奈，觉得自己PHP学得挺牛B，编程能力也不比别人差，这么一来，到公司我看起来还真的像个&ldquo;新人&rdquo;，什么都不会的&ldquo;新人&rdquo;。<br />
<br />
广州的天气又热，让人的心情又焦躁。<br />
<br />
<br />
我一要好好努力，努力学习跟进！<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_474.html]]></link>
<title><![CDATA[“按位相与”对“布尔逻辑”造成的误差  - “&amp;”运算符]]></title>
<author>claymore</author>
<category><![CDATA[ 运算符 &amp; 布尔 ]]></category>
<pubDate>2010-03-10</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_474.html]]></guid>
<description><![CDATA[<div>在表示判断的过程中我们常使用&ldquo;&amp;&rdquo;表示逻辑与，可能是由于其他语言如C系程序语言工具而来的，但是很有可能造成严重的错误。<br />
<br />
比如，在位运算中&ldquo;&amp;&rdquo;表示按位与，二者便造成了冲突。<br />
<br />
在PHP中，逻辑与的正确运算符应该是&ldquo;&nbsp;and &rdquo;而不是&ldquo;&amp;&rdquo;。<br />
<br />
请正确使用。<br />
<br />
<br />
注意一些的逻辑表达<br />
<br />
<span style="color: #ff0000">1&amp;64 为假(0000001&amp;1000000=0)<br />
1 and 64 为真</span></div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_1_473.html]]></link>
<title><![CDATA[最近比较忙···累]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2010-03-07</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_1_473.html]]></guid>
<description><![CDATA[其实什么也没做，其实有很多要做，就是因为他多了，忙不过来干脆偷懒什么也不想做。<br />
<br />
点击那边的事：<br />
一些程序需要完善，一些隐性的BUG需要解决，新的站点需要写成，服务器应该在我走之前你得到很好的优化和配置。<br />
但是，我不想做。<br />
<br />
<br />
自己这边的事：<br />
13号去广州，去了那边又是一大堆麻烦的事。<br />
现在自己的一些程序需要完善和升级，更好的思路就会产生新的解决问题的方案，就会多花时间来处理。<br />
BLOG程序新的思路已经有了，升级了20%，觉得在13号之前没可能完成，就没写了。<br />
不过如果心情好的话会继续做的。<br />
还有毕业设计什么的一边工作一边做，也很繁忙的，杂七杂八的。<br />
最近处理在学校的事，又是嫌麻烦。<br />
<br />
我这个人啊，最讨厌麻烦的事情，没那么多的精力一一做好。]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_1_472.html]]></link>
<title><![CDATA[2010.02.08 焦躁的内心]]></title>
<author>claymore</author>
<category><![CDATA[ 焦躁 烦 忙 懒 妈的什么也不想做 ]]></category>
<pubDate>2010-02-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_1_472.html]]></guid>
<description><![CDATA[好久没有写日记了，原因有很多，比如是忙啊什么的理由。不过呢，主要的还是这个程序需要做很大的修改，没什么心情写。<br />
<br />
以前比较喜欢写日记，喜欢经常对自己所做过的事情进行总结，不过呢，现在很少这样了，我也想经常这样，总结一下。<br />
<br />
<br />
<br />
话说对PhpMe_Blog进行改版啊，还真是麻烦，相当于把整个程序从新写一遍，不过呢，这个程序是我最喜欢的程序了，一直对它不停地修改和改进，所以我希望它能非常完美，所以改版我会做的，就算再麻烦，由于麻烦呢，放假之后一直都没有做，等待以后找个非常好的时间以及非常好的心情就做吧。<br />
<br />
现在这个Blog程序其实已经很好了，不过有一些毛病，比如表设计上、程序结构设计上有一些毛病，特别是还没有做index，所以当数据量大的时候访问会变慢，不过呢，现在还看不出来赫赫。<br />
<br />
<br />
<br />
话说最近这些空闲时间呢一直都闲着，什么也不想做其实应该做的事情有很多，比如点击的服务器需要做调整，一些程序应该再完善一下，我想我下学期没有时间做这种事情了。<br />
<br />
<br />
该死的补考，下学期开学还得再学校待2个周才能去广州工作，因为补考啊，有门选修课挂掉了，郁闷呢，那个老师怎么挂我的科呢，都大四了，害的我这么麻烦，原本的时间计划都混乱了，真是&middot;&middot;&middot;巴嘎！！]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_6_471.html]]></link>
<title><![CDATA[Jquery Tabs: spinner option not working?]]></title>
<author>claymore</author>
<category><![CDATA[ Jquery Tabs spinner ]]></category>
<pubDate>2010-01-10</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_6_471.html]]></guid>
<description><![CDATA[<span style="font-size: large;">I need an ajax animation while the remote page is loaded in tabs.<br />
I am using<br />
<br />
$('#tabs2').tabs({ spinner: ''&lt;img src=&quot;../../Content/images/Jquery/spinner.gi'' });<br />
<br />
Even $('#tabs2').tabs({ spinner: 'Loading..' }); also doesn't works ...<br />
<br />
Though the tab functionality is working but the animation is not working ...<br />
I am using JQuery theme roller files. Your help is much appreciated. Many Thanks</span><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Problem solved. I Put a &lt;span&gt; tag in the tabs. Found the solution in Jquery support discussions. <a href="http://docs.jquery.com/Discussion" target="_blank">http://docs.jquery.com/Discussion</a><br />
<br />
e.g.<br />
<br />
<span style="font-size: large;">&lt;li&gt;&lt;a href=&quot;../URL&quot;&gt;**&lt;span&gt;Text to display in Tabs&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;a href=&quot;tabdiv&quot;&gt;**&lt;span&gt;Text to display in Tabs&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;</span><br />
<br />
<br />
<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_108_470.html]]></link>
<title><![CDATA[HTTP头部详解及使用Java套接字处理HTTP请求]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2009-12-01</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_108_470.html]]></guid>
<description><![CDATA[<div>进行Web开发关键是要了解超文本传输协议（HTTP），该协议用来传输网页、图像以及因特 网上在浏览器与服务器间传输的其他类型文件。只要你在浏览器上输入一个URL，最前面的http://就表示使用HTTP来访问指定位置的信息。（大部分 浏览器还支持其他一些不同的协议，其中FTP就是一个典型例子。）</div>
<div>本文从HTTP协议的结构上初步探讨HTTP协议的工作原理和请求响应格式,并最后通过一个使用Java编写的小HTTP服务器验证了如何处理和响应HTTP请求</div>
<div>HTTP由两部分组成：请求和响应。当你在Web浏览器中输入一个URL时，浏览器将根据你 的要求创建并发送请求，该请求包含所输入的URL以及一些与浏览器本身相关的信息。当服务器收到这个请求时将返回一个响应，该响应包括与该请求相关的信息 以及位于指定URL（如果有的话）的数据。直到浏览器解析该响应并显示出网页（或其他资源）为止。<br />
<br />
&nbsp;</div>
<div><strong>HTTP请求</strong></div>
<div>HTTP请求的格式如下所示：</div>
<div>＜request-line＞</div>
<div>＜headers＞</div>
<div>＜blank line＞</div>
<div>[＜request-body＞]</div>
<div>在HTTP请求中，第一行必须是一个请求行（request line），用来说明请求类型、要访问的资源以及使用的HTTP版本。紧接着是一个首部（header）小节，用来说明服务器要使用的附加信息。在首部之 后是一个空行，再此之后可以添加任意的其他数据[称之为主体（body）]。</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_84_469.html]]></link>
<title><![CDATA[经典恶搞]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2009-11-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_84_469.html]]></guid>
<description><![CDATA[1 ：我自横刀向天笑，笑完我就去睡觉。 <br />
2 ：收银员说：没零钱了，找你两个塑料袋吧！ <br />
3 ：我的优点是：我很帅；但是我的缺点是：我帅的不明显。 <br />
4 ：什么是幸福？幸福就是猫吃鱼，狗吃肉，奥特曼打小怪兽！ <br />
5 ：我的人生有A 面也有B面，你的人生有S面也有B面。 <br />
6 ：我是胖人，不是粗人。 <br />
7 ：台湾一日不收复，我一日不过4级！ <br />
8 ：如果太阳不出来了，我就不去上班了；如果出来了，我就继续睡觉！ <br />
9 ：狂奔的蜗牛。 <br />
10 ：泡妞就像挂QQ，每天哄她2个小时，很快就可以太阳了。  <br />
11 ：谈钱不伤感情，谈感情最他妈伤钱。 <br />
12 ：我诅咒你一辈子买方便面没有调料包。 <br />
13 ：会计说：&ldquo;你晚点来领工资吧，我这没零钱。&rdquo; <br />
14 ：你看得出我擦了粉吗？ <br />
15 ：虽然你身上喷了古龙水，但我还是能隐约闻到一股人渣味儿。 <br />
16 ：我的名字叫Rain，小名叫润土。 <br />
17 ：我是天使，回不去天堂是因为体重的原因。 <br />
18 ：有一次我上街，一群女孩把我拦住，她们说我帅，我不承认，她们就打我，还说我虚伪。 <br />
19 ：既宅又腐，前途未卜。 <br />
20 ：冲杯三鹿给党喝。 <br />
21 ：史上最神秘的部门：有关部门。 <br />
22 ：不可否认，马赛克是这个世纪阻碍人类裸体艺术进步最大的障碍！ ]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_468.html]]></link>
<title><![CDATA[PHP和Socket简介]]></title>
<author>claymore</author>
<category><![CDATA[ Socket ]]></category>
<pubDate>2009-11-23</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_468.html]]></guid>
<description><![CDATA[章: PHP And Socket<br />
书名: 《PHP Game Programming》<br />
作者: Matt Rutledget<br />
翻译: heiyeluren &lt;heiyeluren_gmail_com&gt;<br />
<br />
◇　Socket基础<br />
◇　产生一个服务器<br />
◇　产生一个客户端<br />
<br />
在这一章里你将了解到迷人而又让人容易糊涂的套接字（Sockets）。Sockets在PHP中是没有充分利用的功能。今天你将看到产生一个能使用客户端连接的服务器，并在客户端使用socket进行连接，服务器端将详细的处理信息发送给客户端。<br />
当你看到完整的socket过程，那么你将会在以后的程序开发中使用它。这个服务器是一个能让你连接的HTTP服务器，客户端是一个Web浏览器，这是一个单一的 客户端/服务器 的关系。<br />
<br />
<br />
<br />
◆　Socket 基础<br />
<br />
<br />
PHP 使用Berkley的socket库来创建它的连接。你可以知道socket只不过是一个数据结构。你使用这个socket数据结构去开始一个客户端和服务器之间的会话。这个服务器是一直在监听准备产生一个新的会话。当一个客户端连接服务器，它就打开服务器正在进行监听的一个端口进行会话。这时，服务器端接受客户端的连接请求，那么就进行一次循环。现在这个客户端就能够发送信息到服务器，服务器也能发送信息给客户端。<br />
产生一个Socket，你需要三个变量：一个协议、一个socket类型和一个公共协议类型。产生一个socket有三种协议供选择，继续看下面的内容来获取详细的协议内容。]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_467.html]]></link>
<title><![CDATA[PHP实现HTML转UBB]]></title>
<author>claymore</author>
<category><![CDATA[ HTML UBB ]]></category>
<pubDate>2009-11-22</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_467.html]]></guid>
<description><![CDATA[/**<br />
* 解析HTML为UBB函数<br />
*<br />
* @param string $str 要解析的字符串<br />
* @return string<br />
*/<br />
function parse($str)<br />
{<br />
$str = str_replace(&quot;\n&quot;,'',$str);<br />
$str = preg_replace(&quot;/\&lt;A[^&gt;]+HREF=\&quot;([^\&quot;]+)\&quot;[^&gt;]*\&gt;(.*?)&lt;\/a\&gt;/i&quot;,&quot;[url=$1]$2[/url]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;font(.*?)color=\&quot;#([^ &gt;]+)\&quot;(.*?)\&gt;(.*?)&lt;\/font&gt;/i&quot;,&quot;&lt;font$1$3&gt;[color=$2]$4[/color]&lt;/font&gt;&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;font(.*?)face=\&quot;([^ &gt;]+)\&quot;(.*?)\&gt;(.*?)&lt;\/font&gt;/i&quot;,&quot;&lt;font$1$3&gt;[face=$2]$4[/face]&lt;/font&gt;&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;font(.*?)size=\&quot;([^ &gt;]+)\&quot;(.*?)\&gt;(.*?)&lt;\/font&gt;/i&quot;,&quot;[size=$2]$4[/size]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;img[^&gt;]+src=\&quot;([^\&quot;]+)\&quot;[^&gt;]*\&gt;/i&quot;,&quot;[img]$1[/img]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;DIV[^&gt;]+ALIGN=\&quot;([^\&quot;]+)\&quot;[^&gt;]*\&gt;(.*?)&lt;\/DIV\&gt;/i&quot;,&quot;[align=$1]$2[/align]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;([\/]?)u\&gt;/i&quot;,&quot;[$1u]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;([\/]?)em\&gt;/i&quot;,&quot;[$1I]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;([\/]?)strong\&gt;/i&quot;,&quot;[$1b]&quot;,$str);<br />
$str = preg_replace(&quot;/\&lt;([\/]?)b(.*?)\&gt;/i&quot;,&quot;[$1b]&quot;,$str);]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_7_466.html]]></link>
<title><![CDATA[父窗口和子窗口相互调用其内定义的Javascript函数]]></title>
<author>claymore</author>
<category><![CDATA[ 父窗口 子窗口 ]]></category>
<pubDate>2009-10-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_7_466.html]]></guid>
<description><![CDATA[你可以在子窗口中用 parent.alert(1); 测试一下子窗口调用父窗口函数的效果，<br />
也可以 document.getElementById('childwindow').contentWindow.alert(1); 测试下父窗口调用子窗口函数的效果。<br />
<br />
特别是子窗口可以通过这样关闭父窗口的层。效果不错。<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_465.html]]></link>
<title><![CDATA[MySQL select in 排序问题]]></title>
<author>claymore</author>
<category><![CDATA[ 排序 ]]></category>
<pubDate>2009-10-09</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_465.html]]></guid>
<description><![CDATA[表结构如下:<br />
mysql&gt; select * from test;<br />
+----+-------+<br />
| id | name |<br />
+----+-------+<br />
| 1 | test1 |<br />
| 2 | test2 |<br />
| 3 | test3 |<br />
| 4 | test4 |<br />
| 5 | test5 |<br />
+----+-------+<br />
<br />
执行以下SQL:<br />
mysql&gt; select * from test where id in(3,1,5);<br />
+----+-------+<br />
| id | name |<br />
+----+-------+<br />
| 1 | test1 |<br />
| 3 | test3 |<br />
| 5 | test5 |<br />
+----+-------+<br />
3 rows in set (0.00 sec)<br />
<br />
这个select在mysql中得结果会自动按照id升序排列,<br />
但是我想执行&quot;select * from test where id in(3,1,5);&quot;的结果按照in中得条件排序,即:3,1,5,<br />
<br />
想得到的结果如下:<br />
id name<br />
3 test3<br />
1 test1<br />
5 test5<br />
<br />
请问在这样的SQL在Mysql中怎么写?<br />
网上查到sqlserver中可以用order by charindex解决,但是没看到Mysql怎么解决??请高手帮忙,谢<br />
<br />
谢!<br />
<br />
select * from a order by substring_index('3,1,2',id,1);<br />
<br />
试下这个good,ls正解。<br />
<br />
<br />
order by find_in_set(id,'3,1,5')<br />
<br />
谢谢,经测试order by substring_index和order by find_in_set都可以<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_6_464.html]]></link>
<title><![CDATA[Javascript跨域和Ajax跨域解决方案]]></title>
<author>claymore</author>
<category><![CDATA[ Ajax 跨域 ]]></category>
<pubDate>2009-09-30</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_6_464.html]]></guid>
<description><![CDATA[1.什么引起了ajax跨域不能的问题<br />
ajax本身实际上是通过XMLHttpRequest对象来进行数据的交互，而浏览器出于安全考虑，不允许js代码进行跨域操作，所以会警告。<br />
<br />
2.有什么完美的解决方案么？<br />
没有。解决方案有不少，但是只能是根据自己的实际情况来选择。<br />
<br />
具体情况有:<br />
一、本域和子域的相互访问: www.aa.com和book.aa.com<br />
二、本域和其他域的相互访问: www.aa.com和www.bb.com 用 iframe<br />
三、本域和其他域的相互访问: www.aa.com和www.bb.com 用 XMLHttpRequest访问代理<br />
四、本域和其他域的相互访问: www.aa.com和www.bb.com 用 JS创建动态脚本<br />
<br />
<br />
解决方法：<br />
一、如果想做到数据的交互，那么www.aa.com和book.aa.com必须由你来开发才可以。可以将book.aa.com用iframe添加到 www.aa.com的某个页面下,在www.aa.com和iframe里面都加上document.domain = &quot;aa.com&quot;，这样就可以统一域了，可以实现跨域访问。就和平时同一个域中镶嵌iframe一样，直接调用里面的JS就可以了。(这个办法我没有尝试，不过理论可行)<br />
<br />
<br />
二、当两个域不同时,如果想相互调用，那么同样需要两个域都是由你来开发才可以。用iframe可以实现数据的互相调用。解决方案就是用 window.location对象的hash属性。hash属性就是http://domian/web/a.htm#dshakjdhsjka 里面的#dshakjdhsjka。利用JS改变hash值网页不会刷新，可以这样实现通过JS访问hash值来做到通信。不过除了IE之外其他大部分浏览器只要改变hash就会记录历史，你在前进和后退时就需要处理，非常麻烦。不过再做简单的处理时还是可以用的，具体的代码我再下面有下载。大体的过程是页面a和页面b在不同域下,b通过iframe添加到a里，a通过JS修改iframe的hash值，b里面做一个监听(因为JS只能修改hash，数据是否改变只能由b自己来判断)，检测到b的hash值被修改了，得到修改的值，经过处理返回a需要的值，再来修改a的hash值(这个地方要注意，如果a 本身是那种查询页面的话比如http://domian/web/a.aspx?id=3,在b中直接parent.window.location是无法取得数据的，同样报没有权限的错误，需要a把这个传过来，所以也比较麻烦)，同样a里面也要做监听，如果hash变化的话就取得返回的数据，再做相应的处理。]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_463.html]]></link>
<title><![CDATA[Linux下MySQL configure参数]]></title>
<author>claymore</author>
<category><![CDATA[ Linux configure ]]></category>
<pubDate>2009-09-26</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_463.html]]></guid>
<description><![CDATA[--prefix=/program/mysql     安装路径<br />
<br />
--localstatedir=/var/lib/mysql    数据库文件存放路径<br />
<br />
--with-comment=Source   <br />
<br />
--with-server-suffix=-Community<br />
<br />
--with-mysqld-user=mysql<br />
<br />
--without-debug<br />
<br />
--with-big-tables<br />
<br />
--with-charset=gbk  utf8<br />
<br />
--with-collation=gbk_chinese_ci   utf8_unicode_ci<br />
<br />
--with-extra-charsets=all<br />
<br />
--with-pthread<br />
<br />
--enable-static<br />
<br />
--enable-thread-safe-client<br />
<br />
--with-client-ldflags=-all-static<br />
<br />
--with-mysqld-ldflags=-all-static<br />
<br />
--enable-assembler<br />
<br />
--without-innodb<br />
<br />
--without-isam<br />
<br />
--without-ndb-debug<br />
<br />
--with-unix-socket-path=/home/mysql/tmp/mysql.sock<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_14_462.html]]></link>
<title><![CDATA[Linux下的Apache缓存系统]]></title>
<author>claymore</author>
<category><![CDATA[ Linux Apache 缓存 ]]></category>
<pubDate>2009-09-26</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_14_462.html]]></guid>
<description><![CDATA[Apache 从2.0开始就已经可以使用缓存模块了，不过在2.0的时候还是实验性的，到了2.2已经完全可以放心的使用。Apache 的缓存实现主要依靠 mod_cache、mod_disk_cache、mod_file_cache 及 mod_mem_cache。只需在配置编译的时候加上参数：&ndash;enable-cache、 &ndash;enable-disk-cache、&ndash;enable-file-cache、 &ndash;enable-mem-cache 即可。<br />
关于 Apache 的编译安装本文就不再说了，可以参考以前的文章。这里主要介绍一下如何配置使用 Apache 的缓存功能。<br />
具体来说，Apache 的缓存方式有两种，一种是基于硬盘文件的缓存，由 mod_disk_cache 实现，另一种是使用内存缓存，由 mod_mem_cache 实现，不过它们都是依赖 mod_cache 模块的，mod_cache 模块提供了一些缓存配置的指令供它们使用，而 mod_file_cache 模块是搭配 mod_mem_cache 模块使用的，下面分别进行介绍。<br />
<br />
<br />
1、基于硬盘文件的缓存<br />
基于硬盘文件存储的缓存由 mod_disk_cache 模块实现，先看个简单的配置例子：<br />
<br />
CacheDefaultExpire 86400<br />
<br />
CacheEnable disk /<br />
CacheRoot /tmp/apacheCache<br />
CacheDirLevels 5<br />
CacheDirLength 5<br />
CacheMaxFileSize 1048576<br />
CacheMinFileSize 10<br />
<br />
<br />
把上面的配置加到 Apache 的 httpd.conf 文件中，如果缓存相关的模块都已经编译进了 Apache 的核心，则无需加载模块，直接就能使用上面的指令。指令的详细说明如下：]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_15_461.html]]></link>
<title><![CDATA[Cannot initialize zend_mm storage [win32]]]></title>
<author>claymore</author>
<category><![CDATA[ Apache ]]></category>
<pubDate>2009-09-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_15_461.html]]></guid>
<description><![CDATA[Basically it means that you have exhausted every available thread and PHP can not start a new one. I recommend running PHP as CGI, application/x-httpd-php &ldquo;/php/php.exe&rdquo;, instead of using php5_module &ldquo;/php/sapi/php5apache2.dll&rdquo; to solve that problem. As a side note the win32 version of Apache can only handle a maximum pool of 600 threads, anything over that the threads get held in a wait proccess, no matter what ThreadLimit or Threadsperchild is set to. Yes the thread get assigned, but it not executed until the current working thread limit falls back below 600! Apache running under Win(64) or running under any version of Linux does not have those limitations.<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_460.html]]></link>
<title><![CDATA[关于Unable to load dynamic library './php_mssql.dll' 类似错误]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2009-09-25</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_460.html]]></guid>
<description><![CDATA[<div>APACHE错误日志:<br />
<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_oci8.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pdo_oci.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pdo_oci8.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pdo_pgsql.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pdo_sqlite_external.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pgsql.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_pspell.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0<br />
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\\PHP\\ext\\php_sybase_ct.dll' - \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\xa3\r\n in Unknown on line 0</div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_3_459.html]]></link>
<title><![CDATA[ZendOptimizer配置指南 ]]></title>
<author>claymore</author>
<category><![CDATA[ ZendOptimizer 配置 优化 ]]></category>
<pubDate>2009-09-23</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_3_459.html]]></guid>
<description><![CDATA[Zend Optimizer是由PHP核心引擎&ldquo;Zend&rdquo;创建者Zend技术公司所开的免费PHP优化软件。据Zend公司透露使用这个软件某些情况下至少可以提高性能30%以上！这么好的免费大餐当然要用，现在我们来谈谈如何配置这套软件。<br />
<br />
Zend Opt的安装是傻瓜化的，安装向导会自动根据你的选择来修改php.ini帮助你启动这个引擎。下面我们来介绍下Zend Opt的配置选项，帮助你最大化自定义合理的配置。下边是我所用的配置文件，看不懂也不要着急，看完本文你就会完全明白。<br />
<br />
[Zend]<br />
zend_optimizer.optimization_level=1023<br />
zend_optimizer.encoder_loader=0<br />
zend_extension_ts=&quot;C:\Program Files\Zend\lib\ZendOptimizer.dll&quot;<br />
<br />
现在我们来介绍下上边这个配置文件的含义：<br />
zend_optimizer.optimization_level 《== 优化程度，这里定义启动多少个优化过程。<br />
zend_optimizer.encoder_loader 《== 是否允许处理由Zend Encoder加密的PHP文件。<br />
zend_extension_ts 《== 优化器所在目录。<br />
<br />
优化过程 zend_optimizer.optimization_level 详细解释<br />
<br />
这里最为重点的部分，仔细看！Zend Opt总共有10个优化过程，从理论上说开的越多性能越好。当然，理论和实际永远都存在着差距。优化过程开启的越多对性能消耗也相对也越大，Zend Opt的10个优化过程并不相同也就是说效果不是平均的。Zend公司定义的最高值(High模式)为15，这里15指的是开启1-4号优化过程。当然，很多朋友并不满足于此，毕竟最高也只开启4个优化过程连总数的一半都没有。各个优化过程的对应的数字代码（值）如下：]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_458.html]]></link>
<title><![CDATA[Table 'xxxx' is marked as crashed...]]></title>
<author>claymore</author>
<category><![CDATA[ crashed ]]></category>
<pubDate>2009-09-16</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_458.html]]></guid>
<description><![CDATA[今天VODCMS的管理员反映无法登陆后台，我想可能是Apache或者数据库又出错了。<br />
<br />
重启了下Apache，正如所料想的一样，问题依旧。<br />
<br />
查看了一下数据库的表，发现有个表出错了，修复不能！<br />
<br />
Table 	Op 	Msg_type 	Msg_text<br />
vodcms.vodcms_members 	optimize 	Error 	Table '.\vodcms\vodcms_members' is marked as crash...<br />
vodcms.vodcms_members 	optimize 	Error 	Table 'vodcms_members' is marked as crashed and la...<br />
vodcms.vodcms_members 	optimize 	error 	Corrupt<br />
<br />
<br />
网上搜了搜，发现这个错误很严重，数据基本上没有了，不管用MySQL提供的修复工具还是PhpMyAdmin都修复不能，查看了下data文件夹，发现少了个*.MYD文件。<br />
<br />
所以呢，从新从网上下了个VODCMS5.0将错误的表重新创建，数据重新导入，<br />
<br />
<br />
要是错误出在其他的重要的数据表上的话问题可就严重了。<br />
<br />
记得前些时候BBS的post表也出过错，不过能修复好，要是出现这样的错误可就严重了。<br />
<br />
<br />
所以以后记得要随时备份数据库。<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_457.html]]></link>
<title><![CDATA[MySQL中把一个查询结果插入到另外一个表中 ]]></title>
<author>claymore</author>
<category><![CDATA[ mysql insert select ]]></category>
<pubDate>2009-09-16</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_457.html]]></guid>
<description><![CDATA[insert into best_quote( quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id )<br />
select quote_id, product_id, quote_type, quote_price, quote_amount, quote_time, company_id<br />
from quote<br />
where product_id = 4<br />
and quote_type = 1; <br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_15_456.html]]></link>
<title><![CDATA[关于LAMP的优化]]></title>
<author>claymore</author>
<category><![CDATA[ LAMP 优化 ]]></category>
<pubDate>2009-09-13</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_15_456.html]]></guid>
<description><![CDATA[<div><span style="font-family: Arial">Linux、Apache、MySQL 和 PHP（或 Perl）是许多 Web 应用程序的 LAMP 架构的基础。有很多基于 LAMP 组件的开源软件包可用于解决各种各样的问题。随着应用程序负载的增加，底层基础设施的瓶颈也会越来越明显，其表现形式就是响应用户请求的速度变慢。 <br />
<br />
</span><a name="N10064" target="_blank"><span style="font-family: Arial">调优 Apache </span></a></div>
<div><span style="font-family: Arial">Apache 是一种高度可配置的软件。它具有大量特性，但每一种都代价高昂。从某种程度上来说，调优 Apache 来说就是以恰当的方式分配资源，还涉及到将配置简化为仅包含必要内容。<br />
<br />
</span></div>
<div><a name="N1006E" target="_blank"><span style="font-family: Arial">配置 MPM</span></a></div>
<div><span style="font-family: Arial">Apache 是模块化的，因为可以轻松添加和移除特性。在 Apache 的核心，多处理模块（Multi-Processing Module，MPM）提供了这种模块化功能性 &mdash;&mdash; 管理网络连接、调度请求。MPM 使您能够使用线程，甚至能够将 Apache 迁移到另外一个操作系统。 </span></div>
<div><span style="font-family: Arial">每次只能有一个 MPM 是活动的，必须使用 <code>--with-mpm=<i>(worker|prefork|event)</i> </code>静态编译。</span></div>
<div><span style="font-family: Arial">每个请求使用一个进程的传统模型称为 <i>prefork</i>。较新的线程化模型称为 <i>worker</i>，它使用多个进程，每个进程又有多个线程，这样就能以较低的开销获得更好的性能。最新的 <i>event</i> MPM 是一种实验性的模型，为不同的任务使用单独的线程池。要确定当前使用的是哪种 MPM，可执行 <code>httpd -l</code>。</span></div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_15_455.html]]></link>
<title><![CDATA[Windows NT系统下的Apache性能优化]]></title>
<author>claymore</author>
<category><![CDATA[ Apache 优化 ]]></category>
<pubDate>2009-09-13</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_15_455.html]]></guid>
<description><![CDATA[一般来说，WinNT系统下使用IIS，而Apache在Linux下应用的比较多，但是依然有很多人在WinNT系统下使用Apache而非IIS，可能是基于对Windows系统的熟悉吧。今天就来说一下在Windows系统下如果优化Apache的性能。<br />
<br />
mpm_winnt.c是专门针对Windows NT优化的MPM(多路处理模块)，它使用一个单独的父进程产生一个单独的子进程，在这个子进程中轮流产生多个线程来处理请求。也就是说 mpm_winnt只能启动父子两个进程, 不能像Linux下那样同时启动多个进程。<br />
<br />
mpm_winnt主要通过ThreadsPerChild和MaxRequestsPerChild两个参数来优化Apache，下面详细来说明一下。<br />
<br />
ThreadsPerChild<br />
这个参数用于设置每个进程的线程数, 子进程在启动时建立这些线程后就不再建立新的线程了. 一方面因为mpm_winnt不能启动多个进程, 所以这个数值要足够大，以便可以处理可能的请求高峰; 另一方面该参数以服务器的响应速度为准的, 数目太大的反而会变慢。因此需要综合均衡一个合理的数值。<br />
<br />
mpm_winnt上的默认值是64, 最大值是1920. 这里建议设置为100-500之间，服务器性能高的话值大一些，反之值小一些。<br />
<br />
MaxRequestsPerChild<br />
该参数表示每个子进程能够处理的最大请求数, 即同时间内子进程数目.设置为零表示不限制, mpm_winnt上的默认值就是0.]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_46_454.html]]></link>
<title><![CDATA[Duplicate entry '' for key 1 的错误解决]]></title>
<author>claymore</author>
<category><![CDATA[ ]]></category>
<pubDate>2009-09-11</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_46_454.html]]></guid>
<description><![CDATA[今天学校BBS抽风，刚Apache出了小问题解决了，没过几分钟又出问题了，这下是无法回帖。<br />
<br />
用httpwatcher看看了，发现是数据库出错了，出现了 Duplicate entry 'xxxxxxxxxx' for key 1的错误，网上搜了搜，确定是表索引数据结构坏掉了，应该修复一下，使用MYSQL自带的myisamchk工具，MYSQL带的工具都很多并且比较实用，不过都是字符界面的。<br />
<br />
<br />
<img width="691" height="459" src="/userfiles/image/2009/09/11/fckeditor_20090911022852.png" alt="" /><br />
<br />
<br />
问题解决了。<br />
<br />]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_14_453.html]]></link>
<title><![CDATA[Linux系统信息查看命令大全]]></title>
<author>claymore</author>
<category><![CDATA[ Linux 系统信息 命令 ]]></category>
<pubDate>2009-09-09</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_14_453.html]]></guid>
<description><![CDATA[<div><strong>系统</strong></div>
<pre>
# uname -a               # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue   # 查看操作系统版本
# cat /proc/cpuinfo      # 查看CPU信息
# hostname               # 查看计算机名
# lspci -tv              # 列出所有PCI设备
# lsusb -tv              # 列出所有USB设备
# lsmod                  # 列出加载的内核模块
# env                    # 查看环境变量</pre>
<div><strong>资源</strong></div>
<pre>
# free -m                # 查看内存使用量和交换区使用量
# df -h                  # 查看各分区使用情况
# du -sh &lt;目录名&gt;        # 查看指定目录的大小
# grep MemTotal /proc/meminfo   # 查看内存总量
# grep MemFree /proc/meminfo    # 查看空闲内存量
# uptime                 # 查看系统运行时间、用户数、负载
# cat /proc/loadavg      # 查看系统负载</pre>
<div><strong>磁盘和分区</strong></div>
<pre>
# mount | column -t      # 查看挂接的分区状态
# fdisk -l               # 查看所有分区
# swapon -s              # 查看所有交换分区
# hdparm -i /dev/hda     # 查看磁盘参数(仅适用于IDE设备)
# dmesg | grep IDE       # 查看启动时IDE设备检测状况</pre>
<div><strong>网络</strong></div>
<pre>
# ifconfig               # 查看所有网络接口的属性
# iptables -L            # 查看防火墙设置
# route -n               # 查看路由表
# netstat -lntp          # 查看所有监听端口
# netstat -antp          # 查看所有已经建立的连接
# netstat -s             # 查看网络统计信息</pre>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_15_452.html]]></link>
<title><![CDATA[Apache配置文件httpd.conf]]></title>
<author>claymore</author>
<category><![CDATA[ Apache 配置 httpd.conf ]]></category>
<pubDate>2009-09-09</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_15_452.html]]></guid>
<description><![CDATA[<div><b><font size="5">原文说明</font></b></div>
<ul>
    <li>引自www.linuxsir.org</li>
    <li>原文地址：<a title="http://www.7880.com/Info/Article-3df0ef00.html" rel="nofollow" href="http://www.7880.com/Info/Article-3df0ef00.html" target="_blank">http://www.7880.com/Info/Article-3df0ef00.html</a></li>
</ul>
<div><b><font size="5"><br />
文件全局说明</font></b></div>
<div>基于 NCSA 服务的配置文件。这是Apache服务器主要配置文件。它包含服务器的影响服务器运行的配置指令。参见&lt;URL:<a title="http://httpd.ache.org/doc-2.0/" rel="nofollow" href="http://httpd.ache.org/doc-2.0/" target="_blank">http://httpd.ache.org/doc-2.0/</a>&gt;以取得关于这些指令的详细信息</div>
<div>不要只是简单的阅读这些指令信息而不去理解它。这里只是做了简单的说明，如果你没有参考在线文件，你就会被警告。</div>
<div>这些配置指令被分为下面三个部分： 1. 控制整个Apache服务器行为的部分(即全局环境变量) 2. 定义主要或者默认服务参数的指令，也为所有虚拟主机提供默认的设置参数 3. 虚拟主机的设置参数</div>
<div>配置和日志文件名：如果你指定的文件名以&ldquo;/&rdquo;开始(win32下以&ldquo;dirver:/&rdquo;)，服务器将使用绝对路径，如果文件名不是以&ldquo;/&rdquo;开始的，那么它将把ServerRoot 的值附加在文件名的前面，例如，对&ldquo;logs/foo.log&quot;，如果ServerRoot的值为&ldquo;/usr/local/apache2&rdquo;，则该文件应为&ldquo;/usr/local/apache2/logs/foo.log&rdquo;</div>
]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_14_451.html]]></link>
<title><![CDATA[Linux查看磁盘空间]]></title>
<author>claymore</author>
<category><![CDATA[ 磁盘空间 ]]></category>
<pubDate>2009-09-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_14_451.html]]></guid>
<description><![CDATA[<strong>一、df 命令</strong><br />
<br />
df 是来自于coreutils 软件包，系统安装时，就自带的；我们通过这个命令可以查看磁盘的使用情况以及文件系统被挂载的位置；<br />
<br />
举例：<br />
<br />
[root@localhost beinan]# df -lh<br />
<br />
Filesystem 容量 已用 可用 已用% 挂载点<br />
<br />
/dev/hda8 11G 6.0G 4.4G 58% /<br />
<br />
/dev/shm 236M 0 236M 0% /dev/shm<br />
<br />
/dev/sda1 56G 22G 35G 39% /mnt/sda1<br />
<br />
我们从中可以看到,系统安装在/dev/hda8 ；还有一个56G的磁盘分区/dev/sda1挂载在 /mnt/sda1中；<br />
<br />
其它的参数请参考 man df<br />
<br />
<br />
<br />
<strong>二、fdsik</strong><br />
<br />
fdisk 是一款强大的磁盘操作工具，来自util-linux软件包，我们在这里只说他如何查看磁盘分区表及分区结构；参数 -l ，通过-l 参数，能获得机器中所有的硬盘的分区情况；<br />
<br />
[root@localhost beinan]# fdisk -l<br />
<br />
Disk /dev/hda: 80.0 GB, 80026361856 bytes<br />
<br />
255 heads, 63 sectors/track, 9729 cylinders<br />
<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
<br />
Device Boot Start End Blocks Id System<br />
<br />
/dev/hda1 * 1 765 6144831 7 HPFS/NTFS<br />
<br />
/dev/hda2 766 2805 16386300 c W95 FAT32 (LBA)<br />
<br />
/dev/hda3 2806 7751 39728745 5 Extended<br />
<br />
/dev/hda5 2806 3825 8193118+ 83 Linux<br />
<br />
/dev/hda6 3826 5100 10241406 83 Linux]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_6_450.html]]></link>
<title><![CDATA[再次遇到Ajax数据提交问题 - &amp;]]></title>
<author>claymore</author>
<category><![CDATA[ Ajax 问题 解决 ]]></category>
<pubDate>2009-09-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_6_450.html]]></guid>
<description><![CDATA[以前自己写AJAX程序池的时候也遇到过,然后使用JQUERY后以为它内部会处理这种显而易见的问题,结果没有,今天才发现还得自己处理。<br />
<br />
这个问题就是当提交的数据中包含特殊的字符如'&amp;'时，数据就会被截断。<br />
<br />
这里必须要使用encodeURIComponent对数据进行编码，后台脚本接收到的数据才会是完整的！<br />
<br />
<br />
var form=$(&quot;#music_add_form&quot;);<br />
var elements = form.find('input[type=text],input[type=hidden],input[checked],select');<br />
var post_data='';<br />
elements.each(function(){<br />
post_data+=&quot;&amp;&quot;+$(this).attr('name')+&quot;=&quot;+encodeURIComponent($(this).val());<br />
});]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_14_449.html]]></link>
<title><![CDATA[proftpd-1.3安装配置]]></title>
<author>claymore</author>
<category><![CDATA[ proftpd ]]></category>
<pubDate>2009-09-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_14_449.html]]></guid>
<description><![CDATA[<div id="zoomtext">
<div>安装环境：<br />
操作系统centos-5.2<br />
mysql 5.0.67 源代码安装在/usr/local/mysql目录</div>
<div>1、proftpd-1.3.1源代码编译安装<br />
<br />
./configure --prefix=/usr/local/proftpd \<br />
--with-modules=mod_sql:mod_sql_mysql \ #支持mysql数据库<br />
--with-modules=mod_quotatab:mod_quotatab_sql \ #支持磁盘配额<br />
--with-modules=mod_tls \ #支持SSL/TLS安全传输<br />
--with-includes=/usr/local/mysql/include \<br />
--with-libraries=/usr/local/mysql/lib<br />
make <br />
make install<br />
<br />
cp sample-configurations/mod_sql.conf /usr/local/proftpd/etc/proftpd.conf<br />
<br />
2、proftpd.conf文件配置基本格式：<br />
<br />
#全局设置<br />
设置项目1 参数1<br />
设置项目2 参数2<br />
&hellip;&hellip;<br />
&hellip;&hellip;<br />
#某个目录的设置<br />
&lt;Directory &quot;路径名&quot;&gt;<br />
&hellip;&hellip;<br />
&hellip;&hellip;<br />
&lt;/Directory&gt;<br />
#关于匿名用户的设置<br />
&lt;Anonymous &quot;匿名登录的目录&quot;&gt;<br />
&hellip;&hellip;<br />
&hellip;&hellip;<br />
&lt;Limit 限制动作&gt;<br />
&hellip;&hellip;<br />
&hellip;&hellip;<br />
&lt;/Limit&gt;<br />
&lt;/Anonymous&gt;<br />
<br />
3、proftpd.conf配置文件中的一些基本配置：<br />
<br />
ServerName 服务器名称<br />
ServerType 服务器工作类型(standalone/inted)<br />
DefaultServer 是否启用虚拟FTP (on/off)<br />
Port 运行端口<br />
Umask 默认文件权限(022)<br />
User 运行proftpd服务器的用户<br />
Group 运行proftpd服务器的用户组<br />
AllowOverwrite 是否允许客户端覆盖文件(安全上一般设置为off)<br />
RequireValidShell 用户shell不在/etc/shells文件中，默认不允许登陆(on/off)<br />
MaxInstances 20 最多有20个proftpd的PID<br />
MaxClients 10 最多允许10个用户在线<br />
MaxClientsPerHost 1 一个IP只允许一个帐号连接<br />
MaxClientsPerUser 2 每个帐号在每个客户端最多同时登陆2次，可防止多线程下载软件<br />
DisplayLogin welcome.msg ftp登陆欢迎信息文件<br />
&lt;Directory /*&gt; 登入时想进入的目录位置(/* 为通配符)<br />
&lt;Anonymous ~ftp&gt; 匿名用户设置<br />
&lt;Global&gt; 所有虚拟ftp的共同设置项<br />
<br />
3.1 虚拟FTP设置<br />
&lt;VirtualHost 192.168.0.1&gt;<br />
ServerName &quot;&hellip;&hellip;&quot;<br />
&hellip;&hellip;<br />
&hellip;&hellip;<br />
&lt;/VitualHost&gt;<br />
<br />
3.2 开启ftp上传/下载的续传功能<br />
AllowStoreRestart on #上传<br />
AllowRetrieveRestart on #下载<br />
<br />
3.3 限速设置<br />
<br />
格式为： TransferRate STOR|RETR 速度(kbytes/s) user 使用者 <br />
STOR 为上传速度<br />
RETR 为下载速度<br />
后面不跟user的时候，针对全部用户进行限速<br />
<br />
3.4 让proftpd支持FXP传输<br />
AllowForeignAddress on<br />
PassivePorts 40000 40999 <br />
<br />
3.5 加快连接速度，关闭DNS反解<br />
UseReverseDNS off<br />
IdentLookups off<br />
<br />
3.6 只允许部分网段访问FTP<br />
&lt;Limit LOGIN&gt;<br />
Order allow,deny<br />
Allow from 10.10.<br />
Deny from all<br />
&lt;/Limit&gt;<br />
<br />
4、&lt;Limit&gt;参数说明</div>
</div>]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_1_448.html]]></link>
<title><![CDATA[2003应用程序错误事件487、3299]]></title>
<author>claymore</author>
<category><![CDATA[ ZendOptimizer Apache ]]></category>
<pubDate>2009-09-08</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_1_448.html]]></guid>
<description><![CDATA[最近学校的BBS每两天当一次，刚开始没注意，最近频繁了，仔细查看了下日志，今天早上出现了两个错误，一个是Zend Optimizer的487错误，一个是Apache的3299错误。<br />
<br />
事件 ID ( 487 )的描述(在资源( Zend Optimizer )中)无法找到。本地计算机可能没有必要的注册信息或消息 DLL 文件来从远程计算机显示消息。您可能可以使用 /AUXSOURCE= 标识来检索词描述；查看帮助和支持以了解详细信息。下列信息是事件的一部分: Unable to view file mapping, 试图访问无效的地址。<br />
<br />
在网上搜了搜，估计是目录的权限问题，于是做了以下操作，修改了C:\Windows\Temp的权限，允许Network Service进行读取和运行的权限；另外修改了php.ini，php.ini文件中设置upload_tmp_dir = &quot;C:\Windows\Temp\&quot;，原来这个upload_tmp_dir 是没有设置的，查看了一下php.ini，居然很多东西没有配置，估计是前任的师兄用的是phpStudy配套PHP配置环境，所以安装后都没进行什么配置，出问题也是难怪的。<br />
<br />
<br />
The Apache service named reported the following error:<br />
&gt;&gt;&gt; httpd.exe: Could not reliably determine the server's fully qualified domain name, using 202.115.144.85 for ServerName .<br />
<br />
有关更多信息，请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。<br />
<br />
这个是Apache错误3299的错误提示，这个错误在昨天给LINUX远程安装Apache的时候也遇到过，就是server name没有设置。于是打开httpd.conf设置 ServerName 202.115.144.81:80，这下问题应该解决了。另外查看了一下这个配置文件，发现还是一些地方没设置好，修改了监听端口为]]></description>
</item>
<item>
<link><![CDATA[http://claymore.phpme.info/index.php/view_14_447.html]]></link>
<title><![CDATA[RedHat5下Apache+MySQL+PHP的安装]]></title>
<author>claymore</author>
<category><![CDATA[ Linux Apache iptables ]]></category>
<pubDate>2009-09-07</pubDate>
<guid><![CDATA[http://claymore.phpme.info/index.php/view_14_447.html]]></guid>
<description><![CDATA[<span style="font-family: Arial;"><span style="font-size: large;"><span style="color: rgb(255, 0, 0);">1.Apache的安装</span></span></span><br />
<br />
今天帮点击音乐网写完了在LINUX下的资源采集,顺便安装了HTTP服务器,使用的是APACHE，不过安装过程还是挺郁闷的(通过winscp远程连接LINUX在终端下安装)。<br />
<br />
首先下载了一个*.tar.gz包，<br />
<br />
# tar -zxvf httpd-2.2.6.tar.gz<br />
<br />
# cd httpd-2.2.6/<br />
# ./configure --prefix=/usr/local/apache --sysconfdir=/etc/httpd --enable-so<br />
<br />
//这里的&mdash;prefix指定apache的安装将安装到：/usr/local/apache目录下，--sysconfdir指定apache配置文件httpd.conf安装到：/etc/httpd目录下。（这两个路径可以自己任意指定指定，但是自己一定要在安装时记清楚，因为这个路径后面还要用到）<br />
<br />
另外一些模块的启用也应该在这里configure的时候指定，比如说 <br />
--enable-cache&nbsp; --enable-disk-cache&nbsp; --enable-file-cache&nbsp; --enable-mem-cache<br />
<br />
# make<br />
<br />
# make install<br />
<br />
如果不出意外的话，successful!<br />
<br />
启动运行apache:<br />
<br />
# /usr/local/apache/bin/apachectl start<br />
<br />
然后在本机浏览器里面输入：http://127.0.0.1，回车，默认会显示：it works字样，证明apache已经在工作状态中了。<br />
<br />
<br />
一般安装就上面的过程，不过在START的时候出现了个错误 Could not reliably determine the server's fully qualified domain name ，解决方法是只要把/conf/httpd.conf文件的#ServerName 前的#去掉就好了。 <br />
<br />
最后在start，没有问题，但是客户端还是无法访问，我想不是配置问题就是防火墙问题，首先检查是否是防火墙问题，的确是。<br />
<br />
/root$ ps<br />
PID TTY TIME CMD<br />
1 ? 00:00:00 init<br />
2 ? 00:00:00 migration/0<br />
3 ? 00:00:00 ksoftirqd/0<br />
4 ? 00:00:00 migration/1<br />
5 ? 00:00:00 ksoftirqd/1<br />
6 ? 00:00:00 migration/2<br />
7 ? 00:00:00 ksoftirqd/2<br />
8 ? 00:00:00 migration/3<br />
9 ? 00:00:00 ksoftirqd/3<br />
10 ? 00:00:00 events/0<br />
11 ? 00:00:00 events/1<br />
12 ? 00:00:00 events/2<br />
13 ? 00:00:00 events/3<br />
14 ? 00:00:00 khelper<br />
15 ? 00:00:00 kacpid<br />
50 ? 00:00:00 kblockd/0<br />
51 ? 00:00:00 kblockd/1<br />
52 ? 00:00:00 kblockd/2<br />
53 ? 00:00:00 kblockd/3<br />
63 ? 00:00:00 pdflush<br />
64 ? 00:00:00 pdflush<br />
66 ? 00:00:00 aio/0<br />
67 ? 00:00:00 aio/1<br />
68 ? 00:00:00 aio/2<br />
69 ? 00:00:00 aio/3<br />
54 ? 00:00:00 khubd<br />
65 ? 00:00:08 kswapd0<br />
142 ? 00:00:00 kseriod<br />
213 ? 00:00:00 scsi_eh_0<br />
229 ? 00:00:00 kjournald<br />
507 ? 00:00:00 minilogd<br />
1004 ? 00:00:00 udevd<br />
1325 ? 00:00:00 kauditd<br />
1423 ? 00:00:00 kmirrord<br />
1424 ? 00:00:00 kmir_mon<br />
1477 ? 00:00:00 kjournald<br />
1478 ? 00:00:00 kjournald<br />
1479 ? 00:00:00 kjournald<br />
1747 ? 00:00:00 sshd<br />
1776 ? 00:00:00 xinetd<br />
1794 ? 00:00:00 crond<br />
11728 ? 00:00:00 sshd<br />
29433 ? 00:00:00 httpd<br />
29470 ? 00:00:00 sshd<br />
29472 ? 00:00:00 sftp-server<br />
29490 ? 00:00:00 sshd<br />
29492 ? 00:00:00 bash<br />
29521 ? 00:00:00 ps<br />
/root$ ps<br />
PID TTY TIME CMD<br />
1 ? 00:00:00 init<br />
2 ? 00:00:00 migration/0<br />
3 ? 00:00:00 ksoftirqd/0<br />
4 ? 00:00:00 migration/1<br />
5 ? 00:00:00 ksoftirqd/1<br />
6 ? 00:00:00 migration/2<br />
7 ? 00:00:00 ksoftirqd/2<br />
8 ? 00:00:00 migration/3<br />
9 ? 00:00:00 ksoftirqd/3<br />
10 ? 00:00:00 events/0<br />
11 ? 00:00:00 events/1<br />
12 ? 00:00:00 events/2<br />
13 ? 00:00:00 events/3<br />
14 ? 00:00:00 khelper<br />
15 ? 00:00:00 kacpid<br />
50 ? 00:00:00 kblockd/0<br />
51 ? 00:00:00 kblockd/1<br />
52 ? 00:00:00 kblockd/2<br />
53 ? 00:00:00 kblockd/3<br />
63 ? 00:00:00 pdflush<br />
64 ? 00:00:00 pdflush<br />
66 ? 00:00:00 aio/0<br />
67 ? 00:00:00 aio/1<br />
68 ? 00:00:00 aio/2<br />
69 ? 00:00:00 aio/3<br />
54 ? 00:00:00 khubd<br />
65 ? 00:00:08 kswapd0<br />
142 ? 00:00:00 kseriod<br />
213 ? 00:00:00 scsi_eh_0<br />
229 ? 00:00:00 kjournald<br />
507 ? 00:00:00 minilogd<br />
1004 ? 00:00:00 udevd<br />
1325 ? 00:00:00 kauditd<br />
1423 ? 00:00:00 kmirrord<br />
1424 ? 00:00:00 kmir_mon<br />
1477 ? 00:00:00 kjournald<br />
1478 ? 00:00:00 kjournald<br />
1479 ? 00:00:00 kjournald<br />
1747 ? 00:00:00 sshd<br />
1776 ? 00:00:00 xinetd<br />
1794 ? 00:00:00 crond<br />
11728 ? 00:00:00 sshd<br />
29433 ? 00:00:00 httpd<br />
29470 ? 00:00:00 sshd<br />
29472 ? 00:00:00 sftp-server<br />
29490 ? 00:00:00 sshd<br />
29492 ? 00:00:00 bash<br />
29522 ? 00:00:00 ps<br />
/root$ setup<br />
TERM environment variable needs set.<br />
/root$ Firmware<br />
-bash: line 11: Firmware: command not found<br />
/root$ service iptables on<br />
Usage: /etc/init.d/iptables {start|stop|restart|condrestart|status|panic|save}<br />
/root$ service iptables off<br />
Usage: /etc/init.d/iptables {start|stop|restart|condrestart|status|panic|save}<br />
/root$ /etc/init.d/iptables stop<br />
Flushing firewall rules: [ OK ]<br />
Setting chains to policy ACCEPT: filter [ OK ]<br />
Unloading iptables modules: [ OK ]<br />
<br />
<br />
这样就OK了，客户端也能正常访问了。<br />
<br />
<br />
PS：<br />
<br />
<span style="color: rgb(255, 0, 0);">linux 下 apache启动、停止、重启命令</span><br />
基本的操作方法：<br />
本文假设你的apahce安装目录为/usr/local/apache2，这些方法适合任何情况<br />
<br />
apahce启动命令：<br />
推荐/usr/local/apache2/bin/apachectl start apaceh启动<br />
<br />
apache停止命令<br />
/usr/local/apache2/bin/apachectl stop 停止<br />
<br />
apache重新启动命令：<br />
/usr/local/apache2/bin/apachectl restart 重启<br />
<br />
要在重启 Apache 服务器时不中断当前的连接，则应运行：<br />
<br />
/usr/local/sbin/apachectl graceful<br />
<br />
如果apache安装成为linux的服务的话，可以用以下命令操作：<br />
<br />
service httpd start 启动<br />
<br />
service httpd restart 重新启动<br />
<br />
service httpd stop 停止服务 <br />
<br />
<br />
<br />
<span style="color: rgb(255, 0, 0);">如果你想一开机就让apache自动运行的话，那么进行如下操作：</span><br />
<br />
编辑etc/rc.d/rc.local<br />
<br />
# vi /etc/rc.d/rc.local<br />
<br />
在最后加上一句： /usr/local/apache/bin/apachectl start<br />
<br />
看这里的/usr/local/apache的安装路径用到了吧，所以大家装的时候一定要记清楚哦。。。。<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Arial;"><span style="font-size: large;"><span style="color: rgb(255, 0, 0);">2.MySQL的安装</span></span></span><br />
<br />
<br />
用tar.gz的文件安装，也就是那个样子，重要的是注意./configure的时候<br />
<br />
./configure \<br />
<div style="margin-left: 40px;">&quot;--prefix=/usr/local/mysql&quot; \<br />
&quot;--localstatedir=/data/mysql/data&quot; \<br />
&quot;--with-comment=Source&quot; \<br />
&quot;--with-server-suffix=-Linuxtone.Org&quot; \<br />
&quot;--with-mysqld-user=mysql&quot; \<br />
&quot;--without-debug&quot; \<br />
&quot;--with-big-tables&quot; \<br />
&quot;--with-charset=gbk&quot; \<br />
&quot;--with-collation=gbk_chinese_ci&quot; \<br />
&quot;--with-extra-charsets=all&quot; \<br />
&quot;--with-pthread&quot; \<br />
&quot;--enable-static&quot; \</div>
]]></description>
</item>
</channel>
</rss>