<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/longbill" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/longbill" type="application/rss+xml"></fs:self_link><lastBuildDate>Thu, 21 Jan 2010 10:48:51 GMT</lastBuildDate><title>Longbill's Blog</title><description>虽然我是一个不善于书写的人～</description><link>http://www.longbill.cn/blog</link><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>1</sy:updateFrequency><language>en</language><pubDate>Fri, 22 Jan 2010 05:09:35 GMT</pubDate><item><title>[原创]PHP实现类似ASP里的Application对象</title><link>http://www.longbill.cn/blog/2010/01/php_asp_application_session/</link><content:encoded>&lt;p&gt;   以前搞过一段时间的asp，觉得application这个对象很爽。。可以很容易的写一个聊天室。。。后来逐渐转到php，就一直为这事郁闷。。因为php里面没有对应的东西。数据只能往数据库或者文件里面写才能实现共享。   今天在公司做聊天室的时候，灵机一动，居然让我发现了一神奇的方法～～哈哈：&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;
PHP里面的$_SESSION变量可以实现类似Application的功能，但重点在它不能跨浏览器进程，或者说是跨用户。。只能是单个用户操作不同页面时候的变量传递，是一种cookie的替代方案。
&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;
众所周知，php里，调用session_start()之后，客户浏览器会收到一个大概名叫PHPSESSID的cookie，这个叫session_id。不同页面的参数共享就是靠这个变量实现的。
&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;
有时，由于客户端浏览器或者其他什么神奇的原因，导致无法正常发送 PHPSESSID的时候，我们可以手动发送，然后在php里面的session_start();之前，调用session_id(&amp;#8221;sessionid在这里&amp;#8221;);手工指定session_id ，这样，就可以让session工作正常。（比如浏览器不支持cookie，或用flash上传文件的时候）
&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;
好了，关键的东西来了。&lt;span id=&quot;more-722&quot;&gt;&lt;/span&gt;如果我们让每个用户的session_id都一样会怎么样？ 哈哈。ASP的Application功能便呼之欲出～～～
&lt;/p&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;p&gt;
实现方法非常简单：&lt;br /&gt;
在每个php页面的前面都写上下面的代码：&lt;br /&gt;
session_id(&amp;#8221;xxxx&amp;#8221;);&lt;br /&gt;
session_start();&lt;br /&gt;
然后，你就可以像用Application对象那样来使用$_SESSION了。。～～哈哈哈哈～～～爽吧～～
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;PS：ASP的Application对象是存储在内存里面的，而PHP的SESSION一般默认是用文件来存的。不过也可以设置php.ini让php用mysql数据库存，甚至用memcached来存～～具体方法就不详述了。。&lt;/p&gt;
&lt;p&gt;chy提到session本来的作用是保存用户的登录信息等，是非常有用的。我这样一弄，session就失去了它原有的功能。所以我搞了一个函数，可以实现全局session和局部session共存。互不干扰。&lt;/p&gt;
&lt;pre&gt;
/*
用法：
application('key','value'); //设置 key=value
$value = application('key'); //获取 key的值
*/

function application()
{
	$args = func_get_args(); //获取输入参数
	if (count($args) &amp;gt;2 || count($args) &amp;lt; 1) return;
	$ssid = session_id(); //保存当前session_id
	session_write_close(); //结束当前session
	ob_start(); //禁止全局session发送header
	session_id(&amp;quot;xxx&amp;quot;); //注册全局session_id
	session_start(); //开启全局session
	$key = $args[0];
	if (count($args) == 2) //如果有第二个参数，那么表示写入全局session
	{
		$re = ($_SESSION[$key] = $args[1]);
	}
	else // 如果只有一个参数，那么返回该参数对应的value
	{
		$re = $_SESSION[$key];
	}
	session_write_close(); //结束全局session
	session_id($ssid); //重新注册上面被中断的非全局session
	session_start(); //重新开启
	ob_end_clean(); //抛弃刚刚由于session_start产生的一些header输出
	return $re;
}
&lt;/pre&gt;
&lt;p&gt;当然，这样操作的成本有点高。。不过在实际使用中，基本不会遇到使用全局session和局部session的频率都很高的情况。所以可以按需求封装局部session或者是全局session。  上面那个函数封装的是全局session，稍微修改就可以实现局部session。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606818/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2010/01/php_asp_application_session/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606818/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606818/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2010/01/php_asp_application_session/feed/</wfw:commentRss><slash:comments>5</slash:comments><description>以前搞过一段时间的asp，觉得application这个对象很爽。。可以很容易的写一个聊天室。。。后来逐渐转到php，就一直为这事郁闷。。因为php里面没有对应的东西。数据只能往数据库或者文件里面写才能实现共享。   今天在公司做聊天室的时候，灵机一动，居然让我发现了一神奇的方法～～哈哈：

PHP里面的$_SESSION变量可以实现类似Application的功能，但重点在它不能跨浏览器进程，或者说是跨用户。。只能是单个用户操作不同页面时候的变量传递，是一种cookie的替代方案。


众所周知，php里，调用session_start()之后，客户浏览器会收到一个大概名叫PHPSESSID的cookie，这个叫session_id。不同页面的参数共享就是靠这个变量实现的。


有时，由于客户端浏览器或者其他什么神奇的原因，导致无法正常发送 PHPSESSID的时候，我们可以手动发送，然后在php里面的session_start();之前，调用session_id(&amp;#8221;sessionid在这里&amp;#8221;);手工指定session_id ，这样，就可以让session工作正常。（比如浏览器不支持cookie，或用flash上传文件的时候）


好了，关键的东西来了。如果我们让每个用户的session_id都一样会怎么样？ 哈哈。ASP的Application功能便呼之欲出～～～


实现方法非常简单：
在每个php页面的前面都写上下面的代码：
session_id(&amp;#8221;xxxx&amp;#8221;);
session_start();
然后，你就可以像用Application对象那样来使用$_SESSION了。。～～哈哈哈哈～～～爽吧～～

PS：ASP的Application对象是存储在内存里面的，而PHP的SESSION一般默认是用文件来存的。不过也可以设置php.ini让php用mysql数据库存，甚至用memcached来存～～具体方法就不详述了。。
chy提到session本来的作用是保存用户的登录信息等，是非常有用的。我这样一弄，session就失去了它原有的功能。所以我搞了一个函数，可以实现全局session和局部session共存。互不干扰。

/*
用法：
application('key','value'); //设置 key=value
$value = application('key'); //获取 key的值
*/

function application()
{
	$args = func_get_args(); //获取输入参数
	if (count($args) &amp;#62;2 &amp;#124;&amp;#124; count($args) &amp;#60; 1) return;
	$ssid = session_id(); //保存当前session_id
	session_write_close(); //结束当前session
	ob_start(); //禁止全局session发送header
	session_id(&amp;#34;xxx&amp;#34;); //注册全局session_id
	session_start(); //开启全局session
	$key = $args[0];
	if (count($args) == 2) //如果有第二个参数，那么表示写入全局session
	{
		$re = ($_SESSION[$key] = $args[1]);
	}
	else // 如果只有一个参数，那么返回该参数对应的value
	{
		$re = $_SESSION[$key];
	}
	session_write_close(); //结束全局session
	session_id($ssid); //重新注册上面被中断的非全局session
	session_start(); //重新开启
	ob_end_clean(); //抛弃刚刚由于session_start产生的一些header输出
	return $re;
}

当然，这样操作的成本有点高。。不过在实际使用中，基本不会遇到使用全局session和局部session的频率都很高的情况。所以可以按需求封装局部session或者是全局session。  上面那个函数封装的是全局session，稍微修改就可以实现局部session。&lt;img src=&quot;http://www1.feedsky.com/t1/324606818/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2010/01/php_asp_application_session/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606818/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606818/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>PHP</category><category>程序们</category><pubDate>Thu, 21 Jan 2010 18:48:51 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2010/01/php_asp_application_session/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=722</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2010/01/php_asp_application_session/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606818/5519543</fs:itemid></item><item><title>寒假又要去北京。。房子好难找。。</title><link>http://www.longbill.cn/blog/2009/12/beijing_hezu/</link><content:encoded>&lt;p&gt;寒假去北京一公司工作，做经验分享的网站(&lt;a href=&quot;http://www.umiwi.com&quot; target=&quot;_blank&quot;&gt;umiwi.com&lt;/a&gt;)。。下学期估计也会待在北京了。。。但是发现房子好难找。朋友们有没有什么建议？或者可以和我合租什么的？  公司在大望路SOHO现代城，地铁1号线上。。只要1号线附近的房子应该都比较方便。房租大概1-2K就可以了。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606819/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/12/beijing_hezu/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606819/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606819/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/12/beijing_hezu/feed/</wfw:commentRss><slash:comments>34</slash:comments><description>寒假去北京一公司工作，做经验分享的网站(umiwi.com)。。下学期估计也会待在北京了。。。但是发现房子好难找。朋友们有没有什么建议？或者可以和我合租什么的？  公司在大望路SOHO现代城，地铁1号线上。。只要1号线附近的房子应该都比较方便。房租大概1-2K就可以了。&lt;img src=&quot;http://www1.feedsky.com/t1/324606819/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/12/beijing_hezu/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606819/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606819/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>生活</category><pubDate>Thu, 24 Dec 2009 18:14:38 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/12/beijing_hezu/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=715</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/12/beijing_hezu/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606819/5519543</fs:itemid></item><item><title>用HTML+Javascript开发AIR桌面程序</title><link>http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/</link><content:encoded>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;早就听说Adobe Air可以用HTML+Javascript的方式来开发，但是直到前不就才开始研究学习。做了几个air的小程序，其中遇到了很多困难。Air的资料网上比较少。所以遇到问题有时候真不知道怎么办。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;其中一个问题是弹出提示窗口（屏幕右下角或者右上角那种提示性的临时窗口），不知道怎么调整大小和位置。找了好多资料，后来终于明白了。弹出窗口的代码如下：&lt;/p&gt;
&lt;pre&gt;var options = new air.NativeWindowInitOptions();
options.systemChrome = &quot;none&quot;; //取消系统窗口外框
options.type = &quot;lightweight&quot;; //轻量级窗口
options.transparent = true; //允许透明
var bounds = new air.Rectangle(100,200,100,100); 

var newHTMLLoader = air.HTMLLoader.createRootWindow(true, options, true, bounds);
newHTMLLoader.load(new air.URLRequest(&quot;notify.html&quot;));
newHTMLLoader.stage.nativeWindow.alwaysInFront = true; //窗口始终置顶&lt;/pre&gt;
&lt;p&gt;上面这段代码会在屏幕的左上方(x:100,y:200)创建一个宽高都是100px的HTML窗口，内容是notify.html。&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;其中，newHTMLLoader.window 可以访问到新建的窗口。可以预先定义一些函数，供窗口加载完后调用。比如：&lt;/p&gt;
&lt;pre&gt;newHTMLLoader.window.on_load = function()
{
     alert('loaded!');
}&lt;/pre&gt;
&lt;p&gt;然后在notify.html页面里面写上 window.onload = on_load; 就可以了。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;而控制窗口宽高、位置的对象是newHTMLLoader.stage.nativeWindow 。可以通过设置这个对象的 x,y,width,height（而不是我们通常认为的left,top,width,height）属性来改变窗口的长宽和位置。 在nofity.html里对应的对象是window.nativeWindow。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;nativeWindow貌似是ActionScript里面的比较常用的东西。不过对我们这种没有研究过AS的人来说，不容易想到控制位置是用x和y，而不是left和top。。。。。。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;下面说下开发AIR程序比开发WEB程序爽的地方：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;在应用程序沙箱中的代码可以任意跨域访问！而且更爽的是AIR会自动保存和处理Cookie，也就是说我可以用AJAX来模拟登录，之后可以直接用AJAX取登录后才能取得的内容而不用担心Cookie！真是太神奇了！&lt;/li&gt;
&lt;li&gt;AIR采用Webkit引擎，不用担心跨操作系统的兼容性。最多是字体显示稍微不同而已。而且可以使用大部分的JS框架，比如JQuery!&lt;/li&gt;
&lt;li&gt;AIR支持部分CSS3! 其中比较爽的是可以很容易的实现圆角效果，颜色可以使用RGBA（第四个参数是透明度）。好处是我们可以很容易的制作一个背景半透明，但是内容不透明的圆角提示窗口～～（例如：-webkit-border-radius:5px; background-color:rgba(20%,20%,20%,0.8);  ）&lt;/li&gt;
&lt;li&gt;支持JS进行文件读取等本地操作，支持本地SQL等。。&lt;/li&gt;
&lt;/ul&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606820/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606820/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606820/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/feed/</wfw:commentRss><slash:comments>11</slash:comments><description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;早就听说Adobe Air可以用HTML+Javascript的方式来开发，但是直到前不就才开始研究学习。做了几个air的小程序，其中遇到了很多困难。Air的资料网上比较少。所以遇到问题有时候真不知道怎么办。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;其中一个问题是弹出提示窗口（屏幕右下角或者右上角那种提示性的临时窗口），不知道怎么调整大小和位置。找了好多资料，后来终于明白了。弹出窗口的代码如下：
var options = new air.NativeWindowInitOptions();
options.systemChrome = &quot;none&quot;; //取消系统窗口外框
options.type = &quot;lightweight&quot;; //轻量级窗口
options.transparent = true; //允许透明
var bounds = new air.Rectangle(100,200,100,100); 

var newHTMLLoader = air.HTMLLoader.createRootWindow(true, options, true, bounds);
newHTMLLoader.load(new air.URLRequest(&quot;notify.html&quot;));
newHTMLLoader.stage.nativeWindow.alwaysInFront = true; //窗口始终置顶
上面这段代码会在屏幕的左上方(x:100,y:200)创建一个宽高都是100px的HTML窗口，内容是notify.html。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;其中，newHTMLLoader.window 可以访问到新建的窗口。可以预先定义一些函数，供窗口加载完后调用。比如：
newHTMLLoader.window.on_load = function()
{
     alert('loaded!');
}
然后在notify.html页面里面写上 window.onload = on_load; 就可以了。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;而控制窗口宽高、位置的对象是newHTMLLoader.stage.nativeWindow 。可以通过设置这个对象的 x,y,width,height（而不是我们通常认为的left,top,width,height）属性来改变窗口的长宽和位置。 在nofity.html里对应的对象是window.nativeWindow。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;nativeWindow貌似是ActionScript里面的比较常用的东西。不过对我们这种没有研究过AS的人来说，不容易想到控制位置是用x和y，而不是left和top。。。。。。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;下面说下开发AIR程序比开发WEB程序爽的地方：

在应用程序沙箱中的代码可以任意跨域访问！而且更爽的是AIR会自动保存和处理Cookie，也就是说我可以用AJAX来模拟登录，之后可以直接用AJAX取登录后才能取得的内容而不用担心Cookie！真是太神奇了！
AIR采用Webkit引擎，不用担心跨操作系统的兼容性。最多是字体显示稍微不同而已。而且可以使用大部分的JS框架，比如JQuery!
AIR支持部分CSS3! 其中比较爽的是可以很容易的实现圆角效果，颜色可以使用RGBA（第四个参数是透明度）。好处是我们可以很容易的制作一个背景半透明，但是内容不透明的圆角提示窗口～～（例如：-webkit-border-radius:5px; background-color:rgba(20%,20%,20%,0.8);  ）
支持JS进行文件读取等本地操作，支持本地SQL等。。&lt;img src=&quot;http://www1.feedsky.com/t1/324606820/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606820/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606820/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>CSS</category><category>JQuery</category><category>程序们</category><category>Javascript</category><category>Air</category><pubDate>Sat, 07 Nov 2009 02:27:35 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=704</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/11/html_javascript_adobe_air/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606820/5519543</fs:itemid></item><item><title>推荐在线模型制作网站：MockingBird</title><link>http://www.longbill.cn/blog/2009/11/mockingbird/</link><content:encoded>&lt;p&gt;MockingBird是一个免费的在线模型制作网站，可以帮助你快速制作，分享你的网站或者应用程序模型。&lt;/p&gt;
&lt;p&gt;它有几个特点：1，在线，不用安装任何软件。2，简单，容易上手。3，功能齐全，包括各种组件和链接。4，可以和别人分享。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://gomockingbird.com/&quot; target=&quot;_blank&quot;&gt;去试试吧。&lt;/a&gt;&lt;/p&gt;
&lt;div id=&quot;attachment_698&quot; class=&quot;wp-caption alignnone&quot; style=&quot;width: 560px&quot;&gt;&lt;a href=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/11/main-screenshot.png&quot;&gt;&lt;img src=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/11/main-screenshot.png&quot; alt=&quot;在线模型制作&quot; title=&quot;main-screenshot&quot; width=&quot;550&quot; height=&quot;300&quot; class=&quot;size-full wp-image-698&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;在线模型制作&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;以下是我随便做的一个模型。&lt;br /&gt;
&lt;iframe width=&quot;600&quot; height=&quot;600&quot; src=&quot;http://gomockingbird.com/mockingbird/index.html?project=dfc4e4ca6930383517068e927cd663dc5e344cb4&quot; style=&quot;border: 1px solid black; margin: 0; padding: 0;&quot;&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606821/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/11/mockingbird/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606821/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606821/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/11/mockingbird/feed/</wfw:commentRss><slash:comments>3</slash:comments><description>MockingBird是一个免费的在线模型制作网站，可以帮助你快速制作，分享你的网站或者应用程序模型。
它有几个特点：1，在线，不用安装任何软件。2，简单，容易上手。3，功能齐全，包括各种组件和链接。4，可以和别人分享。
去试试吧。
以下是我随便做的一个模型。&lt;img src=&quot;http://www1.feedsky.com/t1/324606821/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/11/mockingbird/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606821/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606821/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>网络</category><category>模型</category><category>设计</category><pubDate>Fri, 06 Nov 2009 15:07:16 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/11/mockingbird/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=697</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/11/mockingbird/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606821/5519543</fs:itemid></item><item><title>发布AIR应用程序：空气域名查询。</title><link>http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/</link><content:encoded>&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;最近对Adobe 的Air技术非常感兴趣。 有了这种技术，我们以后就能很轻易的把B/S程序扩展到桌面，成为C/S程序！&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;下面是我的第一个AIR应用程序：空气域名查询。  “空气”二字源于 Air。 主要功能是快速查询某个域名是否被注册。输入一串字符串，选中下面的后缀，程序会自动查询对应的域名。 当然你也可以自定义查询任意后缀，如果想这样，只需要输入完整的域名即可（当然，不包含www）。比如：当我输入longbill，并选中com，和net。那么程序会自动查询longbill.com和longbill.net。如果我输入longbill.la，那么程序只会查询longbill.la。&lt;/p&gt;
&lt;p&gt;下面是截图：&lt;br /&gt;
&lt;a href=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/airdomainchecker.gif&quot;&gt;&lt;img src=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/airdomainchecker.gif&quot; alt=&quot;空气域名查询&quot; title=&quot;空气域名查询&quot; width=&quot;366&quot; height=&quot;418&quot; class=&quot;alignnone size-full wp-image-694&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;此外，我还在尝试做一些附加功能，比如whois查询和域名收藏（方便以后从收藏的域名中找出最好的）。现在只实现了在新窗口种查询whois，实现方式也很机械：调用http://who.is/longbill.cn的网页内容。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;如果你对此程序感兴趣，可以&lt;a href=&quot;http://www.longbill.cn/down/air/airdomainchecker.air&quot; target=&quot;_blank&quot;&gt;点击这里&lt;/a&gt;下载。 不过，前提是你的电脑上有Adobe Air 运行环境。如果没有，你可以去&lt;a href=&quot;http://get.adobe.com/cn/air/&quot; target=&quot;_blank&quot;&gt;这里&lt;/a&gt;安装。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606822/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606822/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606822/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/feed/</wfw:commentRss><slash:comments>13</slash:comments><description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;最近对Adobe 的Air技术非常感兴趣。 有了这种技术，我们以后就能很轻易的把B/S程序扩展到桌面，成为C/S程序！
&amp;#160;&amp;#160;&amp;#160;&amp;#160;下面是我的第一个AIR应用程序：空气域名查询。  “空气”二字源于 Air。 主要功能是快速查询某个域名是否被注册。输入一串字符串，选中下面的后缀，程序会自动查询对应的域名。 当然你也可以自定义查询任意后缀，如果想这样，只需要输入完整的域名即可（当然，不包含www）。比如：当我输入longbill，并选中com，和net。那么程序会自动查询longbill.com和longbill.net。如果我输入longbill.la，那么程序只会查询longbill.la。
下面是截图：

&amp;#160;&amp;#160;&amp;#160;&amp;#160;此外，我还在尝试做一些附加功能，比如whois查询和域名收藏（方便以后从收藏的域名中找出最好的）。现在只实现了在新窗口种查询whois，实现方式也很机械：调用http://who.is/longbill.cn的网页内容。
&amp;#160;&amp;#160;&amp;#160;&amp;#160;如果你对此程序感兴趣，可以点击这里下载。 不过，前提是你的电脑上有Adobe Air 运行环境。如果没有，你可以去这里安装。&lt;img src=&quot;http://www1.feedsky.com/t1/324606822/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606822/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606822/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>程序们</category><category>Air</category><pubDate>Mon, 26 Oct 2009 17:09:51 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=693</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/10/adobe_air_html_javascript/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606822/5519543</fs:itemid></item><item><title>最强大的编辑器：Textmate ！</title><link>http://www.longbill.cn/blog/2009/10/textmate_todo_list/</link><content:encoded>&lt;p&gt;用Textmate已经有一年多了。但是一直以来都只是把它当作一个文本编辑器来用的。没有用什么高级功能。仅仅知道bundle可以实现代码补全。今天看到Textmate Bundle里面有一个TODO，很好奇。于是打开一看，有几个标签，但是没什么内容。我还以为是普通的todo list 。但是事实远不止如此。潜心研究了一番，甚至看了todo bundle的源代码。下面为大家介绍一下：&lt;span id=&quot;more-689&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;输入todo然后按tab键，往文本文件光标处插入todo注释。 你可以在TODO 后面写一些自己的文字。&lt;/li&gt;
&lt;li&gt;按shift+control+T，会弹出todo list窗口。 自动搜索当前项目里面的所有TODO！并显示出来，还可以点击查看。&lt;/li&gt;
&lt;li&gt;你还可以用bundle editor增加fixme快捷键，changed快捷键等。&lt;/li&gt;
&lt;li&gt;有时项目过大，文件过多。按shift+control+T的时候，会搜索很久。此时你可以增加一些ignore目录。具体方法是：Textmate-&amp;gt;Prefrences-&amp;gt;Advanced-&amp;gt;Shell Variables，增加一个变量：TM_TODO_IGNORE，然后值输入目录名，多个目录用|分隔。 比如可以把一些plugin目录（fckeditor,tiny_mce等）设置成ignore。打开todo list窗口的速度大大提高！&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;上个图先：&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/textmate.jpg&quot;&gt;&lt;img class=&quot;alignnone size-full wp-image-691&quot; title=&quot;textmate&quot; src=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/textmate.jpg&quot; alt=&quot;textmate&quot; width=&quot;644&quot; height=&quot;384&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606823/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/textmate_todo_list/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606823/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606823/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/10/textmate_todo_list/feed/</wfw:commentRss><slash:comments>3</slash:comments><description>用Textmate已经有一年多了。但是一直以来都只是把它当作一个文本编辑器来用的。没有用什么高级功能。仅仅知道bundle可以实现代码补全。今天看到Textmate Bundle里面有一个TODO，很好奇。于是打开一看，有几个标签，但是没什么内容。我还以为是普通的todo list 。但是事实远不止如此。潜心研究了一番，甚至看了todo bundle的源代码。下面为大家介绍一下：

输入todo然后按tab键，往文本文件光标处插入todo注释。 你可以在TODO 后面写一些自己的文字。
按shift+control+T，会弹出todo list窗口。 自动搜索当前项目里面的所有TODO！并显示出来，还可以点击查看。
你还可以用bundle editor增加fixme快捷键，changed快捷键等。
有时项目过大，文件过多。按shift+control+T的时候，会搜索很久。此时你可以增加一些ignore目录。具体方法是：Textmate-&amp;#62;Prefrences-&amp;#62;Advanced-&amp;#62;Shell Variables，增加一个变量：TM_TODO_IGNORE，然后值输入目录名，多个目录用&amp;#124;分隔。 比如可以把一些plugin目录（fckeditor,tiny_mce等）设置成ignore。打开todo list窗口的速度大大提高！

上个图先：&lt;img src=&quot;http://www1.feedsky.com/t1/324606823/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/textmate_todo_list/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606823/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606823/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>孤独苹果</category><category>程序们</category><pubDate>Sun, 25 Oct 2009 00:20:41 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/10/textmate_todo_list/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=689</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/10/textmate_todo_list/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606823/5519543</fs:itemid></item><item><title>最近换手机有点频繁。。终于走入3G时代。</title><link>http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/</link><content:encoded>&lt;p&gt;&lt;div id=&quot;attachment_682&quot; class=&quot;wp-caption alignright&quot; style=&quot;width: 204px&quot;&gt;&lt;a href=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/hkc.jpg&quot;&gt;&lt;img src=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/10/hkc.jpg&quot; alt=&quot;hkc mythos&quot; title=&quot;hkc mythos&quot; width=&quot;194&quot; height=&quot;322&quot; class=&quot;size-full wp-image-682&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;hkc mythos&lt;/p&gt;&lt;/div&gt;&amp;nbsp;&amp;nbsp;过年的时候买的魅族M8 。玩了2个月，觉得不稳定，信号不好，经常漏电话。然后一次偶然机会入手Nokia E71。这可是我第一次买诺基亚的手机哦。。水货，带wifi ,gps, wcdma。 那时候联通3G正在商用,本来打算申请一个号试试的。结果哪知道联通把价格定那么高。最次的套餐都是93元/月。。。。就算了。。只有等了！不过E71真的挺不错的。主要是稳定，操作流畅，软件多。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;暑假完了，开学，电信的天翼进校园。那资费，看着就爽啊，大概是：19元月租（包40分市话，30M流量，300条短信），然后在学校里面打市话是0.08元每分。 如果寝室是包月上网，每月还要返一半的网费成话费。。。。天哪。跟联通比，简直太划算了。。于是，果断卖掉E71，在淘宝入手一台HKC mythos(神话)。刚好2K。 配置超高，wifi gps evdo一应俱全。。于是，哥们终于在经过了数年的漫长等待后用上了日思夜想的速度超快资费便宜信号超好的3G网络。&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;晕，怎么觉得自己在给电信打广告。。不过我觉得电信天翼真的不错，覆盖很广。 不过可能是因为3G网络才建好，客服方面经常出问题。 有时查不到话费。。。。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606824/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606824/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606824/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/feed/</wfw:commentRss><slash:comments>20</slash:comments><description>nbsp;&amp;#160;过年的时候买的魅族M8 。玩了2个月，觉得不稳定，信号不好，经常漏电话。然后一次偶然机会入手Nokia E71。这可是我第一次买诺基亚的手机哦。。水货，带wifi ,gps, wcdma。 那时候联通3G正在商用,本来打算申请一个号试试的。结果哪知道联通把价格定那么高。最次的套餐都是93元/月。。。。就算了。。只有等了！不过E71真的挺不错的。主要是稳定，操作流畅，软件多。
&amp;#160;&amp;#160;暑假完了，开学，电信的天翼进校园。那资费，看着就爽啊，大概是：19元月租（包40分市话，30M流量，300条短信），然后在学校里面打市话是0.08元每分。 如果寝室是包月上网，每月还要返一半的网费成话费。。。。天哪。跟联通比，简直太划算了。。于是，果断卖掉E71，在淘宝入手一台HKC mythos(神话)。刚好2K。 配置超高，wifi gps evdo一应俱全。。于是，哥们终于在经过了数年的漫长等待后用上了日思夜想的速度超快资费便宜信号超好的3G网络。
&amp;#160;&amp;#160;晕，怎么觉得自己在给电信打广告。。不过我觉得电信天翼真的不错，覆盖很广。 不过可能是因为3G网络才建好，客服方面经常出问题。 有时查不到话费。。。。&lt;img src=&quot;http://www1.feedsky.com/t1/324606824/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606824/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606824/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>3G</category><category>生活</category><category>手机</category><pubDate>Sat, 17 Oct 2009 04:15:59 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=680</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/10/hkc_mythos_3g_cdma_evdo/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606824/5519543</fs:itemid></item><item><title>做了一个山寨的Omegle。。chendian.net</title><link>http://www.longbill.cn/blog/2009/09/omegle_chendian_net/</link><content:encoded>&lt;p&gt;由于最近omegle很火。于是就想copy一个到国内。 正好我以前做过聊天室～哈哈。2天就搞定了。 先是在学校内部测试，修正了一些bug 。然后就放到外网。 因为聊天过程中会建立很多长连接。所以把服务器上的apache换成了nginx。希望能扛得住那么多的并发。&lt;/p&gt;
&lt;p&gt;域名： &lt;a href=&quot;http://chendian.net &quot; target=&quot;_blank&quot;&gt;http://chendian.net &lt;/a&gt; 沉淀时光。&lt;/p&gt;
&lt;p&gt;网站的功能是跟一个陌生人聊天，随机配对。而且是只能2个人聊。不是传统的聊天室。&lt;/p&gt;
&lt;div id=&quot;attachment_673&quot; class=&quot;wp-caption alignnone&quot; style=&quot;width: 341px&quot;&gt;&lt;a title=&quot;沉淀时光&quot; href=&quot;http://chendian.net&quot; target=&quot;_blank&quot;&gt;&lt;img class=&quot;size-full wp-image-673&quot; title=&quot;沉淀时光&quot; src=&quot;http://www.longbill.cn/blog/wp-content/uploads/2009/09/logo.jpg&quot; alt=&quot;Chendian.net&quot; width=&quot;331&quot; height=&quot;80&quot; /&gt;&lt;/a&gt;&lt;p class=&quot;wp-caption-text&quot;&gt;Chendian.net&lt;/p&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606825/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/09/omegle_chendian_net/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606825/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606825/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/09/omegle_chendian_net/feed/</wfw:commentRss><slash:comments>20</slash:comments><description>由于最近omegle很火。于是就想copy一个到国内。 正好我以前做过聊天室～哈哈。2天就搞定了。 先是在学校内部测试，修正了一些bug 。然后就放到外网。 因为聊天过程中会建立很多长连接。所以把服务器上的apache换成了nginx。希望能扛得住那么多的并发。
域名： http://chendian.net  沉淀时光。
网站的功能是跟一个陌生人聊天，随机配对。而且是只能2个人聊。不是传统的聊天室。&lt;img src=&quot;http://www1.feedsky.com/t1/324606825/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/09/omegle_chendian_net/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606825/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606825/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>AJAX</category><category>PHP</category><category>nginx</category><category>程序们</category><category>聊天室</category><category>Javascript</category><pubDate>Wed, 30 Sep 2009 16:31:45 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/09/omegle_chendian_net/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=672</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/09/omegle_chendian_net/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606825/5519543</fs:itemid></item><item><title>Love story Meets Viva la vida</title><link>http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/</link><content:encoded>&lt;p&gt;Taylor Swift 和 Coldplay 都是我非常崇拜的歌手和乐队。都是可以堪称天才的人物。Taylor的Love Story我尤其喜欢，那种Country + pop的风格感觉很爽，外加Taylor的美丽的声音和外表～ 。。。Coldplay 就不说了，如果你不知道他们，那我也无话可说。。&lt;/p&gt;
&lt;p&gt;昨天在校内上看到有人分享钢琴家Jon Schmidt与大提琴家Steven Sharp Nelson改编的一首曲子，融合了Taylor Swift 的Love Story 和 Coldplay 的 Viva la vida，听了之后非常有感觉，于是贴出来分享一下。&lt;/p&gt;
&lt;p&gt;&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;480&quot; height=&quot;400&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://player.youku.com/player.php/sid/XMTAxMDY2ODg4/v.swf&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;480&quot; height=&quot;400&quot; src=&quot;http://player.youku.com/player.php/sid/XMTAxMDY2ODg4/v.swf&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;再贴出出处1：Taylor Swift &lt;em&gt;Love Story&lt;span id=&quot;more-667&quot;&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;480&quot; height=&quot;400&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://player.youku.com/player.php/sid/XMTAxNzM3MzMy/v.swf&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;480&quot; height=&quot;400&quot; src=&quot;http://player.youku.com/player.php/sid/XMTAxNzM3MzMy/v.swf&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;出处2：Coldplay &lt;em&gt;Viva la vida&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;480&quot; height=&quot;400&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://player.youku.com/player.php/sid/XNDkzODY2MjA=/v.swf&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;480&quot; height=&quot;400&quot; src=&quot;http://player.youku.com/player.php/sid/XNDkzODY2MjA=/v.swf&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;如果想下载Love Story Meets Viva La Vida的mp3版本，&lt;a href=&quot;http://mp3.baidu.com/m?f=nidx&amp;amp;tn=baidump3&amp;amp;ct=134217728&amp;amp;lf=&amp;amp;rn=&amp;amp;word=love+story+meets+viva+la+vida&amp;amp;lm=-1&quot; target=&quot;_blank&quot;&gt;请猛击这里&lt;/a&gt;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606826/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606826/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606826/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/feed/</wfw:commentRss><slash:comments>6</slash:comments><description>Taylor Swift 和 Coldplay 都是我非常崇拜的歌手和乐队。都是可以堪称天才的人物。Taylor的Love Story我尤其喜欢，那种Country + pop的风格感觉很爽，外加Taylor的美丽的声音和外表～ 。。。Coldplay 就不说了，如果你不知道他们，那我也无话可说。。
昨天在校内上看到有人分享钢琴家Jon Schmidt与大提琴家Steven Sharp Nelson改编的一首曲子，融合了Taylor Swift 的Love Story 和 Coldplay 的 Viva la vida，听了之后非常有感觉，于是贴出来分享一下。

再贴出出处1：Taylor Swift Love Story

出处2：Coldplay Viva la vida

如果想下载Love Story Meets Viva La Vida的mp3版本，请猛击这里&lt;img src=&quot;http://www1.feedsky.com/t1/324606826/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606826/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606826/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>音乐</category><category>生活</category><pubDate>Thu, 17 Sep 2009 12:53:18 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=667</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/09/love-story-meets-viva-la-vida/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606826/5519543</fs:itemid></item><item><title>关于PHP输出文件给浏览器下载时的编码问题</title><link>http://www.longbill.cn/blog/2009/08/php_download_filename_charset/</link><content:encoded>&lt;p&gt;    做文件管理器的时候会遇到让PHP输出一个文件给浏览器下载。我们都知道要发一下一些header:&lt;/p&gt;
&lt;pre&gt;&lt;code lang=&quot;php&quot;&gt;
$filename = &quot;下载文件名&quot;;
$filesize = filesize('文件地址'); //获得文件大小
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: application/force-download');
header('Content-Disposition: attachment; filename=&quot;'.$filename.'&quot;');
header('Content-length: '.$filesize);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后再用readfile把文件内容输出给浏览器。但是会遇到一个很烦的问题：弹出文件下载框时，显示的文件名在不同的浏览器下面是不一样的。有的是乱码，有的是空白。 为了解决这个问题，我找了查了很多资料。最终找到一个好的解决办法：&lt;/p&gt;
&lt;p&gt;文件名统一使用utf-8编码，然后针对ie浏览器进行一次rawurlencode编码。&lt;br /&gt;
比如：&lt;br /&gt;
if (preg_match(&amp;#8217;/MSIE/&amp;#8217;,$_SERVER['HTTP_USER_AGENT']))  $filename = rawurlencode($filename);&lt;br /&gt;
这样在不同操作系统，不同浏览器里面，下载文件的时候，中文文件名都能正确显示了。&lt;br /&gt;
测试通过：Safari4(MAC) ,Firefox3.5(MAC), Firefox3(Win), IE7/8(Win), Chrome(Win)&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/324606827/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/08/php_download_filename_charset/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606827/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606827/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</content:encoded><wfw:commentRss>http://www.longbill.cn/blog/2009/08/php_download_filename_charset/feed/</wfw:commentRss><slash:comments>4</slash:comments><description>    做文件管理器的时候会遇到让PHP输出一个文件给浏览器下载。我们都知道要发一下一些header:

$filename = &quot;下载文件名&quot;;
$filesize = filesize('文件地址'); //获得文件大小
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: application/force-download');
header('Content-Disposition: attachment; filename=&quot;'.$filename.'&quot;');
header('Content-length: '.$filesize);

然后再用readfile把文件内容输出给浏览器。但是会遇到一个很烦的问题：弹出文件下载框时，显示的文件名在不同的浏览器下面是不一样的。有的是乱码，有的是空白。 为了解决这个问题，我找了查了很多资料。最终找到一个好的解决办法：
文件名统一使用utf-8编码，然后针对ie浏览器进行一次rawurlencode编码。
比如：
if (preg_match(&amp;#8217;/MSIE/&amp;#8217;,$_SERVER['HTTP_USER_AGENT']))  $filename = rawurlencode($filename);
这样在不同操作系统，不同浏览器里面，下载文件的时候，中文文件名都能正确显示了。
测试通过：Safari4(MAC) ,Firefox3.5(MAC), Firefox3(Win), IE7/8(Win), Chrome(Win)&lt;img src=&quot;http://www1.feedsky.com/t1/324606827/longbill/feedsky/s.gif?r=http://www.longbill.cn/blog/2009/08/php_download_filename_charset/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/longbill/324606827/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/longbill/324606827/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category>PHP</category><category>程序们</category><pubDate>Sat, 01 Aug 2009 15:36:48 +0800</pubDate><author>Longbill</author><comments>http://www.longbill.cn/blog/2009/08/php_download_filename_charset/#comments</comments><guid isPermaLink="false">http://www.longbill.cn/blog/?p=660</guid><dc:creator>Longbill</dc:creator><fs:srclink>http://www.longbill.cn/blog/2009/08/php_download_filename_charset/</fs:srclink><fs:srcfeed>http://www.longbill.cn/blog/feed/</fs:srcfeed><fs:itemid>feedsky/longbill/~7410024/324606827/5519543</fs:itemid></item></channel></rss>