<?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>Chin</title>
	<atom:link href="http://echin.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://echin.net</link>
	<description>All about me..</description>
	<lastBuildDate>Mon, 27 Feb 2012 15:34:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hosting Your Own Git Repositories</title>
		<link>http://echin.net/hosting-your-own-git-repositories/</link>
		<comments>http://echin.net/hosting-your-own-git-repositories/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 15:34:34 +0000</pubDate>
		<dc:creator>Chin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://echin.net/?p=183</guid>
		<description><![CDATA[I was using Subversion as software versioning and revision control system with my previous company. Hosting repositories with Subversion is not easy, and it is a centralized system where you can’t have your own local commits; and mergings within branches &#8230; <a href="http://echin.net/hosting-your-own-git-repositories/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was using Subversion as software versioning and revision control system with my previous company. Hosting repositories with Subversion is not easy, and it is a centralized system where you can’t have your own local commits; and mergings within branches to trunk always a nightmare for me.</p>
<p>I am happy to get to know about Git. Git is a free, open source and well developed source control management system developed by Linus Torvalds, initially for Linux kernel development.</p>
<p>Hosting with Git is easy, and it is a distributed version control system where you can have your codes committed to local or remotes. Git copy all of the data containing branches, tags and stored locally in client’s system in order to switch between branches in seconds. With Git, you can work offline, by committing your codes locally and push to the remotes whenever you have internet connections.</p>
<h2>Requirements</h2>
<ul>
<li>Linux or Unix based system</li>
<li>Git to be installed on both server and client</li>
<li>SSH access to the server</li>
</ul>
<h2>Git on Server</h2>
<p>SSH to the server, create the repository and create a bare Git repository.</p>
<pre><code>$ mkdir test.git
$ cd test.git
$ git --bare init</code></pre>
<p>That is all for the server side.</p>
<h2>Git on Client</h2>
<p>Open up Terminal, create a working directory, create an empty Git repository.</p>
<pre><code>$ mkdir test
$ cd test
$ git init</code></pre>
<p>We have created an empty Git repository. We will now add a file and commit the changes.</p>
<pre><code>$ touch README
$ git add README
$ git commit -a -m 'first commit'</code></pre>
<p>We have committed the changes. We will now setup the remote server and push to the server.</p>
<pre><code>$ git remote add origin git@server.com:test.git
$ git push origin master</code></pre>
<p>That is all for the first commit. Each and every time you want to push the changes to remotes, you can just do <code>git push</code></p>
<h2>Conclusion</h2>
<p>Code versioning makes our life easy! Try to start everything with <code>git init</code> today!</p>
]]></content:encoded>
			<wfw:commentRss>http://echin.net/hosting-your-own-git-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler &#8211; Problem 23</title>
		<link>http://echin.net/project-euler-problem-23/</link>
		<comments>http://echin.net/project-euler-problem-23/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 06:38:43 +0000</pubDate>
		<dc:creator>Chin</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[abundant]]></category>
		<category><![CDATA[euler]]></category>
		<category><![CDATA[factor]]></category>
		<category><![CDATA[perfect]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://echin.net/?p=180</guid>
		<description><![CDATA[Problem A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 &#8230; <a href="http://echin.net/project-euler-problem-23/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.</p>
<p>A number <em>n</em> is called deficient if the sum of its proper divisors is less than <em>n</em> and it is called abundant if this sum exceeds <em>n</em>.</p>
<p>As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit.</p>
<p>Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers.</p>
<h2>Solution</h2>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://echin.net/project-euler-problem-23/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Project Euler &#8211; Problem 22</title>
		<link>http://echin.net/project-euler-problem-22/</link>
		<comments>http://echin.net/project-euler-problem-22/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 06:23:25 +0000</pubDate>
		<dc:creator>Chin</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[euler]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[score]]></category>

		<guid isPermaLink="false">http://echin.net/?p=178</guid>
		<description><![CDATA[Problem Using names.txt (right click and &#8216;Save Link/Target As&#8230;&#8217;), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical &#8230; <a href="http://echin.net/project-euler-problem-22/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>Using <a href="http://projecteuler.net/project/names.txt">names.txt</a> (right click and &#8216;Save Link/Target As&#8230;&#8217;), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the alphabetical value for each name, multiply this value by its alphabetical position in the list to obtain a name score.</p>
<p>For example, when the list is sorted into alphabetical order, COLIN, which is worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would obtain a score of 938 &times; 53 = 49714.</p>
<p>What is the total of all the name scores in the file?</p>
<h2>Solution</h2>
<pre>$sum = 0;

for ($i = 1; $i &lt; 10000; $i++) {
  if ($i == d(d($i)) &amp;&amp; $i != d($i)) {
    $sum += $i;
  }
}

echo $sum;

function d($num) {
  $temp = 0;

  for ($i = 1; $i &lt;= $num / 2; $i++) {
    if ($num % $i == 0) {
      $temp += $i;
    }
  }

  return $temp;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://echin.net/project-euler-problem-22/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler &#8211; Problem 21</title>
		<link>http://echin.net/project-euler-problem-21/</link>
		<comments>http://echin.net/project-euler-problem-21/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 04:58:25 +0000</pubDate>
		<dc:creator>Chin</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[amicable]]></category>
		<category><![CDATA[divisor]]></category>
		<category><![CDATA[euler]]></category>
		<category><![CDATA[factor]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://echin.net/?p=176</guid>
		<description><![CDATA[Problem Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a &#8800; b, then a and b are an &#8230; <a href="http://echin.net/project-euler-problem-21/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p>Let d(<em>n</em>) be defined as the sum of proper divisors of <em>n</em> (numbers less than <em>n</em> which divide evenly into <em>n</em>).<br />
If d(<em>a</em>) = <em>b</em> and d(<em>b</em>) = <em>a</em>, where <em>a</em> &ne; <em>b</em>, then <em>a</em> and <em>b</em> are an amicable pair and each of <em>a</em> and <em>b</em> are called amicable numbers.</p>
<p>For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.</p>
<p>Evaluate the sum of all the amicable numbers under 10000.</p>
<h2>Solution</h2>
<pre>$sum = 0;

for ($i = 1; $i &lt; 10000; $i++) {
  if ($i == d(d($i)) &amp;&amp; $i != d($i)) {
    $sum += $i;
  }
}

echo $sum;

function d($num) {
  $temp = 0;

  for ($i = 1; $i &lt;= $num / 2; $i++) {
    if ($num % $i == 0) {
      $temp += $i;
    }
  }

  return $temp;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://echin.net/project-euler-problem-21/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Project Euler &#8211; Problem 20</title>
		<link>http://echin.net/project-euler-problem-20/</link>
		<comments>http://echin.net/project-euler-problem-20/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 04:41:08 +0000</pubDate>
		<dc:creator>Chin</dc:creator>
				<category><![CDATA[Project Euler]]></category>
		<category><![CDATA[digit]]></category>
		<category><![CDATA[euler]]></category>
		<category><![CDATA[multiplication]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sum]]></category>

		<guid isPermaLink="false">http://echin.net/?p=174</guid>
		<description><![CDATA[Problem n! means n &#215; (n − 1) &#215; &#8230; &#215; 3 &#215; 2 &#215; 1 For example, 10! = 10 &#215; 9 &#215; &#8230; &#215; 3 &#215; 2 &#215; 1 = 3628800, and the sum of the digits in &#8230; <a href="http://echin.net/project-euler-problem-20/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>Problem</h2>
<p><em>n</em>! means <em>n</em> &times; (<em>n</em> − 1) &times; &#8230; &times; 3 &times; 2 &times; 1</p>
<p>For example, 10! = 10 &times; 9 &times; &#8230; &times; 3 &times; 2 &times; 1 = 3628800,<br />
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27.</p>
<p>Find the sum of the digits in the number 100!</p>
<h2>Solution</h2>
<pre>echo problem20(100);

function problem20($num) {
  $sum = 0;
  $temp = 1;

  for ($i = 1; $i < $num; $i++) {
    $temp = bcmul($temp, $i);
  }

  $arrDigit = str_split($temp);

  foreach ($arrDigit as $digit) {
    $sum += $digit;
  }

  return $sum;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://echin.net/project-euler-problem-20/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

