<?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>mnavasca.ca</title>
	<atom:link href="http://mnavasca.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://mnavasca.ca</link>
	<description>I haven't thought of a tag line yet...</description>
	<pubDate>Sat, 22 Aug 2009 02:01:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>An Undocumented Feature Of Apple Mail</title>
		<link>http://mnavasca.ca/2009/05/11/an-undocumented-feature-of-apple-mail/</link>
		<comments>http://mnavasca.ca/2009/05/11/an-undocumented-feature-of-apple-mail/#comments</comments>
		<pubDate>Tue, 12 May 2009 02:28:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://mnavasca.ca/?p=505</guid>
		<description><![CDATA[An Apple Mail undocumented feature that I can do without: Randomly shooting up to 100% CPU at least 3-4 times a day. After much googling (and following many dead ends) I&#8217;ve decided to blame Apple Mail&#8217;s data detectors. Type the following on the command line:
defaults write com.apple.mail DisableDataDetectors YES
Restart Mail, and no more 100% CPU.
]]></description>
			<content:encoded><![CDATA[<p>An <a href="http://en.wikipedia.org/wiki/Mail_%28application%29">Apple Mail</a> undocumented feature that I can do without: Randomly shooting up to 100% CPU at least 3-4 times a day. After much googling (and following many dead ends) I&#8217;ve decided to blame <a href="http://arstechnica.com/apple/news/2008/07/turn-off-those-annoying-data-detectors-in-apples-mail.ars">Apple Mail&#8217;s data detectors</a>. Type the following on the command line:</p>
<pre>defaults write com.apple.mail DisableDataDetectors YES</pre>
<p>Restart Mail, and no more 100% CPU.</p>
]]></content:encoded>
			<wfw:commentRss>http://mnavasca.ca/2009/05/11/an-undocumented-feature-of-apple-mail/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Zebra Tables In Zend Framework</title>
		<link>http://mnavasca.ca/2009/04/20/zebra-tables-in-zend-framework/</link>
		<comments>http://mnavasca.ca/2009/04/20/zebra-tables-in-zend-framework/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 01:36:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://mnavasca.ca/?p=512</guid>
		<description><![CDATA[I came across this today at work:
&#60;?php $rowClass = '#f0f0f0' ?&#62;
&#60;table&#62;
&#60;?php foreach($this-&#62;books as $book) { ?&#62;
   &#60;?php $i = 0; ?&#62;
   &#60;tr class = "&#60;?php echo $rowClass ?&#62;"&#62;
      &#60;td&#62;&#60;?php echo $book['author'] ?&#62;&#60;/td&#62;
   &#60;/tr&#62;
   &#60;?php
      if ($i % [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this today at work:</p>
<pre>&lt;?php $rowClass = '#f0f0f0' ?&gt;
&lt;table&gt;
&lt;?php foreach($this-&gt;books as $book) { ?&gt;
   &lt;?php $i = 0; ?&gt;
   &lt;tr class = "&lt;?php echo $rowClass ?&gt;"&gt;
      &lt;td&gt;&lt;?php echo $book['author'] ?&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;?php
      if ($i % 2 == 0)
         $rowClass = '#ffffff';
      else
         $rowClass = '#f0f0f0';
      $i++;
    ?&gt;
&lt;?php } ?&gt;
&lt;/table&gt;</pre>
<p>Zebra tables! Written like a five year old!</p>
<p>For a split second I longed for Smarty&#8217;s <a href="http://www.smarty.net/manual/en/language.function.cycle.php"><code>{cycle}</code></a> function. Does ZF have something similar? Well of course it does, <a href="http://www.gsdesign.ro/blog/zend-framework-view-helper-for-smarty-cycle/">and it&#8217;s even has the word &#8216;cycle&#8217; in it</a>!</p>
<pre>&lt;? $cycle=$this-&gt;cycle(array("#F0F0F0","#FFFFFF"));?&gt;
&lt;? foreach ($this-&gt;books as $book):?&gt;
  &lt;tr style="background-color:&lt;?=$cycle-&gt;next()?&gt;"&gt;
  &lt;td&gt;&lt;?=$this-&gt;escape($book['author']) ?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;? endforeach;?&gt;</pre>
<p>As a sidenote: ZF&#8217;s view helpers are so_much_cleaner than Smarty&#8217;s custom functions&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mnavasca.ca/2009/04/20/zebra-tables-in-zend-framework/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What&#8217;s Smarty?</title>
		<link>http://mnavasca.ca/2009/04/04/whats-smarty/</link>
		<comments>http://mnavasca.ca/2009/04/04/whats-smarty/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 01:39:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Smarty]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://mnavasca.ca/?p=497</guid>
		<description><![CDATA[Six months later&#8230; and I don&#8217;t miss Smarty at all. I&#8217;m perfectly happy with Zend Framework&#8217;s view scripts and PHP&#8217;s alternate syntax tags. Accepting view scripts was easy enough, it&#8217;s part of the framework so I might as well use it. However I still couldn&#8217;t accept seeing PHP code in my HTML templates:
&#60;table&#62;
&#60;?php foreach($tableData as [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mnavasca.ca/2008/10/16/i-miss-smarty/">Six months later</a>&#8230; and I don&#8217;t miss Smarty at all. I&#8217;m perfectly happy with <a href="http://framework.zend.com/manual/en/zend.view.scripts.html">Zend Framework&#8217;s view scripts</a> and <a href="http://us2.php.net/manual/en/control-structures.alternative-syntax.php">PHP&#8217;s alternate syntax tags</a>. Accepting view scripts was easy enough, it&#8217;s part of the framework so I might as well use it. However I still couldn&#8217;t accept seeing PHP code in my HTML templates:</p>
<pre>&lt;table&gt;
&lt;?php foreach($tableData as $dataRow) { ?&gt;
   &lt;tr&gt;
   &lt;?php foreach($dataRow as $data) { ?&gt;
      &lt;td&gt;&lt;?php echo $data; ?&gt;&lt;/td&gt;
   &lt;?php } ?&gt;
   &lt;/tr&gt;
&lt;?php } ?&gt;
&lt;/table&gt;</pre>
<p>When I discovered PHP&#8217;s alternate syntax, it just made sense. Especially if one keeps the alternate syntax in the view script only. And I think the syntax itself is much easier for The Designer (who doesn&#8217;t know/care about anything that is PHP) to understand:</p>
<pre>&lt;table&gt;
&lt;? foreach($tableData as $dataRow): ?&gt;
   &lt;tr&gt;
   &lt;? foreach($dataRow as $data): ?&gt;
      &lt;td&gt;&lt;?= $data ?&gt;&lt;/td&gt;
   &lt;? endforeach; ?&gt;
   &lt;/tr&gt;
&lt;? endforeach; ?&gt;
&lt;/table&gt;</pre>
<p>And at the same time I don&#8217;t get asked those endless &#8216;what the hell does <a href="http://www.smarty.net/manual/en/language.function.section.php"><code>{section}</code></a> mean?&#8217; questions anymore.</p>
]]></content:encoded>
			<wfw:commentRss>http://mnavasca.ca/2009/04/04/whats-smarty/feed/</wfw:commentRss>
		</item>
		<item>
		<title>I Miss Smarty</title>
		<link>http://mnavasca.ca/2008/10/16/i-miss-smarty/</link>
		<comments>http://mnavasca.ca/2008/10/16/i-miss-smarty/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 23:39:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Smarty]]></category>

		<guid isPermaLink="false">http://mnavasca.ca/?p=466</guid>
		<description><![CDATA[The last couple of days I&#8217;ve been getting my hands dirty with the codebase of one of the projects at work. At first I was kind of excited because it&#8217;s always a good experience becoming familiar with the unfamiliar. But imagine how my heart sank when I opened that first .php file and saw code [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of days I&#8217;ve been getting my hands dirty with the codebase of one of the projects at work. At first I was kind of excited because it&#8217;s always a good experience becoming familiar with the unfamiliar. But imagine how my heart sank when I opened that first <code>.php</code> file and saw code like the following:</p>
<pre>&lt;table&gt;
&lt;?php foreach($tableData as $dataRow) { ?&gt;
   &lt;tr&gt;
   &lt;?php foreach($dataRow as $data) { ?&gt;
      &lt;td&gt;&lt;?php echo $data; ?&gt;&lt;/td&gt;
   &lt;?php } ?&gt;
   &lt;/tr&gt;
&lt;?php } ?&gt;
&lt;/table&gt;</pre>
<p>Yes that&#8217;s right. PHP code mixed with the HTML markup. It&#8217;s a far cry from the neatly formatted Smarty templates that I&#8217;ve been working with the past 2-3 months.</p>
<p>There are three places where I usually see this kind of &#8216;unfortunate&#8217; code:</p>
<ol>
<li>PHP for dummies books</li>
<li>Templating systems</li>
<li>Ajax payloads from the server</li>
</ol>
<p>A free cookie to the first reader to guess correctly which category The Project falls in.</p>
<p>Although there&#8217;s a good reason why much the codebase is written like the above, that justification doesn&#8217;t make working with it any easier. Case in point: I spent the better part of this afternoon pulling my hair out trying to figure out why a block of HTML wasn&#8217;t showing up and it was all because I misplaced a <code>&lt;/div&gt;</code> insde a triple nested <code>&lt;foreach&gt;</code> structure.</p>
<p>Not the best way to spend your afternoon. Especially during the first week of a new job&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mnavasca.ca/2008/10/16/i-miss-smarty/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A New Job</title>
		<link>http://mnavasca.ca/2008/10/10/a-new-job/</link>
		<comments>http://mnavasca.ca/2008/10/10/a-new-job/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 23:30:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://mnavasca.ca/?p=464</guid>
		<description><![CDATA[So just imagine going into work on a Monday morning. You&#8217;re immediately called into an unscheduled meeting (which in my experience is never a good thing). You&#8217;re informed that due to budgetary concerns you&#8217;re being laid off. 
However a similiar position at another company has been generously arranged for you. It&#8217;s just a matter of [...]]]></description>
			<content:encoded><![CDATA[<p>So just imagine going into work on a Monday morning. You&#8217;re immediately called into an unscheduled meeting (which in my experience is never a good thing). You&#8217;re informed that due to budgetary concerns you&#8217;re being laid off. <em></em></p>
<p><em>However</em> a similiar position at another company has been generously arranged for you. It&#8217;s just a matter of you accepting. And as tempting as it is for you to sit a home all day and collect six months worth of employment insurance, you accept.</p>
<p>And that&#8217;s how I got a new job.</p>
<p>In case anybody&#8217;s wondering: This new position entails me to use the same set of technologies that I&#8217;m familiar with (PHP, Javascript, HTML, Ajax). The new workplace is even the same type of workplace environment (even down to the <a href="http://www.apple.com/ca/mac/">machines itself</a>). So really it just feels like I&#8217;m been assigned to a different development team more than anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://mnavasca.ca/2008/10/10/a-new-job/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
