<?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>Rex Goode</title>
	<atom:link href="http://www.rexgoode.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.rexgoode.com</link>
	<description>My work, my ideas, my faith, my life</description>
	<lastBuildDate>Wed, 06 Mar 2013 03:52:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Not Feeling Overloaded</title>
		<link>http://www.rexgoode.com/?p=533</link>
		<comments>http://www.rexgoode.com/?p=533#comments</comments>
		<pubDate>Wed, 06 Mar 2013 03:52:21 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[C and C++]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Object-Oriented Programming]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=533</guid>
		<description><![CDATA[I just completed a project for a biochemist using Java to create a tool for some analysis work. I&#8217;m being vague about the nature of the project because it&#8217;s confidential and not complete. I just wanted to celebrate a little by talking about it. I first learned object-oriented program using C++ a very long time [...]]]></description>
				<content:encoded><![CDATA[<p>I just completed a project for a biochemist using Java to create a tool for some analysis work. I&#8217;m being vague about the nature of the project because it&#8217;s confidential and not complete. I just wanted to celebrate a little by talking about it.</p>
<p>I first learned object-oriented program using C++ a very long time ago and it really appealed to me. I was self-taught. Then, one day, when working for a consulting company, I got the opportunity for my employer to pay for a week-long class in Java. I liked the way it relied on the same concepts of C++ I had come to enjoy: classes, object, and polymorphism. What it doesn&#8217;t do is operator overloading. Well, there are some other things it doesn&#8217;t do, but that&#8217;s my biggest beef.
<div style='float:right; width:200px;' >
<div id='stb-box-4323' class='stb-info_box' >See <a title="OOP’s! Did I do that?!" href="http://www.rexgoode.com/?p=289">OOP’s! Did I do that?!</a></div>
</div>
<p>I liked the term &#8220;overloading&#8221; because it sounded like the way I eat or the way I sometimes run my life.  Sad, eh? In fact, my overloading with food has caused me no end of polymorphisizing (new word I just made up). I kind of inherited this. Most people in my family I have known have gone from skinny to fat in a very short time. What I&#8217;m waiting for is the point where they got skinny again.</p>
<p>In my instance, I&#8217;m still a pretty big object. Don&#8217;t worry, I still have class.</p>
<p>So, if this post seems a little abstract, you&#8217;re catching on.</p>
<p>Let me encapsulate this post. There is a method to my madness. Object-oriented programmers will figure it out.</p>
<p>Let me just say this. I&#8217;d rather be a constructor than a destructor, anyday.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=533</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Forum Restrict</title>
		<link>http://www.rexgoode.com/?p=497</link>
		<comments>http://www.rexgoode.com/?p=497#comments</comments>
		<pubDate>Wed, 13 Jun 2012 14:39:04 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Software Engineer]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=497</guid>
		<description><![CDATA[In one screen, search for members by username, email address, or display names. With one click on the same screen, you can add or remove them from the forum.]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.rexgoode.com/wp-content/uploads/2012/06/forum_application_screen.png"><img class=" wp-image-498 alignleft" title="forum_application_screen" src="http://www.rexgoode.com/wp-content/uploads/2012/06/forum_application_screen-300x253.png" alt="Forum Application Screen" width="240" height="202" /></a>Introducing my new <a title="WordPres" href="http://www.wordpress.com" target="_blank">WordPress</a> plugin, <em>Forum Restrict</em>. made to function as a companion to the <a title="bbPress" href="http://www.bbpress.org/" target="_blank">bbPress</a> bulletin board system. It solves a problem that I have encountered in needing to restrict access to certain forums on my web sites to certain users. <span id="more-497"></span>While <em>bbPress</em> provides for the functionality to make a &#8220;private&#8221; forum. What this means is that you have to be logged in and have a certain role assigned to you on the site. It isn&#8217;t quite what I needed. I wanted a way to have a forum administrator have the functionality to mark certain forums as restricted, add and delete members of individual restricted forums, search for users to add, and allow users to make application to be admitted to a certain forum.</p>
<p>The process for doing all of that could be done in steps manually by adding new user roles, assigning them to individual users, and restricting current private users to those roles. It would have not only been too complicated for average users, but too much work for an administrator.</p>
<p>To illustrate, without <em>Forum Restrict</em>, to create a private forum and only allow certain users access to it, you would have to do the following:
<div style='float:right; width:240px;' >
<div id='stb-box-7458' class='stb-warning_box' >If you are looking for a good PHP/Javascript/MySql (and many other systems) developer, take a look at <a title="My Resume" href="http://www.rexgoode.com/se/dpresume.pdf">my resume</a>. I am available for small to large contract work. I am open to full-time employment. Let me know if you need me.</div>
</div>
<ol>
<li>Create the forum.</li>
<li>Mark it as &#8220;Private&#8221;.</li>
<li>Create a role that has access to private forums or add the capability to read private forums to existing roles. This functionality doesn&#8217;t automatically come with <em>bbPress</em>. You would have to find a plugin that does that.</li>
<li>After this much work, you still have a private forum that is restricted to certain <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">roles</a>. The problem is, all private forums are accessible by such persons, unless you create new roles and new capabilities that are forum-specific. You would have to find a way to create capabilities them that are specific to individual forums and figure out a way to tie that capability to the forum.</li>
<li>Assuming you don&#8217;t want to do step 4, which would leave it so that certain users could read private forums and all of the other users could not. It would not solve the problem of having certain users using certain forums.</li>
<li>To add to the problem, if a user wants to join a certain forum, how do they let you know? You could do the most inadvisable thing and publish your email address on your website. If you like getting slammed by spam, go ahead. You could download a plugin that has a contact form, which I do advise. That way, your address is hidden from people who want to email you from the site. Even then, it is a much more manual process to oblige these requests.</li>
<li>Once you figure out that a person wants to be admitted to private forums, you have to change their role, which is doable through their user profile record, which you, as admin, have access to do. It&#8217;s a multi-step process.</li>
</ol>
<p>With <em>Forum_Restrict</em>, you do the following:</p>
<ol>
<li>Create the forum.</li>
<li>Mark it as restricted by <em>Forum Restrict</em>.</li>
<li>A user sees the forum and an &#8220;Apply&#8221; link which takes them to a form where they enter the reason they want to join.</li>
<li>You go to the <em>Forum Restrict</em> administration page and will see all of the applications to join the forum in one list. With one click, you make them a member of the forum or deny their application.</li>
</ol>
<p>You can also:</p>
<p style="padding-left: 30px;">In one screen, search for members by username, email address, or display names. With one click on the same screen, you can add or remove them from the forum.</p>
<p>Up to now, all <em>WordPress</em> plugins I have written have had very specific uses for my web sites, not applicable to other web sites. Because of this, I haven&#8217;t yet figured out how to make my plugin available on the <em>WordPress</em> plugin directory. While I work on that, let me know if you want to try it out. You will need to have a <em>WordPress</em> web site with the <em>bbPress</em> plugin installed and activated. Use the &#8220;Contact Us&#8221; link on the web page to get a copy. Let me know if you want it in a zip file or a tar file. Your feedback is welcome.</p>
<p>In addition to uploading it to the <em>WordPress</em>  plugin directory, I will be writing some documentation which will guide you through the screens (all two of them) and the small changes to existing <em>bbPress</em> screens (all two of them). I will also create a forum here for dealing with feedback and problems. Look for both.</p>
<h3>Some of the Technical Info</h3>
<p>See my article, <a title="True To Form" href="http://www.rexgoode.com/?p=441" target="_blank">True to Form</a>, on this site for my description of using Ajax. The entire administration screen for <em>Forum Restrict</em> is based on the Ajax technology as described in that article. A lot happens without ever reloading the page. You move people around and the changes you make show up fairly instantly.</p>
<p>I made use of several <em>WordPress</em> and <em>bbPress</em> filter and action hooks to insert my functionality into existing screens and forms.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=497</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>True to Form</title>
		<link>http://www.rexgoode.com/?p=441</link>
		<comments>http://www.rexgoode.com/?p=441#comments</comments>
		<pubDate>Mon, 04 Jun 2012 20:12:01 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=441</guid>
		<description><![CDATA[My intention here is not to teach XML. Basically, the first line of this file specifies that it is, indeed, an XML document. Within the document are different levels of tag. In order for it to be well-formed, it must have a single, all-encompassing, top element, which I just happened to call, "AJ". Call it anything if you are writing an XML document. All it has to do is encompass all other elements within it.]]></description>
				<content:encoded><![CDATA[<div id='stb-box-6684' class='stb-warning_box' >This post is for web developers who are familiar with the HTML, XML, and Javasript languages. Some of my usual readers won&#8217;t be interested. Feel free to read it anyway, but I didn&#8217;t make a big effort to start from the basics.</div>
<p><a class="alignleft" href="http://click.linksynergy.com/fs-bin/click?id=FyTGOMKjX6A&amp;offerid=243780.417931&amp;type=2&amp;subid=0"><img src="http://www.officedepot.com/pictures/us/od/sk/md/417931_sk_md.jpg" alt="" border="0" /></a><img class="alignleft" src="http://ad.linksynergy.com/fs-bin/show?id=FyTGOMKjX6A&amp;bids=243780.417931&amp;type=2&amp;subid=0" alt="" width="1" height="1" border="0" />Of Ajax, epic character in the Trojan War, it was said by William Shakespeare in the voice of Agamemnon, comparing Ajax to Achilles, &#8220;You are as strong, as valiant, as wise, no less noble, much more gentle, and altogether more tractable (<em>Troilus and Cressida</em>).&#8221; I beg to differ.<span id="more-441"></span>I am not talking about the old, standby cleaning products that people use. It&#8217;s a good brand. I&#8217;m also not talking about the hero of antiquity. I&#8217;m talking about a web development system called AJAX. It stands for Asynchronous Javascript and XML.</p>
<p>Using Agamemnon&#8217;s list, it is strong, perhaps violent, wise, and noble. I did not, however, find it to be gentle and least of all, <a href="http://dictionary.reference.com/browse/tractable">tractable</a>. <em>Random House Dictionary </em>says that &#8220;tractable&#8221; means &#8220;easily managed or controlled.&#8221; That has not been my experience with it.</p>
<p>I refer to AJAX as a development system because it is based in Javascript, but also employs XML (eXtensible Markup Language) and other web development technologies. Since it isn&#8217;t my purpose to explain all of this to non-techs, I&#8217;ll refrain from too much bringing all of my friends up to speed on what some of these things mean.</p>
<p>What I want to do is describe a simple example that I came up with, one that goes a little farther than other examples I have seen. Most AJAX examples you find on the web are about using it to manipulate just one element on a web page. For the needs of a WordPress plugin I have been developing, I needed it to manipulate four different web elements with one Javascript script.</p>
<p>It was trying to accomplish this that I encountered the AJAX intractability. Since I worked my AJAXity using three languages, I will address the intractability issue on three fronts: HTML, XML, and XML.</p>
<h3>HTML, XML, and HTML as if it were XML</h3>
<p>When you write HTML code, you have tags in angle brackets (&lt;&gt;) along with attributes. For example:</p>
<div style='float:left; width:250px;' >
<div id='stb-box-5858' class='stb-custom_box' style="background-color: #eeeeee; background-image: url(none); min-height: 20px; padding-left: 5px; ">&lt;p align=center&gt;Some text&lt;/p&gt;</div>
</div>
<p>The HTML tag, P, for paragraph, has several possible attributes, including &#8216;align&#8217;. If you are just coding web page in HTML, this is acceptable. To use good form, however, real programmers, supposedly, put the attribute value in single or double quotes, as in:</p>
<div style='float:right; width:250px;' >
<div id='stb-box-7646' class='stb-custom_box' style="background-color: #eeeeee; background-image: url(none); min-height: 20px; padding-left: 5px; ">&lt;p align=&#8217;center&#8217;&gt;Some text&lt;/p&gt;</div>
</div>
<p>Plain old HTML doesn&#8217;t mind if you leave out the quotes, as long as the attribute value contains no white space. Not so with trying to output HTML through AJAX as if it were XML. That&#8217;s because XML is unforgiving about such a lack in good form.</p>
<p>In fact, if you have any such lapse in form, such as leaving an attribute value unquoted, your attempt AJAXing will fail. You can get away with it if you&#8217;re trying to parse HTML as text instead of as XML. I know, it&#8217;s confusing.</p>
<h3>Javascript</h3>
<p>As unforgiving as XML is, Javascript is merciless when it comes to coding errors. Generally, without putting a ton of error handling into it, when it fails, it just fails and doesn&#8217;t tell you why. You make a change, and suddenly, what was working fine before isn&#8217;t working anymore and the reason is completely invisible.</p>
<p>Javascript has error-handling capabilities. I prefer the newer way, which is with the try-catch methodology. Basically, that means that you try something (a line or lines of code) within a <em>try</em> block. If any line of code within the <em>try</em> block has an error, it will throw an error that the <em>catch</em> block will catch and process. (See the example.)</p>
<div style='float:right; width:260px;' >
<div id='stb-box-2861' class='stb-custom_box' style="background-color: #eeeeee; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<pre>try {
   document.write('hello');
} catch(err) {
   alert('Cannot write hello.');
}</pre>
</div>
</div>
<p>There are no samples of this in the Javascript for the example I am presenting, so I can keep the code reduced. Just know that it&#8217;s good to put it in your code, especially if it mysteriously stops working (and it will).</p>
<h2>Why Use AJAX?</h2>
<p>The beauty of AJAX is that you can manipulate portions of a web page without reloading the entire page. You can define a block of a web page with an id and then use AJAX technology to change just that portion of the page. In the old days, if you wanted to change a section of a web page, you had to reload the whole thing. You could get away with something similar using <em>frames</em> or <em>iframes</em>, but they are more for putting things in a fixed size on your screen. With them, you are really loading a whole different page that shows in the same window as the main page.</p>
<p>Many times in my long history of doing web development, the idea of changing a section of the page without reloading the whole page would have worked well and simplified my work. I have known about AJAX for awhile, but keeping up with other projects has kept me away from learning it.</p>
<p>This last week, I took the time and want to share what I learned.</p>
<h2>The Example</h2>
<p>This example shows a page with a button that simply says, &#8220;Do It&#8221;. <a href="http://www.rexgoode.com/wp-content/uploads/2012/06/doit.png"><img class="alignleft size-full wp-image-457" style="border: 1px solid black; margin: 4px;" title="doit" src="http://www.rexgoode.com/wp-content/uploads/2012/06/doit.png" alt="" width="82" height="67" /></a></p>
<p>If you click on that button, without reloading the entire page, you will see two new page elements appear. <a href="http://www.rexgoode.com/wp-content/uploads/2012/06/doit_done.png"><img class="alignright  wp-image-458" style="border: 1px solid black; margin: 4px;" title="doit_done" src="http://www.rexgoode.com/wp-content/uploads/2012/06/doit_done.png" alt="" width="351" height="139" /></a></p>
<p>&nbsp;</p>
<p>Without AJAX, pushing the button would have had to go back to the server and reload the whole page. For something as small and insignificant as this, maybe it isn&#8217;t such a big deal. For a larger page with lots of other things going on, this has many advantages.</p>
<h3>What It Did, Internally Speaking</h3>
<p>The web page has four main elements in the body section—two headers, a paragraph section for errors, and the Do It button. Everything but the button is empty.</p>
<p>When a user clicks the button, a script written in Javascript is called that opens a request to an XML document. When the request is filled, the same Javascript catches it, receives the content of the XML document and parses one part into the first header and the other part of the other header.</p>
<p>If there is an error in the XML document (remembering that XML is intractable), information about the error is loaded into the error section of the page.</p>
<h3>The HTML File</h3>
<p>The HTML file, test.html, includes the Javascript and the HTML code.</p>
<div id='stb-box-7203' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<pre>&lt;html&gt;&lt;head&gt;&lt;title&gt;Ajax Test&lt;/title&gt;&lt;/head&gt;
&lt;script type="text/javascript"&gt;
function ajtest() {
   var ajaxRequest = new XMLHttpRequest();
   ajaxRequest.overrideMimeType("text/xml");

   ajaxRequest.onreadystatechange=function() {
      if (
         ajaxRequest.readyState==4 &amp;&amp;
         ajaxRequest.status==200 ) {
         xmlDoc = ajaxRequest.responseXML;
         a = xmlDoc.getElementsByTagName("*");
         if (a.length == 2) {
            if (a[0].nodeName == 'parsererror') {
               txt = "&lt;pre&gt;";
               for(i=0; i&lt;a.length; i++) {
                  txt = txt +
                        a[i].nodeName + '\n';
                  txt = txt +
                        a[i].textContent + '\n';
               }
               txt = txt + "&lt;/pre&gt;\n";
               document.getElementById(
                    'AJAX_Error').innerHTML = txt;
            }
         }
         x=xmlDoc.getElementsByTagName("DIVPAGE");
         for(i=0; i&lt;x.length; i++) {
            divname = x[i].attributes.getNamedItem(
                      'divname').value;
            switch(divname) {
               case "ONE":
                  txt = x[i].textContent;
                  break;
               case "TWO":
                  txt = x[i].textContent;
                  break;
               default:
                  txt = "";
                  break;
            }
            document.getElementById(
                divname).innerHTML=txt;
         }
      }
   }
   ajaxRequest.open("POST", "test.xml", true);
   ajaxRequest.setRequestHeader(
          "Content-Type", "text/xml");
   ajaxRequest.send();
}
&lt;/script&gt;
&lt;body&gt;
&lt;h1 id="ONE"&gt;&lt;/h1&gt;
&lt;h2 id="TWO"&gt;&lt;/h2&gt;
&lt;p id="AJAX_Error"&gt;&lt;/p&gt;
&lt;button onClick="ajtest();"&gt;Do It&lt;/button&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>
<p>Within the <em>body</em> tag is the whole of the page as seen by the user. There is an <em>h1</em> header with the ID of &#8220;ONE&#8221;, the <em>h2</em> header with the ID of &#8220;TWO&#8221;, a paragraph for displaying any errors that happen, and the button definition, which includes a Javascript event handler to be called when the user clicks on the button.</p>
<div style='float:right; width:290px;' >
<div id='stb-box-8385' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<p><span style="font-size: xx-small;">&lt;body&gt; &lt;h1 id=&#8221;ONE&#8221;&gt;&lt;/h1&gt; &lt;h2 id=&#8221;TWO&#8221;&gt;&lt;/h2&gt; &lt;p id=&#8221;AJAX_Error&#8221;&gt;&lt;/p&gt; &lt;button onClick=&#8221;ajtest();&#8221;&gt;Do It&lt;/button&gt; &lt;/body&gt;</span></p>
</div>
</div>
<p>Since the <em>h1</em>, <em>h2</em>, and <em>p</em> elements are all empty, the user sees only the button. Once a user clicks on &#8220;Do It&#8221;, the script contained within the <em>&lt;SCRIPT&gt;</em> start and end tags is called. The first thing it does is create an AJAX request object and specifies that it is expecting an XML document in return.</p>
<p>This second step was never mentioned as necessary in all of the examples I found, but I couldn&#8217;t get it to work without it.</p>
<div style='float:left; width:286px;' >
<div id='stb-box-4311' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<p><span style="font-size: xx-small;">var ajaxRequest = new XMLHttpRequest(); ajaxRequest.overrideMimeType(&#8220;text/xml&#8221;);</span></p>
</div>
</div>
<p>The next thing it does is create a function that will be called when the information is returned. This constitutes the bulk of the Javascript up to, but not including, the call to the <em>ajaxRequest.open()</em> function.</p>
<div style='float:right; width:320px;' >
<div id='stb-box-8288' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 10px 10px 10px 4px; ">
<p><span style="font-size: xx-small;">ajaxRequest.open(&#8220;POST&#8221;, &#8220;test.xml&#8221;, true); ajaxRequest.setRequestHeader( &#8220;Content-Type&#8221;, &#8220;text/xml&#8221;); ajaxRequest.send();</span></p>
</div>
</div>
<p>The <em>open() </em>function takes, as its first argument, the request method, which can be &#8220;GET&#8221; or &#8220;POST&#8221;. Get is somewhat limited in the kind and size of the information you can send via the <em>open() </em>function. Since this script isn&#8217;t sending any information, it doesn&#8217;t really much matter. The name of the document I am requesting is &#8216;text.xml&#8217;. It could have easily been to something written in any number of web development and scripting languages such as PHP, ASP, or HTML.</p>
<p>I chose XML because if you send it to a script that returns something other than XML, you have to work harder to parse it in the handler function. Javascript comes with some pretty useful XML parsing tools that I wanted to use.</p>
<p>I don&#8217;t think I needed to, but I sent a header specifying an XML document. Given the intractability of AJAX, I just left it in once I got it working. Someday I will figure out if I needed it or not, and why.</p>
<p>Finally, now that that the request is empty, it is sent to the server. When it is ready with a response, the function declared in the <em>ajaxRequest.onreadystatechange</em> attribute handles the response. The first thing it does once the response is ready is put the XML document into a Javascript variable that I can parse.</p>
<div style='float:right; width:260px;' >
<div id='stb-box-840' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; "><span style="font-size: xx-small;">xmlDoc = ajaxRequest.responseXML;</span></div>
</div>
<p>Now, you don&#8217;t have to put the information that you retrieve directly onto the page. That was one of the first things I didn&#8217;t understand by reading all of the examples I could find online.</p>
<p>The other thing I didn&#8217;t understand, but now I do, is that you can send different parts of the response to different parts of the web page. You can take different parts of it and use the data to create and present something entirely different on the web page. However, to keep it simple for this article, I&#8217;m just going to parse the data and send it out to the two headers (<em>h1</em> and <em>h2</em>) directly.</p>
<p>If there is an error in the XML document, I&#8217;m going to send information about it to the error section of the page. The error handling is contained in the following section of code. Basically, if the name of the first element of the document is &#8220;parsererror&#8221;, you know something is wrong with the XML code. Remember, it is intractable.</p>
<div style='float:right; width:294px;' >
<div id='stb-box-520' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 10px 10px 10px 10px; ">
<p><span style="font-size: xx-small;">a = xmlDoc.getElementsByTagName(&#8220;*&#8221;); if (a.length == 2) { if (a[0].nodeName == &#8216;parsererror&#8217;) { txt = &#8220;&lt;pre&gt;&#8221;; for(i=0; i&lt;a.length; i++) { txt = txt + a[i].nodeName + &#8216;\n&#8217;; txt = txt + a[i].textContent + &#8216;\n&#8217;; } txt = txt + &#8220;&lt;/pre&gt;\n&#8221;; document.getElementById( &#8216;AJAX_Error&#8217;).innerHTML = txt; } }</span></p>
</div>
</div>
<p>The terminology that XML uses for XML code that is without errors is &#8220;well-formed&#8221;. XML code that is not well-formed is rejected by AJAX functionality. Putting this code in the Javascript ensures that I will know when I have XML on my hands that is not well-formed. The error section of the page will give pretty good information on the well-formedness of my XML document.</p>
<p>Two lines of this code deserve special attention:</p>
<div style='float:left; width:310px;' >
<div id='stb-box-5071' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<p><span style="font-size: xx-small;">a = xmlDoc.getElementsByTagName(&#8220;*&#8221;); <em>and </em> document.getElementById( &#8216;AJAX_Error&#8217;).innerHTML = txt; </span></p>
</div>
</div>
<p>The first reads into an array (<em>a</em>), all of the elements of the XML document. The &#8220;*&#8221; in the function call indicates that I want all of them. When you get a parser error, you get two elements back and the first one is named &#8220;parsererror&#8221;.</p>
<p>The second line of code in the box above is the heart of the magic of AJAX. It finds the element on the web page, in this case, the paragraph (<em>p</em>) element that is identified as &#8220;AJAX_Error&#8221; and places into it whatever I want. What I want to place into it is the information I gleaned from the parser error generated by my misbehaving, or unwell-formed, XML.</p>
<p>You will see this <em>getElementById </em>thing later in the script when I go to fill up the two headers.</p>
<h3>The XML Document</h3>
<p>Before I show you this, let&#8217;s look at the content of the file, &#8216;test.xml&#8217;.</p>
<div style='float:right; width:440px;' >
<div id='stb-box-868' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; ">
<p><span style="font-size: xx-small;">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;ISO-8859-1&#8243;?&gt; &lt;AJ&gt; &lt;DIVPAGE divname=&#8217;ONE&#8217;&gt;One is the loneliest number&lt;/DIVPAGE&gt; &lt;DIVPAGE divname=&#8217;TWO&#8217;&gt;Two can be as sad as one&lt;/DIVPAGE&gt; &lt;/AJ&gt;</span></p>
</div>
</div>
<p>My intention here is not to teach XML. Basically, the first line of this file specifies that it is, indeed, an XML document. Within the document are different levels of tag. In order for it to be well-formed, it must have a single, all-encompassing, top element, which I just happened to call, &#8220;AJ&#8221;. Call it anything if you are writing an XML document. All it has to do is encompass all other elements within it.</p>
<p>This simple XML document has only two elements, both named the same. Each one has a single attribute named &#8220;divname&#8221;. The value of <em>divname</em> for the first element is &#8220;ONE&#8221;, corresponding to the <em>h1</em> tag in the HTML document with an ID of &#8220;ONE&#8221;. The second element has a <em>divname</em> value of &#8220;TWO&#8221; corresponding to the ID of the <em>h2</em> element in the HTML document.</p>
<p>See those two sections of the two files side-by-side:</p>
<div style='float:left; width:140px;' >
<div id='stb-box-6166' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 10px 4px 10px 4px; "><span style="font-size: xx-small;">&lt;h1 id=&#8221;ONE&#8221;&gt;&lt;/h1&gt;<br />
&lt;h2 id=&#8221;TWO&#8221;&gt;&lt;/h2&gt;</span>
</div>
</div>
<div style='float:right; width:420px;' >
<div id='stb-box-2538' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 34px 4px 10px 4px; "><span style="font-size: xx-small;">&lt;DIVPAGE divname=&#8217;ONE&#8217;&gt;One is the loneliest number&lt;/DIVPAGE&gt;<br />
&lt;DIVPAGE divname=&#8217;TWO&#8217;&gt;Two can be as sad as one&lt;/DIVPAGE&gt;</span>
</div>
</div>
<p>Now, let me be clear. These are only the same as each other because I designed it that way. It made it easier for me to understand to give them the same names, respectively, not to mention easier to demonstrate. Unfortunately, when you do that, you might give the impression that they <strong>must</strong> be the same. They don&#8217;t.</p>
<p>The final piece of the Javascript I haven&#8217;t described is how I send the data from the two XML documents to their respective page sections.</p>
<div id='stb-box-6419' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 10px 4px 10px 4px; ">
<p><span style="font-size: xx-small;">x=xmlDoc.getElementsByTagName(&#8220;DIVPAGE&#8221;); for(i=0; i&lt;x.length; i++) { divname = x[i].attributes.getNamedItem(&#8216;divname&#8217;).value; switch(divname) { case &#8220;ONE&#8221;: txt = x[i].textContent; break; case &#8220;TWO&#8221;: txt = x[i].textContent; break; default: txt = &#8220;&#8221;; break; } document.getElementById(divname).innerHTML=txt; }</span></p>
</div>
<p>The first and last statements in this block of code should be familiar by now. The code for handling XML document &#8220;not well-formed&#8221; errors used them. The one at the top gets an array of all elements named &#8220;DIVPAGE&#8221;. The last line puts the text created from those elements into the two different sections of the web page.</p>
<p>I do this for all <em>DIVPAGE</em> elements in a loop and send it to the right place on the page based on the value of the <em>divname</em> attribute, which I retrieve with the <em>getNamedItem() </em>function call.</p>
<p>If you are getting all of this, you might notice that I didn&#8217;t have to do the whole switch thing. I could have simplified this script like this:</p>
<div id='stb-box-6342' class='stb-custom_box' style="background-color: #dddddd; background-image: url(none); min-height: 20px; padding-left: 5px; margin: 10px 1px 10px 1px; ">
<p><span style="font-size: xx-small;">x=xmlDoc.getElementsByTagName(&#8220;DIVPAGE&#8221;); for(i=0; i&lt;x.length; i++) { divname = x[i].attributes.getNamedItem(&#8216;divname&#8217;).value; document.getElementById(divname).innerHTML=x[i].textContent; }</span></p>
</div>
<p>The reason I did it with the <em>switch</em> construct is to allow for maybe processing the response differently depending on which <em>divname</em> I am working on.</p>
<p>I am using this entire method for a <a title="WordPress" href="http://www.wordpress.com/" target="_blank">WordPress</a> plugin I am working on. The plugin will allow a blog administrator to limit access to certain <a title="bbPress" href="http://www.bbpress.org/">bbPress</a> forums to certain users. The administration of this activity will be much faster for the adminstrators because they won&#8217;t have to wait for each little change to go through an entire reload of the page, which includes all of the WordPress dashboard menu, headers, and footers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=441</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some Don&#8217;t Like It Hot</title>
		<link>http://www.rexgoode.com/?p=434</link>
		<comments>http://www.rexgoode.com/?p=434#comments</comments>
		<pubDate>Thu, 25 Aug 2011 21:12:10 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Temperature]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=434</guid>
		<description><![CDATA[Truly, the Portland area has been a cold, wet place for the last year. I remember on many mornings, standing outside my club while waiting, sarcastically chiming in when people groused about the cold morning, "Global warming!"]]></description>
				<content:encoded><![CDATA[<div id="attachment_435" class="wp-caption alignleft" style="width: 269px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/08/desert.jpg"><img class="size-full wp-image-435" title="desert" src="http://www.rexgoode.com/wp-content/uploads/2011/08/desert.jpg" alt="" width="259" height="194" /></a>
<p class="wp-caption-text">Arizona Desert</p>
</div>
<p>I am a proud native of the state of Arizona and an even prouder resident of the moderate state of Oregon. Not to be a traitor, but I love my adopted home state. I don&#8217;t like my biological home state so much.<span id="more-434"></span>Just this morning, while relaxing ever so briefly in a hot tub at my gym, one of my friends there said to another, &#8220;I can&#8217;t believe it&#8217;s almost Labor Day. Where was summer?&#8221;</p>
<p>The other agreed and bemoaned the lack of warm days this year, not only this summer, but from last fall through now. Truly, the Portland area has been a cold, wet place for the last year. I remember on many mornings, standing outside my club while waiting, sarcastically chiming in when people groused about the cold morning, &#8220;Global warming!&#8221;</p>
<p>Of course, that brought on the current standard correction, &#8220;Not global warming. Climate change!&#8221; My response: &#8220;Whatever!&#8221;</p>
<p>So, here is a question for you. If you can have a love affair, can you have a hate affair? Well, in my book, yes, you can. I have a hate affair with heat. Do you find it strange that the guy who wrote, &#8220;<a title="Some Like It Hot" href="http://wp.me/pg2vv-3k" target="_blank">Some Like It Hot</a>&#8221; and &#8220;<a title="My Pad Thai Scares Me" href="http://wp.me/pg2vv-6S" target="_blank">My Pad Thai Scares Me</a>&#8221; doesn&#8217;t like heat?</p>
<p>When it comes to the spiciness level of food, I think that spicy dishes ought to be truly spicy. When it comes to the temperature of the air, it should never get above 82 degrees Fahrenheit if I am to be comfortable. When it is hotter than that and people say that the weather is wonderful, I want to punch them in the arm. What is so wonderful about it being so hot you don&#8217;t feel like moving?</p>
<p>Not to be short on discrepancies, but I did start this rant by describing something said to me while I was sitting in a hot tub. I like a hot tub session now and then, but I can only handle about five minutes before I feel cooked. I joke , &#8220;Why don&#8217;t you just throw in a few vegetables and call me Stu?&#8221; Get it?</p>
<p>Give me half a chance and I&#8217;ll gravitate towards the cold water. For example, in the summer when the club opens its outdoor pool in the morning, I show up around 4:00AM. I wait in the parking lot until the doors open up at 4:30AM. I go right to the lap pool indoors, which is claimed to be kept around 81 degrees. At around 5:10AM, a worker removes the covering on the outdoor pool.</p>
<p>The air temperature out there at that time is anywhere from 50 to 70 degrees. I&#8217;m wet from head to toe and only wearing swim trunks and flip-flops. It&#8217;s breezy so it&#8217;s a little cold. I love it! The outdoor pool is purportedly about 84 degrees. Feels pretty warm to me.</p>
<p>After about a half-hour out there, I start getting lonely, so I go inside to the therapy pool, which is around 90 degrees, plenty warm for me. It&#8217;s a long, cold walk back into the club.</p>
<p>I have a regular group of men I shoot the breeze with and we end up in the hot tub, which is around 104 degrees. I know of one man who quit the club when they started complying with the State of Oregon&#8217;s guidelines limiting the temperature to 104. They used to keep it at 107. The man who left wanted even more. I don&#8217;t get it.</p>
<p>Some of my friends have speculated that I like cold air because I&#8217;m so overweight. That&#8217;s not it. Back when I was a youth in Arizona, I was so skinny my dad nagged my mom to take me to a doctor and see if I was dying. I wasn&#8217;t. I just had a high metabolism and I burned fat like crazy! I would have those days again.</p>
<p>Yet, being little more than a stick figure, I still hated hot summer days. I&#8217;ve hated them through all the ups and downs of the readings on scales.</p>
<p>Once, I was sent by my consulting company to work in Anchorage, Alaska for six weeks, beginning in early November through mid December. It was around 60 below 0. When I walked out of the apartment building, I felt the inside of my nostrils start to crackle.  I liked it! I think that maybe somewhere up in the pre-existence, someone made a clerical error. It said I was supposed to go to Alaska but got sent to Arizona.</p>
<p>My wife agrees. Don&#8217;t be surprised. We do agree on some things. She&#8217;s a native Oregonian. She doesn&#8217;t like hot days. She calls Arizona, Arid-zona.</p>
<p>Right now, I&#8217;m just biding my time until October hits, the leaves turn pretty colors, and an icy wind whips up. I&#8217;ll probably start walking to the gym in my swim trunks.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=434</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Pad Thai Scares Me</title>
		<link>http://www.rexgoode.com/?p=426</link>
		<comments>http://www.rexgoode.com/?p=426#comments</comments>
		<pubDate>Thu, 25 Aug 2011 18:30:32 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[Cooking]]></category>
		<category><![CDATA[Culture]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Food]]></category>
		<category><![CDATA[spicy]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=426</guid>
		<description><![CDATA[So often, I sit down in a restaurant and see the little "spicy" icon on the menu. I eagerly order the item thinking, "This is gonna be good!" I dive in with my fork and wonder where the spiciness is. It is very disappointing. That's because most people's idea of "hot" is my idea of mild.]]></description>
				<content:encoded><![CDATA[<div id="attachment_427" class="wp-caption alignleft" style="width: 269px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/08/padthai.jpg"><img class="size-full wp-image-427" title="padthai" src="http://www.rexgoode.com/wp-content/uploads/2011/08/padthai.jpg" alt="" width="259" height="194" /></a>
<p class="wp-caption-text">Pad Thai</p>
</div>
<p>So, in case I haven&#8217;t made it clear, I love spicy food. I said it before in &#8220;<a title="Some Like It Hot" href="http://www.rexgoode.com/?p=206">Some Like It Hot</a>.&#8221; I have an ongoing love affair with capsicum, the little chemical that makes spicy food hot. It&#8217;s really good for you.<span id="more-426"></span>So often, I sit down in a restaurant and see the little &#8220;spicy&#8221; icon (<a href="http://www.rexgoode.com/wp-content/uploads/2011/08/spicy.jpg"><img title="spicy" src="http://www.rexgoode.com/wp-content/uploads/2011/08/spicy.jpg" alt="" width="25" height="37" /></a>) on the menu. I eagerly order the item thinking, &#8220;This is gonna be <strong>good!&#8221;</strong> I dive in with my fork and wonder where the spiciness is. It is very disappointing. That&#8217;s because most people&#8217;s idea of &#8220;hot&#8221; is my idea of mild.</p>
<p>Years ago, I moved back to Portland, Oregon from Columbus, Ohio when my dear mother was diagnosed with pancreatic cancer. A block away from her apartment was this place that sold doughnuts and Thai food. My parents said the doughnuts were the best!</p>
<p>I had some one morning and they were right. I still don&#8217;t know what makes <a title="The Honey Jar" href="http://www.yelp.com/biz/honey-jar-yogurt-portland" target="_blank">The Honey Jar</a>&#8216;s doughnuts better, but they are really good. Eleven years later, and I still will go out of way to get a doughnut there, not that I should be eating doughnuts at all.</p>
<p>Also, one day, I decided to try their Thai food. The cook was an older Thai woman and she personally took our orders and cooked them. It was a wonderful setting, very family-like. My wife and I both order Pad Thai, my favorite. Barbara had never had it before. I asked for spicy. She asked for mild. When hers came, she made the &#8220;I&#8217;m dying&#8221; face and wouldn&#8217;t eat her meal. The cook saw her and made her a whole new plate with absolutely no spiciness at all. Barbara was content. I was was too. Mine was very good and very hot.</p>
<p>Over the next eleven years, I&#8217;ve recommended the place to a lot of people. I haven&#8217;t seen the woman there since that one day, but the food is every bit as good as it was back then.</p>
<p>Yesterday, I went there. To my delight, the latest menu says that you can order any meal mild, medium, hot, or very hot. I didn&#8217;t hesitate to ask for it very hot, recalling my experiences at other restaurants who falsely label mild food as spicy.</p>
<p>Well, I wasn&#8217;t disappointed. It was not only very hot. It was very <span style="font-size: large;">very<span style="font-size: small;"> hot. Now, I&#8217;m not complaining. In fact, I was greatly pleased that the menu accurately described it. Shame on those other places that don&#8217;t know mild from hot. Unfortunately, it was too hot for me to eat in one sitting, so I asked for a box. </span></span></p>
<p>This morning, I came home from my workout at the gym famished. I opened up the refrigerator and saw that white takeout box full of pad thai and a momentary sense of foreboding overcame me. My pad thai was actually scaring me. Not to worry. I&#8217;m having it for lunch.</p>
<p>If you get the chance and live in the Portland area, do check out The Honey Jar at 13810 N.E. Sandy Blvd in Portland. It is good, good, good thai food. Just beware. When it says, &#8220;very hot&#8221;, it means it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=426</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick Fields</title>
		<link>http://www.rexgoode.com/?p=394</link>
		<comments>http://www.rexgoode.com/?p=394#comments</comments>
		<pubDate>Mon, 04 Jul 2011 04:32:25 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Object-Oriented Programming]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=394</guid>
		<description><![CDATA[I recently created a new blog on my readersclubs.com site where I write reviews of movies and television shows I see. I enjoy watching and I have a lot of opinions. I also did it as a means of helping myself learn more about using WordPress, which is the software that runs my blogs.In particular, [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.rexgoode.com/wp-content/uploads/2011/07/sitelogo.gif"><img class="size-full wp-image-395 alignleft" title="sitelogo" src="http://www.rexgoode.com/wp-content/uploads/2011/07/sitelogo.gif" alt="" width="280" height="75" /></a>I recently created a new blog on my readersclubs.com site where I write reviews of movies and television shows I see. I enjoy watching and I have a lot of opinions. I also did it as a means of helping myself learn more about using <a href="http://www.wordpress.com/">WordPress</a>, which is the software that runs my blogs.<span id="more-394"></span>In particular, I wanted to write a plugin, for the sake of practice. A film criticism site seemed a good place to do that. So, for your not-so-entertaining enjoyment, here is the info on a WordPress plugin I wrote. Now, don&#8217;t go asking why I haven&#8217;t offered it to the WordPress community. I&#8217;ll tell you why before you ask. It isn&#8217;t ready yet, and I&#8217;m not sure I&#8217;m going to get it ready. There are other plugins that do similar things. If I want to really polish it up, I will. For now, I did it as a test of my skills and to have something to write about here.</p>
<p>The film review blog is called, &#8220;<a href="http://anyscreenwilldo.readersclubs.com" target="_blank">Any Screen Will Do</a>.&#8221; Since a blog made up of film reviews is likely to have a lot of the same information in it, such as who the directors, producers, and actors were, it made sense to me to have them be fields I could fill in instead of narrative I had to write each time I did a review.</p>
<p>Look at any review on the blog and you will see at the bottom of it, a list of these items. I did not write a new table for each review. I just created fields in the dashboard to fill in whenever I write a review. The plugin then formats them to appear at the bottom of the review.</p>
<p>Here&#8217;s the table from the review of a movie called, &#8220;<a href="http://anyscreenwilldo.readersclubs.com/2011/06/23/dark-night-of-the-scarecrow/" target="_blank">Dark Night of the Scarecrow</a>:&#8221;</p>
<p><!-- .quickfields { font-size: 18pt; border: 1pt; background-color: #cdf; } .quickfieldslabel { font-weight: bold; background-color: #cdf; } .quickfieldsvalue {background-color: #cdf;  } --></p>
<div class="quickfields">
<table style="{background-color: #cdf; }" border=1>
<tbody>
<tr>
<td class="quickfieldslabel" style="padding-right: 8pt;" valign="top">Director(s):</td>
<td class="quickfieldsvalue" style="padding-right: 8pt;" valign="top">Frank De Felitta</td>
</tr>
<tr>
<td class="quickfieldslabel" style="padding-right: 8pt;" valign="top">Producer(s):</td>
<td class="quickfieldsvalue" style="padding-right: 8pt;" valign="top">J.D. Feigelson</td>
</tr>
<tr>
<td class="quickfieldslabel" style="padding-right: 8pt;" valign="top">Featured Cast Members:</td>
<td class="quickfieldsvalue" style="padding-right: 8pt;" valign="top">Charles Durning<br />
Larry Drake<br />
Jocelyn Brando<br />
Lane Smith</td>
</tr>
<tr>
<td class="quickfieldslabel" style="padding-right: 8pt;" valign="top">Release Year:</td>
<td class="quickfieldsvalue" style="padding-right: 8pt;" valign="top">1981</td>
</tr>
<tr>
<td class="quickfieldslabel" style="padding-right: 8pt;" valign="top">Writer(s):</td>
<td class="quickfieldsvalue" style="padding-right: 8pt;" valign="top">J.D. Feigelson</td>
</tr>
</tbody>
</table>
</div>
<p>
To create a plugin for WordPress, you create a directory for it under the plugins directory on your server. IN that new directory, you write the code for the plugin. Comments in the code tell WordPress the name of the plugin.</p>
<div class="su-note" style="background-color:#c9ffff;border:1px solid #a8e5e5">
<div class="su-note-shell" style="border:1px solid #f1ffff;color:#384c4c">
<p>/*<br />
Plugin Name: Quick Fields<br />
Plugin URI: http://www.innervessel.com/quickfields/<br />
Description: Allows entry of quick fields such as director, producer, year for film and television. Facilitates themed control of placement.<br />
Author: Rex Goode<br />
Version: 1.0<br />
Author URI: http://www.rexgoode.com/<br />
*/
</p></div>
</div>
<p>I won&#8217;t be giving the entire code for you. The purpose of writing this is not to give you a plugin to use, but to describe some of the steps of writing one.</p>
<p>You won&#8217;t necessarily find my way of doing it exactly in the WordPress documentation. Most of the WordPress documentation tells about writing plugins with standard programming techniques. I, on the other hand, always prefer to work with objects whenever I can. (For more on object-oriented programming, see <a href="../?p=289" target="_blank">OOP’s! Did I do that?!)</a> So, my Quick Fields plugin was written as a class called &#8220;quickfields&#8221;.</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
<p style="padding-left: 30px;">class quickfields {<br />
var $dbVersion = &#8220;1.0&#8243;;<br />
var $all_fields;<br />
var $table_name;<br />
var $postId;</p>
<p style="padding-left: 30px;">&#8230;</p>
<p style="padding-left: 30px;">}</p>
</div>
</div>
<p>Almost everything that happens in the plugin is in the confines of the quickfields object that is created at run time. In fact, the only things that happen outside of the object are the WordPress housekeeping items at the start of the file and the following lines at the bottom, which are explained in the comments.</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
if (class_exists(&#8220;quickfields&#8221;)) { $qf = new quickfields(); } // Create a object of type quickfields</p>
<p>//Actions and Filters</p>
<p>if (isset($qf)) {</p>
<p style="padding-left: 30px;">// Tell it what to do when the plugin is activated<br />
<span style="background-color: #c0c0c0;">register_activation_hook</span>(__FILE__,array(&amp;$qf, &#8216;quick_fields_activate&#8217;));</p>
<p style="padding-left: 30px;">// Tell it what to do when the plugin is deactivated<br />
register_deactivation_hook(__FILE__,array(&amp;$qf, &#8216;quick_fields_deactivate&#8217;));</p>
<p style="padding-left: 30px;">// Show the table of values<br />
function the_quick_fields() {</p>
<p style="padding-left: 60px;">global $qf, $post;<br />
$qf-&gt;quick_fields_display($post-&gt;ID);</p>
<p style="padding-left: 30px;">}</p>
<p>}</p>
</div>
</div>
<p>The &#8220;register_activation_hook&#8221; and &#8220;register_deactivation_hook&#8221; functions are the way a programmer tells WordPress what to do when someone activates or deactivates a plugin, respectively. What I told them to do are to run member functions of my quickfields class, namely, &#8220;quick_fields_activate&#8221; and &#8220;quick_fields_deactivate&#8221;</p>
<p>The first one creates a database table to hold the names and information about the quick fields that the blog author can create. The second one destroys the table.</p>
<p>I also create a function called, &#8220;quick_fields_display&#8221;, which goes into the database, grabs the values entered by the blog author, and displays them on the post. Where it displays them depends on where the theme calls the quick_fields_display function. My Clive theme that I created (more on that some day maybe) calls this function after the body of the post is displayed.</p>
<p>Now, at about this point, I bet I&#8217;ve lost most people who read my blog. I won&#8217;t mind if you give up right now. This is as much for my future reference as it is for others who might want to write WordPress plugins.</p>
<p>So, some of you Object-Oriented purists are wondering why I didn&#8217;t make quick_fields_display a member function of the quickfields class. I could have. Right now, the code in the theme looks like this:</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
<p>&lt;?php the_quick_fields(); ?&gt;</p>
</div>
</div>
<p>If it would have been a member function, it would have looked like:</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
<p>&lt;?php if (isset($qf)) { $qf-&gt;the_quick_fields(); } ?&gt;</p>
</div>
</div>
<p>In some ways, the latter is probably not a bad idea. I will think about it.</p>
<p>At this point, my code for creating and destroying the table is working. Next, I had to give the blog owner a way to decide which quick fields he wanted to create.</p>
<p>If you are familiar with the WordPress Dashboard, you know that there is a Settings menu. I chose to put my Quick Fields functionality under that menu. I accomplished that with the following member function:</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
<p>function quick_fields_menu() {</p>
<p style="padding-left: 30px;">add_options_page(&#8216;Quick Fields Settings&#8217;, &#8216;Quick Fields&#8217;, &#8216;manage_options&#8217;, &#8216;qfoptions&#8217;, array($this, &#8216;quick_fields_options&#8217;));</p>
<p>}</p>
</div>
</div>
<p>This points the new Settings menu item to another member function, &#8220;quick_fields_options&#8221;, for control of the Quick Fields settings.</p>
<p>The quick_fields_options function and other related functions allow the owner of the blog to decide which quick fields to make available to authors. Take a look at how it looks.</p>
<p><a href="http://www.rexgoode.com/wp-content/uploads/2011/07/quickfields.jpg"><img class="aligncenter size-full wp-image-412" title="quickfields" src="http://www.rexgoode.com/wp-content/uploads/2011/07/quickfields.jpg" alt="" width="722" height="228" /></a>In future versions, I might create a way to change the order they appear. For now, it is first-in/first-out.</p>
<p>So, up to this point, the functionality exists for a blog owner to go in and create a series of special fields that the author of a blog post might want to add to his post. The functionality is not yet in place for the author of the post to fill in those fields. That is the last piece.</p>
<p>It is accomplished through something that WordPress calls, meta boxes. A meta box is something that shows beneath the main box where you write when you&#8217;re writing a blog post. If you are using the WordPress excerpt field, this is a meta box. Each field that is defined by the blog owner in the process above gets its own meta box. In my next version, I will make all of the fields appear in a single meta box.</p>
<p>Here is the code for the current version:</p>
<div class="su-note" style="background-color:#d6ffff;border:1px solid #b8e5e5">
<div class="su-note-shell" style="border:1px solid #f5ffff;color:#3d4c4c">
<p>foreach($this-&gt;all_fields as $field) {</p>
<p style="padding-left: 30px;">$slug = &#8220;qf&#8221; . $field-&gt;fieldSlug;</p>
<p style="padding-left: 30px;">$fieldkey = &#8220;qf_&#8221; . $field-&gt;fieldSlug;</p>
<p style="padding-left: 30px;">$fieldargs = array(&#8220;fieldInstructions&#8221; =&gt; $field-&gt;fieldInstructions, &#8220;keyname&#8221; =&gt; $fieldkey);</p>
<p style="padding-left: 30px;">add_meta_box($slug, $field-&gt;fieldLabel, array(&amp;$this, &#8216;quick_field_post&#8217;), &#8216;post&#8217;, &#8216;normal&#8217;, &#8216;high&#8217;, $fieldargs);</p>
<p>}
</p></div>
</div>
<p>It looks like this:</p>
<p><a href="http://www.rexgoode.com/wp-content/uploads/2011/07/quickfieldsmeta.jpg"><img class="aligncenter size-full wp-image-415" title="quickfieldsmeta" src="http://www.rexgoode.com/wp-content/uploads/2011/07/quickfieldsmeta.jpg" alt="" width="500" height="578" /></a>The values a reviewer types into these fields shows up at the end of his review in tabular form as shown above. He doesn&#8217;t have to remember to write them into his narrative somewhere. He just fills in the form and the plugin does the rest.</p>
<p>Now, if you&#8217;re still following me, you might be wondering where I store the information the reviewer types into these fields. I didn&#8217;t need to create a database table for it. Each WordPress database has a table called &#8220;wp_postmeta&#8221; or for networked sites like mine, &#8220;wp_n_postmeta&#8221; where &#8220;n&#8221; is the blog ID number. For information on how to do this, look for the documentation for the get_post_meta, update_post_meta, and add_post_meta WordPress functions.</p>
<p>I enjoyed writing a WordPress plugin. It employed several of my skills, including:</p>
<ul>
<li>Object-oriented PHP language design and coding</li>
<li>MySql database administration and design</li>
<li>Javascript form processing</li>
<li>HTML coding and design</li>
</ul>
<p>When I make some of the improvements I have in mind, I might consider posting it at WordPress.com for others to try. If you find yourself trying to make a WordPress plugin and are having trouble, respond here and I&#8217;ll try to help. It&#8217;ll make a good learning exercise for me. Good luck.</p>
<div id="_mcePaste" class="mcePaste" style="position: absolute; left: -10000px; top: 2863px; width: 1px; height: 1px; overflow: hidden;">foreach($this-&gt;all_fields as $field) {<br />
$slug = &#8220;qf&#8221; . $field-&gt;fieldSlug;<br />
$fieldkey = &#8220;qf_&#8221; . $field-&gt;fieldSlug;<br />
$fieldargs = array(&#8220;fieldInstructions&#8221; =&gt; $field-&gt;fieldInstructions, &#8220;keyname&#8221; =&gt; $fieldkey);<br />
add_meta_box($slug, $field-&gt;fieldLabel, array(&amp;$this, &#8216;quick_field_post&#8217;), &#8216;post&#8217;, &#8216;normal&#8217;, &#8216;high&#8217;, $fieldargs);<br />
}</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=394</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flexibility</title>
		<link>http://www.rexgoode.com/?p=356</link>
		<comments>http://www.rexgoode.com/?p=356#comments</comments>
		<pubDate>Sun, 05 Jun 2011 04:11:33 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Social Work]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=356</guid>
		<description><![CDATA[Do they really think they are going to find someone who sat down and coded Javascript for five years straight, never looking at another language? That would be a job that would quickly drive you to despair. Yet, that's the way hiring managers seem to think.]]></description>
				<content:encoded><![CDATA[<div id="attachment_357" class="wp-caption alignleft" style="width: 310px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/cro-cop-splits.jpg"><img class="size-medium wp-image-357" title="cro-cop-splits" src="http://www.rexgoode.com/wp-content/uploads/2011/06/cro-cop-splits-300x219.jpg" alt="" width="300" height="219" /></a>
<p class="wp-caption-text">Man Doing the Splits</p>
</div>
<p>You wouldn&#8217;t know it to look at me, but I&#8217;m flexible. I really am. No kidding.</p>
<p>So, I may not be able to do the splits, but if you look over my long career, you&#8217;d have to admit that one of my strongest character attributes is my flexibility&#8211;my willingness to change to fit what is needed.<span id="more-356"></span>My last job doing TCL is an example of this. I didn&#8217;t know TCL from any other language. I had never heard of it before I got that contract. I just turned on the computer and started working. I figured the language out pretty quickly.</p>
<p>Look at what I&#8217;ve learned since BASIC. I&#8217;m not just talking about languages here, but languages, operating systems, technologies, not to mention work cultures, geographic cultures, and whatever else needed doing.</p>
<p>I&#8217;m still quite a bit like my old students at OMSI, the children who really didn&#8217;t even need me to tell them how to program. The learned because they were still young enough to be flexible in their thinking. So, I&#8217;m 54 years old. I&#8217;m still flexible in my thinking.</p>
<p>Since my time at that last contract, I&#8217;ve built several web sites and can code and engineer software as well as ever.</p>
<p>Here&#8217;s a list of the things I&#8217;ve learned within a few days if not hours when the need arose:</p>
<table border="0" cellspacing="0" cellpadding="4" width="665">
<colgroup>
<col width="112"></col>
<col width="537"></col>
</colgroup>
<tbody>
<tr valign="TOP">
<td width="112"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">Languages and Tecnologies<br />
</span></td>
<td width="537"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">SQL, Perl, C, C++, TCL, BASIC, HTML, PHP, JAVA, 			Javascript, PostScript, XML<br />
</span></td>
</tr>
<tr valign="TOP">
<td width="112"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">Databases</span></td>
<td width="537"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">Sybase Adaptive Server 			Enterprise and Replication Server(v12.0), Informix,</span>&nbsp;</p>
<p><span style="font-size: small; font-family: arial,helvetica,sans-serif;">MySQL (v3.22), Microsoft SQL Server 7.0</span></td>
</tr>
<tr valign="TOP">
<td width="112"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">Operating Systems</span></td>
<td width="537"><span style="font-size: small; font-family: arial,helvetica,sans-serif;">MS Windows 			(2000/98/NT/3.1), MS DOS, UNIX(Solaris, SCO, Linux), VMS, Linux<br />
</span>&nbsp;</p>
<p>&nbsp;</td>
</tr>
</tbody>
</table>
<p>In today&#8217;s computer consulting game, they still want to know how many years you&#8217;ve been working with a certain language or technology. I recently applied for a job where one of the requirements was five years working with Javascript. Really?</p>
<p>Do they really think they are going to find someone who sat down and coded <a href="http://www.javascript.com/" target="_blank">Javascript </a>for five years straight, never looking at another language? That would be a job that would quickly drive you to despair. Yet, that&#8217;s the way hiring managers seem to think.</p>
<p>Some people would say that the variety in my experience makes me a jack of all trades but a master of none. Maybe they are right. I would say that I am a jack of many languages, but what I really am is a master of flexibility at learning new things when new things come along.</p>
<p>If you&#8217;re a hiring manager, consider this. I may not be able to claim the years you want with a certain language, but I&#8217;ve done enough different things that I might even be better than someone who knows how to do only one thing.</p>
<p>Consider this too. Since that lay off, I&#8217;ve operated my own web building company. Haven&#8217;t made a lot of money, but I&#8217;ve made a lot of web sites.</p>
<p>The best thing I did was that I went back to school. If you read <a href="http://www.rexgoode.com/?p=257" target="_blank">Back to the BASIC</a>, you will hopefully remember my high school Medical Careers teacher who thought I should become a psychologist because I&#8217;m the kind of person people like to tell their troubles to.</p>
<div id="attachment_358" class="wp-caption alignright" style="width: 235px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/PIC_0094.jpg"><img class="size-medium wp-image-358" title="PIC_0094" src="http://www.rexgoode.com/wp-content/uploads/2011/06/PIC_0094-225x300.jpg" alt="" width="225" height="300" /></a>
<p class="wp-caption-text">Me At My Graduation</p>
</div>
<p>I received my Bachelors Degree in Social Work in 2007 from Concordia University. I graduated <em>Magna Cum Laude</em> and was honored by the staff as Outstanding Social Work Student of the Year.</p>
<p>For several years now, I&#8217;ve taught life skills to developmentally disabled adults. I help them with behavior problems. My flexibility and willingness to adapt is probably the best skill I bring to this work as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=356</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Now THAT Is a Mountain!</title>
		<link>http://www.rexgoode.com/?p=350</link>
		<comments>http://www.rexgoode.com/?p=350#comments</comments>
		<pubDate>Sun, 05 Jun 2011 04:27:54 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Family]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Sybase]]></category>
		<category><![CDATA[TCL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=350</guid>
		<description><![CDATA[We missed the Columbia River Gorge, the trails, the ocean beaches, and the greenness everywhere you looked all year long. To be honest, some months aren't as green as others, but there's always green. Columbus has lots and lots of dull grey and brown.]]></description>
				<content:encoded><![CDATA[<p>&nbsp;</p>
<div id="attachment_353" class="wp-caption alignleft" style="width: 220px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/crocodile-dundees-knife-101035.jpg"><img class="size-full wp-image-353" title="crocodile-dundees-knife-101035" src="http://www.rexgoode.com/wp-content/uploads/2011/06/crocodile-dundees-knife-101035.jpg" alt="" width="210" height="254" /></a>
<p class="wp-caption-text">Crocodile Dundee&#39;s Knife</p>
</div>
<p>Do you remember the scene from<a title="Crocodile Dundee" href="http://www.imdb.com/title/tt0090555/"> Crocodile Dundee</a> where some punk tries to mug Mick and his girlfriend? The mugger pulls out a knife and threatens them, saying, &#8220;Do you want me to cut you with my knife?&#8221;</p>
<p>Mick replies, &#8220;That&#8217;s not a knife.&#8221; He pulls out his considerable blade and says, &#8220;<strong>This </strong> is a knife!&#8221;<span id="more-350"></span>As much as I enjoyed Columbus, Ohio&#8217;s friendly and outgoing people, I couldn&#8217;t handle the terrain. From my 16th story window at work, I could see a long way in all directions. The only interesting thing I ever saw out that window was a severe thunderstorm with what looked like the beginnings of funnel clouds, that and the way the other tall buildings were swaying in the winds.</p>
<p>It was amusing to us when someone would try to give us directions somewhere and say it was up in the mountains. &#8220;What mountains?&#8221; we wondered.</p>
<div id="attachment_351" class="wp-caption alignright" style="width: 310px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/mthood.jpg"><img class="size-medium wp-image-351" title="mthood" src="http://www.rexgoode.com/wp-content/uploads/2011/06/mthood-300x225.jpg" alt="" width="300" height="225" /></a>
<p class="wp-caption-text">Mt. Hood</p>
</div>
<p>To them, the mountains were the little knobs you could travel to with slightly higher elevations than Columbus itself. To be honest, we just plain missed Oregon. Mt. Hood&#8211;now <strong>that</strong> is a mountain!</p>
<p>You can see it right out in plain sight from just about anywhere in Portland. Well, you have to get a clear day without clouds, but you always know it is there.</p>
<p>We missed the Columbia River Gorge, the trails, the ocean beaches, and the greenness everywhere you looked all year long. To be honest, some months aren&#8217;t as green as others, but there&#8217;s always green. Columbus has lots and lots of dull grey and brown.</p>
<p>Just as my severance pay was getting close to ending in Columbus, I got a call from a woman we knew in Portland. She was my mother&#8217;s Relief Society President. My mother was very ill and she felt I should come out and see her.</p>
<p>That is when we found out that my mother, Xyla Kelley, had pancreatic cancer. The prognosis was not good. She needed us there.</p>
<p>I flew out to be with her at a meeting with her doctor where surgery was being proposed. There wasn&#8217;t much hope it would help, but could have been worth a try.</p>
<p>While waiting, I saw a newspaper ad for a job using Sybase in the Portland area. I called the number and made an appointment with a recruiter. That same day, he took me to the client company and I interviewed there. Before I flew back to Columbus, I had a job offer complete with moving expenses. It was an answer to prayer.</p>
<p>The job was as a database administrator (DBA) project. I would be designing the database for a telephony and voice recognition system that would log the calls, times, and billing. It needed to be fast, fast, fast.</p>
<p>As before, I was an employee of a consulting company, not of the company whose cubicle I occupied. It was hard adjusting to the atmosphere. There just wasn&#8217;t the same Columbus friendliness that I had enjoyed.</p>
<div id="attachment_354" class="wp-caption alignleft" style="width: 235px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/young.jpg"><img class="size-full wp-image-354" title="young" src="http://www.rexgoode.com/wp-content/uploads/2011/06/young.jpg" alt="" width="225" height="285" /></a>
<p class="wp-caption-text">Xyla Faye Moore Kelley</p>
</div>
<p>Every day for the first four months, I would take the train home to Gresham and go visit my mother in the hospital and later, the nursing home. She passed away in April of 2000.</p>
<p>One day, we were treated to a team building exercise that included laser tag, miniature golf, and go-karts. It was fun. The people were fun, but I wasn&#8217;t clicking.</p>
<p>The contract didn&#8217;t last long. I completed the database and left. My next contract took me back to a place where I had worked before, but different projects and managers.</p>
<p>On my first day there, I got a call from the manager at the telephony company. He was upset because the last index I left on one of the tables was slowing the whole operation down. He wanted me to explain to him why.</p>
<p>I asked him to read the syntax of the index to me. It wasn&#8217;t the one I left running. It was one of the benchmark &#8220;wrong&#8221; ones I had created for testing. Yes, despite my hatred for quality assurance, I still did it. I created several versions of the index and then did stress testing on each one. I fired tens of thousands of records at each one and documented which one worked the best. When I left, that is the one I left live.</p>
<p>The others were still in my account somewhere. Someone applied one of the bad ones after I left, probably thinking it was the only one. To this day, I think that manager thinks I left the bad one live.</p>
<p>It&#8217;s funny how once someone makes an accusation, it sticks. Being defensive about it only makes you look more guilty. So, I stated that I left the right one running and left it at that.</p>
<p>My new position took me into the world of web pages. It was my first paying job working with HTML and a language called <a title="TCL" href="http://www.tcl.tk/about/language.html" target="_blank">TCL</a> (pronounced like &#8220;tickle&#8221;). It was somewhat like a language I taught myself for use on my own web pages, which had by then been growing in number. <a title="PHP" href="http://www.php.net" target="_blank">PHP </a>is what I now mostly use to create web pages.</p>
<p>I wasn&#8217;t really even creating new pages. The system was already built. I was a maintenance programmer. I maintained a database of complaints from around the company about bugs in the system. My job was to start at the top of the priority list and try to fix everything of the highest priorities. I got through most of those pretty quickly and started in on the not-so-important ones.</p>
<p>I had to be careful too. Just because someone in the company thought something was a bug didn&#8217;t mean that others shared his opinion. So, I had to communicate with people and see if everyone agreed on something being fixed. There wasn&#8217;t a lot of that. Most of it was just sitting there fixing other people&#8217;s programs.</p>
<p>I don&#8217;t mind that, really. It gives me a certain sense of superiority to know that I have to clean up after other people&#8217;s mistakes. Honestly, though, it was a whole lot of boring.</p>
<p>For eighteen months, I sat in that cubicle doing that. Once in a while, I&#8217;d mosey on over to the manager&#8217;s cubicle, check in and say that all was well. I think twice in eighteen months, he came to my cube and inquired how it was going.</p>
<p>One day, one of my manager&#8217;s manager&#8217;s managers decided that I should start coming to team meetings. As you know, &#8220;meet&#8221; is a four-letter word as far as I&#8217;m concerned. I started attending these meetings. They had nothing to do with my assignment, but the manager two tiers up liked the fact that I was being part of the team. At least, I got to see faces and hear voices.</p>
<p>Actually, I heard lots of voices in that sea of cubicles. Each cubicle is surrounded by eight others. You&#8217;re close enough to hear every conversation. I knew when they had doctor appointments, were fighting with their spouses, or disciplining their children by phone. You would think I would have known how other projects were going, but of course, for that kind of information sharing they had to&#8230;you guessed it&#8230;call a meeting.</p>
<p>The highlight was when one early morning before many people were there, the guy down the aisle from me had a shouting match with his wife over the phone. Really, she shouldn&#8217;t have overdrawn their checking account like that, but he was definitely overreacting.</p>
<p>That company has a policy that you can&#8217;t keep a contractor more than eighteen months. I did the whole eighteen. The assistant manager told me that he wished he could keep me. With me gone, the whole thing would fall back to him. He paid me a nice complement, though. He said I was the best person that had ever been in that position.</p>
<p>Shortly before my last day, the World Trade Center was demolished by a terrorist attack. A recession followed. My consulting company couldn&#8217;t place me within a few days and laid me off.</p>
<p><em>To be continued in </em><a title="Flexibility" href="http://www.rexgoode.com/?p=356">Flexibility</a>.<em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=350</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Giant Mutant Prairie Dog From Hell</title>
		<link>http://www.rexgoode.com/?p=344</link>
		<comments>http://www.rexgoode.com/?p=344#comments</comments>
		<pubDate>Sun, 05 Jun 2011 04:18:13 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Creativity]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=344</guid>
		<description><![CDATA[I worked in a half-height cubicle. Next to me was another contractor from another company. He called my name, intending to ask me a question. As soon as I stood up, he busted out in a raucous and long laugh. It took him a few minutes to settle down.

He said, with other people gathered around, "When you stood up, you looked just like some giant mutant prairie dog from hell coming out of its hole."]]></description>
				<content:encoded><![CDATA[<div id="attachment_345" class="wp-caption alignleft" style="width: 310px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/Prairie_Dog_closeup.jpg"><img class="size-medium wp-image-345 " title="Prairie_Dog_closeup" src="http://www.rexgoode.com/wp-content/uploads/2011/06/Prairie_Dog_closeup-300x287.jpg" alt="" width="300" height="287" /></a>
<p class="wp-caption-text">Prairie Dog</p>
</div>
<p>Now, getting back to my prejudices about Easterners. In the movies,  they are often portrayed as blunt, rude, and impatient. I know that Ohio  is more mid-west, but my prejudices didn&#8217;t know the difference until I  moved there.</p>
<p>One night, before Barbara and the kids joined me, I  went to a grocery store. On the way out to my car, the very young man  helping me with my groceries carried on a conversation with me. I was  pretty stunned. I started see that everywhere I went, people actually  talked to you.<span id="more-344"></span></p>
<p>I hadn&#8217;t noticed it before about Portland, but if  you sit on a park bench and someone sits down and starts talking to you,  you usually get up and move somewhere else. In Portland, the culture  seems to be, &#8220;Speak only when you are spoken to.&#8221; That keeps everyone  pretty tight-lipped. Even when someone talks to you, it is very  superficial.</p>
<p>In the East, they may sometimes be a little blunt and  to the point, but they&#8217;re uncommonly friendly. I discovered that I  would rather have someone be rude and open with me than be closed and  suspicious. Church was the same. We fit right in and they treated like  us like old friends from the very first.</p>
<p>My job in Columbus was for a large and old food firm, you know the one, with a cow on the label. It has since went the way of all the earth. I&#8217;m speaking of Borden Foods. You may remember Elsie the Cow and her husband, Elmer, of Elmer&#8217;s Glue fame.</p>
<p>You may have noticed up until now, that I haven&#8217;t been using the company names much in this narrative. Mostly, that&#8217;s because I don&#8217;t want to ruin my chances getting a job there again. The two I have mentioned, Volt Energy Systems and Borden Foods, are gone into history.</p>
<p>My job at Borden Foods was what I always have wanted to do but don&#8217;t get enough chances to do&#8211;database administration (DBA) work. The database I supported was for an accounting system related to deals. I never knew it before I worked at Borden, but it&#8217;s not just a matter of a manufacturer selling product to grocery store chains for a price that gets marked up. There is an elaborate system of offering the products to brokers along with deals to encourage grocery chains to feature those products in conspicuous places in the stores.</p>
<p>My database was part of that system. It had an enormous throughput. I was astounded at how much food that company was producing and selling, even more astounding when I considered that they had already had one major financial crisis and were being bought by a larger conglomerate.</p>
<p>The work was fascinating, but it was the people that really made it a great place to work. Again, my biases about people of the East proved to be unfair.</p>
<p>Meetings at Borden Foods were markedly different than those I had experienced in California. They were fun, not because they didn&#8217;t get down to business. It was just that the Eastern forwardness made for wonderful connections between people.</p>
<div id="attachment_347" class="wp-caption alignright" style="width: 183px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/GGATE.jpg"><img class="size-medium wp-image-347" title="GGATE" src="http://www.rexgoode.com/wp-content/uploads/2011/06/GGATE-173x300.jpg" alt="" width="173" height="300" /></a>
<p class="wp-caption-text">Me With a Beard</p>
</div>
<p>While living there, I tried some facial hair for the first time in my life. I&#8217;m old school Mormon about things like that. Well, maybe more like middle school. Somewhere along the line, we Mormon men went from being bearded to clean-shaven to the point of it being a mark of orthodoxy of some kind. If you sport a beard, you&#8217;re not really priesthood leader material. In fact, I had been told once that they wanted me to be a Seminary teacher, but I would have to agree to remain clean shaven. That&#8217;s when I decided to grow a beard.</p>
<p>I worked in a half-height cubicle. Next to me was another contractor from another company. He called my name, intending to ask me a question. As soon as I stood up, he busted out in a raucous and long laugh. It took him a few minutes to settle down.</p>
<p>He said, with other people gathered around, &#8220;When you stood up, you looked just like some giant mutant prairie dog from hell coming out of its hole.&#8221;</p>
<p>Personally, I&#8217;ve never known this to be true, but people say that if I don&#8217;t get fed at regular intervals, I can become quite belligerent. It problem has something to do with hypoglycemia. We worked on the 16th floor.</p>
<p>This same character who dubbed me the Prairie Dog also started telling anyone new to the group that if I looked hungry, to quickly invite me to lunch. He said, &#8220;The consequences of not doing so would be that he will rip your arms off and throw you AND your arms out into the street.&#8221;</p>
<p>This legendary reaction to not eating became known as &#8220;pluck and chuck.&#8221; I pluck your arms off of your body and chuck the whole mess into the street. What else would you expect from a giant mutant prairie dog from hell? If you see me looking hungry, remember that.</p>
<p>It wasn&#8217;t just the one delightful fellow that marked the culture there. There was such a friendliness and enjoyment of each other that existed in that town, and not just at work.</p>
<p>I had been offered a full-time position. Although it didn&#8217;t make my employer, the consulting company, very happy, it was a raise in pay I very much needed. Borden Foods, as a company, was sinking fast. There were lots of rounds of layoffs within a few months of me being hired.</p>
<p>They divested an entire division and it became a new company. I was still with Borden Foods after that. Then came the news. I had exactly six months left, at which time I would be given a six-month severance package. Until then, I was also given a spending allowance to go out and get training. The company would pay for my tuition, travel, and hotel accommodations.</p>
<p>At that time, the internet was starting to really grow up. I had been on the internet since way back at Volt Energy Systems, thanks to Steve Willoughby. I was doing email before most people.</p>
<div id="attachment_348" class="wp-caption aligncenter" style="width: 355px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/sowlogo.gif"><img class="size-full wp-image-348" title="sowlogo" src="http://www.rexgoode.com/wp-content/uploads/2011/06/sowlogo.gif" alt="" width="345" height="60" /></a>
<p class="wp-caption-text">SpringsOfWater.com</p>
</div>
<p>I spent some of my training allowance on learning HTML, Perl, and MySQL. I registered my first domain name, <a href="http://www.springsofwater.com">springsofwater.com</a>, in 1999. Using Perl, HTML, and MySQL, I created my first bulletin board system and operated a couple of forums on the site using my own software. I finally had a job title that sounded like something from a medieval fantasy&#8211;the Webmaster!</p>
<p><em>To be continued in </em><a title="Now THAT Is a Mountain!" href="http://www.rexgoode.com/?p=350">Now THAT Is a Mountain!</a><em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=344</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The New Easterner</title>
		<link>http://www.rexgoode.com/?p=340</link>
		<comments>http://www.rexgoode.com/?p=340#comments</comments>
		<pubDate>Sun, 05 Jun 2011 04:15:19 +0000</pubDate>
		<dc:creator>Rex Goode</dc:creator>
				<category><![CDATA[Career]]></category>
		<category><![CDATA[Creativity]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.rexgoode.com/?p=340</guid>
		<description><![CDATA[Another weather front was coming in and my flight was cancelled. I asked for a room in a hotel until morning when they said I could flight out. They said they didn't provide hotel rooms for acts of God.  I said something like, "Well, if God were here, would you give him a hotel room?"]]></description>
				<content:encoded><![CDATA[<div id="attachment_342" class="wp-caption alignleft" style="width: 212px"><a href="http://www.rexgoode.com/wp-content/uploads/2011/06/outoftowners.jpg"><img class="size-medium wp-image-342 " title="outoftowners" src="http://www.rexgoode.com/wp-content/uploads/2011/06/outoftowners-202x300.jpg" alt="" width="202" height="300" /></a>
<p class="wp-caption-text">The Out of Towners</p>
</div>
<p>Turning down the transfer to Anchorage earned me a lay off. I was unemployed a couple of months. It didn&#8217;t look very promising to get a new job at that time. I always seem to be out of a job in the middle of recessions.<span id="more-340"></span>I expanded my job search all over the country. I got a call one day from a headhunter looking for a Sybase DBA who would be willing to relocate to New York City. The idea intrigued me, even though I was pretty certain I didn&#8217;t want to raise my family in the city so nice they named it twice. I had all of the prejudices of anyone raised in the West.</p>
<p>Yet, the salary was beyond anything I ever thought I could get. It came with an allowance to rent a flat in the city so my family could live somewhere else. I would work on the weekdays and take a train home on the weekends. It sounded pretty good. I had already done that kind of thing working in California. The headhunter practically guaranteed that if my claims on my resume were true, they had a place for me. I don&#8217;t remember why it didn&#8217;t work out. It had something to do with not being able to figure out how I would pay my rent and feed my family before the first paycheck.</p>
<p>The second opportunity was with a Great Lakes region manufacturer. I was to fly out for an interview that they would pay for. I got on the plane with my luggage and got off of the plane while my luggage landed somewhere else.</p>
<p>I made it to my hotel, wearing jeans and a t-shirt. Early the next morning, I got up as soon as the airport opened to get my luggage. I didn&#8217;t have time to wait for them to deliver it. I changed into my extremely wrinkled suit at the airport and headed to my interview.</p>
<p>Even though I explained why I looked like I had slept in my clothes, the interview didn&#8217;t seem to go very well. They just couldn&#8217;t seem to get over my appearance.</p>
<p>I left the interview feeling dejected, but didn&#8217;t really have time to mope. I had arranged another interview for another job on the east coast. I got a taxi to the airport and went to check in.</p>
<p>Another weather front was coming in and my flight was cancelled. I asked for a room in a hotel until morning when they said I could flight out. They said they didn&#8217;t provide hotel rooms for acts of God.  I said something like, &#8220;Well, if God were here, would you give him a hotel room?&#8221;</p>
<p>They did say they would get a shuttle to give me a ride to a hotel, but paying for the hotel would be my problem. I had no credit cards and very little cash. I pulled together every dollar I could find and had just enough.</p>
<p>The next morning, I flew to my other interview. It went very well. It went so well, in fact, that one of my interviewers from another branch of the company asked if I would come down to her city for an interview the next day for a job there. She would arrange for travel and accommodations. I agreed. I stayed in a grand hotel room that night and went to the airport the next morning.</p>
<p>This time, my flight was cancelled for some lame reason. I think it was something like underbooked. &#8220;But,&#8221; the ticket agent said, &#8220;you can get there if you take a taxi to the train station and a train to your destination.&#8221;</p>
<p>Of course, they weren&#8217;t going to pay for that either. I called the potential employer and they set it up. I was traveling from Philadelphia to Washington, DC. I expected a train ride through cities and farmlands. Guess what? No farmland. Only the megalopolis of the Easter seaboard.</p>
<p>Up to that point, with this East coast company, I had been smugly saying that I would have no problem living in a big city. After all, I lived in Portland, Oregon, a metropolis in its own right. No problem!</p>
<p>The interview there went very well. When it was over, my flight home was already waiting. I asked if they would call me a cab. She said, &#8220;Oh just step out into the street and raise your hand. A cab will pull up.&#8221;</p>
<p>Well, that was a totally foreign concept to me, but I tried it. Nothing.</p>
<p>I went back in and said, &#8220;The cabs are ignoring me.&#8221;</p>
<p>She motioned to one of her subordinates who went out, raised his hand, and voila! A cab pulled up.</p>
<p>I had never been in Washington, DC before, but I have a really good sense of direction. So, when the cab driver headed east, north, west, and then south, I was certain he was going in a circle. What I thought would be a twenty-minute cab ride ended up taking about an hour. I had time to run and catch my flight, just.</p>
<p>One of my favorite all-time movies is <a title="The Out of Towners" href="http://www.imdb.com/title/tt0066193/">The Out of Towners</a> starring <a href="http://www.imdb.com/name/nm0000493/">Jack Lemmon</a> and <a href="http://www.imdb.com/name/nm0006800/">Sandy Dennis</a>. I felt I had lived through it.</p>
<p>One week later, I got a phone call offering me the job just five minutes after getting another job offer in Columbus, Ohio. I had two to choose from. After the experience with the cab, I figured that Columbus was more my speed.</p>
<p><em>To be continued in </em><a href="http://www.rexgoode.com/?p=344">The Giant Mutant Prairie Dog From Hell</a><em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rexgoode.com/?feed=rss2&#038;p=340</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
