<?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>邪罗刹的菠萝阁</title>
	<atom:link href="http://www.rainmoe.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rainmoe.com</link>
	<description>One code, one world ...</description>
	<lastBuildDate>Thu, 29 Dec 2011 14:04:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>为 Nginx 安装多站点的 uWSGI 支持；凶残的 IMG 标签</title>
		<link>http://www.rainmoe.com/2011/12/29/install-uwsgi-on-nginx/</link>
		<comments>http://www.rainmoe.com/2011/12/29/install-uwsgi-on-nginx/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 12:34:22 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.rainmoe.com/?p=2327</guid>
		<description><![CDATA[前天晚上小邪折腾了一晚上 Python，因为小邪现在 VPS 的 Webserver 环境是由 Linux + Nginx（前端）+ Apache（解析PHP）+ Mysql + PHP + Memcached，而这次折腾的目的就是想把 Python 的 Webserver 组合到 Nginx 里面一起运行。

小邪查看了一些资料，发现 uWsgi 是目前效率灰常不错的 Python 应用容器服务器，并且可以通过 uwsgi 协议和 Nginx 协调工作。所以就果断开始折腾，目前已经搞定，请大家通过 Yui.im 传送门进行围观。

<span class="readmore"><a href="http://www.rainmoe.com/2011/12/29/install-uwsgi-on-nginx/" title="为 Nginx 安装多站点的 uWSGI 支持；凶残的 IMG 标签">阅读全文——共3402字</a></span>]]></description>
			<content:encoded><![CDATA[<p>前天晚上小邪折腾了一晚上 Python，因为小邪现在 VPS 的 Webserver 环境是由 Linux + Nginx（前端）+ Apache（解析PHP）+ Mysql + PHP + Memcached，而这次折腾的目的就是想把 Python 的 Webserver 组合到 Nginx 里面一起运行。</p>
<p>小邪查看了一些资料，发现 uWsgi 是目前效率灰常不错的 Python 应用容器服务器，并且可以通过 uwsgi 协议和 Nginx 协调工作。所以就果断开始折腾，目前已经搞定，请大家通过 <a href="http://yui.im" target="_blank">Yui.im</a> 传送门进行围观。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0003105.png" alt="" title="CapE0003105" width="600" height="352" class="alignnone size-full wp-image-2330" /></p>
<p><span id="more-2327"></span><strong>一. 为 Nginx 安装多站点的 uWsgi (Python) 支持：</strong></p>
<p>以下都属于 SSH Bash 下的操作以及代码，小邪就直接用代码高亮 + 注释贴出来了喔 W(￣w￣)W。注意，/home/py 是小邪的 Python 虚拟环境根目录，/home/py/yui-im 是小邪用于测试的虚拟环境目录，这两个地址以及 yui-im yui.im 字符串请大家按照自己的需要修改，现在可以点击此传送门查看小邪的 hello world - <a href="http://yui.im/" target="_blank">http://yui.im/</a></p>
<pre class="brush: bash; title: ; notranslate">
#首先小邪要升级 Python，不需要的童鞋请跳过
wget http://python.org/ftp/python/2.7.2/Python-2.7.2.tar.bz2
tar jxvf Python-2.7.2.tar.bz2
cd Python-2.7.2
./configure
make &amp;&amp; make install
mv /usr/bin/python /usr/bin/python.bak #备份原文件
ln -s /usr/local/bin/python2.7 /usr/bin/python
python -V #查看目前系统默认 Python 的版本
</pre>
<pre class="brush: bash; title: ; notranslate">
#然后安装python下的安装管理器
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

#安装Vitualenv（Python的虚拟环境，像虚拟机一样的）
easy_install virtualenv
mkdir /home/py/ #小邪用 /home/py/ 作为虚拟环境根目录
virtualenv --no-site-package /home/py/yui-im
#yui-im 文件夹作为本次测试用的单独虚拟环境文件存放地址
cd /home/py/yui-im/bin
source activate #激活此虚拟环境

#在激活的虚拟环境中安装bottle web框架
pip install bottle
#用于在最后测试安装是否成功
</pre>
<pre class="brush: bash; title: ; notranslate">
#安装uWsgi
wget http://projects.unbit.it/downloads/uwsgi-0.9.9.3.tar.gz
#最新版本可见 http://projects.unbit.it/uwsgi/wiki/WikiStart#Getit

tar zxvf uwsgi-0.9.9.3.tar.gz
cd uwsgi-0.9.9.3
make #不用install

#移动一下安装位置方便使用
mkdir /usr/local/uwsgi
cp uwsgi /usr/local/uwsgi
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- 此文件是 uwsgi 虚拟主机的配置文件，就像 nginx 下的 vhost 一样 --&gt;
&lt;uwsgi&gt;
	&lt;socket&gt;127.0.0.1:4040&lt;/socket&gt;
	&lt;module&gt;[WSGI Script (index)]&lt;/module&gt;
	&lt;limit-as&gt;256&lt;/limit-as&gt;
	&lt;harakiri&gt;30&lt;/harakiri&gt;
	&lt;processes&gt;8&lt;/processes&gt;
	&lt;master /&gt;
	&lt;memory-report/&gt;
	&lt;vhost/&gt;
	&lt;no-site/&gt;
	&lt;logto&gt;/home/logs/yui-im.log&lt;/logto&gt;
&lt;/uwsgi&gt;
&lt;!-- 将此文件保存到 /root/yui-im.xml --&gt;
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;!-- 以下内容保存为 yui-im.conf 放入 nginx 的 vhost 文件夹 --&gt;
server
	{
		listen 80;
		charset utf-8;
		server_name yui.im www.yui.im;

		location / {
			include uwsgi_params;
			uwsgi_pass 127.0.0.1:4040;
			uwsgi_param UWSGI_PYHOME /home/py/yui-im;
			uwsgi_param UWSGI_CHDIR /home/py/yui-im;
			uwsgi_param UWSGI_SCRIPT index;
			}

		access_log off;
	}
</pre>
<pre class="brush: python; title: ; notranslate">
#以下内容保存为 /home/py/yui-im/index.py
from bottle import route, run, default_app

@route('/')
def index():
    return &quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;Hello World&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Hello world lol ...&lt;/body&gt;&lt;/html&gt;&quot;

if __name__ == &quot;__main__&quot;:
    run(host=&quot;localhost&quot;, port=8888)
else:
    application = default_app()
</pre>
<pre class="brush: bash; title: ; notranslate">
#最后reload一下nginx。
#接着启动uwsgi，以下命令可以放到 /etc/rc.local 里面开机启动
/usr/local/uwsgi/uwsgi -x /root/yui-im.xml
</pre>
<p><strong>二. 凶残的 IMG 标签：</strong></p>
<p>请直接查看下面的代码与注释，这种用法有好处也有坏处。好处是可以用在 Single Sign On 单点登录系统的同步登录与退出，这样可以直接在同一个页面内对多个站点进行 GET 操作。坏处是如果拿来恶作剧的话就蛋疼了，以下第一行是用法，第二行是例子。例子里面的 URL 是 BILIBILI 站点的登出 URL，如果你浏览了某个包含下面第二行代码的网页，就会立即登出 BILIBILI，大家可以想像如果用在坏处就杯具了。</p>
<p>不过理论上 PHP 里应该可以防护这种攻击，有兴趣的童鞋可以去研究一下。</p>
<pre class="brush: xml; title: ; notranslate">
&lt;img src=&quot;请求URL&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;

&lt;img src=&quot;http://member.bilibili.tv/logout&quot; width=&quot;1&quot; height=&quot;1&quot; /&gt;
</pre>
<p><strong>三. 尾记：</strong></p>
<p>小邪折腾了一晚上安装 uＷsgi，一直都提示错误 application not found 找不到应用。最后一看 index.py 第一行，from 写成 form 了。<br />
顿时一口老血喷在显示器上。</p>
<pre class="brush: plain; title: ; notranslate">
//错误日志，嗯嗯，错误日志是好东西啊
SyntaxError: invalid syntax
unable to load app mountpoint=yui.im|
yui.im {address space usage: 14065664 bytes/13MB} {rss usage: 4268032 bytes/4MB} [pid: 4400|app: -1|req: -1/10] 220.255.1.84 () {50 vars in 840 bytes} [Wed Dec 28 00:51:23 2011] GET / =&gt; generated 48 bytes in 2 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)
  File &quot;/home/py/yui-im/index.py&quot;, line 1
    form bottle import route, run, default_app
              ^
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/12/29/install-uwsgi-on-nginx/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
		</item>
		<item>
		<title>强行卸载设备；iTunes找不到设备问题；迅雷假死问题；Cipher</title>
		<link>http://www.rainmoe.com/2011/12/21/i-know-the-title-is-so-long/</link>
		<comments>http://www.rainmoe.com/2011/12/21/i-know-the-title-is-so-long/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 18:20:52 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.rainmoe.com/?p=2311</guid>
		<description><![CDATA[　　此文包含一个强行卸载系统提示 “正在使用中” 设备的小工具，一个iTunes 提示找不到设备（设备连接后没反应）的解决方法，一个迅雷假死的解决办法（Win7），以及小邪玩 Gamemastertips.com　的黑客游戏用 Python + C#.Net 来解密的代码和心得。



一. 强行卸载系统提示 “正在使用中” 设备的小工具：

<span class="readmore"><a href="http://www.rainmoe.com/2011/12/21/i-know-the-title-is-so-long/" title="强行卸载设备；iTunes找不到设备问题；迅雷假死问题；Cipher">阅读全文——共2351字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　此文包含一个强行卸载系统提示 “正在使用中” 设备的小工具，一个iTunes 提示找不到设备（设备连接后没反应）的解决方法，一个迅雷假死的解决办法（Win7），以及小邪玩 Gamemastertips.com　的黑客游戏用 Python + C#.Net 来解密的代码和心得。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/IMG_1513.jpg" alt="" title="IMG_1513" width="600" height="325" class="alignnone size-full wp-image-2317" /></p>
<p><span id="more-2311"></span><strong>一. 强行卸载系统提示 “正在使用中” 设备的小工具：</strong></p>
<p>　　小邪从去年到今年坏了3块移动硬盘了，2块 Hitachi 320GB/1.5TB，1块 WD Element 750GB。简直是杯具啊。后来小邪发现比这三块还要早买的用的频率也要高一些的 WD Passport 1TB 移动硬盘一点事儿也木有。对比使用过程小邪发现除了这一块小邪有特别注意要移除设备之后再从USB上拔掉以外，其他几块只要提示设备正在使用中，小邪都会直接拔掉。直接拔掉的时候硬盘还在运转中。</p>
<p>　　不知道是神马邪恶的进程正在使用这些可怜的移动硬盘 ( ﹁ ﹁ ) ，而且基本上不管怎么等或者尝试关闭 Explorer.exe 都木有效果，所以最后小邪就果断拔掉了 (￣▽￣")。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002893.jpg" alt="" title="CapE0002893" width="600" height="399" class="alignnone size-full wp-image-2314" /></p>
<p>　　看样子是因为木有等硬盘停转才拔掉的原因。所以小邪找到一款可以强行移除正在使用中的设备的小工具，相当给力。</p>
<p>　　下载传送门 - <a href="http://code.google.com/p/evlosbox/downloads/detail?name=%E6%8A%A4U%E4%BD%BF%E8%80%85.zip&#038;can=2&#038;q=" target="_blank">http://code.google.com/p/evlosbox/downloads/detail?name=%E6%8A%A4U%E4%BD%BF%E8%80%85.zip&#038;can=2&#038;q=</a></p>
<p><strong>二. iTunes 提示找不到设备（设备连接后没反应）的解决方法：</strong></p>
<p>　　可能是人品问题 ( ﹁ ﹁ )，小邪最近经常碰到把APPLE设备连到电脑上后 iTunes 一点同步的反应的木有的情况，然后小邪发现重装 iTunes 就好了。但是 iTunes 挺大的，所以有时候在想是不是可以只装一部分，后来偶尔鼠标右键点到了 iTunes64Setup.exe 发现可以用 Winrar 解压（喔(￣O￣)，伟大的Winrar），解压之后文件如下。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002894.jpg" alt="" title="CapE0002894" width="600" height="243" class="alignnone size-full wp-image-2315" /></p>
<p>　　一看 AppleMobileDeviceSupport64.msi 的文件名就知道这个是设备驱动程序，所以小邪运行它，然后选择修复安装，之后设备又可以正常被识别和同步了喔 o(*￣▽￣*)，虽然过几天还是要修复一下 (￣_￣|||)。</p>
<p><strong>三. 迅雷假死的解决办法（Win7）：</strong></p>
<p>　　最近小邪的迅雷天天假死（已经可以肯定小邪的人品有问题了 (ˇˍˇ），最近那么杯具），不知道肿么回事。反正后来好像在迅雷客服论坛上看到说是把缓存调低一点就好了。小邪顿时内牛满面，给多一些缓存用丫还不干了 (⊙o⊙)。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002896.jpg" alt="" title="CapE0002896" width="600" height="396" class="alignnone size-full wp-image-2316" /></p>
<p>　　所以此问题的解决办法就是把最大缓存调低，３２ＭＢ差不多了。</p>
<p><strong>四. Gamemastertips.com 的解密闯关游戏：</strong></p>
<p>　　昨天小邪开始玩 <a href="http://www.gamemastertips.com" target="_blank">Gamemastertips.com</a> 的解密闯关游戏，刚刚到第八关，其中有需要把二进制ASCII转换为英文字母的解密过程，所以小邪就用 Python 写了一小段代码，嘿嘿，作为 Python 的初学者，咱得勤于练习才好。</p>
<pre class="brush: python; title: ; notranslate">
def binaryAsciiToChar(binary):
    blen = len(binary)
    for i in range(0, blen, 8):
        if i+8&gt; blen:
            break
        print chr(int(binary[i: i+8], 2)),

binaryAsciiToChar(r'要被转换的二进制ASCII码放这里，然后用IDLE或者Bush运行就好咯')

#下面代码则是从字符串转回二进制。

def charToBinaryAscii(data):
    blen = len(data)
    for i in range(0, blen):
        print bin(ord(data[i: i+1])),

charToBinaryAscii('要被转换的字符串')
</pre>
<p>　　同样的，如果用 C#.Net 来转换的话，代码如下。参考，可见 MSDN 上的 <a href="http://msdn.microsoft.com/zh-cn/library/5bdb6693.aspx" target="_blank">Byte类型</a> - <a href="http://msdn.microsoft.com/zh-cn/library/128fhstt.aspx" target="_blank">Convert.ToByte 方法 (Int16)</a> - <a href="http://msdn.microsoft.com/zh-cn/library/4wxkt09k.aspx" target="_blank">Convert.ToInt16 方法 (String, Int32)</a> - <a href="http://msdn.microsoft.com/zh-cn/library/system.text.encoding.getstring.aspx" target="_blank">Encoding.GetString 方法</a>。</p>
<pre class="brush: csharp; title: ; notranslate">
private void button1_Click(object sender, EventArgs e)
{
	string source = textBox1.Text;
	string res = &quot;&quot;;

	for (int i = 0; i &lt; source.Length / 8; i++)
		res += Convert.ToChar(Convert.ToInt16(source.Substring(i * 8, 8), 2));

	textBox2.Text = res;
}

//下面代码则是从字符串转回二进制。

private void button2_Click(object sender, EventArgs e)
{
	string source = textBox1.Text;
	string res = &quot;&quot;;

	for (int i = 0; i &lt; source.Length; i++)
		res += Convert.ToString(Convert.ToChar(source.Substring(i, 1)), 2).PadLeft(8, '0');

	textBox2.Text = res;
}
</pre>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002901.png" alt="" title="CapE0002901" width="600" height="361" class="alignnone size-full wp-image-2318" /></p>
<p>　　编译好的 C#.Net 的 Exe 程序下载传送门 - <a href="http://code.google.com/p/evlosbox/downloads/detail?name=BinaryAscii2Str%20r0.exe&#038;can=2&#038;q=" target="_blank">http://code.google.com/p/evlosbox/downloads/detail?name=BinaryAscii2Str%20r0.exe&#038;can=2&#038;q=</a></p>
<p>　　本来还想等写完 Objective-C 的程序再发布此文章的，不过今天有点晚了，想想还是先发了后面再补吧。预览图。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/iphone00187tgb.jpg" alt="" title="iphone00187tgb" width="600" height="480" class="alignnone size-full wp-image-2319" /></p>
<p>　　小邪要碎觉鸟 (～﹃～) ~ 。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/12/21/i-know-the-title-is-so-long/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>错误 HOOK 函数；小邪又回来了；博客是良师益友</title>
		<link>http://www.rainmoe.com/2011/12/18/i-am-back/</link>
		<comments>http://www.rainmoe.com/2011/12/18/i-am-back/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 07:17:52 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.rainmoe.com/?p=2304</guid>
		<description><![CDATA[　　好久不见，小邪又回来了「杯具，已经需要用“又”了 ( ﹁ ﹁ ) 」。接着上一篇文章，小邪到了新加坡，读 Database Engineering（数据库工程）专业。目前刚完成了 HTML+JAVASCRIPT 的基础课程，虽然小邪早就能熟练使用 HTML 了，但是对 JAVASCRIPT 的基础性学习让小邪把 TWITTER 的 BIO 里面的「Javascript恐惧症患者」果断删除，(￣y▽￣)╭ Ohohoho，看来重学基础也不是坏事。



　　OK，对代码木有兴趣的童鞋请直接跳转到尾记；对代码木有兴趣但是蛋疼想要继续读的童鞋挺住；喜欢代码的童鞋请无视此行 lol。

<span class="readmore"><a href="http://www.rainmoe.com/2011/12/18/i-am-back/" title="错误 HOOK 函数；小邪又回来了；博客是良师益友">阅读全文——共2453字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　好久不见，小邪又回来了「杯具，已经需要用“又”了 ( ﹁ ﹁ ) 」。接着上一篇文章，小邪到了新加坡，读 Database Engineering（数据库工程）专业。目前刚完成了 HTML+JAVASCRIPT 的基础课程，虽然小邪早就能熟练使用 HTML 了，但是对 JAVASCRIPT 的基础性学习让小邪把 TWITTER 的 BIO 里面的「Javascript恐惧症患者」果断删除，(￣y▽￣)╭ Ohohoho，看来重学基础也不是坏事。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/587.jpg" alt="" title="587" width="600" height="390" class="alignnone size-full wp-image-2309" /></p>
<p><span id="more-2304"></span>　　OK，对代码木有兴趣的童鞋请直接跳转到尾记；对代码木有兴趣但是蛋疼想要继续读的童鞋挺住；喜欢代码的童鞋请无视此行 lol。</p>
<p><strong>一. 错误HOOK Wp_enqueue_script 函数导致后台页面错位：</strong></p>
<p>　　在functions.php里面，小邪用如下的方式载入 comments-ajax.js （Willin写的AJAX方式提交评论的JS）。</p>
<pre class="brush: php; title: ; notranslate">
add_action('init','ev_script_add');

function ev_script_add(){
	wp_enqueue_script('ajaxcq',get_template_directory_uri().'/comments-ajax.js');
}
</pre>
<p>　　用这个方法载入此 JS 文件，会同时出现在后台页面，结果就导致页面错位了。（如图）</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002841.jpg" alt="" title="CapE0002841" width="600" height="335" class="alignnone size-full wp-image-2305" /></p>
<p><strong>二. Wp_enqueue_script 函数：</strong></p>
<p>　　后来小邪查看了ＷＰ官方文档，其中举例说明如果要替换ＷＰ自带的ｊｑｕｅｒｙ函数，用如下代码即可。</p>
<pre class="brush: php; title: ; notranslate">
function my_scripts_method() {
    wp_deregister_script('jquery'); //禁止加载WP自带的jquery函数库
    wp_register_script('jquery','http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js');
    //注册新的函数库地址
    wp_enqueue_script('jquery'); //加载新的函数库
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
</pre>
<p>　　代码中HOOK my_scripts_method 函数到了 wp_enqueue_scripts 上面。看来这就是问题所在了。</p>
<p><strong>三. 问题所在与解决方案：</strong></p>
<pre class="brush: php; title: ; notranslate">
add_action('init','ev_script_add');

function ev_script_add(){
	wp_enqueue_script('ajaxcq',get_template_directory_uri().'/comments-ajax.js');
}
</pre>
<p>　　之前小邪是参照 iLost 1.0.6 模板中的 functions.php 里面挂载模板自带 JS 的方法，代码如上。直接 hook 到 init 上面，但是这样就会导致后台也加载此 JS 文件，导致页面错位。</p>
<p>　　正确的加载方式如下，hook 函数到 wp_enqueue_scripts 上即可。</p>
<pre class="brush: php; title: ; notranslate">
add_action('wp_enqueue_scripts','ev_script_add');
</pre>
<p>　　<em>[Updated @2011-12-20 16:40 GMT+8]</em> 据 <a href="http://kayosite.com/" target="_blank">Kayo</a> 童鞋补充，HOOK 到 wp_head 上也可以的。</p>
<p>　　了解更多调戏 wp_enqueue_script 函数的方法，请点击此传送门 - <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script" target="_blank">http://codex.wordpress.org/Function_Reference/wp_enqueue_script</a></p>
<p><strong>四. 尾记：</strong></p>
<p>　　话说小邪在新加坡的生活挺平淡的，新加坡地方小，所以和土地有关的东西都很贵。所以基本上也没啥可以玩的地方，话说小邪最近也木有精力跑到马来西亚去 ( ﹁ ﹁ )。但是这对小邪并没有什么坏处，这导致小邪一天到晚往图书馆跑，最近读了很多不同的书，读得有深有浅，但是好处大大滴有 o(*￣▽￣*)。然后其他的活动就只有宿舍楼下的游泳池了（新加坡这里基本上每个小区都有游泳池）。所以不管是对学习还是健康，小邪来新加坡之后都是很有好处的。</p>
<p>　　毕竟原先在荷兰天气寒冷，也没有啥适合运动（跑步的话会被风干的 - =）或学习（图书馆里大部分都是荷兰语书）的地方。</p>
<p>　　新加坡这里的学校一般是每三个月放一个月的假，平常有节假日也就一天两天的样子。现在整个 12 月都是小邪的假期。</p>
<p>　　前半个月小邪完全放松了８天之后，看了３天的书，后面５天在为荷兰的一个公司做个网站，预览图如下。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002761.jpg" alt="" title="CapE0002761" width="600" height="430" class="alignnone size-full wp-image-2306" /></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/12/CapE0002770.jpg" alt="" title="CapE0002770" width="600" height="430" class="alignnone size-full wp-image-2307" /></p>
<p>　　这算是终稿了，人家也蛮喜欢的嘿嘿。</p>
<p>　　接下来就是学习的日子了，前几个月的学校上课之余，小邪在图书馆看的书里面其中就有 C# .Net 的书和 Python 的书。虽然有涉及 LISP RubyOnRails NodeJS 之类的，但是毕竟小邪也不是超人，所以咱打算先搞定 C# .Net 和 Python。后面小邪会写一些相关的东西，因为小邪对比无博客学习和使用博客学习法之后，发现博客学习法真的相当实用喔。</p>
<p><strong>五. 尾记之后的博客学习法：</strong></p>
<p>　　（咱随便取个名字 xD，好像木有见过其他人命名或者定义这个方法）</p>
<p>　　1) 小邪发现“能够教别人”和“仅仅自己熟练”比起来，“能够教别人”对知识的熟练度的要求要更高一些。以前有位老师和小邪说过，自己学会了什么并不代表能够把它教给别人。所以小邪希望自己的知识能够达到“能够教别人”的熟练度，写博客是很好的一个衡量的方法。</p>
<p>　　2) 小邪写文章的时候，每次查看文章中的语法错误的同时，能发现很多代码上的错误，或者知识上的错误。这恰恰达到了很多书中建议学习之后要多次反省的要求（没有写博客之前，小邪依然不是很理解学习后反省的意思 >_<）。所以小邪可以很自豪地说：从写博到现在从未出现过语法错误。</p>
<p>　　3) 坚持写博客，有时候就算没有东西写，这个习惯反而能督促小邪去学点新东西然后拿来写。</p>
<p>　　博客真的是良师益友。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/12/18/i-am-back/feed/</wfw:commentRss>
		<slash:comments>74</slash:comments>
		</item>
		<item>
		<title>走遍荷兰，无限期离开荷兰；战略性转移计划启动</title>
		<link>http://www.rainmoe.com/2011/10/22/what-is-next/</link>
		<comments>http://www.rainmoe.com/2011/10/22/what-is-next/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 19:20:32 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.rainmoe.com/blog/?p=2293</guid>
		<description><![CDATA[　　刚才看到 Hzlzh 的留言，小邪觉得很温馨 DwD。没想到那么长时间木有更新还有盆友来看小邪。因为发生了很多事情，所以小邪突然想写写自己的近况。

　　最新情况是，小邪会坐明天荷兰时间 21 点左右的飞机，从荷兰的 Amsterdam 飞到新加坡，单程票。



<span class="readmore"><a href="http://www.rainmoe.com/2011/10/22/what-is-next/" title="走遍荷兰，无限期离开荷兰；战略性转移计划启动">阅读全文——共1811字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　刚才看到 <a href="http://zlz.im/" target="_blank">Hzlzh</a> 的留言，小邪觉得很温馨 DwD。没想到那么长时间木有更新还有盆友来看小邪。因为发生了很多事情，所以小邪突然想写写自己的近况。</p>
<p>　　最新情况是，小邪会坐明天荷兰时间 21 点左右的飞机，从荷兰的 Amsterdam 飞到新加坡，单程票。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/10/IMG_2897.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2295" /></p>
<p><span id="more-2293"></span><strong>一. 从暑假开始之后发生的事情：</strong></p>
<p>　　(￣w￣）话说之前小邪写了一篇《<a href="http://www.rainmoe.com/2011/06/24/final/" target="_blank">最后，果然还是想做自己喜欢做的事情呐</a>》的文章，因为当时经过努力，荷兰这边小邪在读学校的 IT 学院部门 Coordinator（课程主管）已经答应小邪可以转专业从 IBMS（国际工商管理）转入 IT 学院。而且他们还发了一封信给小邪，热烈欢迎小邪的加入。接着又给小邪一大堆课程资料，让小邪可以提前做一些准备。没有什么比可以做自己喜欢的事情更好了。然后小邪就开开心心回国度暑假去了。</p>
<p>　　接着过了６天舒服的日子。就收到了一封电子邮件，告诉小邪说：“因为招收不到足够的学生，所以 IT 部门面向外国学生的课程已经全部取消了，你自己另寻出路吧。”</p>
<p>　　。。。。。。</p>
<p>　　然后无奈的，只好告诉学校把小邪放到 Financial &#038; Control（金融与控制）课程中去，而不是回去继续读 IBMS，因为小邪觉得最少也必须发生一些改变才行。</p>
<p>　　这就是为什么，暑假开始之后小邪又散散地更新了几篇博文，接着又开始从博客上消失鸟。</p>
<p><strong>二. 试图掌控自己的人生：</strong></p>
<p>　　之后小邪选择的是接受现实。然后开始准备系统性学习金融、投资与股票。看了一些书，一直不断告诉自己应该放弃 IT，自己喜欢的是金融，IT 什么的糟透了。</p>
<p>　　但是做自己不喜欢做的事情真的太难受了。</p>
<p>　　所以过了一个月之后，小邪开始寻找另外一个可以学习 IT 的地方。荷兰是一个很美丽的国家，整个欧洲的风景也很让人难忘。但是这里不适合小邪学习 IT。首先目前小邪有效的学历只有高中，所以没有办法读所有的研究类大学，剩下的只有两家学校可以学 IT，当然其中一家就是之前小邪提到的目前在读的学校，而另外一家学校十分不给力，所以荷兰不行。其他的欧洲国家其实也半斤八两，而且附近多是少数语种的国家，必须要学会讲德语、意大利语、法语或者西班牙语之类的才能去学习，所以欧洲也不行。</p>
<p>　　美国和日本或许会是小邪 IT 的终点，所以不会是中途要去的地方。</p>
<p>　　那么剩下的地方就是新加坡了。</p>
<p>　　所以小邪申请了新加坡的一所英国威尔士大学与牛津布鲁克斯大学合作开办的私立学校，开始办手续。</p>
<p><strong>三. 走遍荷兰：</strong></p>
<p>　　然后小邪回到荷兰，走遍了整个荷兰偏僻的、著名的、大大小小的城市。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/10/MG_2592.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2298" /></p>
<p>　　小邪没有去美术馆、博物馆之类的地方。仅仅是走过荷兰的沙石路、水泥路、石砖路、铺满落叶的泥土路，沿着细小的河、湍急的河、宽广的河、安静的河，坐一坐公园的长木椅，看着周围的那些忙碌的人、悠闲的人、急匆匆的人、疲惫的人、毫无目的的人。然后去看海，沿着海岸线，走过静寂的毫无一人的偏僻的海滩、走过有热闹的数不清的游人的海滩，脱掉鞋子走进海水、捡一些贝壳、在沙子上踩一些脚印，然后坐在沙滩上等待日落再离开。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/10/MG_3044.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2297" /></p>
<p>　　因为小邪觉得很重要很深刻的文化底蕴早已经和人们的行为、和大大小小的建筑、和街上卖的东西、和小邪一切能看到的景象融合在一起了。</p>
<p>　　重要的东西总会留下来，不需要博物馆的保护。不重要的东西，没有必要去看。没有被发现的重要的东西，就交给那些历史学家和研究人员吧。</p>
<p>　　因为这次的离去的确让人很舍不得，这样的心情让小邪并没有详细记述自己到的地方与看过的事物，有时候连相机也没有带在身上。就像刚刚说的一样，重要的东西总会被留下来，以后小邪会发一些回忆分享给大家。</p>
<p><strong>四. 下一站 - 新加坡：</strong></p>
<p>　　那么小邪本体的战略性转移计划的下一步就是新加坡了。</p>
<p>　　新加坡是小邪从未到过的地方，所以明天之后的一切都是未知。让我们拭目以待。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/10/CapE0001885.png" alt="" title="" width="600" height="400" class="alignnone size-full wp-image-2296" /></p>
<p><strong>五. 尾记：</strong></p>
<p>　　小邪已经把幽灵域和菠萝阁从 imevlos.com 和 evlos.org 转移到 rainmoe.com。</p>
<p>　　之后小邪打算把 /blog 从子目录迁移到 / 根目录，感觉大家进来以后还要点一次鼠标才能看到小邪的博客实在是太蛋疼的事情了 - -。然后考虑把用户管理系统整合到牛奶蛋程序，或者作为独立的系统放到 yuicard.com。不久以后请使用 http://www.rainmoe.com/ 来访问小邪的菠萝阁，麻烦链接小邪的朋友修改一下链接地址，谢谢。</p>
<p>　　现在时间是荷兰时间 21:29 21/10/2011 周五。飞机的时间是明天晚上荷兰时间 9 点（中国及新加坡时间第二天凌晨 3 点）。回头见。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/10/22/what-is-next/feed/</wfw:commentRss>
		<slash:comments>109</slash:comments>
		</item>
		<item>
		<title>WP插件：WP Nndim Show v1.00 与非插件版发布；照片2张</title>
		<link>http://www.rainmoe.com/2011/08/24/wp-nndim-show-v100/</link>
		<comments>http://www.rainmoe.com/2011/08/24/wp-nndim-show-v100/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 22:11:30 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2286</guid>
		<description><![CDATA[　　话说小邪看着侧边栏上面的 Twitter 插件感觉很给力，而且展示自己上传到牛奶蛋的图片的途径应该方便一些，所以想想干脆也弄一个显示牛奶蛋图片的侧边栏插件好了。本来昨天写好的，就是今天有些事情就发得迟了一点 ╮(╯_╰)╭。



一. WP Nndim Show v1.00：

<span class="readmore"><a href="http://www.rainmoe.com/2011/08/24/wp-nndim-show-v100/" title="WP插件：WP Nndim Show v1.00 与非插件版发布；照片2张">阅读全文——共1609字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　话说小邪看着侧边栏上面的 Twitter 插件感觉很给力，而且展示自己上传到牛奶蛋的图片的途径应该方便一些，所以想想干脆也弄一个显示牛奶蛋图片的侧边栏插件好了。本来昨天写好的，就是今天有些事情就发得迟了一点 ╮(╯_╰)╭。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000612.png" alt="" title="" width="600" height="424" class="alignnone size-full wp-image-2287" /></p>
<p><span id="more-2286"></span><strong>一. WP Nndim Show v1.00：</strong></p>
<p>　　下载传送门 @GoogleCode - <a href="http://code.google.com/p/evlosbox/downloads/detail?name=wp-nndim-show%20v1.00.zip&#038;can=2&#038;q=" target="_blank">http://code.google.com/p/evlosbox/downloads/detail?name=wp-nndim-show%20v1.00.zip</a></p>
<p>　　WP官方传送门 - <a href="http://wordpress.org/extend/plugins/wp-nndim-show/" target="_blank">http://wordpress.org/extend/plugins/wp-nndim-show/</a></p>
<p><strong>二. 非插件版：</strong></p>
<p>　　由于<a href="http://xlolix.com/" target="_blank">玻璃柠檬</a>童鞋不使用小挂件，所以小邪特地为他量身（按照各种XXOO部位的尺寸 (*￣w￣*)）定做定制了非插件版，把下面这段代码复制到主题文件 sidebar.php 适当的位置就可以了喔。由于下面代码是为 Neutral 主题定制的，所以其他主题如果要用的话，请自行修改一下，很简单的，一般修改前两行就好。或者牛奶蛋用户可以找小邪专门定制 o(*￣▽￣*)ゞ。</p>
<p>　　Demo - <a href="http://www.rainmoe.com/apps/wordpress/?themedemo=neutral" target="_blank">http://www.rainmoe.com/apps/wordpress/?themedemo=neutral</a></p>
<pre class="brush: jscript; title: ; notranslate">
 &lt;div class=&quot;side_box&quot;&gt;
  &lt;h3 class=&quot;side_title&quot;&gt;NND.im&lt;/h3&gt;
  &lt;ul&gt;
   &lt;?php
   require_once(ABSPATH . WPINC . '/rss-functions.php');
   $rss = wp_cache_get('nndim_rss','nndim');
   if ($rss == false) {
    $rss = fetch_rss('http://nnd.im/rss/1');
    wp_cache_set('nndim_rss',$rss,'nndim',300);
   }
   $rss-&gt;items = array_slice($rss-&gt;items, 0, 4);
   foreach ($rss-&gt;items as $item )
   echo '&lt;li style=&quot;float:left;border:1px solid #DDD;padding:1px;height:120px;width:120px;margin:8px 4px 4px 0;&quot;&gt;&lt;a href=&quot;'.$item['link'].'&quot; title=&quot;'.$item['title'].'&quot;&gt;'.$item['thumb'].'&lt;/a&gt;&lt;/li&gt;';
	?&gt;
  &lt;/ul&gt;
  &lt;div style=&quot;clear:both;&quot;&gt;&lt;/div&gt;
 &lt;/div&gt;
</pre>
<p><strong>三. 使用与设置说明：</strong></p>
<p>　　插件版的同学开启插件之后，请到后台的小挂件设置里面，把牛奶蛋ＷＰ小挂件那个部件拖到侧边栏上面即可。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000616.png" alt="" title="" width="600" height="331" class="alignnone size-full wp-image-2288" /></p>
<p>　　小邪暂时就不做后台面板了，参数设置也挺简单的，修改一下插件代码中以下部分即可。</p>
<pre class="brush: jscript; title: ; notranslate">
wp_cache_set('nndim_rss',$rss,'nndim',300);
//缓存时间是 300 秒

$rss-&gt;items = array_slice($rss-&gt;items, 0, 4);
//显示图片数量为 4，最大为10
</pre>
<p>　　啊啊，对了，这个缓存使用的是 WP 自带的 Object 缓存，具体的效果受 WP 缓存插件影响 \(*￣w￣*)。正常情况下应该是每 5 分钟更新一次滴。</p>
<p><strong>四. 尾记：</strong></p>
<p>　　又发照片咯，这两张是前两天拍的，现在荷兰在下大雨的说。话说荷兰一般下雨都不打雷的，这次难得打了几声蛮大的的，惊得可怜滴小邪在被窝里面发抖（才怪 ( ﹁ ﹁ )。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1206.jpg" alt="" title="IMG_1206" width="600" height="375" class="alignnone size-full wp-image-2289" /></p>
<p><span class="inside_imgdesc">花与蜘蛛 ~ 牛奶蛋照片页面传送门 - <a href="http://nnd.im/276" target="_blank">http://nnd.im/276</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1354.jpg" alt="" title="IMG_1354" width="600" height="375" class="alignnone size-full wp-image-2290" /></p>
<p><span class="inside_imgdesc">荷兰的天空 ~ 牛奶蛋照片页面传送门 - <a href="http://nnd.im/277" target="_blank">http://nnd.im/277</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/24/wp-nndim-show-v100/feed/</wfw:commentRss>
		<slash:comments>113</slash:comments>
		</item>
		<item>
		<title>回到荷兰鸟，拍了一些微距照片，晒晒 o(*￣▽￣*)ゞ</title>
		<link>http://www.rainmoe.com/2011/08/21/550d/</link>
		<comments>http://www.rainmoe.com/2011/08/21/550d/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 13:08:48 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2273</guid>
		<description><![CDATA[　　这些照片是在小邪荷兰的宿舍附近拍的，这个宿舍离学校灰常远，骑车得骑 40 分钟，但是风景很不错，其他宿舍就不给力鸟。原图的话，请通过下面图片下部的传送门传送到 {牛奶蛋}，之后在图片查看页面底部的查看原图处有链接，点进去可以获取 1920x1200 px 的大图。o(*￣▽￣*)ゞ。



牛奶蛋照片页面传送门 - http://nnd.im/251

<span class="readmore"><a href="http://www.rainmoe.com/2011/08/21/550d/" title="回到荷兰鸟，拍了一些微距照片，晒晒 o(*￣▽￣*)ゞ">阅读全文——共470字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　这些照片是在小邪荷兰的宿舍附近拍的，这个宿舍离学校灰常远，骑车得骑 40 分钟，但是风景很不错，其他宿舍就不给力鸟。原图的话，请通过下面图片下部的传送门传送到 {牛奶蛋}，之后在图片查看页面底部的查看原图处有链接，点进去可以获取 1920x1200 px 的大图。o(*￣▽￣*)ゞ。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1203_.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2285" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/251" target="_blank">http://nnd.im/251</a></span></p>
<p><span id="more-2273"></span><strong>一. 一些微距照片：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1231.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2274" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/241" target="_blank">http://nnd.im/241</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1339.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2282" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/249" target="_blank">http://nnd.im/249</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1338.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2281" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/248" target="_blank">http://nnd.im/248</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1337.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2280" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/247" target="_blank">http://nnd.im/247</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1326.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2279" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/246" target="_blank">http://nnd.im/246</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1325.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2278" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/245" target="_blank">http://nnd.im/245</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1313.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2277" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/244" target="_blank">http://nnd.im/244</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1304.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2276" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/243" target="_blank">http://nnd.im/243</a></span></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/IMG_1302.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2275" /></p>
<p><span class="inside_imgdesc">牛奶蛋照片页面传送门 - <a href="http://nnd.im/242" target="_blank">http://nnd.im/242</a></span></p>
<p><strong>二. 尾记：</strong></p>
<p>　　话说照片果然还是微距给力（← 其实这家伙拍微距以外的东西各种杯具 ( ﹁ ﹁ )。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/21/550d/feed/</wfw:commentRss>
		<slash:comments>99</slash:comments>
		</item>
		<item>
		<title>WP插件：水淹菠萝阁 v1.00 Alpha（CPU 燃烧的远征</title>
		<link>http://www.rainmoe.com/2011/08/12/wp-flooded-v1-0-0-alpha/</link>
		<comments>http://www.rainmoe.com/2011/08/12/wp-flooded-v1-0-0-alpha/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 11:34:04 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[作品 [Work]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2270</guid>
		<description><![CDATA[　　嘿嘿，话说小邪从上篇文章《CSS+jQuery实现随滚动条增减的汽水瓶中的液体》与玻璃柠檬童鞋聊天的时候，获得了一个点子，所以今天就完成了这个插件 水淹菠萝阁 WP-Flooded v1.00，目前还是 Alpha 版本，鉴于目前的 WordPress 主题参差不齐，很多主题的风格灰常个性，但同时代码也灰常随意，所以理论上会碰到很多问题。下面是关于这个插件的实现讲解以及一些已知问题的解决方法。

　　Demo - http://www.rainmoe.com/apps/wordpress/?themedemo=ilost （已经转移到此地址

<span class="readmore"><a href="http://www.rainmoe.com/2011/08/12/wp-flooded-v1-0-0-alpha/" title="WP插件：水淹菠萝阁 v1.00 Alpha（CPU 燃烧的远征">阅读全文——共1956字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　嘿嘿，话说小邪从上篇文章《<a href="http://www.evlos.org/2011/08/10/css-and-jquery-controls-the-liquid-in-a-bottle-increasing-and-decreasing/" target="_blank">CSS+jQuery实现随滚动条增减的汽水瓶中的液体</a>》与<a href="http://xlolix.com/" target="_blank">玻璃柠檬</a>童鞋聊天的时候，获得了一个点子，所以今天就完成了这个插件 水淹菠萝阁 WP-Flooded v1.00，目前还是 Alpha 版本，鉴于目前的 WordPress 主题参差不齐，很多主题的风格灰常个性，但同时代码也灰常随意，所以理论上会碰到很多问题。下面是关于这个插件的实现讲解以及一些已知问题的解决方法。</p>
<p>　　Demo - <a href="http://www.rainmoe.com/apps/wordpress/?themedemo=ilost" target="_blank">http://www.rainmoe.com/apps/wordpress/?themedemo=ilost</a> （已经转移到此地址</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000261.jpg" alt="" title="" width="600" height="325" class="alignnone size-full wp-image-2272" /></p>
<p><span id="more-2270"></span><strong>一. WP-Flooded v1.00 Alpha 说明：</strong></p>
<p>　　首先这个插件会自动加载 jQuery 库，所以不用担心忘记鸟。这个插件引用了另外一个 jQuery 插件 - spritely，spritely 是一个灰常给力的动画插件，水淹菠萝阁中的水的图片就是通过这个插件来产生水平流动效果的。大家可以点击 {<a rel="nofollow" href="http://www.spritely.net/documentation/" target="_blank">这里</a>} 传送到 spritely 的官网进行强力围观 o(*￣▽￣*)ゞ。</p>
<p>　　下面我们看看主要的 JS 代码。这些代码基于上篇文章的代码进行了优化，之前一打开小邪的本本温度会迅速升高 - -。所以现在修改为滚动条移动后停止 500 ms 之后，水才会在接着的 500 ms 之内完成上涨或者下降。</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery(document).ready(function($){

	$('#flooded').pan({fps: 25, speed: 2, dir: 'left'});
	//这个是引用 spritely 插件的代码，表示以 25 帧，速度 2，向左的方式运行

	var windowH = $(window).height(); //取窗口高度
	var bodyH = $(document.body).height(); //取页面高度
	$(&quot;#flooded&quot;).css('height',windowH+200);

	var timeout = false;
	$(window).scroll(function() {
		if (timeout){clearTimeout(timeout);} //用延时的方法保证CPU低负载
		timeout = setTimeout(function(){
			valS = $(window).scrollTop();
			valI = windowH-valS*1.5/bodyH*windowH;
			if (valI&lt;=-134) valI=-134;
			$(&quot;#flooded&quot;).animate({top:valI},500);
		},500);
	});

})
</pre>
<p><strong>二. WP-Flooded v1.00 Alpha 下载：</strong></p>
<p>　　Google Code 下载传送门 - <a href="http://code.google.com/p/evlosbox/downloads/detail?name=wp-flooded%20v1.00%20Alpha.zip&#038;can=2&#038;q=" target="_blank">http://code.google.com/p/evlosbox/downloads/detail?name=wp-flooded%20v1.00%20Alpha.zip&#038;can=2&#038;q=</a></p>
<p>　　Wordpress 官方传送门 - <a href="http://wordpress.org/extend/plugins/wp-flooded/" target="_blank">http://wordpress.org/extend/plugins/wp-flooded/</a></p>
<p><strong>三. 已知的问题：</strong></p>
<p>　　1. 首先是 wp_footer() 函数：</p>
<pre class="brush: php; title: ; notranslate">
//(*/ω＼*)[脸红掩面]，其实这个问题在很多小邪修改或原创的主题里面都有

&lt;?php wp_footer();?&gt;
&lt;/body&gt;
//首先确保主题的 footer.php 文件中上面两行代码是放在一起的
//如果上面的第一行不存在请照上面的样子修改一下
</pre>
<p><strong>四. 已知的需要修补的主题：</strong></p>
<p>　　1. EvilGreen 主题（真不好意思，滚来滚去……~(～o￣▽￣)～o 。滚来滚去……o～(＿△＿o～) ~。</p>
<pre class="brush: php; title: ; notranslate">
//请删除 footer.php 里面如下的代码
&lt;?php wp_footer(); ?&gt;
//然后将这段代码添加到 &lt;/body&gt; 上方
</pre>
<p>　　2. Twenty Eleven 1.1。</p>
<pre class="brush: php; title: ; notranslate">
//请删除 style.css 里面如下的代码
body {
    padding: 0 2em;
}
</pre>
<p><strong>五. 已知的兼容主题：</strong></p>
<p>　　1. Green 1.3，作者为 xxxxxly</p>
<p>　　2. Twenty Ten 1.2，作者为 the WordPress team</p>
<p>　　3. neutral (mono-lab.ver) 1.0，作者为 mono-lab</p>
<p>　　4. 目前本地就几个主题，其他的请大家自行测试 ╮(╯▽╰)╭</p>
<p><strong>六. 尾记：</strong></p>
<p>　　呼呼，终于完成任务鸟。（擦汗 (_　_)。゜</p>
<p>　　P.S. 祝大家的 CPU 挺住 ╮(╯_╰)╭。这是一场 CPU 的燃烧的远征。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/12/wp-flooded-v1-0-0-alpha/feed/</wfw:commentRss>
		<slash:comments>105</slash:comments>
		</item>
		<item>
		<title>CSS+jQuery实现随滚动条增减的汽水瓶中的液体</title>
		<link>http://www.rainmoe.com/2011/08/10/css-and-jquery-controls-the-liquid-in-a-bottle-increasing-and-decreasing/</link>
		<comments>http://www.rainmoe.com/2011/08/10/css-and-jquery-controls-the-liquid-in-a-bottle-increasing-and-decreasing/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 11:44:03 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2267</guid>
		<description><![CDATA[　　话说之前小邪在小闇那边看到她在《[JS]近期流行的視差(parallax)效果》文中提到一个很有意思的网站，那个网站是一家德国汽水公司的网站（德文神马的），网站首页有一个汽水瓶，汽水瓶里的水会随着我们向下拉滚动条而减少。很有意思。小邪就跟着做了一个Demo，木有用插件，只挂了jQuery。

　　Demo 页面传送门 - http://www.rainmoe.com/apps/demo_new/0_janploch-demo/



<span class="readmore"><a href="http://www.rainmoe.com/2011/08/10/css-and-jquery-controls-the-liquid-in-a-bottle-increasing-and-decreasing/" title="CSS+jQuery实现随滚动条增减的汽水瓶中的液体">阅读全文——共2938字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　话说之前小邪在<a href="http://www.rinkaiten.com/" target="_blank">小闇</a>那边看到她在《<a href="http://www.rinkaiten.com/parallax_in_web.html" target="_blank">[JS]近期流行的視差(parallax)效果</a>》文中提到一个很有意思的网站，那个网站是一家德国汽水公司的网站（德文神马的），网站首页有一个汽水瓶，汽水瓶里的水会随着我们向下拉滚动条而减少。很有意思。小邪就跟着做了一个Demo，木有用插件，只挂了jQuery。</p>
<p>　　Demo 页面传送门 - <a href="http://www.rainmoe.com/apps/demo_new/0_janploch-demo/" target="_blank">http://www.rainmoe.com/apps/demo_new/0_janploch-demo/</a></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000203.jpg" alt="" title="CapE0000203" width="600" height="331" class="alignnone size-full wp-image-2268" /></p>
<p><span id="more-2267"></span><strong>一. CSS+jQuery实现随滚动条增减汽水瓶中的液体：</strong></p>
<p>　　话说喝汽水的那个网站是用一个瓶子的图片，分为瓶口、瓶身、吸管还有瓶底。在这些图片中瓶子内部都是透明的，所以我们可以在底下一层按 x 轴平铺液体的图片，当然记得弄好吸管，吸管则是按照 y 轴平铺。其他具体的请看代码中注释。</p>
<p>　　啊，对了，那家公司的地址在这里 - <a rel="nofollow" href="http://janploch.de/" target="_blank">http://janploch.de/</a></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000204.jpg" alt="" title="CapE0000203" width="600" height="331" class="alignnone size-full wp-image-2268" /></p>
<pre class="brush: css; title: ; notranslate">
body {background:#fff url(bg_site.png);margin:0;}
#juice, #juice .inner, #bottle, #bottle .footer, #bottle .content, #bottle .header, #mid .inner {margin:0 auto;}
/*
 * #juice 加不加 margin:0 auto; 无所谓啦
 * 因为 position:fixed; 了所以 margin:0 auto; 自然就失效了
 * 因为 #bottle 无法准确设置宽度，所以自然加 margin:0 auto; 也没用了
 * 嘿嘿，这些都是小邪的错误
 *
 * #bottle .footer, #bottle .content, #bottle .header 这几个
 * 分别是瓶底、瓶身、瓶口几个位置的图片
 * 剩下的 #juice .inner 和 #mid .inner 则分别
 * 是居中按 x 轴平铺的液体和居中按 y 轴平铺的吸管咯
*/

#monitor {
	position:fixed;
	top:10px;
	left:10px;
	color:#f0f0f0;
	z-index:999;
	}
/*
 * #monitor 则是左上角的提示文字区域，具体查看JS注释部分
*/

#juice {
	width:99%;
	position:fixed;
	top:2000px;
	}
#juice .inner {
	width:1165px;
	background:url(juice.png) repeat-x;
	height:2000px;
	}
/*
 * #juice 在外层设置为 position:fixed; width:99%;
 * position:fixed; 的意思是绝对定位的元素，相对于浏览器窗口定位
 * #juice .inner 在里层设置为 margin:0 auto; width:1165px;
 * 这样配合好就能做出既是居中又是不随滚动条移动的效果
*/

#bottle {
	width:99%;
	text-align:center;
	position:absolute;
	top:0;
	}
/*
 * position:absolute; top:0;
 * 这样做因为绝对定位的东西多了，防止妨碍到瓶体的位置
 * text-align:center; 纯蛋疼勿在意
*/

#bottle .header {
	background:url(bottle_top.png) no-repeat;
	width:1175px;
	height:2648px;
	}
#bottle .content {
	background:url(content_bg.png) repeat-y;
	height:500px;
	width:1186px;
	}
#bottle .footer {
	background:url(bg_footer.png) no-repeat;
	width:1184px;
	height:567px;
	}
/*
 * 分别瓶子三部分，很简单的 o(*￣▽￣*)ゞ
*/

#mid {
	width:99%;
	position:fixed;
	z-index:-999;
	}
/*
 * 此处效果同 #juice，z-index:-999; 表示放到最底层
*/

#mid .inner {
	width:92px;
	height:2000px;
	background:url(strohalm_mid.png) repeat-y;
	}
/*
 * #mid .inner 则是吸管的图片设置
*/
&lt;/style&gt;
</pre>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery(document).ready(function($){
//记得在这段代码前面挂上 jQuery 库哈，忘记的童鞋拉出去切JJ一小时
	$(window).scroll(function() {
	//滚动条触发事件，目标则是整个窗口，即此窗口的滚动条
		$(&quot;#monitor&quot;).html(&quot;scrollTop: &quot;+$(window).scrollTop());
		//在 #monitor 里面随时监视 $(window).scrollTop() 的值
		if ($(window).scrollTop()&lt;1108) $(&quot;#juice&quot;).css('top',490+815-$(window).scrollTop());
			else $(&quot;#juice&quot;).css('top',$(window).scrollTop()/2900*580)
		//$(window).scrollTop()&lt;1108 则液体停止增加，并且随滚动条上拉而下移
		//反之则按滚动条滚动的比例增减
	//1108是液体应该停止增加的时候，$(window).scrollTop()的值
	//2900是页面高度，580是窗口的部分高度
	//490 815 什么的小邪才不知道是什么咧（其实是这家伙忘记了
	//反正随滚动条上拉而远离窗口顶部啦
	});
})
&lt;/script&gt;
</pre>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;demo_menu&quot; style=&quot;position:fixed;bottom:10px;left:10px;z-index:999;&quot;&gt;&lt;a style=&quot;color:#fff;&quot; href=&quot;/&quot;&gt;返回&lt;/a&gt;&lt;/div&gt;
&lt;div id=&quot;monitor&quot; style=&quot;&quot;&gt;scrollTop: 0&lt;/div&gt;
&lt;div id=&quot;juice&quot;&gt;&lt;div class=&quot;inner&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id=&quot;mid&quot;&gt;&lt;div class=&quot;inner&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;div id=&quot;bottle&quot;&gt;
	&lt;div class=&quot;header&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;content&quot;&gt;&lt;/div&gt;
	&lt;div class=&quot;footer&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>
<p><strong>二. 尾记：</strong></p>
<p>　　总结一下，恩恩，这样子是用于大家加深对 jQuery 和设计中对视觉滴应用滴理解（其实是小邪弄得自己蛋疼然后想拉上大家一起疼），理解完之后感觉无力的还是去用插件吧 (╯_╰) （小邪表示无力+1，这样的确有点折腾人 (=_-) 的说）。嘿嘿嘿嘿嘿 o(*￣▽￣*)ゞ。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/10/css-and-jquery-controls-the-liquid-in-a-bottle-increasing-and-decreasing/feed/</wfw:commentRss>
		<slash:comments>70</slash:comments>
		</item>
		<item>
		<title>波斯王子 MAD；如何将 iLost 主题修改成菠萝阁样式；广告位</title>
		<link>http://www.rainmoe.com/2011/08/09/theme-and-mad/</link>
		<comments>http://www.rainmoe.com/2011/08/09/theme-and-mad/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 10:17:52 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2258</guid>
		<description><![CDATA[　　这几天小邪无聊突然想玩玩波斯王子5，顺便就用 After effects + Permiere + Fraps 酝酿出来了一部小短片，标题是《波斯王子：勇气 Courage》，长度大概 4分40秒 左右，720p滴 o(*￣▽￣*)ゞ。用了一些魔兽世界原声带里面滴交响乐BGM，求支持嘿嘿嘿。首发Bilibili，传送门在下面一点点。



一. 波斯王子：勇气 MAD：

<span class="readmore"><a href="http://www.rainmoe.com/2011/08/09/theme-and-mad/" title="波斯王子 MAD；如何将 iLost 主题修改成菠萝阁样式；广告位">阅读全文——共13715字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　这几天小邪无聊突然想玩玩波斯王子5，顺便就用 After effects + Permiere + Fraps 酝酿出来了一部小短片，标题是《波斯王子：勇气 Courage》，长度大概 4分40秒 左右，720p滴 o(*￣▽￣*)ゞ。用了一些魔兽世界原声带里面滴交响乐BGM，求支持嘿嘿嘿。首发Bilibili，传送门在下面一点点。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/Sequence-10_1-2.jpg" alt="" title="" width="600" height="308" class="alignnone size-full wp-image-2259" /></p>
<p><span id="more-2258"></span><strong>一. 波斯王子：勇气 MAD：</strong></p>
<p>　　Bilibili 传送门 - <a href="http://www.bilibili.tv/video/av126301/" target="_blank">http://www.bilibili.tv/video/av126301/</a><br />
　　115 下载传送门 - <a href="http://u.115.com/file/aq6vzk7k#" target="_blank">http://u.115.com/file/aq6vzk7k#</a></p>
<p><strong>二. 广告位求包养：</strong></p>
<p>　　话说之前小邪一直是不挂广告的坚持者来着，现在终于准备战略性撤退 ╮(╯▽╰)╭，毕竟想想如果一个网站木有办法养活自己就太杯具了 - -，所以打算出售一些广告位。现在只有三个位置，文章头部 600x80，侧边栏 250x250，文章底部 600x120。求包养 o(*￣▽￣*)ゞ。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000137.jpg" alt="" title="" width="600" height="331" class="alignnone size-full wp-image-2260" /></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000138.jpg" alt="" title="" width="600" height="331" class="alignnone size-full wp-image-2261" /></p>
<p><strong>三. 如何将 iLost 主题修改成菠萝阁这种样式：</strong></p>
<p>　　首先下载原主题（<a href="http://wordpress.org/extend/themes/ilost" target="_blank">点击这里下载</a>），然后按照以下的步骤进行依次修改。很遗憾小邪不能直接把修改后的主题全部打包共享，因为二次发布感觉事情会比较复杂的说 ╮(╯_╰)╭。</p>
<pre class="brush: php; title: ; notranslate">
// 首先下载如下几个图片文件，覆盖到主题的 images 目录
http://www.evlos.org/wp-content/themes/ilost/images/sidebg.png
http://www.evlos.org/wp-content/themes/ilost/images/bg_.png
http://www.evlos.org/wp-content/themes/ilost/images/bg_asd.png

Tags: white, two-columns, left-sidebar, fixed-width, custom-background, threaded-comments, translation-ready, editor-style
*/
// 然后用 http://www.evlos.org/wp-content/themes/ilost/style.css 中如上内容下方的全部内容
// 替换主题文件中 style.css 如上内容下方的全部内容
</pre>
<pre class="brush: php; title: ; notranslate">
// 修改主题中的 single.php 文件

&lt;h2&gt;&lt;?php the_title();?&gt;&lt;/h2&gt;
// 将如上的内容修改为如下的内容
&lt;h2&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;&lt;?php the_permalink() ?&gt;&quot;&gt;&lt;?php the_title();?&gt;&lt;/a&gt;&lt;/h2&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
// 修改主题中的 index.php 文件

&lt;article&gt;
// 将如上的内容修改为如下的内容
&lt;article&gt;&lt;?php $ev_counter = 0; ?&gt;

&lt;div class=&quot;entry&quot;&gt;
// 将如上的内容修改为如下的内容
&lt;div class=&quot;entry &lt;?php if (++$ev_counter&lt;&gt;1) echo 'ev_hidden'; ?&gt;&quot;&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
// 修改主题中的 functions.php 文件

function ilost_home_menulink($args){$args['show_home']=true;return $args;}
// 将如上的内容修改为如下的内容
function ilost_home_menulink($args){$args['show_home']='首页 [Index]';return $args;}

function ilost_enqueue_script(){
	if((strpos(BROWSER_USER_AGENT,'MSIE')!==false)&amp;&amp;(strpos(BROWSER_USER_AGENT,'MSIE 9')===false))wp_enqueue_script('html5',get_template_directory_uri().'/scripts/html5.js');
	wp_enqueue_script('jquery');
	wp_enqueue_script('lazyload',get_template_directory_uri().'/scripts/lazyload.js');
	wp_enqueue_script('ilostq',get_template_directory_uri().'/scripts/ilostq.js');
	if(is_singular()&amp;&amp;get_option('thread_comments'))wp_enqueue_script('comment-reply');
}
// 将如上的内容修改为如下的内容
function ilost_enqueue_script(){
	if((strpos(BROWSER_USER_AGENT,'MSIE')!==false)&amp;&amp;(strpos(BROWSER_USER_AGENT,'MSIE 9')===false))wp_enqueue_script('html5',get_template_directory_uri().'/scripts/html5.js');
	wp_enqueue_script('jquery');
}

remove_action('wp_head','wp_generator');?&gt;
// 将如上的内容修改为如下的内容
remove_action('wp_head','wp_generator');

// 在底部增加如下内容，要加 comment_mail_notify 函数的请自行加在此函数上方
function mytheme_comment($comment, $args, $depth) {
   global $mycmcount;
   $GLOBALS['comment'] = $comment;
?&gt;
&lt;li &lt;?php comment_class(); ?&gt; id=&quot;li-comment-&lt;?php comment_ID() ?&gt;&quot;&gt;
	&lt;div id=&quot;comment-&lt;?php comment_ID(); ?&gt;&quot;&gt;
		&lt;div class=&quot;comment-author vcard&quot;&gt;
			&lt;?php echo get_avatar($comment,$size='40',$default='&lt;path_to_url&gt;' ); ?&gt;
			&lt;cite class=&quot;fn&quot;&gt;&lt;?php comment_author_link() ?&gt;&lt;/cite&gt;
			&lt;span class=&quot;comment-meta commentmetadata&quot;&gt;&lt;a href=&quot;&lt;?php echo htmlspecialchars( get_comment_link( $comment-&gt;comment_ID ) ) ?&gt;&quot;&gt;&lt;?php echo human_time_diff(strtotime($comment-&gt;comment_date_gmt), strtotime(gmdate('Y-m-j G:i:s'))) . '之前'; ?&gt;&lt;/a&gt;&lt;?php edit_comment_link(__('(Edit)'),'  ','') ?&gt;&lt;/span&gt;&lt;span class=&quot;my_comments_count&quot;&gt;&lt;?php if($depth==1){$mycmcount++;echo($mycmcount==1?'坐沙发！':($mycmcount==2?'坐板凳！':($mycmcount==3?'躺地板！':($mycmcount==4?'天花板！':($mycmcount==5?'下水道！':($mycmcount==6?'地心！':'')))))).'#'.$mycmcount;} ?&gt;&lt;/span&gt;
		&lt;/div&gt;
		&lt;?php if ($comment-&gt;comment_approved == '0') : ?&gt;
		&lt;em class=&quot;approved&quot;&gt;&lt;?php _e('Your comment is awaiting moderation.') ?&gt;&lt;/em&gt;
		&lt;br /&gt;
		&lt;?php endif; ?&gt;
		&lt;div class=&quot;comment-text&quot;&gt;
			&lt;?php comment_text() ?&gt;
		&lt;/div&gt;
		&lt;div class=&quot;reply&quot;&gt;
			&lt;?php comment_reply_link(array_merge( $args, array('depth' =&gt; $depth, 'max_depth' =&gt; $args['max_depth'], 'reply_text' =&gt; '@'))); ?&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;?php } ?&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
// 修改主题中的 header.php 文件

&lt;?php wp_head();?&gt;
// 将如上的内容修改为如下的内容
&lt;?php wp_head();?&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
jQuery(document).ready(function($){
$('#searchform #s').focus(function(){if($(this).val()=='Search blog...'){$(this).css({color:'#555'}).val('');}}).blur(function(){if($(this).val()==''){$(this).css({color:'#aaa'}).val('Search blog...');}});
$(function(){if($('#searchform #s').val()=='' || $('#searchform #s').val()=='Search blog...'){$('#searchform #s').css({color:'#999'}).val('Search blog...');}});})
&lt;/script&gt;

&lt;body &lt;?php body_class();?&gt;&gt;
// 将如上的内容修改为如下的内容
&lt;body &lt;?php body_class();?&gt;&gt;&lt;div id=&quot;box&quot;&gt;&lt;div id=&quot;box_in&quot;&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
// 修改主题中的 footer.php 文件

&lt;footer&gt;
	&lt;div&gt;
		&lt;p class=&quot;line&quot;&gt;&lt;span class=&quot;alignright&quot;&gt;&lt;?php printf('&lt;a href=&quot;'.home_url('/').'&quot; title=&quot;'.esc_attr(get_bloginfo('name', 'display')).'&quot;&gt;HOME&lt;/a&gt;'.__(' &amp;brvbar; '));?&gt;&lt;a href=&quot;&lt;?php bloginfo('rss2_url');?&gt;'&quot;&gt;&lt;?php echo esc_attr('RSS Feed');?&gt;&lt;/a&gt;&lt;/span&gt;
    &lt;?php printf(themename.' theme '.__(' &amp;brvbar; ').'Designed by &lt;a href=&quot;'.esc_attr('http://xuui.net/').'&quot;&gt;Xu.hel&lt;/a&gt; in ChengDu.');?&gt;
    &lt;/p&gt;
		&lt;p&gt;&lt;?php printf('&lt;span class=&quot;alignright&quot;&gt;Powered by &lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/span&gt;');?&gt;
		&lt;?php printf('Copyright &amp;copy;2011 ');?&gt;&lt;a href=&quot;&lt;?php echo home_url('/');?&gt;&quot; title=&quot;&lt;?php echo esc_attr(get_bloginfo('name','display'));?&gt;&quot; rel=&quot;home&quot;&gt;&lt;?php bloginfo('name');?&gt;&lt;/a&gt;&lt;/p&gt;
	&lt;/div&gt;
	&lt;!--&lt;?php echo get_num_queries();?&gt; queries. &lt;?php timer_stop(1);?&gt; seconds. --&gt;
&lt;/footer&gt;
&lt;!--/div--&gt;
&lt;?php wp_footer();?&gt;
// 将如上的内容修改为如下的内容
&lt;footer&gt;
	&lt;div&gt;
    &lt;p&gt;&lt;span class=&quot;alignright&quot;&gt;&lt;?php printf('Copyright &amp;copy;2009-2011 ');?&gt;&lt;a target=&quot;_blank&quot; rel=&quot;nofollow&quot; href=&quot;&lt;?php echo home_url('/');?&gt;&quot; title=&quot;&lt;?php echo esc_attr(get_bloginfo('name','display'));?&gt;&quot; rel=&quot;home&quot;&gt;&lt;?php bloginfo('name');?&gt;&lt;/a&gt; - &lt;?php printf('&lt;a target=&quot;_blank&quot; rel=&quot;nofollow&quot; href=&quot;'.home_url('/').'&quot; title=&quot;'.esc_attr(get_bloginfo('name', 'display')).'&quot;&gt;HOME&lt;/a&gt;'.__(' &amp;brvbar; '));?&gt;&lt;a href=&quot;&lt;?php bloginfo('rss2_url');?&gt;'&quot;&gt;&lt;?php echo esc_attr('RSS Feed');?&gt;&lt;/a&gt;&lt;/span&gt;
    &lt;?php printf('Powered by &lt;a target=&quot;_blank&quot; rel=&quot;nofollow&quot; href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;');?&gt; - &lt;?php printf(themename.' theme '.__(' &amp;brvbar; ').'Designed by &lt;a target=&quot;_blank&quot; href=&quot;'.esc_attr('http://xuui.net/').'&quot;&gt;Xu.hel&lt;/a&gt; in ChengDu '.__(' &amp;brvbar; ').'Modified by &lt;a target=&quot;_blank&quot; href=&quot;'.esc_attr('http://www.imevlos.com/').'&quot;&gt;小邪[Evlos]&lt;/a&gt;.');?&gt;
    &lt;/p&gt;
	&lt;/div&gt;
	&lt;!--&lt;?php echo get_num_queries();?&gt; queries. &lt;?php timer_stop(1);?&gt; seconds. --&gt;
&lt;/footer&gt;
&lt;!--/div--&gt;
&lt;?php wp_footer();?&gt;&lt;/div&gt;&lt;/div&gt;
</pre>
<pre class="brush: php; title: ; notranslate">
// 用以下内容覆盖 comments.php

&lt;?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */
// Do not delete these lines
	if (!empty($_SERVER['SCRIPT_FILENAME']) &amp;&amp; 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');
	if ( post_password_required() ) { ?&gt;
		&lt;p class=&quot;nocomments&quot;&gt;This post is password protected. Enter the password to view comments.&lt;/p&gt;
	&lt;?php
		return;
	}
$countComments = 0;
$countPings = 0;
if($post-&gt;comment_count &gt; 0) {
	$comments_list = array();
	$pings_list = array();
	foreach($comments as $comment) {
		if('comment' == get_comment_type()) $comments_list[++$countComments] = $comment;
		else $pings_list[++$countPings] = $comment;
	}
}
?&gt;
	&lt;?php if ( have_comments() ) : ?&gt;
			&lt;div id=&quot;comments-div&quot;&gt;&lt;span id=&quot;comments-addcomment&quot;&gt;&lt;a href=&quot;#respond&quot;  rel=&quot;nofollow&quot; title=&quot;Leave a comment ?&quot;&gt;Leave a comment&lt;/a&gt;&lt;/span&gt;&lt;div id=&quot;comments&quot;&gt;&lt;?php comments_number('0', '1', '%' );?&gt; Comments.&lt;/div&gt;&lt;/div&gt;
			&lt;ol class=&quot;commentlist&quot; id=&quot;thecomments&quot;&gt;
					&lt;?php wp_list_comments('type=comment&amp;callback=mytheme_comment'); ?&gt;
			&lt;/ol&gt;
			&lt;div class=&quot;navigation&quot;&gt;&lt;?php paginate_comments_links(); ?&gt;&lt;/div&gt;
	&lt;?php else : // this is displayed if there are no comments so far
	?&gt;
		&lt;?php if ('open' == $post-&gt;comment_status) : ?&gt;
			&lt;div id=&quot;comments-div&quot;&gt;&lt;span id=&quot;comments-addcomment&quot;&gt;&lt;a href=&quot;#respond&quot;  rel=&quot;nofollow&quot; title=&quot;Leave a comment ?&quot;&gt;Leave a comment&lt;/a&gt;&lt;/span&gt;&lt;div id=&quot;comments&quot;&gt;&lt;?php comments_number('0', '1', '%' );?&gt; Comments.&lt;/div&gt;&lt;/div&gt;
		&lt;?php else : // comments are closed
		?&gt;
			&lt;div id=&quot;comments-div&quot;&gt;&lt;div id=&quot;comments&quot;&gt;Comments are closed.&lt;/div&gt;&lt;/div&gt;
		&lt;?php endif; ?&gt;
	&lt;?php endif; ?&gt;
	&lt;?php if ('open' == $post-&gt;comment_status) : ?&gt;
		&lt;div id=&quot;respond&quot;&gt;
			&lt;h2&gt;&lt;?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?&gt;&lt;/h2&gt;
			&lt;div class=&quot;cancel-comment-reply&quot;&gt;
				&lt;small&gt;&lt;?php cancel_comment_reply_link(); ?&gt;&lt;/small&gt;
			&lt;/div&gt;
			&lt;?php if ( get_option('comment_registration') &amp;&amp; !$user_ID ) : ?&gt;
					&lt;p&gt;You must be &lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-login.php?redirect_to=&lt;?php echo urlencode(get_permalink()); ?&gt;&quot;&gt;logged in&lt;/a&gt; to post a comment.&lt;/p&gt;
			&lt;?php else : ?&gt;
					&lt;form action=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-comments-post.php&quot; method=&quot;post&quot; id=&quot;commentform&quot;&gt;
				&lt;?php if ( $user_ID ) : ?&gt;
						&lt;p&gt;Logged in as &lt;a href=&quot;&lt;?php echo get_option('siteurl'); ?&gt;/wp-admin/profile.php&quot;&gt;&lt;?php echo $user_identity; ?&gt;&lt;/a&gt;. &lt;a href=&quot;&lt;?php echo wp_logout_url(get_permalink()); ?&gt;&quot; title=&quot;Log out of this account&quot;&gt;Log out &amp;raquo;&lt;/a&gt;&lt;/p&gt;
				&lt;?php else : ?&gt;
						&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;author&quot; id=&quot;author&quot; value=&quot;&lt;?php echo $comment_author; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;1&quot; /&gt;
						&lt;label for=&quot;author&quot;&gt;&lt;small&gt;Name &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
						&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;email&quot; id=&quot;email&quot; value=&quot;&lt;?php echo $comment_author_email; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;2&quot; /&gt;
						&lt;label for=&quot;email&quot;&gt;&lt;small&gt;Mail (will not be published) &lt;?php if ($req) echo &quot;(required)&quot;; ?&gt;&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
						&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;url&quot; id=&quot;url&quot; value=&quot;&lt;?php echo $comment_author_url; ?&gt;&quot; size=&quot;22&quot; tabindex=&quot;3&quot; /&gt;
						&lt;label for=&quot;url&quot;&gt;&lt;small&gt;Website&lt;/small&gt;&lt;/label&gt;&lt;/p&gt;
				&lt;?php endif; ?&gt;
						&lt;p&gt;
&lt;!-- +++++++++++ Smiles +++++++++++++ --&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;
/* &lt;![CDATA[ */
    function grin(tag) {
    	var myField;
    	tag = ' ' + tag + ' ';
        if (document.getElementById('comment') &amp;&amp; document.getElementById('comment').type == 'textarea') {
    		myField = document.getElementById('comment');
    	} else {
    		return false;
    	}
    	if (document.selection) {
    		myField.focus();
    		sel = document.selection.createRange();
    		sel.text = tag;
    		myField.focus();
    	}
    	else if (myField.selectionStart || myField.selectionStart == '0') {
    		var startPos = myField.selectionStart;
    		var endPos = myField.selectionEnd;
    		var cursorPos = endPos;
    		myField.value = myField.value.substring(0, startPos)
    					  + tag
    					  + myField.value.substring(endPos, myField.value.length);
    		cursorPos += tag.length;
    		myField.focus();
    		myField.selectionStart = cursorPos;
    		myField.selectionEnd = cursorPos;
    	}
    	else {
    		myField.value += tag;
    		myField.focus();
    	}
    }
/* ]]&gt; */
&lt;/script&gt;
&lt;a href=&quot;javascript:grin(':?:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_question.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':razz:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_razz.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':sad:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_sad.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':evil:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_evil.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':!:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_exclaim.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':smile:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_smile.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':oops:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_redface.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':grin:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_biggrin.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':eek:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_surprised.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':shock:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_eek.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':???:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_confused.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':cool:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_cool.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':lol:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_lol.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':mad:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_mad.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':twisted:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_twisted.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':roll:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_rolleyes.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':wink:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_wink.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':idea:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_idea.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':arrow:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_arrow.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':neutral:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_neutral.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':cry:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_cry.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;a href=&quot;javascript:grin(':mrgreen:')&quot;&gt;&lt;img src=&quot;&lt;?php bloginfo('wpurl'); ?&gt;/wp-includes/images/smilies/icon_mrgreen.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;!-- +++++++++++ Smiles end +++++++++++++ --&gt;
						&lt;/p&gt;
						&lt;p&gt;&lt;textarea name=&quot;comment&quot; id=&quot;comment&quot; cols=&quot;100%&quot; rows=&quot;6&quot; tabindex=&quot;4&quot; onkeydown=&quot;if(event.ctrlKey&amp;amp;&amp;amp;event.keyCode==13){document.getElementById('submit').click();return false};&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;
						&lt;p&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; id=&quot;submit&quot; tabindex=&quot;5&quot; value=&quot;Submit&quot; /&gt; [ Ctrl + Enter ] &lt;?php comment_id_fields(); ?&gt;&lt;/p&gt;
						&lt;?php do_action('comment_form', $post-&gt;ID); ?&gt;
					&lt;/form&gt;
			&lt;?php endif; // If registration required and not logged in
			?&gt;
		&lt;/div&gt;
	&lt;?php endif; // if you delete this the sky will fall on your head
	?&gt;
	&lt;?php if($countPings &gt; 0) : ?&gt;
		&lt;div class=&quot;trackbacks-pingbacks&quot;&gt;
			&lt;h3&gt;Trackbacks and Pingbacks:&lt;/h3&gt;
			&lt;ul id=&quot;pinglist&quot;&gt;
				&lt;?php foreach($pings_list as $comment) :
						if('pingback' == get_comment_type()) $pingtype = 'Pingback';
						else $pingtype = 'Trackback';
				?&gt;
				&lt;li id=&quot;comment-&lt;?php echo $comment-&gt;comment_ID ?&gt;&quot;&gt;
					&lt;?php comment_author_link(); ?&gt; - &lt;?php echo $pingtype; ?&gt; on &lt;?php echo mysql2date('Y/m/d/ H:i', $comment-&gt;comment_date); ?&gt;
				&lt;/li&gt;
				&lt;?php endforeach; ?&gt;
			&lt;/ul&gt;
		&lt;/div&gt;
	&lt;?php endif; ?&gt;
</pre>
<p>　　按照一般滴潜规则，Ajax comments 部分请自行添加一下。当然如果有用小邪的 EvilGreen 主题的童鞋就可以直接把修改好的 comments-ajax.php 直接拿过来用喔，因为小邪直接用那个主题的评论代码覆盖了这个主题的评论部分。小邪也按照上面的步骤做了一遍以确保全部的步骤都木有问题，结果如下图。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000143.jpg" alt="" title="" width="600" height="408" class="alignnone size-full wp-image-2264" /></p>
<p><strong>四. 尾记：</strong></p>
<p>　　最近小邪的 Google reader 突然坏掉了，完全显示不出正确的未读文章。看图片的左上角显示有 30 个新条目，右下角显示超过 100 个条目，而且这些全部条目都是未读的。真是太悲催了 (T__T)，如果点击仅显示新条目则只显示那 30 条，剩下的未读全部显示不出来。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/CapE0000141a.jpg" alt="" title="" width="600" height="386" class="alignnone size-full wp-image-2263" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/09/theme-and-mad/feed/</wfw:commentRss>
		<slash:comments>64</slash:comments>
		</item>
		<item>
		<title>第一次用绘图板；牛奶蛋相关的 Yii 数据库查询；iFttt；杂记</title>
		<link>http://www.rainmoe.com/2011/08/02/today/</link>
		<comments>http://www.rainmoe.com/2011/08/02/today/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 10:00:03 +0000</pubDate>
		<dc:creator>小邪</dc:creator>
				<category><![CDATA[奇客 [Geek]]]></category>

		<guid isPermaLink="false">http://www.evlos.org/?p=2248</guid>
		<description><![CDATA[　　今天的杂记是一大堆很复杂的东西，小邪木有很高的更新频率，但是每篇文章的内容都是足足的，嘿嘿嘿嘿，众人蛋定 o(*￣▽￣*)ゞ。因为太复杂，不知道用什么封面图好了 T__T。就用小邪刚到手的摸你傻墙纸好了。



一. 第一次用友基（基友？）Rainbow 画板画的惨照：

<span class="readmore"><a href="http://www.rainmoe.com/2011/08/02/today/" title="第一次用绘图板；牛奶蛋相关的 Yii 数据库查询；iFttt；杂记">阅读全文——共3112字</a></span>]]></description>
			<content:encoded><![CDATA[<p>　　今天的杂记是一大堆很复杂的东西，小邪木有很高的更新频率，但是每篇文章的内容都是足足的，嘿嘿嘿嘿，众人蛋定 o(*￣▽￣*)ゞ。因为太复杂，不知道用什么封面图好了 T__T。就用小邪刚到手的摸你傻墙纸好了。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/08/157.jpg" alt="" title="" width="600" height="348" class="alignnone size-full wp-image-2257" /></p>
<p><span id="more-2248"></span><strong>一. 第一次用友基（基友？）Rainbow 画板画的惨照：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/145.jpg" alt="" title="" width="600" height="256" class="alignnone size-full wp-image-2249" /></p>
<p>　　这个苹果好像不好吃 ( ﹁ ﹁ )。</p>
<p><strong>二. 收到 iFttt 的邀请：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/Cap0000277.png" alt="" title="Cap0000277" width="600" height="345" class="alignnone size-full wp-image-2251" /></p>
<p>　　嘿嘿，图中左下角显示　“You have 5 invites left” （你还剩下 5 个邀请名额），那么有哪位盆友想要的都可以问小邪拿，因为数量有限，所以认识的人（本文之前在小邪这里留过几条言的盆友都算哈）优先 o(*￣▽￣*)ゞ。</p>
<p><strong>三. 魔兽世界：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/WoWScrnShot_072911_111706.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2254" /></p>
<p>　　纪念当年的 5 区莫什奥格 70 法师，当时在留学前刚好玩到 70，因为后来身在欧洲地区所以后面也木有办法玩鸟。<a href="http://nnd.im/img/original/146" target="_blank">打开大图</a>。</p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/119.jpg" alt="" title="" width="600" height="375" class="alignnone size-full wp-image-2253" /></p>
<p>　　纪念一下玩到 80 就没玩了的，欧服 Darksorrow 区 Dragonblood 公会的号，当时打完 Lichking，后面暑假大部分人员都零零散散回国度度假或者离开欧洲了，暑假结束之后，上线看不到几个认识的人觉得木有意思，就直接在另外个区练了其他号和现在还在荷兰的盆友一起玩。<a href="http://nnd.im/img/original/119" target="_blank">打开大图</a>。</p>
<p><strong>四. 牛奶蛋相关函数：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/Cap0000280.jpg" alt="" title="" width="600" height="358" class="alignnone size-full wp-image-2250" /></p>
<p>　　额，其实都是一些木有营养的函数，牛奶蛋这个程序技术含量并不高，因为不需要什么复杂的算法或者代码，所以咱就意思一下，嘿嘿，意思一下。</p>
<pre class="brush: php; title: ; notranslate">
public static function getMicroTime() //获得当前毫秒数的函数
{
  list($usec, $sec) = explode(&quot; &quot;,microtime());
  return ((float)$usec + (float)$sec);
}
</pre>
<pre class="brush: php; title: ; notranslate">
public static function randpsw($len=8) //生成的随机字符串的函数
{
  $chars='abcdefghijklmnopqrstuvwxyz0123456789';
  mt_srand((double)microtime()*1000000*getmypid());
  $password=&quot;&quot;;
  while(strlen($password)&lt;$len) $password.=substr($chars,(mt_rand()%strlen($chars)),1);
  return $password;
}
</pre>
<pre class="brush: php; title: ; notranslate">
public static function evurlcode($str,$method) //小邪自用url编码函数
{
  $ori = array('!','*',&quot;'&quot;,&quot;(&quot;,&quot;)&quot;,&quot;;&quot;,&quot;:&quot;,&quot;@&quot;,&quot;&amp;&quot;,&quot;=&quot;,&quot;+&quot;,&quot;$&quot;,&quot;,&quot;,&quot;/&quot;,&quot;?&quot;,&quot;%&quot;,&quot;#&quot;,&quot;[&quot;,&quot;]&quot;);
  $tar = array('e%v21','e%v2A','e%v27','e%v28','e%v29','e%v3B','e%v3A','e%v40','e%v26','e%v3D','e%v2B','e%v24','e%v2C','e%v2F','e%v3F','e%v25','e%v23','e%v5B','e%v5D');
  //防止使用官方的url编码函数而与加密函数产生冲突
  if ($method) return str_replace($ori,$tar,$str); //Encode
  else return str_replace(array_reverse($tar),array_reverse($ori),$str); //Decode
}
</pre>
<pre class="brush: php; title: ; notranslate">
public static function num2code($num) { //10进制与36进制互相转换
  return base_convert($num,10,36);
}
public static function code2num($code) {
  return base_convert($code,36,10);
}
</pre>
<pre class="brush: php; title: ; notranslate">
public static function textFilter($text) //显示数据时，防止运行恶意脚本
{
  return preg_replace('/&lt;[a-z\/]+&gt;/i','',$text);
}
</pre>
<p><strong>五. Google CDN ：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/Cap0000284.png" alt="" title="" width="600" height="233" class="alignnone size-full wp-image-2255" /></p>
<p>　　<a rel="nofollow" href="http://code.google.com/speed/pss/" target="_blank">http://code.google.com/speed/pss/</a></p>
<p><strong>六. 第一个 C++ 程序：</strong></p>
<p><img src="http://www.rainmoe.com/wp-content/uploads/2011/07/75.png" alt="" title="" width="600" height="317" class="alignnone size-full wp-image-2256" /></p>
<p>　　高手们蛋定，这个只是一个很蛋疼的程序，位数多一些就木有办法显示了。因为木有用数组来存储运算 ╮(╯▽╰)╭。</p>
<p><strong>七. Yii 相关教程（数据库查询）：</strong></p>
<pre class="brush: php; title: ; notranslate">
$dataCmt = Comments::model()-&gt;findAll(array('limit'=&gt;6,'order'=&gt;'id DESC'));
//Comments 是事先用 Yii 的 Gii 工具创建的一个 Model
//Gii 是 Yii 的一个自带工具，用于生成 Model Controller 之类的基本文件
//Model 简单理解就是对于一个表的结构与数据类型的描述文件
//findAll 是 Yii 的数据库查询方法
//limit 等价于普通数据库查询语句中的 limit 参数
//当然 order 也是一样咯

//这是牛奶蛋首页最新评论的查询语句。
</pre>
<pre class="brush: php; title: ; notranslate">
$dataUser = Users::model()-&gt;findAllByPk($uids,array('select'=&gt;'id,user_nickname'));
//反正文档官方都有，小邪这里就直接讲例子 o(*￣▽￣*)ゞ
//ByPk 的意思就是 by primary key，一般就是 id 那一列
//select 等价于查询语句中相同的参数，所以这样就只会返回 id,user_nickname 两列值

//这是查询指定 id 的昵称的查询语句，$uids 是数组。
</pre>
<pre class="brush: php; title: ; notranslate">
$dataCmt = Comments::model()-&gt;findAllByAttributes(array('imgid'=&gt;$id),array('offset'=&gt;$fid,'order'=&gt;'id DESC'));
//ByAttributes 的意思就是按照列名来查询
//offset 就是从那一列开始查询
//id DESC 就是按照 id 进行倒序排列返回

//这是图片查看页面的评论查询语句。
</pre>
<pre class="brush: php; title: ; notranslate">
$dataImg = Imgs::model()-&gt;findAll(array('condition'=&gt;'deleted=0','offset'=&gt;($pageNum-1)*$imgPerPage,'limit'=&gt;$imgPerPage,'order'=&gt;'id DESC'));
//condition 是附加的判断语句，比如上面就是查找 deleted 不是 0 的行

//这就是牛奶蛋首页那堆缩略图的查询语句。
</pre>
<p><strong>八. 尾记：</strong></p>
<p>　　牛奶蛋的代码好像已经被小邪揭露到果体了 ( ﹁ ﹁ ) ，嘿嘿，下次咱搞点有营养的东西 o(*￣▽￣*)ゞ。</p>
<p>　　话说，小邪这家伙也是一个大懒虫 (╯__╰)，经常三天打渔两天晒网。必须得改过来，恩。（自我吐槽</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rainmoe.com/2011/08/02/today/feed/</wfw:commentRss>
		<slash:comments>86</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached (Feed is rejected)
Page Caching using memcached
Database Caching using memcached
Object Caching 573/648 objects using memcached

Served from: www.rainmoe.com @ 2012-02-05 16:17:52 -->
