<?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>incrediblog</title>
	<atom:link href="http://incredimike.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://incredimike.com</link>
	<description>Just another web development blog</description>
	<lastBuildDate>Mon, 23 Apr 2012 06:49:45 +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>deflate &amp; gzip: I was wrong</title>
		<link>http://incredimike.com/2012/03/deflate-gzip-i-was-wrong/</link>
		<comments>http://incredimike.com/2012/03/deflate-gzip-i-was-wrong/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 07:03:24 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://incredimike.com/?p=188</guid>
		<description><![CDATA[UPDATE: I was wrong about being wrong! In the comments section below, Billy Hoffman has pointed out that gzip compression is still incredibly useful, and that I should do better research. ;) &#160; Today I had to rethink how I serve data to my users. According to an answer posted on StackOverflow,  gzip or deflate [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: I was wrong about being wrong! In the comments section below, <a href="http://zoompf.com/blog/2012/02/lose-the-wait-http-compression">Billy Hoffman</a> has pointed out that gzip compression is still incredibly useful, and that I should do better research. ;)</p>
<p>&nbsp;</p>
<p>Today I had to rethink how I serve data to my users.</p>
<p>According to an<a href="http://stackoverflow.com/questions/388595/why-use-deflate-instead-of-gzip-for-text-files-served-by-apache/9856879#9856879"> answer posted on StackOverflow</a>,  gzip or deflate compression should be avoided when serving text-based files.</p>
<p>While compressing data to decrease bandwidth and download times generally seems like a great idea, there are a number of problems which have surfaced during the evolution of on-the-fly compression over the wire. After reading the article <a href="http://zoompf.com/blog/2012/02/lose-the-wait-http-compression">Lose the wait</a>, I thought more of why I had implemented used mod_gzip in the past and started to realize that the benefits aren&#8217;t particularly worth the effort or expense.</p>
<ul>
<li>Internet Explorer has a <a href="http://www.vervestudios.co/projects/compression-tests/results">history of issues</a> with receiving compressed payloads &#8212; so much history that all gzip/deflate HOWTOs have a line disabling compression for IE, based upon user agent evaluation.</li>
<li>Uses <a href="http://www.codinghorror.com/blog/2008/10/youre-reading-the-worlds-most-dangerous-programming-blog.html">extra CPU cycles</a> to compress data on each request.</li>
<li>Requires another module to be loaded into memory (mod_gzip, mod_deflate, etc)</li>
<li>SSL (HTTPS) connections cannot be compressed.</li>
</ul>
<div></div>
<p>A better approach is to combine technologies like browser caching and local storage mechanisms, server-side expires tags, and code &#8220;minification&#8221; to mitigate the need for on-the-fly compression by addressing the underlying issue: management of client-to-server requests.</p>
<p>All that said, compressed http payloads still have a place on the web. For example, Reddit, Digg, Slashdot, or any high-traffic, predominantly text-based site with a large volume of traffic from modern, non-IE web browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2012/03/deflate-gzip-i-was-wrong/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Git is magnificent.</title>
		<link>http://incredimike.com/2012/01/git-is-magnificent/</link>
		<comments>http://incredimike.com/2012/01/git-is-magnificent/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 05:27:36 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Expression Engine]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://incredimike.com/?p=161</guid>
		<description><![CDATA[Git is magnificent. No single tool has saved me as much time, effort, and sanity as Git and I recommend it&#8217;s use to every developer, designer, and power-user I know. What&#8217;s so great about Git? I had planned to sit down this evening and write an article extolling the virtues of git and version control, [...]]]></description>
			<content:encoded><![CDATA[<p>Git is magnificent. No single tool has saved me as much time, effort, and sanity as Git and I recommend it&#8217;s use to every developer, designer, and power-user I know.</p>
<h2>What&#8217;s so great about Git?</h2>
<p>I had planned to sit down this evening and write an article extolling the virtues of git and version control, but I&#8217;ve discovered loads of articles who have done it much better than I ever could. So instead of reinventing the wheel, I will merely redirect you to to these articles for an introduction to git, then make a few additional points.</p>
<p><strong>Required reading:</strong><br />
Designers read <a href="http://www.viget.com/inspire/git-a-designers-perspective/">Git: A Designer’s Perspective</a>.<br />
Developers read the article above and <a href="http://beust.com/weblog/2010/04/06/git-for-the-nervous-developer/">Git for the nervous developer</a>.</p>
<p><strong>Extracurricular:</strong><br />
A SlideShare presentation on the more <a href="http://www.slideshare.net/dreamiurg/introduction-to-git-8660499">technical aspects of Git</a>.</p>
<p><strong>Git options on Mac OS X: </strong></p>
<ul>
<li><a href="http://www.git-tower.com/">GitTower</a> &#8211; Commercial gui client ($69)</li>
<li><a href="http://code.google.com/p/git-osx-installer/">git-osx-installer</a> &#8211; open-source installation of command-line git</li>
<li>port install git-core &#8211; using <a href="http://www.macports.org/install.php">mac ports</a> (formerly darwin) package manager</li>
</ul>
<p><strong>Git options for Windows users:</strong></p>
<ul>
<li><a href="http://code.google.com/p/tortoisegit/">TortiseGit</a> - open-source client with Windows Explorer integration</li>
<li><a href="http://code.google.com/p/msysgit/">MSysGit</a> - open-source command-line client</li>
<li><a href="http://www.syntevo.com/smartgit/index.html">SmartGit</a> - commercial ($69)</li>
</ul>
<p><strong>Git repository hosting:</strong></p>
<ul>
<li><a href="https://github.com/">Github</a> &#8211; Packages geared toward many users and better collaboration, less repositories</li>
<li><a href="http://beanstalkapp.com/">Beanstalk</a> &#8211; Repository hosting with packages geared toward fewer developers, but more repositories per account tier.</li>
<li><a href="http://unfuddle.com/">Unfuddle</a> &#8211; Git and SVN hosting, geared toward project managements (has wikis, gantt charts, etc). Silly name.</li>
</ul>
<p><strong>More resources:</strong></p>
<p><a href="http://progit.org/book/">Pro Git</a> &#8211; A free git bible.</p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2012/01/git-is-magnificent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Lion and the Jumpy Mouse: A Mac Users Tale of Frustration</title>
		<link>http://incredimike.com/2011/08/the-lion-and-the-jumpy-mouse-a-mac-users-tale-of-frustration/</link>
		<comments>http://incredimike.com/2011/08/the-lion-and-the-jumpy-mouse-a-mac-users-tale-of-frustration/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 18:22:42 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[OSX Lion]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=122</guid>
		<description><![CDATA[Immediately after installing Lion I encountered the problem and have been researching it since. I thought I had fixed the problem by turning off pointer acceleration, but unfortunately that just reduced the symptoms. My experience: I first noticed that my mouse pointer will jump around the screen while moving it. That is, I would move [...]]]></description>
			<content:encoded><![CDATA[<p>Immediately after installing Lion I encountered the problem and have been researching it since. I thought I had fixed the problem by <a title="Fixing pointer skipping/jumping after OS X Lion install" href="http://incredimike.com/blog/2011/08/os-x-lion-causing-a-jumpy-mouse-movement/">turning off pointer acceleration</a>, but unfortunately that just reduced the symptoms.</p>
<p>My experience:</p>
<p>I first noticed that my mouse pointer will jump around the screen while moving it. That is, I would move the mouse a short distance but it does not move (seems &#8220;frozen&#8221;), then appears on the screen having covered a greater distance than it should have (100px move, appears 250px away [arbitrary values]), with no movement animation.</p>
<p>This seems to happen when various components in my system are under some sort load. It reminds me of older PCs and how human interface devices would take a back-seat when the system bus became overloaded.</p>
<p>I have noticed the problem occur during the following system activities:</p>
<ol>
<li>Dropbox displaying a growl notification about files being removed from my system (Growl, video, disk?)</li>
<li>Saving out files in photoshop (video?, disk)</li>
</ol>
<p>What I know it is not:</p>
<p>1. Solely Disk I/O related. I have run a command like &#8220;dd if=/dev/random of=/tmp/largefile bs=1024 count=4000000&#8243; and moved the mouse all around the screen.<br />
2. Solely video-related. I can play games just fine, though the pointer does become noticeably more jumpy.</p>
<p>I expect the problem is related to multiple components.</p>
<p>My current system configuration:</p>
<ul>
<li>21&#8243; iMac (Mid-2010)</li>
<li>8GB ram</li>
<li>Additional 20&#8243; monitor (mini-to-dvi adapter)</li>
<li>Logitech MX518 mouse</li>
<li>Apple USB keyboard</li>
</ul>
<div>I&#8217;m going to continue revisiting this until I&#8217;ve figure out what&#8217;s causing the problem.</div>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/08/the-lion-and-the-jumpy-mouse-a-mac-users-tale-of-frustration/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Changing IP subnets on a network containing OSX Lion Server running Virtualbox</title>
		<link>http://incredimike.com/2011/08/change-subnet-osx-lion-virtualbo/</link>
		<comments>http://incredimike.com/2011/08/change-subnet-osx-lion-virtualbo/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 01:33:21 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[OS X Lion Server]]></category>
		<category><![CDATA[OSX Lion]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=108</guid>
		<description><![CDATA[&#8230;on a Friday afternoon in July. I decided to finish setting up VPN access to the office and part of the process was to change our local subnet of &#8220;192.168.1.0&#8243; to &#8220;192.168.x.0&#8243; (for x > 1) to avoid ip address conflicts with most home routers. It&#8217;s not a difficult process, but I did encounter a [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;on a Friday afternoon in July.</p>
<p>I decided to finish setting up VPN access to the office and part of the process was to change our local subnet of &#8220;192.168.1.0&#8243; to &#8220;192.168.x.0&#8243; (for x > 1) to avoid ip address conflicts with most home routers. It&#8217;s not a difficult process, but I did encounter a few stumbling blocks along the way and I have noted them below.</p>
<p><strong>Obvious Tip of the Day:</strong> Change your TCP/IP settings on <strong>all</strong> devices that have IP settings manually configured.</p>
<p>Our OSX Lion server has its IP address manually assigned on the server itself, and luckily I was smart enough to have changed the IP address on the machine before making the subnet change. Unfortunately, I did <strong>not</strong> remember about the virtual machines that live in Virtualbox on the Lion server. After reconfiguring the router with the new subnet information I was left without my dev linux servers or the ability to access the internet. Here&#8217;s why:</p>
<h3>Virtualbox does not like moving subnets</h3>
<p>After rebooting the Lion server, my VMs (which normally <a href="http://mikkel.hoegh.org/blog/2010/dec/23/run-virtualbox-boot-mac-os-x">start at boot</a>) did not come back online and I was unable to connect to them using the Virtualbox GUI, even though the GUI suggested they were stopped. I believe I was getting an &#8220;access denied&#8221; error.</p>
<p>I unloaded the VMs .plist from OSX&#8217;s LaunchDaemon and started the VM manually via the VBox GUI, but once the machine had loaded to the login prompt I couldn&#8217;t type into the console! Also, when checking the settings for each VM showed a &#8220;Invalid Settings Detected&#8221; message at the bottom of the dialog.</p>
<p>Eventually I found that the problem was related to the subnet change having hosed VirtualBox&#8217;s virtual network interfaces.</p>
<h3>The Fix</h3>
<p>I added a new virtual interface by going to <strong>Virtualbox Preferences, Network, and clicking the plus (+) button</strong> to add a new interface for each VM. Not only did this give me the ability to interact with each VM via the VBox GUI, but it also allowed the VMs to reconnect to the network (obviously). Woohoo!</p>
<p>Except the ugly &#8220;Invalid settings detected&#8221; error was still displayed in the settings dialog for my VMs, which also has the nasty side-effect of disabling the OK button so you cannot change any settings.</p>
<h3>The Fix, part 2</h3>
<p>More <del datetime="2011-08-06T00:31:16+00:00">googling</del> research eventually let me to a <a href="http://forum.virtualbox.org/viewtopic.php?f=2&#038;t=43190">forum post</a> that solved my problem.</p>
<p>Run the following command:</p>
<p>$ VBoxManage showvminfo &#8220;Your VM Name&#8221;</p>
<p>If you see the following line:</p>
<pre class="brush: plain; title: ; notranslate">VRDE:            enabled (Address 0.0.0.0, Ports , MultiConn: off, ReuseSingleConn: off, Authentication type: null)</pre>
<p>Run this command:</p>
<p>$ VBoxManage modifyvm &#8220;your VM Name&#8221; &#8211;vrde off</p>
<p>Voila! Error message gone and you can edit your settings again. </p>
<p>Of course this is a band-aid fix and you should really <a href="http://www.virtualbox.org/manual/ch07.html">understand what VRDE does</a> before leaving it off indefinitely, but it&#8217;s Friday afternoon and I&#8217;m going home. See ya!</p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/08/change-subnet-osx-lion-virtualbo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing pointer skipping/jumping after OS X Lion install</title>
		<link>http://incredimike.com/2011/08/os-x-lion-causing-a-jumpy-mouse-movement/</link>
		<comments>http://incredimike.com/2011/08/os-x-lion-causing-a-jumpy-mouse-movement/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 20:06:34 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[OSX Lion]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=100</guid>
		<description><![CDATA[TL;DR: Disable mouse pointer acceleration. I installed OSX Lion onto my work machine this week and, while I do love the new features, I&#8217;ve been having some problems. Most notably, once I switched away from the carpel-tunnel-causing Magic Mouse to the luscious Logitech MX518 I have been experiencing the same &#8220;pointer skip&#8221; that many other [...]]]></description>
			<content:encoded><![CDATA[<p><kbd><strong>TL;DR: Disable mouse pointer acceleration.</strong></kbd></p>
<p>I installed OSX Lion onto my work machine this week and, while I do love the new features, I&#8217;ve been having some problems. Most notably, once I switched away from the carpel-tunnel-causing Magic Mouse to the luscious Logitech MX518 I have been experiencing the same &#8220;pointer skip&#8221; that <a href="http://us.battle.net/sc2/en/forum/topic/2878400077">many</a> other <a href="https://discussions.apple.com/thread/3210520?start=0&#038;tstart=0">people</a> are <a href="http://forums.steampowered.com/forums/showthread.php?p=24008538">complaining</a> about.</p>
<p>After some research it seems like the problem is related to mouse acceleration during high CPU usage, and it seems that the only way to mitigate the issue is to <strong>turn off mouse acceleration</strong>. I found a piece of software that allowed me do this, and it seems to have helped stop the pointer from jumping around as much but the problem isn&#8217;t completely solved. Obviously turning off isn&#8217;t a solution.</p>
<p>Here are two solutions to turning off mouse acceleration:</p>
<p>1. Command line app [<a href="http://osxdaily.com/2010/06/02/kill-os-x-mouse-acceleration-from-the-command-line/">source</a>]</p>
<p>$ curl -O http://ktwit.net/code/killmouseaccel<br />
$ chmod +x killmouseaccel<br />
$ ./killmouseaccel mouse</p>
<p>2. Use the app <a href="http://cl.ly/3qS0">Kill Mouse Accel.app</a>.</p>
<p>Try these fixes at your own risk. I used the option #1 above and it worked just fine. I hope this gets addressed in the near future.. it&#8217;s really odd mousing around the screen without acceleration. </p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/08/os-x-lion-causing-a-jumpy-mouse-movement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My new Bitcoin mining rig &#8220;Newbie&#8221;</title>
		<link>http://incredimike.com/2011/07/my-new-bitcoin-mining-rig/</link>
		<comments>http://incredimike.com/2011/07/my-new-bitcoin-mining-rig/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 14:52:29 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Bitcoin]]></category>
		<category><![CDATA[Economics]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=92</guid>
		<description><![CDATA[Given that I built this system 2 weeks ago it isn&#8217;t quite &#8220;new&#8221; but it mines at around 750-800 Mhash/sec, or 1 bitcoin every 2 days (via deepbit). I think that&#8217;s pretty respectable. Here&#8217;s the rig that I&#8217;ve christened &#8220;Newbie&#8221;: 2x ATI Radeon HD 5850 video cards (w/ CrossfireX) Intel i3-2100 (Dual core, 3.1 GHz) Asus P8P67LE [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.imgur.com/GYGyX.jpg" alt="" width="600" /></p>
<p>Given that I built this system 2 weeks ago it isn&#8217;t quite &#8220;new&#8221; but it mines at around 750-800 Mhash/sec, or 1 <a href="http://www.bitcoin.org/">bitcoin</a> every 2 days (via <a href="http://deepbit.net">deepbit</a>). I think that&#8217;s pretty respectable.</p>
<p>Here&#8217;s the rig that I&#8217;ve christened &#8220;Newbie&#8221;:</p>
<ul>
<li>2x ATI Radeon HD 5850 video cards (w/ CrossfireX)</li>
<li>Intel i3-2100 (Dual core, 3.1 GHz)</li>
<li>Asus P8P67LE motherboard (w/ 2 PCIE-16 slots)</li>
<li>4GB DDR3 RAM</li>
<li>640GB WD HDD</li>
<li>Antec case</li>
</ul>
<p>My first calculations were that the machine would paid for itself in approximately 3 months, but due to several factors affecting the <a href="http://bitcoincharts.com/markets/virtexCAD.html">BTC exchange</a> (increased difficulty, less interest, falling USD, etc) I&#8217;m not sure where this will take the market. Either way, it&#8217;s still an interesting experiment!</p>
<p>I&#8217;m going to post some mining statistics about the rig&#8217;s once I get a chance.</p>
<p><img class="alignnone" title="Deepbit Mhash/sec rate" src="http://deepbit.net/userbar/4e1fc33f0691728652000001_1834ab3aed.png" alt="Deepbit Mhash rate" width="377" height="19" /></p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/07/my-new-bitcoin-mining-rig/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adding a &#8220;Prepend&#8221; Option to URLs generated by the {exp:structure:nav} Tag</title>
		<link>http://incredimike.com/2011/06/prepending-arbitrary-text-to-structure-nav-urls/</link>
		<comments>http://incredimike.com/2011/06/prepending-arbitrary-text-to-structure-nav-urls/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 16:40:41 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Expression Engine]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Structure]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=77</guid>
		<description><![CDATA[In mod.structure.php function nav() insert the highlighted line: And before the end of the function, replace the line setting $html with the following highlighted line: Now open sql.structure.php. Locate the generate_nav() function (around line 479) and change the function definition to the first highlighted line below. Also update the function call to get_selective_data() (around line [...]]]></description>
			<content:encoded><![CDATA[<p>In <strong>mod.structure.php</strong> function <strong>nav()</strong> insert the highlighted line:</p>
<pre class="brush: php; first-line: 76; highlight: [81]; title: ; notranslate">
...
		// Miscellaneous parameters
		$depth = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('limit_depth', 1);
		$exclude = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('exclude', NULL);
		$mode = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('mode', 'sub');
		$prepend = $this-&gt;EE-&gt;TMPL-&gt;fetch_param('prepend', NULL);
...
</pre>
<p>And before the end of the function, replace the line setting <strong>$html</strong> with the following highlighted line:</p>
<pre class="brush: php; first-line: 120; highlight: [124]; title: ; notranslate">
...
		if ($entry_id === FALSE)
			$entry_id = 0;

		$html = $this-&gt;sql-&gt;generate_nav($entry_id, $current_id, $depth, $exclude, $mode, $prepend);

		return $html;
	}
...
</pre>
<p>Now open <strong>sql.structure.php</strong>.</p>
<p>Locate the <strong>generate_nav()</strong> function (around line 479) and change the function definition to the first highlighted line below. Also update the function call to <strong>get_selective_data()</strong> (around line 489) to pass through that $prepend value as shown in the second line below.</p>
<pre class="brush: php; highlight: [479,489]; title: ; notranslate">
...
	/**
	 * Get the HTML code for an unordered list of the tree
	 * @return string HTML code for an unordered list of the whole tree
	 */
	function generate_nav($entry_id, $current_id = FALSE, $depth = 1, $exclude = NULL, $mode, $prepend=null)
	{

		$html = '';
		$separator = $this-&gt;EE-&gt;config-&gt;item('word_separator') != &quot;dash&quot; ? '_' : '-';

		// Fallback to entry_id if no current_id (e.g. sitemap usage)
		if ($current_id === FALSE)
			$current_id = $entry_id;

		$pages = $this-&gt;get_selective_data($entry_id, $depth, $exclude, $current_id, $mode, $prepend);
		$pages = $this-&gt;add_attributes($pages, $current_id, $mode);
...
</pre>
<p>Now we update <strong>get_selective_data()</strong> (around line 139) to make use of the passed data:</p>
<pre class="brush: php; highlight: [139]; title: ; notranslate">
	/**
	 * Get selective data on all Structure Channels
	 * The Godfather of all Structure queries
	 *
	 * &quot;I'm gonna make you a query you can't refuse.&quot;
	 *
	 * @return array
	 */
	function get_selective_data($parent_id = NULL, $depth = 1, $exclude = NULL, $current_id = NULL, $mode = NULL, $prepend = NULL)
	{
		$pages = $this-&gt;get_site_pages();
...
</pre>
<p>Please take a moment and go back to thoroughly review the inline comment.</p>
<p>Finally, in the same <strong>get_selective_data()</strong> function find the code which sets &#8220;$data[$row['entry_id']]['uri']&#8221; (around line 286) and replace it with the highlighted code:</p>
<pre class="brush: php; highlight: [287]; title: ; notranslate">
...
			// build out the main data array
			foreach ($page_data as $row)
			{
				$data[$row['entry_id']] = $row;
				//$data[$row['entry_id']]['uri'] = $this-&gt;EE-&gt;functions-&gt;create_page_url($pages['url'] .'/'. $prepend, $pages['uris'][$row['entry_id']]);
				$data[$row['entry_id']]['uri'] = $this-&gt;EE-&gt;functions-&gt;create_page_url($pages['url'] .'/'. $prepend, $pages['uris'][$row['entry_id']]);
				$data[$row['entry_id']]['slug'] = $pages['uris'][$row['entry_id']];
				$data[$row['entry_id']]['classes'] = array();
				$data[$row['entry_id']]['ids'] = array();
...
</pre>
<p>That does it. You should now be able to add an arbitrary string to the beginning of the path portion of a URL.</p>
<p>Example code:</p>
<pre class="brush: php; html-script: true; title: ; wrap-lines: true; notranslate">
...
{exp:structure:nav mode=&quot;sub&quot; lang=&quot;{site_lang}&quot; start_from=&quot;/{segment_1}&quot; }
...
</pre>
<p>Note: {site_lang} is a snippet I&#8217;ve created in the EE back end that always echos the current site &#8220;stub&#8221;. Also, the &#8220;start_from&#8221; attribute isn&#8217;t required.</p>
<p>You can use the same principles in this post to prepend strings to the Structure breadcrumbs and other parts of Structure. Please be aware, however, if you modify the core code the Structure guys are <strong><em>not</em></strong> going to be able to help you with any problems you might encounter.</p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/06/prepending-arbitrary-text-to-structure-nav-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextMate: My favorite bundles and themes</title>
		<link>http://incredimike.com/2011/06/textmate-my-favorite-bundles-and-themes/</link>
		<comments>http://incredimike.com/2011/06/textmate-my-favorite-bundles-and-themes/#comments</comments>
		<pubDate>Mon, 13 Jun 2011 18:34:28 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=39</guid>
		<description><![CDATA[On my first day at POWERSHiFTER I was greeted with a desk &#38; chair to be assembled and a new iMac to be configured and while I had my chair built and desk organized in no time, setting up my iMac has been much more of a process. Sure, MobileMe automagically configured the baseline (settings, accounts, [...]]]></description>
			<content:encoded><![CDATA[<p>On my first day at POWERSHiFTER I was greeted with a <a href="http://www.flickr.com/photos/incredimike/5740943619/">desk &amp; chair to be assembled</a> and a new iMac to be configured and while I had my chair built and desk organized in no time, setting up my iMac has been much more of a process. </p>
<p>Sure, MobileMe automagically configured the baseline (settings, accounts, etc) for me but I&#8217;m still left with a number of particulars.. namely configuring my virtual workspace: editors, browsers, scripts, etc. Below is a list of all the custom add-ons I&#8217;ve installed to make my copy of TextMate wicked awesome:</p>
<p><strong>Essentials:</strong></p>
<ul>
<li><a href="https://github.com/jezdez/textmate-missingdrawer/">MissingDrawer</a> (gh) &#8211; This plugin provides Xcode-like project window interface without drawer and adds &#8220;Open Terminal Here&#8221; button to the file list&#8217;s button panel.</li>
</ul>
<p><strong>Awesome TextMate bundles:</strong></p>
<ul>
<li><a href="https://github.com/subtleGradient/javascript-tools.tmbundle">Javascript Tools bundle</a> (gh) - Essential Tools for developing Javascript in TextMate</li>
<li><a href="https://github.com/minimaldesign/mHTML.tmbundle">mHTML bundle</a> (gh) - TextMate XHTML Bundle that extends the functionality of the default HTML bundle. (<a href="http://minimaldesign.net/uploads/screencasts/html_css_textmate_bundles.mov">screencast</a>)</li>
<li><a href="https://github.com/minimaldesign/mCSS.tmbundle">mCSS bundle</a> (gh) - TextMate CSS Bundle that extends the default bundle with a million snippets. (<a href="http://minimaldesign.net/uploads/screencasts/html_css_textmate_bundles.mov">screencast</a>)</li>
<li><a href="https://github.com/kswedberg/jquery-tmbundle">jQuery bundle</a> (gh) &#8211; jQuery bundle to aid in jQuery development.</li>
<li><a href="http://julianeberius.github.com/Textmate-Minimap/">TextMade MiniMap</a> (gh) - Display a &#8220;mini-map&#8221; or preview for a file in a pane.</li>
<li><a href="https://github.com/briancollins/nice_find">nice_find</a> (gh) &#8211; Written in Objective C and interacts directly with TextMate. Uses grep (or git-grep where available). As a result it is faster, more intuitive, and has a native look and feel that is the envy of all the other grep bundles.</li>
<li><a href="http://www.cocoabits.com/TmCodeBrowser/Manual/index.html">TmCodeBrowser</a> -</li>
<li><a href="http://ciaranwal.sh/remate/">ReMate</a> - ReMate is a TextMate plugin which can be used to disable the automatic project tree refresh when the application regains focus.</li>
<li><a href="https://github.com/jcf/git-tmbundle">git-tmbundle</a> (gh) &#8211; Built-in git support for TextMate</li>
</ul>
<p><strong>Themes:</strong></p>
<ul>
<li><a href="http://blog.toddwerth.com/entries/show/2">IR_Black.tmTheme</a> &#8211; Black theme that has different colors for a wide variety of items, with coordinated colors between like items. (Ruby, Java, HTML, XML)</li>
<li><a href="http://fredhq.com/projects/clouds/">Clouds</a> &#8211; Light coloured, minimal theme. Very nice. (HTML, CSS, Javascript, PHP)</li>
</ul>
<p><strong>Other Resources:</strong></p>
<ul>
<li><a href="http://thinkvitamin.com/code/the-hidden-magic-in-textmate/">The Hidden Magic in TextMate</a></li>
<li>http://wiki.macromates.com/Main/Plugins</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/06/textmate-my-favorite-bundles-and-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://minimaldesign.net/uploads/screencasts/html_css_textmate_bundles.mov" length="29878237" type="video/quicktime" />
		</item>
		<item>
		<title>Adding a Custom Field to the Structure Page Control Panel</title>
		<link>http://incredimike.com/2011/06/adding-a-custom-field-to-the-structure-pages-list/</link>
		<comments>http://incredimike.com/2011/06/adding-a-custom-field-to-the-structure-pages-list/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 01:52:55 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[Expression Engine]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[Structure]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=47</guid>
		<description><![CDATA[A recent project with POWERSHiFTER had us designing an Expression Engine-driven site with a ridiculous amount of content (110,000 words / 500+ printed pages). Luckily the content was very well organized and came complete with internal addressing system for each of the sections to improve the quality of life for out copy editors. Now for [...]]]></description>
			<content:encoded><![CDATA[<p>A recent project with POWERSHiFTER had us designing an Expression Engine-driven site with a ridiculous amount of content (110,000 words / 500+ printed pages). Luckily the content was very well organized and came complete with internal addressing system for each of the sections to improve the quality of life for out copy editors.</p>
<div class="wp-caption alignright" style="width: 221px"><img title="Structure Control Panel page list" src="http://incredimike.com/blog/wp-content/uploads/2011/06/screenshot_001.png" alt="" width="211" height="172" /><p class="wp-caption-text">Out-of-the-box page hierarchy on the Structure control panel</p></div>
<p>Now for all of our Expression Engine sites we immediately install Structure, a badass module that completely reinvents how EE handles pages. Basically, it&#8217;s the best thing ever.. it&#8217;s got an intuitive design and saves us (me) from messing around trying to hack a &#8220;page structure&#8221; into EE, and lists site content pages in a hierarchy on a single view on the admin control panel which makes it super-easy to find or edit pages. Awesome! But even with all those perks, managing all that content in Structure became a bit cumbersome as everything in our copy was referenced by the &#8220;internal address&#8221; I mentioned above, not by the page titles that appear on the Structure control panel.</p>
<p>The solution? <strong>Add our internal document address system custom field to the Structure control panel page!</strong></p>
<div id="attachment_63" class="wp-caption alignright" style="width: 240px"><img class="size-full wp-image-63 " title="Added custom field data to Structure control panel" src="http://incredimike.com/blog/wp-content/uploads/2011/06/screenshot_002.png" alt="" width="230" height="174" /><p class="wp-caption-text">After adding custom field data to the page hierarchy</p></div>
<p>Keep in mind that this should work for any custom field attached to a Structure page (provided the field exists), but I&#8217;m not making any guarantees or warranty that this will work.. even though it should. Basically, it <a title="Works on my Machine" href="  http://www.codinghorror.com/blog/2007/03/the-works-on-my-machine-certification-program.html" target="_blank">works on my machine</a> using an install of ExpressionEngine 2.1.3 but, as with everything in life, YMMV.</p>
<p><strong>Further Warning</strong>: This will modify the core code for Structure. Don&#8217;t expect Travis or Jack (the guys behind Structure) to support your extension if these modifications break your site, cause you mental anguish, or murder your goldfish. You&#8217;ve been warned.</p>
<h3>Step 0:</h3>
<p>FOR GOODNESS SAKE, BACK UP EVERYTHING.</p>
<h3>Step 1:</h3>
<p>Get the <strong>Field ID</strong> for the custom field you want to include on the Structure Control Panel page. You can get this by going to Admin -&gt; Channel Administration -&gt; Custom Fields. Click &#8220;Add/Edit Custom Fields&#8221; for the appropriate Field Group, then click on the custom field you will be using.</p>
<p>Now look at the URL, you should see an address like this:<br />
<code>http://csrdev.powershiftermedia.com/admin/index.php?S=1234567890deadbeef&amp;D=cp&amp;C=admin_content&amp;M=field_edit&amp;<strong>field_id=<span style="text-decoration: underline;">21</span></strong>&amp;group_id=5</code></p>
<p>Write down the number that comes after &#8220;field_id=&#8221; in the URL; in this case it&#8217;s &#8220;21&#8243;. We will be using this later.</p>
<h3>Step 2</h3>
<p>Open the file &#8220;expressionengine/third_party/stricture/<strong>sql.structure.php</strong>&#8221; and find the &#8220;get_data()&#8221; function, on-or-around line 83. We are going to update the SQL query used by this function.</p>
<p>The SQL query at the time of writing is the following:</p>
<pre class="brush: php; title: Original SQL; notranslate">
$sql = &quot;SELECT node.*, (COUNT(parent.entry_id) - 1) AS depth, expt.title, expt.status
FROM exp_structure AS node
INNER JOIN exp_structure AS parent
ON node.lft BETWEEN parent.lft AND parent.rgt
INNER JOIN exp_channel_titles AS expt
ON node.entry_id = expt.entry_id
WHERE parent.lft &gt; 1
AND node.site_id = {$this-&gt;site_id}
AND parent.site_id = {$this-&gt;site_id}
GROUP BY node.entry_id
ORDER BY node.lft&quot;;
</pre>
<p>And we&#8217;re going to update it to the following:</p>
<pre class="brush: php; highlight: [2,8]; title: Modified SQL Query; notranslate">
$sql = &quot;SELECT node.*, (COUNT(parent.entry_id) - 1) AS depth, expt.title, expt.status
,expd.field_id_21 AS content_address
FROM exp_structure AS node
INNER JOIN exp_structure AS parent
ON node.lft BETWEEN parent.lft AND parent.rgt
INNER JOIN exp_channel_titles AS expt
ON node.entry_id = expt.entry_id
INNER JOIN exp_channel_data as expd ON node.entry_id = expd.entry_id
WHERE parent.lft &gt; 1
AND node.site_id = {$this-&gt;site_id}
AND parent.site_id = {$this-&gt;site_id}
GROUP BY node.entry_id
ORDER BY node.lft&quot;;
</pre>
<p>Notice the additions I&#8217;ve made on the 2nd and 8th lines. Let me explain:</p>
<ul>
<li>Line 2: <strong>Replace &#8220;21&#8243; with the Field ID you noted from Step 1.</strong> This will return the data you care about. You can also add &#8220;AS your_field_name&#8221; bit to your SQL to help you identify the field in the next step.</li>
<li>Line 8: This INNER JOIN connects the page title we&#8217;re returning to the custom field data for the page. You don&#8217;t need to edit this line.</li>
</ul>
<p>Save and close the file.</p>
<h3>Step 3:</h3>
<p>Open the file &#8220;expressionengine/third_party/structure/views/<strong>index.php</strong>&#8221; and find following code (on or around line 69):</p>
<pre class="brush: php; title: ; notranslate">
&lt;a class=&quot;page-edit&quot; href=&quot;&lt;?=$edit_url;?&gt;&quot;&gt;&lt;?=$page['title'];?&gt;&lt;/a&gt;
</pre>
<p>Now update the code to add in your custom field data, similar to the following:</p>
<pre class="brush: php; title: ; notranslate">
&lt;a class=&quot;page-edit&quot; href=&quot;&lt;?=$edit_url;?&gt;&quot;&gt;&lt;?=$page['content_address'];?&gt;&amp;nbsp;&lt;?=$page['title'];?&gt;&lt;/a&gt;
</pre>
<p>Save and close the file. Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/06/adding-a-custom-field-to-the-structure-pages-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin installation errors</title>
		<link>http://incredimike.com/2011/04/phpmyadmin-installation-errors/</link>
		<comments>http://incredimike.com/2011/04/phpmyadmin-installation-errors/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 21:20:40 +0000</pubDate>
		<dc:creator>Mike Walker</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[php-fpm]]></category>
		<category><![CDATA[rhel/centos]]></category>

		<guid isPermaLink="false">http://incredimike.com/blog/?p=33</guid>
		<description><![CDATA[When installing phpMyAdmin 3.3.10 on my Nginx 0.8.76, PHP-FPM 5.3.6 (w/ APC + memcached) &#38; MySQL 5.5.9 setup, I first encountered this problem: 2011/04/06 14:17:36 [error] 32174#0: *9366 FastCGI sent in stderr: "PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0 PHP Warning: require_once(): Unable to allocate memory for pool. [...]]]></description>
			<content:encoded><![CDATA[<p>When installing phpMyAdmin 3.3.10 on my Nginx 0.8.76, PHP-FPM 5.3.6 (w/ APC + memcached) &amp; MySQL 5.5.9 setup, I first encountered this problem:</p>
<p><code><br />
2011/04/06 14:17:36 [error] 32174#0: *9366 FastCGI sent in stderr: "PHP Warning:  Unknown: Unable to allocate memory for pool. in Unknown on line 0<br />
PHP Warning:  require_once(): Unable to allocate memory for pool. in /PATH/TO/MYSITE/phpmyadmin/index.php on line 35<br />
PHP Warning:  require_once(): Unable to allocate memory for pool. in /PATH/TO/MYSITE/phpmyadmin/libraries/common.inc.php on line 53<br />
PHP Warning:  require_once(): Unable to allocate memory for pool. in /PATH/TO/MYSITE/phpmyadmin/libraries/Error_Handler.class.php on line 13<br />
PHP Warning:  require_once(): Unable to allocate memory for pool. in /PATH/TO/MYSITE/phpmyadmin/libraries/Error.class.php on line 13" while reading response header from upstream, client: xxx.xxx.xxx.xxx, server: www.example.com, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.example.com"<br />
</code></p>
<p>I corrected this by editing <strong>/etc/php.d/apc.ini</strong> and setting <strong>apc.shm_size=64M</strong>.</p>
<p>Next, I encountered the following error:</p>
<p></code><br />
011/04/06 16:54:35 [error] 7399#0: *492 FastCGI sent in stderr: "PHP Fatal error:  Class 'PMA_Message' not found in /PATH/TO/MYSITE/phpmyadmin/libraries/Message.class.php on line 732" while reading upstream, client: xxx.xxx.xxx.xxx, server: www.example.org, request: "GET /phpmyadmin/phpmyadmin.css.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.example.org"<br />
</code></p>
<p>I found a <a href="http://sourceforge.net/projects/phpmyadmin/forums/forum/72909/topic/3533089?message=8033134">hint</a> to fix the problem, and discovered that PHP packages installed by the <a href="http://iuscommunity.org/">IUS Community Project</a> store sessions into <strong>/var/lib/php/session</strong>, which is owned by <strong>apache:apache</strong>. Since I don't use apache, I had changed both the PHP-FPM pool <strong>user</strong> and <strong>group</strong> to <strong>"nginx"</strong>, and that change removed PHP-FPM's ability to write to sessions.</p>
<p>Lessons learned:</p>
<ul>
<li>PHP packages installed via the <a href="http://iuscommunity.org/">IUS Community Project</a> attempt to save sessions to <strong>/var/lib/php/session</strong>, which is owned by <strong>apache:apache</strong>. Keep this in mind when modifying permissions or the accounts under which the services run.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://incredimike.com/2011/04/phpmyadmin-installation-errors/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

