<?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>Developer-Tricks</title>
	<atom:link href="http://dev-tricks.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev-tricks.com</link>
	<description>&#34;SELECT `tricks` FROM `developer-tricks` WHERE `tricks` in (&#039;php&#039;,&#039;jQuery&#039;,&#039;HTML5&#039;,&#039;CSS3&#039;);&#34;</description>
	<lastBuildDate>Wed, 22 Feb 2012 09:11:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>A CSS3 quiz</title>
		<link>http://dev-tricks.com/a-css3-quiz/</link>
		<comments>http://dev-tricks.com/a-css3-quiz/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 09:11:56 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=528</guid>
		<description><![CDATA[This may take you a little time to accomplish it , but i think it valueable.The quiz below is very funny, test what degree you master the css3. 1.Can you can specify more than one box shadow to an element? &#8230; <a href="http://dev-tricks.com/a-css3-quiz/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This may take you a little time to accomplish it , but i think it valueable.The quiz below is very funny, test what degree you master the css3.<br />
1.Can you can specify more than one box shadow to an element?<br />
　　a.yes<br />
　　b.no<br />
2.box-shadow: 5px 5px 5px #888; What does the third value in the declaration specify?<br />
　　a.X off set<br />
　　b.Y offset<br />
　　c.Blur radius<br />
　　d.Margin<br />
3.What does the a in RGBa stand for?<br />
　　a.Alt-transparency<br />
　　b.Alpha<br />
　　c.Alphabetic<br />
　　d.Alphanumberic<br />
4.RGBa can not be applied to which of these sections?<br />
　　a.Backgrounds<br />
　　b.Borders<br />
　　c.Shadows<br />
　　d.None of the above. RGBa can be applied to any property associated with color<br />
5.Which of these declarations will result in a box whose bottom right corner has a radius of 20px?<br />
　　a.border-radius: 40px 20px 20px 80px;<br />
　　b.border-radius: 40px 20px;<br />
　　c.border-radius: 20px 20px 40px 20px;<br />
　　d.border-radius: 20px 40px 60px 80px;<br />
6.Is this a valid declaration, under CSS3? text-shadow: 0 1px 0 #fff, 0 -1px 0 #000;<br />
　　a.Yes<br />
　　b.No<br />
7.Which of the below is a valid way to embed and use non-standard fonts?<br />
　　a.@font-face {<br />
　　　　font-family: &#8216;Droid Sans&#8217;;<br />
　　　　src: href(&#8216;/DroidSans.otf&#8217;) format(&#8216;opentype&#8217;);<br />
　　　}<br />
　　b.@font-face {<br />
　　　　font-family: &#8216;Droid Sans&#8217;;<br />
　　　　href: url(&#8216;/DroidSans.otf&#8217;) format(&#8216;opentype&#8217;);<br />
　　　}<br />
　　c.@font-face {<br />
　　　　add-font: &#8216;Droid Sans&#8217;;<br />
　　　　src: url(&#8216;/DroidSans.otf&#8217;) format(&#8216;opentype&#8217;);<br />
　　　}<br />
　　d.@font-face {<br />
　　　　font-family: &#8216;Droid Sans&#8217;;<br />
　　　　src: url(&#8216;/DroidSans.otf&#8217;) format(&#8216;opentype&#8217;);<br />
　　}<br />
8.Can the values of red, green and blue be interchanged in the RGBa notation?<br />
　　a.Yes<br />
　　b.No<br />
9.Which of these is a keyword that can be used when using the box-shadow property?<br />
　　a.Engrave<br />
　　b.Emboss<br />
　　c.Inset<br />
　　d.Bevel<br />
10.Can you use a negative number as the blur radius value?<br />
　　a.Yes<br />
　　b.No<br />
11.Including the optional parameters, how many parameters does a box shadow declaration take?<br />
　　a.3<br />
　　b.4<br />
　　c.5<br />
　　d.This is a trick question. The correct answer is not a choice.<br />
12.Which new property, introduced in CSS3, allows you to wrap long words?<br />
　　a.auto-word-wrap<br />
　　b.word-wrap-on<br />
　　c.wrap<br />
　d.word-wrap<br />
13.Which vendor specific prefix do you have to use to target Opera?<br />
　　a.-opera-<br />
　　b.-o-<br />
　　c.-vendor-<br />
　　d.-custom-<br />
14.Which of the following pseudo selectors isn&#8217;t a part of CSS3?<br />
　　a.enabled<br />
　　b.disabled<br />
　　c.empty<br />
　　d.visible<br />
15.What does the :empty pseudo class target?<br />
　　a.Matches elements that are invisible<br />
　　b.Matches elements that have no parents<br />
　　c.Matches elements that have no children<br />
　　d.Matches elements that have no CSS associated with it.<br />
16.Using the border-radius property, you can style either all four borders or none at all. This statement is..<br />
　　a.True<br />
　　b.False<br />
17.Will the :empty pseduo class target an element if it only contains comments inside?<br />
　　a.Yes<br />
　　b.No</p>
<p><strong>The correct answers:</strong><br />
acbdaadbcbddbdcba</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/a-css3-quiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to use jquery easing</title>
		<link>http://dev-tricks.com/how-to-use-jquery-easing/</link>
		<comments>http://dev-tricks.com/how-to-use-jquery-easing/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 09:34:01 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[JQUERY]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=520</guid>
		<description><![CDATA[I have been use jQuery for a long time, but quite know about the multiple effect of the easing plugin, today i find some thing useful, and summary it here. You must introduce the plugin after your jquery invoke. 1.Change &#8230; <a href="http://dev-tricks.com/how-to-use-jquery-easing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been use jQuery for a long time, but quite know about the multiple effect of the easing plugin, today i find some thing useful, and summary it here.</p>
<p>You must introduce the plugin after your jquery invoke.</p>
<p>1.Change the default animate effect of jQuery</p>
<pre class="js">
jQuery.easing.def = "effect-string";
</pre>
<p>With this code in the top of your js code, then the default animate effect will change to the string  you defined.</p>
<p>2.Make a difference of your multiple action, for example:</p>
<pre class="js">
$(ele).animate({
   top: "+200",
   right: "-=100"
},{
   specialEasing:{
     top: 'swing',
     right: 'easeOutBounce'
   }
});
</pre>
<p>or</p>
<pre class="js">
$(ele).animate({
   top: [500, 'swing'],
   right: [200, 'easeOutBounce']
},{
   specialEasing:{
     top: 'swing',
     right: 'easeOutBounce'
   }
});
</pre>
<p>You can use it after the version 1.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/how-to-use-jquery-easing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips of Operator Precedence</title>
		<link>http://dev-tricks.com/tips-of-operator-precedence/</link>
		<comments>http://dev-tricks.com/tips-of-operator-precedence/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 08:15:59 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=514</guid>
		<description><![CDATA[I saw this snippet in my one qq group: $a=$b=0; if($a=0 &#124;&#124; $b =2) { var_dump($a,$b); } This outputs: bool(true) int(2) Do you know why $a changed to the boolean true? Someone explains that because the &#8216;&#124;&#124;&#8217; operator&#8217;s precedence is &#8230; <a href="http://dev-tricks.com/tips-of-operator-precedence/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I saw this snippet in my one qq group:</p>
<pre class="php">
$a=$b=0;
if($a=0 || $b =2)
{
    var_dump($a,$b);
}
</pre>
<p>This outputs:</p>
<pre class="php">
bool(true)
int(2)
</pre>
<p>Do you know why $a changed to the boolean true?<br />
Someone explains that because the &#8216;||&#8217; operator&#8217;s precedence is big than &#8216;=&#8217;,so the code is equivalent to</p>
<pre class="class">
if($a= (0 || $b =2))
{
    var_dump($a,$b);
}
</pre>
<p>And that&#8217;s right!<br />
Of course, you should not put an assignment in that situation.<br />
Here is the operator precedence of all the operators in php:</p>
<p><a href="http://dev-tricks.com/wp-content/uploads/2012/02/precedence.png" target="_blank"><img src="http://dev-tricks.com/wp-content/uploads/2012/02/precedence-300x275.png" alt="" title="precedence" width="300" height="275" class="alignnone size-medium wp-image-515" /></a></p>
<p>The precedence of an operator specifies how &#8220;tightly&#8221; it binds two expressions together. For example, in the expression 1 + 5 * 3, the answer is 16 and not 18 because the multiplication (&#8220;*&#8221;) operator has a higher precedence than the addition (&#8220;+&#8221;) operator. Parentheses may be used to force precedence, if necessary. For instance: (1 + 5) * 3 evaluates to 18.</p>
<p>When operators have equal precedence, their associativity decides whether they are evaluated starting from the right, or starting from the left.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/tips-of-operator-precedence/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Studio-5th</title>
		<link>http://dev-tricks.com/studio-5th/</link>
		<comments>http://dev-tricks.com/studio-5th/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 17:39:48 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Autobiography]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=510</guid>
		<description><![CDATA[Since i decided to establish a studio in my hometown, Sanmenxia city, i did&#8217;t know how to begin with it.The most important and difficult thing is to get customers, how to get and server them. I did a start today. &#8230; <a href="http://dev-tricks.com/studio-5th/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since i decided to establish a studio in my hometown, Sanmenxia city, i did&#8217;t know how to begin with it.The most important and difficult thing is to get customers, how to get and server them.<br />
I did a start today.<br />
1.Print business cards.The studio name is &#8216;<a href="http://www.studio-5th.com" title="studio-5th" target="_blank">studio-5th</a>&#8216;, to meet with the outsourcing, i want make it more meaningful, that means, do the work with html5 in the future.<br />
2.Design the web page of <a href="http://www.studio-5th.com" title="studio-5th" target="_blank">studio-5th</a>, i had never did that job before, and i copy the apple&#8217;s web design, almost all one page of it.That is one so bad idea, and i will change the page later.When i did this job, i found that, you must think about how is your page&#8217;s construction and what main color you want to use.If you did not think it clearly, a serial of troubles will come to with you.</p>
<p>There is one technology calls <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" title="SVG" target="_blank">SVG</a> is used in apple&#8217;s official website.<br />
Next time i will share with you what <a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" title="SVG" target="_blank">SVG</a> is, how and when you can use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/studio-5th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to solve rewrite in ngnix</title>
		<link>http://dev-tricks.com/how-to-solve-rewrite-in-ngnix/</link>
		<comments>http://dev-tricks.com/how-to-solve-rewrite-in-ngnix/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 13:51:18 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Autobiography]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=497</guid>
		<description><![CDATA[Since i bought the vps with ngnix environment, i&#8217;m new about it.When i upload my site to the host, i can&#8217;t use the rewrite module. The case is that, i am unable to use linux command and also vim,so i &#8230; <a href="http://dev-tricks.com/how-to-solve-rewrite-in-ngnix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Since i bought the vps with ngnix environment, i&#8217;m new about it.When i upload my site to the host, i can&#8217;t use the rewrite module.<br />
The case is that, i am unable to use linux command and also vim,so i have to learn to deal with it.Finally i find that the rewrite sentences in apache rewrite and ngnix are difference, i change the commands.</p>
<p>The rewrite commands in apache rewrite are:</p>
<pre class="rewrite">
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^.*(.css|.js|.gif|.png|.jpg|.jpeg)$
</pre>
<p>but in ngnix are:</p>
<pre class="rewrite">
if  (!-e $request_filename)
{
    rewrite ^(.*)$ /index.php;
}
</pre>
<p>And here is the command to restart the ngnix service:</p>
<pre>
/usr/local/nginx/sbin/nginx -s reload
</pre>
<p>The location of the vhost.conf is &#8216;/usr/local/nginx/conf/vhost.conf&#8217;;<br />
Just modify it and restart the service. I think there is another way to use apache rewrite file in ngnix, if i find out it , i will memory it below.</p>
<p>There is one article about how to exchange apache rewrite commands to ngnix commands:<br />
<a href="http://edu.codepub.com/2010/0829/25477.php" target="_blank">http://edu.codepub.com/2010/0829/25477.php</a>, hope it is also useful to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/how-to-solve-rewrite-in-ngnix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>经典互联网文案</title>
		<link>http://dev-tricks.com/internet-copy/</link>
		<comments>http://dev-tricks.com/internet-copy/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 09:46:43 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Autobiography]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=489</guid>
		<description><![CDATA[最近一直在寻找名字，寻找文案，无意中在知乎里面看见此文，经典不容错过。 Apple 少即是多，多则更多。&#8212; MacBook 看得见的美，看不见的，更美。&#8212; iMac This changes everything. Again. &#8212; iPhone 4 再一次，改变一切。&#8212; iPhone 4 Google Don&#8217;t be evil. &#8212; Google 电子邮件可以更加直观、高效而实用，甚至可能很有趣。&#8212; Gmail Yor&#8217;re awesome! Thanks for trying Google Chrome! &#8212; Google Chrome Twitter Follow Your Interests. Discover Your &#8230; <a href="http://dev-tricks.com/internet-copy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>最近一直在寻找名字，寻找文案，无意中在<a href="//www.zhihu.com" target="_blank">知乎</a>里面看见此文，经典不容错过。</p>
<p><strong>Apple</strong><br />
少即是多，多则更多。&#8212; MacBook<br />
看得见的美，看不见的，更美。&#8212; iMac<br />
This changes everything. Again. &#8212; iPhone 4<br />
再一次，改变一切。&#8212; iPhone 4</p>
<p><strong>Google</strong><br />
Don&#8217;t be evil. &#8212; Google<br />
电子邮件可以更加直观、高效而实用，甚至可能很有趣。&#8212; Gmail<br />
Yor&#8217;re awesome! Thanks for trying Google Chrome! &#8212; Google Chrome</p>
<p><strong>Twitter</strong><br />
Follow Your Interests. Discover Your World. &#8212; Twitter</p>
<p><strong>阿里巴巴</strong><br />
淘！我喜欢。&#8212; 淘宝网<br />
没人上街，不一定没人逛街。&#8212; 淘宝商城</p>
<p><strong>百度</strong><br />
百度一下，你就知道。&#8212; 百度</p>
<p><strong>豆瓣</strong><br />
与喜欢的音乐不期而遇。&#8212; 豆瓣电台<br />
此时此刻谁在和你同看一本书。&#8212; 豆瓣</p>
<p><strong>饭否</strong><br />
在幻变的生命里，岁月，原来是最大的小偷。等你开饭！爱生活，爱饭否！&#8212; 饭否回归</p>
<p><strong>时光</strong><br />
与爱电影的人们共勉：美好的事物永不磨灭。纪念一段被遗失的时光。&#8212; 时光回归</p>
<p><strong>搜狐</strong><br />
生活在别处。&#8212; 白社会<br />
上搜狐，知天下。&#8212; 搜狐<br />
中国最大的门户网站。&#8212; 搜狐<br />
相逢的人会再相逢。&#8212; 搜狐微博</p>
<p><strong>腾讯</strong><br />
QQ邮箱，常联系。&#8212; QQ邮箱<br />
弹指间，心无间。&#8212; 腾讯QQ十二年<br />
与其在别处仰望不如在这里并肩。&#8212; 腾讯微博<br />
别人问我飞得高不高。只有她，问我飞得累不累。&#8212; QQ 邮箱母亲节</p>
<p><strong>天涯</strong><br />
天涯一路同行。&#8212; 天涯社区</p>
<p><strong>土豆</strong><br />
人人都是生活的导演。&#8212; 土豆</p>
<p><strong>网易</strong><br />
网聚人的力量。&#8212; 网易<br />
做有态度的门户。&#8212; 网易新闻<br />
无跟帖，不新闻。&#8212; 网易新闻</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/internet-copy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql中时间函数应用</title>
		<link>http://dev-tricks.com/mysql-date-function/</link>
		<comments>http://dev-tricks.com/mysql-date-function/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 07:19:13 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=486</guid>
		<description><![CDATA[查询一天： select * from table where to_days(column_time) = to_days(now()); select * from table where date(column_time) = curdate(); 查询一周： select * from table where DATE_SUB(CURDATE(), INTERVAL 7 DAY) 3 WEEKDAY(date) 返回 date 的星期索引(0 = Monday, 1 = Tuesday, &#8230; 6 = &#8230; <a href="http://dev-tricks.com/mysql-date-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>查询一天：<br />
select * from table where to_days(column_time) = to_days(now());<br />
select * from table where date(column_time) = curdate();<br />
查询一周：<br />
select * from table   where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(column_time);<br />
查询一个月：<br />
select * from table where DATE_SUB(CURDATE(), INTERVAL INTERVAL 1 MONTH) <= date(column_time);<br />
mysql的日期和时间函数<br />
查询选择所有 date_col 值在最后 30 天内的记录。<br />
mysql> SELECT something FROM tbl_name<br />
            WHERE TO_DAYS(NOW()) &#8211; TO_DAYS(date_col) <= 30;    //真方便,以前都是自己写的,竟然不知道有这,失败.</p>
<p>DAYOFWEEK(date)<br />
返回 date 的星期索引(1 = Sunday, 2 = Monday, ... 7 = Saturday)。索引值符合 ODBC 的标准。<br />
mysql> SELECT DAYOFWEEK(’1998-02-03’);<br />
         -> 3 </p>
<p>WEEKDAY(date)<br />
返回 date 的星期索引(0 = Monday, 1 = Tuesday, &#8230; 6 = Sunday)：<br />
mysql> SELECT WEEKDAY(’1998-02-03 22:23:00’);<br />
         -> 1<br />
mysql> SELECT WEEKDAY(’1997-11-05’);<br />
         -> 2 </p>
<p>DAYOFMONTH(date)<br />
返回 date 是一月中的第几天，范围为 1 到 31：<br />
mysql> SELECT DAYOFMONTH(’1998-02-03’);<br />
         -> 3 </p>
<p>DAYOFYEAR(date)<br />
返回 date 是一年中的第几天，范围为 1 到 366：<br />
mysql> SELECT DAYOFYEAR(’1998-02-03’);<br />
         -> 34 </p>
<p>MONTH(date)<br />
返回 date 中的月份，范围为 1 到 12：<br />
mysql> SELECT MONTH(’1998-02-03’);<br />
         -> 2 </p>
<p>DAYNAME(date)<br />
返回 date 的星期名：<br />
mysql> SELECT DAYNAME(&#8220;1998-02-05&#8243;);<br />
         -> ’Thursday’ </p>
<p>MONTHNAME(date)<br />
返回 date 的月份名：<br />
mysql> SELECT MONTHNAME(&#8220;1998-02-05&#8243;);<br />
         -> ’February’ </p>
<p>QUARTER(date)<br />
返回 date 在一年中的季度，范围为 1 到 4：<br />
mysql> SELECT QUARTER(’98-04-01’);<br />
         -> 2 </p>
<p>WEEK(date)<br />
WEEK(date,first)<br />
对 于星期日是一周中的第一天的场合，如果函数只有一个参数调用，返回 date 为一年的第几周，返回值范围为 0 到 53 (是的，可能有第 53 周的开始)。两个参数形式的 WEEK() 允许你指定一周是否以星期日或星期一开始，以及返回值为 0-53 还是 1-52。 这里的一个表显示第二个参数是如何工作的： </p>
<p>值     含义<br />
0     一周以星期日开始，返回值范围为 0-53<br />
1      一周以星期一开始，返回值范围为 0-53<br />
2      一周以星期日开始，返回值范围为 1-53<br />
3      一周以星期一开始，返回值范围为 1-53 (ISO 8601) </p>
<p>mysql> SELECT WEEK(’1998-02-20’);<br />
         -> 7<br />
mysql> SELECT WEEK(’1998-02-20’,0);<br />
         -> 7<br />
mysql> SELECT WEEK(’1998-02-20’,1);<br />
         -> 8<br />
mysql> SELECT WEEK(’1998-12-31’,1);<br />
         -> 53 </p>
<p>注意，在版本 4.0 中，WEEK(#,0) 被更改为匹配 USA 历法。 注意，如果一周是上一年的最后一周，当你没有使用 2 或 3 做为可选参数时，MySQL 将返回 0：<br />
mysql> SELECT YEAR(’2000-01-01’), WEEK(’2000-01-01’,0);<br />
         -> 2000, 0<br />
mysql> SELECT WEEK(’2000-01-01’,2);<br />
         -> 52 </p>
<p>你 可能会争辩说，当给定的日期值实际上是 1999 年的第 52 周的一部分时，MySQL 对 WEEK() 函数应该返回 52。我们决定返回 0 ，是因为我们希望该函数返回“在指定年份中是第几周”。当与其它的提取日期值中的月日值的函数结合使用时，这使得 WEEK() 函数的用法可靠。 如果你更希望能得到恰当的年-周值，那么你应该使用参数 2 或 3 做为可选参数，或者使用函数 YEARWEEK() ：<br />
mysql> SELECT YEARWEEK(’2000-01-01’);<br />
         -> 199952<br />
mysql> SELECT MID(YEARWEEK(’2000-01-01’),5,2);<br />
         -> 52 </p>
<p>YEAR(date)<br />
返回 date 的年份，范围为 1000 到 9999：<br />
mysql> SELECT YEAR(’98-02-03’);<br />
         -> 1998 </p>
<p>YEARWEEK(date)<br />
YEARWEEK(date,first)<br />
返回一个日期值是的哪一年的哪一周。第二个参数的形式与作用完全与 WEEK() 的第二个参数一致。注意，对于给定的日期参数是一年的第一周或最后一周的，返回的年份值可能与日期参数给出的年份不一致：<br />
mysql> SELECT YEARWEEK(’1987-01-01’);<br />
         -> 198653 </p>
<p>注意，对于可选参数 0 或 1，周值的返回值不同于 WEEK() 函数所返回值(0)， WEEK() 根据给定的年语境返回周值。<br />
HOUR(time)<br />
返回 time 的小时值，范围为 0 到 23：<br />
mysql> SELECT HOUR(’10:05:03’);<br />
         -> 10 </p>
<p>MINUTE(time)<br />
返回 time 的分钟值，范围为 0 到 59：<br />
mysql> SELECT MINUTE(’98-02-03 10:05:03’);<br />
         -> 5 </p>
<p>SECOND(time)<br />
返回 time 的秒值，范围为 0 到 59：<br />
mysql> SELECT SECOND(’10:05:03’);<br />
         -> 3 </p>
<p>PERIOD_ADD(P,N)<br />
增加 N 个月到时期 P(格式为 YYMM 或 YYYYMM)中。以 YYYYMM 格式返回值。 注意，期间参数 P 不是 一个日期值：<br />
mysql> SELECT PERIOD_ADD(9801,2);<br />
         -> 199803 </p>
<p>PERIOD_DIFF(P1,P2)<br />
返回时期 P1 和 P2 之间的月数。P1 和 P2 应该以 YYMM 或 YYYYMM 指定。 注意，时期参数 P1 和 P2 不是 日期值：<br />
mysql> SELECT PERIOD_DIFF(9802,199703);<br />
         -> 11 </p>
<p>DATE_ADD(date,INTERVAL expr type)<br />
DATE_SUB(date,INTERVAL expr type)<br />
ADDDATE(date,INTERVAL expr type)<br />
SUBDATE(date,INTERVAL expr type)<br />
这 些函数执行日期的算术运算。ADDDATE() 和 SUBDATE() 分别是 DATE_ADD() 和 DATE_SUB() 的同义词。 在 MySQL 3.23 中，如果表达式的右边是一个日期值或一个日期时间型字段，你可以使用 + 和 &#8211; 代替 DATE_ADD() 和 DATE_SUB()(示例如下)。 参数 date 是一个 DATETIME 或 DATE 值，指定一个日期的开始。expr 是一个表达式，指定从开始日期上增加还是减去间隔值。expr 是一个字符串；它可以以一个 “-” 领头表示一个负的间隔值。type 是一个关键词，它标志着表达式以何格式被解释。</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/mysql-date-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>朝CMS策略的发展</title>
		<link>http://dev-tricks.com/go-cms/</link>
		<comments>http://dev-tricks.com/go-cms/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 06:35:19 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Autobiography]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=482</guid>
		<description><![CDATA[作为曾经的公司开发人员，两年多的时间虽然也经历过不少的项目，做过不少的网站，但一直有遗憾么有亲自开发网站后台程序以及商城的开发。 有时候回想起来，对于离职事件连自己都感觉很突然，刚开始提出的离职被领导提出来的项目有那么一些打动了，后来在经历漫长的两个月时间等待无果后，毅然决然的提出了离职，算起来前后时间也就两天。 回到家中以后由最初的终于可以轻松一下到现在的挺茫然，心理上感觉经历了很长一段岁月。 我也终于有点点体会，每一次恋爱，每一次工作机会都会让人成长很多。 最近，一直忙于修改胖子那套后台程序，水平层次不一样，他写的东西对于我来说还是有点晦涩难懂，尤其是需要修改的时候太浪费时间，因此决定将程序进行修改到自己比较熟悉的风格。 回想以前做过的一些网站，归总以后目前对网站做了如下方面调整： 1、首先是订单功能，新增加了类似购物系统的多订单表，将原来的一个表拆分成客户表和订单表 2、增加了产品和自助栏目中可以上传多图片的功能 3、以前一直觉着类似siteconfig这样的表太过浪费，经常性的一个表里面只会存放一条数据，后来参考wd新建一个param表，将各个参数、配置等信息按照键值对的形式进行存储。新写了类似于jQuery的能set、get的函数来进行操作 4、增加主题选择功能，网站只要有做好的主题可以在后台进行任意更换，但这功能不打算对直接客户开放 5、前几天碰见以后后台增加自助栏目以后可以在左侧作为栏目导航使用，这是对我们之前接触的网站后台程序的一大不同之处，感觉对于网络知识缺乏的客户来说却是挺方便的，也就给引入进来，增加控制开关 6、将留言数据库表进行更改，可以很方便的扩展至产品和新闻留言 7、保留友情链接功能 8、增加数据库控制栏目 未来的计划中，准备介入目前的主流功能，类似博客，以及会员同步等等。 对于这套程序，目前采用的是smarty+面向过程的开发方式，感觉这样对于小型的网站已经可以使用，避免了实用类开发代码冗余的弊端。不过，或许在以后的使用过程中，功能逐渐的增多，也可能会引入面向对象来开发。 感觉越来越向着CMS的方向发展了，未来这套系统功能将会越来越完善，控制越来越灵活，期待中！ 忙碌的时间总会感觉很充实，这也许就是劳累命吧。 哈哈，不过挺好的。]]></description>
			<content:encoded><![CDATA[<p>作为曾经的公司开发人员，两年多的时间虽然也经历过不少的项目，做过不少的网站，但一直有遗憾么有亲自开发网站后台程序以及商城的开发。<br />
有时候回想起来，对于离职事件连自己都感觉很突然，刚开始提出的离职被领导提出来的项目有那么一些打动了，后来在经历漫长的两个月时间等待无果后，毅然决然的提出了离职，算起来前后时间也就两天。<br />
回到家中以后由最初的终于可以轻松一下到现在的挺茫然，心理上感觉经历了很长一段岁月。<br />
我也终于有点点体会，每一次恋爱，每一次工作机会都会让人成长很多。<br />
最近，一直忙于修改胖子那套后台程序，水平层次不一样，他写的东西对于我来说还是有点晦涩难懂，尤其是需要修改的时候太浪费时间，因此决定将程序进行修改到自己比较熟悉的风格。<br />
回想以前做过的一些网站，归总以后目前对网站做了如下方面调整：</p>
<pre>1、首先是订单功能，新增加了类似购物系统的多订单表，将原来的一个表拆分成客户表和订单表
2、增加了产品和自助栏目中可以上传多图片的功能
3、以前一直觉着类似siteconfig这样的表太过浪费，经常性的一个表里面只会存放一条数据，后来参考wd新建一个param表，将各个参数、配置等信息按照键值对的形式进行存储。新写了类似于jQuery的能set、get的函数来进行操作
4、增加主题选择功能，网站只要有做好的主题可以在后台进行任意更换，但这功能不打算对直接客户开放
5、前几天碰见以后后台增加自助栏目以后可以在左侧作为栏目导航使用，这是对我们之前接触的网站后台程序的一大不同之处，感觉对于网络知识缺乏的客户来说却是挺方便的，也就给引入进来，增加控制开关
6、将留言数据库表进行更改，可以很方便的扩展至产品和新闻留言
7、保留友情链接功能
8、增加数据库控制栏目</pre>
<p>未来的计划中，准备介入目前的主流功能，类似博客，以及会员同步等等。<br />
对于这套程序，目前采用的是smarty+面向过程的开发方式，感觉这样对于小型的网站已经可以使用，避免了实用类开发代码冗余的弊端。不过，或许在以后的使用过程中，功能逐渐的增多，也可能会引入面向对象来开发。<br />
感觉越来越向着CMS的方向发展了，未来这套系统功能将会越来越完善，控制越来越灵活，期待中！<br />
忙碌的时间总会感觉很充实，这也许就是劳累命吧。<br />
哈哈，不过挺好的。</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/go-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>美的灯饰上线</title>
		<link>http://dev-tricks.com/meidi/</link>
		<comments>http://dev-tricks.com/meidi/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 15:22:44 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Autobiography]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=468</guid>
		<description><![CDATA[这段时间忙碌了很多事情，经历过工作的愤怒，尝试过敢情的痛苦，从来不敢说自己的经历有多丰富，但也会不禁的沉湎在记忆的长河，时而年幼的可笑，时而年少的疯狂，但仍没有现在的精彩。 “文字能表达一种思想，即使你的思想很丰富，但缺少表达的渲染也就不会让这些思想保留下来” 一直都在计划这每天能写点东西，沉湎的文学的魅力，尽管我更多的还是喜欢小说类的作品，但不能因此剥夺对文学的喜爱。 2011年9月2日，“美的灯饰”正是上线，开始做百度推广，可以说是自从6月31日离职到现在唯一作为自己的事业的事情，尽管目前来看前景渺茫，我更会珍惜这次经历，让这么美好的记录伴随着我的成长，在这里留下记忆的痕迹。 回忆一下当时的情景： “现在百度推广已经生效了吗？我怎么没有一点感觉啊。” “你还想有啥感觉，能吃啊” 就这样，我很没有感觉的就开始走走上了这条分岔路口。 感慨：我们经常听别人说，万事开头难，自己也很清楚这个道理，但事情只有自己亲自经历的时候才能切身的体会到，“万事”开头怎么个难发。 鼓励：虽然是不熟悉的领域，但相信自己，珍惜经历！ 这段时间在家的时候，就如刚开始“大墩哥”说的那，回家以后就不受控制的生活规律就开始松散下来了，后来每次想停歇下来，不想工作学习的时候，就用这句话来提醒自己：I leave uncultivated today, was precisely yesterday perishes tomorrow which person of the body implored! 这是摘自哈佛图书馆管训里面的一句：我无所事事地度过的今天是昨天死去的人们所奢望的明天！ 慢慢的要学会珍惜，珍惜时间，珍惜生命，珍惜亲情，珍惜爱情，珍惜生命！]]></description>
			<content:encoded><![CDATA[<p>这段时间忙碌了很多事情，经历过工作的愤怒，尝试过敢情的痛苦，从来不敢说自己的经历有多丰富，但也会不禁的沉湎在记忆的长河，时而年幼的可笑，时而年少的疯狂，但仍没有现在的精彩。<br />
“文字能表达一种思想，即使你的思想很丰富，但缺少表达的渲染也就不会让这些思想保留下来”<br />
一直都在计划这每天能写点东西，沉湎的文学的魅力，尽管我更多的还是喜欢小说类的作品，但不能因此剥夺对文学的喜爱。<br />
2011年9月2日，“美的灯饰”正是上线，开始做百度推广，可以说是自从6月31日离职到现在唯一作为自己的事业的事情，尽管目前来看前景渺茫，我更会珍惜这次经历，让这么美好的记录伴随着我的成长，在这里留下记忆的痕迹。<br />
回忆一下当时的情景：</p>
<pre>“现在百度推广已经生效了吗？我怎么没有一点感觉啊。”
“你还想有啥感觉，能吃啊”</pre>
<p>就这样，我很没有感觉的就开始走走上了这条分岔路口。<br />
感慨：我们经常听别人说，万事开头难，自己也很清楚这个道理，但事情只有自己亲自经历的时候才能切身的体会到，“万事”开头怎么个难发。<br />
鼓励：虽然是不熟悉的领域，但相信自己，珍惜经历！<br />
这段时间在家的时候，就如刚开始“大墩哥”说的那，回家以后就不受控制的生活规律就开始松散下来了，后来每次想停歇下来，不想工作学习的时候，就用这句话来提醒自己：I leave uncultivated today, was precisely yesterday perishes tomorrow which person of the body implored!<br />
这是摘自哈佛图书馆管训里面的一句：我无所事事地度过的今天是昨天死去的人们所奢望的明天！<br />
慢慢的要学会珍惜，珍惜时间，珍惜生命，珍惜亲情，珍惜爱情，珍惜生命！</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/meidi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>css属性zoom的使用</title>
		<link>http://dev-tricks.com/how-to-use-css-zoom/</link>
		<comments>http://dev-tricks.com/how-to-use-css-zoom/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 11:09:13 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=458</guid>
		<description><![CDATA[相信很多开发者写css的时候使用过zoom属性，以前也模仿使用过，那时候刚开始接触前端开发，抄过来一段代码就知道能解决什么问题，实现了什么功能，但是对于里面使用的各个属性并不是很了解，也没有很深入的去研究过。 这种现在伴随着我成长了很长一段时间，然后才意识到这其实是一种很大的弊端，很不利于对于技术的研究。反复告诫自己，在研究代码，研究程序的时候尽量要做到彻底弄清楚实现的原理！ 今天在看alipay一位前段大虾的博客的时候，又碰到了关于这方面的问题，于是乎，本着不能草草了事，知其然须知其所以然的态度，在网上搜索了一下相关的内容，有很多大致类似的解释和说明，下面摘录修改了一段感觉比较能明确解释其功能的文字： zoom : normal &#124; number 语法取值 normal : 默认值。使用对象的实际尺寸 number : 百分数 &#124; 无符号浮点实数。浮点实数值为1.0或百分数为100%时相当于此属性的 normal 值 使用说明 此属性仅IE6使用。设置或检索对象的缩放比例。设置或更改一个已被呈递的对象的此属性值将导致环绕对象的内容重新流动。虽然此属性不可继承，但是它会影响对象的所有子对象( children )。这种影响很像 background 和 filter 属性导致的变化。此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。 尤其后半句的说明更加重要，利用这个代码来实现ie6下清楚浮动的功能。网上比较流行的清楚浮动的代码： .clear:after{ visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0; }.clear{zoom:1} 前面是清楚高级浏览器浮动，后面主要是针对ie6. 作此记录，备忘（脑子不够用现在。。。）]]></description>
			<content:encoded><![CDATA[<p>相信很多开发者写css的时候使用过zoom属性，以前也模仿使用过，那时候刚开始接触前端开发，抄过来一段代码就知道能解决什么问题，实现了什么功能，但是对于里面使用的各个属性并不是很了解，也没有很深入的去研究过。<br />
这种现在伴随着我成长了很长一段时间，然后才意识到这其实是一种很大的弊端，很不利于对于技术的研究。反复告诫自己，在研究代码，研究程序的时候尽量要做到彻底弄清楚实现的原理！<br />
今天在看alipay一位前段大虾的博客的时候，又碰到了关于这方面的问题，于是乎，本着不能草草了事，知其然须知其所以然的态度，在网上搜索了一下相关的内容，有很多大致类似的解释和说明，下面摘录修改了一段感觉比较能明确解释其功能的文字：</p>
<pre name="code" class="html">
zoom : normal | number
语法取值
normal  : 默认值。使用对象的实际尺寸
number  : 百分数 | 无符号浮点实数。浮点实数值为1.0或百分数为100%时相当于此属性的 normal 值
使用说明
此属性仅IE6使用。设置或检索对象的缩放比例。设置或更改一个已被呈递的对象的此属性值将导致环绕对象的内容重新流动。虽然此属性不可继承，但是它会影响对象的所有子对象( children )。这种影响很像 background 和 filter 属性导致的变化。此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。
</pre>
<p>尤其后半句的说明更加重要，利用这个代码来实现ie6下清楚浮动的功能。网上比较流行的清楚浮动的代码：</p>
<pre name="code" class="css">
.clear:after{ visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0; }.clear{zoom:1}
</pre>
<p>前面是清楚高级浏览器浮动，后面主要是针对ie6.<br />
作此记录，备忘（脑子不够用现在。。。）</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/how-to-use-css-zoom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

