<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Tower Of Power</title>
	
	<link>http://www.toosweettobesour.com</link>
	<description>Far Too Sweet To Be Sour</description>
	<pubDate>Mon, 10 Nov 2008 23:36:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<geo:lat>30.571905</geo:lat><geo:long>-96.298825</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/toosweettobesour/HrtK" type="application/rss+xml" /><item>
		<title>MiniBarBCS in Bryan, Texas THIS FRIDAY (November 14th, 2008)!</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/448932542/</link>
		<comments>http://www.toosweettobesour.com/2008/11/10/minibarbcs-in-bryan-texas-this-friday/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 23:35:57 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[BarCamp]]></category>

		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=221</guid>
		<description><![CDATA[This is a post to make sure anyone interested in development, design, or new media entrepreneurship shows up to MiniBarBCS this Friday starting at 5pm. The event is being held on the 5th floor of the Varisco Building in Bryan, Texas (219 N. Main St., Bryan, TX 77803).
So far the proposed topics cover everything from [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post to make sure anyone interested in development, design, or new media entrepreneurship shows up to <a href="http://barcamp.org/MiniBarBCS">MiniBarBCS</a> this Friday starting at 5pm. The event is being held on the 5th floor of the Varisco Building in Bryan, Texas (<a href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=219+N+Main+St,+Bryan,+TX+77803&sll=37.0625,-95.677068&sspn=57.118084,114.257812&ie=UTF8&z=17&g=219+N+Main+St,+Bryan,+TX+77803&iwloc=addr">219 N. Main St., Bryan, TX 77803</a>).</p>
<p>So far the proposed topics cover everything from iPhone development to "Design for Developers" to .NET to PHP, Ruby, Coworking, and anything else under the sun.</p>
<p>So if you're around the area this Friday, show up and join in the fun! Just make sure to RSVP in the wiki linked above (the password/invite key is "c4mp") or the <a href="http://www.facebook.com/event.php?eid=33872923951">Facebook event</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/11/10/minibarbcs-in-bryan-texas-this-friday/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F11%2F10%2Fminibarbcs-in-bryan-texas-this-friday%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/11/10/minibarbcs-in-bryan-texas-this-friday/</feedburner:origLink></item>
		<item>
		<title>Ubuntu Linux slow/bad internet connection problems</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/431029035/</link>
		<comments>http://www.toosweettobesour.com/2008/10/24/ubuntu-linux-slowbad-internet-connection-problems/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 19:27:25 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=215</guid>
		<description><![CDATA[At my office I had been having a problem with my Ubuntu and Fedora boxen having problem connecting to external sites. Some would work, albeit slow, where as others would not work at all (e.g. trying to connect to reddit in Firefox would get enough of the page to display the &#60;title&#62;&#60;/title&#038;gt tags but it [...]]]></description>
			<content:encoded><![CDATA[<p>At my office I had been having a problem with my Ubuntu and Fedora boxen having problem connecting to external sites. Some would work, albeit slow, where as others would not work at all (e.g. trying to connect to reddit in Firefox would get enough of the page to display the <code>&lt;title&gt;&lt;/title&gt</code> tags but it would be "forever loading" the actual content, with only a white screen).</p>
<p>The solution seemed to be that the router hated TCP Window Scaling. The fix that so far seems to work is to edit your /etc/sysctl.conf file and adding the line:</p>
<blockquote><p><code>net.ipv4.tcp_window_scaling=0</code></p></blockquote>
<p>And then running the command:</p>
<blockquote><p><code>sudo sysctl -p</code></p></blockquote>
<p>To reload the changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/10/24/ubuntu-linux-slowbad-internet-connection-problems/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F10%2F24%2Fubuntu-linux-slowbad-internet-connection-problems%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/10/24/ubuntu-linux-slowbad-internet-connection-problems/</feedburner:origLink></item>
		<item>
		<title>Serialize Python Variables To PHP</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/428353565/</link>
		<comments>http://www.toosweettobesour.com/2008/10/22/serialize-python-variables-to-php/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 08:34:47 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=202</guid>
		<description><![CDATA[So I'm in the planning stages of a project where I'll probably be doing some heavy lifting in Python and serving up the output through PHP. Obviously this will entail transmitting data between Python and PHP and while I haven't had a chance to do performance testing to see if it's worth it to save [...]]]></description>
			<content:encoded><![CDATA[<p>So I'm in the planning stages of a project where I'll probably be doing some heavy lifting in Python and serving up the output through PHP. Obviously this will entail transmitting data between Python and PHP and while I haven't had a chance to do performance testing to see if it's worth it to save to a database, the only other option was to serialize the data to a file that PHP could parse quickly. Obviously, the output from <code>serialize()</code> is going to be the fastest way to recieved the data.</p>
<p>While there already <a href="http://hurring.com/scott/code/python/serialize/">exists</a> a Python set of classes that serializes (and serializes) Python data, it (a) didn't handle objects and (b) was licensed under the GPL (rant to follow later), meaning I couldn't use it for it's intended purpose due to the closed source nature of my project.</p>
<p>I decided this was a good enough time to play around with git so I created a github repo <a href="http://github.com/dcousineau/phpserialize/tree/master">here</a>.</p>
<p>It could probably still use some more TLC in the object area, maybe a few more supported types, and unserialization functions would be nice.</p>
<p>I do feel it wasn't bad for a few hours of hacking if I do say so myself.</p>
<p>The code for the module (should be in a phpserialize.py file) is as follows:</p>
<p><span id="more-202"></span></p>
<h3>Python Code</h3>
<pre class="python"><span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
Collection of functions to serialize Python variables to the native PHP format
&nbsp;
@version 0.1
@author Daniel Cousineau &lt;dcousineau@gmail.com&gt;
@copyright Copyright (c) 2008 Daniel Cousineau
@license http://www.opensource.org/licenses/mit-license.php MIT License
&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">types</span> <span style="color: #ff7700;font-weight:bold;">import</span> *
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Serialize var to the native PHP serialization format
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> IntType <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> LongType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_int<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> FloatType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_decimal<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> BooleanType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_boolean<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> StringType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_string<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> NoneType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_null<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> ListType <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> TupleType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_array<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> DictType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_dictionary<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> InstanceType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_object<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		<span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">TypeError</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Invalid Type %s&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_string<span style="color: black;">&#40;</span><span style="color: #dc143c;">string</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: s:L:&quot;</span>STRING<span style="color: #483d8b;">&quot;;
		L: Length of the string
		STRING: The string itself. No need to escape quotes (&quot;</span><span style="color: black;">&#41;</span>
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	return &quot;</span>s:%d:\<span style="color: #483d8b;">&quot;%s<span style="color: #000099; font-weight: bold;">\&quot;</span>;&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">string</span><span style="color: black;">&#41;</span>, <span style="color: #dc143c;">string</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_int<span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: i:D;
		D: the integer
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;i:%d;&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_decimal<span style="color: black;">&#40;</span><span style="color: #dc143c;">decimal</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: d:D;
		D: the decimal (accepts expontent notation)
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;d:%s;&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #dc143c;">decimal</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_boolean<span style="color: black;">&#40;</span>boolean<span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: b:B;
		B: 1 for True, 0 for False
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;b:%d;&quot;</span> % <span style="color: black;">&#40;</span>boolean<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_null<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: N;
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;N;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_array<span style="color: black;">&#40;</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: a:K:{VALUES}
		K: Number of entries (number of keys for dictionaries)
		VALUES: serialized key appended to serialized value. Do not worry about ;
		        if a value is an array
&nbsp;
	DOES NOT END WITH A ;
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	values = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> index, value <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">enumerate</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span>:
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize_array_key<span style="color: black;">&#40;</span>index<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize<span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;a:%d:{%s}&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">&quot;&quot;</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>values<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_array_key<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Decimals and Boolans are automatically converted to integers for key values.
	Arrays and Objects throw errors if they are set as a key
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> IntType <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> FloatType <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> BooleanType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_int<span style="color: black;">&#40;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> NoneType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_int<span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">elif</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">is</span> StringType:
		<span style="color: #ff7700;font-weight:bold;">return</span> serialize_string<span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">else</span>:
		<span style="color: #ff7700;font-weight:bold;">raise</span> <span style="color: #008000;">TypeError</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Invalid Key Type %s&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">type</span><span style="color: black;">&#40;</span>var<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_dictionary<span style="color: black;">&#40;</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	See serialize_array()
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	values = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> index, value <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">array</span>.<span style="color: black;">iteritems</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize_array_key<span style="color: black;">&#40;</span>index<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize<span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;a:%d:{%s}&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">array</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">&quot;&quot;</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>values<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> serialize_object<span style="color: black;">&#40;</span>obj<span style="color: black;">&#41;</span>:
	<span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
	Format: O:L:&quot;</span>CLASS<span style="color: #483d8b;">&quot;:K:{MEMBERS}
		L: Length of class name
		CLASS: class name (string)
		K: Number of class members (ignore 'static' members)
		MEMBERS: Members as an associative array (dictionary) (ignore 'static' members)
	&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
	objClass = obj.__class__.__name__
&nbsp;
	values = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
	<span style="color: #ff7700;font-weight:bold;">for</span> index, value <span style="color: #ff7700;font-weight:bold;">in</span> obj.<span style="color: #0000cd;">__dict__</span>.<span style="color: black;">iteritems</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize_array_key<span style="color: black;">&#40;</span>index<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
		values.<span style="color: black;">append</span><span style="color: black;">&#40;</span>serialize<span style="color: black;">&#40;</span>value<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #483d8b;">&quot;O:%d:<span style="color: #000099; font-weight: bold;">\&quot;</span>%s<span style="color: #000099; font-weight: bold;">\&quot;</span>:%d:{%s}&quot;</span> % <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span>objClass<span style="color: black;">&#41;</span>, objClass, <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>obj.<span style="color: #0000cd;">__dict__</span><span style="color: black;">&#41;</span>, <span style="color: #483d8b;">&quot;&quot;</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>values<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;</pre>
<p>I also wrote up some tests in PHP:</p>
<h3>PHP Test Code</h3>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;BEGINNING TESTS:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;----------------<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//STRING</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #ff0000;">&quot;String&quot;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;String&quot;</span><span style="color: #66cc66;">&#41;</span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;STRINGS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//INTEGER</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #cc66cc;">52</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">52</span><span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;INTEGERS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//DECIMAL</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #cc66cc;">9.8</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9.8</span><span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;DECIMALS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #cc66cc;">1.52</span>*<a href="http://www.php.net/pow"><span style="color: #000066;">pow</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">-5</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1.52</span>*<a href="http://www.php.net/pow"><span style="color: #000066;">pow</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">-5</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;DECIMALS (exponential format)&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//BOOLEAN</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">True</span><span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;BOOLEANS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//NULL</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #000000; font-weight: bold;">null</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span>None<span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;NULLS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//ARRAY</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9</span>, <span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">7</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">9</span>, <span style="color: #cc66cc;">8</span>, <span style="color: #cc66cc;">7</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;SIMPLE ARRAYS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$test</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;key&quot;</span> =&gt; <span style="color: #ff0000;">&quot;value&quot;</span>, <span style="color: #cc66cc;">5</span> =&gt; <span style="color: #ff0000;">&quot;another value&quot;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;key&quot;</span>:<span style="color: #ff0000;">&quot;value&quot;</span>,<span style="color: #cc66cc;">5</span>:<span style="color: #ff0000;">&quot;another value&quot;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;ASSOCIATIVE ARRAYS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$test</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;key&quot;</span> =&gt; <span style="color: #ff0000;">&quot;value&quot;</span>, <span style="color: #cc66cc;">5</span> =&gt; <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;values&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
import phpserialize
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#123;</span><span style="color: #ff0000;">&quot;key&quot;</span>:<span style="color: #ff0000;">&quot;value&quot;</span>,<span style="color: #cc66cc;">5</span>:<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;values&quot;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;COMPLEX ARRAYS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">//OBJECTS</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Test
<span style="color: #66cc66;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$i</span> = <span style="color: #ff0000;">&quot;PUBLIC&quot;</span>;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #0000ff;">$j</span> = <span style="color: #ff0000;">&quot;B0RKED&quot;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$test</span> = <span style="color: #000000; font-weight: bold;">new</span> Test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$python</span> = &lt;&lt;&lt;HEREDOC
<span style="color: #ff0000">import phpserialize
</span>
<span style="color: #000000; font-weight: bold;">class</span> Test:
	def __init__<span style="color: #66cc66;">&#40;</span>self<span style="color: #66cc66;">&#41;</span>:
		self.i = <span style="color: #ff0000;">&quot;PUBLIC&quot;</span>
		self.j = <span style="color: #ff0000;">&quot;B0RKED&quot;</span>
&nbsp;
<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> phpserialize.<a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span>Test<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
HEREDOC;
&nbsp;
print_results<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;OBJECTS&quot;</span>, <span style="color: #0000ff;">$test</span>, <span style="color: #0000ff;">$python</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> print_results<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$test_name</span>, <span style="color: #0000ff;">$var</span>, <span style="color: #0000ff;">$python_code</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/sprintf"><span style="color: #000066;">sprintf</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;TESTING %s:<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$test_name</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/sprintf"><span style="color: #000066;">sprintf</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Expecting:  %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <a href="http://www.php.net/serialize"><span style="color: #000066;">serialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$var</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/sprintf"><span style="color: #000066;">sprintf</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;            %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <a href="http://www.php.net/implode"><span style="color: #000066;">implode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>            &quot;</span>, <a href="http://www.php.net/explode"><span style="color: #000066;">explode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <a href="http://www.php.net/print_r"><span style="color: #000066;">print_r</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$var</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
	<span style="color: #0000ff;">$recieved</span> = <a href="http://www.php.net/exec"><span style="color: #000066;">exec</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;python -c &quot;</span> . <a href="http://www.php.net/escapeshellarg"><span style="color: #000066;">escapeshellarg</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$python_code</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/sprintf"><span style="color: #000066;">sprintf</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;Recieved:   %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$recieved</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <a href="http://www.php.net/sprintf"><span style="color: #000066;">sprintf</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;            %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <a href="http://www.php.net/implode"><span style="color: #000066;">implode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>            &quot;</span>, <a href="http://www.php.net/explode"><span style="color: #000066;">explode</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <a href="http://www.php.net/print_r"><span style="color: #000066;">print_r</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/unserialize"><span style="color: #000066;">unserialize</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$recieved</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>---<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p>Which gives us the following output:</p>
<h3>PHP Test Results</h3>
<pre>
BEGINNING TESTS:
----------------

TESTING STRINGS:

Expecting:  s:6:"String";
            String

Recieved:   s:6:"String";
            String

---

TESTING INTEGERS:

Expecting:  i:52;
            52

Recieved:   i:52;
            52

---

TESTING DECIMALS:

Expecting:  d:9.800000000000000710542735760100185871124267578125;
            9.8

Recieved:   d:9.8;
            9.8

---

TESTING DECIMALS (exponential format):

Expecting:  d:1.5200000000000001853270141516372149226299370639026165008544921875E-5;
            1.52E-5

Recieved:   d:1.52e-05;
            1.52E-5

---

TESTING BOOLEANS:

Expecting:  b:1;
            1

Recieved:   b:1;
            1

---

TESTING NULLS:

Expecting:  N;

Recieved:   N;

---

TESTING SIMPLE ARRAYS:

Expecting:  a:3:{i:0;i:9;i:1;i:8;i:2;i:7;}
            Array
            (
                [0] => 9
                [1] => 8
                [2] => 7
            )

Recieved:   a:3:{i:0;i:9;i:1;i:8;i:2;i:7;}
            Array
            (
                [0] => 9
                [1] => 8
                [2] => 7
            )

---

TESTING ASSOCIATIVE ARRAYS:

Expecting:  a:2:{s:3:"key";s:5:"value";i:5;s:13:"another value";}
            Array
            (
                [key] => value
                [5] => another value
            )

Recieved:   a:2:{i:5;s:13:"another value";s:3:"key";s:5:"value";}
            Array
            (
                [5] => another value
                [key] => value
            )

---

TESTING COMPLEX ARRAYS:

Expecting:  a:2:{s:3:"key";s:5:"value";i:5;a:1:{i:0;s:6:"values";}}
            Array
            (
                [key] => value
                [5] => Array
                    (
                        [0] => values
                    )

            )

Recieved:   a:2:{i:5;a:1:{i:0;s:6:"values";}s:3:"key";s:5:"value";}
            Array
            (
                [5] => Array
                    (
                        [0] => values
                    )

                [key] => value
            )

---

TESTING OBJECTS:

Expecting:  O:4:"Test":2:{s:1:"i";s:6:"PUBLIC";s:1:"j";s:6:"B0RKED";}
            Test Object
            (
                [i] => PUBLIC
                [j] => B0RKED
            )

Recieved:   O:4:"Test":2:{s:1:"i";s:6:"PUBLIC";s:1:"j";s:6:"B0RKED";}
            Test Object
            (
                [i] => PUBLIC
                [j] => B0RKED
            )

---
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/10/22/serialize-python-variables-to-php/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F10%2F22%2Fserialize-python-variables-to-php%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/10/22/serialize-python-variables-to-php/</feedburner:origLink></item>
		<item>
		<title>PHP Bacon!</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/422027978/</link>
		<comments>http://www.toosweettobesour.com/2008/10/15/php-bacon/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 22:32:28 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Humor]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=199</guid>
		<description><![CDATA[Unfortunately, Elizabeth Smith mentioned on twitter that PHP 5.3's new garbage collector is based on a paper written by a man named Bacon (pdf here). We now have Bacon's garbage collector...
Announcing PHP 5.3: Now With More Bacon!!
Spread the meme.
]]></description>
			<content:encoded><![CDATA[<p>Unfortunately, <a href="http://elizabethmariesmith.com/">Elizabeth Smith</a> mentioned on <a href="http://twitter.com/auroraeosrose/statuses/961281159">twitter</a> that PHP 5.3's new garbage collector is based on a paper written by a man named Bacon (<a href="http://www.research.ibm.com/people/d/dfb/papers/Bacon03Pure.pdf">pdf here</a>). We now have Bacon's garbage collector...</p>
<h1>Announcing PHP 5.3: Now With More Bacon!!</h1>
<p>Spread the meme.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/10/15/php-bacon/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F10%2F15%2Fphp-bacon%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/10/15/php-bacon/</feedburner:origLink></item>
		<item>
		<title>Outputting CSV as a Downloadable File in PHP</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/416952684/</link>
		<comments>http://www.toosweettobesour.com/2008/10/10/outputting-csv-as-a-downloadable-file-in-php/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 16:42:13 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=193</guid>
		<description><![CDATA[Nearly every application you could write in for the business sphere in PHP probably requires some sort of data export, most likely in the CSV format.
The easiest way to provide a downloadable file is by altering the headers and echo'ing the file content. In our case:
&#60;?php
header&#40;&#34;Content-type: text/csv&#34;&#41;;
header&#40;&#34;Cache-Control: no-store, no-cache&#34;&#41;;
header&#40;'Content-Disposition: attachment; filename=&#34;filename.csv&#34;'&#41;;
We want to set our [...]]]></description>
			<content:encoded><![CDATA[<p>Nearly every application you could write in for the business sphere in PHP probably requires some sort of data export, most likely in the CSV format.</p>
<p>The easiest way to provide a downloadable file is by altering the headers and echo'ing the file content. In our case:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Content-type: text/csv&quot;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Cache-Control: no-store, no-cache&quot;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Content-Disposition: attachment; filename=&quot;filename.csv&quot;'</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>We want to set our applicable Content-Type so that the browsers associate the file properly. Just relying on the extension doesn't work, even in Windows. The magic is in the third header setting, "Content-Disposition," which informs the browser to download as a separate file (don't open a new window and display a blank page, just display the file download box) and tell the browser the filename is "filename.csv". This way rewrite rules like http://localhost/export/csv/ will result in a download box that declares the file "filename.csv" rather than a randomly assigned name or whatever the current url is.</p>
<p>Into the meat of the CSV export. At the very beginning we need to open up a stream to the PHP output (the same place where echo sends its string content, which is NOT stdout):</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff;">$outstream</span> = <a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;php://output&quot;</span>,<span style="color: #ff0000;">'w'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Next we're going to assume you already have your data packed nicely into an array (or array of arrays) so long as we have a single array per row/line.</p>
<p>The magic comes into play using the build in PHP function <a href="http://php.net/fgetcsv"><code>fgetcsv()</code></a>. <code>fgetcsv()</code> takes an array for a single row and outputs it, automatically escaping output according to column and enclosure delimiters!</p>
<p><code>fgetcsv()</code> requires a file resource as its first parameter and the magic of PHP streams is they act like a file resource (actually a file resource is just a file stream), so we give it <code>$outstream</code> to make <code>fputcsv()</code> echo its output. We fill in the rest of the parameters according to the php.net documentation and voila we have:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Content-type: text/csv&quot;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Cache-Control: no-store, no-cache&quot;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/header"><span style="color: #000066;">header</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Content-Disposition: attachment; filename=&quot;filename.csv&quot;'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$outstream</span> = <a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;php://output&quot;</span>,<span style="color: #ff0000;">'w'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">$test_data</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span>
	<a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'Cell 1,A'</span>, <span style="color: #ff0000;">'Cell 1,B'</span> <span style="color: #66cc66;">&#41;</span>,
	<a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'Cell 2,A'</span>, <span style="color: #ff0000;">'Cell 2,B'</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0000ff;">$test_data</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$row</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	fputcsv<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$outstream</span>, <span style="color: #0000ff;">$row</span>, <span style="color: #ff0000;">','</span>, <span style="color: #ff0000;">'&quot;'</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<a href="http://www.php.net/fclose"><span style="color: #000066;">fclose</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$outstream</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>For more output stream craziness, zaemis from the #phpc IRC channel on freenode shared a code snipped that outputs CSV either to the output buffer OR will return it as a string using some clever streams hackery:</p>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> exportCSV<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$data</span>, <span style="color: #0000ff;">$col_headers</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #0000ff;">$return_string</span> = <span style="color: #000000; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
    <span style="color: #0000ff;">$stream</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$return_string</span><span style="color: #66cc66;">&#41;</span> ? <a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'php://temp/maxmemory'</span>, <span style="color: #ff0000;">'w+'</span><span style="color: #66cc66;">&#41;</span> : <a href="http://www.php.net/fopen"><span style="color: #000066;">fopen</span></a> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'php://output'</span>, <span style="color: #ff0000;">'w'</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<a href="http://www.php.net/empty"><span style="color: #000066;">empty</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$col_headers</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        fputcsv<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span>, <span style="color: #0000ff;">$col_headers</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">foreach</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$data</span> <span style="color: #b1b100;">as</span> <span style="color: #0000ff;">$record</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        fputcsv<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span>, <span style="color: #0000ff;">$record</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$return_string</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
        <a href="http://www.php.net/rewind"><span style="color: #000066;">rewind</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #0000ff;">$retVal</span> = stream_get_contents<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span><span style="color: #66cc66;">&#41;</span>;
        <a href="http://www.php.net/fclose"><span style="color: #000066;">fclose</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span><span style="color: #66cc66;">&#41;</span>;
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$retVal</span>;
    <span style="color: #66cc66;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #66cc66;">&#123;</span>
        <a href="http://www.php.net/fclose"><span style="color: #000066;">fclose</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$stream</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/10/10/outputting-csv-as-a-downloadable-file-in-php/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F10%2F10%2Foutputting-csv-as-a-downloadable-file-in-php%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/10/10/outputting-csv-as-a-downloadable-file-in-php/</feedburner:origLink></item>
		<item>
		<title>ZendCon08 Wrapup</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/400221570/</link>
		<comments>http://www.toosweettobesour.com/2008/09/22/zendcon08-wrapup/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 22:49:42 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[ZendCon 08]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=187</guid>
		<description><![CDATA[So I kinda had a thing going about blogging during ZendCon but lost it, so I might as well just do a single day wrap up.
So ZendCon turned out to be completely worth it, even if only for the chance to meet in person a lot of the core PHP community and then drink semi-copiously [...]]]></description>
			<content:encoded><![CDATA[<p>So I kinda had a thing going about blogging during ZendCon but lost it, so I might as well just do a single day wrap up.</p>
<p>So ZendCon turned out to be completely worth it, even if only for the chance to meet in person a lot of the core PHP community and then drink semi-copiously with them.</p>
<p>The talks were good, though most of them were either more basic than I would have liked or really indepth (/me thinks back to Sara's PHP Extension Writing talk, though that was more "few php developers gets this deep" than indepth/complicated).</p>
<p>The uncon was nice, which of course I'd like it given my love for barcamps, refreshes, and generally community driven and adhoc events.</p>
<p>The Yahoo party started out awkward given that one expects an open bar after paying $500+ for tickets to a conference, however from what I gathered it really wasn't so much Yahoo's fault more the hotel's. I won the raffle for the "Day with Rasmus" prize and felt bad 'cause when one of the Yahoo girls came to me and to have me verify my information, I told them my email (which was a gmail account) was correct but if they still have trouble to just google my first and last name since I dominate the first page for my name.</p>
<p>My only problem with ZendCon is that it ended...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/09/22/zendcon08-wrapup/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F09%2F22%2Fzendcon08-wrapup%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/09/22/zendcon08-wrapup/</feedburner:origLink></item>
		<item>
		<title>refreshBCS October 1st</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/400209122/</link>
		<comments>http://www.toosweettobesour.com/2008/09/22/refreshbcs-october-1st/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 22:37:28 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[refreshBCS]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=183</guid>
		<description><![CDATA[Since it isn't up on refreshbcs.org yet I'll repost the announcement from the listserv:

Where: Murphy's Law (upstairs) [Google Map]
When: October 1st 7PM (Happy Hour starting at 5)
Speaker: Michelle Greer
We've been quiet for a while but it's time to get this show back on the road. We've got several months worth of great speakers lined up [...]]]></description>
			<content:encoded><![CDATA[<p>Since it isn't up on <a href="http://refreshbcs.org/">refreshbcs.org</a> yet I'll repost the announcement from the listserv:</p>
<blockquote><p>
<strong>Where:</strong> Murphy's Law (upstairs) <a href="http://maps.google.com/maps?f=q&hl=en&geocode=&q=murphy%27s+law&sll=30.617038,-96.34679&sspn=0.307278,0.617981&ie=UTF8&ll=30.673648,-96.37295&spn=0.004798,0.009656&t=h&z=17">[Google Map]</a><br />
<strong>When:</strong> October 1st 7PM (Happy Hour starting at 5)<br />
<strong>Speaker:</strong> <a href="http://www.michellesblog.net/">Michelle Greer</a></p>
<p>We've been quiet for a while but it's time to get this show back on the road. We've got several months worth of great speakers lined up and we're starting this thing off with a bang. Michelle Greer has been kicking ass and taking names in the Austin area for quite some time and she has no plans to stop anytime soon. Come listen to her speak about how she uses social media to institute real-life change in the world around us.</p>
<p><strong>Making Social Media Matter:<br />
How Social Media Turns Everyday Citizens into Superheroes</strong></p>
<p>In an age where anyone can publish anything for the cost of hosting a WordPress blog, the means for spreading ideas has never been easier or cheaper.  Learn how people have used social media to mobilize people at rates never seen before in history, and how these tools make it easy for you to bring about positive change for your community.</p>
<p>-> Michelle Greer<br />
-> Web Marketing Strategist<br />
-> <a href="http://www.michellesblog.net/">http://www.michellesblog.net</a><br />
-> 512.294.3909
</p></blockquote>
<p>If any of you happen to be around college station on the 1st of October, or can make it, I highly suggest you show up to the refresh meetings. Even if the particular topic isn't your cup of tea (if you are a developer and it's a design topic, etc.) it's a great place to connect with people (obviously from the BCS area) and get educated on the happenings on the other side of the fence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/09/22/refreshbcs-october-1st/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F09%2F22%2Frefreshbcs-october-1st%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/09/22/refreshbcs-october-1st/</feedburner:origLink></item>
		<item>
		<title>Ruby on FAILS</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/396488093/</link>
		<comments>http://www.toosweettobesour.com/2008/09/18/ruby-on-fails/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 19:19:40 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[Humor]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[ZendCon 08]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=178</guid>
		<description><![CDATA[
Spoon is both a gentleman AND a scholar.
(And caseysoftware is awesome for the pic)
]]></description>
			<content:encoded><![CDATA[<p><img alt="Ruby on FAILS sticker" src="http://farm4.static.flickr.com/3184/2861098256_5124e48f76.jpg?v=0" title="Ruby on FAILS sticker" class="alignnone" width="500" height="375" /></p>
<p><a href="http://www.nexdot.net/blog/2008/09/15/ruby-on-fails-story-and-stickers/">Spoon</a> is both a gentleman AND a scholar.</p>
<p>(And <a href="http://caseysoftware.com/">caseysoftware</a> is awesome for the pic)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/09/18/ruby-on-fails/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F09%2F18%2Fruby-on-fails%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/09/18/ruby-on-fails/</feedburner:origLink></item>
		<item>
		<title>ZendCon08 Day 1 Wrap Up</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/395678592/</link>
		<comments>http://www.toosweettobesour.com/2008/09/17/zendcon08-day-1-wrap-up/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 23:52:40 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[ZendCon 08]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=171</guid>
		<description><![CDATA[Turned out to be a fairly exciting day. I woke up late wondering why my alarms didn't go off, just barely got to lunch and regretted missing Jay Pipes' talk.
Sara Golemon gave an interesting introduction to PHP extension writing. I bow to her vastly superior C-fu.
I already discussed a few talks that I went to [...]]]></description>
			<content:encoded><![CDATA[<p>Turned out to be a fairly exciting day. I woke up late wondering why my alarms didn't go off, just barely got to lunch and regretted missing <a href="http://www.jpipes.com/index.php">Jay Pipes</a>' talk.</p>
<p><a href="http://blog.libssh2.org/">Sara Golemon</a> gave an interesting introduction to PHP extension writing. I bow to her vastly superior C-fu.</p>
<p>I <a href="http://www.toosweettobesour.com/2008/09/16/zendcon-day-1-pecl-picks/">already</a> <a href="http://www.toosweettobesour.com/2008/09/16/zendcon08-day-1-the-knight-rider-methodology-to-software-development/">discussed</a> a few talks that I went to yesterday as well.</p>
<p>Ended the night doing a pub crawl with some people (hung out with Jay Pipes at the end which is what caused me to regret missing his talk).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/09/17/zendcon08-day-1-wrap-up/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F09%2F17%2Fzendcon08-day-1-wrap-up%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/09/17/zendcon08-day-1-wrap-up/</feedburner:origLink></item>
		<item>
		<title>ZendCon08 Day 1 - The Knight Rider Methodology to Software Development</title>
		<link>http://feeds.feedburner.com/~r/toosweettobesour/HrtK/~3/394604220/</link>
		<comments>http://www.toosweettobesour.com/2008/09/16/zendcon08-day-1-the-knight-rider-methodology-to-software-development/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 22:24:08 +0000</pubDate>
		<dc:creator>Daniel Cousineau</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[ZendCon 08]]></category>

		<guid isPermaLink="false">http://www.toosweettobesour.com/?p=163</guid>
		<description><![CDATA[Eli White gave a talk called "The Knight Rider Methodology to Software Development".
He compares software development methodologies to the old TV show Knight Rider, in that the main character, Michael Knight, was average and ordinary except for the fact that he had an applicable toolset for what he needed to do (KITT).
Eli talks about how [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eliw.com/">Eli White</a> gave a talk called <a href="http://eliw.com/conference/zendcon-2008-KnightRider.pdf">"The Knight Rider Methodology to Software Development"</a>.</p>
<p>He compares software development methodologies to the old TV show <a href="http://en.wikipedia.org/wiki/Knight_Rider">Knight Rider</a>, in that the main character, Michael Knight, was average and ordinary except for the fact that he had an applicable toolset for what he needed to do (KITT).</p>
<p>Eli talks about how while locking yourself into a programming language (company wise) is okay in that when you hire you know that the candidate has to know at lease a finite number of languages. But you shouldn't force employees to use locked in tools. If they like their own editor debugger combo, let them use it because they will be faster, the code will still work the same.</p>
<p>He goes over different tools you'll use for different purposes. Editors, debuggers, load testers, etc.</p>
<p>The movie clips are great, which you unfortunately don't get on the downloadable presentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.toosweettobesour.com/2008/09/16/zendcon08-day-1-the-knight-rider-methodology-to-software-development/feed/</wfw:commentRss>
		<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetItemData?uri=toosweettobesour/HrtK&amp;itemurl=http%3A%2F%2Fwww.toosweettobesour.com%2F2008%2F09%2F16%2Fzendcon08-day-1-the-knight-rider-methodology-to-software-development%2F</feedburner:awareness><feedburner:origLink>http://www.toosweettobesour.com/2008/09/16/zendcon08-day-1-the-knight-rider-methodology-to-software-development/</feedburner:origLink></item>
	<feedburner:awareness>http://api.feedburner.com/awareness/1.0/GetFeedData?uri=toosweettobesour/HrtK</feedburner:awareness></channel>
</rss><!-- Dynamic Page Served (once) in 1.444 seconds -->
