<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>phimuemue&#039;s Blog</title>
	<atom:link href="http://phimuemue.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phimuemue.wordpress.com</link>
	<description>Allerlei.</description>
	<lastBuildDate>Thu, 03 Feb 2011 17:08:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='phimuemue.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>phimuemue&#039;s Blog</title>
		<link>http://phimuemue.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://phimuemue.wordpress.com/osd.xml" title="phimuemue&#039;s Blog" />
	<atom:link rel='hub' href='http://phimuemue.wordpress.com/?pushpress=hub'/>
		<item>
		<title>I&#8217;m movin</title>
		<link>http://phimuemue.wordpress.com/2009/08/14/im-movin/</link>
		<comments>http://phimuemue.wordpress.com/2009/08/14/im-movin/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 10:32:59 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=451</guid>
		<description><![CDATA[My page/blog is moving to another page: phimuemue.com This is probably my last post here. I&#8217;m thinking about moving all posts to phimuemue.com. phimuemue.com is not completely finished yet and has not too much content yet, but it will be filled more and more over the time.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=451&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My page/blog is moving to another page:</p>
<p><a href="http://phimuemue.com">phimuemue.com</a><br />
<span id="more-451"></span><br />
This is probably my last post here. I&#8217;m thinking about moving all posts to <a href="http://phimuemue.com">phimuemue.com</a>.</p>
<p><a href="http://phimuemue.com">phimuemue.com</a> is not completely finished yet and has not too much content yet, but it will be filled more and more over the time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/451/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/451/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/451/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=451&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/08/14/im-movin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>SAT &#8211; a randomized algorithm</title>
		<link>http://phimuemue.wordpress.com/2009/08/04/sat-a-randomized-algorithm/</link>
		<comments>http://phimuemue.wordpress.com/2009/08/04/sat-a-randomized-algorithm/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 12:57:57 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Probability theory]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=426</guid>
		<description><![CDATA[As everybody knows, SAT is NP-complete. Here is a randomized algorithm that (eventually) solves an instance of a SAT-Problem (in polynomial time). The problem must be given in conjunctive normal form. The algorithm uses the following format for the problem: Let&#8217;s call our boolean variables . I want to show the format for the algorithm [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=426&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As everybody knows, <a href="http://en.wikipedia.org/wiki/Boolean_satisfiability_problem">SAT</a> is NP-complete.</p>
<p>Here is a randomized algorithm that (<em>eventually</em>) solves an instance of a SAT-Problem (in polynomial time).<br />
<span id="more-426"></span><br />
The problem must be given in <a href="http://en.wikipedia.org/wiki/Conjunctive_normal_form">conjunctive normal form</a>. The algorithm uses the following format for the problem: </p>
<p>Let&#8217;s call our boolean variables <img src='http://s0.wp.com/latex.php?latex=v_1%2C+v_2%2C+%5Cdots%2C+v_n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v_1, v_2, &#92;dots, v_n' title='v_1, v_2, &#92;dots, v_n' class='latex' />. I want to show the format for the algorithm with an example. Consider the following CNF: <img src='http://s0.wp.com/latex.php?latex=%28v_1+%5Cvee+%5Clnot+v_2%29+%5Cwedge+%28%5Clnot+v_1+%5Cvee+v_3%29+%5Cwedge+%28v_2+%5Cvee+v_3+%5Cvee+%5Clnot+v_4%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(v_1 &#92;vee &#92;lnot v_2) &#92;wedge (&#92;lnot v_1 &#92;vee v_3) &#92;wedge (v_2 &#92;vee v_3 &#92;vee &#92;lnot v_4)' title='(v_1 &#92;vee &#92;lnot v_2) &#92;wedge (&#92;lnot v_1 &#92;vee v_3) &#92;wedge (v_2 &#92;vee v_3 &#92;vee &#92;lnot v_4)' class='latex' />. A satisfiying combination of variables would be: <img src='http://s0.wp.com/latex.php?latex=v_1%3D1%2C+v_2%3D1%2C+v_3%3D1%2C+v_4%3D0&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v_1=1, v_2=1, v_3=1, v_4=0' title='v_1=1, v_2=1, v_3=1, v_4=0' class='latex' /> (1 corresponds with true, 0 corresponds with false).</p>
<p>The above formula would be translated into the following array of arrays:</p>
<pre class="brush: ruby;">
[[1,-2],[1,3],[2,3,-4]]
</pre>
<p>The first element, <code>[1,-2]</code> shows, that <img src='http://s0.wp.com/latex.php?latex=v_1&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v_1' title='v_1' class='latex' /> is used normal and <img src='http://s0.wp.com/latex.php?latex=v_2&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v_2' title='v_2' class='latex' /> is negated. The other elements show things correspondingly.</p>
<p>Here&#8217;s the source code (Ruby):</p>
<pre class="brush: ruby;">
# Input format: Array of arrays
# [[+1,+2],[-1,+3]] =&gt; (A or B) and (-A or C)
# i.e. sign indicates, wether variable is beeing neglected (-) or not (+)
# !!! Special: Using 1-indexed subarrays (otherwise problems with sign and 0)

def randomBool()
  return (rand(2)==0)
end

# controls the whole CNF
def validateField(field, belegung)
  result=true
  field.each { |b|
    result=(result and validateSubField(b, belegung))
  }
  return result
end

# controls a subarray of the CNF
def validateSubField(field,belegung)
  result=false
  field.each { |b|
    zw = belegung[b.abs]
    if (b&lt;0)
      zw = (not zw)
    end
    result = (result or zw)
  }
  return result
end

# n is the number of variables
def solve(field, n)
  result = Array.new(n+1){ |i| randomBool() }
  timeout=200
  timeout.times{
    # look for corrupt clause
    field.each { |e|
      if (not validateSubField(e, result))
        zw = rand(e.length)
        result[e[zw]]=(not result[e[zw]])
        break
      end
    }
  }
  result[0]=&quot;Result:&quot;
  if (validateField(field, result))
    return result
  end
  return &quot;No solution found in #{timeout} steps found&quot;
end

# Generates a CNF using n variables and l subfields with k elements
def generateRandomCNF(n, l, k)
  result = Array.new(l){ Array.new(k) }
  result.each { |f|
    f.length.times{ |i|
      a = (rand(n)*((rand(2.0)-0.5)*2)).to_i
      while (a==0)
        a = (rand(n)*((rand(2.0)-0.5)*2)).to_i
      end
      f[i]=a
    }
  }
end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/426/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/426/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/426/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=426&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/08/04/sat-a-randomized-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>A nice method for&#8230;</title>
		<link>http://phimuemue.wordpress.com/2009/07/29/a-nice-method-for/</link>
		<comments>http://phimuemue.wordpress.com/2009/07/29/a-nice-method-for/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:52:58 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Can you solve it?]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[bit twiddling]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[quiz]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=406</guid>
		<description><![CDATA[Consider the following Code (in Python): def dosomething(a, b): result=0 while (a): if (a&#38;1): result+=b b=b&#60;&#60;1 a=a&#62;&#62;1 return result The function needs a to be a positive integer and b to be an integer. What does the function do? Can you tell how it works?<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=406&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Consider the following Code (in Python):</p>
<pre class="brush: python;">
def dosomething(a, b):
    result=0
    while (a):
        if (a&amp;1):
            result+=b
        b=b&lt;&lt;1
        a=a&gt;&gt;1
    return result
</pre>
<p>The function needs <code>a</code> to be a positive integer and <code>b</code> to be an integer.</p>
<p>What does the function do? Can you tell how it works?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/406/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=406&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/07/29/a-nice-method-for/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>Some algorithmic quizzes</title>
		<link>http://phimuemue.wordpress.com/2009/07/11/some-algorithmic-quizzes/</link>
		<comments>http://phimuemue.wordpress.com/2009/07/11/some-algorithmic-quizzes/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 09:23:07 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Can you solve it?]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=374</guid>
		<description><![CDATA[Many algorithmic puzzles are circulating around the net. Here i want to present some problems i came across and found interesting to solve (or not to solve). Neither did i solve all the problems nor do i even know, if solutions exist for particular problems. Partial shifts Consider an array . A k-shift (notation: ) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=374&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many algorithmic puzzles are circulating around the net. Here i want to present some problems i came across and found interesting to solve (or not to solve).<br />
<span id="more-374"></span><br />
Neither did i solve all the problems nor do i even know, if solutions exist for particular problems.</p>
<h3>Partial shifts</h3>
<p>Consider an array <img src='http://s0.wp.com/latex.php?latex=a+%3D+a_0%2C+a_1%2C+%5Cdots+a_n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='a = a_0, a_1, &#92;dots a_n' title='a = a_0, a_1, &#92;dots a_n' class='latex' />. A k-shift (notation: <img src='http://s0.wp.com/latex.php?latex=s_k&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s_k' title='s_k' class='latex' />) is an operation that takes the k-th element and moves it to the first position. For example <img src='http://s0.wp.com/latex.php?latex=s_3%280%2C1%2C2%2C3%2C4%2C5%29+%3D+%283%2C0%2C1%2C2%2C4%2C5%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s_3(0,1,2,3,4,5) = (3,0,1,2,4,5)' title='s_3(0,1,2,3,4,5) = (3,0,1,2,4,5)' class='latex' />.</p>
<p>The goal is to sort the array using only k-shifts. Give an polynomial-time algorithm that calculates the minimum number of shifts to sort the array, and the shifts itself.</p>
<p><strong>Bonus:</strong> What is the expected number of moves?</p>
<h3>Finding minimum / maximum</h3>
<p>Given an array, that either consists of first ascending and then descending numbers (e.g. 0, 3, 5, 7, 9, 13, 7, 4, 2), of first descending and then ascending numbers (e.g. 10, 8, 3, 2, 5, 7, 9).</p>
<p>Give an efficient algorithm that computes the position of the maximum or minimum, respectively.</p>
<h3>Finding palindromes</h3>
<p>A palindrom is a sequence of signs that can be read from left to right and right to left without changing, that is: <img src='http://s0.wp.com/latex.php?latex=p_1%2C+p_2%2C+%5Cdots%2C+p_%7Bn-1%7D%2C+p_n+%3D+p_n%2C+p_%7Bn-1%7D%2C+%5Cdots+p_2%2C+p_1&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='p_1, p_2, &#92;dots, p_{n-1}, p_n = p_n, p_{n-1}, &#92;dots p_2, p_1' title='p_1, p_2, &#92;dots, p_{n-1}, p_n = p_n, p_{n-1}, &#92;dots p_2, p_1' class='latex' />.</p>
<p>Given an array of characters, find the longest palindromic subarray efficiently (that is: <img src='http://s0.wp.com/latex.php?latex=O%28n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n)' title='O(n)' class='latex' />).</p>
<h3>Stack sorting</h3>
<p>Given a stack, sort its content using only:</p>
<li>recursion</li>
<li>a queue</li>
<h3>Tree distances</h3>
<p>Given a undirected, unweighted tree, give an preprocessing algorithm, so that all distances from node <img src='http://s0.wp.com/latex.php?latex=u&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='u' title='u' class='latex' /> to node <img src='http://s0.wp.com/latex.php?latex=v&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v' title='v' class='latex' /> can be computed in <img src='http://s0.wp.com/latex.php?latex=O%28dist%28u%2Cv%29%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(dist(u,v))' title='O(dist(u,v))' class='latex' />.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/374/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/374/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/374/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=374&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/07/11/some-algorithmic-quizzes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>Can you solve it? &#8211; Maximum sum</title>
		<link>http://phimuemue.wordpress.com/2009/07/11/can-you-solve-it-maximum-sum/</link>
		<comments>http://phimuemue.wordpress.com/2009/07/11/can-you-solve-it-maximum-sum/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 13:39:32 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Can you solve it?]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=370</guid>
		<description><![CDATA[Here i want to present a quite nice small puzzle: Given an array of not necessarily positive numbers (elements are called ), i want to find the indices , , where , so that the sum is maximal. The task is to find an algorithm that runs in .<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=370&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here i want to present a quite nice small puzzle: Given an array of not necessarily positive numbers (elements are called <img src='http://s0.wp.com/latex.php?latex=a_0%2C+a_1%2C+%5Cdots%2C+a_n&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='a_0, a_1, &#92;dots, a_n' title='a_0, a_1, &#92;dots, a_n' class='latex' />), i want to find the indices <img src='http://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />, <img src='http://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' />, where <img src='http://s0.wp.com/latex.php?latex=i+%5Cleq+j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i &#92;leq j' title='i &#92;leq j' class='latex' />, so that the sum <img src='http://s0.wp.com/latex.php?latex=%5Csum_%7Bk%3Di%7D%5Ej+a_k&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;sum_{k=i}^j a_k' title='&#92;sum_{k=i}^j a_k' class='latex' /> is maximal.</p>
<p>The task is to find an algorithm that runs in <img src='http://s0.wp.com/latex.php?latex=O%28n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n)' title='O(n)' class='latex' />.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=370&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/07/11/can-you-solve-it-maximum-sum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>Five easy to avoid programming mistakes</title>
		<link>http://phimuemue.wordpress.com/2009/07/10/five-easy-to-avoid-programming-mistakes/</link>
		<comments>http://phimuemue.wordpress.com/2009/07/10/five-easy-to-avoid-programming-mistakes/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 15:00:33 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=347</guid>
		<description><![CDATA[When reading source code, i often wonder, why it is so hard to understand. This applies for code from others as well as for my own code i wrote some time ago. Here are some tipps that could make maintaining and reading your code a bit easier. Dead Code Many programmers tend to comment out [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=347&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When reading source code, i often wonder, why it is so hard to understand. This applies for code from others as well as for my own code i wrote some time ago.</p>
<p>Here are some tipps that could make maintaining and reading your code a bit easier.<br />
<span id="more-347"></span></p>
<h3>Dead Code</h3>
<p>Many programmers tend to comment out their code, if they want to test something. This leads to dead code:</p>
<pre class="brush: cpp;">
int a;
cin &gt;&gt; a;
// Old Test, no more needed
/*if (a&gt;=20) {
 doSomething()
}*/
if (a&gt;=30) {
 doSomethingElse()
}
</pre>
<p>Of course, the above example is very trivial, but if the <code>doSomething</code>-Routines are sufficiently long, and the commented-out code is too much, you get a mess of no more used code. So just refactor it and remove the code you don&#8217;t need anymore:</p>
<pre class="brush: cpp;">
int a;
cin &gt;&gt; a;
if (a&gt;=30) {
 doSomethingElse()
}
</pre>
<h3>Tricky constants</h3>
<p>Often, we use integer numbers to identify something. Let&#8217;s consider a function that takes an integer as argument and interprets it as something special. In our case, the number stands for a mathematical operation:</p>
<pre class="brush: cpp;">
int calculate(int a, int b, int operation){
 if (operation==1) return a+b;
 if (operation==2) return a-b;
 if (operation==3) return a*b;
 if (operation==4) return a/b;
}
</pre>
<p>If our constants are not as simple as in the example above, we can easily forget, what they stand for. For that reason, it is better to define them as constants somewhere and checking against the constants:</p>
<pre class="brush: cpp;">
#define OP_ADD 1
#define OP_SUB 2
#define OP_MUL 3
#define OP_DIV 4
int calculate(int a, int b, int operation){
 if (operation==OP_ADD) return a+b;
 if (operation==OP_SUB) return a-b;
 if (operation==OP_MUL) return a*b;
 if (operation==OP_DIV) return a/b;
}
</pre>
<h3>Long and confusing methods</h3>
<p>If method definitions are too long, they are much harder to handle. If one discovers lenghty methods, it could be a sign that the problem isn&#8217;t split up well enough into smaller subproblems. So source out some passages of the code to make it easier to read and maintain.</p>
<p>A rule of thumb says, that every method should fit on a single screen page so it can be read completely without scrolling.</p>
<h3>Ugly looking code</h3>
<p>I often come across code that isn&#8217;t well-formatted. That is, there is (almost) no indentation, no whitespace, etc&#8230;</p>
<p>Consider the following example snippet:</p>
<pre class="brush: cpp;">
void bubbleSort(int *a,int l){
for(int j=l-1;j&gt;0;--j){
for(int i=0;i&lt;j;++i){
if(a[i]&gt;a[i+1]){
int tmp=a[i];
a[i]=a[i+1];
a[i+1]=tmp;}}}}
</pre>
<p>Of course, the above example is extreme. But it is quite easy to do it more nicely:</p>
<pre class="brush: cpp;">
// *a   array to sort
//  l   size of the array
void bubbleSort(int *a,int l){
   for(int upper=l-1;upper&gt;0;--upper){
      for(int pos=0;pos&lt;upper;++pos){
         if(a[pos]&gt;a[pos+1]){
            int tmp=a[pos];
            a[pos]=a[pos+1];
            a[pos+1]=tmp;
         }
      }
   }
}
</pre>
<p>Describe the arguments to a function (if not obvious). If necessary, allow yourself to use whitespace. That structures the code enormously.</p>
<h3>Don&#8217;t use superflous comments</h3>
<p>Consider the following snippet:</p>
<pre class="brush: cpp;">
float p(int s){
   // initial value of result: 1
   float res = 1;
   // do s steps
   for (int i = 1; i &lt; s; ++i){
      // calculate reciprocal value and add it.
      res = 1 + (1/res);
   }
   return res;
}
</pre>
<p>Do you know what it does? If not, see the snippet below:</p>
<pre class="brush: cpp;">
// approximates the golden ratio (~1.61)
float p(int s){
   float res = 1;
   for (int i = 1; i &lt; s; ++i){
      res = 1 + (1/res);
   }
   return res;
}
</pre>
<p>Give comments that explain the things you can not see directly from the code.</p>
<p>Or even better, use appropriate describing method names (if possible). (Thanks to gutzofter for his hint.)</p>
<pre class="brush: cpp;">
float approximateGoldenRatio(int steps){
   float res = 1;
   for (int i = 1; i &lt; steps; ++i){
      res = 1 + (1/res);
   }
   return res;
}
</pre>
<h3>Conclusion</h3>
<p>Even if it seems quite simple to follow these common sense tipps, it is often more difficult than one might think.</p>
<p>It is useful to control the code from time to time end eventually refactor it, so it can be read better. To put it in a nutshell:</p>
<p><a href="http://phimuemue.files.wordpress.com/2009/07/20090121-alwayscodeasif.png"><img src="http://phimuemue.files.wordpress.com/2009/07/20090121-alwayscodeasif.png?w=425&#038;h=280" alt="20090121-alwayscodeasif" title="20090121-alwayscodeasif" width="425" height="280" class="aligncenter size-full wp-image-363" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=347&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/07/10/five-easy-to-avoid-programming-mistakes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>

		<media:content url="http://phimuemue.files.wordpress.com/2009/07/20090121-alwayscodeasif.png" medium="image">
			<media:title type="html">20090121-alwayscodeasif</media:title>
		</media:content>
	</item>
		<item>
		<title>Some thoughts on terrain generation</title>
		<link>http://phimuemue.wordpress.com/2009/06/09/some-thoughts-on-terrain-generation/</link>
		<comments>http://phimuemue.wordpress.com/2009/06/09/some-thoughts-on-terrain-generation/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 21:35:41 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[diamond square]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[midpoint displacement]]></category>
		<category><![CDATA[terrain]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=305</guid>
		<description><![CDATA[This file provides a general insight in how to generate terrains using the diamond-square algorithm. You can download the file here. It is just a draft, but i&#8217;m offering it here, because i hope it could help somebody.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=305&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This file provides a general insight in how to generate terrains using the diamond-square algorithm.</p>
<p>You can download the file <a href='http://phimuemue.files.wordpress.com/2009/06/terrain-generation.pdf'>here</a>. It is just a draft, but i&#8217;m offering it here, because i hope it could help somebody.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/305/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/305/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/305/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=305&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/06/09/some-thoughts-on-terrain-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>Logarithm of float numbers</title>
		<link>http://phimuemue.wordpress.com/2009/06/08/logarithm-of-float-numbers/</link>
		<comments>http://phimuemue.wordpress.com/2009/06/08/logarithm-of-float-numbers/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 12:40:59 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Assembler]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[assembler]]></category>
		<category><![CDATA[bit hacking]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[logarithm]]></category>
		<category><![CDATA[logarithmus]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=247</guid>
		<description><![CDATA[Some time ago, a teacher asked me, how computers logarithmize float numbers. Of couse, one could use the power series . But soon it is clear, that the series converges quite slowly. The following article gives a general insight how floats could be logarithmized faster. It shows an approximative algorithm that can be extended to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=247&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some time ago, a teacher asked me, how computers logarithmize float numbers.<br />
Of couse, one could use the power series<br />
<img src='http://s0.wp.com/latex.php?latex=%5Cln%281%2Bx%29+%3D+%5Csum_%7Bk%3D1%7D%5E%7B%5Cinfty%7D+%28-1%29%5E%7Bk%2B1%7D+%5Ccdot+%5Cdfrac%7Bx%5Ek%7D%7Bk%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;ln(1+x) = &#92;sum_{k=1}^{&#92;infty} (-1)^{k+1} &#92;cdot &#92;dfrac{x^k}{k}' title='&#92;ln(1+x) = &#92;sum_{k=1}^{&#92;infty} (-1)^{k+1} &#92;cdot &#92;dfrac{x^k}{k}' class='latex' />.<br />
But soon it is clear, that the series converges quite slowly.</p>
<p>The following article gives a general insight how floats could be logarithmized faster. It shows an approximative algorithm that can be extended to get more accurate results.<br />
<span id="more-247"></span><br />
It should be clear, that doesnt really matter wich base we choose to calculate the logarithm. We can write every logarithm (with positive base):</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Clog_b+%28a%29+%3D+%5Cdfrac%7B%5Clog+_c%28a%29%7D%7B%5Clog_c%28b%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log_b (a) = &#92;dfrac{&#92;log _c(a)}{&#92;log_c(b)}' title='&#92;log_b (a) = &#92;dfrac{&#92;log _c(a)}{&#92;log_c(b)}' class='latex' />.</p>
<p>This means, if we have calculated a logarithm for a certain base, we can just compute the logarithm for any other base. As we will se later, for logarithmizing float numbers, it is convenient to choose base 2.</p>
<p>Lets assume we are working with 32-bit float numbers, that is, we have four bytes to form a float.</p>
<p>The internal representation of float numbers is essential to understand how the algorithm works. The image below shows float representation according to <a href="http://en.wikipedia.org/wiki/IEEE_754-1985">IEEE-754</a>:</p>
<p><img src="http://phimuemue.files.wordpress.com/2009/06/576px-ieee-754-single-svg1.png?w=450&#038;h=98" alt="576px-IEEE-754-single.svg" title="576px-IEEE-754-single.svg" width="450" height="98" class="aligncenter size-full wp-image-250" /></p>
<p>That means (<img src='http://s0.wp.com/latex.php?latex=b_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='b_i' title='b_i' class='latex' /> denotes the bit at position <img src='http://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />):</p>
<li>S stands for sign <img src='http://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' />, i.e. -1 or 1 (respectively, in bits: 1 or 0)</li>
<li>E stands for a biased exponent. That means, that the exponent is calculated as the normal binary number minus 128:<br />
<img src='http://s0.wp.com/latex.php?latex=e%27+%3D+%5Cleft%28+%5Csum_%7Bi%3D30%7D%5E%7B23%7D+b_%7Bi%7D+%5Ccdot+2%5E%7Bi+-+23%7D+%5Cright%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e&#039; = &#92;left( &#92;sum_{i=30}^{23} b_{i} &#92;cdot 2^{i - 23} &#92;right)' title='e&#039; = &#92;left( &#92;sum_{i=30}^{23} b_{i} &#92;cdot 2^{i - 23} &#92;right)' class='latex' /><br />
<img src='http://s0.wp.com/latex.php?latex=e+%3D+e%27+-+127&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e = e&#039; - 127' title='e = e&#039; - 127' class='latex' /></li>
<li>M stands for mantissa. Mantissa is calculated as follows:<br />
<img src='http://s0.wp.com/latex.php?latex=m+%3D+1+%2B+%5Csum_%7Bi%3D0%7D%5E%7B22%7D+b_%7Bi%7D+%5Ccdot+%5Cfrac%7B1%7D%7B2%5E%7B23-i%7D%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='m = 1 + &#92;sum_{i=0}^{22} b_{i} &#92;cdot &#92;frac{1}{2^{23-i}}' title='m = 1 + &#92;sum_{i=0}^{22} b_{i} &#92;cdot &#92;frac{1}{2^{23-i}}' class='latex' /></li>
<p>(See <a href="http://en.wikipedia.org/wiki/IEEE_754-1985">Wikipedia</a> for details.)</p>
<p>If we know <img src='http://s0.wp.com/latex.php?latex=s%2C+m%2C+e%27&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s, m, e&#039;' title='s, m, e&#039;' class='latex' /> as integral numbers (each in binary notation), we can calculate the value <img src='http://s0.wp.com/latex.php?latex=v+%3D+s+%5Ccdot+2%5E%7Be-127%7D+%5Ccdot+m&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='v = s &#92;cdot 2^{e-127} &#92;cdot m' title='v = s &#92;cdot 2^{e-127} &#92;cdot m' class='latex' />. If we want to calculate the logarithm, we can easily write:</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Clog%28v%29+%3D+%5Clog%28s%29+%2B+%28e%27-127%29%5Ccdot+%5Clog%282%29+%2B+%5Clog+%28m%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log(v) = &#92;log(s) + (e&#039;-127)&#92;cdot &#92;log(2) + &#92;log (m)' title='&#92;log(v) = &#92;log(s) + (e&#039;-127)&#92;cdot &#92;log(2) + &#92;log (m)' class='latex' /></p>
<p>No we see, why we chose base 2 for our calculations. If our logarithm base is 2, we can easily substitute <img src='http://s0.wp.com/latex.php?latex=%5Clog_2%282%29%3D1&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log_2(2)=1' title='&#92;log_2(2)=1' class='latex' />, that is, the exponent can be extracted quite easily. For the mantissa, we can either generate a lookup table or approximate the logarithm.</p>
<h3>Implementation</h3>
<p>The following section shows how the above thoughts could be transferred to an implementation.</p>
<p>I wrote a small assembler routine (in <a href="http://www.nasm.us/">NASM</a>):</p>
<pre class="brush: cpp;">
; file log2.asm
GLOBAL _log2ASS						; C-Signature:		void log2ASS(float a, float* b)

section .data						

log2: 	dd 0
		dd 0.169925
		dd 0.321928
		dd 0.459432
		dd 0.584963
		dd 0.70044
		dd 0.807355
		dd 0.906891

_log2ASS:
start_log:
	push ebp
	mov ebp, esp

	push eax				;
	push ebx				;
	push ecx				;

	; exponent extraction.
	mov eax, [ebp+8]		; read argument
	and eax, 0x7F800000		;
	sar eax, 23				;
	sub eax, 127			;
	mov ecx, [ebp+12]		;
	mov [ecx], eax			; save extracted exponent (in target)

	; mantissa extraction
	mov eax, [ebp+8]		;
	and eax, 0x007FFFFF		;
	sar eax, 20				;

	mov ebx, 4
	mul ebx
	add eax, dword log2		;

	finit					;
	fld dword [eax]			; read log(mantisse).
	fild dword [ecx]		; read extracted exponent
	faddp st1				; add them together

	mov eax, [ebp+12]
	fstp dword [eax]		; write result to target.

	pop ecx				;
	pop ebx				;
	pop eax				;
	pop ebp				;

	ret					;
</pre>
<p>Running Windows Vista we can compile this file (called <code>log2.asm</code>) via <code>nasm -f elf log2.asm</code>. This creates an object file called <code>log2.o</code>.</p>
<p>Now we can call the created routine from C the following way:</p>
<pre class="brush: cpp;">
// declare extern function
extern void log2ASS(float a, float* b);

int main(int argc, char *argv[]){
	float a = 16.5978e23;
	float result;
	log2ASS(a, &amp;result);
	printf (&quot;Calculated result: %e\n&quot;, result);
}
</pre>
<p>We see, that <code>log2ASS</code> expects 2 parameters. The first parameter is the number we want to logarithmize, the second argument is a pointer to a memory cell, where the routine writes back the result (in float format). To use this function, you must ensure that the linker knows where to find log2ASS. Therefore we specify that the linker includes the generated file <code>log2.o</code>.</p>
<h3>Technique</h3>
<p>The described routine works quite simple and is a pretty straightforward implementation of the mentioned equation</p>
<p><img src='http://s0.wp.com/latex.php?latex=%5Clog%28v%29+%3D+%5Clog%28s%29+%2B+%28e%27-127%29%5Ccdot+%5Clog%282%29+%2B+%5Clog+%28m%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log(v) = &#92;log(s) + (e&#039;-127)&#92;cdot &#92;log(2) + &#92;log (m).' title='&#92;log(v) = &#92;log(s) + (e&#039;-127)&#92;cdot &#92;log(2) + &#92;log (m).' class='latex' /></p>
<p>Let me demonstrate how the exponents extraction works:</p>
<p><img src="http://phimuemue.files.wordpress.com/2009/06/extractexponent.png?w=450&#038;h=321" alt="extractExponent" title="extractExponent" width="450" height="321" class="aligncenter size-full wp-image-278" /></p>
<p>After that we have to subtract the bias 127, and then we have the correct exponent.</p>
<p>We extract the mantissa in an analog manner. The above implementation calculates the logarithm of the mantissa using a lookup table. Therefore, it discards the 20 lowest bits (thus the implementation loses much accuracy) and calculates an approximation of the logaritm using the three highest bits of the mantissa.</p>
<p>Since we do consider three mantissa bits only, i can specify all the possible configurations:</p>
<pre class="brush: cpp;">
Bits	value	log(value)
000		1.0		0
001		1.125	0.169925
010		1.25	0.321928
011		1.375	0.459432
100		1.5		0.584963
101		1.625	0.70044
110		1.75	0.807355
111		1.875	0.906891
</pre>
<p>You can see that these are the values we save in our lookuptable <code>log2</code>. The mantissas logarithm can now been calculated via a simple lookup. We use the three highest bits of the mantissa as an offset.</p>
<p>After calculating these two numbers, we can simply add them. This is done in the floating point unit (FPU). After that, we write the sum to the given memory location.</p>
<h3>Improvements, Conclusion</h3>
<p>The described implementation uses only the three highest mantissa bits and yields just a rough approximation of the logarithm therefore. It works relatively fine for float values with big exponents, because the exponents are calculated exactly. If the exponents are big enough, the mantissa logarithm carries no weight. If we want to be more precise even for small exponents, we have to make the mantissa logarithm more accurate. So one first improvement could be to consider more mantissa bits in order to get a more precise logarithm. Of course each additional bit doubles the size of the lookup table. I chose to consider three bits only because i wanted to emphasize the principle.</p>
<p>Furthermore, this implementation doesnt deal very well with special cases (such as <code>NAN</code> or negative numbers). Therefore one would introduce some assertions to ensure that the method works correct.</p>
<p>Because this method does no error handling, no assertions and only approximates the results, it is quite fast. </p>
<p>If we wanted to cover all possibilities for the mantissa (and hence get maximum precision), we would have to store <img src='http://s0.wp.com/latex.php?latex=2%5E%7B23%7D+%5Ccdot+4&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='2^{23} &#92;cdot 4' title='2^{23} &#92;cdot 4' class='latex' /> byte, that is 16 gigabyte. I suppose that the FPU-intern routines uses the provided thought, but does interpolate cleverly over the lookup table.</p>
<p>As said in the beginning, we can easily compute the logarithm for other bases <img src='http://s0.wp.com/latex.php?latex=b&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='b' title='b' class='latex' /> by dividing the result of the above routine <img src='http://s0.wp.com/latex.php?latex=%5Clog_2%28x%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log_2(x)' title='&#92;log_2(x)' class='latex' />, so we get:<br />
<img src='http://s0.wp.com/latex.php?latex=%5Clog_b%28x%29+%3D+%5Cdfrac%7B%5Clog_2%28d%29%7D%7B%5Clog_2%28b%29%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;log_b(x) = &#92;dfrac{&#92;log_2(d)}{&#92;log_2(b)}' title='&#92;log_b(x) = &#92;dfrac{&#92;log_2(d)}{&#92;log_2(b)}' class='latex' /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=247&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/06/08/logarithm-of-float-numbers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>

		<media:content url="http://phimuemue.files.wordpress.com/2009/06/576px-ieee-754-single-svg1.png" medium="image">
			<media:title type="html">576px-IEEE-754-single.svg</media:title>
		</media:content>

		<media:content url="http://phimuemue.files.wordpress.com/2009/06/extractexponent.png" medium="image">
			<media:title type="html">extractExponent</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang</title>
		<link>http://phimuemue.wordpress.com/2009/06/02/erlang/</link>
		<comments>http://phimuemue.wordpress.com/2009/06/02/erlang/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 20:39:03 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Erlang]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=236</guid>
		<description><![CDATA[I found a very nice (for me) new programming language: Erlang. It is a concurrent, functional programming language. Almost everything can be seen as a process you can communicate with. For example you can create a function waiting for something to receive: -module(testmodule). -export([waitforinput/0]). waitforinput() -&#62; receive finished -&#62; io:format(&#34;waitforinput stopped.&#34;,[]); X -&#62; io:format(&#34;received ~p~n&#34;,[X]), [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=236&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found a very nice (for me) new programming language: <a href="http://erlang.org/">Erlang</a>. It is a concurrent, functional programming language.<br />
<span id="more-236"></span><br />
Almost everything can be seen as a process you can communicate with. For example you can create a function waiting for something to receive:</p>
<pre class="brush: css;">
-module(testmodule).
-export([waitforinput/0]).

waitforinput() -&gt;
receive
 finished -&gt; io:format(&quot;waitforinput stopped.&quot;,[]);
 X -&gt;
  io:format(&quot;received ~p~n&quot;,[X]),
  waitforinput()
end.
</pre>
<p>Correspondingly, we can write a function, that sends a message to the upper function (after we created the process with the <code>register</code>-function. Before doing so, we have to make the <code>waitforinput</code>-function accessible by registering it.</p>
<pre class="brush: css;">
register (receiver, spawn(testmodule, waitforinput, []).

senditem(X)-&gt;
 receiver ! X.
</pre>
<p>(Consider this elegant Syntax: <code>receiver ! X</code> means: Send <code>X</code> to <code>receiver</code>.)</p>
<p>After that, we can send things to the <code>waitforinput</code>-function with:</p>
<pre class="brush: css;">
testmodule:senditem(&quot;test&quot;).
testmodule:senditem({3,2,6}).
testmodule:senditem(finished).
</pre>
<p>This yields the output:<br />
<code><br />
received "test"<br />
received {3,2,6}<br />
waitforinput stopped.<br />
</code></p>
<p>I dont know where it leads me, but i like the concept very much because of its quite good readability and idea. As far as i know, it is quite easy to integrate it with, for example, Java. I don&#8217;t know all the features of Erlang up to know, but i think, i&#8217;ll do something from time to time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/236/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/236/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/236/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=236&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/06/02/erlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Milestones&#8221;</title>
		<link>http://phimuemue.wordpress.com/2009/05/25/milestones/</link>
		<comments>http://phimuemue.wordpress.com/2009/05/25/milestones/#comments</comments>
		<pubDate>Sun, 24 May 2009 22:11:46 +0000</pubDate>
		<dc:creator>phimuemue</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[milestones]]></category>
		<category><![CDATA[nice small projects]]></category>

		<guid isPermaLink="false">http://phimuemue.wordpress.com/?p=172</guid>
		<description><![CDATA[Every programmer has his own personal milestones. Here are some of mine, that were &#8211; especially when i began programming &#8211; my favourite projects. Maze generator My first &#8220;big&#8221; project i was fascinated by was a simple program, whose only purpose was to generate a simple maze. Here you can see an example maze, that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=172&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Every programmer has his own personal milestones. Here are some of mine, that were &#8211; especially when i began programming &#8211; my favourite projects.</p>
<p><span id="more-172"></span></p>
<h3> Maze generator </h3>
<p>My first &#8220;big&#8221; project i was fascinated by was a simple program, whose only purpose was to generate a simple maze.<br />
Here you can see an example maze, that i&#8217;ve created with a implementation in C#:</p>
<p><img src="http://phimuemue.files.wordpress.com/2009/05/labyrinth.gif?w=406&#038;h=53" alt="labyrinth" title="labyrinth" width="406" height="53" class="aligncenter size-full wp-image-173" /></p>
<p><strong>Motivation</strong> At the beginning this problem seemed unsolvable to me, because i had no idea how to tackle it. After some googling and reading i found the necessary know how to generate a maze.</p>
<p><strong>Outcome</strong> Finally i solved this task with graph theoretic considerations: I just had to generate a rectangular grid graph and looked for a minimum spanning tree in it. If you set the edge weights randomly you get a random maze. Alternatively, you could always pick a random edge that doesnt create a circle. Standard algorithms for minimum spanning trees are <a href="http://en.wikipedia.org/wiki/Kruskal%27s_algorithm">Kruskals</a> and <a href="http://en.wikipedia.org/wiki/Prim%27s_algorithm">Prims</a> algorithm. This was my first project to cope with graph theory.</p>
<h3>Sorting algorithms of all kinds</h3>
<p><strong>Motivation</strong> Another problem is sorting data &#8211; needed in almost every application in some way. In many programming languages i tried several sorting algorithms.</p>
<li> Bubblesort, Insertionsort or Selectionsort (runtime <img src='http://s0.wp.com/latex.php?latex=O%28n%5E2%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n^2)' title='O(n^2)' class='latex' />) </li>
<li> Quicksort (average case <img src='http://s0.wp.com/latex.php?latex=O%28n+%5Clog+n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n &#92;log n)' title='O(n &#92;log n)' class='latex' />)</li>
<li> Mergesort (worst case <img src='http://s0.wp.com/latex.php?latex=O%28n+%5Clog+n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n &#92;log n)' title='O(n &#92;log n)' class='latex' />) </li>
<p>A further goal, that i was following up was to generate a (comparison) sort algorithm, that has runtime <img src='http://s0.wp.com/latex.php?latex=o%28n+%5Clog+n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o(n &#92;log n)' title='o(n &#92;log n)' class='latex' /> &#8211; without success.</p>
<p><strong>Outcome</strong> Every programmer comes to a point where he has to cope with sorting algorithms. Now i know, that no comparison sort algorithm can acchieve my hoped for runtime of <img src='http://s0.wp.com/latex.php?latex=o%28n+%5Clog+n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o(n &#92;log n)' title='o(n &#92;log n)' class='latex' />. But with some restrictions and conditions concerning the input data, faster algorithms can be constructed (e.g. radix sort in <img src='http://s0.wp.com/latex.php?latex=O%28n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='O(n)' title='O(n)' class='latex' />).</p>
<h3> Parser / Plotter </h3>
<p><strong>Motivation</strong> Since i got a calculator that accepted terms like <code>(2*4-3)*(2+6*4)</code> and calculated the result, i wanted to develop an algorithm doing the same. Logically, it&#8217;s just a stone&#8217;s throw away to develop a plotter that prints whole function graphs.</p>
<p><strong>Outcome</strong> <a href="http://phimuemue.wordpress.com/2009/04/08/programm-zum-therme-auswerten/">My first post</a> shows a &#8220;remake&#8221; of this personal classic (in german). It has just basic functions, plotting is not implemented in the shown version. While first developing the algorithm for computing the results i was very fascinated by the principle of recursion, a very elegant method of solving many problems (but not always the most efficient one).</p>
<h3> A free-hand drawing tool </h3>
<p><strong>Motivation</strong> Drawing graphs (graph theoretic graphs, not function graphs) in LaTeX (with the <a href="http://sourceforge.net/projects/pgf/">TikZ-package</a>) is not a very comfortable thing. Because everything has to be described quite detailed simple graphs have long-winded code. With pencil and paper, a graph is drawn in half a minute. With TikZ, you need much more time.</p>
<p><img src="http://phimuemue.files.wordpress.com/2009/05/simplegraph1.gif?w=152&#038;h=98" alt="simplegraph" title="simplegraph" width="152" height="98" class="aligncenter size-full wp-image-184" /></p>
<p>The above simple graph requires round 15 lines of code in TikZ. That&#8217;s why i wrote a tiny program providing a &#8220;canvas&#8221;. You can draw as you would on paper. The software detects rectangles and converts them to graph nodes. If you connect two nodes, it creates an edge. After you have drawn the graph, it can easily been exported to TikZ</p>
<p><strong>Outcome</strong> This program saved me a lot of time yet. I have to draw quite many graphs and exporting them to LaTeX (finite automata, networks, etc.). Even if the program is not very sophisticated it is capable of some nice features that make it quite easy to generate (simple) graphs. Adaptions can be made in the TikZ-Code relatively fast.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phimuemue.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phimuemue.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phimuemue.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phimuemue.wordpress.com&amp;blog=7272036&amp;post=172&amp;subd=phimuemue&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phimuemue.wordpress.com/2009/05/25/milestones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/74b63650ed07d745fd9accf52e4d286b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">phimuemue</media:title>
		</media:content>

		<media:content url="http://phimuemue.files.wordpress.com/2009/05/labyrinth.gif" medium="image">
			<media:title type="html">labyrinth</media:title>
		</media:content>

		<media:content url="http://phimuemue.files.wordpress.com/2009/05/simplegraph1.gif" medium="image">
			<media:title type="html">simplegraph</media:title>
		</media:content>
	</item>
	</channel>
</rss>
