<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>撒旦 &#187; PHP</title>
	<atom:link href="http://blog.xnux.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xnux.net</link>
	<description>still life ...</description>
	<lastBuildDate>Wed, 06 Jan 2010 18:34:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>整理一下lighttpd+php在iPhone上的安装的方法</title>
		<link>http://blog.xnux.net/2009/04/03/iphone_lighttpd_php5_mysql5/</link>
		<comments>http://blog.xnux.net/2009/04/03/iphone_lighttpd_php5_mysql5/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 02:34:57 +0000</pubDate>
		<dc:creator>Jack.f</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[开发]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[mod_fastcgi]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.xnux.net/?p=83</guid>
		<description><![CDATA[&#62; Win32使用putty，linux和mac osx使用ssh连接到iPhone;
&#62; 安装php和lighttpd;
apt-get update; apt-get install php; apt-get install lighttpd
&#62; 创建布署目录;
mkdir -p /var/www/htdocs
&#62; 修改lighttpd配置;
vi /usr/local/etc/lighttpd.conf
修改:
server.document-root = "/var/www/htdocs"
server.modules = ( "mod_fastcgi" )
server.tag = "lighttpd 1.4.18/PHP 5.2.8 (cgi-fcgi)"   #此处可以随意填写
server.pid-file = "/var/run/lighttpd.pid"
index-file.names = ( "index.php", "index.py", "index.html", "index.htm" ) #根据自己需要填写
static-file.exclude-extensions = ( ".php", ".fcgi", ".cgi", ".py" )
 fastcgi.map-extensions = ( ".php3"=&#62;".php" )
 fastcgi.server = (
    ".php"=&#62;((
       [...]]]></description>
			<content:encoded><![CDATA[<p>&gt; Win32使用putty，linux和mac osx使用ssh连接到iPhone;</p>
<p>&gt; 安装php和lighttpd;</p>
<blockquote><p>apt-get update; apt-get install php; apt-get install lighttpd</p></blockquote>
<p>&gt; 创建布署目录;</p>
<blockquote><p>mkdir -p /var/www/htdocs</p></blockquote>
<p>&gt; 修改lighttpd配置;</p>
<blockquote><p>vi /usr/local/etc/lighttpd.conf</p>
<p>修改:</p>
<p>server.document-root = "<span style="color: #ff0000;">/var/www/htdocs</span>"<br />
server.modules = ( <span style="color: #ff0000;">"mod_fastcgi"</span> )<br />
server.tag = "<span style="color: #ff0000;">lighttpd 1.4.18/PHP 5.2.8 (cgi-fcgi)</span>"   #此处可以随意填写<br />
server.pid-file = "<span style="color: #ff0000;">/var/run/lighttpd.pid</span>"<br />
index-file.names = (<span style="color: #ff0000;"> "index.php", "index.py", "index.html", "index.htm"</span> ) #根据自己需要填写<br />
static-file.exclude-extensions = ( <span style="color: #ff0000;">".php"</span>, ".fcgi", ".cgi", ".py" )<br />
<span style="color: #ff0000;"> fastcgi.map-extensions = ( ".php3"=&gt;".php" )</span><br />
<span style="color: #ff0000;"> fastcgi.server = (<br />
    ".php"=&gt;((<br />
        "host"=&gt;"127.0.0.1",<br />
        "port"=&gt;9000,<br />
        "broken-scriptfilename"=&gt;"enable",<br />
        "fix-root-scriptname"=&gt;"enable"<br />
    ))<br />
)</span><br />
cgi.assign = (<br />
     ".py" =&gt; "/usr/bin/python"  # 如果安装python的话，可以考虑添加这行<br />
)</p>
<p>#其它保持不变<br />
memetype.assign ...</p></blockquote>
<p>&gt; 运行;</p>
<blockquote><p>php-cgi -b 127.0.0.1:9000 &amp;</p>
<p>lighttpd -f /usr/local/etc/lighttpd.conf &amp;</p></blockquote>
<p>&gt; 测试;</p>
<blockquote><p>echo "&lt;?php phpinfo(); ?&gt;" &gt; /var/www/htdocs/info.php</p>
<p>打开safari，输入地址 http://localhost/info.php</p></blockquote>
<p> </p>
<p>以上操作必备条件，jb过的iPhone，已经安装unix subsystem，mobile terminal，cydia，openssl，openssh。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnux.net/2009/04/03/iphone_lighttpd_php5_mysql5/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有用的formatString,支持Actionscript1.0</title>
		<link>http://blog.xnux.net/2008/01/25/actionscript_formatstring/</link>
		<comments>http://blog.xnux.net/2008/01/25/actionscript_formatstring/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 16:28:28 +0000</pubDate>
		<dc:creator>Jack.f</dc:creator>
				<category><![CDATA[开发]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[formatString]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[printf]]></category>
		<category><![CDATA[string.Format]]></category>

		<guid isPermaLink="false">http://blog.xnux.net/2008/01/25/%e6%9c%89%e7%94%a8%e7%9a%84formatstring%e6%94%af%e6%8c%81actionscript10/</guid>
		<description><![CDATA[有用过C#, C/C++, PHP的人都应该知道string.Format或者printf吧! 下面我们让AS也有这样的功能. 什么? 没听说过 ... 拖出去TJJ ...
&#160;
var formatString = function&#40;m&#41;
&#123;
  if &#40;m.indexOf&#40;&#34;{&#34;&#41;==-1&#41; return m;
  var r=&#34;&#34;,n=&#34;&#34;;
  for&#40;var i=0;i&#60;m.length;i++&#41;
  &#123;
    if &#40;m.charAt&#40;i&#41;==&#34;{&#34;&#41;
    &#123;
      i++;
      for&#40;n=&#34;&#34;;m.charAt&#40;i&#41;!=&#34;}&#34;;i++&#41;
        n+=m.charAt&#40;i&#41;;
   [...]]]></description>
			<content:encoded><![CDATA[<p>有用过C#, C/C++, PHP的人都应该知道string.Format或者printf吧! 下面我们让AS也有这样的功能. 什么? 没听说过 ... 拖出去TJJ ...</p>
<pre class="actionscript">&nbsp;
<span style="color: #000000; font-weight: bold;">var</span> formatString = <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span>m<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>m.<span style="color: #0066CC;">indexOf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;{&quot;</span><span style="color: #66cc66;">&#41;</span>==<span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #b1b100;">return</span> m;
  <span style="color: #000000; font-weight: bold;">var</span> r=<span style="color: #ff0000;">&quot;&quot;</span>,n=<span style="color: #ff0000;">&quot;&quot;</span>;
  <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> i=<span style="color: #cc66cc;">0</span>;i&lt;m.<span style="color: #0066CC;">length</span>;i++<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>m.<span style="color: #0066CC;">charAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>==<span style="color: #ff0000;">&quot;{&quot;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
      i++;
      <span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span>n=<span style="color: #ff0000;">&quot;&quot;</span>;m.<span style="color: #0066CC;">charAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>!=<span style="color: #ff0000;">&quot;}&quot;</span>;i++<span style="color: #66cc66;">&#41;</span>
        n+=m.<span style="color: #0066CC;">charAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
      <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">isNaN</span><span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
      <span style="color: #66cc66;">&#123;</span>
        r+=<span style="color: #ff0000;">&quot;{&quot;</span>;
        i-=n.<span style="color: #006600;">length</span><span style="color: #cc66cc;">+1</span>;
        <span style="color: #b1b100;">continue</span>;
      <span style="color: #66cc66;">&#125;</span>
      i++;
      r+=<span style="color: #0066CC;">arguments</span><span style="color: #66cc66;">&#91;</span><span style="color: #0066CC;">parseInt</span><span style="color: #66cc66;">&#40;</span>n<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">+1</span><span style="color: #66cc66;">&#93;</span>;
    <span style="color: #66cc66;">&#125;</span>
    r += m.<span style="color: #0066CC;">charAt</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
  <span style="color: #b1b100;">return</span> r;
<span style="color: #66cc66;">&#125;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/* usage:
var model = &quot;&lt;font size='{2}'&gt;&lt;b&gt;{0}&lt;/b&gt;+&lt;b&gt;{1}&lt;/b&gt;=&lt;b&gt;{0}&lt;/b&gt;&lt;/font&gt;&quot;;
var str = formatString(model, 100, 0, 9);
trace(str);
// output: &lt;font size='9'&gt;&lt;b&gt;100&lt;/b&gt;+&lt;b&gt;0&lt;/b&gt;=&lt;b&gt;100&lt;/b&gt;&lt;/font&gt;
*/</span> 就这么简单, 如果觉得不爽, 你可以继续使用:
<span style="color: #000000; font-weight: bold;">var</span> str = <span style="color: #ff0000;">&quot;&lt;font size='&quot;</span><span style="color: #cc66cc;">+9</span>+<span style="color: #ff0000;">&quot;'&gt;&lt;b&gt;&quot;</span><span style="color: #cc66cc;">+100</span>+<span style="color: #ff0000;">&quot;&lt;/b&gt;+&lt;b&gt;&quot;</span><span style="color: #cc66cc;">+0</span>+<span style="color: #ff0000;">&quot;&lt;/b&gt;=&lt;b&gt;&quot;</span><span style="color: #cc66cc;">+100</span>+<span style="color: #ff0000;">&quot;&lt;/b&gt;&lt;/font&gt;&quot;</span>;
<span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span>... 狂呕中 ...
&nbsp;</pre>
<p><strong>顺便说一句: </strong>函数体不用修改, 直接拿到html里当Javascript使, 也可以</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xnux.net/2008/01/25/actionscript_formatstring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
