<?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>hemono</title>
	<atom:link href="http://www.hemono.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.hemono.com</link>
	<description>常记溪亭日暮，沉醉不知归路……</description>
	<lastBuildDate>Thu, 02 Sep 2010 02:49:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>foreach中unset引用元素？</title>
		<link>http://www.hemono.com/?p=334</link>
		<comments>http://www.hemono.com/?p=334#comments</comments>
		<pubDate>Thu, 02 Sep 2010 02:40:14 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=334</guid>
		<description><![CDATA[$array = array(1,2,3);
foreach($array&#160;as &#38;$value) {}
&#160;
$value = 4;  &#160; //var_dump($array);
unset($value); //var_dump($array);

array(3) {
[0]=&#62;
int(1)
[1]=&#62;
int(2)
[2]=&#62;
 &#38;int(4)
}
array(3) {
[0]=&#62;
int(1)
[1]=&#62;
int(2)
[2]=&#62;
 int(4)
}

foreach中unset引用&#38;元素，只是unlink了引用（没收了变量的&#38;）
]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=334</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>gif2png sprite</title>
		<link>http://www.hemono.com/?p=328</link>
		<comments>http://www.hemono.com/?p=328#comments</comments>
		<pubDate>Wed, 01 Sep 2010 03:00:55 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=328</guid>
		<description><![CDATA[动画图片一般都是使用gif格式，不过在游戏中，gif的帧率和播放速度就不太好控制了，解决办法就是使用png sprite（google
）技术，看图：

使用png，每行存储一组连贯动画，然后使用css，动态改变background-position，动画就连贯了！
参见gamequery实现的拳皇游戏：
http://gamequery.onaluf.org/
gamequery源代码，原理参看其中的refreshSprite方法：
http://gamequery.onaluf.org/download/jquery.gamequery-0.5.0.js
由于之前的游戏动画都采用gif格式，怎么样将gif的帧动画，拼接为png sprite呢？
如果手工做的话，wst要orz了……
imagemagick，开源的图片处理工具，而且是跨平台的，命令行下的photoshop
1.将gif导出成帧图片
convert +adjoin -coalesce xxx.gif xxx/%02d.gif
2.将单帧图片合并成png sprite
convert xxx/*.gif -append xxx.png
PS：由于png使用的是行压缩技术，所以，图片拼接是横着拼比竖着拼压缩率更高，压缩比是多少呢？
大概是 1 : 1.5 (横:竖)，而且文件越大，这个比值越大，看下面的成果：



]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=328</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can nginx be used as a reverse proxy for a backend websocket server?</title>
		<link>http://www.hemono.com/?p=193</link>
		<comments>http://www.hemono.com/?p=193#comments</comments>
		<pubDate>Thu, 26 Aug 2010 17:11:31 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=193</guid>
		<description><![CDATA[http://www.igvita.com/2009/10/21/nginx-comet-low-latency-server-push/
http://stackoverflow.com/questions/2419346/can-nginx-be-used-as-a-revers&#8230;
http://github.com/slact/nginx_http_push_module
]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=193</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>启用open_basedir导致CURL失效的问题</title>
		<link>http://www.hemono.com/?p=321</link>
		<comments>http://www.hemono.com/?p=321#comments</comments>
		<pubDate>Mon, 16 Aug 2010 16:25:40 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=321</guid>
		<description><![CDATA[
CURLOPT_FOLLOWLOCATION
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set
curl_setopt_array()
如果curl_setopt_array中包含CURLOPT_FOLLOWLOCATION键值，会导致所有options设置失败，让你感觉curl_setopt_array有问题，其实这个函数本身是没问题的。

]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=321</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>强制下载文件，正确输出中文名</title>
		<link>http://www.hemono.com/?p=317</link>
		<comments>http://www.hemono.com/?p=317#comments</comments>
		<pubDate>Sun, 15 Aug 2010 16:30:25 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=317</guid>
		<description><![CDATA[通杀浏览器：IE、Opear、webkit（Safari / Chrome）、Firefox
function&#160;header_filename($filename){ // $filename 必须 UTF-8 encode
$ua = $_SERVER['HTTP_USER_AGENT'];
if&#160;( strpos($ua, &#34;MSIE&#34;) !== false ) {
$encoded_filename = urlencode($filename);
$encoded_filename = str_replace(&#34;+&#34;, &#34;%20&#34;, $encoded_filename);
header('Content-Disposition: attachment; filename=&#34;' . $encoded_filename . '&#34;');
}&#160;elseif ( strpos($ua, &#34;Firefox&#34;) !== false ) {
header('Content-Disposition: attachment; filename*=&#34;utf8\'\'' . $filename . '&#34;');
}&#160;else {
header('Content-Disposition: attachment; filename=&#34;' . $filename . '&#34;');
}
}

]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=317</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crontab别忘了设置环境变量！</title>
		<link>http://www.hemono.com/?p=314</link>
		<comments>http://www.hemono.com/?p=314#comments</comments>
		<pubDate>Sat, 07 Aug 2010 08:31:08 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=314</guid>
		<description><![CDATA[freebsd下，crontab未继承用户环境变量，需要在crontab头部加入PATH，HOME：
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
HOME=/home/zhangwei
* * * * * cd ~/script &#38;&#38; php hello.php  #如果未设置HOME，那就找不到~，如果未设置PATH，就找不到php
]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=314</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>腾讯-1亿个数取前1万大的整数-答</title>
		<link>http://www.hemono.com/?p=302</link>
		<comments>http://www.hemono.com/?p=302#comments</comments>
		<pubDate>Sun, 01 Aug 2010 15:11:31 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=302</guid>
		<description><![CDATA[还是这位大爷牛：http://lanphaday.bokee.com/5145363.html
单机
1.先取10000个整数，从小到大排好序，形成一个有序队列Q[0～9999]。
2.然后取第10001个整数，是否比Q[0]小？
3.使用插入排序法（算法复杂度log2(N)，二分法，10000个，找到自己的插入位置，需要查找14次::2^14=16384）插入到Q中。
4.剔除掉队列中最小的那个数Q[0];
5.重复2-4，直到1亿。
总的计算次数是：
10000 × 14+ (1亿-10000) × 14
14 × 1亿 ≈ 14亿
如果把队列Q增大为16384呢？貌似降低了后期排序的6384*14次计算，可是理论上时间复杂度没什么变化……
将Q增大为2^14，即Q[0~16363]
16384 × 14 + (1亿-16384) × 14
14 × 1亿 ≈ 14亿
随着遍历的进行，这个Q[0～9999]内的min最小数会越来越大，插入排序的概率也会越来越小。这个概率到底是多少呢？
分布式计算？
假设阁下有10000台机器 ！
1.把1亿切分成10000×10000的分卷
2.在单台机器完成10000的快速排序（也可一边传输一边使用插入排序……）
3.在总机执行TOP10000的归并排序
1亿+网络传输(1亿)+10000×10000×14+网络传输(1万)+2×10000×14
1亿+14亿+28万+网络传输(1亿零1万) ≈ 计算（14亿零15万）+网络传输(1亿零1万)

快速排序的时间复杂度
最坏：N*(N-1)/2
最好：N*logN

归并排序的时间复杂度
N*logN

]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=302</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>禁止选中</title>
		<link>http://www.hemono.com/?p=295</link>
		<comments>http://www.hemono.com/?p=295#comments</comments>
		<pubDate>Thu, 29 Jul 2010 07:37:46 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=295</guid>
		<description><![CDATA[// ie
&#60;script&#62;document.onselectstart = function(){ return false; }&#60;/script&#62;
// ff
&#60;style&#62;body{-moz-user-select:none}&#60;/style&#62;
]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=295</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A*</title>
		<link>http://www.hemono.com/?p=290</link>
		<comments>http://www.hemono.com/?p=290#comments</comments>
		<pubDate>Thu, 29 Jul 2010 03:46:14 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=290</guid>
		<description><![CDATA[A*寻路初探
http://blog.vckbase.com/panic/archive/2005/03/20/3778.html
在A*寻路中使用二叉堆
http://my.opera.com/jingze/blog/show.dml/434118
]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=290</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>freebsd ports软件安装</title>
		<link>http://www.hemono.com/?p=288</link>
		<comments>http://www.hemono.com/?p=288#comments</comments>
		<pubDate>Tue, 27 Jul 2010 15:43:43 +0000</pubDate>
		<dc:creator>hemon</dc:creator>
				<category><![CDATA[未分类]]></category>

		<guid isPermaLink="false">http://www.hemono.com/?p=288</guid>
		<description><![CDATA[
进入ports目录
cd /usr/ports
搜索软件
make search key=[search software]
Port:   gmpc-libnotify-0.19.0_3
Path:   /usr/ports/audio/gmpc-libnotify
Info:   A libnotify for gmpc
Maint:  miwi@FreeBSD.org
B-deps: ORBit2-2.14.18_1 atk-1.30.0_1 ……

进入path目录
cd [Path]
使用sudo权限安装
sudo make install

]]></description>
		<wfw:commentRss>http://www.hemono.com/?feed=rss2&amp;p=288</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
