<?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"
	>

<channel>
	<title>tekrat</title>
	<atom:link href="http://tekrat.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tekrat.com</link>
	<description></description>
	<pubDate>Fri, 27 Jun 2008 07:31:16 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>PHP Fat Memory Manager Patch available</title>
		<link>http://tekrat.com/2008/06/11/php-fat-memory-manager-patch-available/</link>
		<comments>http://tekrat.com/2008/06/11/php-fat-memory-manager-patch-available/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 07:44:45 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[tech]]></category>

		<category><![CDATA[PHP Memory Manager Zend Performance Optimization]]></category>

		<guid isPermaLink="false">http://tekrat.com/?p=102</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->My latest performance bottle-neck in PHP has been the frequent memory allocation/deallocation that happens on every request.  I&#8217;ve created a speed freak&#8217;s patch to help with this by pre-allocating memory and letting it persist across requests.  This removes the interaction with the kernel memory management, and the rest of the internal emalloc/efree calls are dealt [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>My latest performance bottle-neck in PHP has been the frequent memory allocation/deallocation that happens on every request.  I&#8217;ve created a <a href="http://tekrat.com/php-fatmm/">speed freak&#8217;s patch </a>to help with this by pre-allocating memory and letting it persist across requests.  This removes the interaction with the kernel memory management, and the rest of the internal emalloc/efree calls are dealt with similar to that of a pool allocator.  It&#8217;s horribly memory inefficient in the hopes of making some CPU gains.  The <a href="http://tekrat.com/downloads/bits/fatmm-5.2.6.patch">patch for PHP-5.2.6</a> is available, I&#8217;d like to hear feedback about it&#8217;s success/failure in different environments.</p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/06/11/php-fat-memory-manager-patch-available/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Where&#8217;s George?</title>
		<link>http://tekrat.com/2008/06/10/wheres-george/</link>
		<comments>http://tekrat.com/2008/06/10/wheres-george/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 06:22:07 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/?p=100</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->After 4 Years and 179 days WheresGeorge.com has finally come through and notified me of my wondering bills status.  I always thought it would be funny to distribute some dollar bills at a strip club all marked with wheresgeorge.com and a nice description of where I dropped them off at.

]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>After 4 Years and 179 days <a href="http://www.wheresgeorge.com">WheresGeorge.com</a> has finally come through and notified me of my wondering bills status.  I always thought it would be funny to distribute some dollar bills at a strip club all marked with wheresgeorge.com and a nice description of where I dropped them off at.</p>
<p><a href="http://tekrat.com/images/wheresgeorge.jpg"><img src="http://tekrat.com/images/wheresgeorge.jpg" alt="" width="684" height="133" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/06/10/wheres-george/feed/</wfw:commentRss>
		</item>
		<item>
		<title>after the longjmp&#8230;.</title>
		<link>http://tekrat.com/2008/05/04/98/</link>
		<comments>http://tekrat.com/2008/05/04/98/#comments</comments>
		<pubDate>Mon, 05 May 2008 02:42:41 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/?p=98</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->I swear the machines are just fucking with me sometimes:
Breakpoint 3, _zend_bailout (filename=0x4089c8
"/Users/shire/data/php/git/php/Zend/zend_alloc.c", lineno=1693) at
/Users/shire/data/php/git/php/Zend/zend.c:787
787             longjmp(*EG(bailout), FAILURE);
(gdb) n

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!/////////!!!!!!!!!!!;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!//////&#62;)!*)&#62;&#62;/////!!!!!!!!!!;;;;;;;;;;
;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!////////&#62;&#62;))&#38;H.I%)&#62;&#62;/////!!!!!!!!!!;;;;;;;
;;;;;;;;;;;!!!!!!!!!!!!!!!!!!/////////&#62;&#62;&#62;))&#124;&#38;I,..H&#38;))&#62;&#62;//////!!!!!!!!;;;;;;
;;;;;;;;!!!!!!!!!!!!!!!!/////////&#62;&#62;&#62;&#62;&#62;)))&#124;&#38;H;))))&#62;;I&#124;))&#62;&#62;&#62;&#62;////!!!!!!!!;;;;
;;;;;!!!!!!!!!!!!!!///////////&#62;&#62;&#62;)&#124;&#38;&#38;%&#38;&#38;IIH%.)))),#HII&#38;&#124;))&#124;.)&#62;///!!!!!!!;;;
;;;!!!!!!!!!!!!//////////&#62;&#62;&#62;&#62;&#62;&#62;))&#124;&#38;*!!/:H))))))))))))):**H.%.)&#62;///!!!!!!!;;
!!!!!!!!!!!!/////&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;&#62;))))&#124;&#38;I,*;))))))))))))))))))))):*&#124;)&#62;&#62;///!!!!!!!;
!!!!!!!!!//////&#62;&#62;)IH&#124;&#124;&#124;&#124;&#38;&#124;&#124;&#124;&#124;&#124;&#124;&#38;H#,))))))))))))))))))))))))#HH)&#62;///!!!!!!!!
!!!!!!//////&#62;&#62;&#62;&#62;)&#124;&#38;%:;&#62;* /#:HHH%&#124;)))))))))))
]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>I swear the machines are just fucking with me sometimes:</p>
<pre>Breakpoint 3, _zend_bailout (filename=0x4089c8
"/Users/shire/data/php/git/php/Zend/zend_alloc.c", lineno=1693) at
/Users/shire/data/php/git/php/Zend/zend.c:787
787             longjmp(*EG(bailout), FAILURE);
(gdb) n

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!/////////!!!!!!!!!!!;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!//////&gt;)!*)&gt;&gt;/////!!!!!!!!!!;;;;;;;;;;
;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!////////&gt;&gt;))&amp;H.I%)&gt;&gt;/////!!!!!!!!!!;;;;;;;
;;;;;;;;;;;!!!!!!!!!!!!!!!!!!/////////&gt;&gt;&gt;))|&amp;I,..H&amp;))&gt;&gt;//////!!!!!!!!;;;;;;
;;;;;;;;!!!!!!!!!!!!!!!!/////////&gt;&gt;&gt;&gt;&gt;)))|&amp;H;))))&gt;;I|))&gt;&gt;&gt;&gt;////!!!!!!!!;;;;
;;;;;!!!!!!!!!!!!!!///////////&gt;&gt;&gt;)|&amp;&amp;%&amp;&amp;IIH%.)))),#HII&amp;|))|.)&gt;///!!!!!!!;;;
;;;!!!!!!!!!!!!//////////&gt;&gt;&gt;&gt;&gt;&gt;))|&amp;*!!/:H))))))))))))):**H.%.)&gt;///!!!!!!!;;
!!!!!!!!!!!!/////&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;))))|&amp;I,*;))))))))))))))))))))):*|)&gt;&gt;///!!!!!!!;
!!!!!!!!!//////&gt;&gt;)IH||||&amp;||||||&amp;H#,))))))))))))))))))))))))#HH)&gt;///!!!!!!!!
!!!!!!//////&gt;&gt;&gt;&gt;)|&amp;%:;&gt;* /#:HHH%|)))))))))))</pre>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/05/04/98/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bash autocompletion + git = super lazy goodness&#8230;.</title>
		<link>http://tekrat.com/2008/04/30/bash-autocompletion-git-super-lazy-goodness/</link>
		<comments>http://tekrat.com/2008/04/30/bash-autocompletion-git-super-lazy-goodness/#comments</comments>
		<pubDate>Thu, 01 May 2008 05:20:54 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[tech]]></category>

		<category><![CDATA[bash completion git tab]]></category>

		<guid isPermaLink="false">http://tekrat.com/?p=97</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Lately I&#8217;ve been using some longer, and not very memorable, git branch names.  I love bash completion and was hoping I could add items to this auto-completion dynamically on request.  It turns out this is really simple to do.   Thanks to this fab tutorial, a quick code snippet like this in [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Lately I&#8217;ve been using some longer, and not very memorable, git branch names.  I love bash completion and was hoping I could add items to this auto-completion dynamically on request.  It turns out this is really simple to do.   Thanks to this <a href="http://www.debian-administration.org/articles/316">fab tutorial</a>, a quick code snippet like this in my .profile and I&#8217;m all set.</p>
<hr />
<pre>_complete_git() {
  if [ -d .git ]; then
    branches=`git branch -a | cut -c 3-`
    tags=`git tag`
    cur=&#8221;${COMP_WORDS[COMP_CWORD]}&#8221;
    COMPREPLY=( $(compgen -W &#8220;${branches} ${tags}&#8221; &#8212; ${cur}) )
  fi
}
complete -F _complete_git git checkout
</pre>
<hr />
<p>Now anytime I&#8217;m in a path with a .git directory, I can just use &#8216;git checkout [tab]&#8216; and I&#8217;ll <em>git</em> tag and branch auto-completion goodness.</p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/04/30/bash-autocompletion-git-super-lazy-goodness/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Thanks Vancouver!</title>
		<link>http://tekrat.com/2008/04/17/thanks-vancouver/</link>
		<comments>http://tekrat.com/2008/04/17/thanks-vancouver/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 08:21:59 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/?p=96</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->I just got back from the OpenWeb conference in Vancouver, and I thought it was well run and enjoyable.  As with most conferences it&#8217;s difficult to make the wireless internet support so many users, not to mention with the restrictions and prices I hear some locations charge coferences.  (I also think electric outlets should be [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>I just got back from the <a href="http://www.openwebvancouver.ca/">OpenWeb</a> conference in Vancouver, and I thought it was well run and enjoyable.  As with most conferences it&#8217;s difficult to make the wireless internet support so many users, not to mention with the restrictions and prices I hear some locations charge coferences.  (I also think electric outlets should be in much wider abundance).  But it&#8217;s really all auxillary anyways, and there where plenty of good talks to listen to.</p>
<p>All the talks where video recorded so I&#8217;m looking forward to looking over anything I missed as soon as they are up on the site (like the <a href="http://www.openwebvancouver.ca/google-gears-teaching-open-web-new-tricks">Google Gears </a>talk).  It was refreshing to attend some other talks of interest such as <a href="http://www.openwebvancouver.ca/grassroots-open-mobile-technology">mobile</a> technologies and <a href="http://www.openwebvancouver.ca/oss-and-understanding-codebases-large">open source project research</a></p>
<p>As always you can find my talks in PDF format on my &#8220;<a href="http://tekrat.com/talks/">talks</a>&#8221; page.</p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/04/17/thanks-vancouver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tricky Tricky Refcounts&#8230;.</title>
		<link>http://tekrat.com/2008/04/07/tricky-tricky-refcounts-2/</link>
		<comments>http://tekrat.com/2008/04/07/tricky-tricky-refcounts-2/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 22:04:00 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/2008/04/07/tricky-tricky-refcounts-2/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->Occasionally a PHP engineer reports this prolem:
Example Code:&#8212;&#8212;&#8212;&#8212;-$my_arr = array(1,2,3);foreach ($my_arr as &#38;$val) {&#160;&#160;&#160; var_dump($val);}foreach ($my_arr as $val) {&#160;&#160;&#160; var_dump($val);}Expected Output:&#8212;&#8212;&#8212;int(1)int(2)int(3)int(1)int(2)int(3)Actual Output:&#8212;&#8212;-int(1)int(2)int(3)int(1)int(2)int(2)
The confusion comes from the expectation that the second loop will print the last element of the array as int(3) rather than int(2).&#160; The initial reaction is usally &#8220;this is a PHP bug&#8221;, but [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>Occasionally a PHP engineer reports this prolem:</p>
<p><span style="font-family: Courier;">Example Code:</span><br style="font-family: Courier;" /><span style="font-family: Courier;">&#8212;&#8212;&#8212;&#8212;-</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$my_arr = array(1,2,3);</span><br style="font-family: Courier;" /><span style="font-family: Courier;">foreach ($my_arr as &amp;$val) {</span><br style="font-family: Courier;" /><span style="font-family: Courier;">&nbsp;&nbsp;&nbsp; var_dump($val);</span><br style="font-family: Courier;" /><span style="font-family: Courier;">}</span><br style="font-family: Courier;" /><span style="font-family: Courier;">foreach ($my_arr as $val) {</span><br style="font-family: Courier;" /><span style="font-family: Courier;">&nbsp;&nbsp;&nbsp; var_dump($val);</span><br style="font-family: Courier;" /><span style="font-family: Courier;">}</span><br style="font-family: Courier;" /><br style="font-family: Courier;" /><br style="font-family: Courier;" /><span style="font-family: Courier;">Expected Output:</span><br style="font-family: Courier;" /><span style="font-family: Courier;">&#8212;&#8212;&#8212;</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(1)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(2)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(3)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(1)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(2)</span><br style="font-family: Courier;" /><span style="font-family: Courier; font-weight: bold;">int(3)</span><br style="font-family: Courier;" /><br style="font-family: Courier;" /><span style="font-family: Courier;">Actual Output:</span><br style="font-family: Courier;" /><span style="font-family: Courier;">&#8212;&#8212;-</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(1)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(2)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(3)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(1)</span><br style="font-family: Courier;" /><span style="font-family: Courier;">int(2)</span><br style="font-family: Courier;" /><span style="font-family: Courier; font-weight: bold;">int(2)</span><br style="font-family: Courier;" /><br />
The confusion comes from the expectation that the second loop will print the last element of the array as int(3) rather than int(2).&nbsp; The initial reaction is usally &#8220;this is a PHP bug&#8221;, but it really isn&#8217;t.&nbsp; There are two key aspects to this code to watch out for; 1) The scope of foreach variables is not limited to the foreach block. 2) Foreach loops do not unset foreach variables at the start of the block.</p>
<p>With this in mind we can see that at the end of the first loop, $val is a reference to the last element of $my_arr.&nbsp; Each iteration over the foreach loop can be thought of as an assignment operation, in this case by reference:</p>
<p><span style="font-family: Courier;">$val = &amp;$my_arr[0]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$val = &amp;$my_arr[1]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$val = &amp;$my_arr[2]&nbsp;&nbsp;<br />
// last iteration $val is a reference to $my_arr[2]</span><br style="font-family: Courier;" /><br />
As we step through each iteration of the second foreach loop we see the assignments of $val to each element of the $my_arr (assigned by value this time).</p>
<p><span style="font-family: Courier;">$val = $my_arr[0]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$val = $my_arr[1]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$val = $my_arr[2]</span><br style="font-family: Courier;" /><br />
But if we you recall $val is really a reference to the last element of $my_arr because it carries over from the first foreach loop, so the actual assignment looks more like:</p>
<p><span style="font-family: Courier;">$my_arr[2] = $my_arr[0]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$my_arr[2] = $my_arr[1]</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$my_arr[2] = $my_arr[2]</span><br style="font-family: Courier;" /><br />
Thus we end up with $my_array being set as such on each iteration:</p>
<p><span style="font-family: Courier;">// (array(1,2,1))&nbsp; first element is set to value of last<br />
</span><span style="font-family: Courier;">$my_arr[2] = $my_arr[0]&nbsp;<br />
</span><span style="font-family: Courier;"><br />
// (array(1,2,2))&nbsp; second element is set to value of last<br />
</span><span style="font-family: Courier;">$my_arr[2] = $my_arr[1]&nbsp;<br />
</span><span style="font-family: Courier;"><br />
// (array(1,2,2))&nbsp; last element is set to value of itself</span><br style="font-family: Courier;" /><span style="font-family: Courier;">$my_arr[2] = $my_arr[2]&nbsp;<br />
</span><br />
Note that the last assignment is really assigning the last element to itself!</p>
<p>Because PHP5 handles variables with a copy on write algorithm, it&#8217;s typically not necessary to do any assignmnents by reference with performance gains in mind (as was the case with a lot of PHP4 code).&nbsp; The above code can be made to function as the expected case by placing an unset($var) between the foreach loops, or not iterating over references and instead assigning the values of $my_arr explicitly by index or key values.&nbsp; References should be used by care&nbsp; and only when necessary.&nbsp; When code like this is present in global scope or large functions it may affect future code in seemingly unpredictable ways.&nbsp; </p>
<p>   <!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/PHP" rel="tag">PHP</a>, <a href="http://technorati.com/tag/reference" rel="tag">reference</a>, <a href="http://technorati.com/tag/%20assignment" rel="tag"> assignment</a>, <a href="http://technorati.com/tag/%20foreach" rel="tag"> foreach</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/04/07/tricky-tricky-refcounts-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Delivery Date Rescheduled&#8230;</title>
		<link>http://tekrat.com/2008/03/19/delivery-date-rescheduled/</link>
		<comments>http://tekrat.com/2008/03/19/delivery-date-rescheduled/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 20:01:21 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/2008/03/19/delivery-date-rescheduled/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->I love UPS tracking, but I&#8217;ve never really seen anything go wrong either&#8230;. until now&#8230;..&#160; my package has been marked as rescheduled for two days later than expected.&#160; Not too bad considering:
   
]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>I love UPS tracking, but I&#8217;ve never really seen anything go wrong either&#8230;. until now&#8230;..&nbsp; my package has been marked as rescheduled for two days later than expected.&nbsp; Not too bad considering:</p>
<p>   <img src="http://img.skitch.com/20080319-kc9h4mbc61btgiapcsk7iqhy1u.jpg" alt="UPS: Tracking Information" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/03/19/delivery-date-rescheduled/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vim Diff</title>
		<link>http://tekrat.com/2008/02/21/vim-diff/</link>
		<comments>http://tekrat.com/2008/02/21/vim-diff/#comments</comments>
		<pubDate>Fri, 22 Feb 2008 04:00:52 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tekrat.com/2008/02/21/vim-diff/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->For a long time now I&#8217;ve wanted to have the current diff of my working copy highlighted in vim.  This would help a lot when you&#8217;re working in complicated code and want your modifications to pop out in case you&#8217;ve missed something.  Unfortunately none of the existing tools do exactly what I want, [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>For a long time now I&#8217;ve wanted to have the current diff of my working copy highlighted in vim.  This would help a lot when you&#8217;re working in complicated code and want your modifications to pop out in case you&#8217;ve missed something.  Unfortunately none of the existing tools do <span style="font-style: italic">exactly</span> what I want, so with the advice of some co-workers I&#8217;ve hacked up the svndiff vim script and made it work with git just like I wanted.  Now I can turn on or refresh the highlights with Ctl-D and diff against a different branch with &#8220;:D &lt;branch&gt;&#8221;.</p>
<p><a href="http://tekrat.com/images/vimdiff.jpg"><img src="http://tekrat.com/images/vimdiff.jpg" style="width: 519px; height: 428px" alt="http://tekrat.com/images/vimdiff.jpg" /></a><br />
<br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">gitdiff.vim</span><br style="font-family: Courier" /><span style="font-family: Courier">&#8212;&#8212;&#8212;&#8212;&#8212;</span><br style="font-family: Courier" /><span style="font-family: Courier">if exists(&#8221;loaded_gitdiff&#8221;) || &amp;cp</span><br style="font-family: Courier" /><span style="font-family: Courier">    finish</span><br style="font-family: Courier" /><span style="font-family: Courier">endif</span><br style="font-family: Courier" /><span style="font-family: Courier">let loaded_gitdiff = 1</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">map &lt;C-d&gt; :call &lt;SID&gt;Gitdiff()&lt;CR&gt;</span><br style="font-family: Courier" /><span style="font-family: Courier">map &lt;C-g&gt; :set nodiff&lt;CR&gt;</span><br style="font-family: Courier" /><span style="font-family: Courier">noremap &lt;unique&gt; &lt;script&gt; &lt;plug&gt;Dh :call &lt;SID&gt;Gitdiff(&#8221;h&#8221;)&lt;CR&gt;</span><br style="font-family: Courier" /><span style="font-family: Courier">com! -bar -nargs=? D :call s:Gitdiff(&lt;f-args&gt;)</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">let g:gitdiff_rev = &#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">  </span><br style="font-family: Courier" /><span style="font-family: Courier">function! s:Gitdiff(&#8230;)</span><br style="font-family: Courier" /><span style="font-family: Courier">    if a:0 == 1</span><br style="font-family: Courier" /><span style="font-family: Courier">        if a:1 == &#8220;none&#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">            let g:gitdiff_rev = &#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">        else</span><br style="font-family: Courier" /><span style="font-family: Courier">            let g:gitdiff_rev = a:1</span><br style="font-family: Courier" /><span style="font-family: Courier">        endif</span><br style="font-family: Courier" /><span style="font-family: Courier">    endif</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">    let ftype = &amp;filetype</span><br style="font-family: Courier" /><span style="font-family: Courier">    let tmpfile = tempname()</span><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd = &#8220;cat &#8221; . bufname(&#8221;%&#8221;) . &#8221; &gt; &#8221; . tmpfile</span><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd_output = system(cmd)</span><br style="font-family: Courier" /><span style="font-family: Courier">    let tmpdiff = tempname()</span><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd = &#8220;git diff &#8221; . g:gitdiff_rev . &#8221; &#8221; . bufname(&#8221;%&#8221;) . &#8221; &gt; &#8221; . tmpdiff</span><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd_output = system(cmd)</span><br style="font-family: Courier" /><span style="font-family: Courier">    if v:shell_error &amp;&amp; cmd_output != &#8220;&#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">        echohl WarningMsg | echon cmd_output </span><br style="font-family: Courier" /><span style="font-family: Courier">        return</span><br style="font-family: Courier" /><span style="font-family: Courier">    endif</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd = &#8220;patch -R -p0 &#8221; . tmpfile . &#8221; &#8221; . tmpdiff</span><br style="font-family: Courier" /><span style="font-family: Courier">    let cmd_output = system(cmd)</span><br style="font-family: Courier" /><span style="font-family: Courier">    if v:shell_error &amp;&amp; cmd_output != &#8220;&#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">        echohl WarningMsg | echon cmd_output </span><br style="font-family: Courier" /><span style="font-family: Courier">        return</span><br style="font-family: Courier" /><span style="font-family: Courier">    endif</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">    if exists(&#8221;s:killbuffs&#8221;)</span><br style="font-family: Courier" /><span style="font-family: Courier">        2,9999 bdelete</span><br style="font-family: Courier" /><span style="font-family: Courier">    endif</span><br style="font-family: Courier" /><span style="font-family: Courier">    let s:killbuffs = 1</span><br style="font-family: Courier" /><span style="font-family: Courier">    if a:0 &gt; 0 &amp;&amp; a:1 == &#8220;h&#8221;</span><br style="font-family: Courier" /><span style="font-family: Courier">        exe &#8220;diffsplit&#8221; . tmpfile</span><br style="font-family: Courier" /><span style="font-family: Courier">    else</span><br style="font-family: Courier" /><span style="font-family: Courier">        exe &#8220;vert diffsplit&#8221; . tmpfile</span><br style="font-family: Courier" /><span style="font-family: Courier">    endif  </span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">    exe &#8220;set filetype=&#8221; . ftype</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">    hide</span><br style="font-family: Courier" /><span style="font-family: Courier">    set foldcolumn=0</span><br style="font-family: Courier" /><span style="font-family: Courier">    set foldlevel=100</span><br style="font-family: Courier" /><span style="font-family: Courier">    set diffopt=          &#8221; removed filler so we don&#8217;t show deleted lines</span><br style="font-family: Courier" /><span style="font-family: Courier">    highlight DiffAdd ctermbg=black ctermfg=DarkGreen</span><br style="font-family: Courier" /><span style="font-family: Courier">    highlight DiffChange ctermbg=black ctermfg=DarkGreen</span><br style="font-family: Courier" /><span style="font-family: Courier">    highlight DiffText ctermbg=black ctermfg=DarkGreen cterm=underline</span><br style="font-family: Courier" /><span style="font-family: Courier">    highlight DiffDelete ctermbg=red ctermfg=white</span><br style="font-family: Courier" /><span style="font-family: Courier">    </span><br style="font-family: Courier" /><span style="font-family: Courier">endfunction</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">&#8220;autocmd CursorHold * call s:Gitdiff()</span><br style="font-family: Courier" /><br style="font-family: Courier" /><span style="font-family: Courier">&#8212;&#8212;&#8212;&#8212;&#8212;</span><br />
<!-- technorati tags begin --></p>
<p style="font-size: 10px; text-align: right">Tags: <a href="http://technorati.com/tag/vimdiff%20git%20" rel="tag">vimdiff git </a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/02/21/vim-diff/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Open Web Vancouver 2008</title>
		<link>http://tekrat.com/2008/02/18/open-web-vancouver-2008/</link>
		<comments>http://tekrat.com/2008/02/18/open-web-vancouver-2008/#comments</comments>
		<pubDate>Mon, 18 Feb 2008 21:19:49 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://tekrat.com/2008/02/18/open-web-vancouver-2008/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->It looks like my talk has been accepted at the Open Web Vancouver 2008 conference.  I&#8217;m really looking forward to this as this will be my first conference that isn&#8217;t strictly PHP.  There will be a wider range of topics including Ruby on Rails, Python, Javascript, and even some mobile technology.
I&#8217;m really impressed [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>It looks like my talk has been accepted at the <a href="http://www.openwebvancouver.ca/">Open Web Vancouver 2008 conference</a>.  I&#8217;m really looking forward to this as this will be my first conference that isn&#8217;t strictly PHP.  There will be a wider range of topics including <a href="http://www.openwebvancouver.ca/node/70">Ruby on Rails</a>, <a href="http://www.openwebvancouver.ca/node/40">Python</a>, <a href="http://www.openwebvancouver.ca/node/62">Javascript</a>, and even some <a href="http://www.openwebvancouver.ca/node/79"><span style="text-decoration: underline">mobile technology</span></a>.</p>
<p>I&#8217;m really impressed with the site organization so far, I&#8217;ve got an account that looks like it lets me update my talk summary and tags.  The conference is also really reasonably priced at only $150 (+$20 for a t-shirt)!  My talk will be the &#8220;APC @ Facebook&#8221; talk that I&#8217;ve given in the past, but of course I&#8217;m hoping to update it with some recent changes and hopefully some new features that I&#8217;ve yet to complete.</p>
<p>My name has also apparently made it under the title &#8220;Some of the big names you can expect to hear&#8221;, although my name is the only one where the hyperlink is on &#8220;Facebook&#8221; rather than my name.  I guess I&#8217;m riding in on the coat tails so to speak.  ;-)</p>
<p><em>Update</em>:  Turns out somebody does read my blog and the &#8220;coat tailing&#8221; is no more, thanks!</p>
<p style="font-size: 10px; text-align: right">Tags: <a href="http://technorati.com/tag/PHPPython%20APC%20Facebook%20Open%20Web%20Vancouver%202008" rel="tag">PHPPython APC Facebook Open Web Vancouver 2008</a><br />
<!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2008/02/18/open-web-vancouver-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Forum PHP Paris 2007</title>
		<link>http://tekrat.com/2007/11/26/forum-php-paris-2007/</link>
		<comments>http://tekrat.com/2007/11/26/forum-php-paris-2007/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 20:10:50 +0000</pubDate>
		<dc:creator>shire</dc:creator>
		
		<category><![CDATA[personal]]></category>

		<guid isPermaLink="false">http://tekrat.com/2007/11/26/forum-php-paris-2007/</guid>
		<description><![CDATA[<!-- matched  --><!-- final 0 -->I had an excellent time at the Forum PHP conference, many thanks to the conference organizers and attendees at the Forum PHP Paris conference.  This year I had the honor of getting to speak to this group of people and share how Facebook uses APC to improve site stability and performance over the last [...]]]></description>
			<content:encoded><![CDATA[<!-- matched  --><!-- final 0 --><p>I had an excellent time at the <a href="http://www.afup.org/pages/forumphp2007/">Forum PHP</a> conference, many thanks to the conference organizers and attendees at the Forum PHP Paris conference.  This year I had the honor of getting to speak to this group of people and share how Facebook uses APC to improve site stability and performance over the last couple years, you can check out the slides <a href="http://tekrat.com/talks_files/forumphp2007/apc@facebook.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tekrat.com/2007/11/26/forum-php-paris-2007/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
