<?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>Aleks&#039; Domain &#187; Programming</title>
	<atom:link href="http://metaleks.net/category/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://metaleks.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Mon, 19 Apr 2010 20:33:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Evolution of a Python Programmer</title>
		<link>http://metaleks.net/programming/the-evolution-of-a-python-programmer</link>
		<comments>http://metaleks.net/programming/the-evolution-of-a-python-programmer#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:42:09 +0000</pubDate>
		<dc:creator>Aleksandar Micovic</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[humour]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://metaleks.net/?p=742</guid>
		<description><![CDATA[A while back, clever snippets of code portraying how different people programming in Python went about solving the same problem, appeared on the internet. Needless to say, it was pretty funny and despite its popularity, not many people seem to know of it when I bring it up. Being as lazy as I am when [...]]]></description>
			<content:encoded><![CDATA[<p>A while back, clever snippets of code portraying how different people programming in Python went about solving the same problem, appeared on the internet. Needless to say, it was pretty funny and despite its popularity, not many people seem to know of it when I bring it up. Being as lazy as I am when it comes to these sorts of things, I am blogging about it now. Almost three years later. It has been posted and reposted dozens of times, but full of geek pride, I can proudly say that I helped create it by correcting some of the mistakes in the original. How&#8217;s that for major geek cred? </p>
<p>The original is right <a href="http://dis.4chan.org/read/prog/1180084983/">here</a>, if you&#8217;re interested.</p>
<h3>Newbie Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> factorial<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> x == <span style="color: #ff4500;">0</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> x <span style="color: #66cc66;">*</span> factorial<span style="color: black;">&#40;</span>x - <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> factorial<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>First Year Programmer (Studied Pascal)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> factorial<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    result = <span style="color: #ff4500;">1</span>
    i = <span style="color: #ff4500;">2</span>
    <span style="color: #ff7700;font-weight:bold;">while</span> i <span style="color: #66cc66;">&lt;</span>= x:
        result = result <span style="color: #66cc66;">*</span> i
        i = i + <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> result
<span style="color: #ff7700;font-weight:bold;">print</span> factorial<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>First Year Programmer (Studied C)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> fact<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>: <span style="color: #808080; font-style: italic;">#{</span>
    result = i = <span style="color: #ff4500;">1</span><span style="color: #66cc66;">;</span>
    <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span>i <span style="color: #66cc66;">&lt;</span>= x<span style="color: black;">&#41;</span>: <span style="color: #808080; font-style: italic;">#{</span>
        result <span style="color: #66cc66;">*</span>= i<span style="color: #66cc66;">;</span>
        i += <span style="color: #ff4500;">1</span><span style="color: #66cc66;">;</span>
    <span style="color: #808080; font-style: italic;">#}</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> result<span style="color: #66cc66;">;</span>
<span style="color: #808080; font-style: italic;">#}</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>First Year Programmer (Read <a href="http://mitpress.mit.edu/sicp/full-text/book/book.html">SICP</a>)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">@tailcall
<span style="color: #ff7700;font-weight:bold;">def</span> fact<span style="color: black;">&#40;</span>x, acc=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span>x <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>: <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#40;</span>fact<span style="color: black;">&#40;</span><span style="color: black;">&#40;</span>x - <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span>acc <span style="color: #66cc66;">*</span> x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:       <span style="color: #ff7700;font-weight:bold;">return</span> acc
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>First Year Programmer (Python)</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> Factorial<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    res = <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> i <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span>, x + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
        res <span style="color: #66cc66;">*</span>= i
    <span style="color: #ff7700;font-weight:bold;">return</span> res
<span style="color: #ff7700;font-weight:bold;">print</span> Factorial<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Lazy Python Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> fact<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> x <span style="color: #66cc66;">&gt;</span> <span style="color: #ff4500;">1</span> <span style="color: #ff7700;font-weight:bold;">and</span> x <span style="color: #66cc66;">*</span> fact<span style="color: black;">&#40;</span>x - <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">print</span> fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Lazier Python Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">f = <span style="color: #ff7700;font-weight:bold;">lambda</span> x: x <span style="color: #ff7700;font-weight:bold;">and</span> x <span style="color: #66cc66;">*</span> f<span style="color: black;">&#40;</span>x - <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">print</span> f<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Python Expert Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">fact = <span style="color: #ff7700;font-weight:bold;">lambda</span> x: <span style="color: #008000;">reduce</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span>.<span style="color: #0000cd;">__mul__</span>, <span style="color: #008000;">xrange</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span>, x + <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Python Hacker</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
@tailcall
<span style="color: #ff7700;font-weight:bold;">def</span> fact<span style="color: black;">&#40;</span>x, acc=<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> x: <span style="color: #ff7700;font-weight:bold;">return</span> fact<span style="color: black;">&#40;</span>x.<span style="color: #0000cd;">__sub__</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>, acc.<span style="color: #0000cd;">__mul__</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> acc
<span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>EXPERT PROGRAMMER</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> c_math <span style="color: #ff7700;font-weight:bold;">import</span> fact
<span style="color: #ff7700;font-weight:bold;">print</span> fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>BRITISH EXPERT PROGRAMMER</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> c_maths <span style="color: #ff7700;font-weight:bold;">import</span> fact
<span style="color: #ff7700;font-weight:bold;">print</span> fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Web Designer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> factorial<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;">#-------------------------------------------------</span>
    <span style="color: #808080; font-style: italic;">#--- Code snippet from The Math Vault          ---</span>
    <span style="color: #808080; font-style: italic;">#--- Calculate factorial (C) Arthur Smith 1999 ---</span>
    <span style="color: #808080; font-style: italic;">#-------------------------------------------------</span>
    result = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    i = <span style="color: #ff4500;">1</span> <span style="color: #808080; font-style: italic;">#Thanks Adam</span>
    <span style="color: #ff7700;font-weight:bold;">while</span> i <span style="color: #66cc66;">&lt;</span>= x:
        <span style="color: #808080; font-style: italic;">#result = result * i  #It's faster to use *=</span>
        <span style="color: #808080; font-style: italic;">#result = str(result * result + i)</span>
           <span style="color: #808080; font-style: italic;">#result = int(result *= i) #??????</span>
        result = <span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>result<span style="color: black;">&#41;</span> <span style="color: #66cc66;">*</span> i<span style="color: black;">&#41;</span>
        <span style="color: #808080; font-style: italic;">#result = int(str(result) * i)</span>
        i = i + <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> result
<span style="color: #ff7700;font-weight:bold;">print</span> factorial<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Unix Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">def</span> fact<span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'factorial '</span> + <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>x<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
fact<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Windows Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">NULL = <span style="color: #008000;">None</span>
<span style="color: #ff7700;font-weight:bold;">def</span> CalculateAndPrintFactorialEx<span style="color: black;">&#40;</span>dwNumber,
                                 hOutputDevice,
                                 lpLparam,
                                 lpWparam,
                                 lpsscSecurity,
                                 <span style="color: #66cc66;">*</span>dwReserved<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> lpsscSecurity <span style="color: #66cc66;">!</span>= NULL:
        <span style="color: #ff7700;font-weight:bold;">return</span> NULL <span style="color: #808080; font-style: italic;">#Not implemented</span>
    dwResult = dwCounter = <span style="color: #ff4500;">1</span>
    <span style="color: #ff7700;font-weight:bold;">while</span> dwCounter <span style="color: #66cc66;">&lt;</span>= dwNumber:
        dwResult <span style="color: #66cc66;">*</span>= dwCounter
        dwCounter += <span style="color: #ff4500;">1</span>
    hOutputDevice.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>dwResult<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    hOutputDevice.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
CalculateAndPrintFactorialEx<span style="color: black;">&#40;</span><span style="color: #ff4500;">6</span>, <span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span>, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL<span style="color: black;">&#41;</span></pre></td></tr></table></div>

<h3>Enterprise Programmer</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #dc143c;">new</span><span style="color: black;">&#40;</span>cls, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> cls<span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> Number<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> IntegralNumber<span style="color: black;">&#40;</span><span style="color: #008000;">int</span>, Number<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> toInt<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span><span style="color: #008000;">int</span>, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> InternalBase<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, base<span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">base</span> = base.<span style="color: black;">toInt</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> getBase<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #008000;">self</span>.<span style="color: black;">base</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> MathematicsSystem<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, ibase<span style="color: black;">&#41;</span>:
        Abstract
&nbsp;
    @<span style="color: #008000;">classmethod</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> getInstance<span style="color: black;">&#40;</span>cls, ibase<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            cls.__instance
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
            cls.__instance = <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>cls, ibase<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> cls.__instance
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> StandardMathematicsSystem<span style="color: black;">&#40;</span>MathematicsSystem<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, ibase<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span> ibase.<span style="color: black;">getBase</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">NotImplementedError</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">base</span> = ibase.<span style="color: black;">getBase</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> calculateFactorial<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, target<span style="color: black;">&#41;</span>:
        result = <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
        i = <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">while</span> i <span style="color: #66cc66;">&lt;</span>= target:
            result = result <span style="color: #66cc66;">*</span> i
            i = i + <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> result
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> StandardMathematicsSystem.<span style="color: black;">getInstance</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>InternalBase, <span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">calculateFactorial</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">new</span> <span style="color: black;">&#40;</span>IntegralNumber, <span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://metaleks.net/programming/the-evolution-of-a-python-programmer/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Recursively Removing .svn</title>
		<link>http://metaleks.net/programming/recursively-removing-svn</link>
		<comments>http://metaleks.net/programming/recursively-removing-svn#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:51:45 +0000</pubDate>
		<dc:creator>Aleksandar Micovic</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://metaleks.net/?p=546</guid>
		<description><![CDATA[I recently started working on an assignment that required me to copy some code from another repository. I did just that, but had a little trouble trying to add the new stuff to my new repository. After about a minute or two I realized that all of the newly copied old code still had the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started working on an assignment that required me to copy some code from another repository. I did just that, but had a little trouble trying to add the new stuff to my new repository. After about a minute or two I realized that all of the newly copied old code still had the hidden folder .svn&#8230;in every directory. I was copying an OS kernel, so there were quite a bit of these .svns sticking around. They needed to go if I was going to add any of my code into my repository.</p>
<p>How did I remove them? Like this.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-name</span> .svn <span style="color: #660033;">-print0</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-0</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://metaleks.net/programming/recursively-removing-svn/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
