<?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>MMcCann.com</title>
	<atom:link href="http://www.mmccann.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mmccann.com</link>
	<description>My Personal Programming Notebook</description>
	<pubDate>Fri, 07 Nov 2008 04:57:32 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Week 1 Summary of Project bluePanda</title>
		<link>http://www.mmccann.com/week-1-summary-of-project-bluepanda/</link>
		<comments>http://www.mmccann.com/week-1-summary-of-project-bluepanda/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 04:57:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[C#]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=26</guid>
		<description><![CDATA[What is the bluePanda project? The bluePanda project is a top-secret web application developed in C# and ASP.NET utilizing the dotNet 3.5.    My goal is to break down tasks into chunks and spread them out over seven weeks.  At the end of those seven weeks, I should have a fully functional, awesome web app.

Blue Panda [...]]]></description>
			<content:encoded><![CDATA[<p>What is the bluePanda project? The bluePanda project is a top-secret web application developed in C# and ASP.NET utilizing the dotNet 3.5.    My goal is to break down tasks into chunks and spread them out over seven weeks.  At the end of those seven weeks, I should have a fully functional, awesome web app.</p>
<p><span id="more-26"></span></p>
<p>Blue Panda Week 1 Review</p>
<p>I finished my week one goals tonight, which means I&#8217;m on track. yay!  This week&#8217;s goals involved developing a complete user autherization system that implemented roles, registration, password changing, password recovery, user management admin interface, and full sitemap integration.  Other tasks included developing a set of nested master page templates, integrating the sitemap with roles autherization, and developing a structural stylesheet.</p>
<p>Thoughts:  This was insane.  I hit the normal learning curve that anyone hits with a new language, but overall this would have taken much, much longer and been less featureful and flexible in PHP.  Everything feels cleaner and less hackish than it did in PHP, I tend to believe this is because C# is OOP from the ground up, where as PHP has OOP as a half-hearted option.</p>
<p>What&#8217;s up in week 2?</p>
<p>Week two will be a lot of fun for nerdiness.  I&#8217;ll start building out some of the &#8220;guts.&#8221;  I&#8217;ll be utilizing normal OOP concepts.  The big stuff I&#8217;ll be using this week are abstract classes, interfaces, datagrids, repeaters, and building out a full DAL to support an n-tiered approach.  I&#8217;ll also be diving into using a few basic ajax controls, mainly the update panel. Photo uploading, image resizing, and storage are also probably going to happen in week 2 if things go as planned.</p>
<p>Week 2 is really a week of software engineering with some implementation thrown in.  Week 3 &amp; 4 will be more implementation.  Week 5 will integrate with facebook.  Week 6 will involve report tools and dynamic image generation.  Week 7 will involve building my own classes revolving around the provider pattern and implementing those classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/week-1-summary-of-project-bluepanda/feed/</wfw:commentRss>
		</item>
		<item>
		<title>vbscript querystring merging functions</title>
		<link>http://www.mmccann.com/vbscript-querystring-merging-functions/</link>
		<comments>http://www.mmccann.com/vbscript-querystring-merging-functions/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 04:11:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[vbscript]]></category>

		<category><![CDATA[automatic link generation]]></category>

		<category><![CDATA[maintaining legacy code]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=25</guid>
		<description><![CDATA[Here&#8217;s a couple of functions (forgive the lack of OOP, I know it should be)
that will take a querystring in as an arguement and merge them with the existing
querystring.  Useful in some cases for building links.


function rebuildQueryString(strArgs)
  ''Takes a querystring, returns it merged into the current querystring
  ''assumes that the querystring fed into [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a couple of functions (forgive the lack of OOP, I know it should be)<br />
that will take a querystring in as an arguement and merge them with the existing<br />
querystring.  Useful in some cases for building links.</p>
<p><span id="more-25"></span></p>

<div class="wp_syntax"><div class="code"><pre>function rebuildQueryString(strArgs)
  ''Takes a querystring, returns it merged into the current querystring
  ''assumes that the querystring fed into the function overrides the qs found 
  ''in the current url ~mmccann nov 08
  ''THIS IS THE FUNCTION YOU SHOULD BE ACCESSING.
  rebuildQueryString = constructQueryString(querystringStrToArray(strArgs))
end function
&nbsp;
&nbsp;
function querystringStrToArray(strArgs)
  ''Converts a string of format &quot;key=val&amp;key2=val2&quot; to a 2D array
   Dim arrArgs 
   arrArgs = array(array(&quot;d&quot;,&quot;d&quot;)) 
   strArgs = replace(strArgs, &quot;?&quot;, &quot;&quot;)
   arrKVPairs = split(strArgs, &quot;&amp;&quot;)
   for each pair in arrKVPairs
       if(trim(pair) &lt;&gt; empty) then
        kvPair = split(pair, &quot;=&quot;)
          if ((kvPair(0) &lt;&gt; empty) AND (kvPair(1) &lt;&gt; empty)) then
           redim preserve arrArgs(UBound(arrArgs)+1)
           arrArgs(UBound(arrArgs)) = array(kvPair(0), kvPair(1))
          end if 
       end if   
   next
   querystringStrToArray = arrArgs
end function
&nbsp;
function constructQueryString(arrArgs)
'' Function combines the key-value pairs supplied in a 2d array (arrArgs) with the current
'' querystring in order to generate a new combined querystring.  Always favors the user-supplied
'' arguements over those found in the querystring.
'' ~mmccann Nov 2008
    strQSDelimiter = &quot;&amp;&quot;
    strQueryString = &quot;&quot;
    Dim objQueryString
    set objQueryString = CreateObject(&quot;Scripting.Dictionary&quot;)
&nbsp;
    for each i in arrArgs
        if ((i(0) &lt;&gt; empty) AND (i(1) &lt;&gt; empty)) then
          objQueryString.Add i(0), i(1)
        end if  
    next
&nbsp;
    for  i = 1 to  Request.QueryString.count() 
     if objQueryString.Exists(Request.QueryString.key(i)) then 'Test for uniqueness, assume user-supplied always more important
        '&lt;!-- non-fatal navigation error, key already exists. Moving on. --&gt;
     else   
        objQueryString.Add Request.QueryString.key(i), Request.QueryString.item(i) 
     end if   
    next
    for  each i in objQueryString.keys
        strQueryString = strQSDelimiter + i + &quot;=&quot; + objQueryString.item(i)
    next
    if (left(strQueryString, 1) = &quot;&amp;&quot;) then
      strQueryString = right(strQueryString, Len(strQueryString) - 1 )
    end if 
    constructQueryString = strQueryString 
end function</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/vbscript-querystring-merging-functions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Code Smells</title>
		<link>http://www.mmccann.com/code-smells/</link>
		<comments>http://www.mmccann.com/code-smells/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 02:23:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[bad programming]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[code smells]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=24</guid>
		<description><![CDATA[You know, I started a new job recently. I&#8217;m &#8220;moving on up&#8221; to the C#/ASP.NET world and I&#8217;m really enjoying it a lot more than programming in PHP. Which is not to say PHP is a bad language, but PHP&#8217;s object orientation is a horrific add-on that never felt natural when you compare it to [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: x-small;">You know, I started a new job recently. I&#8217;m &#8220;moving on up&#8221; to the C#/ASP.NET world and I&#8217;m really enjoying it a lot more than programming in PHP. Which is not to say PHP is a bad language, but PHP&#8217;s object orientation is a horrific add-on that never felt natural when you compare it to Java or even C++. Now that I&#8217;m working a little in C#, it feels like I&#8217;m coming home again. I&#8217;m still learning a lot about what .NET 3.5 has to offer, but I really like what I&#8217;m seeing.</p>
<p><span id="more-24"></span></p>
<p>Now that you&#8217;re caught up with my life, I want to share with you a little about some programming culture I recently picked up. Its called Code Smells, and its a rule of thumb kind of thing. It isn&#8217;t locked in stone, but these are some signs that the code you&#8217;re looking at needs to be rewritten. (Shamelessly lifted from Wikipedia)</p>
<ul>
<li>Duplicate code: identical or very similar code exists in more than one location.</li>
<li>Large method: a method, function, or procedure that has grown too large.</li>
<li>Large class: a class that has grown too large, see God object.</li>
<li>Feature envy: a class that uses methods of another class excessively.</li>
<li>Inappropriate intimacy: a class that has dependencies on implementation details of another class.</li>
<li>Refused bequest: a class that overrides a method of a base class in such a way that the contract of the base class is not honored by derived class. See Liskov substitution principle.</li>
<li>Lazy class: a class that does too little.</li>
<li>Duplicated method: a method, function, or procedure that is very similar to another.</li>
<li>Contrived Complexity: forced usage of overly complicated design patterns where simpler design would suffice.</li>
</ul>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/code-smells/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Listing Columns in SQL Server</title>
		<link>http://www.mmccann.com/listing-columns-in-sql-server/</link>
		<comments>http://www.mmccann.com/listing-columns-in-sql-server/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 00:00:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[SQL Server]]></category>

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

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=23</guid>
		<description><![CDATA[Here&#8217;s a quick way to list columns in a table using SQL Server.
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = &#8216;YOUR_TABLE_NAME&#8217;;
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick way to list columns in a table using SQL Server.</p>
<p>SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.Columns where TABLE_NAME = &#8216;YOUR_TABLE_NAME&#8217;;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/listing-columns-in-sql-server/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More blogging excuses, and back to a regular schedule</title>
		<link>http://www.mmccann.com/more-blogging-excuses-and-back-to-a-regular-schedule/</link>
		<comments>http://www.mmccann.com/more-blogging-excuses-and-back-to-a-regular-schedule/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 21:38:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://www.mmccann.com/?p=22</guid>
		<description><![CDATA[I just wanted to apologize to my hundred or so readers that I haven&#8217;t posted anything lately. I&#8217;ve got about six entries written on various PM/BA topics, then I&#8217;m going to start posting regular notes on Microsoft SQL Server.

I haven&#8217;t touched SQL Server in a couple of years since 90% of my database work is [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to apologize to my hundred or so readers that I haven&#8217;t posted anything lately. I&#8217;ve got about six entries written on various PM/BA topics, then I&#8217;m going to start posting regular notes on Microsoft SQL Server.</p>
<p><span id="more-22"></span></p>
<p>I haven&#8217;t touched SQL Server in a couple of years since 90% of my database work is mySQL at the Tennessean. However, most of the career paths open to me appear to use SQL Server at some level, so I&#8217;m going to begin dedicating myself to relearning and brushing up on the SQL Server specifics through pursuit of some industry certifications and take some great blog-worthy notes while at I&#8217;m it.</p>
<p>Now for the excuses&#8230;<br />
I&#8217;ve a had a crazy couple of weeks that have made it nearly impossible to post.  The first reason is working some crazy long weeks at the work&#8230;I was racking up between 20 and 30 hours overtime a week for a while.  The second reason is that my home computer (a laptop), broke and required some creative &lt;a href=&#8221;http://www.epemag.wimborne.co.uk/solderfaq.htm&#8221;&gt;soldering&lt;/a&gt; to fix.  Lastly,  and most importantly (and sadly), my Papaw died suddenly and unexpectedly.</p>
<p>Papaw was very close to me, and its probably his fault I got interested in the technical stuff. He  was very smart, self-educated, highly technical, and hardworking man.  He was also very soft spoken,but strong-willed and moral.  I hope live up to his memory and legacy.</p>
<p>In a nutshell I had a death in the family, a broken computer, and crazy overtime and all of these  ended up in me putting blogging on the back burner.  Things are starting to settle down, so I should be back to blogging a couple times a week now.</p>
<p>Thanks for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/more-blogging-excuses-and-back-to-a-regular-schedule/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This is pretty much my dream car</title>
		<link>http://www.mmccann.com/this-is-pretty-much-my-dream-car/</link>
		<comments>http://www.mmccann.com/this-is-pretty-much-my-dream-car/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 03:24:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[baja bug]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=21</guid>
		<description><![CDATA[I took a vote, and everyone who posts to this blog agreed&#8230;Its ok for me to post the occasional personal entry as long as it doesn&#8217;t get overdone.  So&#8230;I wanted to mention that my dream car is up for sale on craigslist in Nashville (Link).

I admit it, I&#8217;m a cheap dreamer.  I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>I took a vote, and everyone who posts to this blog agreed&#8230;Its ok for me to post the occasional personal entry as long as it doesn&#8217;t get overdone.  So&#8230;I wanted to mention that my dream car is up for sale on craigslist in Nashville (<a href="http://nashville.craigslist.org/car/750482687.html">Link</a>).</p>
<p><span id="more-21"></span></p>
<p>I admit it, I&#8217;m a cheap dreamer.  I don&#8217;t aspire to the finer things in life like I should&#8230;I just want to be secure in life and have cool projects to work on.  As far as cars go,  I&#8217;ve always wanted these three vehicles - a DeLorean, a `57 Cadillac Ambulance, and a Baja Bug.   DeLoreans are just cool, the Ambulance I want for the nerdiest of reasons, and the Baja Bug I want as a daily driver.</p>
<p>As fate would have it, there&#8217;s a Baja Bug for sale as I already mentioned.  Here&#8217;s a list of reasons why I like it, followed by the reason I haven&#8217;t snatched it up yet.</p>
<p>1) Its affordable - For cars, $4000 isn&#8217;t really a lot of cash.</p>
<p>2) Its affordable to drive, Baja Bugs with stock engines get pretty good milage.</p>
<p>3) Its unique.  You don&#8217;t see to many of them, and its almost required that you personalize your Baja in paint and bolt-ons.  A vanilla Baja Bug paint job is unheard of.</p>
<p>4) It can offroad and out perform a jeep in almost every case, and for a fraction of the cost.</p>
<p>5) Its easy to repair and tinker with.  Parts are cheap, and there&#8217;s so little that can go wrong that even very novice mechanics like myself can usually fix it.  Air-cooled engines for the win.</p>
<p>6) This particular Baja needs a better Baja front end and suspension &#8212; I can totally do this, which would satisfy my need to tinker with after I got it.  I&#8217;d also do some electrical work because I&#8217;m actually good at that, but that&#8217;s secondary (Don&#8217;t you think it would look cooler with a whip antenna?).</p>
<p>7) With a little love, they can go on living forever.  Which is great because that&#8217;s what I intend to do (live forever <img src='http://www.mmccann.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<p>Now for the reason I haven&#8217;t bought it&#8230;</p>
<p>I have truck that&#8217;s ok (even if it does guzzle gas <img src='http://www.mmccann.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ) and I have student loans that are more important than toys.  I hate being responsible, but its very important that I get them paid off as quickly as possible.  Besides, by the time they&#8217;re actually paid off the Chevy Volt will probably be on the market and I can buy a pure electric car anyway.</p>
<p>What&#8217;s coming up on MMcCann.com this week? I&#8217;ve got two entries scheduled. One is really long and about Product Requirements Documents (PRDs), the other is about taking the Risk Management stuff I learned from ROTC and applying it to civilian management/software development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/this-is-pretty-much-my-dream-car/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP function to generate n-grams</title>
		<link>http://www.mmccann.com/php-function-to-generate-n-grams/</link>
		<comments>http://www.mmccann.com/php-function-to-generate-n-grams/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 12:32:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[n-gram]]></category>

		<guid isPermaLink="false">http://www.mmccann.com/?p=17</guid>
		<description><![CDATA[
Here&#8217;s a code snippet fresh from my PHP n-gram search class.  The $str arguement
expects a string, $size is the length of the desired n-gram, and $clean lets us
opt-out of some &#8220;clean-up&#8221; where duplicate n-grams are removed, and non-alphanumeric
characters are removed from the string.  It both returns an array and sets a class value.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
&#60; [...]]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s a code snippet fresh from my PHP n-gram search class.  The $str arguement<br />
expects a string, $size is the length of the desired n-gram, and $clean lets us<br />
opt-out of some &#8220;clean-up&#8221; where duplicate n-grams are removed, and non-alphanumeric<br />
characters are removed from the string.  It both returns an array and sets a class value.
</p>
<p><span id="more-17"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="php"><span style="color: #339933;">&lt;</span> ?
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> get_ngrams<span style="color: #009900;">&#40;</span><span style="color: #000033;">$str</span><span style="color: #339933;">,</span> <span style="color: #000033;">$size</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #000033;">$clean</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#123;</span>
	  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$clean</span><span style="color: #009900;">&#41;</span>
	  <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$str</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/[^A-Za-z0-9]/&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000033;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$str</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000033;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	  <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$potential_ngram</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$str</span><span style="color: #339933;">,</span> <span style="color: #000033;">$i</span><span style="color: #339933;">,</span> <span style="color: #000033;">$size</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$potential_ngram</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
		  <span style="color: #009900;">&#123;</span>
		  	<span style="color: #000033;">$arrNgrams</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$potential_ngram</span><span style="color: #339933;">;</span>
		  <span style="color: #009900;">&#125;</span>
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$clean</span><span style="color: #009900;">&#41;</span>
	  <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$arrNgrams</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_unique</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$arrNgrams</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	  <span style="color: #009900;">&#125;</span>
	  <span style="color: #000033;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">arrNgrams</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$arrNgrams</span><span style="color: #339933;">;</span>
	  <span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$arrNgrams</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/php-function-to-generate-n-grams/feed/</wfw:commentRss>
		</item>
		<item>
		<title>After Action Reports for Projects&#8230;Going Civilian the Army Way</title>
		<link>http://www.mmccann.com/after-action-reports-for-projectsgoing-civilian-the-army-way/</link>
		<comments>http://www.mmccann.com/after-action-reports-for-projectsgoing-civilian-the-army-way/#comments</comments>
		<pubDate>Sun, 13 Jul 2008 11:07:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[The Business Side]]></category>

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

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

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

		<category><![CDATA[project management]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=18</guid>
		<description><![CDATA[I learned a lot of useful project management techniques in hanging out with the  Army ROTC folks.  I know some people will disagree, but I think the army actually  teaches its officers a lot of great management techniques &#8212; they&#8217;ve got to since  they&#8217;re placing 21-25 year olds in high stress [...]]]></description>
			<content:encoded><![CDATA[<p>I learned a lot of useful project management techniques in hanging out with the  Army ROTC folks.  I know some people will disagree, but I think the army actually  teaches its officers a lot of great management techniques &#8212; they&#8217;ve got to since  they&#8217;re placing 21-25 year olds in high stress leadership positions where they&#8217;re  in charge of a number of people with various skill levels, personalities, and  backgrounds.</p>
<p><span id="more-18"></span></p>
<p>One of things I try to do, usually unofficially, is to do what they called an AAR  (After Action Report) after I finish a project.  In the military world, you perform  AARs in a group setting after a mission and discuss what went right, what went wrong, what techniques and processes should be kept, and how to improve in the future.</p>
<p>If you&#8217;re honest and comfortable with the people you&#8217;re working with, this can be a great tool for process development and lead to smoother, better product development and launch in the future.</p>
<p>Here&#8217;s how I&#8217;ve conducted them in the past.  Get everyone in a room, and start off listing a couple of things that went right &#8212; no matter how badly the project went.  There&#8217;s a three point minimum here.  I find that starting off with positives puts everyone into a more open mindset and helps them become less upset during the next phase, negatives.</p>
<p>In the next phase, talk about things that went wrong or things that can be improved.  Spend as much time as you need here but don&#8217;t let it degrade into complaining or riding points into the ground. The goal is to find out what went wrong and how to improve it, there shouldn&#8217;t be any blame, attacking, or obsessing over any one point here.</p>
<p>Finally, go back and find a few more positive things.  Ideally, your positives should either match or exceed the negatives. It is a lot easier to spot things that went wrong than it is things that went right, so this may require some initial coaching but once people get the hang of it and see that they have a voice in improving things they really will get into it.</p>
<p>Naturally, the most important step is after the AAR meeting where you analyze what is said and figure out how to apply changes to improve the processes in the future.</p>
<p>I would also like to mention that AARs sometimes devolve into day-long affairs. Speaking from experience, don&#8217;t let this happen.  If you do, one of two things is going to happen. The first is that you&#8217;re going to get too much information and you won&#8217;t be able to make use of it all - and then people become frustrated in the long run.  The second possibility is that people become frustrated that its taking so long, tempers can flare, feelings can get hurt, and then you don&#8217;t get anything useful.  I like to keep them between an hour and hour and half at most.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/after-action-reports-for-projectsgoing-civilian-the-army-way/feed/</wfw:commentRss>
		</item>
		<item>
		<title>mimicing substr_count in mySQL</title>
		<link>http://www.mmccann.com/mimicing-substr_count-in-mysql/</link>
		<comments>http://www.mmccann.com/mimicing-substr_count-in-mysql/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 04:36:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[mySQL]]></category>

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

		<category><![CDATA[n-grams]]></category>

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

		<guid isPermaLink="false">http://www.mmccann.com/?p=16</guid>
		<description><![CDATA[I&#8217;ve been developing an n-gram based search in PHP for a secondary project at work.  For development purposes, I&#8217;ve been scoring things in PHP while I tweaked by algorithm, but now that I&#8217;m getting closer to the implementation stage of things I&#8217;m trying to push the work of scoring onto mySQL.

I was hoping mySQL [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been developing an <a href="http://en.wikipedia.org/wiki/N-gram" rel="nofollow">n-gram</a> based search in PHP for a secondary project at work.  For development purposes, I&#8217;ve been scoring things in PHP while I tweaked by algorithm, but now that I&#8217;m getting closer to the implementation stage of things I&#8217;m trying to push the work of scoring onto mySQL.</p>
<p><span id="more-16"></span></p>
<p>I was hoping mySQL had some method of counting occurrences of a string within a string, but much to my chagrin it doesn&#8217;t have this.  Luckily, Andrew Hanna posted a great custom mySQL function that does exactly this. For the sake of posterity and my own reference, I&#8217;ve posted his function below.</p>
<pre lang="SQL" lines="1">
DROP FUNCTION IF EXISTS substrCount||
CREATE FUNCTION substrCount(s VARCHAR(255), ss VARCHAR(255)) RETURNS TINYINT(3) UNSIGNED LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA
BEGIN
DECLARE count TINYINT(3) UNSIGNED;
DECLARE offset TINYINT(3) UNSIGNED;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET s = NULL;

SET count = 0;
SET offset = 1;

REPEAT
IF NOT ISNULL(s) AND offset > 0 THEN
SET offset = LOCATE(ss, s, offset);
IF offset > 0 THEN
SET count = count + 1;
SET offset = offset + 1;
END IF;
END IF;
UNTIL ISNULL(s) OR offset = 0 END REPEAT;

RETURN count;
END;
</pre>
<p>usage is this&#8230;</p>
<pre lang="SQL" lines="1">
SELECT substrCount('/this/is/a/path', '/') `count`;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/mimicing-substr_count-in-mysql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Freebie Friday: Dumping values with nice formatting on the web</title>
		<link>http://www.mmccann.com/freebie-friday-dumping-values-with-nice-formatting-on-the-web/</link>
		<comments>http://www.mmccann.com/freebie-friday-dumping-values-with-nice-formatting-on-the-web/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 12:49:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

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

		<category><![CDATA[quick hacks]]></category>

		<guid isPermaLink="false">http://www.mmccann.com/?p=15</guid>
		<description><![CDATA[
Here&#8217;s a freebie since its friday.  Print_r is a great debugging function, but it
doesn&#8217;t format well in a web browser.  I&#8217;m sure 99.999% of php coders have this already,
but if not you&#8217;ll slap yourself in the forehead for not thinking of it sooner (I know
I did, you have no idea how long I [...]]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s a freebie since its friday.  Print_r is a great debugging function, but it<br />
doesn&#8217;t format well in a web browser.  I&#8217;m sure 99.999% of php coders have this already,<br />
but if not you&#8217;ll slap yourself in the forehead for not thinking of it sooner (I know<br />
I did, you have no idea how long I coded before I thought about doing this&#8230;sad times).
</p>
<p><span id="more-15"></span></p>
<p>
The super-trick&#8230;wrap it in the pre tag. Common sense, yeah&#8230;
</p>
<p>
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">function</span> print_mm<span style="color: #009900;">&#40;</span><span style="color: #000033;">$val</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">echo</span> <span style="color: #0000ff;">'
</span</pre></td></tr></table></div>

<pre>';
  print_r($val);
  echo '</pre>
<p>&#8216;;<br />
}</p>
<p>
On a side note, I&#8217;m thinking about putting up some full classes/objects in the not<br />
to distant future.  I just need to go through them and make sure there&#8217;s no &#8220;secret&#8221;<br />
business logic in them first.  Look for the first few around the beginning of August.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mmccann.com/freebie-friday-dumping-values-with-nice-formatting-on-the-web/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
