<?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>Next Door Hacker &#187; python</title>
	<atom:link href="http://www.nextdoorhacker.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nextdoorhacker.com</link>
	<description>I&#039;m just your friendly neighborhood hacker</description>
	<lastBuildDate>Mon, 05 Apr 2010 09:44:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jacobian Algorithm for Multidimensional Continued Fractions</title>
		<link>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/</link>
		<comments>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:35:58 +0000</pubDate>
		<dc:creator>Prasanna</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[continued fractions]]></category>
		<category><![CDATA[dynamic programming]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=30</guid>
		<description><![CDATA[Just a great example of Dynamic programming.
#!/usr/bin/env pythonfrom math import floorA = [ 1, 0, 0]B = [ 0, 1 ,0]C = [0 , 0 ,1]p = []q = []&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; u = [17]v = [44]w = [13]i = 0DEBUG = Truewhile (u[-1] != 0):&#160;&#160;&#160; p.append(int(floor(v[-1]/u[-1])))&#160;&#160;&#160; q.append(int(floor(w[-1]/u[-1])))&#160;&#160;&#160; A.append(q[-1]*A[-1] +p[-1]*A[-2] +A[-3])&#160;&#160;&#160; B.append(q[-1]*B[-1]+p[-1]*B[-2] + B[-3])&#160;&#160;&#160; C.append(q[-1]*C[-1]+p[-1]*C[-2] + C[-3])&#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Just a great example of Dynamic programming.</p>
<p>#!/usr/bin/env python<br />from math import floor<br />A = [ 1, 0, 0]<br />B = [ 0, 1 ,0]<br />C = [0 , 0 ,1]<br />p = []<br />q = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />u = [17]<br />v = [44]<br />w = [13]<br />i = 0<br />DEBUG = True<br />while (u[-1] != 0):<br />&nbsp;&nbsp;&nbsp; p.append(int(floor(v[-1]/u[-1])))<br />&nbsp;&nbsp;&nbsp; q.append(int(floor(w[-1]/u[-1])))<br />&nbsp;&nbsp;&nbsp; A.append(q[-1]*A[-1] +p[-1]*A[-2] +A[-3])<br />&nbsp;&nbsp;&nbsp; B.append(q[-1]*B[-1]+p[-1]*B[-2] + B[-3])<br />&nbsp;&nbsp;&nbsp; C.append(q[-1]*C[-1]+p[-1]*C[-2] + C[-3])<br />&nbsp;&nbsp;&nbsp; u.append(v[-1] &#8211; p[-1]*u[-1])<br />&nbsp;&nbsp;&nbsp; v.append(w[-1] &#8211; q[-1]*u[-2])<br />&nbsp;&nbsp;&nbsp; w.append(u[-2])<br />&nbsp;&nbsp;&nbsp; i+=1<br />&nbsp;&nbsp;&nbsp; if DEBUG:<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print i, u[-1], v[-1], w[-1], p[-1], q[-1], A[-1], B[-1], C[-1]</p>
<p>if DEBUG: <br />&nbsp;&nbsp;&nbsp; print p, q<br />for k in range(i-1):<br />&nbsp;&nbsp;&nbsp; print (p[k],q[k]),</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2008/11/jacobian-algorithm-for-multidimensional-continued-fractions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello World</title>
		<link>http://www.nextdoorhacker.com/2008/10/hello-world/</link>
		<comments>http://www.nextdoorhacker.com/2008/10/hello-world/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 06:15:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[asm]]></category>
		<category><![CDATA[helloworld]]></category>
		<category><![CDATA[intro]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.nextdoorhacker.com/?p=6</guid>
		<description><![CDATA[As a typical programmer perhaps, I have a habit of embarking in any new mission with a nice and sweet &#8220;hello world.&#8221; I intend to keep this site as a collection of my thoughts, ideas and as a notepad of my various curiosities and I keep collecting and refining them over time. As per the [...]]]></description>
			<content:encoded><![CDATA[<p>As a typical programmer perhaps, I have a habit of embarking in any new mission with a nice and sweet &#8220;hello world.&#8221; I intend to keep this site as a collection of my thoughts, ideas and as a notepad of my various curiosities and I keep collecting and refining them over time. As per the name, I believe it was a lucky coincidence that I decided to keep this site as a blog, you know, the name is just too good to give up on. My vanity didn&#8217;t permit me to just keep this domain parked once I got it <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Apart from this. here&#8217;s the typical hello world. Since I&#8217;m doing Java at the moment, in Java it is:</p>
<blockquote><p>public class HelloWorld{</p>
<p>public static void main(String[] argv){</p>
<p>System.out.println(&#8221;Hello World&#8221;);</p>
<p>}</p></blockquote>
<p>}</p>
<p>Looks ugly.. Here&#8217;s a python version</p>
<blockquote><p>print &#8220;Hello World&#8221;</p></blockquote>
<p>To top it off, here&#8217;s what I&#8217;d do in assembly. Of course it&#8217;ll only run on a *nix box (syscalls) but whatever..</p>
<blockquote><p>.text<br />
.global _start</p>
<p>_start:<br />
movl $len, %edx<br />
movl $msg, %ecx<br />
movl $1,%ebx<br />
movl $4,%eax<br />
int $0&#215;80</p>
<p>movl $0,%ebx<br />
movl $1,%eax<br />
int $0&#215;80</p>
<p>.data</p>
<p>msg:<br />
.ascii &#8220;Hello World\n&#8221;<br />
len = . &#8211; msg</p></blockquote>
<p>This is probably enough of hello world for now. I can add some more but it&#8217;s just going to be redundant&#8230; <img src='http://www.nextdoorhacker.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nextdoorhacker.com/2008/10/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
