<?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.adamstudio.cn/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adamstudio.cn</link>
	<description>稠密的时间 稀疏的事件 圆润的思念 尖锐的蜕变</description>
	<lastBuildDate>Sat, 04 Feb 2012 10:31:11 +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>以阴谋论的眼光来看《鸿门宴》</title>
		<link>http://www.adamstudio.cn/index.php/2012/yi_yin_mou_lun_de_yan_guang_lai_kan_hong_men_yan/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/yi_yin_mou_lun_de_yan_guang_lai_kan_hong_men_yan/#comments</comments>
		<pubDate>Sat, 04 Feb 2012 10:31:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的作品]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=762</guid>
		<description><![CDATA[《鸿门宴》的改编比较大胆，有新意。历史的真相只有一个，但猜测却又无限多种，让我们以阴谋论的眼光来看看这段传奇： 为什么让刘邦送虞姬？ 项羽这个英雄确实没能过虞姬这个美人关。每天的枕边风让项羽自信心极度膨胀。范增看在眼里急在心里，自己从小培养大的苗子眼看就要闪着腰了，能不急么。但现在自己跟项羽谈工作交心的时间不足2小时/每天，哪抵得上虞姬白天5个小时，晚上4个小时的迷魂汤管用。范增知道“先入咸阳者封秦王”是楚怀王的离间计。但如果能借这个机会干掉虞姬，倒也不错。于是他让项羽安排刘邦来送虞姬。 范增早就看出虞姬是个祸害，不是美女间谍也是红颜祸水，所以借这个机会想打发掉虞姬。他预计如果虞姬不是间谍，那么这一趟孤男寡女，熟饭改成稀粥。让占了便宜的刘邦不好意思再去抢被自己扣了绿帽子兄弟的生意。如果虞姬是间谍，那么刘邦有可能假借送嫂子这个机会去抢咸阳。到时候让发怒的项羽灭了咸阳城，到时候用计在兵荒马乱中把虞姬快递到阴曹地府，既除掉了刘邦，又得了个耳根子清静。 范增的idea看似是一个地税不漏的计策。没想到的是冒出个抢饭碗的张良，所以后来他自己也感慨，敌人就像一面镜子，总能在对面找到个跟自己面对面较量的。张良让百姓上城墙，如果杀进去就等于屠城，落得个秦始皇二世的绰号的话，必然失了人心。后面才有了将计就计的鸿门宴。 虞姬到底是干嘛的？ 刘邦出身平民，想与项羽攀上关系。于是挖掘了个歌女，安排了一出英雄救美+英雄救英雄的好戏。刘邦这招一方面可以拉近与项羽的关系，另一方面从长远看有希望让项羽爱江山更爱美人，成为为自己垫背的。 另一种可能是秦朝的人，他那儿部门庞大，挑出一个虞姬，集训一下再安排给项羽，干干无间道的工作。 最善良的一种猜测是，是一绝色美女，EQ高到侧漏，IQ低到秀逗。不用任何计策就把项羽迷得晕晕乎乎。  范增是怎么死的？ 史书记载是被离间后再回乡路上病死的，但我觉得很可能是被张良派人杀的。而锦囊，我觉得是不存在的。 &#160;]]></description>
			<content:encoded><![CDATA[<p>《鸿门宴》的改编比较大胆，有新意。历史的真相只有一个，但猜测却又无限多种，让我们以阴谋论的眼光来看看这段传奇：</p>
<h4>为什么让刘邦送虞姬？</h4>
<p>项羽这个英雄确实没能过虞姬这个美人关。每天的枕边风让项羽自信心极度膨胀。范增看在眼里急在心里，自己从小培养大的苗子眼看就要闪着腰了，能不急么。但现在自己跟项羽谈工作交心的时间不足2小时/每天，哪抵得上虞姬白天5个小时，晚上4个小时的迷魂汤管用。范增知道“先入咸阳者封秦王”是楚怀王的离间计。但如果能借这个机会干掉虞姬，倒也不错。于是他让项羽安排刘邦来送虞姬。</p>
<p>范增早就看出虞姬是个祸害，不是美女间谍也是红颜祸水，所以借这个机会想打发掉虞姬。他预计如果虞姬不是间谍，那么这一趟孤男寡女，熟饭改成稀粥。让占了便宜的刘邦不好意思再去抢被自己扣了绿帽子兄弟的生意。如果虞姬是间谍，那么刘邦有可能假借送嫂子这个机会去抢咸阳。到时候让发怒的项羽灭了咸阳城，到时候用计在兵荒马乱中把虞姬快递到阴曹地府，既除掉了刘邦，又得了个耳根子清静。</p>
<p>范增的idea看似是一个地税不漏的计策。没想到的是冒出个抢饭碗的张良，所以后来他自己也感慨，敌人就像一面镜子，总能在对面找到个跟自己面对面较量的。张良让百姓上城墙，如果杀进去就等于屠城，落得个秦始皇二世的绰号的话，必然失了人心。后面才有了将计就计的鸿门宴。</p>
<h4>虞姬到底是干嘛的？</h4>
<p>刘邦出身平民，想与项羽攀上关系。于是挖掘了个歌女，安排了一出英雄救美+英雄救英雄的好戏。刘邦这招一方面可以拉近与项羽的关系，另一方面从长远看有希望让项羽爱江山更爱美人，成为为自己垫背的。<br />
另一种可能是秦朝的人，他那儿部门庞大，挑出一个虞姬，集训一下再安排给项羽，干干无间道的工作。<br />
最善良的一种猜测是，是一绝色美女，EQ高到侧漏，IQ低到秀逗。不用任何计策就把项羽迷得晕晕乎乎。</p>
<h4> 范增是怎么死的？</h4>
<p>史书记载是被离间后再回乡路上病死的，但我觉得很可能是被张良派人杀的。而锦囊，我觉得是不存在的。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/yi_yin_mou_lun_de_yan_guang_lai_kan_hong_men_yan/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>FlashBuilder 4.6安装手记</title>
		<link>http://www.adamstudio.cn/index.php/2012/flashbuilder_4_6_an_zhuang_shou_ji/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/flashbuilder_4_6_an_zhuang_shou_ji/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 07:42:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[网络技术]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=760</guid>
		<description><![CDATA[有几个月没有摸FB了，换笔记本后，也没有安装。根据又中国特色的社会主义特点，自然要安装最新版本Flash Builder 4.6。Adobe下载界面提示此试用版本需要先安装Eclipse，无所谓了，反正机器上有。压缩包大概有800多兆，安装时提示错误。后来一查，很多电脑需要删除“C:\Program Files\Common Files\Adobe”文件夹方可安装，这下可麻烦了。 不是我舍不得删除，而是根本删不干净。我先删除了CS5.5里的其他软件，但“C:\Program Files\Common Files\Adobe”里面有两个文件夹怎么都删不掉，提示说需要system账户权限，即使用管理员角色也不行！即使按F8进安全模式也不行。网上有一些教程说用命令行打开超级终端或者提高Administrator的权限，但非常复杂。 最简单的方法是：在删除不了的文件上右键/属性，修改文件的所有人为Administrator，然后就可以删除了！ 经过漫长的等待，终于安装好Flash Builder 4.6了。至于被删掉的CS5.5 软件能不能再次安装，只有下次试试才知道了。]]></description>
			<content:encoded><![CDATA[<p>有几个月没有摸FB了，换笔记本后，也没有安装。根据又中国特色的社会主义特点，自然要安装最新版本Flash Builder 4.6。Adobe下载界面提示此试用版本需要先安装Eclipse，无所谓了，反正机器上有。压缩包大概有800多兆，安装时提示错误。后来一查，很多电脑需要删除“C:\Program Files\Common Files\Adobe”文件夹方可安装，这下可麻烦了。</p>
<p>不是我舍不得删除，而是根本删不干净。我先删除了CS5.5里的其他软件，但“C:\Program Files\Common Files\Adobe”里面有两个文件夹怎么都删不掉，提示说需要system账户权限，即使用管理员角色也不行！即使按F8进安全模式也不行。网上有一些教程说用命令行打开超级终端或者提高Administrator的权限，但非常复杂。</p>
<p>最简单的方法是：在删除不了的文件上右键/属性，修改文件的所有人为Administrator，然后就可以删除了！</p>
<p>经过漫长的等待，终于安装好Flash Builder 4.6了。至于被删掉的CS5.5 软件能不能再次安装，只有下次试试才知道了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/flashbuilder_4_6_an_zhuang_shou_ji/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>YII:如何在CActiveDataProvider中调用关联表并在view中显示其数据</title>
		<link>http://www.adamstudio.cn/index.php/2012/yii_customize_cactivedataprovider/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/yii_customize_cactivedataprovider/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 23:13:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[YII]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=746</guid>
		<description><![CDATA[YII的CListView使用起来很方便，并且它的dataprovider也是可以自定义的。比如想要获取其它表里的内容，可以在controller中这样写： $dataProvider=new CActiveDataProvider&#40;'tableA', array&#40; 'criteria'=&#38;gt;array&#40; 'select'=&#38;gt;'ta.*', 'condition'=&#38;gt;'tb.status=1', 'alias'=&#38;gt;'ta', 'order'=&#38;gt;'id DESC', 'join'=&#38;gt;'JOIN '.tableB::model&#40;&#41;-&#38;gt;tableName&#40;&#41;.' ta ON ta.pid=tb.id', 'with'=&#38;gt;'p', &#41;, 'pagination'=&#38;gt;array&#40; 'pageSize'=&#38;gt;20, &#41;, &#41;&#41;; 在CListView的view中使用的时候： echo CHtml::encode&#40;$data-&#38;gt;id&#41;; echo CHtml::encode&#40;$data-&#38;gt;p&#91;'title'&#93;&#41;; 注意，“p”是在前面&#8217;with&#8217;=&#62;&#8217;p'中定义的。用以上方法可以大大扩充dataprovier的使用范围。 如果需要更复杂的数据整理，建议自行提取数据放入array，然后再用CArrayDataProvider将Array转化为dataprovider。]]></description>
			<content:encoded><![CDATA[<p>YII的CListView使用起来很方便，并且它的dataprovider也是可以自定义的。比如想要获取其它表里的内容，可以在controller中这样写：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$dataProvider</span><span style="color: #339933;">=</span><span style="color: #000000; font-weight: bold;">new</span> CActiveDataProvider<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tableA'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			    <span style="color: #0000ff;">'criteria'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span>array<span style="color: #009900;">&#40;</span>
					<span style="color: #0000ff;">'select'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'ta.*'</span><span style="color: #339933;">,</span>
			        <span style="color: #0000ff;">'condition'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'tb.status=1'</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'alias'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'ta'</span><span style="color: #339933;">,</span>
			        <span style="color: #0000ff;">'order'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'id DESC'</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'join'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'JOIN '</span><span style="color: #339933;">.</span>tableB<span style="color: #339933;">::</span><span style="color: #004000;">model</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>tableName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' ta ON ta.pid=tb.id'</span><span style="color: #339933;">,</span>
					<span style="color: #0000ff;">'with'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">'p'</span><span style="color: #339933;">,</span>
			    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			    <span style="color: #0000ff;">'pagination'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span>array<span style="color: #009900;">&#40;</span>
			        <span style="color: #0000ff;">'pageSize'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span>
			    <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>在CListView的view中使用的时候：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> CHtml<span style="color: #339933;">::</span><span style="color: #004000;">encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>id<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> CHtml<span style="color: #339933;">::</span><span style="color: #004000;">encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>p<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>注意，“p”是在前面&#8217;with&#8217;=&gt;&#8217;p'中定义的。用以上方法可以大大扩充dataprovier的使用范围。<br />
<strong>如果需要更复杂的数据整理，建议自行提取数据放入array，然后再用CArrayDataProvider将Array转化为dataprovider。</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/yii_customize_cactivedataprovider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL中使用JOIN和零时变量一例</title>
		<link>http://www.adamstudio.cn/index.php/2012/mysql_zhong_shi_yong_join_he_ling_shi_bian_liang_yi_li/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/mysql_zhong_shi_yong_join_he_ling_shi_bian_liang_yi_li/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 11:02:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=736</guid>
		<description><![CDATA[SELECT @id:=ho.hotel_id,hl.hotel_email FROM order_info oi JOIN hotel_order ho ON &#40;ho.order_id=oi.order_id&#41; JOIN hotel_list hl ON &#40;hl.hotel_id=@id&#41; WHERE oi.order_id=1]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">SELECT</span> @id<span style="color: #CC0099;">:=</span>ho.hotel_id<span style="color: #000033;">,</span>hl.hotel_email
<span style="color: #990099; font-weight: bold;">FROM</span> order_info oi
<span style="color: #990099; font-weight: bold;">JOIN</span> hotel_order ho <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #FF00FF;">&#40;</span>ho.order_id<span style="color: #CC0099;">=</span>oi.order_id<span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">JOIN</span> hotel_list hl <span style="color: #990099; font-weight: bold;">ON</span> <span style="color: #FF00FF;">&#40;</span>hl.hotel_id<span style="color: #CC0099;">=</span>@id<span style="color: #FF00FF;">&#41;</span>
<span style="color: #990099; font-weight: bold;">WHERE</span> oi.order_id<span style="color: #CC0099;">=</span><span style="color: #008080;">1</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/mysql_zhong_shi_yong_join_he_ling_shi_bian_liang_yi_li/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何设置apache的virtualhost?</title>
		<link>http://www.adamstudio.cn/index.php/2012/ru_he_she_zhi_apache_de_virtualhost/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/ru_he_she_zhi_apache_de_virtualhost/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 08:13:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=728</guid>
		<description><![CDATA[以下代码可以实现在一台电脑、一个ip下多个网站并存： NameVirtualHost *:80 ServerName www.site1.cn ServerAlias domain.tld *.domain.tld DocumentRoot D:/www/site1 ServerName www.site2.cn DocumentRoot D:/www/site2 注意第一行别落下！]]></description>
			<content:encoded><![CDATA[<p>以下代码可以实现在一台电脑、一个ip下多个网站并存：<br />
<code><br />
NameVirtualHost *:80<br />
<VirtualHost *:80><br />
    ServerName www.site1.cn<br />
    ServerAlias domain.tld *.domain.tld<br />
    DocumentRoot D:/www/site1<br />
</VirtualHost></p>
<p><VirtualHost *:80><br />
    ServerName www.site2.cn<br />
    DocumentRoot D:/www/site2<br />
</VirtualHost><br />
</code></p>
<p>注意第一行别落下！</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/ru_he_she_zhi_apache_de_virtualhost/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>各个视频网站视频尺寸要求</title>
		<link>http://www.adamstudio.cn/index.php/2012/ge_ge_shi_pin_wang_zhan_shi_pin_chi_cun_yao_qiu/</link>
		<comments>http://www.adamstudio.cn/index.php/2012/ge_ge_shi_pin_wang_zhan_shi_pin_chi_cun_yao_qiu/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 08:59:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=721</guid>
		<description><![CDATA[http://www.cnblogs.com/MrYang/archive/2011/08/20/2147385.html]]></description>
			<content:encoded><![CDATA[<p>http://www.cnblogs.com/MrYang/archive/2011/08/20/2147385.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2012/ge_ge_shi_pin_wang_zhan_shi_pin_chi_cun_yao_qiu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Builder技巧</title>
		<link>http://www.adamstudio.cn/index.php/2011/flash-builder-shortcut/</link>
		<comments>http://www.adamstudio.cn/index.php/2011/flash-builder-shortcut/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 01:05:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=720</guid>
		<description><![CDATA[http://www.riadev.com/flex-thread-469-1-1.html]]></description>
			<content:encoded><![CDATA[<p>http://www.riadev.com/flex-thread-469-1-1.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2011/flash-builder-shortcut/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Papervision3D中绘制线条</title>
		<link>http://www.adamstudio.cn/index.php/2011/papervision3d-use-line3d/</link>
		<comments>http://www.adamstudio.cn/index.php/2011/papervision3d-use-line3d/#comments</comments>
		<pubDate>Fri, 16 Sep 2011 00:35:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[网络技术]]></category>
		<category><![CDATA[网络技术-ActionScript 3]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=719</guid>
		<description><![CDATA[线条的绘制有点特别，线条本身是继承的Line3D,但必须要放入Lines3D之后才能使用。 lines = new Lines3D; line = new Line3D&#40;lines, new LineMaterial&#40;0xFF0000&#41;, 2, new Vertex3D&#40;450, 0, 0&#41;, new Vertex3D&#40;500, 0, 0&#41;&#41;; lines.addLine&#40;line&#41;; default_scene.addChild&#40;lines&#41;; 注意：lines可以包含多条line]]></description>
			<content:encoded><![CDATA[<p>线条的绘制有点特别，线条本身是继承的Line3D,但必须要放入Lines3D之后才能使用。</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">lines <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Lines3D<span style="color: #339933;">;</span>
line <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Line3D<span style="color: #009900;">&#40;</span>lines<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> LineMaterial<span style="color: #009900;">&#40;</span>0xFF0000<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">2</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Vertex3D<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">450</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">new</span> Vertex3D<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">500</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
lines.<span style="color: #660066;">addLine</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
default_scene.<span style="color: #660066;">addChild</span><span style="color: #009900;">&#40;</span>lines<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>注意：lines可以包含多条line</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2011/papervision3d-use-line3d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YII:使用jQuery实现AJAX心得</title>
		<link>http://www.adamstudio.cn/index.php/2011/yii-jquery-ajax-experience/</link>
		<comments>http://www.adamstudio.cn/index.php/2011/yii-jquery-ajax-experience/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 09:30:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[YII]]></category>
		<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=718</guid>
		<description><![CDATA[随着开发的不断深入，这两天在Yii框架下利用jQuery实现了AJAX。关键点有如下： //listen to main element with ajaxlink style class name $&#40;document&#41;.ready&#40;function&#40;&#41;&#123; //after clicking a prediction intro $&#40;'.ajaxlink'&#41;.click&#40;function&#40;&#41;&#123; //ajax scan all dom element at the begining //and will not scan again even if class name is changed //so need to check the class name for sure if&#40;$&#40;this&#41;.attr&#40;'class'&#41;==&#34;ajaxlink&#34;&#41;&#123; targetID=$&#40;this&#41;.attr&#40;'pid'&#41;; $.ajax&#40;&#123; type:&#34;POST&#34;, url:'index.php?r=prediction/load', data:&#34;id=&#34;+targetID, success:function&#40;data&#41;&#123; $&#40;'#detail_'+targetID&#41;.html&#40;data&#41;; &#125; &#125;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>随着开发的不断深入，这两天在Yii框架下利用jQuery实现了AJAX。关键点有如下：</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//listen to main element with ajaxlink style class name</span>
    $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">//after clicking a prediction intro</span>
       $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.ajaxlink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
           <span style="color: #006600; font-style: italic;">//ajax scan all dom element at the begining</span>
           <span style="color: #006600; font-style: italic;">//and will not scan again even if class name is changed</span>
           <span style="color: #006600; font-style: italic;">//so need to check the class name for sure</span>
           <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'class'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;ajaxlink&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            targetID<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'pid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            $.<span style="color: #660066;">ajax</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
                type<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;POST&quot;</span><span style="color: #339933;">,</span>
                url<span style="color: #339933;">:</span><span style="color: #3366CC;">'index.php?r=prediction/load'</span><span style="color: #339933;">,</span>
                data<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;id=&quot;</span><span style="color: #339933;">+</span>targetID<span style="color: #339933;">,</span>
                success<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#detail_'</span><span style="color: #339933;">+</span>targetID<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
           <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>核心是初始化文档时侦听带有特定样式名的元素，如果它（们）被点击，则激发js函数进行处理。这里是把id以post的形式发送到index.php?r=prediction/load，并将返回值放到id为#detail_x的元素中。实际开发过程中发现jQuery建立侦听后不能再添加侦听或者消除已建立的侦听，即使改变了样式名也不行。所以上面代码中加了一个对样式名的判断，虽然改变样式名不能消除侦听，但可以通过判断不执行相应操作。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2011/yii-jquery-ajax-experience/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yii:通过Session为user添加变量</title>
		<link>http://www.adamstudio.cn/index.php/2011/yii-add-user-parameter/</link>
		<comments>http://www.adamstudio.cn/index.php/2011/yii-add-user-parameter/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 19:49:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[YII]]></category>
		<category><![CDATA[我的观点]]></category>

		<guid isPermaLink="false">http://www.adamstudio.cn/?p=717</guid>
		<description><![CDATA[在YII简单角色设定一文中介绍了如何设定user的角色。实际应用中往往还需要为user添加更多的变量。在userIdentity文件中可以这样写 if &#40;$role &#62;= 1&#41; &#123; $auth = Yii::app&#40;&#41;-&#62;authManager; $auth-&#62;createRole&#40;'admin'&#41;; $auth-&#62;assign&#40;'admin', $this&#41;; $this-&#62;setState&#40;'level', &#34;admin&#34;&#41;; &#125; else &#123; $this-&#62;setState&#40;'level', &#34;user&#34;&#41;; &#125; 之后就可以这样应用level变量了 if&#40;!Yii::app&#40;&#41;-&#62;user-&#62;isGuest&#41; echo&#40;Yii::app&#40;&#41;-&#62;user-&#62;level&#41;;]]></description>
			<content:encoded><![CDATA[<p>在YII简单角色设定一文中介绍了如何设定user的角色。实际应用中往往还需要为user添加更多的变量。在userIdentity文件中可以这样写</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$role</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$auth</span> <span style="color: #339933;">=</span> Yii<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">authManager</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">createRole</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$auth</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">assign</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setState</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;admin&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setState</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'level'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;user&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span></pre></div></div>

<p>之后就可以这样应用level变量了</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>Yii<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isGuest</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span>Yii<span style="color: #339933;">::</span><span style="color: #004000;">app</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">level</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.adamstudio.cn/index.php/2011/yii-add-user-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

