<?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>Keep [C]*(od&#124;do)ing &#187; software</title>
	<atom:link href="http://liwen.name/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://liwen.name</link>
	<description>Grow with the flow</description>
	<lastBuildDate>Fri, 10 Jul 2009 19:37:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Save Subversion Server on BlueHost</title>
		<link>http://liwen.name/2009/06/save-subversion-server-on-bluehost/</link>
		<comments>http://liwen.name/2009/06/save-subversion-server-on-bluehost/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 14:30:03 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bluehost]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://liwen.name/?p=336</guid>
		<description><![CDATA[The first command I typed in Emacs this morning was “svn up“. Two seconds later, the unexpected unwelcome stranger “svnserve: error while loading shared libraries: libpq.so.3: cannot open shared object file: No such file or directory” popped into my screen, I felt my heart jumped up into my throat and my blood pressure went up [...]]]></description>
			<content:encoded><![CDATA[<p>The first command I typed in Emacs this morning was “<code>svn up</code>“. Two seconds later, the unexpected unwelcome stranger “<code>svnserve: error while loading shared libraries: libpq.so.3: cannot open shared object file: No such file or directory</code>” popped into my screen, I felt my heart jumped up into my throat and my blood pressure went up a bit. This is no good***@#^&#038; :&#8211;(</p>
<p>Checked on BlueHost support site and was informed that they have upgraded PostgreSQL and have recompiled Apache. I suppose I couldn’t ask BlueHost tech support regarding the issue since Subversion is not something included in the hosting package.</p>
<p>Found <a href="http://www.nabble.com/svn:-error-while-loading-shared-libraries:-libpq.so.3:-cannot-open-shared-object-file:-No-such-file-or-directory-td23891720.html#a24017347" rel="external">this thread</a> on Google suggesting to ‘rebuild apt-util’ but without giving any solution, so I decided to roll my sleeves and solve the problem on my own.</p>
<p>Here was my installation hosting environment:<br />
1.	Bluehost 64bit box<br />
2.	subversion 1.5.5</p>
<p>And here is <a href="http://liwen.name/2009/02/bluehost-subversion-windows-cmd/">how I installed subversion in the first place</a>, you may want to check this post (referring as <em>post #1</em> form now on) first as the following steps are partially in the same context with it.</p>
<p><strong>Failed trying to reconfigure</strong></p>
<p>Tried to install all subversion dependencies downloaded in post #1, it ignores the installation and says the libraries have been installed.<br />
Tried to reconfigure and link, got lots of &#8216;<code>cannot read symbols</code>&#8216; error. One of the errors seems to be version related problem which I encountered before while doing apache upgrading.</p>
<p>I guess I may need higher version of <code>apr</code> and <code>apr-util</code> and hope they will still work with subversion 1.5.5, otherwise I’ll have to upgrade my svn on the server as well. </p>
<p><strong>Download apr and apr-util</strong></p>
<p><code>cd src<br />
wget http://www.apache.org/dist/apr/apr-1.3.5.tar.gz<br />
wget http://www.apache.org/dist/apr/apr-util-1.3.7.tar.gz<br />
tar -xzvf apr-1.3.5.tar.gz<br />
tar -xzvf apr-util-1.3.7.tar.gz</code></p>
<p><strong>Install apr</strong></p>
<p><code>cd apr-1.3.5<br />
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"<br />
make &#038;&#038; make install</code></p>
<p><strong>Install apr-util</strong></p>
<p><code>cd ../apr-util-1.3.7<br />
./configure --enable-shared --prefix=$HOME --with-apr=$HOME --without-berkeley-db LDFLAGS="-L/lib64"<br />
make &#038;&#038; make install</code></p>
<p><strong>Install neon</strong></p>
<p>Since <code>neon</code> depends on <code>apr</code> and <code>apr-util</code>, I&#8217;d better reinstall it as well, tried to install the <code>neon</code> comes with <code>subversion-dep-1.5.5.tar.gz</code> and this time it succeeded, great!</p>
<p><code>cd ../subversion-1.5.5/neon<br />
EXTRA_CFLAGS="-L/lib64 -fPIC"<br />
CFLAGS="-L/lib64 -fPIC"<br />
./configure --prefix=$HOME --enable-shared LDFLAGS="-L/lib64" --with-libs=$HOME<br />
make &#038;&#038; make install</code></p>
<p><strong>Reinstall Subversion</strong></p>
<p><code>cd ..<br />
./configure --prefix=$HOME --without-berkeley-db --with-apr=$HOME --with-apr-util=$HOME --with-neon=$HOME -without-apxs --without-apache<br />
make &#038;&#038; make install</code></p>
<p>Something you might want to know if you are going to follow my steps to save your svn server on BlueHost. As the information in this weblog is provided “AS IS” with no warranties : )</p>
<p>1.Check your BlueHost hosting environment (32 bit or 64 bit)<br />
2.Check your subversion version (a new repository schema has been introduced since version 1.4.?, you may want to download all repositories and upgrade them locally)<br />
3.Backup all repositories.<br />
4.If you are not sure about what those steps are all about please do read post #1, don&#8217;t replicate them blindly &#8211; for your server&#8217;s safety, although BlueHost backs up your home directory in daily and weekly intervals.<br />
5.There might be a better solution beyond my knowledge and you can wait for someone to find out – I am just a brave armature :)</p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/06/save-subversion-server-on-bluehost/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Password-less svn+ssh Access on Mac OS X &#8211; Updated</title>
		<link>http://liwen.name/2009/05/passwordless-svnssh-access-on-mac-os-x/</link>
		<comments>http://liwen.name/2009/05/passwordless-svnssh-access-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 03 May 2009 20:57:04 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[macos]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://liwen.name/?p=272</guid>
		<description><![CDATA[Related Posts: 1. Install Subversion 1.5.5 on Bluehost Linux 64bit Box 2. Configure svn+ssh on Windows OS After relentless pounding of my fingers on the keyboard just to feed the same password again and again and again to subversion repository in Mac terminal, I realised that typing password is not as fun as developing finger [...]]]></description>
			<content:encoded><![CDATA[<p>Related Posts:</p>
<p>1. <a href="http://liwen.name/2009/02/bluehost-subversion-windows-cmd/">Install Subversion 1.5.5 on Bluehost Linux 64bit Box</a><br />
2. <a href="http://liwen.name/2009/02/configure-svnssh-on-windows/">Configure svn+ssh on Windows OS</a></p>
<p>After relentless pounding of my fingers on the keyboard just to feed the same password again and again and again to subversion repository in Mac terminal, I realised that typing password is not as fun as developing finger habits in my beloved Emacs, although they are both repetitive. </p>
<p>I was reluctant to set up password-less svn+ssh access on my new Mac machine. The reason is that the key pair I am using were both generated by <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" rel="external">Putty</a>, one deployed on Linux server and one for Windows clients. I would rather play Street Fight 4 online for half hour other than reconfigure SSH access across three different operating systems &#8211; if it is not absolutely necessary. They both involve the phrase “pain in the ass”, if you know what I mean :) </p>
<p>Good news is that Mac OS comes with a SSH agent:</p>
<blockquote><p>ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA). The idea is that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or programs are started as clients to the ssh-agent program.  </p></blockquote>
<p>With the ssh agent, we can add the identity once per login. It means &#8216;add once, use everywhere&#8217;! It will be really helpful if you use more than one clients to connect to the same repository server.</p>
<p>Step1:<br />
Use mac os build in <a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/ssh-keygen.1.html#//apple_ref/doc/man/1/ssh-keygen" rel="external">ssh-keygen</a> to generate a pair of openssh format keys. Deploy the public key on your server (assume your server uses openssh) and set up the appropriate permissions (see the related post1 to lean more). If you already have a .ppk key, then a conversion from Putty format to openssh would probably be the easiest way to go. It can be done either using  <a rel="external"  href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">PuttyGen</a> in Windows OS or using a Putty Mac port (<a href="http://www.macports.org/" rel="external">MacPorts</a> or <a href="http://putty.darwinports.com/" rel="external">DawinPorts</a>). </p>
<p>Step2:<br />
Grant the key file minimum permissions. It needs to be:<br />
<code>chmod u=r,ga-rwx</code> </p>
<p>If you are curious about ssh agent, read step3 and step4, otherwise, just skip to step 5.</p>
<p><del datetime="2009-05-16T10:15:11+00:00">Step3:<br />
Find out the ssh-agent environment variable values: <code>SSH_AUTH_SOCK</code> and <code>SSH_AGENT_PID</code>. For more info about ssh agent in Mac OS, please <a href="http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/ssh-agent.1.html" rel="external">read here</a>.</del></p>
<p><img src="http://liwen.name/images/blog/mac_ssh_agent.jpg" alt="Mac OS SSH agent" /></p>
<p>Step4:<br />
<del datetime="2009-05-04T12:09:26+00:00">Set <code>SSH_AUTH_SOCK</code> and <code>SSH_AGENT_PID</code> environment variables in your subversion client of choice. If you only use command line clients, this step can be skipped.</del><br />
Update: It turned out the <code>SSH_AGENT_PID</code> value changes form login to login. </p>
<blockquote><p><code>/tmp/ssh-XXXXXXXXXX/agent.&lt;ppid&gt;</code><br />
Unix-domain sockets used to contain the connection to the authentication agent.  These sockets should only be readable by the owner.  The sockets should get automatically removed when the agent exits.</p></blockquote>
<p>In this case, the clients need to talk to the OS to find out the value. Since ssh-agent servers as a lower level service in the OS, it seems to be impossible to set up those values for clients manually and I assume it is not necessary.</p>
<p>Setp5:<br />
<del datetime="2009-05-04T12:09:26+00:00">Use ssh-add command to add the key to ssh authentication agent.<br />
<code>ssh-add yourkey</code></del></p>
<p>Find the following three files in the ~/.ssh/ directory (create if not exist).</p>
<blockquote>
<pre>
 ~/.ssh/identity
    Contains the protocol version 1 RSA authentication identity of the user.
 ~/.ssh/id_dsa
    Contains the protocol version 2 DSA authentication identity of the user.
 ~/.ssh/id_rsa
    Contains the protocol version 2 RSA authentication identity of the user.
</pre>
</blockquote>
<p>Append your private key in the right file (depends on the key type) and change the permission to <strong>owner read only</strong>, the ssh-agent will automatically read those files and add identities to the agent every time a ssh request occurs.</p>
<p>Now it&#8217;s really password-less!</p>
<p><img src="http://liwen.name/images/blog/mac_ssh_add.jpg" alt="Mac ssh-add command" /></p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/05/passwordless-svnssh-access-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You exposed too much</title>
		<link>http://liwen.name/2009/03/you-exposed-too-much/</link>
		<comments>http://liwen.name/2009/03/you-exposed-too-much/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 23:22:25 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://liwen.name/?p=193</guid>
		<description><![CDATA[Sometimes, actually most times, people love exposing, either to attract attention or express affection. Look how happy they are! This must be enjoyable! However, one probably should get himself fully covered when it comes to serious business &#8211; even it means sacrifice of agility and strength. This also applies to coding. When one&#8217;s code needs [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, actually most times, people love exposing, either to attract attention or express affection.</p>
<p><img src="http://liwen.name/images/blog/topless.jpg" alt="Topless" /></p>
<p>Look how happy they are! This must be enjoyable! </p>
<p>However, one probably should get himself fully covered when it comes to serious business &#8211; even it means sacrifice of agility and strength.</p>
<p><img src="http://liwen.name/images/blog/j-warrior.jpg" alt="Japanese Warrior" /></p>
<p>This also applies to coding. When one&#8217;s code needs to interact with other people’s code or intends to serve as a service, the less exposure, the better. As one of the three pillars of <acronym title="Object-Oriented Programming" >OOP</acronym>, <strong>encapsulation</strong> is defined as below:</p>
<blockquote><p>In computer science, Encapsulation is the hiding of the internal mechanisms and data structures of a software component behind a defined interface, in such a way that users of the component (other pieces of software) only need to know what the component does, and cannot make themselves dependent on the details of how it does it. <strong>The purpose is to</strong> achieve potential for change: the internal mechanisms of the component can be improved without impact on other components, or the component can be replaced with a different one that supports the same public interface.</p>
<p>Encapsulation <strong>also protects</strong> the integrity of the component, by preventing users from setting the internal data of the component into an invalid or inconsistent state.</p>
<p>Another benefit of encapsulation is that <strong>it reduces system complexity and thus increases robustness</strong>, by limiting the interdependencies between software components.</p></blockquote>
<p>Two weeks ago, I was asked to integrate a third-party online game into our system at work, here is the API I received.</p>
<p>For registration: </p>
<p><code>http://domain/service/commandHandler.php?Command=doCommand&#038;<br />
RequestID=b5e555ec-7788-486e-8426-37d82a97a287&#038;Code=234ab13&#038;Name=XXXXXXXXX&#038;<br />
Username= XXXXXXXXX&#038;FirstName=NTVA&#038;LastName=NTVA&#038;Password=XXXXXXXX&#038;<br />
Email=XXXXXXXXX&#038;CountryID=2&#038;State=NTVA&#038;PostCode=NTVA&#038;City=NTVA&#038;Address=NTVA&#038;<br />
PhoneNumber=NTVA&#038;GenderID=1&#038;DateOfBirth=20081111&#038;IsAffiliate=FalseDiscountCode=&#038;<br />
BannerID=XXXXXXXXX&#038;IBAN=&#038;BankAccountOwnerName=&#038;SwiftCode=&#038;BankName=</code></p>
<p>In the manual, it says only parameters marked as <code>XXXXXXX</code> are mandatory, others are all optional. sounds simple!</p>
<p>So here is what I did:</p>
<p>1. Send request like this: <code>http://domain/service/commandHandler.php?Command=doCommand&#038;RequestID=[Guid]&#038;<br />
RequestCode=RandamCode&#038;Name=XXXXXXXXX&#038;Username=XXXXXXXXX&#038;<br />
Password=XXXXXXXX&#038;Email=XXXXXXXXX&#038;<br />
BannerID=XXXXXXXXX.</code></p>
<p>Response:<code> Error in FirstName, LastName....</code> blar blar blar.</p>
<p>2. OK I guess it expects every parameter to be passed in even they are optional. So sent request like the below &#8211; I would not say it&#8217;s dumb:</p>
<p><code>http://domain/service/commandHandler.php?Command=doCommand&#038;<br />
RequestID=[GUID]&#038;Code=RandomCode&#038;Name=XXXXXXXXX&#038;<br />
Username= XXXXXXXXX&#038;FirstName= &#038;LastName=&#038;Password=XXXXXXXX&#038;Email=XXXXXXXXX&#038;<br />
CountryID=&#038;State=&#038;PostCode=&#038;City=&#038;Address=&#038;PhoneNumber=&#038;GenderID=1&#038;<br />
DateOfBirth=20081111&#038;IsAffiliate=False&#038;DiscountCode=&#038;BannerID=XXXXXXXXX&#038;IBAN=&#038;<br />
BankAccountOwnerName=&#038;SwiftCode=&#038;BankName=</code></p>
<p>Response: <code>Error in FirstName, LastName...</code> blar blar blar. This time all <code>‘parameter=’</code> didn&#8217;t complain, but all &#8216;parameter=NTVA&#8217; failed. </p>
<p>3. After 10 more times try, I finally figured out:</p>
<ul>
<li>The <code>RequestCode</code> need to be exact the same value as printed in the API example although there isn&#8217;t a single word of explanation about the mythical code.</li>
<li>All Parameters which have value <code>NTVA</code> in the printed API need to be set to something, if the values are available, you still need to set them to <code>NTVA</code>, <code>NTVA</code> means <code>NULL</code> or empty string.</li>
<li>The <code>countryCode</code> and <code>GenderID</code> must be numbers and again there is not a single sentence about those being mentioned in the manual. Who cares, let’s pass in the <code>countryCode</code> as 1 (I assure there will be at least one country) and <code>GenderID=1</code></li>
<li>The <code>DateOfBirth</code>, you need to pass in a string in <code>‘yyyymmdd’</code> format, let’s pass <code>19800101</code> to make sure every user I registered can access whatever porn you are going to show&#8230;</li>
<li>Hooray, registration succeeded! But I got no userID?</li>
<li>Let me give those guys a call to check if I did it right. Then I was astounded by what I heard: the <code>RequestID</code> is not suppose to be unique, just as the magical <code>RequestCode</code>, you need to send the same value (exact as printed in the API) every tim. <code>UserID</code> is not returned with registration command because they can’t see why we need it, but all other commands would return <code>userID</code> so you can get it later if you want – So my assumption is that they don&#8217;t know how to return an ID for newly inserted row.</li>
</ul>
<p>After all these steps, my first thought was to send the API to <a href="http://thedailywtf.com/" rel="external">The Daily WTF</a>.</p>
<p>How hard it could be to check whether a parameter is present in a HTTP request? Is it really impossible to determine if the value of the parameter is empty so I need to pass some stupid string like <code>NTVA</code>?</p>
<p>If things have been done down to such a level, I would not expect them to know encapsulation. (Notice all bold emphasised parts have been violated). But then how could you expect me to send user details into your database? Who knows what the data would end up to? Did you notice there are bank details to be expected?</p>
<p>The contact from the API provider is very enthusiastic about the project. Out of courtesy, I didn’t tell him that the API sucks.</p>
<p>From a tech perspective, I wouldn’t had gave it a go anyway, although the integration was cancelled due to other reasons.</p>
<p>Sometimes, actually most times, you need to get yourself well equipped before going out hunting for business. No one would choose vulnerable partner or hire naked soldiers. In a similar vain, skilled coders would not use overly exposed APIs, which will set everyone in trouble.</p>
<p>Show your robustness, not vulnerabilities.</p>
<p><img src="http://liwen.name/images/blog/HappyBirthdayChippendales.jpg" alt="HappyBirthdayChippendales" /></p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/03/you-exposed-too-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Early, Often, Thoroughly</title>
		<link>http://liwen.name/2009/03/early-often-thoroughly/</link>
		<comments>http://liwen.name/2009/03/early-often-thoroughly/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 19:25:04 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[methodology]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://liwen.name/?p=111</guid>
		<description><![CDATA[Along with the growth of my consciousness and experiences in software development, I discovered that there are three words which can be used universally really count: early, often and thoroughly. Here are two examples of using the template: Refactor early, refactor often, refactor thoroughly. Test early, test often, test thoroughly. For 9-5 programmers (The programmers [...]]]></description>
			<content:encoded><![CDATA[<p>Along with the growth of my consciousness and experiences in software development, I discovered that there are three words which can be used universally really count: <strong>early, often and thoroughly</strong>. Here are two examples of using the template:</p>
<blockquote><p>Refactor early, refactor often, refactor thoroughly.<br />
Test early, test often, test thoroughly.</p></blockquote>
<p>For 9-5 programmers (The programmers who come to work at 9am, shut down their computers at 5pm and go home with coding-proof bubbles around them.), my points would seem to be over killing. The overwhelming effort needed to practice the principles is enormous, after all, not every coder would like to put these things as his/her epitaph.</p>
<p>For well versed desktop application developers, these three words,  <strong>early, often and thorough, </strong>might not be innovative, as we all have read <em><a href="http://en.wikipedia.org/wiki/The_Pragmatic_Programmer" rel="external">The Pragmatic programmer</a></em> and Steve McConnell&#8217;s <em><a href="http://www.stevemcconnell.com/cc.htm" rel="external">Code Complete</a></em>. However, from a web developer&#8217;s point of view, they are quite interesting.</p>
<p>A typical web application development circle includes requirement, specification (optional), design, coding, testing and delivery. We apply different three word formulas to each stage.</p>
<h4>Requirements and Specification</h4>
<blockquote><p>Gather early, gather often, gather thoroughly.</p></blockquote>
<p>Clients, especially shareholders, usually are non tech savvy type of people, they come to you: &#8216;We want a website, we want it next month and we like Facebook pop-up bubbles!&#8217;. I am so glad you said &#8216;pop-up bubbles&#8217;! </p>
<p>Gathering requirements should be absolutely essential and it is the first deference of disappointment. Some small agencies, including the ones I worked with, tend to pitch their &#8216;free designs&#8217; in the first meeting, do the hard sells, tell the client nothing could not be done &#8211; even if the client want the web to trap real fish. </p>
<p>Instead of trapping clients with free design and ocean deep low price and then rip them off when it comes to tiny changes and maintenance, a well composed contract that is based on enough requirements would be more appropriate. For web applications, personally I don&#8217;t think specifications are usually necessary and somehow they produce more disappointment than satisfactions. Reason? it&#8217;s not easy to get the specific level right. How specific is specific enough? &#8216;Membership management&#8217; equals nothing when it comes to design and coding, but &#8216;The site needs three roles, respectively gusts, registered users and vip users&#8217; will guarantee future changes to be incurred. For a requirements-change-everyday application, you might want to spend more time to gather the right requirements to ensure the solidity of design &#8211; both visual and coding.</p>
<h4>Design and Coding</h4>
<blockquote><p>Refactor early, refactor often, refactor thoroughly</p></blockquote>
<p>Not to repeat many great <a href="http://lens.cos.ufrj.br/sugarloafplop/2002/download/refactoring-tutorial.pdf" rel="external">talks (PDF)</a> and <a href="http://stackoverflow.com/questions/140677/how-often-should-you-refactor" rel="external">discussions</a> on this topic, I will only say one point that I found very interesting yet paradoxical. <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" rel="external">DRY</a> is the first thing I learned from my C++ class and I believed in it for many years. But for web applications, it becomes quite disadvantageous sometimes: If the page only needs to be alive for three days, code generator and wizard are your best bets. Duplication? don&#8217;t worry about that, you would not have a chance to modify them before they die out from Google.</p>
<h4>Testing and Delivery</h4>
<blockquote><p>Test early, test often, test thoroughly.</p></blockquote>
<blockquote><p>User involve early, user involve often, user involve thoroughly.</p></blockquote>
<p>Test is a big topic and will not be discussed here. </p>
<p>User involving might be a pleasant way to work with, it is definitely the most efficient way of avoiding disappointment and disagreement. Let the end users involve from the beginning to the end. Give them a prototype of interface to play with, ask for feedback after each stage/component. There is a thing called one-mind, but you and your client don&#8217;t usually have it. Sometimes user doesn&#8217;t know how much effect would be involved for a small change of his mind; sometimes a big change the client is afraid of telling you may only requires one line code change. Communicating with user can synchronize user&#8217;s expectation and developers&#8217; decision, reducing the unhappiness caused by the parts which developers put a huge amount of effort in but lives out of user&#8217;s expectations and prevent client changing mind like a kid &#8211; which is far more efficient than specification and user would appreciate it. </p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/03/early-often-thoroughly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configure svn+ssh on Windows</title>
		<link>http://liwen.name/2009/02/configure-svnssh-on-windows/</link>
		<comments>http://liwen.name/2009/02/configure-svnssh-on-windows/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 20:52:58 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=40</guid>
		<description><![CDATA[As a proud command line junkie, I never went anywhere without my Emacs ssettings, which made my hands look like old branches from dead tree in some desert, but that&#8217;s fine for me, it&#8217;s been a decade since I ceased my hand moulding career. Ok It&#8217;s a lie but seriously, I am not a big [...]]]></description>
			<content:encoded><![CDATA[<p>As a proud command line junkie, I never went anywhere without my <a rel="external"  href="http://www.gnu.org/software/emacs/">Emacs</a> ssettings, which made my hands look like old branches from dead tree in some desert, but that&#8217;s fine for me, it&#8217;s been a decade since I ceased my hand moulding career.</p>
<p>Ok It&#8217;s a lie but seriously, I am not a big fan of mice and GUI, they usually slow me down and distract me from concentrating. Besides, some really bad designed HCI, such as <a rel="external" href="http://technet.microsoft.com/en-us/library/cc709628.aspx">Windows Vista UAC</a>, can easily push my buttons in all circumstances. People from Microsoft said </p>
<blockquote><p>“Disabling UAC risks your computer for allowing some worms to execute commands secretly without a prompt confirmation from end user.”</p></blockquote>
<p>and I up voted this as the correct answer: </p>
<blockquote><p>“Enabling UAC risks me throwing my computer out the window from frustration with a poorly designed and horribly executed security model.”</p></blockquote>
<p>Forgive me being loquacious, the point here is I don’t want to use <a rel="external" href="http://tortoisesvn.tigris.org/">TortoiseSVN</a> &#8211; I 100% agree with you that it&#8217;s a fantastic software, I do! I just need to get svn+ssh work with my Emacs shell mode.</p>
<p>Let&#8217;s get started.</p>
<p>1. Download <a rel="external" href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a>, if you are like me always afraid of installing untrusted software from the Internet because you believe that they are mostly badly written piece of crap that they would mess your already rubbished Windows OS completely then you can be greatly relieved here, I promise.</p>
<p>2. Start <code>Puttygen.exe</code> and generate a pair of keys, save the private key <strong>WITHOUT</strong> passcode,</p>
<p>3. Copy the public key, yes <strong>COPY</strong> not <strong>SAVE</strong>, paste/append it to <code>$HOME/.ssh/authorized_keys</code>, create the file if it doesn&#8217;t exist.</p>
<p>4. After modified the <code>authorized_keys</code> file, remember to:</p>
<p><code>chmod 700 authorized_keys<br />
chmod 600 .ssh</code></p>
<p>This is important as you may get connection errors if the file is group writable.</p>
<p>5. Next, test the connection with <code>putty.exe</code> or <code>plink.exe</code>, (side note:TortoiseSVN has a <code>plink.exe</code> windows implementation which would not pop up messages.)<br />
<code>plink.exe -i theprivatekey.ppk username@hostname </code></p>
<p>6. Modify your subversion configuration file. It&#8217;s in<br />
<code>c:\Users\yourname\AppData\Roaming\Subversion</code> in Windows Vista<br />
add the following line to your <code>[tunnels]</code> section:<br />
<code>ssh=x:/path/plink.exe -i x:/path/privatekey.ppk</code></p>
<p>Now you should be able to access your svn+ssh repository without typing password, in Microsoft Windows! Vista!</p>
<p>Some extra info for folks who love GUI – for TortoiseSVN users, you need to generate the OpenSSH private key from server, then load it with puttygen.exe and get the public key – it’s due to the fact that there are differences between private key implementations in putty and OpenSSH, otherwise you will get the lovely “server refused our key” message!</p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/02/configure-svnssh-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install Subversion 1.5.5 on Bluehost 64bit Box</title>
		<link>http://liwen.name/2009/02/bluehost-subversion-windows-cmd/</link>
		<comments>http://liwen.name/2009/02/bluehost-subversion-windows-cmd/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 23:55:18 +0000</pubDate>
		<dc:creator>Liwen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bluehost]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=20</guid>
		<description><![CDATA[The first thing I do before start typing code at home is to put it under version control system; the first thing I tried to do when had a SSH enabled reliable hosting, of course, was to set up Subversion server on it. There are already several tutorials in the Internet, why I am writing [...]]]></description>
			<content:encoded><![CDATA[<p>The first thing I do before start typing code at home is to put it under version control system; the first thing I tried to do when had a SSH enabled reliable hosting, of course, was to set up Subversion server on it.</p>
<p>There are already several tutorials in the Internet, why I am writing this again? Well, I just wanted to prove that I too, can write blog!  Among all those tutorials, none of them worked for me, I guess either I was trying to install the newest version of SVN or the BlueHost hosting environment has changed, or they just hate me. So I am constructing this and hope to contribute something I learned along the frustrating process of setting up SVN on 64bit shared hosting so you don’t need to smash your keyboard.</p>
<p>Once you enabled SSH on BlueHost control panel with a photo ID, it’s time to set up Subversion.</p>
<p>1. Open a terminal, type in:<br />
<code>ssh username@yourdomain.com</code><br />
and hit enter, then input your hosting password.</p>
<p>2. It’s better to create a separate folder for all the operations, in case our home directories got messed up by any mistakes.</p>
<p><code>mkdir src<br />
cd src</code></p>
<p>3. Download Subversion and dependencies:</p>
<p><code>wget http://subversion.tigris.org/downloads/subversion-1.5.5.tar.gz<br />
wget http://subversion.tigris.org/downloads/subversion-deps-1.5.5.tar.gz<br />
tar -xzvf subversion-1.5.5.tar.gz<br />
tar -xzvf subversion-deps-1.5.5.tar.gz<br />
cd subversion-1.5.5</code></p>
<p>4. Install <code>apr</code> and <code>apr-util</code>, notice the var <code>LDFLAGS</code> , it&#8217;s 64 bit, it&#8217;s m-A-g-I-c.</p>
<p><code>cd apr<br />
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"<br />
make &#038;&#038; make install</code></p>
<p><code>cd ../apr-util<br />
./configure --enable-shared --prefix=$HOME<br />
--with-apr=$HOME --without-berkeley-db LDFLAGS="-L/lib64"<br />
make &#038;&#038; make install</code></p>
<p>5. Install <code>neon</code>, I had been stuck here for an hour because of the 64 bit mode problem, remember to explicitly enable compilation of shared libraries and prefix the files into home directory.</p>
<p><code>cd ../neon<br />
EXTRA_CFLAGS="-L/lib64 -fPIC"<br />
CFLAGS="-L/lib64 -fPIC"<br />
./configure --prefix=$HOME --enable-shared LDFLAGS="-L/lib64" --with-libs=$HOME<br />
make &#038;&#038; make install</code></p>
<p>6. Install Subversion, pass <code>--without-apxs</code> and -<code>-without-apache</code> to prevent svn installing Apach modules, also you need to explicitly specify the dependencies.</p>
<p><code>cd ../<br />
./configure --prefix=$HOME --without-berkeley-db --with-apr=$HOME --with-apr-util=$HOME --with-neon=$HOME<br />
-without-apxs --without-apache<br />
make &#038;&#038; make install</code></p>
<p>7. Modify <code>.bash_profile</code> and <code>.bashrc</code> file</p>
<p><code>nano -w .bash_profil</code>e (pico is always my favourite.)<br />
add <code>$HOME/system/bin</code> to <code>PATH</code> variable, it should look like this:<br />
<code>PATH=$PATH:$HOME/bin:$HOME/system/bin</code><br />
Also add this line to your <code>.bashrc</code> file, after the &#8216;<code>fi</code>&#8216;<br />
PATH=$PATH:$HOME/bin</p>
<p>8. Logout the current session and log on again, let’s try:<br />
<code>mkdir ~/repos<br />
cd repos<br />
svnadmin create topsecrets007plus</code></p>
<p>now you can access your repository like this:<br />
<code>svn+ssh://username@host/home/username/repos/topsecrets007plus/</code><br />
just replace username with your 8-character user name given by BlueHost.</p>
]]></content:encoded>
			<wfw:commentRss>http://liwen.name/2009/02/bluehost-subversion-windows-cmd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
