<?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/"
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
> <channel><title>F.A.B.L.E &#187; Tips</title> <atom:link href="http://sh3ng.com/category/uncategorized/tips/feed/" rel="self" type="application/rss+xml" /><link>http://sh3ng.com</link> <description>iOS, Programming, Design, Game, Photography, Movie, Music, Trip, Sharing...</description> <lastBuildDate>Fri, 23 Sep 2011 03:04:36 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> <item><title>Git in a nutshell</title><link>http://sh3ng.com/2011/05/git-in-a-nutshell/</link> <comments>http://sh3ng.com/2011/05/git-in-a-nutshell/#comments</comments> <pubDate>Sun, 29 May 2011 04:16:25 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Dev]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[git]]></category> <guid
isPermaLink="false">http://sh3ng.com/2011/05/git-in-a-nutshell/</guid> <description><![CDATA[Introduce a great site GitRef, Easy learn git less in a hour.]]></description> <content:encoded><![CDATA[<p>Introduce a great site <a
href="http://gitref.org">GitRef</a>,
Easy learn git less in a hour.</p> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2011/05/git-in-a-nutshell/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> <item><title>How To Rotate Screen of Macbook Pro</title><link>http://sh3ng.com/2011/05/how-to-rotate-screen-of-macbook-pro/</link> <comments>http://sh3ng.com/2011/05/how-to-rotate-screen-of-macbook-pro/#comments</comments> <pubDate>Mon, 23 May 2011 14:23:00 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Tips]]></category> <category><![CDATA[Mac]]></category> <category><![CDATA[macbookpro]]></category> <guid
isPermaLink="false">http://sh3ng.com/2011/05/how-to-rotate-screen-of-macbook-pro/</guid> <description><![CDATA[Open &#8220;Preference&#8221; form Dock, hold &#8220;Command + option&#8221; click &#8220;Display&#8221;, then you can see &#8220;Rotate 90 degree&#8221; or other degree.]]></description> <content:encoded><![CDATA[<p>Open &#8220;Preference&#8221; form Dock, hold &#8220;Command + option&#8221; click &#8220;Display&#8221;, then you can see &#8220;Rotate 90 degree&#8221; or other degree.</p> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2011/05/how-to-rotate-screen-of-macbook-pro/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> <item><title>视力降低了吗，为什么看UILabel中的文字很模糊！</title><link>http://sh3ng.com/2010/02/%e8%a7%86%e5%8a%9b%e9%99%8d%e4%bd%8e%e4%ba%86%e5%90%97%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e7%9c%8builabel%e4%b8%ad%e7%9a%84%e6%96%87%e5%ad%97%e5%be%88%e6%a8%a1%e7%b3%8a%ef%bc%81/</link> <comments>http://sh3ng.com/2010/02/%e8%a7%86%e5%8a%9b%e9%99%8d%e4%bd%8e%e4%ba%86%e5%90%97%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e7%9c%8builabel%e4%b8%ad%e7%9a%84%e6%96%87%e5%ad%97%e5%be%88%e6%a8%a1%e7%b3%8a%ef%bc%81/#comments</comments> <pubDate>Wed, 10 Feb 2010 12:55:17 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Dev]]></category> <category><![CDATA[Tips]]></category> <category><![CDATA[blur]]></category> <category><![CDATA[xcode]]></category> <guid
isPermaLink="false">http://sh3ng.com/?p=391</guid> <description><![CDATA[喔喔，在使用UILabel等继承于UIView的控件时,如果frame的rect不是整数的情况下,就会显示起来看得很模糊.这通常出现在代码控制的界面中，控件是由计算的数值所决定的位置的时候。 解决方法就是把浮点数转换成整形。]]></description> <content:encoded><![CDATA[<p>喔喔，在使用UILabel等继承于UIView的控件时,如果frame的rect不是整数的情况下,就会显示起来看得很模糊.这通常出现在代码控制的界面中，控件是由计算的数值所决定的位置的时候。</p><p>解决方法就是把浮点数转换成整形。</p> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2010/02/%e8%a7%86%e5%8a%9b%e9%99%8d%e4%bd%8e%e4%ba%86%e5%90%97%ef%bc%8c%e4%b8%ba%e4%bb%80%e4%b9%88%e7%9c%8builabel%e4%b8%ad%e7%9a%84%e6%96%87%e5%ad%97%e5%be%88%e6%a8%a1%e7%b3%8a%ef%bc%81/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> <item><title>使用arc4random获取随机数</title><link>http://sh3ng.com/2009/06/arc4random/</link> <comments>http://sh3ng.com/2009/06/arc4random/#comments</comments> <pubDate>Sun, 21 Jun 2009 21:16:10 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Tips]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://doskoi.cn/2009/06/%e4%bd%bf%e7%94%a8arc4random%e8%8e%b7%e5%8f%96%e9%9a%8f%e6%9c%ba%e6%95%b0/</guid> <description><![CDATA[通常我们获得随机数的时候直接使用random()就会发现为什么每次打开程序随机出来结果的顺序都一样?这是因为我们获得的随机数实际上都是伪随机数,所有在random之前需要实用srandom()函数,那么有没有更便捷的方法呢?]]></description> <content:encoded><![CDATA[<p>通常我们需要获得随机数的时候,假如直接使用了random()就会发现&#8221;为什么每次打开程序随机出来结果的顺序都一样?&#8221;,这是因为我们获得的随机数实际上都是<a
href="http://zh.wikipedia.org/w/index.php?title=伪随机数&amp;variant=zh-cn">伪随机数</a>,所以在random之前需要使用srandom()函数获得一个seed来进行随机算法,并且通常是使用<span
style="font-family: Monaco, 'Times New Roman', 'Bitstream Charter', Times, fantasy; line-height: normal; font-size: 10px; color: #2e0d6e;"><span
style="color: #888888;">srandom</span><span
style="color: #888888;">(</span><span
style="color: #888888;">time</span><span
style="color: #888888;">(</span><span
style="color: #888888;">NULL</span><span
style="color: #888888;">)),</span></span>把时间作为参数是为了获得的seed每次都不一样,当然理论上肯定是不一样的 XD</p><p>那么有没有更便捷的随机方法呢?</p><p><span
id="more-96"></span></p><p>答案就是使用arc4random,它就藏在C语言标准库(Standard C Library)当中.文档对于它的描述是:</p><p>The <strong>arc4random</strong>() function uses the key stream generator employed by the arc4 cipher, which uses 8*8 8 bit <a
href="http://en.wikipedia.org/wiki/Substitution_box">S-Boxes</a>. The S-Boxes can be in about (2<strong>1700) states. The <strong>arc4random</strong>() function returns pseudo-random numbers in the range of 0 to (2</strong>32)-1, and therefore has twice the range of rand(3) and random(3) .</p><p>arc4random既使用了<a
href="http://en.wikipedia.org/wiki/RC4">arc4</a>加密算法避免seed重复,并且比random的取值范围(2**31)-1整整大了一倍!那么有什么理由不使用它呢 :-)</p><div
class="thumbnail"><a
href="http://skitch.com/doskoi/biyyx/arc4random"><img
src="http://img.skitch.com/20090621-ncfpkwx16qnpy33f2dd6irjhit.preview.jpg" alt="arc4random" /></a><span
style="font-family: 'Lucida Grande', Trebuchet, sans-serif, Helvetica, Arial; color: #808080; font-size: x-small;"><span> </span></span></div> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2009/06/arc4random/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> <item><title>在Google Chart API里显示中文等非拉丁语系字符</title><link>http://sh3ng.com/2008/10/use-non-english-by-google-chart-api/</link> <comments>http://sh3ng.com/2008/10/use-non-english-by-google-chart-api/#comments</comments> <pubDate>Sat, 18 Oct 2008 19:43:06 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Tips]]></category> <category><![CDATA[api]]></category> <category><![CDATA[Chart]]></category> <category><![CDATA[CJK]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[中文]]></category> <category><![CDATA[日文]]></category> <category><![CDATA[韩文]]></category> <guid
isPermaLink="false">http://doskoi.cn/?p=17</guid> <description><![CDATA[Google Chart API是google提供的一组实时表格绘制系统，只用提供参数进去，就能返回生成好的图片。 但是我在网上没有找不到使用中文或其他非拉丁语系语言（如日语，韩语）的方法，以至于大家都以为它不提供中文支持。因为直接使用中文做参数传进去,表格里会显示成乱码，p.s.后来调用出中文以后把url复制到chrome等地址栏是utf-8显示的浏览器，直接通过浏览器的地址栏往参数里写中文是可以的，因为始终是utf-8发送的编码。 在网站程序里用方法很简单：使用url encode把中文转换成16进制的编码就行了。 php直接调用urlencode()函数。 rails使用URI.encode()函数。 如果使用的是gchartrb，则把最后的to_url换成to_escaped_url就行了,不用自己调用encode。 c#使用Server.UrlEncode函数。 其他程序都一样各自调用API里的url encode就行了~ 于是中文等不能直接显示的非拉丁语系文字转换以后就可以了，但是CJK中唯独中文有一个BUG。 就是使用了中文以后半角数字(2,4,7)部分不能正确显示。 如图： 英文 中文 日文和韩文 这是由于google绘制图片的程序调用的中文字库的关系。]]></description> <content:encoded><![CDATA[<p><a
class="exLink" href="http://code.google.com/intl/zh-CN/apis/chart/">Google Chart API</a>是google提供的一组实时表格绘制系统，只用提供参数进去，就能返回生成好的图片。
但是我在网上没有找不到使用中文或其他非拉丁语系语言（如日语，韩语）的方法，以至于大家都以为它不提供中文支持。因为直接使用中文做参数传进去,表格里会显示成乱码，p.s.后来调用出中文以后把url复制到chrome等地址栏是utf-8显示的浏览器，直接通过浏览器的地址栏往参数里写中文是可以的，因为始终是utf-8发送的编码。</p><div>在网站程序里用方法很简单：使用url encode把中文转换成16进制的编码就行了。
php直接调用urlencode()函数。
rails使用URI.encode()函数。</div><div>如果使用的是gchartrb，则把最后的to_url换成to_escaped_url就行了,不用自己调用encode。
c#使用Server.UrlEncode函数。</div><div>其他程序都一样各自调用API里的url encode就行了~
于是中文等不能直接显示的非拉丁语系文字转换以后就可以了，但是CJK中唯独中文有一个BUG。</div><p><span
id="more-17"></span> 就是使用了中文以后半角数字(2,4,7)部分不能正确显示。</p><p>如图：</p><p>英文 <img
src="http://chart.apis.google.com/chart?cht=p3&amp;chd=t:60,40&amp;chs=280x100&amp;chl=En%2012345%7CUs%2067890" alt="" /></p><p>中文 <img
src="http://chart.apis.google.com/chart?cht=p3&amp;chd=t:60,40&amp;chs=280x100&amp;chl=%E6%B1%8912345%7C%E4%B8%AD67890" alt="" /></p><p>日文和韩文 <img
src="http://chart.apis.google.com/chart?cht=p3&amp;chd=t:60,40&amp;chs=360x100&amp;chl=%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF12345%7C%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%9467890" alt="" /></p><p>这是由于google绘制图片的程序调用的中文字库的关系。</p> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2008/10/use-non-english-by-google-chart-api/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> <item><title>SEO for Movable Type Blog</title><link>http://sh3ng.com/2008/09/seo-for-movable-type-blog/</link> <comments>http://sh3ng.com/2008/09/seo-for-movable-type-blog/#comments</comments> <pubDate>Sat, 27 Sep 2008 01:54:21 +0000</pubDate> <dc:creator>黑眼圈</dc:creator> <category><![CDATA[Tips]]></category> <category><![CDATA[Blog]]></category> <category><![CDATA[description]]></category> <category><![CDATA[keyword]]></category> <category><![CDATA[MovableType]]></category> <category><![CDATA[MT]]></category> <category><![CDATA[SEO]]></category> <guid
isPermaLink="false">http://doskoi.cn/?p=13</guid> <description><![CDATA[How to create a template for keywords and meta description tag.Movable Type missing keywords and description meta tag at the template.SEO has not measure the standard too much, but I suggest you better do this than doing nothing.&#8220;Better than not&#8221; that said the exact keywords in HEAD and that the description was not put to [...]]]></description> <content:encoded><![CDATA[<p>How to create a template for keywords and meta description tag.<br
/><br
/>Movable Type missing keywords and description meta tag at the template.<br
/><span
class="caps">SEO </span>has not measure the standard too much, but I suggest you better do this than doing nothing.<br
/><br
/>&#8220;Better than not&#8221; that said the exact keywords in <span
class="caps">HEAD </span>and that the description was not put to much more like that, so I&#8217;ll just follow the following points. <br
/></p><ul><li>keywords: 5, 6 and each other the same page.</li><li>description: Approximately 100 characters or less.</li></ul><p>btw,if you find out this article via the search engine, I guess you better do that :p<br
/><br
/></p><p><span
id="more-13"></span></p><p>This is the only consideration of the following templates and Movable Type<br
/></p><p><pre name="code" class="html">&lt;mt:If name="main_index"&gt;
&lt;meta name="robots" content="all" /&gt;
&lt;meta name="googlebot" content="index, follow" /&gt;
&lt;meta name="keywords" content="put,your,keywords,here" /&gt;
&lt;meta name="description" content="&lt;$mt:BlogDescription$&gt;" /&gt;
&lt;meta name="revisit-after" content="1 days" &gt;
&lt;mt:ElseIf name="archive_index"&gt;
&lt;meta name="keywords" content="&lt;mt:Entries lastn="2"&gt;&lt;mt:If name="<strong>first</strong>"&gt;&lt;mt:EntryCategories glue=","&gt;&lt;$mt:CategoryLabel regex_replace="/[0-9]+<em>/",""$&gt;&lt;/mt:EntryCategories&gt;&lt;mt:ElseIf name="<strong>last</strong>"&gt;&lt;mt:EntryIfTagged&gt;,&lt;mt:EntryTags glue=","&gt;&lt;$mt:TagName$&gt;&lt;/mt:EntryTags&gt;&lt;/mt:EntryIfTagged&gt;&lt;/mt:If&gt;&lt;/mt:Entries&gt;" /&gt;
&lt;meta name="description" content="&lt;mt:Entries lastn="5"&gt;&lt;$mt:EntryTitle encode_html="1"$&gt;,&lt;/mt:Entries&gt;" /&gt;
&lt;mt:ElseIf name="entry_template"&gt;
&lt;meta name="robots" content="all" /&gt;
&lt;meta name="googlebot" content="index, follow" /&gt;
&lt;meta name="keywords" content="&lt;$mt:EntryKeywords$&gt;" /&gt;
&lt;meta name="description" content="&lt;$mt:EntryExcerpt$&gt;" /&gt;
&lt;mt:ElseIf name="page_template"&gt;
&lt;meta name="robots" content="all" /&gt;
&lt;meta name="googlebot" content="index, follow" /&gt;
&lt;meta name="keywords" content="&lt;$mt:PageKeywords$&gt;" /&gt;
&lt;meta name="description" content="&lt;$mt:PageExcerpt$&gt;" /&gt;
&lt;mt:ElseIf name="archive_listing"&gt;
&lt;meta name="keywords" content="&lt;mt:Entries lastn="2"&gt;&lt;mt:If name="<strong>first</strong>"&gt;&lt;mt:EntryCategories glue=","&gt;&lt;$mt:CategoryLabel regex_replace="/[0-9]+</em>/",""$&gt;&lt;/mt:EntryCategories&gt;&lt;mt:ElseIf name="<strong>last</strong>"&gt;&lt;mt:EntryIfTagged&gt;,&lt;mt:EntryTags glue=","&gt;&lt;$mt:TagName$&gt;&lt;/mt:EntryTags&gt;&lt;/mt:EntryIfTagged&gt;&lt;/mt:If&gt;&lt;/mt:Entries&gt;" /&gt;
&lt;meta name="description" content="&lt;mt:Entries lastn="5"&gt;&lt;$mt:EntryTitle encode_html="1"$&gt;,&lt;/mt:Entries&gt;" /&gt;
&lt;/mt:If&gt;
</pre></p><p><br
/>It inculdes <b>Main page</b>, <b>Archive Index</b>, <b>Blogs</b>, <b>Pages</b>, <b>Blog List</b><br
/>edit the keywords, description etc, and insert this code in your <b><span
class="caps">HTML</span> Head</b> of template and Publish blog.<br
/><br
/>Now, It&#8217;s done, You just need to write <b>keyword</b> for every blog on bottom.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://sh3ng.com/2008/09/seo-for-movable-type-blog/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license> </item> </channel> </rss>
