<?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>Freedom of Software &#187; Code</title>
	<atom:link href="http://freedomofsoftware.org/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://freedomofsoftware.org</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 08:30:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>InDefero &#8212; Code Hosting and Project Management</title>
		<link>http://freedomofsoftware.org/2011/02/indefero/</link>
		<comments>http://freedomofsoftware.org/2011/02/indefero/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 08:56:45 +0000</pubDate>
		<dc:creator>Braydon</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://braydon.com/?p=1658</guid>
		<description><![CDATA[While at SCaLE 9x this last weekend I went to a talk on &#8220;Behind the Scenes of Google Code Project Hosting&#8221;. I had previously just discovered InDefero, a project that started out as using a similar user interface but is &#8230; <a href="http://freedomofsoftware.org/2011/02/indefero/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While at SCaLE 9x this last weekend I went to a talk on &#8220;Behind the Scenes of Google Code Project Hosting&#8221;. I had previously just discovered <a href="http://www.indefero.net/">InDefero</a>, a project that started out as using a similar user interface but is radically different.</p>
<p>What I&#8217;ve always found very untrustworthy about Google Code Project Hosting, is that it is a proprietary based web service hosting open source software. They have two feelings for the same thing. He who can destroy a thing, can control a thing. Their hosting may affect your on more on a subconscious level than many may realize. You think we&#8217;ll ever see Bigtable or GFS (Google Filesystem) on their own code hosting? Google Code is built on top of Google&#8217;s proprietary database and filesystem, so even if they decided to make the project free software, there wouldn&#8217;t be a point because nobody could run it since it depends on those technologies, they would have to free their whole base. Which would be nearly impossible to do considering there might not be a community there to support it, that takes time.</p>
<p>At the end of the talk, someone asked the question if they were planning on supporting other version control systems. Which brought us to the ticket list of their project hosting which features at the top of the list as most requested feature being support for Git. The speaker from Google said he wasn&#8217;t allowed to state if they intended to support it.</p>
<p><a href="http://www.indefero.net/">InDefero</a> supports Git, is free software, has a hosted service, there is no vendor lock-in, and you pay for your service like any other web host, and it&#8217;s actively developed. I see no reason to use Google Project Hosting unless it is for Google specific projects like Chrome or Android. The world needs more companies like Google, but less ambivalent towards free software, less quantitative, more qualitative, and moving together via the cooperative superpower of free software.</p>
<p>Let&#8217;s put our feet down and start running? Yes!</p>
<p>-Braydon</p>
]]></content:encoded>
			<wfw:commentRss>http://freedomofsoftware.org/2011/02/indefero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Tip: Modifying the Loop, Custom Posts Query to include all Post Types</title>
		<link>http://freedomofsoftware.org/2010/08/wordpress-tip-modifying-the-loop-custom-posts-query-to-include-all-post-types/</link>
		<comments>http://freedomofsoftware.org/2010/08/wordpress-tip-modifying-the-loop-custom-posts-query-to-include-all-post-types/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 07:45:47 +0000</pubDate>
		<dc:creator>Braydon</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hacking]]></category>

		<guid isPermaLink="false">http://braydon.com/blog/?p=1012</guid>
		<description><![CDATA[The default post_type in query_posts is &#8216;post&#8217;, so other post types will not be in the loop unless they are specified. Here is an example of what you could include at the top of your template to include all post &#8230; <a href="http://freedomofsoftware.org/2010/08/wordpress-tip-modifying-the-loop-custom-posts-query-to-include-all-post-types/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The default post_type in query_posts is &#8216;post&#8217;, so other post types will not be in the loop unless they are specified. Here is an example of what you could include at the top of your template to include all post types.</p>
<p><code><br />
global $wp_query;<br />
$p = array('post_type' => array('article', 'gallery','post','project'));<br />
$q = array_merge($wp_query->query_vars, $p);<br />
query_posts($q);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://freedomofsoftware.org/2010/08/wordpress-tip-modifying-the-loop-custom-posts-query-to-include-all-post-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;The 1,11,2 Problem&#8221;, natural sorting of numbers and characters.</title>
		<link>http://freedomofsoftware.org/2010/08/the-1112-problem-natural-sorting-of-numbers-and-characters/</link>
		<comments>http://freedomofsoftware.org/2010/08/the-1112-problem-natural-sorting-of-numbers-and-characters/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 21:11:31 +0000</pubDate>
		<dc:creator>Braydon</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://braydon.com/blog/?p=1006</guid>
		<description><![CDATA[I&#8217;m sure everyone has run into this problem! You&#8217;re looking at a list in your file browser, or a maybe a list of tracks, the filenames or track numbers contain both numbers and characters, and the ordering is against logic: &#8230; <a href="http://freedomofsoftware.org/2010/08/the-1112-problem-natural-sorting-of-numbers-and-characters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure everyone has run into this problem! You&#8217;re looking at a list in your file browser, or a maybe a list of tracks, the filenames or track numbers contain both numbers and characters, and the ordering is against logic: &#8220;1,11,2&#8243; instead of &#8220;1,2,11&#8243;. Often times we will rename filenames to be have a preceding zero to fix the problem, &#8220;01, 02, 11&#8243;, however that isn&#8217;t compulsory!  This error happens because the numbers are seen to the software as as &#8220;string&#8221; of characters and their numeric value is not considered when it is sorted. Here is a great resource with examples in many programming languages on how to sort the &#8220;strings&#8221; considering both the alpha and numeric values in the &#8220;strings&#8221;: <a href="http://www.davekoelle.com/alphanum.html">The Alphanum Algorithm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://freedomofsoftware.org/2010/08/the-1112-problem-natural-sorting-of-numbers-and-characters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress URL Rewrite</title>
		<link>http://freedomofsoftware.org/2010/07/wordpress-url-rewrite/</link>
		<comments>http://freedomofsoftware.org/2010/07/wordpress-url-rewrite/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 01:11:56 +0000</pubDate>
		<dc:creator>Braydon</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://braydon.com/blog/?p=853</guid>
		<description><![CDATA[WordPress has it&#8217;s own URL management system, and when developing websites it&#8217;s convenient to be able to add new rules dynamically. I&#8217;ve used this for two websites, music.vtechphones.com and for a site I am building now. It&#8217;s also great to &#8230; <a href="http://freedomofsoftware.org/2010/07/wordpress-url-rewrite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>WordPress has it&#8217;s own URL management system, and when developing websites it&#8217;s convenient to be able to add new rules dynamically. I&#8217;ve used this for two websites, <a href="http://music.vtechphones.com">music.vtechphones.com</a> and for a site I am building now. It&#8217;s also great to keep all modifications in one place, so upgrades are easier, and easier for another developer to pick up!</p>
<p>Create a new plugin, and you place your rules into it doing something similar to the PHP below:</p>
<pre>

add_filter('rewrite_rules_array','wp_insert_my_rewrite_rules');
add_filter('init','flush_rules');

// Remember to flush_rules() when adding rules
function flush_rules(){
  global $wp_rewrite;
  $wp_rewrite->flush_rules();
}

// Adding a new rule
function wp_insert_my_rewrite_rules($rules){
  $newrules = array();

  $newrules['(articles)$'] = 'index.php?post_type=article';
  $newrules['(gallery)$'] = 'index.php?post_type=gallery';
  $newrules['(projects)$'] = 'index.php?post_type=project';
  $newrules['(blog)$'] = 'index.php?post_type=post';

  return $newrules + $rules;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://freedomofsoftware.org/2010/07/wordpress-url-rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Performance Part 3: Python 3000 and Transforming Large Lists into Seperate Smaller Lists</title>
		<link>http://freedomofsoftware.org/2008/12/python-performance-part-3-python-3000-and-transforming-large-lists-into-seperate-smaller-lists/</link>
		<comments>http://freedomofsoftware.org/2008/12/python-performance-part-3-python-3000-and-transforming-large-lists-into-seperate-smaller-lists/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 13:30:00 +0000</pubDate>
		<dc:creator>Braydon</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://braydon.com/blog/?p=125</guid>
		<description><![CDATA[Preface This is a redux of Python Performance Part 1, where the fastest method was using the reduce builtin function in Python2.5. December 3rd, Python 3000 final was released so I have downloaded it and gone over some of these &#8230; <a href="http://freedomofsoftware.org/2008/12/python-performance-part-3-python-3000-and-transforming-large-lists-into-seperate-smaller-lists/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="text" id="extended">
<h2>Preface</h2>
<p>This is a redux of <a href="/blog/2009/2/11/python-performance-part-1">Python Performance Part 1</a>, where the fastest method was using the reduce builtin function in Python2.5. December 3rd, Python 3000 final was released so I have downloaded it and gone over some of these scripts again. In Python 3000 the reduce function is no longer a builtin, and has moved to the module functools. When doing some general comparisons between Python2.5 and Python 3000, the later seemed to always run slightly slower. This is due to the new IO system and unicode indentifiers, as I was told in #python channel by Crys_. It was also recommended that I also compare my tests with <a href="http://en.wikipedia.org/wiki/List_comprehension">List Comprehension</a>, of which is new to me.</p>
<h2>List Comprehension</h2>
<pre>from oids import oids as a
c = 3
res = [a[x:x+c] for x in [c*x for x in range(int(round(len(a)/c)))]]
</pre>
<h3>Python 3k Times</h3>
<pre>real  0m0.218s
user  0m0.180s
sys   0m0.016s

real  0m0.262s
user  0m0.204s
sys   0m0.032s

real  0m0.287s
user  0m0.244s
sys   0m0.008s
</pre>
<h3>Python 2.5 Times</h3>
<pre>real  0m0.244s
user  0m0.220s
sys   0m0.016s

real  0m0.229s
user  0m0.208s
sys   0m0.020s

real  0m0.251s
user  0m0.236s
sys   0m0.020s
</pre>
<p>
This makes it the fastest method, beating the previous fastest time of 0.34s. Even better, there is little difference between Python2.5 and Python3000 here.
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://freedomofsoftware.org/2008/12/python-performance-part-3-python-3000-and-transforming-large-lists-into-seperate-smaller-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

