<?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"
	>

<channel>
	<title>Twonilblankblank &#187; python</title>
	<atom:link href="http://www.twonilblankblank.com/tag/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.twonilblankblank.com</link>
	<description>Every RPG I have ever played is a lie</description>
	<pubDate>Tue, 18 Nov 2008 01:09:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Fibonacci fuck-up killed my Vista* says man</title>
		<link>http://www.twonilblankblank.com/2008/05/01/fibonacci-fuck-up-killed-my-vista-says-man/</link>
		<comments>http://www.twonilblankblank.com/2008/05/01/fibonacci-fuck-up-killed-my-vista-says-man/#comments</comments>
		<pubDate>Thu, 01 May 2008 21:13:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[computers]]></category>

		<category><![CDATA[I am not a nerd]]></category>

		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.twonilblankblank.com/?p=302</guid>
		<description><![CDATA[I was bored last night so I was tinkering with Python.  I&#8217;m not a programmer. I tinker.  First thing I do  with a programming language is write Fibonacci sequence functions (it&#8217;s a good way of getting a sense of things):
def fib4(current=1,last=0,inclusive='y',count=10):
    if inclusive==('y' or 'Y'):
       [...]]]></description>
			<content:encoded><![CDATA[<p>I was bored last night so I was tinkering with Python.  I&#8217;m not a programmer. I tinker.  First thing I do  with a programming language is write Fibonacci sequence functions (it&#8217;s a good way of getting a sense of things):</p>
<pre>def fib4(current=1,last=0,inclusive='y',count=10):
    if inclusive==('y' or 'Y'):
        ser=[last,current]
    else:
        ser=[]
    while count&gt;0:
        ser.append(current+last)
        current=last+current
        last=current-last
        count=count-1
    return(ser)

print fib4(1,0,'y',100)
</pre>
<p>That was the fourth one, and it&#8217;s probably really inefficient, because I&#8217;m an amateur. I made a variety.</p>
<p>Initially I forgot the count decrement (count=count-1) which meant the while loop never exited.  Which meant the (ser) array was having hundreds of Fibonacci numbers appended per second.  It was eating all of my system memory.  I didn&#8217;t know that because I&#8217;d left to go to the toilet. I&#8217;m sure uncontrolled allocation of memory like that would slow any operating system.   Memory is finite.</p>
<p>But after 2 minutes of the fibonnaci function running it took me 10 minutes to close Python down.  Another five minutes for Vista (not SP1)  to become usable again.   I cannot remember Linux, Windows XP, or OS-X being that susceptable to an idiot&#8217;s program and have that glacial degree of slow down. It was like a <a href="http://en.wikipedia.org/wiki/Fork_bomb" target="_blank">fork bomb</a>.</p>
<p>With Linux I usually alt-F1&#8242;d to an empty terminal, logged in, did a &#8216;ps aux | grep programname&#8217; then &#8216;kill -9 process_id&#8217;.  And Windows XP seemed to be more responsive to the &#8216;ctrl-alt-delete&#8217; system call.  With OS-X I usually have a terminal open and kill the process from there.</p>
<p>* Briefly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twonilblankblank.com/2008/05/01/fibonacci-fuck-up-killed-my-vista-says-man/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.734 seconds -->
