<?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>Because of sharing,we learn more.</description>
	<lastBuildDate>Wed, 09 May 2012 15:41:40 +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>New resources for web developer</title>
		<link>http://dev-tricks.com/new-resources-for-web-developer/</link>
		<comments>http://dev-tricks.com/new-resources-for-web-developer/#comments</comments>
		<pubDate>Wed, 09 May 2012 15:26:41 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=556</guid>
		<description><![CDATA[As web developers, the sheer amount of resources we can tap into increases exponentially with time. Here is just a quick look at some recently created resources that deserve your attention — everything from new books to scripts and frameworks.]]></description>
			<content:encoded><![CDATA[<p>As web developers, the sheer amount of resources we can tap into increases exponentially with time. Here is just a quick look at some recently created resources that deserve your attention — everything from new books to scripts and frameworks.</p>
<h3>Smooth.js</h3>
<p>Smooth.js takes an array of numbers or vectors and returns a parametric function that continuously interpolates that array. Smooth.js supports several interpolation methods, and flexible options for boundary behavior.</p>
<h3>Scroll Path</h3>
<p>jQuery Scroll Path is a plugin that lets you define your own custom scroll path. What this means exactly is best understood by checking out the demo. The plugin uses canvas flavored syntax for drawing paths, using the methods moveTo, lineTo and arc. To help with getting the path right, a canvas overlay with the path can be enabled when initializing the plugin.</p>
<h3>keymaster.js</h3>
<p>Keymaster is a simple (100 LoC or so) micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.</p>
<h3>Ham</h3>
<p>PHP Microframework for use with whatever you like. Basically just a fast router with nice syntax, and a cache singleton. Will add more things as I go, like perhaps an extension system, autoloader and some other stuff to make developing in PHP less irritating than it currently is.</p>
<h3>mailcheck.js</h3>
<p>The jQuery plugin that suggests a right domain when your users misspell it in an email address.</p>
<h3>Hammer.js</h3>
<p>Hammer.js is a javascript library that can be used to control gestures on touch devices.</p>
<h3>Monorail.js</h3>
<p>Monorail.js will never force you, and uses only what you need. Monorail.js will never force you to install anything not needed for your project. The goal is to use what you need. Anything other than creating a project will always be optional.</p>
<h3>Rainbow</h3>
<p>Rainbow is a code syntax highlighting library written in Javascript. It was designed to be lightweight (1.4kb), easy to use, and extendable.</p>
<h3>Timeline</h3>
<p>There are lots of timeline tools on the web but they are almost all either hard on the eyes or hard to use. Create timelines that are at the same time beautiful and intuitive for users. Timeline is great for pulling in media from different sources. Just throw in a link from Twitter, YouTube, Flickr, Vimeo, Google Maps or SoundCloud and Timeline will format it to fit perfectly. More media types will be supported in the future.</p>
<h3>FakeS3</h3>
<p>FakeS3 is a lightweight server that responds to the same calls Amazon S3 responds to.<br />
It is extremely useful for testing of S3 in a sandbox environment without actually making calls to Amazon, which not only require network, but also cost you precious dollars.</p>
<h3>retina.js</h3>
<p>retina.js makes it easy to serve high-resolution images to devices with retina displays. When your users load a page, retina.js checks each image on the page to see if there is a high-resolution version of that image on your server. If a high-resolution variant exists, the script will swap in that image in-place.</p>
<h3>Rucksack</h3>
<p>Rucksack is a jquery plugin to arrange elements that can fit in the given width. It relies on the knapsack algorithm.</p>
<h3>jQuery PopBox</h3>
<p>jQuery PopBox is a simple balloon UI element inspired by 37Signals Highrise CRM.</p>
<h3>html2canvas</h3>
<p>This script allows you to take “screenshots” of webpages or parts of it, directly on the users browser. The screenshot is based on the DOM and as such may not be 100% accurate to the real representation as it does not make an actual screenshot, but builds the screenshot based on the information available on the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/new-resources-for-web-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic HTML5 techniques</title>
		<link>http://dev-tricks.com/basic-html5-techniques/</link>
		<comments>http://dev-tricks.com/basic-html5-techniques/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 03:45:12 +0000</pubDate>
		<dc:creator>wison</dc:creator>
				<category><![CDATA[Html5]]></category>

		<guid isPermaLink="false">http://dev-tricks.com/?p=532</guid>
		<description><![CDATA[1. New Doctype 2. The Figure Element 3. &#60;small&#62; Redefined 4. No More Types for Scripts and Links 5. To... <a href="http://dev-tricks.com/basic-html5-techniques/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>1. New Doctype<br />
2. The Figure Element<br />
3. &lt;small&gt; Redefined<br />
4. No More Types for Scripts and Links<br />
5. To Quote or Not to Quote.<br />
6. Make your Content Editable<br />
7. Email Inputs<br />
8. Placeholders<br />
9. Local Storage<br />
10. The Semantic Header and Footer<br />
11. More HTML5 Form Features<br />
12. Internet Explorer and HTML5<br />
13. hgroup<br />
14. Required Attribute<br />
15. Autofocus Attribute<br />
16. Audio Support<br />
17. Video Support<br />
18. Preload Videos<br />
19. Display Controls<br />
20. Regular Expressions<br />
21. Detect Support for Attributes<br />
22. Mark Element<br />
23. When to Use a&lt;/small&gt;<br />
&lt;div&gt;24. What to Immediately Begin Using<br />
25. What is Not HTML5<br />
SVG: Not HTML5. It’s at least five years old.<br />
CSS3: Not HTML5. It’s…CSS.<br />
Geolocation: Not HTML5.<br />
Client Storage: Not HTML5. It was at one point, but was removed from the spec, due to the fact that many worried that it, as a whole, was becoming too complicated. It now has its own specification.<br />
Web Sockets: Not HTML5. Again, was exported to its own specification.<br />
26. The Data Attribute<br />
27. The Output Element<br />
28. Create Sliders with the Range Input&lt;/div&gt;<br />
This article is from &lt;a href=&#8221;http://net.tutsplus.com/tutorials/html-css-techniques/25-html5-features-tips-and-techniques-you-must-know/&#8221;&gt;tutsplus&lt;/a&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://dev-tricks.com/basic-html5-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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... <a href="http://dev-tricks.com/a-css3-quiz/">Continue reading &#187;</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[Javascript]]></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,... <a href="http://dev-tricks.com/how-to-use-jquery-easing/">Continue reading &#187;</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)... <a href="http://dev-tricks.com/tips-of-operator-precedence/">Continue reading &#187;</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[Events]]></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... <a href="http://dev-tricks.com/studio-5th/">Continue reading &#187;</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.</p>
<p>I did a start today.<br />
1.Print business cards.The studio name is &#8216;<a title="studio-5th" href="http://www.studio-5th.com" 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 title="studio-5th" href="http://www.studio-5th.com" 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 title="SVG" href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" target="_blank">SVG</a> is used in apple&#8217;s official website.<br />
Next time i will share with you what <a title="SVG" href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics" target="_blank">SVG</a> is, how and when you can use it.</p>
<div id="-chrome-auto-translate-plugin-dialog" style="opacity: 1 !important; background-image: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; position: absolute !important; top: 0px; left: 0px; overflow-x: visible !important; overflow-y: visible !important; z-index: 999999 !important; text-align: left !important; display: none; background-position: initial initial !important; background-repeat: initial initial !important; padding: 0px !important; margin: 0px !important;">
<div style="max-width: 300px !important; color: #fafafa !important; opacity: 0.8 !important; border-color: #000000 !important; border-width: 0px !important; -webkit-border-radius: 10px !important; background-color: #363636 !important; font-size: 16px !important; padding: 8px !important; overflow: visible !important; background-image: -webkit-gradient(linear, left top, right bottom, color-stop(0%, #000), color-stop(50%, #363636), color-stop(100%, #000)); z-index: 999999 !important; text-align: left  !important;"></div>
<p><img style="position: absolute !important; z-index: -1 !important; right: 1px !important; top: -20px !important; cursor: pointer !important; -webkit-border-radius: 20px; background-color: rgba(200, 200, 200, 0.3) !important; padding: 3px 5px 0 !important; margin: 0 !important;" onclick="document.location.href='http://translate.google.com/';" src="http://www.google.com/uds/css/small-logo.png" alt="" /></p>
</div>
]]></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[Events]]></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... <a href="http://dev-tricks.com/how-to-solve-rewrite-in-ngnix/">Continue reading &#187;</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[Events]]></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.... <a href="http://dev-tricks.com/internet-copy/">Continue reading &#187;</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 *... <a href="http://dev-tricks.com/mysql-date-function/">Continue reading &#187;</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[Events]]></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>
	</channel>
</rss>

