<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://zhuocorporation.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fzhuocorporation.spaces.live.com%2fcategory%2fCode%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>James Zhuo 卓宇翔: Code</title><description /><link>http://zhuocorporation.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catCode</link><language>en-US</language><pubDate>Thu, 21 Aug 2008 03:22:05 GMT</pubDate><lastBuildDate>Thu, 21 Aug 2008 03:22:05 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://zhuocorporation.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>-2924427532851016437</live:id><live:alias>zhuocorporation</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>Python Decorators</title><link>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1691.entry</link><description> Using python decorators you can easy do inject behaviours through declaration.&lt;br&gt;A good example of how this might be used in an web application is as follows&lt;br&gt;&lt;br&gt;@authenticated&lt;br&gt;def home(request):&lt;br&gt;  &amp;quot;&amp;quot;&amp;quot; a function to handle web request for the home page &amp;quot;&amp;quot;&amp;quot;&lt;br&gt;  .... code to handle web request ....&lt;br&gt;&lt;br&gt;@authenticated injects authentication functionality through a decorator implemented&lt;br&gt;as either a Python decorator function or decorator class. Here's a great 3 part tutorial on&lt;br&gt;python decorators &lt;a target="_blank" href="http://muharem.wordpress.com/2006/10/18/3/"&gt;http://muharem.wordpress.com/2006/10/18/3/&lt;/a&gt;&lt;br&gt;&lt;br&gt;One of those lovely things about python.&lt;br&gt; &lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-2924427532851016437&amp;page=RSS%3a+Python+Decorators&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=zhuocorporation.spaces.live.com&amp;amp;GT1=zhuocorporation"&gt;</description><comments>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1691.entry#comment</comments><guid isPermaLink="true">http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1691.entry</guid><pubDate>Tue, 19 Aug 2008 09:50:35 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1691/comments/feed.rss</wfw:commentRss><wfw:comment>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1691.entry#comment</wfw:comment><dcterms:modified>2008-08-19T09:50:35Z</dcterms:modified></item><item><title>Python Humour (Sorry if you are not a programmer)</title><link>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1775.entry</link><description>This was some python geek's signature in a python mailing list that I've recently joined. I thought it's quite funny.&lt;br&gt;&lt;br&gt;&amp;quot;Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.&amp;quot;&lt;br&gt;&lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-2924427532851016437&amp;page=RSS%3a+Python+Humour+(Sorry+if+you+are+not+a+programmer)&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=zhuocorporation.spaces.live.com&amp;amp;GT1=zhuocorporation"&gt;</description><comments>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1775.entry#comment</comments><guid isPermaLink="true">http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1775.entry</guid><pubDate>Mon, 18 Aug 2008 10:23:50 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1775/comments/feed.rss</wfw:commentRss><wfw:comment>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1775.entry#comment</wfw:comment><dcterms:modified>2008-08-18T10:23:50Z</dcterms:modified></item><item><title>C# Coding Standard</title><link>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1522.entry</link><description>I've been using &lt;a target="_blank" href="http://www.idesign.net/idesign/download/IDesign CSharp Coding Standard.zip"&gt;this&lt;/a&gt; as a guideline for my C# based projects for a while now. It's by Juval Lowy. They call him .net legend. I've met him once at a user group, very smart guy no doubt, but as you would probably expect, also came across as being a bit arrogant. Juval's guideline has served very well, but the reason for this post is really because I've found an alternate guideline published by Microsoft which is 99% identical to Juval's that I think is much quicker to skim through because it focuses mainly on naming conventions . &lt;br&gt;&lt;br&gt;The Microsoft naming guideline can be found &lt;a target="_blank" href="http://msdn2.microsoft.com/en-us/library/xzf533w0(vs.71).aspx"&gt;here&lt;/a&gt;. enjoy :)&lt;br&gt;&lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-2924427532851016437&amp;page=RSS%3a+C%23+Coding+Standard&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=zhuocorporation.spaces.live.com&amp;amp;GT1=zhuocorporation"&gt;</description><comments>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1522.entry#comment</comments><guid isPermaLink="true">http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1522.entry</guid><pubDate>Wed, 05 Mar 2008 10:55:22 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1522/comments/feed.rss</wfw:commentRss><wfw:comment>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1522.entry#comment</wfw:comment><dcterms:modified>2008-03-05T10:55:22Z</dcterms:modified></item><item><title>Handy SVN commands, much faster than using a GUI tool</title><link>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1521.entry</link><description>Here's some handy SVN commands I use on a daily basis.&lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn help&lt;/b&gt;&lt;br&gt;Lists all svn commands  &lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn update&lt;/b&gt;&lt;br&gt;Compares and updates all files under version control in the context of the current directory&lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn add&lt;/b&gt; [directory_name]or[file_name]&lt;br&gt;Add a file or directory under version control&lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn help [command]&lt;br&gt;&lt;/b&gt;If you want to know more about a particular command&lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn delete&lt;/b&gt; [directory_name]or[file_name]&lt;br&gt;Remove file or directory from version control&lt;br&gt;&lt;br&gt;&amp;gt; &lt;b&gt;svn commit -m&lt;/b&gt; &amp;quot;commit message&amp;quot;&lt;br&gt;Sends all changes to version control&lt;br&gt;&lt;br&gt;This is generally enough to get me through the day :)&lt;br&gt;&lt;br&gt;Oh almost forgot, &lt;b&gt;svn stat &lt;/b&gt;this is a really useful one, you will never miss another uncommited file again.&lt;br&gt; &lt;br&gt;PS: If you ever need to delete all the .svn folders, use these unix commands&lt;br&gt;&lt;font size=2&gt;&lt;span style="font-family:Courier New"&gt;&amp;gt; find . -type d -name .svn&lt;/span&gt;&lt;br style="font-family:Courier New"&gt;&lt;span style="font-family:Courier New"&gt;&amp;gt; rm -rf `find . -type d -name .svn`&lt;/span&gt;&lt;/font&gt;&lt;br&gt;I've found it &lt;a target="_blank" href="http://www.anyexample.com/linux_bsd/bash/recursively_delete__svn_directories.xml"&gt;here&lt;/a&gt; and it works really well.&lt;br&gt; &lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-2924427532851016437&amp;page=RSS%3a+Handy+SVN+commands%2c+much+faster+than+using+a+GUI+tool&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=zhuocorporation.spaces.live.com&amp;amp;GT1=zhuocorporation"&gt;</description><comments>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1521.entry#comment</comments><guid isPermaLink="true">http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1521.entry</guid><pubDate>Sun, 02 Mar 2008 12:34:28 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1521/comments/feed.rss</wfw:commentRss><wfw:comment>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1521.entry#comment</wfw:comment><dcterms:modified>2008-05-23T03:41:46Z</dcterms:modified></item><item><title>Handy MySQL 5 commands to help you navigate the database</title><link>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1518.entry</link><description> I've found MySQL Admin/Query Browser very
cumbersome on OSX. So I've resorted to using command lines instead to
get an overall picture of the database. This has worked surprisingly
well, there is a bit of typing, but you can get every where on the
keyboard which is generally much faster than using a GUI interface for
programming tasks.&lt;br&gt;
&lt;br&gt;
In Mac OSX you can install MySQL5 using mac port&lt;br&gt;
&amp;gt; port install mysql5&lt;br&gt;
&lt;br&gt;
To login to mysql5 (no password has been set for root user in this case)&lt;br&gt;
&amp;gt; mysql5 -u root&lt;br&gt;
&lt;br&gt;
To get a list of databases available&lt;br&gt;
&amp;gt; show databases;&lt;br&gt;
&lt;br&gt;
To use a particular database&lt;br&gt;
&amp;gt; use [database_name]&lt;br&gt;
&lt;br&gt;
To show all tables in the database&lt;br&gt;
&amp;gt; show tables;&lt;br&gt;
&lt;br&gt;
To show fields from a table&lt;br&gt;
&amp;gt; show fields from [table_name];&lt;br&gt;&amp;gt; desc [table_name];   (much shorter)&lt;br&gt;
&lt;br&gt;
To show indexes for a table&lt;br&gt;
&amp;gt; show index from [table_name];&lt;br&gt;
&lt;br&gt;
From just those few commands you can pretty much get a good picture of
the database, particularly hard-to-remember field names. There's a more
comprehensive list from someone else &lt;a href="http://www.bios.niu.edu/johns/bioinform/mysql_commands.htm"&gt;here&lt;/a&gt;. &lt;br&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=-2924427532851016437&amp;page=RSS%3a+Handy+MySQL+5+commands+to+help+you+navigate+the+database&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=zhuocorporation.spaces.live.com&amp;amp;GT1=zhuocorporation"&gt;</description><comments>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1518.entry#comment</comments><guid isPermaLink="true">http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1518.entry</guid><pubDate>Wed, 13 Feb 2008 13:01:13 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://zhuocorporation.spaces.live.com/blog/cns!D76A58A7350B0D0B!1518/comments/feed.rss</wfw:commentRss><wfw:comment>http://zhuocorporation.spaces.live.com/Blog/cns!D76A58A7350B0D0B!1518.entry#comment</wfw:comment><dcterms:modified>2008-02-13T14:18:59Z</dcterms:modified></item></channel></rss>