<?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>mindfieldz</title>
	<atom:link href="http://www.projectwhite.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.projectwhite.com</link>
	<description>Inside the mind of a geeky learning technologist</description>
	<lastBuildDate>Thu, 03 May 2012 20:25:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>This week, I have been mostly watching&#8230;</title>
		<link>http://www.projectwhite.com/2012/05/03/this-week-i-have-been-mostly-watching/</link>
		<comments>http://www.projectwhite.com/2012/05/03/this-week-i-have-been-mostly-watching/#comments</comments>
		<pubDate>Thu, 03 May 2012 20:25:57 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=110</guid>
		<description><![CDATA[This week, I have been mostly watching Geek and Sundry. There is something very odd about seeing a grown-up Will Wheaton playing TableTop games; in my head, he&#8217;s still about 15 and on the Enterprise bridge (TNG). The Flog is &#8230; <a href="http://www.projectwhite.com/2012/05/03/this-week-i-have-been-mostly-watching/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This week, I have been mostly watching <a href="http://geekandsundry.com/">Geek and Sundry</a>.</p>
<p>There is something very odd about seeing a grown-up Will Wheaton playing TableTop games; in my head, he&#8217;s still about 15 and on the Enterprise bridge (TNG). The Flog is also worth a watch to see all the gaming and meme references.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/05/03/this-week-i-have-been-mostly-watching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Header images</title>
		<link>http://www.projectwhite.com/2012/03/04/header-images/</link>
		<comments>http://www.projectwhite.com/2012/03/04/header-images/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 11:10:55 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tinkering]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=50</guid>
		<description><![CDATA[I&#8217;ve also replaced the default header images with some that are more relevant to me.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve also replaced the default header images with some that are more relevant to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/03/04/header-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Domain change</title>
		<link>http://www.projectwhite.com/2012/03/04/domain-change/</link>
		<comments>http://www.projectwhite.com/2012/03/04/domain-change/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 10:43:32 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tinkering]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=38</guid>
		<description><![CDATA[I&#8217;ve taken the opportunity to move this site over to my other domain, hopefully links and things will still work.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve taken the opportunity to move this site over to my other domain, hopefully links and things will still work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/03/04/domain-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Downloadable Content (DLC)</title>
		<link>http://www.projectwhite.com/2012/02/14/downloadable-content-dlc/</link>
		<comments>http://www.projectwhite.com/2012/02/14/downloadable-content-dlc/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 20:19:02 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=15</guid>
		<description><![CDATA[This post is a rant, I warn you now, it&#8217;s not going to be pretty. It&#8217;s part-based in a dilemma I face this month, as I do a few times every year: Should I pre-order game X? I know what &#8230; <a href="http://www.projectwhite.com/2012/02/14/downloadable-content-dlc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post is a rant, I warn you now, it&#8217;s not going to be pretty. It&#8217;s part-based in a dilemma I face this month, as I do a few times every year: <em>Should I pre-order game X?</em> I know what you&#8217;re thinking, if I pre-order, I&#8217;ll get my game of choice on release day (or soon after, thank you Royal Mail), and I can eagerly play to my heart&#8217;s content. However, this isn&#8217;t so much of an issue for me, because:</p>
<ol>
<li>I mostly download games through the likes of Steam, no need to wait for postie;</li>
<li>I have a 50Mb internet connection (soon to be 100Mbit, thank you Virgin Media)</li>
</ol>
<p>So, my dilemma isn&#8217;t: <em>Should I pre-order this so that I can get it on release day?</em> No, my dilemma is: <em>Should I pre-order this so that I can get the pre-order DownLoadable Content (DLC)?</em></p>
<p><span id="more-15"></span></p>
<p>Don&#8217;t get me wrong, back in the day when this sort of thing used to be called an <em>expansion</em>, I used to love it. Many modern games continue this tradition of adding new and fresh content to games, see my &#8216;good&#8217; point below. However, DLC nowadays seems to be a byword for revenue generation, with actual gameplay a distant second. I shall explain&#8230;</p>
<p><em><strong>Expansion</strong> DLC</em> is the only DLC that I&#8217;ll pay good money for. This is the stuff that adds genuine new content to the game, doesn&#8217;t require any prerequisites (in terms of game play), and is available to anyone who already owns the game. Examples include the <em>Total War </em>series, most recently <a href="http://en.wikipedia.org/wiki/Total_War:_Shogun_2#Rise_of_the_Samurai_Campaign"><em>Total War: Shogun 2: Rise of the Samurai</em></a>, but there are examples in everything from <em>Wing Commander</em> to <em>Railworks</em>. It doesn&#8217;t give [m]any advantages over those who don&#8217;t own it, it&#8217;s available to all, it can be played in isolation to the main plot. In all, most of the DLC for the <em>Total War</em> series has fallen into this category, adding <a href="http://en.wikipedia.org/wiki/Total_War:_Shogun_2#Downloadable_content">additional units and starts/campaigns</a> to the game.</p>
<p>Then we get into the DLCs that I dislike. There are a few, but the mainly apply to Bethesda and EA games:</p>
<p><em><strong>Pre-order </strong>DLC</em>,  the <em>&#8220;buy the game in advance and receive an in-game X&#8221;</em> content. Whilst I can appreciate that game publishers want you to pony up the cash in advance, my last few pre-orders (which I shall blog about another day) have been lame horses when finally released. Moreover, this DLC is often a one-shot; if you don&#8217;t pre-order then there&#8217;s only the slim chance that the DLC will be in a <em>Gold</em> or <em>Complete</em> edition of the game  released a few months/years down the line. This isn&#8217;t an old concept, so there are plenty of examples, but <a href="http://masseffect.wikia.com/wiki/Mass_Effect_2#Retail_Bonus_Items"><em>Mass Effect 2</em></a> is the one that demonstrates it well.</p>
<p><em><strong>Retailer specific</strong> DLC</em>, the<em> &#8220;pre-order from retailer X and receive exclusive in-game item Y&#8221;</em> content. This is a relatively new concept, but it annoys the hell out of me. If you buy from retailer X you&#8217;ll receive item X, order from retailer Y and you&#8217;ll receive item Y. In many cases these are also region locked, there won&#8217;t necessarily be a retailer in your region that sells the game with item Y. If I want item X or Y, I&#8217;m locked into a specific vendor, and often have to source and then wait for a physical copy of the game (<em>Amazon</em> and <em>Game</em> don&#8217;t do digital distribution). A recent example of this is <a href="http://deusex.wikia.com/wiki/Deus_Ex:_Human_Revolution_Preorder_Packs#Explosive_Mission_Pack"><em>Deus Ex:Human Revolution</em></a>, where there were both retailer specific and region specific exclusive items.</p>
<p><em><strong>Overpowered</strong> DLC</em>, is the sort of DLC that changes the balance of the game. Usually these items are massively overpowered, and can be used throughout the entire game, negating the need to search for and upgrade starting items. Conversely, the item is overpowered, but ammunition is so rare that the item is useless once it&#8217;s been &#8216;used&#8217;. Again, <a href="http://masseffect.wikia.com/wiki/M-29_Incisor"><em>Mass Effect 2</em></a> is a good example here, where the pre-order weapons were more powerful than many late-game items.</p>
<p><em><strong>Vanity</strong> DLC</em>, does absolutely nothing to the game, other than make it look visually different; there&#8217;s no advantages here other than showing off to your mates. Fortunately, this concept is so stupid that it&#8217;s relatively rare, but a good example is the weapon skins in <a href="http://epicgames.com/community/gears-of-war-3-weapon-skins/"><em>Gears of War 3</em></a>.</p>
<p><em><strong>Promotional</strong> DL</em>C, is the sort of thing where you get DLC for doing/purchasing something completely unrelated to the game. Again, <a href="http://masseffect.wikia.com/wiki/Mass_Effect_2#Promotional_Bonus_Items"><em>Mass Effect 2</em></a> is the example here, where there was a promotion run with <em>Dr Pepper</em>. I&#8217;ve recently heard that although these codes are easy to find on the internet, Bioware no longer allows users to redeem them.</p>
<p><em><strong>Other purchases</strong> DLC</em> (play demo, get DLC) generally requires you to own another game by the same developer or publisher. Sometimes just playing a demo of the other game will suffice, but often you have to own the game outright, and have reached a certain point in the game or unlock a certain achievement. Bioware&#8217;s games are a shining example of this, where the <em><a href="http://dragonage.wikia.com/wiki/Blood_Dragon_armor_set_%28Origins%29">Blood</a> <a href="http://dragonage.wikia.com/wiki/Blood_Dragon_armor_set_%28Dragon_Age_II%29">Dragon</a> <a href="http://masseffect.wikia.com/wiki/Blood_Dragon_Armor">Armour</a></em> persists across several games; unlocking it in an earlier game will unlock it in a later one. <a href="http://kotaku.com/5875094/i-reckon-mass-effect-3-in+game-goodies-will-do-wonders-for-the-kingdoms-of-amalur-demo/"><em>Mass Effect 3</em></a> is also guilty of doing this, requiring you to play demos of other games in order to unlock Mass Effect 3 items.<br />
In fact, Mass Effect 3 goes comically further on this one, its been recently announced that purchasing<a href="http://www.examiner.com/video-game-news-in-national/new-mass-effect-figures-to-include-mass-effect-3-dlc"> physical figurines of in-game characters</a> will unlock DLC.</p>
<p>If you&#8217;ve read this far, you&#8217;ll realise that a lot of games mix these types of &#8216;bad&#8217; DLC *cough*MassEffect*cough*. It wouldn&#8217;t be a problem if these items were only a few pounds, and available to all; but often they are locked into significant additional expense (&gt;£5) and only available for a limited time.<br />
So, that&#8217;s the end of my rant. I have until the beginning of March to decide whether I should pre-order some games&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/02/14/downloadable-content-dlc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing your Moodle statistics</title>
		<link>http://www.projectwhite.com/2012/01/13/fixing-your-moodle-statistics/</link>
		<comments>http://www.projectwhite.com/2012/01/13/fixing-your-moodle-statistics/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:32:39 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[moodle]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=8</guid>
		<description><![CDATA[Moodle statistics are great. Personally, every October, I scream like a schoolgirl and wave the most recent statistics graph at my colleagues whilst shouting at how all the numbers are bigger. However, it seems that on busier servers, especially one &#8230; <a href="http://www.projectwhite.com/2012/01/13/fixing-your-moodle-statistics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Moodle statistics are great. Personally, every October, I scream like a schoolgirl and wave the most recent statistics graph at my colleagues whilst shouting at how all the numbers are bigger. However, it seems that on busier servers, especially one like ours with 700,000 actions in one month, Moodle can easily fall behind.</p>
<p>For the past three months, since October 2011, our Moodle serve hasn&#8217;t been compiling statistics.</p>
<p>I can&#8217;t fully demonstrate the symptoms here, as I only decided to write this blog post after I had fixed things. But if you look at the graph below, you&#8217;ll see an earlier month where statistics also failed. 1st April 2011 has no actions logged.</p>
<div id="attachment_10" class="wp-caption alignnone" style="width: 757px"><a href="http://www.projectwhite.com/wp-content/uploads/2012/01/moodlestats.png"><img class="size-full wp-image-10" title="Example Moodle Statistics" src="http://www.projectwhite.com/wp-content/uploads/2012/01/moodlestats.png" alt="Moodle statistics" width="747" height="198" /></a><p class="wp-caption-text">Example Moodle statistics</p></div>
<p>This fix works on Moodle 1.9.3+, it should also work on Moodle 2.0 but some of the lines might be slightly different. YMMV</p>
<p>So&#8230; how to fix it&#8230; well&#8230;<span id="more-8"></span></p>
<p>First off, log in to your Moodle server and look at the <em>Server &gt; Statistics</em> settings. Ensure that the following are set:</p>
<ul>
<li>Enable statistics &#8211; checked (duh!)</li>
<li>Maximim processing interval &#8211; all<br />
(This is the earliest date for which Moodle will try to compile statistics.)</li>
<li>Maximum runtime &#8211; until complete</li>
<li>Days to process &#8211; 2<br />
(This is how many days worth of statistics will be processed each day, best to keep this &gt;1 and &lt;31</li>
<li>Run at &#8211; whatever you like, we&#8217;ll ignore this later</li>
<li>User threshold &#8211; 0</li>
<li>Maximum parent categories &#8211; 1</li>
</ul>
<p>&nbsp;</p>
<p>Then, open up your favourite database editor and look at the Moodle database. There are a few rows that you&#8217;ll need to adjust, which can best be found by running:</p>
<pre class="brush:sql">SELECT [id]
      ,[name]
      ,[value]
  FROM [moodle].[moodle].[mdl_config]
  WHERE name LIKE '%stats%'</pre>
<p>The fields you want to edit, are:</p>
<ul>
<li>statslastdaily = 0</li>
<li>statslastweekly = 0</li>
<li>statslastmonthly = 0</li>
<li>statslastexecution = 0</li>
</ul>
<p>&nbsp;</p>
<p>Finally, you&#8217;ll want to change the /admin/cron.php so that it only compiles statistics, and it ignores when it was last run. The best way of doing this is to take a copy of the existing cron.php, and rename it to something sensible, eg. cronstats.php. Then, editing our copy of cronstats.php:</p>
<ul>
<li>Keep everything above:
<pre class="brush:php">mtrace("Server Time: ".date('r',$timenow)."\n\n");</pre>
</li>
<li>Keep everything below the line:
<pre>//Unset session variables and destroy it</pre>
</li>
<li>For the rest of the document, remove everything except the following:
<pre class="brush:php">    if (!empty($CFG-&gt;enablestats) and empty($CFG-&gt;disablestatsprocessing)) {
        require_once($CFG-&gt;dirroot.'/lib/statslib.php');
        // check we're not before our runtime
        $timetocheck = stats_get_base_daily() + $CFG-&gt;statsruntimestarthour*6$

        if (time() &gt; $timetocheck) {
            // process configured number of days as max (defaulting to 31)
            $maxdays = empty($CFG-&gt;statsruntimedays) ? 31 : abs($CFG-&gt;statsrunt$
            if (stats_cron_daily($maxdays)) {
                if (stats_cron_weekly()) {
                    if (stats_cron_monthly()) {
                        stats_clean_old();
                    }
                }
            }
            @set_time_limit(0);
        } else {
            mtrace('Next stats run after:'. userdate($timetocheck));
        }
    }</pre>
</li>
<li>Then, comment out some lines so that it reads:
<pre class="brush:php">    //if (!empty($CFG-&gt;enablestats) and empty($CFG-&gt;disablestatsprocessing)) {
        require_once($CFG-&gt;dirroot.'/lib/statslib.php');
        // check we're not before our runtime
        //$timetocheck = stats_get_base_daily() + $CFG-&gt;statsruntimestarthour*6$

        //if (time() &gt; $timetocheck) {
            // process configured number of days as max (defaulting to 31)
            $maxdays = empty($CFG-&gt;statsruntimedays) ? 31 : abs($CFG-&gt;statsrunt$
            if (stats_cron_daily($maxdays)) {
                if (stats_cron_weekly()) {
                    if (stats_cron_monthly()) {
                        stats_clean_old();
                    }
                }
            }
            @set_time_limit(0);
        //} else {
        //    mtrace('Next stats run after:'. userdate($timetocheck));
        //}
    //}</pre>
</li>
</ul>
<p>This last step will stop the cronstats.php script from checking that it&#8217;s already run that day, meaning that you can run the script several times in succession. This is handy because something must have prevented the statistics from being compiled in the first place, and we want to determine what that is without having to reset the mdl_config table each time.</p>
<p>&nbsp;</p>
<p><strong>Warning!</strong> Running the cronstats.php will use a significant amount of CPU/RAM on your database server. The queries that Moodle uses to compile statistics are quite complex. It&#8217;s fine to run on a live server, just bear in mind that things <strong>will</strong> slow down.</p>
<p>Now, if you run the crontstats.php from the command line (or directly via the web, if you prefer). It should go off and compile the statistics for a few days (whatever you set &#8216;Days to process&#8217; to, above). If you&#8217;re lucky, the script will start to list hours of the day, and then eventually complete with the date that it&#8217;s just processed. eg. 0:1,1:20,2:30 &#8230; January 1 2012.</p>
<p>If you&#8217;re unlucky, like me, your script will get to the 0:1,1:20,2:30 part, then fail miserably with a SQL error. Which is probably what caused the script to fail in the first place, 3 months ago. But, at least we can now run this script repeatedly, and see what&#8217;s going on behind the scenes.</p>
<p>&nbsp;</p>
<p><strong>Warning!</strong> Until now, we&#8217;ve just been altering some configuration settings and timestamps, we&#8217;ve not changed anything serious. These next steps will vary wildly, depending on your database platform (we use MSSQL), and your experiences. You have been warned.</p>
<p>Part of the reason the cronstats.php script is not completing is because its taking too long. I can&#8217;t prove this, but the 100% CPU usage on our SQL server, and the 3 minutes it took the script to run before it gave up, are good indicators. For MSSQL we can run the profiler and database tuning wizards to decide whether additional indexes would improve things. Again, YMMV, but in our case the SQL server suggested a 30% improvement if we added some indexes, mainly to the mdl_context table.</p>
<p>After these index improvements, cronstats.php runs successfully, and manages to build statistics. In our case there was one last error where the SQL server timed out whilst trying to run some DELETE statements on the mdl_stats_&#8230; tables, but fortunately the cronstats.php script will list the statements that have failed, and you can run these by hand.</p>
<p>&nbsp;</p>
<p><strong>Final big warning!</strong> This generates a very large number of transactions in your database. Processing 3 months worth of statistics created a MSSQL transaction log in the region of 20GB. Don&#8217;t be a numpty like me and ignore this. I&#8217;ve spent most of this morning cleaning up transaction logs and disk space on our database server. It might be better to spread this entire process over a few days, or change the transaction logging method on your database whilst you run this.</p>
<p>Finally, a few observations from this:</p>
<ul>
<li>MSSQL Profiler and Database Tuning Wizard are excellent tools. The Moodle database isn&#8217;t the most efficient, especially on big installations, and inefficient indexes can cripple performance.</li>
<li>Make sure you have enough disk space on your database servers, no, really!</li>
<li>Always set your &#8220;Days to process&#8221; to more than 1 day. Since the statistics are only compiled once per day, you&#8217;ll want to have this set somewhere between 2 and 7; any less and we could start to see a backlog.</li>
<li>Keep a regular eye on the statistics. It&#8217;s very quick and easy to recover a week or two of statistics, but any mocan be problematic (see my server snafu, above).</li>
</ul>
<p>That&#8217;s it. I am sure there will be more Moodle adventures soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/01/13/fixing-your-moodle-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fresh start</title>
		<link>http://www.projectwhite.com/2012/01/12/fresh-start/</link>
		<comments>http://www.projectwhite.com/2012/01/12/fresh-start/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 21:58:55 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.projectwhite.com/?p=6</guid>
		<description><![CDATA[My existing blog was getting a bit irregular and out of date, both in terms of content and plugins/designs. I&#8217;ve decided on a bit of a fresh start, partly driven by the new blogs of my colleagues (see links), but &#8230; <a href="http://www.projectwhite.com/2012/01/12/fresh-start/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My existing blog was getting a bit irregular and out of date, both in terms of content and plugins/designs.</p>
<p>I&#8217;ve decided on a bit of a fresh start, partly driven by the new blogs of my colleagues (see links), but also driven by the new year.</p>
<p>Hopefully, this attempt will be a bit more regular.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.projectwhite.com/2012/01/12/fresh-start/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

