<?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>Cognitive Sandbox</title>
	<atom:link href="http://cognitivesandbox.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cognitivesandbox.com</link>
	<description>Vegan cooking, unix tidbits and other minor discoveries</description>
	<lastBuildDate>Sat, 28 Aug 2010 21:23:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>PHP&#8217;s array_walk_recursive</title>
		<link>http://cognitivesandbox.com/posts/phps-array_walk_recursive/</link>
		<comments>http://cognitivesandbox.com/posts/phps-array_walk_recursive/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 21:23:21 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Software development]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2729</guid>
		<description><![CDATA[The description says &#8220;If funcname needs to be working with the actual values of the array, specify the first parameter of funcname as a reference.&#8221; This isn&#8217;t necessarily helpful as the function you&#8217;re calling might be built in (e.g. trim or strip_tags). One option would be to create a version of these like so. function [...]]]></description>
			<content:encoded><![CDATA[<p>The description says &#8220;If funcname needs to be working with the actual values of the array, specify the first parameter of funcname as a reference.&#8221; This isn&#8217;t necessarily helpful as the function you&#8217;re calling might be built in (e.g. trim or strip_tags). One option would be to create a version of these like so.</p>
<pre><code>
function trim_by_reference(&#038;$string) {
    $string = trim($string);
}
</code></pre>
<p>The downside to this approach is that you need to create a wrapper function for each function you might want to call. Instead, we can use PHP 5.3&#8242;s inline function syntax to create a new version of array_walk_recursive.</p>
<pre><code>
/**
 * This function acts exactly like array_walk_recursive, except
 * that it pretends that the function its calling replaces the
 * value with its result.
 *
 * @param $array The first value of the array will be passed
 *               into $function as the primary argument
 * @param $function The function to be called on each element
 *               in the array, recursively
 * @param $parameters An optional array of the additional
 *                parameters to be appeneded to the function
 *
 * Example to alter $array to get a short slice of each value
 *    array_walk_recursive_by_reference(
 *        $array, "substr", array("1","3")
 *    );
 */
function array_walk_recursive_by_reference(
        &#038;$array, $function, $parameters = array()) {
    $reference_function = function(&#038;$value, $key, $data) {
        $parameters = array_merge(array($value), $data[1]);
        $value = call_user_func_array($data[0], $parameters);
    };
    array_walk_recursive(
        $array,
        $reference_function,
        array($function, $parameters)
    );
}
</code></pre>
<p>The advantage here is that we only explicitly define one wrapper function instead of potentially dozens.</p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/phps-array_walk_recursive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portable cheesecake</title>
		<link>http://cognitivesandbox.com/posts/portable-cheesecake/</link>
		<comments>http://cognitivesandbox.com/posts/portable-cheesecake/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 15:51:17 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desserts]]></category>
		<category><![CDATA[Recipes]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2721</guid>
		<description><![CDATA[Following up on the pie in a jar notion, I&#8217;ve extended the same idea to cheesecakes. The following recipe is from La Dolce Vegan with minor modifications for convenience. Filling 300g silken tofu 2 cups tofutti &#8220;cream cheese&#8221; ¾ cup sugar 1 tbsp vanilla extract (I also added one vanilla bean) 1 tbsp lemon juice [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/08/vegan-cheesecake-283x425.jpg" alt="" title="vegan cheesecake" width="283" height="425" class="aligncenter size-medium wp-image-2722" /></p>
<p>Following up on the pie in a jar notion, I&#8217;ve extended the same idea to cheesecakes. The following recipe is from La Dolce Vegan with minor modifications for convenience.</p>
<h3>Filling</h3>
<ul>
<li>300g silken tofu</li>
<li>2 cups tofutti &#8220;cream cheese&#8221;</li>
<li>¾ cup sugar</li>
<li>1 tbsp vanilla extract (I also added one vanilla bean)</li>
<li>1 tbsp lemon juice (I think I put in 1½)</li>
<li>1 tsp lemon rind, finely grated</li>
<li>½ tsp salt</li>
<li>¼ flour</li>
</ul>
<h3>Glaze</h3>
<ul>
<li>1 cup jam</li>
<li>1 tbsp corn starch</li>
<li>¼ cup water</li>
</ul>
<h3>Method</h3>
<ol>
<li>Using a premade graham cracker crust (much faster), ground it up and split it between 8 jars.</li>
<li>Blend the filling in a food processor (wets first, drys second) and pour into the jars on top of the crust.</li>
<li>Cover and leave overnight in the fridge.</li>
<li>The next day, bring the glaze to a boil and simmer for 5 minutes, stirring constantly (make sure to mix the water and cornstarch first to avoid clumps).</li>
<li>Split the glaze between the 8 jars and refrigerate again for an hour.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/portable-cheesecake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pie in a jar</title>
		<link>http://cognitivesandbox.com/posts/pie-in-a-jar/</link>
		<comments>http://cognitivesandbox.com/posts/pie-in-a-jar/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 19:25:51 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desserts]]></category>
		<category><![CDATA[Recipes]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2713</guid>
		<description><![CDATA[Just about any pie recipe can be easily converted into jar pie. It&#8217;s really just a matter of form factor. Prepare a bunch, leave them in the freezer, thaw before use and bake at 375°F for 45 minutes. Couldn&#8217;t be simpler. Alternate ideas: layer on multiple pie flavours, or partition them horizontally with the aid [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cognitivesandbox.com/wp-content/uploads/2010/07/IMG_9292.jpg"><img src="http://cognitivesandbox.com/wp-content/uploads/2010/07/IMG_9292-283x425.jpg" alt="" title="Pie in a jar" width="283" height="425" class="aligncenter size-medium wp-image-2714" /></a></p>
<p>Just about any pie recipe can be easily converted into jar pie. It&#8217;s really just a matter of form factor. Prepare a bunch, leave them in the freezer, thaw before use and bake at 375°F for 45 minutes. Couldn&#8217;t be simpler.</p>
<p>Alternate ideas: layer on multiple pie flavours, or partition them horizontally with the aid of construction paper. The photo below is cherry on the left, blueberry on the right.</p>
<p><a href="http://cognitivesandbox.com/wp-content/uploads/2010/07/IMG_9293.jpg"><img src="http://cognitivesandbox.com/wp-content/uploads/2010/07/IMG_9293-425x283.jpg" alt="2pie1jar" title="2pie1jar" width="425" height="283" class="aligncenter size-medium wp-image-2718" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/pie-in-a-jar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding columns in a database</title>
		<link>http://cognitivesandbox.com/posts/finding-columns-in-a-database/</link>
		<comments>http://cognitivesandbox.com/posts/finding-columns-in-a-database/#comments</comments>
		<pubDate>Sat, 26 Jun 2010 22:13:15 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Software development]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2697</guid>
		<description><![CDATA[If you need to determine which columns in a database contain a certain type of string, the pseudocode is fairly simple: list all tables in a database, list their columns that are text-oriented, filter those that match some given format. For large tables, this script won&#8217;t bother looking at too much. ############################################ # Imports import [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to determine which columns in a database contain a certain type of string, the pseudocode is fairly simple: list all tables in a database, list their columns that are text-oriented, filter those that match some given format. For large tables, this script won&#8217;t bother looking at too much.</p>
<pre><code>
############################################
# Imports
import MySQLdb
import sys
############################################
# Initialize the database connection
database = MySQLdb.connect(
  host = "localhost",
  user = "username",
  passwd = "password",
  db = "database")
cursor = database.cursor();
############################################
# Find all matching columns
cursor.execute("SHOW TABLES")
tables = [table[0] for table in cursor.fetchall()]
for table in tables:
  cursor.execute("DESCRIBE %s" % table)
  columns = [column for column in cursor.fetchall()]
  for column in columns:
    if column[1].count("text") or column[1].count("char"):
      cursor.execute("SELECT `%s` FROM \
        (SELECT `%s` FROM `%s` LIMIT 20000) AS subtable \
        WHERE `%s` LIKE %s LIMIT 1" \
        % (column[0], column[0], table, column[0], '"%foo%"'))
      results = cursor.fetchall()
      if results != ():
        print "%s.%s -- %s" % (table, column[0], results)
############################################
# Close the database connection
database.close()
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/finding-columns-in-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chocolate truffles</title>
		<link>http://cognitivesandbox.com/posts/chocolate-truffles/</link>
		<comments>http://cognitivesandbox.com/posts/chocolate-truffles/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 07:22:30 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desserts]]></category>
		<category><![CDATA[Recipes]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2693</guid>
		<description><![CDATA[½ &#8220;butter&#8221; (Earth Balance works better than margarine here as consistency is important) 1 cup cocoa powder ½ tsp vanilla extract 1 tbsp maple syrup 1½ cups icing sugar Cream the &#8220;butter&#8221; and mix the rest in slowly, one at a time. When you&#8217;re done, you can coat each with melted chocolate (as pictured above), [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://cognitivesandbox.com/wp-content/uploads/2010/06/IMG_9245.jpg"><img src="http://cognitivesandbox.com/wp-content/uploads/2010/06/IMG_9245-425x283.jpg" alt="" title="Chocolate truffles" width="425" height="283" class="aligncenter size-medium wp-image-2694" /></a></p>
<ul>
<li>½ &#8220;butter&#8221; (Earth Balance works better than margarine here as consistency is important)</li>
<li>1 cup cocoa powder</li>
<li>½ tsp vanilla extract</li>
<li>1 tbsp maple syrup</li>
<li>1½ cups icing sugar</li>
</ul>
<p>Cream the &#8220;butter&#8221; and mix the rest in slowly, one at a time. When you&#8217;re done, you can coat each with melted chocolate (as pictured above), roll them in cinnamon, top them with an almond perhaps. These keep fairly well in the fridge when they&#8217;re done, although I&#8217;m no chocolatier, so venture with caution.</p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/chocolate-truffles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increased streetview coverage</title>
		<link>http://cognitivesandbox.com/posts/increased-streetview-coverage/</link>
		<comments>http://cognitivesandbox.com/posts/increased-streetview-coverage/#comments</comments>
		<pubDate>Tue, 04 May 2010 01:39:45 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Musings]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2685</guid>
		<description><![CDATA[Back in 2009, Google&#8217;s coverage of Canadian streets was limited to major cities. Seems as though there was an update in the meantime.]]></description>
			<content:encoded><![CDATA[<p>Back in 2009, Google&#8217;s coverage of Canadian streets was limited to major cities.</p>
<p><a href="http://blog.fagstein.com/2009/10/07/google-street-view-coverage-map/"><img src="http://cognitivesandbox.com/wp-content/uploads/2010/05/streetview-america-425x239.jpg" alt="" title="streetview-america" width="425" height="239" class="aligncenter size-medium wp-image-2686" /></a></p>
<p>Seems as though there was an update in the meantime.</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/05/streetview-canada-425x232.png" alt="" title="streetview-canada" width="425" height="232" class="aligncenter size-medium wp-image-2687" /></p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/increased-streetview-coverage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macaroni casserole</title>
		<link>http://cognitivesandbox.com/posts/macaroni-casserole/</link>
		<comments>http://cognitivesandbox.com/posts/macaroni-casserole/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 09:06:20 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Main course]]></category>
		<category><![CDATA[Recipes]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2645</guid>
		<description><![CDATA[The following details Greg Opperman&#8216;s recipe for vegan macaroni and &#8220;cheese&#8221;. Likely one of the tastiest of dishes I&#8217;ve ever had. It&#8217;s a touch elaborate, but well worth the effort. Veggie Beef 1 cup TVP 2 cups water 2 tbsp vegetable oil 2 tbsp mild chili powder 1 tbsp cumin 1 tsb soy sauce 1 [...]]]></description>
			<content:encoded><![CDATA[<p>The following details <a href="http://vegworcester.com/2010/02/05/best-vegan-mac-and-cheese-recipe/">Greg Opperman</a>&#8216;s recipe for vegan macaroni and &#8220;cheese&#8221;. Likely one of the tastiest of dishes I&#8217;ve ever had. It&#8217;s a touch elaborate, but well worth the effort.</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/IMG_9134-425x283.jpg" alt="" title="IMG_9134" width="425" height="283" class="aligncenter size-medium wp-image-2644" /></p>
<h3>Veggie Beef</h3>
<ul>
<li>1 cup TVP</li>
<li>2 cups water</li>
<li>2 tbsp vegetable oil</li>
<li>2 tbsp mild chili powder</li>
<li>1 tbsp cumin</li>
<li>1 tsb soy sauce</li>
<li>1 veggie broth cube</li>
<li>1 tbsp <a href="http://en.wikipedia.org/wiki/Sriracha_sauce">Sriracha</a></li>
<li>¼ cup chopped sage leaves</li>
</ul>
<ol>
<li>Combine ingredients in a saucepan.</li>
<li>Boil then simmer.</li>
<li>Adjust flavours as necessary.</li>
</ol>
<h3>Main sauce</h3>
<ul>
<li>½ cup flour</li>
<li>½ cup vegetable oil</li>
<li>4 cups unflavoured &#8220;milk&#8221; (soy, almond or rice)</li>
<li>1½ tbsp tumeric</li>
<li>1½ tbsp madras curry</li>
<li>1 tbsp garam masala</li>
<li>2 tbsp soy sauce</li>
<li>1 veggie broth cube</li>
<li>1 tbsp yellow mustard</li>
<li>1 inch fresh ginger</li>
<li>4 cloves garlic</li>
<li>1 batch veggie beef (as per above)</li>
<li>1 cup nutritional yeast flakes</li>
<li>8 ounces peas</li>
<li>8 ounces corn</li>
<li>1 pound rotini pasta (al dente)</li>
</ul>
<ol>
<li>Make a roux with the oil, flour and milk.</li>
<li>Add the spices and bring to a bubble.</li>
<li>Simmer with the remaining ingredients.</li>
</ol>
<h3>Topping</h3>
<ul>
<li>¼ cup sage leaves</li>
<li>1 cup panko breadcrumbs</li>
<li>8 ounces margarine</li>
</ul>
<ol>
<li>Melt the margarine.</li>
<li>Add the sage.</li>
<li>Add the breadcrumbs and combine.</li>
</ol>
<h3>Combine</h3>
<ol>
<li>Preheat the oven to 400°F.</li>
<li>Pour the main sauce into the casserole dish, followed by the topping.</li>
<li>Bake for 30 minutes (you&#8217;ll want the topping to be crispy, which may require broiling).</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/macaroni-casserole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Invasive browser sniffing</title>
		<link>http://cognitivesandbox.com/posts/history-scanner/</link>
		<comments>http://cognitivesandbox.com/posts/history-scanner/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 19:47:55 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Software development]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2597</guid>
		<description><![CDATA[Take the a:visited pseudo-class and use it to determine if the client&#8217;s browser has visited a site. Do this en masse with a subset of Alexa&#8217;s top 1m websites and you can build up a fairly detailed profile of a visiting brower&#8217;s history. var sites = [ 'http://google.com', 'http://facebook.com' ]; $(function(){ for (var i in [...]]]></description>
			<content:encoded><![CDATA[<p>Take the a:visited pseudo-class and use it to determine if the client&#8217;s browser has visited a site. Do this en masse with a subset of <a href="http://s3.amazonaws.com/alexa-static/top-1m.csv.zip">Alexa&#8217;s top 1m websites</a> and you can build up a fairly detailed profile of a visiting brower&#8217;s history.</p>
<pre><code>var sites = [
  'http://google.com',
  'http://facebook.com'
];
$(function(){
  for (var i in sites) {
    $(&quot;#test&quot;).html(&quot;
      &lt;li&gt;&lt;a href='&quot;+sites[i]+&quot;'&gt;&quot;+sites[i]+&quot;&lt;/a&gt; &lt;/li&gt;
    &quot;);
    if ($(&quot;#test a&quot;).css('color') == &quot;rgb(0, 204, 0)&quot;)
      $(&quot;#test li&quot;).appendTo(&quot;#visited&quot;);
    else
      $(&quot;#test li&quot;).appendTo(&quot;#not-visited&quot;);
    }
});</code></pre>
<ul>
<li><a href="http://cognitivesandbox.com/wp-content/uploads/2010/02/history-scanner.html">Try the code</a></li>
</ul>
<p>The ethics of this technique are questionable, especially if you retain this data and associate it with an email address or a registered user account. The only way I can see to protect against it is to disable JavaScript on all but the few sites you trust.</p>
<p>You could augment it to only send a sampling of 50 sites, respond with an ajax post, then determine which 50 to check next (e.g. if a user has visited a site specific to tech news, poll your next 50 on the most popular tech news sites). This concept is used at <a href="http://whattheinternetknowsaboutyou.com/">What The Internet Knows About You</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/history-scanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fondue and fudge</title>
		<link>http://cognitivesandbox.com/posts/fondue-and-fudge/</link>
		<comments>http://cognitivesandbox.com/posts/fondue-and-fudge/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 01:39:28 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Desserts]]></category>
		<category><![CDATA[Recipes]]></category>
		<guid isPermaLink="false">http://cognitivesandbox.com/?p=2580</guid>
		<description><![CDATA[This recipe works well both as fondue (while hot) and a soft fudge (while cold). ¼ cup margarine 225 grams dark chocolate ½ tbsp flour ½ cup corn syrup ½ tsp vanilla 2 tbsp soy milk Melt the chocolate and liquids in a double boiler. Sift in the flour to thicken the mixture up.]]></description>
			<content:encoded><![CDATA[<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/IMG_8994-425x283.jpg" alt="" title="IMG_8994" width="425" height="283" class="aligncenter size-medium wp-image-2582" /></p>
<p>This recipe works well both as fondue (while hot) and a soft fudge (while cold).</p>
<ul>
<li>¼ cup margarine</li>
<li>225 grams dark chocolate</li>
<li>½ tbsp flour</li>
<li>½ cup corn syrup</li>
<li>½ tsp vanilla</li>
<li>2 tbsp soy milk</li>
</ul>
<ol>
<li>Melt the chocolate and liquids in a double boiler.</li>
<li>Sift in the flour to thicken the mixture up.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/fondue-and-fudge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Misinterpreting problem spaces</title>
		<link>http://cognitivesandbox.com/posts/misinterpreting-problem-spaces/</link>
		<comments>http://cognitivesandbox.com/posts/misinterpreting-problem-spaces/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 04:41:31 +0000</pubDate>
		<dc:creator>Brad Beattie</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Musings]]></category>
		<category><![CDATA[Politics]]></category>
		<guid isPermaLink="false">http://www.cognitivesandbox.com/?p=2419</guid>
		<description><![CDATA[Polls and elections aren&#8217;t the same type of thing. The former asks for descriptive data, the latter for prescriptive preferences. To illustrate the hazards of this common misunderstanding, let&#8217;s go over some other ways data can partitioned and the problems that arise from confusing them. Ordered data vs unordered data Ordered data has an innate [...]]]></description>
			<content:encoded><![CDATA[<p>Polls and elections aren&#8217;t the same type of thing. The former asks for descriptive data, the latter for prescriptive preferences. To illustrate the hazards of this common misunderstanding, let&#8217;s go over some other ways data can partitioned and the problems that arise from confusing them.</p>
<h3>Ordered data vs unordered data</h3>
<p>Ordered data has an innate linear ordering, whereas unordered data doesn&#8217;t.</p>
<dl>
<dt>Ordered</dt>
<dd>How many apples can you eat in one sitting? (0, 1, 2&hellip;)</dd>
<dt>Unordered</dt>
<dd>What was the last type of apple you ate? (Granny smith, red delicious&hellip;)</dd>
</dl>
<p>When unordered data is confused as ordered data, a relationship is erroneously implied between the items.</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/unordered-as-ordered-425x303.jpg" alt="unordered-as-ordered" title="unordered-as-ordered" width="425" height="303" class="aligncenter size-medium wp-image-2545" /></p>
<p>When ordered data is confused as unordered, data trends are buried.</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/ordered-as-unordered-425x303.jpg" alt="ordered-as-unordered" title="ordered-as-unordered" width="425" height="303" class="aligncenter size-medium wp-image-2544" /></p>
<h3>Ordered discrete vs ordered continuous</h3>
<p>With discrete data, there exist two values for which there is no valid value in between, whereas continuous data can always be broken down into more detail.</p>
<dl>
<dt>Discrete</dt>
<dd>How many thermostats do you have in your house? (0, 1, 2&hellip;)</dd>
<dt>Continuous</dt>
<dd>What is the average temperature in your house? (22.1°C, 20.3°C&hellip;)</dd>
</dl>
<p>When discrete data is confused as continuous, inappropriate conclusions can be reached (chances are you have 2.3 thermostats in your house).</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/discrete-as-continuous-425x303.jpg" alt="discrete-as-continuous" title="discrete-as-continuous" width="425" height="303" class="aligncenter size-medium wp-image-2543" /></p>
<p>When continuous data is confused as discrete, granularity is lost. We can&#8217;t tell from the graph below whether there&#8217;s a large portion of 0.0km entries, if only odd decimal entries exist (0.1, 0.3, 0.5&hellip;), or any other detail hidden by these brackets.</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/continuous-as-discrete-425x303.jpg" alt="continuous-as-discrete" title="continuous-as-discrete" width="425" height="303" class="aligncenter size-medium wp-image-2552" /></p>
<h3>Simple data vs compound data</h3>
<p>Compound data have multiple values that bear some relation to each other.</p>
<dl>
<dt>Simple</dt>
<dd>How big is your television diagonally (24&#8243;, 32&#8243;, 34&#8243;&hellip;)</dd>
<dt>Compound</dt>
<dd>What are the dimensions of your television (20&#8243;x18&#8243;, 24&#8243;x20&#8243;&hellip;)</dd>
</dl>
<p>Compound data can be misrepresented as multiple simple data axes by ignoring the coupling between the two values, whereby the conditional probabilities are lost. Worse, it can be restricted down to a single simple data axis, whereby relevant data is entirely discarded (e.g. do sampled televisions only exist at certain aspect ratios?).</p>
<p><img src="http://cognitivesandbox.com/wp-content/uploads/2010/02/compound-as-simple-425x303.jpg" alt="compound-as-simple" title="compound-as-simple" width="425" height="303" class="aligncenter size-medium wp-image-2541" /></p>
<h3>Descriptive data vs prescriptive preferences</h3>
<dl>
<dt>Descriptive</dt>
<dd>What did you have for dinner last night?</dd>
<dt>Prescriptive</dt>
<dd>What should we have for dinner tonight?</dd>
</dl>
<p>The difference is subtle, but it&#8217;s there. With descriptive data, respondents have no incentive to tactically misrepresent their opinions. With prescriptive preferences, respondents (aka voters) are aware that their response will influence a future that likely affects them and will vote accordingly.</p>
<p>When prescriptive preferences are confused as descriptive data, a few things can happen:</p>
<ul>
<li>Continuous data can be filtered down into discrete data. Instead of allowing degrees of preference, ballots are restricted to binary expressions of support.</li>
<li>Compound data can be filtered down into simple data. Although multiple options exist, ballots restrict the voter to supporting a single candidate.</li>
</ul>
<p>Both confusions are present when Plurality voting is used in lieu of <a href="http://cognitivesandbox.com/posts/a-brief-survey-of-ballot-types/">a more expressive ballot</a>, where in voters could express more than just a single binary preference for a single option. Maybe this comes from ignorance of alternative voting methods, technical restrictions from the online voting application used, or seeing everything as a nail when you&#8217;re holding a hammer; Take your pick.</p>
<p>When Plurality voting is used to obtain prescriptive preferences, the same type of analytical fallacy is being made as is detailed in the above examples, all of which lead to a poor understanding of the underlying reality the data represents.</p>
]]></content:encoded>
			<wfw:commentRss>http://cognitivesandbox.com/posts/misinterpreting-problem-spaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
