<?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>possumstew.com</title>
	<atom:link href="http://www.possumstew.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.possumstew.com</link>
	<description>Web &#38; Android Application Development • Linux Administration • SEO • Tech Blog</description>
	<lastBuildDate>Wed, 28 Mar 2012 20:50:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Add ZXing barcode scanning natively in your Android project in Eclipse</title>
		<link>http://www.possumstew.com/add-zxing-barcode-scanning-natively-in-your-android-project-in-eclipse/</link>
		<comments>http://www.possumstew.com/add-zxing-barcode-scanning-natively-in-your-android-project-in-eclipse/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:56:29 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Android Development]]></category>

		<guid isPermaLink="false">http://www.possumstew.com/?p=150</guid>
		<description><![CDATA[Barcode and QR code scanning is used in many product-related smartphone apps (shopping, inventory management, e-commerce, etc).  This tutorial will show you how you can include scanning functionality natively in your own app using the open source ZXing (Zebra Crossing) library. First off, it should be noted that it is often preferable to simply &#8220;scan<a href="http://www.possumstew.com/add-zxing-barcode-scanning-natively-in-your-android-project-in-eclipse/"> <br /><br /> (Read More...)</a>]]></description>
			<content:encoded><![CDATA[<p>Barcode and QR code scanning is used in many product-related smartphone apps (shopping, inventory management, e-commerce, etc).  This tutorial will show you how you can include scanning functionality natively in your own app using the open source ZXing (Zebra Crossing) library.</p>
<p><span id="more-150"></span>First off, it should be noted that it is often preferable to simply &#8220;scan via Intent&#8221; from your app to the ZXing &#8220;Barcode Scanner&#8221; app (available in Android Marketplace), rather than including scanning functionality natively in your app.   However there may be times when you find it necessary to integrate barcode scanning directly into your own app (ie &#8220;your client wants it&#8221;), hence this tutorial.</p>
<p>Integrating  ZXing into your own Android project boils down to 4 steps:</p>
<p><strong>1. Create an &#8220;external library&#8221; (.jar file) from the &#8220;core&#8221; folder included in the ZXing source code.  This folder contains the core code for image decoding.</strong></p>
<p><strong>2. Create an &#8220;Android library project&#8221; from the ZXing &#8220;android&#8221; folder included in the ZXing source.  This folder contains the code for the Android &#8220;Barcode Scanner&#8221; app mentioned above.</strong></p>
<p><strong>3. Include the resulting .jar file from Step 1 and the resulting library project from Step 2 into your own Android project.</strong></p>
<p><strong>4. Copy the CaptureActivity from the ZXing AndroidManifest.xml to your own project&#8217;s AndroidManifest.xml</strong></p>
<p>A step-by-step procedure is outlined below.</p>
<p>&nbsp;</p>
<p><strong>Before we begin:</strong></p>
<p>1. Download the ZXing source code from http://code.google.com/p/zxing/downloads/list and unzip it.  I like to put it right under my root directory to avoid any potential problems on Windows with a path containing a space.</p>
<p>2. Download Apache Ant from http://ant.apache.org/ (if you don&#8217;t already have it).  Ant will be used to create the .jar file from the ZXing &#8220;core&#8221; folder.</p>
<p>&nbsp;</p>
<p><strong>Step 1. Create core.jar file from the Zxing &#8220;core&#8221; folder.</strong></p>
<p>From a command prompt type &#8220;c:\PATH_TO_ANT\bin\ant -f c:\PATH_TO_ZXING\core\build.xml&#8221;.  This will create the &#8220;core.jar&#8221; file which we will include in Steps 2 &amp; 3.</p>
<p><img class="alignnone size-full wp-image-213" title="ant" src="http://www.possumstew.com/wp-content/uploads/2011/10/ant.png" alt="" width="500" height="191" /></p>
<p>&nbsp;</p>
<p><strong>Step 2. Create Android library project from ZXing &#8220;android&#8221; folder.</strong></p>
<p>1. Start Eclipse.</p>
<p>2. Create a new Android project.</p>
<p>3. Enter project name &#8220;zxing-lib&#8221; (you may name this whatever you want).</p>
<p>4. Click &#8220;Create project from existing source&#8221; radio button.</p>
<p>5. Browse  to the location of your ZXing &#8220;android&#8221; folder.</p>
<p>6. Click &#8220;Next&#8221;.</p>
<p><img class="alignnone size-full wp-image-214" title="zxing-lib-1" src="http://www.possumstew.com/wp-content/uploads/2011/10/zxing-lib-1.png" alt="" width="500" height="544" /></p>
<p>7. Select your Build Target.  I have been able to build this as far back as 1.6.</p>
<p>8. Click &#8220;Finish&#8221;.</p>
<p><img class="alignnone size-full wp-image-215" title="zxing-lib-2" src="http://www.possumstew.com/wp-content/uploads/2011/10/zxing-lib-2.png" alt="" width="500" height="545" /></p>
<p>9. In the Project Explorer right-click on the &#8220;zxing-lib&#8221; project you just created and select &#8220;Properties&#8221;.</p>
<p>10. You are now in the Properties window.  Select Java Build Path in the left pane and then select the Libraries tab.  Now click Add External Jars&#8230;.</p>
<p><img class="alignnone size-full wp-image-216" title="zxing-lib-3" src="http://www.possumstew.com/wp-content/uploads/2011/10/zxing-lib-3.png" alt="" width="500" height="378" /></p>
<p>11. You are now in the Jar Selection window.  Navigate to c:\PATH_TO_ZXING\core\core.jar and click Open.</p>
<p><img class="alignnone size-full wp-image-218" title="3-refjarsel" src="http://www.possumstew.com/wp-content/uploads/2011/10/3-refjarsel1.png" alt="" width="500" height="353" /></p>
<p>12. You are now back in the Properties window.  Select Android in the left pane and tick Is Library checkbox.</p>
<p><img class="alignnone size-full wp-image-219" title="islib" src="http://www.possumstew.com/wp-content/uploads/2011/10/islib.png" alt="" width="500" height="476" /></p>
<p>Your zxing-lib library project is now ready.</p>
<p>&nbsp;</p>
<p><strong>Step 3. Include core .jar from Step 1 and zxing-lib library project from Step 2 in your own Android project.</strong></p>
<p>1. In the Project Explorer right-click on your android project and select &#8220;Properties&#8221;.</p>
<p>2. Add the core.jar file just like you did in <strong>Step 2, Items 10 &amp; 11</strong>.</p>
<p>3. You are now back in the Properties window.  Select Android in the left pane and click the Add button under Library.</p>
<p><img class="alignnone size-full wp-image-220" title="addlib" src="http://www.possumstew.com/wp-content/uploads/2011/10/addlib.png" alt="" width="500" height="499" /></p>
<p>4. Select the zxing-lib library project you created in Step 2 and click OK.</p>
<p><img class="alignnone size-full wp-image-221" title="addlib2" src="http://www.possumstew.com/wp-content/uploads/2011/10/addlib2.png" alt="" width="396" height="435" /></p>
<p>5. You are now back in the Properties window and a reference to the zxing-lib library project you just selected is now displayed under Library.  Click OK.</p>
<p><img class="alignnone size-full wp-image-223" title="addlib3" src="http://www.possumstew.com/wp-content/uploads/2011/10/addlib3.png" alt="" width="500" height="499" /></p>
<p>Your android project now includes the necessary core.jar file and zxing-lib library project to allow you to include barcode scanning natively in your own app.</p>
<p>&nbsp;</p>
<p><strong>Step 4. Copy the CaptureActivity from the ZXing AndroidManifest.xml to your own project&#8217;s AndroidManifest.xml</strong></p>
<p>Currently when you include an android library project  into your own project the AndroidManifest.xml of the library project does not get included.   So you must copy the relevant info from the library project AndroidManaifest.xml to your own project&#8217;s AndroidManifest.xml.  In our case we copy the following:</p>
<pre>        &lt;activity android:name="com.google.zxing.client.android.CaptureActivity"
           android:screenOrientation="landscape"
           android:configChanges="orientation|keyboardHidden"
           android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
           android:windowSoftInputMode="stateAlwaysHidden"&gt;
           &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN"/&gt;
              &lt;category android:name="android.intent.category.DEFAULT"/&gt;
           &lt;/intent-filter&gt;
           &lt;intent-filter&gt;
              &lt;action android:name="com.google.zxing.client.android.SCAN"/&gt;
              &lt;category android:name="android.intent.category.DEFAULT"/&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;</pre>
<p>&nbsp;</p>
<p><strong>Okay, so I have completed Steps 1-4, but how do I use it?</strong></p>
<p>To start the scanner add the following code to your android project:</p>
<pre>        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.putExtra("SCAN_MODE", "PRODUCT_MODE");
        startActivityForResult(intent, 0);<strong></strong></pre>
<p>&nbsp;</p>
<p>To read the results of a scan add the following code:</p>
<pre>        public void onActivityResult(int requestCode, int resultCode, Intent intent) {
           if (requestCode == 0) {
              if (resultCode == RESULT_OK) {
                 String contents = intent.getStringExtra("SCAN_RESULT")
                 // Do something with scanned string
              }
           }
        }</pre>
<p>&nbsp;</p>
<p>Please note that credit should be given to Zxing in your app&#8217;s description if you choose to integrate ZXing natively into your android app.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.possumstew.com/add-zxing-barcode-scanning-natively-in-your-android-project-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Permalinks not working</title>
		<link>http://www.possumstew.com/wordpress-permalinks-not-working/</link>
		<comments>http://www.possumstew.com/wordpress-permalinks-not-working/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 02:49:29 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[permalinks]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.possumstew.com/?p=1</guid>
		<description><![CDATA[I&#8217;ve had several instances where Permalinks (SEO links) have not immediately worked on new WordPress installations, resulting in &#8220;Page Not Found&#8221; errors.  This is due to a configuration issue in the webserver (Apache, IIS, etc&#8230;).  The fix is simple but might not be obvious if you aren&#8217;t familiar with webserver configuration. First, let&#8217;s review what<a href="http://www.possumstew.com/wordpress-permalinks-not-working/"> <br /><br /> (Read More...)</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had several instances where Permalinks (SEO links) have not immediately worked on new WordPress installations, resulting in &#8220;Page Not Found&#8221; errors.  This is due to a configuration issue in the webserver (Apache, IIS, etc&#8230;).  The fix is simple but might not be obvious if you aren&#8217;t familiar with webserver configuration.</p>
<p><span id="more-1"></span></p>
<p>First, let&#8217;s review what Permalinks are.  Permalinks provide an &#8220;SEO friendly&#8221; URI  for WordPress Pages and Posts.</p>
<p>So instead of the default format URI:</p>
<pre style="padding-left: 30px;">http://www.possumstew.com/?page=2</pre>
<p>&nbsp;</p>
<p>We get the nicer:</p>
<pre style="padding-left: 30px;">http://www.possumstew.com/wordpress-permalinks-not-working/</pre>
<p>&nbsp;</p>
<p>Now let&#8217;s look at how Permalinks are configured in WordPress.  Click on &#8220;Settings&#8221; -&gt; &#8220;Permalinks&#8221; in the WordPress admin menu and you will see a page similar to this:</p>
<p><a href="http://www.possumstew.com/wp-content/uploads/2011/10/permalinks1.png"><img class="alignnone size-full wp-image-118" title="permalinks" src="http://www.possumstew.com/wp-content/uploads/2011/10/permalinks1.png" alt="" width="500" height="404" /></a></p>
<p>&nbsp;</p>
<p>Select one of the Permalink configuration options and click Save.  WordPress will attempt to add the following code to the .htaccess file located in the the root directory of your installation:</p>
<p># BEGIN WordPress<br />
&lt;IfModule mod_rewrite.c&gt;<br />
RewriteEngine On<br />
RewriteBase /<br />
RewriteRule ^index\.php$ &#8211; [L]<br />
RewriteCond %{REQUEST_FILENAME} !-f<br />
RewriteCond %{REQUEST_FILENAME} !-d<br />
RewriteRule . /index.php [L]<br />
&lt;/IfModule&gt;<br />
# END WordPress</p>
<p><span style="color: #ff0000;">*IMPORTANT!</span>  WordPress must have permission to write to the .htaccess file.  Contact your site administrator if this is not the case and you are unable to set the permission yourself.</p>
<p>If everything has gone as planned you should now be able to click on any link to your Pages or Posts and be taken the the Permalink URI.  However if your webserver is not configured correctly you may get a &#8220;Not Found&#8221; error instead.</p>
<p>They key to solving this problem is your webserver&#8217;s <strong>AllowOverride</strong> directive (Apache, IIS, etc).  <strong>AllowOverride</strong> is set in the webserver configuration file and must be located within a <strong>Directory</strong> section.  For example:</p>
<p>&lt;Directory ABSOLUTE_PATH_TO_YOUR_WORDPRESS INSTALLATION&gt;<br />
AllowOverride All<br />
&lt;/Directory&gt;</p>
<p>Save this in your webserver configuration file and restart the webserver.  Your Permalinks should now work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.possumstew.com/wordpress-permalinks-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search and replace multiple files with Perl</title>
		<link>http://www.possumstew.com/search-and-replace-multiple-files/</link>
		<comments>http://www.possumstew.com/search-and-replace-multiple-files/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 23:23:42 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Linux Systems Administration]]></category>

		<guid isPermaLink="false">http://www.possumstew.com/?p=137</guid>
		<description><![CDATA[Here is a very handy little perl command for replacing a string in multiple files in a directory: perl -pi -e 's/search/replace/g;' . If you want to replace a string in all files containing the string in subdirectories, simply add a backticked recursive grep command: perl -pi -e 's/search/replace/g;' `grep -r search .`]]></description>
			<content:encoded><![CDATA[<p>Here is a very handy little perl command for replacing a string in multiple files in a directory:</p>
<p style="padding-left: 30px;"><code>perl -pi -e 's/search/replace/g;' .</code></p>
<p style="text-align: left;">If you want to replace a string in all files containing the string in subdirectories, simply add a backticked recursive grep command:</p>
<pre style="text-align: left; padding-left: 30px;"><code>perl -pi -e 's/search/replace/g;' `grep -r search .`</code></pre>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.possumstew.com/search-and-replace-multiple-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to disable a CCK field in Drupal 6</title>
		<link>http://www.possumstew.com/how-to-disable-a-cck-field-in-drupal-6/</link>
		<comments>http://www.possumstew.com/how-to-disable-a-cck-field-in-drupal-6/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 20:14:26 +0000</pubDate>
		<dc:creator>karl</dc:creator>
				<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://www.possumstew.com/?p=237</guid>
		<description><![CDATA[CCK form elements in Drupal 6 are handled differently than standard node elements.  For instance, a standard node field has the &#8216;disabled&#8217; property: $element['#disabled'] &#160; while for a CCK field this becomes $element['#attributes']['disabled'] &#160; Therefore a CCK field requires special handling if you want to disable it.  What we need to do is create a<a href="http://www.possumstew.com/how-to-disable-a-cck-field-in-drupal-6/"> <br /><br /> (Read More...)</a>]]></description>
			<content:encoded><![CDATA[<p>CCK form elements in Drupal 6 are handled differently than standard node elements.  For instance, a standard node field has the &#8216;disabled&#8217; property:</p>
<pre style="padding-left: 60px;">$element['#disabled']</pre>
<p>&nbsp;</p>
<p>while for a CCK field this becomes</p>
<p style="padding-left: 60px;"><code>$element['#attributes']['disabled']</code></p>
<p><span id="more-237"></span></p>
<p>&nbsp;</p>
<p>Therefore a CCK field requires special handling if you want to disable it.  What we need to do is create a callback function to handle CCK elements and call it after the form is built.  Here we call the callback function &#8216;my_form_after&#8217;:</p>
<pre>        if (isset($form['type']) &amp;&amp; isset($form['#node']) {
          $form['#after_build'][] = 'my_form_after';
        }</pre>
<p>&nbsp;</p>
<p>Within our &#8216;my_form_after&#8217; callback function we call another function &#8216;my_form_disabled&#8217;  which we have created to carry out the actual disabling of  specific CCK form elements.</p>
<pre style="padding-left: 60px;">function my_form_after($form, &amp;$form_state) {
  my_form_disabled($form['field_cckfield']);
  return $form;
}</pre>
<pre style="padding-left: 60px;">function my_form_disabled(&amp;$elements) {
  foreach (element_children($elements) as $key) {
    if (isset($elements[$key]) &amp;&amp; $elements[$key]) {
      // Recurse through all children elements.
      my_form_disabled($elements[$key]);
    }
  }
  if (!isset($elements['#attributes'])) {
    $elements['#attributes'] = array();
  }
  $elements['#attributes']['disabled'] = 'disabled';
}</pre>
<p>&nbsp;</p>
<p>The code above disables a CCK field named &#8216;field_cckfield&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.possumstew.com/how-to-disable-a-cck-field-in-drupal-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

