<?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>Zenovation's Blog &#187; Technical</title>
	<atom:link href="http://zenovations.com/blog/tag/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://zenovations.com/blog</link>
	<description>A blog about web design, programming, hosting, and virtualmin hacks</description>
	<lastBuildDate>Wed, 28 Jul 2010 23:33:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Project Management and Time Tracking</title>
		<link>http://zenovations.com/blog/2010/07/project-management-and-time-tracking/</link>
		<comments>http://zenovations.com/blog/2010/07/project-management-and-time-tracking/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 23:30:41 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[time tracking]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=201</guid>
		<description><![CDATA[The world of Time Tracking and Project Management is a vast one. For small businesses like ours, there are seemingly endless time tracking solutions and a good number of project management answers.  I spent nearly two weeks evaluating options in my spare time, so hopefully this data will help save you some time. Here are [...]]]></description>
			<content:encoded><![CDATA[<p>The world of Time Tracking and Project Management is a vast one. For small businesses like ours, there are seemingly endless time tracking solutions and a good number of project management answers.  I spent nearly two weeks evaluating options in my spare time, so hopefully this data will help save you some time.</p>
<p><span id="more-201"></span></p>
<p>Here are the criteria I used to narrow down the possible project management and time tracking solutions:</p>
<ul>
<li>Web based application<br />
<span style="color: #888888;">Our devs use various platforms and it needs to run everywhere without install and upgrade headaches, I also considered Air and Flash apps</span></li>
<li>Support for 5 users<br />
<span style="color: #808080;">Because, yanno, we need five people to record time</span></li>
<li>Time tracking must include timer with start/stop capabilities<br />
<span style="color: #808080;">We are multi taskers and like accuracy; we considered products with timer widgets as well</span></li>
<li>Feature list and pricing prominent<br />
<span style="color: #888888;">Excluded all sites with vague details, no screenshots,  or &#8220;contact us for details and pricing&#8221; models, due to sheer volume and time needed to research</span></li>
<li>Must have a free trial evaluation<br />
<span style="color: #888888;">Yanno, so I could evaluate them</span></li>
<li>Professional and sharp web site<br />
<span style="color: #888888;">Attention to detail is critical to good software design and project management, how they run their site should reflect this</span></li>
</ul>
<p>After nearly ten hours of research, I narrowed the field to fifteen products. Then I evaluated each product by importing several of our current projects into it and using the time tracking tools for one day. After which I ran reports and recorded my findings in a spreadsheet. The final ratings were on a 1-5 scale, based on usability, project management capabilities, time tracking capabilities, invoicing features, reporting capabilities, and API and integration tools. Here&#8217;s what I came up with:</p>
<p><a href="http://zenovations.com/blog/wp-content/uploads/2010/07/product_quality.png"><img class="alignnone size-full wp-image-208" title="product_quality" src="http://zenovations.com/blog/wp-content/uploads/2010/07/product_quality.png" alt="" width="800" height="600" /></a></p>
<p>Once I had some numbers to work with, I weighted each product to meet our needs, based on the following criteria:</p>
<ul>
<li>Usability: Ease and speed of use is very important to us, as we have little time for project management (x2)</li>
<li>Time tracking capabilities: highly critical (x5)</li>
<li>Project management capabilities: highly critical (x5)</li>
<li>Low price:  we want to keep the price under $50 a month, so our value calculation was tweaked accordingly:  rating *3 &#8211; (price per month/10)</li>
<li>Invoicing, reports, and so on are nice, of course, but we can make due with our external, existing solutions</li>
</ul>
<p>So, using this data, here were my findings:</p>
<p><a href="http://zenovations.com/blog/wp-content/uploads/2010/07/value_to_us.png"><img class="size-full wp-image-206 alignnone" title="value_to_us" src="http://zenovations.com/blog/wp-content/uploads/2010/07/value_to_us.png" alt="" width="800" height="600" /></a></p>
<p>It should be apparent that ProWorkflow is, hands down, the best overall product on the market. It&#8217;s quality, well thought out, bug free, fast, and powerful. Skylight was by far the best for our needs, according to price versus quality. The rest of the data is interesting, but several of the products listed had a time tracking or project management rating less than three, which is insufficient for our needs. So the final choices for us were as follows:</p>
<ul>
<li><a href="http://www.skylightit.com">Skylight </a>&#8211; use this and put up with the slow, laborious interface; our preference for now</li>
<li><a href="http://www.basecamphq.com">Basecamp </a>+ <a href="http://www.myhours.com/">MyHours</a>/<a href="http://www.getharvest.com/">Harvest</a>/<a href="http://www.tickspot.com/pricing/">Tick </a>&#8211; together, these products are a complete package, but pricey</li>
<li><a href="http://www.proworkflow.com/">ProWorkflow </a>&#8211; very pricey, but we could bite the bullet on this and get the best quality product on the market.</li>
</ul>
<p>If you&#8217;d like to view or download the complete data, including links to all of the product sites, you can <a href="https://spreadsheets.google.com/pub?key=0Asi9t45zMwJJdEd6LVpGSHhsQndmbjN2RllyTEZwOFE&amp;single=true&amp;gid=0&amp;output=html" target="_blank">find all the gory details in the Google spreadsheet</a>. You can also view <a href="https://spreadsheets.google.com/pub?key=0Asi9t45zMwJJdGc4REdPZndfVTh6ZC1vT2FNdVZHUVE&amp;single=true&amp;gid=0&amp;output=html">the same data sorted by total quality</a> instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2010/07/project-management-and-time-tracking/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Get elements by CSS class name in javascript</title>
		<link>http://zenovations.com/blog/2010/06/get-elements-by-css-class-name-in-javascript/</link>
		<comments>http://zenovations.com/blog/2010/06/get-elements-by-css-class-name-in-javascript/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 19:59:59 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code clips]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=195</guid>
		<description><![CDATA[Dustin Diaz wrote a nice, efficient version of getElementByClassName(), which searches HTML elements and retrieves all the items with a given CSS class specified. Of course, if you use a lib like extjs, jQuery, et al, then you have no need of this. But if you&#8217;re trying to hack out a greasemonkey script or insert [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dustindiaz.com">Dustin Diaz</a> wrote a nice, efficient version of getElementByClassName(), which searches HTML elements and retrieves all the items with a given CSS class specified.</p>
<p>Of course, if you use a lib like extjs, jQuery, et al, then you have no need of this. But if you&#8217;re trying to hack out a greasemonkey script or insert some minimalist code, <a href="http://www.dustindiaz.com/getelementsbyclass/">here it is</a>.</p>
<p>And here it is, for my own archives:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p195code3'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1953"><td class="code" id="p195code3"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> getElementsByClass<span style="color: #009900;">&#40;</span>searchClass<span style="color: #339933;">,</span>node<span style="color: #339933;">,</span>tag<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> classElements <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> node <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>
		node <span style="color: #339933;">=</span> document<span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> tag <span style="color: #339933;">==</span> <span style="color: #003366; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span>
		tag <span style="color: #339933;">=</span> <span style="color: #3366CC;">'*'</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> els <span style="color: #339933;">=</span> node.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span>tag<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> elsLen <span style="color: #339933;">=</span> els.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> pattern <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> RegExp<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;(^|<span style="color: #000099; font-weight: bold;">\\</span>s)&quot;</span><span style="color: #339933;">+</span>searchClass<span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;(<span style="color: #000099; font-weight: bold;">\\</span>s|$)&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> j <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> elsLen<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> pattern.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>els<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">className</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			classElements<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> els<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			j<span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> classElements<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here&#8217;s another alternative I found on <a href="http://daniel.glazman.free.fr/weblog/">Glazblog</a>, using xpath to search the document:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p195code4'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1954"><td class="code" id="p195code4"><pre class="javascript" style="font-family:monospace;">document.<span style="color: #660066;">getElementByClassName</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>needle<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> xpathResult <span style="color: #339933;">=</span> document.<span style="color: #660066;">evaluate</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'//*[@class = needle]'</span><span style="color: #339933;">,</span> document<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #003366; font-weight: bold;">var</span> outArray <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>outArray<span style="color: #009900;">&#91;</span>outArray.<span style="color: #660066;">length</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> xpathResult.<span style="color: #660066;">iterateNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">return</span> outArray<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I don&#8217;t really know which is more efficient, though I suspect the xpath search could be taxing in very large documents. I&#8217;m positive, based on IE&#8217;s fake implementation of key/value pairs in the DOM, that they both suck in IE, even if you specify a specific tag type to search. Obviously, providing a node makes the regular expression search faster, by virtue of having less content to parse.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2010/06/get-elements-by-css-class-name-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Mail From Bash Scripts with an Attachment</title>
		<link>http://zenovations.com/blog/2010/04/sending-mail-from-bash-scripts-with-an-attachment/</link>
		<comments>http://zenovations.com/blog/2010/04/sending-mail-from-bash-scripts-with-an-attachment/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 14:06:02 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=186</guid>
		<description><![CDATA[Here is a great little tut on getting started in Bash. I&#8217;d recommend it to anyone trying to hack their way into a shell script. Here is a quick script for sending an email: ?View Code BASH#!/bin/bash &#160; # Subject of email SUBJECT=&#34;Test email with attachment from a bash script&#34; &#160; # Where to send [...]]]></description>
			<content:encoded><![CDATA[<p>Here is <a href="http://www.linux.org/lessons/advanced/x1110.html">a great little tut on getting started in Bash</a>. I&#8217;d recommend it to anyone trying to hack their way into a shell script.</p>
<p>Here is a quick script for sending an email:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p186code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1866"><td class="code" id="p186code6"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Subject of email</span>
<span style="color: #007800;">SUBJECT</span>=<span style="color: #ff0000;">&quot;Test email with attachment from a bash script&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Where to send it</span>
<span style="color: #007800;">TO_ADDRESS</span>=<span style="color: #ff0000;">&quot;your@email.com&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Where the attachment is</span>
<span style="color: #007800;">ATTACHMENT_FILE</span>=<span style="color: #ff0000;">&quot;/tmp/attachment.txt&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># For fun, let's put something into the attachment</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This goes into the file.&quot;</span>  <span style="color: #000000; font-weight: bold;">&gt;</span>  <span style="color: #007800;">$ATTACHMENT_FILE</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;This appends to the file.&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$ATTACHMENT_FILE</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># send the message</span>
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SUBJECT</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$TO_ADDRESS</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$ATTACHMENT_FILE</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2010/04/sending-mail-from-bash-scripts-with-an-attachment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Manually remove a service from windows</title>
		<link>http://zenovations.com/blog/2010/02/manually-remove-a-service-from-windows/</link>
		<comments>http://zenovations.com/blog/2010/02/manually-remove-a-service-from-windows/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:18:19 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=181</guid>
		<description><![CDATA[Today I needed to manually remove a service from windows. I found this command line approach, which worked great for me.  Be sure to use the service name and not the display name: ?View Code DOSsc delete ServiceName You can find the service name by going to Control Panel -&#62; Administrative Tools -&#62; Services, right [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to manually remove a service from windows. I found this command line approach, which worked great for me.  Be sure to use the service name and not the display name:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p181code8'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1818"><td class="code" id="p181code8"><pre class="dos" style="font-family:monospace;">sc delete ServiceName</pre></td></tr></table></div>

<p>You can find the service name by going to Control Panel -&gt; Administrative Tools -&gt; Services, right click the service and choose properties, the service name is shown there.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2010/02/manually-remove-a-service-from-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find previous occurrence of string using PHP&#8217;s strrev() and preg_match()</title>
		<link>http://zenovations.com/blog/2010/01/find-previous-occurrence-of-string-using-phps-strrev-and-preg_match/</link>
		<comments>http://zenovations.com/blog/2010/01/find-previous-occurrence-of-string-using-phps-strrev-and-preg_match/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 00:59:15 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=161</guid>
		<description><![CDATA[Today I wrote a class to iterate words in a string. One challenge was finding my way backwards in a string. Specifically, given a starting position inside the string, I wanted to find the previous &#8220;word&#8221; and return it. However, since this needs to work localized (not just a-z), and the definition of a &#8220;word&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Today I wrote a class to iterate words in a string. One challenge was finding my way backwards in a string. Specifically, given a starting position inside the string, I wanted to find the previous &#8220;word&#8221; and return it. However, since this needs to work localized (not just a-z), and the definition of a &#8220;word&#8221; is configurable, it was no simple matter of looking back for the previous space character.</p>
<p>So here is what I came up with; a method that finds the next or previous word given a starting position in the string:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p16111"><td class="code" id="p161code11"><pre class="php" style="font-family:monospace;">   <span style="color: #009933; font-style: italic;">/**
    * Abstracted method for finding the next/prev word. This method assumes that 
    * $pos is greater than zero and less than the length of $text (check before calling)
    *
    * @param string $text the string of text to find next/prev word in
    * @param int $pos the position of first character in current word
    * @param string $wordPattern the regex definition of a word without any matching parens
    * @param string $reverse looks backward instead of forward (finds last word in string)
    * @return mixed false if no more words or array( &quot;the word matched with junk&quot;, &quot;the word only&quot;)
    */</span>
   <span style="color: #000000; font-weight: bold;">private</span> static <span style="color: #000000; font-weight: bold;">function</span> nextWordMatch<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wordPattern</span><span style="color: #339933;">,</span> <span style="color: #000088;">$reverse</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// we get the substring of text, starting at the current position</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$reverse</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #666666; font-style: italic;">// in this case, we look at everything before $pos; we reverse it so that</span>
         <span style="color: #666666; font-style: italic;">// we can run a simple regex on it rather than trying to deal with craziness</span>
         <span style="color: #666666; font-style: italic;">// of looking backwards in string</span>
         <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #666666; font-style: italic;">// in this case, we look at everything after $pos</span>
         <span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// we escape the preg character just in case</span>
      <span style="color: #666666; font-style: italic;">// we add in two sets of match parens, one for the word and one for the whole match</span>
      <span style="color: #666666; font-style: italic;">// when looking backwards, we need to look from the end rather than the start</span>
      <span style="color: #000088;">$wordPattern</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/str_replace"><span style="color: #990000;">str_replace</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'\\@'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wordPattern</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;((<span style="color: #006699; font-weight: bold;">{$wordPattern}</span>)&quot;</span><span style="color: #339933;">.</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">NON_WORD_CHARS</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$reverse</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;@<span style="color: #006699; font-weight: bold;">{$pattern}</span><span style="color: #000099; font-weight: bold;">\$</span>@&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$pattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;@^<span style="color: #006699; font-weight: bold;">{$pattern}</span>@&quot;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// perform the match now and figure out what to do with it</span>
      <a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$pattern</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">3</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// remember that the first match is the raw text, so we add one</span>
         <span style="color: #666666; font-style: italic;">// we didn't find any words, so return false</span>
         <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// strip off the raw text, leaving our two matches</span>
      <span style="color: #b1b100;">return</span> <a href="http://www.php.net/array_slice"><span style="color: #990000;">array_slice</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$matches</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Here is the default value for $wordPattern and the constant NON_WORD_CHARS used in the example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code12'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p16112"><td class="code" id="p161code12"><pre class="php" style="font-family:monospace;">   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$wordPattern</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'\b[\w]+(?:[-\']\w+)*\b'</span><span style="color: #339933;">;</span>
   <span style="color: #000000; font-weight: bold;">const</span> NON_WORD_CHARS <span style="color: #339933;">=</span> <span style="color: #0000ff;">'\W*'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2010/01/find-previous-occurrence-of-string-using-phps-strrev-and-preg_match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very Cheap, Really Nice Graphics</title>
		<link>http://zenovations.com/blog/2009/08/very-cheap-really-nice-graphics/</link>
		<comments>http://zenovations.com/blog/2009/08/very-cheap-really-nice-graphics/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:11:18 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2009/08/very-cheap-really-nice-graphics/</guid>
		<description><![CDATA[It takes a bit of surfing, but you can find some really nice graphics on this site at a fraction of the usual cost: http://graphicriver.net/category/graphics/backgrounds/nature]]></description>
			<content:encoded><![CDATA[<p>It takes a bit of surfing, but you can find some really nice graphics on this site at a fraction of the usual cost: http://graphicriver.net/category/graphics/backgrounds/nature</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2009/08/very-cheap-really-nice-graphics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great Compilation of CSS Techniques</title>
		<link>http://zenovations.com/blog/2009/08/great-compilation-of-css-techniques/</link>
		<comments>http://zenovations.com/blog/2009/08/great-compilation-of-css-techniques/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 16:09:55 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2009/08/great-compilation-of-css-techniques/</guid>
		<description><![CDATA[This compilation is awesome, covering things like fluid horizontal and vertical layouts, sprites, and many other excellent techniques for CSS: http://www.smashingmagazine.com/2009/07/20/50-new-css-techniques-for-your-next-web-design/]]></description>
			<content:encoded><![CDATA[<p>This compilation is awesome, covering things like fluid horizontal and vertical layouts, sprites, and many other excellent techniques for CSS: http://www.smashingmagazine.com/2009/07/20/50-new-css-techniques-for-your-next-web-design/</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2009/08/great-compilation-of-css-techniques/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mind Mapping Software: Mindomo</title>
		<link>http://zenovations.com/blog/2009/07/mind-mapping-software-mindomo/</link>
		<comments>http://zenovations.com/blog/2009/07/mind-mapping-software-mindomo/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 15:56:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[organization]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[Technical]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=129</guid>
		<description><![CDATA[Mindomo is a great, free product for mind mapping. You can utilize it online for free to create some great looking and functional maps. There is also a pro version at the great price of $6/month, which provides a desktop version, allowing you to store the files locally and organize with folders and sharing capabilities. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mindomo.com" alt="visit mindomo site" title="visit mindomo site"><img src="http://zenovations.com/blog/wp-content/uploads/2009/07/mindomo_home_logo-300x159.gif" width="300" height="159" class="size-medium wp-image-131" /></a><a href="http://mindomo.com/comparison_chart.htm"></p>
<p>Mindomo</a> is a great, free product for <a href="http://en.wikipedia.org/wiki/Mind_map">mind mapping</a>. You can utilize it online for free to create some great looking and functional maps.</p>
<p>There is also a pro version at the great price of $6/month, which provides a desktop version, allowing you to store the files locally and organize with folders and sharing capabilities.</p>
<p>With the upcoming addition of collaboraiton, and there continual efforts to improve the product, it&#8217;s quickly becoming a great brainstorming and outlining tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2009/07/mind-mapping-software-mindomo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Valid flash in XHTML (killing &lt;embed&gt;)</title>
		<link>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/</link>
		<comments>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 21:02:05 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/?p=154</guid>
		<description><![CDATA[I wanted to validate my xhtml code for the new site design, and ran into the following fun errors from w3c: Line 25, Column 15: there is no attribute "src". Line 26, Column 18: there is no attribute "wmode". Line 27, Column 17: there is no attribute "type". Line 28, Column 18: there is no [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to <a href="http://validator.w3.org/">validate my xhtml code</a> for the new site design, and ran into the following fun errors from <a href="http://www.w3c.org">w3c</a>:<br />
<code> Line 25, Column 15: there is no attribute "src".<br />
Line 26, Column 18: there is no attribute "wmode".<br />
Line 27, Column 17: there is no attribute "type".<br />
Line 28, Column 18: there is no attribute "width".<br />
Line 28, Column 31: there is no attribute "height".<br />
Line 28, Column 38: element "embed" undefined.<br />
</code><br />
<span id="more-154"></span></p>
<p>Which was caused by this tag, my <a href="http://www.digsby.com">Digsby</a> chat widget:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code15'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p15415"><td class="code" id="p154code15"><pre class="html" style="font-family:monospace;">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;190&quot; height=&quot;250&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;190&quot; height=&quot;250&quot; src=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</pre></td></tr></table></div>

<p>A little research and <a href="http://www.alistapart.com/stories/flashsatay/">an article from A List Apart later</a>, I&#8217;ve found valid input for including flash in Transitional XHTML:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p154code16'); return false;">View Code</a> HTML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p15416"><td class="code" id="p154code16"><pre class="html" style="font-family:monospace;">&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; width=&quot;190&quot; height=&quot;250&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot;&gt;&lt;param name=&quot;src&quot; value=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot; /&gt;&lt;embed type=&quot;application/x-shockwave-flash&quot; width=&quot;190&quot; height=&quot;250&quot; src=&quot;http://w.digsby.com/dw.swf?c=lxogglyphmsfi7xc&quot;&gt;&lt;/embed&gt;&lt;/object&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2008/09/valid-flash-in-xhtml-killing-embed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dropping multiple tables in mysql (drop tables with wildcard)</title>
		<link>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/</link>
		<comments>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 17:02:03 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Web Server]]></category>

		<guid isPermaLink="false">http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/</guid>
		<description><![CDATA[I wanted to drop all mysql tables from a db that had a certain prefix, such as xx_. Well this turned out to be an adventure&#8230; The First Attempt The first solution I found was to use sed/grep sort of logic: ?View Code BASH#mysqlshow -u username -p dbname xx\\_% &#124;sed 's/[&#124;+-]//g'&#124;sed 's/[ ]*$/,/'&#62;droptables.sql (xx\\_% is [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to drop all mysql tables from a db that had a certain prefix, such as xx_. </p>
<p>Well this turned out to be an adventure&#8230;</p>
<p><strong>The First Attempt</strong></p>
<p>The first solution I found was to use sed/grep sort of logic:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10920"><td class="code" id="p109code20"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#mysqlshow -u username -p dbname xx\\_% |sed 's/[|+-]//g'|sed 's/[ ]*$/,/'&gt;droptables.sql</span></pre></td></tr></table></div>

<p>(xx\\_% is how you tell it to show tables starting with xx_)</p>
<p>This produced a semi-useful list. But I had to manually edit out the extra commas and line feeds to get a pure list, then add &#8220;DROP TABLE &#8221; to the beginning of the list. Then feed this into mysql as follows:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code21'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10921"><td class="code" id="p109code21"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#mysql -u username -p dbname &lt; droptables.sql</span></pre></td></tr></table></div>

<p>I wasn&#8217;t real happy with that answer, naturally, so I researched more&#8230;</p>
<p><strong>A Better Solution</strong></p>
<p>I came across an alternative in this command:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p109code22'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10922"><td class="code" id="p109code22"><pre class="bash" style="font-family:monospace;">mysqldump <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> <span style="color: #660033;">--add-drop-table</span> <span style="color: #660033;">--no-data</span> dbname <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^DROP.*\`xx_&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> mysql <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> dbname</pre></td></tr></table></div>

<p>(replace xx_ with the prefix you want to remove, to do all tables, try just &#8220;grep ^DROP&#8221;</p>
<p>You can test it first by cutting off the last &#8220;| mysql&#8230;&#8221; bit and see the output, which is useful for debugging, before you go blowing away your tables.</p>
]]></content:encoded>
			<wfw:commentRss>http://zenovations.com/blog/2008/08/dropping-multiple-tables-in-mysql-drop-tables-with-wildcard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
